From dd572a8fed96bd9dc4ee7836fd2f93cfd36a52f3 Mon Sep 17 00:00:00 2001 From: z7zmey Date: Mon, 18 Jun 2018 23:29:52 +0300 Subject: [PATCH 001/117] #31 dump to native golang struct --- main.go | 2 +- node/expr/assign/n_assign.go | 10 ++- node/expr/assign/n_assign_ref.go | 10 ++- node/expr/assign/n_bitwise_and.go | 10 ++- node/expr/assign/n_bitwise_or.go | 10 ++- node/expr/assign/n_bitwise_xor.go | 10 ++- node/expr/assign/n_concat.go | 10 ++- node/expr/assign/n_div.go | 10 ++- node/expr/assign/n_minus.go | 10 ++- node/expr/assign/n_mod.go | 10 ++- node/expr/assign/n_mul.go | 10 ++- node/expr/assign/n_plus.go | 10 ++- node/expr/assign/n_pow.go | 10 ++- node/expr/assign/n_shift_left.go | 10 ++- node/expr/assign/n_shift_right.go | 10 ++- node/expr/assign/t_visitor_test.go | 66 +++++++------- node/expr/binary/n_bitwise_and.go | 10 ++- node/expr/binary/n_bitwise_or.go | 10 ++- node/expr/binary/n_bitwise_xor.go | 10 ++- node/expr/binary/n_boolean_and.go | 10 ++- node/expr/binary/n_boolean_or.go | 10 ++- node/expr/binary/n_coalesce.go | 10 ++- node/expr/binary/n_concat.go | 10 ++- node/expr/binary/n_div.go | 10 ++- node/expr/binary/n_equal.go | 10 ++- node/expr/binary/n_greater.go | 10 ++- node/expr/binary/n_greater_or_equal.go | 10 ++- node/expr/binary/n_identical.go | 10 ++- node/expr/binary/n_logical_and.go | 10 ++- node/expr/binary/n_logical_or.go | 10 ++- node/expr/binary/n_logical_xor.go | 10 ++- node/expr/binary/n_minus.go | 10 ++- node/expr/binary/n_mod.go | 10 ++- node/expr/binary/n_mul.go | 10 ++- node/expr/binary/n_not_equal.go | 10 ++- node/expr/binary/n_not_identical.go | 10 ++- node/expr/binary/n_plus.go | 10 ++- node/expr/binary/n_pow.go | 10 ++- node/expr/binary/n_shift_left.go | 10 ++- node/expr/binary/n_shift_right.go | 10 ++- node/expr/binary/n_smaller.go | 10 ++- node/expr/binary/n_smaller_or_equal.go | 10 ++- node/expr/binary/n_spaceship.go | 10 ++- node/expr/binary/t_visitor_test.go | 118 +++++++++++++------------ node/expr/cast/n_cast_array.go | 5 +- node/expr/cast/n_cast_bool.go | 5 +- node/expr/cast/n_cast_double.go | 5 +- node/expr/cast/n_cast_int.go | 5 +- node/expr/cast/n_cast_object.go | 5 +- node/expr/cast/n_cast_string.go | 5 +- node/expr/cast/n_cast_unset.go | 5 +- node/expr/cast/t_visitor_test.go | 24 ++--- node/expr/n_array.go | 5 +- node/expr/n_array_dim_fetch.go | 10 ++- node/expr/n_array_item.go | 10 ++- node/expr/n_bitwise_not.go | 5 +- node/expr/n_boolean_not.go | 5 +- node/expr/n_class_const_fetch.go | 10 ++- node/expr/n_clone.go | 5 +- node/expr/n_closure.go | 20 +++-- node/expr/n_closure_use.go | 5 +- node/expr/n_const_fetch.go | 5 +- node/expr/n_die.go | 5 +- node/expr/n_empty.go | 5 +- node/expr/n_error_suppress.go | 5 +- node/expr/n_eval.go | 5 +- node/expr/n_exit.go | 5 +- node/expr/n_function_call.go | 10 ++- node/expr/n_include.go | 5 +- node/expr/n_include_once.go | 5 +- node/expr/n_instance_of.go | 10 ++- node/expr/n_isset.go | 5 +- node/expr/n_list.go | 5 +- node/expr/n_method_call.go | 15 ++-- node/expr/n_new.go | 10 ++- node/expr/n_post_dec.go | 5 +- node/expr/n_post_inc.go | 5 +- node/expr/n_pre_dec.go | 5 +- node/expr/n_pre_inc.go | 5 +- node/expr/n_print.go | 5 +- node/expr/n_property_fetch.go | 10 ++- node/expr/n_reference.go | 5 +- node/expr/n_require.go | 5 +- node/expr/n_require_once.go | 5 +- node/expr/n_shell_exec.go | 5 +- node/expr/n_short_array.go | 5 +- node/expr/n_short_list.go | 5 +- node/expr/n_static_call.go | 15 ++-- node/expr/n_static_property_fetch.go | 10 ++- node/expr/n_ternary.go | 15 ++-- node/expr/n_unary_minus.go | 5 +- node/expr/n_unary_plus.go | 5 +- node/expr/n_variable.go | 5 +- node/expr/n_yield.go | 10 ++- node/expr/n_yield_from.go | 5 +- node/expr/t_visitor_test.go | 83 ++++++++--------- node/n_argument.go | 5 +- node/n_argument_list.go | 5 +- node/n_nullable.go | 5 +- node/n_parameter.go | 15 ++-- node/n_root.go | 5 +- node/name/n_fully_qualified.go | 5 +- node/name/n_name.go | 5 +- node/name/n_relative.go | 5 +- node/name/t_visitor_test.go | 10 ++- node/scalar/node_encapsed.go | 5 +- node/scalar/node_heredoc.go | 5 +- node/scalar/t_visitor_test.go | 10 ++- node/stmt/n_alt_else.go | 5 +- node/stmt/n_alt_else_if.go | 10 ++- node/stmt/n_alt_for.go | 20 +++-- node/stmt/n_alt_foreach.go | 20 +++-- node/stmt/n_alt_if.go | 20 +++-- node/stmt/n_alt_switch.go | 10 ++- node/stmt/n_alt_while.go | 10 ++- node/stmt/n_break.go | 5 +- node/stmt/n_case.go | 10 ++- node/stmt/n_case_list.go | 5 +- node/stmt/n_catch.go | 15 ++-- node/stmt/n_class.go | 30 ++++--- node/stmt/n_class_const_list.go | 10 ++- node/stmt/n_class_extends.go | 5 +- node/stmt/n_class_implements.go | 5 +- node/stmt/n_class_method.go | 25 +++--- node/stmt/n_const_list.go | 5 +- node/stmt/n_constant.go | 10 ++- node/stmt/n_continue.go | 5 +- node/stmt/n_declare.go | 10 ++- node/stmt/n_default.go | 5 +- node/stmt/n_do.go | 10 ++- node/stmt/n_echo.go | 5 +- node/stmt/n_else.go | 5 +- node/stmt/n_else_if.go | 10 ++- node/stmt/n_expression.go | 5 +- node/stmt/n_finally.go | 5 +- node/stmt/n_for.go | 20 +++-- node/stmt/n_foreach.go | 20 +++-- node/stmt/n_function.go | 20 +++-- node/stmt/n_global.go | 5 +- node/stmt/n_goto.go | 5 +- node/stmt/n_group_use.go | 15 ++-- node/stmt/n_if.go | 20 +++-- node/stmt/n_interface.go | 15 ++-- node/stmt/n_interface_extends.go | 5 +- node/stmt/n_label.go | 5 +- node/stmt/n_namespace.go | 10 ++- node/stmt/n_property.go | 10 ++- node/stmt/n_property_list.go | 10 ++- node/stmt/n_return.go | 5 +- node/stmt/n_static.go | 5 +- node/stmt/n_static_var.go | 10 ++- node/stmt/n_stmt_list.go | 5 +- node/stmt/n_switch.go | 10 ++- node/stmt/n_throw.go | 5 +- node/stmt/n_trait.go | 10 ++- node/stmt/n_trait_adaptation_list.go | 5 +- node/stmt/n_trait_method_ref.go | 10 ++- node/stmt/n_trait_use.go | 10 ++- node/stmt/n_trait_use_alias.go | 15 ++-- node/stmt/n_trait_use_precedence.go | 10 ++- node/stmt/n_try.go | 15 ++-- node/stmt/n_unset.go | 5 +- node/stmt/n_use.go | 15 ++-- node/stmt/n_use_list.go | 10 ++- node/stmt/n_while.go | 10 ++- node/stmt/t_visitor_test.go | 12 ++- node/t_visitor_test.go | 16 ++-- visitor/dumper.go | 30 +++++-- visitor/dumper_test.go | 2 +- visitor/go_dumper.go | 93 +++++++++++++++++++ visitor/go_dumper_test.go | 111 +++++++++++++++++++++++ visitor/namespace_resolver.go | 21 +++-- walker/walker.go | 11 ++- 173 files changed, 1279 insertions(+), 735 deletions(-) create mode 100644 visitor/go_dumper.go create mode 100644 visitor/go_dumper_test.go diff --git a/main.go b/main.go index 53f9901..151d3b7 100644 --- a/main.go +++ b/main.go @@ -99,7 +99,7 @@ func printer(result <-chan parser.Parser) { nsResolver := visitor.NewNamespaceResolver() parserWorker.GetRootNode().Walk(nsResolver) - dumper := visitor.Dumper{ + dumper := &visitor.Dumper{ Writer: os.Stdout, Indent: " | ", Comments: parserWorker.GetComments(), diff --git a/node/expr/assign/n_assign.go b/node/expr/assign/n_assign.go index d94df64..65a9cb8 100644 --- a/node/expr/assign/n_assign.go +++ b/node/expr/assign/n_assign.go @@ -32,13 +32,15 @@ func (n *Assign) Walk(v walker.Visitor) { } if n.Variable != nil { - vv := v.GetChildrenVisitor("Variable") - n.Variable.Walk(vv) + v.EnterChildNode("Variable", n) + n.Variable.Walk(v) + v.LeaveChildNode("Variable", n) } if n.Expression != nil { - vv := v.GetChildrenVisitor("Expression") - n.Expression.Walk(vv) + v.EnterChildNode("Expression", n) + n.Expression.Walk(v) + v.LeaveChildNode("Expression", n) } v.LeaveNode(n) diff --git a/node/expr/assign/n_assign_ref.go b/node/expr/assign/n_assign_ref.go index 8cbd264..c6d560f 100644 --- a/node/expr/assign/n_assign_ref.go +++ b/node/expr/assign/n_assign_ref.go @@ -32,13 +32,15 @@ func (n *Reference) Walk(v walker.Visitor) { } if n.Variable != nil { - vv := v.GetChildrenVisitor("Variable") - n.Variable.Walk(vv) + v.EnterChildNode("Variable", n) + n.Variable.Walk(v) + v.LeaveChildNode("Variable", n) } if n.Expression != nil { - vv := v.GetChildrenVisitor("Expression") - n.Expression.Walk(vv) + v.EnterChildNode("Expression", n) + n.Expression.Walk(v) + v.LeaveChildNode("Expression", n) } v.LeaveNode(n) diff --git a/node/expr/assign/n_bitwise_and.go b/node/expr/assign/n_bitwise_and.go index bc112e6..ff01896 100644 --- a/node/expr/assign/n_bitwise_and.go +++ b/node/expr/assign/n_bitwise_and.go @@ -32,13 +32,15 @@ func (n *BitwiseAnd) Walk(v walker.Visitor) { } if n.Variable != nil { - vv := v.GetChildrenVisitor("Variable") - n.Variable.Walk(vv) + v.EnterChildNode("Variable", n) + n.Variable.Walk(v) + v.LeaveChildNode("Variable", n) } if n.Expression != nil { - vv := v.GetChildrenVisitor("Expression") - n.Expression.Walk(vv) + v.EnterChildNode("Expression", n) + n.Expression.Walk(v) + v.LeaveChildNode("Expression", n) } v.LeaveNode(n) diff --git a/node/expr/assign/n_bitwise_or.go b/node/expr/assign/n_bitwise_or.go index b8ae059..2832633 100644 --- a/node/expr/assign/n_bitwise_or.go +++ b/node/expr/assign/n_bitwise_or.go @@ -32,13 +32,15 @@ func (n *BitwiseOr) Walk(v walker.Visitor) { } if n.Variable != nil { - vv := v.GetChildrenVisitor("Variable") - n.Variable.Walk(vv) + v.EnterChildNode("Variable", n) + n.Variable.Walk(v) + v.LeaveChildNode("Variable", n) } if n.Expression != nil { - vv := v.GetChildrenVisitor("Expression") - n.Expression.Walk(vv) + v.EnterChildNode("Expression", n) + n.Expression.Walk(v) + v.LeaveChildNode("Expression", n) } v.LeaveNode(n) diff --git a/node/expr/assign/n_bitwise_xor.go b/node/expr/assign/n_bitwise_xor.go index 905158b..ad22009 100644 --- a/node/expr/assign/n_bitwise_xor.go +++ b/node/expr/assign/n_bitwise_xor.go @@ -32,13 +32,15 @@ func (n *BitwiseXor) Walk(v walker.Visitor) { } if n.Variable != nil { - vv := v.GetChildrenVisitor("Variable") - n.Variable.Walk(vv) + v.EnterChildNode("Variable", n) + n.Variable.Walk(v) + v.LeaveChildNode("Variable", n) } if n.Expression != nil { - vv := v.GetChildrenVisitor("Expression") - n.Expression.Walk(vv) + v.EnterChildNode("Expression", n) + n.Expression.Walk(v) + v.LeaveChildNode("Expression", n) } v.LeaveNode(n) diff --git a/node/expr/assign/n_concat.go b/node/expr/assign/n_concat.go index a43e3a1..66c08fc 100644 --- a/node/expr/assign/n_concat.go +++ b/node/expr/assign/n_concat.go @@ -32,13 +32,15 @@ func (n *Concat) Walk(v walker.Visitor) { } if n.Variable != nil { - vv := v.GetChildrenVisitor("Variable") - n.Variable.Walk(vv) + v.EnterChildNode("Variable", n) + n.Variable.Walk(v) + v.LeaveChildNode("Variable", n) } if n.Expression != nil { - vv := v.GetChildrenVisitor("Expression") - n.Expression.Walk(vv) + v.EnterChildNode("Expression", n) + n.Expression.Walk(v) + v.LeaveChildNode("Expression", n) } v.LeaveNode(n) diff --git a/node/expr/assign/n_div.go b/node/expr/assign/n_div.go index 05bc2ed..9d70e82 100644 --- a/node/expr/assign/n_div.go +++ b/node/expr/assign/n_div.go @@ -32,13 +32,15 @@ func (n *Div) Walk(v walker.Visitor) { } if n.Variable != nil { - vv := v.GetChildrenVisitor("Variable") - n.Variable.Walk(vv) + v.EnterChildNode("Variable", n) + n.Variable.Walk(v) + v.LeaveChildNode("Variable", n) } if n.Expression != nil { - vv := v.GetChildrenVisitor("Expression") - n.Expression.Walk(vv) + v.EnterChildNode("Expression", n) + n.Expression.Walk(v) + v.LeaveChildNode("Expression", n) } v.LeaveNode(n) diff --git a/node/expr/assign/n_minus.go b/node/expr/assign/n_minus.go index c66b1d2..191e6fa 100644 --- a/node/expr/assign/n_minus.go +++ b/node/expr/assign/n_minus.go @@ -32,13 +32,15 @@ func (n *Minus) Walk(v walker.Visitor) { } if n.Variable != nil { - vv := v.GetChildrenVisitor("Variable") - n.Variable.Walk(vv) + v.EnterChildNode("Variable", n) + n.Variable.Walk(v) + v.LeaveChildNode("Variable", n) } if n.Expression != nil { - vv := v.GetChildrenVisitor("Expression") - n.Expression.Walk(vv) + v.EnterChildNode("Expression", n) + n.Expression.Walk(v) + v.LeaveChildNode("Expression", n) } v.LeaveNode(n) diff --git a/node/expr/assign/n_mod.go b/node/expr/assign/n_mod.go index 6e394c5..b35dd22 100644 --- a/node/expr/assign/n_mod.go +++ b/node/expr/assign/n_mod.go @@ -32,13 +32,15 @@ func (n *Mod) Walk(v walker.Visitor) { } if n.Variable != nil { - vv := v.GetChildrenVisitor("Variable") - n.Variable.Walk(vv) + v.EnterChildNode("Variable", n) + n.Variable.Walk(v) + v.LeaveChildNode("Variable", n) } if n.Expression != nil { - vv := v.GetChildrenVisitor("Expression") - n.Expression.Walk(vv) + v.EnterChildNode("Expression", n) + n.Expression.Walk(v) + v.LeaveChildNode("Expression", n) } v.LeaveNode(n) diff --git a/node/expr/assign/n_mul.go b/node/expr/assign/n_mul.go index 3dc8090..d241a4d 100644 --- a/node/expr/assign/n_mul.go +++ b/node/expr/assign/n_mul.go @@ -32,13 +32,15 @@ func (n *Mul) Walk(v walker.Visitor) { } if n.Variable != nil { - vv := v.GetChildrenVisitor("Variable") - n.Variable.Walk(vv) + v.EnterChildNode("Variable", n) + n.Variable.Walk(v) + v.LeaveChildNode("Variable", n) } if n.Expression != nil { - vv := v.GetChildrenVisitor("Expression") - n.Expression.Walk(vv) + v.EnterChildNode("Expression", n) + n.Expression.Walk(v) + v.LeaveChildNode("Expression", n) } v.LeaveNode(n) diff --git a/node/expr/assign/n_plus.go b/node/expr/assign/n_plus.go index d5cc425..d010c54 100644 --- a/node/expr/assign/n_plus.go +++ b/node/expr/assign/n_plus.go @@ -32,13 +32,15 @@ func (n *Plus) Walk(v walker.Visitor) { } if n.Variable != nil { - vv := v.GetChildrenVisitor("Variable") - n.Variable.Walk(vv) + v.EnterChildNode("Variable", n) + n.Variable.Walk(v) + v.LeaveChildNode("Variable", n) } if n.Expression != nil { - vv := v.GetChildrenVisitor("Expression") - n.Expression.Walk(vv) + v.EnterChildNode("Expression", n) + n.Expression.Walk(v) + v.LeaveChildNode("Expression", n) } v.LeaveNode(n) diff --git a/node/expr/assign/n_pow.go b/node/expr/assign/n_pow.go index a81cb0c..8623887 100644 --- a/node/expr/assign/n_pow.go +++ b/node/expr/assign/n_pow.go @@ -32,13 +32,15 @@ func (n *Pow) Walk(v walker.Visitor) { } if n.Variable != nil { - vv := v.GetChildrenVisitor("Variable") - n.Variable.Walk(vv) + v.EnterChildNode("Variable", n) + n.Variable.Walk(v) + v.LeaveChildNode("Variable", n) } if n.Expression != nil { - vv := v.GetChildrenVisitor("Expression") - n.Expression.Walk(vv) + v.EnterChildNode("Expression", n) + n.Expression.Walk(v) + v.LeaveChildNode("Expression", n) } v.LeaveNode(n) diff --git a/node/expr/assign/n_shift_left.go b/node/expr/assign/n_shift_left.go index 6b52663..49f3fc5 100644 --- a/node/expr/assign/n_shift_left.go +++ b/node/expr/assign/n_shift_left.go @@ -32,13 +32,15 @@ func (n *ShiftLeft) Walk(v walker.Visitor) { } if n.Variable != nil { - vv := v.GetChildrenVisitor("Variable") - n.Variable.Walk(vv) + v.EnterChildNode("Variable", n) + n.Variable.Walk(v) + v.LeaveChildNode("Variable", n) } if n.Expression != nil { - vv := v.GetChildrenVisitor("Expression") - n.Expression.Walk(vv) + v.EnterChildNode("Expression", n) + n.Expression.Walk(v) + v.LeaveChildNode("Expression", n) } v.LeaveNode(n) diff --git a/node/expr/assign/n_shift_right.go b/node/expr/assign/n_shift_right.go index 126b801..b07ff30 100644 --- a/node/expr/assign/n_shift_right.go +++ b/node/expr/assign/n_shift_right.go @@ -32,13 +32,15 @@ func (n *ShiftRight) Walk(v walker.Visitor) { } if n.Variable != nil { - vv := v.GetChildrenVisitor("Variable") - n.Variable.Walk(vv) + v.EnterChildNode("Variable", n) + n.Variable.Walk(v) + v.LeaveChildNode("Variable", n) } if n.Expression != nil { - vv := v.GetChildrenVisitor("Expression") - n.Expression.Walk(vv) + v.EnterChildNode("Expression", n) + n.Expression.Walk(v) + v.LeaveChildNode("Expression", n) } v.LeaveNode(n) diff --git a/node/expr/assign/t_visitor_test.go b/node/expr/assign/t_visitor_test.go index 643d158..3b65670 100644 --- a/node/expr/assign/t_visitor_test.go +++ b/node/expr/assign/t_visitor_test.go @@ -20,112 +20,112 @@ var nodesToTest = []struct { }{ { &assign.Reference{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expression: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Variable: &expr.Variable{}, + Expression: &expr.Variable{}, }, []string{"Variable", "Expression"}, map[string]interface{}{}, }, { &assign.Assign{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expression: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Variable: &expr.Variable{}, + Expression: &expr.Variable{}, }, []string{"Variable", "Expression"}, map[string]interface{}{}, }, { &assign.BitwiseAnd{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expression: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Variable: &expr.Variable{}, + Expression: &expr.Variable{}, }, []string{"Variable", "Expression"}, map[string]interface{}{}, }, { &assign.BitwiseOr{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expression: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Variable: &expr.Variable{}, + Expression: &expr.Variable{}, }, []string{"Variable", "Expression"}, map[string]interface{}{}, }, { &assign.BitwiseXor{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expression: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Variable: &expr.Variable{}, + Expression: &expr.Variable{}, }, []string{"Variable", "Expression"}, map[string]interface{}{}, }, { &assign.Concat{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expression: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Variable: &expr.Variable{}, + Expression: &expr.Variable{}, }, []string{"Variable", "Expression"}, map[string]interface{}{}, }, { &assign.Div{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expression: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Variable: &expr.Variable{}, + Expression: &expr.Variable{}, }, []string{"Variable", "Expression"}, map[string]interface{}{}, }, { &assign.Minus{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expression: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Variable: &expr.Variable{}, + Expression: &expr.Variable{}, }, []string{"Variable", "Expression"}, map[string]interface{}{}, }, { &assign.Mod{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expression: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Variable: &expr.Variable{}, + Expression: &expr.Variable{}, }, []string{"Variable", "Expression"}, map[string]interface{}{}, }, { &assign.Mul{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expression: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Variable: &expr.Variable{}, + Expression: &expr.Variable{}, }, []string{"Variable", "Expression"}, map[string]interface{}{}, }, { &assign.Plus{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expression: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Variable: &expr.Variable{}, + Expression: &expr.Variable{}, }, []string{"Variable", "Expression"}, map[string]interface{}{}, }, { &assign.Pow{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expression: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Variable: &expr.Variable{}, + Expression: &expr.Variable{}, }, []string{"Variable", "Expression"}, map[string]interface{}{}, }, { &assign.ShiftLeft{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expression: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Variable: &expr.Variable{}, + Expression: &expr.Variable{}, }, []string{"Variable", "Expression"}, map[string]interface{}{}, }, { &assign.ShiftRight{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expression: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Variable: &expr.Variable{}, + Expression: &expr.Variable{}, }, []string{"Variable", "Expression"}, map[string]interface{}{}, @@ -138,11 +138,15 @@ type visitorMock struct { } func (v *visitorMock) EnterNode(n walker.Walkable) bool { return v.visitChildren } -func (v *visitorMock) GetChildrenVisitor(key string) walker.Visitor { +func (v *visitorMock) LeaveNode(n walker.Walkable) {} +func (v *visitorMock) EnterChildNode(key string, w walker.Walkable) { v.visitedKeys = append(v.visitedKeys, key) - return &visitorMock{v.visitChildren, nil} } -func (v *visitorMock) LeaveNode(n walker.Walkable) {} +func (v *visitorMock) LeaveChildNode(key string, w walker.Walkable) {} +func (v *visitorMock) EnterChildList(key string, w walker.Walkable) { + v.visitedKeys = append(v.visitedKeys, key) +} +func (v *visitorMock) LeaveChildList(key string, w walker.Walkable) {} func TestVisitorDisableChildren(t *testing.T) { for _, tt := range nodesToTest { diff --git a/node/expr/binary/n_bitwise_and.go b/node/expr/binary/n_bitwise_and.go index 842398d..5b24ccb 100644 --- a/node/expr/binary/n_bitwise_and.go +++ b/node/expr/binary/n_bitwise_and.go @@ -32,13 +32,15 @@ func (n *BitwiseAnd) Walk(v walker.Visitor) { } if n.Left != nil { - vv := v.GetChildrenVisitor("Left") - n.Left.Walk(vv) + v.EnterChildNode("Left", n) + n.Left.Walk(v) + v.LeaveChildNode("Left", n) } if n.Right != nil { - vv := v.GetChildrenVisitor("Right") - n.Right.Walk(vv) + v.EnterChildNode("Right", n) + n.Right.Walk(v) + v.LeaveChildNode("Right", n) } v.LeaveNode(n) diff --git a/node/expr/binary/n_bitwise_or.go b/node/expr/binary/n_bitwise_or.go index 2d257b5..0637ecb 100644 --- a/node/expr/binary/n_bitwise_or.go +++ b/node/expr/binary/n_bitwise_or.go @@ -32,13 +32,15 @@ func (n *BitwiseOr) Walk(v walker.Visitor) { } if n.Left != nil { - vv := v.GetChildrenVisitor("Left") - n.Left.Walk(vv) + v.EnterChildNode("Left", n) + n.Left.Walk(v) + v.LeaveChildNode("Left", n) } if n.Right != nil { - vv := v.GetChildrenVisitor("Right") - n.Right.Walk(vv) + v.EnterChildNode("Right", n) + n.Right.Walk(v) + v.LeaveChildNode("Right", n) } v.LeaveNode(n) diff --git a/node/expr/binary/n_bitwise_xor.go b/node/expr/binary/n_bitwise_xor.go index c67fe00..f675345 100644 --- a/node/expr/binary/n_bitwise_xor.go +++ b/node/expr/binary/n_bitwise_xor.go @@ -32,13 +32,15 @@ func (n *BitwiseXor) Walk(v walker.Visitor) { } if n.Left != nil { - vv := v.GetChildrenVisitor("Left") - n.Left.Walk(vv) + v.EnterChildNode("Left", n) + n.Left.Walk(v) + v.LeaveChildNode("Left", n) } if n.Right != nil { - vv := v.GetChildrenVisitor("Right") - n.Right.Walk(vv) + v.EnterChildNode("Right", n) + n.Right.Walk(v) + v.LeaveChildNode("Right", n) } v.LeaveNode(n) diff --git a/node/expr/binary/n_boolean_and.go b/node/expr/binary/n_boolean_and.go index e7ca96b..b0a5bae 100644 --- a/node/expr/binary/n_boolean_and.go +++ b/node/expr/binary/n_boolean_and.go @@ -32,13 +32,15 @@ func (n *BooleanAnd) Walk(v walker.Visitor) { } if n.Left != nil { - vv := v.GetChildrenVisitor("Left") - n.Left.Walk(vv) + v.EnterChildNode("Left", n) + n.Left.Walk(v) + v.LeaveChildNode("Left", n) } if n.Right != nil { - vv := v.GetChildrenVisitor("Right") - n.Right.Walk(vv) + v.EnterChildNode("Right", n) + n.Right.Walk(v) + v.LeaveChildNode("Right", n) } v.LeaveNode(n) diff --git a/node/expr/binary/n_boolean_or.go b/node/expr/binary/n_boolean_or.go index bb92e0a..b522baa 100644 --- a/node/expr/binary/n_boolean_or.go +++ b/node/expr/binary/n_boolean_or.go @@ -32,13 +32,15 @@ func (n *BooleanOr) Walk(v walker.Visitor) { } if n.Left != nil { - vv := v.GetChildrenVisitor("Left") - n.Left.Walk(vv) + v.EnterChildNode("Left", n) + n.Left.Walk(v) + v.LeaveChildNode("Left", n) } if n.Right != nil { - vv := v.GetChildrenVisitor("Right") - n.Right.Walk(vv) + v.EnterChildNode("Right", n) + n.Right.Walk(v) + v.LeaveChildNode("Right", n) } v.LeaveNode(n) diff --git a/node/expr/binary/n_coalesce.go b/node/expr/binary/n_coalesce.go index b0eb6f5..8339fdc 100644 --- a/node/expr/binary/n_coalesce.go +++ b/node/expr/binary/n_coalesce.go @@ -32,13 +32,15 @@ func (n *Coalesce) Walk(v walker.Visitor) { } if n.Left != nil { - vv := v.GetChildrenVisitor("Left") - n.Left.Walk(vv) + v.EnterChildNode("Left", n) + n.Left.Walk(v) + v.LeaveChildNode("Left", n) } if n.Right != nil { - vv := v.GetChildrenVisitor("Right") - n.Right.Walk(vv) + v.EnterChildNode("Right", n) + n.Right.Walk(v) + v.LeaveChildNode("Right", n) } v.LeaveNode(n) diff --git a/node/expr/binary/n_concat.go b/node/expr/binary/n_concat.go index 3a74a4d..a5953c1 100644 --- a/node/expr/binary/n_concat.go +++ b/node/expr/binary/n_concat.go @@ -32,13 +32,15 @@ func (n *Concat) Walk(v walker.Visitor) { } if n.Left != nil { - vv := v.GetChildrenVisitor("Left") - n.Left.Walk(vv) + v.EnterChildNode("Left", n) + n.Left.Walk(v) + v.LeaveChildNode("Left", n) } if n.Right != nil { - vv := v.GetChildrenVisitor("Right") - n.Right.Walk(vv) + v.EnterChildNode("Right", n) + n.Right.Walk(v) + v.LeaveChildNode("Right", n) } v.LeaveNode(n) diff --git a/node/expr/binary/n_div.go b/node/expr/binary/n_div.go index aa68b9a..d3f7a86 100644 --- a/node/expr/binary/n_div.go +++ b/node/expr/binary/n_div.go @@ -32,13 +32,15 @@ func (n *Div) Walk(v walker.Visitor) { } if n.Left != nil { - vv := v.GetChildrenVisitor("Left") - n.Left.Walk(vv) + v.EnterChildNode("Left", n) + n.Left.Walk(v) + v.LeaveChildNode("Left", n) } if n.Right != nil { - vv := v.GetChildrenVisitor("Right") - n.Right.Walk(vv) + v.EnterChildNode("Right", n) + n.Right.Walk(v) + v.LeaveChildNode("Right", n) } v.LeaveNode(n) diff --git a/node/expr/binary/n_equal.go b/node/expr/binary/n_equal.go index c02b1ec..b266679 100644 --- a/node/expr/binary/n_equal.go +++ b/node/expr/binary/n_equal.go @@ -32,13 +32,15 @@ func (n *Equal) Walk(v walker.Visitor) { } if n.Left != nil { - vv := v.GetChildrenVisitor("Left") - n.Left.Walk(vv) + v.EnterChildNode("Left", n) + n.Left.Walk(v) + v.LeaveChildNode("Left", n) } if n.Right != nil { - vv := v.GetChildrenVisitor("Right") - n.Right.Walk(vv) + v.EnterChildNode("Right", n) + n.Right.Walk(v) + v.LeaveChildNode("Right", n) } v.LeaveNode(n) diff --git a/node/expr/binary/n_greater.go b/node/expr/binary/n_greater.go index daab173..58f24fe 100644 --- a/node/expr/binary/n_greater.go +++ b/node/expr/binary/n_greater.go @@ -32,13 +32,15 @@ func (n *Greater) Walk(v walker.Visitor) { } if n.Left != nil { - vv := v.GetChildrenVisitor("Left") - n.Left.Walk(vv) + v.EnterChildNode("Left", n) + n.Left.Walk(v) + v.LeaveChildNode("Left", n) } if n.Right != nil { - vv := v.GetChildrenVisitor("Right") - n.Right.Walk(vv) + v.EnterChildNode("Right", n) + n.Right.Walk(v) + v.LeaveChildNode("Right", n) } v.LeaveNode(n) diff --git a/node/expr/binary/n_greater_or_equal.go b/node/expr/binary/n_greater_or_equal.go index 47f1df2..921b84a 100644 --- a/node/expr/binary/n_greater_or_equal.go +++ b/node/expr/binary/n_greater_or_equal.go @@ -32,13 +32,15 @@ func (n *GreaterOrEqual) Walk(v walker.Visitor) { } if n.Left != nil { - vv := v.GetChildrenVisitor("Left") - n.Left.Walk(vv) + v.EnterChildNode("Left", n) + n.Left.Walk(v) + v.LeaveChildNode("Left", n) } if n.Right != nil { - vv := v.GetChildrenVisitor("Right") - n.Right.Walk(vv) + v.EnterChildNode("Right", n) + n.Right.Walk(v) + v.LeaveChildNode("Right", n) } v.LeaveNode(n) diff --git a/node/expr/binary/n_identical.go b/node/expr/binary/n_identical.go index 6a782e0..06c1947 100644 --- a/node/expr/binary/n_identical.go +++ b/node/expr/binary/n_identical.go @@ -32,13 +32,15 @@ func (n *Identical) Walk(v walker.Visitor) { } if n.Left != nil { - vv := v.GetChildrenVisitor("Left") - n.Left.Walk(vv) + v.EnterChildNode("Left", n) + n.Left.Walk(v) + v.LeaveChildNode("Left", n) } if n.Right != nil { - vv := v.GetChildrenVisitor("Right") - n.Right.Walk(vv) + v.EnterChildNode("Right", n) + n.Right.Walk(v) + v.LeaveChildNode("Right", n) } v.LeaveNode(n) diff --git a/node/expr/binary/n_logical_and.go b/node/expr/binary/n_logical_and.go index b2d35b6..7015a74 100644 --- a/node/expr/binary/n_logical_and.go +++ b/node/expr/binary/n_logical_and.go @@ -32,13 +32,15 @@ func (n *LogicalAnd) Walk(v walker.Visitor) { } if n.Left != nil { - vv := v.GetChildrenVisitor("Left") - n.Left.Walk(vv) + v.EnterChildNode("Left", n) + n.Left.Walk(v) + v.LeaveChildNode("Left", n) } if n.Right != nil { - vv := v.GetChildrenVisitor("Right") - n.Right.Walk(vv) + v.EnterChildNode("Right", n) + n.Right.Walk(v) + v.LeaveChildNode("Right", n) } v.LeaveNode(n) diff --git a/node/expr/binary/n_logical_or.go b/node/expr/binary/n_logical_or.go index 5e7d88e..05dff50 100644 --- a/node/expr/binary/n_logical_or.go +++ b/node/expr/binary/n_logical_or.go @@ -32,13 +32,15 @@ func (n *LogicalOr) Walk(v walker.Visitor) { } if n.Left != nil { - vv := v.GetChildrenVisitor("Left") - n.Left.Walk(vv) + v.EnterChildNode("Left", n) + n.Left.Walk(v) + v.LeaveChildNode("Left", n) } if n.Right != nil { - vv := v.GetChildrenVisitor("Right") - n.Right.Walk(vv) + v.EnterChildNode("Right", n) + n.Right.Walk(v) + v.LeaveChildNode("Right", n) } v.LeaveNode(n) diff --git a/node/expr/binary/n_logical_xor.go b/node/expr/binary/n_logical_xor.go index 043e0a3..91e8408 100644 --- a/node/expr/binary/n_logical_xor.go +++ b/node/expr/binary/n_logical_xor.go @@ -32,13 +32,15 @@ func (n *LogicalXor) Walk(v walker.Visitor) { } if n.Left != nil { - vv := v.GetChildrenVisitor("Left") - n.Left.Walk(vv) + v.EnterChildNode("Left", n) + n.Left.Walk(v) + v.LeaveChildNode("Left", n) } if n.Right != nil { - vv := v.GetChildrenVisitor("Right") - n.Right.Walk(vv) + v.EnterChildNode("Right", n) + n.Right.Walk(v) + v.LeaveChildNode("Right", n) } v.LeaveNode(n) diff --git a/node/expr/binary/n_minus.go b/node/expr/binary/n_minus.go index 397fa68..6e42de6 100644 --- a/node/expr/binary/n_minus.go +++ b/node/expr/binary/n_minus.go @@ -32,13 +32,15 @@ func (n *Minus) Walk(v walker.Visitor) { } if n.Left != nil { - vv := v.GetChildrenVisitor("Left") - n.Left.Walk(vv) + v.EnterChildNode("Left", n) + n.Left.Walk(v) + v.LeaveChildNode("Left", n) } if n.Right != nil { - vv := v.GetChildrenVisitor("Right") - n.Right.Walk(vv) + v.EnterChildNode("Right", n) + n.Right.Walk(v) + v.LeaveChildNode("Right", n) } v.LeaveNode(n) diff --git a/node/expr/binary/n_mod.go b/node/expr/binary/n_mod.go index 30809e3..759737a 100644 --- a/node/expr/binary/n_mod.go +++ b/node/expr/binary/n_mod.go @@ -32,13 +32,15 @@ func (n *Mod) Walk(v walker.Visitor) { } if n.Left != nil { - vv := v.GetChildrenVisitor("Left") - n.Left.Walk(vv) + v.EnterChildNode("Left", n) + n.Left.Walk(v) + v.LeaveChildNode("Left", n) } if n.Right != nil { - vv := v.GetChildrenVisitor("Right") - n.Right.Walk(vv) + v.EnterChildNode("Right", n) + n.Right.Walk(v) + v.LeaveChildNode("Right", n) } v.LeaveNode(n) diff --git a/node/expr/binary/n_mul.go b/node/expr/binary/n_mul.go index c601bfd..c37d1c8 100644 --- a/node/expr/binary/n_mul.go +++ b/node/expr/binary/n_mul.go @@ -32,13 +32,15 @@ func (n *Mul) Walk(v walker.Visitor) { } if n.Left != nil { - vv := v.GetChildrenVisitor("Left") - n.Left.Walk(vv) + v.EnterChildNode("Left", n) + n.Left.Walk(v) + v.LeaveChildNode("Left", n) } if n.Right != nil { - vv := v.GetChildrenVisitor("Right") - n.Right.Walk(vv) + v.EnterChildNode("Right", n) + n.Right.Walk(v) + v.LeaveChildNode("Right", n) } v.LeaveNode(n) diff --git a/node/expr/binary/n_not_equal.go b/node/expr/binary/n_not_equal.go index e63cfcd..4cc6a89 100644 --- a/node/expr/binary/n_not_equal.go +++ b/node/expr/binary/n_not_equal.go @@ -32,13 +32,15 @@ func (n *NotEqual) Walk(v walker.Visitor) { } if n.Left != nil { - vv := v.GetChildrenVisitor("Left") - n.Left.Walk(vv) + v.EnterChildNode("Left", n) + n.Left.Walk(v) + v.LeaveChildNode("Left", n) } if n.Right != nil { - vv := v.GetChildrenVisitor("Right") - n.Right.Walk(vv) + v.EnterChildNode("Right", n) + n.Right.Walk(v) + v.LeaveChildNode("Right", n) } v.LeaveNode(n) diff --git a/node/expr/binary/n_not_identical.go b/node/expr/binary/n_not_identical.go index 4f8f13e..172d56d 100644 --- a/node/expr/binary/n_not_identical.go +++ b/node/expr/binary/n_not_identical.go @@ -32,13 +32,15 @@ func (n *NotIdentical) Walk(v walker.Visitor) { } if n.Left != nil { - vv := v.GetChildrenVisitor("Left") - n.Left.Walk(vv) + v.EnterChildNode("Left", n) + n.Left.Walk(v) + v.LeaveChildNode("Left", n) } if n.Right != nil { - vv := v.GetChildrenVisitor("Right") - n.Right.Walk(vv) + v.EnterChildNode("Right", n) + n.Right.Walk(v) + v.LeaveChildNode("Right", n) } v.LeaveNode(n) diff --git a/node/expr/binary/n_plus.go b/node/expr/binary/n_plus.go index 5d68c46..1e18553 100644 --- a/node/expr/binary/n_plus.go +++ b/node/expr/binary/n_plus.go @@ -32,13 +32,15 @@ func (n *Plus) Walk(v walker.Visitor) { } if n.Left != nil { - vv := v.GetChildrenVisitor("Left") - n.Left.Walk(vv) + v.EnterChildNode("Left", n) + n.Left.Walk(v) + v.LeaveChildNode("Left", n) } if n.Right != nil { - vv := v.GetChildrenVisitor("Right") - n.Right.Walk(vv) + v.EnterChildNode("Right", n) + n.Right.Walk(v) + v.LeaveChildNode("Right", n) } v.LeaveNode(n) diff --git a/node/expr/binary/n_pow.go b/node/expr/binary/n_pow.go index a21e115..ee3d6da 100644 --- a/node/expr/binary/n_pow.go +++ b/node/expr/binary/n_pow.go @@ -32,13 +32,15 @@ func (n *Pow) Walk(v walker.Visitor) { } if n.Left != nil { - vv := v.GetChildrenVisitor("Left") - n.Left.Walk(vv) + v.EnterChildNode("Left", n) + n.Left.Walk(v) + v.LeaveChildNode("Left", n) } if n.Right != nil { - vv := v.GetChildrenVisitor("Right") - n.Right.Walk(vv) + v.EnterChildNode("Right", n) + n.Right.Walk(v) + v.LeaveChildNode("Right", n) } v.LeaveNode(n) diff --git a/node/expr/binary/n_shift_left.go b/node/expr/binary/n_shift_left.go index 2b1dec0..c1ed698 100644 --- a/node/expr/binary/n_shift_left.go +++ b/node/expr/binary/n_shift_left.go @@ -32,13 +32,15 @@ func (n *ShiftLeft) Walk(v walker.Visitor) { } if n.Left != nil { - vv := v.GetChildrenVisitor("Left") - n.Left.Walk(vv) + v.EnterChildNode("Left", n) + n.Left.Walk(v) + v.LeaveChildNode("Left", n) } if n.Right != nil { - vv := v.GetChildrenVisitor("Right") - n.Right.Walk(vv) + v.EnterChildNode("Right", n) + n.Right.Walk(v) + v.LeaveChildNode("Right", n) } v.LeaveNode(n) diff --git a/node/expr/binary/n_shift_right.go b/node/expr/binary/n_shift_right.go index 44911cb..f522721 100644 --- a/node/expr/binary/n_shift_right.go +++ b/node/expr/binary/n_shift_right.go @@ -32,13 +32,15 @@ func (n *ShiftRight) Walk(v walker.Visitor) { } if n.Left != nil { - vv := v.GetChildrenVisitor("Left") - n.Left.Walk(vv) + v.EnterChildNode("Left", n) + n.Left.Walk(v) + v.LeaveChildNode("Left", n) } if n.Right != nil { - vv := v.GetChildrenVisitor("Right") - n.Right.Walk(vv) + v.EnterChildNode("Right", n) + n.Right.Walk(v) + v.LeaveChildNode("Right", n) } v.LeaveNode(n) diff --git a/node/expr/binary/n_smaller.go b/node/expr/binary/n_smaller.go index 1622871..eff9eed 100644 --- a/node/expr/binary/n_smaller.go +++ b/node/expr/binary/n_smaller.go @@ -32,13 +32,15 @@ func (n *Smaller) Walk(v walker.Visitor) { } if n.Left != nil { - vv := v.GetChildrenVisitor("Left") - n.Left.Walk(vv) + v.EnterChildNode("Left", n) + n.Left.Walk(v) + v.LeaveChildNode("Left", n) } if n.Right != nil { - vv := v.GetChildrenVisitor("Right") - n.Right.Walk(vv) + v.EnterChildNode("Right", n) + n.Right.Walk(v) + v.LeaveChildNode("Right", n) } v.LeaveNode(n) diff --git a/node/expr/binary/n_smaller_or_equal.go b/node/expr/binary/n_smaller_or_equal.go index 9a839d8..38c4432 100644 --- a/node/expr/binary/n_smaller_or_equal.go +++ b/node/expr/binary/n_smaller_or_equal.go @@ -32,13 +32,15 @@ func (n *SmallerOrEqual) Walk(v walker.Visitor) { } if n.Left != nil { - vv := v.GetChildrenVisitor("Left") - n.Left.Walk(vv) + v.EnterChildNode("Left", n) + n.Left.Walk(v) + v.LeaveChildNode("Left", n) } if n.Right != nil { - vv := v.GetChildrenVisitor("Right") - n.Right.Walk(vv) + v.EnterChildNode("Right", n) + n.Right.Walk(v) + v.LeaveChildNode("Right", n) } v.LeaveNode(n) diff --git a/node/expr/binary/n_spaceship.go b/node/expr/binary/n_spaceship.go index ea05c77..5d307ef 100644 --- a/node/expr/binary/n_spaceship.go +++ b/node/expr/binary/n_spaceship.go @@ -32,13 +32,15 @@ func (n *Spaceship) Walk(v walker.Visitor) { } if n.Left != nil { - vv := v.GetChildrenVisitor("Left") - n.Left.Walk(vv) + v.EnterChildNode("Left", n) + n.Left.Walk(v) + v.LeaveChildNode("Left", n) } if n.Right != nil { - vv := v.GetChildrenVisitor("Right") - n.Right.Walk(vv) + v.EnterChildNode("Right", n) + n.Right.Walk(v) + v.LeaveChildNode("Right", n) } v.LeaveNode(n) diff --git a/node/expr/binary/t_visitor_test.go b/node/expr/binary/t_visitor_test.go index 868bddf..a875cc5 100644 --- a/node/expr/binary/t_visitor_test.go +++ b/node/expr/binary/t_visitor_test.go @@ -19,216 +19,216 @@ var nodesToTest = []struct { }{ { &binary.BitwiseAnd{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Left: &expr.Variable{}, + Right: &expr.Variable{}, }, []string{"Left", "Right"}, map[string]interface{}{}, }, { &binary.BitwiseOr{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Left: &expr.Variable{}, + Right: &expr.Variable{}, }, []string{"Left", "Right"}, map[string]interface{}{}, }, { &binary.BitwiseXor{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Left: &expr.Variable{}, + Right: &expr.Variable{}, }, []string{"Left", "Right"}, map[string]interface{}{}, }, { &binary.BooleanAnd{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Left: &expr.Variable{}, + Right: &expr.Variable{}, }, []string{"Left", "Right"}, map[string]interface{}{}, }, { &binary.BooleanOr{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Left: &expr.Variable{}, + Right: &expr.Variable{}, }, []string{"Left", "Right"}, map[string]interface{}{}, }, { &binary.Coalesce{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Left: &expr.Variable{}, + Right: &expr.Variable{}, }, []string{"Left", "Right"}, map[string]interface{}{}, }, { &binary.Concat{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Left: &expr.Variable{}, + Right: &expr.Variable{}, }, []string{"Left", "Right"}, map[string]interface{}{}, }, { &binary.Div{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Left: &expr.Variable{}, + Right: &expr.Variable{}, }, []string{"Left", "Right"}, map[string]interface{}{}, }, { &binary.Equal{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Left: &expr.Variable{}, + Right: &expr.Variable{}, }, []string{"Left", "Right"}, map[string]interface{}{}, }, { &binary.GreaterOrEqual{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Left: &expr.Variable{}, + Right: &expr.Variable{}, }, []string{"Left", "Right"}, map[string]interface{}{}, }, { &binary.Greater{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Left: &expr.Variable{}, + Right: &expr.Variable{}, }, []string{"Left", "Right"}, map[string]interface{}{}, }, { &binary.Identical{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Left: &expr.Variable{}, + Right: &expr.Variable{}, }, []string{"Left", "Right"}, map[string]interface{}{}, }, { &binary.LogicalAnd{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Left: &expr.Variable{}, + Right: &expr.Variable{}, }, []string{"Left", "Right"}, map[string]interface{}{}, }, { &binary.LogicalOr{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Left: &expr.Variable{}, + Right: &expr.Variable{}, }, []string{"Left", "Right"}, map[string]interface{}{}, }, { &binary.LogicalXor{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Left: &expr.Variable{}, + Right: &expr.Variable{}, }, []string{"Left", "Right"}, map[string]interface{}{}, }, { &binary.Minus{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Left: &expr.Variable{}, + Right: &expr.Variable{}, }, []string{"Left", "Right"}, map[string]interface{}{}, }, { &binary.Mod{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Left: &expr.Variable{}, + Right: &expr.Variable{}, }, []string{"Left", "Right"}, map[string]interface{}{}, }, { &binary.Mul{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Left: &expr.Variable{}, + Right: &expr.Variable{}, }, []string{"Left", "Right"}, map[string]interface{}{}, }, { &binary.NotEqual{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Left: &expr.Variable{}, + Right: &expr.Variable{}, }, []string{"Left", "Right"}, map[string]interface{}{}, }, { &binary.NotIdentical{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Left: &expr.Variable{}, + Right: &expr.Variable{}, }, []string{"Left", "Right"}, map[string]interface{}{}, }, { &binary.Plus{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Left: &expr.Variable{}, + Right: &expr.Variable{}, }, []string{"Left", "Right"}, map[string]interface{}{}, }, { &binary.Pow{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Left: &expr.Variable{}, + Right: &expr.Variable{}, }, []string{"Left", "Right"}, map[string]interface{}{}, }, { &binary.ShiftLeft{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Left: &expr.Variable{}, + Right: &expr.Variable{}, }, []string{"Left", "Right"}, map[string]interface{}{}, }, { &binary.ShiftRight{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Left: &expr.Variable{}, + Right: &expr.Variable{}, }, []string{"Left", "Right"}, map[string]interface{}{}, }, { &binary.SmallerOrEqual{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Left: &expr.Variable{}, + Right: &expr.Variable{}, }, []string{"Left", "Right"}, map[string]interface{}{}, }, { &binary.Smaller{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Left: &expr.Variable{}, + Right: &expr.Variable{}, }, []string{"Left", "Right"}, map[string]interface{}{}, }, { &binary.Spaceship{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Left: &expr.Variable{}, + Right: &expr.Variable{}, }, []string{"Left", "Right"}, map[string]interface{}{}, @@ -241,11 +241,15 @@ type visitorMock struct { } func (v *visitorMock) EnterNode(n walker.Walkable) bool { return v.visitChildren } -func (v *visitorMock) GetChildrenVisitor(key string) walker.Visitor { +func (v *visitorMock) LeaveNode(n walker.Walkable) {} +func (v *visitorMock) EnterChildNode(key string, w walker.Walkable) { v.visitedKeys = append(v.visitedKeys, key) - return &visitorMock{v.visitChildren, nil} } -func (v *visitorMock) LeaveNode(n walker.Walkable) {} +func (v *visitorMock) LeaveChildNode(key string, w walker.Walkable) {} +func (v *visitorMock) EnterChildList(key string, w walker.Walkable) { + v.visitedKeys = append(v.visitedKeys, key) +} +func (v *visitorMock) LeaveChildList(key string, w walker.Walkable) {} func TestVisitorDisableChildren(t *testing.T) { for _, tt := range nodesToTest { diff --git a/node/expr/cast/n_cast_array.go b/node/expr/cast/n_cast_array.go index 56537a8..0776331 100644 --- a/node/expr/cast/n_cast_array.go +++ b/node/expr/cast/n_cast_array.go @@ -30,8 +30,9 @@ func (n *Array) Walk(v walker.Visitor) { } if n.Expr != nil { - vv := v.GetChildrenVisitor("Expr") - n.Expr.Walk(vv) + v.EnterChildNode("Expr", n) + n.Expr.Walk(v) + v.LeaveChildNode("Expr", n) } v.LeaveNode(n) diff --git a/node/expr/cast/n_cast_bool.go b/node/expr/cast/n_cast_bool.go index f4c5988..00e5409 100644 --- a/node/expr/cast/n_cast_bool.go +++ b/node/expr/cast/n_cast_bool.go @@ -30,8 +30,9 @@ func (n *Bool) Walk(v walker.Visitor) { } if n.Expr != nil { - vv := v.GetChildrenVisitor("Expr") - n.Expr.Walk(vv) + v.EnterChildNode("Expr", n) + n.Expr.Walk(v) + v.LeaveChildNode("Expr", n) } v.LeaveNode(n) diff --git a/node/expr/cast/n_cast_double.go b/node/expr/cast/n_cast_double.go index addbbc7..81c6c6a 100644 --- a/node/expr/cast/n_cast_double.go +++ b/node/expr/cast/n_cast_double.go @@ -30,8 +30,9 @@ func (n *Double) Walk(v walker.Visitor) { } if n.Expr != nil { - vv := v.GetChildrenVisitor("Expr") - n.Expr.Walk(vv) + v.EnterChildNode("Expr", n) + n.Expr.Walk(v) + v.LeaveChildNode("Expr", n) } v.LeaveNode(n) diff --git a/node/expr/cast/n_cast_int.go b/node/expr/cast/n_cast_int.go index 2d70e16..0ad977d 100644 --- a/node/expr/cast/n_cast_int.go +++ b/node/expr/cast/n_cast_int.go @@ -30,8 +30,9 @@ func (n *Int) Walk(v walker.Visitor) { } if n.Expr != nil { - vv := v.GetChildrenVisitor("Expr") - n.Expr.Walk(vv) + v.EnterChildNode("Expr", n) + n.Expr.Walk(v) + v.LeaveChildNode("Expr", n) } v.LeaveNode(n) diff --git a/node/expr/cast/n_cast_object.go b/node/expr/cast/n_cast_object.go index b25b919..7e38461 100644 --- a/node/expr/cast/n_cast_object.go +++ b/node/expr/cast/n_cast_object.go @@ -30,8 +30,9 @@ func (n *Object) Walk(v walker.Visitor) { } if n.Expr != nil { - vv := v.GetChildrenVisitor("Expr") - n.Expr.Walk(vv) + v.EnterChildNode("Expr", n) + n.Expr.Walk(v) + v.LeaveChildNode("Expr", n) } v.LeaveNode(n) diff --git a/node/expr/cast/n_cast_string.go b/node/expr/cast/n_cast_string.go index 3fcd0d2..fab6637 100644 --- a/node/expr/cast/n_cast_string.go +++ b/node/expr/cast/n_cast_string.go @@ -30,8 +30,9 @@ func (n *String) Walk(v walker.Visitor) { } if n.Expr != nil { - vv := v.GetChildrenVisitor("Expr") - n.Expr.Walk(vv) + v.EnterChildNode("Expr", n) + n.Expr.Walk(v) + v.LeaveChildNode("Expr", n) } v.LeaveNode(n) diff --git a/node/expr/cast/n_cast_unset.go b/node/expr/cast/n_cast_unset.go index a3dc011..ea37f26 100644 --- a/node/expr/cast/n_cast_unset.go +++ b/node/expr/cast/n_cast_unset.go @@ -30,8 +30,9 @@ func (n *Unset) Walk(v walker.Visitor) { } if n.Expr != nil { - vv := v.GetChildrenVisitor("Expr") - n.Expr.Walk(vv) + v.EnterChildNode("Expr", n) + n.Expr.Walk(v) + v.LeaveChildNode("Expr", n) } v.LeaveNode(n) diff --git a/node/expr/cast/t_visitor_test.go b/node/expr/cast/t_visitor_test.go index 3f48c90..f574936 100644 --- a/node/expr/cast/t_visitor_test.go +++ b/node/expr/cast/t_visitor_test.go @@ -19,49 +19,49 @@ var nodesToTest = []struct { }{ { &cast.Array{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Expr: &expr.Variable{}, }, []string{"Expr"}, map[string]interface{}{}, }, { &cast.Bool{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Expr: &expr.Variable{}, }, []string{"Expr"}, map[string]interface{}{}, }, { &cast.Double{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Expr: &expr.Variable{}, }, []string{"Expr"}, map[string]interface{}{}, }, { &cast.Int{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Expr: &expr.Variable{}, }, []string{"Expr"}, map[string]interface{}{}, }, { &cast.Object{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Expr: &expr.Variable{}, }, []string{"Expr"}, map[string]interface{}{}, }, { &cast.String{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Expr: &expr.Variable{}, }, []string{"Expr"}, map[string]interface{}{}, }, { &cast.Unset{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Expr: &expr.Variable{}, }, []string{"Expr"}, map[string]interface{}{}, @@ -74,11 +74,15 @@ type visitorMock struct { } func (v *visitorMock) EnterNode(n walker.Walkable) bool { return v.visitChildren } -func (v *visitorMock) GetChildrenVisitor(key string) walker.Visitor { +func (v *visitorMock) LeaveNode(n walker.Walkable) {} +func (v *visitorMock) EnterChildNode(key string, w walker.Walkable) { v.visitedKeys = append(v.visitedKeys, key) - return &visitorMock{v.visitChildren, nil} } -func (v *visitorMock) LeaveNode(n walker.Walkable) {} +func (v *visitorMock) LeaveChildNode(key string, w walker.Walkable) {} +func (v *visitorMock) EnterChildList(key string, w walker.Walkable) { + v.visitedKeys = append(v.visitedKeys, key) +} +func (v *visitorMock) LeaveChildList(key string, w walker.Walkable) {} func TestVisitorDisableChildren(t *testing.T) { for _, tt := range nodesToTest { diff --git a/node/expr/n_array.go b/node/expr/n_array.go index d96793c..c555a8e 100644 --- a/node/expr/n_array.go +++ b/node/expr/n_array.go @@ -30,12 +30,13 @@ func (n *Array) Walk(v walker.Visitor) { } if n.Items != nil { - vv := v.GetChildrenVisitor("Items") + v.EnterChildList("Items", n) for _, nn := range n.Items { if nn != nil { - nn.Walk(vv) + nn.Walk(v) } } + v.LeaveChildList("Items", n) } v.LeaveNode(n) diff --git a/node/expr/n_array_dim_fetch.go b/node/expr/n_array_dim_fetch.go index e41135f..6eef938 100644 --- a/node/expr/n_array_dim_fetch.go +++ b/node/expr/n_array_dim_fetch.go @@ -32,13 +32,15 @@ func (n *ArrayDimFetch) Walk(v walker.Visitor) { } if n.Variable != nil { - vv := v.GetChildrenVisitor("Variable") - n.Variable.Walk(vv) + v.EnterChildNode("Variable", n) + n.Variable.Walk(v) + v.LeaveChildNode("Variable", n) } if n.Dim != nil { - vv := v.GetChildrenVisitor("Dim") - n.Dim.Walk(vv) + v.EnterChildNode("Dim", n) + n.Dim.Walk(v) + v.LeaveChildNode("Dim", n) } v.LeaveNode(n) diff --git a/node/expr/n_array_item.go b/node/expr/n_array_item.go index b651358..9ae1752 100644 --- a/node/expr/n_array_item.go +++ b/node/expr/n_array_item.go @@ -32,13 +32,15 @@ func (n *ArrayItem) Walk(v walker.Visitor) { } if n.Key != nil { - vv := v.GetChildrenVisitor("Key") - n.Key.Walk(vv) + v.EnterChildNode("Key", n) + n.Key.Walk(v) + v.LeaveChildNode("Key", n) } if n.Val != nil { - vv := v.GetChildrenVisitor("Val") - n.Val.Walk(vv) + v.EnterChildNode("Val", n) + n.Val.Walk(v) + v.LeaveChildNode("Val", n) } v.LeaveNode(n) diff --git a/node/expr/n_bitwise_not.go b/node/expr/n_bitwise_not.go index e4ca599..0877bbc 100644 --- a/node/expr/n_bitwise_not.go +++ b/node/expr/n_bitwise_not.go @@ -30,8 +30,9 @@ func (n *BitwiseNot) Walk(v walker.Visitor) { } if n.Expr != nil { - vv := v.GetChildrenVisitor("Expr") - n.Expr.Walk(vv) + v.EnterChildNode("Expr", n) + n.Expr.Walk(v) + v.LeaveChildNode("Expr", n) } v.LeaveNode(n) diff --git a/node/expr/n_boolean_not.go b/node/expr/n_boolean_not.go index a552eca..b28318a 100644 --- a/node/expr/n_boolean_not.go +++ b/node/expr/n_boolean_not.go @@ -30,8 +30,9 @@ func (n *BooleanNot) Walk(v walker.Visitor) { } if n.Expr != nil { - vv := v.GetChildrenVisitor("Expr") - n.Expr.Walk(vv) + v.EnterChildNode("Expr", n) + n.Expr.Walk(v) + v.LeaveChildNode("Expr", n) } v.LeaveNode(n) diff --git a/node/expr/n_class_const_fetch.go b/node/expr/n_class_const_fetch.go index 6f9ecd0..3557c3e 100644 --- a/node/expr/n_class_const_fetch.go +++ b/node/expr/n_class_const_fetch.go @@ -32,13 +32,15 @@ func (n *ClassConstFetch) Walk(v walker.Visitor) { } if n.Class != nil { - vv := v.GetChildrenVisitor("Class") - n.Class.Walk(vv) + v.EnterChildNode("Class", n) + n.Class.Walk(v) + v.LeaveChildNode("Class", n) } if n.ConstantName != nil { - vv := v.GetChildrenVisitor("ConstantName") - n.ConstantName.Walk(vv) + v.EnterChildNode("ConstantName", n) + n.ConstantName.Walk(v) + v.LeaveChildNode("ConstantName", n) } v.LeaveNode(n) diff --git a/node/expr/n_clone.go b/node/expr/n_clone.go index 64ec320..ee712e4 100644 --- a/node/expr/n_clone.go +++ b/node/expr/n_clone.go @@ -30,8 +30,9 @@ func (n *Clone) Walk(v walker.Visitor) { } if n.Expr != nil { - vv := v.GetChildrenVisitor("Expr") - n.Expr.Walk(vv) + v.EnterChildNode("Expr", n) + n.Expr.Walk(v) + v.LeaveChildNode("Expr", n) } v.LeaveNode(n) diff --git a/node/expr/n_closure.go b/node/expr/n_closure.go index 26d9949..e2761da 100644 --- a/node/expr/n_closure.go +++ b/node/expr/n_closure.go @@ -46,31 +46,35 @@ func (n *Closure) Walk(v walker.Visitor) { } if n.Params != nil { - vv := v.GetChildrenVisitor("Params") + v.EnterChildList("Params", n) for _, nn := range n.Params { if nn != nil { - nn.Walk(vv) + nn.Walk(v) } } + v.LeaveChildList("Params", n) } if n.ClosureUse != nil { - vv := v.GetChildrenVisitor("ClosureUse") - n.ClosureUse.Walk(vv) + v.EnterChildNode("ClosureUse", n) + n.ClosureUse.Walk(v) + v.LeaveChildNode("ClosureUse", n) } if n.ReturnType != nil { - vv := v.GetChildrenVisitor("ReturnType") - n.ReturnType.Walk(vv) + v.EnterChildNode("ReturnType", n) + n.ReturnType.Walk(v) + v.LeaveChildNode("ReturnType", n) } if n.Stmts != nil { - vv := v.GetChildrenVisitor("Stmts") + v.EnterChildList("Stmts", n) for _, nn := range n.Stmts { if nn != nil { - nn.Walk(vv) + nn.Walk(v) } } + v.LeaveChildList("Stmts", n) } v.LeaveNode(n) diff --git a/node/expr/n_closure_use.go b/node/expr/n_closure_use.go index 6225208..fd9b0b2 100644 --- a/node/expr/n_closure_use.go +++ b/node/expr/n_closure_use.go @@ -30,12 +30,13 @@ func (n *ClosureUse) Walk(v walker.Visitor) { } if n.Uses != nil { - vv := v.GetChildrenVisitor("Uses") + v.EnterChildList("Uses", n) for _, nn := range n.Uses { if nn != nil { - nn.Walk(vv) + nn.Walk(v) } } + v.LeaveChildList("Uses", n) } v.LeaveNode(n) diff --git a/node/expr/n_const_fetch.go b/node/expr/n_const_fetch.go index 09313e4..c45481f 100644 --- a/node/expr/n_const_fetch.go +++ b/node/expr/n_const_fetch.go @@ -30,8 +30,9 @@ func (n *ConstFetch) Walk(v walker.Visitor) { } if n.Constant != nil { - vv := v.GetChildrenVisitor("Constant") - n.Constant.Walk(vv) + v.EnterChildNode("Constant", n) + n.Constant.Walk(v) + v.LeaveChildNode("Constant", n) } v.LeaveNode(n) diff --git a/node/expr/n_die.go b/node/expr/n_die.go index 5cae0d4..80fd988 100644 --- a/node/expr/n_die.go +++ b/node/expr/n_die.go @@ -30,8 +30,9 @@ func (n *Die) Walk(v walker.Visitor) { } if n.Expr != nil { - vv := v.GetChildrenVisitor("Expr") - n.Expr.Walk(vv) + v.EnterChildNode("Expr", n) + n.Expr.Walk(v) + v.LeaveChildNode("Expr", n) } v.LeaveNode(n) diff --git a/node/expr/n_empty.go b/node/expr/n_empty.go index 0ce4e3c..44692bb 100644 --- a/node/expr/n_empty.go +++ b/node/expr/n_empty.go @@ -30,8 +30,9 @@ func (n *Empty) Walk(v walker.Visitor) { } if n.Expr != nil { - vv := v.GetChildrenVisitor("Expr") - n.Expr.Walk(vv) + v.EnterChildNode("Expr", n) + n.Expr.Walk(v) + v.LeaveChildNode("Expr", n) } v.LeaveNode(n) diff --git a/node/expr/n_error_suppress.go b/node/expr/n_error_suppress.go index b927c8d..9699014 100644 --- a/node/expr/n_error_suppress.go +++ b/node/expr/n_error_suppress.go @@ -30,8 +30,9 @@ func (n *ErrorSuppress) Walk(v walker.Visitor) { } if n.Expr != nil { - vv := v.GetChildrenVisitor("Expr") - n.Expr.Walk(vv) + v.EnterChildNode("Expr", n) + n.Expr.Walk(v) + v.LeaveChildNode("Expr", n) } v.LeaveNode(n) diff --git a/node/expr/n_eval.go b/node/expr/n_eval.go index 39bae38..0f48c24 100644 --- a/node/expr/n_eval.go +++ b/node/expr/n_eval.go @@ -30,8 +30,9 @@ func (n *Eval) Walk(v walker.Visitor) { } if n.Expr != nil { - vv := v.GetChildrenVisitor("Expr") - n.Expr.Walk(vv) + v.EnterChildNode("Expr", n) + n.Expr.Walk(v) + v.LeaveChildNode("Expr", n) } v.LeaveNode(n) diff --git a/node/expr/n_exit.go b/node/expr/n_exit.go index 2567296..607cb30 100644 --- a/node/expr/n_exit.go +++ b/node/expr/n_exit.go @@ -30,8 +30,9 @@ func (n *Exit) Walk(v walker.Visitor) { } if n.Expr != nil { - vv := v.GetChildrenVisitor("Expr") - n.Expr.Walk(vv) + v.EnterChildNode("Expr", n) + n.Expr.Walk(v) + v.LeaveChildNode("Expr", n) } v.LeaveNode(n) diff --git a/node/expr/n_function_call.go b/node/expr/n_function_call.go index 2d17fdc..929d387 100644 --- a/node/expr/n_function_call.go +++ b/node/expr/n_function_call.go @@ -32,13 +32,15 @@ func (n *FunctionCall) Walk(v walker.Visitor) { } if n.Function != nil { - vv := v.GetChildrenVisitor("Function") - n.Function.Walk(vv) + v.EnterChildNode("Function", n) + n.Function.Walk(v) + v.LeaveChildNode("Function", n) } if n.ArgumentList != nil { - vv := v.GetChildrenVisitor("ArgumentList") - n.ArgumentList.Walk(vv) + v.EnterChildNode("ArgumentList", n) + n.ArgumentList.Walk(v) + v.LeaveChildNode("ArgumentList", n) } v.LeaveNode(n) diff --git a/node/expr/n_include.go b/node/expr/n_include.go index afdac26..f4e33e8 100644 --- a/node/expr/n_include.go +++ b/node/expr/n_include.go @@ -30,8 +30,9 @@ func (n *Include) Walk(v walker.Visitor) { } if n.Expr != nil { - vv := v.GetChildrenVisitor("Expr") - n.Expr.Walk(vv) + v.EnterChildNode("Expr", n) + n.Expr.Walk(v) + v.LeaveChildNode("Expr", n) } v.LeaveNode(n) diff --git a/node/expr/n_include_once.go b/node/expr/n_include_once.go index 08bcc6a..0841834 100644 --- a/node/expr/n_include_once.go +++ b/node/expr/n_include_once.go @@ -30,8 +30,9 @@ func (n *IncludeOnce) Walk(v walker.Visitor) { } if n.Expr != nil { - vv := v.GetChildrenVisitor("Expr") - n.Expr.Walk(vv) + v.EnterChildNode("Expr", n) + n.Expr.Walk(v) + v.LeaveChildNode("Expr", n) } v.LeaveNode(n) diff --git a/node/expr/n_instance_of.go b/node/expr/n_instance_of.go index d71441d..f8941ca 100644 --- a/node/expr/n_instance_of.go +++ b/node/expr/n_instance_of.go @@ -32,13 +32,15 @@ func (n *InstanceOf) Walk(v walker.Visitor) { } if n.Expr != nil { - vv := v.GetChildrenVisitor("Expr") - n.Expr.Walk(vv) + v.EnterChildNode("Expr", n) + n.Expr.Walk(v) + v.LeaveChildNode("Expr", n) } if n.Class != nil { - vv := v.GetChildrenVisitor("Class") - n.Class.Walk(vv) + v.EnterChildNode("Class", n) + n.Class.Walk(v) + v.LeaveChildNode("Class", n) } v.LeaveNode(n) diff --git a/node/expr/n_isset.go b/node/expr/n_isset.go index 3b96086..46f6e3b 100644 --- a/node/expr/n_isset.go +++ b/node/expr/n_isset.go @@ -30,12 +30,13 @@ func (n *Isset) Walk(v walker.Visitor) { } if n.Variables != nil { - vv := v.GetChildrenVisitor("Variables") + v.EnterChildList("Variables", n) for _, nn := range n.Variables { if nn != nil { - nn.Walk(vv) + nn.Walk(v) } } + v.LeaveChildList("Variables", n) } v.LeaveNode(n) diff --git a/node/expr/n_list.go b/node/expr/n_list.go index 0f6c5f6..9b09cc3 100644 --- a/node/expr/n_list.go +++ b/node/expr/n_list.go @@ -30,12 +30,13 @@ func (n *List) Walk(v walker.Visitor) { } if n.Items != nil { - vv := v.GetChildrenVisitor("Items") + v.EnterChildList("Items", n) for _, nn := range n.Items { if nn != nil { - nn.Walk(vv) + nn.Walk(v) } } + v.LeaveChildList("Items", n) } v.LeaveNode(n) diff --git a/node/expr/n_method_call.go b/node/expr/n_method_call.go index 1bcc4fb..5fe3f02 100644 --- a/node/expr/n_method_call.go +++ b/node/expr/n_method_call.go @@ -34,18 +34,21 @@ func (n *MethodCall) Walk(v walker.Visitor) { } if n.Variable != nil { - vv := v.GetChildrenVisitor("Variable") - n.Variable.Walk(vv) + v.EnterChildNode("Variable", n) + n.Variable.Walk(v) + v.LeaveChildNode("Variable", n) } if n.Method != nil { - vv := v.GetChildrenVisitor("Method") - n.Method.Walk(vv) + v.EnterChildNode("Method", n) + n.Method.Walk(v) + v.LeaveChildNode("Method", n) } if n.ArgumentList != nil { - vv := v.GetChildrenVisitor("ArgumentList") - n.ArgumentList.Walk(vv) + v.EnterChildNode("ArgumentList", n) + n.ArgumentList.Walk(v) + v.LeaveChildNode("ArgumentList", n) } v.LeaveNode(n) diff --git a/node/expr/n_new.go b/node/expr/n_new.go index 9323f48..4dca5cf 100644 --- a/node/expr/n_new.go +++ b/node/expr/n_new.go @@ -32,13 +32,15 @@ func (n *New) Walk(v walker.Visitor) { } if n.Class != nil { - vv := v.GetChildrenVisitor("Class") - n.Class.Walk(vv) + v.EnterChildNode("Class", n) + n.Class.Walk(v) + v.LeaveChildNode("Class", n) } if n.ArgumentList != nil { - vv := v.GetChildrenVisitor("ArgumentList") - n.ArgumentList.Walk(vv) + v.EnterChildNode("ArgumentList", n) + n.ArgumentList.Walk(v) + v.LeaveChildNode("ArgumentList", n) } v.LeaveNode(n) diff --git a/node/expr/n_post_dec.go b/node/expr/n_post_dec.go index 1b68e8f..c120afd 100644 --- a/node/expr/n_post_dec.go +++ b/node/expr/n_post_dec.go @@ -30,8 +30,9 @@ func (n *PostDec) Walk(v walker.Visitor) { } if n.Variable != nil { - vv := v.GetChildrenVisitor("Variable") - n.Variable.Walk(vv) + v.EnterChildNode("Variable", n) + n.Variable.Walk(v) + v.LeaveChildNode("Variable", n) } v.LeaveNode(n) diff --git a/node/expr/n_post_inc.go b/node/expr/n_post_inc.go index b6a007c..a2f394f 100644 --- a/node/expr/n_post_inc.go +++ b/node/expr/n_post_inc.go @@ -30,8 +30,9 @@ func (n *PostInc) Walk(v walker.Visitor) { } if n.Variable != nil { - vv := v.GetChildrenVisitor("Variable") - n.Variable.Walk(vv) + v.EnterChildNode("Variable", n) + n.Variable.Walk(v) + v.LeaveChildNode("Variable", n) } v.LeaveNode(n) diff --git a/node/expr/n_pre_dec.go b/node/expr/n_pre_dec.go index fc7e27a..99d6025 100644 --- a/node/expr/n_pre_dec.go +++ b/node/expr/n_pre_dec.go @@ -30,8 +30,9 @@ func (n *PreDec) Walk(v walker.Visitor) { } if n.Variable != nil { - vv := v.GetChildrenVisitor("Variable") - n.Variable.Walk(vv) + v.EnterChildNode("Variable", n) + n.Variable.Walk(v) + v.LeaveChildNode("Variable", n) } v.LeaveNode(n) diff --git a/node/expr/n_pre_inc.go b/node/expr/n_pre_inc.go index 6ba964b..a30b23e 100644 --- a/node/expr/n_pre_inc.go +++ b/node/expr/n_pre_inc.go @@ -30,8 +30,9 @@ func (n *PreInc) Walk(v walker.Visitor) { } if n.Variable != nil { - vv := v.GetChildrenVisitor("Variable") - n.Variable.Walk(vv) + v.EnterChildNode("Variable", n) + n.Variable.Walk(v) + v.LeaveChildNode("Variable", n) } v.LeaveNode(n) diff --git a/node/expr/n_print.go b/node/expr/n_print.go index e60f3aa..02d8173 100644 --- a/node/expr/n_print.go +++ b/node/expr/n_print.go @@ -30,8 +30,9 @@ func (n *Print) Walk(v walker.Visitor) { } if n.Expr != nil { - vv := v.GetChildrenVisitor("Expr") - n.Expr.Walk(vv) + v.EnterChildNode("Expr", n) + n.Expr.Walk(v) + v.LeaveChildNode("Expr", n) } v.LeaveNode(n) diff --git a/node/expr/n_property_fetch.go b/node/expr/n_property_fetch.go index 128f355..cfc155f 100644 --- a/node/expr/n_property_fetch.go +++ b/node/expr/n_property_fetch.go @@ -32,13 +32,15 @@ func (n *PropertyFetch) Walk(v walker.Visitor) { } if n.Variable != nil { - vv := v.GetChildrenVisitor("Variable") - n.Variable.Walk(vv) + v.EnterChildNode("Variable", n) + n.Variable.Walk(v) + v.LeaveChildNode("Variable", n) } if n.Property != nil { - vv := v.GetChildrenVisitor("Property") - n.Property.Walk(vv) + v.EnterChildNode("Property", n) + n.Property.Walk(v) + v.LeaveChildNode("Property", n) } v.LeaveNode(n) diff --git a/node/expr/n_reference.go b/node/expr/n_reference.go index 9b864fc..523ba1d 100644 --- a/node/expr/n_reference.go +++ b/node/expr/n_reference.go @@ -30,8 +30,9 @@ func (n *Reference) Walk(v walker.Visitor) { } if n.Variable != nil { - vv := v.GetChildrenVisitor("Variable") - n.Variable.Walk(vv) + v.EnterChildNode("Variable", n) + n.Variable.Walk(v) + v.LeaveChildNode("Variable", n) } v.LeaveNode(n) diff --git a/node/expr/n_require.go b/node/expr/n_require.go index 3f5c43f..79ba272 100644 --- a/node/expr/n_require.go +++ b/node/expr/n_require.go @@ -30,8 +30,9 @@ func (n *Require) Walk(v walker.Visitor) { } if n.Expr != nil { - vv := v.GetChildrenVisitor("Expr") - n.Expr.Walk(vv) + v.EnterChildNode("Expr", n) + n.Expr.Walk(v) + v.LeaveChildNode("Expr", n) } v.LeaveNode(n) diff --git a/node/expr/n_require_once.go b/node/expr/n_require_once.go index 9d1436d..ee9cb2f 100644 --- a/node/expr/n_require_once.go +++ b/node/expr/n_require_once.go @@ -30,8 +30,9 @@ func (n *RequireOnce) Walk(v walker.Visitor) { } if n.Expr != nil { - vv := v.GetChildrenVisitor("Expr") - n.Expr.Walk(vv) + v.EnterChildNode("Expr", n) + n.Expr.Walk(v) + v.LeaveChildNode("Expr", n) } v.LeaveNode(n) diff --git a/node/expr/n_shell_exec.go b/node/expr/n_shell_exec.go index 9310989..1432c92 100644 --- a/node/expr/n_shell_exec.go +++ b/node/expr/n_shell_exec.go @@ -30,12 +30,13 @@ func (n *ShellExec) Walk(v walker.Visitor) { } if n.Parts != nil { - vv := v.GetChildrenVisitor("Parts") + v.EnterChildList("Parts", n) for _, nn := range n.Parts { if nn != nil { - nn.Walk(vv) + nn.Walk(v) } } + v.LeaveChildList("Parts", n) } v.LeaveNode(n) diff --git a/node/expr/n_short_array.go b/node/expr/n_short_array.go index 6bb45e0..694830f 100644 --- a/node/expr/n_short_array.go +++ b/node/expr/n_short_array.go @@ -30,12 +30,13 @@ func (n *ShortArray) Walk(v walker.Visitor) { } if n.Items != nil { - vv := v.GetChildrenVisitor("Items") + v.EnterChildList("Items", n) for _, nn := range n.Items { if nn != nil { - nn.Walk(vv) + nn.Walk(v) } } + v.LeaveChildList("Items", n) } v.LeaveNode(n) diff --git a/node/expr/n_short_list.go b/node/expr/n_short_list.go index dd00855..2e4f8a8 100644 --- a/node/expr/n_short_list.go +++ b/node/expr/n_short_list.go @@ -30,12 +30,13 @@ func (n *ShortList) Walk(v walker.Visitor) { } if n.Items != nil { - vv := v.GetChildrenVisitor("Items") + v.EnterChildList("Items", n) for _, nn := range n.Items { if nn != nil { - nn.Walk(vv) + nn.Walk(v) } } + v.LeaveChildList("Items", n) } v.LeaveNode(n) diff --git a/node/expr/n_static_call.go b/node/expr/n_static_call.go index 0f87f93..4c61a33 100644 --- a/node/expr/n_static_call.go +++ b/node/expr/n_static_call.go @@ -34,18 +34,21 @@ func (n *StaticCall) Walk(v walker.Visitor) { } if n.Class != nil { - vv := v.GetChildrenVisitor("Class") - n.Class.Walk(vv) + v.EnterChildNode("Class", n) + n.Class.Walk(v) + v.LeaveChildNode("Class", n) } if n.Call != nil { - vv := v.GetChildrenVisitor("Call") - n.Call.Walk(vv) + v.EnterChildNode("Call", n) + n.Call.Walk(v) + v.LeaveChildNode("Call", n) } if n.ArgumentList != nil { - vv := v.GetChildrenVisitor("ArgumentList") - n.ArgumentList.Walk(vv) + v.EnterChildNode("ArgumentList", n) + n.ArgumentList.Walk(v) + v.LeaveChildNode("ArgumentList", n) } v.LeaveNode(n) diff --git a/node/expr/n_static_property_fetch.go b/node/expr/n_static_property_fetch.go index a3d07d6..97f2714 100644 --- a/node/expr/n_static_property_fetch.go +++ b/node/expr/n_static_property_fetch.go @@ -32,13 +32,15 @@ func (n *StaticPropertyFetch) Walk(v walker.Visitor) { } if n.Class != nil { - vv := v.GetChildrenVisitor("Class") - n.Class.Walk(vv) + v.EnterChildNode("Class", n) + n.Class.Walk(v) + v.LeaveChildNode("Class", n) } if n.Property != nil { - vv := v.GetChildrenVisitor("Property") - n.Property.Walk(vv) + v.EnterChildNode("Property", n) + n.Property.Walk(v) + v.LeaveChildNode("Property", n) } v.LeaveNode(n) diff --git a/node/expr/n_ternary.go b/node/expr/n_ternary.go index 83729b2..c559b06 100644 --- a/node/expr/n_ternary.go +++ b/node/expr/n_ternary.go @@ -34,18 +34,21 @@ func (n *Ternary) Walk(v walker.Visitor) { } if n.Condition != nil { - vv := v.GetChildrenVisitor("Condition") - n.Condition.Walk(vv) + v.EnterChildNode("Condition", n) + n.Condition.Walk(v) + v.LeaveChildNode("Condition", n) } if n.IfTrue != nil { - vv := v.GetChildrenVisitor("IfTrue") - n.IfTrue.Walk(vv) + v.EnterChildNode("IfTrue", n) + n.IfTrue.Walk(v) + v.LeaveChildNode("IfTrue", n) } if n.IfFalse != nil { - vv := v.GetChildrenVisitor("IfFalse") - n.IfFalse.Walk(vv) + v.EnterChildNode("IfFalse", n) + n.IfFalse.Walk(v) + v.LeaveChildNode("IfFalse", n) } v.LeaveNode(n) diff --git a/node/expr/n_unary_minus.go b/node/expr/n_unary_minus.go index efeda8e..e075c96 100644 --- a/node/expr/n_unary_minus.go +++ b/node/expr/n_unary_minus.go @@ -30,8 +30,9 @@ func (n *UnaryMinus) Walk(v walker.Visitor) { } if n.Expr != nil { - vv := v.GetChildrenVisitor("Expr") - n.Expr.Walk(vv) + v.EnterChildNode("Expr", n) + n.Expr.Walk(v) + v.LeaveChildNode("Expr", n) } v.LeaveNode(n) diff --git a/node/expr/n_unary_plus.go b/node/expr/n_unary_plus.go index cd6fcdb..bbd6228 100644 --- a/node/expr/n_unary_plus.go +++ b/node/expr/n_unary_plus.go @@ -30,8 +30,9 @@ func (n *UnaryPlus) Walk(v walker.Visitor) { } if n.Expr != nil { - vv := v.GetChildrenVisitor("Expr") - n.Expr.Walk(vv) + v.EnterChildNode("Expr", n) + n.Expr.Walk(v) + v.LeaveChildNode("Expr", n) } v.LeaveNode(n) diff --git a/node/expr/n_variable.go b/node/expr/n_variable.go index caa0f10..a098d22 100644 --- a/node/expr/n_variable.go +++ b/node/expr/n_variable.go @@ -35,8 +35,9 @@ func (n *Variable) Walk(v walker.Visitor) { } if n.VarName != nil { - vv := v.GetChildrenVisitor("VarName") - n.VarName.Walk(vv) + v.EnterChildNode("VarName", n) + n.VarName.Walk(v) + v.LeaveChildNode("VarName", n) } v.LeaveNode(n) diff --git a/node/expr/n_yield.go b/node/expr/n_yield.go index dbbd811..51fafb4 100644 --- a/node/expr/n_yield.go +++ b/node/expr/n_yield.go @@ -32,13 +32,15 @@ func (n *Yield) Walk(v walker.Visitor) { } if n.Key != nil { - vv := v.GetChildrenVisitor("Key") - n.Key.Walk(vv) + v.EnterChildNode("Key", n) + n.Key.Walk(v) + v.LeaveChildNode("Key", n) } if n.Value != nil { - vv := v.GetChildrenVisitor("Value") - n.Value.Walk(vv) + v.EnterChildNode("Value", n) + n.Value.Walk(v) + v.LeaveChildNode("Value", n) } v.LeaveNode(n) diff --git a/node/expr/n_yield_from.go b/node/expr/n_yield_from.go index 1109d0d..47d1f34 100644 --- a/node/expr/n_yield_from.go +++ b/node/expr/n_yield_from.go @@ -30,8 +30,9 @@ func (n *YieldFrom) Walk(v walker.Visitor) { } if n.Expr != nil { - vv := v.GetChildrenVisitor("Expr") - n.Expr.Walk(vv) + v.EnterChildNode("Expr", n) + n.Expr.Walk(v) + v.LeaveChildNode("Expr", n) } v.LeaveNode(n) diff --git a/node/expr/t_visitor_test.go b/node/expr/t_visitor_test.go index 90d6741..bcb0c45 100644 --- a/node/expr/t_visitor_test.go +++ b/node/expr/t_visitor_test.go @@ -24,7 +24,7 @@ var nodesToTest = []struct { }{ { &expr.ArrayDimFetch{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Variable: &expr.Variable{}, Dim: &scalar.Lnumber{Value: "1"}, }, []string{"Variable", "Dim"}, @@ -41,10 +41,7 @@ var nodesToTest = []struct { { &expr.Array{ Items: []node.Node{ - &expr.ArrayItem{ - Key: &scalar.String{Value: "key"}, - Val: &scalar.Lnumber{Value: "1"}, - }, + &expr.ArrayItem{}, }, }, []string{"Items"}, @@ -52,21 +49,21 @@ var nodesToTest = []struct { }, { &expr.BitwiseNot{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Expr: &expr.Variable{}, }, []string{"Expr"}, map[string]interface{}{}, }, { &expr.BooleanNot{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Expr: &expr.Variable{}, }, []string{"Expr"}, map[string]interface{}{}, }, { &expr.ClassConstFetch{ - Class: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Class: &expr.Variable{}, ConstantName: &node.Identifier{Value: "foo"}, }, []string{"Class", "ConstantName"}, @@ -74,7 +71,7 @@ var nodesToTest = []struct { }, { &expr.Clone{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Expr: &expr.Variable{}, }, []string{"Expr"}, map[string]interface{}{}, @@ -82,7 +79,7 @@ var nodesToTest = []struct { { &expr.ClosureUse{ Uses: []node.Node{ - &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + &expr.Variable{}, }, }, []string{"Uses"}, @@ -110,42 +107,42 @@ var nodesToTest = []struct { }, { &expr.Empty{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Expr: &expr.Variable{}, }, []string{"Expr"}, map[string]interface{}{}, }, { &expr.ErrorSuppress{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Expr: &expr.Variable{}, }, []string{"Expr"}, map[string]interface{}{}, }, { &expr.Eval{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Expr: &expr.Variable{}, }, []string{"Expr"}, map[string]interface{}{}, }, { &expr.Exit{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Expr: &expr.Variable{}, }, []string{"Expr"}, map[string]interface{}{}, }, { &expr.Die{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Expr: &expr.Variable{}, }, []string{"Expr"}, map[string]interface{}{}, }, { &expr.FunctionCall{ - Function: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Function: &expr.Variable{}, ArgumentList: &node.ArgumentList{}, }, []string{"Function", "ArgumentList"}, @@ -153,21 +150,21 @@ var nodesToTest = []struct { }, { &expr.IncludeOnce{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Expr: &expr.Variable{}, }, []string{"Expr"}, map[string]interface{}{}, }, { &expr.Include{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Expr: &expr.Variable{}, }, []string{"Expr"}, map[string]interface{}{}, }, { &expr.InstanceOf{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Expr: &expr.Variable{}, Class: &name.Name{}, }, []string{"Expr", "Class"}, @@ -176,7 +173,7 @@ var nodesToTest = []struct { { &expr.Isset{ Variables: []node.Node{ - &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + &expr.Variable{}, }, }, []string{"Variables"}, @@ -193,7 +190,7 @@ var nodesToTest = []struct { }, { &expr.MethodCall{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Variable: &expr.Variable{}, Method: &node.Identifier{Value: "foo"}, ArgumentList: &node.ArgumentList{}, }, @@ -210,42 +207,42 @@ var nodesToTest = []struct { }, { &expr.PostDec{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Variable: &expr.Variable{}, }, []string{"Variable"}, map[string]interface{}{}, }, { &expr.PostInc{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Variable: &expr.Variable{}, }, []string{"Variable"}, map[string]interface{}{}, }, { &expr.PreDec{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Variable: &expr.Variable{}, }, []string{"Variable"}, map[string]interface{}{}, }, { &expr.PreInc{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Variable: &expr.Variable{}, }, []string{"Variable"}, map[string]interface{}{}, }, { &expr.Print{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Expr: &expr.Variable{}, }, []string{"Expr"}, map[string]interface{}{}, }, { &expr.PropertyFetch{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Variable: &expr.Variable{}, Property: &node.Identifier{Value: "foo"}, }, []string{"Variable", "Property"}, @@ -253,21 +250,21 @@ var nodesToTest = []struct { }, { &expr.Reference{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Variable: &expr.Variable{}, }, []string{"Variable"}, map[string]interface{}{}, }, { &expr.RequireOnce{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Expr: &expr.Variable{}, }, []string{"Expr"}, map[string]interface{}{}, }, { &expr.Require{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Expr: &expr.Variable{}, }, []string{"Expr"}, map[string]interface{}{}, @@ -318,23 +315,23 @@ var nodesToTest = []struct { }, { &expr.Ternary{ - Condition: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - IfTrue: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - IfFalse: &expr.Variable{VarName: &node.Identifier{Value: "c"}}, + Condition: &expr.Variable{}, + IfTrue: &expr.Variable{}, + IfFalse: &expr.Variable{}, }, []string{"Condition", "IfTrue", "IfFalse"}, map[string]interface{}{}, }, { &expr.UnaryMinus{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Expr: &expr.Variable{}, }, []string{"Expr"}, map[string]interface{}{}, }, { &expr.UnaryPlus{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Expr: &expr.Variable{}, }, []string{"Expr"}, map[string]interface{}{}, @@ -346,15 +343,15 @@ var nodesToTest = []struct { }, { &expr.YieldFrom{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Expr: &expr.Variable{}, }, []string{"Expr"}, map[string]interface{}{}, }, { &expr.Yield{ - Key: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Value: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Key: &expr.Variable{}, + Value: &expr.Variable{}, }, []string{"Key", "Value"}, map[string]interface{}{}, @@ -367,11 +364,15 @@ type visitorMock struct { } func (v *visitorMock) EnterNode(n walker.Walkable) bool { return v.visitChildren } -func (v *visitorMock) GetChildrenVisitor(key string) walker.Visitor { +func (v *visitorMock) LeaveNode(n walker.Walkable) {} +func (v *visitorMock) EnterChildNode(key string, w walker.Walkable) { v.visitedKeys = append(v.visitedKeys, key) - return &visitorMock{v.visitChildren, nil} } -func (v *visitorMock) LeaveNode(n walker.Walkable) {} +func (v *visitorMock) LeaveChildNode(key string, w walker.Walkable) {} +func (v *visitorMock) EnterChildList(key string, w walker.Walkable) { + v.visitedKeys = append(v.visitedKeys, key) +} +func (v *visitorMock) LeaveChildList(key string, w walker.Walkable) {} func TestVisitorDisableChildren(t *testing.T) { for _, tt := range nodesToTest { diff --git a/node/n_argument.go b/node/n_argument.go index 564532d..4b4d178 100644 --- a/node/n_argument.go +++ b/node/n_argument.go @@ -34,8 +34,9 @@ func (n *Argument) Walk(v walker.Visitor) { } if n.Expr != nil { - vv := v.GetChildrenVisitor("Expr") - n.Expr.Walk(vv) + v.EnterChildNode("Expr", n) + n.Expr.Walk(v) + v.LeaveChildNode("Expr", n) } v.LeaveNode(n) diff --git a/node/n_argument_list.go b/node/n_argument_list.go index 843030f..59857f4 100644 --- a/node/n_argument_list.go +++ b/node/n_argument_list.go @@ -29,12 +29,13 @@ func (n *ArgumentList) Walk(v walker.Visitor) { } if n.Arguments != nil { - vv := v.GetChildrenVisitor("Arguments") + v.EnterChildList("Arguments", n) for _, nn := range n.Arguments { if nn != nil { - nn.Walk(vv) + nn.Walk(v) } } + v.LeaveChildList("Arguments", n) } v.LeaveNode(n) diff --git a/node/n_nullable.go b/node/n_nullable.go index 1eca09e..f78a860 100644 --- a/node/n_nullable.go +++ b/node/n_nullable.go @@ -27,8 +27,9 @@ func (n *Nullable) Walk(v walker.Visitor) { } if n.Expr != nil { - vv := v.GetChildrenVisitor("Expr") - n.Expr.Walk(vv) + v.EnterChildNode("Expr", n) + n.Expr.Walk(v) + v.LeaveChildNode("Expr", n) } v.LeaveNode(n) diff --git a/node/n_parameter.go b/node/n_parameter.go index 0986874..9f5a08e 100644 --- a/node/n_parameter.go +++ b/node/n_parameter.go @@ -38,18 +38,21 @@ func (n *Parameter) Walk(v walker.Visitor) { } if n.VariableType != nil { - vv := v.GetChildrenVisitor("VariableType") - n.VariableType.Walk(vv) + v.EnterChildNode("VariableType", n) + n.VariableType.Walk(v) + v.LeaveChildNode("VariableType", n) } if n.Variable != nil { - vv := v.GetChildrenVisitor("Variable") - n.Variable.Walk(vv) + v.EnterChildNode("Variable", n) + n.Variable.Walk(v) + v.LeaveChildNode("Variable", n) } if n.DefaultValue != nil { - vv := v.GetChildrenVisitor("DefaultValue") - n.DefaultValue.Walk(vv) + v.EnterChildNode("DefaultValue", n) + n.DefaultValue.Walk(v) + v.LeaveChildNode("DefaultValue", n) } v.LeaveNode(n) diff --git a/node/n_root.go b/node/n_root.go index 67db6dc..097c97e 100644 --- a/node/n_root.go +++ b/node/n_root.go @@ -29,12 +29,13 @@ func (n *Root) Walk(v walker.Visitor) { } if n.Stmts != nil { - vv := v.GetChildrenVisitor("Stmts") + v.EnterChildList("Stmts", n) for _, nn := range n.Stmts { if nn != nil { - nn.Walk(vv) + nn.Walk(v) } } + v.LeaveChildList("Stmts", n) } v.LeaveNode(n) diff --git a/node/name/n_fully_qualified.go b/node/name/n_fully_qualified.go index 5e55b9a..bc868db 100644 --- a/node/name/n_fully_qualified.go +++ b/node/name/n_fully_qualified.go @@ -30,12 +30,13 @@ func (n *FullyQualified) Walk(v walker.Visitor) { } if n.Parts != nil { - vv := v.GetChildrenVisitor("Parts") + v.EnterChildList("Parts", n) for _, nn := range n.Parts { if nn != nil { - nn.Walk(vv) + nn.Walk(v) } } + v.LeaveChildList("Parts", n) } v.LeaveNode(n) diff --git a/node/name/n_name.go b/node/name/n_name.go index e0edebe..db2fe8c 100644 --- a/node/name/n_name.go +++ b/node/name/n_name.go @@ -30,12 +30,13 @@ func (n *Name) Walk(v walker.Visitor) { } if n.Parts != nil { - vv := v.GetChildrenVisitor("Parts") + v.EnterChildList("Parts", n) for _, nn := range n.Parts { if nn != nil { - nn.Walk(vv) + nn.Walk(v) } } + v.LeaveChildList("Parts", n) } v.LeaveNode(n) diff --git a/node/name/n_relative.go b/node/name/n_relative.go index b367831..2e7df34 100644 --- a/node/name/n_relative.go +++ b/node/name/n_relative.go @@ -30,12 +30,13 @@ func (n *Relative) Walk(v walker.Visitor) { } if n.Parts != nil { - vv := v.GetChildrenVisitor("Parts") + v.EnterChildList("Parts", n) for _, nn := range n.Parts { if nn != nil { - nn.Walk(vv) + nn.Walk(v) } } + v.LeaveChildList("Parts", n) } v.LeaveNode(n) diff --git a/node/name/t_visitor_test.go b/node/name/t_visitor_test.go index 38a7a64..dad1d33 100644 --- a/node/name/t_visitor_test.go +++ b/node/name/t_visitor_test.go @@ -44,11 +44,15 @@ type visitorMock struct { } func (v *visitorMock) EnterNode(n walker.Walkable) bool { return v.visitChildren } -func (v *visitorMock) GetChildrenVisitor(key string) walker.Visitor { +func (v *visitorMock) LeaveNode(n walker.Walkable) {} +func (v *visitorMock) EnterChildNode(key string, w walker.Walkable) { v.visitedKeys = append(v.visitedKeys, key) - return &visitorMock{v.visitChildren, nil} } -func (v *visitorMock) LeaveNode(n walker.Walkable) {} +func (v *visitorMock) LeaveChildNode(key string, w walker.Walkable) {} +func (v *visitorMock) EnterChildList(key string, w walker.Walkable) { + v.visitedKeys = append(v.visitedKeys, key) +} +func (v *visitorMock) LeaveChildList(key string, w walker.Walkable) {} func TestNameVisitorDisableChildren(t *testing.T) { for _, tt := range nameNodesTests { diff --git a/node/scalar/node_encapsed.go b/node/scalar/node_encapsed.go index e6dceda..3ce0c2f 100644 --- a/node/scalar/node_encapsed.go +++ b/node/scalar/node_encapsed.go @@ -30,11 +30,12 @@ func (n *Encapsed) Walk(v walker.Visitor) { } if n.Parts != nil { - vv := v.GetChildrenVisitor("Parts") + v.EnterChildList("Parts", n) for _, nn := range n.Parts { if nn != nil { - nn.Walk(vv) + nn.Walk(v) } } + v.LeaveChildList("Parts", n) } } diff --git a/node/scalar/node_heredoc.go b/node/scalar/node_heredoc.go index 1395134..c2f9e74 100644 --- a/node/scalar/node_heredoc.go +++ b/node/scalar/node_heredoc.go @@ -34,11 +34,12 @@ func (n *Heredoc) Walk(v walker.Visitor) { } if n.Parts != nil { - vv := v.GetChildrenVisitor("Parts") + v.EnterChildList("Parts", n) for _, nn := range n.Parts { if nn != nil { - nn.Walk(vv) + nn.Walk(v) } } + v.LeaveChildList("Parts", n) } } diff --git a/node/scalar/t_visitor_test.go b/node/scalar/t_visitor_test.go index bea1192..f3bc581 100644 --- a/node/scalar/t_visitor_test.go +++ b/node/scalar/t_visitor_test.go @@ -58,11 +58,15 @@ type visitorMock struct { } func (v *visitorMock) EnterNode(n walker.Walkable) bool { return v.visitChildren } -func (v *visitorMock) GetChildrenVisitor(key string) walker.Visitor { +func (v *visitorMock) LeaveNode(n walker.Walkable) {} +func (v *visitorMock) EnterChildNode(key string, w walker.Walkable) { v.visitedKeys = append(v.visitedKeys, key) - return &visitorMock{v.visitChildren, nil} } -func (v *visitorMock) LeaveNode(n walker.Walkable) {} +func (v *visitorMock) LeaveChildNode(key string, w walker.Walkable) {} +func (v *visitorMock) EnterChildList(key string, w walker.Walkable) { + v.visitedKeys = append(v.visitedKeys, key) +} +func (v *visitorMock) LeaveChildList(key string, w walker.Walkable) {} func TestNameVisitorDisableChildren(t *testing.T) { for _, tt := range nameNodesTests { diff --git a/node/stmt/n_alt_else.go b/node/stmt/n_alt_else.go index 0c5f5cb..3dec33d 100644 --- a/node/stmt/n_alt_else.go +++ b/node/stmt/n_alt_else.go @@ -30,8 +30,9 @@ func (n *AltElse) Walk(v walker.Visitor) { } if n.Stmt != nil { - vv := v.GetChildrenVisitor("Stmt") - n.Stmt.Walk(vv) + v.EnterChildNode("Stmt", n) + n.Stmt.Walk(v) + v.LeaveChildNode("Stmt", n) } v.LeaveNode(n) diff --git a/node/stmt/n_alt_else_if.go b/node/stmt/n_alt_else_if.go index 813667d..feae465 100644 --- a/node/stmt/n_alt_else_if.go +++ b/node/stmt/n_alt_else_if.go @@ -32,13 +32,15 @@ func (n *AltElseIf) Walk(v walker.Visitor) { } if n.Cond != nil { - vv := v.GetChildrenVisitor("Cond") - n.Cond.Walk(vv) + v.EnterChildNode("Cond", n) + n.Cond.Walk(v) + v.LeaveChildNode("Cond", n) } if n.Stmt != nil { - vv := v.GetChildrenVisitor("Stmt") - n.Stmt.Walk(vv) + v.EnterChildNode("Stmt", n) + n.Stmt.Walk(v) + v.LeaveChildNode("Stmt", n) } v.LeaveNode(n) diff --git a/node/stmt/n_alt_for.go b/node/stmt/n_alt_for.go index 8be4591..a80765a 100644 --- a/node/stmt/n_alt_for.go +++ b/node/stmt/n_alt_for.go @@ -36,35 +36,39 @@ func (n *AltFor) Walk(v walker.Visitor) { } if n.Init != nil { - vv := v.GetChildrenVisitor("Init") + v.EnterChildList("Init", n) for _, nn := range n.Init { if nn != nil { - nn.Walk(vv) + nn.Walk(v) } } + v.LeaveChildList("Init", n) } if n.Cond != nil { - vv := v.GetChildrenVisitor("Cond") + v.EnterChildList("Cond", n) for _, nn := range n.Cond { if nn != nil { - nn.Walk(vv) + nn.Walk(v) } } + v.LeaveChildList("Cond", n) } if n.Loop != nil { - vv := v.GetChildrenVisitor("Loop") + v.EnterChildList("Loop", n) for _, nn := range n.Loop { if nn != nil { - nn.Walk(vv) + nn.Walk(v) } } + v.LeaveChildList("Loop", n) } if n.Stmt != nil { - vv := v.GetChildrenVisitor("Stmt") - n.Stmt.Walk(vv) + v.EnterChildNode("Stmt", n) + n.Stmt.Walk(v) + v.LeaveChildNode("Stmt", n) } v.LeaveNode(n) diff --git a/node/stmt/n_alt_foreach.go b/node/stmt/n_alt_foreach.go index deaa4c4..4488a45 100644 --- a/node/stmt/n_alt_foreach.go +++ b/node/stmt/n_alt_foreach.go @@ -36,23 +36,27 @@ func (n *AltForeach) Walk(v walker.Visitor) { } if n.Expr != nil { - vv := v.GetChildrenVisitor("Expr") - n.Expr.Walk(vv) + v.EnterChildNode("Expr", n) + n.Expr.Walk(v) + v.LeaveChildNode("Expr", n) } if n.Key != nil { - vv := v.GetChildrenVisitor("Key") - n.Key.Walk(vv) + v.EnterChildNode("Key", n) + n.Key.Walk(v) + v.LeaveChildNode("Key", n) } if n.Variable != nil { - vv := v.GetChildrenVisitor("Variable") - n.Variable.Walk(vv) + v.EnterChildNode("Variable", n) + n.Variable.Walk(v) + v.LeaveChildNode("Variable", n) } if n.Stmt != nil { - vv := v.GetChildrenVisitor("Stmt") - n.Stmt.Walk(vv) + v.EnterChildNode("Stmt", n) + n.Stmt.Walk(v) + v.LeaveChildNode("Stmt", n) } v.LeaveNode(n) diff --git a/node/stmt/n_alt_if.go b/node/stmt/n_alt_if.go index eafacf0..b844dfc 100644 --- a/node/stmt/n_alt_if.go +++ b/node/stmt/n_alt_if.go @@ -54,27 +54,31 @@ func (n *AltIf) Walk(v walker.Visitor) { } if n.Cond != nil { - vv := v.GetChildrenVisitor("Cond") - n.Cond.Walk(vv) + v.EnterChildNode("Cond", n) + n.Cond.Walk(v) + v.LeaveChildNode("Cond", n) } if n.Stmt != nil { - vv := v.GetChildrenVisitor("Stmt") - n.Stmt.Walk(vv) + v.EnterChildNode("Stmt", n) + n.Stmt.Walk(v) + v.LeaveChildNode("Stmt", n) } if n.ElseIf != nil { - vv := v.GetChildrenVisitor("ElseIf") + v.EnterChildList("ElseIf", n) for _, nn := range n.ElseIf { if nn != nil { - nn.Walk(vv) + nn.Walk(v) } } + v.LeaveChildList("ElseIf", n) } if n.Else != nil { - vv := v.GetChildrenVisitor("Else") - n.Else.Walk(vv) + v.EnterChildNode("Else", n) + n.Else.Walk(v) + v.LeaveChildNode("Else", n) } v.LeaveNode(n) diff --git a/node/stmt/n_alt_switch.go b/node/stmt/n_alt_switch.go index ef28404..d036c34 100644 --- a/node/stmt/n_alt_switch.go +++ b/node/stmt/n_alt_switch.go @@ -32,13 +32,15 @@ func (n *AltSwitch) Walk(v walker.Visitor) { } if n.Cond != nil { - vv := v.GetChildrenVisitor("Cond") - n.Cond.Walk(vv) + v.EnterChildNode("Cond", n) + n.Cond.Walk(v) + v.LeaveChildNode("Cond", n) } if n.CaseList != nil { - vv := v.GetChildrenVisitor("CaseList") - n.CaseList.Walk(vv) + v.EnterChildNode("CaseList", n) + n.CaseList.Walk(v) + v.LeaveChildNode("CaseList", n) } v.LeaveNode(n) diff --git a/node/stmt/n_alt_while.go b/node/stmt/n_alt_while.go index 2cacf79..b962807 100644 --- a/node/stmt/n_alt_while.go +++ b/node/stmt/n_alt_while.go @@ -32,13 +32,15 @@ func (n *AltWhile) Walk(v walker.Visitor) { } if n.Cond != nil { - vv := v.GetChildrenVisitor("Cond") - n.Cond.Walk(vv) + v.EnterChildNode("Cond", n) + n.Cond.Walk(v) + v.LeaveChildNode("Cond", n) } if n.Stmt != nil { - vv := v.GetChildrenVisitor("Stmt") - n.Stmt.Walk(vv) + v.EnterChildNode("Stmt", n) + n.Stmt.Walk(v) + v.LeaveChildNode("Stmt", n) } v.LeaveNode(n) diff --git a/node/stmt/n_break.go b/node/stmt/n_break.go index 3aaabc4..acf4fd2 100644 --- a/node/stmt/n_break.go +++ b/node/stmt/n_break.go @@ -30,8 +30,9 @@ func (n *Break) Walk(v walker.Visitor) { } if n.Expr != nil { - vv := v.GetChildrenVisitor("Expr") - n.Expr.Walk(vv) + v.EnterChildNode("Expr", n) + n.Expr.Walk(v) + v.LeaveChildNode("Expr", n) } v.LeaveNode(n) diff --git a/node/stmt/n_case.go b/node/stmt/n_case.go index 6eb4b40..6a8d736 100644 --- a/node/stmt/n_case.go +++ b/node/stmt/n_case.go @@ -32,17 +32,19 @@ func (n *Case) Walk(v walker.Visitor) { } if n.Cond != nil { - vv := v.GetChildrenVisitor("Cond") - n.Cond.Walk(vv) + v.EnterChildNode("Cond", n) + n.Cond.Walk(v) + v.LeaveChildNode("Cond", n) } if n.Stmts != nil { - vv := v.GetChildrenVisitor("Stmts") + v.EnterChildList("Stmts", n) for _, nn := range n.Stmts { if nn != nil { - nn.Walk(vv) + nn.Walk(v) } } + v.LeaveChildList("Stmts", n) } v.LeaveNode(n) diff --git a/node/stmt/n_case_list.go b/node/stmt/n_case_list.go index ac43d6a..a12ef2a 100644 --- a/node/stmt/n_case_list.go +++ b/node/stmt/n_case_list.go @@ -30,12 +30,13 @@ func (n *CaseList) Walk(v walker.Visitor) { } if n.Cases != nil { - vv := v.GetChildrenVisitor("Cases") + v.EnterChildList("Cases", n) for _, nn := range n.Cases { if nn != nil { - nn.Walk(vv) + nn.Walk(v) } } + v.LeaveChildList("Cases", n) } v.LeaveNode(n) diff --git a/node/stmt/n_catch.go b/node/stmt/n_catch.go index 9d59efe..291f764 100644 --- a/node/stmt/n_catch.go +++ b/node/stmt/n_catch.go @@ -34,26 +34,29 @@ func (n *Catch) Walk(v walker.Visitor) { } if n.Types != nil { - vv := v.GetChildrenVisitor("Types") + v.EnterChildList("Types", n) for _, nn := range n.Types { if nn != nil { - nn.Walk(vv) + nn.Walk(v) } } + v.LeaveChildList("Types", n) } if n.Variable != nil { - vv := v.GetChildrenVisitor("Variable") - n.Variable.Walk(vv) + v.EnterChildNode("Variable", n) + n.Variable.Walk(v) + v.LeaveChildNode("Variable", n) } if n.Stmts != nil { - vv := v.GetChildrenVisitor("Stmts") + v.EnterChildList("Stmts", n) for _, nn := range n.Stmts { if nn != nil { - nn.Walk(vv) + nn.Walk(v) } } + v.LeaveChildList("Stmts", n) } v.LeaveNode(n) diff --git a/node/stmt/n_class.go b/node/stmt/n_class.go index 305490d..2ad81d2 100644 --- a/node/stmt/n_class.go +++ b/node/stmt/n_class.go @@ -44,41 +44,47 @@ func (n *Class) Walk(v walker.Visitor) { } if n.ClassName != nil { - vv := v.GetChildrenVisitor("ClassName") - n.ClassName.Walk(vv) + v.EnterChildNode("ClassName", n) + n.ClassName.Walk(v) + v.LeaveChildNode("ClassName", n) } if n.Modifiers != nil { - vv := v.GetChildrenVisitor("Modifiers") + v.EnterChildList("Modifiers", n) for _, nn := range n.Modifiers { if nn != nil { - nn.Walk(vv) + nn.Walk(v) } } + v.LeaveChildList("Modifiers", n) } if n.ArgumentList != nil { - vv := v.GetChildrenVisitor("ArgumentList") - n.ArgumentList.Walk(vv) + v.EnterChildNode("ArgumentList", n) + n.ArgumentList.Walk(v) + v.LeaveChildNode("ArgumentList", n) } if n.Extends != nil { - vv := v.GetChildrenVisitor("Extends") - n.Extends.Walk(vv) + v.EnterChildNode("Extends", n) + n.Extends.Walk(v) + v.LeaveChildNode("Extends", n) } if n.Implements != nil { - vv := v.GetChildrenVisitor("Implements") - n.Implements.Walk(vv) + v.EnterChildNode("Implements", n) + n.Implements.Walk(v) + v.LeaveChildNode("Implements", n) } if n.Stmts != nil { - vv := v.GetChildrenVisitor("Stmts") + v.EnterChildList("Stmts", n) for _, nn := range n.Stmts { if nn != nil { - nn.Walk(vv) + nn.Walk(v) } } + v.LeaveChildList("Stmts", n) } v.LeaveNode(n) diff --git a/node/stmt/n_class_const_list.go b/node/stmt/n_class_const_list.go index e7c76fc..b65c4e4 100644 --- a/node/stmt/n_class_const_list.go +++ b/node/stmt/n_class_const_list.go @@ -32,21 +32,23 @@ func (n *ClassConstList) Walk(v walker.Visitor) { } if n.Modifiers != nil { - vv := v.GetChildrenVisitor("Modifiers") + v.EnterChildList("Modifiers", n) for _, nn := range n.Modifiers { if nn != nil { - nn.Walk(vv) + nn.Walk(v) } } + v.LeaveChildList("Modifiers", n) } if n.Consts != nil { - vv := v.GetChildrenVisitor("Consts") + v.EnterChildList("Consts", n) for _, nn := range n.Consts { if nn != nil { - nn.Walk(vv) + nn.Walk(v) } } + v.LeaveChildList("Consts", n) } v.LeaveNode(n) diff --git a/node/stmt/n_class_extends.go b/node/stmt/n_class_extends.go index 2d7efcc..70864b3 100644 --- a/node/stmt/n_class_extends.go +++ b/node/stmt/n_class_extends.go @@ -30,8 +30,9 @@ func (n *ClassExtends) Walk(v walker.Visitor) { } if n.ClassName != nil { - vv := v.GetChildrenVisitor("ClassName") - n.ClassName.Walk(vv) + v.EnterChildNode("ClassName", n) + n.ClassName.Walk(v) + v.LeaveChildNode("ClassName", n) } v.LeaveNode(n) diff --git a/node/stmt/n_class_implements.go b/node/stmt/n_class_implements.go index 00a37a1..0ac8688 100644 --- a/node/stmt/n_class_implements.go +++ b/node/stmt/n_class_implements.go @@ -30,12 +30,13 @@ func (n *ClassImplements) Walk(v walker.Visitor) { } if n.InterfaceNames != nil { - vv := v.GetChildrenVisitor("InterfaceNames") + v.EnterChildList("InterfaceNames", n) for _, nn := range n.InterfaceNames { if nn != nil { - nn.Walk(vv) + nn.Walk(v) } } + v.LeaveChildList("InterfaceNames", n) } v.LeaveNode(n) diff --git a/node/stmt/n_class_method.go b/node/stmt/n_class_method.go index ec7d9ee..ad09e34 100644 --- a/node/stmt/n_class_method.go +++ b/node/stmt/n_class_method.go @@ -45,36 +45,41 @@ func (n *ClassMethod) Walk(v walker.Visitor) { } if n.MethodName != nil { - vv := v.GetChildrenVisitor("MethodName") - n.MethodName.Walk(vv) + v.EnterChildNode("MethodName", n) + n.MethodName.Walk(v) + v.LeaveChildNode("MethodName", n) } if n.Modifiers != nil { - vv := v.GetChildrenVisitor("Modifiers") + v.EnterChildList("Modifiers", n) for _, nn := range n.Modifiers { if nn != nil { - nn.Walk(vv) + nn.Walk(v) } } + v.LeaveChildList("Modifiers", n) } if n.Params != nil { - vv := v.GetChildrenVisitor("Params") + v.EnterChildList("Params", n) for _, nn := range n.Params { if nn != nil { - nn.Walk(vv) + nn.Walk(v) } } + v.LeaveChildList("Params", n) } if n.ReturnType != nil { - vv := v.GetChildrenVisitor("ReturnType") - n.ReturnType.Walk(vv) + v.EnterChildNode("ReturnType", n) + n.ReturnType.Walk(v) + v.LeaveChildNode("ReturnType", n) } if n.Stmt != nil { - vv := v.GetChildrenVisitor("Stmt") - n.Stmt.Walk(vv) + v.EnterChildNode("Stmt", n) + n.Stmt.Walk(v) + v.LeaveChildNode("Stmt", n) } v.LeaveNode(n) diff --git a/node/stmt/n_const_list.go b/node/stmt/n_const_list.go index 8490ec5..46c702f 100644 --- a/node/stmt/n_const_list.go +++ b/node/stmt/n_const_list.go @@ -30,12 +30,13 @@ func (n *ConstList) Walk(v walker.Visitor) { } if n.Consts != nil { - vv := v.GetChildrenVisitor("Consts") + v.EnterChildList("Consts", n) for _, nn := range n.Consts { if nn != nil { - nn.Walk(vv) + nn.Walk(v) } } + v.LeaveChildList("Consts", n) } v.LeaveNode(n) diff --git a/node/stmt/n_constant.go b/node/stmt/n_constant.go index 4cc651c..3a98e43 100644 --- a/node/stmt/n_constant.go +++ b/node/stmt/n_constant.go @@ -36,13 +36,15 @@ func (n *Constant) Walk(v walker.Visitor) { } if n.ConstantName != nil { - vv := v.GetChildrenVisitor("ConstantName") - n.ConstantName.Walk(vv) + v.EnterChildNode("ConstantName", n) + n.ConstantName.Walk(v) + v.LeaveChildNode("ConstantName", n) } if n.Expr != nil { - vv := v.GetChildrenVisitor("Expr") - n.Expr.Walk(vv) + v.EnterChildNode("Expr", n) + n.Expr.Walk(v) + v.LeaveChildNode("Expr", n) } v.LeaveNode(n) diff --git a/node/stmt/n_continue.go b/node/stmt/n_continue.go index afa8780..c14ee25 100644 --- a/node/stmt/n_continue.go +++ b/node/stmt/n_continue.go @@ -30,8 +30,9 @@ func (n *Continue) Walk(v walker.Visitor) { } if n.Expr != nil { - vv := v.GetChildrenVisitor("Expr") - n.Expr.Walk(vv) + v.EnterChildNode("Expr", n) + n.Expr.Walk(v) + v.LeaveChildNode("Expr", n) } v.LeaveNode(n) diff --git a/node/stmt/n_declare.go b/node/stmt/n_declare.go index f2e251d..057f6d2 100644 --- a/node/stmt/n_declare.go +++ b/node/stmt/n_declare.go @@ -32,17 +32,19 @@ func (n *Declare) Walk(v walker.Visitor) { } if n.Consts != nil { - vv := v.GetChildrenVisitor("Consts") + v.EnterChildList("Consts", n) for _, nn := range n.Consts { if nn != nil { - nn.Walk(vv) + nn.Walk(v) } } + v.LeaveChildList("Consts", n) } if n.Stmt != nil { - vv := v.GetChildrenVisitor("Stmt") - n.Stmt.Walk(vv) + v.EnterChildNode("Stmt", n) + n.Stmt.Walk(v) + v.LeaveChildNode("Stmt", n) } v.LeaveNode(n) diff --git a/node/stmt/n_default.go b/node/stmt/n_default.go index 961d3d1..7203f30 100644 --- a/node/stmt/n_default.go +++ b/node/stmt/n_default.go @@ -30,12 +30,13 @@ func (n *Default) Walk(v walker.Visitor) { } if n.Stmts != nil { - vv := v.GetChildrenVisitor("Stmts") + v.EnterChildList("Stmts", n) for _, nn := range n.Stmts { if nn != nil { - nn.Walk(vv) + nn.Walk(v) } } + v.LeaveChildList("Stmts", n) } v.LeaveNode(n) diff --git a/node/stmt/n_do.go b/node/stmt/n_do.go index c8da1b0..324d60b 100644 --- a/node/stmt/n_do.go +++ b/node/stmt/n_do.go @@ -32,13 +32,15 @@ func (n *Do) Walk(v walker.Visitor) { } if n.Stmt != nil { - vv := v.GetChildrenVisitor("Stmt") - n.Stmt.Walk(vv) + v.EnterChildNode("Stmt", n) + n.Stmt.Walk(v) + v.LeaveChildNode("Stmt", n) } if n.Cond != nil { - vv := v.GetChildrenVisitor("Cond") - n.Cond.Walk(vv) + v.EnterChildNode("Cond", n) + n.Cond.Walk(v) + v.LeaveChildNode("Cond", n) } v.LeaveNode(n) diff --git a/node/stmt/n_echo.go b/node/stmt/n_echo.go index 9deb7d9..df932f1 100644 --- a/node/stmt/n_echo.go +++ b/node/stmt/n_echo.go @@ -30,12 +30,13 @@ func (n *Echo) Walk(v walker.Visitor) { } if n.Exprs != nil { - vv := v.GetChildrenVisitor("Exprs") + v.EnterChildList("Exprs", n) for _, nn := range n.Exprs { if nn != nil { - nn.Walk(vv) + nn.Walk(v) } } + v.LeaveChildList("Exprs", n) } v.LeaveNode(n) diff --git a/node/stmt/n_else.go b/node/stmt/n_else.go index 15ad017..78ce8e8 100644 --- a/node/stmt/n_else.go +++ b/node/stmt/n_else.go @@ -30,8 +30,9 @@ func (n *Else) Walk(v walker.Visitor) { } if n.Stmt != nil { - vv := v.GetChildrenVisitor("Stmt") - n.Stmt.Walk(vv) + v.EnterChildNode("Stmt", n) + n.Stmt.Walk(v) + v.LeaveChildNode("Stmt", n) } v.LeaveNode(n) diff --git a/node/stmt/n_else_if.go b/node/stmt/n_else_if.go index 98db7f7..cf02f34 100644 --- a/node/stmt/n_else_if.go +++ b/node/stmt/n_else_if.go @@ -32,13 +32,15 @@ func (n *ElseIf) Walk(v walker.Visitor) { } if n.Cond != nil { - vv := v.GetChildrenVisitor("Cond") - n.Cond.Walk(vv) + v.EnterChildNode("Cond", n) + n.Cond.Walk(v) + v.LeaveChildNode("Cond", n) } if n.Stmt != nil { - vv := v.GetChildrenVisitor("Stmt") - n.Stmt.Walk(vv) + v.EnterChildNode("Stmt", n) + n.Stmt.Walk(v) + v.LeaveChildNode("Stmt", n) } v.LeaveNode(n) diff --git a/node/stmt/n_expression.go b/node/stmt/n_expression.go index 77dfe64..bc9374e 100644 --- a/node/stmt/n_expression.go +++ b/node/stmt/n_expression.go @@ -30,8 +30,9 @@ func (n *Expression) Walk(v walker.Visitor) { } if n.Expr != nil { - vv := v.GetChildrenVisitor("Expr") - n.Expr.Walk(vv) + v.EnterChildNode("Expr", n) + n.Expr.Walk(v) + v.LeaveChildNode("Expr", n) } v.LeaveNode(n) diff --git a/node/stmt/n_finally.go b/node/stmt/n_finally.go index 9436140..944ff23 100644 --- a/node/stmt/n_finally.go +++ b/node/stmt/n_finally.go @@ -30,12 +30,13 @@ func (n *Finally) Walk(v walker.Visitor) { } if n.Stmts != nil { - vv := v.GetChildrenVisitor("Stmts") + v.EnterChildList("Stmts", n) for _, nn := range n.Stmts { if nn != nil { - nn.Walk(vv) + nn.Walk(v) } } + v.LeaveChildList("Stmts", n) } v.LeaveNode(n) diff --git a/node/stmt/n_for.go b/node/stmt/n_for.go index f8d3c91..6af170b 100644 --- a/node/stmt/n_for.go +++ b/node/stmt/n_for.go @@ -36,35 +36,39 @@ func (n *For) Walk(v walker.Visitor) { } if n.Init != nil { - vv := v.GetChildrenVisitor("Init") + v.EnterChildList("Init", n) for _, nn := range n.Init { if nn != nil { - nn.Walk(vv) + nn.Walk(v) } } + v.LeaveChildList("Init", n) } if n.Cond != nil { - vv := v.GetChildrenVisitor("Cond") + v.EnterChildList("Cond", n) for _, nn := range n.Cond { if nn != nil { - nn.Walk(vv) + nn.Walk(v) } } + v.LeaveChildList("Cond", n) } if n.Loop != nil { - vv := v.GetChildrenVisitor("Loop") + v.EnterChildList("Loop", n) for _, nn := range n.Loop { if nn != nil { - nn.Walk(vv) + nn.Walk(v) } } + v.LeaveChildList("Loop", n) } if n.Stmt != nil { - vv := v.GetChildrenVisitor("Stmt") - n.Stmt.Walk(vv) + v.EnterChildNode("Stmt", n) + n.Stmt.Walk(v) + v.LeaveChildNode("Stmt", n) } v.LeaveNode(n) diff --git a/node/stmt/n_foreach.go b/node/stmt/n_foreach.go index b82d2f5..68644df 100644 --- a/node/stmt/n_foreach.go +++ b/node/stmt/n_foreach.go @@ -36,23 +36,27 @@ func (n *Foreach) Walk(v walker.Visitor) { } if n.Expr != nil { - vv := v.GetChildrenVisitor("Expr") - n.Expr.Walk(vv) + v.EnterChildNode("Expr", n) + n.Expr.Walk(v) + v.LeaveChildNode("Expr", n) } if n.Key != nil { - vv := v.GetChildrenVisitor("Key") - n.Key.Walk(vv) + v.EnterChildNode("Key", n) + n.Key.Walk(v) + v.LeaveChildNode("Key", n) } if n.Variable != nil { - vv := v.GetChildrenVisitor("Variable") - n.Variable.Walk(vv) + v.EnterChildNode("Variable", n) + n.Variable.Walk(v) + v.LeaveChildNode("Variable", n) } if n.Stmt != nil { - vv := v.GetChildrenVisitor("Stmt") - n.Stmt.Walk(vv) + v.EnterChildNode("Stmt", n) + n.Stmt.Walk(v) + v.LeaveChildNode("Stmt", n) } v.LeaveNode(n) diff --git a/node/stmt/n_function.go b/node/stmt/n_function.go index 762c710..effc13c 100644 --- a/node/stmt/n_function.go +++ b/node/stmt/n_function.go @@ -44,31 +44,35 @@ func (n *Function) Walk(v walker.Visitor) { } if n.FunctionName != nil { - vv := v.GetChildrenVisitor("FunctionName") - n.FunctionName.Walk(vv) + v.EnterChildNode("FunctionName", n) + n.FunctionName.Walk(v) + v.LeaveChildNode("FunctionName", n) } if n.Params != nil { - vv := v.GetChildrenVisitor("Params") + v.EnterChildList("Params", n) for _, nn := range n.Params { if nn != nil { - nn.Walk(vv) + nn.Walk(v) } } + v.LeaveChildList("Params", n) } if n.ReturnType != nil { - vv := v.GetChildrenVisitor("ReturnType") - n.ReturnType.Walk(vv) + v.EnterChildNode("ReturnType", n) + n.ReturnType.Walk(v) + v.LeaveChildNode("ReturnType", n) } if n.Stmts != nil { - vv := v.GetChildrenVisitor("Stmts") + v.EnterChildList("Stmts", n) for _, nn := range n.Stmts { if nn != nil { - nn.Walk(vv) + nn.Walk(v) } } + v.LeaveChildList("Stmts", n) } v.LeaveNode(n) diff --git a/node/stmt/n_global.go b/node/stmt/n_global.go index b13861a..65621f9 100644 --- a/node/stmt/n_global.go +++ b/node/stmt/n_global.go @@ -30,12 +30,13 @@ func (n *Global) Walk(v walker.Visitor) { } if n.Vars != nil { - vv := v.GetChildrenVisitor("Vars") + v.EnterChildList("Vars", n) for _, nn := range n.Vars { if nn != nil { - nn.Walk(vv) + nn.Walk(v) } } + v.LeaveChildList("Vars", n) } v.LeaveNode(n) diff --git a/node/stmt/n_goto.go b/node/stmt/n_goto.go index 682699e..0815d65 100644 --- a/node/stmt/n_goto.go +++ b/node/stmt/n_goto.go @@ -30,8 +30,9 @@ func (n *Goto) Walk(v walker.Visitor) { } if n.Label != nil { - vv := v.GetChildrenVisitor("Label") - n.Label.Walk(vv) + v.EnterChildNode("Label", n) + n.Label.Walk(v) + v.LeaveChildNode("Label", n) } v.LeaveNode(n) diff --git a/node/stmt/n_group_use.go b/node/stmt/n_group_use.go index d62c1cd..3057fbc 100644 --- a/node/stmt/n_group_use.go +++ b/node/stmt/n_group_use.go @@ -40,22 +40,25 @@ func (n *GroupUse) Walk(v walker.Visitor) { } if n.UseType != nil { - vv := v.GetChildrenVisitor("UseType") - n.UseType.Walk(vv) + v.EnterChildNode("UseType", n) + n.UseType.Walk(v) + v.LeaveChildNode("UseType", n) } if n.Prefix != nil { - vv := v.GetChildrenVisitor("Prefix") - n.Prefix.Walk(vv) + v.EnterChildNode("Prefix", n) + n.Prefix.Walk(v) + v.LeaveChildNode("Prefix", n) } if n.UseList != nil { - vv := v.GetChildrenVisitor("UseList") + v.EnterChildList("UseList", n) for _, nn := range n.UseList { if nn != nil { - nn.Walk(vv) + nn.Walk(v) } } + v.LeaveChildList("UseList", n) } v.LeaveNode(n) diff --git a/node/stmt/n_if.go b/node/stmt/n_if.go index b31af45..e20c0f3 100644 --- a/node/stmt/n_if.go +++ b/node/stmt/n_if.go @@ -54,27 +54,31 @@ func (n *If) Walk(v walker.Visitor) { } if n.Cond != nil { - vv := v.GetChildrenVisitor("Cond") - n.Cond.Walk(vv) + v.EnterChildNode("Cond", n) + n.Cond.Walk(v) + v.LeaveChildNode("Cond", n) } if n.Stmt != nil { - vv := v.GetChildrenVisitor("Stmt") - n.Stmt.Walk(vv) + v.EnterChildNode("Stmt", n) + n.Stmt.Walk(v) + v.LeaveChildNode("Stmt", n) } if n.ElseIf != nil { - vv := v.GetChildrenVisitor("ElseIf") + v.EnterChildList("ElseIf", n) for _, nn := range n.ElseIf { if nn != nil { - nn.Walk(vv) + nn.Walk(v) } } + v.LeaveChildList("ElseIf", n) } if n.Else != nil { - vv := v.GetChildrenVisitor("Else") - n.Else.Walk(vv) + v.EnterChildNode("Else", n) + n.Else.Walk(v) + v.LeaveChildNode("Else", n) } v.LeaveNode(n) diff --git a/node/stmt/n_interface.go b/node/stmt/n_interface.go index 46524c6..13e296c 100644 --- a/node/stmt/n_interface.go +++ b/node/stmt/n_interface.go @@ -38,22 +38,25 @@ func (n *Interface) Walk(v walker.Visitor) { } if n.InterfaceName != nil { - vv := v.GetChildrenVisitor("InterfaceName") - n.InterfaceName.Walk(vv) + v.EnterChildNode("InterfaceName", n) + n.InterfaceName.Walk(v) + v.LeaveChildNode("InterfaceName", n) } if n.Extends != nil { - vv := v.GetChildrenVisitor("Extends") - n.Extends.Walk(vv) + v.EnterChildNode("Extends", n) + n.Extends.Walk(v) + v.LeaveChildNode("Extends", n) } if n.Stmts != nil { - vv := v.GetChildrenVisitor("Stmts") + v.EnterChildList("Stmts", n) for _, nn := range n.Stmts { if nn != nil { - nn.Walk(vv) + nn.Walk(v) } } + v.LeaveChildList("Stmts", n) } v.LeaveNode(n) diff --git a/node/stmt/n_interface_extends.go b/node/stmt/n_interface_extends.go index 2b1c61a..eea76b2 100644 --- a/node/stmt/n_interface_extends.go +++ b/node/stmt/n_interface_extends.go @@ -30,12 +30,13 @@ func (n *InterfaceExtends) Walk(v walker.Visitor) { } if n.InterfaceNames != nil { - vv := v.GetChildrenVisitor("InterfaceNames") + v.EnterChildList("InterfaceNames", n) for _, nn := range n.InterfaceNames { if nn != nil { - nn.Walk(vv) + nn.Walk(v) } } + v.LeaveChildList("InterfaceNames", n) } v.LeaveNode(n) diff --git a/node/stmt/n_label.go b/node/stmt/n_label.go index ea681b3..bf77c0e 100644 --- a/node/stmt/n_label.go +++ b/node/stmt/n_label.go @@ -30,8 +30,9 @@ func (n *Label) Walk(v walker.Visitor) { } if n.LabelName != nil { - vv := v.GetChildrenVisitor("LabelName") - n.LabelName.Walk(vv) + v.EnterChildNode("LabelName", n) + n.LabelName.Walk(v) + v.LeaveChildNode("LabelName", n) } v.LeaveNode(n) diff --git a/node/stmt/n_namespace.go b/node/stmt/n_namespace.go index 02399f6..c9147fa 100644 --- a/node/stmt/n_namespace.go +++ b/node/stmt/n_namespace.go @@ -32,17 +32,19 @@ func (n *Namespace) Walk(v walker.Visitor) { } if n.NamespaceName != nil { - vv := v.GetChildrenVisitor("NamespaceName") - n.NamespaceName.Walk(vv) + v.EnterChildNode("NamespaceName", n) + n.NamespaceName.Walk(v) + v.LeaveChildNode("NamespaceName", n) } if n.Stmts != nil { - vv := v.GetChildrenVisitor("Stmts") + v.EnterChildList("Stmts", n) for _, nn := range n.Stmts { if nn != nil { - nn.Walk(vv) + nn.Walk(v) } } + v.LeaveChildList("Stmts", n) } v.LeaveNode(n) diff --git a/node/stmt/n_property.go b/node/stmt/n_property.go index 71a017b..607231f 100644 --- a/node/stmt/n_property.go +++ b/node/stmt/n_property.go @@ -36,13 +36,15 @@ func (n *Property) Walk(v walker.Visitor) { } if n.Variable != nil { - vv := v.GetChildrenVisitor("Variable") - n.Variable.Walk(vv) + v.EnterChildNode("Variable", n) + n.Variable.Walk(v) + v.LeaveChildNode("Variable", n) } if n.Expr != nil { - vv := v.GetChildrenVisitor("Expr") - n.Expr.Walk(vv) + v.EnterChildNode("Expr", n) + n.Expr.Walk(v) + v.LeaveChildNode("Expr", n) } v.LeaveNode(n) diff --git a/node/stmt/n_property_list.go b/node/stmt/n_property_list.go index 7ebbcba..51a5813 100644 --- a/node/stmt/n_property_list.go +++ b/node/stmt/n_property_list.go @@ -32,21 +32,23 @@ func (n *PropertyList) Walk(v walker.Visitor) { } if n.Modifiers != nil { - vv := v.GetChildrenVisitor("Modifiers") + v.EnterChildList("Modifiers", n) for _, nn := range n.Modifiers { if nn != nil { - nn.Walk(vv) + nn.Walk(v) } } + v.LeaveChildList("Modifiers", n) } if n.Properties != nil { - vv := v.GetChildrenVisitor("Properties") + v.EnterChildList("Properties", n) for _, nn := range n.Properties { if nn != nil { - nn.Walk(vv) + nn.Walk(v) } } + v.LeaveChildList("Properties", n) } v.LeaveNode(n) diff --git a/node/stmt/n_return.go b/node/stmt/n_return.go index 8f1c77c..5dcec71 100644 --- a/node/stmt/n_return.go +++ b/node/stmt/n_return.go @@ -30,8 +30,9 @@ func (n *Return) Walk(v walker.Visitor) { } if n.Expr != nil { - vv := v.GetChildrenVisitor("Expr") - n.Expr.Walk(vv) + v.EnterChildNode("Expr", n) + n.Expr.Walk(v) + v.LeaveChildNode("Expr", n) } v.LeaveNode(n) diff --git a/node/stmt/n_static.go b/node/stmt/n_static.go index 292ca3c..1b0e365 100644 --- a/node/stmt/n_static.go +++ b/node/stmt/n_static.go @@ -30,12 +30,13 @@ func (n *Static) Walk(v walker.Visitor) { } if n.Vars != nil { - vv := v.GetChildrenVisitor("Vars") + v.EnterChildList("Vars", n) for _, nn := range n.Vars { if nn != nil { - nn.Walk(vv) + nn.Walk(v) } } + v.LeaveChildList("Vars", n) } v.LeaveNode(n) diff --git a/node/stmt/n_static_var.go b/node/stmt/n_static_var.go index 4ae5624..9f953ac 100644 --- a/node/stmt/n_static_var.go +++ b/node/stmt/n_static_var.go @@ -32,13 +32,15 @@ func (n *StaticVar) Walk(v walker.Visitor) { } if n.Variable != nil { - vv := v.GetChildrenVisitor("Variable") - n.Variable.Walk(vv) + v.EnterChildNode("Variable", n) + n.Variable.Walk(v) + v.LeaveChildNode("Variable", n) } if n.Expr != nil { - vv := v.GetChildrenVisitor("Expr") - n.Expr.Walk(vv) + v.EnterChildNode("Expr", n) + n.Expr.Walk(v) + v.LeaveChildNode("Expr", n) } v.LeaveNode(n) diff --git a/node/stmt/n_stmt_list.go b/node/stmt/n_stmt_list.go index 58adedb..e3a6084 100644 --- a/node/stmt/n_stmt_list.go +++ b/node/stmt/n_stmt_list.go @@ -30,12 +30,13 @@ func (n *StmtList) Walk(v walker.Visitor) { } if n.Stmts != nil { - vv := v.GetChildrenVisitor("Stmts") + v.EnterChildList("Stmts", n) for _, nn := range n.Stmts { if nn != nil { - nn.Walk(vv) + nn.Walk(v) } } + v.LeaveChildList("Stmts", n) } v.LeaveNode(n) diff --git a/node/stmt/n_switch.go b/node/stmt/n_switch.go index af9bd65..cd6f047 100644 --- a/node/stmt/n_switch.go +++ b/node/stmt/n_switch.go @@ -32,13 +32,15 @@ func (n *Switch) Walk(v walker.Visitor) { } if n.Cond != nil { - vv := v.GetChildrenVisitor("Cond") - n.Cond.Walk(vv) + v.EnterChildNode("Cond", n) + n.Cond.Walk(v) + v.LeaveChildNode("Cond", n) } if n.CaseList != nil { - vv := v.GetChildrenVisitor("CaseList") - n.CaseList.Walk(vv) + v.EnterChildNode("CaseList", n) + n.CaseList.Walk(v) + v.LeaveChildNode("CaseList", n) } v.LeaveNode(n) diff --git a/node/stmt/n_throw.go b/node/stmt/n_throw.go index 1be5f2f..8d8d466 100644 --- a/node/stmt/n_throw.go +++ b/node/stmt/n_throw.go @@ -30,8 +30,9 @@ func (n *Throw) Walk(v walker.Visitor) { } if n.Expr != nil { - vv := v.GetChildrenVisitor("Expr") - n.Expr.Walk(vv) + v.EnterChildNode("Expr", n) + n.Expr.Walk(v) + v.LeaveChildNode("Expr", n) } v.LeaveNode(n) diff --git a/node/stmt/n_trait.go b/node/stmt/n_trait.go index 65a98d4..7d72719 100644 --- a/node/stmt/n_trait.go +++ b/node/stmt/n_trait.go @@ -36,17 +36,19 @@ func (n *Trait) Walk(v walker.Visitor) { } if n.TraitName != nil { - vv := v.GetChildrenVisitor("TraitName") - n.TraitName.Walk(vv) + v.EnterChildNode("TraitName", n) + n.TraitName.Walk(v) + v.LeaveChildNode("TraitName", n) } if n.Stmts != nil { - vv := v.GetChildrenVisitor("Stmts") + v.EnterChildList("Stmts", n) for _, nn := range n.Stmts { if nn != nil { - nn.Walk(vv) + nn.Walk(v) } } + v.LeaveChildList("Stmts", n) } v.LeaveNode(n) diff --git a/node/stmt/n_trait_adaptation_list.go b/node/stmt/n_trait_adaptation_list.go index d2a4b73..fd2f814 100644 --- a/node/stmt/n_trait_adaptation_list.go +++ b/node/stmt/n_trait_adaptation_list.go @@ -30,12 +30,13 @@ func (n *TraitAdaptationList) Walk(v walker.Visitor) { } if n.Adaptations != nil { - vv := v.GetChildrenVisitor("Adaptations") + v.EnterChildList("Adaptations", n) for _, nn := range n.Adaptations { if nn != nil { - nn.Walk(vv) + nn.Walk(v) } } + v.LeaveChildList("Adaptations", n) } v.LeaveNode(n) diff --git a/node/stmt/n_trait_method_ref.go b/node/stmt/n_trait_method_ref.go index f75c381..a1e2bac 100644 --- a/node/stmt/n_trait_method_ref.go +++ b/node/stmt/n_trait_method_ref.go @@ -32,13 +32,15 @@ func (n *TraitMethodRef) Walk(v walker.Visitor) { } if n.Trait != nil { - vv := v.GetChildrenVisitor("Trait") - n.Trait.Walk(vv) + v.EnterChildNode("Trait", n) + n.Trait.Walk(v) + v.LeaveChildNode("Trait", n) } if n.Method != nil { - vv := v.GetChildrenVisitor("Method") - n.Method.Walk(vv) + v.EnterChildNode("Method", n) + n.Method.Walk(v) + v.LeaveChildNode("Method", n) } v.LeaveNode(n) diff --git a/node/stmt/n_trait_use.go b/node/stmt/n_trait_use.go index d39dbec..ebe319e 100644 --- a/node/stmt/n_trait_use.go +++ b/node/stmt/n_trait_use.go @@ -32,17 +32,19 @@ func (n *TraitUse) Walk(v walker.Visitor) { } if n.Traits != nil { - vv := v.GetChildrenVisitor("Traits") + v.EnterChildList("Traits", n) for _, nn := range n.Traits { if nn != nil { - nn.Walk(vv) + nn.Walk(v) } } + v.LeaveChildList("Traits", n) } if n.TraitAdaptationList != nil { - vv := v.GetChildrenVisitor("TraitAdaptationList") - n.TraitAdaptationList.Walk(vv) + v.EnterChildNode("TraitAdaptationList", n) + n.TraitAdaptationList.Walk(v) + v.LeaveChildNode("TraitAdaptationList", n) } v.LeaveNode(n) diff --git a/node/stmt/n_trait_use_alias.go b/node/stmt/n_trait_use_alias.go index 38201fb..32cc32f 100644 --- a/node/stmt/n_trait_use_alias.go +++ b/node/stmt/n_trait_use_alias.go @@ -34,18 +34,21 @@ func (n *TraitUseAlias) Walk(v walker.Visitor) { } if n.Ref != nil { - vv := v.GetChildrenVisitor("Ref") - n.Ref.Walk(vv) + v.EnterChildNode("Ref", n) + n.Ref.Walk(v) + v.LeaveChildNode("Ref", n) } if n.Modifier != nil { - vv := v.GetChildrenVisitor("Modifier") - n.Modifier.Walk(vv) + v.EnterChildNode("Modifier", n) + n.Modifier.Walk(v) + v.LeaveChildNode("Modifier", n) } if n.Alias != nil { - vv := v.GetChildrenVisitor("Alias") - n.Alias.Walk(vv) + v.EnterChildNode("Alias", n) + n.Alias.Walk(v) + v.LeaveChildNode("Alias", n) } v.LeaveNode(n) diff --git a/node/stmt/n_trait_use_precedence.go b/node/stmt/n_trait_use_precedence.go index e85624b..1dd159b 100644 --- a/node/stmt/n_trait_use_precedence.go +++ b/node/stmt/n_trait_use_precedence.go @@ -32,17 +32,19 @@ func (n *TraitUsePrecedence) Walk(v walker.Visitor) { } if n.Ref != nil { - vv := v.GetChildrenVisitor("Ref") - n.Ref.Walk(vv) + v.EnterChildNode("Ref", n) + n.Ref.Walk(v) + v.LeaveChildNode("Ref", n) } if n.Insteadof != nil { - vv := v.GetChildrenVisitor("Insteadof") + v.EnterChildList("Insteadof", n) for _, nn := range n.Insteadof { if nn != nil { - nn.Walk(vv) + nn.Walk(v) } } + v.LeaveChildList("Insteadof", n) } v.LeaveNode(n) diff --git a/node/stmt/n_try.go b/node/stmt/n_try.go index 9bd94d8..d7f3a3f 100644 --- a/node/stmt/n_try.go +++ b/node/stmt/n_try.go @@ -34,26 +34,29 @@ func (n *Try) Walk(v walker.Visitor) { } if n.Stmts != nil { - vv := v.GetChildrenVisitor("Stmts") + v.EnterChildList("Stmts", n) for _, nn := range n.Stmts { if nn != nil { - nn.Walk(vv) + nn.Walk(v) } } + v.LeaveChildList("Stmts", n) } if n.Catches != nil { - vv := v.GetChildrenVisitor("Catches") + v.EnterChildList("Catches", n) for _, nn := range n.Catches { if nn != nil { - nn.Walk(vv) + nn.Walk(v) } } + v.LeaveChildList("Catches", n) } if n.Finally != nil { - vv := v.GetChildrenVisitor("Finally") - n.Finally.Walk(vv) + v.EnterChildNode("Finally", n) + n.Finally.Walk(v) + v.LeaveChildNode("Finally", n) } v.LeaveNode(n) diff --git a/node/stmt/n_unset.go b/node/stmt/n_unset.go index c66f7e7..43ef4ac 100644 --- a/node/stmt/n_unset.go +++ b/node/stmt/n_unset.go @@ -30,12 +30,13 @@ func (n *Unset) Walk(v walker.Visitor) { } if n.Vars != nil { - vv := v.GetChildrenVisitor("Vars") + v.EnterChildList("Vars", n) for _, nn := range n.Vars { if nn != nil { - nn.Walk(vv) + nn.Walk(v) } } + v.LeaveChildList("Vars", n) } v.LeaveNode(n) diff --git a/node/stmt/n_use.go b/node/stmt/n_use.go index 1bbabe1..9261877 100644 --- a/node/stmt/n_use.go +++ b/node/stmt/n_use.go @@ -40,18 +40,21 @@ func (n *Use) Walk(v walker.Visitor) { } if n.UseType != nil { - vv := v.GetChildrenVisitor("UseType") - n.UseType.Walk(vv) + v.EnterChildNode("UseType", n) + n.UseType.Walk(v) + v.LeaveChildNode("UseType", n) } if n.Use != nil { - vv := v.GetChildrenVisitor("Use") - n.Use.Walk(vv) + v.EnterChildNode("Use", n) + n.Use.Walk(v) + v.LeaveChildNode("Use", n) } if n.Alias != nil { - vv := v.GetChildrenVisitor("Alias") - n.Alias.Walk(vv) + v.EnterChildNode("Alias", n) + n.Alias.Walk(v) + v.LeaveChildNode("Alias", n) } v.LeaveNode(n) diff --git a/node/stmt/n_use_list.go b/node/stmt/n_use_list.go index 197773d..a95d038 100644 --- a/node/stmt/n_use_list.go +++ b/node/stmt/n_use_list.go @@ -32,17 +32,19 @@ func (n *UseList) Walk(v walker.Visitor) { } if n.UseType != nil { - vv := v.GetChildrenVisitor("UseType") - n.UseType.Walk(vv) + v.EnterChildNode("UseType", n) + n.UseType.Walk(v) + v.LeaveChildNode("UseType", n) } if n.Uses != nil { - vv := v.GetChildrenVisitor("Uses") + v.EnterChildList("Uses", n) for _, nn := range n.Uses { if nn != nil { - nn.Walk(vv) + nn.Walk(v) } } + v.LeaveChildList("Uses", n) } v.LeaveNode(n) diff --git a/node/stmt/n_while.go b/node/stmt/n_while.go index 3d737b5..d20e296 100644 --- a/node/stmt/n_while.go +++ b/node/stmt/n_while.go @@ -32,13 +32,15 @@ func (n *While) Walk(v walker.Visitor) { } if n.Cond != nil { - vv := v.GetChildrenVisitor("Cond") - n.Cond.Walk(vv) + v.EnterChildNode("Cond", n) + n.Cond.Walk(v) + v.LeaveChildNode("Cond", n) } if n.Stmt != nil { - vv := v.GetChildrenVisitor("Stmt") - n.Stmt.Walk(vv) + v.EnterChildNode("Stmt", n) + n.Stmt.Walk(v) + v.LeaveChildNode("Stmt", n) } v.LeaveNode(n) diff --git a/node/stmt/t_visitor_test.go b/node/stmt/t_visitor_test.go index 7527dab..c7ac8bc 100644 --- a/node/stmt/t_visitor_test.go +++ b/node/stmt/t_visitor_test.go @@ -369,7 +369,7 @@ var nodesToTest = []struct { { &stmt.AltSwitch{ Cond: &expr.Variable{}, - CaseList: &stmt.CaseList{Cases: []node.Node{}}, + CaseList: &stmt.CaseList{}, }, []string{"Cond", "CaseList"}, map[string]interface{}{}, @@ -526,11 +526,15 @@ type visitorMock struct { } func (v *visitorMock) EnterNode(n walker.Walkable) bool { return v.visitChildren } -func (v *visitorMock) GetChildrenVisitor(key string) walker.Visitor { +func (v *visitorMock) LeaveNode(n walker.Walkable) {} +func (v *visitorMock) EnterChildNode(key string, w walker.Walkable) { v.visitedKeys = append(v.visitedKeys, key) - return &visitorMock{v.visitChildren, nil} } -func (v *visitorMock) LeaveNode(n walker.Walkable) {} +func (v *visitorMock) LeaveChildNode(key string, w walker.Walkable) {} +func (v *visitorMock) EnterChildList(key string, w walker.Walkable) { + v.visitedKeys = append(v.visitedKeys, key) +} +func (v *visitorMock) LeaveChildList(key string, w walker.Walkable) {} func TestVisitorDisableChildren(t *testing.T) { for _, tt := range nodesToTest { diff --git a/node/t_visitor_test.go b/node/t_visitor_test.go index 15def8d..bf0b85e 100644 --- a/node/t_visitor_test.go +++ b/node/t_visitor_test.go @@ -26,12 +26,12 @@ var nodesToTest = []struct { map[string]interface{}{"Value": "foo"}, }, { - &node.Nullable{Expr: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}}, + &node.Nullable{Expr: &expr.Variable{}}, []string{"Expr"}, nil, }, { - &node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}}, + &node.Argument{Variadic: true, Expr: &expr.Variable{}}, []string{"Expr"}, map[string]interface{}{"IsReference": false, "Variadic": true}, }, @@ -40,7 +40,7 @@ var nodesToTest = []struct { ByRef: false, Variadic: true, VariableType: &node.Identifier{Value: "foo"}, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "bar"}}, + Variable: &expr.Variable{}, DefaultValue: &scalar.Lnumber{Value: "0"}, }, []string{"VariableType", "Variable", "DefaultValue"}, @@ -70,11 +70,15 @@ type visitorMock struct { } func (v *visitorMock) EnterNode(n walker.Walkable) bool { return v.visitChildren } -func (v *visitorMock) GetChildrenVisitor(key string) walker.Visitor { +func (v *visitorMock) LeaveNode(n walker.Walkable) {} +func (v *visitorMock) EnterChildNode(key string, w walker.Walkable) { v.visitedKeys = append(v.visitedKeys, key) - return &visitorMock{v.visitChildren, nil} } -func (v *visitorMock) LeaveNode(n walker.Walkable) {} +func (v *visitorMock) LeaveChildNode(key string, w walker.Walkable) {} +func (v *visitorMock) EnterChildList(key string, w walker.Walkable) { + v.visitedKeys = append(v.visitedKeys, key) +} +func (v *visitorMock) LeaveChildList(key string, w walker.Walkable) {} func TestNameVisitorDisableChildren(t *testing.T) { for _, tt := range nodesToTest { diff --git a/visitor/dumper.go b/visitor/dumper.go index 0cf56e1..e69f3a1 100644 --- a/visitor/dumper.go +++ b/visitor/dumper.go @@ -5,6 +5,7 @@ import ( "fmt" "io" "reflect" + "strings" "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" @@ -24,7 +25,7 @@ type Dumper struct { } // EnterNode is invoked at every node in hierarchy -func (d Dumper) EnterNode(w walker.Walkable) bool { +func (d *Dumper) EnterNode(w walker.Walkable) bool { n := w.(node.Node) fmt.Fprintf(d.Writer, "%v[%v]\n", d.Indent, reflect.TypeOf(n)) @@ -59,13 +60,26 @@ func (d Dumper) EnterNode(w walker.Walkable) bool { return true } -// GetChildrenVisitor is invoked at every node parameter that contains children nodes -func (d Dumper) GetChildrenVisitor(key string) walker.Visitor { - fmt.Fprintf(d.Writer, "%v%q:\n", d.Indent+" ", key) - return Dumper{d.Writer, d.Indent + " ", d.Comments, d.Positions, d.NsResolver} -} - // LeaveNode is invoked after node process -func (d Dumper) LeaveNode(n walker.Walkable) { +func (d *Dumper) LeaveNode(n walker.Walkable) { // do nothing } + +// GetChildrenVisitor is invoked at every node parameter that contains children nodes +func (d *Dumper) EnterChildNode(key string, w walker.Walkable) { + fmt.Fprintf(d.Writer, "%v%q:\n", d.Indent+" ", key) + d.Indent = d.Indent + " " +} + +func (d *Dumper) LeaveChildNode(key string, w walker.Walkable) { + d.Indent = strings.TrimSuffix(d.Indent, " ") +} + +func (d *Dumper) EnterChildList(key string, w walker.Walkable) { + fmt.Fprintf(d.Writer, "%v%q:\n", d.Indent+" ", key) + d.Indent = d.Indent + " " +} + +func (d *Dumper) LeaveChildList(key string, w walker.Walkable) { + d.Indent = strings.TrimSuffix(d.Indent, " ") +} diff --git a/visitor/dumper_test.go b/visitor/dumper_test.go index c0d3bed..8fedd3b 100644 --- a/visitor/dumper_test.go +++ b/visitor/dumper_test.go @@ -29,7 +29,7 @@ func ExampleDumper() { nsResolver := visitor.NewNamespaceResolver() nodes.Walk(nsResolver) - dumper := visitor.Dumper{ + dumper := &visitor.Dumper{ Writer: os.Stdout, Indent: "| ", Comments: php7parser.GetComments(), diff --git a/visitor/go_dumper.go b/visitor/go_dumper.go new file mode 100644 index 0000000..a857cb0 --- /dev/null +++ b/visitor/go_dumper.go @@ -0,0 +1,93 @@ +// Package visitor contains walker.visitor implementations +package visitor + +import ( + "fmt" + "io" + "reflect" + "strings" + + "github.com/z7zmey/php-parser/node" + + "github.com/z7zmey/php-parser/walker" +) + +// GoDumper writes ast hierarchy to an io.Writer as native Golang struct +type GoDumper struct { + Writer io.Writer + depth int + isChildNode bool +} + +func printIndent(w io.Writer, d int) { + for i := 0; i < d; i++ { + io.WriteString(w, "\t") + } +} + +// EnterNode is invoked at every node in hierarchy +func (d *GoDumper) EnterNode(w walker.Walkable) bool { + n := w.(node.Node) + + nodeType := reflect.TypeOf(n).String() + nodeType = strings.Replace(nodeType, "*", "&", 1) + + if d.isChildNode { + d.isChildNode = false + } else { + printIndent(d.Writer, d.depth) + } + + io.WriteString(d.Writer, nodeType+"{\n") + + d.depth++ + + if a := n.Attributes(); len(a) > 0 { + for key, attr := range a { + printIndent(d.Writer, d.depth) + switch attr.(type) { + case string: + fmt.Fprintf(d.Writer, "%s: %q,\n", key, attr) + default: + fmt.Fprintf(d.Writer, "%s: %v,\n", key, attr) + } + } + } + + return true +} + +// LeaveNode is invoked after node process +func (d *GoDumper) LeaveNode(n walker.Walkable) { + d.depth-- + printIndent(d.Writer, d.depth) + if d.depth != 0 { + io.WriteString(d.Writer, "},\n") + } else { + io.WriteString(d.Writer, "}\n") + } +} + +func (d *GoDumper) EnterChildNode(key string, w walker.Walkable) { + printIndent(d.Writer, d.depth) + io.WriteString(d.Writer, key+": ") + d.isChildNode = true +} + +func (d *GoDumper) LeaveChildNode(key string, w walker.Walkable) { + // do nothing +} + +func (d *GoDumper) EnterChildList(key string, w walker.Walkable) { + printIndent(d.Writer, d.depth) + io.WriteString(d.Writer, key+": []node.Node{\n") + d.depth++ +} + +func (d *GoDumper) LeaveChildList(key string, w walker.Walkable) { + d.depth-- + printIndent(d.Writer, d.depth) + if d.depth != 0 { + io.WriteString(d.Writer, "},\n") + } +} diff --git a/visitor/go_dumper_test.go b/visitor/go_dumper_test.go new file mode 100644 index 0000000..7d29252 --- /dev/null +++ b/visitor/go_dumper_test.go @@ -0,0 +1,111 @@ +//Package visitor contains walker.visitor implementations +package visitor_test + +import ( + "bytes" + "os" + + "github.com/z7zmey/php-parser/php7" + "github.com/z7zmey/php-parser/visitor" +) + +func ExampleGoDumper() { + src := ` Date: Tue, 19 Jun 2018 23:55:12 +0300 Subject: [PATCH 002/117] #30 created json dumper --- README.md | 10 +- main.go | 57 +++++- visitor/dumper.go | 11 +- visitor/dumper_test.go | 160 ++++++++--------- visitor/json_dumper.go | 97 +++++++++++ visitor/json_dumper_test.go | 43 +++++ visitor/pretty_json_dumper.go | 145 ++++++++++++++++ visitor/pretty_json_dumper_test.go | 269 +++++++++++++++++++++++++++++ 8 files changed, 700 insertions(+), 92 deletions(-) create mode 100644 visitor/json_dumper.go create mode 100644 visitor/json_dumper_test.go create mode 100644 visitor/pretty_json_dumper.go create mode 100644 visitor/pretty_json_dumper_test.go diff --git a/README.md b/README.md index b998659..e4dbd19 100644 --- a/README.md +++ b/README.md @@ -47,9 +47,17 @@ CLI --- ``` -php-parser [-php5 -noDump] ... +php-parser [flags] ... ``` +| flag | type | description | +|-------|------|----------------------------------------------| +| -d |string| dump format: [custom, go, json, pretty-json] | +| -p | bool | show positions | +| -c | bool | show comments | +| -r | bool | resolve names | +| -php5 | bool | parse as PHP5 | + Dump AST to stdout. Example diff --git a/main.go b/main.go index 151d3b7..ac260c7 100644 --- a/main.go +++ b/main.go @@ -17,11 +17,18 @@ import ( var wg sync.WaitGroup var usePhp5 *bool -var noDump *bool +var dumpType string +var showPositions *bool +var showComments *bool +var showResolvedNs *bool func main() { - usePhp5 = flag.Bool("php5", false, "use PHP5 parserWorker") - noDump = flag.Bool("noDump", false, "disable dumping to stdout") + usePhp5 = flag.Bool("php5", false, "parse as PHP5") + showPositions = flag.Bool("p", false, "show positions") + showComments = flag.Bool("c", false, "show comments") + showResolvedNs = flag.Bool("r", false, "resolve names") + flag.StringVar(&dumpType, "d", "", "dump format: [custom, go, json, pretty_json]") + flag.Parse() pathCh := make(chan string) @@ -95,19 +102,53 @@ func printer(result <-chan parser.Parser) { fmt.Println(e) } - if !*noDump { - nsResolver := visitor.NewNamespaceResolver() + var nsResolver *visitor.NamespaceResolver + if *showResolvedNs { + nsResolver = visitor.NewNamespaceResolver() parserWorker.GetRootNode().Walk(nsResolver) + } + var comments parser.Comments + if *showComments { + comments = parserWorker.GetComments() + } + + var positions parser.Positions + if *showPositions { + positions = parserWorker.GetPositions() + } + + switch dumpType { + case "custom": dumper := &visitor.Dumper{ Writer: os.Stdout, - Indent: " | ", - Comments: parserWorker.GetComments(), - Positions: parserWorker.GetPositions(), + Indent: "| ", + Comments: comments, + Positions: positions, NsResolver: nsResolver, } parserWorker.GetRootNode().Walk(dumper) + case "json": + dumper := &visitor.JsonDumper{ + Writer: os.Stdout, + Comments: comments, + Positions: positions, + NsResolver: nsResolver, + } + parserWorker.GetRootNode().Walk(dumper) + case "pretty_json": + dumper := &visitor.PrettyJsonDumper{ + Writer: os.Stdout, + Comments: comments, + Positions: positions, + NsResolver: nsResolver, + } + parserWorker.GetRootNode().Walk(dumper) + case "go": + dumper := &visitor.GoDumper{Writer: os.Stdout} + parserWorker.GetRootNode().Walk(dumper) } + wg.Done() } } diff --git a/visitor/dumper.go b/visitor/dumper.go index e69f3a1..862c3ca 100644 --- a/visitor/dumper.go +++ b/visitor/dumper.go @@ -32,13 +32,13 @@ func (d *Dumper) EnterNode(w walker.Walkable) bool { if d.Positions != nil { if p := d.Positions[n]; p != nil { - fmt.Fprintf(d.Writer, "%v\"Position\": %s;\n", d.Indent+" ", *p) + fmt.Fprintf(d.Writer, "%v\"Position\": %s\n", d.Indent+" ", *p) } } if d.NsResolver != nil { if namespacedName, ok := d.NsResolver.ResolvedNames[n]; ok { - fmt.Fprintf(d.Writer, "%v\"NamespacedName\": %s;\n", d.Indent+" ", namespacedName) + fmt.Fprintf(d.Writer, "%v\"NamespacedName\": %q\n", d.Indent+" ", namespacedName) } } @@ -53,7 +53,12 @@ func (d *Dumper) EnterNode(w walker.Walkable) bool { if a := n.Attributes(); len(a) > 0 { for key, attr := range a { - fmt.Fprintf(d.Writer, "%v\"%v\": %v;\n", d.Indent+" ", key, attr) + switch attr.(type) { + case string: + fmt.Fprintf(d.Writer, "%v\"%v\": %q\n", d.Indent+" ", key, attr) + default: + fmt.Fprintf(d.Writer, "%v\"%v\": %v\n", d.Indent+" ", key, attr) + } } } diff --git a/visitor/dumper_test.go b/visitor/dumper_test.go index 8fedd3b..127af48 100644 --- a/visitor/dumper_test.go +++ b/visitor/dumper_test.go @@ -39,84 +39,84 @@ func ExampleDumper() { nodes.Walk(dumper) // Unordered output: - //| [*node.Root] - //| "Position": Pos{Line: 3-11 Pos: 10-143}; - //| "Stmts": - //| [*stmt.Namespace] - //| "Position": Pos{Line: 3-11 Pos: 10-143}; - //| "NamespaceName": - //| [*name.Name] - //| "Position": Pos{Line: 3-3 Pos: 20-22}; - //| "Parts": - //| [*name.NamePart] - //| "Position": Pos{Line: 3-3 Pos: 20-22}; - //| "Value": Foo; - //| "Stmts": - //| [*stmt.Class] - //| "Position": Pos{Line: 4-10 Pos: 29-139}; - //| "NamespacedName": Foo\Bar; - //| "PhpDocComment": ; - //| "ClassName": - //| [*node.Identifier] - //| "Position": Pos{Line: 4-4 Pos: 35-37}; - //| "Value": Bar; - //| "Stmts": - //| [*stmt.ClassMethod] - //| "Position": Pos{Line: 5-9 Pos: 45-134}; - //| "ReturnsRef": false; - //| "PhpDocComment": ; - //| "MethodName": - //| [*node.Identifier] - //| "Position": Pos{Line: 5-5 Pos: 61-72}; - //| "Value": FunctionName; - //| "Modifiers": - //| [*node.Identifier] - //| "Position": Pos{Line: 5-5 Pos: 45-50}; - //| "Value": public; - //| "Params": - //| [*node.Parameter] - //| "Position": Pos{Line: 5-5 Pos: 74-89}; - //| "ByRef": false; - //| "Variadic": false; - //| "VariableType": - //| [*name.Name] - //| "Position": Pos{Line: 5-5 Pos: 74-77}; - //| "NamespacedName": Foo\Type; - //| "Parts": - //| [*name.NamePart] - //| "Position": Pos{Line: 5-5 Pos: 74-77}; - //| "Value": Type; - //| "Variable": - //| [*expr.Variable] - //| "Position": Pos{Line: 5-5 Pos: 79-82}; - //| "VarName": - //| [*node.Identifier] - //| "Position": Pos{Line: 5-5 Pos: 79-82}; - //| "Value": var; - //| "DefaultValue": - //| [*expr.ConstFetch] - //| "Position": Pos{Line: 5-5 Pos: 86-89}; - //| "Constant": - //| [*name.Name] - //| "Position": Pos{Line: 5-5 Pos: 86-89}; - //| "NamespacedName": null; - //| "Parts": - //| [*name.NamePart] - //| "Position": Pos{Line: 5-5 Pos: 86-89}; - //| "Value": null; - //| "Stmt": - //| [*stmt.StmtList] - //| "Position": Pos{Line: 6-9 Pos: 96-134}; - //| "Stmts": - //| [*stmt.Expression] - //| "Position": Pos{Line: 8-8 Pos: 124-128}; - //| "Expr": - //| [*expr.Variable] - //| "Position": Pos{Line: 8-8 Pos: 124-127}; - //| "Comments": - //| "// some comment\n" before "VariableToken" - //| "VarName": - //| [*node.Identifier] - //| "Position": Pos{Line: 8-8 Pos: 124-127}; - //| "Value": var; + // | [*node.Root] + // | "Position": Pos{Line: 3-11 Pos: 10-143} + // | "Stmts": + // | [*stmt.Namespace] + // | "Position": Pos{Line: 3-11 Pos: 10-143} + // | "NamespaceName": + // | [*name.Name] + // | "Position": Pos{Line: 3-3 Pos: 20-22} + // | "Parts": + // | [*name.NamePart] + // | "Position": Pos{Line: 3-3 Pos: 20-22} + // | "Value": "Foo" + // | "Stmts": + // | [*stmt.Class] + // | "Position": Pos{Line: 4-10 Pos: 29-139} + // | "NamespacedName": "Foo\\Bar" + // | "PhpDocComment": "" + // | "ClassName": + // | [*node.Identifier] + // | "Position": Pos{Line: 4-4 Pos: 35-37} + // | "Value": "Bar" + // | "Stmts": + // | [*stmt.ClassMethod] + // | "Position": Pos{Line: 5-9 Pos: 45-134} + // | "ReturnsRef": false + // | "PhpDocComment": "" + // | "MethodName": + // | [*node.Identifier] + // | "Position": Pos{Line: 5-5 Pos: 61-72} + // | "Value": "FunctionName" + // | "Modifiers": + // | [*node.Identifier] + // | "Position": Pos{Line: 5-5 Pos: 45-50} + // | "Value": "public" + // | "Params": + // | [*node.Parameter] + // | "Position": Pos{Line: 5-5 Pos: 74-89} + // | "Variadic": false + // | "ByRef": false + // | "VariableType": + // | [*name.Name] + // | "Position": Pos{Line: 5-5 Pos: 74-77} + // | "NamespacedName": "Foo\\Type" + // | "Parts": + // | [*name.NamePart] + // | "Position": Pos{Line: 5-5 Pos: 74-77} + // | "Value": "Type" + // | "Variable": + // | [*expr.Variable] + // | "Position": Pos{Line: 5-5 Pos: 79-82} + // | "VarName": + // | [*node.Identifier] + // | "Position": Pos{Line: 5-5 Pos: 79-82} + // | "Value": "var" + // | "DefaultValue": + // | [*expr.ConstFetch] + // | "Position": Pos{Line: 5-5 Pos: 86-89} + // | "Constant": + // | [*name.Name] + // | "Position": Pos{Line: 5-5 Pos: 86-89} + // | "NamespacedName": "null" + // | "Parts": + // | [*name.NamePart] + // | "Position": Pos{Line: 5-5 Pos: 86-89} + // | "Value": "null" + // | "Stmt": + // | [*stmt.StmtList] + // | "Position": Pos{Line: 6-9 Pos: 96-134} + // | "Stmts": + // | [*stmt.Expression] + // | "Position": Pos{Line: 8-8 Pos: 124-128} + // | "Expr": + // | [*expr.Variable] + // | "Position": Pos{Line: 8-8 Pos: 124-127} + // | "Comments": + // | "// some comment\n" before "VariableToken" + // | "VarName": + // | [*node.Identifier] + // | "Position": Pos{Line: 8-8 Pos: 124-127} + // | "Value": "var" } diff --git a/visitor/json_dumper.go b/visitor/json_dumper.go new file mode 100644 index 0000000..9903000 --- /dev/null +++ b/visitor/json_dumper.go @@ -0,0 +1,97 @@ +// Package visitor contains walker.visitor implementations +package visitor + +import ( + "fmt" + "io" + "reflect" + + "github.com/z7zmey/php-parser/node" + "github.com/z7zmey/php-parser/parser" + + "github.com/z7zmey/php-parser/walker" +) + +type JsonDumper struct { + Writer io.Writer + Comments parser.Comments + Positions parser.Positions + NsResolver *NamespaceResolver +} + +// EnterNode is invoked at every node in hierarchy +func (d *JsonDumper) EnterNode(w walker.Walkable) bool { + n := w.(node.Node) + + nodeType := reflect.TypeOf(n).String() + + fmt.Fprintf(d.Writer, "{%q:%q", "type", nodeType) + + if d.Positions != nil { + if p := d.Positions[n]; p != nil { + fmt.Fprintf(d.Writer, ",%q:{%q:%d,%q:%d,%q:%d,%q:%d}", + "position", + "startPos", p.StartPos, + "endPos", p.EndPos, + "startLine", p.StartLine, + "endLine", p.EndLine) + } + } + + if d.NsResolver != nil { + if namespacedName, ok := d.NsResolver.ResolvedNames[n]; ok { + fmt.Fprintf(d.Writer, ",%q:%q", "namespacedName", namespacedName) + } + } + + if d.Comments != nil { + if c := d.Comments[n]; len(c) > 0 { + fmt.Fprintf(d.Writer, ",%q:[", "comments") + + for k, cc := range c { + if k == 0 { + fmt.Fprintf(d.Writer, "%q", cc) + } else { + fmt.Fprintf(d.Writer, ",%q", cc) + } + } + + fmt.Fprint(d.Writer, "]") + } + } + + if a := n.Attributes(); len(a) > 0 { + for key, attr := range a { + switch attr.(type) { + case string: + fmt.Fprintf(d.Writer, ",\"%s\":%q", key, attr) + default: + fmt.Fprintf(d.Writer, ",\"%s\":%v", key, attr) + } + } + } + + return true +} + +// LeaveNode is invoked after node process +func (d *JsonDumper) LeaveNode(n walker.Walkable) { + fmt.Fprint(d.Writer, "}") +} + +func (d *JsonDumper) EnterChildNode(key string, w walker.Walkable) { + fmt.Fprintf(d.Writer, ",%q:", key) +} + +func (d *JsonDumper) LeaveChildNode(key string, w walker.Walkable) { + // do nothing +} + +func (d *JsonDumper) EnterChildList(key string, w walker.Walkable) { + fmt.Fprintf(d.Writer, ",%q:[", key) + +} + +func (d *JsonDumper) LeaveChildList(key string, w walker.Walkable) { + fmt.Fprint(d.Writer, "]") +} diff --git a/visitor/json_dumper_test.go b/visitor/json_dumper_test.go new file mode 100644 index 0000000..b53c39f --- /dev/null +++ b/visitor/json_dumper_test.go @@ -0,0 +1,43 @@ +//Package visitor contains walker.visitor implementations +package visitor_test + +import ( + "bytes" + "os" + + "github.com/z7zmey/php-parser/php7" + "github.com/z7zmey/php-parser/visitor" +) + +func ExampleJsonDumper() { + src := ` 0 { + fmt.Fprint(d.Writer, ",\n") + d.printIndent(d.Writer) + fmt.Fprint(d.Writer, "\"comments\": [\n") + d.depth++ + for k, cc := range c { + if k == 0 { + d.printIndent(d.Writer) + fmt.Fprintf(d.Writer, "%q", cc) + } else { + fmt.Fprint(d.Writer, ",\n") + d.printIndent(d.Writer) + fmt.Fprintf(d.Writer, "%q", cc) + } + } + d.depth-- + fmt.Fprint(d.Writer, "\n") + d.printIndent(d.Writer) + fmt.Fprint(d.Writer, "]") + } + } + + if a := n.Attributes(); len(a) > 0 { + for key, attr := range a { + fmt.Fprint(d.Writer, ",\n") + d.printIndent(d.Writer) + switch attr.(type) { + case string: + fmt.Fprintf(d.Writer, "\"%s\": %q", key, attr) + default: + fmt.Fprintf(d.Writer, "\"%s\": %v", key, attr) + } + } + } + + return true +} + +// LeaveNode is invoked after node process +func (d *PrettyJsonDumper) LeaveNode(n walker.Walkable) { + d.depth-- + fmt.Fprint(d.Writer, "\n") + d.printIndent(d.Writer) + fmt.Fprint(d.Writer, "}") +} + +func (d *PrettyJsonDumper) EnterChildNode(key string, w walker.Walkable) { + fmt.Fprint(d.Writer, ",\n") + d.printIndent(d.Writer) + fmt.Fprintf(d.Writer, "%q: ", key) + d.isChildNode = true +} + +func (d *PrettyJsonDumper) LeaveChildNode(key string, w walker.Walkable) { + // do nothing +} + +func (d *PrettyJsonDumper) EnterChildList(key string, w walker.Walkable) { + fmt.Fprint(d.Writer, ",\n") + d.printIndent(d.Writer) + fmt.Fprintf(d.Writer, "%q: [\n", key) + d.depth++ +} + +func (d *PrettyJsonDumper) LeaveChildList(key string, w walker.Walkable) { + d.depth-- + fmt.Fprint(d.Writer, "\n") + d.printIndent(d.Writer) + fmt.Fprint(d.Writer, "]") +} diff --git a/visitor/pretty_json_dumper_test.go b/visitor/pretty_json_dumper_test.go new file mode 100644 index 0000000..c77ec87 --- /dev/null +++ b/visitor/pretty_json_dumper_test.go @@ -0,0 +1,269 @@ +//Package visitor contains walker.visitor implementations +package visitor_test + +import ( + "bytes" + "os" + + "github.com/z7zmey/php-parser/php7" + "github.com/z7zmey/php-parser/visitor" +) + +func ExamplePrettyJsonDumper() { + src := ` Date: Thu, 21 Jun 2018 20:37:34 +0300 Subject: [PATCH 003/117] cli: add -prof flag --- .gitignore | 4 ++-- Makefile | 8 ++++---- README.md | 1 + main.go | 10 ++++++++++ 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 66451b4..032c7f4 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,7 @@ php-parser *example.php -cpu.prof -mem.prof +cpu.pprof +mem.pprof php7.test php5.test diff --git a/Makefile b/Makefile index 4f0a311..14e7188 100644 --- a/Makefile +++ b/Makefile @@ -36,12 +36,12 @@ compile: ./php5/php5.go ./php7/php7.go ./scanner/scanner.go goyacc -o $@ $< cpu_pprof: - GOGC=off go test -cpuprofile cpu.prof -bench=. -benchtime=20s ./php7 - go tool pprof ./php7.test cpu.prof + GOGC=off go test -cpuprofile cpu.pprof -bench=. -benchtime=20s ./php7 + go tool pprof ./php7.test cpu.pprof mem_pprof: - GOGC=off go test -memprofile mem.prof -bench=. -benchtime=20s -benchmem ./php7 - go tool pprof -alloc_objects ./php7.test mem.prof + GOGC=off go test -memprofile mem.pprof -bench=. -benchtime=20s -benchmem ./php7 + go tool pprof -alloc_objects ./php7.test mem.pprof cpu_pprof_php5: GOGC=off go test -cpuprofile cpu.prof -bench=. -benchtime=20s ./php5 diff --git a/README.md b/README.md index e4dbd19..0d3e482 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,7 @@ php-parser [flags] ... | flag | type | description | |-------|------|----------------------------------------------| | -d |string| dump format: [custom, go, json, pretty-json] | +| -prof |string| start profiler: [cpu, mem] | | -p | bool | show positions | | -c | bool | show comments | | -r | bool | resolve names | diff --git a/main.go b/main.go index ac260c7..05bceba 100644 --- a/main.go +++ b/main.go @@ -8,6 +8,7 @@ import ( "path/filepath" "sync" + "github.com/pkg/profile" "github.com/yookoala/realpath" "github.com/z7zmey/php-parser/parser" "github.com/z7zmey/php-parser/php5" @@ -18,6 +19,7 @@ import ( var wg sync.WaitGroup var usePhp5 *bool var dumpType string +var profiler string var showPositions *bool var showComments *bool var showResolvedNs *bool @@ -28,9 +30,17 @@ func main() { showComments = flag.Bool("c", false, "show comments") showResolvedNs = flag.Bool("r", false, "resolve names") flag.StringVar(&dumpType, "d", "", "dump format: [custom, go, json, pretty_json]") + flag.StringVar(&profiler, "prof", "", "start profiler: [cpu, mem]") flag.Parse() + switch profiler { + case "cpu": + defer profile.Start(profile.ProfilePath("."), profile.NoShutdownHook).Stop() + case "mem": + defer profile.Start(profile.MemProfile, profile.ProfilePath("."), profile.NoShutdownHook).Stop() + } + pathCh := make(chan string) resultCh := make(chan parser.Parser) From f068fb7aae086b092d2f492fc23dac485328fc2e Mon Sep 17 00:00:00 2001 From: z7zmey Date: Fri, 22 Jun 2018 01:00:02 +0300 Subject: [PATCH 004/117] add file counter --- main.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 05bceba..7151f5b 100644 --- a/main.go +++ b/main.go @@ -100,13 +100,17 @@ func parserWorker(pathCh <-chan string, result chan<- parser.Parser) { } func printer(result <-chan parser.Parser) { + var counter int + for { parserWorker, ok := <-result if !ok { return } - fmt.Printf("==> %s\n", parserWorker.GetPath()) + counter++ + + fmt.Printf("==> [%d] %s\n", counter, parserWorker.GetPath()) for _, e := range parserWorker.GetErrors() { fmt.Println(e) From 81425528a5fb5366e4c1a758e49b0a89f5d88a67 Mon Sep 17 00:00:00 2001 From: z7zmey Date: Mon, 25 Jun 2018 20:14:36 +0300 Subject: [PATCH 005/117] close file --- main.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 7151f5b..f3adeec 100644 --- a/main.go +++ b/main.go @@ -86,7 +86,8 @@ func parserWorker(pathCh <-chan string, result chan<- parser.Parser) { return } - src, _ := os.Open(path) + src, err := os.Open(path) + checkErr(err) if *usePhp5 { parserWorker = php5.NewParser(src, path) @@ -95,6 +96,9 @@ func parserWorker(pathCh <-chan string, result chan<- parser.Parser) { } parserWorker.Parse() + + src.Close() + result <- parserWorker } } From 6ac67675d587b43c1e57ad24a22897908da47a44 Mon Sep 17 00:00:00 2001 From: z7zmey Date: Mon, 25 Jun 2018 18:20:16 +0300 Subject: [PATCH 006/117] use karrick/godirwalk --- main.go | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/main.go b/main.go index f3adeec..3a6e572 100644 --- a/main.go +++ b/main.go @@ -8,6 +8,7 @@ import ( "path/filepath" "sync" + "github.com/karrick/godirwalk" "github.com/pkg/profile" "github.com/yookoala/realpath" "github.com/z7zmey/php-parser/parser" @@ -66,14 +67,27 @@ func processPath(pathList []string, pathCh chan<- string) { real, err := realpath.Realpath(path) checkErr(err) - err = filepath.Walk(real, func(path string, f os.FileInfo, err error) error { - if !f.IsDir() && filepath.Ext(path) == ".php" { - wg.Add(1) - pathCh <- path - } - return nil - }) + s, err := os.Stat(real) checkErr(err) + + if !s.IsDir() { + wg.Add(1) + pathCh <- real + } else { + godirwalk.Walk(real, &godirwalk.Options{ + Unsorted: true, + Callback: func(osPathname string, de *godirwalk.Dirent) error { + if !de.IsDir() && filepath.Ext(osPathname) == ".php" { + wg.Add(1) + pathCh <- osPathname + } + return nil + }, + ErrorCallback: func(osPathname string, err error) godirwalk.ErrorAction { + return godirwalk.SkipNode + }, + }) + } } } From 1ebb0c6fad1266f3aacfc88f38653f0147601f30 Mon Sep 17 00:00:00 2001 From: z7zmey Date: Sun, 24 Jun 2018 10:19:44 +0300 Subject: [PATCH 007/117] #25: save position within node --- errors/error.go | 7 +- errors/error_test.go | 15 +- main.go | 10 - node/expr/assign/n_assign.go | 16 +- node/expr/assign/n_assign_ref.go | 16 +- node/expr/assign/n_bitwise_and.go | 16 +- node/expr/assign/n_bitwise_or.go | 16 +- node/expr/assign/n_bitwise_xor.go | 16 +- node/expr/assign/n_concat.go | 16 +- node/expr/assign/n_div.go | 16 +- node/expr/assign/n_minus.go | 16 +- node/expr/assign/n_mod.go | 16 +- node/expr/assign/n_mul.go | 16 +- node/expr/assign/n_plus.go | 16 +- node/expr/assign/n_pow.go | 16 +- node/expr/assign/n_shift_left.go | 16 +- node/expr/assign/n_shift_right.go | 16 +- node/expr/assign/t_assign_op_test.go | 903 +- node/expr/binary/n_bitwise_and.go | 20 +- node/expr/binary/n_bitwise_or.go | 20 +- node/expr/binary/n_bitwise_xor.go | 20 +- node/expr/binary/n_boolean_and.go | 20 +- node/expr/binary/n_boolean_or.go | 20 +- node/expr/binary/n_coalesce.go | 20 +- node/expr/binary/n_concat.go | 20 +- node/expr/binary/n_div.go | 20 +- node/expr/binary/n_equal.go | 20 +- node/expr/binary/n_greater.go | 20 +- node/expr/binary/n_greater_or_equal.go | 20 +- node/expr/binary/n_identical.go | 20 +- node/expr/binary/n_logical_and.go | 20 +- node/expr/binary/n_logical_or.go | 20 +- node/expr/binary/n_logical_xor.go | 20 +- node/expr/binary/n_minus.go | 20 +- node/expr/binary/n_mod.go | 20 +- node/expr/binary/n_mul.go | 20 +- node/expr/binary/n_not_equal.go | 20 +- node/expr/binary/n_not_identical.go | 20 +- node/expr/binary/n_plus.go | 20 +- node/expr/binary/n_pow.go | 20 +- node/expr/binary/n_shift_left.go | 20 +- node/expr/binary/n_shift_right.go | 20 +- node/expr/binary/n_smaller.go | 20 +- node/expr/binary/n_smaller_or_equal.go | 20 +- node/expr/binary/n_spaceship.go | 20 +- node/expr/binary/t_binary_op_test.go | 1459 +- node/expr/cast/n_cast_array.go | 16 +- node/expr/cast/n_cast_bool.go | 16 +- node/expr/cast/n_cast_double.go | 16 +- node/expr/cast/n_cast_int.go | 16 +- node/expr/cast/n_cast_object.go | 16 +- node/expr/cast/n_cast_string.go | 16 +- node/expr/cast/n_cast_unset.go | 16 +- node/expr/cast/t_cast_test.go | 419 +- node/expr/n_array.go | 16 +- node/expr/n_array_dim_fetch.go | 16 +- node/expr/n_array_item.go | 20 +- node/expr/n_bitwise_not.go | 16 +- node/expr/n_boolean_not.go | 16 +- node/expr/n_class_const_fetch.go | 16 +- node/expr/n_clone.go | 16 +- node/expr/n_closure.go | 26 +- node/expr/n_closure_use.go | 16 +- node/expr/n_const_fetch.go | 14 +- node/expr/n_die.go | 16 +- node/expr/n_empty.go | 16 +- node/expr/n_error_suppress.go | 16 +- node/expr/n_eval.go | 16 +- node/expr/n_exit.go | 16 +- node/expr/n_function_call.go | 16 +- node/expr/n_include.go | 16 +- node/expr/n_include_once.go | 16 +- node/expr/n_instance_of.go | 20 +- node/expr/n_isset.go | 14 +- node/expr/n_list.go | 16 +- node/expr/n_method_call.go | 18 +- node/expr/n_new.go | 16 +- node/expr/n_post_dec.go | 14 +- node/expr/n_post_inc.go | 14 +- node/expr/n_pre_dec.go | 14 +- node/expr/n_pre_inc.go | 14 +- node/expr/n_print.go | 16 +- node/expr/n_property_fetch.go | 16 +- node/expr/n_reference.go | 14 +- node/expr/n_require.go | 16 +- node/expr/n_require_once.go | 16 +- node/expr/n_shell_exec.go | 16 +- node/expr/n_short_array.go | 16 +- node/expr/n_short_list.go | 16 +- node/expr/n_static_call.go | 18 +- node/expr/n_static_property_fetch.go | 16 +- node/expr/n_ternary.go | 18 +- node/expr/n_unary_minus.go | 16 +- node/expr/n_unary_plus.go | 16 +- node/expr/n_variable.go | 16 +- node/expr/n_yield.go | 20 +- node/expr/n_yield_from.go | 16 +- node/expr/t_array_dim_fetch_test.go | 111 +- node/expr/t_array_test.go | 129 +- node/expr/t_bitwise_not_test.go | 37 +- node/expr/t_boolean_not_test.go | 37 +- node/expr/t_class_const_fetch_test.go | 83 +- node/expr/t_clone_test.go | 73 +- node/expr/t_closure_test.go | 291 +- node/expr/t_const_fetch_test.go | 115 +- node/expr/t_empty_test.go | 37 +- node/expr/t_error_supress_test.go | 37 +- node/expr/t_eval_test.go | 37 +- node/expr/t_exit_test.go | 115 +- node/expr/t_function_call_test.go | 291 +- node/expr/t_inc_dec_test.go | 145 +- node/expr/t_include_test.go | 145 +- node/expr/t_instance_of_test.go | 157 +- node/expr/t_isset_test.go | 91 +- node/expr/t_list_test.go | 259 +- node/expr/t_method_call_test.go | 56 +- node/expr/t_new_test.go | 207 +- node/expr/t_print_test.go | 37 +- node/expr/t_property_fetch_test.go | 47 +- node/expr/t_reference_test.go | 81 +- node/expr/t_shell_exec_test.go | 47 +- node/expr/t_short_array_test.go | 129 +- node/expr/t_short_list_test.go | 217 +- node/expr/t_static_call_test.go | 284 +- node/expr/t_static_property_fetch_test.go | 157 +- node/expr/t_ternary_test.go | 359 +- node/expr/t_unary_test.go | 73 +- node/expr/t_variable_test.go | 69 +- node/expr/t_yield_test.go | 222 +- node/n_argument.go | 22 +- node/n_argument_list.go | 14 +- node/n_identifier.go | 20 +- node/n_nullable.go | 20 +- node/n_parameter.go | 26 +- node/n_root.go | 16 +- node/name/n_fully_qualified.go | 16 +- node/name/n_name.go | 16 +- node/name/n_name_part.go | 20 +- node/name/n_relative.go | 16 +- node/name/t_name_test.go | 142 +- node/node.go | 7 +- node/scalar/node_dnumber.go | 20 +- node/scalar/node_encapsed.go | 18 +- node/scalar/node_encapsed_string_part.go | 20 +- node/scalar/node_heredoc.go | 22 +- node/scalar/node_lnumber.go | 20 +- node/scalar/node_magic_constant.go | 20 +- node/scalar/node_string.go | 20 +- node/scalar/t_encapsed_test.go | 466 +- node/scalar/t_heredoc_test.go | 187 +- node/scalar/t_magic_constant_test.go | 23 +- node/scalar/t_numbers_test.go | 155 +- node/scalar/t_string_test.go | 112 +- node/stmt/n_alt_else.go | 16 +- node/stmt/n_alt_else_if.go | 20 +- node/stmt/n_alt_for.go | 28 +- node/stmt/n_alt_foreach.go | 20 +- node/stmt/n_alt_if.go | 28 +- node/stmt/n_alt_switch.go | 16 +- node/stmt/n_alt_while.go | 20 +- node/stmt/n_break.go | 16 +- node/stmt/n_case.go | 20 +- node/stmt/n_case_list.go | 16 +- node/stmt/n_catch.go | 18 +- node/stmt/n_class.go | 26 +- node/stmt/n_class_const_list.go | 16 +- node/stmt/n_class_extends.go | 14 +- node/stmt/n_class_implements.go | 14 +- node/stmt/n_class_method.go | 26 +- node/stmt/n_const_list.go | 16 +- node/stmt/n_constant.go | 18 +- node/stmt/n_continue.go | 16 +- node/stmt/n_declare.go | 20 +- node/stmt/n_default.go | 16 +- node/stmt/n_do.go | 20 +- node/stmt/n_echo.go | 16 +- node/stmt/n_else.go | 16 +- node/stmt/n_else_if.go | 20 +- node/stmt/n_expression.go | 16 +- node/stmt/n_finally.go | 16 +- node/stmt/n_for.go | 28 +- node/stmt/n_foreach.go | 20 +- node/stmt/n_function.go | 24 +- node/stmt/n_global.go | 16 +- node/stmt/n_goto.go | 16 +- node/stmt/n_group_use.go | 24 +- node/stmt/n_halt_compiler.go | 16 +- node/stmt/n_if.go | 28 +- node/stmt/n_inline_html.go | 20 +- node/stmt/n_interface.go | 20 +- node/stmt/n_interface_extends.go | 14 +- node/stmt/n_label.go | 14 +- node/stmt/n_namespace.go | 16 +- node/stmt/n_nop.go | 16 +- node/stmt/n_property.go | 18 +- node/stmt/n_property_list.go | 16 +- node/stmt/n_return.go | 16 +- node/stmt/n_static.go | 16 +- node/stmt/n_static_var.go | 16 +- node/stmt/n_stmt_list.go | 16 +- node/stmt/n_switch.go | 16 +- node/stmt/n_throw.go | 16 +- node/stmt/n_trait.go | 18 +- node/stmt/n_trait_adaptation_list.go | 14 +- node/stmt/n_trait_method_ref.go | 20 +- node/stmt/n_trait_use.go | 16 +- node/stmt/n_trait_use_alias.go | 18 +- node/stmt/n_trait_use_precedence.go | 16 +- node/stmt/n_try.go | 24 +- node/stmt/n_unset.go | 16 +- node/stmt/n_use.go | 24 +- node/stmt/n_use_list.go | 20 +- node/stmt/n_while.go | 20 +- node/stmt/t_alt_if_test.go | 295 +- node/stmt/t_class_const_list_test.go | 173 +- node/stmt/t_class_method_test.go | 480 +- node/stmt/t_class_test.go | 334 +- node/stmt/t_const_list_test.go | 65 +- node/stmt/t_continue_test.go | 126 +- node/stmt/t_declare_test.go | 162 +- node/stmt/t_do_test.go | 29 +- node/stmt/t_echo_test.go | 67 +- node/stmt/t_expression_test.go | 23 +- node/stmt/t_for_test.go | 219 +- node/stmt/t_foreach_test.go | 483 +- node/stmt/t_function_test.go | 256 +- node/stmt/t_global_test.go | 142 +- node/stmt/t_goto_label_test.go | 39 +- node/stmt/t_halt_compiler_test.go | 16 +- node/stmt/t_if_test.go | 428 +- node/stmt/t_inline_html_test.go | 26 +- node/stmt/t_interface_test.go | 132 +- node/stmt/t_namespace_test.go | 72 +- node/stmt/t_property_list_test.go | 281 +- node/stmt/t_static_var_test.go | 177 +- node/stmt/t_switch_case_default_test.go | 283 +- node/stmt/t_throw_test.go | 31 +- node/stmt/t_trait_test.go | 25 +- node/stmt/t_trait_use_test.go | 568 +- node/stmt/t_try_catch_finnaly_test.go | 402 +- node/stmt/t_unset_test.go | 127 +- node/stmt/t_use_test.go | 952 +- node/stmt/t_while_break_test.go | 126 +- node/t_node_test.go | 2567 ++- parser/parser.go | 1 - parser/position_builder.go | 178 +- parser/position_builder_test.go | 497 +- parser/positions.go | 14 - parser/positions_test.go | 25 - php5/parser.go | 14 +- php5/php5.go | 1392 +- php5/php5.y | 989 +- php5/php5_test.go | 20268 +++++++++++++++++--- php7/parser.go | 14 +- php7/php7.go | 756 +- php7/php7.y | 698 +- php7/php7_test.go | 16028 ++++++++++++++-- scanner/lexer.go | 17 +- scanner/token.go | 10 +- scanner/token_test.go | 14 +- visitor/dumper.go | 7 +- visitor/dumper_test.go | 1 - visitor/go_dumper.go | 17 + visitor/go_dumper_test.go | 128 +- visitor/json_dumper.go | 18 +- visitor/json_dumper_test.go | 1 - visitor/pretty_json_dumper.go | 35 +- visitor/pretty_json_dumper_test.go | 1 - 268 files changed, 53606 insertions(+), 7719 deletions(-) delete mode 100644 parser/positions.go delete mode 100644 parser/positions_test.go diff --git a/errors/error.go b/errors/error.go index 850856d..2dd46c2 100644 --- a/errors/error.go +++ b/errors/error.go @@ -17,7 +17,12 @@ type Error struct { func NewError(msg string, t *scanner.Token) *Error { return &Error{ Msg: msg, - Pos: t.Position, + Pos: &position.Position{ + StartLine: t.StartLine, + EndLine: t.EndLine, + StartPos: t.StartPos, + EndPos: t.EndPos, + }, } } diff --git a/errors/error_test.go b/errors/error_test.go index d2e0484..27828c4 100644 --- a/errors/error_test.go +++ b/errors/error_test.go @@ -28,8 +28,11 @@ func assertEqual(t *testing.T, expected interface{}, actual interface{}) { func TestConstructor(t *testing.T) { pos := position.NewPosition(1, 2, 3, 4) token := &scanner.Token{ - Value: `test`, - Position: pos, + Value: `test`, + StartLine: 1, + EndLine: 2, + StartPos: 3, + EndPos: 4, } actual := errors.NewError("message", token) @@ -43,10 +46,12 @@ func TestConstructor(t *testing.T) { } func TestPrint(t *testing.T) { - pos := position.NewPosition(1, 2, 3, 4) token := &scanner.Token{ - Value: `test`, - Position: pos, + Value: `test`, + StartLine: 1, + EndLine: 2, + StartPos: 3, + EndPos: 4, } Error := errors.NewError("message", token) diff --git a/main.go b/main.go index 3a6e572..6233d3d 100644 --- a/main.go +++ b/main.go @@ -21,13 +21,11 @@ var wg sync.WaitGroup var usePhp5 *bool var dumpType string var profiler string -var showPositions *bool var showComments *bool var showResolvedNs *bool func main() { usePhp5 = flag.Bool("php5", false, "parse as PHP5") - showPositions = flag.Bool("p", false, "show positions") showComments = flag.Bool("c", false, "show comments") showResolvedNs = flag.Bool("r", false, "resolve names") flag.StringVar(&dumpType, "d", "", "dump format: [custom, go, json, pretty_json]") @@ -145,18 +143,12 @@ func printer(result <-chan parser.Parser) { comments = parserWorker.GetComments() } - var positions parser.Positions - if *showPositions { - positions = parserWorker.GetPositions() - } - switch dumpType { case "custom": dumper := &visitor.Dumper{ Writer: os.Stdout, Indent: "| ", Comments: comments, - Positions: positions, NsResolver: nsResolver, } parserWorker.GetRootNode().Walk(dumper) @@ -164,7 +156,6 @@ func printer(result <-chan parser.Parser) { dumper := &visitor.JsonDumper{ Writer: os.Stdout, Comments: comments, - Positions: positions, NsResolver: nsResolver, } parserWorker.GetRootNode().Walk(dumper) @@ -172,7 +163,6 @@ func printer(result <-chan parser.Parser) { dumper := &visitor.PrettyJsonDumper{ Writer: os.Stdout, Comments: comments, - Positions: positions, NsResolver: nsResolver, } parserWorker.GetRootNode().Walk(dumper) diff --git a/node/expr/assign/n_assign.go b/node/expr/assign/n_assign.go index 65a9cb8..7d99267 100644 --- a/node/expr/assign/n_assign.go +++ b/node/expr/assign/n_assign.go @@ -2,11 +2,13 @@ package assign import ( "github.com/z7zmey/php-parser/node" + "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" ) // Assign node type Assign struct { + Position *position.Position Variable node.Node Expression node.Node } @@ -14,11 +16,21 @@ type Assign struct { // NewAssign node constructor func NewAssign(Variable node.Node, Expression node.Node) *Assign { return &Assign{ - Variable, - Expression, + Variable: Variable, + Expression: Expression, } } +// SetPosition sets node position +func (n *Assign) SetPosition(p *position.Position) { + n.Position = p +} + +// GetPosition returns node positions +func (n *Assign) GetPosition() *position.Position { + return n.Position +} + // Attributes returns node attributes as map func (n *Assign) Attributes() map[string]interface{} { return nil diff --git a/node/expr/assign/n_assign_ref.go b/node/expr/assign/n_assign_ref.go index c6d560f..92fbd45 100644 --- a/node/expr/assign/n_assign_ref.go +++ b/node/expr/assign/n_assign_ref.go @@ -2,11 +2,13 @@ package assign import ( "github.com/z7zmey/php-parser/node" + "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" ) // Reference node type Reference struct { + Position *position.Position Variable node.Node Expression node.Node } @@ -14,11 +16,21 @@ type Reference struct { // NewReference node constructor func NewReference(Variable node.Node, Expression node.Node) *Reference { return &Reference{ - Variable, - Expression, + Variable: Variable, + Expression: Expression, } } +// SetPosition sets node position +func (n *Reference) SetPosition(p *position.Position) { + n.Position = p +} + +// GetPosition returns node positions +func (n *Reference) GetPosition() *position.Position { + return n.Position +} + // Attributes returns node attributes as map func (n *Reference) Attributes() map[string]interface{} { return nil diff --git a/node/expr/assign/n_bitwise_and.go b/node/expr/assign/n_bitwise_and.go index ff01896..bc43e00 100644 --- a/node/expr/assign/n_bitwise_and.go +++ b/node/expr/assign/n_bitwise_and.go @@ -2,11 +2,13 @@ package assign import ( "github.com/z7zmey/php-parser/node" + "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" ) // BitwiseAnd node type BitwiseAnd struct { + Position *position.Position Variable node.Node Expression node.Node } @@ -14,11 +16,21 @@ type BitwiseAnd struct { // NewBitwiseAnd node constructor func NewBitwiseAnd(Variable node.Node, Expression node.Node) *BitwiseAnd { return &BitwiseAnd{ - Variable, - Expression, + Variable: Variable, + Expression: Expression, } } +// SetPosition sets node position +func (n *BitwiseAnd) SetPosition(p *position.Position) { + n.Position = p +} + +// GetPosition returns node positions +func (n *BitwiseAnd) GetPosition() *position.Position { + return n.Position +} + // Attributes returns node attributes as map func (n *BitwiseAnd) Attributes() map[string]interface{} { return nil diff --git a/node/expr/assign/n_bitwise_or.go b/node/expr/assign/n_bitwise_or.go index 2832633..c758efc 100644 --- a/node/expr/assign/n_bitwise_or.go +++ b/node/expr/assign/n_bitwise_or.go @@ -2,11 +2,13 @@ package assign import ( "github.com/z7zmey/php-parser/node" + "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" ) // BitwiseOr node type BitwiseOr struct { + Position *position.Position Variable node.Node Expression node.Node } @@ -14,11 +16,21 @@ type BitwiseOr struct { // NewBitwiseOr node constructor func NewBitwiseOr(Variable node.Node, Expression node.Node) *BitwiseOr { return &BitwiseOr{ - Variable, - Expression, + Variable: Variable, + Expression: Expression, } } +// SetPosition sets node position +func (n *BitwiseOr) SetPosition(p *position.Position) { + n.Position = p +} + +// GetPosition returns node positions +func (n *BitwiseOr) GetPosition() *position.Position { + return n.Position +} + // Attributes returns node attributes as map func (n *BitwiseOr) Attributes() map[string]interface{} { return nil diff --git a/node/expr/assign/n_bitwise_xor.go b/node/expr/assign/n_bitwise_xor.go index ad22009..76da08a 100644 --- a/node/expr/assign/n_bitwise_xor.go +++ b/node/expr/assign/n_bitwise_xor.go @@ -2,11 +2,13 @@ package assign import ( "github.com/z7zmey/php-parser/node" + "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" ) // BitwiseXor node type BitwiseXor struct { + Position *position.Position Variable node.Node Expression node.Node } @@ -14,11 +16,21 @@ type BitwiseXor struct { // NewBitwiseXor node constructor func NewBitwiseXor(Variable node.Node, Expression node.Node) *BitwiseXor { return &BitwiseXor{ - Variable, - Expression, + Variable: Variable, + Expression: Expression, } } +// SetPosition sets node position +func (n *BitwiseXor) SetPosition(p *position.Position) { + n.Position = p +} + +// GetPosition returns node positions +func (n *BitwiseXor) GetPosition() *position.Position { + return n.Position +} + // Attributes returns node attributes as map func (n *BitwiseXor) Attributes() map[string]interface{} { return nil diff --git a/node/expr/assign/n_concat.go b/node/expr/assign/n_concat.go index 66c08fc..14484cf 100644 --- a/node/expr/assign/n_concat.go +++ b/node/expr/assign/n_concat.go @@ -2,11 +2,13 @@ package assign import ( "github.com/z7zmey/php-parser/node" + "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" ) // Concat node type Concat struct { + Position *position.Position Variable node.Node Expression node.Node } @@ -14,11 +16,21 @@ type Concat struct { // NewConcat node constructor func NewConcat(Variable node.Node, Expression node.Node) *Concat { return &Concat{ - Variable, - Expression, + Variable: Variable, + Expression: Expression, } } +// SetPosition sets node position +func (n *Concat) SetPosition(p *position.Position) { + n.Position = p +} + +// GetPosition returns node positions +func (n *Concat) GetPosition() *position.Position { + return n.Position +} + // Attributes returns node attributes as map func (n *Concat) Attributes() map[string]interface{} { return nil diff --git a/node/expr/assign/n_div.go b/node/expr/assign/n_div.go index 9d70e82..a10fdb6 100644 --- a/node/expr/assign/n_div.go +++ b/node/expr/assign/n_div.go @@ -2,11 +2,13 @@ package assign import ( "github.com/z7zmey/php-parser/node" + "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" ) // Div node type Div struct { + Position *position.Position Variable node.Node Expression node.Node } @@ -14,11 +16,21 @@ type Div struct { // NewDiv node constructor func NewDiv(Variable node.Node, Expression node.Node) *Div { return &Div{ - Variable, - Expression, + Variable: Variable, + Expression: Expression, } } +// SetPosition sets node position +func (n *Div) SetPosition(p *position.Position) { + n.Position = p +} + +// GetPosition returns node positions +func (n *Div) GetPosition() *position.Position { + return n.Position +} + // Attributes returns node attributes as map func (n *Div) Attributes() map[string]interface{} { return nil diff --git a/node/expr/assign/n_minus.go b/node/expr/assign/n_minus.go index 191e6fa..1b29561 100644 --- a/node/expr/assign/n_minus.go +++ b/node/expr/assign/n_minus.go @@ -2,11 +2,13 @@ package assign import ( "github.com/z7zmey/php-parser/node" + "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" ) // Minus node type Minus struct { + Position *position.Position Variable node.Node Expression node.Node } @@ -14,11 +16,21 @@ type Minus struct { // NewMinus node constructor func NewMinus(Variable node.Node, Expression node.Node) *Minus { return &Minus{ - Variable, - Expression, + Variable: Variable, + Expression: Expression, } } +// SetPosition sets node position +func (n *Minus) SetPosition(p *position.Position) { + n.Position = p +} + +// GetPosition returns node positions +func (n *Minus) GetPosition() *position.Position { + return n.Position +} + // Attributes returns node attributes as map func (n *Minus) Attributes() map[string]interface{} { return nil diff --git a/node/expr/assign/n_mod.go b/node/expr/assign/n_mod.go index b35dd22..ba98537 100644 --- a/node/expr/assign/n_mod.go +++ b/node/expr/assign/n_mod.go @@ -2,11 +2,13 @@ package assign import ( "github.com/z7zmey/php-parser/node" + "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" ) // Mod node type Mod struct { + Position *position.Position Variable node.Node Expression node.Node } @@ -14,11 +16,21 @@ type Mod struct { // NewMod node constructor func NewMod(Variable node.Node, Expression node.Node) *Mod { return &Mod{ - Variable, - Expression, + Variable: Variable, + Expression: Expression, } } +// SetPosition sets node position +func (n *Mod) SetPosition(p *position.Position) { + n.Position = p +} + +// GetPosition returns node positions +func (n *Mod) GetPosition() *position.Position { + return n.Position +} + // Attributes returns node attributes as map func (n *Mod) Attributes() map[string]interface{} { return nil diff --git a/node/expr/assign/n_mul.go b/node/expr/assign/n_mul.go index d241a4d..8abc7c6 100644 --- a/node/expr/assign/n_mul.go +++ b/node/expr/assign/n_mul.go @@ -2,11 +2,13 @@ package assign import ( "github.com/z7zmey/php-parser/node" + "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" ) // Mul node type Mul struct { + Position *position.Position Variable node.Node Expression node.Node } @@ -14,11 +16,21 @@ type Mul struct { // NewMul node constructor func NewMul(Variable node.Node, Expression node.Node) *Mul { return &Mul{ - Variable, - Expression, + Variable: Variable, + Expression: Expression, } } +// SetPosition sets node position +func (n *Mul) SetPosition(p *position.Position) { + n.Position = p +} + +// GetPosition returns node positions +func (n *Mul) GetPosition() *position.Position { + return n.Position +} + // Attributes returns node attributes as map func (n *Mul) Attributes() map[string]interface{} { return nil diff --git a/node/expr/assign/n_plus.go b/node/expr/assign/n_plus.go index d010c54..b12f948 100644 --- a/node/expr/assign/n_plus.go +++ b/node/expr/assign/n_plus.go @@ -2,11 +2,13 @@ package assign import ( "github.com/z7zmey/php-parser/node" + "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" ) // Plus node type Plus struct { + Position *position.Position Variable node.Node Expression node.Node } @@ -14,11 +16,21 @@ type Plus struct { // NewPlus node constructor func NewPlus(Variable node.Node, Expression node.Node) *Plus { return &Plus{ - Variable, - Expression, + Variable: Variable, + Expression: Expression, } } +// SetPosition sets node position +func (n *Plus) SetPosition(p *position.Position) { + n.Position = p +} + +// GetPosition returns node positions +func (n *Plus) GetPosition() *position.Position { + return n.Position +} + // Attributes returns node attributes as map func (n *Plus) Attributes() map[string]interface{} { return nil diff --git a/node/expr/assign/n_pow.go b/node/expr/assign/n_pow.go index 8623887..4b4edcf 100644 --- a/node/expr/assign/n_pow.go +++ b/node/expr/assign/n_pow.go @@ -2,11 +2,13 @@ package assign import ( "github.com/z7zmey/php-parser/node" + "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" ) // Pow node type Pow struct { + Position *position.Position Variable node.Node Expression node.Node } @@ -14,11 +16,21 @@ type Pow struct { // NewPow node constructor func NewPow(Variable node.Node, Expression node.Node) *Pow { return &Pow{ - Variable, - Expression, + Variable: Variable, + Expression: Expression, } } +// SetPosition sets node position +func (n *Pow) SetPosition(p *position.Position) { + n.Position = p +} + +// GetPosition returns node positions +func (n *Pow) GetPosition() *position.Position { + return n.Position +} + // Attributes returns node attributes as map func (n *Pow) Attributes() map[string]interface{} { return nil diff --git a/node/expr/assign/n_shift_left.go b/node/expr/assign/n_shift_left.go index 49f3fc5..2d60059 100644 --- a/node/expr/assign/n_shift_left.go +++ b/node/expr/assign/n_shift_left.go @@ -2,11 +2,13 @@ package assign import ( "github.com/z7zmey/php-parser/node" + "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" ) // ShiftLeft node type ShiftLeft struct { + Position *position.Position Variable node.Node Expression node.Node } @@ -14,11 +16,21 @@ type ShiftLeft struct { // NewShiftLeft node constructor func NewShiftLeft(Variable node.Node, Expression node.Node) *ShiftLeft { return &ShiftLeft{ - Variable, - Expression, + Variable: Variable, + Expression: Expression, } } +// SetPosition sets node position +func (n *ShiftLeft) SetPosition(p *position.Position) { + n.Position = p +} + +// GetPosition returns node positions +func (n *ShiftLeft) GetPosition() *position.Position { + return n.Position +} + // Attributes returns node attributes as map func (n *ShiftLeft) Attributes() map[string]interface{} { return nil diff --git a/node/expr/assign/n_shift_right.go b/node/expr/assign/n_shift_right.go index b07ff30..715002d 100644 --- a/node/expr/assign/n_shift_right.go +++ b/node/expr/assign/n_shift_right.go @@ -2,11 +2,13 @@ package assign import ( "github.com/z7zmey/php-parser/node" + "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" ) // ShiftRight node type ShiftRight struct { + Position *position.Position Variable node.Node Expression node.Node } @@ -14,11 +16,21 @@ type ShiftRight struct { // NewShiftRight node constructor func NewShiftRight(Variable node.Node, Expression node.Node) *ShiftRight { return &ShiftRight{ - Variable, - Expression, + Variable: Variable, + Expression: Expression, } } +// SetPosition sets node position +func (n *ShiftRight) SetPosition(p *position.Position) { + n.Position = p +} + +// GetPosition returns node positions +func (n *ShiftRight) GetPosition() *position.Position { + return n.Position +} + // Attributes returns node attributes as map func (n *ShiftRight) Attributes() map[string]interface{} { return nil diff --git a/node/expr/assign/t_assign_op_test.go b/node/expr/assign/t_assign_op_test.go index 207e891..4a00579 100644 --- a/node/expr/assign/t_assign_op_test.go +++ b/node/expr/assign/t_assign_op_test.go @@ -6,6 +6,7 @@ import ( "testing" "github.com/z7zmey/php-parser/node/expr/assign" + "github.com/z7zmey/php-parser/position" "github.com/kylelemons/godebug/pretty" @@ -33,11 +34,61 @@ func TestReference(t *testing.T) { src := `>= $b;` expected := &node.Root{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 4, + EndPos: 13, + }, Stmts: []node.Node{ &stmt.Expression{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 4, + EndPos: 13, + }, Expr: &assign.ShiftRight{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expression: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 4, + EndPos: 12, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 4, + EndPos: 5, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 4, + EndPos: 5, + }, + Value: "a", + }, + }, + Expression: &expr.Variable{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 11, + EndPos: 12, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 11, + EndPos: 12, + }, + Value: "b", + }, + }, }, }, }, diff --git a/node/expr/binary/n_bitwise_and.go b/node/expr/binary/n_bitwise_and.go index 5b24ccb..1e18f70 100644 --- a/node/expr/binary/n_bitwise_and.go +++ b/node/expr/binary/n_bitwise_and.go @@ -2,23 +2,35 @@ package binary import ( "github.com/z7zmey/php-parser/node" + "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" ) // BitwiseAnd node type BitwiseAnd struct { - Left node.Node - Right node.Node + Position *position.Position + Left node.Node + Right node.Node } // NewBitwiseAnd node constructor func NewBitwiseAnd(Variable node.Node, Expression node.Node) *BitwiseAnd { return &BitwiseAnd{ - Variable, - Expression, + Left: Variable, + Right: Expression, } } +// SetPosition sets node position +func (n *BitwiseAnd) SetPosition(p *position.Position) { + n.Position = p +} + +// GetPosition returns node positions +func (n *BitwiseAnd) GetPosition() *position.Position { + return n.Position +} + // Attributes returns node attributes as map func (n *BitwiseAnd) Attributes() map[string]interface{} { return nil diff --git a/node/expr/binary/n_bitwise_or.go b/node/expr/binary/n_bitwise_or.go index 0637ecb..77449a6 100644 --- a/node/expr/binary/n_bitwise_or.go +++ b/node/expr/binary/n_bitwise_or.go @@ -2,23 +2,35 @@ package binary import ( "github.com/z7zmey/php-parser/node" + "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" ) // BitwiseOr node type BitwiseOr struct { - Left node.Node - Right node.Node + Position *position.Position + Left node.Node + Right node.Node } // NewBitwiseOr node constructor func NewBitwiseOr(Variable node.Node, Expression node.Node) *BitwiseOr { return &BitwiseOr{ - Variable, - Expression, + Left: Variable, + Right: Expression, } } +// SetPosition sets node position +func (n *BitwiseOr) SetPosition(p *position.Position) { + n.Position = p +} + +// GetPosition returns node positions +func (n *BitwiseOr) GetPosition() *position.Position { + return n.Position +} + // Attributes returns node attributes as map func (n *BitwiseOr) Attributes() map[string]interface{} { return nil diff --git a/node/expr/binary/n_bitwise_xor.go b/node/expr/binary/n_bitwise_xor.go index f675345..cbf6359 100644 --- a/node/expr/binary/n_bitwise_xor.go +++ b/node/expr/binary/n_bitwise_xor.go @@ -2,23 +2,35 @@ package binary import ( "github.com/z7zmey/php-parser/node" + "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" ) // BitwiseXor node type BitwiseXor struct { - Left node.Node - Right node.Node + Position *position.Position + Left node.Node + Right node.Node } // NewBitwiseXor node constructor func NewBitwiseXor(Variable node.Node, Expression node.Node) *BitwiseXor { return &BitwiseXor{ - Variable, - Expression, + Left: Variable, + Right: Expression, } } +// SetPosition sets node position +func (n *BitwiseXor) SetPosition(p *position.Position) { + n.Position = p +} + +// GetPosition returns node positions +func (n *BitwiseXor) GetPosition() *position.Position { + return n.Position +} + // Attributes returns node attributes as map func (n *BitwiseXor) Attributes() map[string]interface{} { return nil diff --git a/node/expr/binary/n_boolean_and.go b/node/expr/binary/n_boolean_and.go index b0a5bae..e47bcf4 100644 --- a/node/expr/binary/n_boolean_and.go +++ b/node/expr/binary/n_boolean_and.go @@ -2,23 +2,35 @@ package binary import ( "github.com/z7zmey/php-parser/node" + "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" ) // BooleanAnd node type BooleanAnd struct { - Left node.Node - Right node.Node + Position *position.Position + Left node.Node + Right node.Node } // NewBooleanAnd node constructor func NewBooleanAnd(Variable node.Node, Expression node.Node) *BooleanAnd { return &BooleanAnd{ - Variable, - Expression, + Left: Variable, + Right: Expression, } } +// SetPosition sets node position +func (n *BooleanAnd) SetPosition(p *position.Position) { + n.Position = p +} + +// GetPosition returns node positions +func (n *BooleanAnd) GetPosition() *position.Position { + return n.Position +} + // Attributes returns node attributes as map func (n *BooleanAnd) Attributes() map[string]interface{} { return nil diff --git a/node/expr/binary/n_boolean_or.go b/node/expr/binary/n_boolean_or.go index b522baa..d374639 100644 --- a/node/expr/binary/n_boolean_or.go +++ b/node/expr/binary/n_boolean_or.go @@ -2,23 +2,35 @@ package binary import ( "github.com/z7zmey/php-parser/node" + "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" ) // BooleanOr node type BooleanOr struct { - Left node.Node - Right node.Node + Position *position.Position + Left node.Node + Right node.Node } // NewBooleanOr node constructor func NewBooleanOr(Variable node.Node, Expression node.Node) *BooleanOr { return &BooleanOr{ - Variable, - Expression, + Left: Variable, + Right: Expression, } } +// SetPosition sets node position +func (n *BooleanOr) SetPosition(p *position.Position) { + n.Position = p +} + +// GetPosition returns node positions +func (n *BooleanOr) GetPosition() *position.Position { + return n.Position +} + // Attributes returns node attributes as map func (n *BooleanOr) Attributes() map[string]interface{} { return nil diff --git a/node/expr/binary/n_coalesce.go b/node/expr/binary/n_coalesce.go index 8339fdc..f852c26 100644 --- a/node/expr/binary/n_coalesce.go +++ b/node/expr/binary/n_coalesce.go @@ -2,23 +2,35 @@ package binary import ( "github.com/z7zmey/php-parser/node" + "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" ) // Coalesce node type Coalesce struct { - Left node.Node - Right node.Node + Position *position.Position + Left node.Node + Right node.Node } // NewCoalesce node constructor func NewCoalesce(Variable node.Node, Expression node.Node) *Coalesce { return &Coalesce{ - Variable, - Expression, + Left: Variable, + Right: Expression, } } +// SetPosition sets node position +func (n *Coalesce) SetPosition(p *position.Position) { + n.Position = p +} + +// GetPosition returns node positions +func (n *Coalesce) GetPosition() *position.Position { + return n.Position +} + // Attributes returns node attributes as map func (n *Coalesce) Attributes() map[string]interface{} { return nil diff --git a/node/expr/binary/n_concat.go b/node/expr/binary/n_concat.go index a5953c1..a2949cc 100644 --- a/node/expr/binary/n_concat.go +++ b/node/expr/binary/n_concat.go @@ -2,23 +2,35 @@ package binary import ( "github.com/z7zmey/php-parser/node" + "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" ) // Concat node type Concat struct { - Left node.Node - Right node.Node + Position *position.Position + Left node.Node + Right node.Node } // NewConcat node constructor func NewConcat(Variable node.Node, Expression node.Node) *Concat { return &Concat{ - Variable, - Expression, + Left: Variable, + Right: Expression, } } +// SetPosition sets node position +func (n *Concat) SetPosition(p *position.Position) { + n.Position = p +} + +// GetPosition returns node positions +func (n *Concat) GetPosition() *position.Position { + return n.Position +} + // Attributes returns node attributes as map func (n *Concat) Attributes() map[string]interface{} { return nil diff --git a/node/expr/binary/n_div.go b/node/expr/binary/n_div.go index d3f7a86..958c376 100644 --- a/node/expr/binary/n_div.go +++ b/node/expr/binary/n_div.go @@ -2,23 +2,35 @@ package binary import ( "github.com/z7zmey/php-parser/node" + "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" ) // Div node type Div struct { - Left node.Node - Right node.Node + Position *position.Position + Left node.Node + Right node.Node } // NewDiv node constructor func NewDiv(Variable node.Node, Expression node.Node) *Div { return &Div{ - Variable, - Expression, + Left: Variable, + Right: Expression, } } +// SetPosition sets node position +func (n *Div) SetPosition(p *position.Position) { + n.Position = p +} + +// GetPosition returns node positions +func (n *Div) GetPosition() *position.Position { + return n.Position +} + // Attributes returns node attributes as map func (n *Div) Attributes() map[string]interface{} { return nil diff --git a/node/expr/binary/n_equal.go b/node/expr/binary/n_equal.go index b266679..6db8bd5 100644 --- a/node/expr/binary/n_equal.go +++ b/node/expr/binary/n_equal.go @@ -2,23 +2,35 @@ package binary import ( "github.com/z7zmey/php-parser/node" + "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" ) // Equal node type Equal struct { - Left node.Node - Right node.Node + Position *position.Position + Left node.Node + Right node.Node } // NewEqual node constructor func NewEqual(Variable node.Node, Expression node.Node) *Equal { return &Equal{ - Variable, - Expression, + Left: Variable, + Right: Expression, } } +// SetPosition sets node position +func (n *Equal) SetPosition(p *position.Position) { + n.Position = p +} + +// GetPosition returns node positions +func (n *Equal) GetPosition() *position.Position { + return n.Position +} + // Attributes returns node attributes as map func (n *Equal) Attributes() map[string]interface{} { return nil diff --git a/node/expr/binary/n_greater.go b/node/expr/binary/n_greater.go index 58f24fe..58f81e8 100644 --- a/node/expr/binary/n_greater.go +++ b/node/expr/binary/n_greater.go @@ -2,23 +2,35 @@ package binary import ( "github.com/z7zmey/php-parser/node" + "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" ) // Greater node type Greater struct { - Left node.Node - Right node.Node + Position *position.Position + Left node.Node + Right node.Node } // NewGreater node constructor func NewGreater(Variable node.Node, Expression node.Node) *Greater { return &Greater{ - Variable, - Expression, + Left: Variable, + Right: Expression, } } +// SetPosition sets node position +func (n *Greater) SetPosition(p *position.Position) { + n.Position = p +} + +// GetPosition returns node positions +func (n *Greater) GetPosition() *position.Position { + return n.Position +} + // Attributes returns node attributes as map func (n *Greater) Attributes() map[string]interface{} { return nil diff --git a/node/expr/binary/n_greater_or_equal.go b/node/expr/binary/n_greater_or_equal.go index 921b84a..f42b82c 100644 --- a/node/expr/binary/n_greater_or_equal.go +++ b/node/expr/binary/n_greater_or_equal.go @@ -2,23 +2,35 @@ package binary import ( "github.com/z7zmey/php-parser/node" + "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" ) // GreaterOrEqual node type GreaterOrEqual struct { - Left node.Node - Right node.Node + Position *position.Position + Left node.Node + Right node.Node } // NewGreaterOrEqual node constructor func NewGreaterOrEqual(Variable node.Node, Expression node.Node) *GreaterOrEqual { return &GreaterOrEqual{ - Variable, - Expression, + Left: Variable, + Right: Expression, } } +// SetPosition sets node position +func (n *GreaterOrEqual) SetPosition(p *position.Position) { + n.Position = p +} + +// GetPosition returns node positions +func (n *GreaterOrEqual) GetPosition() *position.Position { + return n.Position +} + // Attributes returns node attributes as map func (n *GreaterOrEqual) Attributes() map[string]interface{} { return nil diff --git a/node/expr/binary/n_identical.go b/node/expr/binary/n_identical.go index 06c1947..31d913f 100644 --- a/node/expr/binary/n_identical.go +++ b/node/expr/binary/n_identical.go @@ -2,23 +2,35 @@ package binary import ( "github.com/z7zmey/php-parser/node" + "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" ) // Identical node type Identical struct { - Left node.Node - Right node.Node + Position *position.Position + Left node.Node + Right node.Node } // NewIdentical node constructor func NewIdentical(Variable node.Node, Expression node.Node) *Identical { return &Identical{ - Variable, - Expression, + Left: Variable, + Right: Expression, } } +// SetPosition sets node position +func (n *Identical) SetPosition(p *position.Position) { + n.Position = p +} + +// GetPosition returns node positions +func (n *Identical) GetPosition() *position.Position { + return n.Position +} + // Attributes returns node attributes as map func (n *Identical) Attributes() map[string]interface{} { return nil diff --git a/node/expr/binary/n_logical_and.go b/node/expr/binary/n_logical_and.go index 7015a74..50b2749 100644 --- a/node/expr/binary/n_logical_and.go +++ b/node/expr/binary/n_logical_and.go @@ -2,23 +2,35 @@ package binary import ( "github.com/z7zmey/php-parser/node" + "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" ) // LogicalAnd node type LogicalAnd struct { - Left node.Node - Right node.Node + Position *position.Position + Left node.Node + Right node.Node } // NewLogicalAnd node constructor func NewLogicalAnd(Variable node.Node, Expression node.Node) *LogicalAnd { return &LogicalAnd{ - Variable, - Expression, + Left: Variable, + Right: Expression, } } +// SetPosition sets node position +func (n *LogicalAnd) SetPosition(p *position.Position) { + n.Position = p +} + +// GetPosition returns node positions +func (n *LogicalAnd) GetPosition() *position.Position { + return n.Position +} + // Attributes returns node attributes as map func (n *LogicalAnd) Attributes() map[string]interface{} { return nil diff --git a/node/expr/binary/n_logical_or.go b/node/expr/binary/n_logical_or.go index 05dff50..17c9099 100644 --- a/node/expr/binary/n_logical_or.go +++ b/node/expr/binary/n_logical_or.go @@ -2,23 +2,35 @@ package binary import ( "github.com/z7zmey/php-parser/node" + "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" ) // LogicalOr node type LogicalOr struct { - Left node.Node - Right node.Node + Position *position.Position + Left node.Node + Right node.Node } // NewLogicalOr node constructor func NewLogicalOr(Variable node.Node, Expression node.Node) *LogicalOr { return &LogicalOr{ - Variable, - Expression, + Left: Variable, + Right: Expression, } } +// SetPosition sets node position +func (n *LogicalOr) SetPosition(p *position.Position) { + n.Position = p +} + +// GetPosition returns node positions +func (n *LogicalOr) GetPosition() *position.Position { + return n.Position +} + // Attributes returns node attributes as map func (n *LogicalOr) Attributes() map[string]interface{} { return nil diff --git a/node/expr/binary/n_logical_xor.go b/node/expr/binary/n_logical_xor.go index 91e8408..6811160 100644 --- a/node/expr/binary/n_logical_xor.go +++ b/node/expr/binary/n_logical_xor.go @@ -2,23 +2,35 @@ package binary import ( "github.com/z7zmey/php-parser/node" + "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" ) // LogicalXor node type LogicalXor struct { - Left node.Node - Right node.Node + Position *position.Position + Left node.Node + Right node.Node } // NewLogicalXor node constructor func NewLogicalXor(Variable node.Node, Expression node.Node) *LogicalXor { return &LogicalXor{ - Variable, - Expression, + Left: Variable, + Right: Expression, } } +// SetPosition sets node position +func (n *LogicalXor) SetPosition(p *position.Position) { + n.Position = p +} + +// GetPosition returns node positions +func (n *LogicalXor) GetPosition() *position.Position { + return n.Position +} + // Attributes returns node attributes as map func (n *LogicalXor) Attributes() map[string]interface{} { return nil diff --git a/node/expr/binary/n_minus.go b/node/expr/binary/n_minus.go index 6e42de6..1e76457 100644 --- a/node/expr/binary/n_minus.go +++ b/node/expr/binary/n_minus.go @@ -2,23 +2,35 @@ package binary import ( "github.com/z7zmey/php-parser/node" + "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" ) // Minus node type Minus struct { - Left node.Node - Right node.Node + Position *position.Position + Left node.Node + Right node.Node } // NewMinus node constructor func NewMinus(Variable node.Node, Expression node.Node) *Minus { return &Minus{ - Variable, - Expression, + Left: Variable, + Right: Expression, } } +// SetPosition sets node position +func (n *Minus) SetPosition(p *position.Position) { + n.Position = p +} + +// GetPosition returns node positions +func (n *Minus) GetPosition() *position.Position { + return n.Position +} + // Attributes returns node attributes as map func (n *Minus) Attributes() map[string]interface{} { return nil diff --git a/node/expr/binary/n_mod.go b/node/expr/binary/n_mod.go index 759737a..46d3f74 100644 --- a/node/expr/binary/n_mod.go +++ b/node/expr/binary/n_mod.go @@ -2,23 +2,35 @@ package binary import ( "github.com/z7zmey/php-parser/node" + "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" ) // Mod node type Mod struct { - Left node.Node - Right node.Node + Position *position.Position + Left node.Node + Right node.Node } // NewMod node constructor func NewMod(Variable node.Node, Expression node.Node) *Mod { return &Mod{ - Variable, - Expression, + Left: Variable, + Right: Expression, } } +// SetPosition sets node position +func (n *Mod) SetPosition(p *position.Position) { + n.Position = p +} + +// GetPosition returns node positions +func (n *Mod) GetPosition() *position.Position { + return n.Position +} + // Attributes returns node attributes as map func (n *Mod) Attributes() map[string]interface{} { return nil diff --git a/node/expr/binary/n_mul.go b/node/expr/binary/n_mul.go index c37d1c8..ea029a5 100644 --- a/node/expr/binary/n_mul.go +++ b/node/expr/binary/n_mul.go @@ -2,23 +2,35 @@ package binary import ( "github.com/z7zmey/php-parser/node" + "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" ) // Mul node type Mul struct { - Left node.Node - Right node.Node + Position *position.Position + Left node.Node + Right node.Node } // NewMul node constructor func NewMul(Variable node.Node, Expression node.Node) *Mul { return &Mul{ - Variable, - Expression, + Left: Variable, + Right: Expression, } } +// SetPosition sets node position +func (n *Mul) SetPosition(p *position.Position) { + n.Position = p +} + +// GetPosition returns node positions +func (n *Mul) GetPosition() *position.Position { + return n.Position +} + // Attributes returns node attributes as map func (n *Mul) Attributes() map[string]interface{} { return nil diff --git a/node/expr/binary/n_not_equal.go b/node/expr/binary/n_not_equal.go index 4cc6a89..21ef277 100644 --- a/node/expr/binary/n_not_equal.go +++ b/node/expr/binary/n_not_equal.go @@ -2,23 +2,35 @@ package binary import ( "github.com/z7zmey/php-parser/node" + "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" ) // NotEqual node type NotEqual struct { - Left node.Node - Right node.Node + Position *position.Position + Left node.Node + Right node.Node } // NewNotEqual node constructor func NewNotEqual(Variable node.Node, Expression node.Node) *NotEqual { return &NotEqual{ - Variable, - Expression, + Left: Variable, + Right: Expression, } } +// SetPosition sets node position +func (n *NotEqual) SetPosition(p *position.Position) { + n.Position = p +} + +// GetPosition returns node positions +func (n *NotEqual) GetPosition() *position.Position { + return n.Position +} + // Attributes returns node attributes as map func (n *NotEqual) Attributes() map[string]interface{} { return nil diff --git a/node/expr/binary/n_not_identical.go b/node/expr/binary/n_not_identical.go index 172d56d..b013fbe 100644 --- a/node/expr/binary/n_not_identical.go +++ b/node/expr/binary/n_not_identical.go @@ -2,23 +2,35 @@ package binary import ( "github.com/z7zmey/php-parser/node" + "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" ) // NotIdentical node type NotIdentical struct { - Left node.Node - Right node.Node + Position *position.Position + Left node.Node + Right node.Node } // NewNotIdentical node constructor func NewNotIdentical(Variable node.Node, Expression node.Node) *NotIdentical { return &NotIdentical{ - Variable, - Expression, + Left: Variable, + Right: Expression, } } +// SetPosition sets node position +func (n *NotIdentical) SetPosition(p *position.Position) { + n.Position = p +} + +// GetPosition returns node positions +func (n *NotIdentical) GetPosition() *position.Position { + return n.Position +} + // Attributes returns node attributes as map func (n *NotIdentical) Attributes() map[string]interface{} { return nil diff --git a/node/expr/binary/n_plus.go b/node/expr/binary/n_plus.go index 1e18553..2753099 100644 --- a/node/expr/binary/n_plus.go +++ b/node/expr/binary/n_plus.go @@ -2,23 +2,35 @@ package binary import ( "github.com/z7zmey/php-parser/node" + "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" ) // Plus node type Plus struct { - Left node.Node - Right node.Node + Position *position.Position + Left node.Node + Right node.Node } // NewPlus node constructor func NewPlus(Variable node.Node, Expression node.Node) *Plus { return &Plus{ - Variable, - Expression, + Left: Variable, + Right: Expression, } } +// SetPosition sets node position +func (n *Plus) SetPosition(p *position.Position) { + n.Position = p +} + +// GetPosition returns node positions +func (n *Plus) GetPosition() *position.Position { + return n.Position +} + // Attributes returns node attributes as map func (n *Plus) Attributes() map[string]interface{} { return nil diff --git a/node/expr/binary/n_pow.go b/node/expr/binary/n_pow.go index ee3d6da..371c6bd 100644 --- a/node/expr/binary/n_pow.go +++ b/node/expr/binary/n_pow.go @@ -2,23 +2,35 @@ package binary import ( "github.com/z7zmey/php-parser/node" + "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" ) // Pow node type Pow struct { - Left node.Node - Right node.Node + Position *position.Position + Left node.Node + Right node.Node } // NewPow node constructor func NewPow(Variable node.Node, Expression node.Node) *Pow { return &Pow{ - Variable, - Expression, + Left: Variable, + Right: Expression, } } +// SetPosition sets node position +func (n *Pow) SetPosition(p *position.Position) { + n.Position = p +} + +// GetPosition returns node positions +func (n *Pow) GetPosition() *position.Position { + return n.Position +} + // Attributes returns node attributes as map func (n *Pow) Attributes() map[string]interface{} { return nil diff --git a/node/expr/binary/n_shift_left.go b/node/expr/binary/n_shift_left.go index c1ed698..f48b559 100644 --- a/node/expr/binary/n_shift_left.go +++ b/node/expr/binary/n_shift_left.go @@ -2,23 +2,35 @@ package binary import ( "github.com/z7zmey/php-parser/node" + "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" ) // ShiftLeft node type ShiftLeft struct { - Left node.Node - Right node.Node + Position *position.Position + Left node.Node + Right node.Node } // NewShiftLeft node constructor func NewShiftLeft(Variable node.Node, Expression node.Node) *ShiftLeft { return &ShiftLeft{ - Variable, - Expression, + Left: Variable, + Right: Expression, } } +// SetPosition sets node position +func (n *ShiftLeft) SetPosition(p *position.Position) { + n.Position = p +} + +// GetPosition returns node positions +func (n *ShiftLeft) GetPosition() *position.Position { + return n.Position +} + // Attributes returns node attributes as map func (n *ShiftLeft) Attributes() map[string]interface{} { return nil diff --git a/node/expr/binary/n_shift_right.go b/node/expr/binary/n_shift_right.go index f522721..2ff7ea8 100644 --- a/node/expr/binary/n_shift_right.go +++ b/node/expr/binary/n_shift_right.go @@ -2,23 +2,35 @@ package binary import ( "github.com/z7zmey/php-parser/node" + "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" ) // ShiftRight node type ShiftRight struct { - Left node.Node - Right node.Node + Position *position.Position + Left node.Node + Right node.Node } // NewShiftRight node constructor func NewShiftRight(Variable node.Node, Expression node.Node) *ShiftRight { return &ShiftRight{ - Variable, - Expression, + Left: Variable, + Right: Expression, } } +// SetPosition sets node position +func (n *ShiftRight) SetPosition(p *position.Position) { + n.Position = p +} + +// GetPosition returns node positions +func (n *ShiftRight) GetPosition() *position.Position { + return n.Position +} + // Attributes returns node attributes as map func (n *ShiftRight) Attributes() map[string]interface{} { return nil diff --git a/node/expr/binary/n_smaller.go b/node/expr/binary/n_smaller.go index eff9eed..1e380a0 100644 --- a/node/expr/binary/n_smaller.go +++ b/node/expr/binary/n_smaller.go @@ -2,23 +2,35 @@ package binary import ( "github.com/z7zmey/php-parser/node" + "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" ) // Smaller node type Smaller struct { - Left node.Node - Right node.Node + Position *position.Position + Left node.Node + Right node.Node } // NewSmaller node constructor func NewSmaller(Variable node.Node, Expression node.Node) *Smaller { return &Smaller{ - Variable, - Expression, + Left: Variable, + Right: Expression, } } +// SetPosition sets node position +func (n *Smaller) SetPosition(p *position.Position) { + n.Position = p +} + +// GetPosition returns node positions +func (n *Smaller) GetPosition() *position.Position { + return n.Position +} + // Attributes returns node attributes as map func (n *Smaller) Attributes() map[string]interface{} { return nil diff --git a/node/expr/binary/n_smaller_or_equal.go b/node/expr/binary/n_smaller_or_equal.go index 38c4432..de00106 100644 --- a/node/expr/binary/n_smaller_or_equal.go +++ b/node/expr/binary/n_smaller_or_equal.go @@ -2,23 +2,35 @@ package binary import ( "github.com/z7zmey/php-parser/node" + "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" ) // SmallerOrEqual node type SmallerOrEqual struct { - Left node.Node - Right node.Node + Position *position.Position + Left node.Node + Right node.Node } // NewSmallerOrEqual node constructor func NewSmallerOrEqual(Variable node.Node, Expression node.Node) *SmallerOrEqual { return &SmallerOrEqual{ - Variable, - Expression, + Left: Variable, + Right: Expression, } } +// SetPosition sets node position +func (n *SmallerOrEqual) SetPosition(p *position.Position) { + n.Position = p +} + +// GetPosition returns node positions +func (n *SmallerOrEqual) GetPosition() *position.Position { + return n.Position +} + // Attributes returns node attributes as map func (n *SmallerOrEqual) Attributes() map[string]interface{} { return nil diff --git a/node/expr/binary/n_spaceship.go b/node/expr/binary/n_spaceship.go index 5d307ef..955fc72 100644 --- a/node/expr/binary/n_spaceship.go +++ b/node/expr/binary/n_spaceship.go @@ -2,23 +2,35 @@ package binary import ( "github.com/z7zmey/php-parser/node" + "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" ) // Spaceship node type Spaceship struct { - Left node.Node - Right node.Node + Position *position.Position + Left node.Node + Right node.Node } // NewSpaceship node constructor func NewSpaceship(Variable node.Node, Expression node.Node) *Spaceship { return &Spaceship{ - Variable, - Expression, + Left: Variable, + Right: Expression, } } +// SetPosition sets node position +func (n *Spaceship) SetPosition(p *position.Position) { + n.Position = p +} + +// GetPosition returns node positions +func (n *Spaceship) GetPosition() *position.Position { + return n.Position +} + // Attributes returns node attributes as map func (n *Spaceship) Attributes() map[string]interface{} { return nil diff --git a/node/expr/binary/t_binary_op_test.go b/node/expr/binary/t_binary_op_test.go index 3f316d0..ccca911 100644 --- a/node/expr/binary/t_binary_op_test.go +++ b/node/expr/binary/t_binary_op_test.go @@ -13,6 +13,7 @@ import ( "github.com/z7zmey/php-parser/node/stmt" "github.com/z7zmey/php-parser/php5" "github.com/z7zmey/php-parser/php7" + "github.com/z7zmey/php-parser/position" ) func assertEqual(t *testing.T, expected interface{}, actual interface{}) { @@ -31,11 +32,61 @@ func TestBitwiseAnd(t *testing.T) { src := `= $b;` expected := &node.Root{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 4, + EndPos: 12, + }, Stmts: []node.Node{ &stmt.Expression{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 4, + EndPos: 12, + }, Expr: &binary.GreaterOrEqual{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 4, + EndPos: 11, + }, + Left: &expr.Variable{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 4, + EndPos: 5, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 4, + EndPos: 5, + }, + Value: "a", + }, + }, + Right: &expr.Variable{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 10, + EndPos: 11, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 10, + EndPos: 11, + }, + Value: "b", + }, + }, }, }, }, @@ -276,11 +777,61 @@ func TestGreater(t *testing.T) { src := ` $b;` expected := &node.Root{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 4, + EndPos: 11, + }, Stmts: []node.Node{ &stmt.Expression{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 4, + EndPos: 11, + }, Expr: &binary.Greater{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 4, + EndPos: 10, + }, + Left: &expr.Variable{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 4, + EndPos: 5, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 4, + EndPos: 5, + }, + Value: "a", + }, + }, + Right: &expr.Variable{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 9, + EndPos: 10, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 9, + EndPos: 10, + }, + Value: "b", + }, + }, }, }, }, @@ -301,11 +852,61 @@ func TestIdentical(t *testing.T) { src := `> $b;` expected := &node.Root{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 4, + EndPos: 12, + }, Stmts: []node.Node{ &stmt.Expression{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 4, + EndPos: 12, + }, Expr: &binary.ShiftRight{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 4, + EndPos: 11, + }, + Left: &expr.Variable{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 4, + EndPos: 5, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 4, + EndPos: 5, + }, + Value: "a", + }, + }, + Right: &expr.Variable{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 10, + EndPos: 11, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 10, + EndPos: 11, + }, + Value: "b", + }, + }, }, }, }, @@ -626,11 +1827,61 @@ func TestSmallerOrEqual(t *testing.T) { src := ` $b;` expected := &node.Root{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 4, + EndPos: 13, + }, Stmts: []node.Node{ &stmt.Expression{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 4, + EndPos: 13, + }, Expr: &binary.Spaceship{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 4, + EndPos: 12, + }, + Left: &expr.Variable{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 4, + EndPos: 5, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 4, + EndPos: 5, + }, + Value: "a", + }, + }, + Right: &expr.Variable{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 11, + EndPos: 12, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 11, + EndPos: 12, + }, + Value: "b", + }, + }, }, }, }, diff --git a/node/expr/cast/n_cast_array.go b/node/expr/cast/n_cast_array.go index 0776331..fbaafd3 100644 --- a/node/expr/cast/n_cast_array.go +++ b/node/expr/cast/n_cast_array.go @@ -2,21 +2,33 @@ package cast import ( "github.com/z7zmey/php-parser/node" + "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" ) // Array node type Array struct { - Expr node.Node + Position *position.Position + Expr node.Node } // NewArray node constructor func NewArray(Expr node.Node) *Array { return &Array{ - Expr, + Expr: Expr, } } +// SetPosition sets node position +func (n *Array) SetPosition(p *position.Position) { + n.Position = p +} + +// GetPosition returns node positions +func (n *Array) GetPosition() *position.Position { + return n.Position +} + // Attributes returns node attributes as map func (n *Array) Attributes() map[string]interface{} { return nil diff --git a/node/expr/cast/n_cast_bool.go b/node/expr/cast/n_cast_bool.go index 00e5409..e580328 100644 --- a/node/expr/cast/n_cast_bool.go +++ b/node/expr/cast/n_cast_bool.go @@ -2,21 +2,33 @@ package cast import ( "github.com/z7zmey/php-parser/node" + "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" ) // Bool node type Bool struct { - Expr node.Node + Position *position.Position + Expr node.Node } // NewBool node constructor func NewBool(Expr node.Node) *Bool { return &Bool{ - Expr, + Expr: Expr, } } +// SetPosition sets node position +func (n *Bool) SetPosition(p *position.Position) { + n.Position = p +} + +// GetPosition returns node positions +func (n *Bool) GetPosition() *position.Position { + return n.Position +} + // Attributes returns node attributes as map func (n *Bool) Attributes() map[string]interface{} { return nil diff --git a/node/expr/cast/n_cast_double.go b/node/expr/cast/n_cast_double.go index 81c6c6a..2240d0d 100644 --- a/node/expr/cast/n_cast_double.go +++ b/node/expr/cast/n_cast_double.go @@ -2,21 +2,33 @@ package cast import ( "github.com/z7zmey/php-parser/node" + "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" ) // Double node type Double struct { - Expr node.Node + Position *position.Position + Expr node.Node } // NewDouble node constructor func NewDouble(Expr node.Node) *Double { return &Double{ - Expr, + Expr: Expr, } } +// SetPosition sets node position +func (n *Double) SetPosition(p *position.Position) { + n.Position = p +} + +// GetPosition returns node positions +func (n *Double) GetPosition() *position.Position { + return n.Position +} + // Attributes returns node attributes as map func (n *Double) Attributes() map[string]interface{} { return nil diff --git a/node/expr/cast/n_cast_int.go b/node/expr/cast/n_cast_int.go index 0ad977d..d4ed5a3 100644 --- a/node/expr/cast/n_cast_int.go +++ b/node/expr/cast/n_cast_int.go @@ -2,21 +2,33 @@ package cast import ( "github.com/z7zmey/php-parser/node" + "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" ) // Int node type Int struct { - Expr node.Node + Position *position.Position + Expr node.Node } // NewInt node constructor func NewInt(Expr node.Node) *Int { return &Int{ - Expr, + Expr: Expr, } } +// SetPosition sets node position +func (n *Int) SetPosition(p *position.Position) { + n.Position = p +} + +// GetPosition returns node positions +func (n *Int) GetPosition() *position.Position { + return n.Position +} + // Attributes returns node attributes as map func (n *Int) Attributes() map[string]interface{} { return nil diff --git a/node/expr/cast/n_cast_object.go b/node/expr/cast/n_cast_object.go index 7e38461..6497b77 100644 --- a/node/expr/cast/n_cast_object.go +++ b/node/expr/cast/n_cast_object.go @@ -2,21 +2,33 @@ package cast import ( "github.com/z7zmey/php-parser/node" + "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" ) // Object node type Object struct { - Expr node.Node + Position *position.Position + Expr node.Node } // NewObject node constructor func NewObject(Expr node.Node) *Object { return &Object{ - Expr, + Expr: Expr, } } +// SetPosition sets node position +func (n *Object) SetPosition(p *position.Position) { + n.Position = p +} + +// GetPosition returns node positions +func (n *Object) GetPosition() *position.Position { + return n.Position +} + // Attributes returns node attributes as map func (n *Object) Attributes() map[string]interface{} { return nil diff --git a/node/expr/cast/n_cast_string.go b/node/expr/cast/n_cast_string.go index fab6637..3b026a9 100644 --- a/node/expr/cast/n_cast_string.go +++ b/node/expr/cast/n_cast_string.go @@ -2,21 +2,33 @@ package cast import ( "github.com/z7zmey/php-parser/node" + "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" ) // String node type String struct { - Expr node.Node + Position *position.Position + Expr node.Node } // NewString node constructor func NewString(Expr node.Node) *String { return &String{ - Expr, + Expr: Expr, } } +// SetPosition sets node position +func (n *String) SetPosition(p *position.Position) { + n.Position = p +} + +// GetPosition returns node positions +func (n *String) GetPosition() *position.Position { + return n.Position +} + // Attributes returns node attributes as map func (n *String) Attributes() map[string]interface{} { return nil diff --git a/node/expr/cast/n_cast_unset.go b/node/expr/cast/n_cast_unset.go index ea37f26..cdc8fea 100644 --- a/node/expr/cast/n_cast_unset.go +++ b/node/expr/cast/n_cast_unset.go @@ -2,21 +2,33 @@ package cast import ( "github.com/z7zmey/php-parser/node" + "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" ) // Unset node type Unset struct { - Expr node.Node + Position *position.Position + Expr node.Node } // NewUnset node constructor func NewUnset(Expr node.Node) *Unset { return &Unset{ - Expr, + Expr: Expr, } } +// SetPosition sets node position +func (n *Unset) SetPosition(p *position.Position) { + n.Position = p +} + +// GetPosition returns node positions +func (n *Unset) GetPosition() *position.Position { + return n.Position +} + // Attributes returns node attributes as map func (n *Unset) Attributes() map[string]interface{} { return nil diff --git a/node/expr/cast/t_cast_test.go b/node/expr/cast/t_cast_test.go index 4058f6c..85e6bca 100644 --- a/node/expr/cast/t_cast_test.go +++ b/node/expr/cast/t_cast_test.go @@ -13,6 +13,7 @@ import ( "github.com/z7zmey/php-parser/node/stmt" "github.com/z7zmey/php-parser/php5" "github.com/z7zmey/php-parser/php7" + "github.com/z7zmey/php-parser/position" ) func assertEqual(t *testing.T, expected interface{}, actual interface{}) { @@ -31,10 +32,44 @@ func TestArray(t *testing.T) { src := `1, &$b,);` expected := &node.Root{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 4, + EndPos: 21, + }, Stmts: []node.Node{ &stmt.Expression{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 4, + EndPos: 21, + }, Expr: &expr.Array{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 4, + EndPos: 20, + }, Items: []node.Node{ &expr.ArrayItem{ - Key: &scalar.Lnumber{Value: "1"}, - Val: &scalar.Lnumber{Value: "1"}, + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 10, + EndPos: 13, + }, + Key: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 10, + EndPos: 10, + }, + Value: "1", + }, + Val: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 13, + EndPos: 13, + }, + Value: "1", + }, }, &expr.ArrayItem{ - Val: &expr.Reference{Variable: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 16, + EndPos: 18, + }, + Val: &expr.Reference{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 16, + EndPos: 18, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 17, + EndPos: 18, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 17, + EndPos: 18, + }, + Value: "b", + }, + }, + }, }, }, }, diff --git a/node/expr/t_bitwise_not_test.go b/node/expr/t_bitwise_not_test.go index a4c6456..ed65377 100644 --- a/node/expr/t_bitwise_not_test.go +++ b/node/expr/t_bitwise_not_test.go @@ -5,6 +5,7 @@ import ( "testing" "github.com/z7zmey/php-parser/node/expr" + "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node/stmt" @@ -16,10 +17,44 @@ func TestBitwiseNot(t *testing.T) { src := `foo();` expected := &node.Root{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 4, + EndPos: 13, + }, Stmts: []node.Node{ &stmt.Expression{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 4, + EndPos: 13, + }, Expr: &expr.MethodCall{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Method: &node.Identifier{Value: "foo"}, - ArgumentList: &node.ArgumentList{}, + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 4, + EndPos: 12, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 4, + EndPos: 5, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 4, + EndPos: 5, + }, + Value: "a", + }, + }, + Method: &node.Identifier{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 8, + EndPos: 10, + }, + Value: "foo", + }, + ArgumentList: &node.ArgumentList{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 11, + EndPos: 12, + }, + }, }, }, }, diff --git a/node/expr/t_new_test.go b/node/expr/t_new_test.go index cba3c88..f4abdf0 100644 --- a/node/expr/t_new_test.go +++ b/node/expr/t_new_test.go @@ -5,6 +5,7 @@ import ( "testing" "github.com/z7zmey/php-parser/node/name" + "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/node/expr" @@ -18,12 +19,44 @@ func TestNew(t *testing.T) { src := `foo;` expected := &node.Root{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 4, + EndPos: 11, + }, Stmts: []node.Node{ &stmt.Expression{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 4, + EndPos: 11, + }, Expr: &expr.PropertyFetch{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Property: &node.Identifier{Value: "foo"}, + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 4, + EndPos: 10, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 4, + EndPos: 5, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 4, + EndPos: 5, + }, + Value: "a", + }, + }, + Property: &node.Identifier{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 8, + EndPos: 10, + }, + Value: "foo", + }, }, }, }, diff --git a/node/expr/t_reference_test.go b/node/expr/t_reference_test.go index 9f83687..611c204 100644 --- a/node/expr/t_reference_test.go +++ b/node/expr/t_reference_test.go @@ -5,6 +5,7 @@ import ( "testing" "github.com/z7zmey/php-parser/node/expr" + "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node/stmt" @@ -17,12 +18,86 @@ func TestForeachWithRef(t *testing.T) { src := ` &$v) {}` expected := &node.Root{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 4, + EndPos: 31, + }, Stmts: []node.Node{ &stmt.Foreach{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Key: &expr.Variable{VarName: &node.Identifier{Value: "k"}}, - Variable: &expr.Reference{Variable: &expr.Variable{VarName: &node.Identifier{Value: "v"}}}, + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 4, + EndPos: 31, + }, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 13, + EndPos: 14, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 13, + EndPos: 14, + }, + Value: "a", + }, + }, + Key: &expr.Variable{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 19, + EndPos: 20, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 19, + EndPos: 20, + }, + Value: "k", + }, + }, + Variable: &expr.Reference{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 25, + EndPos: 27, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 26, + EndPos: 27, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 26, + EndPos: 27, + }, + Value: "v", + }, + }, + }, Stmt: &stmt.StmtList{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 30, + EndPos: 31, + }, Stmts: []node.Node{}, }, }, diff --git a/node/expr/t_shell_exec_test.go b/node/expr/t_shell_exec_test.go index 19f4ee9..be1c92f 100644 --- a/node/expr/t_shell_exec_test.go +++ b/node/expr/t_shell_exec_test.go @@ -5,6 +5,7 @@ import ( "testing" "github.com/z7zmey/php-parser/node/scalar" + "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/node/expr" @@ -18,12 +19,54 @@ func TestShellExec(t *testing.T) { src := "1, &$b,];` expected := &node.Root{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 4, + EndPos: 16, + }, Stmts: []node.Node{ &stmt.Expression{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 4, + EndPos: 16, + }, Expr: &expr.ShortArray{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 4, + EndPos: 15, + }, Items: []node.Node{ &expr.ArrayItem{ - Key: &scalar.Lnumber{Value: "1"}, - Val: &scalar.Lnumber{Value: "1"}, + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 5, + EndPos: 8, + }, + Key: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 5, + EndPos: 5, + }, + Value: "1", + }, + Val: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 8, + EndPos: 8, + }, + Value: "1", + }, }, &expr.ArrayItem{ - Val: &expr.Reference{Variable: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 11, + EndPos: 13, + }, + Val: &expr.Reference{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 11, + EndPos: 13, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 12, + EndPos: 13, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 12, + EndPos: 13, + }, + Value: "b", + }, + }, + }, }, }, }, diff --git a/node/expr/t_short_list_test.go b/node/expr/t_short_list_test.go index 9492ef9..5041800 100644 --- a/node/expr/t_short_list_test.go +++ b/node/expr/t_short_list_test.go @@ -5,6 +5,7 @@ import ( "testing" "github.com/z7zmey/php-parser/node/expr/assign" + "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/node/expr" @@ -17,17 +18,79 @@ func TestShortList(t *testing.T) { src := ` $b;` expected := &node.Root{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 4, + EndPos: 18, + }, Stmts: []node.Node{ &stmt.Expression{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 4, + EndPos: 18, + }, Expr: &expr.Yield{ - Key: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Value: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 4, + EndPos: 17, + }, + Key: &expr.Variable{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 10, + EndPos: 11, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 10, + EndPos: 11, + }, + Value: "a", + }, + }, + Value: &expr.Variable{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 16, + EndPos: 17, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 16, + EndPos: 17, + }, + Value: "b", + }, + }, }, }, }, @@ -88,10 +192,36 @@ func TestYieldExpr(t *testing.T) { src := ` 1;` expected := &node.Root{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 4, + EndPos: 17, + }, Stmts: []node.Node{ &stmt.Expression{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 4, + EndPos: 17, + }, Expr: &expr.Yield{ - Key: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Value: &scalar.Lnumber{Value: "1"}, + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 4, + EndPos: 16, + }, + Key: &expr.Variable{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 10, + EndPos: 11, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 10, + EndPos: 11, + }, + Value: "a", + }, + }, + Value: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 16, + EndPos: 16, + }, + Value: "1", + }, }, }, }, @@ -137,10 +309,44 @@ func TestYieldFrom(t *testing.T) { src := `bar()";` expected := &node.Root{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 4, + EndPos: 22, + }, Stmts: []node.Node{ &stmt.Expression{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 4, + EndPos: 22, + }, Expr: &scalar.Encapsed{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 4, + EndPos: 21, + }, Parts: []node.Node{ - &scalar.EncapsedStringPart{Value: "test "}, - &expr.PropertyFetch{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, - Property: &node.Identifier{Value: "bar"}, + &scalar.EncapsedStringPart{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 5, + EndPos: 9, + }, + Value: "test ", + }, + &expr.PropertyFetch{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 10, + EndPos: 18, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 10, + EndPos: 13, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 10, + EndPos: 13, + }, + Value: "foo", + }, + }, + Property: &node.Identifier{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 16, + EndPos: 18, + }, + Value: "bar", + }, + }, + &scalar.EncapsedStringPart{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 19, + EndPos: 20, + }, + Value: "()", }, - &scalar.EncapsedStringPart{Value: "()"}, }, }, }, @@ -158,12 +415,54 @@ func TestDollarOpenCurlyBraces(t *testing.T) { src := `bar()}";` expected := &node.Root{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 4, + EndPos: 24, + }, Stmts: []node.Node{ &stmt.Expression{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 4, + EndPos: 24, + }, Expr: &scalar.Encapsed{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 4, + EndPos: 23, + }, Parts: []node.Node{ - &scalar.EncapsedStringPart{Value: "test "}, + &scalar.EncapsedStringPart{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 5, + EndPos: 9, + }, + Value: "test ", + }, &expr.MethodCall{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, - Method: &node.Identifier{Value: "bar"}, - ArgumentList: &node.ArgumentList{}, + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 11, + EndPos: 21, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 11, + EndPos: 14, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 11, + EndPos: 14, + }, + Value: "foo", + }, + }, + Method: &node.Identifier{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 17, + EndPos: 19, + }, + Value: "bar", + }, + ArgumentList: &node.ArgumentList{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 20, + EndPos: 21, + }, + }, }, }, }, diff --git a/node/scalar/t_heredoc_test.go b/node/scalar/t_heredoc_test.go index 10ffb61..47d8bd8 100644 --- a/node/scalar/t_heredoc_test.go +++ b/node/scalar/t_heredoc_test.go @@ -5,6 +5,7 @@ import ( "testing" "github.com/z7zmey/php-parser/node/expr" + "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node/scalar" @@ -20,14 +21,64 @@ LBL; ` expected := &node.Root{ + Position: &position.Position{ + StartLine: 1, + EndLine: 3, + StartPos: 7, + EndPos: 24, + }, Stmts: []node.Node{ &stmt.Expression{ + Position: &position.Position{ + StartLine: 1, + EndLine: 3, + StartPos: 7, + EndPos: 24, + }, Expr: &scalar.Heredoc{ + Position: &position.Position{ + StartLine: 1, + EndLine: 3, + StartPos: 7, + EndPos: 23, + }, Label: "LBL", Parts: []node.Node{ - &scalar.EncapsedStringPart{Value: "test "}, - &expr.Variable{VarName: &node.Identifier{Value: "var"}}, - &scalar.EncapsedStringPart{Value: "\n"}, + &scalar.EncapsedStringPart{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 11, + EndPos: 15, + }, + Value: "test ", + }, + &expr.Variable{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 16, + EndPos: 19, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 16, + EndPos: 19, + }, + Value: "var", + }, + }, + &scalar.EncapsedStringPart{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 20, + EndPos: 20, + }, + Value: "\n", + }, }, }, }, @@ -52,14 +103,64 @@ LBL; ` expected := &node.Root{ + Position: &position.Position{ + StartLine: 1, + EndLine: 3, + StartPos: 7, + EndPos: 26, + }, Stmts: []node.Node{ &stmt.Expression{ + Position: &position.Position{ + StartLine: 1, + EndLine: 3, + StartPos: 7, + EndPos: 26, + }, Expr: &scalar.Heredoc{ + Position: &position.Position{ + StartLine: 1, + EndLine: 3, + StartPos: 7, + EndPos: 25, + }, Label: "\"LBL\"", Parts: []node.Node{ - &scalar.EncapsedStringPart{Value: "test "}, - &expr.Variable{VarName: &node.Identifier{Value: "var"}}, - &scalar.EncapsedStringPart{Value: "\n"}, + &scalar.EncapsedStringPart{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 13, + EndPos: 17, + }, + Value: "test ", + }, + &expr.Variable{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 18, + EndPos: 21, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 18, + EndPos: 21, + }, + Value: "var", + }, + }, + &scalar.EncapsedStringPart{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 22, + EndPos: 22, + }, + Value: "\n", + }, }, }, }, @@ -84,12 +185,38 @@ LBL; ` expected := &node.Root{ + Position: &position.Position{ + StartLine: 1, + EndLine: 3, + StartPos: 7, + EndPos: 26, + }, Stmts: []node.Node{ &stmt.Expression{ + Position: &position.Position{ + StartLine: 1, + EndLine: 3, + StartPos: 7, + EndPos: 26, + }, Expr: &scalar.Heredoc{ + Position: &position.Position{ + StartLine: 1, + EndLine: 3, + StartPos: 7, + EndPos: 25, + }, Label: "'LBL'", Parts: []node.Node{ - &scalar.EncapsedStringPart{Value: "test $var\n"}, + &scalar.EncapsedStringPart{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 13, + EndPos: 22, + }, + Value: "test $var\n", + }, }, }, }, @@ -113,9 +240,27 @@ CAD; ` expected := &node.Root{ + Position: &position.Position{ + StartLine: 1, + EndLine: 2, + StartPos: 7, + EndPos: 14, + }, Stmts: []node.Node{ &stmt.Expression{ + Position: &position.Position{ + StartLine: 1, + EndLine: 2, + StartPos: 7, + EndPos: 14, + }, Expr: &scalar.Heredoc{ + Position: &position.Position{ + StartLine: 1, + EndLine: 2, + StartPos: 7, + EndPos: 13, + }, Label: "CAD", }, }, @@ -140,12 +285,38 @@ CAD; ` expected := &node.Root{ + Position: &position.Position{ + StartLine: 1, + EndLine: 3, + StartPos: 7, + EndPos: 21, + }, Stmts: []node.Node{ &stmt.Expression{ + Position: &position.Position{ + StartLine: 1, + EndLine: 3, + StartPos: 7, + EndPos: 21, + }, Expr: &scalar.Heredoc{ + Position: &position.Position{ + StartLine: 1, + EndLine: 3, + StartPos: 7, + EndPos: 20, + }, Label: "CAD", Parts: []node.Node{ - &scalar.EncapsedStringPart{Value: "\thello\n"}, + &scalar.EncapsedStringPart{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 11, + EndPos: 17, + }, + Value: "\thello\n", + }, }, }, }, diff --git a/node/scalar/t_magic_constant_test.go b/node/scalar/t_magic_constant_test.go index 0fbdfdb..e450dc8 100644 --- a/node/scalar/t_magic_constant_test.go +++ b/node/scalar/t_magic_constant_test.go @@ -9,6 +9,7 @@ import ( "github.com/z7zmey/php-parser/node/stmt" "github.com/z7zmey/php-parser/php5" "github.com/z7zmey/php-parser/php7" + "github.com/z7zmey/php-parser/position" ) func TestMagicConstant(t *testing.T) { @@ -16,9 +17,29 @@ func TestMagicConstant(t *testing.T) { src := ` $v) {}` expected := &node.Root{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 4, + EndPos: 30, + }, Stmts: []node.Node{ &stmt.Foreach{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Key: &expr.Variable{VarName: &node.Identifier{Value: "k"}}, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "v"}}, - Stmt: &stmt.StmtList{Stmts: []node.Node{}}, + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 4, + EndPos: 30, + }, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 13, + EndPos: 14, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 13, + EndPos: 14, + }, + Value: "a", + }, + }, + Key: &expr.Variable{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 19, + EndPos: 20, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 19, + EndPos: 20, + }, + Value: "k", + }, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 25, + EndPos: 26, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 25, + EndPos: 26, + }, + Value: "v", + }, + }, + Stmt: &stmt.StmtList{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 29, + EndPos: 30, + }, + Stmts: []node.Node{}, + }, }, }, } @@ -113,12 +330,72 @@ func TestForeachExprWithKey(t *testing.T) { src := ` $v) {}` expected := &node.Root{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 4, + EndPos: 30, + }, Stmts: []node.Node{ &stmt.Foreach{ - Expr: &expr.ShortArray{Items: []node.Node{}}, - Key: &expr.Variable{VarName: &node.Identifier{Value: "k"}}, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "v"}}, - Stmt: &stmt.StmtList{Stmts: []node.Node{}}, + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 4, + EndPos: 30, + }, + Expr: &expr.ShortArray{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 13, + EndPos: 14, + }, + Items: []node.Node{}, + }, + Key: &expr.Variable{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 19, + EndPos: 20, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 19, + EndPos: 20, + }, + Value: "k", + }, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 25, + EndPos: 26, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 25, + EndPos: 26, + }, + Value: "v", + }, + }, + Stmt: &stmt.StmtList{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 29, + EndPos: 30, + }, + Stmts: []node.Node{}, + }, }, }, } @@ -138,12 +415,88 @@ func TestForeachWithRef(t *testing.T) { src := ` &$v) {}` expected := &node.Root{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 4, + EndPos: 31, + }, Stmts: []node.Node{ &stmt.Foreach{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Key: &expr.Variable{VarName: &node.Identifier{Value: "k"}}, - Variable: &expr.Reference{Variable: &expr.Variable{VarName: &node.Identifier{Value: "v"}}}, - Stmt: &stmt.StmtList{Stmts: []node.Node{}}, + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 4, + EndPos: 31, + }, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 13, + EndPos: 14, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 13, + EndPos: 14, + }, + Value: "a", + }, + }, + Key: &expr.Variable{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 19, + EndPos: 20, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 19, + EndPos: 20, + }, + Value: "k", + }, + }, + Variable: &expr.Reference{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 25, + EndPos: 27, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 26, + EndPos: 27, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 26, + EndPos: 27, + }, + Value: "v", + }, + }, + }, + Stmt: &stmt.StmtList{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 30, + EndPos: 31, + }, + Stmts: []node.Node{}, + }, }, }, } @@ -163,18 +516,98 @@ func TestForeachWithList(t *testing.T) { src := ` list($v)) {}` expected := &node.Root{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 4, + EndPos: 36, + }, Stmts: []node.Node{ &stmt.Foreach{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Key: &expr.Variable{VarName: &node.Identifier{Value: "k"}}, + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 4, + EndPos: 36, + }, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 13, + EndPos: 14, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 13, + EndPos: 14, + }, + Value: "a", + }, + }, + Key: &expr.Variable{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 19, + EndPos: 20, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 19, + EndPos: 20, + }, + Value: "k", + }, + }, Variable: &expr.List{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 25, + EndPos: 32, + }, Items: []node.Node{ &expr.ArrayItem{ - Val: &expr.Variable{VarName: &node.Identifier{Value: "v"}}, + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 30, + EndPos: 31, + }, + Val: &expr.Variable{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 30, + EndPos: 31, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 30, + EndPos: 31, + }, + Value: "v", + }, + }, }, }, }, - Stmt: &stmt.StmtList{Stmts: []node.Node{}}, + Stmt: &stmt.StmtList{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 35, + EndPos: 36, + }, + Stmts: []node.Node{}, + }, }, }, } diff --git a/node/stmt/t_function_test.go b/node/stmt/t_function_test.go index fb32180..3ff53e1 100644 --- a/node/stmt/t_function_test.go +++ b/node/stmt/t_function_test.go @@ -6,6 +6,7 @@ import ( "github.com/z7zmey/php-parser/node/name" "github.com/z7zmey/php-parser/node/scalar" + "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node/expr" @@ -18,12 +19,32 @@ func TestSimpleFunction(t *testing.T) { src := `
` expected := &node.Root{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 4, + EndPos: 17, + }, Stmts: []node.Node{ - &stmt.Nop{}, - &stmt.InlineHtml{Value: "
"}, + &stmt.Nop{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 4, + EndPos: 5, + }, + }, + &stmt.InlineHtml{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 17, + }, + Value: "
", + }, }, } diff --git a/node/stmt/t_interface_test.go b/node/stmt/t_interface_test.go index 85a64d8..749e99a 100644 --- a/node/stmt/t_interface_test.go +++ b/node/stmt/t_interface_test.go @@ -2,9 +2,11 @@ package stmt_test import ( "bytes" - "github.com/z7zmey/php-parser/node/name" "testing" + "github.com/z7zmey/php-parser/node/name" + "github.com/z7zmey/php-parser/position" + "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node/stmt" "github.com/z7zmey/php-parser/php5" @@ -15,11 +17,31 @@ func TestInterface(t *testing.T) { src := ` 0 { - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[4].list)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[4].list)) } else { - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) } // save comments @@ -2987,8 +2988,8 @@ yydefault: yyVAL.node = stmt.NewAltIf(yyDollar[2].node, stmts, yyDollar[5].list, yyDollar[6].node) // save position - yylex.(*Parser).positions.AddPosition(stmts, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[4].list)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[8].token)) + stmts.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[4].list)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[8].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.IfToken) @@ -3012,7 +3013,7 @@ yydefault: yyVAL.node = yyDollar[3].node // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.WhileToken) @@ -3026,7 +3027,7 @@ yydefault: yyVAL.node = stmt.NewDo(yyDollar[2].node, yyDollar[4].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[5].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[5].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.DoToken) @@ -3053,7 +3054,7 @@ yydefault: yyVAL.node = yyDollar[9].node // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[9].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[9].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ForToken) @@ -3080,7 +3081,7 @@ yydefault: yyVAL.node = yyDollar[3].node // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.SwitchToken) @@ -3094,7 +3095,7 @@ yydefault: yyVAL.node = stmt.NewBreak(nil) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.BreakToken) @@ -3109,7 +3110,7 @@ yydefault: yyVAL.node = stmt.NewBreak(yyDollar[2].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.BreakToken) @@ -3124,7 +3125,7 @@ yydefault: yyVAL.node = stmt.NewContinue(nil) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ContinueToken) @@ -3139,7 +3140,7 @@ yydefault: yyVAL.node = stmt.NewContinue(yyDollar[2].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ContinueToken) @@ -3154,7 +3155,7 @@ yydefault: yyVAL.node = stmt.NewReturn(nil) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ReturnToken) @@ -3169,7 +3170,7 @@ yydefault: yyVAL.node = stmt.NewReturn(yyDollar[2].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ReturnToken) @@ -3184,7 +3185,7 @@ yydefault: yyVAL.node = stmt.NewReturn(yyDollar[2].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ReturnToken) @@ -3199,7 +3200,7 @@ yydefault: yyVAL.node = stmt.NewExpression(yyDollar[1].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.SemiColonToken) @@ -3213,7 +3214,7 @@ yydefault: yyVAL.node = stmt.NewGlobal(yyDollar[2].list) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.GlobalToken) @@ -3228,7 +3229,7 @@ yydefault: yyVAL.node = stmt.NewStatic(yyDollar[2].list) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.StaticToken) @@ -3243,7 +3244,7 @@ yydefault: yyVAL.node = stmt.NewEcho(yyDollar[2].list) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.EchoToken) @@ -3258,7 +3259,7 @@ yydefault: yyVAL.node = stmt.NewInlineHtml(yyDollar[1].token.Value) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.InlineHTMLToken) @@ -3272,7 +3273,7 @@ yydefault: yyVAL.node = stmt.NewExpression(yyDollar[1].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.SemiColonToken) @@ -3286,7 +3287,7 @@ yydefault: yyVAL.node = stmt.NewUnset(yyDollar[3].list) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[5].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[5].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.UnsetToken) @@ -3325,7 +3326,7 @@ yydefault: yyVAL.node = yyDollar[8].node // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[8].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[8].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ForeachToken) @@ -3364,7 +3365,7 @@ yydefault: // save position yyVAL.node = yyDollar[8].node - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[8].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[8].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ForeachToken) @@ -3381,7 +3382,7 @@ yydefault: yyVAL.node = stmt.NewDeclare(yyDollar[3].list, yyDollar[5].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[5].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[5].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.DeclareToken) @@ -3397,7 +3398,7 @@ yydefault: yyVAL.node = stmt.NewNop() // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.SemiColonToken) @@ -3412,9 +3413,9 @@ yydefault: // save position if yyDollar[6].node == nil { - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[5].list)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[5].list)) } else { - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[6].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[6].node)) } // save comments @@ -3431,7 +3432,7 @@ yydefault: yyVAL.node = stmt.NewThrow(yyDollar[2].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ThrowToken) @@ -3447,8 +3448,8 @@ yydefault: yyVAL.node = stmt.NewGoto(label) // save position - yylex.(*Parser).positions.AddPosition(label, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) + label.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.GotoToken) @@ -3475,9 +3476,9 @@ yydefault: yyVAL.list = append([]node.Node{catch}, yyDollar[9].list...) // save position - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) - yylex.(*Parser).positions.AddPosition(catch, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[8].token)) + identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) + variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) + catch.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[8].token)) // save comments yylex.(*Parser).comments.AddFromToken(catch, yyDollar[1].token, comment.CatchToken) @@ -3504,7 +3505,7 @@ yydefault: yyVAL.node = stmt.NewFinally(yyDollar[3].list) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.FinallyToken) @@ -3554,9 +3555,9 @@ yydefault: yyVAL.node = stmt.NewCatch([]node.Node{yyDollar[3].node}, variable, yyDollar[7].list) // save position - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[8].token)) + identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) + variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[8].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.CatchToken) @@ -3643,8 +3644,8 @@ yydefault: yyVAL.node = stmt.NewFunction(name, yyDollar[2].token != nil, yyDollar[5].list, nil, yyDollar[8].list, "") // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[9].token)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[9].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.FunctionToken) @@ -3679,8 +3680,8 @@ yydefault: yyVAL.node = yyDollar[1].node // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[7].token)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[7].token)) // save comments yylex.(*Parser).comments.AddFromToken(name, yyDollar[2].token, comment.StringToken) @@ -3697,8 +3698,8 @@ yydefault: yyVAL.node = stmt.NewInterface(name, yyDollar[3].InterfaceExtends, yyDollar[5].list, "") // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[6].token)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[6].token)) // save comments yylex.(*Parser).comments.AddFromToken(name, yyDollar[2].token, comment.StringToken) @@ -3714,7 +3715,7 @@ yydefault: yyVAL.node = stmt.NewClass(nil, nil, nil, nil, nil, nil, "") // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ClassToken) @@ -3729,8 +3730,8 @@ yydefault: yyVAL.node = stmt.NewClass(nil, []node.Node{classModifier}, nil, nil, nil, nil, "") // save position - yylex.(*Parser).positions.AddPosition(classModifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) + classModifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments yylex.(*Parser).comments.AddFromToken(classModifier, yyDollar[1].token, comment.AbstractToken) @@ -3745,7 +3746,7 @@ yydefault: yyVAL.node = stmt.NewTrait(nil, nil, "") // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.TraitToken) @@ -3760,8 +3761,8 @@ yydefault: yyVAL.node = stmt.NewClass(nil, []node.Node{classModifier}, nil, nil, nil, nil, "") // save position - yylex.(*Parser).positions.AddPosition(classModifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) + classModifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments yylex.(*Parser).comments.AddFromToken(classModifier, yyDollar[1].token, comment.FinalToken) @@ -3784,7 +3785,7 @@ yydefault: yyVAL.ClassExtends = stmt.NewClassExtends(yyDollar[2].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.ClassExtends, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + yyVAL.ClassExtends.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.ClassExtends, yyDollar[1].token, comment.ExtendsToken) @@ -3812,7 +3813,7 @@ yydefault: yyVAL.InterfaceExtends = stmt.NewInterfaceExtends(yyDollar[2].list) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.InterfaceExtends, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) + yyVAL.InterfaceExtends.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.InterfaceExtends, yyDollar[1].token, comment.ExtendsToken) @@ -3834,7 +3835,7 @@ yydefault: yyVAL.ClassImplements = stmt.NewClassImplements(yyDollar[2].list) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.ClassImplements, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) + yyVAL.ClassImplements.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.ClassImplements, yyDollar[1].token, comment.ImplementsToken) @@ -3894,7 +3895,7 @@ yydefault: yyVAL.node = expr.NewReference(yyDollar[2].node) // save position - yylex.(*Parser).positions.AddPosition(yyDollar[2].node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.AmpersandToken) @@ -3908,7 +3909,7 @@ yydefault: yyVAL.node = expr.NewList(yyDollar[3].list) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ListToken) @@ -3924,7 +3925,7 @@ yydefault: yyVAL.node = stmt.NewFor(nil, nil, nil, yyDollar[1].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3936,8 +3937,8 @@ yydefault: yyVAL.node = stmt.NewAltFor(nil, nil, nil, stmtList) // save position - yylex.(*Parser).positions.AddPosition(stmtList, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + stmtList.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ColonToken) @@ -3953,7 +3954,7 @@ yydefault: yyVAL.node = stmt.NewForeach(nil, nil, nil, yyDollar[1].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3965,8 +3966,8 @@ yydefault: yyVAL.node = stmt.NewAltForeach(nil, nil, nil, stmtList) // save position - yylex.(*Parser).positions.AddPosition(stmtList, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + stmtList.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ColonToken) @@ -3990,7 +3991,7 @@ yydefault: yyVAL.node = stmt.NewStmtList(yyDollar[2].list) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ColonToken) @@ -4008,8 +4009,8 @@ yydefault: yyVAL.list = []node.Node{constant} // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).positions.AddPosition(constant, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + constant.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(name, yyDollar[1].token, comment.StringToken) @@ -4026,8 +4027,8 @@ yydefault: yyVAL.list = append(yyDollar[1].list, constant) // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) - yylex.(*Parser).positions.AddPosition(constant, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[3].token, yyDollar[5].node)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) + constant.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[3].token, yyDollar[5].node)) // save comments yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) @@ -4044,8 +4045,8 @@ yydefault: yyVAL.node = stmt.NewSwitch(nil, caseList) // save position - yylex.(*Parser).positions.AddPosition(caseList, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) + caseList.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments yylex.(*Parser).comments.AddFromToken(caseList, yyDollar[1].token, comment.OpenCurlyBracesToken) @@ -4061,8 +4062,8 @@ yydefault: yyVAL.node = stmt.NewSwitch(nil, caseList) // save position - yylex.(*Parser).positions.AddPosition(caseList, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + caseList.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments yylex.(*Parser).comments.AddFromToken(caseList, yyDollar[1].token, comment.OpenCurlyBracesToken) @@ -4079,8 +4080,8 @@ yydefault: yyVAL.node = stmt.NewAltSwitch(nil, caseList) // save position - yylex.(*Parser).positions.AddPosition(caseList, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + caseList.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments yylex.(*Parser).comments.AddFromToken(caseList, yyDollar[1].token, comment.ColonToken) @@ -4098,8 +4099,8 @@ yydefault: yyVAL.node = stmt.NewAltSwitch(nil, caseList) // save position - yylex.(*Parser).positions.AddPosition(caseList, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[3].list)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[5].token)) + caseList.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[3].list)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[5].token)) // save comments yylex.(*Parser).comments.AddFromToken(caseList, yyDollar[1].token, comment.ColonToken) @@ -4125,7 +4126,7 @@ yydefault: yyVAL.list = append(yyDollar[1].list, _case) // save position - yylex.(*Parser).positions.AddPosition(_case, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[5].list)) + _case.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[5].list)) // save comments yylex.(*Parser).comments.AddFromToken(_case, yyDollar[2].token, comment.CaseToken) @@ -4141,7 +4142,7 @@ yydefault: yyVAL.list = append(yyDollar[1].list, _default) // save position - yylex.(*Parser).positions.AddPosition(_default, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[4].list)) + _default.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[4].list)) // save comments yylex.(*Parser).comments.AddFromToken(_default, yyDollar[2].token, comment.DefaultToken) @@ -4168,7 +4169,7 @@ yydefault: yyVAL.node = stmt.NewWhile(nil, yyDollar[1].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4180,8 +4181,8 @@ yydefault: yyVAL.node = stmt.NewAltWhile(nil, stmtList) // save position - yylex.(*Parser).positions.AddPosition(stmtList, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + stmtList.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ColonToken) @@ -4206,7 +4207,7 @@ yydefault: yyVAL.list = append(yyDollar[1].list, _elseIf) // save position - yylex.(*Parser).positions.AddPosition(_elseIf, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[2].token, yyDollar[4].node)) + _elseIf.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[2].token, yyDollar[4].node)) // save comments yylex.(*Parser).comments.AddFromToken(_elseIf, yyDollar[2].token, comment.ElseifToken) @@ -4230,8 +4231,8 @@ yydefault: yyVAL.list = append(yyDollar[1].list, _elseIf) // save position - yylex.(*Parser).positions.AddPosition(stmts, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[5].list)) - yylex.(*Parser).positions.AddPosition(_elseIf, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[5].list)) + stmts.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[5].list)) + _elseIf.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[5].list)) // save comments yylex.(*Parser).comments.AddFromToken(_elseIf, yyDollar[2].token, comment.ElseifToken) @@ -4254,7 +4255,7 @@ yydefault: yyVAL.node = stmt.NewElse(yyDollar[2].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ElseToken) @@ -4277,8 +4278,8 @@ yydefault: yyVAL.node = stmt.NewAltElse(stmts) // save position - yylex.(*Parser).positions.AddPosition(stmts, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[3].list)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) + stmts.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[3].list)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ElseToken) @@ -4330,16 +4331,16 @@ yydefault: yyVAL.node = node.NewParameter(yyDollar[1].node, variable, nil, yyDollar[2].token != nil, yyDollar[3].token != nil) // save position - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) + identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) + variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) if yyDollar[1].node != nil { - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) } else if yyDollar[2].token != nil { - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[2].token, yyDollar[4].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[2].token, yyDollar[4].token)) } else if yyDollar[3].token != nil { - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[3].token, yyDollar[4].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[3].token, yyDollar[4].token)) } else { - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) } // save comments @@ -4362,16 +4363,16 @@ yydefault: yyVAL.node = node.NewParameter(yyDollar[1].node, variable, yyDollar[6].node, yyDollar[2].token != nil, yyDollar[3].token != nil) // save position - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) + identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) + variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) if yyDollar[1].node != nil { - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[6].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[6].node)) } else if yyDollar[2].token != nil { - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[2].token, yyDollar[6].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[2].token, yyDollar[6].node)) } else if yyDollar[3].token != nil { - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[3].token, yyDollar[6].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[3].token, yyDollar[6].node)) } else { - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[4].token, yyDollar[6].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[4].token, yyDollar[6].node)) } // save comments @@ -4401,7 +4402,7 @@ yydefault: yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ArrayToken) @@ -4415,7 +4416,7 @@ yydefault: yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.CallableToken) @@ -4437,7 +4438,7 @@ yydefault: yyVAL.node = node.NewArgumentList(nil) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.OpenParenthesisToken) @@ -4452,7 +4453,7 @@ yydefault: yyVAL.node = node.NewArgumentList(yyDollar[2].list) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.OpenParenthesisToken) @@ -4468,8 +4469,8 @@ yydefault: yyVAL.node = node.NewArgumentList([]node.Node{arg}) // save position - yylex.(*Parser).positions.AddPosition(arg, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[2].node)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) + arg.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[2].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.OpenParenthesisToken) @@ -4503,7 +4504,7 @@ yydefault: yyVAL.node = node.NewArgument(yyDollar[1].node, false, false) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4514,7 +4515,7 @@ yydefault: yyVAL.node = node.NewArgument(yyDollar[1].node, false, false) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4525,7 +4526,7 @@ yydefault: yyVAL.node = node.NewArgument(yyDollar[2].node, false, true) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[2].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[2].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.AmpersandToken) @@ -4539,7 +4540,7 @@ yydefault: yyVAL.node = node.NewArgument(yyDollar[2].node, true, false) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.EllipsisToken) @@ -4573,8 +4574,8 @@ yydefault: yyVAL.node = expr.NewVariable(name) // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.VariableToken) @@ -4588,7 +4589,7 @@ yydefault: yyVAL.node = expr.NewVariable(yyDollar[2].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.DollarToken) @@ -4602,7 +4603,7 @@ yydefault: yyVAL.node = expr.NewVariable(yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.DollarToken) @@ -4621,9 +4622,9 @@ yydefault: yyVAL.list = append(yyDollar[1].list, staticVar) // save position - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) - yylex.(*Parser).positions.AddPosition(staticVar, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) + identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) + variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) + staticVar.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) // save comments yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) @@ -4641,9 +4642,9 @@ yydefault: yyVAL.list = append(yyDollar[1].list, staticVar) // save position - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) - yylex.(*Parser).positions.AddPosition(staticVar, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[3].token, yyDollar[5].node)) + identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) + variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) + staticVar.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[3].token, yyDollar[5].node)) // save comments yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) @@ -4662,9 +4663,9 @@ yydefault: yyVAL.list = []node.Node{staticVar} // save position - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).positions.AddPosition(staticVar, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + staticVar.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(variable, yyDollar[1].token, comment.VariableToken) @@ -4681,9 +4682,9 @@ yydefault: yyVAL.list = []node.Node{staticVar} // save position - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).positions.AddPosition(staticVar, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) + identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + staticVar.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(variable, yyDollar[1].token, comment.VariableToken) @@ -4714,7 +4715,7 @@ yydefault: yyVAL.node = stmt.NewPropertyList(yyDollar[1].list, yyDollar[2].list) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeListTokenPosition(yyDollar[1].list, yyDollar[3].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition(yyDollar[1].list, yyDollar[3].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.SemiColonToken) @@ -4728,7 +4729,7 @@ yydefault: yyVAL.node = yyDollar[1].node // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.SemiColonToken) @@ -4751,11 +4752,11 @@ yydefault: yyVAL.node = stmt.NewClassMethod(name, yyDollar[1].list, yyDollar[3].token != nil, yyDollar[6].list, nil, yyDollar[8].node, "") // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) if yyDollar[1].list == nil { - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[2].token, yyDollar[8].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[2].token, yyDollar[8].node)) } else { - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeListNodePosition(yyDollar[1].list, yyDollar[8].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListNodePosition(yyDollar[1].list, yyDollar[8].node)) } // save comments @@ -4783,7 +4784,7 @@ yydefault: yyVAL.node = stmt.NewTraitUse(yyDollar[2].list, adaptationList) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.UseToken) @@ -4815,7 +4816,7 @@ yydefault: { yyVAL.node = stmt.NewNop() - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.SemiColonToken) @@ -4828,7 +4829,7 @@ yydefault: { yyVAL.node = stmt.NewTraitAdaptationList(yyDollar[2].list) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.OpenCurlyBracesToken) @@ -4897,7 +4898,7 @@ yydefault: yyVAL.node = stmt.NewTraitUsePrecedence(yyDollar[1].node, yyDollar[3].list) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeNodeListPosition(yyDollar[1].node, yyDollar[3].list)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeNodeListPosition(yyDollar[1].node, yyDollar[3].list)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.InsteadofToken) @@ -4931,8 +4932,8 @@ yydefault: yyVAL.node = stmt.NewTraitMethodRef(nil, name) // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(name, yyDollar[1].token, comment.IdentifierToken) @@ -4955,8 +4956,8 @@ yydefault: yyVAL.node = stmt.NewTraitMethodRef(yyDollar[1].node, target) // save position - yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) + target.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PaamayimNekudotayimToken) @@ -4972,8 +4973,8 @@ yydefault: yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, yyDollar[3].node, alias) // save position - yylex.(*Parser).positions.AddPosition(alias, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) + alias.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.AsToken) @@ -4988,7 +4989,7 @@ yydefault: yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, yyDollar[3].node, nil) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.AsToken) @@ -5018,7 +5019,7 @@ yydefault: yyVAL.node = stmt.NewNop() // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.SemiColonToken) @@ -5032,7 +5033,7 @@ yydefault: yyVAL.node = stmt.NewStmtList(yyDollar[2].list) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.OpenCurlyBracesToken) @@ -5056,7 +5057,7 @@ yydefault: yyVAL.list = []node.Node{modifier} // save position - yylex.(*Parser).positions.AddPosition(modifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + modifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(modifier, yyDollar[1].token, comment.VarToken) @@ -5102,7 +5103,7 @@ yydefault: yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.PublicToken) @@ -5116,7 +5117,7 @@ yydefault: yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ProtectedToken) @@ -5130,7 +5131,7 @@ yydefault: yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.PrivateToken) @@ -5144,7 +5145,7 @@ yydefault: yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.StaticToken) @@ -5158,7 +5159,7 @@ yydefault: yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.AbstractToken) @@ -5172,7 +5173,7 @@ yydefault: yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.FinalToken) @@ -5189,9 +5190,9 @@ yydefault: yyVAL.list = append(yyDollar[1].list, property) // save position - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) - yylex.(*Parser).positions.AddPosition(property, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) + identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) + variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) + property.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) // save comments yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) @@ -5209,9 +5210,9 @@ yydefault: yyVAL.list = append(yyDollar[1].list, property) // save position - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) - yylex.(*Parser).positions.AddPosition(property, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[3].token, yyDollar[5].node)) + identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) + variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) + property.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[3].token, yyDollar[5].node)) // save comments yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) @@ -5230,9 +5231,9 @@ yydefault: yyVAL.list = []node.Node{property} // save position - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).positions.AddPosition(property, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + property.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(variable, yyDollar[1].token, comment.VariableToken) @@ -5249,9 +5250,9 @@ yydefault: yyVAL.list = []node.Node{property} // save position - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).positions.AddPosition(property, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) + identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + property.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(variable, yyDollar[1].token, comment.VariableToken) @@ -5270,9 +5271,9 @@ yydefault: yyVAL.node = yyDollar[1].node // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) - yylex.(*Parser).positions.AddPosition(constant, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[3].token, yyDollar[5].node)) - yylex.(*Parser).positions.AddPosition(yyDollar[1].node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[5].node)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) + constant.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[3].token, yyDollar[5].node)) + yyDollar[1].node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[5].node)) // save comments yylex.(*Parser).comments.AddFromToken(lastNode(constList.Consts), yyDollar[2].token, comment.CommaToken) @@ -5290,9 +5291,9 @@ yydefault: yyVAL.node = stmt.NewClassConstList(nil, []node.Node{constant}) // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) - yylex.(*Parser).positions.AddPosition(constant, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[2].token, yyDollar[4].node)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[4].node)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) + constant.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[2].token, yyDollar[4].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[4].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ConstToken) @@ -5379,7 +5380,7 @@ yydefault: yyVAL.list = append(yyDollar[1].list, fetch) // save position - yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) + fetch.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(fetch, yyDollar[2].token, comment.OpenSquareBracket) @@ -5395,7 +5396,7 @@ yydefault: yyVAL.list = []node.Node{fetch} // save position - yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[2].node)) + fetch.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[2].node)) // save comments yylex.(*Parser).comments.AddFromToken(fetch, yyDollar[1].token, comment.OpenSquareBracket) @@ -5450,10 +5451,10 @@ yydefault: if yyDollar[3].node != nil { yyVAL.node = expr.NewNew(yyDollar[2].node, yyDollar[3].node.(*node.ArgumentList)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) } else { yyVAL.node = expr.NewNew(yyDollar[2].node, nil) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) } // save comments @@ -5469,8 +5470,8 @@ yydefault: yyVAL.node = assign.NewAssign(list, yyDollar[6].node) // save position - yylex.(*Parser).positions.AddPosition(list, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[6].node)) + list.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[6].node)) // save comments yylex.(*Parser).comments.AddFromToken(list, yyDollar[1].token, comment.ListToken) @@ -5487,7 +5488,7 @@ yydefault: yyVAL.node = assign.NewAssign(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.EqualToken) @@ -5501,7 +5502,7 @@ yydefault: yyVAL.node = assign.NewReference(yyDollar[1].node, yyDollar[4].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.EqualToken) @@ -5524,11 +5525,11 @@ yydefault: // save position if yyDollar[6].node != nil { - yylex.(*Parser).positions.AddPosition(_new, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[4].token, yyDollar[6].node)) + _new.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[4].token, yyDollar[6].node)) } else { - yylex.(*Parser).positions.AddPosition(_new, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[4].token, yyDollar[5].node)) + _new.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[4].token, yyDollar[5].node)) } - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, _new)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, _new)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.EqualToken) @@ -5544,7 +5545,7 @@ yydefault: yyVAL.node = expr.NewClone(yyDollar[2].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.CloneToken) @@ -5558,7 +5559,7 @@ yydefault: yyVAL.node = assign.NewPlus(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PlusEqualToken) @@ -5572,7 +5573,7 @@ yydefault: yyVAL.node = assign.NewMinus(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.MinusEqualToken) @@ -5586,7 +5587,7 @@ yydefault: yyVAL.node = assign.NewMul(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.MulEqualToken) @@ -5600,7 +5601,7 @@ yydefault: yyVAL.node = assign.NewPow(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PowEqualToken) @@ -5614,7 +5615,7 @@ yydefault: yyVAL.node = assign.NewDiv(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.DivEqualToken) @@ -5628,7 +5629,7 @@ yydefault: yyVAL.node = assign.NewConcat(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.ConcatEqualToken) @@ -5642,7 +5643,7 @@ yydefault: yyVAL.node = assign.NewMod(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.ModEqualToken) @@ -5656,7 +5657,7 @@ yydefault: yyVAL.node = assign.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.AndEqualToken) @@ -5670,7 +5671,7 @@ yydefault: yyVAL.node = assign.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OrEqualToken) @@ -5684,7 +5685,7 @@ yydefault: yyVAL.node = assign.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.XorEqualToken) @@ -5698,7 +5699,7 @@ yydefault: yyVAL.node = assign.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.SlEqualToken) @@ -5712,7 +5713,7 @@ yydefault: yyVAL.node = assign.NewShiftRight(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.SrEqualToken) @@ -5726,7 +5727,7 @@ yydefault: yyVAL.node = expr.NewPostInc(yyDollar[1].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.IncToken) @@ -5740,7 +5741,7 @@ yydefault: yyVAL.node = expr.NewPreInc(yyDollar[2].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.IncToken) @@ -5754,7 +5755,7 @@ yydefault: yyVAL.node = expr.NewPostDec(yyDollar[1].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.DecToken) @@ -5768,7 +5769,7 @@ yydefault: yyVAL.node = expr.NewPreDec(yyDollar[2].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.DecToken) @@ -5782,7 +5783,7 @@ yydefault: yyVAL.node = binary.NewBooleanOr(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.BooleanOrToken) @@ -5796,7 +5797,7 @@ yydefault: yyVAL.node = binary.NewBooleanAnd(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.BooleanAndToken) @@ -5810,7 +5811,7 @@ yydefault: yyVAL.node = binary.NewLogicalOr(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.LogicalOrToken) @@ -5824,7 +5825,7 @@ yydefault: yyVAL.node = binary.NewLogicalAnd(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.LogicalAndToken) @@ -5838,7 +5839,7 @@ yydefault: yyVAL.node = binary.NewLogicalXor(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.LogicalXorToken) @@ -5852,7 +5853,7 @@ yydefault: yyVAL.node = binary.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.VerticalBarToken) @@ -5866,7 +5867,7 @@ yydefault: yyVAL.node = binary.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.AmpersandToken) @@ -5880,7 +5881,7 @@ yydefault: yyVAL.node = binary.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.CaretToken) @@ -5894,7 +5895,7 @@ yydefault: yyVAL.node = binary.NewConcat(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.DotToken) @@ -5908,7 +5909,7 @@ yydefault: yyVAL.node = binary.NewPlus(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PlusToken) @@ -5922,7 +5923,7 @@ yydefault: yyVAL.node = binary.NewMinus(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.MinusToken) @@ -5936,7 +5937,7 @@ yydefault: yyVAL.node = binary.NewMul(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.AsteriskToken) @@ -5950,7 +5951,7 @@ yydefault: yyVAL.node = binary.NewPow(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PowToken) @@ -5964,7 +5965,7 @@ yydefault: yyVAL.node = binary.NewDiv(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.SlashToken) @@ -5978,7 +5979,7 @@ yydefault: yyVAL.node = binary.NewMod(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PercentToken) @@ -5992,7 +5993,7 @@ yydefault: yyVAL.node = binary.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.SlToken) @@ -6006,7 +6007,7 @@ yydefault: yyVAL.node = binary.NewShiftRight(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.SrToken) @@ -6020,7 +6021,7 @@ yydefault: yyVAL.node = expr.NewUnaryPlus(yyDollar[2].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.PlusToken) @@ -6034,7 +6035,7 @@ yydefault: yyVAL.node = expr.NewUnaryMinus(yyDollar[2].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.MinusToken) @@ -6048,7 +6049,7 @@ yydefault: yyVAL.node = expr.NewBooleanNot(yyDollar[2].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ExclamationMarkToken) @@ -6062,7 +6063,7 @@ yydefault: yyVAL.node = expr.NewBitwiseNot(yyDollar[2].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.TildeToken) @@ -6076,7 +6077,7 @@ yydefault: yyVAL.node = binary.NewIdentical(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.IsIdenticalToken) @@ -6090,7 +6091,7 @@ yydefault: yyVAL.node = binary.NewNotIdentical(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.IsNotIdenticalToken) @@ -6104,7 +6105,7 @@ yydefault: yyVAL.node = binary.NewEqual(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.IsEqualToken) @@ -6118,7 +6119,7 @@ yydefault: yyVAL.node = binary.NewNotEqual(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.IsNotEqualToken) @@ -6132,7 +6133,7 @@ yydefault: yyVAL.node = binary.NewSmaller(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.LessToken) @@ -6146,7 +6147,7 @@ yydefault: yyVAL.node = binary.NewSmallerOrEqual(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.IsSmallerOrEqualToken) @@ -6160,7 +6161,7 @@ yydefault: yyVAL.node = binary.NewGreater(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.GreaterToken) @@ -6174,7 +6175,7 @@ yydefault: yyVAL.node = binary.NewGreaterOrEqual(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.IsGreaterOrEqualToken) @@ -6188,7 +6189,7 @@ yydefault: yyVAL.node = expr.NewInstanceOf(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.InstanceofToken) @@ -6233,7 +6234,7 @@ yydefault: } // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyVAL.node, n)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyVAL.node, n)) } // save comments @@ -6249,7 +6250,7 @@ yydefault: yyVAL.node = expr.NewTernary(yyDollar[1].node, yyDollar[3].node, yyDollar[5].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[5].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[5].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.QuestionMarkToken) @@ -6264,7 +6265,7 @@ yydefault: yyVAL.node = expr.NewTernary(yyDollar[1].node, nil, yyDollar[4].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.QuestionMarkToken) @@ -6287,7 +6288,7 @@ yydefault: yyVAL.node = cast.NewInt(yyDollar[2].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.IntCastToken) @@ -6301,7 +6302,7 @@ yydefault: yyVAL.node = cast.NewDouble(yyDollar[2].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.DoubleCastToken) @@ -6315,7 +6316,7 @@ yydefault: yyVAL.node = cast.NewString(yyDollar[2].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.StringCastToken) @@ -6329,7 +6330,7 @@ yydefault: yyVAL.node = cast.NewArray(yyDollar[2].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ArrayCastToken) @@ -6343,7 +6344,7 @@ yydefault: yyVAL.node = cast.NewObject(yyDollar[2].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ObjectCastToken) @@ -6357,7 +6358,7 @@ yydefault: yyVAL.node = cast.NewBool(yyDollar[2].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.BoolCastToken) @@ -6371,7 +6372,7 @@ yydefault: yyVAL.node = cast.NewUnset(yyDollar[2].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.UnsetCastToken) @@ -6396,9 +6397,9 @@ yydefault: // save position if yyDollar[2].node == nil { - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) } else { - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) } // save comments @@ -6417,7 +6418,7 @@ yydefault: yyVAL.node = expr.NewErrorSuppress(yyDollar[2].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.AtToken) @@ -6455,7 +6456,7 @@ yydefault: yyVAL.node = expr.NewShellExec(yyDollar[2].list) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.BackquoteToken) @@ -6470,7 +6471,7 @@ yydefault: yyVAL.node = expr.NewPrint(yyDollar[2].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.PrintToken) @@ -6484,7 +6485,7 @@ yydefault: yyVAL.node = expr.NewYield(nil, nil) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.YieldToken) @@ -6498,7 +6499,7 @@ yydefault: yyVAL.node = expr.NewClosure(yyDollar[4].list, yyDollar[6].ClosureUse, nil, yyDollar[8].list, false, yyDollar[2].token != nil, "") // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[9].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[9].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.FunctionToken) @@ -6519,7 +6520,7 @@ yydefault: yyVAL.node = expr.NewClosure(yyDollar[5].list, yyDollar[7].ClosureUse, nil, yyDollar[9].list, true, yyDollar[3].token != nil, "") // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[10].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[10].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.StaticToken) @@ -6541,7 +6542,7 @@ yydefault: yyVAL.node = expr.NewYield(nil, yyDollar[2].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.YieldToken) @@ -6555,7 +6556,7 @@ yydefault: yyVAL.node = expr.NewYield(nil, yyDollar[2].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.YieldToken) @@ -6569,7 +6570,7 @@ yydefault: yyVAL.node = expr.NewYield(yyDollar[2].node, yyDollar[4].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[4].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[4].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.YieldToken) @@ -6584,7 +6585,7 @@ yydefault: yyVAL.node = expr.NewYield(yyDollar[2].node, yyDollar[4].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[4].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[4].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.YieldToken) @@ -6599,7 +6600,7 @@ yydefault: yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenSquareBracket) @@ -6614,7 +6615,7 @@ yydefault: yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenSquareBracket) @@ -6630,8 +6631,8 @@ yydefault: yyVAL.node = expr.NewArrayDimFetch(str, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(str, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(str, yyDollar[4].token)) + str.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(str, yyDollar[4].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenSquareBracket) @@ -6646,7 +6647,7 @@ yydefault: yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenSquareBracket) @@ -6661,7 +6662,7 @@ yydefault: yyVAL.node = expr.NewArray(yyDollar[3].list) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ArrayToken) @@ -6677,7 +6678,7 @@ yydefault: yyVAL.node = expr.NewShortArray(yyDollar[2].list) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.OpenSquareBracket) @@ -6705,7 +6706,7 @@ yydefault: { yyVAL.ClosureUse = expr.NewClosureUse(yyDollar[3].list) - yylex.(*Parser).positions.AddPosition(yyVAL.ClosureUse, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + yyVAL.ClosureUse.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6718,8 +6719,8 @@ yydefault: yyVAL.list = append(yyDollar[1].list, variable) // save position - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) + identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) + variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) // save comments yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) @@ -6737,8 +6738,9 @@ yydefault: yyVAL.list = append(yyDollar[1].list, reference) // save position - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) + identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) + variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) + reference.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[3].token, yyDollar[4].token)) // save comments yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) @@ -6749,15 +6751,15 @@ yydefault: } case 321: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4368 + //line php5/php5.y:4369 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) yyVAL.list = []node.Node{variable} // save position - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(variable, yyDollar[1].token, comment.VariableToken) @@ -6766,7 +6768,7 @@ yydefault: } case 322: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4383 + //line php5/php5.y:4384 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[2].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -6774,9 +6776,9 @@ yydefault: yyVAL.list = []node.Node{reference} // save position - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) - yylex.(*Parser).positions.AddPosition(reference, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) + identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) + variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) + reference.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments yylex.(*Parser).comments.AddFromToken(reference, yyDollar[1].token, comment.VariableToken) @@ -6786,27 +6788,27 @@ yydefault: } case 323: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4404 + //line php5/php5.y:4405 { name := name.NewName(yyDollar[1].list) yyVAL.node = expr.NewFunctionCall(name, yyDollar[2].node.(*node.ArgumentList)) // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(name, yyDollar[2].node)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(name, yyDollar[2].node)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 324: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4415 + //line php5/php5.y:4416 { funcName := name.NewRelative(yyDollar[3].list) yyVAL.node = expr.NewFunctionCall(funcName, yyDollar[4].node.(*node.ArgumentList)) // save position - yylex.(*Parser).positions.AddPosition(funcName, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(funcName, yyDollar[4].node)) + funcName.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(funcName, yyDollar[4].node)) // save comments yylex.(*Parser).comments.AddFromToken(funcName, yyDollar[1].token, comment.NamespaceToken) @@ -6816,14 +6818,14 @@ yydefault: } case 325: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4430 + //line php5/php5.y:4431 { funcName := name.NewFullyQualified(yyDollar[2].list) yyVAL.node = expr.NewFunctionCall(funcName, yyDollar[3].node.(*node.ArgumentList)) // save position - yylex.(*Parser).positions.AddPosition(funcName, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(funcName, yyDollar[3].node)) + funcName.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(funcName, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(funcName, yyDollar[1].token, comment.NsSeparatorToken) @@ -6832,12 +6834,12 @@ yydefault: } case 326: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4444 + //line php5/php5.y:4445 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PaamayimNekudotayimToken) @@ -6846,12 +6848,12 @@ yydefault: } case 327: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4456 + //line php5/php5.y:4457 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PaamayimNekudotayimToken) @@ -6860,12 +6862,12 @@ yydefault: } case 328: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4468 + //line php5/php5.y:4469 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PaamayimNekudotayimToken) @@ -6874,12 +6876,12 @@ yydefault: } case 329: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4480 + //line php5/php5.y:4481 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PaamayimNekudotayimToken) @@ -6888,23 +6890,23 @@ yydefault: } case 330: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4492 + //line php5/php5.y:4493 { yyVAL.node = expr.NewFunctionCall(yyDollar[1].node, yyDollar[2].node.(*node.ArgumentList)) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[2].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[2].node)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 331: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4504 + //line php5/php5.y:4505 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.StaticToken) @@ -6913,23 +6915,23 @@ yydefault: } case 332: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4516 + //line php5/php5.y:4517 { yyVAL.node = name.NewName(yyDollar[1].list) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 333: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4525 + //line php5/php5.y:4526 { yyVAL.node = name.NewRelative(yyDollar[3].list) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.NamespaceToken) @@ -6939,12 +6941,12 @@ yydefault: } case 334: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4538 + //line php5/php5.y:4539 { yyVAL.node = name.NewFullyQualified(yyDollar[2].list) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.NsSeparatorToken) @@ -6953,23 +6955,23 @@ yydefault: } case 335: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4553 + //line php5/php5.y:4554 { yyVAL.node = name.NewName(yyDollar[1].list) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 336: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4562 + //line php5/php5.y:4563 { yyVAL.node = name.NewRelative(yyDollar[3].list) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.NamespaceToken) @@ -6979,12 +6981,12 @@ yydefault: } case 337: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4575 + //line php5/php5.y:4576 { yyVAL.node = name.NewFullyQualified(yyDollar[2].list) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.NsSeparatorToken) @@ -6993,7 +6995,7 @@ yydefault: } case 338: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4590 + //line php5/php5.y:4591 { yyVAL.node = yyDollar[1].node @@ -7001,7 +7003,7 @@ yydefault: } case 339: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4596 + //line php5/php5.y:4597 { yyVAL.node = yyDollar[1].node @@ -7009,7 +7011,7 @@ yydefault: } case 340: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4605 + //line php5/php5.y:4606 { yyVAL.node = yyDollar[1].node @@ -7020,12 +7022,12 @@ yydefault: switch nn := n.(type) { case *expr.ArrayDimFetch: nn.Variable = yyVAL.node - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyVAL.node, nn)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyVAL.node, nn)) yyVAL.node = nn case *expr.PropertyFetch: nn.Variable = yyVAL.node - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyVAL.node, nn)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyVAL.node, nn)) yyVAL.node = nn } } @@ -7034,12 +7036,12 @@ yydefault: switch nn := n.(type) { case *expr.ArrayDimFetch: nn.Variable = yyVAL.node - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyVAL.node, nn)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyVAL.node, nn)) yyVAL.node = nn case *expr.PropertyFetch: nn.Variable = yyVAL.node - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyVAL.node, nn)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyVAL.node, nn)) yyVAL.node = nn } } @@ -7048,7 +7050,7 @@ yydefault: } case 341: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4642 + //line php5/php5.y:4643 { yyVAL.node = yyDollar[1].node @@ -7056,7 +7058,7 @@ yydefault: } case 342: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4652 + //line php5/php5.y:4653 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) @@ -7064,7 +7066,7 @@ yydefault: } case 343: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:4658 + //line php5/php5.y:4659 { yyVAL.list = []node.Node{} @@ -7072,7 +7074,7 @@ yydefault: } case 344: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4668 + //line php5/php5.y:4669 { yyVAL.list = yyDollar[2].list @@ -7083,7 +7085,7 @@ yydefault: } case 345: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:4680 + //line php5/php5.y:4681 { yyVAL.node = nil @@ -7091,12 +7093,12 @@ yydefault: } case 346: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4686 + //line php5/php5.y:4687 { yyVAL.node = expr.NewExit(nil) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.OpenParenthesisToken) @@ -7106,18 +7108,18 @@ yydefault: } case 347: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4699 + //line php5/php5.y:4700 { yyVAL.node = expr.NewExit(yyDollar[1].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 348: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:4711 + //line php5/php5.y:4712 { yyVAL.list = []node.Node{} @@ -7125,7 +7127,7 @@ yydefault: } case 349: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4717 + //line php5/php5.y:4718 { yyVAL.list = []node.Node{scalar.NewEncapsedStringPart(yyDollar[1].token.Value)} @@ -7133,7 +7135,7 @@ yydefault: } case 350: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4723 + //line php5/php5.y:4724 { yyVAL.list = yyDollar[1].list @@ -7141,7 +7143,7 @@ yydefault: } case 351: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:4732 + //line php5/php5.y:4733 { yyVAL.node = nil @@ -7149,7 +7151,7 @@ yydefault: } case 352: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4738 + //line php5/php5.y:4739 { yyVAL.node = yyDollar[1].node @@ -7157,12 +7159,12 @@ yydefault: } case 353: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4747 + //line php5/php5.y:4748 { yyVAL.node = scalar.NewLnumber(yyDollar[1].token.Value) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.LnumberToken) @@ -7171,12 +7173,12 @@ yydefault: } case 354: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4759 + //line php5/php5.y:4760 { yyVAL.node = scalar.NewDnumber(yyDollar[1].token.Value) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.DnumberToken) @@ -7185,12 +7187,12 @@ yydefault: } case 355: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4771 + //line php5/php5.y:4772 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ConstantEncapsedStringToken) @@ -7199,12 +7201,12 @@ yydefault: } case 356: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4783 + //line php5/php5.y:4784 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.LineToken) @@ -7213,12 +7215,12 @@ yydefault: } case 357: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4795 + //line php5/php5.y:4796 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.FileToken) @@ -7227,12 +7229,12 @@ yydefault: } case 358: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4807 + //line php5/php5.y:4808 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.DirToken) @@ -7241,12 +7243,12 @@ yydefault: } case 359: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4819 + //line php5/php5.y:4820 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.TraitCToken) @@ -7255,12 +7257,12 @@ yydefault: } case 360: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4831 + //line php5/php5.y:4832 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.MethodCToken) @@ -7269,12 +7271,12 @@ yydefault: } case 361: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4843 + //line php5/php5.y:4844 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.FuncCToken) @@ -7283,12 +7285,12 @@ yydefault: } case 362: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4855 + //line php5/php5.y:4856 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.NsCToken) @@ -7297,14 +7299,14 @@ yydefault: } case 363: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4867 + //line php5/php5.y:4868 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, []node.Node{encapsed}) // save position - yylex.(*Parser).positions.AddPosition(encapsed, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) + encapsed.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.StartHeredocToken) @@ -7313,12 +7315,12 @@ yydefault: } case 364: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4881 + //line php5/php5.y:4882 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, nil) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.StartHeredocToken) @@ -7327,14 +7329,14 @@ yydefault: } case 365: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4896 + //line php5/php5.y:4897 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) // save position - yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) + target.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PaamayimNekudotayimToken) @@ -7344,7 +7346,7 @@ yydefault: } case 366: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4914 + //line php5/php5.y:4915 { yyVAL.node = yyDollar[1].node @@ -7352,7 +7354,7 @@ yydefault: } case 367: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4923 + //line php5/php5.y:4924 { yyVAL.node = yyDollar[1].node @@ -7360,7 +7362,7 @@ yydefault: } case 368: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4929 + //line php5/php5.y:4930 { yyVAL.node = yyDollar[1].node @@ -7368,27 +7370,27 @@ yydefault: } case 369: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4935 + //line php5/php5.y:4936 { name := name.NewName(yyDollar[1].list) yyVAL.node = expr.NewConstFetch(name) // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(name)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(name)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 370: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4946 + //line php5/php5.y:4947 { name := name.NewRelative(yyDollar[3].list) yyVAL.node = expr.NewConstFetch(name) // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.NamespaceToken) @@ -7398,14 +7400,14 @@ yydefault: } case 371: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4961 + //line php5/php5.y:4962 { name := name.NewFullyQualified(yyDollar[2].list) yyVAL.node = expr.NewConstFetch(name) // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.NsSeparatorToken) @@ -7414,12 +7416,12 @@ yydefault: } case 372: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4975 + //line php5/php5.y:4976 { yyVAL.node = expr.NewArray(yyDollar[3].list) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ArrayToken) @@ -7430,12 +7432,12 @@ yydefault: } case 373: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4989 + //line php5/php5.y:4990 { yyVAL.node = expr.NewShortArray(yyDollar[2].list) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.OpenSquareBracket) @@ -7445,7 +7447,7 @@ yydefault: } case 374: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5002 + //line php5/php5.y:5003 { yyVAL.node = yyDollar[1].node @@ -7453,12 +7455,12 @@ yydefault: } case 375: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5008 + //line php5/php5.y:5009 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ClassCToken) @@ -7467,7 +7469,7 @@ yydefault: } case 376: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5020 + //line php5/php5.y:5021 { yyVAL.node = yyDollar[1].node @@ -7475,12 +7477,12 @@ yydefault: } case 377: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:5029 + //line php5/php5.y:5030 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenSquareBracket) @@ -7490,12 +7492,12 @@ yydefault: } case 378: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5042 + //line php5/php5.y:5043 { yyVAL.node = binary.NewPlus(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PlusToken) @@ -7504,12 +7506,12 @@ yydefault: } case 379: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5054 + //line php5/php5.y:5055 { yyVAL.node = binary.NewMinus(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.MinusToken) @@ -7518,12 +7520,12 @@ yydefault: } case 380: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5066 + //line php5/php5.y:5067 { yyVAL.node = binary.NewMul(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.AsteriskToken) @@ -7532,12 +7534,12 @@ yydefault: } case 381: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5078 + //line php5/php5.y:5079 { yyVAL.node = binary.NewPow(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PowToken) @@ -7546,12 +7548,12 @@ yydefault: } case 382: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5090 + //line php5/php5.y:5091 { yyVAL.node = binary.NewDiv(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.SlashToken) @@ -7560,12 +7562,12 @@ yydefault: } case 383: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5102 + //line php5/php5.y:5103 { yyVAL.node = binary.NewMod(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PercentToken) @@ -7574,12 +7576,12 @@ yydefault: } case 384: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5114 + //line php5/php5.y:5115 { yyVAL.node = expr.NewBooleanNot(yyDollar[2].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ExclamationMarkToken) @@ -7588,12 +7590,12 @@ yydefault: } case 385: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5126 + //line php5/php5.y:5127 { yyVAL.node = expr.NewBitwiseNot(yyDollar[2].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.TildeToken) @@ -7602,12 +7604,12 @@ yydefault: } case 386: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5138 + //line php5/php5.y:5139 { yyVAL.node = binary.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.VerticalBarToken) @@ -7616,12 +7618,12 @@ yydefault: } case 387: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5150 + //line php5/php5.y:5151 { yyVAL.node = binary.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.AmpersandToken) @@ -7630,12 +7632,12 @@ yydefault: } case 388: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5162 + //line php5/php5.y:5163 { yyVAL.node = binary.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.CaretToken) @@ -7644,12 +7646,12 @@ yydefault: } case 389: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5174 + //line php5/php5.y:5175 { yyVAL.node = binary.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.SlToken) @@ -7658,12 +7660,12 @@ yydefault: } case 390: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5186 + //line php5/php5.y:5187 { yyVAL.node = binary.NewShiftRight(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.SrToken) @@ -7672,12 +7674,12 @@ yydefault: } case 391: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5198 + //line php5/php5.y:5199 { yyVAL.node = binary.NewConcat(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.DotToken) @@ -7686,12 +7688,12 @@ yydefault: } case 392: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5210 + //line php5/php5.y:5211 { yyVAL.node = binary.NewLogicalXor(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.LogicalXorToken) @@ -7700,12 +7702,12 @@ yydefault: } case 393: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5222 + //line php5/php5.y:5223 { yyVAL.node = binary.NewLogicalAnd(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.LogicalAndToken) @@ -7714,12 +7716,12 @@ yydefault: } case 394: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5234 + //line php5/php5.y:5235 { yyVAL.node = binary.NewLogicalOr(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.LogicalOrToken) @@ -7728,12 +7730,12 @@ yydefault: } case 395: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5246 + //line php5/php5.y:5247 { yyVAL.node = binary.NewBooleanAnd(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.BooleanAndToken) @@ -7742,12 +7744,12 @@ yydefault: } case 396: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5258 + //line php5/php5.y:5259 { yyVAL.node = binary.NewBooleanOr(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.BooleanOrToken) @@ -7756,12 +7758,12 @@ yydefault: } case 397: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5270 + //line php5/php5.y:5271 { yyVAL.node = binary.NewIdentical(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.IsIdenticalToken) @@ -7770,12 +7772,12 @@ yydefault: } case 398: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5282 + //line php5/php5.y:5283 { yyVAL.node = binary.NewNotIdentical(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.IsNotIdenticalToken) @@ -7784,12 +7786,12 @@ yydefault: } case 399: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5294 + //line php5/php5.y:5295 { yyVAL.node = binary.NewEqual(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.IsEqualToken) @@ -7798,12 +7800,12 @@ yydefault: } case 400: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5306 + //line php5/php5.y:5307 { yyVAL.node = binary.NewNotEqual(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.IsNotEqualToken) @@ -7812,12 +7814,12 @@ yydefault: } case 401: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5318 + //line php5/php5.y:5319 { yyVAL.node = binary.NewSmaller(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.LessToken) @@ -7826,12 +7828,12 @@ yydefault: } case 402: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5330 + //line php5/php5.y:5331 { yyVAL.node = binary.NewGreater(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.GreaterToken) @@ -7840,12 +7842,12 @@ yydefault: } case 403: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5342 + //line php5/php5.y:5343 { yyVAL.node = binary.NewSmallerOrEqual(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.IsSmallerOrEqualToken) @@ -7854,12 +7856,12 @@ yydefault: } case 404: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5354 + //line php5/php5.y:5355 { yyVAL.node = binary.NewGreaterOrEqual(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.IsGreaterOrEqualToken) @@ -7868,12 +7870,12 @@ yydefault: } case 405: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:5366 + //line php5/php5.y:5367 { yyVAL.node = expr.NewTernary(yyDollar[1].node, nil, yyDollar[4].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.QuestionMarkToken) @@ -7883,12 +7885,12 @@ yydefault: } case 406: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:5379 + //line php5/php5.y:5380 { yyVAL.node = expr.NewTernary(yyDollar[1].node, yyDollar[3].node, yyDollar[5].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[5].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[5].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.QuestionMarkToken) @@ -7898,12 +7900,12 @@ yydefault: } case 407: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5392 + //line php5/php5.y:5393 { yyVAL.node = expr.NewUnaryPlus(yyDollar[2].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.PlusToken) @@ -7912,12 +7914,12 @@ yydefault: } case 408: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5404 + //line php5/php5.y:5405 { yyVAL.node = expr.NewUnaryMinus(yyDollar[2].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.MinusToken) @@ -7926,7 +7928,7 @@ yydefault: } case 409: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5416 + //line php5/php5.y:5417 { yyVAL.node = yyDollar[2].node @@ -7938,7 +7940,7 @@ yydefault: } case 410: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5429 + //line php5/php5.y:5430 { yyVAL.node = yyDollar[1].node @@ -7946,25 +7948,25 @@ yydefault: } case 411: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5435 + //line php5/php5.y:5436 { name := name.NewName(yyDollar[1].list) yyVAL.node = expr.NewConstFetch(name) // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(name)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(name)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 412: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5446 + //line php5/php5.y:5447 { name := name.NewRelative(yyDollar[3].list) yyVAL.node = expr.NewConstFetch(name) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(name)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(name)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.NamespaceToken) @@ -7974,14 +7976,14 @@ yydefault: } case 413: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5459 + //line php5/php5.y:5460 { name := name.NewFullyQualified(yyDollar[2].list) yyVAL.node = expr.NewConstFetch(name) // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(name)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(name)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.NsSeparatorToken) @@ -7990,14 +7992,14 @@ yydefault: } case 414: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5476 + //line php5/php5.y:5477 { name := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = expr.NewVariable(name) // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(name, yyDollar[1].token, comment.StringVarnameToken) @@ -8006,7 +8008,7 @@ yydefault: } case 415: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5490 + //line php5/php5.y:5491 { yyVAL.node = yyDollar[1].node @@ -8014,7 +8016,7 @@ yydefault: } case 416: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5496 + //line php5/php5.y:5497 { yyVAL.node = yyDollar[1].node @@ -8022,7 +8024,7 @@ yydefault: } case 417: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5502 + //line php5/php5.y:5503 { yyVAL.node = yyDollar[1].node @@ -8030,12 +8032,12 @@ yydefault: } case 418: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5508 + //line php5/php5.y:5509 { yyVAL.node = scalar.NewEncapsed(yyDollar[2].list) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.DoubleQuoteToken) @@ -8044,12 +8046,12 @@ yydefault: } case 419: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5520 + //line php5/php5.y:5521 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, yyDollar[2].list) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.StartHeredocToken) @@ -8058,12 +8060,12 @@ yydefault: } case 420: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5532 + //line php5/php5.y:5533 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ClassCToken) @@ -8072,7 +8074,7 @@ yydefault: } case 421: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:5547 + //line php5/php5.y:5548 { yyVAL.list = nil @@ -8080,7 +8082,7 @@ yydefault: } case 422: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5553 + //line php5/php5.y:5554 { yyVAL.list = yyDollar[1].list @@ -8093,25 +8095,25 @@ yydefault: } case 423: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:5567 + //line php5/php5.y:5568 { yyVAL.token = nil } case 424: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5571 + //line php5/php5.y:5572 { yyVAL.token = yyDollar[1].token } case 425: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:5578 + //line php5/php5.y:5579 { arrayItem := expr.NewArrayItem(yyDollar[3].node, yyDollar[5].node) yyVAL.list = append(yyDollar[1].list, arrayItem) // save position - yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[3].node, yyDollar[5].node)) + arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[3].node, yyDollar[5].node)) // save comments yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) @@ -8121,13 +8123,13 @@ yydefault: } case 426: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5592 + //line php5/php5.y:5593 { arrayItem := expr.NewArrayItem(nil, yyDollar[3].node) yyVAL.list = append(yyDollar[1].list, arrayItem) // save position - yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) + arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) @@ -8136,13 +8138,13 @@ yydefault: } case 427: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5605 + //line php5/php5.y:5606 { arrayItem := expr.NewArrayItem(yyDollar[1].node, yyDollar[3].node) yyVAL.list = []node.Node{arrayItem} // save position - yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(arrayItem, yyDollar[2].token, comment.DoubleArrowToken) @@ -8151,19 +8153,19 @@ yydefault: } case 428: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5618 + //line php5/php5.y:5619 { arrayItem := expr.NewArrayItem(nil, yyDollar[1].node) yyVAL.list = []node.Node{arrayItem} // save position - yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) + arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 429: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5631 + //line php5/php5.y:5632 { yyVAL.node = yyDollar[1].node @@ -8171,7 +8173,7 @@ yydefault: } case 430: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5637 + //line php5/php5.y:5638 { yyVAL.node = yyDollar[1].node @@ -8179,7 +8181,7 @@ yydefault: } case 431: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5646 + //line php5/php5.y:5647 { yyVAL.node = yyDollar[2].node @@ -8187,7 +8189,7 @@ yydefault: } case 432: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5652 + //line php5/php5.y:5653 { yyVAL.node = yyDollar[2].node @@ -8195,7 +8197,7 @@ yydefault: } case 433: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5662 + //line php5/php5.y:5663 { yyVAL.node = yyDollar[1].node @@ -8203,7 +8205,7 @@ yydefault: } case 434: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5672 + //line php5/php5.y:5673 { yyVAL.node = yyDollar[1].node @@ -8211,7 +8213,7 @@ yydefault: } case 435: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5681 + //line php5/php5.y:5682 { yyVAL.node = yyDollar[1].node @@ -8219,7 +8221,7 @@ yydefault: } case 436: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:5690 + //line php5/php5.y:5691 { yyVAL.node = yyDollar[1].node @@ -8235,17 +8237,17 @@ yydefault: switch nn := n.(type) { case *expr.ArrayDimFetch: nn.Variable = yyVAL.node - yylex.(*Parser).positions.AddPosition(nn, yylex.(*Parser).positionBuilder.NewNodesPosition(yyVAL.node, nn)) + nn.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyVAL.node, nn)) yyVAL.node = nn case *expr.PropertyFetch: nn.Variable = yyVAL.node - yylex.(*Parser).positions.AddPosition(nn, yylex.(*Parser).positionBuilder.NewNodesPosition(yyVAL.node, nn)) + nn.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyVAL.node, nn)) yyVAL.node = nn case *expr.MethodCall: nn.Variable = yyVAL.node - yylex.(*Parser).positions.AddPosition(nn, yylex.(*Parser).positionBuilder.NewNodesPosition(yyVAL.node, nn)) + nn.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyVAL.node, nn)) yyVAL.node = nn } } @@ -8254,17 +8256,17 @@ yydefault: switch nn := n.(type) { case *expr.ArrayDimFetch: nn.Variable = yyVAL.node - yylex.(*Parser).positions.AddPosition(nn, yylex.(*Parser).positionBuilder.NewNodesPosition(yyVAL.node, nn)) + nn.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyVAL.node, nn)) yyVAL.node = nn case *expr.PropertyFetch: nn.Variable = yyVAL.node - yylex.(*Parser).positions.AddPosition(nn, yylex.(*Parser).positionBuilder.NewNodesPosition(yyVAL.node, nn)) + nn.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyVAL.node, nn)) yyVAL.node = nn case *expr.MethodCall: nn.Variable = yyVAL.node - yylex.(*Parser).positions.AddPosition(nn, yylex.(*Parser).positionBuilder.NewNodesPosition(yyVAL.node, nn)) + nn.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyVAL.node, nn)) yyVAL.node = nn } } @@ -8273,7 +8275,7 @@ yydefault: } case 437: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5742 + //line php5/php5.y:5743 { yyVAL.node = yyDollar[1].node @@ -8281,7 +8283,7 @@ yydefault: } case 438: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5751 + //line php5/php5.y:5752 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) @@ -8289,7 +8291,7 @@ yydefault: } case 439: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:5757 + //line php5/php5.y:5758 { yyVAL.list = []node.Node{} @@ -8297,7 +8299,7 @@ yydefault: } case 440: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5767 + //line php5/php5.y:5768 { if yyDollar[3].list != nil { yyDollar[3].list[0].(*expr.MethodCall).Method = yyDollar[2].list[len(yyDollar[2].list)-1].(*expr.PropertyFetch).Property @@ -8313,13 +8315,13 @@ yydefault: } case 441: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:5784 + //line php5/php5.y:5785 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yyVAL.list = append(yyDollar[1].list, fetch) // save position - yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) + fetch.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(fetch, yyDollar[2].token, comment.OpenSquareBracket) @@ -8329,13 +8331,13 @@ yydefault: } case 442: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:5798 + //line php5/php5.y:5799 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yyVAL.list = []node.Node{yyDollar[1].node, fetch} // save position - yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) + fetch.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(fetch, yyDollar[2].token, comment.OpenSquareBracket) @@ -8345,18 +8347,18 @@ yydefault: } case 443: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5815 + //line php5/php5.y:5816 { yyVAL.node = expr.NewMethodCall(nil, nil, yyDollar[1].node.(*node.ArgumentList)) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 444: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5827 + //line php5/php5.y:5828 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -8364,7 +8366,7 @@ yydefault: } case 445: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5833 + //line php5/php5.y:5834 { yyVAL.list = yyDollar[1].list @@ -8372,7 +8374,7 @@ yydefault: } case 446: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:5839 + //line php5/php5.y:5840 { yyVAL.list = nil @@ -8380,7 +8382,7 @@ yydefault: } case 447: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5848 + //line php5/php5.y:5849 { yyVAL.node = yyDollar[1].node @@ -8388,12 +8390,12 @@ yydefault: } case 448: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5854 + //line php5/php5.y:5855 { yyDollar[1].simpleIndirectReference.last.SetVarName(yyDollar[2].node) for _, n := range yyDollar[1].simpleIndirectReference.all { - yylex.(*Parser).positions[n] = yylex.(*Parser).positionBuilder.NewNodesPosition(n, yyDollar[2].node) + n.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(n, yyDollar[2].node)) } yyVAL.node = yyDollar[1].simpleIndirectReference.all[0] @@ -8402,12 +8404,12 @@ yydefault: } case 449: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5869 + //line php5/php5.y:5870 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PaamayimNekudotayimToken) @@ -8416,12 +8418,12 @@ yydefault: } case 450: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5881 + //line php5/php5.y:5882 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PaamayimNekudotayimToken) @@ -8430,7 +8432,7 @@ yydefault: } case 451: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5896 + //line php5/php5.y:5897 { yyVAL.node = yyDollar[1].node @@ -8438,12 +8440,12 @@ yydefault: } case 452: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:5905 + //line php5/php5.y:5906 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenSquareBracket) @@ -8453,12 +8455,12 @@ yydefault: } case 453: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:5918 + //line php5/php5.y:5919 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenSquareBracket) @@ -8468,7 +8470,7 @@ yydefault: } case 454: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5934 + //line php5/php5.y:5935 { yyVAL.node = yyDollar[1].node @@ -8476,7 +8478,7 @@ yydefault: } case 455: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5940 + //line php5/php5.y:5941 { yyVAL.node = yyDollar[1].node @@ -8484,7 +8486,7 @@ yydefault: } case 456: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5946 + //line php5/php5.y:5947 { yyVAL.node = yyDollar[1].node @@ -8492,7 +8494,7 @@ yydefault: } case 457: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5956 + //line php5/php5.y:5957 { yyVAL.node = yyDollar[1].node @@ -8500,12 +8502,12 @@ yydefault: } case 458: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5962 + //line php5/php5.y:5963 { yyDollar[1].simpleIndirectReference.last.SetVarName(yyDollar[2].node) for _, n := range yyDollar[1].simpleIndirectReference.all { - yylex.(*Parser).positions[n] = yylex.(*Parser).positionBuilder.NewNodesPosition(n, yyDollar[2].node) + n.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(n, yyDollar[2].node)) } yyVAL.node = yyDollar[1].simpleIndirectReference.all[0] @@ -8514,7 +8516,7 @@ yydefault: } case 459: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5974 + //line php5/php5.y:5975 { yyVAL.node = yyDollar[1].node @@ -8522,12 +8524,12 @@ yydefault: } case 460: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:5983 + //line php5/php5.y:5984 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenSquareBracket) @@ -8537,12 +8539,12 @@ yydefault: } case 461: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:5996 + //line php5/php5.y:5997 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenCurlyBracesToken) @@ -8552,7 +8554,7 @@ yydefault: } case 462: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6009 + //line php5/php5.y:6010 { yyVAL.node = yyDollar[1].node @@ -8560,14 +8562,14 @@ yydefault: } case 463: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6019 + //line php5/php5.y:6020 { name := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(name) // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.VariableToken) @@ -8576,12 +8578,12 @@ yydefault: } case 464: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6033 + //line php5/php5.y:6034 { yyVAL.node = expr.NewVariable(yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.DollarToken) @@ -8592,7 +8594,7 @@ yydefault: } case 465: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:6050 + //line php5/php5.y:6051 { yyVAL.node = nil @@ -8600,7 +8602,7 @@ yydefault: } case 466: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6056 + //line php5/php5.y:6057 { yyVAL.node = yyDollar[1].node @@ -8608,7 +8610,7 @@ yydefault: } case 467: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6066 + //line php5/php5.y:6067 { yyVAL.list = yyDollar[1].list @@ -8616,25 +8618,25 @@ yydefault: } case 468: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6072 + //line php5/php5.y:6073 { fetch := expr.NewPropertyFetch(nil, yyDollar[1].node) yyVAL.list = []node.Node{fetch} // save position - yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) + fetch.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 469: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6085 + //line php5/php5.y:6086 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yyVAL.list = append(yyDollar[1].list, fetch) // save position - yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) + fetch.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(fetch, yyDollar[2].token, comment.OpenSquareBracket) @@ -8644,13 +8646,13 @@ yydefault: } case 470: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6099 + //line php5/php5.y:6100 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yyVAL.list = append(yyDollar[1].list, fetch) // save position - yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) + fetch.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(fetch, yyDollar[2].token, comment.OpenCurlyBracesToken) @@ -8660,24 +8662,24 @@ yydefault: } case 471: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6113 + //line php5/php5.y:6114 { fetch := expr.NewPropertyFetch(nil, yyDollar[1].node) yyVAL.list = []node.Node{fetch} // save position - yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) + fetch.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 472: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6126 + //line php5/php5.y:6127 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.StringToken) @@ -8686,12 +8688,12 @@ yydefault: } case 473: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6138 + //line php5/php5.y:6139 { yyVAL.node = yyDollar[2].node // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.OpenCurlyBracesToken) @@ -8701,13 +8703,13 @@ yydefault: } case 474: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6154 + //line php5/php5.y:6155 { n := expr.NewVariable(nil) yyVAL.simpleIndirectReference = simpleIndirectReference{[]*expr.Variable{n}, n} // save position - yylex.(*Parser).positions.AddPosition(n, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + n.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(n, yyDollar[1].token, comment.DollarToken) @@ -8716,7 +8718,7 @@ yydefault: } case 475: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6167 + //line php5/php5.y:6168 { n := expr.NewVariable(nil) @@ -8726,7 +8728,7 @@ yydefault: yyVAL.simpleIndirectReference = yyDollar[1].simpleIndirectReference // save position - yylex.(*Parser).positions.AddPosition(n, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) + n.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) // save comments yylex.(*Parser).comments.AddFromToken(n, yyDollar[2].token, comment.DollarToken) @@ -8735,7 +8737,7 @@ yydefault: } case 476: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6187 + //line php5/php5.y:6188 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -8746,7 +8748,7 @@ yydefault: } case 477: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6196 + //line php5/php5.y:6197 { if yyDollar[1].node == nil { yyVAL.list = []node.Node{} @@ -8758,25 +8760,25 @@ yydefault: } case 478: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6210 + //line php5/php5.y:6211 { yyVAL.node = expr.NewArrayItem(nil, yyDollar[1].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 479: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6219 + //line php5/php5.y:6220 { item := expr.NewList(yyDollar[3].list) yyVAL.node = expr.NewArrayItem(nil, item) // save position - yylex.(*Parser).positions.AddPosition(item, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(item)) + item.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(item)) // save comments yylex.(*Parser).comments.AddFromToken(item, yyDollar[1].token, comment.ListToken) @@ -8787,7 +8789,7 @@ yydefault: } case 480: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:6235 + //line php5/php5.y:6236 { yyVAL.node = nil @@ -8795,7 +8797,7 @@ yydefault: } case 481: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:6245 + //line php5/php5.y:6246 { yyVAL.list = []node.Node{} @@ -8803,7 +8805,7 @@ yydefault: } case 482: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6251 + //line php5/php5.y:6252 { yyVAL.list = yyDollar[1].list @@ -8816,13 +8818,13 @@ yydefault: } case 483: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:6265 + //line php5/php5.y:6266 { arrayItem := expr.NewArrayItem(yyDollar[3].node, yyDollar[5].node) yyVAL.list = append(yyDollar[1].list, arrayItem) // save position - yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[3].node, yyDollar[5].node)) + arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[3].node, yyDollar[5].node)) // save comments yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) @@ -8832,13 +8834,13 @@ yydefault: } case 484: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6279 + //line php5/php5.y:6280 { arrayItem := expr.NewArrayItem(nil, yyDollar[3].node) yyVAL.list = append(yyDollar[1].list, arrayItem) // save position - yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) + arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) @@ -8847,13 +8849,13 @@ yydefault: } case 485: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6292 + //line php5/php5.y:6293 { arrayItem := expr.NewArrayItem(yyDollar[1].node, yyDollar[3].node) yyVAL.list = []node.Node{arrayItem} // save position - yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(arrayItem, yyDollar[2].token, comment.DoubleArrowToken) @@ -8862,27 +8864,27 @@ yydefault: } case 486: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6305 + //line php5/php5.y:6306 { arrayItem := expr.NewArrayItem(nil, yyDollar[1].node) yyVAL.list = []node.Node{arrayItem} // save position - yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) + arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 487: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:6315 + //line php5/php5.y:6316 { reference := expr.NewReference(yyDollar[6].node) arrayItem := expr.NewArrayItem(yyDollar[3].node, reference) yyVAL.list = append(yyDollar[1].list, arrayItem) // save position - yylex.(*Parser).positions.AddPosition(reference, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[5].token, yyDollar[6].node)) - yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[3].node, yyDollar[6].node)) + reference.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[5].token, yyDollar[6].node)) + arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[3].node, yyDollar[6].node)) // save comments yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) @@ -8893,15 +8895,15 @@ yydefault: } case 488: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6332 + //line php5/php5.y:6333 { reference := expr.NewReference(yyDollar[4].node) arrayItem := expr.NewArrayItem(nil, reference) yyVAL.list = append(yyDollar[1].list, arrayItem) // save position - yylex.(*Parser).positions.AddPosition(reference, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[3].token, yyDollar[4].node)) - yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[3].token, yyDollar[4].node)) + reference.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[3].token, yyDollar[4].node)) + arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[3].token, yyDollar[4].node)) // save comments yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) @@ -8911,15 +8913,15 @@ yydefault: } case 489: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6348 + //line php5/php5.y:6349 { reference := expr.NewReference(yyDollar[4].node) arrayItem := expr.NewArrayItem(yyDollar[1].node, reference) yyVAL.list = []node.Node{arrayItem} // save position - yylex.(*Parser).positions.AddPosition(reference, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[3].token, yyDollar[4].node)) - yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) + reference.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[3].token, yyDollar[4].node)) + arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) // save comments yylex.(*Parser).comments.AddFromToken(arrayItem, yyDollar[2].token, comment.DoubleArrowToken) @@ -8929,15 +8931,15 @@ yydefault: } case 490: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6364 + //line php5/php5.y:6365 { reference := expr.NewReference(yyDollar[2].node) arrayItem := expr.NewArrayItem(nil, reference) yyVAL.list = []node.Node{arrayItem} // save position - yylex.(*Parser).positions.AddPosition(reference, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) - yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + reference.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments yylex.(*Parser).comments.AddFromToken(reference, yyDollar[1].token, comment.AmpersandToken) @@ -8946,7 +8948,7 @@ yydefault: } case 491: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6382 + //line php5/php5.y:6383 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -8954,13 +8956,13 @@ yydefault: } case 492: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6388 + //line php5/php5.y:6389 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yyVAL.list = append(yyDollar[1].list, encapsed) // save position - yylex.(*Parser).positions.AddPosition(encapsed, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) + encapsed.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) // save comments yylex.(*Parser).comments.AddFromToken(encapsed, yyDollar[2].token, comment.EncapsedAndWhitespaceToken) @@ -8969,7 +8971,7 @@ yydefault: } case 493: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6401 + //line php5/php5.y:6402 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -8977,13 +8979,13 @@ yydefault: } case 494: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6407 + //line php5/php5.y:6408 { encapsed := scalar.NewEncapsedStringPart(yyDollar[1].token.Value) yyVAL.list = []node.Node{encapsed, yyDollar[2].node} // save position - yylex.(*Parser).positions.AddPosition(encapsed, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + encapsed.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(encapsed, yyDollar[1].token, comment.EncapsedAndWhitespaceToken) @@ -8992,14 +8994,14 @@ yydefault: } case 495: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6423 + //line php5/php5.y:6424 { name := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(name) // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.VariableToken) @@ -9008,16 +9010,16 @@ yydefault: } case 496: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6437 + //line php5/php5.y:6438 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) yyVAL.node = expr.NewArrayDimFetch(variable, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments yylex.(*Parser).comments.AddFromToken(variable, yyDollar[1].token, comment.VariableToken) @@ -9028,7 +9030,7 @@ yydefault: } case 497: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6455 + //line php5/php5.y:6456 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -9036,10 +9038,10 @@ yydefault: yyVAL.node = expr.NewPropertyFetch(variable, fetch) // save position - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) + identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + fetch.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments yylex.(*Parser).comments.AddFromToken(variable, yyDollar[1].token, comment.VariableToken) @@ -9050,12 +9052,12 @@ yydefault: } case 498: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6475 + //line php5/php5.y:6476 { yyVAL.node = expr.NewVariable(yyDollar[2].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.DollarOpenCurlyBracesToken) @@ -9065,14 +9067,14 @@ yydefault: } case 499: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6488 + //line php5/php5.y:6489 { name := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = expr.NewVariable(name) // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.DollarOpenCurlyBracesToken) @@ -9083,16 +9085,16 @@ yydefault: } case 500: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:6504 + //line php5/php5.y:6505 { identifier := node.NewIdentifier(yyDollar[2].token.Value) variable := expr.NewVariable(identifier) yyVAL.node = expr.NewArrayDimFetch(variable, yyDollar[4].node) // save position - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[6].token)) + identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) + variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[6].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.DollarOpenCurlyBracesToken) @@ -9105,7 +9107,7 @@ yydefault: } case 501: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6524 + //line php5/php5.y:6525 { yyVAL.node = yyDollar[2].node @@ -9113,12 +9115,12 @@ yydefault: } case 502: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6533 + //line php5/php5.y:6534 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.StringToken) @@ -9127,7 +9129,7 @@ yydefault: } case 503: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6545 + //line php5/php5.y:6546 { // TODO: add option to handle 64 bit integer if _, err := strconv.Atoi(yyDollar[1].token.Value); err == nil { @@ -9137,7 +9139,7 @@ yydefault: } // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.NumStringToken) @@ -9146,14 +9148,14 @@ yydefault: } case 504: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6562 + //line php5/php5.y:6563 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(identifier) // save position - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.VariableToken) @@ -9162,12 +9164,12 @@ yydefault: } case 505: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6579 + //line php5/php5.y:6580 { yyVAL.node = expr.NewIsset(yyDollar[3].list) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.IssetToken) @@ -9178,12 +9180,12 @@ yydefault: } case 506: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6593 + //line php5/php5.y:6594 { yyVAL.node = expr.NewEmpty(yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.EmptyToken) @@ -9194,12 +9196,12 @@ yydefault: } case 507: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6607 + //line php5/php5.y:6608 { yyVAL.node = expr.NewEmpty(yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.EmptyToken) @@ -9210,12 +9212,12 @@ yydefault: } case 508: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6621 + //line php5/php5.y:6622 { yyVAL.node = expr.NewInclude(yyDollar[2].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.IncludeToken) @@ -9224,12 +9226,12 @@ yydefault: } case 509: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6633 + //line php5/php5.y:6634 { yyVAL.node = expr.NewIncludeOnce(yyDollar[2].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.IncludeOnceToken) @@ -9238,12 +9240,12 @@ yydefault: } case 510: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6645 + //line php5/php5.y:6646 { yyVAL.node = expr.NewEval(yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.EvalToken) @@ -9254,12 +9256,12 @@ yydefault: } case 511: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6659 + //line php5/php5.y:6660 { yyVAL.node = expr.NewRequire(yyDollar[2].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.RequireToken) @@ -9268,12 +9270,12 @@ yydefault: } case 512: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6671 + //line php5/php5.y:6672 { yyVAL.node = expr.NewRequireOnce(yyDollar[2].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.RequireOnceToken) @@ -9282,7 +9284,7 @@ yydefault: } case 513: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6686 + //line php5/php5.y:6687 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -9290,7 +9292,7 @@ yydefault: } case 514: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6692 + //line php5/php5.y:6693 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -9301,7 +9303,7 @@ yydefault: } case 515: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6704 + //line php5/php5.y:6705 { yyVAL.node = yyDollar[1].node @@ -9309,7 +9311,7 @@ yydefault: } case 516: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6710 + //line php5/php5.y:6711 { yyVAL.node = yyDollar[1].node @@ -9317,14 +9319,14 @@ yydefault: } case 517: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6719 + //line php5/php5.y:6720 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) // save position - yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) + target.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PaamayimNekudotayimToken) @@ -9333,14 +9335,14 @@ yydefault: } case 518: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6733 + //line php5/php5.y:6734 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) // save position - yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) + target.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PaamayimNekudotayimToken) @@ -9349,14 +9351,14 @@ yydefault: } case 519: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6750 + //line php5/php5.y:6751 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) // save position - yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) + target.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PaamayimNekudotayimToken) @@ -9365,14 +9367,14 @@ yydefault: } case 520: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6767 + //line php5/php5.y:6768 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) // save position - yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) + target.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PaamayimNekudotayimToken) diff --git a/php5/php5.y b/php5/php5.y index 0ab1482..c923ef8 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -280,7 +280,7 @@ start: top_statement_list { yylex.(*Parser).rootNode = node.NewRoot($1) - yylex.(*Parser).positions.AddPosition(yylex.(*Parser).rootNode, yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) + yylex.(*Parser).rootNode.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -310,7 +310,7 @@ namespace_name: $$ = []node.Node{namePart} // save position - yylex.(*Parser).positions.AddPosition(namePart, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + namePart.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken(namePart, $1, comment.StringToken) @@ -323,7 +323,7 @@ namespace_name: $$ = append($1, namePart) // save position - yylex.(*Parser).positions.AddPosition(namePart, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) + namePart.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) // save comments yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.NsSeparatorToken) @@ -364,7 +364,7 @@ top_statement: $$ = stmt.NewHaltCompiler() // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.HaltCompilerToken) @@ -380,8 +380,8 @@ top_statement: $$ = stmt.NewNamespace(name, nil) // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.NamespaceToken) @@ -395,8 +395,8 @@ top_statement: $$ = stmt.NewNamespace(name, $4) // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.NamespaceToken) @@ -410,7 +410,7 @@ top_statement: $$ = stmt.NewNamespace(nil, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.NamespaceToken) @@ -424,7 +424,7 @@ top_statement: $$ = stmt.NewUseList(nil, $2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.UseToken) @@ -438,8 +438,8 @@ top_statement: $$ = stmt.NewUseList(useType, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + useType.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.UseToken) @@ -454,8 +454,8 @@ top_statement: $$ = stmt.NewUseList(useType, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + useType.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.UseToken) @@ -469,7 +469,7 @@ top_statement: $$ = $1 // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.SemiColonToken) @@ -503,8 +503,8 @@ use_declaration: $$ = stmt.NewUse(nil, name, nil) // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -515,9 +515,9 @@ use_declaration: $$ = stmt.NewUse(nil, name, alias) // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) - yylex.(*Parser).positions.AddPosition(alias, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $3)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) + alias.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.AsToken) @@ -531,8 +531,8 @@ use_declaration: $$ = stmt.NewUse(nil, name, nil) // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.NsSeparatorToken) @@ -546,9 +546,9 @@ use_declaration: $$ = stmt.NewUse(nil, name, alias) // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) - yylex.(*Parser).positions.AddPosition(alias, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($2, $4)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) + alias.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($4)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($2, $4)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.NsSeparatorToken) @@ -584,8 +584,8 @@ use_function_declaration: $$ = stmt.NewUse(nil, name, nil) // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -596,9 +596,9 @@ use_function_declaration: $$ = stmt.NewUse(nil, name, alias) // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) - yylex.(*Parser).positions.AddPosition(alias, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $3)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) + alias.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.AsToken) @@ -612,8 +612,8 @@ use_function_declaration: $$ = stmt.NewUse(nil, name, nil) // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.NsSeparatorToken) @@ -627,9 +627,9 @@ use_function_declaration: $$ = stmt.NewUse(nil, name, alias) // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) - yylex.(*Parser).positions.AddPosition(alias, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($2, $4)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) + alias.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($4)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($2, $4)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.NsSeparatorToken) @@ -665,8 +665,8 @@ use_const_declaration: $$ = stmt.NewUse(nil, name, nil) // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -677,9 +677,9 @@ use_const_declaration: $$ = stmt.NewUse(nil, name, alias) // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) - yylex.(*Parser).positions.AddPosition(alias, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $3)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) + alias.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.AsToken) @@ -693,8 +693,8 @@ use_const_declaration: $$ = stmt.NewUse(nil, name, nil) // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.NsSeparatorToken) @@ -708,9 +708,9 @@ use_const_declaration: $$ = stmt.NewUse(nil, name, alias) // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) - yylex.(*Parser).positions.AddPosition(alias, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($2, $4)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) + alias.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($4)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($2, $4)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.NsSeparatorToken) @@ -731,9 +731,9 @@ constant_declaration: $$ = $1 // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - yylex.(*Parser).positions.AddPosition(constant, yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $5)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeNodeListPosition($1, constList.Consts)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) + constant.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $5)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeNodeListPosition($1, constList.Consts)) // save comments yylex.(*Parser).comments.AddFromToken(lastNode(constList.Consts), $2, comment.CommaToken) @@ -750,9 +750,9 @@ constant_declaration: $$ = stmt.NewConstList(constList) // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - yylex.(*Parser).positions.AddPosition(constant, yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $4)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, constList)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) + constant.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $4)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, constList)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.ConstToken) @@ -812,7 +812,7 @@ inner_statement: $$ = stmt.NewHaltCompiler() // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.HaltCompilerToken) @@ -838,8 +838,8 @@ statement: $$ = stmt.NewLabel(label) // save position - yylex.(*Parser).positions.AddPosition(label, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) + label.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken(label, $1, comment.StringToken) @@ -855,7 +855,7 @@ unticked_statement: $$ = stmt.NewStmtList($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.OpenCurlyBracesToken) @@ -869,11 +869,11 @@ unticked_statement: // save position if $5 != nil { - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5)) } else if len($4) > 0 { - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $4)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $4)) } else { - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) } // save comments @@ -887,8 +887,8 @@ unticked_statement: $$ = stmt.NewAltIf($2, stmts, $5, $6) // save position - yylex.(*Parser).positions.AddPosition(stmts, yylex.(*Parser).positionBuilder.NewNodeListPosition($4)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $8)) + stmts.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($4)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $8)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.IfToken) @@ -910,7 +910,7 @@ unticked_statement: $$ = $3 // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.WhileToken) @@ -922,7 +922,7 @@ unticked_statement: $$ = stmt.NewDo($2, $4) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.DoToken) @@ -947,7 +947,7 @@ unticked_statement: $$ = $9 // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $9)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $9)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.ForToken) @@ -972,7 +972,7 @@ unticked_statement: $$ = $3 // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.SwitchToken) @@ -984,7 +984,7 @@ unticked_statement: $$ = stmt.NewBreak(nil) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.BreakToken) @@ -997,7 +997,7 @@ unticked_statement: $$ = stmt.NewBreak($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.BreakToken) @@ -1010,7 +1010,7 @@ unticked_statement: $$ = stmt.NewContinue(nil) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.ContinueToken) @@ -1023,7 +1023,7 @@ unticked_statement: $$ = stmt.NewContinue($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.ContinueToken) @@ -1036,7 +1036,7 @@ unticked_statement: $$ = stmt.NewReturn(nil) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.ReturnToken) @@ -1049,7 +1049,7 @@ unticked_statement: $$ = stmt.NewReturn($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.ReturnToken) @@ -1062,7 +1062,7 @@ unticked_statement: $$ = stmt.NewReturn($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.ReturnToken) @@ -1075,7 +1075,7 @@ unticked_statement: $$ = stmt.NewExpression($1) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.SemiColonToken) @@ -1087,7 +1087,7 @@ unticked_statement: $$ = stmt.NewGlobal($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.GlobalToken) @@ -1100,7 +1100,7 @@ unticked_statement: $$ = stmt.NewStatic($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.StaticToken) @@ -1113,7 +1113,7 @@ unticked_statement: $$ = stmt.NewEcho($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.EchoToken) @@ -1126,7 +1126,7 @@ unticked_statement: $$ = stmt.NewInlineHtml($1.Value) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.InlineHTMLToken) @@ -1138,7 +1138,7 @@ unticked_statement: $$ = stmt.NewExpression($1) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.SemiColonToken) @@ -1150,7 +1150,7 @@ unticked_statement: $$ = stmt.NewUnset($3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.UnsetToken) @@ -1187,7 +1187,7 @@ unticked_statement: $$ = $8 // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $8)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $8)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.ForeachToken) @@ -1224,7 +1224,7 @@ unticked_statement: // save position $$ = $8 - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $8)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $8)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.ForeachToken) @@ -1239,7 +1239,7 @@ unticked_statement: $$ = stmt.NewDeclare($3, $5) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.DeclareToken) @@ -1253,7 +1253,7 @@ unticked_statement: $$ = stmt.NewNop() // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.SemiColonToken) @@ -1266,9 +1266,9 @@ unticked_statement: // save position if $6 == nil { - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $5)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $5)) } else { - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $6)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $6)) } // save comments @@ -1283,7 +1283,7 @@ unticked_statement: $$ = stmt.NewThrow($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.ThrowToken) @@ -1297,8 +1297,8 @@ unticked_statement: $$ = stmt.NewGoto(label) // save position - yylex.(*Parser).positions.AddPosition(label, yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + label.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.GotoToken) @@ -1324,9 +1324,9 @@ catch_statement: $$ = append([]node.Node{catch}, $9...) // save position - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) - yylex.(*Parser).positions.AddPosition(catch, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $8)) + identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($4)) + variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($4)) + catch.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $8)) // save comments yylex.(*Parser).comments.AddFromToken(catch, $1, comment.CatchToken) @@ -1352,7 +1352,7 @@ finally_statement: $$ = stmt.NewFinally($3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.FinallyToken) @@ -1401,9 +1401,9 @@ additional_catch: $$ = stmt.NewCatch([]node.Node{$3}, variable, $7) // save position - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $8)) + identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($4)) + variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($4)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $8)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.CatchToken) @@ -1491,8 +1491,8 @@ unticked_function_declaration_statement: $$ = stmt.NewFunction(name, $2 != nil, $5, nil, $8, "") // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $9)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $9)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.FunctionToken) @@ -1528,8 +1528,8 @@ unticked_class_declaration_statement: $$ = $1 // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $7)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $7)) // save comments yylex.(*Parser).comments.AddFromToken(name, $2, comment.StringToken) @@ -1544,8 +1544,8 @@ unticked_class_declaration_statement: $$ = stmt.NewInterface(name, $3, $5, "") // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $6)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $6)) // save comments yylex.(*Parser).comments.AddFromToken(name, $2, comment.StringToken) @@ -1563,7 +1563,7 @@ class_entry_type: $$ = stmt.NewClass(nil, nil, nil, nil, nil, nil, "") // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.ClassToken) @@ -1576,8 +1576,8 @@ class_entry_type: $$ = stmt.NewClass(nil, []node.Node{classModifier}, nil, nil, nil, nil, "") // save position - yylex.(*Parser).positions.AddPosition(classModifier, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) + classModifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken(classModifier, $1, comment.AbstractToken) @@ -1590,7 +1590,7 @@ class_entry_type: $$ = stmt.NewTrait(nil, nil, "") // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.TraitToken) @@ -1603,8 +1603,8 @@ class_entry_type: $$ = stmt.NewClass(nil, []node.Node{classModifier}, nil, nil, nil, nil, "") // save position - yylex.(*Parser).positions.AddPosition(classModifier, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) + classModifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken(classModifier, $1, comment.FinalToken) @@ -1626,7 +1626,7 @@ extends_from: $$ = stmt.NewClassExtends($2); // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.ExtendsToken) @@ -1654,7 +1654,7 @@ interface_extends_list: $$ = stmt.NewInterfaceExtends($2); // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.ExtendsToken) @@ -1675,7 +1675,7 @@ implements_list: $$ = stmt.NewClassImplements($2); // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.ImplementsToken) @@ -1732,7 +1732,7 @@ foreach_variable: $$ = expr.NewReference($2) // save position - yylex.(*Parser).positions.AddPosition($2, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.AmpersandToken) @@ -1744,7 +1744,7 @@ foreach_variable: $$ = expr.NewList($3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.ListToken) @@ -1761,7 +1761,7 @@ for_statement: $$ = stmt.NewFor(nil, nil, nil, $1) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodePosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1771,8 +1771,8 @@ for_statement: $$ = stmt.NewAltFor(nil, nil, nil, stmtList) // save position - yylex.(*Parser).positions.AddPosition(stmtList, yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + stmtList.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.ColonToken) @@ -1789,7 +1789,7 @@ foreach_statement: $$ = stmt.NewForeach(nil, nil, nil, $1) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodePosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1799,8 +1799,8 @@ foreach_statement: $$ = stmt.NewAltForeach(nil, nil, nil, stmtList) // save position - yylex.(*Parser).positions.AddPosition(stmtList, yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + stmtList.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.ColonToken) @@ -1824,7 +1824,7 @@ declare_statement: $$ = stmt.NewStmtList($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.ColonToken) @@ -1844,8 +1844,8 @@ declare_list: $$ = []node.Node{constant} // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).positions.AddPosition(constant, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + constant.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken(name, $1, comment.StringToken) @@ -1860,8 +1860,8 @@ declare_list: $$ = append($1, constant) // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - yylex.(*Parser).positions.AddPosition(constant, yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $5)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) + constant.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $5)) // save comments yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) @@ -1880,8 +1880,8 @@ switch_case_list: $$ = stmt.NewSwitch(nil, caseList) // save position - yylex.(*Parser).positions.AddPosition(caseList, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + caseList.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken(caseList, $1, comment.OpenCurlyBracesToken) @@ -1895,8 +1895,8 @@ switch_case_list: $$ = stmt.NewSwitch(nil, caseList) // save position - yylex.(*Parser).positions.AddPosition(caseList, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + caseList.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments yylex.(*Parser).comments.AddFromToken(caseList, $1, comment.OpenCurlyBracesToken) @@ -1911,8 +1911,8 @@ switch_case_list: $$ = stmt.NewAltSwitch(nil, caseList) // save position - yylex.(*Parser).positions.AddPosition(caseList, yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + caseList.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments yylex.(*Parser).comments.AddFromToken(caseList, $1, comment.ColonToken) @@ -1928,8 +1928,8 @@ switch_case_list: $$ = stmt.NewAltSwitch(nil, caseList) // save position - yylex.(*Parser).positions.AddPosition(caseList, yylex.(*Parser).positionBuilder.NewNodeListPosition($3)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5)) + caseList.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5)) // save comments yylex.(*Parser).comments.AddFromToken(caseList, $1, comment.ColonToken) @@ -1955,7 +1955,7 @@ case_list: $$ = append($1, _case) // save position - yylex.(*Parser).positions.AddPosition(_case, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $5)) + _case.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $5)) // save comments yylex.(*Parser).comments.AddFromToken(_case, $2, comment.CaseToken) @@ -1969,7 +1969,7 @@ case_list: $$ = append($1, _default) // save position - yylex.(*Parser).positions.AddPosition(_default, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $4)) + _default.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $4)) // save comments yylex.(*Parser).comments.AddFromToken(_default, $2, comment.DefaultToken) @@ -1998,7 +1998,7 @@ while_statement: $$ = stmt.NewWhile(nil, $1) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodePosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2008,8 +2008,8 @@ while_statement: $$ = stmt.NewAltWhile(nil, stmtList) // save position - yylex.(*Parser).positions.AddPosition(stmtList, yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + stmtList.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.ColonToken) @@ -2035,7 +2035,7 @@ elseif_list: $$ = append($1, _elseIf) // save position - yylex.(*Parser).positions.AddPosition(_elseIf, yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $4)) + _elseIf.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $4)) // save comments yylex.(*Parser).comments.AddFromToken(_elseIf, $2, comment.ElseifToken) @@ -2059,8 +2059,8 @@ new_elseif_list: $$ = append($1, _elseIf) // save position - yylex.(*Parser).positions.AddPosition(stmts, yylex.(*Parser).positionBuilder.NewNodeListPosition($5)) - yylex.(*Parser).positions.AddPosition(_elseIf, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $5)) + stmts.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($5)) + _elseIf.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $5)) // save comments yylex.(*Parser).comments.AddFromToken(_elseIf, $2, comment.ElseifToken) @@ -2083,7 +2083,7 @@ else_single: $$ = stmt.NewElse($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.ElseToken) @@ -2106,8 +2106,8 @@ new_else_single: $$ = stmt.NewAltElse(stmts) // save position - yylex.(*Parser).positions.AddPosition(stmts, yylex.(*Parser).positionBuilder.NewNodeListPosition($3)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3)) + stmts.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.ElseToken) @@ -2159,16 +2159,16 @@ parameter: $$ = node.NewParameter($1, variable, nil, $2 != nil, $3 != nil) // save position - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) + identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($4)) + variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($4)) if $1 != nil { - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) } else if $2 != nil { - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($2, $4)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($2, $4)) } else if $3 != nil { - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($3, $4)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($3, $4)) } else { - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($4)) } // save comments @@ -2189,16 +2189,16 @@ parameter: $$ = node.NewParameter($1, variable, $6, $2 != nil, $3 != nil) // save position - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) + identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($4)) + variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($4)) if $1 != nil { - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $6)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $6)) } else if $2 != nil { - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $6)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $6)) } else if $3 != nil { - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $6)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $6)) } else { - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($4, $6)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($4, $6)) } // save comments @@ -2228,7 +2228,7 @@ optional_class_type: $$ = node.NewIdentifier($1.Value) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.ArrayToken) @@ -2240,7 +2240,7 @@ optional_class_type: $$ = node.NewIdentifier($1.Value) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.CallableToken) @@ -2262,7 +2262,7 @@ function_call_parameter_list: $$ = node.NewArgumentList(nil) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.OpenParenthesisToken) @@ -2275,7 +2275,7 @@ function_call_parameter_list: $$ = node.NewArgumentList($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.OpenParenthesisToken) @@ -2289,8 +2289,8 @@ function_call_parameter_list: $$ = node.NewArgumentList([]node.Node{arg}) // save position - yylex.(*Parser).positions.AddPosition(arg, yylex.(*Parser).positionBuilder.NewNodePosition($2)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + arg.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.OpenParenthesisToken) @@ -2325,7 +2325,7 @@ function_call_parameter: $$ = node.NewArgument($1, false, false) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodePosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2334,7 +2334,7 @@ function_call_parameter: $$ = node.NewArgument($1, false, false) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodePosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2343,7 +2343,7 @@ function_call_parameter: $$ = node.NewArgument($2, false, true) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodePosition($2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.AmpersandToken) @@ -2355,7 +2355,7 @@ function_call_parameter: $$ = node.NewArgument($2, true, false) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.EllipsisToken) @@ -2390,8 +2390,8 @@ global_var: $$ = expr.NewVariable(name) // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.VariableToken) @@ -2403,7 +2403,7 @@ global_var: $$ = expr.NewVariable($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.DollarToken) @@ -2415,7 +2415,7 @@ global_var: $$ = expr.NewVariable($3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.DollarToken) @@ -2436,9 +2436,9 @@ static_var_list: $$ = append($1, staticVar) // save position - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - yylex.(*Parser).positions.AddPosition(staticVar, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) + identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) + variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) + staticVar.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) // save comments yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) @@ -2454,9 +2454,9 @@ static_var_list: $$ = append($1, staticVar) // save position - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - yylex.(*Parser).positions.AddPosition(staticVar, yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $5)) + identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) + variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) + staticVar.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $5)) // save comments yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) @@ -2473,9 +2473,9 @@ static_var_list: $$ = []node.Node{staticVar} // save position - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).positions.AddPosition(staticVar, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + staticVar.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken(variable, $1, comment.VariableToken) @@ -2490,9 +2490,9 @@ static_var_list: $$ = []node.Node{staticVar} // save position - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).positions.AddPosition(staticVar, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) + identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + staticVar.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken(variable, $1, comment.VariableToken) @@ -2525,7 +2525,7 @@ class_statement: $$ = stmt.NewPropertyList($1, $2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $3, comment.SemiColonToken) @@ -2537,7 +2537,7 @@ class_statement: $$ = $1 // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.SemiColonToken) @@ -2556,11 +2556,11 @@ class_statement: $$ = stmt.NewClassMethod(name, $1, $3 != nil, $6, nil, $8, "") // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($4)) if $1 == nil { - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $8)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $8)) } else { - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeListNodePosition($1, $8)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListNodePosition($1, $8)) } // save comments @@ -2589,7 +2589,7 @@ trait_use_statement: $$ = stmt.NewTraitUse($2, adaptationList) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.UseToken) @@ -2621,7 +2621,7 @@ trait_adaptations: { $$ = stmt.NewNop() - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.SemiColonToken) @@ -2633,7 +2633,7 @@ trait_adaptations: { $$ = stmt.NewTraitAdaptationList($2) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.OpenCurlyBracesToken) @@ -2700,7 +2700,7 @@ trait_precedence: $$ = stmt.NewTraitUsePrecedence($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeNodeListPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeNodeListPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.InsteadofToken) @@ -2734,8 +2734,8 @@ trait_method_reference: $$ = stmt.NewTraitMethodRef(nil, name) // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken(name, $1, comment.IdentifierToken) @@ -2757,8 +2757,8 @@ trait_method_reference_fully_qualified: $$ = stmt.NewTraitMethodRef($1, target) // save position - yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) + target.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.PaamayimNekudotayimToken) @@ -2775,8 +2775,8 @@ trait_alias: $$ = stmt.NewTraitUseAlias($1, $3, alias) // save position - yylex.(*Parser).positions.AddPosition(alias, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) + alias.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($4)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.AsToken) @@ -2789,7 +2789,7 @@ trait_alias: $$ = stmt.NewTraitUseAlias($1, $3, nil) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.AsToken) @@ -2819,7 +2819,7 @@ method_body: $$ = stmt.NewNop() // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.SemiColonToken) @@ -2831,7 +2831,7 @@ method_body: $$ = stmt.NewStmtList($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.OpenCurlyBracesToken) @@ -2854,7 +2854,7 @@ variable_modifiers: $$ = []node.Node{modifier} // save position - yylex.(*Parser).positions.AddPosition(modifier, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + modifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken(modifier, $1, comment.VarToken) @@ -2899,7 +2899,7 @@ member_modifier: $$ = node.NewIdentifier($1.Value) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.PublicToken) @@ -2911,7 +2911,7 @@ member_modifier: $$ = node.NewIdentifier($1.Value) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.ProtectedToken) @@ -2923,7 +2923,7 @@ member_modifier: $$ = node.NewIdentifier($1.Value) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.PrivateToken) @@ -2935,7 +2935,7 @@ member_modifier: $$ = node.NewIdentifier($1.Value) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.StaticToken) @@ -2947,7 +2947,7 @@ member_modifier: $$ = node.NewIdentifier($1.Value) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.AbstractToken) @@ -2959,7 +2959,7 @@ member_modifier: $$ = node.NewIdentifier($1.Value) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.FinalToken) @@ -2977,9 +2977,9 @@ class_variable_declaration: $$ = append($1, property) // save position - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - yylex.(*Parser).positions.AddPosition(property, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) + identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) + variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) + property.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) // save comments yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) @@ -2995,9 +2995,9 @@ class_variable_declaration: $$ = append($1, property) // save position - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - yylex.(*Parser).positions.AddPosition(property, yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $5)) + identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) + variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) + property.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $5)) // save comments yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) @@ -3014,9 +3014,9 @@ class_variable_declaration: $$ = []node.Node{property} // save position - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).positions.AddPosition(property, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + property.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken(variable, $1, comment.VariableToken) @@ -3031,9 +3031,9 @@ class_variable_declaration: $$ = []node.Node{property} // save position - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).positions.AddPosition(property, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) + identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + property.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken(variable, $1, comment.VariableToken) @@ -3053,9 +3053,9 @@ class_constant_declaration: $$ = $1 // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - yylex.(*Parser).positions.AddPosition(constant, yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $5)) - yylex.(*Parser).positions.AddPosition($1, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $5)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) + constant.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $5)) + $1.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $5)) // save comments yylex.(*Parser).comments.AddFromToken(lastNode(constList.Consts), $2, comment.CommaToken) @@ -3071,9 +3071,9 @@ class_constant_declaration: $$ = stmt.NewClassConstList(nil, []node.Node{constant}) // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - yylex.(*Parser).positions.AddPosition(constant, yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $4)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $4)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) + constant.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $4)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $4)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.ConstToken) @@ -3158,7 +3158,7 @@ chaining_dereference: $$ = append($1, fetch) // save position - yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition($3)) + fetch.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($3)) // save comments yylex.(*Parser).comments.AddFromToken(fetch, $2, comment.OpenSquareBracket) @@ -3172,7 +3172,7 @@ chaining_dereference: $$ = []node.Node{fetch} // save position - yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition($2)) + fetch.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($2)) // save comments yylex.(*Parser).comments.AddFromToken(fetch, $1, comment.OpenSquareBracket) @@ -3224,10 +3224,10 @@ new_expr: if $3 != nil { $$ = expr.NewNew($2, $3.(*node.ArgumentList)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) } else { $$ = expr.NewNew($2, nil) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) } // save comments @@ -3244,8 +3244,8 @@ expr_without_variable: $$ = assign.NewAssign(list, $6) // save position - yylex.(*Parser).positions.AddPosition(list, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $6)) + list.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $6)) // save comments yylex.(*Parser).comments.AddFromToken(list, $1, comment.ListToken) @@ -3260,7 +3260,7 @@ expr_without_variable: $$ = assign.NewAssign($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.EqualToken) @@ -3272,7 +3272,7 @@ expr_without_variable: $$ = assign.NewReference($1, $4) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.EqualToken) @@ -3293,11 +3293,11 @@ expr_without_variable: // save position if $6 != nil { - yylex.(*Parser).positions.AddPosition(_new, yylex.(*Parser).positionBuilder.NewTokenNodePosition($4, $6)) + _new.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($4, $6)) } else { - yylex.(*Parser).positions.AddPosition(_new, yylex.(*Parser).positionBuilder.NewTokenNodePosition($4, $5)) + _new.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($4, $5)) } - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, _new)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, _new)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.EqualToken) @@ -3311,7 +3311,7 @@ expr_without_variable: $$ = expr.NewClone($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.CloneToken) @@ -3323,7 +3323,7 @@ expr_without_variable: $$ = assign.NewPlus($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.PlusEqualToken) @@ -3335,7 +3335,7 @@ expr_without_variable: $$ = assign.NewMinus($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.MinusEqualToken) @@ -3347,7 +3347,7 @@ expr_without_variable: $$ = assign.NewMul($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.MulEqualToken) @@ -3359,7 +3359,7 @@ expr_without_variable: $$ = assign.NewPow($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.PowEqualToken) @@ -3371,7 +3371,7 @@ expr_without_variable: $$ = assign.NewDiv($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.DivEqualToken) @@ -3383,7 +3383,7 @@ expr_without_variable: $$ = assign.NewConcat($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.ConcatEqualToken) @@ -3395,7 +3395,7 @@ expr_without_variable: $$ = assign.NewMod($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.ModEqualToken) @@ -3407,7 +3407,7 @@ expr_without_variable: $$ = assign.NewBitwiseAnd($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.AndEqualToken) @@ -3419,7 +3419,7 @@ expr_without_variable: $$ = assign.NewBitwiseOr($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.OrEqualToken) @@ -3431,7 +3431,7 @@ expr_without_variable: $$ = assign.NewBitwiseXor($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.XorEqualToken) @@ -3443,7 +3443,7 @@ expr_without_variable: $$ = assign.NewShiftLeft($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.SlEqualToken) @@ -3455,7 +3455,7 @@ expr_without_variable: $$ = assign.NewShiftRight($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.SrEqualToken) @@ -3467,7 +3467,7 @@ expr_without_variable: $$ = expr.NewPostInc($1) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.IncToken) @@ -3479,7 +3479,7 @@ expr_without_variable: $$ = expr.NewPreInc($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.IncToken) @@ -3491,7 +3491,7 @@ expr_without_variable: $$ = expr.NewPostDec($1) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.DecToken) @@ -3503,7 +3503,7 @@ expr_without_variable: $$ = expr.NewPreDec($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.DecToken) @@ -3515,7 +3515,7 @@ expr_without_variable: $$ = binary.NewBooleanOr($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.BooleanOrToken) @@ -3527,7 +3527,7 @@ expr_without_variable: $$ = binary.NewBooleanAnd($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.BooleanAndToken) @@ -3539,7 +3539,7 @@ expr_without_variable: $$ = binary.NewLogicalOr($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.LogicalOrToken) @@ -3551,7 +3551,7 @@ expr_without_variable: $$ = binary.NewLogicalAnd($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.LogicalAndToken) @@ -3563,7 +3563,7 @@ expr_without_variable: $$ = binary.NewLogicalXor($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.LogicalXorToken) @@ -3575,7 +3575,7 @@ expr_without_variable: $$ = binary.NewBitwiseOr($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.VerticalBarToken) @@ -3587,7 +3587,7 @@ expr_without_variable: $$ = binary.NewBitwiseAnd($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.AmpersandToken) @@ -3599,7 +3599,7 @@ expr_without_variable: $$ = binary.NewBitwiseXor($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.CaretToken) @@ -3611,7 +3611,7 @@ expr_without_variable: $$ = binary.NewConcat($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.DotToken) @@ -3623,7 +3623,7 @@ expr_without_variable: $$ = binary.NewPlus($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.PlusToken) @@ -3635,7 +3635,7 @@ expr_without_variable: $$ = binary.NewMinus($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.MinusToken) @@ -3647,7 +3647,7 @@ expr_without_variable: $$ = binary.NewMul($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.AsteriskToken) @@ -3659,7 +3659,7 @@ expr_without_variable: $$ = binary.NewPow($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.PowToken) @@ -3671,7 +3671,7 @@ expr_without_variable: $$ = binary.NewDiv($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.SlashToken) @@ -3683,7 +3683,7 @@ expr_without_variable: $$ = binary.NewMod($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.PercentToken) @@ -3695,7 +3695,7 @@ expr_without_variable: $$ = binary.NewShiftLeft($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.SlToken) @@ -3707,7 +3707,7 @@ expr_without_variable: $$ = binary.NewShiftRight($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.SrToken) @@ -3719,7 +3719,7 @@ expr_without_variable: $$ = expr.NewUnaryPlus($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.PlusToken) @@ -3731,7 +3731,7 @@ expr_without_variable: $$ = expr.NewUnaryMinus($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.MinusToken) @@ -3743,7 +3743,7 @@ expr_without_variable: $$ = expr.NewBooleanNot($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.ExclamationMarkToken) @@ -3755,7 +3755,7 @@ expr_without_variable: $$ = expr.NewBitwiseNot($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.TildeToken) @@ -3767,7 +3767,7 @@ expr_without_variable: $$ = binary.NewIdentical($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.IsIdenticalToken) @@ -3779,7 +3779,7 @@ expr_without_variable: $$ = binary.NewNotIdentical($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.IsNotIdenticalToken) @@ -3791,7 +3791,7 @@ expr_without_variable: $$ = binary.NewEqual($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.IsEqualToken) @@ -3803,7 +3803,7 @@ expr_without_variable: $$ = binary.NewNotEqual($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.IsNotEqualToken) @@ -3815,7 +3815,7 @@ expr_without_variable: $$ = binary.NewSmaller($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.LessToken) @@ -3827,7 +3827,7 @@ expr_without_variable: $$ = binary.NewSmallerOrEqual($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.IsSmallerOrEqualToken) @@ -3839,7 +3839,7 @@ expr_without_variable: $$ = binary.NewGreater($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.GreaterToken) @@ -3851,7 +3851,7 @@ expr_without_variable: $$ = binary.NewGreaterOrEqual($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.IsGreaterOrEqualToken) @@ -3863,7 +3863,7 @@ expr_without_variable: $$ = expr.NewInstanceOf($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.InstanceofToken) @@ -3902,7 +3902,7 @@ expr_without_variable: } // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($$, n)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($$, n)) } // save comments @@ -3916,7 +3916,7 @@ expr_without_variable: $$ = expr.NewTernary($1, $3, $5) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $5)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $5)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.QuestionMarkToken) @@ -3929,7 +3929,7 @@ expr_without_variable: $$ = expr.NewTernary($1, nil, $4) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.QuestionMarkToken) @@ -3948,7 +3948,7 @@ expr_without_variable: $$ = cast.NewInt($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.IntCastToken) @@ -3960,7 +3960,7 @@ expr_without_variable: $$ = cast.NewDouble($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.DoubleCastToken) @@ -3972,7 +3972,7 @@ expr_without_variable: $$ = cast.NewString($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.StringCastToken) @@ -3984,7 +3984,7 @@ expr_without_variable: $$ = cast.NewArray($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.ArrayCastToken) @@ -3996,7 +3996,7 @@ expr_without_variable: $$ = cast.NewObject($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.ObjectCastToken) @@ -4008,7 +4008,7 @@ expr_without_variable: $$ = cast.NewBool($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.BoolCastToken) @@ -4020,7 +4020,7 @@ expr_without_variable: $$ = cast.NewUnset($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.UnsetCastToken) @@ -4043,9 +4043,9 @@ expr_without_variable: // save position if $2 == nil { - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) } else { - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) } // save comments @@ -4062,7 +4062,7 @@ expr_without_variable: $$ = expr.NewErrorSuppress($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.AtToken) @@ -4092,7 +4092,7 @@ expr_without_variable: $$ = expr.NewShellExec($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.BackquoteToken) @@ -4105,7 +4105,7 @@ expr_without_variable: $$ = expr.NewPrint($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.PrintToken) @@ -4117,7 +4117,7 @@ expr_without_variable: $$ = expr.NewYield(nil, nil) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.YieldToken) @@ -4129,7 +4129,7 @@ expr_without_variable: $$ = expr.NewClosure($4, $6, nil, $8, false, $2 != nil, "") // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $9)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $9)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.FunctionToken) @@ -4148,7 +4148,7 @@ expr_without_variable: $$ = expr.NewClosure($5, $7, nil, $9, true, $3 != nil, "") // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $10)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $10)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.StaticToken) @@ -4171,7 +4171,7 @@ yield_expr: $$ = expr.NewYield(nil, $2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.YieldToken) @@ -4183,7 +4183,7 @@ yield_expr: $$ = expr.NewYield(nil, $2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.YieldToken) @@ -4195,7 +4195,7 @@ yield_expr: $$ = expr.NewYield($2, $4) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $4)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $4)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.YieldToken) @@ -4208,7 +4208,7 @@ yield_expr: $$ = expr.NewYield($2, $4) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $4)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $4)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.YieldToken) @@ -4224,7 +4224,7 @@ combined_scalar_offset: $$ = expr.NewArrayDimFetch($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenSquareBracket) @@ -4237,7 +4237,7 @@ combined_scalar_offset: $$ = expr.NewArrayDimFetch($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenSquareBracket) @@ -4251,8 +4251,8 @@ combined_scalar_offset: $$ = expr.NewArrayDimFetch(str, $3) // save position - yylex.(*Parser).positions.AddPosition(str, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(str, $4)) + str.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(str, $4)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenSquareBracket) @@ -4265,7 +4265,7 @@ combined_scalar_offset: $$ = expr.NewArrayDimFetch($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenSquareBracket) @@ -4281,7 +4281,7 @@ combined_scalar: $$ = expr.NewArray($3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.ArrayToken) @@ -4295,7 +4295,7 @@ combined_scalar: $$ = expr.NewShortArray($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.OpenSquareBracket) @@ -4323,7 +4323,7 @@ lexical_vars: { $$ = expr.NewClosureUse($3) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4337,8 +4337,8 @@ lexical_var_list: $$ = append($1, variable) // save position - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) + identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) + variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) // save comments yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) @@ -4354,8 +4354,9 @@ lexical_var_list: $$ = append($1, reference) // save position - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) + identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($4)) + variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($4)) + reference.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($3, $4)) // save comments yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) @@ -4371,8 +4372,8 @@ lexical_var_list: $$ = []node.Node{variable} // save position - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken(variable, $1, comment.VariableToken) @@ -4387,9 +4388,9 @@ lexical_var_list: $$ = []node.Node{reference} // save position - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - yylex.(*Parser).positions.AddPosition(reference, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) + identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) + variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) + reference.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken(reference, $1, comment.VariableToken) @@ -4406,8 +4407,8 @@ function_call: $$ = expr.NewFunctionCall(name, $2.(*node.ArgumentList)) // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition(name, $2)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(name, $2)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4417,8 +4418,8 @@ function_call: $$ = expr.NewFunctionCall(funcName, $4.(*node.ArgumentList)) // save position - yylex.(*Parser).positions.AddPosition(funcName, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition(funcName, $4)) + funcName.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(funcName, $4)) // save comments yylex.(*Parser).comments.AddFromToken(funcName, $1, comment.NamespaceToken) @@ -4432,8 +4433,8 @@ function_call: $$ = expr.NewFunctionCall(funcName, $3.(*node.ArgumentList)) // save position - yylex.(*Parser).positions.AddPosition(funcName, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition(funcName, $3)) + funcName.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(funcName, $3)) // save comments yylex.(*Parser).comments.AddFromToken(funcName, $1, comment.NsSeparatorToken) @@ -4445,7 +4446,7 @@ function_call: $$ = expr.NewStaticCall($1, $3, $4.(*node.ArgumentList)) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.PaamayimNekudotayimToken) @@ -4457,7 +4458,7 @@ function_call: $$ = expr.NewStaticCall($1, $3, $4.(*node.ArgumentList)) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.PaamayimNekudotayimToken) @@ -4469,7 +4470,7 @@ function_call: $$ = expr.NewStaticCall($1, $3, $4.(*node.ArgumentList)) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.PaamayimNekudotayimToken) @@ -4481,7 +4482,7 @@ function_call: $$ = expr.NewStaticCall($1, $3, $4.(*node.ArgumentList)) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.PaamayimNekudotayimToken) @@ -4493,7 +4494,7 @@ function_call: $$ = expr.NewFunctionCall($1, $2.(*node.ArgumentList)) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $2)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4505,7 +4506,7 @@ class_name: $$ = node.NewIdentifier($1.Value) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.StaticToken) @@ -4517,7 +4518,7 @@ class_name: $$ = name.NewName($1) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4526,7 +4527,7 @@ class_name: $$ = name.NewRelative($3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.NamespaceToken) @@ -4539,7 +4540,7 @@ class_name: $$ = name.NewFullyQualified($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.NsSeparatorToken) @@ -4554,7 +4555,7 @@ fully_qualified_class_name: $$ = name.NewName($1) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4563,7 +4564,7 @@ fully_qualified_class_name: $$ = name.NewRelative($3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.NamespaceToken) @@ -4576,7 +4577,7 @@ fully_qualified_class_name: $$ = name.NewFullyQualified($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.NsSeparatorToken) @@ -4612,12 +4613,12 @@ dynamic_class_name_reference: switch nn := n.(type) { case *expr.ArrayDimFetch: nn.Variable = $$ - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn)) $$ = nn case *expr.PropertyFetch: nn.Variable = $$ - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn)) $$ = nn } } @@ -4626,12 +4627,12 @@ dynamic_class_name_reference: switch nn := n.(type) { case *expr.ArrayDimFetch: nn.Variable = $$ - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn)) $$ = nn case *expr.PropertyFetch: nn.Variable = $$ - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn)) $$ = nn } } @@ -4687,7 +4688,7 @@ exit_expr: $$ = expr.NewExit(nil); // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.OpenParenthesisToken) @@ -4700,7 +4701,7 @@ exit_expr: $$ = expr.NewExit($1); // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodePosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4748,7 +4749,7 @@ common_scalar: $$ = scalar.NewLnumber($1.Value) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.LnumberToken) @@ -4760,7 +4761,7 @@ common_scalar: $$ = scalar.NewDnumber($1.Value) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.DnumberToken) @@ -4772,7 +4773,7 @@ common_scalar: $$ = scalar.NewString($1.Value) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.ConstantEncapsedStringToken) @@ -4784,7 +4785,7 @@ common_scalar: $$ = scalar.NewMagicConstant($1.Value) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.LineToken) @@ -4796,7 +4797,7 @@ common_scalar: $$ = scalar.NewMagicConstant($1.Value) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.FileToken) @@ -4808,7 +4809,7 @@ common_scalar: $$ = scalar.NewMagicConstant($1.Value) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.DirToken) @@ -4820,7 +4821,7 @@ common_scalar: $$ = scalar.NewMagicConstant($1.Value) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.TraitCToken) @@ -4832,7 +4833,7 @@ common_scalar: $$ = scalar.NewMagicConstant($1.Value) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.MethodCToken) @@ -4844,7 +4845,7 @@ common_scalar: $$ = scalar.NewMagicConstant($1.Value) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.FuncCToken) @@ -4856,7 +4857,7 @@ common_scalar: $$ = scalar.NewMagicConstant($1.Value) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.NsCToken) @@ -4869,8 +4870,8 @@ common_scalar: $$ = scalar.NewHeredoc($1.Value, []node.Node{encapsed}) // save position - yylex.(*Parser).positions.AddPosition(encapsed, yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + encapsed.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.StartHeredocToken) @@ -4882,7 +4883,7 @@ common_scalar: $$ = scalar.NewHeredoc($1.Value, nil) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.StartHeredocToken) @@ -4898,8 +4899,8 @@ static_class_constant: $$ = expr.NewClassConstFetch($1, target) // save position - yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) + target.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.PaamayimNekudotayimToken) @@ -4937,8 +4938,8 @@ static_scalar_value: $$ = expr.NewConstFetch(name) // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodePosition(name)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(name)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4948,8 +4949,8 @@ static_scalar_value: $$ = expr.NewConstFetch(name) // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.NamespaceToken) @@ -4963,8 +4964,8 @@ static_scalar_value: $$ = expr.NewConstFetch(name) // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.NsSeparatorToken) @@ -4976,7 +4977,7 @@ static_scalar_value: $$ = expr.NewArray($3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.ArrayToken) @@ -4990,7 +4991,7 @@ static_scalar_value: $$ = expr.NewShortArray($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.OpenSquareBracket) @@ -5009,7 +5010,7 @@ static_scalar_value: $$ = scalar.NewMagicConstant($1.Value) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.ClassCToken) @@ -5030,7 +5031,7 @@ static_operation: $$ = expr.NewArrayDimFetch($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenSquareBracket) @@ -5043,7 +5044,7 @@ static_operation: $$ = binary.NewPlus($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.PlusToken) @@ -5055,7 +5056,7 @@ static_operation: $$ = binary.NewMinus($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.MinusToken) @@ -5067,7 +5068,7 @@ static_operation: $$ = binary.NewMul($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.AsteriskToken) @@ -5079,7 +5080,7 @@ static_operation: $$ = binary.NewPow($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.PowToken) @@ -5091,7 +5092,7 @@ static_operation: $$ = binary.NewDiv($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.SlashToken) @@ -5103,7 +5104,7 @@ static_operation: $$ = binary.NewMod($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.PercentToken) @@ -5115,7 +5116,7 @@ static_operation: $$ = expr.NewBooleanNot($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.ExclamationMarkToken) @@ -5127,7 +5128,7 @@ static_operation: $$ = expr.NewBitwiseNot($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.TildeToken) @@ -5139,7 +5140,7 @@ static_operation: $$ = binary.NewBitwiseOr($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.VerticalBarToken) @@ -5151,7 +5152,7 @@ static_operation: $$ = binary.NewBitwiseAnd($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.AmpersandToken) @@ -5163,7 +5164,7 @@ static_operation: $$ = binary.NewBitwiseXor($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.CaretToken) @@ -5175,7 +5176,7 @@ static_operation: $$ = binary.NewShiftLeft($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.SlToken) @@ -5187,7 +5188,7 @@ static_operation: $$ = binary.NewShiftRight($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.SrToken) @@ -5199,7 +5200,7 @@ static_operation: $$ = binary.NewConcat($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.DotToken) @@ -5211,7 +5212,7 @@ static_operation: $$ = binary.NewLogicalXor($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.LogicalXorToken) @@ -5223,7 +5224,7 @@ static_operation: $$ = binary.NewLogicalAnd($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.LogicalAndToken) @@ -5235,7 +5236,7 @@ static_operation: $$ = binary.NewLogicalOr($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.LogicalOrToken) @@ -5247,7 +5248,7 @@ static_operation: $$ = binary.NewBooleanAnd($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.BooleanAndToken) @@ -5259,7 +5260,7 @@ static_operation: $$ = binary.NewBooleanOr($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.BooleanOrToken) @@ -5271,7 +5272,7 @@ static_operation: $$ = binary.NewIdentical($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.IsIdenticalToken) @@ -5283,7 +5284,7 @@ static_operation: $$ = binary.NewNotIdentical($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.IsNotIdenticalToken) @@ -5295,7 +5296,7 @@ static_operation: $$ = binary.NewEqual($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.IsEqualToken) @@ -5307,7 +5308,7 @@ static_operation: $$ = binary.NewNotEqual($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.IsNotEqualToken) @@ -5319,7 +5320,7 @@ static_operation: $$ = binary.NewSmaller($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.LessToken) @@ -5331,7 +5332,7 @@ static_operation: $$ = binary.NewGreater($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.GreaterToken) @@ -5343,7 +5344,7 @@ static_operation: $$ = binary.NewSmallerOrEqual($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.IsSmallerOrEqualToken) @@ -5355,7 +5356,7 @@ static_operation: $$ = binary.NewGreaterOrEqual($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.IsGreaterOrEqualToken) @@ -5367,7 +5368,7 @@ static_operation: $$ = expr.NewTernary($1, nil, $4) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.QuestionMarkToken) @@ -5380,7 +5381,7 @@ static_operation: $$ = expr.NewTernary($1, $3, $5) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $5)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $5)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.QuestionMarkToken) @@ -5393,7 +5394,7 @@ static_operation: $$ = expr.NewUnaryPlus($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.PlusToken) @@ -5405,7 +5406,7 @@ static_operation: $$ = expr.NewUnaryMinus($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.MinusToken) @@ -5437,8 +5438,8 @@ general_constant: $$ = expr.NewConstFetch(name) // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodePosition(name)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(name)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5446,8 +5447,8 @@ general_constant: { name := name.NewRelative($3) $$ = expr.NewConstFetch(name) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodePosition(name)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(name)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.NamespaceToken) @@ -5461,8 +5462,8 @@ general_constant: $$ = expr.NewConstFetch(name) // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodePosition(name)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(name)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.NsSeparatorToken) @@ -5478,8 +5479,8 @@ scalar: $$ = expr.NewVariable(name) // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken(name, $1, comment.StringVarnameToken) @@ -5509,7 +5510,7 @@ scalar: $$ = scalar.NewEncapsed($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.DoubleQuoteToken) @@ -5521,7 +5522,7 @@ scalar: $$ = scalar.NewHeredoc($1.Value, $2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.StartHeredocToken) @@ -5533,7 +5534,7 @@ scalar: $$ = scalar.NewMagicConstant($1.Value) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.ClassCToken) @@ -5580,7 +5581,7 @@ non_empty_static_array_pair_list: $$ = append($1, arrayItem) // save position - yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition($3, $5)) + arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($3, $5)) // save comments yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) @@ -5594,7 +5595,7 @@ non_empty_static_array_pair_list: $$ = append($1, arrayItem) // save position - yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodePosition($3)) + arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($3)) // save comments yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) @@ -5607,7 +5608,7 @@ non_empty_static_array_pair_list: $$ = []node.Node{arrayItem} // save position - yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken(arrayItem, $2, comment.DoubleArrowToken) @@ -5620,7 +5621,7 @@ non_empty_static_array_pair_list: $$ = []node.Node{arrayItem} // save position - yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodePosition($1)) + arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5702,17 +5703,17 @@ variable: switch nn := n.(type) { case *expr.ArrayDimFetch: nn.Variable = $$ - yylex.(*Parser).positions.AddPosition(nn, yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn)) + nn.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn)) $$ = nn case *expr.PropertyFetch: nn.Variable = $$ - yylex.(*Parser).positions.AddPosition(nn, yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn)) + nn.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn)) $$ = nn case *expr.MethodCall: nn.Variable = $$ - yylex.(*Parser).positions.AddPosition(nn, yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn)) + nn.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn)) $$ = nn } } @@ -5721,17 +5722,17 @@ variable: switch nn := n.(type) { case *expr.ArrayDimFetch: nn.Variable = $$ - yylex.(*Parser).positions.AddPosition(nn, yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn)) + nn.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn)) $$ = nn case *expr.PropertyFetch: nn.Variable = $$ - yylex.(*Parser).positions.AddPosition(nn, yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn)) + nn.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn)) $$ = nn case *expr.MethodCall: nn.Variable = $$ - yylex.(*Parser).positions.AddPosition(nn, yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn)) + nn.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn)) $$ = nn } } @@ -5786,7 +5787,7 @@ array_method_dereference: $$ = append($1, fetch) // save position - yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition($3)) + fetch.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($3)) // save comments yylex.(*Parser).comments.AddFromToken(fetch, $2, comment.OpenSquareBracket) @@ -5800,7 +5801,7 @@ array_method_dereference: $$ = []node.Node{$1, fetch} // save position - yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition($3)) + fetch.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($3)) // save comments yylex.(*Parser).comments.AddFromToken(fetch, $2, comment.OpenSquareBracket) @@ -5816,7 +5817,7 @@ method: $$ = expr.NewMethodCall(nil, nil, $1.(*node.ArgumentList)) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodePosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5855,7 +5856,7 @@ variable_without_objects: $1.last.SetVarName($2) for _, n := range($1.all) { - yylex.(*Parser).positions[n] = yylex.(*Parser).positionBuilder.NewNodesPosition(n, $2) + n.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(n, $2)) } $$ = $1.all[0] @@ -5870,7 +5871,7 @@ static_member: $$ = expr.NewStaticPropertyFetch($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.PaamayimNekudotayimToken) @@ -5882,7 +5883,7 @@ static_member: $$ = expr.NewStaticPropertyFetch($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.PaamayimNekudotayimToken) @@ -5906,7 +5907,7 @@ array_function_dereference: $$ = expr.NewArrayDimFetch($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenSquareBracket) @@ -5919,7 +5920,7 @@ array_function_dereference: $$ = expr.NewArrayDimFetch($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenSquareBracket) @@ -5963,7 +5964,7 @@ base_variable: $1.last.SetVarName($2) for _, n := range($1.all) { - yylex.(*Parser).positions[n] = yylex.(*Parser).positionBuilder.NewNodesPosition(n, $2) + n.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(n, $2)) } $$ = $1.all[0] @@ -5984,7 +5985,7 @@ reference_variable: $$ = expr.NewArrayDimFetch($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenSquareBracket) @@ -5997,7 +5998,7 @@ reference_variable: $$ = expr.NewArrayDimFetch($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenCurlyBracesToken) @@ -6021,8 +6022,8 @@ compound_variable: $$ = expr.NewVariable(name) // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.VariableToken) @@ -6034,7 +6035,7 @@ compound_variable: $$ = expr.NewVariable($3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.DollarToken) @@ -6074,7 +6075,7 @@ object_property: $$ = []node.Node{fetch} // save position - yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition($1)) + fetch.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6087,7 +6088,7 @@ object_dim_list: $$ = append($1, fetch) // save position - yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition($3)) + fetch.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($3)) // save comments yylex.(*Parser).comments.AddFromToken(fetch, $2, comment.OpenSquareBracket) @@ -6101,7 +6102,7 @@ object_dim_list: $$ = append($1, fetch) // save position - yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition($3)) + fetch.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($3)) // save comments yylex.(*Parser).comments.AddFromToken(fetch, $2, comment.OpenCurlyBracesToken) @@ -6115,7 +6116,7 @@ object_dim_list: $$ = []node.Node{fetch} // save position - yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition($1)) + fetch.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6127,7 +6128,7 @@ variable_name: $$ = node.NewIdentifier($1.Value) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.StringToken) @@ -6139,7 +6140,7 @@ variable_name: $$ = $2 // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.OpenCurlyBracesToken) @@ -6156,7 +6157,7 @@ simple_indirect_reference: $$ = simpleIndirectReference{[]*expr.Variable{n}, n} // save position - yylex.(*Parser).positions.AddPosition(n, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + n.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken(n, $1, comment.DollarToken) @@ -6173,7 +6174,7 @@ simple_indirect_reference: $$ = $1 // save position - yylex.(*Parser).positions.AddPosition(n, yylex.(*Parser).positionBuilder.NewTokenPosition($2)) + n.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) // save comments yylex.(*Parser).comments.AddFromToken(n, $2, comment.DollarToken) @@ -6211,7 +6212,7 @@ assignment_list_element: $$ = expr.NewArrayItem(nil, $1) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodePosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6221,8 +6222,8 @@ assignment_list_element: $$ = expr.NewArrayItem(nil, item) // save position - yylex.(*Parser).positions.AddPosition(item, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodePosition(item)) + item.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(item)) // save comments yylex.(*Parser).comments.AddFromToken(item, $1, comment.ListToken) @@ -6267,7 +6268,7 @@ non_empty_array_pair_list: $$ = append($1, arrayItem) // save position - yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition($3, $5)) + arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($3, $5)) // save comments yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) @@ -6281,7 +6282,7 @@ non_empty_array_pair_list: $$ = append($1, arrayItem) // save position - yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodePosition($3)) + arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($3)) // save comments yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) @@ -6294,7 +6295,7 @@ non_empty_array_pair_list: $$ = []node.Node{arrayItem} // save position - yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken(arrayItem, $2, comment.DoubleArrowToken) @@ -6307,7 +6308,7 @@ non_empty_array_pair_list: $$ = []node.Node{arrayItem} // save position - yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodePosition($1)) + arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6318,8 +6319,8 @@ non_empty_array_pair_list: $$ = append($1, arrayItem) // save position - yylex.(*Parser).positions.AddPosition(reference, yylex.(*Parser).positionBuilder.NewTokenNodePosition($5, $6)) - yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition($3, $6)) + reference.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($5, $6)) + arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($3, $6)) // save comments yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) @@ -6335,8 +6336,8 @@ non_empty_array_pair_list: $$ = append($1, arrayItem) // save position - yylex.(*Parser).positions.AddPosition(reference, yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $4)) - yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $4)) + reference.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $4)) + arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $4)) // save comments yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) @@ -6351,8 +6352,8 @@ non_empty_array_pair_list: $$ = []node.Node{arrayItem} // save position - yylex.(*Parser).positions.AddPosition(reference, yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $4)) - yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) + reference.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $4)) + arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) // save comments yylex.(*Parser).comments.AddFromToken(arrayItem, $2, comment.DoubleArrowToken) @@ -6367,8 +6368,8 @@ non_empty_array_pair_list: $$ = []node.Node{arrayItem} // save position - yylex.(*Parser).positions.AddPosition(reference, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + reference.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken(reference, $1, comment.AmpersandToken) @@ -6390,7 +6391,7 @@ encaps_list: $$ = append($1, encapsed) // save position - yylex.(*Parser).positions.AddPosition(encapsed, yylex.(*Parser).positionBuilder.NewTokenPosition($2)) + encapsed.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) // save comments yylex.(*Parser).comments.AddFromToken(encapsed, $2, comment.EncapsedAndWhitespaceToken) @@ -6409,7 +6410,7 @@ encaps_list: $$ = []node.Node{encapsed, $2} // save position - yylex.(*Parser).positions.AddPosition(encapsed, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + encapsed.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken(encapsed, $1, comment.EncapsedAndWhitespaceToken) @@ -6425,8 +6426,8 @@ encaps_var: $$ = expr.NewVariable(name) // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.VariableToken) @@ -6440,9 +6441,9 @@ encaps_var: $$ = expr.NewArrayDimFetch(variable, $3) // save position - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments yylex.(*Parser).comments.AddFromToken(variable, $1, comment.VariableToken) @@ -6459,10 +6460,10 @@ encaps_var: $$ = expr.NewPropertyFetch(variable, fetch) // save position - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + fetch.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken(variable, $1, comment.VariableToken) @@ -6476,7 +6477,7 @@ encaps_var: $$ = expr.NewVariable($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.DollarOpenCurlyBracesToken) @@ -6490,8 +6491,8 @@ encaps_var: $$ = expr.NewVariable(name) // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.DollarOpenCurlyBracesToken) @@ -6507,9 +6508,9 @@ encaps_var: $$ = expr.NewArrayDimFetch(variable, $4) // save position - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $6)) + identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) + variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $6)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.DollarOpenCurlyBracesToken) @@ -6534,7 +6535,7 @@ encaps_var_offset: $$ = scalar.NewString($1.Value) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.StringToken) @@ -6551,7 +6552,7 @@ encaps_var_offset: } // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.NumStringToken) @@ -6564,8 +6565,8 @@ encaps_var_offset: $$ = expr.NewVariable(identifier) // save position - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.VariableToken) @@ -6580,7 +6581,7 @@ internal_functions_in_yacc: $$ = expr.NewIsset($3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.IssetToken) @@ -6594,7 +6595,7 @@ internal_functions_in_yacc: $$ = expr.NewEmpty($3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.EmptyToken) @@ -6608,7 +6609,7 @@ internal_functions_in_yacc: $$ = expr.NewEmpty($3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.EmptyToken) @@ -6622,7 +6623,7 @@ internal_functions_in_yacc: $$ = expr.NewInclude($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.IncludeToken) @@ -6634,7 +6635,7 @@ internal_functions_in_yacc: $$ = expr.NewIncludeOnce($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.IncludeOnceToken) @@ -6646,7 +6647,7 @@ internal_functions_in_yacc: $$ = expr.NewEval($3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.EvalToken) @@ -6660,7 +6661,7 @@ internal_functions_in_yacc: $$ = expr.NewRequire($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.RequireToken) @@ -6672,7 +6673,7 @@ internal_functions_in_yacc: $$ = expr.NewRequireOnce($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.RequireOnceToken) @@ -6721,8 +6722,8 @@ class_constant: $$ = expr.NewClassConstFetch($1, target) // save position - yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) + target.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.PaamayimNekudotayimToken) @@ -6735,8 +6736,8 @@ class_constant: $$ = expr.NewClassConstFetch($1, target) // save position - yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) + target.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.PaamayimNekudotayimToken) @@ -6752,8 +6753,8 @@ static_class_name_scalar: $$ = expr.NewClassConstFetch($1, target) // save position - yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) + target.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.PaamayimNekudotayimToken) @@ -6769,8 +6770,8 @@ class_name_scalar: $$ = expr.NewClassConstFetch($1, target) // save position - yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) + target.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.PaamayimNekudotayimToken) diff --git a/php5/php5_test.go b/php5/php5_test.go index 8a5dc81..52c634c 100644 --- a/php5/php5_test.go +++ b/php5/php5_test.go @@ -12,6 +12,7 @@ import ( "github.com/z7zmey/php-parser/node/expr/cast" "github.com/z7zmey/php-parser/node/name" "github.com/z7zmey/php-parser/node/scalar" + "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/php5" "github.com/z7zmey/php-parser/node" @@ -413,1051 +414,6092 @@ func TestPhp5(t *testing.T) { $foo::bar; ` - expectedParams := []node.Node{ - &node.Parameter{ - ByRef: false, - Variadic: false, - VariableType: &name.Name{Parts: []node.Node{&name.NamePart{Value: "bar"}}}, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "bar"}}, - DefaultValue: &expr.ConstFetch{Constant: &name.Name{Parts: []node.Node{&name.NamePart{Value: "null"}}}}, - }, - &node.Parameter{ - ByRef: true, - Variadic: true, - VariableType: &name.Name{Parts: []node.Node{&name.NamePart{Value: "baz"}}}, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "baz"}}, - }, - } - expected := &node.Root{ + Position: &position.Position{ + StartLine: 2, + EndLine: 379, + StartPos: 6, + EndPos: 6965, + }, Stmts: []node.Node{ &stmt.Expression{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 6, + EndPos: 20, + }, Expr: &expr.FunctionCall{ - Function: &name.Name{Parts: []node.Node{&name.NamePart{Value: "foo"}}}, + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 6, + EndPos: 19, + }, + Function: &name.Name{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 6, + EndPos: 8, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 6, + EndPos: 8, + }, + Value: "foo", + }, + }, + }, ArgumentList: &node.ArgumentList{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 9, + EndPos: 19, + }, Arguments: []node.Node{ - &node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, - &node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + &node.Argument{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 10, + EndPos: 11, + }, + Variadic: false, + IsReference: false, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 10, + EndPos: 11, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 10, + EndPos: 11, + }, + Value: "a", + }, + }, + }, + &node.Argument{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 14, + EndPos: 18, + }, + Variadic: true, + IsReference: false, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 17, + EndPos: 18, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 17, + EndPos: 18, + }, + Value: "b", + }, + }, + }, }, }, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 3, + EndLine: 3, + StartPos: 24, + EndPos: 39, + }, Expr: &expr.FunctionCall{ - Function: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, + Position: &position.Position{ + StartLine: 3, + EndLine: 3, + StartPos: 24, + EndPos: 38, + }, + Function: &expr.Variable{ + Position: &position.Position{ + StartLine: 3, + EndLine: 3, + StartPos: 24, + EndPos: 27, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 3, + EndLine: 3, + StartPos: 24, + EndPos: 27, + }, + Value: "foo", + }, + }, ArgumentList: &node.ArgumentList{ + Position: &position.Position{ + StartLine: 3, + EndLine: 3, + StartPos: 28, + EndPos: 38, + }, Arguments: []node.Node{ - &node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, - &node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + &node.Argument{ + Position: &position.Position{ + StartLine: 3, + EndLine: 3, + StartPos: 29, + EndPos: 30, + }, + Variadic: false, + IsReference: false, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 3, + EndLine: 3, + StartPos: 29, + EndPos: 30, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 3, + EndLine: 3, + StartPos: 29, + EndPos: 30, + }, + Value: "a", + }, + }, + }, + &node.Argument{ + Position: &position.Position{ + StartLine: 3, + EndLine: 3, + StartPos: 33, + EndPos: 37, + }, + Variadic: true, + IsReference: false, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 3, + EndLine: 3, + StartPos: 36, + EndPos: 37, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 3, + EndLine: 3, + StartPos: 36, + EndPos: 37, + }, + Value: "b", + }, + }, + }, }, }, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 43, + EndPos: 63, + }, Expr: &expr.MethodCall{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, - Method: &node.Identifier{Value: "bar"}, + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 43, + EndPos: 62, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 43, + EndPos: 46, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 43, + EndPos: 46, + }, + Value: "foo", + }, + }, + Method: &node.Identifier{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 49, + EndPos: 51, + }, + Value: "bar", + }, ArgumentList: &node.ArgumentList{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 52, + EndPos: 62, + }, Arguments: []node.Node{ - &node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, - &node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + &node.Argument{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 53, + EndPos: 54, + }, + Variadic: false, + IsReference: false, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 53, + EndPos: 54, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 53, + EndPos: 54, + }, + Value: "a", + }, + }, + }, + &node.Argument{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 57, + EndPos: 61, + }, + Variadic: true, + IsReference: false, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 60, + EndPos: 61, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 60, + EndPos: 61, + }, + Value: "b", + }, + }, + }, }, }, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 67, + EndPos: 86, + }, Expr: &expr.StaticCall{ - Class: &name.Name{Parts: []node.Node{&name.NamePart{Value: "foo"}}}, - Call: &node.Identifier{Value: "bar"}, + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 67, + EndPos: 85, + }, + Class: &name.Name{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 67, + EndPos: 69, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 67, + EndPos: 69, + }, + Value: "foo", + }, + }, + }, + Call: &node.Identifier{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 72, + EndPos: 74, + }, + Value: "bar", + }, ArgumentList: &node.ArgumentList{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 75, + EndPos: 85, + }, Arguments: []node.Node{ - &node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, - &node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + &node.Argument{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 76, + EndPos: 77, + }, + Variadic: false, + IsReference: false, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 76, + EndPos: 77, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 76, + EndPos: 77, + }, + Value: "a", + }, + }, + }, + &node.Argument{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 80, + EndPos: 84, + }, + Variadic: true, + IsReference: false, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 83, + EndPos: 84, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 83, + EndPos: 84, + }, + Value: "b", + }, + }, + }, }, }, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 90, + EndPos: 110, + }, Expr: &expr.StaticCall{ - Class: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, - Call: &node.Identifier{Value: "bar"}, + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 90, + EndPos: 109, + }, + Class: &expr.Variable{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 90, + EndPos: 93, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 90, + EndPos: 93, + }, + Value: "foo", + }, + }, + Call: &node.Identifier{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 96, + EndPos: 98, + }, + Value: "bar", + }, ArgumentList: &node.ArgumentList{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 99, + EndPos: 109, + }, Arguments: []node.Node{ - &node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, - &node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + &node.Argument{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 100, + EndPos: 101, + }, + Variadic: false, + IsReference: false, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 100, + EndPos: 101, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 100, + EndPos: 101, + }, + Value: "a", + }, + }, + }, + &node.Argument{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 104, + EndPos: 108, + }, + Variadic: true, + IsReference: false, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 107, + EndPos: 108, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 107, + EndPos: 108, + }, + Value: "b", + }, + }, + }, }, }, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 114, + EndPos: 132, + }, Expr: &expr.New{ - Class: &name.Name{Parts: []node.Node{&name.NamePart{Value: "foo"}}}, + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 114, + EndPos: 131, + }, + Class: &name.Name{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 118, + EndPos: 120, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 118, + EndPos: 120, + }, + Value: "foo", + }, + }, + }, ArgumentList: &node.ArgumentList{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 121, + EndPos: 131, + }, Arguments: []node.Node{ - &node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, - &node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + &node.Argument{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 122, + EndPos: 123, + }, + Variadic: false, + IsReference: false, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 122, + EndPos: 123, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 122, + EndPos: 123, + }, + Value: "a", + }, + }, + }, + &node.Argument{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 126, + EndPos: 130, + }, + Variadic: true, + IsReference: false, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 129, + EndPos: 130, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 129, + EndPos: 130, + }, + Value: "b", + }, + }, + }, }, }, }, }, &stmt.Function{ - ReturnsRef: false, + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 137, + EndPos: 180, + }, + ReturnsRef: false, PhpDocComment: "", - FunctionName: &node.Identifier{Value: "foo"}, - Params: expectedParams, - Stmts: []node.Node{}, + FunctionName: &node.Identifier{ + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 146, + EndPos: 148, + }, + Value: "foo", + }, + Params: []node.Node{ + &node.Parameter{ + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 150, + EndPos: 162, + }, + Variadic: false, + ByRef: false, + VariableType: &name.Name{ + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 150, + EndPos: 152, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 150, + EndPos: 152, + }, + Value: "bar", + }, + }, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 154, + EndPos: 157, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 154, + EndPos: 157, + }, + Value: "bar", + }, + }, + DefaultValue: &expr.ConstFetch{ + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 159, + EndPos: 162, + }, + Constant: &name.Name{ + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 159, + EndPos: 162, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 159, + EndPos: 162, + }, + Value: "null", + }, + }, + }, + }, + }, + &node.Parameter{ + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 165, + EndPos: 176, + }, + Variadic: true, + ByRef: true, + VariableType: &name.Name{ + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 165, + EndPos: 167, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 165, + EndPos: 167, + }, + Value: "baz", + }, + }, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 173, + EndPos: 176, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 173, + EndPos: 176, + }, + Value: "baz", + }, + }, + }, + }, + Stmts: []node.Node{ + }, }, &stmt.Class{ - ClassName: &node.Identifier{Value: "foo"}, + Position: &position.Position{ + StartLine: 10, + EndLine: 10, + StartPos: 184, + EndPos: 246, + }, + PhpDocComment: "", + ClassName: &node.Identifier{ + Position: &position.Position{ + StartLine: 10, + EndLine: 10, + StartPos: 190, + EndPos: 192, + }, + Value: "foo", + }, Stmts: []node.Node{ &stmt.ClassMethod{ - MethodName: &node.Identifier{Value: "foo"}, - Modifiers: []node.Node{&node.Identifier{Value: "public"}}, - Params: expectedParams, + Position: &position.Position{ + StartLine: 10, + EndLine: 10, + StartPos: 195, + EndPos: 245, + }, + PhpDocComment: "", + ReturnsRef: false, + MethodName: &node.Identifier{ + Position: &position.Position{ + StartLine: 10, + EndLine: 10, + StartPos: 211, + EndPos: 213, + }, + Value: "foo", + }, + Modifiers: []node.Node{ + &node.Identifier{ + Position: &position.Position{ + StartLine: 10, + EndLine: 10, + StartPos: 195, + EndPos: 200, + }, + Value: "public", + }, + }, + Params: []node.Node{ + &node.Parameter{ + Position: &position.Position{ + StartLine: 10, + EndLine: 10, + StartPos: 215, + EndPos: 227, + }, + ByRef: false, + Variadic: false, + VariableType: &name.Name{ + Position: &position.Position{ + StartLine: 10, + EndLine: 10, + StartPos: 215, + EndPos: 217, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 10, + EndLine: 10, + StartPos: 215, + EndPos: 217, + }, + Value: "bar", + }, + }, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 10, + EndLine: 10, + StartPos: 219, + EndPos: 222, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 10, + EndLine: 10, + StartPos: 219, + EndPos: 222, + }, + Value: "bar", + }, + }, + DefaultValue: &expr.ConstFetch{ + Position: &position.Position{ + StartLine: 10, + EndLine: 10, + StartPos: 224, + EndPos: 227, + }, + Constant: &name.Name{ + Position: &position.Position{ + StartLine: 10, + EndLine: 10, + StartPos: 224, + EndPos: 227, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 10, + EndLine: 10, + StartPos: 224, + EndPos: 227, + }, + Value: "null", + }, + }, + }, + }, + }, + &node.Parameter{ + Position: &position.Position{ + StartLine: 10, + EndLine: 10, + StartPos: 230, + EndPos: 241, + }, + ByRef: true, + Variadic: true, + VariableType: &name.Name{ + Position: &position.Position{ + StartLine: 10, + EndLine: 10, + StartPos: 230, + EndPos: 232, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 10, + EndLine: 10, + StartPos: 230, + EndPos: 232, + }, + Value: "baz", + }, + }, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 10, + EndLine: 10, + StartPos: 238, + EndPos: 241, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 10, + EndLine: 10, + StartPos: 238, + EndPos: 241, + }, + Value: "baz", + }, + }, + }, + }, Stmt: &stmt.StmtList{ - Stmts: []node.Node{}, + Position: &position.Position{ + StartLine: 10, + EndLine: 10, + StartPos: 244, + EndPos: 245, + }, + Stmts: []node.Node{ + }, }, }, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 11, + EndLine: 11, + StartPos: 250, + EndPos: 290, + }, Expr: &expr.Closure{ - Params: expectedParams, - Stmts: []node.Node{}, - }, - }, - &stmt.Expression{ - Expr: &expr.Closure{ - Static: true, - Params: expectedParams, - Stmts: []node.Node{}, - }, - }, - &stmt.Expression{ - Expr: &scalar.Lnumber{Value: "1234567890123456789"}, - }, - &stmt.Expression{ - Expr: &scalar.Dnumber{Value: "12345678901234567890"}, - }, - &stmt.Expression{ - Expr: &scalar.Dnumber{Value: "0."}, - }, - &stmt.Expression{ - Expr: &scalar.Lnumber{Value: "0b0111111111111111111111111111111111111111111111111111111111111111"}, - }, - &stmt.Expression{ - Expr: &scalar.Dnumber{Value: "0b1111111111111111111111111111111111111111111111111111111111111111"}, - }, - &stmt.Expression{ - Expr: &scalar.Lnumber{Value: "0x007111111111111111"}, - }, - &stmt.Expression{ - Expr: &scalar.Dnumber{Value: "0x8111111111111111"}, - }, - - &stmt.Expression{ - Expr: &scalar.MagicConstant{Value: "__CLASS__"}, - }, - &stmt.Expression{ - Expr: &scalar.MagicConstant{Value: "__DIR__"}, - }, - &stmt.Expression{ - Expr: &scalar.MagicConstant{Value: "__FILE__"}, - }, - &stmt.Expression{ - Expr: &scalar.MagicConstant{Value: "__FUNCTION__"}, - }, - &stmt.Expression{ - Expr: &scalar.MagicConstant{Value: "__LINE__"}, - }, - &stmt.Expression{ - Expr: &scalar.MagicConstant{Value: "__NAMESPACE__"}, - }, - &stmt.Expression{ - Expr: &scalar.MagicConstant{Value: "__METHOD__"}, - }, - &stmt.Expression{ - Expr: &scalar.MagicConstant{Value: "__TRAIT__"}, - }, - - &stmt.Expression{ - Expr: &scalar.Encapsed{ - Parts: []node.Node{ - &scalar.EncapsedStringPart{Value: "test "}, - &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + Position: &position.Position{ + StartLine: 11, + EndLine: 11, + StartPos: 250, + EndPos: 289, }, - }, - }, - &stmt.Expression{ - Expr: &scalar.Encapsed{ - Parts: []node.Node{ - &scalar.EncapsedStringPart{Value: "test "}, - &expr.ArrayDimFetch{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, - Dim: &scalar.Lnumber{Value: "1"}, + ReturnsRef: false, + Static: false, + PhpDocComment: "", + Params: []node.Node{ + &node.Parameter{ + Position: &position.Position{ + StartLine: 11, + EndLine: 11, + StartPos: 259, + EndPos: 271, + }, + ByRef: false, + Variadic: false, + VariableType: &name.Name{ + Position: &position.Position{ + StartLine: 11, + EndLine: 11, + StartPos: 259, + EndPos: 261, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 11, + EndLine: 11, + StartPos: 259, + EndPos: 261, + }, + Value: "bar", + }, + }, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 11, + EndLine: 11, + StartPos: 263, + EndPos: 266, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 11, + EndLine: 11, + StartPos: 263, + EndPos: 266, + }, + Value: "bar", + }, + }, + DefaultValue: &expr.ConstFetch{ + Position: &position.Position{ + StartLine: 11, + EndLine: 11, + StartPos: 268, + EndPos: 271, + }, + Constant: &name.Name{ + Position: &position.Position{ + StartLine: 11, + EndLine: 11, + StartPos: 268, + EndPos: 271, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 11, + EndLine: 11, + StartPos: 268, + EndPos: 271, + }, + Value: "null", + }, + }, + }, + }, + }, + &node.Parameter{ + Position: &position.Position{ + StartLine: 11, + EndLine: 11, + StartPos: 274, + EndPos: 285, + }, + ByRef: true, + Variadic: true, + VariableType: &name.Name{ + Position: &position.Position{ + StartLine: 11, + EndLine: 11, + StartPos: 274, + EndPos: 276, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 11, + EndLine: 11, + StartPos: 274, + EndPos: 276, + }, + Value: "baz", + }, + }, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 11, + EndLine: 11, + StartPos: 282, + EndPos: 285, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 11, + EndLine: 11, + StartPos: 282, + EndPos: 285, + }, + Value: "baz", + }, + }, }, }, - }, - }, - &stmt.Expression{ - Expr: &scalar.Encapsed{ - Parts: []node.Node{ - &scalar.EncapsedStringPart{Value: "test "}, - &expr.ArrayDimFetch{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, - Dim: &scalar.String{Value: "1234567890123456789012345678901234567890"}, - }, - }, - }, - }, - &stmt.Expression{ - Expr: &scalar.Encapsed{ - Parts: []node.Node{ - &scalar.EncapsedStringPart{Value: "test "}, - &expr.ArrayDimFetch{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, - Dim: &scalar.String{Value: "bar"}, - }, - }, - }, - }, - &stmt.Expression{ - Expr: &scalar.Encapsed{ - Parts: []node.Node{ - &scalar.EncapsedStringPart{Value: "test "}, - &expr.ArrayDimFetch{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, - Dim: &expr.Variable{VarName: &node.Identifier{Value: "bar"}}, - }, - }, - }, - }, - &stmt.Expression{ - Expr: &scalar.Encapsed{ - Parts: []node.Node{ - &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, - &scalar.EncapsedStringPart{Value: " "}, - &expr.Variable{VarName: &node.Identifier{Value: "bar"}}, - }, - }, - }, - &stmt.Expression{ - Expr: &scalar.Encapsed{ - Parts: []node.Node{ - &scalar.EncapsedStringPart{Value: "test "}, - &expr.PropertyFetch{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, - Property: &node.Identifier{Value: "bar"}, - }, - &scalar.EncapsedStringPart{Value: "()"}, - }, - }, - }, - &stmt.Expression{ - Expr: &scalar.Encapsed{ - Parts: []node.Node{ - &scalar.EncapsedStringPart{Value: "test "}, - &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, - }, - }, - }, - &stmt.Expression{ - Expr: &scalar.Encapsed{ - Parts: []node.Node{ - &scalar.EncapsedStringPart{Value: "test "}, - &expr.ArrayDimFetch{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, - Dim: &scalar.Lnumber{Value: "0"}, - }, - }, - }, - }, - &stmt.Expression{ - Expr: &scalar.Encapsed{ - Parts: []node.Node{ - &scalar.EncapsedStringPart{Value: "test "}, - &expr.MethodCall{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, - Method: &node.Identifier{Value: "bar"}, - ArgumentList: &node.ArgumentList{}, - }, - }, - }, - }, - - &stmt.AltIf{ - Cond: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Stmt: &stmt.StmtList{Stmts: []node.Node{}}, - }, - &stmt.AltIf{ - Cond: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Stmt: &stmt.StmtList{Stmts: []node.Node{}}, - ElseIf: []node.Node{ - &stmt.AltElseIf{ - Cond: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - Stmt: &stmt.StmtList{Stmts: []node.Node{}}, - }, - }, - }, - &stmt.AltIf{ - Cond: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Stmt: &stmt.StmtList{Stmts: []node.Node{}}, - Else: &stmt.AltElse{ - Stmt: &stmt.StmtList{Stmts: []node.Node{}}, - }, - }, - &stmt.AltIf{ - Cond: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Stmt: &stmt.StmtList{Stmts: []node.Node{}}, - ElseIf: []node.Node{ - &stmt.AltElseIf{ - Cond: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - Stmt: &stmt.StmtList{Stmts: []node.Node{}}, - }, - &stmt.AltElseIf{ - Cond: &expr.Variable{VarName: &node.Identifier{Value: "c"}}, - Stmt: &stmt.StmtList{Stmts: []node.Node{}}, - }, - }, - Else: &stmt.AltElse{ - Stmt: &stmt.StmtList{Stmts: []node.Node{}}, - }, - }, - &stmt.While{ - Cond: &scalar.Lnumber{Value: "1"}, - Stmt: &stmt.StmtList{ Stmts: []node.Node{ - &stmt.Break{}, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 12, + EndLine: 12, + StartPos: 294, + EndPos: 341, + }, + Expr: &expr.Closure{ + Position: &position.Position{ + StartLine: 12, + EndLine: 12, + StartPos: 294, + EndPos: 340, + }, + ReturnsRef: false, + Static: true, + PhpDocComment: "", + Params: []node.Node{ + &node.Parameter{ + Position: &position.Position{ + StartLine: 12, + EndLine: 12, + StartPos: 310, + EndPos: 322, + }, + ByRef: false, + Variadic: false, + VariableType: &name.Name{ + Position: &position.Position{ + StartLine: 12, + EndLine: 12, + StartPos: 310, + EndPos: 312, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 12, + EndLine: 12, + StartPos: 310, + EndPos: 312, + }, + Value: "bar", + }, + }, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 12, + EndLine: 12, + StartPos: 314, + EndPos: 317, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 12, + EndLine: 12, + StartPos: 314, + EndPos: 317, + }, + Value: "bar", + }, + }, + DefaultValue: &expr.ConstFetch{ + Position: &position.Position{ + StartLine: 12, + EndLine: 12, + StartPos: 319, + EndPos: 322, + }, + Constant: &name.Name{ + Position: &position.Position{ + StartLine: 12, + EndLine: 12, + StartPos: 319, + EndPos: 322, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 12, + EndLine: 12, + StartPos: 319, + EndPos: 322, + }, + Value: "null", + }, + }, + }, + }, + }, + &node.Parameter{ + Position: &position.Position{ + StartLine: 12, + EndLine: 12, + StartPos: 325, + EndPos: 336, + }, + ByRef: true, + Variadic: true, + VariableType: &name.Name{ + Position: &position.Position{ + StartLine: 12, + EndLine: 12, + StartPos: 325, + EndPos: 327, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 12, + EndLine: 12, + StartPos: 325, + EndPos: 327, + }, + Value: "baz", + }, + }, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 12, + EndLine: 12, + StartPos: 333, + EndPos: 336, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 12, + EndLine: 12, + StartPos: 333, + EndPos: 336, + }, + Value: "baz", + }, + }, + }, + }, + Stmts: []node.Node{ + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 14, + EndLine: 14, + StartPos: 346, + EndPos: 365, + }, + Expr: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 14, + EndLine: 14, + StartPos: 346, + EndPos: 364, + }, + Value: "1234567890123456789", + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 15, + EndLine: 15, + StartPos: 369, + EndPos: 389, + }, + Expr: &scalar.Dnumber{ + Position: &position.Position{ + StartLine: 15, + EndLine: 15, + StartPos: 369, + EndPos: 388, + }, + Value: "12345678901234567890", + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 16, + EndLine: 16, + StartPos: 393, + EndPos: 395, + }, + Expr: &scalar.Dnumber{ + Position: &position.Position{ + StartLine: 16, + EndLine: 16, + StartPos: 393, + EndPos: 394, + }, + Value: "0.", + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 17, + EndLine: 17, + StartPos: 399, + EndPos: 465, + }, + Expr: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 17, + EndLine: 17, + StartPos: 399, + EndPos: 464, + }, + Value: "0b0111111111111111111111111111111111111111111111111111111111111111", + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 18, + EndLine: 18, + StartPos: 469, + EndPos: 535, + }, + Expr: &scalar.Dnumber{ + Position: &position.Position{ + StartLine: 18, + EndLine: 18, + StartPos: 469, + EndPos: 534, + }, + Value: "0b1111111111111111111111111111111111111111111111111111111111111111", + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 19, + EndLine: 19, + StartPos: 539, + EndPos: 559, + }, + Expr: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 19, + EndLine: 19, + StartPos: 539, + EndPos: 558, + }, + Value: "0x007111111111111111", + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 20, + EndLine: 20, + StartPos: 563, + EndPos: 581, + }, + Expr: &scalar.Dnumber{ + Position: &position.Position{ + StartLine: 20, + EndLine: 20, + StartPos: 563, + EndPos: 580, + }, + Value: "0x8111111111111111", + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 21, + EndLine: 21, + StartPos: 585, + EndPos: 594, + }, + Expr: &scalar.MagicConstant{ + Position: &position.Position{ + StartLine: 21, + EndLine: 21, + StartPos: 585, + EndPos: 593, + }, + Value: "__CLASS__", + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 22, + EndLine: 22, + StartPos: 598, + EndPos: 605, + }, + Expr: &scalar.MagicConstant{ + Position: &position.Position{ + StartLine: 22, + EndLine: 22, + StartPos: 598, + EndPos: 604, + }, + Value: "__DIR__", + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 23, + EndLine: 23, + StartPos: 609, + EndPos: 617, + }, + Expr: &scalar.MagicConstant{ + Position: &position.Position{ + StartLine: 23, + EndLine: 23, + StartPos: 609, + EndPos: 616, + }, + Value: "__FILE__", + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 24, + EndLine: 24, + StartPos: 621, + EndPos: 633, + }, + Expr: &scalar.MagicConstant{ + Position: &position.Position{ + StartLine: 24, + EndLine: 24, + StartPos: 621, + EndPos: 632, + }, + Value: "__FUNCTION__", + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 25, + EndLine: 25, + StartPos: 637, + EndPos: 645, + }, + Expr: &scalar.MagicConstant{ + Position: &position.Position{ + StartLine: 25, + EndLine: 25, + StartPos: 637, + EndPos: 644, + }, + Value: "__LINE__", + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 26, + EndLine: 26, + StartPos: 649, + EndPos: 662, + }, + Expr: &scalar.MagicConstant{ + Position: &position.Position{ + StartLine: 26, + EndLine: 26, + StartPos: 649, + EndPos: 661, + }, + Value: "__NAMESPACE__", + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 27, + EndLine: 27, + StartPos: 666, + EndPos: 676, + }, + Expr: &scalar.MagicConstant{ + Position: &position.Position{ + StartLine: 27, + EndLine: 27, + StartPos: 666, + EndPos: 675, + }, + Value: "__METHOD__", + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 28, + EndLine: 28, + StartPos: 680, + EndPos: 689, + }, + Expr: &scalar.MagicConstant{ + Position: &position.Position{ + StartLine: 28, + EndLine: 28, + StartPos: 680, + EndPos: 688, + }, + Value: "__TRAIT__", + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 30, + EndLine: 30, + StartPos: 694, + EndPos: 705, + }, + Expr: &scalar.Encapsed{ + Position: &position.Position{ + StartLine: 30, + EndLine: 30, + StartPos: 694, + EndPos: 704, + }, + Parts: []node.Node{ + &scalar.EncapsedStringPart{ + Position: &position.Position{ + StartLine: 30, + EndLine: 30, + StartPos: 695, + EndPos: 699, + }, + Value: "test ", + }, + &expr.Variable{ + Position: &position.Position{ + StartLine: 30, + EndLine: 30, + StartPos: 700, + EndPos: 703, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 30, + EndLine: 30, + StartPos: 700, + EndPos: 703, + }, + Value: "var", + }, + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 31, + EndLine: 31, + StartPos: 709, + EndPos: 723, + }, + Expr: &scalar.Encapsed{ + Position: &position.Position{ + StartLine: 31, + EndLine: 31, + StartPos: 709, + EndPos: 722, + }, + Parts: []node.Node{ + &scalar.EncapsedStringPart{ + Position: &position.Position{ + StartLine: 31, + EndLine: 31, + StartPos: 710, + EndPos: 714, + }, + Value: "test ", + }, + &expr.ArrayDimFetch{ + Position: &position.Position{ + StartLine: 31, + EndLine: 31, + StartPos: 715, + EndPos: 721, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 31, + EndLine: 31, + StartPos: 715, + EndPos: 718, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 31, + EndLine: 31, + StartPos: 715, + EndPos: 718, + }, + Value: "var", + }, + }, + Dim: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 31, + EndLine: 31, + StartPos: 720, + EndPos: 720, + }, + Value: "1", + }, + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 32, + EndLine: 32, + StartPos: 727, + EndPos: 780, + }, + Expr: &scalar.Encapsed{ + Position: &position.Position{ + StartLine: 32, + EndLine: 32, + StartPos: 727, + EndPos: 779, + }, + Parts: []node.Node{ + &scalar.EncapsedStringPart{ + Position: &position.Position{ + StartLine: 32, + EndLine: 32, + StartPos: 728, + EndPos: 732, + }, + Value: "test ", + }, + &expr.ArrayDimFetch{ + Position: &position.Position{ + StartLine: 32, + EndLine: 32, + StartPos: 733, + EndPos: 778, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 32, + EndLine: 32, + StartPos: 733, + EndPos: 736, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 32, + EndLine: 32, + StartPos: 733, + EndPos: 736, + }, + Value: "var", + }, + }, + Dim: &scalar.String{ + Position: &position.Position{ + StartLine: 32, + EndLine: 32, + StartPos: 738, + EndPos: 777, + }, + Value: "1234567890123456789012345678901234567890", + }, + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 33, + EndLine: 33, + StartPos: 784, + EndPos: 800, + }, + Expr: &scalar.Encapsed{ + Position: &position.Position{ + StartLine: 33, + EndLine: 33, + StartPos: 784, + EndPos: 799, + }, + Parts: []node.Node{ + &scalar.EncapsedStringPart{ + Position: &position.Position{ + StartLine: 33, + EndLine: 33, + StartPos: 785, + EndPos: 789, + }, + Value: "test ", + }, + &expr.ArrayDimFetch{ + Position: &position.Position{ + StartLine: 33, + EndLine: 33, + StartPos: 790, + EndPos: 798, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 33, + EndLine: 33, + StartPos: 790, + EndPos: 793, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 33, + EndLine: 33, + StartPos: 790, + EndPos: 793, + }, + Value: "var", + }, + }, + Dim: &scalar.String{ + Position: &position.Position{ + StartLine: 33, + EndLine: 33, + StartPos: 795, + EndPos: 797, + }, + Value: "bar", + }, + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 34, + EndLine: 34, + StartPos: 804, + EndPos: 821, + }, + Expr: &scalar.Encapsed{ + Position: &position.Position{ + StartLine: 34, + EndLine: 34, + StartPos: 804, + EndPos: 820, + }, + Parts: []node.Node{ + &scalar.EncapsedStringPart{ + Position: &position.Position{ + StartLine: 34, + EndLine: 34, + StartPos: 805, + EndPos: 809, + }, + Value: "test ", + }, + &expr.ArrayDimFetch{ + Position: &position.Position{ + StartLine: 34, + EndLine: 34, + StartPos: 810, + EndPos: 819, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 34, + EndLine: 34, + StartPos: 810, + EndPos: 813, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 34, + EndLine: 34, + StartPos: 810, + EndPos: 813, + }, + Value: "var", + }, + }, + Dim: &expr.Variable{ + Position: &position.Position{ + StartLine: 34, + EndLine: 34, + StartPos: 815, + EndPos: 818, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 34, + EndLine: 34, + StartPos: 815, + EndPos: 818, + }, + Value: "bar", + }, + }, + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 35, + EndLine: 35, + StartPos: 825, + EndPos: 836, + }, + Expr: &scalar.Encapsed{ + Position: &position.Position{ + StartLine: 35, + EndLine: 35, + StartPos: 825, + EndPos: 835, + }, + Parts: []node.Node{ + &expr.Variable{ + Position: &position.Position{ + StartLine: 35, + EndLine: 35, + StartPos: 826, + EndPos: 829, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 35, + EndLine: 35, + StartPos: 826, + EndPos: 829, + }, + Value: "foo", + }, + }, + &scalar.EncapsedStringPart{ + Position: &position.Position{ + StartLine: 35, + EndLine: 35, + StartPos: 830, + EndPos: 830, + }, + Value: " ", + }, + &expr.Variable{ + Position: &position.Position{ + StartLine: 35, + EndLine: 35, + StartPos: 831, + EndPos: 834, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 35, + EndLine: 35, + StartPos: 831, + EndPos: 834, + }, + Value: "bar", + }, + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 36, + EndLine: 36, + StartPos: 840, + EndPos: 858, + }, + Expr: &scalar.Encapsed{ + Position: &position.Position{ + StartLine: 36, + EndLine: 36, + StartPos: 840, + EndPos: 857, + }, + Parts: []node.Node{ + &scalar.EncapsedStringPart{ + Position: &position.Position{ + StartLine: 36, + EndLine: 36, + StartPos: 841, + EndPos: 845, + }, + Value: "test ", + }, + &expr.PropertyFetch{ + Position: &position.Position{ + StartLine: 36, + EndLine: 36, + StartPos: 846, + EndPos: 854, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 36, + EndLine: 36, + StartPos: 846, + EndPos: 849, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 36, + EndLine: 36, + StartPos: 846, + EndPos: 849, + }, + Value: "foo", + }, + }, + Property: &node.Identifier{ + Position: &position.Position{ + StartLine: 36, + EndLine: 36, + StartPos: 852, + EndPos: 854, + }, + Value: "bar", + }, + }, + &scalar.EncapsedStringPart{ + Position: &position.Position{ + StartLine: 36, + EndLine: 36, + StartPos: 855, + EndPos: 856, + }, + Value: "()", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 37, + EndLine: 37, + StartPos: 862, + EndPos: 875, + }, + Expr: &scalar.Encapsed{ + Position: &position.Position{ + StartLine: 37, + EndLine: 37, + StartPos: 862, + EndPos: 874, + }, + Parts: []node.Node{ + &scalar.EncapsedStringPart{ + Position: &position.Position{ + StartLine: 37, + EndLine: 37, + StartPos: 863, + EndPos: 867, + }, + Value: "test ", + }, + &expr.Variable{ + Position: &position.Position{ + StartLine: 37, + EndLine: 37, + StartPos: 868, + EndPos: 873, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 37, + EndLine: 37, + StartPos: 870, + EndPos: 872, + }, + Value: "foo", + }, + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 38, + EndLine: 38, + StartPos: 879, + EndPos: 895, + }, + Expr: &scalar.Encapsed{ + Position: &position.Position{ + StartLine: 38, + EndLine: 38, + StartPos: 879, + EndPos: 894, + }, + Parts: []node.Node{ + &scalar.EncapsedStringPart{ + Position: &position.Position{ + StartLine: 38, + EndLine: 38, + StartPos: 880, + EndPos: 884, + }, + Value: "test ", + }, + &expr.ArrayDimFetch{ + Position: &position.Position{ + StartLine: 38, + EndLine: 38, + StartPos: 885, + EndPos: 893, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 38, + EndLine: 38, + StartPos: 887, + EndPos: 889, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 38, + EndLine: 38, + StartPos: 887, + EndPos: 889, + }, + Value: "foo", + }, + }, + Dim: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 38, + EndLine: 38, + StartPos: 891, + EndPos: 891, + }, + Value: "0", + }, + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 39, + EndLine: 39, + StartPos: 899, + EndPos: 919, + }, + Expr: &scalar.Encapsed{ + Position: &position.Position{ + StartLine: 39, + EndLine: 39, + StartPos: 899, + EndPos: 918, + }, + Parts: []node.Node{ + &scalar.EncapsedStringPart{ + Position: &position.Position{ + StartLine: 39, + EndLine: 39, + StartPos: 900, + EndPos: 904, + }, + Value: "test ", + }, + &expr.MethodCall{ + Position: &position.Position{ + StartLine: 39, + EndLine: 39, + StartPos: 906, + EndPos: 916, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 39, + EndLine: 39, + StartPos: 906, + EndPos: 909, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 39, + EndLine: 39, + StartPos: 906, + EndPos: 909, + }, + Value: "foo", + }, + }, + Method: &node.Identifier{ + Position: &position.Position{ + StartLine: 39, + EndLine: 39, + StartPos: 912, + EndPos: 914, + }, + Value: "bar", + }, + ArgumentList: &node.ArgumentList{ + Position: &position.Position{ + StartLine: 39, + EndLine: 39, + StartPos: 915, + EndPos: 916, + }, + }, + }, + }, + }, + }, + &stmt.AltIf{ + Position: &position.Position{ + StartLine: 41, + EndLine: 42, + StartPos: 924, + EndPos: 941, + }, + Cond: &expr.Variable{ + Position: &position.Position{ + StartLine: 41, + EndLine: 41, + StartPos: 928, + EndPos: 929, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 41, + EndLine: 41, + StartPos: 928, + EndPos: 929, + }, + Value: "a", + }, + }, + Stmt: &stmt.StmtList{ + Position: &position.Position{ + StartLine: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, + }, + Stmts: []node.Node{ + }, + }, + }, + &stmt.AltIf{ + Position: &position.Position{ + StartLine: 43, + EndLine: 45, + StartPos: 945, + EndPos: 977, + }, + Cond: &expr.Variable{ + Position: &position.Position{ + StartLine: 43, + EndLine: 43, + StartPos: 949, + EndPos: 950, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 43, + EndLine: 43, + StartPos: 949, + EndPos: 950, + }, + Value: "a", + }, + }, + Stmt: &stmt.StmtList{ + Position: &position.Position{ + StartLine: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, + }, + Stmts: []node.Node{ + }, + }, + ElseIf: []node.Node{ + &stmt.AltElseIf{ + Position: &position.Position{ + StartLine: 44, + EndLine: -1, + StartPos: 957, + EndPos: -1, + }, + Cond: &expr.Variable{ + Position: &position.Position{ + StartLine: 44, + EndLine: 44, + StartPos: 965, + EndPos: 966, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 44, + EndLine: 44, + StartPos: 965, + EndPos: 966, + }, + Value: "b", + }, + }, + Stmt: &stmt.StmtList{ + Position: &position.Position{ + StartLine: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, + }, + Stmts: []node.Node{ + }, + }, + }, + }, + }, + &stmt.AltIf{ + Position: &position.Position{ + StartLine: 46, + EndLine: 48, + StartPos: 981, + EndPos: 1006, + }, + Cond: &expr.Variable{ + Position: &position.Position{ + StartLine: 46, + EndLine: 46, + StartPos: 985, + EndPos: 986, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 46, + EndLine: 46, + StartPos: 985, + EndPos: 986, + }, + Value: "a", + }, + }, + Stmt: &stmt.StmtList{ + Position: &position.Position{ + StartLine: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, + }, + Stmts: []node.Node{ + }, + }, + Else: &stmt.AltElse{ + Position: &position.Position{ + StartLine: 47, + EndLine: -1, + StartPos: 993, + EndPos: -1, + }, + Stmt: &stmt.StmtList{ + Position: &position.Position{ + StartLine: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, + }, + Stmts: []node.Node{ + }, + }, + }, + }, + &stmt.AltIf{ + Position: &position.Position{ + StartLine: 49, + EndLine: 53, + StartPos: 1010, + EndPos: 1065, + }, + Cond: &expr.Variable{ + Position: &position.Position{ + StartLine: 49, + EndLine: 49, + StartPos: 1014, + EndPos: 1015, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 49, + EndLine: 49, + StartPos: 1014, + EndPos: 1015, + }, + Value: "a", + }, + }, + Stmt: &stmt.StmtList{ + Position: &position.Position{ + StartLine: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, + }, + Stmts: []node.Node{ + }, + }, + ElseIf: []node.Node{ + &stmt.AltElseIf{ + Position: &position.Position{ + StartLine: 50, + EndLine: -1, + StartPos: 1022, + EndPos: -1, + }, + Cond: &expr.Variable{ + Position: &position.Position{ + StartLine: 50, + EndLine: 50, + StartPos: 1030, + EndPos: 1031, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 50, + EndLine: 50, + StartPos: 1030, + EndPos: 1031, + }, + Value: "b", + }, + }, + Stmt: &stmt.StmtList{ + Position: &position.Position{ + StartLine: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, + }, + Stmts: []node.Node{ + }, + }, + }, + &stmt.AltElseIf{ + Position: &position.Position{ + StartLine: 51, + EndLine: -1, + StartPos: 1037, + EndPos: -1, + }, + Cond: &expr.Variable{ + Position: &position.Position{ + StartLine: 51, + EndLine: 51, + StartPos: 1045, + EndPos: 1046, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 51, + EndLine: 51, + StartPos: 1045, + EndPos: 1046, + }, + Value: "c", + }, + }, + Stmt: &stmt.StmtList{ + Position: &position.Position{ + StartLine: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, + }, + Stmts: []node.Node{ + }, + }, + }, + }, + Else: &stmt.AltElse{ + Position: &position.Position{ + StartLine: 52, + EndLine: -1, + StartPos: 1052, + EndPos: -1, + }, + Stmt: &stmt.StmtList{ + Position: &position.Position{ + StartLine: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, + }, + Stmts: []node.Node{ + }, }, }, }, &stmt.While{ - Cond: &scalar.Lnumber{Value: "1"}, + Position: &position.Position{ + StartLine: 55, + EndLine: 55, + StartPos: 1070, + EndPos: 1089, + }, + Cond: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 55, + EndLine: 55, + StartPos: 1077, + EndPos: 1077, + }, + Value: "1", + }, Stmt: &stmt.StmtList{ + Position: &position.Position{ + StartLine: 55, + EndLine: 55, + StartPos: 1080, + EndPos: 1089, + }, Stmts: []node.Node{ &stmt.Break{ - Expr: &scalar.Lnumber{Value: "2"}, + Position: &position.Position{ + StartLine: 55, + EndLine: 55, + StartPos: 1082, + EndPos: 1087, + }, + }, + }, + }, + }, + &stmt.While{ + Position: &position.Position{ + StartLine: 56, + EndLine: 56, + StartPos: 1093, + EndPos: 1114, + }, + Cond: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 56, + EndLine: 56, + StartPos: 1100, + EndPos: 1100, + }, + Value: "1", + }, + Stmt: &stmt.StmtList{ + Position: &position.Position{ + StartLine: 56, + EndLine: 56, + StartPos: 1103, + EndPos: 1114, + }, + Stmts: []node.Node{ + &stmt.Break{ + Position: &position.Position{ + StartLine: 56, + EndLine: 56, + StartPos: 1105, + EndPos: 1112, + }, + Expr: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 56, + EndLine: 56, + StartPos: 1111, + EndPos: 1111, + }, + Value: "2", + }, }, }, }, }, &stmt.AltWhile{ - Cond: &scalar.Lnumber{Value: "1"}, + Position: &position.Position{ + StartLine: 57, + EndLine: 57, + StartPos: 1118, + EndPos: 1148, + }, + Cond: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 57, + EndLine: 57, + StartPos: 1125, + EndPos: 1125, + }, + Value: "1", + }, Stmt: &stmt.StmtList{ + Position: &position.Position{ + StartLine: 57, + EndLine: 57, + StartPos: 1130, + EndPos: 1138, + }, Stmts: []node.Node{ &stmt.Break{ - Expr: &scalar.Lnumber{Value: "3"}, + Position: &position.Position{ + StartLine: 57, + EndLine: 57, + StartPos: 1130, + EndPos: 1138, + }, + Expr: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 57, + EndLine: 57, + StartPos: 1136, + EndPos: 1136, + }, + Value: "3", + }, }, }, }, }, &stmt.Class{ - ClassName: &node.Identifier{Value: "foo"}, + Position: &position.Position{ + StartLine: 58, + EndLine: 58, + StartPos: 1152, + EndPos: 1187, + }, + PhpDocComment: "", + ClassName: &node.Identifier{ + Position: &position.Position{ + StartLine: 58, + EndLine: 58, + StartPos: 1158, + EndPos: 1160, + }, + Value: "foo", + }, Stmts: []node.Node{ &stmt.ClassConstList{ + Position: &position.Position{ + StartLine: 58, + EndLine: 58, + StartPos: 1163, + EndPos: 1185, + }, Consts: []node.Node{ &stmt.Constant{ + Position: &position.Position{ + StartLine: 58, + EndLine: 58, + StartPos: 1169, + EndPos: 1175, + }, PhpDocComment: "", - ConstantName: &node.Identifier{Value: "FOO"}, - Expr: &scalar.Lnumber{Value: "1"}, + ConstantName: &node.Identifier{ + Position: &position.Position{ + StartLine: 58, + EndLine: 58, + StartPos: 1169, + EndPos: 1171, + }, + Value: "FOO", + }, + Expr: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 58, + EndLine: 58, + StartPos: 1175, + EndPos: 1175, + }, + Value: "1", + }, }, &stmt.Constant{ + Position: &position.Position{ + StartLine: 58, + EndLine: 58, + StartPos: 1178, + EndPos: 1184, + }, PhpDocComment: "", - ConstantName: &node.Identifier{Value: "BAR"}, - Expr: &scalar.Lnumber{Value: "2"}, + ConstantName: &node.Identifier{ + Position: &position.Position{ + StartLine: 58, + EndLine: 58, + StartPos: 1178, + EndPos: 1180, + }, + Value: "BAR", + }, + Expr: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 58, + EndLine: 58, + StartPos: 1184, + EndPos: 1184, + }, + Value: "2", + }, }, }, }, }, }, &stmt.Class{ - ClassName: &node.Identifier{Value: "foo"}, + Position: &position.Position{ + StartLine: 59, + EndLine: 59, + StartPos: 1191, + EndPos: 1220, + }, + PhpDocComment: "", + ClassName: &node.Identifier{ + Position: &position.Position{ + StartLine: 59, + EndLine: 59, + StartPos: 1197, + EndPos: 1199, + }, + Value: "foo", + }, Stmts: []node.Node{ &stmt.ClassMethod{ + Position: &position.Position{ + StartLine: 59, + EndLine: 59, + StartPos: 1202, + EndPos: 1218, + }, + ReturnsRef: false, PhpDocComment: "", - MethodName: &node.Identifier{Value: "bar"}, + MethodName: &node.Identifier{ + Position: &position.Position{ + StartLine: 59, + EndLine: 59, + StartPos: 1211, + EndPos: 1213, + }, + Value: "bar", + }, Stmt: &stmt.StmtList{ - Stmts: []node.Node{}, + Position: &position.Position{ + StartLine: 59, + EndLine: 59, + StartPos: 1217, + EndPos: 1218, + }, + Stmts: []node.Node{ + }, }, }, }, }, &stmt.Class{ - ClassName: &node.Identifier{Value: "foo"}, + Position: &position.Position{ + StartLine: 60, + EndLine: 60, + StartPos: 1224, + EndPos: 1268, + }, + PhpDocComment: "", + ClassName: &node.Identifier{ + Position: &position.Position{ + StartLine: 60, + EndLine: 60, + StartPos: 1230, + EndPos: 1232, + }, + Value: "foo", + }, Stmts: []node.Node{ &stmt.ClassMethod{ + Position: &position.Position{ + StartLine: 60, + EndLine: 60, + StartPos: 1235, + EndPos: 1266, + }, + ReturnsRef: true, PhpDocComment: "", - ReturnsRef: true, - MethodName: &node.Identifier{Value: "bar"}, + MethodName: &node.Identifier{ + Position: &position.Position{ + StartLine: 60, + EndLine: 60, + StartPos: 1259, + EndPos: 1261, + }, + Value: "bar", + }, Modifiers: []node.Node{ - &node.Identifier{Value: "public"}, - &node.Identifier{Value: "static"}, + &node.Identifier{ + Position: &position.Position{ + StartLine: 60, + EndLine: 60, + StartPos: 1235, + EndPos: 1240, + }, + Value: "public", + }, + &node.Identifier{ + Position: &position.Position{ + StartLine: 60, + EndLine: 60, + StartPos: 1242, + EndPos: 1247, + }, + Value: "static", + }, }, Stmt: &stmt.StmtList{ - Stmts: []node.Node{}, + Position: &position.Position{ + StartLine: 60, + EndLine: 60, + StartPos: 1265, + EndPos: 1266, + }, + Stmts: []node.Node{ + }, }, }, }, }, &stmt.Class{ - ClassName: &node.Identifier{Value: "foo"}, + Position: &position.Position{ + StartLine: 61, + EndLine: 61, + StartPos: 1272, + EndPos: 1343, + }, + PhpDocComment: "", + ClassName: &node.Identifier{ + Position: &position.Position{ + StartLine: 61, + EndLine: 61, + StartPos: 1278, + EndPos: 1280, + }, + Value: "foo", + }, Stmts: []node.Node{ &stmt.ClassMethod{ + Position: &position.Position{ + StartLine: 61, + EndLine: 61, + StartPos: 1283, + EndPos: 1313, + }, + ReturnsRef: false, PhpDocComment: "", - ReturnsRef: false, - MethodName: &node.Identifier{Value: "bar"}, + MethodName: &node.Identifier{ + Position: &position.Position{ + StartLine: 61, + EndLine: 61, + StartPos: 1306, + EndPos: 1308, + }, + Value: "bar", + }, Modifiers: []node.Node{ - &node.Identifier{Value: "final"}, - &node.Identifier{Value: "private"}, + &node.Identifier{ + Position: &position.Position{ + StartLine: 61, + EndLine: 61, + StartPos: 1283, + EndPos: 1287, + }, + Value: "final", + }, + &node.Identifier{ + Position: &position.Position{ + StartLine: 61, + EndLine: 61, + StartPos: 1289, + EndPos: 1295, + }, + Value: "private", + }, }, Stmt: &stmt.StmtList{ - Stmts: []node.Node{}, + Position: &position.Position{ + StartLine: 61, + EndLine: 61, + StartPos: 1312, + EndPos: 1313, + }, + Stmts: []node.Node{ + }, }, }, &stmt.ClassMethod{ + Position: &position.Position{ + StartLine: 61, + EndLine: 61, + StartPos: 1315, + EndPos: 1341, + }, + ReturnsRef: false, PhpDocComment: "", - ReturnsRef: false, - MethodName: &node.Identifier{Value: "baz"}, + MethodName: &node.Identifier{ + Position: &position.Position{ + StartLine: 61, + EndLine: 61, + StartPos: 1334, + EndPos: 1336, + }, + Value: "baz", + }, Modifiers: []node.Node{ - &node.Identifier{Value: "protected"}, + &node.Identifier{ + Position: &position.Position{ + StartLine: 61, + EndLine: 61, + StartPos: 1315, + EndPos: 1323, + }, + Value: "protected", + }, }, Stmt: &stmt.StmtList{ - Stmts: []node.Node{}, + Position: &position.Position{ + StartLine: 61, + EndLine: 61, + StartPos: 1340, + EndPos: 1341, + }, + Stmts: []node.Node{ + }, }, }, }, }, &stmt.Class{ - ClassName: &node.Identifier{Value: "foo"}, + Position: &position.Position{ + StartLine: 62, + EndLine: 62, + StartPos: 1347, + EndPos: 1399, + }, + PhpDocComment: "", + ClassName: &node.Identifier{ + Position: &position.Position{ + StartLine: 62, + EndLine: 62, + StartPos: 1362, + EndPos: 1364, + }, + Value: "foo", + }, Modifiers: []node.Node{ - &node.Identifier{Value: "abstract"}, + &node.Identifier{ + Position: &position.Position{ + StartLine: 62, + EndLine: 62, + StartPos: 1347, + EndPos: 1354, + }, + Value: "abstract", + }, }, Stmts: []node.Node{ &stmt.ClassMethod{ - PhpDocComment: "", - ReturnsRef: false, - MethodName: &node.Identifier{Value: "bar"}, - Modifiers: []node.Node{ - &node.Identifier{Value: "abstract"}, - &node.Identifier{Value: "public"}, + Position: &position.Position{ + StartLine: 62, + EndLine: 62, + StartPos: 1367, + EndPos: 1397, + }, + ReturnsRef: false, + PhpDocComment: "", + MethodName: &node.Identifier{ + Position: &position.Position{ + StartLine: 62, + EndLine: 62, + StartPos: 1392, + EndPos: 1394, + }, + Value: "bar", + }, + Modifiers: []node.Node{ + &node.Identifier{ + Position: &position.Position{ + StartLine: 62, + EndLine: 62, + StartPos: 1367, + EndPos: 1374, + }, + Value: "abstract", + }, + &node.Identifier{ + Position: &position.Position{ + StartLine: 62, + EndLine: 62, + StartPos: 1376, + EndPos: 1381, + }, + Value: "public", + }, + }, + Stmt: &stmt.Nop{ + Position: &position.Position{ + StartLine: 62, + EndLine: 62, + StartPos: 1397, + EndPos: 1397, + }, }, - Stmt: &stmt.Nop{}, }, }, }, &stmt.Class{ - ClassName: &node.Identifier{Value: "foo"}, + Position: &position.Position{ + StartLine: 63, + EndLine: 63, + StartPos: 1403, + EndPos: 1433, + }, + PhpDocComment: "", + ClassName: &node.Identifier{ + Position: &position.Position{ + StartLine: 63, + EndLine: 63, + StartPos: 1415, + EndPos: 1417, + }, + Value: "foo", + }, Modifiers: []node.Node{ - &node.Identifier{Value: "final"}, + &node.Identifier{ + Position: &position.Position{ + StartLine: 63, + EndLine: 63, + StartPos: 1403, + EndPos: 1407, + }, + Value: "final", + }, }, Extends: &stmt.ClassExtends{ + Position: &position.Position{ + StartLine: 63, + EndLine: 63, + StartPos: 1419, + EndPos: 1429, + }, ClassName: &name.Name{ + Position: &position.Position{ + StartLine: 63, + EndLine: 63, + StartPos: 1427, + EndPos: 1429, + }, Parts: []node.Node{ - &name.NamePart{Value: "bar"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 63, + EndLine: 63, + StartPos: 1427, + EndPos: 1429, + }, + Value: "bar", + }, }, }, }, - Stmts: []node.Node{}, + Stmts: []node.Node{ + }, }, &stmt.Class{ - ClassName: &node.Identifier{Value: "foo"}, + Position: &position.Position{ + StartLine: 64, + EndLine: 64, + StartPos: 1437, + EndPos: 1470, + }, + PhpDocComment: "", + ClassName: &node.Identifier{ + Position: &position.Position{ + StartLine: 64, + EndLine: 64, + StartPos: 1449, + EndPos: 1451, + }, + Value: "foo", + }, Modifiers: []node.Node{ - &node.Identifier{Value: "final"}, + &node.Identifier{ + Position: &position.Position{ + StartLine: 64, + EndLine: 64, + StartPos: 1437, + EndPos: 1441, + }, + Value: "final", + }, }, Implements: &stmt.ClassImplements{ + Position: &position.Position{ + StartLine: 64, + EndLine: 64, + StartPos: 1453, + EndPos: 1466, + }, InterfaceNames: []node.Node{ &name.Name{ + Position: &position.Position{ + StartLine: 64, + EndLine: 64, + StartPos: 1464, + EndPos: 1466, + }, Parts: []node.Node{ - &name.NamePart{Value: "bar"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 64, + EndLine: 64, + StartPos: 1464, + EndPos: 1466, + }, + Value: "bar", + }, }, }, }, }, - Stmts: []node.Node{}, + Stmts: []node.Node{ + }, }, &stmt.Class{ - ClassName: &node.Identifier{Value: "foo"}, + Position: &position.Position{ + StartLine: 65, + EndLine: 65, + StartPos: 1474, + EndPos: 1512, + }, + PhpDocComment: "", + ClassName: &node.Identifier{ + Position: &position.Position{ + StartLine: 65, + EndLine: 65, + StartPos: 1486, + EndPos: 1488, + }, + Value: "foo", + }, Modifiers: []node.Node{ - &node.Identifier{Value: "final"}, + &node.Identifier{ + Position: &position.Position{ + StartLine: 65, + EndLine: 65, + StartPos: 1474, + EndPos: 1478, + }, + Value: "final", + }, }, Implements: &stmt.ClassImplements{ + Position: &position.Position{ + StartLine: 65, + EndLine: 65, + StartPos: 1490, + EndPos: 1508, + }, InterfaceNames: []node.Node{ &name.Name{ + Position: &position.Position{ + StartLine: 65, + EndLine: 65, + StartPos: 1501, + EndPos: 1503, + }, Parts: []node.Node{ - &name.NamePart{Value: "bar"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 65, + EndLine: 65, + StartPos: 1501, + EndPos: 1503, + }, + Value: "bar", + }, }, }, &name.Name{ + Position: &position.Position{ + StartLine: 65, + EndLine: 65, + StartPos: 1506, + EndPos: 1508, + }, Parts: []node.Node{ - &name.NamePart{Value: "baz"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 65, + EndLine: 65, + StartPos: 1506, + EndPos: 1508, + }, + Value: "baz", + }, }, }, }, }, - Stmts: []node.Node{}, + Stmts: []node.Node{ + }, }, &stmt.ConstList{ + Position: &position.Position{ + StartLine: 67, + EndLine: 67, + StartPos: 1517, + EndPos: 1539, + }, Consts: []node.Node{ &stmt.Constant{ + Position: &position.Position{ + StartLine: 67, + EndLine: 67, + StartPos: 1523, + EndPos: 1529, + }, PhpDocComment: "", - ConstantName: &node.Identifier{Value: "FOO"}, - Expr: &scalar.Lnumber{Value: "1"}, + ConstantName: &node.Identifier{ + Position: &position.Position{ + StartLine: 67, + EndLine: 67, + StartPos: 1523, + EndPos: 1525, + }, + Value: "FOO", + }, + Expr: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 67, + EndLine: 67, + StartPos: 1529, + EndPos: 1529, + }, + Value: "1", + }, }, &stmt.Constant{ + Position: &position.Position{ + StartLine: 67, + EndLine: 67, + StartPos: 1532, + EndPos: 1538, + }, PhpDocComment: "", - ConstantName: &node.Identifier{Value: "BAR"}, - Expr: &scalar.Lnumber{Value: "2"}, - }, - }, - }, - &stmt.While{ - Cond: &scalar.Lnumber{Value: "1"}, - Stmt: &stmt.StmtList{ - Stmts: []node.Node{ - &stmt.Continue{Expr: nil}, - }, - }, - }, - &stmt.While{ - Cond: &scalar.Lnumber{Value: "1"}, - Stmt: &stmt.StmtList{ - Stmts: []node.Node{ - &stmt.Continue{ - Expr: &scalar.Lnumber{Value: "2"}, + ConstantName: &node.Identifier{ + Position: &position.Position{ + StartLine: 67, + EndLine: 67, + StartPos: 1532, + EndPos: 1534, + }, + Value: "BAR", + }, + Expr: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 67, + EndLine: 67, + StartPos: 1538, + EndPos: 1538, + }, + Value: "2", }, }, }, }, &stmt.While{ - Cond: &scalar.Lnumber{Value: "1"}, + Position: &position.Position{ + StartLine: 68, + EndLine: 68, + StartPos: 1543, + EndPos: 1565, + }, + Cond: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 68, + EndLine: 68, + StartPos: 1550, + EndPos: 1550, + }, + Value: "1", + }, Stmt: &stmt.StmtList{ + Position: &position.Position{ + StartLine: 68, + EndLine: 68, + StartPos: 1553, + EndPos: 1565, + }, Stmts: []node.Node{ &stmt.Continue{ - Expr: &scalar.Lnumber{Value: "3"}, + Position: &position.Position{ + StartLine: 68, + EndLine: 68, + StartPos: 1555, + EndPos: 1563, + }, + }, + }, + }, + }, + &stmt.While{ + Position: &position.Position{ + StartLine: 69, + EndLine: 69, + StartPos: 1569, + EndPos: 1593, + }, + Cond: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 69, + EndLine: 69, + StartPos: 1576, + EndPos: 1576, + }, + Value: "1", + }, + Stmt: &stmt.StmtList{ + Position: &position.Position{ + StartLine: 69, + EndLine: 69, + StartPos: 1579, + EndPos: 1593, + }, + Stmts: []node.Node{ + &stmt.Continue{ + Position: &position.Position{ + StartLine: 69, + EndLine: 69, + StartPos: 1581, + EndPos: 1591, + }, + Expr: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 69, + EndLine: 69, + StartPos: 1590, + EndPos: 1590, + }, + Value: "2", + }, + }, + }, + }, + }, + &stmt.While{ + Position: &position.Position{ + StartLine: 70, + EndLine: 70, + StartPos: 1597, + EndPos: 1622, + }, + Cond: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 70, + EndLine: 70, + StartPos: 1604, + EndPos: 1604, + }, + Value: "1", + }, + Stmt: &stmt.StmtList{ + Position: &position.Position{ + StartLine: 70, + EndLine: 70, + StartPos: 1607, + EndPos: 1622, + }, + Stmts: []node.Node{ + &stmt.Continue{ + Position: &position.Position{ + StartLine: 70, + EndLine: 70, + StartPos: 1609, + EndPos: 1620, + }, + Expr: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 70, + EndLine: 70, + StartPos: 1618, + EndPos: 1618, + }, + Value: "3", + }, }, }, }, }, &stmt.Declare{ + Position: &position.Position{ + StartLine: 71, + EndLine: 71, + StartPos: 1626, + EndPos: 1642, + }, Consts: []node.Node{ &stmt.Constant{ + Position: &position.Position{ + StartLine: 71, + EndLine: 71, + StartPos: 1634, + EndPos: 1640, + }, PhpDocComment: "", - ConstantName: &node.Identifier{Value: "ticks"}, - Expr: &scalar.Lnumber{Value: "1"}, + ConstantName: &node.Identifier{ + Position: &position.Position{ + StartLine: 71, + EndLine: 71, + StartPos: 1634, + EndPos: 1638, + }, + Value: "ticks", + }, + Expr: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 71, + EndLine: 71, + StartPos: 1640, + EndPos: 1640, + }, + Value: "1", + }, }, }, - Stmt: &stmt.Nop{}, - }, - &stmt.Declare{ - Consts: []node.Node{ - &stmt.Constant{ - PhpDocComment: "", - ConstantName: &node.Identifier{Value: "ticks"}, - Expr: &scalar.Lnumber{Value: "1"}, + Stmt: &stmt.Nop{ + Position: &position.Position{ + StartLine: 71, + EndLine: 71, + StartPos: 1642, + EndPos: 1642, }, - &stmt.Constant{ - PhpDocComment: "", - ConstantName: &node.Identifier{Value: "strict_types"}, - Expr: &scalar.Lnumber{Value: "1"}, - }, - }, - Stmt: &stmt.StmtList{ - Stmts: []node.Node{}, }, }, &stmt.Declare{ + Position: &position.Position{ + StartLine: 72, + EndLine: 72, + StartPos: 1646, + EndPos: 1680, + }, Consts: []node.Node{ &stmt.Constant{ + Position: &position.Position{ + StartLine: 72, + EndLine: 72, + StartPos: 1654, + EndPos: 1660, + }, PhpDocComment: "", - ConstantName: &node.Identifier{Value: "ticks"}, - Expr: &scalar.Lnumber{Value: "1"}, + ConstantName: &node.Identifier{ + Position: &position.Position{ + StartLine: 72, + EndLine: 72, + StartPos: 1654, + EndPos: 1658, + }, + Value: "ticks", + }, + Expr: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 72, + EndLine: 72, + StartPos: 1660, + EndPos: 1660, + }, + Value: "1", + }, + }, + &stmt.Constant{ + Position: &position.Position{ + StartLine: 72, + EndLine: 72, + StartPos: 1663, + EndPos: 1676, + }, + PhpDocComment: "", + ConstantName: &node.Identifier{ + Position: &position.Position{ + StartLine: 72, + EndLine: 72, + StartPos: 1663, + EndPos: 1674, + }, + Value: "strict_types", + }, + Expr: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 72, + EndLine: 72, + StartPos: 1676, + EndPos: 1676, + }, + Value: "1", + }, }, }, Stmt: &stmt.StmtList{ - Stmts: []node.Node{}, + Position: &position.Position{ + StartLine: 72, + EndLine: 72, + StartPos: 1679, + EndPos: 1680, + }, + Stmts: []node.Node{ + }, + }, + }, + &stmt.Declare{ + Position: &position.Position{ + StartLine: 73, + EndLine: 73, + StartPos: 1684, + EndPos: 1712, + }, + Consts: []node.Node{ + &stmt.Constant{ + Position: &position.Position{ + StartLine: 73, + EndLine: 73, + StartPos: 1692, + EndPos: 1698, + }, + PhpDocComment: "", + ConstantName: &node.Identifier{ + Position: &position.Position{ + StartLine: 73, + EndLine: 73, + StartPos: 1692, + EndPos: 1696, + }, + Value: "ticks", + }, + Expr: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 73, + EndLine: 73, + StartPos: 1698, + EndPos: 1698, + }, + Value: "1", + }, + }, + }, + Stmt: &stmt.StmtList{ + Position: &position.Position{ + StartLine: 73, + EndLine: 73, + StartPos: 1700, + EndPos: 1712, + }, + Stmts: []node.Node{ + }, }, }, &stmt.Do{ + Position: &position.Position{ + StartLine: 74, + EndLine: 74, + StartPos: 1716, + EndPos: 1730, + }, Stmt: &stmt.StmtList{ - Stmts: []node.Node{}, - }, - Cond: &scalar.Lnumber{Value: "1"}, - }, - &stmt.Echo{ - Exprs: []node.Node{ - &expr.Variable{ - VarName: &node.Identifier{Value: "a"}, + Position: &position.Position{ + StartLine: 74, + EndLine: 74, + StartPos: 1719, + EndPos: 1720, }, - &scalar.Lnumber{Value: "1"}, + Stmts: []node.Node{ + }, + }, + Cond: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 74, + EndLine: 74, + StartPos: 1728, + EndPos: 1728, + }, + Value: "1", }, }, &stmt.Echo{ + Position: &position.Position{ + StartLine: 75, + EndLine: 75, + StartPos: 1734, + EndPos: 1744, + }, Exprs: []node.Node{ &expr.Variable{ - VarName: &node.Identifier{Value: "a"}, + Position: &position.Position{ + StartLine: 75, + EndLine: 75, + StartPos: 1739, + EndPos: 1740, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 75, + EndLine: 75, + StartPos: 1739, + EndPos: 1740, + }, + Value: "a", + }, + }, + &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 75, + EndLine: 75, + StartPos: 1743, + EndPos: 1743, + }, + Value: "1", + }, + }, + }, + &stmt.Echo{ + Position: &position.Position{ + StartLine: 76, + EndLine: 76, + StartPos: 1748, + EndPos: 1756, + }, + Exprs: []node.Node{ + &expr.Variable{ + Position: &position.Position{ + StartLine: 76, + EndLine: 76, + StartPos: 1753, + EndPos: 1754, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 76, + EndLine: 76, + StartPos: 1753, + EndPos: 1754, + }, + Value: "a", + }, }, }, }, &stmt.For{ + Position: &position.Position{ + StartLine: 77, + EndLine: 77, + StartPos: 1760, + EndPos: 1794, + }, Init: []node.Node{ &assign.Assign{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "i"}}, - Expression: &scalar.Lnumber{Value: "0"}, - }, - }, - Cond: []node.Node{ - &binary.Smaller{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "i"}}, - Right: &scalar.Lnumber{Value: "10"}, - }, - }, - Loop: []node.Node{ - &expr.PostInc{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "i"}}, - }, - &expr.PostInc{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "i"}}, - }, - }, - Stmt: &stmt.StmtList{Stmts: []node.Node{}}, - }, - &stmt.AltFor{ - Cond: []node.Node{ - &binary.Smaller{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "i"}}, - Right: &scalar.Lnumber{Value: "10"}, - }, - }, - Loop: []node.Node{ - &expr.PostInc{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "i"}}, - }, - }, - Stmt: &stmt.StmtList{Stmts: []node.Node{}}, - }, - &stmt.Foreach{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "v"}}, - Stmt: &stmt.StmtList{Stmts: []node.Node{}}, - }, - &stmt.Foreach{ - Expr: &expr.ShortArray{Items: []node.Node{}}, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "v"}}, - Stmt: &stmt.StmtList{Stmts: []node.Node{}}, - }, - &stmt.AltForeach{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "v"}}, - Stmt: &stmt.StmtList{Stmts: []node.Node{}}, - }, - &stmt.Foreach{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Key: &expr.Variable{VarName: &node.Identifier{Value: "k"}}, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "v"}}, - Stmt: &stmt.StmtList{Stmts: []node.Node{}}, - }, - &stmt.Foreach{ - Expr: &expr.ShortArray{Items: []node.Node{}}, - Key: &expr.Variable{VarName: &node.Identifier{Value: "k"}}, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "v"}}, - Stmt: &stmt.StmtList{Stmts: []node.Node{}}, - }, - &stmt.Foreach{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Key: &expr.Variable{VarName: &node.Identifier{Value: "k"}}, - Variable: &expr.Reference{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "v"}}, - }, - Stmt: &stmt.StmtList{Stmts: []node.Node{}}, - }, - &stmt.Foreach{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Key: &expr.Variable{VarName: &node.Identifier{Value: "k"}}, - Variable: &expr.List{ - Items: []node.Node{ - &expr.ArrayItem{ - Val: &expr.Variable{VarName: &node.Identifier{Value: "v"}}, + Position: &position.Position{ + StartLine: 77, + EndLine: 77, + StartPos: 1764, + EndPos: 1769, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 77, + EndLine: 77, + StartPos: 1764, + EndPos: 1765, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 77, + EndLine: 77, + StartPos: 1764, + EndPos: 1765, + }, + Value: "i", + }, + }, + Expression: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 77, + EndLine: 77, + StartPos: 1769, + EndPos: 1769, + }, + Value: "0", }, }, }, - Stmt: &stmt.StmtList{Stmts: []node.Node{}}, - }, - &stmt.Function{ - ReturnsRef: false, - PhpDocComment: "", - FunctionName: &node.Identifier{Value: "foo"}, - Stmts: []node.Node{}, - }, - &stmt.Function{ - ReturnsRef: false, - PhpDocComment: "", - FunctionName: &node.Identifier{Value: "foo"}, - Stmts: []node.Node{ - &stmt.HaltCompiler{}, - &stmt.Function{ - ReturnsRef: false, - PhpDocComment: "", - FunctionName: &node.Identifier{Value: "bar"}, - Stmts: []node.Node{}, + Cond: []node.Node{ + &binary.Smaller{ + Position: &position.Position{ + StartLine: 77, + EndLine: 77, + StartPos: 1772, + EndPos: 1778, + }, + Left: &expr.Variable{ + Position: &position.Position{ + StartLine: 77, + EndLine: 77, + StartPos: 1772, + EndPos: 1773, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 77, + EndLine: 77, + StartPos: 1772, + EndPos: 1773, + }, + Value: "i", + }, + }, + Right: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 77, + EndLine: 77, + StartPos: 1777, + EndPos: 1778, + }, + Value: "10", + }, }, - &stmt.Class{ - PhpDocComment: "", - ClassName: &node.Identifier{Value: "Baz"}, - Stmts: []node.Node{}, + }, + Loop: []node.Node{ + &expr.PostInc{ + Position: &position.Position{ + StartLine: 77, + EndLine: 77, + StartPos: 1781, + EndPos: 1784, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 77, + EndLine: 77, + StartPos: 1781, + EndPos: 1782, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 77, + EndLine: 77, + StartPos: 1781, + EndPos: 1782, + }, + Value: "i", + }, + }, }, - &stmt.Return{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + &expr.PostInc{ + Position: &position.Position{ + StartLine: 77, + EndLine: 77, + StartPos: 1787, + EndPos: 1790, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 77, + EndLine: 77, + StartPos: 1787, + EndPos: 1788, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 77, + EndLine: 77, + StartPos: 1787, + EndPos: 1788, + }, + Value: "i", + }, + }, + }, + }, + Stmt: &stmt.StmtList{ + Position: &position.Position{ + StartLine: 77, + EndLine: 77, + StartPos: 1793, + EndPos: 1794, + }, + Stmts: []node.Node{ }, }, }, - &stmt.Function{ - ReturnsRef: false, - PhpDocComment: "", - FunctionName: &node.Identifier{Value: "foo"}, - Params: []node.Node{ - &node.Parameter{ - ByRef: false, - Variadic: false, - VariableType: &node.Identifier{Value: "array"}, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - }, - &node.Parameter{ - ByRef: false, - Variadic: false, - VariableType: &node.Identifier{Value: "callable"}, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + &stmt.AltFor{ + Position: &position.Position{ + StartLine: 78, + EndLine: 78, + StartPos: 1798, + EndPos: 1827, + }, + Cond: []node.Node{ + &binary.Smaller{ + Position: &position.Position{ + StartLine: 78, + EndLine: 78, + StartPos: 1804, + EndPos: 1810, + }, + Left: &expr.Variable{ + Position: &position.Position{ + StartLine: 78, + EndLine: 78, + StartPos: 1804, + EndPos: 1805, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 78, + EndLine: 78, + StartPos: 1804, + EndPos: 1805, + }, + Value: "i", + }, + }, + Right: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 78, + EndLine: 78, + StartPos: 1809, + EndPos: 1810, + }, + Value: "10", + }, }, }, - Stmts: []node.Node{ - &stmt.Return{}, + Loop: []node.Node{ + &expr.PostInc{ + Position: &position.Position{ + StartLine: 78, + EndLine: 78, + StartPos: 1813, + EndPos: 1816, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 78, + EndLine: 78, + StartPos: 1813, + EndPos: 1814, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 78, + EndLine: 78, + StartPos: 1813, + EndPos: 1814, + }, + Value: "i", + }, + }, + }, }, - }, - &stmt.Function{ - ReturnsRef: true, - PhpDocComment: "", - FunctionName: &node.Identifier{Value: "foo"}, - Stmts: []node.Node{ - &stmt.Return{ - Expr: &scalar.Lnumber{Value: "1"}, + Stmt: &stmt.StmtList{ + Position: &position.Position{ + StartLine: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, + }, + Stmts: []node.Node{ }, }, }, - &stmt.Function{ - ReturnsRef: true, - PhpDocComment: "", - FunctionName: &node.Identifier{Value: "foo"}, - Stmts: []node.Node{}, + &stmt.Foreach{ + Position: &position.Position{ + StartLine: 79, + EndLine: 79, + StartPos: 1831, + EndPos: 1851, + }, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 79, + EndLine: 79, + StartPos: 1840, + EndPos: 1841, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 79, + EndLine: 79, + StartPos: 1840, + EndPos: 1841, + }, + Value: "a", + }, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 79, + EndLine: 79, + StartPos: 1846, + EndPos: 1847, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 79, + EndLine: 79, + StartPos: 1846, + EndPos: 1847, + }, + Value: "v", + }, + }, + Stmt: &stmt.StmtList{ + Position: &position.Position{ + StartLine: 79, + EndLine: 79, + StartPos: 1850, + EndPos: 1851, + }, + Stmts: []node.Node{ + }, + }, }, - &stmt.Global{ - Vars: []node.Node{ - &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - &expr.Variable{VarName: &expr.Variable{VarName: &node.Identifier{Value: "c"}}}, - &expr.Variable{ - VarName: &expr.FunctionCall{ - Function: &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "foo"}, + &stmt.Foreach{ + Position: &position.Position{ + StartLine: 80, + EndLine: 80, + StartPos: 1855, + EndPos: 1875, + }, + Expr: &expr.ShortArray{ + Position: &position.Position{ + StartLine: 80, + EndLine: 80, + StartPos: 1864, + EndPos: 1865, + }, + Items: []node.Node{ + }, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 80, + EndLine: 80, + StartPos: 1870, + EndPos: 1871, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 80, + EndLine: 80, + StartPos: 1870, + EndPos: 1871, + }, + Value: "v", + }, + }, + Stmt: &stmt.StmtList{ + Position: &position.Position{ + StartLine: 80, + EndLine: 80, + StartPos: 1874, + EndPos: 1875, + }, + Stmts: []node.Node{ + }, + }, + }, + &stmt.AltForeach{ + Position: &position.Position{ + StartLine: 81, + EndLine: 81, + StartPos: 1879, + EndPos: 1910, + }, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 81, + EndLine: 81, + StartPos: 1888, + EndPos: 1889, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 81, + EndLine: 81, + StartPos: 1888, + EndPos: 1889, + }, + Value: "a", + }, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 81, + EndLine: 81, + StartPos: 1894, + EndPos: 1895, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 81, + EndLine: 81, + StartPos: 1894, + EndPos: 1895, + }, + Value: "v", + }, + }, + Stmt: &stmt.StmtList{ + Position: &position.Position{ + StartLine: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, + }, + Stmts: []node.Node{ + }, + }, + }, + &stmt.Foreach{ + Position: &position.Position{ + StartLine: 82, + EndLine: 82, + StartPos: 1914, + EndPos: 1940, + }, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 82, + EndLine: 82, + StartPos: 1923, + EndPos: 1924, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 82, + EndLine: 82, + StartPos: 1923, + EndPos: 1924, + }, + Value: "a", + }, + }, + Key: &expr.Variable{ + Position: &position.Position{ + StartLine: 82, + EndLine: 82, + StartPos: 1929, + EndPos: 1930, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 82, + EndLine: 82, + StartPos: 1929, + EndPos: 1930, + }, + Value: "k", + }, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 82, + EndLine: 82, + StartPos: 1935, + EndPos: 1936, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 82, + EndLine: 82, + StartPos: 1935, + EndPos: 1936, + }, + Value: "v", + }, + }, + Stmt: &stmt.StmtList{ + Position: &position.Position{ + StartLine: 82, + EndLine: 82, + StartPos: 1939, + EndPos: 1940, + }, + Stmts: []node.Node{ + }, + }, + }, + &stmt.Foreach{ + Position: &position.Position{ + StartLine: 83, + EndLine: 83, + StartPos: 1944, + EndPos: 1970, + }, + Expr: &expr.ShortArray{ + Position: &position.Position{ + StartLine: 83, + EndLine: 83, + StartPos: 1953, + EndPos: 1954, + }, + Items: []node.Node{ + }, + }, + Key: &expr.Variable{ + Position: &position.Position{ + StartLine: 83, + EndLine: 83, + StartPos: 1959, + EndPos: 1960, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 83, + EndLine: 83, + StartPos: 1959, + EndPos: 1960, + }, + Value: "k", + }, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 83, + EndLine: 83, + StartPos: 1965, + EndPos: 1966, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 83, + EndLine: 83, + StartPos: 1965, + EndPos: 1966, + }, + Value: "v", + }, + }, + Stmt: &stmt.StmtList{ + Position: &position.Position{ + StartLine: 83, + EndLine: 83, + StartPos: 1969, + EndPos: 1970, + }, + Stmts: []node.Node{ + }, + }, + }, + &stmt.Foreach{ + Position: &position.Position{ + StartLine: 84, + EndLine: 84, + StartPos: 1974, + EndPos: 2001, + }, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 84, + EndLine: 84, + StartPos: 1983, + EndPos: 1984, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 84, + EndLine: 84, + StartPos: 1983, + EndPos: 1984, + }, + Value: "a", + }, + }, + Key: &expr.Variable{ + Position: &position.Position{ + StartLine: 84, + EndLine: 84, + StartPos: 1989, + EndPos: 1990, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 84, + EndLine: 84, + StartPos: 1989, + EndPos: 1990, + }, + Value: "k", + }, + }, + Variable: &expr.Reference{ + Position: &position.Position{ + StartLine: 84, + EndLine: 84, + StartPos: 1995, + EndPos: 1997, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 84, + EndLine: 84, + StartPos: 1996, + EndPos: 1997, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 84, + EndLine: 84, + StartPos: 1996, + EndPos: 1997, + }, + Value: "v", + }, + }, + }, + Stmt: &stmt.StmtList{ + Position: &position.Position{ + StartLine: 84, + EndLine: 84, + StartPos: 2000, + EndPos: 2001, + }, + Stmts: []node.Node{ + }, + }, + }, + &stmt.Foreach{ + Position: &position.Position{ + StartLine: 85, + EndLine: 85, + StartPos: 2005, + EndPos: 2037, + }, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 85, + EndLine: 85, + StartPos: 2014, + EndPos: 2015, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 85, + EndLine: 85, + StartPos: 2014, + EndPos: 2015, + }, + Value: "a", + }, + }, + Key: &expr.Variable{ + Position: &position.Position{ + StartLine: 85, + EndLine: 85, + StartPos: 2020, + EndPos: 2021, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 85, + EndLine: 85, + StartPos: 2020, + EndPos: 2021, + }, + Value: "k", + }, + }, + Variable: &expr.List{ + Position: &position.Position{ + StartLine: 85, + EndLine: 85, + StartPos: 2026, + EndPos: 2033, + }, + Items: []node.Node{ + &expr.ArrayItem{ + Position: &position.Position{ + StartLine: 85, + EndLine: 85, + StartPos: 2031, + EndPos: 2032, + }, + Val: &expr.Variable{ + Position: &position.Position{ + StartLine: 85, + EndLine: 85, + StartPos: 2031, + EndPos: 2032, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 85, + EndLine: 85, + StartPos: 2031, + EndPos: 2032, + }, + Value: "v", + }, + }, + }, + }, + }, + Stmt: &stmt.StmtList{ + Position: &position.Position{ + StartLine: 85, + EndLine: 85, + StartPos: 2036, + EndPos: 2037, + }, + Stmts: []node.Node{ + }, + }, + }, + &stmt.Function{ + Position: &position.Position{ + StartLine: 86, + EndLine: 86, + StartPos: 2041, + EndPos: 2057, + }, + ReturnsRef: false, + PhpDocComment: "", + FunctionName: &node.Identifier{ + Position: &position.Position{ + StartLine: 86, + EndLine: 86, + StartPos: 2050, + EndPos: 2052, + }, + Value: "foo", + }, + Stmts: []node.Node{ + }, + }, + &stmt.Function{ + Position: &position.Position{ + StartLine: 88, + EndLine: 93, + StartPos: 2062, + EndPos: 2154, + }, + ReturnsRef: false, + PhpDocComment: "", + FunctionName: &node.Identifier{ + Position: &position.Position{ + StartLine: 88, + EndLine: 88, + StartPos: 2071, + EndPos: 2073, + }, + Value: "foo", + }, + Stmts: []node.Node{ + &stmt.HaltCompiler{ + Position: &position.Position{ + StartLine: 89, + EndLine: 89, + StartPos: 2082, + EndPos: 2099, + }, + }, + &stmt.Function{ + Position: &position.Position{ + StartLine: 90, + EndLine: 90, + StartPos: 2104, + EndPos: 2120, + }, + ReturnsRef: false, + PhpDocComment: "", + FunctionName: &node.Identifier{ + Position: &position.Position{ + StartLine: 90, + EndLine: 90, + StartPos: 2113, + EndPos: 2115, + }, + Value: "bar", + }, + Stmts: []node.Node{ + }, + }, + &stmt.Class{ + Position: &position.Position{ + StartLine: 91, + EndLine: 91, + StartPos: 2125, + EndPos: 2136, + }, + PhpDocComment: "", + ClassName: &node.Identifier{ + Position: &position.Position{ + StartLine: 91, + EndLine: 91, + StartPos: 2131, + EndPos: 2133, + }, + Value: "Baz", + }, + Stmts: []node.Node{ + }, + }, + &stmt.Return{ + Position: &position.Position{ + StartLine: 92, + EndLine: 92, + StartPos: 2141, + EndPos: 2150, + }, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 92, + EndLine: 92, + StartPos: 2148, + EndPos: 2149, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 92, + EndLine: 92, + StartPos: 2148, + EndPos: 2149, + }, + Value: "a", + }, + }, + }, + }, + }, + &stmt.Function{ + Position: &position.Position{ + StartLine: 95, + EndLine: 95, + StartPos: 2161, + EndPos: 2205, + }, + PhpDocComment: "", + ReturnsRef: false, + FunctionName: &node.Identifier{ + Position: &position.Position{ + StartLine: 95, + EndLine: 95, + StartPos: 2170, + EndPos: 2172, + }, + Value: "foo", + }, + Params: []node.Node{ + &node.Parameter{ + Position: &position.Position{ + StartLine: 95, + EndLine: 95, + StartPos: 2174, + EndPos: 2181, + }, + ByRef: false, + Variadic: false, + VariableType: &node.Identifier{ + Position: &position.Position{ + StartLine: 95, + EndLine: 95, + StartPos: 2174, + EndPos: 2178, + }, + Value: "array", + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 95, + EndLine: 95, + StartPos: 2180, + EndPos: 2181, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 95, + EndLine: 95, + StartPos: 2180, + EndPos: 2181, + }, + Value: "a", + }, + }, + }, + &node.Parameter{ + Position: &position.Position{ + StartLine: 95, + EndLine: 95, + StartPos: 2184, + EndPos: 2194, + }, + ByRef: false, + Variadic: false, + VariableType: &node.Identifier{ + Position: &position.Position{ + StartLine: 95, + EndLine: 95, + StartPos: 2184, + EndPos: 2191, + }, + Value: "callable", + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 95, + EndLine: 95, + StartPos: 2193, + EndPos: 2194, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 95, + EndLine: 95, + StartPos: 2193, + EndPos: 2194, + }, + Value: "b", + }, + }, + }, + }, + Stmts: []node.Node{ + &stmt.Return{ + Position: &position.Position{ + StartLine: 95, + EndLine: 95, + StartPos: 2198, + EndPos: 2204, + }, + }, + }, + }, + &stmt.Function{ + Position: &position.Position{ + StartLine: 96, + EndLine: 96, + StartPos: 2209, + EndPos: 2235, + }, + ReturnsRef: true, + PhpDocComment: "", + FunctionName: &node.Identifier{ + Position: &position.Position{ + StartLine: 96, + EndLine: 96, + StartPos: 2219, + EndPos: 2221, + }, + Value: "foo", + }, + Stmts: []node.Node{ + &stmt.Return{ + Position: &position.Position{ + StartLine: 96, + EndLine: 96, + StartPos: 2226, + EndPos: 2234, + }, + Expr: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 96, + EndLine: 96, + StartPos: 2233, + EndPos: 2233, + }, + Value: "1", + }, + }, + }, + }, + &stmt.Function{ + Position: &position.Position{ + StartLine: 97, + EndLine: 97, + StartPos: 2239, + EndPos: 2256, + }, + ReturnsRef: true, + PhpDocComment: "", + FunctionName: &node.Identifier{ + Position: &position.Position{ + StartLine: 97, + EndLine: 97, + StartPos: 2249, + EndPos: 2251, + }, + Value: "foo", + }, + Stmts: []node.Node{ + }, + }, + &stmt.Global{ + Position: &position.Position{ + StartLine: 98, + EndLine: 98, + StartPos: 2260, + EndPos: 2288, + }, + Vars: []node.Node{ + &expr.Variable{ + Position: &position.Position{ + StartLine: 98, + EndLine: 98, + StartPos: 2267, + EndPos: 2268, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 98, + EndLine: 98, + StartPos: 2267, + EndPos: 2268, + }, + Value: "a", + }, + }, + &expr.Variable{ + Position: &position.Position{ + StartLine: 98, + EndLine: 98, + StartPos: 2271, + EndPos: 2272, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 98, + EndLine: 98, + StartPos: 2271, + EndPos: 2272, + }, + Value: "b", + }, + }, + &expr.Variable{ + Position: &position.Position{ + StartLine: 98, + EndLine: 98, + StartPos: 2275, + EndPos: 2277, + }, + VarName: &expr.Variable{ + Position: &position.Position{ + StartLine: 98, + EndLine: 98, + StartPos: 2276, + EndPos: 2277, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 98, + EndLine: 98, + StartPos: 2276, + EndPos: 2277, + }, + Value: "c", + }, + }, + }, + &expr.Variable{ + Position: &position.Position{ + StartLine: 98, + EndLine: 98, + StartPos: 2280, + EndPos: 2287, + }, + VarName: &expr.FunctionCall{ + Position: &position.Position{ + StartLine: 98, + EndLine: 98, + StartPos: 2282, + EndPos: 2286, + }, + Function: &name.Name{ + Position: &position.Position{ + StartLine: 98, + EndLine: 98, + StartPos: 2282, + EndPos: 2284, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 98, + EndLine: 98, + StartPos: 2282, + EndPos: 2284, + }, + Value: "foo", + }, + }, + }, + ArgumentList: &node.ArgumentList{ + Position: &position.Position{ + StartLine: 98, + EndLine: 98, + StartPos: 2285, + EndPos: 2286, }, }, - ArgumentList: &node.ArgumentList{}, }, }, }, }, &stmt.Label{ - LabelName: &node.Identifier{Value: "a"}, + Position: &position.Position{ + StartLine: 99, + EndLine: 99, + StartPos: 2292, + EndPos: 2293, + }, + LabelName: &node.Identifier{ + Position: &position.Position{ + StartLine: 99, + EndLine: 99, + StartPos: 2292, + EndPos: 2292, + }, + Value: "a", + }, }, &stmt.Goto{ - Label: &node.Identifier{Value: "a"}, + Position: &position.Position{ + StartLine: 100, + EndLine: 100, + StartPos: 2298, + EndPos: 2304, + }, + Label: &node.Identifier{ + Position: &position.Position{ + StartLine: 100, + EndLine: 100, + StartPos: 2303, + EndPos: 2303, + }, + Value: "a", + }, }, - &stmt.HaltCompiler{}, - &stmt.If{ - Cond: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Stmt: &stmt.StmtList{Stmts: []node.Node{}}, + &stmt.HaltCompiler{ + Position: &position.Position{ + StartLine: 101, + EndLine: 101, + StartPos: 2308, + EndPos: 2325, + }, }, &stmt.If{ - Cond: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Stmt: &stmt.StmtList{Stmts: []node.Node{}}, - ElseIf: []node.Node{ - &stmt.ElseIf{ - Cond: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - Stmt: &stmt.StmtList{Stmts: []node.Node{}}, + Position: &position.Position{ + StartLine: 102, + EndLine: 102, + StartPos: 2329, + EndPos: 2338, + }, + Cond: &expr.Variable{ + Position: &position.Position{ + StartLine: 102, + EndLine: 102, + StartPos: 2333, + EndPos: 2334, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 102, + EndLine: 102, + StartPos: 2333, + EndPos: 2334, + }, + Value: "a", + }, + }, + Stmt: &stmt.StmtList{ + Position: &position.Position{ + StartLine: 102, + EndLine: 102, + StartPos: 2337, + EndPos: 2338, + }, + Stmts: []node.Node{ }, }, }, &stmt.If{ - Cond: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Stmt: &stmt.StmtList{Stmts: []node.Node{}}, - Else: &stmt.Else{ - Stmt: &stmt.StmtList{Stmts: []node.Node{}}, + Position: &position.Position{ + StartLine: 103, + EndLine: 103, + StartPos: 2342, + EndPos: 2366, + }, + Cond: &expr.Variable{ + Position: &position.Position{ + StartLine: 103, + EndLine: 103, + StartPos: 2346, + EndPos: 2347, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 103, + EndLine: 103, + StartPos: 2346, + EndPos: 2347, + }, + Value: "a", + }, + }, + Stmt: &stmt.StmtList{ + Position: &position.Position{ + StartLine: 103, + EndLine: 103, + StartPos: 2350, + EndPos: 2351, + }, + Stmts: []node.Node{ + }, + }, + ElseIf: []node.Node{ + &stmt.ElseIf{ + Position: &position.Position{ + StartLine: 103, + EndLine: 103, + StartPos: 2353, + EndPos: 2366, + }, + Cond: &expr.Variable{ + Position: &position.Position{ + StartLine: 103, + EndLine: 103, + StartPos: 2361, + EndPos: 2362, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 103, + EndLine: 103, + StartPos: 2361, + EndPos: 2362, + }, + Value: "b", + }, + }, + Stmt: &stmt.StmtList{ + Position: &position.Position{ + StartLine: 103, + EndLine: 103, + StartPos: 2365, + EndPos: 2366, + }, + Stmts: []node.Node{ + }, + }, + }, }, }, &stmt.If{ - Cond: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Stmt: &stmt.StmtList{Stmts: []node.Node{}}, - ElseIf: []node.Node{ - &stmt.ElseIf{ - Cond: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - Stmt: &stmt.StmtList{Stmts: []node.Node{}}, + Position: &position.Position{ + StartLine: 104, + EndLine: 104, + StartPos: 2370, + EndPos: 2387, + }, + Cond: &expr.Variable{ + Position: &position.Position{ + StartLine: 104, + EndLine: 104, + StartPos: 2374, + EndPos: 2375, }, - &stmt.ElseIf{ - Cond: &expr.Variable{VarName: &node.Identifier{Value: "c"}}, - Stmt: &stmt.StmtList{Stmts: []node.Node{}}, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 104, + EndLine: 104, + StartPos: 2374, + EndPos: 2375, + }, + Value: "a", + }, + }, + Stmt: &stmt.StmtList{ + Position: &position.Position{ + StartLine: 104, + EndLine: 104, + StartPos: 2378, + EndPos: 2379, + }, + Stmts: []node.Node{ }, }, Else: &stmt.Else{ - Stmt: &stmt.StmtList{Stmts: []node.Node{}}, + Position: &position.Position{ + StartLine: 104, + EndLine: 104, + StartPos: 2381, + EndPos: 2387, + }, + Stmt: &stmt.StmtList{ + Position: &position.Position{ + StartLine: 104, + EndLine: 104, + StartPos: 2386, + EndPos: 2387, + }, + Stmts: []node.Node{ + }, + }, }, }, &stmt.If{ - Cond: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Stmt: &stmt.StmtList{Stmts: []node.Node{}}, + Position: &position.Position{ + StartLine: 105, + EndLine: 105, + StartPos: 2391, + EndPos: 2438, + }, + Cond: &expr.Variable{ + Position: &position.Position{ + StartLine: 105, + EndLine: 105, + StartPos: 2395, + EndPos: 2396, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 105, + EndLine: 105, + StartPos: 2395, + EndPos: 2396, + }, + Value: "a", + }, + }, + Stmt: &stmt.StmtList{ + Position: &position.Position{ + StartLine: 105, + EndLine: 105, + StartPos: 2399, + EndPos: 2400, + }, + Stmts: []node.Node{ + }, + }, ElseIf: []node.Node{ &stmt.ElseIf{ - Cond: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - Stmt: &stmt.StmtList{Stmts: []node.Node{}}, + Position: &position.Position{ + StartLine: 105, + EndLine: 105, + StartPos: 2402, + EndPos: 2415, + }, + Cond: &expr.Variable{ + Position: &position.Position{ + StartLine: 105, + EndLine: 105, + StartPos: 2410, + EndPos: 2411, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 105, + EndLine: 105, + StartPos: 2410, + EndPos: 2411, + }, + Value: "b", + }, + }, + Stmt: &stmt.StmtList{ + Position: &position.Position{ + StartLine: 105, + EndLine: 105, + StartPos: 2414, + EndPos: 2415, + }, + Stmts: []node.Node{ + }, + }, + }, + &stmt.ElseIf{ + Position: &position.Position{ + StartLine: 105, + EndLine: 105, + StartPos: 2417, + EndPos: 2430, + }, + Cond: &expr.Variable{ + Position: &position.Position{ + StartLine: 105, + EndLine: 105, + StartPos: 2425, + EndPos: 2426, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 105, + EndLine: 105, + StartPos: 2425, + EndPos: 2426, + }, + Value: "c", + }, + }, + Stmt: &stmt.StmtList{ + Position: &position.Position{ + StartLine: 105, + EndLine: 105, + StartPos: 2429, + EndPos: 2430, + }, + Stmts: []node.Node{ + }, + }, }, }, Else: &stmt.Else{ + Position: &position.Position{ + StartLine: 105, + EndLine: 105, + StartPos: 2432, + EndPos: 2438, + }, + Stmt: &stmt.StmtList{ + Position: &position.Position{ + StartLine: 105, + EndLine: 105, + StartPos: 2437, + EndPos: 2438, + }, + Stmts: []node.Node{ + }, + }, + }, + }, + &stmt.If{ + Position: &position.Position{ + StartLine: 106, + EndLine: 106, + StartPos: 2442, + EndPos: 2490, + }, + Cond: &expr.Variable{ + Position: &position.Position{ + StartLine: 106, + EndLine: 106, + StartPos: 2446, + EndPos: 2447, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 106, + EndLine: 106, + StartPos: 2446, + EndPos: 2447, + }, + Value: "a", + }, + }, + Stmt: &stmt.StmtList{ + Position: &position.Position{ + StartLine: 106, + EndLine: 106, + StartPos: 2450, + EndPos: 2451, + }, + Stmts: []node.Node{ + }, + }, + ElseIf: []node.Node{ + &stmt.ElseIf{ + Position: &position.Position{ + StartLine: 106, + EndLine: 106, + StartPos: 2453, + EndPos: 2466, + }, + Cond: &expr.Variable{ + Position: &position.Position{ + StartLine: 106, + EndLine: 106, + StartPos: 2461, + EndPos: 2462, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 106, + EndLine: 106, + StartPos: 2461, + EndPos: 2462, + }, + Value: "b", + }, + }, + Stmt: &stmt.StmtList{ + Position: &position.Position{ + StartLine: 106, + EndLine: 106, + StartPos: 2465, + EndPos: 2466, + }, + Stmts: []node.Node{ + }, + }, + }, + }, + Else: &stmt.Else{ + Position: &position.Position{ + StartLine: 106, + EndLine: 106, + StartPos: 2468, + EndPos: 2490, + }, Stmt: &stmt.If{ - Cond: &expr.Variable{VarName: &node.Identifier{Value: "c"}}, - Stmt: &stmt.StmtList{Stmts: []node.Node{}}, + Position: &position.Position{ + StartLine: 106, + EndLine: 106, + StartPos: 2473, + EndPos: 2490, + }, + Cond: &expr.Variable{ + Position: &position.Position{ + StartLine: 106, + EndLine: 106, + StartPos: 2477, + EndPos: 2478, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 106, + EndLine: 106, + StartPos: 2477, + EndPos: 2478, + }, + Value: "c", + }, + }, + Stmt: &stmt.StmtList{ + Position: &position.Position{ + StartLine: 106, + EndLine: 106, + StartPos: 2481, + EndPos: 2482, + }, + Stmts: []node.Node{ + }, + }, Else: &stmt.Else{ - Stmt: &stmt.StmtList{Stmts: []node.Node{}}, + Position: &position.Position{ + StartLine: 106, + EndLine: 106, + StartPos: 2484, + EndPos: 2490, + }, + Stmt: &stmt.StmtList{ + Position: &position.Position{ + StartLine: 106, + EndLine: 106, + StartPos: 2489, + EndPos: 2490, + }, + Stmts: []node.Node{ + }, + }, }, }, }, }, - &stmt.Nop{}, - &stmt.InlineHtml{Value: "
"}, - &stmt.Interface{ - PhpDocComment: "", - InterfaceName: &node.Identifier{Value: "Foo"}, - Stmts: []node.Node{}, + &stmt.Nop{ + Position: &position.Position{ + StartLine: 107, + EndLine: 107, + StartPos: 2494, + EndPos: 2495, + }, + }, + &stmt.InlineHtml{ + Position: &position.Position{ + StartLine: 107, + EndLine: 107, + StartPos: 2497, + EndPos: 2508, + }, + Value: "
", }, &stmt.Interface{ + Position: &position.Position{ + StartLine: 108, + EndLine: 108, + StartPos: 2514, + EndPos: 2529, + }, PhpDocComment: "", - InterfaceName: &node.Identifier{Value: "Foo"}, + InterfaceName: &node.Identifier{ + Position: &position.Position{ + StartLine: 108, + EndLine: 108, + StartPos: 2524, + EndPos: 2526, + }, + Value: "Foo", + }, + Stmts: []node.Node{ + }, + }, + &stmt.Interface{ + Position: &position.Position{ + StartLine: 109, + EndLine: 109, + StartPos: 2533, + EndPos: 2560, + }, + PhpDocComment: "", + InterfaceName: &node.Identifier{ + Position: &position.Position{ + StartLine: 109, + EndLine: 109, + StartPos: 2543, + EndPos: 2545, + }, + Value: "Foo", + }, Extends: &stmt.InterfaceExtends{ + Position: &position.Position{ + StartLine: 109, + EndLine: 109, + StartPos: 2547, + EndPos: 2557, + }, InterfaceNames: []node.Node{ &name.Name{ + Position: &position.Position{ + StartLine: 109, + EndLine: 109, + StartPos: 2555, + EndPos: 2557, + }, Parts: []node.Node{ - &name.NamePart{Value: "Bar"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 109, + EndLine: 109, + StartPos: 2555, + EndPos: 2557, + }, + Value: "Bar", + }, }, }, }, }, - Stmts: []node.Node{}, + Stmts: []node.Node{ + }, }, &stmt.Interface{ + Position: &position.Position{ + StartLine: 110, + EndLine: 110, + StartPos: 2564, + EndPos: 2596, + }, PhpDocComment: "", - InterfaceName: &node.Identifier{Value: "Foo"}, + InterfaceName: &node.Identifier{ + Position: &position.Position{ + StartLine: 110, + EndLine: 110, + StartPos: 2574, + EndPos: 2576, + }, + Value: "Foo", + }, Extends: &stmt.InterfaceExtends{ + Position: &position.Position{ + StartLine: 110, + EndLine: 110, + StartPos: 2578, + EndPos: 2593, + }, InterfaceNames: []node.Node{ &name.Name{ + Position: &position.Position{ + StartLine: 110, + EndLine: 110, + StartPos: 2586, + EndPos: 2588, + }, Parts: []node.Node{ - &name.NamePart{Value: "Bar"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 110, + EndLine: 110, + StartPos: 2586, + EndPos: 2588, + }, + Value: "Bar", + }, }, }, &name.Name{ + Position: &position.Position{ + StartLine: 110, + EndLine: 110, + StartPos: 2591, + EndPos: 2593, + }, Parts: []node.Node{ - &name.NamePart{Value: "Baz"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 110, + EndLine: 110, + StartPos: 2591, + EndPos: 2593, + }, + Value: "Baz", + }, }, }, }, }, - Stmts: []node.Node{}, + Stmts: []node.Node{ + }, }, &stmt.Namespace{ + Position: &position.Position{ + StartLine: 111, + EndLine: 111, + StartPos: 2600, + EndPos: 2613, + }, NamespaceName: &name.Name{ + Position: &position.Position{ + StartLine: 111, + EndLine: 111, + StartPos: 2610, + EndPos: 2612, + }, Parts: []node.Node{ - &name.NamePart{Value: "Foo"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 111, + EndLine: 111, + StartPos: 2610, + EndPos: 2612, + }, + Value: "Foo", + }, }, }, }, &stmt.Namespace{ + Position: &position.Position{ + StartLine: 112, + EndLine: 112, + StartPos: 2617, + EndPos: 2636, + }, NamespaceName: &name.Name{ + Position: &position.Position{ + StartLine: 112, + EndLine: 112, + StartPos: 2627, + EndPos: 2633, + }, Parts: []node.Node{ - &name.NamePart{Value: "Foo"}, - &name.NamePart{Value: "Bar"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 112, + EndLine: 112, + StartPos: 2627, + EndPos: 2629, + }, + Value: "Foo", + }, + &name.NamePart{ + Position: &position.Position{ + StartLine: 112, + EndLine: 112, + StartPos: 2631, + EndPos: 2633, + }, + Value: "Bar", + }, }, }, - Stmts: []node.Node{}, + Stmts: []node.Node{ + }, }, &stmt.Namespace{ - Stmts: []node.Node{}, + Position: &position.Position{ + StartLine: 113, + EndLine: 113, + StartPos: 2640, + EndPos: 2651, + }, + Stmts: []node.Node{ + }, }, &stmt.Class{ - ClassName: &node.Identifier{Value: "foo"}, + Position: &position.Position{ + StartLine: 114, + EndLine: 114, + StartPos: 2655, + EndPos: 2673, + }, + PhpDocComment: "", + ClassName: &node.Identifier{ + Position: &position.Position{ + StartLine: 114, + EndLine: 114, + StartPos: 2661, + EndPos: 2663, + }, + Value: "foo", + }, Stmts: []node.Node{ &stmt.PropertyList{ + Position: &position.Position{ + StartLine: 114, + EndLine: 114, + StartPos: 2666, + EndPos: 2672, + }, Modifiers: []node.Node{ - &node.Identifier{Value: "var"}, + &node.Identifier{ + Position: &position.Position{ + StartLine: 114, + EndLine: 114, + StartPos: 2666, + EndPos: 2668, + }, + Value: "var", + }, }, Properties: []node.Node{ &stmt.Property{ + Position: &position.Position{ + StartLine: 114, + EndLine: 114, + StartPos: 2670, + EndPos: 2671, + }, PhpDocComment: "", - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 114, + EndLine: 114, + StartPos: 2670, + EndPos: 2671, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 114, + EndLine: 114, + StartPos: 2670, + EndPos: 2671, + }, + Value: "a", + }, + }, }, }, }, }, }, &stmt.Class{ - ClassName: &node.Identifier{Value: "foo"}, + Position: &position.Position{ + StartLine: 115, + EndLine: 115, + StartPos: 2677, + EndPos: 2713, + }, + PhpDocComment: "", + ClassName: &node.Identifier{ + Position: &position.Position{ + StartLine: 115, + EndLine: 115, + StartPos: 2683, + EndPos: 2685, + }, + Value: "foo", + }, Stmts: []node.Node{ &stmt.PropertyList{ + Position: &position.Position{ + StartLine: 115, + EndLine: 115, + StartPos: 2688, + EndPos: 2712, + }, Modifiers: []node.Node{ - &node.Identifier{Value: "public"}, - &node.Identifier{Value: "static"}, + &node.Identifier{ + Position: &position.Position{ + StartLine: 115, + EndLine: 115, + StartPos: 2688, + EndPos: 2693, + }, + Value: "public", + }, + &node.Identifier{ + Position: &position.Position{ + StartLine: 115, + EndLine: 115, + StartPos: 2695, + EndPos: 2700, + }, + Value: "static", + }, }, Properties: []node.Node{ &stmt.Property{ + Position: &position.Position{ + StartLine: 115, + EndLine: 115, + StartPos: 2702, + EndPos: 2703, + }, PhpDocComment: "", - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 115, + EndLine: 115, + StartPos: 2702, + EndPos: 2703, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 115, + EndLine: 115, + StartPos: 2702, + EndPos: 2703, + }, + Value: "a", + }, + }, }, &stmt.Property{ + Position: &position.Position{ + StartLine: 115, + EndLine: 115, + StartPos: 2706, + EndPos: 2711, + }, PhpDocComment: "", - Variable: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - Expr: &scalar.Lnumber{Value: "1"}, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 115, + EndLine: 115, + StartPos: 2706, + EndPos: 2707, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 115, + EndLine: 115, + StartPos: 2706, + EndPos: 2707, + }, + Value: "b", + }, + }, + Expr: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 115, + EndLine: 115, + StartPos: 2711, + EndPos: 2711, + }, + Value: "1", + }, }, }, }, }, }, &stmt.Class{ - ClassName: &node.Identifier{Value: "foo"}, + Position: &position.Position{ + StartLine: 116, + EndLine: 116, + StartPos: 2717, + EndPos: 2753, + }, + PhpDocComment: "", + ClassName: &node.Identifier{ + Position: &position.Position{ + StartLine: 116, + EndLine: 116, + StartPos: 2723, + EndPos: 2725, + }, + Value: "foo", + }, Stmts: []node.Node{ &stmt.PropertyList{ + Position: &position.Position{ + StartLine: 116, + EndLine: 116, + StartPos: 2728, + EndPos: 2752, + }, Modifiers: []node.Node{ - &node.Identifier{Value: "public"}, - &node.Identifier{Value: "static"}, + &node.Identifier{ + Position: &position.Position{ + StartLine: 116, + EndLine: 116, + StartPos: 2728, + EndPos: 2733, + }, + Value: "public", + }, + &node.Identifier{ + Position: &position.Position{ + StartLine: 116, + EndLine: 116, + StartPos: 2735, + EndPos: 2740, + }, + Value: "static", + }, }, Properties: []node.Node{ &stmt.Property{ + Position: &position.Position{ + StartLine: 116, + EndLine: 116, + StartPos: 2742, + EndPos: 2747, + }, PhpDocComment: "", - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expr: &scalar.Lnumber{Value: "1"}, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 116, + EndLine: 116, + StartPos: 2742, + EndPos: 2743, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 116, + EndLine: 116, + StartPos: 2742, + EndPos: 2743, + }, + Value: "a", + }, + }, + Expr: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 116, + EndLine: 116, + StartPos: 2747, + EndPos: 2747, + }, + Value: "1", + }, }, &stmt.Property{ + Position: &position.Position{ + StartLine: 116, + EndLine: 116, + StartPos: 2750, + EndPos: 2751, + }, PhpDocComment: "", - Variable: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 116, + EndLine: 116, + StartPos: 2750, + EndPos: 2751, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 116, + EndLine: 116, + StartPos: 2750, + EndPos: 2751, + }, + Value: "b", + }, + }, }, }, }, }, }, &stmt.Static{ + Position: &position.Position{ + StartLine: 117, + EndLine: 117, + StartPos: 2757, + EndPos: 2774, + }, Vars: []node.Node{ &stmt.StaticVar{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Position: &position.Position{ + StartLine: 117, + EndLine: 117, + StartPos: 2764, + EndPos: 2765, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 117, + EndLine: 117, + StartPos: 2764, + EndPos: 2765, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 117, + EndLine: 117, + StartPos: 2764, + EndPos: 2765, + }, + Value: "a", + }, + }, }, &stmt.StaticVar{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - Expr: &scalar.Lnumber{Value: "1"}, + Position: &position.Position{ + StartLine: 117, + EndLine: 117, + StartPos: 2768, + EndPos: 2773, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 117, + EndLine: 117, + StartPos: 2768, + EndPos: 2769, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 117, + EndLine: 117, + StartPos: 2768, + EndPos: 2769, + }, + Value: "b", + }, + }, + Expr: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 117, + EndLine: 117, + StartPos: 2773, + EndPos: 2773, + }, + Value: "1", + }, }, }, }, &stmt.Static{ + Position: &position.Position{ + StartLine: 118, + EndLine: 118, + StartPos: 2778, + EndPos: 2795, + }, Vars: []node.Node{ &stmt.StaticVar{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expr: &scalar.Lnumber{Value: "1"}, + Position: &position.Position{ + StartLine: 118, + EndLine: 118, + StartPos: 2785, + EndPos: 2790, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 118, + EndLine: 118, + StartPos: 2785, + EndPos: 2786, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 118, + EndLine: 118, + StartPos: 2785, + EndPos: 2786, + }, + Value: "a", + }, + }, + Expr: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 118, + EndLine: 118, + StartPos: 2790, + EndPos: 2790, + }, + Value: "1", + }, }, &stmt.StaticVar{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Position: &position.Position{ + StartLine: 118, + EndLine: 118, + StartPos: 2793, + EndPos: 2794, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 118, + EndLine: 118, + StartPos: 2793, + EndPos: 2794, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 118, + EndLine: 118, + StartPos: 2793, + EndPos: 2794, + }, + Value: "b", + }, + }, }, }, }, &stmt.AltSwitch{ - Cond: &scalar.Lnumber{Value: "1"}, + Position: &position.Position{ + StartLine: 120, + EndLine: 124, + StartPos: 2800, + EndPos: 2858, + }, + Cond: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 120, + EndLine: 120, + StartPos: 2808, + EndPos: 2808, + }, + Value: "1", + }, CaseList: &stmt.CaseList{ + Position: &position.Position{ + StartLine: 121, + EndLine: -1, + StartPos: 2816, + EndPos: -1, + }, Cases: []node.Node{ &stmt.Case{ - Cond: &scalar.Lnumber{Value: "1"}, - Stmts: []node.Node{}, + Position: &position.Position{ + StartLine: 121, + EndLine: -1, + StartPos: 2816, + EndPos: -1, + }, + Cond: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 121, + EndLine: 121, + StartPos: 2821, + EndPos: 2821, + }, + Value: "1", + }, + Stmts: []node.Node{ + }, }, &stmt.Default{ - Stmts: []node.Node{}, + Position: &position.Position{ + StartLine: 122, + EndLine: -1, + StartPos: 2827, + EndPos: -1, + }, + Stmts: []node.Node{ + }, }, &stmt.Case{ - Cond: &scalar.Lnumber{Value: "2"}, - Stmts: []node.Node{}, + Position: &position.Position{ + StartLine: 123, + EndLine: -1, + StartPos: 2839, + EndPos: -1, + }, + Cond: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 123, + EndLine: 123, + StartPos: 2844, + EndPos: 2844, + }, + Value: "2", + }, + Stmts: []node.Node{ + }, }, }, }, }, &stmt.AltSwitch{ - Cond: &scalar.Lnumber{Value: "1"}, - CaseList: &stmt.CaseList{ - Cases: []node.Node{ - &stmt.Case{ - Cond: &scalar.Lnumber{Value: "1"}, - Stmts: []node.Node{}, - }, - &stmt.Case{ - Cond: &scalar.Lnumber{Value: "2"}, - Stmts: []node.Node{}, - }, - }, + Position: &position.Position{ + StartLine: 126, + EndLine: 129, + StartPos: 2863, + EndPos: 2910, + }, + Cond: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 126, + EndLine: 126, + StartPos: 2871, + EndPos: 2871, + }, + Value: "1", }, - }, - &stmt.Switch{ - Cond: &scalar.Lnumber{Value: "1"}, CaseList: &stmt.CaseList{ + Position: &position.Position{ + StartLine: 127, + EndLine: -1, + StartPos: 2880, + EndPos: -1, + }, Cases: []node.Node{ &stmt.Case{ - Cond: &scalar.Lnumber{Value: "1"}, + Position: &position.Position{ + StartLine: 127, + EndLine: -1, + StartPos: 2880, + EndPos: -1, + }, + Cond: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 127, + EndLine: 127, + StartPos: 2885, + EndPos: 2885, + }, + Value: "1", + }, Stmts: []node.Node{ - &stmt.Break{}, }, }, &stmt.Case{ - Cond: &scalar.Lnumber{Value: "2"}, + Position: &position.Position{ + StartLine: 128, + EndLine: -1, + StartPos: 2891, + EndPos: -1, + }, + Cond: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 128, + EndLine: 128, + StartPos: 2896, + EndPos: 2896, + }, + Value: "2", + }, Stmts: []node.Node{ - &stmt.Break{}, }, }, }, }, }, &stmt.Switch{ - Cond: &scalar.Lnumber{Value: "1"}, + Position: &position.Position{ + StartLine: 131, + EndLine: 134, + StartPos: 2917, + EndPos: 2968, + }, + Cond: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 131, + EndLine: 131, + StartPos: 2925, + EndPos: 2925, + }, + Value: "1", + }, CaseList: &stmt.CaseList{ + Position: &position.Position{ + StartLine: 131, + EndLine: 134, + StartPos: 2928, + EndPos: 2968, + }, Cases: []node.Node{ &stmt.Case{ - Cond: &scalar.Lnumber{Value: "1"}, + Position: &position.Position{ + StartLine: 132, + EndLine: 132, + StartPos: 2933, + EndPos: 2946, + }, + Cond: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 132, + EndLine: 132, + StartPos: 2938, + EndPos: 2938, + }, + Value: "1", + }, Stmts: []node.Node{ - &stmt.Break{}, + &stmt.Break{ + Position: &position.Position{ + StartLine: 132, + EndLine: 132, + StartPos: 2941, + EndPos: 2946, + }, + }, }, }, &stmt.Case{ - Cond: &scalar.Lnumber{Value: "2"}, + Position: &position.Position{ + StartLine: 133, + EndLine: 133, + StartPos: 2951, + EndPos: 2964, + }, + Cond: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 133, + EndLine: 133, + StartPos: 2956, + EndPos: 2956, + }, + Value: "2", + }, Stmts: []node.Node{ - &stmt.Break{}, + &stmt.Break{ + Position: &position.Position{ + StartLine: 133, + EndLine: 133, + StartPos: 2959, + EndPos: 2964, + }, + }, + }, + }, + }, + }, + }, + &stmt.Switch{ + Position: &position.Position{ + StartLine: 136, + EndLine: 139, + StartPos: 2975, + EndPos: 3027, + }, + Cond: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 136, + EndLine: 136, + StartPos: 2983, + EndPos: 2983, + }, + Value: "1", + }, + CaseList: &stmt.CaseList{ + Position: &position.Position{ + StartLine: 136, + EndLine: 139, + StartPos: 2986, + EndPos: 3027, + }, + Cases: []node.Node{ + &stmt.Case{ + Position: &position.Position{ + StartLine: 137, + EndLine: 137, + StartPos: 2992, + EndPos: 3005, + }, + Cond: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 137, + EndLine: 137, + StartPos: 2997, + EndPos: 2997, + }, + Value: "1", + }, + Stmts: []node.Node{ + &stmt.Break{ + Position: &position.Position{ + StartLine: 137, + EndLine: 137, + StartPos: 3000, + EndPos: 3005, + }, + }, + }, + }, + &stmt.Case{ + Position: &position.Position{ + StartLine: 138, + EndLine: 138, + StartPos: 3010, + EndPos: 3023, + }, + Cond: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 138, + EndLine: 138, + StartPos: 3015, + EndPos: 3015, + }, + Value: "2", + }, + Stmts: []node.Node{ + &stmt.Break{ + Position: &position.Position{ + StartLine: 138, + EndLine: 138, + StartPos: 3018, + EndPos: 3023, + }, + }, }, }, }, }, }, &stmt.Throw{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "e"}}, + Position: &position.Position{ + StartLine: 140, + EndLine: 140, + StartPos: 3031, + EndPos: 3039, + }, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 140, + EndLine: 140, + StartPos: 3037, + EndPos: 3038, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 140, + EndLine: 140, + StartPos: 3037, + EndPos: 3038, + }, + Value: "e", + }, + }, }, &stmt.Trait{ + Position: &position.Position{ + StartLine: 141, + EndLine: 141, + StartPos: 3043, + EndPos: 3054, + }, PhpDocComment: "", - TraitName: &node.Identifier{Value: "Foo"}, - Stmts: []node.Node{}, + TraitName: &node.Identifier{ + Position: &position.Position{ + StartLine: 141, + EndLine: 141, + StartPos: 3049, + EndPos: 3051, + }, + Value: "Foo", + }, + Stmts: []node.Node{ + }, }, &stmt.Class{ + Position: &position.Position{ + StartLine: 142, + EndLine: 142, + StartPos: 3058, + EndPos: 3079, + }, PhpDocComment: "", - ClassName: &node.Identifier{Value: "Foo"}, + ClassName: &node.Identifier{ + Position: &position.Position{ + StartLine: 142, + EndLine: 142, + StartPos: 3064, + EndPos: 3066, + }, + Value: "Foo", + }, Stmts: []node.Node{ &stmt.TraitUse{ + Position: &position.Position{ + StartLine: 142, + EndLine: 142, + StartPos: 3070, + EndPos: 3077, + }, Traits: []node.Node{ &name.Name{ + Position: &position.Position{ + StartLine: 142, + EndLine: 142, + StartPos: 3074, + EndPos: 3076, + }, Parts: []node.Node{ - &name.NamePart{Value: "Bar"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 142, + EndLine: 142, + StartPos: 3074, + EndPos: 3076, + }, + Value: "Bar", + }, }, }, }, @@ -1465,50 +6507,187 @@ func TestPhp5(t *testing.T) { }, }, &stmt.Class{ - PhpDocComment: "", - ClassName: &node.Identifier{Value: "Foo"}, - Stmts: []node.Node{ - &stmt.TraitUse{ - Traits: []node.Node{ - &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "Bar"}, - }, - }, - &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "Baz"}, - }, - }, - }, - TraitAdaptationList: &stmt.TraitAdaptationList{}, - }, + Position: &position.Position{ + StartLine: 143, + EndLine: 143, + StartPos: 3083, + EndPos: 3111, }, - }, - &stmt.Class{ PhpDocComment: "", - ClassName: &node.Identifier{Value: "Foo"}, + ClassName: &node.Identifier{ + Position: &position.Position{ + StartLine: 143, + EndLine: 143, + StartPos: 3089, + EndPos: 3091, + }, + Value: "Foo", + }, Stmts: []node.Node{ &stmt.TraitUse{ + Position: &position.Position{ + StartLine: 143, + EndLine: 143, + StartPos: 3095, + EndPos: 3109, + }, Traits: []node.Node{ &name.Name{ + Position: &position.Position{ + StartLine: 143, + EndLine: 143, + StartPos: 3099, + EndPos: 3101, + }, Parts: []node.Node{ - &name.NamePart{Value: "Bar"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 143, + EndLine: 143, + StartPos: 3099, + EndPos: 3101, + }, + Value: "Bar", + }, }, }, &name.Name{ + Position: &position.Position{ + StartLine: 143, + EndLine: 143, + StartPos: 3104, + EndPos: 3106, + }, Parts: []node.Node{ - &name.NamePart{Value: "Baz"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 143, + EndLine: 143, + StartPos: 3104, + EndPos: 3106, + }, + Value: "Baz", + }, }, }, }, TraitAdaptationList: &stmt.TraitAdaptationList{ + Position: &position.Position{ + StartLine: 143, + EndLine: 143, + StartPos: 3108, + EndPos: 3109, + }, + }, + }, + }, + }, + &stmt.Class{ + Position: &position.Position{ + StartLine: 144, + EndLine: 144, + StartPos: 3115, + EndPos: 3159, + }, + PhpDocComment: "", + ClassName: &node.Identifier{ + Position: &position.Position{ + StartLine: 144, + EndLine: 144, + StartPos: 3121, + EndPos: 3123, + }, + Value: "Foo", + }, + Stmts: []node.Node{ + &stmt.TraitUse{ + Position: &position.Position{ + StartLine: 144, + EndLine: 144, + StartPos: 3127, + EndPos: 3157, + }, + Traits: []node.Node{ + &name.Name{ + Position: &position.Position{ + StartLine: 144, + EndLine: 144, + StartPos: 3131, + EndPos: 3133, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 144, + EndLine: 144, + StartPos: 3131, + EndPos: 3133, + }, + Value: "Bar", + }, + }, + }, + &name.Name{ + Position: &position.Position{ + StartLine: 144, + EndLine: 144, + StartPos: 3136, + EndPos: 3138, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 144, + EndLine: 144, + StartPos: 3136, + EndPos: 3138, + }, + Value: "Baz", + }, + }, + }, + }, + TraitAdaptationList: &stmt.TraitAdaptationList{ + Position: &position.Position{ + StartLine: 144, + EndLine: 144, + StartPos: 3140, + EndPos: 3157, + }, Adaptations: []node.Node{ &stmt.TraitUseAlias{ - Ref: &stmt.TraitMethodRef{ - Method: &node.Identifier{Value: "one"}, + Position: &position.Position{ + StartLine: 144, + EndLine: 144, + StartPos: 3142, + EndPos: 3154, + }, + Ref: &stmt.TraitMethodRef{ + Position: &position.Position{ + StartLine: 144, + EndLine: 144, + StartPos: 3142, + EndPos: 3144, + }, + Method: &node.Identifier{ + Position: &position.Position{ + StartLine: 144, + EndLine: 144, + StartPos: 3142, + EndPos: 3144, + }, + Value: "one", + }, + }, + Modifier: &node.Identifier{ + Position: &position.Position{ + StartLine: 144, + EndLine: 144, + StartPos: 3149, + EndPos: 3154, + }, + Value: "public", }, - Modifier: &node.Identifier{Value: "public"}, }, }, }, @@ -1516,30 +6695,120 @@ func TestPhp5(t *testing.T) { }, }, &stmt.Class{ + Position: &position.Position{ + StartLine: 145, + EndLine: 145, + StartPos: 3163, + EndPos: 3211, + }, PhpDocComment: "", - ClassName: &node.Identifier{Value: "Foo"}, + ClassName: &node.Identifier{ + Position: &position.Position{ + StartLine: 145, + EndLine: 145, + StartPos: 3169, + EndPos: 3171, + }, + Value: "Foo", + }, Stmts: []node.Node{ &stmt.TraitUse{ + Position: &position.Position{ + StartLine: 145, + EndLine: 145, + StartPos: 3175, + EndPos: 3209, + }, Traits: []node.Node{ &name.Name{ + Position: &position.Position{ + StartLine: 145, + EndLine: 145, + StartPos: 3179, + EndPos: 3181, + }, Parts: []node.Node{ - &name.NamePart{Value: "Bar"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 145, + EndLine: 145, + StartPos: 3179, + EndPos: 3181, + }, + Value: "Bar", + }, }, }, &name.Name{ + Position: &position.Position{ + StartLine: 145, + EndLine: 145, + StartPos: 3184, + EndPos: 3186, + }, Parts: []node.Node{ - &name.NamePart{Value: "Baz"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 145, + EndLine: 145, + StartPos: 3184, + EndPos: 3186, + }, + Value: "Baz", + }, }, }, }, TraitAdaptationList: &stmt.TraitAdaptationList{ + Position: &position.Position{ + StartLine: 145, + EndLine: 145, + StartPos: 3188, + EndPos: 3209, + }, Adaptations: []node.Node{ &stmt.TraitUseAlias{ - Ref: &stmt.TraitMethodRef{ - Method: &node.Identifier{Value: "one"}, + Position: &position.Position{ + StartLine: 145, + EndLine: 145, + StartPos: 3190, + EndPos: 3206, + }, + Ref: &stmt.TraitMethodRef{ + Position: &position.Position{ + StartLine: 145, + EndLine: 145, + StartPos: 3190, + EndPos: 3192, + }, + Method: &node.Identifier{ + Position: &position.Position{ + StartLine: 145, + EndLine: 145, + StartPos: 3190, + EndPos: 3192, + }, + Value: "one", + }, + }, + Modifier: &node.Identifier{ + Position: &position.Position{ + StartLine: 145, + EndLine: 145, + StartPos: 3197, + EndPos: 3202, + }, + Value: "public", + }, + Alias: &node.Identifier{ + Position: &position.Position{ + StartLine: 145, + EndLine: 145, + StartPos: 3204, + EndPos: 3206, + }, + Value: "two", }, - Modifier: &node.Identifier{Value: "public"}, - Alias: &node.Identifier{Value: "two"}, }, }, }, @@ -1547,2010 +6816,10911 @@ func TestPhp5(t *testing.T) { }, }, &stmt.Class{ + Position: &position.Position{ + StartLine: 146, + EndLine: 146, + StartPos: 3215, + EndPos: 3291, + }, PhpDocComment: "", - ClassName: &node.Identifier{Value: "Foo"}, + ClassName: &node.Identifier{ + Position: &position.Position{ + StartLine: 146, + EndLine: 146, + StartPos: 3221, + EndPos: 3223, + }, + Value: "Foo", + }, Stmts: []node.Node{ &stmt.TraitUse{ + Position: &position.Position{ + StartLine: 146, + EndLine: 146, + StartPos: 3227, + EndPos: 3289, + }, Traits: []node.Node{ &name.Name{ + Position: &position.Position{ + StartLine: 146, + EndLine: 146, + StartPos: 3231, + EndPos: 3233, + }, Parts: []node.Node{ - &name.NamePart{Value: "Bar"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 146, + EndLine: 146, + StartPos: 3231, + EndPos: 3233, + }, + Value: "Bar", + }, }, }, &name.Name{ + Position: &position.Position{ + StartLine: 146, + EndLine: 146, + StartPos: 3236, + EndPos: 3238, + }, Parts: []node.Node{ - &name.NamePart{Value: "Baz"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 146, + EndLine: 146, + StartPos: 3236, + EndPos: 3238, + }, + Value: "Baz", + }, }, }, }, TraitAdaptationList: &stmt.TraitAdaptationList{ + Position: &position.Position{ + StartLine: 146, + EndLine: 146, + StartPos: 3240, + EndPos: 3289, + }, Adaptations: []node.Node{ &stmt.TraitUsePrecedence{ + Position: &position.Position{ + StartLine: 146, + EndLine: 146, + StartPos: 3242, + EndPos: 3269, + }, Ref: &stmt.TraitMethodRef{ + Position: &position.Position{ + StartLine: 146, + EndLine: 146, + StartPos: 3242, + EndPos: 3249, + }, Trait: &name.Name{ + Position: &position.Position{ + StartLine: 146, + EndLine: 146, + StartPos: 3242, + EndPos: 3244, + }, Parts: []node.Node{ - &name.NamePart{Value: "Bar"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 146, + EndLine: 146, + StartPos: 3242, + EndPos: 3244, + }, + Value: "Bar", + }, }, }, - Method: &node.Identifier{Value: "one"}, + Method: &node.Identifier{ + Position: &position.Position{ + StartLine: 146, + EndLine: 146, + StartPos: 3247, + EndPos: 3249, + }, + Value: "one", + }, }, Insteadof: []node.Node{ &name.Name{ + Position: &position.Position{ + StartLine: 146, + EndLine: 146, + StartPos: 3261, + EndPos: 3263, + }, Parts: []node.Node{ - &name.NamePart{Value: "Baz"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 146, + EndLine: 146, + StartPos: 3261, + EndPos: 3263, + }, + Value: "Baz", + }, }, }, &name.Name{ + Position: &position.Position{ + StartLine: 146, + EndLine: 146, + StartPos: 3266, + EndPos: 3269, + }, Parts: []node.Node{ - &name.NamePart{Value: "Quux"}, - }, - }, - }, - }, - &stmt.TraitUseAlias{ - Ref: &stmt.TraitMethodRef{ - Trait: &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "Baz"}, - }, - }, - Method: &node.Identifier{Value: "one"}, - }, - Alias: &node.Identifier{Value: "two"}, - }, - }, - }, - }, - }, - }, - &stmt.Try{ - Stmts: []node.Node{}, - Catches: []node.Node{}, - }, - &stmt.Try{ - Stmts: []node.Node{}, - Catches: []node.Node{ - &stmt.Catch{ - Types: []node.Node{ - &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "Exception"}, - }, - }, - }, - Variable: &expr.Variable{ - VarName: &node.Identifier{Value: "e"}, - }, - Stmts: []node.Node{}, - }, - }, - }, - &stmt.Try{ - Stmts: []node.Node{}, - Catches: []node.Node{ - &stmt.Catch{ - Types: []node.Node{ - &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "Exception"}, - }, - }, - }, - Variable: &expr.Variable{ - VarName: &node.Identifier{Value: "e"}, - }, - Stmts: []node.Node{}, - }, - &stmt.Catch{ - Types: []node.Node{ - &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "RuntimeException"}, - }, - }, - }, - Variable: &expr.Variable{ - VarName: &node.Identifier{Value: "e"}, - }, - Stmts: []node.Node{}, - }, - }, - }, - &stmt.Try{ - Stmts: []node.Node{}, - Catches: []node.Node{ - &stmt.Catch{ - Types: []node.Node{ - &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "Exception"}, - }, - }, - }, - Variable: &expr.Variable{ - VarName: &node.Identifier{Value: "e"}, - }, - Stmts: []node.Node{}, - }, - &stmt.Catch{ - Types: []node.Node{ - &name.FullyQualified{ - Parts: []node.Node{ - &name.NamePart{Value: "RuntimeException"}, - }, - }, - }, - Variable: &expr.Variable{ - VarName: &node.Identifier{Value: "e"}, - }, - Stmts: []node.Node{}, - }, - &stmt.Catch{ - Types: []node.Node{ - &name.Relative{ - Parts: []node.Node{ - &name.NamePart{Value: "AdditionException"}, - }, - }, - }, - Variable: &expr.Variable{ - VarName: &node.Identifier{Value: "e"}, - }, - Stmts: []node.Node{}, - }, - }, - }, - &stmt.Try{ - Stmts: []node.Node{}, - Catches: []node.Node{ - &stmt.Catch{ - Types: []node.Node{ - &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "Exception"}, - }, - }, - }, - Variable: &expr.Variable{ - VarName: &node.Identifier{Value: "e"}, - }, - Stmts: []node.Node{}, - }, - }, - Finally: &stmt.Finally{ - Stmts: []node.Node{}, - }, - }, - &stmt.Unset{ - Vars: []node.Node{ - &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - }, - &stmt.UseList{ - Uses: []node.Node{ - &stmt.Use{ - Use: &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "Foo"}, - }, - }, - }, - }, - }, - &stmt.UseList{ - Uses: []node.Node{ - &stmt.Use{ - Use: &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "Foo"}, - }, - }, - }, - }, - }, - &stmt.UseList{ - Uses: []node.Node{ - &stmt.Use{ - Use: &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "Foo"}, - }, - }, - Alias: &node.Identifier{Value: "Bar"}, - }, - }, - }, - &stmt.UseList{ - Uses: []node.Node{ - &stmt.Use{ - Use: &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "Foo"}, - }, - }, - }, - &stmt.Use{ - Use: &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "Bar"}, - }, - }, - }, - }, - }, - &stmt.UseList{ - Uses: []node.Node{ - &stmt.Use{ - Use: &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "Foo"}, - }, - }, - }, - &stmt.Use{ - Use: &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "Bar"}, - }, - }, - Alias: &node.Identifier{Value: "Baz"}, - }, - }, - }, - &stmt.UseList{ - UseType: &node.Identifier{Value: "function"}, - Uses: []node.Node{ - &stmt.Use{ - Use: &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "Foo"}, - }, - }, - }, - &stmt.Use{ - Use: &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "Bar"}, - }, - }, - }, - }, - }, - &stmt.UseList{ - UseType: &node.Identifier{Value: "function"}, - Uses: []node.Node{ - &stmt.Use{ - Use: &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "Foo"}, - }, - }, - Alias: &node.Identifier{Value: "foo"}, - }, - &stmt.Use{ - Use: &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "Bar"}, - }, - }, - Alias: &node.Identifier{Value: "bar"}, - }, - }, - }, - &stmt.UseList{ - UseType: &node.Identifier{Value: "const"}, - Uses: []node.Node{ - &stmt.Use{ - Use: &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "Foo"}, - }, - }, - }, - &stmt.Use{ - Use: &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "Bar"}, - }, - }, - }, - }, - }, - &stmt.UseList{ - UseType: &node.Identifier{Value: "const"}, - Uses: []node.Node{ - &stmt.Use{ - Use: &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "Foo"}, - }, - }, - Alias: &node.Identifier{Value: "foo"}, - }, - &stmt.Use{ - Use: &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "Bar"}, - }, - }, - Alias: &node.Identifier{Value: "bar"}, - }, - }, - }, - &stmt.Expression{ - Expr: &expr.ArrayDimFetch{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Dim: &scalar.Lnumber{Value: "1"}, - }, - }, - &stmt.Expression{ - Expr: &expr.ArrayDimFetch{ - Variable: &expr.ArrayDimFetch{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Dim: &scalar.Lnumber{Value: "1"}, - }, - Dim: &scalar.Lnumber{Value: "2"}, - }, - }, - &stmt.Expression{ - Expr: &expr.Array{ - Items: []node.Node{}, - }, - }, - &stmt.Expression{ - Expr: &expr.Array{ - Items: []node.Node{ - &expr.ArrayItem{ - Val: &scalar.Lnumber{Value: "1"}, - }, - }, - }, - }, - &stmt.Expression{ - Expr: &expr.Array{ - Items: []node.Node{ - &expr.ArrayItem{ - Key: &scalar.Lnumber{Value: "1"}, - Val: &scalar.Lnumber{Value: "1"}, - }, - &expr.ArrayItem{ - Val: &expr.Reference{Variable: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, - }, - }, - }, - }, - &stmt.Expression{ - Expr: &expr.Array{ - Items: []node.Node{ - &expr.ArrayItem{ - Key: &scalar.Lnumber{Value: "3"}, - Val: &expr.Reference{Variable: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, - }, - }, - }, - }, - &stmt.Expression{ - Expr: &expr.Array{ - Items: []node.Node{ - &expr.ArrayItem{ - Val: &expr.Reference{Variable: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, - }, - &expr.ArrayItem{ - Key: &scalar.Lnumber{Value: "1"}, - Val: &scalar.Lnumber{Value: "1"}, - }, - &expr.ArrayItem{ - Val: &scalar.Lnumber{Value: "1"}, - }, - &expr.ArrayItem{ - Key: &scalar.Lnumber{Value: "3"}, - Val: &expr.Reference{Variable: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, - }, - }, - }, - }, - &stmt.Expression{ - Expr: &expr.BitwiseNot{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - }, - }, - &stmt.Expression{ - Expr: &expr.BooleanNot{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - }, - }, - &stmt.Expression{ - Expr: &expr.ClassConstFetch{ - Class: &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "Foo"}, - }, - }, - ConstantName: &node.Identifier{Value: "Bar"}, - }, - }, - &stmt.Expression{ - Expr: &expr.Clone{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - }, - }, - &stmt.Expression{ - Expr: &expr.Clone{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - }, - }, - &stmt.Expression{ - Expr: &expr.Closure{ - ReturnsRef: false, - Static: false, - PhpDocComment: "", - Stmts: []node.Node{}, - }, - }, - &stmt.Expression{ - Expr: &expr.Closure{ - ReturnsRef: false, - Static: false, - PhpDocComment: "", - Params: []node.Node{ - &node.Parameter{ - ByRef: false, - Variadic: false, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - }, - &node.Parameter{ - ByRef: false, - Variadic: false, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - }, - ClosureUse: &expr.ClosureUse{ - Uses: []node.Node{ - &expr.Variable{VarName: &node.Identifier{Value: "c"}}, - &expr.Reference{Variable: &expr.Variable{VarName: &node.Identifier{Value: "d"}}}, - }, - }, - Stmts: []node.Node{}, - }, - }, - &stmt.Expression{ - Expr: &expr.Closure{ - ReturnsRef: false, - Static: false, - PhpDocComment: "", - Params: []node.Node{ - &node.Parameter{ - ByRef: false, - Variadic: false, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - }, - &node.Parameter{ - ByRef: false, - Variadic: false, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - }, - ClosureUse: &expr.ClosureUse{ - Uses: []node.Node{ - &expr.Reference{Variable: &expr.Variable{VarName: &node.Identifier{Value: "c"}}}, - &expr.Variable{VarName: &node.Identifier{Value: "d"}}, - }, - }, - Stmts: []node.Node{}, - }, - }, - &stmt.Expression{ - Expr: &expr.Closure{ - ReturnsRef: false, - Static: false, - PhpDocComment: "", - Stmts: []node.Node{}, - }, - }, - &stmt.Expression{ - Expr: &expr.ConstFetch{ - Constant: &name.Name{Parts: []node.Node{&name.NamePart{Value: "foo"}}}, - }, - }, - &stmt.Expression{ - Expr: &expr.ConstFetch{ - Constant: &name.Relative{Parts: []node.Node{&name.NamePart{Value: "foo"}}}, - }, - }, - &stmt.Expression{ - Expr: &expr.ConstFetch{ - Constant: &name.FullyQualified{Parts: []node.Node{&name.NamePart{Value: "foo"}}}, - }, - }, - &stmt.Expression{ - Expr: &expr.Empty{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - }, - }, - &stmt.Expression{ - Expr: &expr.Empty{ - Expr: &expr.ConstFetch{ - Constant: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Foo"}}}, - }, - }, - }, - &stmt.Expression{ - Expr: &expr.ErrorSuppress{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - }, - }, - &stmt.Expression{ - Expr: &expr.Eval{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - }, - }, - &stmt.Expression{ - Expr: &expr.Exit{}, - }, - &stmt.Expression{ - Expr: &expr.Exit{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - }, - }, - &stmt.Expression{ - Expr: &expr.Die{}, - }, - &stmt.Expression{ - Expr: &expr.Die{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - }, - }, - &stmt.Expression{ - Expr: &expr.FunctionCall{ - Function: &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "foo"}, - }, - }, - ArgumentList: &node.ArgumentList{}, - }, - }, - &stmt.Expression{ - Expr: &expr.FunctionCall{ - Function: &name.Relative{ - Parts: []node.Node{ - &name.NamePart{Value: "foo"}, - }, - }, - ArgumentList: &node.ArgumentList{ - Arguments: []node.Node{ - &node.Argument{ - Variadic: false, - IsReference: true, - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - }, - }, - }, - }, - }, - &stmt.Expression{ - Expr: &expr.FunctionCall{ - Function: &name.FullyQualified{ - Parts: []node.Node{ - &name.NamePart{Value: "foo"}, - }, - }, - ArgumentList: &node.ArgumentList{ - Arguments: []node.Node{ - &node.Argument{ - Variadic: false, - IsReference: false, - Expr: &expr.ShortArray{ - Items: []node.Node{}, - }, - }, - }, - }, - }, - }, - &stmt.Expression{ - Expr: &expr.FunctionCall{ - Function: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, - ArgumentList: &node.ArgumentList{ - Arguments: []node.Node{ - &node.Argument{ - Variadic: false, - IsReference: false, - Expr: &expr.Yield{ - Value: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - }, - }, - }, - }, - }, - }, - &stmt.Expression{ - Expr: &expr.PostDec{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - }, - }, - &stmt.Expression{ - Expr: &expr.PostInc{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - }, - }, - &stmt.Expression{ - Expr: &expr.PreDec{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - }, - }, - &stmt.Expression{ - Expr: &expr.PreInc{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - }, - }, - &stmt.Expression{ - Expr: &expr.Include{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - }, - }, - &stmt.Expression{ - Expr: &expr.IncludeOnce{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - }, - }, - &stmt.Expression{ - Expr: &expr.Require{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - }, - }, - &stmt.Expression{ - Expr: &expr.RequireOnce{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - }, - }, - &stmt.Expression{ - Expr: &expr.InstanceOf{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Class: &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "Foo"}, - }, - }, - }, - }, - &stmt.Expression{ - Expr: &expr.InstanceOf{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Class: &name.Relative{ - Parts: []node.Node{ - &name.NamePart{Value: "Foo"}, - }, - }, - }, - }, - &stmt.Expression{ - Expr: &expr.InstanceOf{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Class: &name.FullyQualified{ - Parts: []node.Node{ - &name.NamePart{Value: "Foo"}, - }, - }, - }, - }, - &stmt.Expression{ - Expr: &expr.Isset{ - Variables: []node.Node{ - &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - }, - }, - &stmt.Expression{ - Expr: &expr.Isset{ - Variables: []node.Node{ - &expr.ConstFetch{ - Constant: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Foo"}}}, - }, - }, - }, - }, - &stmt.Expression{ - Expr: &assign.Assign{ - Variable: &expr.List{ - Items: []node.Node{}, - }, - Expression: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - }, - &stmt.Expression{ - Expr: &assign.Assign{ - Variable: &expr.List{ - Items: []node.Node{ - &expr.ArrayItem{ - Val: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - }, - &expr.ArrayItem{ - Val: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - }, - }, - Expression: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - }, - &stmt.Expression{ - Expr: &assign.Assign{ - Variable: &expr.List{ - Items: []node.Node{ - &expr.ArrayItem{ - Val: &expr.ArrayDimFetch{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - }, - }, - }, - }, - Expression: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - }, - &stmt.Expression{ - Expr: &assign.Assign{ - Variable: &expr.List{ - Items: []node.Node{ - &expr.ArrayItem{ - Val: &expr.List{ - Items: []node.Node{ - &expr.ArrayItem{ - Val: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - }, - }, - }, - }, - }, - }, - Expression: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - }, - &stmt.Expression{ - Expr: &expr.MethodCall{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Method: &node.Identifier{Value: "foo"}, - ArgumentList: &node.ArgumentList{}, - }, - }, - &stmt.Expression{ - Expr: &expr.New{ - Class: &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "Foo"}, - }, - }, - }, - }, - &stmt.Expression{ - Expr: &expr.New{ - Class: &name.Relative{ - Parts: []node.Node{ - &name.NamePart{Value: "Foo"}, - }, - }, - ArgumentList: &node.ArgumentList{}, - }, - }, - &stmt.Expression{ - Expr: &expr.New{ - Class: &name.FullyQualified{ - Parts: []node.Node{ - &name.NamePart{Value: "Foo"}, - }, - }, - ArgumentList: &node.ArgumentList{}, - }, - }, - &stmt.Expression{ - Expr: &expr.Print{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - }, - }, - &stmt.Expression{ - Expr: &expr.PropertyFetch{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Property: &node.Identifier{Value: "foo"}, - }, - }, - &stmt.Expression{ - Expr: &expr.ArrayDimFetch{ - Variable: &expr.PropertyFetch{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Property: &node.Identifier{Value: "foo"}, - }, - Dim: &scalar.Lnumber{Value: "1"}, - }, - }, - &stmt.Expression{ - Expr: &expr.ArrayDimFetch{ - Variable: &expr.PropertyFetch{ - Variable: &expr.MethodCall{ - Variable: &expr.PropertyFetch{ - Variable: &expr.PropertyFetch{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Property: &node.Identifier{Value: "foo"}, - }, - Property: &node.Identifier{Value: "bar"}, - }, - Method: &node.Identifier{Value: "baz"}, - ArgumentList: &node.ArgumentList{}, - }, - Property: &node.Identifier{Value: "quux"}, - }, - Dim: &scalar.Lnumber{Value: "0"}, - }, - }, - &stmt.Expression{ - Expr: &expr.ArrayDimFetch{ - Variable: &expr.ArrayDimFetch{ - Variable: &expr.MethodCall{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Method: &node.Identifier{Value: "foo"}, - ArgumentList: &node.ArgumentList{}, - }, - Dim: &scalar.Lnumber{Value: "1"}, - }, - Dim: &scalar.Lnumber{Value: "1"}, - }, - }, - &stmt.Expression{ - Expr: &expr.ShellExec{ - Parts: []node.Node{ - &scalar.EncapsedStringPart{Value: "cmd "}, - &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - }, - }, - }, - &stmt.Expression{ - Expr: &expr.ShellExec{ - Parts: []node.Node{ - &scalar.EncapsedStringPart{Value: "cmd"}, - }, - }, - }, - &stmt.Expression{ - Expr: &expr.ShellExec{ - Parts: []node.Node{}, - }, - }, - &stmt.Expression{ - Expr: &expr.ShortArray{ - Items: []node.Node{}, - }, - }, - &stmt.Expression{ - Expr: &expr.ShortArray{ - Items: []node.Node{ - &expr.ArrayItem{ - Val: &scalar.Lnumber{Value: "1"}, - }, - }, - }, - }, - &stmt.Expression{ - Expr: &expr.ShortArray{ - Items: []node.Node{ - &expr.ArrayItem{ - Key: &scalar.Lnumber{Value: "1"}, - Val: &scalar.Lnumber{Value: "1"}, - }, - &expr.ArrayItem{ - Val: &expr.Reference{Variable: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, - }, - }, - }, - }, - &stmt.Expression{ - Expr: &expr.StaticCall{ - Class: &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "Foo"}, - }, - }, - Call: &node.Identifier{Value: "bar"}, - ArgumentList: &node.ArgumentList{}, - }, - }, - &stmt.Expression{ - Expr: &expr.StaticCall{ - Class: &name.Relative{ - Parts: []node.Node{ - &name.NamePart{Value: "Foo"}, - }, - }, - Call: &node.Identifier{Value: "bar"}, - ArgumentList: &node.ArgumentList{}, - }, - }, - &stmt.Expression{ - Expr: &expr.StaticCall{ - Class: &name.FullyQualified{ - Parts: []node.Node{ - &name.NamePart{Value: "Foo"}, - }, - }, - Call: &node.Identifier{Value: "bar"}, - ArgumentList: &node.ArgumentList{}, - }, - }, - &stmt.Expression{ - Expr: &expr.StaticCall{ - Class: &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "Foo"}, - }, - }, - Call: &expr.Variable{VarName: &node.Identifier{Value: "bar"}}, - ArgumentList: &node.ArgumentList{}, - }, - }, - &stmt.Expression{ - Expr: &expr.StaticCall{ - Class: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, - Call: &expr.Variable{VarName: &node.Identifier{Value: "bar"}}, - ArgumentList: &node.ArgumentList{}, - }, - }, - &stmt.Expression{ - Expr: &expr.StaticPropertyFetch{ - Class: &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "Foo"}, - }, - }, - Property: &expr.Variable{VarName: &node.Identifier{Value: "bar"}}, - }, - }, - &stmt.Expression{ - Expr: &expr.StaticPropertyFetch{ - Class: &name.Relative{ - Parts: []node.Node{ - &name.NamePart{Value: "Foo"}, - }, - }, - Property: &expr.Variable{VarName: &node.Identifier{Value: "bar"}}, - }, - }, - &stmt.Expression{ - Expr: &expr.StaticPropertyFetch{ - Class: &name.FullyQualified{ - Parts: []node.Node{ - &name.NamePart{Value: "Foo"}, - }, - }, - Property: &expr.Variable{VarName: &node.Identifier{Value: "bar"}}, - }, - }, - &stmt.Expression{ - Expr: &expr.Ternary{ - Condition: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - IfTrue: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - IfFalse: &expr.Variable{VarName: &node.Identifier{Value: "c"}}, - }, - }, - &stmt.Expression{ - Expr: &expr.Ternary{ - Condition: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - IfFalse: &expr.Variable{VarName: &node.Identifier{Value: "c"}}, - }, - }, - &stmt.Expression{ - Expr: &expr.Ternary{ - Condition: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - IfTrue: &expr.Ternary{ - Condition: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - IfTrue: &expr.Variable{VarName: &node.Identifier{Value: "c"}}, - IfFalse: &expr.Variable{VarName: &node.Identifier{Value: "d"}}, - }, - IfFalse: &expr.Variable{VarName: &node.Identifier{Value: "e"}}, - }, - }, - &stmt.Expression{ - Expr: &expr.Ternary{ - Condition: &expr.Ternary{ - Condition: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - IfTrue: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - IfFalse: &expr.Variable{VarName: &node.Identifier{Value: "c"}}, - }, - IfTrue: &expr.Variable{VarName: &node.Identifier{Value: "d"}}, - IfFalse: &expr.Variable{VarName: &node.Identifier{Value: "e"}}, - }, - }, - &stmt.Expression{ - Expr: &expr.UnaryMinus{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - }, - }, - &stmt.Expression{ - Expr: &expr.UnaryPlus{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - }, - }, - &stmt.Expression{ - Expr: &expr.Variable{VarName: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, - }, - &stmt.Expression{ - Expr: &expr.Variable{VarName: &expr.Variable{VarName: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}}, - }, - &stmt.Expression{ - Expr: &expr.Yield{}, - }, - &stmt.Expression{ - Expr: &expr.Yield{ - Value: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - }, - }, - &stmt.Expression{ - Expr: &expr.Yield{ - Key: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Value: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - }, - &stmt.Expression{ - Expr: &expr.Yield{ - Value: &expr.ClassConstFetch{ - Class: &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "Foo"}, - }, - }, - ConstantName: &node.Identifier{Value: "class"}, - }, - }, - }, - &stmt.Expression{ - Expr: &expr.Yield{ - Key: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Value: &expr.ClassConstFetch{ - Class: &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "Foo"}, - }, - }, - ConstantName: &node.Identifier{Value: "class"}, - }, - }, - }, - &stmt.Expression{ - Expr: &cast.Array{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - }, - }, - &stmt.Expression{ - Expr: &cast.Bool{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - }, - }, - &stmt.Expression{ - Expr: &cast.Bool{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - }, - }, - &stmt.Expression{ - Expr: &cast.Double{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - }, - }, - &stmt.Expression{ - Expr: &cast.Double{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - }, - }, - &stmt.Expression{ - Expr: &cast.Int{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - }, - }, - &stmt.Expression{ - Expr: &cast.Int{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - }, - }, - &stmt.Expression{ - Expr: &cast.Object{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - }, - }, - &stmt.Expression{ - Expr: &cast.String{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - }, - }, - &stmt.Expression{ - Expr: &cast.Unset{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - }, - }, - &stmt.Expression{ - Expr: &binary.BitwiseAnd{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - }, - &stmt.Expression{ - Expr: &binary.BitwiseOr{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - }, - &stmt.Expression{ - Expr: &binary.BitwiseXor{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - }, - &stmt.Expression{ - Expr: &binary.BooleanAnd{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - }, - &stmt.Expression{ - Expr: &binary.BooleanOr{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - }, - &stmt.Expression{ - Expr: &binary.Concat{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - }, - &stmt.Expression{ - Expr: &binary.Div{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - }, - &stmt.Expression{ - Expr: &binary.Equal{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - }, - &stmt.Expression{ - Expr: &binary.GreaterOrEqual{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - }, - &stmt.Expression{ - Expr: &binary.Greater{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - }, - &stmt.Expression{ - Expr: &binary.Identical{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - }, - &stmt.Expression{ - Expr: &binary.LogicalAnd{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - }, - &stmt.Expression{ - Expr: &binary.LogicalOr{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - }, - &stmt.Expression{ - Expr: &binary.LogicalXor{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - }, - &stmt.Expression{ - Expr: &binary.Minus{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - }, - &stmt.Expression{ - Expr: &binary.Mod{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - }, - &stmt.Expression{ - Expr: &binary.Mul{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - }, - &stmt.Expression{ - Expr: &binary.NotEqual{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - }, - &stmt.Expression{ - Expr: &binary.NotIdentical{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - }, - &stmt.Expression{ - Expr: &binary.Plus{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - }, - &stmt.Expression{ - Expr: &binary.Pow{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - }, - &stmt.Expression{ - Expr: &binary.ShiftLeft{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - }, - &stmt.Expression{ - Expr: &binary.ShiftRight{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - }, - &stmt.Expression{ - Expr: &binary.SmallerOrEqual{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - }, - &stmt.Expression{ - Expr: &binary.Smaller{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - }, - &stmt.Expression{ - Expr: &assign.Reference{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expression: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - }, - &stmt.Expression{ - Expr: &assign.Reference{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expression: &expr.New{ - Class: &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "Foo"}, - }, - }, - }, - }, - }, - &stmt.Expression{ - Expr: &assign.Reference{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expression: &expr.New{ - Class: &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "Foo"}, - }, - }, - ArgumentList: &node.ArgumentList{ - Arguments: []node.Node{ - &node.Argument{ - Variadic: false, - IsReference: false, - Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - }, - }, - }, - }, - }, - &stmt.Expression{ - Expr: &assign.Assign{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expression: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - }, - &stmt.Expression{ - Expr: &assign.BitwiseAnd{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expression: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - }, - &stmt.Expression{ - Expr: &assign.BitwiseOr{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expression: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - }, - &stmt.Expression{ - Expr: &assign.BitwiseXor{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expression: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - }, - &stmt.Expression{ - Expr: &assign.Concat{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expression: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - }, - &stmt.Expression{ - Expr: &assign.Div{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expression: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - }, - &stmt.Expression{ - Expr: &assign.Minus{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expression: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - }, - &stmt.Expression{ - Expr: &assign.Mod{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expression: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - }, - &stmt.Expression{ - Expr: &assign.Mul{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expression: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - }, - &stmt.Expression{ - Expr: &assign.Plus{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expression: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - }, - &stmt.Expression{ - Expr: &assign.Pow{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expression: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - }, - &stmt.Expression{ - Expr: &assign.ShiftLeft{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expression: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - }, - &stmt.Expression{ - Expr: &assign.ShiftRight{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expression: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - }, - &stmt.Expression{ - Expr: &expr.New{ - Class: &name.FullyQualified{ - Parts: []node.Node{ - &name.NamePart{Value: "Foo"}, - }, - }, - ArgumentList: &node.ArgumentList{}, - }, - }, - &stmt.Expression{ - Expr: &expr.PropertyFetch{ - Variable: &expr.MethodCall{ - Variable: &expr.New{ - Class: &name.FullyQualified{ - Parts: []node.Node{ - &name.NamePart{Value: "Foo"}, - }, - }, - ArgumentList: &node.ArgumentList{}, - }, - Method: &node.Identifier{Value: "bar"}, - ArgumentList: &node.ArgumentList{}, - }, - Property: &node.Identifier{Value: "baz"}, - }, - }, - &stmt.Expression{ - Expr: &expr.ArrayDimFetch{ - Variable: &expr.ArrayDimFetch{ - Variable: &expr.New{ - Class: &name.FullyQualified{ - Parts: []node.Node{ - &name.NamePart{Value: "Foo"}, - }, - }, - ArgumentList: &node.ArgumentList{}, - }, - Dim: &scalar.Lnumber{Value: "0"}, - }, - Dim: &scalar.Lnumber{Value: "0"}, - }, - }, - &stmt.Expression{ - Expr: &expr.MethodCall{ - Variable: &expr.ArrayDimFetch{ - Variable: &expr.New{ - Class: &name.FullyQualified{ - Parts: []node.Node{ - &name.NamePart{Value: "Foo"}, - }, - }, - ArgumentList: &node.ArgumentList{}, - }, - Dim: &scalar.Lnumber{Value: "0"}, - }, - Method: &node.Identifier{Value: "bar"}, - ArgumentList: &node.ArgumentList{}, - }, - }, - &stmt.Expression{ - Expr: &expr.ArrayDimFetch{ - Variable: &expr.ArrayDimFetch{ - Variable: &expr.Array{ - Items: []node.Node{ - &expr.ArrayItem{ - Val: &expr.ShortArray{ - Items: []node.Node{ - &expr.ArrayItem{ - Val: &scalar.Lnumber{Value: "0"}, - }, - }, - }, - }, - }, - }, - Dim: &scalar.Lnumber{Value: "0"}, - }, - Dim: &scalar.Lnumber{Value: "0"}, - }, - }, - &stmt.Expression{ - Expr: &expr.ArrayDimFetch{ - Variable: &scalar.String{Value: "\"foo\""}, - Dim: &scalar.Lnumber{Value: "0"}, - }, - }, - &stmt.Expression{ - Expr: &expr.ArrayDimFetch{ - Variable: &expr.ConstFetch{ - Constant: &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "foo"}, - }, - }, - }, - Dim: &scalar.Lnumber{Value: "0"}, - }, - }, - &stmt.Expression{ - Expr: &expr.ClassConstFetch{ - Class: &node.Identifier{Value: "static"}, - ConstantName: &node.Identifier{Value: "foo"}, - }, - }, - &stmt.Expression{ - Expr: &expr.New{ - Class: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, - }, - }, - &stmt.Expression{ - Expr: &expr.New{ - Class: &expr.StaticPropertyFetch{ - Class: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, - Property: &expr.Variable{VarName: &node.Identifier{Value: "bar"}}, - }, - }, - }, - &stmt.Expression{ - Expr: &expr.New{ - Class: &expr.ArrayDimFetch{ - Variable: &expr.PropertyFetch{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Property: &node.Identifier{Value: "b"}, - }, - Dim: &scalar.Lnumber{Value: "0"}, - }, - }, - }, - &stmt.Expression{ - Expr: &expr.New{ - Class: &expr.ArrayDimFetch{ - Variable: &expr.PropertyFetch{ - Variable: &expr.PropertyFetch{ - Variable: &expr.ArrayDimFetch{ - Variable: &expr.PropertyFetch{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Property: &node.Identifier{Value: "b"}, - }, - Dim: &expr.Ternary{ - Condition: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - IfFalse: &expr.ConstFetch{ - Constant: &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "null"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 146, + EndLine: 146, + StartPos: 3266, + EndPos: 3269, + }, + Value: "Quux", }, }, }, }, }, - Property: &expr.Variable{VarName: &node.Identifier{Value: "c"}}, - }, - Property: &node.Identifier{Value: "d"}, - }, - Dim: &scalar.Lnumber{Value: "0"}, - }, - }, - }, - &stmt.Static{ - Vars: []node.Node{ - &stmt.StaticVar{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expr: &expr.ArrayDimFetch{ - Variable: &expr.ShortArray{ - Items: []node.Node{ - &expr.ArrayItem{ - Val: &scalar.Lnumber{Value: "1"}, + &stmt.TraitUseAlias{ + Position: &position.Position{ + StartLine: 146, + EndLine: 146, + StartPos: 3272, + EndPos: 3286, + }, + Ref: &stmt.TraitMethodRef{ + Position: &position.Position{ + StartLine: 146, + EndLine: 146, + StartPos: 3272, + EndPos: 3279, + }, + Trait: &name.Name{ + Position: &position.Position{ + StartLine: 146, + EndLine: 146, + StartPos: 3272, + EndPos: 3274, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 146, + EndLine: 146, + StartPos: 3272, + EndPos: 3274, + }, + Value: "Baz", + }, + }, + }, + Method: &node.Identifier{ + Position: &position.Position{ + StartLine: 146, + EndLine: 146, + StartPos: 3277, + EndPos: 3279, + }, + Value: "one", + }, + }, + Alias: &node.Identifier{ + Position: &position.Position{ + StartLine: 146, + EndLine: 146, + StartPos: 3284, + EndPos: 3286, + }, + Value: "two", }, }, }, - Dim: &scalar.Lnumber{Value: "0"}, }, }, }, }, - &stmt.Static{ - Vars: []node.Node{ - &stmt.StaticVar{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expr: &expr.BooleanNot{ - Expr: &scalar.Lnumber{Value: "1"}, + &stmt.Try{ + Position: &position.Position{ + StartLine: 148, + EndLine: -1, + StartPos: 3296, + EndPos: -1, + }, + Stmts: []node.Node{ + }, + Catches: []node.Node{ + }, + }, + &stmt.Try{ + Position: &position.Position{ + StartLine: 149, + EndLine: 149, + StartPos: 3305, + EndPos: 3334, + }, + Stmts: []node.Node{ + }, + Catches: []node.Node{ + &stmt.Catch{ + Position: &position.Position{ + StartLine: 149, + EndLine: 149, + StartPos: 3312, + EndPos: 3334, }, - }, - }, - }, - &stmt.Static{ - Vars: []node.Node{ - &stmt.StaticVar{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expr: &expr.BitwiseNot{ - Expr: &scalar.Lnumber{Value: "1"}, - }, - }, - }, - }, - &stmt.Static{ - Vars: []node.Node{ - &stmt.StaticVar{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expr: &expr.UnaryPlus{ - Expr: &scalar.Lnumber{Value: "1"}, - }, - }, - }, - }, - &stmt.Static{ - Vars: []node.Node{ - &stmt.StaticVar{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expr: &expr.UnaryMinus{ - Expr: &scalar.Lnumber{Value: "1"}, - }, - }, - }, - }, - &stmt.Static{ - Vars: []node.Node{ - &stmt.StaticVar{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expr: &scalar.Lnumber{Value: "1"}, - }, - }, - }, - &stmt.Static{ - Vars: []node.Node{ - &stmt.StaticVar{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expr: &expr.Ternary{ - Condition: &scalar.Lnumber{Value: "1"}, - IfFalse: &scalar.Lnumber{Value: "2"}, - }, - }, - }, - }, - &stmt.Static{ - Vars: []node.Node{ - &stmt.StaticVar{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expr: &expr.Ternary{ - Condition: &scalar.Lnumber{Value: "1"}, - IfTrue: &scalar.Lnumber{Value: "2"}, - IfFalse: &scalar.Lnumber{Value: "3"}, - }, - }, - }, - }, - &stmt.Static{ - Vars: []node.Node{ - &stmt.StaticVar{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expr: &binary.BitwiseAnd{ - Left: &scalar.Lnumber{Value: "1"}, - Right: &scalar.Lnumber{Value: "2"}, - }, - }, - }, - }, - &stmt.Static{ - Vars: []node.Node{ - &stmt.StaticVar{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expr: &binary.BitwiseOr{ - Left: &scalar.Lnumber{Value: "1"}, - Right: &scalar.Lnumber{Value: "2"}, - }, - }, - }, - }, - &stmt.Static{ - Vars: []node.Node{ - &stmt.StaticVar{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expr: &binary.BitwiseXor{ - Left: &scalar.Lnumber{Value: "1"}, - Right: &scalar.Lnumber{Value: "2"}, - }, - }, - }, - }, - &stmt.Static{ - Vars: []node.Node{ - &stmt.StaticVar{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expr: &binary.BooleanAnd{ - Left: &scalar.Lnumber{Value: "1"}, - Right: &scalar.Lnumber{Value: "2"}, - }, - }, - }, - }, - &stmt.Static{ - Vars: []node.Node{ - &stmt.StaticVar{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expr: &binary.BooleanOr{ - Left: &scalar.Lnumber{Value: "1"}, - Right: &scalar.Lnumber{Value: "2"}, - }, - }, - }, - }, - &stmt.Static{ - Vars: []node.Node{ - &stmt.StaticVar{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expr: &binary.Concat{ - Left: &scalar.Lnumber{Value: "1"}, - Right: &scalar.Lnumber{Value: "2"}, - }, - }, - }, - }, - &stmt.Static{ - Vars: []node.Node{ - &stmt.StaticVar{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expr: &binary.Div{ - Left: &scalar.Lnumber{Value: "1"}, - Right: &scalar.Lnumber{Value: "2"}, - }, - }, - }, - }, - &stmt.Static{ - Vars: []node.Node{ - &stmt.StaticVar{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expr: &binary.Equal{ - Left: &scalar.Lnumber{Value: "1"}, - Right: &scalar.Lnumber{Value: "2"}, - }, - }, - }, - }, - &stmt.Static{ - Vars: []node.Node{ - &stmt.StaticVar{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expr: &binary.GreaterOrEqual{ - Left: &scalar.Lnumber{Value: "1"}, - Right: &scalar.Lnumber{Value: "2"}, - }, - }, - }, - }, - &stmt.Static{ - Vars: []node.Node{ - &stmt.StaticVar{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expr: &binary.Greater{ - Left: &scalar.Lnumber{Value: "1"}, - Right: &scalar.Lnumber{Value: "2"}, - }, - }, - }, - }, - &stmt.Static{ - Vars: []node.Node{ - &stmt.StaticVar{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expr: &binary.Identical{ - Left: &scalar.Lnumber{Value: "1"}, - Right: &scalar.Lnumber{Value: "2"}, - }, - }, - }, - }, - &stmt.Static{ - Vars: []node.Node{ - &stmt.StaticVar{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expr: &binary.LogicalAnd{ - Left: &scalar.Lnumber{Value: "1"}, - Right: &scalar.Lnumber{Value: "2"}, - }, - }, - }, - }, - &stmt.Static{ - Vars: []node.Node{ - &stmt.StaticVar{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expr: &binary.LogicalOr{ - Left: &scalar.Lnumber{Value: "1"}, - Right: &scalar.Lnumber{Value: "2"}, - }, - }, - }, - }, - &stmt.Static{ - Vars: []node.Node{ - &stmt.StaticVar{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expr: &binary.LogicalXor{ - Left: &scalar.Lnumber{Value: "1"}, - Right: &scalar.Lnumber{Value: "2"}, - }, - }, - }, - }, - &stmt.Static{ - Vars: []node.Node{ - &stmt.StaticVar{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expr: &binary.Minus{ - Left: &scalar.Lnumber{Value: "1"}, - Right: &scalar.Lnumber{Value: "2"}, - }, - }, - }, - }, - &stmt.Static{ - Vars: []node.Node{ - &stmt.StaticVar{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expr: &binary.Mod{ - Left: &scalar.Lnumber{Value: "1"}, - Right: &scalar.Lnumber{Value: "2"}, - }, - }, - }, - }, - &stmt.Static{ - Vars: []node.Node{ - &stmt.StaticVar{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expr: &binary.Mul{ - Left: &scalar.Lnumber{Value: "1"}, - Right: &scalar.Lnumber{Value: "2"}, - }, - }, - }, - }, - &stmt.Static{ - Vars: []node.Node{ - &stmt.StaticVar{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expr: &binary.NotEqual{ - Left: &scalar.Lnumber{Value: "1"}, - Right: &scalar.Lnumber{Value: "2"}, - }, - }, - }, - }, - &stmt.Static{ - Vars: []node.Node{ - &stmt.StaticVar{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expr: &binary.NotIdentical{ - Left: &scalar.Lnumber{Value: "1"}, - Right: &scalar.Lnumber{Value: "2"}, - }, - }, - }, - }, - &stmt.Static{ - Vars: []node.Node{ - &stmt.StaticVar{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expr: &binary.Plus{ - Left: &scalar.Lnumber{Value: "1"}, - Right: &scalar.Lnumber{Value: "2"}, - }, - }, - }, - }, - &stmt.Static{ - Vars: []node.Node{ - &stmt.StaticVar{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expr: &binary.Pow{ - Left: &scalar.Lnumber{Value: "1"}, - Right: &scalar.Lnumber{Value: "2"}, - }, - }, - }, - }, - &stmt.Static{ - Vars: []node.Node{ - &stmt.StaticVar{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expr: &binary.ShiftLeft{ - Left: &scalar.Lnumber{Value: "1"}, - Right: &scalar.Lnumber{Value: "2"}, - }, - }, - }, - }, - &stmt.Static{ - Vars: []node.Node{ - &stmt.StaticVar{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expr: &binary.ShiftRight{ - Left: &scalar.Lnumber{Value: "1"}, - Right: &scalar.Lnumber{Value: "2"}, - }, - }, - }, - }, - &stmt.Static{ - Vars: []node.Node{ - &stmt.StaticVar{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expr: &binary.SmallerOrEqual{ - Left: &scalar.Lnumber{Value: "1"}, - Right: &scalar.Lnumber{Value: "2"}, - }, - }, - }, - }, - &stmt.Static{ - Vars: []node.Node{ - &stmt.StaticVar{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expr: &binary.Smaller{ - Left: &scalar.Lnumber{Value: "1"}, - Right: &scalar.Lnumber{Value: "2"}, - }, - }, - }, - }, - &stmt.Static{ - Vars: []node.Node{ - &stmt.StaticVar{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expr: &expr.ClassConstFetch{ - Class: &name.Name{ + Types: []node.Node{ + &name.Name{ + Position: &position.Position{ + StartLine: 149, + EndLine: 149, + StartPos: 3319, + EndPos: 3327, + }, Parts: []node.Node{ - &name.NamePart{Value: "Foo"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 149, + EndLine: 149, + StartPos: 3319, + EndPos: 3327, + }, + Value: "Exception", + }, }, }, - ConstantName: &node.Identifier{Value: "bar"}, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 149, + EndLine: 149, + StartPos: 3329, + EndPos: 3330, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 149, + EndLine: 149, + StartPos: 3329, + EndPos: 3330, + }, + Value: "e", + }, + }, + Stmts: []node.Node{ }, }, }, }, - &stmt.Static{ - Vars: []node.Node{ - &stmt.StaticVar{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expr: &expr.ClassConstFetch{ - Class: &name.Name{ + &stmt.Try{ + Position: &position.Position{ + StartLine: 150, + EndLine: 150, + StartPos: 3338, + EndPos: 3398, + }, + Stmts: []node.Node{ + }, + Catches: []node.Node{ + &stmt.Catch{ + Position: &position.Position{ + StartLine: 150, + EndLine: 150, + StartPos: 3345, + EndPos: 3367, + }, + Types: []node.Node{ + &name.Name{ + Position: &position.Position{ + StartLine: 150, + EndLine: 150, + StartPos: 3352, + EndPos: 3360, + }, Parts: []node.Node{ - &name.NamePart{Value: "Foo"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 150, + EndLine: 150, + StartPos: 3352, + EndPos: 3360, + }, + Value: "Exception", + }, }, }, - ConstantName: &node.Identifier{Value: "class"}, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 150, + EndLine: 150, + StartPos: 3362, + EndPos: 3363, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 150, + EndLine: 150, + StartPos: 3362, + EndPos: 3363, + }, + Value: "e", + }, + }, + Stmts: []node.Node{ + }, + }, + &stmt.Catch{ + Position: &position.Position{ + StartLine: 150, + EndLine: 150, + StartPos: 3369, + EndPos: 3398, + }, + Types: []node.Node{ + &name.Name{ + Position: &position.Position{ + StartLine: 150, + EndLine: 150, + StartPos: 3376, + EndPos: 3391, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 150, + EndLine: 150, + StartPos: 3376, + EndPos: 3391, + }, + Value: "RuntimeException", + }, + }, + }, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 150, + EndLine: 150, + StartPos: 3393, + EndPos: 3394, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 150, + EndLine: 150, + StartPos: 3393, + EndPos: 3394, + }, + Value: "e", + }, + }, + Stmts: []node.Node{ }, }, }, }, - &stmt.Static{ - Vars: []node.Node{ - &stmt.StaticVar{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expr: &scalar.MagicConstant{Value: "__CLASS__"}, + &stmt.Try{ + Position: &position.Position{ + StartLine: 151, + EndLine: 151, + StartPos: 3402, + EndPos: 3505, + }, + Stmts: []node.Node{ + }, + Catches: []node.Node{ + &stmt.Catch{ + Position: &position.Position{ + StartLine: 151, + EndLine: 151, + StartPos: 3409, + EndPos: 3431, + }, + Types: []node.Node{ + &name.Name{ + Position: &position.Position{ + StartLine: 151, + EndLine: 151, + StartPos: 3416, + EndPos: 3424, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 151, + EndLine: 151, + StartPos: 3416, + EndPos: 3424, + }, + Value: "Exception", + }, + }, + }, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 151, + EndLine: 151, + StartPos: 3426, + EndPos: 3427, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 151, + EndLine: 151, + StartPos: 3426, + EndPos: 3427, + }, + Value: "e", + }, + }, + Stmts: []node.Node{ + }, + }, + &stmt.Catch{ + Position: &position.Position{ + StartLine: 151, + EndLine: 151, + StartPos: 3433, + EndPos: 3463, + }, + Types: []node.Node{ + &name.FullyQualified{ + Position: &position.Position{ + StartLine: 151, + EndLine: 151, + StartPos: 3440, + EndPos: 3456, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 151, + EndLine: 151, + StartPos: 3441, + EndPos: 3456, + }, + Value: "RuntimeException", + }, + }, + }, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 151, + EndLine: 151, + StartPos: 3458, + EndPos: 3459, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 151, + EndLine: 151, + StartPos: 3458, + EndPos: 3459, + }, + Value: "e", + }, + }, + Stmts: []node.Node{ + }, + }, + &stmt.Catch{ + Position: &position.Position{ + StartLine: 151, + EndLine: 151, + StartPos: 3465, + EndPos: 3505, + }, + Types: []node.Node{ + &name.Relative{ + Position: &position.Position{ + StartLine: 151, + EndLine: 151, + StartPos: 3472, + EndPos: 3498, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 151, + EndLine: 151, + StartPos: 3482, + EndPos: 3498, + }, + Value: "AdditionException", + }, + }, + }, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 151, + EndLine: 151, + StartPos: 3500, + EndPos: 3501, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 151, + EndLine: 151, + StartPos: 3500, + EndPos: 3501, + }, + Value: "e", + }, + }, + Stmts: []node.Node{ + }, }, }, }, - &stmt.Static{ + &stmt.Try{ + Position: &position.Position{ + StartLine: 152, + EndLine: 152, + StartPos: 3509, + EndPos: 3549, + }, + Stmts: []node.Node{ + }, + Catches: []node.Node{ + &stmt.Catch{ + Position: &position.Position{ + StartLine: 152, + EndLine: 152, + StartPos: 3516, + EndPos: 3538, + }, + Types: []node.Node{ + &name.Name{ + Position: &position.Position{ + StartLine: 152, + EndLine: 152, + StartPos: 3523, + EndPos: 3531, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 152, + EndLine: 152, + StartPos: 3523, + EndPos: 3531, + }, + Value: "Exception", + }, + }, + }, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 152, + EndLine: 152, + StartPos: 3533, + EndPos: 3534, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 152, + EndLine: 152, + StartPos: 3533, + EndPos: 3534, + }, + Value: "e", + }, + }, + Stmts: []node.Node{ + }, + }, + }, + Finally: &stmt.Finally{ + Position: &position.Position{ + StartLine: 152, + EndLine: 152, + StartPos: 3540, + EndPos: 3549, + }, + Stmts: []node.Node{ + }, + }, + }, + &stmt.Unset{ + Position: &position.Position{ + StartLine: 154, + EndLine: 154, + StartPos: 3554, + EndPos: 3567, + }, Vars: []node.Node{ - &stmt.StaticVar{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expr: &expr.ConstFetch{ + &expr.Variable{ + Position: &position.Position{ + StartLine: 154, + EndLine: 154, + StartPos: 3560, + EndPos: 3561, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 154, + EndLine: 154, + StartPos: 3560, + EndPos: 3561, + }, + Value: "a", + }, + }, + &expr.Variable{ + Position: &position.Position{ + StartLine: 154, + EndLine: 154, + StartPos: 3564, + EndPos: 3565, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 154, + EndLine: 154, + StartPos: 3564, + EndPos: 3565, + }, + Value: "b", + }, + }, + }, + }, + &stmt.UseList{ + Position: &position.Position{ + StartLine: 156, + EndLine: 156, + StartPos: 3572, + EndPos: 3579, + }, + Uses: []node.Node{ + &stmt.Use{ + Position: &position.Position{ + StartLine: 156, + EndLine: 156, + StartPos: 3576, + EndPos: 3578, + }, + Use: &name.Name{ + Position: &position.Position{ + StartLine: 156, + EndLine: 156, + StartPos: 3576, + EndPos: 3578, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 156, + EndLine: 156, + StartPos: 3576, + EndPos: 3578, + }, + Value: "Foo", + }, + }, + }, + }, + }, + }, + &stmt.UseList{ + Position: &position.Position{ + StartLine: 157, + EndLine: 157, + StartPos: 3583, + EndPos: 3591, + }, + Uses: []node.Node{ + &stmt.Use{ + Position: &position.Position{ + StartLine: 157, + EndLine: 157, + StartPos: 3588, + EndPos: 3590, + }, + Use: &name.Name{ + Position: &position.Position{ + StartLine: 157, + EndLine: 157, + StartPos: 3588, + EndPos: 3590, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 157, + EndLine: 157, + StartPos: 3588, + EndPos: 3590, + }, + Value: "Foo", + }, + }, + }, + }, + }, + }, + &stmt.UseList{ + Position: &position.Position{ + StartLine: 158, + EndLine: 158, + StartPos: 3595, + EndPos: 3610, + }, + Uses: []node.Node{ + &stmt.Use{ + Position: &position.Position{ + StartLine: 158, + EndLine: 158, + StartPos: 3600, + EndPos: 3609, + }, + Use: &name.Name{ + Position: &position.Position{ + StartLine: 158, + EndLine: 158, + StartPos: 3600, + EndPos: 3602, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 158, + EndLine: 158, + StartPos: 3600, + EndPos: 3602, + }, + Value: "Foo", + }, + }, + }, + Alias: &node.Identifier{ + Position: &position.Position{ + StartLine: 158, + EndLine: 158, + StartPos: 3607, + EndPos: 3609, + }, + Value: "Bar", + }, + }, + }, + }, + &stmt.UseList{ + Position: &position.Position{ + StartLine: 159, + EndLine: 159, + StartPos: 3614, + EndPos: 3626, + }, + Uses: []node.Node{ + &stmt.Use{ + Position: &position.Position{ + StartLine: 159, + EndLine: 159, + StartPos: 3618, + EndPos: 3620, + }, + Use: &name.Name{ + Position: &position.Position{ + StartLine: 159, + EndLine: 159, + StartPos: 3618, + EndPos: 3620, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 159, + EndLine: 159, + StartPos: 3618, + EndPos: 3620, + }, + Value: "Foo", + }, + }, + }, + }, + &stmt.Use{ + Position: &position.Position{ + StartLine: 159, + EndLine: 159, + StartPos: 3623, + EndPos: 3625, + }, + Use: &name.Name{ + Position: &position.Position{ + StartLine: 159, + EndLine: 159, + StartPos: 3623, + EndPos: 3625, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 159, + EndLine: 159, + StartPos: 3623, + EndPos: 3625, + }, + Value: "Bar", + }, + }, + }, + }, + }, + }, + &stmt.UseList{ + Position: &position.Position{ + StartLine: 160, + EndLine: 160, + StartPos: 3630, + EndPos: 3649, + }, + Uses: []node.Node{ + &stmt.Use{ + Position: &position.Position{ + StartLine: 160, + EndLine: 160, + StartPos: 3634, + EndPos: 3636, + }, + Use: &name.Name{ + Position: &position.Position{ + StartLine: 160, + EndLine: 160, + StartPos: 3634, + EndPos: 3636, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 160, + EndLine: 160, + StartPos: 3634, + EndPos: 3636, + }, + Value: "Foo", + }, + }, + }, + }, + &stmt.Use{ + Position: &position.Position{ + StartLine: 160, + EndLine: 160, + StartPos: 3639, + EndPos: 3648, + }, + Use: &name.Name{ + Position: &position.Position{ + StartLine: 160, + EndLine: 160, + StartPos: 3639, + EndPos: 3641, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 160, + EndLine: 160, + StartPos: 3639, + EndPos: 3641, + }, + Value: "Bar", + }, + }, + }, + Alias: &node.Identifier{ + Position: &position.Position{ + StartLine: 160, + EndLine: 160, + StartPos: 3646, + EndPos: 3648, + }, + Value: "Baz", + }, + }, + }, + }, + &stmt.UseList{ + Position: &position.Position{ + StartLine: 161, + EndLine: 161, + StartPos: 3653, + EndPos: 3675, + }, + UseType: &node.Identifier{ + Position: &position.Position{ + StartLine: 161, + EndLine: 161, + StartPos: 3657, + EndPos: 3664, + }, + Value: "function", + }, + Uses: []node.Node{ + &stmt.Use{ + Position: &position.Position{ + StartLine: 161, + EndLine: 161, + StartPos: 3666, + EndPos: 3668, + }, + Use: &name.Name{ + Position: &position.Position{ + StartLine: 161, + EndLine: 161, + StartPos: 3666, + EndPos: 3668, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 161, + EndLine: 161, + StartPos: 3666, + EndPos: 3668, + }, + Value: "Foo", + }, + }, + }, + }, + &stmt.Use{ + Position: &position.Position{ + StartLine: 161, + EndLine: 161, + StartPos: 3672, + EndPos: 3674, + }, + Use: &name.Name{ + Position: &position.Position{ + StartLine: 161, + EndLine: 161, + StartPos: 3672, + EndPos: 3674, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 161, + EndLine: 161, + StartPos: 3672, + EndPos: 3674, + }, + Value: "Bar", + }, + }, + }, + }, + }, + }, + &stmt.UseList{ + Position: &position.Position{ + StartLine: 162, + EndLine: 162, + StartPos: 3679, + EndPos: 3715, + }, + UseType: &node.Identifier{ + Position: &position.Position{ + StartLine: 162, + EndLine: 162, + StartPos: 3683, + EndPos: 3690, + }, + Value: "function", + }, + Uses: []node.Node{ + &stmt.Use{ + Position: &position.Position{ + StartLine: 162, + EndLine: 162, + StartPos: 3692, + EndPos: 3701, + }, + Use: &name.Name{ + Position: &position.Position{ + StartLine: 162, + EndLine: 162, + StartPos: 3692, + EndPos: 3694, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 162, + EndLine: 162, + StartPos: 3692, + EndPos: 3694, + }, + Value: "Foo", + }, + }, + }, + Alias: &node.Identifier{ + Position: &position.Position{ + StartLine: 162, + EndLine: 162, + StartPos: 3699, + EndPos: 3701, + }, + Value: "foo", + }, + }, + &stmt.Use{ + Position: &position.Position{ + StartLine: 162, + EndLine: 162, + StartPos: 3705, + EndPos: 3714, + }, + Use: &name.Name{ + Position: &position.Position{ + StartLine: 162, + EndLine: 162, + StartPos: 3705, + EndPos: 3707, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 162, + EndLine: 162, + StartPos: 3705, + EndPos: 3707, + }, + Value: "Bar", + }, + }, + }, + Alias: &node.Identifier{ + Position: &position.Position{ + StartLine: 162, + EndLine: 162, + StartPos: 3712, + EndPos: 3714, + }, + Value: "bar", + }, + }, + }, + }, + &stmt.UseList{ + Position: &position.Position{ + StartLine: 163, + EndLine: 163, + StartPos: 3719, + EndPos: 3738, + }, + UseType: &node.Identifier{ + Position: &position.Position{ + StartLine: 163, + EndLine: 163, + StartPos: 3723, + EndPos: 3727, + }, + Value: "const", + }, + Uses: []node.Node{ + &stmt.Use{ + Position: &position.Position{ + StartLine: 163, + EndLine: 163, + StartPos: 3729, + EndPos: 3731, + }, + Use: &name.Name{ + Position: &position.Position{ + StartLine: 163, + EndLine: 163, + StartPos: 3729, + EndPos: 3731, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 163, + EndLine: 163, + StartPos: 3729, + EndPos: 3731, + }, + Value: "Foo", + }, + }, + }, + }, + &stmt.Use{ + Position: &position.Position{ + StartLine: 163, + EndLine: 163, + StartPos: 3735, + EndPos: 3737, + }, + Use: &name.Name{ + Position: &position.Position{ + StartLine: 163, + EndLine: 163, + StartPos: 3735, + EndPos: 3737, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 163, + EndLine: 163, + StartPos: 3735, + EndPos: 3737, + }, + Value: "Bar", + }, + }, + }, + }, + }, + }, + &stmt.UseList{ + Position: &position.Position{ + StartLine: 164, + EndLine: 164, + StartPos: 3742, + EndPos: 3775, + }, + UseType: &node.Identifier{ + Position: &position.Position{ + StartLine: 164, + EndLine: 164, + StartPos: 3746, + EndPos: 3750, + }, + Value: "const", + }, + Uses: []node.Node{ + &stmt.Use{ + Position: &position.Position{ + StartLine: 164, + EndLine: 164, + StartPos: 3752, + EndPos: 3761, + }, + Use: &name.Name{ + Position: &position.Position{ + StartLine: 164, + EndLine: 164, + StartPos: 3752, + EndPos: 3754, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 164, + EndLine: 164, + StartPos: 3752, + EndPos: 3754, + }, + Value: "Foo", + }, + }, + }, + Alias: &node.Identifier{ + Position: &position.Position{ + StartLine: 164, + EndLine: 164, + StartPos: 3759, + EndPos: 3761, + }, + Value: "foo", + }, + }, + &stmt.Use{ + Position: &position.Position{ + StartLine: 164, + EndLine: 164, + StartPos: 3765, + EndPos: 3774, + }, + Use: &name.Name{ + Position: &position.Position{ + StartLine: 164, + EndLine: 164, + StartPos: 3765, + EndPos: 3767, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 164, + EndLine: 164, + StartPos: 3765, + EndPos: 3767, + }, + Value: "Bar", + }, + }, + }, + Alias: &node.Identifier{ + Position: &position.Position{ + StartLine: 164, + EndLine: 164, + StartPos: 3772, + EndPos: 3774, + }, + Value: "bar", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 166, + EndLine: 166, + StartPos: 3780, + EndPos: 3785, + }, + Expr: &expr.ArrayDimFetch{ + Position: &position.Position{ + StartLine: 166, + EndLine: 166, + StartPos: 3780, + EndPos: 3784, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 166, + EndLine: 166, + StartPos: 3780, + EndPos: 3781, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 166, + EndLine: 166, + StartPos: 3780, + EndPos: 3781, + }, + Value: "a", + }, + }, + Dim: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 166, + EndLine: 166, + StartPos: 3783, + EndPos: 3783, + }, + Value: "1", + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 167, + EndLine: 167, + StartPos: 3789, + EndPos: 3797, + }, + Expr: &expr.ArrayDimFetch{ + Position: &position.Position{ + StartLine: 167, + EndLine: 167, + StartPos: 3789, + EndPos: 3796, + }, + Variable: &expr.ArrayDimFetch{ + Position: &position.Position{ + StartLine: 167, + EndLine: 167, + StartPos: 3789, + EndPos: 3793, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 167, + EndLine: 167, + StartPos: 3789, + EndPos: 3790, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 167, + EndLine: 167, + StartPos: 3789, + EndPos: 3790, + }, + Value: "a", + }, + }, + Dim: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 167, + EndLine: 167, + StartPos: 3792, + EndPos: 3792, + }, + Value: "1", + }, + }, + Dim: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 167, + EndLine: 167, + StartPos: 3795, + EndPos: 3795, + }, + Value: "2", + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 168, + EndLine: 168, + StartPos: 3801, + EndPos: 3808, + }, + Expr: &expr.Array{ + Position: &position.Position{ + StartLine: 168, + EndLine: 168, + StartPos: 3801, + EndPos: 3807, + }, + Items: []node.Node{ + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 169, + EndLine: 169, + StartPos: 3812, + EndPos: 3820, + }, + Expr: &expr.Array{ + Position: &position.Position{ + StartLine: 169, + EndLine: 169, + StartPos: 3812, + EndPos: 3819, + }, + Items: []node.Node{ + &expr.ArrayItem{ + Position: &position.Position{ + StartLine: 169, + EndLine: 169, + StartPos: 3818, + EndPos: 3818, + }, + Val: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 169, + EndLine: 169, + StartPos: 3818, + EndPos: 3818, + }, + Value: "1", + }, + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 170, + EndLine: 170, + StartPos: 3824, + EndPos: 3841, + }, + Expr: &expr.Array{ + Position: &position.Position{ + StartLine: 170, + EndLine: 170, + StartPos: 3824, + EndPos: 3840, + }, + Items: []node.Node{ + &expr.ArrayItem{ + Position: &position.Position{ + StartLine: 170, + EndLine: 170, + StartPos: 3830, + EndPos: 3833, + }, + Key: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 170, + EndLine: 170, + StartPos: 3830, + EndPos: 3830, + }, + Value: "1", + }, + Val: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 170, + EndLine: 170, + StartPos: 3833, + EndPos: 3833, + }, + Value: "1", + }, + }, + &expr.ArrayItem{ + Position: &position.Position{ + StartLine: 170, + EndLine: 170, + StartPos: 3836, + EndPos: 3838, + }, + Val: &expr.Reference{ + Position: &position.Position{ + StartLine: 170, + EndLine: 170, + StartPos: 3836, + EndPos: 3838, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 170, + EndLine: 170, + StartPos: 3837, + EndPos: 3838, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 170, + EndLine: 170, + StartPos: 3837, + EndPos: 3838, + }, + Value: "b", + }, + }, + }, + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 171, + EndLine: 171, + StartPos: 3845, + EndPos: 3859, + }, + Expr: &expr.Array{ + Position: &position.Position{ + StartLine: 171, + EndLine: 171, + StartPos: 3845, + EndPos: 3858, + }, + Items: []node.Node{ + &expr.ArrayItem{ + Position: &position.Position{ + StartLine: 171, + EndLine: 171, + StartPos: 3851, + EndPos: 3857, + }, + Key: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 171, + EndLine: 171, + StartPos: 3851, + EndPos: 3851, + }, + Value: "3", + }, + Val: &expr.Reference{ + Position: &position.Position{ + StartLine: 171, + EndLine: 171, + StartPos: 3855, + EndPos: 3857, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 171, + EndLine: 171, + StartPos: 3856, + EndPos: 3857, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 171, + EndLine: 171, + StartPos: 3856, + EndPos: 3857, + }, + Value: "b", + }, + }, + }, + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 172, + EndLine: 172, + StartPos: 3863, + EndPos: 3891, + }, + Expr: &expr.Array{ + Position: &position.Position{ + StartLine: 172, + EndLine: 172, + StartPos: 3863, + EndPos: 3890, + }, + Items: []node.Node{ + &expr.ArrayItem{ + Position: &position.Position{ + StartLine: 172, + EndLine: 172, + StartPos: 3869, + EndPos: 3871, + }, + Val: &expr.Reference{ + Position: &position.Position{ + StartLine: 172, + EndLine: 172, + StartPos: 3869, + EndPos: 3871, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 172, + EndLine: 172, + StartPos: 3870, + EndPos: 3871, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 172, + EndLine: 172, + StartPos: 3870, + EndPos: 3871, + }, + Value: "b", + }, + }, + }, + }, + &expr.ArrayItem{ + Position: &position.Position{ + StartLine: 172, + EndLine: 172, + StartPos: 3874, + EndPos: 3877, + }, + Key: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 172, + EndLine: 172, + StartPos: 3874, + EndPos: 3874, + }, + Value: "1", + }, + Val: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 172, + EndLine: 172, + StartPos: 3877, + EndPos: 3877, + }, + Value: "1", + }, + }, + &expr.ArrayItem{ + Position: &position.Position{ + StartLine: 172, + EndLine: 172, + StartPos: 3880, + EndPos: 3880, + }, + Val: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 172, + EndLine: 172, + StartPos: 3880, + EndPos: 3880, + }, + Value: "1", + }, + }, + &expr.ArrayItem{ + Position: &position.Position{ + StartLine: 172, + EndLine: 172, + StartPos: 3883, + EndPos: 3889, + }, + Key: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 172, + EndLine: 172, + StartPos: 3883, + EndPos: 3883, + }, + Value: "3", + }, + Val: &expr.Reference{ + Position: &position.Position{ + StartLine: 172, + EndLine: 172, + StartPos: 3887, + EndPos: 3889, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 172, + EndLine: 172, + StartPos: 3888, + EndPos: 3889, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 172, + EndLine: 172, + StartPos: 3888, + EndPos: 3889, + }, + Value: "b", + }, + }, + }, + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 173, + EndLine: 173, + StartPos: 3895, + EndPos: 3898, + }, + Expr: &expr.BitwiseNot{ + Position: &position.Position{ + StartLine: 173, + EndLine: 173, + StartPos: 3895, + EndPos: 3897, + }, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 173, + EndLine: 173, + StartPos: 3896, + EndPos: 3897, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 173, + EndLine: 173, + StartPos: 3896, + EndPos: 3897, + }, + Value: "a", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 174, + EndLine: 174, + StartPos: 3902, + EndPos: 3905, + }, + Expr: &expr.BooleanNot{ + Position: &position.Position{ + StartLine: 174, + EndLine: 174, + StartPos: 3902, + EndPos: 3904, + }, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 174, + EndLine: 174, + StartPos: 3903, + EndPos: 3904, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 174, + EndLine: 174, + StartPos: 3903, + EndPos: 3904, + }, + Value: "a", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 176, + EndLine: 176, + StartPos: 3910, + EndPos: 3918, + }, + Expr: &expr.ClassConstFetch{ + Position: &position.Position{ + StartLine: 176, + EndLine: 176, + StartPos: 3910, + EndPos: 3917, + }, + Class: &name.Name{ + Position: &position.Position{ + StartLine: 176, + EndLine: 176, + StartPos: 3910, + EndPos: 3912, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 176, + EndLine: 176, + StartPos: 3910, + EndPos: 3912, + }, + Value: "Foo", + }, + }, + }, + ConstantName: &node.Identifier{ + Position: &position.Position{ + StartLine: 176, + EndLine: 176, + StartPos: 3915, + EndPos: 3917, + }, + Value: "Bar", + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 177, + EndLine: 177, + StartPos: 3922, + EndPos: 3931, + }, + Expr: &expr.Clone{ + Position: &position.Position{ + StartLine: 177, + EndLine: 177, + StartPos: 3922, + EndPos: 3929, + }, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 177, + EndLine: 177, + StartPos: 3928, + EndPos: 3929, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 177, + EndLine: 177, + StartPos: 3928, + EndPos: 3929, + }, + Value: "a", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 178, + EndLine: 178, + StartPos: 3935, + EndPos: 3943, + }, + Expr: &expr.Clone{ + Position: &position.Position{ + StartLine: 178, + EndLine: 178, + StartPos: 3935, + EndPos: 3942, + }, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 178, + EndLine: 178, + StartPos: 3941, + EndPos: 3942, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 178, + EndLine: 178, + StartPos: 3941, + EndPos: 3942, + }, + Value: "a", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 179, + EndLine: 179, + StartPos: 3947, + EndPos: 3959, + }, + Expr: &expr.Closure{ + Position: &position.Position{ + StartLine: 179, + EndLine: 179, + StartPos: 3947, + EndPos: 3958, + }, + ReturnsRef: false, + Static: false, + PhpDocComment: "", + Stmts: []node.Node{ + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 180, + EndLine: 180, + StartPos: 3963, + EndPos: 3996, + }, + Expr: &expr.Closure{ + Position: &position.Position{ + StartLine: 180, + EndLine: 180, + StartPos: 3963, + EndPos: 3995, + }, + PhpDocComment: "", + ReturnsRef: false, + Static: false, + Params: []node.Node{ + &node.Parameter{ + Position: &position.Position{ + StartLine: 180, + EndLine: 180, + StartPos: 3972, + EndPos: 3973, + }, + ByRef: false, + Variadic: false, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 180, + EndLine: 180, + StartPos: 3972, + EndPos: 3973, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 180, + EndLine: 180, + StartPos: 3972, + EndPos: 3973, + }, + Value: "a", + }, + }, + }, + &node.Parameter{ + Position: &position.Position{ + StartLine: 180, + EndLine: 180, + StartPos: 3976, + EndPos: 3977, + }, + ByRef: false, + Variadic: false, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 180, + EndLine: 180, + StartPos: 3976, + EndPos: 3977, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 180, + EndLine: 180, + StartPos: 3976, + EndPos: 3977, + }, + Value: "b", + }, + }, + }, + }, + ClosureUse: &expr.ClosureUse{ + Position: &position.Position{ + StartLine: 180, + EndLine: 180, + StartPos: 3980, + EndPos: 3992, + }, + Uses: []node.Node{ + &expr.Variable{ + Position: &position.Position{ + StartLine: 180, + EndLine: 180, + StartPos: 3985, + EndPos: 3986, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 180, + EndLine: 180, + StartPos: 3985, + EndPos: 3986, + }, + Value: "c", + }, + }, + &expr.Reference{ + Position: &position.Position{ + StartLine: 180, + EndLine: 180, + StartPos: 3989, + EndPos: 3991, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 180, + EndLine: 180, + StartPos: 3990, + EndPos: 3991, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 180, + EndLine: 180, + StartPos: 3990, + EndPos: 3991, + }, + Value: "d", + }, + }, + }, + }, + }, + Stmts: []node.Node{ + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 181, + EndLine: 181, + StartPos: 4000, + EndPos: 4033, + }, + Expr: &expr.Closure{ + Position: &position.Position{ + StartLine: 181, + EndLine: 181, + StartPos: 4000, + EndPos: 4032, + }, + ReturnsRef: false, + Static: false, + PhpDocComment: "", + Params: []node.Node{ + &node.Parameter{ + Position: &position.Position{ + StartLine: 181, + EndLine: 181, + StartPos: 4009, + EndPos: 4010, + }, + ByRef: false, + Variadic: false, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 181, + EndLine: 181, + StartPos: 4009, + EndPos: 4010, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 181, + EndLine: 181, + StartPos: 4009, + EndPos: 4010, + }, + Value: "a", + }, + }, + }, + &node.Parameter{ + Position: &position.Position{ + StartLine: 181, + EndLine: 181, + StartPos: 4013, + EndPos: 4014, + }, + Variadic: false, + ByRef: false, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 181, + EndLine: 181, + StartPos: 4013, + EndPos: 4014, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 181, + EndLine: 181, + StartPos: 4013, + EndPos: 4014, + }, + Value: "b", + }, + }, + }, + }, + ClosureUse: &expr.ClosureUse{ + Position: &position.Position{ + StartLine: 181, + EndLine: 181, + StartPos: 4017, + EndPos: 4029, + }, + Uses: []node.Node{ + &expr.Reference{ + Position: &position.Position{ + StartLine: 181, + EndLine: 181, + StartPos: 4022, + EndPos: 4024, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 181, + EndLine: 181, + StartPos: 4023, + EndPos: 4024, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 181, + EndLine: 181, + StartPos: 4023, + EndPos: 4024, + }, + Value: "c", + }, + }, + }, + &expr.Variable{ + Position: &position.Position{ + StartLine: 181, + EndLine: 181, + StartPos: 4027, + EndPos: 4028, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 181, + EndLine: 181, + StartPos: 4027, + EndPos: 4028, + }, + Value: "d", + }, + }, + }, + }, + Stmts: []node.Node{ + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 182, + EndLine: 182, + StartPos: 4037, + EndPos: 4050, + }, + Expr: &expr.Closure{ + Position: &position.Position{ + StartLine: 182, + EndLine: 182, + StartPos: 4037, + EndPos: 4049, + }, + ReturnsRef: false, + Static: false, + PhpDocComment: "", + Stmts: []node.Node{ + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 183, + EndLine: 183, + StartPos: 4054, + EndPos: 4057, + }, + Expr: &expr.ConstFetch{ + Position: &position.Position{ + StartLine: 183, + EndLine: 183, + StartPos: 4054, + EndPos: 4056, + }, + Constant: &name.Name{ + Position: &position.Position{ + StartLine: 183, + EndLine: 183, + StartPos: 4054, + EndPos: 4056, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 183, + EndLine: 183, + StartPos: 4054, + EndPos: 4056, + }, + Value: "foo", + }, + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 184, + EndLine: 184, + StartPos: 4061, + EndPos: 4074, + }, + Expr: &expr.ConstFetch{ + Position: &position.Position{ + StartLine: 184, + EndLine: 184, + StartPos: 4061, + EndPos: 4073, + }, + Constant: &name.Relative{ + Position: &position.Position{ + StartLine: 184, + EndLine: 184, + StartPos: 4061, + EndPos: 4073, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 184, + EndLine: 184, + StartPos: 4071, + EndPos: 4073, + }, + Value: "foo", + }, + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 185, + EndLine: 185, + StartPos: 4078, + EndPos: 4082, + }, + Expr: &expr.ConstFetch{ + Position: &position.Position{ + StartLine: 185, + EndLine: 185, + StartPos: 4078, + EndPos: 4081, + }, + Constant: &name.FullyQualified{ + Position: &position.Position{ + StartLine: 185, + EndLine: 185, + StartPos: 4078, + EndPos: 4081, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 185, + EndLine: 185, + StartPos: 4079, + EndPos: 4081, + }, + Value: "foo", + }, + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 187, + EndLine: 187, + StartPos: 4087, + EndPos: 4096, + }, + Expr: &expr.Empty{ + Position: &position.Position{ + StartLine: 187, + EndLine: 187, + StartPos: 4087, + EndPos: 4095, + }, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 187, + EndLine: 187, + StartPos: 4093, + EndPos: 4094, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 187, + EndLine: 187, + StartPos: 4093, + EndPos: 4094, + }, + Value: "a", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 188, + EndLine: 188, + StartPos: 4100, + EndPos: 4110, + }, + Expr: &expr.Empty{ + Position: &position.Position{ + StartLine: 188, + EndLine: 188, + StartPos: 4100, + EndPos: 4109, + }, + Expr: &expr.ConstFetch{ + Position: &position.Position{ + StartLine: 188, + EndLine: 188, + StartPos: 4106, + EndPos: 4108, + }, + Constant: &name.Name{ + Position: &position.Position{ + StartLine: 188, + EndLine: 188, + StartPos: 4106, + EndPos: 4108, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 188, + EndLine: 188, + StartPos: 4106, + EndPos: 4108, + }, + Value: "Foo", + }, + }, + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 189, + EndLine: 189, + StartPos: 4114, + EndPos: 4117, + }, + Expr: &expr.ErrorSuppress{ + Position: &position.Position{ + StartLine: 189, + EndLine: 189, + StartPos: 4114, + EndPos: 4116, + }, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 189, + EndLine: 189, + StartPos: 4115, + EndPos: 4116, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 189, + EndLine: 189, + StartPos: 4115, + EndPos: 4116, + }, + Value: "a", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 190, + EndLine: 190, + StartPos: 4121, + EndPos: 4129, + }, + Expr: &expr.Eval{ + Position: &position.Position{ + StartLine: 190, + EndLine: 190, + StartPos: 4121, + EndPos: 4128, + }, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 190, + EndLine: 190, + StartPos: 4126, + EndPos: 4127, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 190, + EndLine: 190, + StartPos: 4126, + EndPos: 4127, + }, + Value: "a", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 191, + EndLine: 191, + StartPos: 4133, + EndPos: 4137, + }, + Expr: &expr.Exit{ + Position: &position.Position{ + StartLine: 191, + EndLine: 191, + StartPos: 4133, + EndPos: 4136, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 192, + EndLine: 192, + StartPos: 4141, + EndPos: 4149, + }, + Expr: &expr.Exit{ + Position: &position.Position{ + StartLine: 192, + EndLine: 192, + StartPos: 4141, + EndPos: 4147, + }, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 192, + EndLine: 192, + StartPos: 4146, + EndPos: 4147, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 192, + EndLine: 192, + StartPos: 4146, + EndPos: 4147, + }, + Value: "a", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 193, + EndLine: 193, + StartPos: 4153, + EndPos: 4158, + }, + Expr: &expr.Die{ + Position: &position.Position{ + StartLine: 193, + EndLine: 193, + StartPos: 4153, + EndPos: 4157, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 194, + EndLine: 194, + StartPos: 4162, + EndPos: 4169, + }, + Expr: &expr.Die{ + Position: &position.Position{ + StartLine: 194, + EndLine: 194, + StartPos: 4162, + EndPos: 4167, + }, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 194, + EndLine: 194, + StartPos: 4166, + EndPos: 4167, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 194, + EndLine: 194, + StartPos: 4166, + EndPos: 4167, + }, + Value: "a", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 195, + EndLine: 195, + StartPos: 4173, + EndPos: 4178, + }, + Expr: &expr.FunctionCall{ + Position: &position.Position{ + StartLine: 195, + EndLine: 195, + StartPos: 4173, + EndPos: 4177, + }, + Function: &name.Name{ + Position: &position.Position{ + StartLine: 195, + EndLine: 195, + StartPos: 4173, + EndPos: 4175, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 195, + EndLine: 195, + StartPos: 4173, + EndPos: 4175, + }, + Value: "foo", + }, + }, + }, + ArgumentList: &node.ArgumentList{ + Position: &position.Position{ + StartLine: 195, + EndLine: 195, + StartPos: 4176, + EndPos: 4177, + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 196, + EndLine: 196, + StartPos: 4182, + EndPos: 4200, + }, + Expr: &expr.FunctionCall{ + Position: &position.Position{ + StartLine: 196, + EndLine: 196, + StartPos: 4182, + EndPos: 4199, + }, + Function: &name.Relative{ + Position: &position.Position{ + StartLine: 196, + EndLine: 196, + StartPos: 4182, + EndPos: 4194, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 196, + EndLine: 196, + StartPos: 4192, + EndPos: 4194, + }, + Value: "foo", + }, + }, + }, + ArgumentList: &node.ArgumentList{ + Position: &position.Position{ + StartLine: 196, + EndLine: 196, + StartPos: 4195, + EndPos: 4199, + }, + Arguments: []node.Node{ + &node.Argument{ + Position: &position.Position{ + StartLine: 196, + EndLine: 196, + StartPos: 4197, + EndPos: 4198, + }, + Variadic: false, + IsReference: true, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 196, + EndLine: 196, + StartPos: 4197, + EndPos: 4198, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 196, + EndLine: 196, + StartPos: 4197, + EndPos: 4198, + }, + Value: "a", + }, + }, + }, + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 197, + EndLine: 197, + StartPos: 4204, + EndPos: 4212, + }, + Expr: &expr.FunctionCall{ + Position: &position.Position{ + StartLine: 197, + EndLine: 197, + StartPos: 4204, + EndPos: 4211, + }, + Function: &name.FullyQualified{ + Position: &position.Position{ + StartLine: 197, + EndLine: 197, + StartPos: 4204, + EndPos: 4207, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 197, + EndLine: 197, + StartPos: 4205, + EndPos: 4207, + }, + Value: "foo", + }, + }, + }, + ArgumentList: &node.ArgumentList{ + Position: &position.Position{ + StartLine: 197, + EndLine: 197, + StartPos: 4208, + EndPos: 4211, + }, + Arguments: []node.Node{ + &node.Argument{ + Position: &position.Position{ + StartLine: 197, + EndLine: 197, + StartPos: 4209, + EndPos: 4210, + }, + Variadic: false, + IsReference: false, + Expr: &expr.ShortArray{ + Position: &position.Position{ + StartLine: 197, + EndLine: 197, + StartPos: 4209, + EndPos: 4210, + }, + Items: []node.Node{ + }, + }, + }, + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 198, + EndLine: 198, + StartPos: 4216, + EndPos: 4230, + }, + Expr: &expr.FunctionCall{ + Position: &position.Position{ + StartLine: 198, + EndLine: 198, + StartPos: 4216, + EndPos: 4229, + }, + Function: &expr.Variable{ + Position: &position.Position{ + StartLine: 198, + EndLine: 198, + StartPos: 4216, + EndPos: 4219, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 198, + EndLine: 198, + StartPos: 4216, + EndPos: 4219, + }, + Value: "foo", + }, + }, + ArgumentList: &node.ArgumentList{ + Position: &position.Position{ + StartLine: 198, + EndLine: 198, + StartPos: 4220, + EndPos: 4229, + }, + Arguments: []node.Node{ + &node.Argument{ + Position: &position.Position{ + StartLine: 198, + EndLine: 198, + StartPos: 4221, + EndPos: 4228, + }, + IsReference: false, + Variadic: false, + Expr: &expr.Yield{ + Position: &position.Position{ + StartLine: 198, + EndLine: 198, + StartPos: 4221, + EndPos: 4228, + }, + Value: &expr.Variable{ + Position: &position.Position{ + StartLine: 198, + EndLine: 198, + StartPos: 4227, + EndPos: 4228, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 198, + EndLine: 198, + StartPos: 4227, + EndPos: 4228, + }, + Value: "a", + }, + }, + }, + }, + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 200, + EndLine: 200, + StartPos: 4235, + EndPos: 4239, + }, + Expr: &expr.PostDec{ + Position: &position.Position{ + StartLine: 200, + EndLine: 200, + StartPos: 4235, + EndPos: 4238, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 200, + EndLine: 200, + StartPos: 4235, + EndPos: 4236, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 200, + EndLine: 200, + StartPos: 4235, + EndPos: 4236, + }, + Value: "a", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 201, + EndLine: 201, + StartPos: 4243, + EndPos: 4247, + }, + Expr: &expr.PostInc{ + Position: &position.Position{ + StartLine: 201, + EndLine: 201, + StartPos: 4243, + EndPos: 4246, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 201, + EndLine: 201, + StartPos: 4243, + EndPos: 4244, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 201, + EndLine: 201, + StartPos: 4243, + EndPos: 4244, + }, + Value: "a", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 202, + EndLine: 202, + StartPos: 4251, + EndPos: 4255, + }, + Expr: &expr.PreDec{ + Position: &position.Position{ + StartLine: 202, + EndLine: 202, + StartPos: 4251, + EndPos: 4254, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 202, + EndLine: 202, + StartPos: 4253, + EndPos: 4254, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 202, + EndLine: 202, + StartPos: 4253, + EndPos: 4254, + }, + Value: "a", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 203, + EndLine: 203, + StartPos: 4259, + EndPos: 4263, + }, + Expr: &expr.PreInc{ + Position: &position.Position{ + StartLine: 203, + EndLine: 203, + StartPos: 4259, + EndPos: 4262, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 203, + EndLine: 203, + StartPos: 4261, + EndPos: 4262, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 203, + EndLine: 203, + StartPos: 4261, + EndPos: 4262, + }, + Value: "a", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 205, + EndLine: 205, + StartPos: 4268, + EndPos: 4278, + }, + Expr: &expr.Include{ + Position: &position.Position{ + StartLine: 205, + EndLine: 205, + StartPos: 4268, + EndPos: 4277, + }, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 205, + EndLine: 205, + StartPos: 4276, + EndPos: 4277, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 205, + EndLine: 205, + StartPos: 4276, + EndPos: 4277, + }, + Value: "a", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 206, + EndLine: 206, + StartPos: 4282, + EndPos: 4297, + }, + Expr: &expr.IncludeOnce{ + Position: &position.Position{ + StartLine: 206, + EndLine: 206, + StartPos: 4282, + EndPos: 4296, + }, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 206, + EndLine: 206, + StartPos: 4295, + EndPos: 4296, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 206, + EndLine: 206, + StartPos: 4295, + EndPos: 4296, + }, + Value: "a", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 207, + EndLine: 207, + StartPos: 4301, + EndPos: 4311, + }, + Expr: &expr.Require{ + Position: &position.Position{ + StartLine: 207, + EndLine: 207, + StartPos: 4301, + EndPos: 4310, + }, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 207, + EndLine: 207, + StartPos: 4309, + EndPos: 4310, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 207, + EndLine: 207, + StartPos: 4309, + EndPos: 4310, + }, + Value: "a", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 208, + EndLine: 208, + StartPos: 4315, + EndPos: 4330, + }, + Expr: &expr.RequireOnce{ + Position: &position.Position{ + StartLine: 208, + EndLine: 208, + StartPos: 4315, + EndPos: 4329, + }, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 208, + EndLine: 208, + StartPos: 4328, + EndPos: 4329, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 208, + EndLine: 208, + StartPos: 4328, + EndPos: 4329, + }, + Value: "a", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 210, + EndLine: 210, + StartPos: 4335, + EndPos: 4352, + }, + Expr: &expr.InstanceOf{ + Position: &position.Position{ + StartLine: 210, + EndLine: 210, + StartPos: 4335, + EndPos: 4351, + }, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 210, + EndLine: 210, + StartPos: 4335, + EndPos: 4336, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 210, + EndLine: 210, + StartPos: 4335, + EndPos: 4336, + }, + Value: "a", + }, + }, + Class: &name.Name{ + Position: &position.Position{ + StartLine: 210, + EndLine: 210, + StartPos: 4349, + EndPos: 4351, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 210, + EndLine: 210, + StartPos: 4349, + EndPos: 4351, + }, + Value: "Foo", + }, + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 211, + EndLine: 211, + StartPos: 4356, + EndPos: 4383, + }, + Expr: &expr.InstanceOf{ + Position: &position.Position{ + StartLine: 211, + EndLine: 211, + StartPos: 4356, + EndPos: 4382, + }, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 211, + EndLine: 211, + StartPos: 4356, + EndPos: 4357, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 211, + EndLine: 211, + StartPos: 4356, + EndPos: 4357, + }, + Value: "a", + }, + }, + Class: &name.Relative{ + Position: &position.Position{ + StartLine: 211, + EndLine: 211, + StartPos: 4370, + EndPos: 4382, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 211, + EndLine: 211, + StartPos: 4380, + EndPos: 4382, + }, + Value: "Foo", + }, + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 212, + EndLine: 212, + StartPos: 4387, + EndPos: 4405, + }, + Expr: &expr.InstanceOf{ + Position: &position.Position{ + StartLine: 212, + EndLine: 212, + StartPos: 4387, + EndPos: 4404, + }, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 212, + EndLine: 212, + StartPos: 4387, + EndPos: 4388, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 212, + EndLine: 212, + StartPos: 4387, + EndPos: 4388, + }, + Value: "a", + }, + }, + Class: &name.FullyQualified{ + Position: &position.Position{ + StartLine: 212, + EndLine: 212, + StartPos: 4401, + EndPos: 4404, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 212, + EndLine: 212, + StartPos: 4402, + EndPos: 4404, + }, + Value: "Foo", + }, + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 214, + EndLine: 214, + StartPos: 4410, + EndPos: 4423, + }, + Expr: &expr.Isset{ + Position: &position.Position{ + StartLine: 214, + EndLine: 214, + StartPos: 4410, + EndPos: 4422, + }, + Variables: []node.Node{ + &expr.Variable{ + Position: &position.Position{ + StartLine: 214, + EndLine: 214, + StartPos: 4416, + EndPos: 4417, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 214, + EndLine: 214, + StartPos: 4416, + EndPos: 4417, + }, + Value: "a", + }, + }, + &expr.Variable{ + Position: &position.Position{ + StartLine: 214, + EndLine: 214, + StartPos: 4420, + EndPos: 4421, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 214, + EndLine: 214, + StartPos: 4420, + EndPos: 4421, + }, + Value: "b", + }, + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 215, + EndLine: 215, + StartPos: 4427, + EndPos: 4437, + }, + Expr: &expr.Isset{ + Position: &position.Position{ + StartLine: 215, + EndLine: 215, + StartPos: 4427, + EndPos: 4436, + }, + Variables: []node.Node{ + &expr.ConstFetch{ + Position: &position.Position{ + StartLine: 215, + EndLine: 215, + StartPos: 4433, + EndPos: 4435, + }, Constant: &name.Name{ + Position: &position.Position{ + StartLine: 215, + EndLine: 215, + StartPos: 4433, + EndPos: 4435, + }, Parts: []node.Node{ - &name.NamePart{Value: "Foo"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 215, + EndLine: 215, + StartPos: 4433, + EndPos: 4435, + }, + Value: "Foo", + }, }, }, }, }, }, }, - &stmt.Static{ - Vars: []node.Node{ - &stmt.StaticVar{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expr: &expr.ConstFetch{ - Constant: &name.Relative{ - Parts: []node.Node{ - &name.NamePart{Value: "Foo"}, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 216, + EndLine: 216, + StartPos: 4441, + EndPos: 4452, + }, + Expr: &assign.Assign{ + Position: &position.Position{ + StartLine: 216, + EndLine: 216, + StartPos: 4441, + EndPos: 4451, + }, + Variable: &expr.List{ + Position: &position.Position{ + StartLine: 216, + EndLine: 216, + StartPos: 4441, + EndPos: 4446, + }, + Items: []node.Node{ + }, + }, + Expression: &expr.Variable{ + Position: &position.Position{ + StartLine: 216, + EndLine: 216, + StartPos: 4450, + EndPos: 4451, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 216, + EndLine: 216, + StartPos: 4450, + EndPos: 4451, + }, + Value: "b", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 217, + EndLine: 217, + StartPos: 4456, + EndPos: 4473, + }, + Expr: &assign.Assign{ + Position: &position.Position{ + StartLine: 217, + EndLine: 217, + StartPos: 4456, + EndPos: 4472, + }, + Variable: &expr.List{ + Position: &position.Position{ + StartLine: 217, + EndLine: 217, + StartPos: 4456, + EndPos: 4467, + }, + Items: []node.Node{ + &expr.ArrayItem{ + Position: &position.Position{ + StartLine: 217, + EndLine: 217, + StartPos: 4461, + EndPos: 4462, + }, + Val: &expr.Variable{ + Position: &position.Position{ + StartLine: 217, + EndLine: 217, + StartPos: 4461, + EndPos: 4462, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 217, + EndLine: 217, + StartPos: 4461, + EndPos: 4462, + }, + Value: "a", + }, + }, + }, + &expr.ArrayItem{ + Position: &position.Position{ + StartLine: 217, + EndLine: 217, + StartPos: 4465, + EndPos: 4466, + }, + Val: &expr.Variable{ + Position: &position.Position{ + StartLine: 217, + EndLine: 217, + StartPos: 4465, + EndPos: 4466, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 217, + EndLine: 217, + StartPos: 4465, + EndPos: 4466, + }, + Value: "b", + }, + }, + }, + }, + }, + Expression: &expr.Variable{ + Position: &position.Position{ + StartLine: 217, + EndLine: 217, + StartPos: 4471, + EndPos: 4472, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 217, + EndLine: 217, + StartPos: 4471, + EndPos: 4472, + }, + Value: "b", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 218, + EndLine: 218, + StartPos: 4477, + EndPos: 4492, + }, + Expr: &assign.Assign{ + Position: &position.Position{ + StartLine: 218, + EndLine: 218, + StartPos: 4477, + EndPos: 4491, + }, + Variable: &expr.List{ + Position: &position.Position{ + StartLine: 218, + EndLine: 218, + StartPos: 4477, + EndPos: 4486, + }, + Items: []node.Node{ + &expr.ArrayItem{ + Position: &position.Position{ + StartLine: 218, + EndLine: 218, + StartPos: 4482, + EndPos: 4485, + }, + Val: &expr.ArrayDimFetch{ + Position: &position.Position{ + StartLine: 218, + EndLine: 218, + StartPos: 4482, + EndPos: 4485, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 218, + EndLine: 218, + StartPos: 4482, + EndPos: 4483, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 218, + EndLine: 218, + StartPos: 4482, + EndPos: 4483, + }, + Value: "a", + }, + }, + }, + }, + }, + }, + Expression: &expr.Variable{ + Position: &position.Position{ + StartLine: 218, + EndLine: 218, + StartPos: 4490, + EndPos: 4491, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 218, + EndLine: 218, + StartPos: 4490, + EndPos: 4491, + }, + Value: "b", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 219, + EndLine: 219, + StartPos: 4496, + EndPos: 4515, + }, + Expr: &assign.Assign{ + Position: &position.Position{ + StartLine: 219, + EndLine: 219, + StartPos: 4496, + EndPos: 4514, + }, + Variable: &expr.List{ + Position: &position.Position{ + StartLine: 219, + EndLine: 219, + StartPos: 4496, + EndPos: 4509, + }, + Items: []node.Node{ + &expr.ArrayItem{ + Position: &position.Position{ + StartLine: 219, + EndLine: 219, + StartPos: 4501, + EndPos: 4508, + }, + Val: &expr.List{ + Position: &position.Position{ + StartLine: 219, + EndLine: 219, + StartPos: 4501, + EndPos: 4508, + }, + Items: []node.Node{ + &expr.ArrayItem{ + Position: &position.Position{ + StartLine: 219, + EndLine: 219, + StartPos: 4506, + EndPos: 4507, + }, + Val: &expr.Variable{ + Position: &position.Position{ + StartLine: 219, + EndLine: 219, + StartPos: 4506, + EndPos: 4507, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 219, + EndLine: 219, + StartPos: 4506, + EndPos: 4507, + }, + Value: "a", + }, + }, + }, + }, + }, + }, + }, + }, + Expression: &expr.Variable{ + Position: &position.Position{ + StartLine: 219, + EndLine: 219, + StartPos: 4513, + EndPos: 4514, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 219, + EndLine: 219, + StartPos: 4513, + EndPos: 4514, + }, + Value: "b", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 221, + EndLine: 221, + StartPos: 4520, + EndPos: 4529, + }, + Expr: &expr.MethodCall{ + Position: &position.Position{ + StartLine: 221, + EndLine: 221, + StartPos: 4520, + EndPos: 4528, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 221, + EndLine: 221, + StartPos: 4520, + EndPos: 4521, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 221, + EndLine: 221, + StartPos: 4520, + EndPos: 4521, + }, + Value: "a", + }, + }, + Method: &node.Identifier{ + Position: &position.Position{ + StartLine: 221, + EndLine: 221, + StartPos: 4524, + EndPos: 4526, + }, + Value: "foo", + }, + ArgumentList: &node.ArgumentList{ + Position: &position.Position{ + StartLine: 221, + EndLine: 221, + StartPos: 4527, + EndPos: 4528, + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 222, + EndLine: 222, + StartPos: 4533, + EndPos: 4540, + }, + Expr: &expr.New{ + Position: &position.Position{ + StartLine: 222, + EndLine: 222, + StartPos: 4533, + EndPos: 4539, + }, + Class: &name.Name{ + Position: &position.Position{ + StartLine: 222, + EndLine: 222, + StartPos: 4537, + EndPos: 4539, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 222, + EndLine: 222, + StartPos: 4537, + EndPos: 4539, + }, + Value: "Foo", + }, + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 223, + EndLine: 223, + StartPos: 4544, + EndPos: 4563, + }, + Expr: &expr.New{ + Position: &position.Position{ + StartLine: 223, + EndLine: 223, + StartPos: 4544, + EndPos: 4562, + }, + Class: &name.Relative{ + Position: &position.Position{ + StartLine: 223, + EndLine: 223, + StartPos: 4548, + EndPos: 4560, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 223, + EndLine: 223, + StartPos: 4558, + EndPos: 4560, + }, + Value: "Foo", + }, + }, + }, + ArgumentList: &node.ArgumentList{ + Position: &position.Position{ + StartLine: 223, + EndLine: 223, + StartPos: 4561, + EndPos: 4562, + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 224, + EndLine: 224, + StartPos: 4567, + EndPos: 4577, + }, + Expr: &expr.New{ + Position: &position.Position{ + StartLine: 224, + EndLine: 224, + StartPos: 4567, + EndPos: 4576, + }, + Class: &name.FullyQualified{ + Position: &position.Position{ + StartLine: 224, + EndLine: 224, + StartPos: 4571, + EndPos: 4574, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 224, + EndLine: 224, + StartPos: 4572, + EndPos: 4574, + }, + Value: "Foo", + }, + }, + }, + ArgumentList: &node.ArgumentList{ + Position: &position.Position{ + StartLine: 224, + EndLine: 224, + StartPos: 4575, + EndPos: 4576, + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 225, + EndLine: 225, + StartPos: 4581, + EndPos: 4590, + }, + Expr: &expr.Print{ + Position: &position.Position{ + StartLine: 225, + EndLine: 225, + StartPos: 4581, + EndPos: 4588, + }, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 225, + EndLine: 225, + StartPos: 4587, + EndPos: 4588, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 225, + EndLine: 225, + StartPos: 4587, + EndPos: 4588, + }, + Value: "a", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 226, + EndLine: 226, + StartPos: 4594, + EndPos: 4601, + }, + Expr: &expr.PropertyFetch{ + Position: &position.Position{ + StartLine: 226, + EndLine: 226, + StartPos: 4594, + EndPos: 4600, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 226, + EndLine: 226, + StartPos: 4594, + EndPos: 4595, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 226, + EndLine: 226, + StartPos: 4594, + EndPos: 4595, + }, + Value: "a", + }, + }, + Property: &node.Identifier{ + Position: &position.Position{ + StartLine: 226, + EndLine: 226, + StartPos: 4598, + EndPos: 4600, + }, + Value: "foo", + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 227, + EndLine: 227, + StartPos: 4605, + EndPos: 4615, + }, + Expr: &expr.ArrayDimFetch{ + Position: &position.Position{ + StartLine: 227, + EndLine: 227, + StartPos: 4605, + EndPos: 4613, + }, + Variable: &expr.PropertyFetch{ + Position: &position.Position{ + StartLine: 227, + EndLine: 227, + StartPos: 4605, + EndPos: 4611, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 227, + EndLine: 227, + StartPos: 4605, + EndPos: 4606, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 227, + EndLine: 227, + StartPos: 4605, + EndPos: 4606, + }, + Value: "a", + }, + }, + Property: &node.Identifier{ + Position: &position.Position{ + StartLine: 227, + EndLine: 227, + StartPos: 4609, + EndPos: 4611, + }, + Value: "foo", + }, + }, + Dim: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 227, + EndLine: 227, + StartPos: 4613, + EndPos: 4613, + }, + Value: "1", + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 228, + EndLine: 228, + StartPos: 4619, + EndPos: 4647, + }, + Expr: &expr.ArrayDimFetch{ + Position: &position.Position{ + StartLine: 228, + EndLine: 228, + StartPos: 4619, + EndPos: 4645, + }, + Variable: &expr.PropertyFetch{ + Position: &position.Position{ + StartLine: 228, + EndLine: 228, + StartPos: 4619, + EndPos: 4643, + }, + Variable: &expr.MethodCall{ + Position: &position.Position{ + StartLine: 228, + EndLine: 228, + StartPos: 4619, + EndPos: 4637, + }, + Variable: &expr.PropertyFetch{ + Position: &position.Position{ + StartLine: 228, + EndLine: 228, + StartPos: 4619, + EndPos: 4630, + }, + Variable: &expr.PropertyFetch{ + Position: &position.Position{ + StartLine: 228, + EndLine: 228, + StartPos: 4619, + EndPos: 4625, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 228, + EndLine: 228, + StartPos: 4619, + EndPos: 4620, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 228, + EndLine: 228, + StartPos: 4619, + EndPos: 4620, + }, + Value: "a", + }, + }, + Property: &node.Identifier{ + Position: &position.Position{ + StartLine: 228, + EndLine: 228, + StartPos: 4623, + EndPos: 4625, + }, + Value: "foo", + }, + }, + Property: &node.Identifier{ + Position: &position.Position{ + StartLine: 228, + EndLine: 228, + StartPos: 4628, + EndPos: 4630, + }, + Value: "bar", + }, + }, + Method: &node.Identifier{ + Position: &position.Position{ + StartLine: 228, + EndLine: 228, + StartPos: 4633, + EndPos: 4635, + }, + Value: "baz", + }, + ArgumentList: &node.ArgumentList{ + Position: &position.Position{ + StartLine: 228, + EndLine: 228, + StartPos: 4636, + EndPos: 4637, + }, + }, + }, + Property: &node.Identifier{ + Position: &position.Position{ + StartLine: 228, + EndLine: 228, + StartPos: 4640, + EndPos: 4643, + }, + Value: "quux", + }, + }, + Dim: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 228, + EndLine: 228, + StartPos: 4645, + EndPos: 4645, + }, + Value: "0", + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 229, + EndLine: 229, + StartPos: 4651, + EndPos: 4666, + }, + Expr: &expr.ArrayDimFetch{ + Position: &position.Position{ + StartLine: 229, + EndLine: 229, + StartPos: 4651, + EndPos: 4664, + }, + Variable: &expr.ArrayDimFetch{ + Position: &position.Position{ + StartLine: 229, + EndLine: 229, + StartPos: 4651, + EndPos: 4661, + }, + Variable: &expr.MethodCall{ + Position: &position.Position{ + StartLine: 229, + EndLine: 229, + StartPos: 4651, + EndPos: 4659, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 229, + EndLine: 229, + StartPos: 4651, + EndPos: 4652, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 229, + EndLine: 229, + StartPos: 4651, + EndPos: 4652, + }, + Value: "a", + }, + }, + Method: &node.Identifier{ + Position: &position.Position{ + StartLine: 229, + EndLine: 229, + StartPos: 4655, + EndPos: 4657, + }, + Value: "foo", + }, + ArgumentList: &node.ArgumentList{ + Position: &position.Position{ + StartLine: 229, + EndLine: 229, + StartPos: 4658, + EndPos: 4659, + }, + }, + }, + Dim: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 229, + EndLine: 229, + StartPos: 4661, + EndPos: 4661, + }, + Value: "1", + }, + }, + Dim: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 229, + EndLine: 229, + StartPos: 4664, + EndPos: 4664, + }, + Value: "1", + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 230, + EndLine: 230, + StartPos: 4670, + EndPos: 4678, + }, + Expr: &expr.ShellExec{ + Position: &position.Position{ + StartLine: 230, + EndLine: 230, + StartPos: 4670, + EndPos: 4677, + }, + Parts: []node.Node{ + &scalar.EncapsedStringPart{ + Position: &position.Position{ + StartLine: 230, + EndLine: 230, + StartPos: 4671, + EndPos: 4674, + }, + Value: "cmd ", + }, + &expr.Variable{ + Position: &position.Position{ + StartLine: 230, + EndLine: 230, + StartPos: 4675, + EndPos: 4676, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 230, + EndLine: 230, + StartPos: 4675, + EndPos: 4676, + }, + Value: "a", + }, + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 231, + EndLine: 231, + StartPos: 4682, + EndPos: 4687, + }, + Expr: &expr.ShellExec{ + Position: &position.Position{ + StartLine: 231, + EndLine: 231, + StartPos: 4682, + EndPos: 4686, + }, + Parts: []node.Node{ + &scalar.EncapsedStringPart{ + Value: "cmd", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 232, + EndLine: 232, + StartPos: 4691, + EndPos: 4693, + }, + Expr: &expr.ShellExec{ + Position: &position.Position{ + StartLine: 232, + EndLine: 232, + StartPos: 4691, + EndPos: 4692, + }, + Parts: []node.Node{ + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 233, + EndLine: 233, + StartPos: 4697, + EndPos: 4699, + }, + Expr: &expr.ShortArray{ + Position: &position.Position{ + StartLine: 233, + EndLine: 233, + StartPos: 4697, + EndPos: 4698, + }, + Items: []node.Node{ + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 234, + EndLine: 234, + StartPos: 4703, + EndPos: 4706, + }, + Expr: &expr.ShortArray{ + Position: &position.Position{ + StartLine: 234, + EndLine: 234, + StartPos: 4703, + EndPos: 4705, + }, + Items: []node.Node{ + &expr.ArrayItem{ + Position: &position.Position{ + StartLine: 234, + EndLine: 234, + StartPos: 4704, + EndPos: 4704, + }, + Val: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 234, + EndLine: 234, + StartPos: 4704, + EndPos: 4704, + }, + Value: "1", + }, + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 235, + EndLine: 235, + StartPos: 4710, + EndPos: 4722, + }, + Expr: &expr.ShortArray{ + Position: &position.Position{ + StartLine: 235, + EndLine: 235, + StartPos: 4710, + EndPos: 4721, + }, + Items: []node.Node{ + &expr.ArrayItem{ + Position: &position.Position{ + StartLine: 235, + EndLine: 235, + StartPos: 4711, + EndPos: 4714, + }, + Key: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 235, + EndLine: 235, + StartPos: 4711, + EndPos: 4711, + }, + Value: "1", + }, + Val: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 235, + EndLine: 235, + StartPos: 4714, + EndPos: 4714, + }, + Value: "1", + }, + }, + &expr.ArrayItem{ + Position: &position.Position{ + StartLine: 235, + EndLine: 235, + StartPos: 4717, + EndPos: 4719, + }, + Val: &expr.Reference{ + Position: &position.Position{ + StartLine: 235, + EndLine: 235, + StartPos: 4717, + EndPos: 4719, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 235, + EndLine: 235, + StartPos: 4718, + EndPos: 4719, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 235, + EndLine: 235, + StartPos: 4718, + EndPos: 4719, + }, + Value: "b", + }, }, }, }, }, }, }, - &stmt.Static{ - Vars: []node.Node{ - &stmt.StaticVar{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expr: &expr.ConstFetch{ - Constant: &name.FullyQualified{ - Parts: []node.Node{ - &name.NamePart{Value: "Foo"}, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 237, + EndLine: 237, + StartPos: 4727, + EndPos: 4737, + }, + Expr: &expr.StaticCall{ + Position: &position.Position{ + StartLine: 237, + EndLine: 237, + StartPos: 4727, + EndPos: 4736, + }, + Class: &name.Name{ + Position: &position.Position{ + StartLine: 237, + EndLine: 237, + StartPos: 4727, + EndPos: 4729, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 237, + EndLine: 237, + StartPos: 4727, + EndPos: 4729, + }, + Value: "Foo", + }, + }, + }, + Call: &node.Identifier{ + Position: &position.Position{ + StartLine: 237, + EndLine: 237, + StartPos: 4732, + EndPos: 4734, + }, + Value: "bar", + }, + ArgumentList: &node.ArgumentList{ + Position: &position.Position{ + StartLine: 237, + EndLine: 237, + StartPos: 4735, + EndPos: 4736, + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 238, + EndLine: 238, + StartPos: 4741, + EndPos: 4761, + }, + Expr: &expr.StaticCall{ + Position: &position.Position{ + StartLine: 238, + EndLine: 238, + StartPos: 4741, + EndPos: 4760, + }, + Class: &name.Relative{ + Position: &position.Position{ + StartLine: 238, + EndLine: 238, + StartPos: 4741, + EndPos: 4753, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 238, + EndLine: 238, + StartPos: 4751, + EndPos: 4753, + }, + Value: "Foo", + }, + }, + }, + Call: &node.Identifier{ + Position: &position.Position{ + StartLine: 238, + EndLine: 238, + StartPos: 4756, + EndPos: 4758, + }, + Value: "bar", + }, + ArgumentList: &node.ArgumentList{ + Position: &position.Position{ + StartLine: 238, + EndLine: 238, + StartPos: 4759, + EndPos: 4760, + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 239, + EndLine: 239, + StartPos: 4765, + EndPos: 4776, + }, + Expr: &expr.StaticCall{ + Position: &position.Position{ + StartLine: 239, + EndLine: 239, + StartPos: 4765, + EndPos: 4775, + }, + Class: &name.FullyQualified{ + Position: &position.Position{ + StartLine: 239, + EndLine: 239, + StartPos: 4765, + EndPos: 4768, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 239, + EndLine: 239, + StartPos: 4766, + EndPos: 4768, + }, + Value: "Foo", + }, + }, + }, + Call: &node.Identifier{ + Position: &position.Position{ + StartLine: 239, + EndLine: 239, + StartPos: 4771, + EndPos: 4773, + }, + Value: "bar", + }, + ArgumentList: &node.ArgumentList{ + Position: &position.Position{ + StartLine: 239, + EndLine: 239, + StartPos: 4774, + EndPos: 4775, + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 240, + EndLine: 240, + StartPos: 4780, + EndPos: 4791, + }, + Expr: &expr.StaticCall{ + Position: &position.Position{ + StartLine: 240, + EndLine: 240, + StartPos: 4780, + EndPos: 4790, + }, + Class: &name.Name{ + Position: &position.Position{ + StartLine: 240, + EndLine: 240, + StartPos: 4780, + EndPos: 4782, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 240, + EndLine: 240, + StartPos: 4780, + EndPos: 4782, + }, + Value: "Foo", + }, + }, + }, + Call: &expr.Variable{ + Position: &position.Position{ + StartLine: 240, + EndLine: 240, + StartPos: 4785, + EndPos: 4788, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 240, + EndLine: 240, + StartPos: 4785, + EndPos: 4788, + }, + Value: "bar", + }, + }, + ArgumentList: &node.ArgumentList{ + Position: &position.Position{ + StartLine: 240, + EndLine: 240, + StartPos: 4789, + EndPos: 4790, + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 241, + EndLine: 241, + StartPos: 4795, + EndPos: 4807, + }, + Expr: &expr.StaticCall{ + Position: &position.Position{ + StartLine: 241, + EndLine: 241, + StartPos: 4795, + EndPos: 4806, + }, + Class: &expr.Variable{ + Position: &position.Position{ + StartLine: 241, + EndLine: 241, + StartPos: 4795, + EndPos: 4798, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 241, + EndLine: 241, + StartPos: 4795, + EndPos: 4798, + }, + Value: "foo", + }, + }, + Call: &expr.Variable{ + Position: &position.Position{ + StartLine: 241, + EndLine: 241, + StartPos: 4801, + EndPos: 4804, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 241, + EndLine: 241, + StartPos: 4801, + EndPos: 4804, + }, + Value: "bar", + }, + }, + ArgumentList: &node.ArgumentList{ + Position: &position.Position{ + StartLine: 241, + EndLine: 241, + StartPos: 4805, + EndPos: 4806, + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 242, + EndLine: 242, + StartPos: 4811, + EndPos: 4820, + }, + Expr: &expr.StaticPropertyFetch{ + Position: &position.Position{ + StartLine: 242, + EndLine: 242, + StartPos: 4811, + EndPos: 4819, + }, + Class: &name.Name{ + Position: &position.Position{ + StartLine: 242, + EndLine: 242, + StartPos: 4811, + EndPos: 4813, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 242, + EndLine: 242, + StartPos: 4811, + EndPos: 4813, + }, + Value: "Foo", + }, + }, + }, + Property: &expr.Variable{ + Position: &position.Position{ + StartLine: 242, + EndLine: 242, + StartPos: 4816, + EndPos: 4819, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 242, + EndLine: 242, + StartPos: 4816, + EndPos: 4819, + }, + Value: "bar", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 243, + EndLine: 243, + StartPos: 4824, + EndPos: 4843, + }, + Expr: &expr.StaticPropertyFetch{ + Position: &position.Position{ + StartLine: 243, + EndLine: 243, + StartPos: 4824, + EndPos: 4842, + }, + Class: &name.Relative{ + Position: &position.Position{ + StartLine: 243, + EndLine: 243, + StartPos: 4824, + EndPos: 4836, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 243, + EndLine: 243, + StartPos: 4834, + EndPos: 4836, + }, + Value: "Foo", + }, + }, + }, + Property: &expr.Variable{ + Position: &position.Position{ + StartLine: 243, + EndLine: 243, + StartPos: 4839, + EndPos: 4842, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 243, + EndLine: 243, + StartPos: 4839, + EndPos: 4842, + }, + Value: "bar", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 244, + EndLine: 244, + StartPos: 4847, + EndPos: 4857, + }, + Expr: &expr.StaticPropertyFetch{ + Position: &position.Position{ + StartLine: 244, + EndLine: 244, + StartPos: 4847, + EndPos: 4856, + }, + Class: &name.FullyQualified{ + Position: &position.Position{ + StartLine: 244, + EndLine: 244, + StartPos: 4847, + EndPos: 4850, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 244, + EndLine: 244, + StartPos: 4848, + EndPos: 4850, + }, + Value: "Foo", + }, + }, + }, + Property: &expr.Variable{ + Position: &position.Position{ + StartLine: 244, + EndLine: 244, + StartPos: 4853, + EndPos: 4856, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 244, + EndLine: 244, + StartPos: 4853, + EndPos: 4856, + }, + Value: "bar", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 245, + EndLine: 245, + StartPos: 4861, + EndPos: 4873, + }, + Expr: &expr.Ternary{ + Position: &position.Position{ + StartLine: 245, + EndLine: 245, + StartPos: 4861, + EndPos: 4872, + }, + Condition: &expr.Variable{ + Position: &position.Position{ + StartLine: 245, + EndLine: 245, + StartPos: 4861, + EndPos: 4862, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 245, + EndLine: 245, + StartPos: 4861, + EndPos: 4862, + }, + Value: "a", + }, + }, + IfTrue: &expr.Variable{ + Position: &position.Position{ + StartLine: 245, + EndLine: 245, + StartPos: 4866, + EndPos: 4867, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 245, + EndLine: 245, + StartPos: 4866, + EndPos: 4867, + }, + Value: "b", + }, + }, + IfFalse: &expr.Variable{ + Position: &position.Position{ + StartLine: 245, + EndLine: 245, + StartPos: 4871, + EndPos: 4872, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 245, + EndLine: 245, + StartPos: 4871, + EndPos: 4872, + }, + Value: "c", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 246, + EndLine: 246, + StartPos: 4877, + EndPos: 4886, + }, + Expr: &expr.Ternary{ + Position: &position.Position{ + StartLine: 246, + EndLine: 246, + StartPos: 4877, + EndPos: 4885, + }, + Condition: &expr.Variable{ + Position: &position.Position{ + StartLine: 246, + EndLine: 246, + StartPos: 4877, + EndPos: 4878, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 246, + EndLine: 246, + StartPos: 4877, + EndPos: 4878, + }, + Value: "a", + }, + }, + IfFalse: &expr.Variable{ + Position: &position.Position{ + StartLine: 246, + EndLine: 246, + StartPos: 4884, + EndPos: 4885, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 246, + EndLine: 246, + StartPos: 4884, + EndPos: 4885, + }, + Value: "c", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 247, + EndLine: 247, + StartPos: 4890, + EndPos: 4912, + }, + Expr: &expr.Ternary{ + Position: &position.Position{ + StartLine: 247, + EndLine: 247, + StartPos: 4890, + EndPos: 4911, + }, + Condition: &expr.Variable{ + Position: &position.Position{ + StartLine: 247, + EndLine: 247, + StartPos: 4890, + EndPos: 4891, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 247, + EndLine: 247, + StartPos: 4890, + EndPos: 4891, + }, + Value: "a", + }, + }, + IfTrue: &expr.Ternary{ + Position: &position.Position{ + StartLine: 247, + EndLine: 247, + StartPos: 4895, + EndPos: 4906, + }, + Condition: &expr.Variable{ + Position: &position.Position{ + StartLine: 247, + EndLine: 247, + StartPos: 4895, + EndPos: 4896, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 247, + EndLine: 247, + StartPos: 4895, + EndPos: 4896, + }, + Value: "b", + }, + }, + IfTrue: &expr.Variable{ + Position: &position.Position{ + StartLine: 247, + EndLine: 247, + StartPos: 4900, + EndPos: 4901, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 247, + EndLine: 247, + StartPos: 4900, + EndPos: 4901, + }, + Value: "c", + }, + }, + IfFalse: &expr.Variable{ + Position: &position.Position{ + StartLine: 247, + EndLine: 247, + StartPos: 4905, + EndPos: 4906, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 247, + EndLine: 247, + StartPos: 4905, + EndPos: 4906, + }, + Value: "d", + }, + }, + }, + IfFalse: &expr.Variable{ + Position: &position.Position{ + StartLine: 247, + EndLine: 247, + StartPos: 4910, + EndPos: 4911, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 247, + EndLine: 247, + StartPos: 4910, + EndPos: 4911, + }, + Value: "e", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 248, + EndLine: 248, + StartPos: 4916, + EndPos: 4938, + }, + Expr: &expr.Ternary{ + Position: &position.Position{ + StartLine: 248, + EndLine: 248, + StartPos: 4916, + EndPos: 4937, + }, + Condition: &expr.Ternary{ + Position: &position.Position{ + StartLine: 248, + EndLine: 248, + StartPos: 4916, + EndPos: 4927, + }, + Condition: &expr.Variable{ + Position: &position.Position{ + StartLine: 248, + EndLine: 248, + StartPos: 4916, + EndPos: 4917, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 248, + EndLine: 248, + StartPos: 4916, + EndPos: 4917, + }, + Value: "a", + }, + }, + IfTrue: &expr.Variable{ + Position: &position.Position{ + StartLine: 248, + EndLine: 248, + StartPos: 4921, + EndPos: 4922, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 248, + EndLine: 248, + StartPos: 4921, + EndPos: 4922, + }, + Value: "b", + }, + }, + IfFalse: &expr.Variable{ + Position: &position.Position{ + StartLine: 248, + EndLine: 248, + StartPos: 4926, + EndPos: 4927, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 248, + EndLine: 248, + StartPos: 4926, + EndPos: 4927, + }, + Value: "c", + }, + }, + }, + IfTrue: &expr.Variable{ + Position: &position.Position{ + StartLine: 248, + EndLine: 248, + StartPos: 4931, + EndPos: 4932, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 248, + EndLine: 248, + StartPos: 4931, + EndPos: 4932, + }, + Value: "d", + }, + }, + IfFalse: &expr.Variable{ + Position: &position.Position{ + StartLine: 248, + EndLine: 248, + StartPos: 4936, + EndPos: 4937, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 248, + EndLine: 248, + StartPos: 4936, + EndPos: 4937, + }, + Value: "e", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 249, + EndLine: 249, + StartPos: 4942, + EndPos: 4945, + }, + Expr: &expr.UnaryMinus{ + Position: &position.Position{ + StartLine: 249, + EndLine: 249, + StartPos: 4942, + EndPos: 4944, + }, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 249, + EndLine: 249, + StartPos: 4943, + EndPos: 4944, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 249, + EndLine: 249, + StartPos: 4943, + EndPos: 4944, + }, + Value: "a", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 250, + EndLine: 250, + StartPos: 4949, + EndPos: 4952, + }, + Expr: &expr.UnaryPlus{ + Position: &position.Position{ + StartLine: 250, + EndLine: 250, + StartPos: 4949, + EndPos: 4951, + }, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 250, + EndLine: 250, + StartPos: 4950, + EndPos: 4951, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 250, + EndLine: 250, + StartPos: 4950, + EndPos: 4951, + }, + Value: "a", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 251, + EndLine: 251, + StartPos: 4956, + EndPos: 4959, + }, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 251, + EndLine: 251, + StartPos: 4956, + EndPos: 4958, + }, + VarName: &expr.Variable{ + Position: &position.Position{ + StartLine: 251, + EndLine: 251, + StartPos: 4957, + EndPos: 4958, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 251, + EndLine: 251, + StartPos: 4957, + EndPos: 4958, + }, + Value: "a", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 252, + EndLine: 252, + StartPos: 4963, + EndPos: 4967, + }, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 252, + EndLine: 252, + StartPos: 4963, + EndPos: 4966, + }, + VarName: &expr.Variable{ + Position: &position.Position{ + StartLine: 252, + EndLine: 252, + StartPos: 4964, + EndPos: 4966, + }, + VarName: &expr.Variable{ + Position: &position.Position{ + StartLine: 252, + EndLine: 252, + StartPos: 4965, + EndPos: 4966, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 252, + EndLine: 252, + StartPos: 4965, + EndPos: 4966, + }, + Value: "a", + }, + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 253, + EndLine: 253, + StartPos: 4971, + EndPos: 4976, + }, + Expr: &expr.Yield{ + Position: &position.Position{ + StartLine: 253, + EndLine: 253, + StartPos: 4971, + EndPos: 4975, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 254, + EndLine: 254, + StartPos: 4980, + EndPos: 4988, + }, + Expr: &expr.Yield{ + Position: &position.Position{ + StartLine: 254, + EndLine: 254, + StartPos: 4980, + EndPos: 4987, + }, + Value: &expr.Variable{ + Position: &position.Position{ + StartLine: 254, + EndLine: 254, + StartPos: 4986, + EndPos: 4987, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 254, + EndLine: 254, + StartPos: 4986, + EndPos: 4987, + }, + Value: "a", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 255, + EndLine: 255, + StartPos: 4992, + EndPos: 5006, + }, + Expr: &expr.Yield{ + Position: &position.Position{ + StartLine: 255, + EndLine: 255, + StartPos: 4992, + EndPos: 5005, + }, + Key: &expr.Variable{ + Position: &position.Position{ + StartLine: 255, + EndLine: 255, + StartPos: 4998, + EndPos: 4999, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 255, + EndLine: 255, + StartPos: 4998, + EndPos: 4999, + }, + Value: "a", + }, + }, + Value: &expr.Variable{ + Position: &position.Position{ + StartLine: 255, + EndLine: 255, + StartPos: 5004, + EndPos: 5005, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 255, + EndLine: 255, + StartPos: 5004, + EndPos: 5005, + }, + Value: "b", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 256, + EndLine: 256, + StartPos: 5010, + EndPos: 5026, + }, + Expr: &expr.Yield{ + Position: &position.Position{ + StartLine: 256, + EndLine: 256, + StartPos: 5010, + EndPos: 5025, + }, + Value: &expr.ClassConstFetch{ + Position: &position.Position{ + StartLine: 256, + EndLine: 256, + StartPos: 5016, + EndPos: 5025, + }, + Class: &name.Name{ + Position: &position.Position{ + StartLine: 256, + EndLine: 256, + StartPos: 5016, + EndPos: 5018, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 256, + EndLine: 256, + StartPos: 5016, + EndPos: 5018, + }, + Value: "Foo", + }, + }, + }, + ConstantName: &node.Identifier{ + Position: &position.Position{ + StartLine: 256, + EndLine: 256, + StartPos: 5021, + EndPos: 5025, + }, + Value: "class", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 257, + EndLine: 257, + StartPos: 5030, + EndPos: 5052, + }, + Expr: &expr.Yield{ + Position: &position.Position{ + StartLine: 257, + EndLine: 257, + StartPos: 5030, + EndPos: 5051, + }, + Key: &expr.Variable{ + Position: &position.Position{ + StartLine: 257, + EndLine: 257, + StartPos: 5036, + EndPos: 5037, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 257, + EndLine: 257, + StartPos: 5036, + EndPos: 5037, + }, + Value: "a", + }, + }, + Value: &expr.ClassConstFetch{ + Position: &position.Position{ + StartLine: 257, + EndLine: 257, + StartPos: 5042, + EndPos: 5051, + }, + Class: &name.Name{ + Position: &position.Position{ + StartLine: 257, + EndLine: 257, + StartPos: 5042, + EndPos: 5044, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 257, + EndLine: 257, + StartPos: 5042, + EndPos: 5044, + }, + Value: "Foo", + }, + }, + }, + ConstantName: &node.Identifier{ + Position: &position.Position{ + StartLine: 257, + EndLine: 257, + StartPos: 5047, + EndPos: 5051, + }, + Value: "class", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 259, + EndLine: 259, + StartPos: 5059, + EndPos: 5068, + }, + Expr: &cast.Array{ + Position: &position.Position{ + StartLine: 259, + EndLine: 259, + StartPos: 5059, + EndPos: 5067, + }, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 259, + EndLine: 259, + StartPos: 5066, + EndPos: 5067, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 259, + EndLine: 259, + StartPos: 5066, + EndPos: 5067, + }, + Value: "a", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 260, + EndLine: 260, + StartPos: 5072, + EndPos: 5083, + }, + Expr: &cast.Bool{ + Position: &position.Position{ + StartLine: 260, + EndLine: 260, + StartPos: 5072, + EndPos: 5082, + }, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 260, + EndLine: 260, + StartPos: 5081, + EndPos: 5082, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 260, + EndLine: 260, + StartPos: 5081, + EndPos: 5082, + }, + Value: "a", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 261, + EndLine: 261, + StartPos: 5087, + EndPos: 5095, + }, + Expr: &cast.Bool{ + Position: &position.Position{ + StartLine: 261, + EndLine: 261, + StartPos: 5087, + EndPos: 5094, + }, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 261, + EndLine: 261, + StartPos: 5093, + EndPos: 5094, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 261, + EndLine: 261, + StartPos: 5093, + EndPos: 5094, + }, + Value: "a", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 262, + EndLine: 262, + StartPos: 5099, + EndPos: 5109, + }, + Expr: &cast.Double{ + Position: &position.Position{ + StartLine: 262, + EndLine: 262, + StartPos: 5099, + EndPos: 5108, + }, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 262, + EndLine: 262, + StartPos: 5107, + EndPos: 5108, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 262, + EndLine: 262, + StartPos: 5107, + EndPos: 5108, + }, + Value: "a", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 263, + EndLine: 263, + StartPos: 5113, + EndPos: 5122, + }, + Expr: &cast.Double{ + Position: &position.Position{ + StartLine: 263, + EndLine: 263, + StartPos: 5113, + EndPos: 5121, + }, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 263, + EndLine: 263, + StartPos: 5120, + EndPos: 5121, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 263, + EndLine: 263, + StartPos: 5120, + EndPos: 5121, + }, + Value: "a", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 264, + EndLine: 264, + StartPos: 5126, + EndPos: 5137, + }, + Expr: &cast.Int{ + Position: &position.Position{ + StartLine: 264, + EndLine: 264, + StartPos: 5126, + EndPos: 5136, + }, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 264, + EndLine: 264, + StartPos: 5135, + EndPos: 5136, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 264, + EndLine: 264, + StartPos: 5135, + EndPos: 5136, + }, + Value: "a", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 265, + EndLine: 265, + StartPos: 5141, + EndPos: 5148, + }, + Expr: &cast.Int{ + Position: &position.Position{ + StartLine: 265, + EndLine: 265, + StartPos: 5141, + EndPos: 5147, + }, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 265, + EndLine: 265, + StartPos: 5146, + EndPos: 5147, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 265, + EndLine: 265, + StartPos: 5146, + EndPos: 5147, + }, + Value: "a", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 266, + EndLine: 266, + StartPos: 5152, + EndPos: 5162, + }, + Expr: &cast.Object{ + Position: &position.Position{ + StartLine: 266, + EndLine: 266, + StartPos: 5152, + EndPos: 5161, + }, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 266, + EndLine: 266, + StartPos: 5160, + EndPos: 5161, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 266, + EndLine: 266, + StartPos: 5160, + EndPos: 5161, + }, + Value: "a", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 267, + EndLine: 267, + StartPos: 5166, + EndPos: 5176, + }, + Expr: &cast.String{ + Position: &position.Position{ + StartLine: 267, + EndLine: 267, + StartPos: 5166, + EndPos: 5175, + }, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 267, + EndLine: 267, + StartPos: 5174, + EndPos: 5175, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 267, + EndLine: 267, + StartPos: 5174, + EndPos: 5175, + }, + Value: "a", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 268, + EndLine: 268, + StartPos: 5180, + EndPos: 5189, + }, + Expr: &cast.Unset{ + Position: &position.Position{ + StartLine: 268, + EndLine: 268, + StartPos: 5180, + EndPos: 5188, + }, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 268, + EndLine: 268, + StartPos: 5187, + EndPos: 5188, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 268, + EndLine: 268, + StartPos: 5187, + EndPos: 5188, + }, + Value: "a", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 270, + EndLine: 270, + StartPos: 5194, + EndPos: 5201, + }, + Expr: &binary.BitwiseAnd{ + Position: &position.Position{ + StartLine: 270, + EndLine: 270, + StartPos: 5194, + EndPos: 5200, + }, + Left: &expr.Variable{ + Position: &position.Position{ + StartLine: 270, + EndLine: 270, + StartPos: 5194, + EndPos: 5195, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 270, + EndLine: 270, + StartPos: 5194, + EndPos: 5195, + }, + Value: "a", + }, + }, + Right: &expr.Variable{ + Position: &position.Position{ + StartLine: 270, + EndLine: 270, + StartPos: 5199, + EndPos: 5200, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 270, + EndLine: 270, + StartPos: 5199, + EndPos: 5200, + }, + Value: "b", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 271, + EndLine: 271, + StartPos: 5205, + EndPos: 5212, + }, + Expr: &binary.BitwiseOr{ + Position: &position.Position{ + StartLine: 271, + EndLine: 271, + StartPos: 5205, + EndPos: 5211, + }, + Left: &expr.Variable{ + Position: &position.Position{ + StartLine: 271, + EndLine: 271, + StartPos: 5205, + EndPos: 5206, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 271, + EndLine: 271, + StartPos: 5205, + EndPos: 5206, + }, + Value: "a", + }, + }, + Right: &expr.Variable{ + Position: &position.Position{ + StartLine: 271, + EndLine: 271, + StartPos: 5210, + EndPos: 5211, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 271, + EndLine: 271, + StartPos: 5210, + EndPos: 5211, + }, + Value: "b", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 272, + EndLine: 272, + StartPos: 5216, + EndPos: 5223, + }, + Expr: &binary.BitwiseXor{ + Position: &position.Position{ + StartLine: 272, + EndLine: 272, + StartPos: 5216, + EndPos: 5222, + }, + Left: &expr.Variable{ + Position: &position.Position{ + StartLine: 272, + EndLine: 272, + StartPos: 5216, + EndPos: 5217, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 272, + EndLine: 272, + StartPos: 5216, + EndPos: 5217, + }, + Value: "a", + }, + }, + Right: &expr.Variable{ + Position: &position.Position{ + StartLine: 272, + EndLine: 272, + StartPos: 5221, + EndPos: 5222, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 272, + EndLine: 272, + StartPos: 5221, + EndPos: 5222, + }, + Value: "b", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 273, + EndLine: 273, + StartPos: 5227, + EndPos: 5235, + }, + Expr: &binary.BooleanAnd{ + Position: &position.Position{ + StartLine: 273, + EndLine: 273, + StartPos: 5227, + EndPos: 5234, + }, + Left: &expr.Variable{ + Position: &position.Position{ + StartLine: 273, + EndLine: 273, + StartPos: 5227, + EndPos: 5228, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 273, + EndLine: 273, + StartPos: 5227, + EndPos: 5228, + }, + Value: "a", + }, + }, + Right: &expr.Variable{ + Position: &position.Position{ + StartLine: 273, + EndLine: 273, + StartPos: 5233, + EndPos: 5234, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 273, + EndLine: 273, + StartPos: 5233, + EndPos: 5234, + }, + Value: "b", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 274, + EndLine: 274, + StartPos: 5239, + EndPos: 5247, + }, + Expr: &binary.BooleanOr{ + Position: &position.Position{ + StartLine: 274, + EndLine: 274, + StartPos: 5239, + EndPos: 5246, + }, + Left: &expr.Variable{ + Position: &position.Position{ + StartLine: 274, + EndLine: 274, + StartPos: 5239, + EndPos: 5240, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 274, + EndLine: 274, + StartPos: 5239, + EndPos: 5240, + }, + Value: "a", + }, + }, + Right: &expr.Variable{ + Position: &position.Position{ + StartLine: 274, + EndLine: 274, + StartPos: 5245, + EndPos: 5246, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 274, + EndLine: 274, + StartPos: 5245, + EndPos: 5246, + }, + Value: "b", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 275, + EndLine: 275, + StartPos: 5251, + EndPos: 5258, + }, + Expr: &binary.Concat{ + Position: &position.Position{ + StartLine: 275, + EndLine: 275, + StartPos: 5251, + EndPos: 5257, + }, + Left: &expr.Variable{ + Position: &position.Position{ + StartLine: 275, + EndLine: 275, + StartPos: 5251, + EndPos: 5252, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 275, + EndLine: 275, + StartPos: 5251, + EndPos: 5252, + }, + Value: "a", + }, + }, + Right: &expr.Variable{ + Position: &position.Position{ + StartLine: 275, + EndLine: 275, + StartPos: 5256, + EndPos: 5257, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 275, + EndLine: 275, + StartPos: 5256, + EndPos: 5257, + }, + Value: "b", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 276, + EndLine: 276, + StartPos: 5262, + EndPos: 5269, + }, + Expr: &binary.Div{ + Position: &position.Position{ + StartLine: 276, + EndLine: 276, + StartPos: 5262, + EndPos: 5268, + }, + Left: &expr.Variable{ + Position: &position.Position{ + StartLine: 276, + EndLine: 276, + StartPos: 5262, + EndPos: 5263, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 276, + EndLine: 276, + StartPos: 5262, + EndPos: 5263, + }, + Value: "a", + }, + }, + Right: &expr.Variable{ + Position: &position.Position{ + StartLine: 276, + EndLine: 276, + StartPos: 5267, + EndPos: 5268, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 276, + EndLine: 276, + StartPos: 5267, + EndPos: 5268, + }, + Value: "b", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 277, + EndLine: 277, + StartPos: 5273, + EndPos: 5281, + }, + Expr: &binary.Equal{ + Position: &position.Position{ + StartLine: 277, + EndLine: 277, + StartPos: 5273, + EndPos: 5280, + }, + Left: &expr.Variable{ + Position: &position.Position{ + StartLine: 277, + EndLine: 277, + StartPos: 5273, + EndPos: 5274, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 277, + EndLine: 277, + StartPos: 5273, + EndPos: 5274, + }, + Value: "a", + }, + }, + Right: &expr.Variable{ + Position: &position.Position{ + StartLine: 277, + EndLine: 277, + StartPos: 5279, + EndPos: 5280, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 277, + EndLine: 277, + StartPos: 5279, + EndPos: 5280, + }, + Value: "b", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 278, + EndLine: 278, + StartPos: 5285, + EndPos: 5293, + }, + Expr: &binary.GreaterOrEqual{ + Position: &position.Position{ + StartLine: 278, + EndLine: 278, + StartPos: 5285, + EndPos: 5292, + }, + Left: &expr.Variable{ + Position: &position.Position{ + StartLine: 278, + EndLine: 278, + StartPos: 5285, + EndPos: 5286, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 278, + EndLine: 278, + StartPos: 5285, + EndPos: 5286, + }, + Value: "a", + }, + }, + Right: &expr.Variable{ + Position: &position.Position{ + StartLine: 278, + EndLine: 278, + StartPos: 5291, + EndPos: 5292, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 278, + EndLine: 278, + StartPos: 5291, + EndPos: 5292, + }, + Value: "b", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 279, + EndLine: 279, + StartPos: 5297, + EndPos: 5304, + }, + Expr: &binary.Greater{ + Position: &position.Position{ + StartLine: 279, + EndLine: 279, + StartPos: 5297, + EndPos: 5303, + }, + Left: &expr.Variable{ + Position: &position.Position{ + StartLine: 279, + EndLine: 279, + StartPos: 5297, + EndPos: 5298, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 279, + EndLine: 279, + StartPos: 5297, + EndPos: 5298, + }, + Value: "a", + }, + }, + Right: &expr.Variable{ + Position: &position.Position{ + StartLine: 279, + EndLine: 279, + StartPos: 5302, + EndPos: 5303, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 279, + EndLine: 279, + StartPos: 5302, + EndPos: 5303, + }, + Value: "b", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 280, + EndLine: 280, + StartPos: 5308, + EndPos: 5317, + }, + Expr: &binary.Identical{ + Position: &position.Position{ + StartLine: 280, + EndLine: 280, + StartPos: 5308, + EndPos: 5316, + }, + Left: &expr.Variable{ + Position: &position.Position{ + StartLine: 280, + EndLine: 280, + StartPos: 5308, + EndPos: 5309, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 280, + EndLine: 280, + StartPos: 5308, + EndPos: 5309, + }, + Value: "a", + }, + }, + Right: &expr.Variable{ + Position: &position.Position{ + StartLine: 280, + EndLine: 280, + StartPos: 5315, + EndPos: 5316, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 280, + EndLine: 280, + StartPos: 5315, + EndPos: 5316, + }, + Value: "b", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 281, + EndLine: 281, + StartPos: 5321, + EndPos: 5330, + }, + Expr: &binary.LogicalAnd{ + Position: &position.Position{ + StartLine: 281, + EndLine: 281, + StartPos: 5321, + EndPos: 5329, + }, + Left: &expr.Variable{ + Position: &position.Position{ + StartLine: 281, + EndLine: 281, + StartPos: 5321, + EndPos: 5322, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 281, + EndLine: 281, + StartPos: 5321, + EndPos: 5322, + }, + Value: "a", + }, + }, + Right: &expr.Variable{ + Position: &position.Position{ + StartLine: 281, + EndLine: 281, + StartPos: 5328, + EndPos: 5329, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 281, + EndLine: 281, + StartPos: 5328, + EndPos: 5329, + }, + Value: "b", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 282, + EndLine: 282, + StartPos: 5334, + EndPos: 5342, + }, + Expr: &binary.LogicalOr{ + Position: &position.Position{ + StartLine: 282, + EndLine: 282, + StartPos: 5334, + EndPos: 5341, + }, + Left: &expr.Variable{ + Position: &position.Position{ + StartLine: 282, + EndLine: 282, + StartPos: 5334, + EndPos: 5335, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 282, + EndLine: 282, + StartPos: 5334, + EndPos: 5335, + }, + Value: "a", + }, + }, + Right: &expr.Variable{ + Position: &position.Position{ + StartLine: 282, + EndLine: 282, + StartPos: 5340, + EndPos: 5341, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 282, + EndLine: 282, + StartPos: 5340, + EndPos: 5341, + }, + Value: "b", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 283, + EndLine: 283, + StartPos: 5346, + EndPos: 5355, + }, + Expr: &binary.LogicalXor{ + Position: &position.Position{ + StartLine: 283, + EndLine: 283, + StartPos: 5346, + EndPos: 5354, + }, + Left: &expr.Variable{ + Position: &position.Position{ + StartLine: 283, + EndLine: 283, + StartPos: 5346, + EndPos: 5347, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 283, + EndLine: 283, + StartPos: 5346, + EndPos: 5347, + }, + Value: "a", + }, + }, + Right: &expr.Variable{ + Position: &position.Position{ + StartLine: 283, + EndLine: 283, + StartPos: 5353, + EndPos: 5354, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 283, + EndLine: 283, + StartPos: 5353, + EndPos: 5354, + }, + Value: "b", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 284, + EndLine: 284, + StartPos: 5359, + EndPos: 5366, + }, + Expr: &binary.Minus{ + Position: &position.Position{ + StartLine: 284, + EndLine: 284, + StartPos: 5359, + EndPos: 5365, + }, + Left: &expr.Variable{ + Position: &position.Position{ + StartLine: 284, + EndLine: 284, + StartPos: 5359, + EndPos: 5360, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 284, + EndLine: 284, + StartPos: 5359, + EndPos: 5360, + }, + Value: "a", + }, + }, + Right: &expr.Variable{ + Position: &position.Position{ + StartLine: 284, + EndLine: 284, + StartPos: 5364, + EndPos: 5365, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 284, + EndLine: 284, + StartPos: 5364, + EndPos: 5365, + }, + Value: "b", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 285, + EndLine: 285, + StartPos: 5370, + EndPos: 5377, + }, + Expr: &binary.Mod{ + Position: &position.Position{ + StartLine: 285, + EndLine: 285, + StartPos: 5370, + EndPos: 5376, + }, + Left: &expr.Variable{ + Position: &position.Position{ + StartLine: 285, + EndLine: 285, + StartPos: 5370, + EndPos: 5371, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 285, + EndLine: 285, + StartPos: 5370, + EndPos: 5371, + }, + Value: "a", + }, + }, + Right: &expr.Variable{ + Position: &position.Position{ + StartLine: 285, + EndLine: 285, + StartPos: 5375, + EndPos: 5376, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 285, + EndLine: 285, + StartPos: 5375, + EndPos: 5376, + }, + Value: "b", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 286, + EndLine: 286, + StartPos: 5381, + EndPos: 5388, + }, + Expr: &binary.Mul{ + Position: &position.Position{ + StartLine: 286, + EndLine: 286, + StartPos: 5381, + EndPos: 5387, + }, + Left: &expr.Variable{ + Position: &position.Position{ + StartLine: 286, + EndLine: 286, + StartPos: 5381, + EndPos: 5382, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 286, + EndLine: 286, + StartPos: 5381, + EndPos: 5382, + }, + Value: "a", + }, + }, + Right: &expr.Variable{ + Position: &position.Position{ + StartLine: 286, + EndLine: 286, + StartPos: 5386, + EndPos: 5387, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 286, + EndLine: 286, + StartPos: 5386, + EndPos: 5387, + }, + Value: "b", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 287, + EndLine: 287, + StartPos: 5392, + EndPos: 5400, + }, + Expr: &binary.NotEqual{ + Position: &position.Position{ + StartLine: 287, + EndLine: 287, + StartPos: 5392, + EndPos: 5399, + }, + Left: &expr.Variable{ + Position: &position.Position{ + StartLine: 287, + EndLine: 287, + StartPos: 5392, + EndPos: 5393, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 287, + EndLine: 287, + StartPos: 5392, + EndPos: 5393, + }, + Value: "a", + }, + }, + Right: &expr.Variable{ + Position: &position.Position{ + StartLine: 287, + EndLine: 287, + StartPos: 5398, + EndPos: 5399, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 287, + EndLine: 287, + StartPos: 5398, + EndPos: 5399, + }, + Value: "b", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 288, + EndLine: 288, + StartPos: 5404, + EndPos: 5413, + }, + Expr: &binary.NotIdentical{ + Position: &position.Position{ + StartLine: 288, + EndLine: 288, + StartPos: 5404, + EndPos: 5412, + }, + Left: &expr.Variable{ + Position: &position.Position{ + StartLine: 288, + EndLine: 288, + StartPos: 5404, + EndPos: 5405, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 288, + EndLine: 288, + StartPos: 5404, + EndPos: 5405, + }, + Value: "a", + }, + }, + Right: &expr.Variable{ + Position: &position.Position{ + StartLine: 288, + EndLine: 288, + StartPos: 5411, + EndPos: 5412, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 288, + EndLine: 288, + StartPos: 5411, + EndPos: 5412, + }, + Value: "b", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 289, + EndLine: 289, + StartPos: 5417, + EndPos: 5424, + }, + Expr: &binary.Plus{ + Position: &position.Position{ + StartLine: 289, + EndLine: 289, + StartPos: 5417, + EndPos: 5423, + }, + Left: &expr.Variable{ + Position: &position.Position{ + StartLine: 289, + EndLine: 289, + StartPos: 5417, + EndPos: 5418, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 289, + EndLine: 289, + StartPos: 5417, + EndPos: 5418, + }, + Value: "a", + }, + }, + Right: &expr.Variable{ + Position: &position.Position{ + StartLine: 289, + EndLine: 289, + StartPos: 5422, + EndPos: 5423, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 289, + EndLine: 289, + StartPos: 5422, + EndPos: 5423, + }, + Value: "b", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 290, + EndLine: 290, + StartPos: 5428, + EndPos: 5436, + }, + Expr: &binary.Pow{ + Position: &position.Position{ + StartLine: 290, + EndLine: 290, + StartPos: 5428, + EndPos: 5435, + }, + Left: &expr.Variable{ + Position: &position.Position{ + StartLine: 290, + EndLine: 290, + StartPos: 5428, + EndPos: 5429, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 290, + EndLine: 290, + StartPos: 5428, + EndPos: 5429, + }, + Value: "a", + }, + }, + Right: &expr.Variable{ + Position: &position.Position{ + StartLine: 290, + EndLine: 290, + StartPos: 5434, + EndPos: 5435, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 290, + EndLine: 290, + StartPos: 5434, + EndPos: 5435, + }, + Value: "b", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 291, + EndLine: 291, + StartPos: 5440, + EndPos: 5448, + }, + Expr: &binary.ShiftLeft{ + Position: &position.Position{ + StartLine: 291, + EndLine: 291, + StartPos: 5440, + EndPos: 5447, + }, + Left: &expr.Variable{ + Position: &position.Position{ + StartLine: 291, + EndLine: 291, + StartPos: 5440, + EndPos: 5441, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 291, + EndLine: 291, + StartPos: 5440, + EndPos: 5441, + }, + Value: "a", + }, + }, + Right: &expr.Variable{ + Position: &position.Position{ + StartLine: 291, + EndLine: 291, + StartPos: 5446, + EndPos: 5447, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 291, + EndLine: 291, + StartPos: 5446, + EndPos: 5447, + }, + Value: "b", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 292, + EndLine: 292, + StartPos: 5452, + EndPos: 5460, + }, + Expr: &binary.ShiftRight{ + Position: &position.Position{ + StartLine: 292, + EndLine: 292, + StartPos: 5452, + EndPos: 5459, + }, + Left: &expr.Variable{ + Position: &position.Position{ + StartLine: 292, + EndLine: 292, + StartPos: 5452, + EndPos: 5453, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 292, + EndLine: 292, + StartPos: 5452, + EndPos: 5453, + }, + Value: "a", + }, + }, + Right: &expr.Variable{ + Position: &position.Position{ + StartLine: 292, + EndLine: 292, + StartPos: 5458, + EndPos: 5459, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 292, + EndLine: 292, + StartPos: 5458, + EndPos: 5459, + }, + Value: "b", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 293, + EndLine: 293, + StartPos: 5464, + EndPos: 5472, + }, + Expr: &binary.SmallerOrEqual{ + Position: &position.Position{ + StartLine: 293, + EndLine: 293, + StartPos: 5464, + EndPos: 5471, + }, + Left: &expr.Variable{ + Position: &position.Position{ + StartLine: 293, + EndLine: 293, + StartPos: 5464, + EndPos: 5465, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 293, + EndLine: 293, + StartPos: 5464, + EndPos: 5465, + }, + Value: "a", + }, + }, + Right: &expr.Variable{ + Position: &position.Position{ + StartLine: 293, + EndLine: 293, + StartPos: 5470, + EndPos: 5471, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 293, + EndLine: 293, + StartPos: 5470, + EndPos: 5471, + }, + Value: "b", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 294, + EndLine: 294, + StartPos: 5476, + EndPos: 5483, + }, + Expr: &binary.Smaller{ + Position: &position.Position{ + StartLine: 294, + EndLine: 294, + StartPos: 5476, + EndPos: 5482, + }, + Left: &expr.Variable{ + Position: &position.Position{ + StartLine: 294, + EndLine: 294, + StartPos: 5476, + EndPos: 5477, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 294, + EndLine: 294, + StartPos: 5476, + EndPos: 5477, + }, + Value: "a", + }, + }, + Right: &expr.Variable{ + Position: &position.Position{ + StartLine: 294, + EndLine: 294, + StartPos: 5481, + EndPos: 5482, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 294, + EndLine: 294, + StartPos: 5481, + EndPos: 5482, + }, + Value: "b", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 296, + EndLine: 296, + StartPos: 5488, + EndPos: 5496, + }, + Expr: &assign.Reference{ + Position: &position.Position{ + StartLine: 296, + EndLine: 296, + StartPos: 5488, + EndPos: 5495, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 296, + EndLine: 296, + StartPos: 5488, + EndPos: 5489, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 296, + EndLine: 296, + StartPos: 5488, + EndPos: 5489, + }, + Value: "a", + }, + }, + Expression: &expr.Variable{ + Position: &position.Position{ + StartLine: 296, + EndLine: 296, + StartPos: 5494, + EndPos: 5495, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 296, + EndLine: 296, + StartPos: 5494, + EndPos: 5495, + }, + Value: "b", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 297, + EndLine: 297, + StartPos: 5500, + EndPos: 5513, + }, + Expr: &assign.Reference{ + Position: &position.Position{ + StartLine: 297, + EndLine: 297, + StartPos: 5500, + EndPos: 5512, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 297, + EndLine: 297, + StartPos: 5500, + EndPos: 5501, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 297, + EndLine: 297, + StartPos: 5500, + EndPos: 5501, + }, + Value: "a", + }, + }, + Expression: &expr.New{ + Position: &position.Position{ + StartLine: 297, + EndLine: 297, + StartPos: 5506, + EndPos: 5512, + }, + Class: &name.Name{ + Position: &position.Position{ + StartLine: 297, + EndLine: 297, + StartPos: 5510, + EndPos: 5512, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 297, + EndLine: 297, + StartPos: 5510, + EndPos: 5512, + }, + Value: "Foo", }, }, }, }, }, }, - &stmt.Static{ - Vars: []node.Node{ - &stmt.StaticVar{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expr: &expr.Array{}, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 298, + EndLine: 298, + StartPos: 5517, + EndPos: 5534, + }, + Expr: &assign.Reference{ + Position: &position.Position{ + StartLine: 298, + EndLine: 298, + StartPos: 5517, + EndPos: 5533, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 298, + EndLine: 298, + StartPos: 5517, + EndPos: 5518, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 298, + EndLine: 298, + StartPos: 5517, + EndPos: 5518, + }, + Value: "a", + }, + }, + Expression: &expr.New{ + Position: &position.Position{ + StartLine: 298, + EndLine: 298, + StartPos: 5523, + EndPos: 5533, + }, + Class: &name.Name{ + Position: &position.Position{ + StartLine: 298, + EndLine: 298, + StartPos: 5527, + EndPos: 5529, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 298, + EndLine: 298, + StartPos: 5527, + EndPos: 5529, + }, + Value: "Foo", + }, + }, + }, + ArgumentList: &node.ArgumentList{ + Position: &position.Position{ + StartLine: 298, + EndLine: 298, + StartPos: 5530, + EndPos: 5533, + }, + Arguments: []node.Node{ + &node.Argument{ + Position: &position.Position{ + StartLine: 298, + EndLine: 298, + StartPos: 5531, + EndPos: 5532, + }, + Variadic: false, + IsReference: false, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 298, + EndLine: 298, + StartPos: 5531, + EndPos: 5532, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 298, + EndLine: 298, + StartPos: 5531, + EndPos: 5532, + }, + Value: "b", + }, + }, + }, + }, + }, }, }, }, - &stmt.Static{ - Vars: []node.Node{ - &stmt.StaticVar{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expr: &expr.Array{ + &stmt.Expression{ + Position: &position.Position{ + StartLine: 299, + EndLine: 299, + StartPos: 5538, + EndPos: 5545, + }, + Expr: &assign.Assign{ + Position: &position.Position{ + StartLine: 299, + EndLine: 299, + StartPos: 5538, + EndPos: 5544, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 299, + EndLine: 299, + StartPos: 5538, + EndPos: 5539, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 299, + EndLine: 299, + StartPos: 5538, + EndPos: 5539, + }, + Value: "a", + }, + }, + Expression: &expr.Variable{ + Position: &position.Position{ + StartLine: 299, + EndLine: 299, + StartPos: 5543, + EndPos: 5544, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 299, + EndLine: 299, + StartPos: 5543, + EndPos: 5544, + }, + Value: "b", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 300, + EndLine: 300, + StartPos: 5549, + EndPos: 5557, + }, + Expr: &assign.BitwiseAnd{ + Position: &position.Position{ + StartLine: 300, + EndLine: 300, + StartPos: 5549, + EndPos: 5556, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 300, + EndLine: 300, + StartPos: 5549, + EndPos: 5550, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 300, + EndLine: 300, + StartPos: 5549, + EndPos: 5550, + }, + Value: "a", + }, + }, + Expression: &expr.Variable{ + Position: &position.Position{ + StartLine: 300, + EndLine: 300, + StartPos: 5555, + EndPos: 5556, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 300, + EndLine: 300, + StartPos: 5555, + EndPos: 5556, + }, + Value: "b", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 301, + EndLine: 301, + StartPos: 5561, + EndPos: 5569, + }, + Expr: &assign.BitwiseOr{ + Position: &position.Position{ + StartLine: 301, + EndLine: 301, + StartPos: 5561, + EndPos: 5568, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 301, + EndLine: 301, + StartPos: 5561, + EndPos: 5562, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 301, + EndLine: 301, + StartPos: 5561, + EndPos: 5562, + }, + Value: "a", + }, + }, + Expression: &expr.Variable{ + Position: &position.Position{ + StartLine: 301, + EndLine: 301, + StartPos: 5567, + EndPos: 5568, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 301, + EndLine: 301, + StartPos: 5567, + EndPos: 5568, + }, + Value: "b", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 302, + EndLine: 302, + StartPos: 5573, + EndPos: 5581, + }, + Expr: &assign.BitwiseXor{ + Position: &position.Position{ + StartLine: 302, + EndLine: 302, + StartPos: 5573, + EndPos: 5580, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 302, + EndLine: 302, + StartPos: 5573, + EndPos: 5574, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 302, + EndLine: 302, + StartPos: 5573, + EndPos: 5574, + }, + Value: "a", + }, + }, + Expression: &expr.Variable{ + Position: &position.Position{ + StartLine: 302, + EndLine: 302, + StartPos: 5579, + EndPos: 5580, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 302, + EndLine: 302, + StartPos: 5579, + EndPos: 5580, + }, + Value: "b", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 303, + EndLine: 303, + StartPos: 5585, + EndPos: 5593, + }, + Expr: &assign.Concat{ + Position: &position.Position{ + StartLine: 303, + EndLine: 303, + StartPos: 5585, + EndPos: 5592, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 303, + EndLine: 303, + StartPos: 5585, + EndPos: 5586, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 303, + EndLine: 303, + StartPos: 5585, + EndPos: 5586, + }, + Value: "a", + }, + }, + Expression: &expr.Variable{ + Position: &position.Position{ + StartLine: 303, + EndLine: 303, + StartPos: 5591, + EndPos: 5592, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 303, + EndLine: 303, + StartPos: 5591, + EndPos: 5592, + }, + Value: "b", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 304, + EndLine: 304, + StartPos: 5597, + EndPos: 5605, + }, + Expr: &assign.Div{ + Position: &position.Position{ + StartLine: 304, + EndLine: 304, + StartPos: 5597, + EndPos: 5604, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 304, + EndLine: 304, + StartPos: 5597, + EndPos: 5598, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 304, + EndLine: 304, + StartPos: 5597, + EndPos: 5598, + }, + Value: "a", + }, + }, + Expression: &expr.Variable{ + Position: &position.Position{ + StartLine: 304, + EndLine: 304, + StartPos: 5603, + EndPos: 5604, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 304, + EndLine: 304, + StartPos: 5603, + EndPos: 5604, + }, + Value: "b", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 305, + EndLine: 305, + StartPos: 5609, + EndPos: 5617, + }, + Expr: &assign.Minus{ + Position: &position.Position{ + StartLine: 305, + EndLine: 305, + StartPos: 5609, + EndPos: 5616, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 305, + EndLine: 305, + StartPos: 5609, + EndPos: 5610, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 305, + EndLine: 305, + StartPos: 5609, + EndPos: 5610, + }, + Value: "a", + }, + }, + Expression: &expr.Variable{ + Position: &position.Position{ + StartLine: 305, + EndLine: 305, + StartPos: 5615, + EndPos: 5616, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 305, + EndLine: 305, + StartPos: 5615, + EndPos: 5616, + }, + Value: "b", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 306, + EndLine: 306, + StartPos: 5621, + EndPos: 5629, + }, + Expr: &assign.Mod{ + Position: &position.Position{ + StartLine: 306, + EndLine: 306, + StartPos: 5621, + EndPos: 5628, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 306, + EndLine: 306, + StartPos: 5621, + EndPos: 5622, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 306, + EndLine: 306, + StartPos: 5621, + EndPos: 5622, + }, + Value: "a", + }, + }, + Expression: &expr.Variable{ + Position: &position.Position{ + StartLine: 306, + EndLine: 306, + StartPos: 5627, + EndPos: 5628, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 306, + EndLine: 306, + StartPos: 5627, + EndPos: 5628, + }, + Value: "b", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 307, + EndLine: 307, + StartPos: 5633, + EndPos: 5641, + }, + Expr: &assign.Mul{ + Position: &position.Position{ + StartLine: 307, + EndLine: 307, + StartPos: 5633, + EndPos: 5640, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 307, + EndLine: 307, + StartPos: 5633, + EndPos: 5634, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 307, + EndLine: 307, + StartPos: 5633, + EndPos: 5634, + }, + Value: "a", + }, + }, + Expression: &expr.Variable{ + Position: &position.Position{ + StartLine: 307, + EndLine: 307, + StartPos: 5639, + EndPos: 5640, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 307, + EndLine: 307, + StartPos: 5639, + EndPos: 5640, + }, + Value: "b", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 308, + EndLine: 308, + StartPos: 5645, + EndPos: 5653, + }, + Expr: &assign.Plus{ + Position: &position.Position{ + StartLine: 308, + EndLine: 308, + StartPos: 5645, + EndPos: 5652, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 308, + EndLine: 308, + StartPos: 5645, + EndPos: 5646, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 308, + EndLine: 308, + StartPos: 5645, + EndPos: 5646, + }, + Value: "a", + }, + }, + Expression: &expr.Variable{ + Position: &position.Position{ + StartLine: 308, + EndLine: 308, + StartPos: 5651, + EndPos: 5652, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 308, + EndLine: 308, + StartPos: 5651, + EndPos: 5652, + }, + Value: "b", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 309, + EndLine: 309, + StartPos: 5657, + EndPos: 5666, + }, + Expr: &assign.Pow{ + Position: &position.Position{ + StartLine: 309, + EndLine: 309, + StartPos: 5657, + EndPos: 5665, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 309, + EndLine: 309, + StartPos: 5657, + EndPos: 5658, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 309, + EndLine: 309, + StartPos: 5657, + EndPos: 5658, + }, + Value: "a", + }, + }, + Expression: &expr.Variable{ + Position: &position.Position{ + StartLine: 309, + EndLine: 309, + StartPos: 5664, + EndPos: 5665, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 309, + EndLine: 309, + StartPos: 5664, + EndPos: 5665, + }, + Value: "b", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 310, + EndLine: 310, + StartPos: 5670, + EndPos: 5679, + }, + Expr: &assign.ShiftLeft{ + Position: &position.Position{ + StartLine: 310, + EndLine: 310, + StartPos: 5670, + EndPos: 5678, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 310, + EndLine: 310, + StartPos: 5670, + EndPos: 5671, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 310, + EndLine: 310, + StartPos: 5670, + EndPos: 5671, + }, + Value: "a", + }, + }, + Expression: &expr.Variable{ + Position: &position.Position{ + StartLine: 310, + EndLine: 310, + StartPos: 5677, + EndPos: 5678, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 310, + EndLine: 310, + StartPos: 5677, + EndPos: 5678, + }, + Value: "b", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 311, + EndLine: 311, + StartPos: 5683, + EndPos: 5692, + }, + Expr: &assign.ShiftRight{ + Position: &position.Position{ + StartLine: 311, + EndLine: 311, + StartPos: 5683, + EndPos: 5691, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 311, + EndLine: 311, + StartPos: 5683, + EndPos: 5684, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 311, + EndLine: 311, + StartPos: 5683, + EndPos: 5684, + }, + Value: "a", + }, + }, + Expression: &expr.Variable{ + Position: &position.Position{ + StartLine: 311, + EndLine: 311, + StartPos: 5690, + EndPos: 5691, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 311, + EndLine: 311, + StartPos: 5690, + EndPos: 5691, + }, + Value: "b", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 314, + EndLine: 314, + StartPos: 5699, + EndPos: 5710, + }, + Expr: &expr.New{ + Position: &position.Position{ + StartLine: 314, + EndLine: 314, + StartPos: 5699, + EndPos: 5708, + }, + Class: &name.FullyQualified{ + Position: &position.Position{ + StartLine: 314, + EndLine: 314, + StartPos: 5703, + EndPos: 5706, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 314, + EndLine: 314, + StartPos: 5704, + EndPos: 5706, + }, + Value: "Foo", + }, + }, + }, + ArgumentList: &node.ArgumentList{ + Position: &position.Position{ + StartLine: 314, + EndLine: 314, + StartPos: 5707, + EndPos: 5708, + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 315, + EndLine: 315, + StartPos: 5735, + EndPos: 5738, + }, + Expr: &expr.PropertyFetch{ + Position: &position.Position{ + StartLine: 315, + EndLine: 315, + StartPos: 5735, + EndPos: 5737, + }, + Variable: &expr.MethodCall{ + Position: &position.Position{ + StartLine: 315, + EndLine: 315, + StartPos: 5731, + EndPos: 5732, + }, + Variable: &expr.New{ + Position: &position.Position{ + StartLine: 315, + EndLine: 315, + StartPos: 5715, + EndPos: 5724, + }, + Class: &name.FullyQualified{ + Position: &position.Position{ + StartLine: 315, + EndLine: 315, + StartPos: 5719, + EndPos: 5722, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 315, + EndLine: 315, + StartPos: 5720, + EndPos: 5722, + }, + Value: "Foo", + }, + }, + }, + ArgumentList: &node.ArgumentList{ + Position: &position.Position{ + StartLine: 315, + EndLine: 315, + StartPos: 5723, + EndPos: 5724, + }, + }, + }, + Method: &node.Identifier{ + Position: &position.Position{ + StartLine: 315, + EndLine: 315, + StartPos: 5728, + EndPos: 5730, + }, + Value: "bar", + }, + ArgumentList: &node.ArgumentList{ + Position: &position.Position{ + StartLine: 315, + EndLine: 315, + StartPos: 5731, + EndPos: 5732, + }, + }, + }, + Property: &node.Identifier{ + Position: &position.Position{ + StartLine: 315, + EndLine: 315, + StartPos: 5735, + EndPos: 5737, + }, + Value: "baz", + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 316, + EndLine: 316, + StartPos: 5758, + EndPos: 5760, + }, + Expr: &expr.ArrayDimFetch{ + Position: &position.Position{ + StartLine: 316, + EndLine: 316, + StartPos: 5758, + EndPos: 5758, + }, + Variable: &expr.ArrayDimFetch{ + Position: &position.Position{ + StartLine: 316, + EndLine: 316, + StartPos: 5755, + EndPos: 5755, + }, + Variable: &expr.New{ + Position: &position.Position{ + StartLine: 316, + EndLine: 316, + StartPos: 5743, + EndPos: 5752, + }, + Class: &name.FullyQualified{ + Position: &position.Position{ + StartLine: 316, + EndLine: 316, + StartPos: 5747, + EndPos: 5750, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 316, + EndLine: 316, + StartPos: 5748, + EndPos: 5750, + }, + Value: "Foo", + }, + }, + }, + ArgumentList: &node.ArgumentList{ + Position: &position.Position{ + StartLine: 316, + EndLine: 316, + StartPos: 5751, + EndPos: 5752, + }, + }, + }, + Dim: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 316, + EndLine: 316, + StartPos: 5755, + EndPos: 5755, + }, + Value: "0", + }, + }, + Dim: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 316, + EndLine: 316, + StartPos: 5758, + EndPos: 5758, + }, + Value: "0", + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 317, + EndLine: 317, + StartPos: 5784, + EndPos: 5786, + }, + Expr: &expr.MethodCall{ + Position: &position.Position{ + StartLine: 317, + EndLine: 317, + StartPos: 5784, + EndPos: 5785, + }, + Variable: &expr.ArrayDimFetch{ + Position: &position.Position{ + StartLine: 317, + EndLine: 317, + StartPos: 5777, + EndPos: 5777, + }, + Variable: &expr.New{ + Position: &position.Position{ + StartLine: 317, + EndLine: 317, + StartPos: 5765, + EndPos: 5774, + }, + Class: &name.FullyQualified{ + Position: &position.Position{ + StartLine: 317, + EndLine: 317, + StartPos: 5769, + EndPos: 5772, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 317, + EndLine: 317, + StartPos: 5770, + EndPos: 5772, + }, + Value: "Foo", + }, + }, + }, + ArgumentList: &node.ArgumentList{ + Position: &position.Position{ + StartLine: 317, + EndLine: 317, + StartPos: 5773, + EndPos: 5774, + }, + }, + }, + Dim: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 317, + EndLine: 317, + StartPos: 5777, + EndPos: 5777, + }, + Value: "0", + }, + }, + Method: &node.Identifier{ + Position: &position.Position{ + StartLine: 317, + EndLine: 317, + StartPos: 5781, + EndPos: 5783, + }, + Value: "bar", + }, + ArgumentList: &node.ArgumentList{ + Position: &position.Position{ + StartLine: 317, + EndLine: 317, + StartPos: 5784, + EndPos: 5785, + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 319, + EndLine: 319, + StartPos: 5791, + EndPos: 5807, + }, + Expr: &expr.ArrayDimFetch{ + Position: &position.Position{ + StartLine: 319, + EndLine: 319, + StartPos: 5791, + EndPos: 5806, + }, + Variable: &expr.ArrayDimFetch{ + Position: &position.Position{ + StartLine: 319, + EndLine: 319, + StartPos: 5791, + EndPos: 5803, + }, + Variable: &expr.Array{ + Position: &position.Position{ + StartLine: 319, + EndLine: 319, + StartPos: 5791, + EndPos: 5800, + }, Items: []node.Node{ &expr.ArrayItem{ - Key: &scalar.Lnumber{Value: "1"}, - Val: &scalar.Lnumber{Value: "1"}, + Position: &position.Position{ + StartLine: 319, + EndLine: 319, + StartPos: 5797, + EndPos: 5799, + }, + Val: &expr.ShortArray{ + Position: &position.Position{ + StartLine: 319, + EndLine: 319, + StartPos: 5797, + EndPos: 5799, + }, + Items: []node.Node{ + &expr.ArrayItem{ + Position: &position.Position{ + StartLine: 319, + EndLine: 319, + StartPos: 5798, + EndPos: 5798, + }, + Val: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 319, + EndLine: 319, + StartPos: 5798, + EndPos: 5798, + }, + Value: "0", + }, + }, + }, + }, }, - &expr.ArrayItem{ - Val: &scalar.Lnumber{Value: "2"}, + }, + }, + Dim: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 319, + EndLine: 319, + StartPos: 5802, + EndPos: 5802, + }, + Value: "0", + }, + }, + Dim: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 319, + EndLine: 319, + StartPos: 5805, + EndPos: 5805, + }, + Value: "0", + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 320, + EndLine: 320, + StartPos: 5811, + EndPos: 5819, + }, + Expr: &expr.ArrayDimFetch{ + Position: &position.Position{ + StartLine: 320, + EndLine: 320, + StartPos: 5811, + EndPos: 5818, + }, + Variable: &scalar.String{ + Position: &position.Position{ + StartLine: 320, + EndLine: 320, + StartPos: 5811, + EndPos: 5815, + }, + Value: "\"foo\"", + }, + Dim: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 320, + EndLine: 320, + StartPos: 5817, + EndPos: 5817, + }, + Value: "0", + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 321, + EndLine: 321, + StartPos: 5823, + EndPos: 5829, + }, + Expr: &expr.ArrayDimFetch{ + Position: &position.Position{ + StartLine: 321, + EndLine: 321, + StartPos: 5823, + EndPos: 5828, + }, + Variable: &expr.ConstFetch{ + Position: &position.Position{ + StartLine: 321, + EndLine: 321, + StartPos: 5823, + EndPos: 5825, + }, + Constant: &name.Name{ + Position: &position.Position{ + StartLine: 321, + EndLine: 321, + StartPos: 5823, + EndPos: 5825, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 321, + EndLine: 321, + StartPos: 5823, + EndPos: 5825, + }, + Value: "foo", + }, + }, + }, + }, + Dim: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 321, + EndLine: 321, + StartPos: 5827, + EndPos: 5827, + }, + Value: "0", + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 322, + EndLine: 322, + StartPos: 5833, + EndPos: 5844, + }, + Expr: &expr.ClassConstFetch{ + Position: &position.Position{ + StartLine: 322, + EndLine: 322, + StartPos: 5833, + EndPos: 5843, + }, + Class: &node.Identifier{ + Position: &position.Position{ + StartLine: 322, + EndLine: 322, + StartPos: 5833, + EndPos: 5838, + }, + Value: "static", + }, + ConstantName: &node.Identifier{ + Position: &position.Position{ + StartLine: 322, + EndLine: 322, + StartPos: 5841, + EndPos: 5843, + }, + Value: "foo", + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 324, + EndLine: 324, + StartPos: 5849, + EndPos: 5857, + }, + Expr: &expr.New{ + Position: &position.Position{ + StartLine: 324, + EndLine: 324, + StartPos: 5849, + EndPos: 5856, + }, + Class: &expr.Variable{ + Position: &position.Position{ + StartLine: 324, + EndLine: 324, + StartPos: 5853, + EndPos: 5856, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 324, + EndLine: 324, + StartPos: 5853, + EndPos: 5856, + }, + Value: "foo", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 325, + EndLine: 325, + StartPos: 5861, + EndPos: 5875, + }, + Expr: &expr.New{ + Position: &position.Position{ + StartLine: 325, + EndLine: 325, + StartPos: 5861, + EndPos: 5874, + }, + Class: &expr.StaticPropertyFetch{ + Position: &position.Position{ + StartLine: 325, + EndLine: 325, + StartPos: 5865, + EndPos: 5874, + }, + Class: &expr.Variable{ + Position: &position.Position{ + StartLine: 325, + EndLine: 325, + StartPos: 5865, + EndPos: 5868, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 325, + EndLine: 325, + StartPos: 5865, + EndPos: 5868, + }, + Value: "foo", + }, + }, + Property: &expr.Variable{ + Position: &position.Position{ + StartLine: 325, + EndLine: 325, + StartPos: 5871, + EndPos: 5874, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 325, + EndLine: 325, + StartPos: 5871, + EndPos: 5874, + }, + Value: "bar", + }, + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 326, + EndLine: 326, + StartPos: 5879, + EndPos: 5891, + }, + Expr: &expr.New{ + Position: &position.Position{ + StartLine: 326, + EndLine: 326, + StartPos: 5879, + EndPos: 5889, + }, + Class: &expr.ArrayDimFetch{ + Position: &position.Position{ + StartLine: 326, + EndLine: 326, + StartPos: 5889, + EndPos: 5889, + }, + Variable: &expr.PropertyFetch{ + Position: &position.Position{ + StartLine: 326, + EndLine: 326, + StartPos: 5887, + EndPos: 5889, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 326, + EndLine: 326, + StartPos: 5883, + EndPos: 5887, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 326, + EndLine: 326, + StartPos: 5883, + EndPos: 5884, + }, + Value: "a", + }, + }, + Property: &node.Identifier{ + Position: &position.Position{ + StartLine: 326, + EndLine: 326, + StartPos: 5887, + EndPos: 5887, + }, + Value: "b", + }, + }, + Dim: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 326, + EndLine: 326, + StartPos: 5889, + EndPos: 5889, + }, + Value: "0", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 327, + EndLine: 327, + StartPos: 5895, + EndPos: 5926, + }, + Expr: &expr.New{ + Position: &position.Position{ + StartLine: 327, + EndLine: 327, + StartPos: 5895, + EndPos: 5924, + }, + Class: &expr.ArrayDimFetch{ + Position: &position.Position{ + StartLine: 327, + EndLine: 327, + StartPos: 5924, + EndPos: 5924, + }, + Variable: &expr.PropertyFetch{ + Position: &position.Position{ + StartLine: 327, + EndLine: 327, + StartPos: 5922, + EndPos: 5924, + }, + Variable: &expr.PropertyFetch{ + Position: &position.Position{ + StartLine: 327, + EndLine: 327, + StartPos: 5918, + EndPos: 5922, + }, + Variable: &expr.ArrayDimFetch{ + Position: &position.Position{ + StartLine: 327, + EndLine: 327, + StartPos: 5905, + EndPos: 5919, + }, + Variable: &expr.PropertyFetch{ + Position: &position.Position{ + StartLine: 327, + EndLine: 327, + StartPos: 5903, + EndPos: 5914, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 327, + EndLine: 327, + StartPos: 5899, + EndPos: 5903, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 327, + EndLine: 327, + StartPos: 5899, + EndPos: 5900, + }, + Value: "a", + }, + }, + Property: &node.Identifier{ + Position: &position.Position{ + StartLine: 327, + EndLine: 327, + StartPos: 5903, + EndPos: 5903, + }, + Value: "b", + }, + }, + Dim: &expr.Ternary{ + Position: &position.Position{ + StartLine: 327, + EndLine: 327, + StartPos: 5905, + EndPos: 5914, + }, + Condition: &expr.Variable{ + Position: &position.Position{ + StartLine: 327, + EndLine: 327, + StartPos: 5905, + EndPos: 5906, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 327, + EndLine: 327, + StartPos: 5905, + EndPos: 5906, + }, + Value: "b", + }, + }, + IfFalse: &expr.ConstFetch{ + Position: &position.Position{ + StartLine: 327, + EndLine: 327, + StartPos: 5911, + EndPos: 5914, + }, + Constant: &name.Name{ + Position: &position.Position{ + StartLine: 327, + EndLine: 327, + StartPos: 5911, + EndPos: 5914, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 327, + EndLine: 327, + StartPos: 5911, + EndPos: 5914, + }, + Value: "null", + }, + }, + }, + }, + }, + }, + Property: &expr.Variable{ + Position: &position.Position{ + StartLine: 327, + EndLine: 327, + StartPos: 5918, + EndPos: 5919, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 327, + EndLine: 327, + StartPos: 5918, + EndPos: 5919, + }, + Value: "c", + }, + }, + }, + Property: &node.Identifier{ + Position: &position.Position{ + StartLine: 327, + EndLine: 327, + StartPos: 5922, + EndPos: 5922, + }, + Value: "d", + }, + }, + Dim: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 327, + EndLine: 327, + StartPos: 5924, + EndPos: 5924, + }, + Value: "0", + }, + }, + }, + }, + &stmt.Static{ + Position: &position.Position{ + StartLine: 327, + EndLine: 327, + StartPos: 5927, + EndPos: 5945, + }, + Vars: []node.Node{ + &stmt.StaticVar{ + Position: &position.Position{ + StartLine: 327, + EndLine: 327, + StartPos: 5934, + EndPos: 5944, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 327, + EndLine: 327, + StartPos: 5934, + EndPos: 5935, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 327, + EndLine: 327, + StartPos: 5934, + EndPos: 5935, + }, + Value: "a", + }, + }, + Expr: &expr.ArrayDimFetch{ + Position: &position.Position{ + StartLine: 327, + EndLine: 327, + StartPos: 5939, + EndPos: 5944, + }, + Variable: &expr.ShortArray{ + Position: &position.Position{ + StartLine: 327, + EndLine: 327, + StartPos: 5939, + EndPos: 5941, + }, + Items: []node.Node{ + &expr.ArrayItem{ + Position: &position.Position{ + StartLine: 327, + EndLine: 327, + StartPos: 5940, + EndPos: 5940, + }, + Val: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 327, + EndLine: 327, + StartPos: 5940, + EndPos: 5940, + }, + Value: "1", + }, + }, + }, + }, + Dim: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 327, + EndLine: 327, + StartPos: 5943, + EndPos: 5943, + }, + Value: "0", + }, + }, + }, + }, + }, + &stmt.Static{ + Position: &position.Position{ + StartLine: 329, + EndLine: 329, + StartPos: 5950, + EndPos: 5964, + }, + Vars: []node.Node{ + &stmt.StaticVar{ + Position: &position.Position{ + StartLine: 329, + EndLine: 329, + StartPos: 5957, + EndPos: 5963, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 329, + EndLine: 329, + StartPos: 5957, + EndPos: 5958, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 329, + EndLine: 329, + StartPos: 5957, + EndPos: 5958, + }, + Value: "a", + }, + }, + Expr: &expr.BooleanNot{ + Position: &position.Position{ + StartLine: 329, + EndLine: 329, + StartPos: 5962, + EndPos: 5963, + }, + Expr: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 329, + EndLine: 329, + StartPos: 5963, + EndPos: 5963, + }, + Value: "1", + }, + }, + }, + }, + }, + &stmt.Static{ + Position: &position.Position{ + StartLine: 330, + EndLine: 330, + StartPos: 5968, + EndPos: 5982, + }, + Vars: []node.Node{ + &stmt.StaticVar{ + Position: &position.Position{ + StartLine: 330, + EndLine: 330, + StartPos: 5975, + EndPos: 5981, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 330, + EndLine: 330, + StartPos: 5975, + EndPos: 5976, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 330, + EndLine: 330, + StartPos: 5975, + EndPos: 5976, + }, + Value: "a", + }, + }, + Expr: &expr.BitwiseNot{ + Position: &position.Position{ + StartLine: 330, + EndLine: 330, + StartPos: 5980, + EndPos: 5981, + }, + Expr: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 330, + EndLine: 330, + StartPos: 5981, + EndPos: 5981, + }, + Value: "1", + }, + }, + }, + }, + }, + &stmt.Static{ + Position: &position.Position{ + StartLine: 331, + EndLine: 331, + StartPos: 5986, + EndPos: 6000, + }, + Vars: []node.Node{ + &stmt.StaticVar{ + Position: &position.Position{ + StartLine: 331, + EndLine: 331, + StartPos: 5993, + EndPos: 5999, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 331, + EndLine: 331, + StartPos: 5993, + EndPos: 5994, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 331, + EndLine: 331, + StartPos: 5993, + EndPos: 5994, + }, + Value: "a", + }, + }, + Expr: &expr.UnaryPlus{ + Position: &position.Position{ + StartLine: 331, + EndLine: 331, + StartPos: 5998, + EndPos: 5999, + }, + Expr: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 331, + EndLine: 331, + StartPos: 5999, + EndPos: 5999, + }, + Value: "1", + }, + }, + }, + }, + }, + &stmt.Static{ + Position: &position.Position{ + StartLine: 332, + EndLine: 332, + StartPos: 6004, + EndPos: 6018, + }, + Vars: []node.Node{ + &stmt.StaticVar{ + Position: &position.Position{ + StartLine: 332, + EndLine: 332, + StartPos: 6011, + EndPos: 6017, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 332, + EndLine: 332, + StartPos: 6011, + EndPos: 6012, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 332, + EndLine: 332, + StartPos: 6011, + EndPos: 6012, + }, + Value: "a", + }, + }, + Expr: &expr.UnaryMinus{ + Position: &position.Position{ + StartLine: 332, + EndLine: 332, + StartPos: 6016, + EndPos: 6017, + }, + Expr: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 332, + EndLine: 332, + StartPos: 6017, + EndPos: 6017, + }, + Value: "1", + }, + }, + }, + }, + }, + &stmt.Static{ + Position: &position.Position{ + StartLine: 333, + EndLine: 333, + StartPos: 6022, + EndPos: 6037, + }, + Vars: []node.Node{ + &stmt.StaticVar{ + Position: &position.Position{ + StartLine: 333, + EndLine: 333, + StartPos: 6029, + EndPos: 6035, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 333, + EndLine: 333, + StartPos: 6029, + EndPos: 6030, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 333, + EndLine: 333, + StartPos: 6029, + EndPos: 6030, + }, + Value: "a", + }, + }, + Expr: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 333, + EndLine: 333, + StartPos: 6035, + EndPos: 6035, + }, + Value: "1", + }, + }, + }, + }, + &stmt.Static{ + Position: &position.Position{ + StartLine: 334, + EndLine: 334, + StartPos: 6041, + EndPos: 6059, + }, + Vars: []node.Node{ + &stmt.StaticVar{ + Position: &position.Position{ + StartLine: 334, + EndLine: 334, + StartPos: 6048, + EndPos: 6058, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 334, + EndLine: 334, + StartPos: 6048, + EndPos: 6049, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 334, + EndLine: 334, + StartPos: 6048, + EndPos: 6049, + }, + Value: "a", + }, + }, + Expr: &expr.Ternary{ + Position: &position.Position{ + StartLine: 334, + EndLine: 334, + StartPos: 6053, + EndPos: 6058, + }, + Condition: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 334, + EndLine: 334, + StartPos: 6053, + EndPos: 6053, + }, + Value: "1", + }, + IfFalse: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 334, + EndLine: 334, + StartPos: 6058, + EndPos: 6058, + }, + Value: "2", + }, + }, + }, + }, + }, + &stmt.Static{ + Position: &position.Position{ + StartLine: 335, + EndLine: 335, + StartPos: 6063, + EndPos: 6084, + }, + Vars: []node.Node{ + &stmt.StaticVar{ + Position: &position.Position{ + StartLine: 335, + EndLine: 335, + StartPos: 6070, + EndPos: 6083, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 335, + EndLine: 335, + StartPos: 6070, + EndPos: 6071, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 335, + EndLine: 335, + StartPos: 6070, + EndPos: 6071, + }, + Value: "a", + }, + }, + Expr: &expr.Ternary{ + Position: &position.Position{ + StartLine: 335, + EndLine: 335, + StartPos: 6075, + EndPos: 6083, + }, + Condition: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 335, + EndLine: 335, + StartPos: 6075, + EndPos: 6075, + }, + Value: "1", + }, + IfTrue: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 335, + EndLine: 335, + StartPos: 6079, + EndPos: 6079, + }, + Value: "2", + }, + IfFalse: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 335, + EndLine: 335, + StartPos: 6083, + EndPos: 6083, + }, + Value: "3", + }, + }, + }, + }, + }, + &stmt.Static{ + Position: &position.Position{ + StartLine: 336, + EndLine: 336, + StartPos: 6088, + EndPos: 6105, + }, + Vars: []node.Node{ + &stmt.StaticVar{ + Position: &position.Position{ + StartLine: 336, + EndLine: 336, + StartPos: 6095, + EndPos: 6104, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 336, + EndLine: 336, + StartPos: 6095, + EndPos: 6096, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 336, + EndLine: 336, + StartPos: 6095, + EndPos: 6096, + }, + Value: "a", + }, + }, + Expr: &binary.BitwiseAnd{ + Position: &position.Position{ + StartLine: 336, + EndLine: 336, + StartPos: 6100, + EndPos: 6104, + }, + Left: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 336, + EndLine: 336, + StartPos: 6100, + EndPos: 6100, + }, + Value: "1", + }, + Right: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 336, + EndLine: 336, + StartPos: 6104, + EndPos: 6104, + }, + Value: "2", + }, + }, + }, + }, + }, + &stmt.Static{ + Position: &position.Position{ + StartLine: 337, + EndLine: 337, + StartPos: 6109, + EndPos: 6126, + }, + Vars: []node.Node{ + &stmt.StaticVar{ + Position: &position.Position{ + StartLine: 337, + EndLine: 337, + StartPos: 6116, + EndPos: 6125, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 337, + EndLine: 337, + StartPos: 6116, + EndPos: 6117, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 337, + EndLine: 337, + StartPos: 6116, + EndPos: 6117, + }, + Value: "a", + }, + }, + Expr: &binary.BitwiseOr{ + Position: &position.Position{ + StartLine: 337, + EndLine: 337, + StartPos: 6121, + EndPos: 6125, + }, + Left: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 337, + EndLine: 337, + StartPos: 6121, + EndPos: 6121, + }, + Value: "1", + }, + Right: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 337, + EndLine: 337, + StartPos: 6125, + EndPos: 6125, + }, + Value: "2", + }, + }, + }, + }, + }, + &stmt.Static{ + Position: &position.Position{ + StartLine: 338, + EndLine: 338, + StartPos: 6130, + EndPos: 6147, + }, + Vars: []node.Node{ + &stmt.StaticVar{ + Position: &position.Position{ + StartLine: 338, + EndLine: 338, + StartPos: 6137, + EndPos: 6146, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 338, + EndLine: 338, + StartPos: 6137, + EndPos: 6138, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 338, + EndLine: 338, + StartPos: 6137, + EndPos: 6138, + }, + Value: "a", + }, + }, + Expr: &binary.BitwiseXor{ + Position: &position.Position{ + StartLine: 338, + EndLine: 338, + StartPos: 6142, + EndPos: 6146, + }, + Left: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 338, + EndLine: 338, + StartPos: 6142, + EndPos: 6142, + }, + Value: "1", + }, + Right: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 338, + EndLine: 338, + StartPos: 6146, + EndPos: 6146, + }, + Value: "2", + }, + }, + }, + }, + }, + &stmt.Static{ + Position: &position.Position{ + StartLine: 339, + EndLine: 339, + StartPos: 6151, + EndPos: 6169, + }, + Vars: []node.Node{ + &stmt.StaticVar{ + Position: &position.Position{ + StartLine: 339, + EndLine: 339, + StartPos: 6158, + EndPos: 6168, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 339, + EndLine: 339, + StartPos: 6158, + EndPos: 6159, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 339, + EndLine: 339, + StartPos: 6158, + EndPos: 6159, + }, + Value: "a", + }, + }, + Expr: &binary.BooleanAnd{ + Position: &position.Position{ + StartLine: 339, + EndLine: 339, + StartPos: 6163, + EndPos: 6168, + }, + Left: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 339, + EndLine: 339, + StartPos: 6163, + EndPos: 6163, + }, + Value: "1", + }, + Right: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 339, + EndLine: 339, + StartPos: 6168, + EndPos: 6168, + }, + Value: "2", + }, + }, + }, + }, + }, + &stmt.Static{ + Position: &position.Position{ + StartLine: 340, + EndLine: 340, + StartPos: 6173, + EndPos: 6191, + }, + Vars: []node.Node{ + &stmt.StaticVar{ + Position: &position.Position{ + StartLine: 340, + EndLine: 340, + StartPos: 6180, + EndPos: 6190, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 340, + EndLine: 340, + StartPos: 6180, + EndPos: 6181, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 340, + EndLine: 340, + StartPos: 6180, + EndPos: 6181, + }, + Value: "a", + }, + }, + Expr: &binary.BooleanOr{ + Position: &position.Position{ + StartLine: 340, + EndLine: 340, + StartPos: 6185, + EndPos: 6190, + }, + Left: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 340, + EndLine: 340, + StartPos: 6185, + EndPos: 6185, + }, + Value: "1", + }, + Right: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 340, + EndLine: 340, + StartPos: 6190, + EndPos: 6190, + }, + Value: "2", + }, + }, + }, + }, + }, + &stmt.Static{ + Position: &position.Position{ + StartLine: 341, + EndLine: 341, + StartPos: 6195, + EndPos: 6212, + }, + Vars: []node.Node{ + &stmt.StaticVar{ + Position: &position.Position{ + StartLine: 341, + EndLine: 341, + StartPos: 6202, + EndPos: 6211, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 341, + EndLine: 341, + StartPos: 6202, + EndPos: 6203, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 341, + EndLine: 341, + StartPos: 6202, + EndPos: 6203, + }, + Value: "a", + }, + }, + Expr: &binary.Concat{ + Position: &position.Position{ + StartLine: 341, + EndLine: 341, + StartPos: 6207, + EndPos: 6211, + }, + Left: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 341, + EndLine: 341, + StartPos: 6207, + EndPos: 6207, + }, + Value: "1", + }, + Right: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 341, + EndLine: 341, + StartPos: 6211, + EndPos: 6211, + }, + Value: "2", + }, + }, + }, + }, + }, + &stmt.Static{ + Position: &position.Position{ + StartLine: 342, + EndLine: 342, + StartPos: 6216, + EndPos: 6233, + }, + Vars: []node.Node{ + &stmt.StaticVar{ + Position: &position.Position{ + StartLine: 342, + EndLine: 342, + StartPos: 6223, + EndPos: 6232, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 342, + EndLine: 342, + StartPos: 6223, + EndPos: 6224, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 342, + EndLine: 342, + StartPos: 6223, + EndPos: 6224, + }, + Value: "a", + }, + }, + Expr: &binary.Div{ + Position: &position.Position{ + StartLine: 342, + EndLine: 342, + StartPos: 6228, + EndPos: 6232, + }, + Left: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 342, + EndLine: 342, + StartPos: 6228, + EndPos: 6228, + }, + Value: "1", + }, + Right: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 342, + EndLine: 342, + StartPos: 6232, + EndPos: 6232, + }, + Value: "2", + }, + }, + }, + }, + }, + &stmt.Static{ + Position: &position.Position{ + StartLine: 343, + EndLine: 343, + StartPos: 6237, + EndPos: 6255, + }, + Vars: []node.Node{ + &stmt.StaticVar{ + Position: &position.Position{ + StartLine: 343, + EndLine: 343, + StartPos: 6244, + EndPos: 6254, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 343, + EndLine: 343, + StartPos: 6244, + EndPos: 6245, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 343, + EndLine: 343, + StartPos: 6244, + EndPos: 6245, + }, + Value: "a", + }, + }, + Expr: &binary.Equal{ + Position: &position.Position{ + StartLine: 343, + EndLine: 343, + StartPos: 6249, + EndPos: 6254, + }, + Left: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 343, + EndLine: 343, + StartPos: 6249, + EndPos: 6249, + }, + Value: "1", + }, + Right: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 343, + EndLine: 343, + StartPos: 6254, + EndPos: 6254, + }, + Value: "2", + }, + }, + }, + }, + }, + &stmt.Static{ + Position: &position.Position{ + StartLine: 344, + EndLine: 344, + StartPos: 6259, + EndPos: 6277, + }, + Vars: []node.Node{ + &stmt.StaticVar{ + Position: &position.Position{ + StartLine: 344, + EndLine: 344, + StartPos: 6266, + EndPos: 6276, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 344, + EndLine: 344, + StartPos: 6266, + EndPos: 6267, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 344, + EndLine: 344, + StartPos: 6266, + EndPos: 6267, + }, + Value: "a", + }, + }, + Expr: &binary.GreaterOrEqual{ + Position: &position.Position{ + StartLine: 344, + EndLine: 344, + StartPos: 6271, + EndPos: 6276, + }, + Left: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 344, + EndLine: 344, + StartPos: 6271, + EndPos: 6271, + }, + Value: "1", + }, + Right: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 344, + EndLine: 344, + StartPos: 6276, + EndPos: 6276, + }, + Value: "2", + }, + }, + }, + }, + }, + &stmt.Static{ + Position: &position.Position{ + StartLine: 345, + EndLine: 345, + StartPos: 6281, + EndPos: 6298, + }, + Vars: []node.Node{ + &stmt.StaticVar{ + Position: &position.Position{ + StartLine: 345, + EndLine: 345, + StartPos: 6288, + EndPos: 6297, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 345, + EndLine: 345, + StartPos: 6288, + EndPos: 6289, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 345, + EndLine: 345, + StartPos: 6288, + EndPos: 6289, + }, + Value: "a", + }, + }, + Expr: &binary.Greater{ + Position: &position.Position{ + StartLine: 345, + EndLine: 345, + StartPos: 6293, + EndPos: 6297, + }, + Left: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 345, + EndLine: 345, + StartPos: 6293, + EndPos: 6293, + }, + Value: "1", + }, + Right: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 345, + EndLine: 345, + StartPos: 6297, + EndPos: 6297, + }, + Value: "2", + }, + }, + }, + }, + }, + &stmt.Static{ + Position: &position.Position{ + StartLine: 346, + EndLine: 346, + StartPos: 6302, + EndPos: 6321, + }, + Vars: []node.Node{ + &stmt.StaticVar{ + Position: &position.Position{ + StartLine: 346, + EndLine: 346, + StartPos: 6309, + EndPos: 6320, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 346, + EndLine: 346, + StartPos: 6309, + EndPos: 6310, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 346, + EndLine: 346, + StartPos: 6309, + EndPos: 6310, + }, + Value: "a", + }, + }, + Expr: &binary.Identical{ + Position: &position.Position{ + StartLine: 346, + EndLine: 346, + StartPos: 6314, + EndPos: 6320, + }, + Left: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 346, + EndLine: 346, + StartPos: 6314, + EndPos: 6314, + }, + Value: "1", + }, + Right: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 346, + EndLine: 346, + StartPos: 6320, + EndPos: 6320, + }, + Value: "2", + }, + }, + }, + }, + }, + &stmt.Static{ + Position: &position.Position{ + StartLine: 347, + EndLine: 347, + StartPos: 6325, + EndPos: 6344, + }, + Vars: []node.Node{ + &stmt.StaticVar{ + Position: &position.Position{ + StartLine: 347, + EndLine: 347, + StartPos: 6332, + EndPos: 6343, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 347, + EndLine: 347, + StartPos: 6332, + EndPos: 6333, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 347, + EndLine: 347, + StartPos: 6332, + EndPos: 6333, + }, + Value: "a", + }, + }, + Expr: &binary.LogicalAnd{ + Position: &position.Position{ + StartLine: 347, + EndLine: 347, + StartPos: 6337, + EndPos: 6343, + }, + Left: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 347, + EndLine: 347, + StartPos: 6337, + EndPos: 6337, + }, + Value: "1", + }, + Right: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 347, + EndLine: 347, + StartPos: 6343, + EndPos: 6343, + }, + Value: "2", + }, + }, + }, + }, + }, + &stmt.Static{ + Position: &position.Position{ + StartLine: 348, + EndLine: 348, + StartPos: 6348, + EndPos: 6366, + }, + Vars: []node.Node{ + &stmt.StaticVar{ + Position: &position.Position{ + StartLine: 348, + EndLine: 348, + StartPos: 6355, + EndPos: 6365, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 348, + EndLine: 348, + StartPos: 6355, + EndPos: 6356, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 348, + EndLine: 348, + StartPos: 6355, + EndPos: 6356, + }, + Value: "a", + }, + }, + Expr: &binary.LogicalOr{ + Position: &position.Position{ + StartLine: 348, + EndLine: 348, + StartPos: 6360, + EndPos: 6365, + }, + Left: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 348, + EndLine: 348, + StartPos: 6360, + EndPos: 6360, + }, + Value: "1", + }, + Right: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 348, + EndLine: 348, + StartPos: 6365, + EndPos: 6365, + }, + Value: "2", + }, + }, + }, + }, + }, + &stmt.Static{ + Position: &position.Position{ + StartLine: 349, + EndLine: 349, + StartPos: 6370, + EndPos: 6389, + }, + Vars: []node.Node{ + &stmt.StaticVar{ + Position: &position.Position{ + StartLine: 349, + EndLine: 349, + StartPos: 6377, + EndPos: 6388, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 349, + EndLine: 349, + StartPos: 6377, + EndPos: 6378, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 349, + EndLine: 349, + StartPos: 6377, + EndPos: 6378, + }, + Value: "a", + }, + }, + Expr: &binary.LogicalXor{ + Position: &position.Position{ + StartLine: 349, + EndLine: 349, + StartPos: 6382, + EndPos: 6388, + }, + Left: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 349, + EndLine: 349, + StartPos: 6382, + EndPos: 6382, + }, + Value: "1", + }, + Right: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 349, + EndLine: 349, + StartPos: 6388, + EndPos: 6388, + }, + Value: "2", + }, + }, + }, + }, + }, + &stmt.Static{ + Position: &position.Position{ + StartLine: 350, + EndLine: 350, + StartPos: 6393, + EndPos: 6410, + }, + Vars: []node.Node{ + &stmt.StaticVar{ + Position: &position.Position{ + StartLine: 350, + EndLine: 350, + StartPos: 6400, + EndPos: 6409, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 350, + EndLine: 350, + StartPos: 6400, + EndPos: 6401, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 350, + EndLine: 350, + StartPos: 6400, + EndPos: 6401, + }, + Value: "a", + }, + }, + Expr: &binary.Minus{ + Position: &position.Position{ + StartLine: 350, + EndLine: 350, + StartPos: 6405, + EndPos: 6409, + }, + Left: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 350, + EndLine: 350, + StartPos: 6405, + EndPos: 6405, + }, + Value: "1", + }, + Right: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 350, + EndLine: 350, + StartPos: 6409, + EndPos: 6409, + }, + Value: "2", + }, + }, + }, + }, + }, + &stmt.Static{ + Position: &position.Position{ + StartLine: 351, + EndLine: 351, + StartPos: 6414, + EndPos: 6431, + }, + Vars: []node.Node{ + &stmt.StaticVar{ + Position: &position.Position{ + StartLine: 351, + EndLine: 351, + StartPos: 6421, + EndPos: 6430, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 351, + EndLine: 351, + StartPos: 6421, + EndPos: 6422, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 351, + EndLine: 351, + StartPos: 6421, + EndPos: 6422, + }, + Value: "a", + }, + }, + Expr: &binary.Mod{ + Position: &position.Position{ + StartLine: 351, + EndLine: 351, + StartPos: 6426, + EndPos: 6430, + }, + Left: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 351, + EndLine: 351, + StartPos: 6426, + EndPos: 6426, + }, + Value: "1", + }, + Right: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 351, + EndLine: 351, + StartPos: 6430, + EndPos: 6430, + }, + Value: "2", + }, + }, + }, + }, + }, + &stmt.Static{ + Position: &position.Position{ + StartLine: 352, + EndLine: 352, + StartPos: 6435, + EndPos: 6452, + }, + Vars: []node.Node{ + &stmt.StaticVar{ + Position: &position.Position{ + StartLine: 352, + EndLine: 352, + StartPos: 6442, + EndPos: 6451, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 352, + EndLine: 352, + StartPos: 6442, + EndPos: 6443, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 352, + EndLine: 352, + StartPos: 6442, + EndPos: 6443, + }, + Value: "a", + }, + }, + Expr: &binary.Mul{ + Position: &position.Position{ + StartLine: 352, + EndLine: 352, + StartPos: 6447, + EndPos: 6451, + }, + Left: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 352, + EndLine: 352, + StartPos: 6447, + EndPos: 6447, + }, + Value: "1", + }, + Right: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 352, + EndLine: 352, + StartPos: 6451, + EndPos: 6451, + }, + Value: "2", + }, + }, + }, + }, + }, + &stmt.Static{ + Position: &position.Position{ + StartLine: 353, + EndLine: 353, + StartPos: 6456, + EndPos: 6474, + }, + Vars: []node.Node{ + &stmt.StaticVar{ + Position: &position.Position{ + StartLine: 353, + EndLine: 353, + StartPos: 6463, + EndPos: 6473, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 353, + EndLine: 353, + StartPos: 6463, + EndPos: 6464, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 353, + EndLine: 353, + StartPos: 6463, + EndPos: 6464, + }, + Value: "a", + }, + }, + Expr: &binary.NotEqual{ + Position: &position.Position{ + StartLine: 353, + EndLine: 353, + StartPos: 6468, + EndPos: 6473, + }, + Left: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 353, + EndLine: 353, + StartPos: 6468, + EndPos: 6468, + }, + Value: "1", + }, + Right: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 353, + EndLine: 353, + StartPos: 6473, + EndPos: 6473, + }, + Value: "2", + }, + }, + }, + }, + }, + &stmt.Static{ + Position: &position.Position{ + StartLine: 354, + EndLine: 354, + StartPos: 6478, + EndPos: 6497, + }, + Vars: []node.Node{ + &stmt.StaticVar{ + Position: &position.Position{ + StartLine: 354, + EndLine: 354, + StartPos: 6485, + EndPos: 6496, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 354, + EndLine: 354, + StartPos: 6485, + EndPos: 6486, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 354, + EndLine: 354, + StartPos: 6485, + EndPos: 6486, + }, + Value: "a", + }, + }, + Expr: &binary.NotIdentical{ + Position: &position.Position{ + StartLine: 354, + EndLine: 354, + StartPos: 6490, + EndPos: 6496, + }, + Left: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 354, + EndLine: 354, + StartPos: 6490, + EndPos: 6490, + }, + Value: "1", + }, + Right: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 354, + EndLine: 354, + StartPos: 6496, + EndPos: 6496, + }, + Value: "2", + }, + }, + }, + }, + }, + &stmt.Static{ + Position: &position.Position{ + StartLine: 355, + EndLine: 355, + StartPos: 6501, + EndPos: 6518, + }, + Vars: []node.Node{ + &stmt.StaticVar{ + Position: &position.Position{ + StartLine: 355, + EndLine: 355, + StartPos: 6508, + EndPos: 6517, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 355, + EndLine: 355, + StartPos: 6508, + EndPos: 6509, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 355, + EndLine: 355, + StartPos: 6508, + EndPos: 6509, + }, + Value: "a", + }, + }, + Expr: &binary.Plus{ + Position: &position.Position{ + StartLine: 355, + EndLine: 355, + StartPos: 6513, + EndPos: 6517, + }, + Left: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 355, + EndLine: 355, + StartPos: 6513, + EndPos: 6513, + }, + Value: "1", + }, + Right: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 355, + EndLine: 355, + StartPos: 6517, + EndPos: 6517, + }, + Value: "2", + }, + }, + }, + }, + }, + &stmt.Static{ + Position: &position.Position{ + StartLine: 356, + EndLine: 356, + StartPos: 6522, + EndPos: 6540, + }, + Vars: []node.Node{ + &stmt.StaticVar{ + Position: &position.Position{ + StartLine: 356, + EndLine: 356, + StartPos: 6529, + EndPos: 6539, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 356, + EndLine: 356, + StartPos: 6529, + EndPos: 6530, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 356, + EndLine: 356, + StartPos: 6529, + EndPos: 6530, + }, + Value: "a", + }, + }, + Expr: &binary.Pow{ + Position: &position.Position{ + StartLine: 356, + EndLine: 356, + StartPos: 6534, + EndPos: 6539, + }, + Left: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 356, + EndLine: 356, + StartPos: 6534, + EndPos: 6534, + }, + Value: "1", + }, + Right: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 356, + EndLine: 356, + StartPos: 6539, + EndPos: 6539, + }, + Value: "2", + }, + }, + }, + }, + }, + &stmt.Static{ + Position: &position.Position{ + StartLine: 357, + EndLine: 357, + StartPos: 6544, + EndPos: 6562, + }, + Vars: []node.Node{ + &stmt.StaticVar{ + Position: &position.Position{ + StartLine: 357, + EndLine: 357, + StartPos: 6551, + EndPos: 6561, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 357, + EndLine: 357, + StartPos: 6551, + EndPos: 6552, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 357, + EndLine: 357, + StartPos: 6551, + EndPos: 6552, + }, + Value: "a", + }, + }, + Expr: &binary.ShiftLeft{ + Position: &position.Position{ + StartLine: 357, + EndLine: 357, + StartPos: 6556, + EndPos: 6561, + }, + Left: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 357, + EndLine: 357, + StartPos: 6556, + EndPos: 6556, + }, + Value: "1", + }, + Right: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 357, + EndLine: 357, + StartPos: 6561, + EndPos: 6561, + }, + Value: "2", + }, + }, + }, + }, + }, + &stmt.Static{ + Position: &position.Position{ + StartLine: 358, + EndLine: 358, + StartPos: 6566, + EndPos: 6584, + }, + Vars: []node.Node{ + &stmt.StaticVar{ + Position: &position.Position{ + StartLine: 358, + EndLine: 358, + StartPos: 6573, + EndPos: 6583, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 358, + EndLine: 358, + StartPos: 6573, + EndPos: 6574, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 358, + EndLine: 358, + StartPos: 6573, + EndPos: 6574, + }, + Value: "a", + }, + }, + Expr: &binary.ShiftRight{ + Position: &position.Position{ + StartLine: 358, + EndLine: 358, + StartPos: 6578, + EndPos: 6583, + }, + Left: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 358, + EndLine: 358, + StartPos: 6578, + EndPos: 6578, + }, + Value: "1", + }, + Right: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 358, + EndLine: 358, + StartPos: 6583, + EndPos: 6583, + }, + Value: "2", + }, + }, + }, + }, + }, + &stmt.Static{ + Position: &position.Position{ + StartLine: 359, + EndLine: 359, + StartPos: 6588, + EndPos: 6606, + }, + Vars: []node.Node{ + &stmt.StaticVar{ + Position: &position.Position{ + StartLine: 359, + EndLine: 359, + StartPos: 6595, + EndPos: 6605, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 359, + EndLine: 359, + StartPos: 6595, + EndPos: 6596, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 359, + EndLine: 359, + StartPos: 6595, + EndPos: 6596, + }, + Value: "a", + }, + }, + Expr: &binary.SmallerOrEqual{ + Position: &position.Position{ + StartLine: 359, + EndLine: 359, + StartPos: 6600, + EndPos: 6605, + }, + Left: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 359, + EndLine: 359, + StartPos: 6600, + EndPos: 6600, + }, + Value: "1", + }, + Right: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 359, + EndLine: 359, + StartPos: 6605, + EndPos: 6605, + }, + Value: "2", + }, + }, + }, + }, + }, + &stmt.Static{ + Position: &position.Position{ + StartLine: 360, + EndLine: 360, + StartPos: 6610, + EndPos: 6627, + }, + Vars: []node.Node{ + &stmt.StaticVar{ + Position: &position.Position{ + StartLine: 360, + EndLine: 360, + StartPos: 6617, + EndPos: 6626, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 360, + EndLine: 360, + StartPos: 6617, + EndPos: 6618, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 360, + EndLine: 360, + StartPos: 6617, + EndPos: 6618, + }, + Value: "a", + }, + }, + Expr: &binary.Smaller{ + Position: &position.Position{ + StartLine: 360, + EndLine: 360, + StartPos: 6622, + EndPos: 6626, + }, + Left: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 360, + EndLine: 360, + StartPos: 6622, + EndPos: 6622, + }, + Value: "1", + }, + Right: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 360, + EndLine: 360, + StartPos: 6626, + EndPos: 6626, + }, + Value: "2", + }, + }, + }, + }, + }, + &stmt.Static{ + Position: &position.Position{ + StartLine: 361, + EndLine: 361, + StartPos: 6631, + EndPos: 6651, + }, + Vars: []node.Node{ + &stmt.StaticVar{ + Position: &position.Position{ + StartLine: 361, + EndLine: 361, + StartPos: 6638, + EndPos: 6650, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 361, + EndLine: 361, + StartPos: 6638, + EndPos: 6639, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 361, + EndLine: 361, + StartPos: 6638, + EndPos: 6639, + }, + Value: "a", + }, + }, + Expr: &expr.ClassConstFetch{ + Position: &position.Position{ + StartLine: 361, + EndLine: 361, + StartPos: 6643, + EndPos: 6650, + }, + Class: &name.Name{ + Position: &position.Position{ + StartLine: 361, + EndLine: 361, + StartPos: 6643, + EndPos: 6645, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 361, + EndLine: 361, + StartPos: 6643, + EndPos: 6645, + }, + Value: "Foo", + }, + }, + }, + ConstantName: &node.Identifier{ + Position: &position.Position{ + StartLine: 361, + EndLine: 361, + StartPos: 6648, + EndPos: 6650, + }, + Value: "bar", + }, + }, + }, + }, + }, + &stmt.Static{ + Position: &position.Position{ + StartLine: 362, + EndLine: 362, + StartPos: 6655, + EndPos: 6677, + }, + Vars: []node.Node{ + &stmt.StaticVar{ + Position: &position.Position{ + StartLine: 362, + EndLine: 362, + StartPos: 6662, + EndPos: 6676, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 362, + EndLine: 362, + StartPos: 6662, + EndPos: 6663, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 362, + EndLine: 362, + StartPos: 6662, + EndPos: 6663, + }, + Value: "a", + }, + }, + Expr: &expr.ClassConstFetch{ + Position: &position.Position{ + StartLine: 362, + EndLine: 362, + StartPos: 6667, + EndPos: 6676, + }, + Class: &name.Name{ + Position: &position.Position{ + StartLine: 362, + EndLine: 362, + StartPos: 6667, + EndPos: 6669, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 362, + EndLine: 362, + StartPos: 6667, + EndPos: 6669, + }, + Value: "Foo", + }, + }, + }, + ConstantName: &node.Identifier{ + Position: &position.Position{ + StartLine: 362, + EndLine: 362, + StartPos: 6672, + EndPos: 6676, + }, + Value: "class", + }, + }, + }, + }, + }, + &stmt.Static{ + Position: &position.Position{ + StartLine: 363, + EndLine: 363, + StartPos: 6681, + EndPos: 6702, + }, + Vars: []node.Node{ + &stmt.StaticVar{ + Position: &position.Position{ + StartLine: 363, + EndLine: 363, + StartPos: 6688, + EndPos: 6701, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 363, + EndLine: 363, + StartPos: 6688, + EndPos: 6689, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 363, + EndLine: 363, + StartPos: 6688, + EndPos: 6689, + }, + Value: "a", + }, + }, + Expr: &scalar.MagicConstant{ + Position: &position.Position{ + StartLine: 363, + EndLine: 363, + StartPos: 6693, + EndPos: 6701, + }, + Value: "__CLASS__", + }, + }, + }, + }, + &stmt.Static{ + Position: &position.Position{ + StartLine: 364, + EndLine: 364, + StartPos: 6706, + EndPos: 6721, + }, + Vars: []node.Node{ + &stmt.StaticVar{ + Position: &position.Position{ + StartLine: 364, + EndLine: 364, + StartPos: 6713, + EndPos: 6720, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 364, + EndLine: 364, + StartPos: 6713, + EndPos: 6714, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 364, + EndLine: 364, + StartPos: 6713, + EndPos: 6714, + }, + Value: "a", + }, + }, + Expr: &expr.ConstFetch{ + Position: &position.Position{ + StartLine: 364, + EndLine: 364, + StartPos: 6718, + EndPos: 6720, + }, + Constant: &name.Name{ + Position: &position.Position{ + StartLine: 364, + EndLine: 364, + StartPos: 6718, + EndPos: 6720, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 364, + EndLine: 364, + StartPos: 6718, + EndPos: 6720, + }, + Value: "Foo", + }, }, }, }, @@ -3558,82 +17728,762 @@ func TestPhp5(t *testing.T) { }, }, &stmt.Static{ + Position: &position.Position{ + StartLine: 365, + EndLine: 365, + StartPos: 6725, + EndPos: 6750, + }, Vars: []node.Node{ &stmt.StaticVar{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expr: &expr.ArrayDimFetch{ - Variable: &expr.ShortArray{ - Items: []node.Node{ - &expr.ArrayItem{ - Val: &scalar.Lnumber{Value: "1"}, - }, - &expr.ArrayItem{ - Key: &scalar.Lnumber{Value: "2"}, - Val: &scalar.Lnumber{Value: "2"}, + Position: &position.Position{ + StartLine: 365, + EndLine: 365, + StartPos: 6732, + EndPos: 6749, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 365, + EndLine: 365, + StartPos: 6732, + EndPos: 6733, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 365, + EndLine: 365, + StartPos: 6732, + EndPos: 6733, + }, + Value: "a", + }, + }, + Expr: &expr.ConstFetch{ + Position: &position.Position{ + StartLine: 365, + EndLine: 365, + StartPos: 6737, + EndPos: 6749, + }, + Constant: &name.Relative{ + Position: &position.Position{ + StartLine: 365, + EndLine: 365, + StartPos: 6737, + EndPos: 6749, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 365, + EndLine: 365, + StartPos: 6747, + EndPos: 6749, + }, + Value: "Foo", }, }, }, - Dim: &scalar.Lnumber{Value: "0"}, + }, + }, + }, + }, + &stmt.Static{ + Position: &position.Position{ + StartLine: 366, + EndLine: 366, + StartPos: 6754, + EndPos: 6770, + }, + Vars: []node.Node{ + &stmt.StaticVar{ + Position: &position.Position{ + StartLine: 366, + EndLine: 366, + StartPos: 6761, + EndPos: 6769, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 366, + EndLine: 366, + StartPos: 6761, + EndPos: 6762, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 366, + EndLine: 366, + StartPos: 6761, + EndPos: 6762, + }, + Value: "a", + }, + }, + Expr: &expr.ConstFetch{ + Position: &position.Position{ + StartLine: 366, + EndLine: 366, + StartPos: 6766, + EndPos: 6769, + }, + Constant: &name.FullyQualified{ + Position: &position.Position{ + StartLine: 366, + EndLine: 366, + StartPos: 6766, + EndPos: 6769, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 366, + EndLine: 366, + StartPos: 6767, + EndPos: 6769, + }, + Value: "Foo", + }, + }, + }, + }, + }, + }, + }, + &stmt.Static{ + Position: &position.Position{ + StartLine: 367, + EndLine: 367, + StartPos: 6774, + EndPos: 6793, + }, + Vars: []node.Node{ + &stmt.StaticVar{ + Position: &position.Position{ + StartLine: 367, + EndLine: 367, + StartPos: 6781, + EndPos: 6792, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 367, + EndLine: 367, + StartPos: 6781, + EndPos: 6782, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 367, + EndLine: 367, + StartPos: 6781, + EndPos: 6782, + }, + Value: "a", + }, + }, + Expr: &expr.Array{ + Position: &position.Position{ + StartLine: 367, + EndLine: 367, + StartPos: 6786, + EndPos: 6792, + }, + }, + }, + }, + }, + &stmt.Static{ + Position: &position.Position{ + StartLine: 368, + EndLine: 368, + StartPos: 6797, + EndPos: 6825, + }, + Vars: []node.Node{ + &stmt.StaticVar{ + Position: &position.Position{ + StartLine: 368, + EndLine: 368, + StartPos: 6804, + EndPos: 6824, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 368, + EndLine: 368, + StartPos: 6804, + EndPos: 6805, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 368, + EndLine: 368, + StartPos: 6804, + EndPos: 6805, + }, + Value: "a", + }, + }, + Expr: &expr.Array{ + Position: &position.Position{ + StartLine: 368, + EndLine: 368, + StartPos: 6809, + EndPos: 6824, + }, + Items: []node.Node{ + &expr.ArrayItem{ + Position: &position.Position{ + StartLine: 368, + EndLine: 368, + StartPos: 6815, + EndPos: 6820, + }, + Key: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 368, + EndLine: 368, + StartPos: 6815, + EndPos: 6815, + }, + Value: "1", + }, + Val: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 368, + EndLine: 368, + StartPos: 6820, + EndPos: 6820, + }, + Value: "1", + }, + }, + &expr.ArrayItem{ + Position: &position.Position{ + StartLine: 368, + EndLine: 368, + StartPos: 6823, + EndPos: 6823, + }, + Val: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 368, + EndLine: 368, + StartPos: 6823, + EndPos: 6823, + }, + Value: "2", + }, + }, + }, + }, + }, + }, + }, + &stmt.Static{ + Position: &position.Position{ + StartLine: 369, + EndLine: 369, + StartPos: 6829, + EndPos: 6855, + }, + Vars: []node.Node{ + &stmt.StaticVar{ + Position: &position.Position{ + StartLine: 369, + EndLine: 369, + StartPos: 6836, + EndPos: 6854, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 369, + EndLine: 369, + StartPos: 6836, + EndPos: 6837, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 369, + EndLine: 369, + StartPos: 6836, + EndPos: 6837, + }, + Value: "a", + }, + }, + Expr: &expr.ArrayDimFetch{ + Position: &position.Position{ + StartLine: 369, + EndLine: 369, + StartPos: 6841, + EndPos: 6854, + }, + Variable: &expr.ShortArray{ + Position: &position.Position{ + StartLine: 369, + EndLine: 369, + StartPos: 6841, + EndPos: 6851, + }, + Items: []node.Node{ + &expr.ArrayItem{ + Position: &position.Position{ + StartLine: 369, + EndLine: 369, + StartPos: 6842, + EndPos: 6842, + }, + Val: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 369, + EndLine: 369, + StartPos: 6842, + EndPos: 6842, + }, + Value: "1", + }, + }, + &expr.ArrayItem{ + Position: &position.Position{ + StartLine: 369, + EndLine: 369, + StartPos: 6845, + EndPos: 6850, + }, + Key: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 369, + EndLine: 369, + StartPos: 6845, + EndPos: 6845, + }, + Value: "2", + }, + Val: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 369, + EndLine: 369, + StartPos: 6850, + EndPos: 6850, + }, + Value: "2", + }, + }, + }, + }, + Dim: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 369, + EndLine: 369, + StartPos: 6853, + EndPos: 6853, + }, + Value: "0", + }, }, }, }, }, &stmt.If{ + Position: &position.Position{ + StartLine: 371, + EndLine: 371, + StartPos: 6860, + EndPos: 6874, + }, Cond: &expr.Yield{ - Value: &scalar.Lnumber{Value: "1"}, + Position: &position.Position{ + StartLine: 371, + EndLine: 371, + StartPos: 6864, + EndPos: 6870, + }, + Value: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 371, + EndLine: 371, + StartPos: 6870, + EndPos: 6870, + }, + Value: "1", + }, }, Stmt: &stmt.StmtList{ - Stmts: []node.Node{}, - }, - }, - &stmt.Expression{ - Expr: &expr.StaticPropertyFetch{ - Class: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Foo"}}}, - Property: &expr.Variable{VarName: &expr.Variable{VarName: &node.Identifier{Value: "bar"}}}, - }, - }, - &stmt.Expression{ - Expr: &expr.FunctionCall{ - Function: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, - ArgumentList: &node.ArgumentList{}, - }, - }, - &stmt.Expression{ - Expr: &expr.ArrayDimFetch{ - Variable: &expr.ArrayDimFetch{ - Variable: &expr.FunctionCall{ - Function: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, - ArgumentList: &node.ArgumentList{}, - }, - Dim: &scalar.Lnumber{Value: "0"}, + Position: &position.Position{ + StartLine: 371, + EndLine: 371, + StartPos: 6873, + EndPos: 6874, + }, + Stmts: []node.Node{ }, - Dim: &scalar.Lnumber{Value: "0"}, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 372, + EndLine: 372, + StartPos: 6878, + EndPos: 6888, + }, + Expr: &expr.StaticPropertyFetch{ + Position: &position.Position{ + StartLine: 372, + EndLine: 372, + StartPos: 6878, + EndPos: 6887, + }, + Class: &name.Name{ + Position: &position.Position{ + StartLine: 372, + EndLine: 372, + StartPos: 6878, + EndPos: 6880, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 372, + EndLine: 372, + StartPos: 6878, + EndPos: 6880, + }, + Value: "Foo", + }, + }, + }, + Property: &expr.Variable{ + Position: &position.Position{ + StartLine: 372, + EndLine: 372, + StartPos: 6883, + EndPos: 6887, + }, + VarName: &expr.Variable{ + Position: &position.Position{ + StartLine: 372, + EndLine: 372, + StartPos: 6884, + EndPos: 6887, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 372, + EndLine: 372, + StartPos: 6884, + EndPos: 6887, + }, + Value: "bar", + }, + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 374, + EndLine: 374, + StartPos: 6893, + EndPos: 6899, + }, + Expr: &expr.FunctionCall{ + Position: &position.Position{ + StartLine: 374, + EndLine: 374, + StartPos: 6893, + EndPos: 6898, + }, + Function: &expr.Variable{ + Position: &position.Position{ + StartLine: 374, + EndLine: 374, + StartPos: 6893, + EndPos: 6896, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 374, + EndLine: 374, + StartPos: 6893, + EndPos: 6896, + }, + Value: "foo", + }, + }, + ArgumentList: &node.ArgumentList{ + Position: &position.Position{ + StartLine: 374, + EndLine: 374, + StartPos: 6897, + EndPos: 6898, + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 375, + EndLine: 375, + StartPos: 6903, + EndPos: 6915, + }, Expr: &expr.ArrayDimFetch{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Dim: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Position: &position.Position{ + StartLine: 375, + EndLine: 375, + StartPos: 6903, + EndPos: 6914, + }, + Variable: &expr.ArrayDimFetch{ + Position: &position.Position{ + StartLine: 375, + EndLine: 375, + StartPos: 6903, + EndPos: 6911, + }, + Variable: &expr.FunctionCall{ + Position: &position.Position{ + StartLine: 375, + EndLine: 375, + StartPos: 6903, + EndPos: 6908, + }, + Function: &expr.Variable{ + Position: &position.Position{ + StartLine: 375, + EndLine: 375, + StartPos: 6903, + EndPos: 6906, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 375, + EndLine: 375, + StartPos: 6903, + EndPos: 6906, + }, + Value: "foo", + }, + }, + ArgumentList: &node.ArgumentList{ + Position: &position.Position{ + StartLine: 375, + EndLine: 375, + StartPos: 6907, + EndPos: 6908, + }, + }, + }, + Dim: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 375, + EndLine: 375, + StartPos: 6910, + EndPos: 6910, + }, + Value: "0", + }, + }, + Dim: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 375, + EndLine: 375, + StartPos: 6913, + EndPos: 6913, + }, + Value: "0", + }, }, }, &stmt.Expression{ - Expr: &expr.Variable{VarName: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, + Position: &position.Position{ + StartLine: 376, + EndLine: 376, + StartPos: 6919, + EndPos: 6925, + }, + Expr: &expr.ArrayDimFetch{ + Position: &position.Position{ + StartLine: 376, + EndLine: 376, + StartPos: 6919, + EndPos: 6924, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 376, + EndLine: 376, + StartPos: 6919, + EndPos: 6920, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 376, + EndLine: 376, + StartPos: 6919, + EndPos: 6920, + }, + Value: "a", + }, + }, + Dim: &expr.Variable{ + Position: &position.Position{ + StartLine: 376, + EndLine: 376, + StartPos: 6922, + EndPos: 6923, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 376, + EndLine: 376, + StartPos: 6922, + EndPos: 6923, + }, + Value: "b", + }, + }, + }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 377, + EndLine: 377, + StartPos: 6929, + EndPos: 6934, + }, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 377, + EndLine: 377, + StartPos: 6929, + EndPos: 6933, + }, + VarName: &expr.Variable{ + Position: &position.Position{ + StartLine: 377, + EndLine: 377, + StartPos: 6931, + EndPos: 6932, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 377, + EndLine: 377, + StartPos: 6931, + EndPos: 6932, + }, + Value: "a", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 378, + EndLine: 378, + StartPos: 6938, + EndPos: 6952, + }, Expr: &expr.StaticCall{ - Class: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, - Call: &expr.Variable{VarName: &node.Identifier{Value: "bar"}}, - ArgumentList: &node.ArgumentList{}, + Position: &position.Position{ + StartLine: 378, + EndLine: 378, + StartPos: 6938, + EndPos: 6951, + }, + Class: &expr.Variable{ + Position: &position.Position{ + StartLine: 378, + EndLine: 378, + StartPos: 6938, + EndPos: 6941, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 378, + EndLine: 378, + StartPos: 6938, + EndPos: 6941, + }, + Value: "foo", + }, + }, + Call: &expr.Variable{ + Position: &position.Position{ + StartLine: 378, + EndLine: 378, + StartPos: 6944, + EndPos: 6949, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 378, + EndLine: 378, + StartPos: 6945, + EndPos: 6948, + }, + Value: "bar", + }, + }, + ArgumentList: &node.ArgumentList{ + Position: &position.Position{ + StartLine: 378, + EndLine: 378, + StartPos: 6950, + EndPos: 6951, + }, + }, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 379, + EndLine: 379, + StartPos: 6956, + EndPos: 6965, + }, Expr: &expr.ClassConstFetch{ - Class: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, - ConstantName: &node.Identifier{Value: "bar"}, + Position: &position.Position{ + StartLine: 379, + EndLine: 379, + StartPos: 6956, + EndPos: 6964, + }, + Class: &expr.Variable{ + Position: &position.Position{ + StartLine: 379, + EndLine: 379, + StartPos: 6956, + EndPos: 6959, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 379, + EndLine: 379, + StartPos: 6956, + EndPos: 6959, + }, + Value: "foo", + }, + }, + ConstantName: &node.Identifier{ + Position: &position.Position{ + StartLine: 379, + EndLine: 379, + StartPos: 6962, + EndPos: 6964, + }, + Value: "bar", + }, }, }, }, } + php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php") php5parser.Parse() @@ -3654,25 +18504,102 @@ func TestPhp5Strings(t *testing.T) { '; ` - expected := &node.Root{ + expected :=&node.Root{ + Position: &position.Position{ + StartLine: 2, + EndLine: 10, + StartPos: 6, + EndPos: 70, + }, Stmts: []node.Node{ &stmt.Expression{ - Expr: &scalar.String{Value: "\"test\""}, + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 6, + EndPos: 12, + }, + Expr: &scalar.String{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 6, + EndPos: 11, + }, + Value: "\"test\"", + }, }, &stmt.Expression{ - Expr: &scalar.String{Value: "\"\\$test\""}, + Position: &position.Position{ + StartLine: 3, + EndLine: 3, + StartPos: 16, + EndPos: 24, + }, + Expr: &scalar.String{ + Position: &position.Position{ + StartLine: 3, + EndLine: 3, + StartPos: 16, + EndPos: 23, + }, + Value: "\"\\$test\"", + }, }, &stmt.Expression{ - Expr: &scalar.String{Value: "\"\n\t\t\ttest\n\t\t\""}, + Position: &position.Position{ + StartLine: 4, + EndLine: 6, + StartPos: 28, + EndPos: 41, + }, + Expr: &scalar.String{ + Position: &position.Position{ + StartLine: 4, + EndLine: 6, + StartPos: 28, + EndPos: 40, + }, + Value: "\"\n\t\t\ttest\n\t\t\"", + }, }, &stmt.Expression{ - Expr: &scalar.String{Value: "'$test'"}, + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 45, + EndPos: 52, + }, + Expr: &scalar.String{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 45, + EndPos: 51, + }, + Value: "'$test'", + }, }, &stmt.Expression{ - Expr: &scalar.String{Value: "'\n\t\t\t$test\n\t\t'"}, + Position: &position.Position{ + StartLine: 8, + EndLine: 10, + StartPos: 56, + EndPos: 70, + }, + Expr: &scalar.String{ + Position: &position.Position{ + StartLine: 8, + EndLine: 10, + StartPos: 56, + EndPos: 69, + }, + Value: "'\n\t\t\t$test\n\t\t'", + }, }, }, } + php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php") php5parser.Parse() @@ -3699,48 +18626,171 @@ CAD; ` expected := &node.Root{ + Position: &position.Position{ + StartLine: 2, + EndLine: 15, + StartPos: 9, + EndPos: 120, + }, Stmts: []node.Node{ &stmt.Expression{ + Position: &position.Position{ + StartLine: 2, + EndLine: 3, + StartPos: 9, + EndPos: 16, + }, Expr: &scalar.Heredoc{ + Position: &position.Position{ + StartLine: 2, + EndLine: 3, + StartPos: 9, + EndPos: 15, + }, Label: "CAD", }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 4, + EndLine: 6, + StartPos: 23, + EndPos: 37, + }, Expr: &scalar.Heredoc{ + Position: &position.Position{ + StartLine: 4, + EndLine: 6, + StartPos: 23, + EndPos: 36, + }, Label: "CAD", Parts: []node.Node{ - &scalar.EncapsedStringPart{Value: "\thello\n"}, + &scalar.EncapsedStringPart{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 27, + EndPos: 33, + }, + Value: "\thello\n", + }, }, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 7, + EndLine: 9, + StartPos: 44, + EndPos: 60, + }, Expr: &scalar.Heredoc{ + Position: &position.Position{ + StartLine: 7, + EndLine: 9, + StartPos: 44, + EndPos: 59, + }, Label: "\"CAD\"", Parts: []node.Node{ - &scalar.EncapsedStringPart{Value: "\thello\n"}, + &scalar.EncapsedStringPart{ + Position: &position.Position{ + StartLine: 8, + EndLine: 8, + StartPos: 50, + EndPos: 56, + }, + Value: "\thello\n", + }, }, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 10, + EndLine: 12, + StartPos: 67, + EndPos: 90, + }, Expr: &scalar.Heredoc{ + Position: &position.Position{ + StartLine: 10, + EndLine: 12, + StartPos: 67, + EndPos: 89, + }, Label: "\"CAD\"", Parts: []node.Node{ - &scalar.EncapsedStringPart{Value: "\thello "}, - &expr.Variable{VarName: &node.Identifier{Value: "world"}}, - &scalar.EncapsedStringPart{Value: "\n"}, + &scalar.EncapsedStringPart{ + Position: &position.Position{ + StartLine: 11, + EndLine: 11, + StartPos: 73, + EndPos: 79, + }, + Value: "\thello ", + }, + &expr.Variable{ + Position: &position.Position{ + StartLine: 11, + EndLine: 11, + StartPos: 80, + EndPos: 85, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 11, + EndLine: 11, + StartPos: 80, + EndPos: 85, + }, + Value: "world", + }, + }, + &scalar.EncapsedStringPart{ + Position: &position.Position{ + StartLine: 11, + EndLine: 11, + StartPos: 86, + EndPos: 86, + }, + Value: "\n", + }, }, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 13, + EndLine: 15, + StartPos: 97, + EndPos: 120, + }, Expr: &scalar.Heredoc{ + Position: &position.Position{ + StartLine: 13, + EndLine: 15, + StartPos: 97, + EndPos: 119, + }, Label: "'CAD'", Parts: []node.Node{ - &scalar.EncapsedStringPart{Value: "\thello $world\n"}, + &scalar.EncapsedStringPart{ + Position: &position.Position{ + StartLine: 14, + EndLine: 14, + StartPos: 103, + EndPos: 116, + }, + Value: "\thello $world\n", + }, }, }, }, }, } + php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php") php5parser.Parse() diff --git a/php7/parser.go b/php7/parser.go index 9271442..0ee0d61 100644 --- a/php7/parser.go +++ b/php7/parser.go @@ -22,7 +22,6 @@ type Parser struct { errors []*errors.Error rootNode node.Node comments parser.Comments - positions parser.Positions } // NewParser creates and returns new Parser @@ -37,7 +36,6 @@ func NewParser(src io.Reader, path string) *Parser { nil, nil, nil, - nil, } } @@ -58,11 +56,7 @@ func (l *Parser) Parse() int { l.errors = nil l.rootNode = nil l.comments = parser.Comments{} - l.positions = parser.Positions{} - l.positionBuilder = &parser.PositionBuilder{ - Positions: &l.positions, - PositionPool: &l.PositionPool, - } + l.positionBuilder = &parser.PositionBuilder{} // parse @@ -89,11 +83,6 @@ func (l *Parser) GetComments() parser.Comments { return l.comments } -// GetPositions returns positions list -func (l *Parser) GetPositions() parser.Positions { - return l.positions -} - // helpers func lastNode(nn []node.Node) node.Node { @@ -112,7 +101,6 @@ func (p *Parser) returnTokenToPool(yyDollar []yySymType, yyVAL *yySymType) { for i := 1; i < len(yyDollar); i++ { if yyDollar[i].token != nil { p.TokenPool.Put(yyDollar[i].token) - p.PositionPool.Put(yyDollar[i].token.Position) } yyDollar[i].token = nil } diff --git a/php7/php7.go b/php7/php7.go index dead580..26893c8 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -346,7 +346,7 @@ const yyEofCode = 1 const yyErrCode = 2 const yyInitialStackSize = 16 -//line php7/php7.y:5344 +//line php7/php7.y:5346 //line yacctab:1 var yyExca = [...]int{ @@ -2119,7 +2119,7 @@ yydefault: yylex.(*Parser).rootNode = node.NewRoot(yyDollar[1].list) // save position - yylex.(*Parser).positions.AddPosition(yylex.(*Parser).rootNode, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) + yylex.(*Parser).rootNode.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2605,7 +2605,7 @@ yydefault: yyVAL.list = []node.Node{namePart} // save position - yylex.(*Parser).positions.AddPosition(namePart, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + namePart.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(namePart, yyDollar[1].token, comment.StringToken) @@ -2620,7 +2620,7 @@ yydefault: yyVAL.list = append(yyDollar[1].list, namePart) // save position - yylex.(*Parser).positions.AddPosition(namePart, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) + namePart.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) // save comments yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.NsSeparatorToken) @@ -2635,7 +2635,7 @@ yydefault: yyVAL.node = name.NewName(yyDollar[1].list) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2646,7 +2646,7 @@ yydefault: yyVAL.node = name.NewRelative(yyDollar[3].list) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.NamespaceToken) @@ -2661,7 +2661,7 @@ yydefault: yyVAL.node = name.NewFullyQualified(yyDollar[2].list) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.NsSeparatorToken) @@ -2724,7 +2724,7 @@ yydefault: yyVAL.node = stmt.NewHaltCompiler() // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.HaltCompilerToken) @@ -2742,8 +2742,8 @@ yydefault: yyVAL.node = stmt.NewNamespace(name, nil) // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.NamespaceToken) @@ -2759,8 +2759,8 @@ yydefault: yyVAL.node = stmt.NewNamespace(name, yyDollar[4].list) // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[5].token)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[5].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.NamespaceToken) @@ -2776,7 +2776,7 @@ yydefault: yyVAL.node = stmt.NewNamespace(nil, yyDollar[3].list) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.NamespaceToken) @@ -2792,7 +2792,7 @@ yydefault: yyVAL.node = yyDollar[2].node // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.UseToken) @@ -2807,7 +2807,7 @@ yydefault: yyVAL.node = yyDollar[3].node.(*stmt.GroupUse).SetUseType(yyDollar[2].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.UseToken) @@ -2822,7 +2822,7 @@ yydefault: yyVAL.node = stmt.NewUseList(nil, yyDollar[2].list) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.UseToken) @@ -2837,7 +2837,7 @@ yydefault: yyVAL.node = stmt.NewUseList(yyDollar[2].node, yyDollar[3].list) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.UseToken) @@ -2852,7 +2852,7 @@ yydefault: yyVAL.node = stmt.NewConstList(yyDollar[2].list) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ConstToken) @@ -2867,7 +2867,7 @@ yydefault: yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.FunctionToken) @@ -2881,7 +2881,7 @@ yydefault: yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ConstToken) @@ -2896,8 +2896,8 @@ yydefault: yyVAL.node = stmt.NewGroupUse(nil, name, yyDollar[4].list) // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeListTokenPosition(yyDollar[1].list, yyDollar[6].token)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition(yyDollar[1].list, yyDollar[6].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.NsSeparatorToken) @@ -2917,8 +2917,8 @@ yydefault: yyVAL.node = stmt.NewGroupUse(nil, name, yyDollar[5].list) // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[7].token)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[7].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.NsSeparatorToken) @@ -2939,8 +2939,8 @@ yydefault: yyVAL.node = stmt.NewGroupUse(nil, name, yyDollar[4].list) // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeListTokenPosition(yyDollar[1].list, yyDollar[6].token)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition(yyDollar[1].list, yyDollar[6].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.NsSeparatorToken) @@ -2960,8 +2960,8 @@ yydefault: yyVAL.node = stmt.NewGroupUse(nil, name, yyDollar[5].list) // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[7].token)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[7].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.NsSeparatorToken) @@ -3067,8 +3067,8 @@ yydefault: yyVAL.node = stmt.NewUse(nil, name, nil) // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3081,9 +3081,9 @@ yydefault: yyVAL.node = stmt.NewUse(nil, name, alias) // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) - yylex.(*Parser).positions.AddPosition(alias, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeListTokenPosition(yyDollar[1].list, yyDollar[3].token)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) + alias.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition(yyDollar[1].list, yyDollar[3].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.AsToken) @@ -3203,7 +3203,7 @@ yydefault: yyVAL.node = stmt.NewHaltCompiler() // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.HaltCompilerToken) @@ -3220,7 +3220,7 @@ yydefault: yyVAL.node = stmt.NewStmtList(yyDollar[2].list) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.OpenCurlyBracesToken) @@ -3258,7 +3258,7 @@ yydefault: yyVAL.node = yyDollar[5].node // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[5].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[5].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.WhileToken) @@ -3274,7 +3274,7 @@ yydefault: yyVAL.node = stmt.NewDo(yyDollar[2].node, yyDollar[5].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[7].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[7].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.DoToken) @@ -3303,7 +3303,7 @@ yydefault: yyVAL.node = yyDollar[9].node // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[9].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[9].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ForToken) @@ -3330,7 +3330,7 @@ yydefault: yyVAL.node = yyDollar[5].node // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[5].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[5].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.SwitchToken) @@ -3346,7 +3346,7 @@ yydefault: yyVAL.node = stmt.NewBreak(yyDollar[2].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.BreakToken) @@ -3361,7 +3361,7 @@ yydefault: yyVAL.node = stmt.NewContinue(yyDollar[2].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ContinueToken) @@ -3376,7 +3376,7 @@ yydefault: yyVAL.node = stmt.NewReturn(yyDollar[2].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ReturnToken) @@ -3391,7 +3391,7 @@ yydefault: yyVAL.node = stmt.NewGlobal(yyDollar[2].list) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.GlobalToken) @@ -3406,7 +3406,7 @@ yydefault: yyVAL.node = stmt.NewStatic(yyDollar[2].list) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.StaticToken) @@ -3421,7 +3421,7 @@ yydefault: yyVAL.node = stmt.NewEcho(yyDollar[2].list) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.EchoToken) @@ -3436,7 +3436,7 @@ yydefault: yyVAL.node = stmt.NewInlineHtml(yyDollar[1].token.Value) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.InlineHTMLToken) @@ -3450,7 +3450,7 @@ yydefault: yyVAL.node = stmt.NewExpression(yyDollar[1].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.SemiColonToken) @@ -3464,7 +3464,7 @@ yydefault: yyVAL.node = stmt.NewUnset(yyDollar[3].list) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[6].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[6].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.UnsetToken) @@ -3493,7 +3493,7 @@ yydefault: yyVAL.node = yyDollar[7].node // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[7].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[7].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ForeachToken) @@ -3521,7 +3521,7 @@ yydefault: yyVAL.node = yyDollar[9].node // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[9].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[9].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ForeachToken) @@ -3539,7 +3539,7 @@ yydefault: yyVAL.node = stmt.NewDeclare(yyDollar[3].list, yyDollar[5].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[5].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[5].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.DeclareToken) @@ -3555,7 +3555,7 @@ yydefault: yyVAL.node = stmt.NewNop() // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.SemiColonToken) @@ -3568,10 +3568,10 @@ yydefault: { if yyDollar[6].node == nil { yyVAL.node = stmt.NewTry(yyDollar[3].list, yyDollar[5].list, yyDollar[6].node) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[5].list)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[5].list)) } else { yyVAL.node = stmt.NewTry(yyDollar[3].list, yyDollar[5].list, yyDollar[6].node) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[6].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[6].node)) } // save comments @@ -3588,7 +3588,7 @@ yydefault: yyVAL.node = stmt.NewThrow(yyDollar[2].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ThrowToken) @@ -3604,8 +3604,8 @@ yydefault: yyVAL.node = stmt.NewGoto(label) // save position - yylex.(*Parser).positions.AddPosition(label, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) + label.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.GotoToken) @@ -3622,8 +3622,8 @@ yydefault: yyVAL.node = stmt.NewLabel(label) // save position - yylex.(*Parser).positions.AddPosition(label, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) + label.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments yylex.(*Parser).comments.AddFromToken(label, yyDollar[1].token, comment.StringToken) @@ -3649,9 +3649,9 @@ yydefault: yyVAL.list = append(yyDollar[1].list, catch) // save position - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[5].token)) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[5].token)) - yylex.(*Parser).positions.AddPosition(catch, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[2].token, yyDollar[9].token)) + identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[5].token)) + variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[5].token)) + catch.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[2].token, yyDollar[9].token)) // save comments yylex.(*Parser).comments.AddFromToken(catch, yyDollar[2].token, comment.CatchToken) @@ -3697,7 +3697,7 @@ yydefault: yyVAL.node = stmt.NewFinally(yyDollar[3].list) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.FinallyToken) @@ -3741,8 +3741,8 @@ yydefault: yyVAL.node = stmt.NewFunction(name, yyDollar[2].token != nil, yyDollar[6].list, yyDollar[8].node, yyDollar[10].list, yyDollar[4].str) // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[11].token)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[11].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.FunctionToken) @@ -3789,8 +3789,8 @@ yydefault: yyVAL.node = stmt.NewClass(name, yyDollar[1].list, nil, yyDollar[4].ClassExtends, yyDollar[5].ClassImplements, yyDollar[8].list, yyDollar[6].str) // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewOptionalListTokensPosition(yyDollar[1].list, yyDollar[2].token, yyDollar[9].token)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewOptionalListTokensPosition(yyDollar[1].list, yyDollar[2].token, yyDollar[9].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.ClassToken) @@ -3808,8 +3808,8 @@ yydefault: yyVAL.node = stmt.NewClass(name, nil, nil, yyDollar[3].ClassExtends, yyDollar[4].ClassImplements, yyDollar[7].list, yyDollar[5].str) // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[8].token)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[8].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ClassToken) @@ -3842,7 +3842,7 @@ yydefault: yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.AbstractToken) @@ -3856,7 +3856,7 @@ yydefault: yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.FinalToken) @@ -3871,8 +3871,8 @@ yydefault: yyVAL.node = stmt.NewTrait(name, yyDollar[5].list, yyDollar[3].str) // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[6].token)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[6].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.TraitToken) @@ -3890,8 +3890,8 @@ yydefault: yyVAL.node = stmt.NewInterface(name, yyDollar[3].InterfaceExtends, yyDollar[6].list, yyDollar[4].str) // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[7].token)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[7].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.InterfaceToken) @@ -3916,7 +3916,7 @@ yydefault: yyVAL.ClassExtends = stmt.NewClassExtends(yyDollar[2].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.ClassExtends, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + yyVAL.ClassExtends.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.ClassExtends, yyDollar[1].token, comment.ExtendsToken) @@ -3938,7 +3938,7 @@ yydefault: yyVAL.InterfaceExtends = stmt.NewInterfaceExtends(yyDollar[2].list) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.InterfaceExtends, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) + yyVAL.InterfaceExtends.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.InterfaceExtends, yyDollar[1].token, comment.ExtendsToken) @@ -3960,7 +3960,7 @@ yydefault: yyVAL.ClassImplements = stmt.NewClassImplements(yyDollar[2].list) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.ClassImplements, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) + yyVAL.ClassImplements.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.ClassImplements, yyDollar[1].token, comment.ImplementsToken) @@ -3982,7 +3982,7 @@ yydefault: yyVAL.node = expr.NewReference(yyDollar[2].node) // save position - yylex.(*Parser).positions.AddPosition(yyDollar[2].node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.AmpersandToken) @@ -3996,7 +3996,7 @@ yydefault: yyVAL.node = expr.NewList(yyDollar[3].list) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ListToken) @@ -4012,7 +4012,7 @@ yydefault: yyVAL.node = expr.NewShortList(yyDollar[2].list) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.OpenSquareBracket) @@ -4027,7 +4027,7 @@ yydefault: yyVAL.node = stmt.NewFor(nil, nil, nil, yyDollar[1].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4039,8 +4039,8 @@ yydefault: yyVAL.node = stmt.NewAltFor(nil, nil, nil, stmtList) // save position - yylex.(*Parser).positions.AddPosition(stmtList, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + stmtList.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ColonToken) @@ -4056,7 +4056,7 @@ yydefault: yyVAL.node = stmt.NewForeach(nil, nil, nil, yyDollar[1].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4068,8 +4068,8 @@ yydefault: yyVAL.node = stmt.NewAltForeach(nil, nil, nil, stmtList) // save position - yylex.(*Parser).positions.AddPosition(stmtList, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + stmtList.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ColonToken) @@ -4093,7 +4093,7 @@ yydefault: yyVAL.node = stmt.NewStmtList(yyDollar[2].list) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ColonToken) @@ -4110,8 +4110,8 @@ yydefault: yyVAL.node = stmt.NewSwitch(nil, caseList) // save position - yylex.(*Parser).positions.AddPosition(caseList, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) + caseList.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments yylex.(*Parser).comments.AddFromToken(caseList, yyDollar[1].token, comment.OpenCurlyBracesToken) @@ -4127,8 +4127,8 @@ yydefault: yyVAL.node = stmt.NewSwitch(nil, caseList) // save position - yylex.(*Parser).positions.AddPosition(caseList, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + caseList.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments yylex.(*Parser).comments.AddFromToken(caseList, yyDollar[1].token, comment.OpenCurlyBracesToken) @@ -4145,8 +4145,8 @@ yydefault: yyVAL.node = stmt.NewAltSwitch(nil, caseList) // save position - yylex.(*Parser).positions.AddPosition(caseList, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + caseList.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments yylex.(*Parser).comments.AddFromToken(caseList, yyDollar[1].token, comment.ColonToken) @@ -4164,8 +4164,8 @@ yydefault: yyVAL.node = stmt.NewAltSwitch(nil, caseList) // save position - yylex.(*Parser).positions.AddPosition(caseList, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[3].list)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[5].token)) + caseList.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[3].list)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[5].token)) // save comments yylex.(*Parser).comments.AddFromToken(caseList, yyDollar[1].token, comment.ColonToken) @@ -4191,7 +4191,7 @@ yydefault: yyVAL.list = append(yyDollar[1].list, _case) // save position - yylex.(*Parser).positions.AddPosition(_case, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[5].list)) + _case.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[5].list)) // save comments yylex.(*Parser).comments.AddFromToken(_case, yyDollar[2].token, comment.CaseToken) @@ -4207,7 +4207,7 @@ yydefault: yyVAL.list = append(yyDollar[1].list, _default) // save position - yylex.(*Parser).positions.AddPosition(_default, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[4].list)) + _default.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[4].list)) // save comments yylex.(*Parser).comments.AddFromToken(_default, yyDollar[2].token, comment.DefaultToken) @@ -4234,7 +4234,7 @@ yydefault: yyVAL.node = stmt.NewWhile(nil, yyDollar[1].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4246,8 +4246,8 @@ yydefault: yyVAL.node = stmt.NewAltWhile(nil, stmtList) // save position - yylex.(*Parser).positions.AddPosition(stmtList, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + stmtList.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ColonToken) @@ -4263,7 +4263,7 @@ yydefault: yyVAL.node = stmt.NewIf(yyDollar[3].node, yyDollar[5].node, nil, nil) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[5].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[5].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.IfToken) @@ -4280,8 +4280,8 @@ yydefault: yyVAL.node = yyDollar[1].node.(*stmt.If).AddElseIf(_elseIf) // save position - yylex.(*Parser).positions.AddPosition(_elseIf, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[2].token, yyDollar[6].node)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[6].node)) + _elseIf.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[2].token, yyDollar[6].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[6].node)) // save comments yylex.(*Parser).comments.AddFromToken(_elseIf, yyDollar[2].token, comment.ElseifToken) @@ -4306,8 +4306,8 @@ yydefault: yyVAL.node = yyDollar[1].node.(*stmt.If).SetElse(_else) // save position - yylex.(*Parser).positions.AddPosition(_else, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[2].token, yyDollar[3].node)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + _else.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[2].token, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.ElseToken) @@ -4322,8 +4322,8 @@ yydefault: yyVAL.node = stmt.NewAltIf(yyDollar[3].node, stmts, nil, nil) // save position - yylex.(*Parser).positions.AddPosition(stmts, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[6].list)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[6].list)) + stmts.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[6].list)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[6].list)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.IfToken) @@ -4342,8 +4342,8 @@ yydefault: yyVAL.node = yyDollar[1].node.(*stmt.AltIf).AddElseIf(_elseIf) // save position - yylex.(*Parser).positions.AddPosition(stmts, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[7].list)) - yylex.(*Parser).positions.AddPosition(_elseIf, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[7].list)) + stmts.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[7].list)) + _elseIf.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[7].list)) // save comments yylex.(*Parser).comments.AddFromToken(_elseIf, yyDollar[2].token, comment.ElseifToken) @@ -4360,7 +4360,7 @@ yydefault: yyVAL.node = yyDollar[1].node // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.EndifToken) @@ -4377,9 +4377,9 @@ yydefault: yyVAL.node = yyDollar[1].node.(*stmt.AltIf).SetElse(_else) // save position - yylex.(*Parser).positions.AddPosition(stmts, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[4].list)) - yylex.(*Parser).positions.AddPosition(_else, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[4].list)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[6].token)) + stmts.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[4].list)) + _else.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[4].list)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[6].token)) // save comments yylex.(*Parser).comments.AddFromToken(_else, yyDollar[2].token, comment.ElseToken) @@ -4433,16 +4433,16 @@ yydefault: yyVAL.node = node.NewParameter(yyDollar[1].node, variable, nil, yyDollar[2].token != nil, yyDollar[3].token != nil) // save position - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) + identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) + variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) if yyDollar[1].node != nil { - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) } else if yyDollar[2].token != nil { - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[2].token, yyDollar[4].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[2].token, yyDollar[4].token)) } else if yyDollar[3].token != nil { - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[3].token, yyDollar[4].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[3].token, yyDollar[4].token)) } else { - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) } // save comments @@ -4465,16 +4465,16 @@ yydefault: yyVAL.node = node.NewParameter(yyDollar[1].node, variable, yyDollar[6].node, yyDollar[2].token != nil, yyDollar[3].token != nil) // save position - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) + identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) + variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) if yyDollar[1].node != nil { - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[6].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[6].node)) } else if yyDollar[2].token != nil { - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[2].token, yyDollar[6].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[2].token, yyDollar[6].node)) } else if yyDollar[3].token != nil { - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[3].token, yyDollar[6].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[3].token, yyDollar[6].node)) } else { - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[4].token, yyDollar[6].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[4].token, yyDollar[6].node)) } // save comments @@ -4520,7 +4520,7 @@ yydefault: yyVAL.node = node.NewNullable(yyDollar[2].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.QuestionMarkToken) @@ -4534,7 +4534,7 @@ yydefault: yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ArrayToken) @@ -4548,7 +4548,7 @@ yydefault: yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.CallableToken) @@ -4589,7 +4589,7 @@ yydefault: yyVAL.node = node.NewArgumentList(nil) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.OpenParenthesisToken) @@ -4604,7 +4604,7 @@ yydefault: yyVAL.node = node.NewArgumentList(yyDollar[2].list) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.OpenParenthesisToken) @@ -4641,7 +4641,7 @@ yydefault: yyVAL.node = node.NewArgument(yyDollar[1].node, false, false) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4652,7 +4652,7 @@ yydefault: yyVAL.node = node.NewArgument(yyDollar[2].node, true, false) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.EllipsisToken) @@ -4714,9 +4714,9 @@ yydefault: yyVAL.node = stmt.NewStaticVar(variable, nil) // save position - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(variable, yyDollar[1].token, comment.VariableToken) @@ -4732,9 +4732,9 @@ yydefault: yyVAL.node = stmt.NewStaticVar(variable, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) + identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(variable, yyDollar[1].token, comment.VariableToken) @@ -4765,7 +4765,7 @@ yydefault: yyVAL.node = stmt.NewPropertyList(yyDollar[1].list, yyDollar[2].list) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeListTokenPosition(yyDollar[1].list, yyDollar[3].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition(yyDollar[1].list, yyDollar[3].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.SemiColonToken) @@ -4779,7 +4779,7 @@ yydefault: yyVAL.node = stmt.NewClassConstList(yyDollar[1].list, yyDollar[3].list) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewOptionalListTokensPosition(yyDollar[1].list, yyDollar[2].token, yyDollar[4].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewOptionalListTokensPosition(yyDollar[1].list, yyDollar[2].token, yyDollar[4].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.ConstToken) @@ -4804,7 +4804,7 @@ yydefault: yyVAL.node = stmt.NewTraitUse(yyDollar[2].list, adaptationList) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.UseToken) @@ -4819,11 +4819,11 @@ yydefault: yyVAL.node = stmt.NewClassMethod(name, yyDollar[1].list, yyDollar[3].token != nil, yyDollar[7].list, yyDollar[9].node, yyDollar[10].node, yyDollar[5].str) // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) if yyDollar[1].list == nil { - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[2].token, yyDollar[10].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[2].token, yyDollar[10].node)) } else { - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeListNodePosition(yyDollar[1].list, yyDollar[10].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListNodePosition(yyDollar[1].list, yyDollar[10].node)) } // save comments @@ -4862,7 +4862,7 @@ yydefault: { yyVAL.node = stmt.NewNop() - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.SemiColonToken) @@ -4875,7 +4875,7 @@ yydefault: { yyVAL.node = stmt.NewTraitAdaptationList(nil) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.OpenCurlyBracesToken) @@ -4889,7 +4889,7 @@ yydefault: { yyVAL.node = stmt.NewTraitAdaptationList(yyDollar[2].list) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.OpenCurlyBracesToken) @@ -4942,7 +4942,7 @@ yydefault: yyVAL.node = stmt.NewTraitUsePrecedence(yyDollar[1].node, yyDollar[3].list) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeNodeListPosition(yyDollar[1].node, yyDollar[3].list)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeNodeListPosition(yyDollar[1].node, yyDollar[3].list)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.InsteadofToken) @@ -4957,8 +4957,8 @@ yydefault: yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, nil, alias) // save position - yylex.(*Parser).positions.AddPosition(alias, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) + alias.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.AsToken) @@ -4974,8 +4974,8 @@ yydefault: yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, nil, alias) // save position - yylex.(*Parser).positions.AddPosition(alias, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) + alias.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.AsToken) @@ -4991,8 +4991,8 @@ yydefault: yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, yyDollar[3].node, alias) // save position - yylex.(*Parser).positions.AddPosition(alias, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) + alias.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.AsToken) @@ -5007,7 +5007,7 @@ yydefault: yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, yyDollar[3].node, nil) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.AsToken) @@ -5022,8 +5022,8 @@ yydefault: yyVAL.node = stmt.NewTraitMethodRef(nil, name) // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(name, yyDollar[1].token, comment.IdentifierToken) @@ -5046,8 +5046,8 @@ yydefault: yyVAL.node = stmt.NewTraitMethodRef(yyDollar[1].node, target) // save position - yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) + target.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PaamayimNekudotayimToken) @@ -5062,7 +5062,7 @@ yydefault: yyVAL.node = stmt.NewNop() // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.SemiColonToken) @@ -5076,7 +5076,7 @@ yydefault: yyVAL.node = stmt.NewStmtList(yyDollar[2].list) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.OpenCurlyBracesToken) @@ -5100,7 +5100,7 @@ yydefault: yyVAL.list = []node.Node{modifier} // save position - yylex.(*Parser).positions.AddPosition(modifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + modifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(modifier, yyDollar[1].token, comment.VarToken) @@ -5146,7 +5146,7 @@ yydefault: yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.PublicToken) @@ -5160,7 +5160,7 @@ yydefault: yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ProtectedToken) @@ -5174,7 +5174,7 @@ yydefault: yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.PrivateToken) @@ -5188,7 +5188,7 @@ yydefault: yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.StaticToken) @@ -5202,7 +5202,7 @@ yydefault: yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.AbstractToken) @@ -5216,7 +5216,7 @@ yydefault: yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.FinalToken) @@ -5251,9 +5251,9 @@ yydefault: yyVAL.node = stmt.NewProperty(variable, nil, yyDollar[2].str) // save position - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(variable, yyDollar[1].token, comment.VariableToken) @@ -5269,9 +5269,9 @@ yydefault: yyVAL.node = stmt.NewProperty(variable, yyDollar[3].node, yyDollar[4].str) // save position - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) + identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(variable, yyDollar[1].token, comment.VariableToken) @@ -5306,8 +5306,8 @@ yydefault: yyVAL.node = stmt.NewConstant(name, yyDollar[3].node, yyDollar[4].str) // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(name, yyDollar[1].token, comment.IdentifierToken) @@ -5323,8 +5323,8 @@ yydefault: yyVAL.node = stmt.NewConstant(name, yyDollar[3].node, yyDollar[4].str) // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(name, yyDollar[1].token, comment.StringToken) @@ -5405,7 +5405,7 @@ yydefault: } // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[8].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[8].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ClassToken) @@ -5420,10 +5420,10 @@ yydefault: { if yyDollar[3].node != nil { yyVAL.node = expr.NewNew(yyDollar[2].node, yyDollar[3].node.(*node.ArgumentList)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) } else { yyVAL.node = expr.NewNew(yyDollar[2].node, nil) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) } // save comments @@ -5438,7 +5438,7 @@ yydefault: yyVAL.node = expr.NewNew(yyDollar[2].node, nil) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.NewToken) @@ -5453,8 +5453,8 @@ yydefault: yyVAL.node = assign.NewAssign(list, yyDollar[6].node) // save position - yylex.(*Parser).positions.AddPosition(list, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[6].node)) + list.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[6].node)) // save comments yylex.(*Parser).comments.AddFromToken(list, yyDollar[1].token, comment.ListToken) @@ -5472,8 +5472,8 @@ yydefault: yyVAL.node = assign.NewAssign(shortList, yyDollar[5].node) // save position - yylex.(*Parser).positions.AddPosition(shortList, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[5].node)) + shortList.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[5].node)) // save comments yylex.(*Parser).comments.AddFromToken(shortList, yyDollar[1].token, comment.OpenSquareBracket) @@ -5489,7 +5489,7 @@ yydefault: yyVAL.node = assign.NewAssign(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.EqualToken) @@ -5503,7 +5503,7 @@ yydefault: yyVAL.node = assign.NewReference(yyDollar[1].node, yyDollar[4].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.EqualToken) @@ -5518,7 +5518,7 @@ yydefault: yyVAL.node = expr.NewClone(yyDollar[2].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.CloneToken) @@ -5532,7 +5532,7 @@ yydefault: yyVAL.node = assign.NewPlus(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PlusEqualToken) @@ -5546,7 +5546,7 @@ yydefault: yyVAL.node = assign.NewMinus(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.MinusEqualToken) @@ -5560,7 +5560,7 @@ yydefault: yyVAL.node = assign.NewMul(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.MulEqualToken) @@ -5574,7 +5574,7 @@ yydefault: yyVAL.node = assign.NewPow(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PowEqualToken) @@ -5588,7 +5588,7 @@ yydefault: yyVAL.node = assign.NewDiv(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.DivEqualToken) @@ -5602,7 +5602,7 @@ yydefault: yyVAL.node = assign.NewConcat(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.ConcatEqualToken) @@ -5616,7 +5616,7 @@ yydefault: yyVAL.node = assign.NewMod(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.ModEqualToken) @@ -5630,7 +5630,7 @@ yydefault: yyVAL.node = assign.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.AndEqualToken) @@ -5644,7 +5644,7 @@ yydefault: yyVAL.node = assign.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OrEqualToken) @@ -5658,7 +5658,7 @@ yydefault: yyVAL.node = assign.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.XorEqualToken) @@ -5672,7 +5672,7 @@ yydefault: yyVAL.node = assign.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.SlEqualToken) @@ -5686,7 +5686,7 @@ yydefault: yyVAL.node = assign.NewShiftRight(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.SrEqualToken) @@ -5700,7 +5700,7 @@ yydefault: yyVAL.node = expr.NewPostInc(yyDollar[1].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.IncToken) @@ -5714,7 +5714,7 @@ yydefault: yyVAL.node = expr.NewPreInc(yyDollar[2].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.IncToken) @@ -5728,7 +5728,7 @@ yydefault: yyVAL.node = expr.NewPostDec(yyDollar[1].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.DecToken) @@ -5742,7 +5742,7 @@ yydefault: yyVAL.node = expr.NewPreDec(yyDollar[2].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.DecToken) @@ -5756,7 +5756,7 @@ yydefault: yyVAL.node = binary.NewBooleanOr(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.BooleanOrToken) @@ -5770,7 +5770,7 @@ yydefault: yyVAL.node = binary.NewBooleanAnd(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.BooleanAndToken) @@ -5784,7 +5784,7 @@ yydefault: yyVAL.node = binary.NewLogicalOr(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.LogicalOrToken) @@ -5798,7 +5798,7 @@ yydefault: yyVAL.node = binary.NewLogicalAnd(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.LogicalAndToken) @@ -5812,7 +5812,7 @@ yydefault: yyVAL.node = binary.NewLogicalXor(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.LogicalXorToken) @@ -5826,7 +5826,7 @@ yydefault: yyVAL.node = binary.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.VerticalBarToken) @@ -5840,7 +5840,7 @@ yydefault: yyVAL.node = binary.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.AmpersandToken) @@ -5854,7 +5854,7 @@ yydefault: yyVAL.node = binary.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.CaretToken) @@ -5868,7 +5868,7 @@ yydefault: yyVAL.node = binary.NewConcat(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.DotToken) @@ -5882,7 +5882,7 @@ yydefault: yyVAL.node = binary.NewPlus(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PlusToken) @@ -5896,7 +5896,7 @@ yydefault: yyVAL.node = binary.NewMinus(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.MinusToken) @@ -5910,7 +5910,7 @@ yydefault: yyVAL.node = binary.NewMul(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.AsteriskToken) @@ -5924,7 +5924,7 @@ yydefault: yyVAL.node = binary.NewPow(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PowToken) @@ -5938,7 +5938,7 @@ yydefault: yyVAL.node = binary.NewDiv(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.SlashToken) @@ -5952,7 +5952,7 @@ yydefault: yyVAL.node = binary.NewMod(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PercentToken) @@ -5966,7 +5966,7 @@ yydefault: yyVAL.node = binary.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.SlToken) @@ -5980,7 +5980,7 @@ yydefault: yyVAL.node = binary.NewShiftRight(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.SrToken) @@ -5994,7 +5994,7 @@ yydefault: yyVAL.node = expr.NewUnaryPlus(yyDollar[2].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.PlusToken) @@ -6008,7 +6008,7 @@ yydefault: yyVAL.node = expr.NewUnaryMinus(yyDollar[2].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.MinusToken) @@ -6022,7 +6022,7 @@ yydefault: yyVAL.node = expr.NewBooleanNot(yyDollar[2].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ExclamationMarkToken) @@ -6036,7 +6036,7 @@ yydefault: yyVAL.node = expr.NewBitwiseNot(yyDollar[2].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.TildeToken) @@ -6050,7 +6050,7 @@ yydefault: yyVAL.node = binary.NewIdentical(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.IsIdenticalToken) @@ -6064,7 +6064,7 @@ yydefault: yyVAL.node = binary.NewNotIdentical(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.IsNotIdenticalToken) @@ -6078,7 +6078,7 @@ yydefault: yyVAL.node = binary.NewEqual(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.IsEqualToken) @@ -6092,7 +6092,7 @@ yydefault: yyVAL.node = binary.NewNotEqual(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.IsNotEqualToken) @@ -6106,7 +6106,7 @@ yydefault: yyVAL.node = binary.NewSmaller(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.LessToken) @@ -6120,7 +6120,7 @@ yydefault: yyVAL.node = binary.NewSmallerOrEqual(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.IsSmallerOrEqualToken) @@ -6134,7 +6134,7 @@ yydefault: yyVAL.node = binary.NewGreater(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.GreaterToken) @@ -6148,7 +6148,7 @@ yydefault: yyVAL.node = binary.NewGreaterOrEqual(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.IsGreaterOrEqualToken) @@ -6162,7 +6162,7 @@ yydefault: yyVAL.node = binary.NewSpaceship(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.SpaceshipToken) @@ -6176,7 +6176,7 @@ yydefault: yyVAL.node = expr.NewInstanceOf(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.InstanceofToken) @@ -6210,7 +6210,7 @@ yydefault: yyVAL.node = expr.NewTernary(yyDollar[1].node, yyDollar[3].node, yyDollar[5].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[5].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[5].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.QuestionMarkToken) @@ -6225,7 +6225,7 @@ yydefault: yyVAL.node = expr.NewTernary(yyDollar[1].node, nil, yyDollar[4].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.QuestionMarkToken) @@ -6240,7 +6240,7 @@ yydefault: yyVAL.node = binary.NewCoalesce(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.CoalesceToken) @@ -6262,7 +6262,7 @@ yydefault: yyVAL.node = cast.NewInt(yyDollar[2].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.IntCastToken) @@ -6276,7 +6276,7 @@ yydefault: yyVAL.node = cast.NewDouble(yyDollar[2].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.DoubleCastToken) @@ -6290,7 +6290,7 @@ yydefault: yyVAL.node = cast.NewString(yyDollar[2].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.StringCastToken) @@ -6304,7 +6304,7 @@ yydefault: yyVAL.node = cast.NewArray(yyDollar[2].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ArrayCastToken) @@ -6318,7 +6318,7 @@ yydefault: yyVAL.node = cast.NewObject(yyDollar[2].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ObjectCastToken) @@ -6332,7 +6332,7 @@ yydefault: yyVAL.node = cast.NewBool(yyDollar[2].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.BoolCastToken) @@ -6346,7 +6346,7 @@ yydefault: yyVAL.node = cast.NewUnset(yyDollar[2].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.UnsetCastToken) @@ -6371,9 +6371,9 @@ yydefault: // save position if yyDollar[2].node == nil { - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) } else { - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) } // save comments @@ -6392,7 +6392,7 @@ yydefault: yyVAL.node = expr.NewErrorSuppress(yyDollar[2].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.AtToken) @@ -6414,7 +6414,7 @@ yydefault: yyVAL.node = expr.NewShellExec(yyDollar[2].list) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.BackquoteToken) @@ -6429,7 +6429,7 @@ yydefault: yyVAL.node = expr.NewPrint(yyDollar[2].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.PrintToken) @@ -6443,7 +6443,7 @@ yydefault: yyVAL.node = expr.NewYield(nil, nil) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.YieldToken) @@ -6457,7 +6457,7 @@ yydefault: yyVAL.node = expr.NewYield(nil, yyDollar[2].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.YieldToken) @@ -6471,7 +6471,7 @@ yydefault: yyVAL.node = expr.NewYield(yyDollar[2].node, yyDollar[4].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[4].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[4].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.YieldToken) @@ -6486,7 +6486,7 @@ yydefault: yyVAL.node = expr.NewYieldFrom(yyDollar[2].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.YieldFromToken) @@ -6500,7 +6500,7 @@ yydefault: yyVAL.node = expr.NewClosure(yyDollar[5].list, yyDollar[7].ClosureUse, yyDollar[8].node, yyDollar[10].list, false, yyDollar[2].token != nil, yyDollar[3].str) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[11].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[11].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.FunctionToken) @@ -6521,7 +6521,7 @@ yydefault: yyVAL.node = expr.NewClosure(yyDollar[6].list, yyDollar[8].ClosureUse, yyDollar[9].node, yyDollar[11].list, true, yyDollar[3].token != nil, yyDollar[4].str) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[12].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[12].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.StaticToken) @@ -6572,7 +6572,7 @@ yydefault: yyVAL.ClosureUse = expr.NewClosureUse(yyDollar[3].list) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.ClosureUse, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + yyVAL.ClosureUse.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.ClosureUse, yyDollar[1].token, comment.UseToken) @@ -6608,8 +6608,8 @@ yydefault: yyVAL.node = expr.NewVariable(identifier) // save position - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.VariableToken) @@ -6625,9 +6625,9 @@ yydefault: yyVAL.node = expr.NewReference(variable) // save position - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) + identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) + variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.AmpersandToken) @@ -6642,7 +6642,7 @@ yydefault: yyVAL.node = expr.NewFunctionCall(yyDollar[1].node, yyDollar[2].node.(*node.ArgumentList)) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[2].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[2].node)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6653,7 +6653,7 @@ yydefault: yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PaamayimNekudotayimToken) @@ -6667,7 +6667,7 @@ yydefault: yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PaamayimNekudotayimToken) @@ -6681,7 +6681,7 @@ yydefault: yyVAL.node = expr.NewFunctionCall(yyDollar[1].node, yyDollar[2].node.(*node.ArgumentList)) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[2].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[2].node)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6692,7 +6692,7 @@ yydefault: yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.StaticToken) @@ -6738,7 +6738,7 @@ yydefault: yyVAL.node = expr.NewExit(yyDollar[2].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.OpenParenthesisToken) @@ -6793,7 +6793,7 @@ yydefault: yyVAL.node = expr.NewArray(yyDollar[3].list) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ArrayToken) @@ -6809,7 +6809,7 @@ yydefault: yyVAL.node = expr.NewShortArray(yyDollar[2].list) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.OpenSquareBracket) @@ -6824,7 +6824,7 @@ yydefault: yyVAL.node = scalar.NewString(yyDollar[1].token.Value) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ConstantEncapsedStringToken) @@ -6838,7 +6838,7 @@ yydefault: yyVAL.node = scalar.NewLnumber(yyDollar[1].token.Value) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.LnumberToken) @@ -6852,7 +6852,7 @@ yydefault: yyVAL.node = scalar.NewDnumber(yyDollar[1].token.Value) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.DnumberToken) @@ -6866,7 +6866,7 @@ yydefault: yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.LineToken) @@ -6880,7 +6880,7 @@ yydefault: yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.FileToken) @@ -6894,7 +6894,7 @@ yydefault: yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.DirToken) @@ -6908,7 +6908,7 @@ yydefault: yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.TraitCToken) @@ -6922,7 +6922,7 @@ yydefault: yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.MethodCToken) @@ -6936,7 +6936,7 @@ yydefault: yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.FuncCToken) @@ -6950,7 +6950,7 @@ yydefault: yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.NsCToken) @@ -6964,7 +6964,7 @@ yydefault: yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ClassCToken) @@ -6979,8 +6979,8 @@ yydefault: yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, []node.Node{encapsed}) // save position - yylex.(*Parser).positions.AddPosition(encapsed, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) + encapsed.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.StartHeredocToken) @@ -6994,7 +6994,7 @@ yydefault: yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, nil) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.StartHeredocToken) @@ -7008,7 +7008,7 @@ yydefault: yyVAL.node = scalar.NewEncapsed(yyDollar[2].list) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.DoubleQuoteToken) @@ -7022,7 +7022,7 @@ yydefault: yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, yyDollar[2].list) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.StartHeredocToken) @@ -7052,7 +7052,7 @@ yydefault: yyVAL.node = expr.NewConstFetch(yyDollar[1].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7064,8 +7064,8 @@ yydefault: yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) // save position - yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) + target.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PaamayimNekudotayimToken) @@ -7081,8 +7081,8 @@ yydefault: yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) // save position - yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) + target.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PaamayimNekudotayimToken) @@ -7201,7 +7201,7 @@ yydefault: yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenSquareBracket) @@ -7216,7 +7216,7 @@ yydefault: yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenSquareBracket) @@ -7231,7 +7231,7 @@ yydefault: yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenCurlyBracesToken) @@ -7246,7 +7246,7 @@ yydefault: yyVAL.node = expr.NewMethodCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.ObjectOperatorToken) @@ -7284,7 +7284,7 @@ yydefault: yyVAL.node = expr.NewPropertyFetch(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.ObjectOperatorToken) @@ -7299,8 +7299,8 @@ yydefault: yyVAL.node = expr.NewVariable(name) // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.VariableToken) @@ -7314,7 +7314,7 @@ yydefault: yyVAL.node = expr.NewVariable(yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.DollarToken) @@ -7330,7 +7330,7 @@ yydefault: yyVAL.node = expr.NewVariable(yyDollar[2].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.DollarToken) @@ -7344,7 +7344,7 @@ yydefault: yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PaamayimNekudotayimToken) @@ -7358,7 +7358,7 @@ yydefault: yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PaamayimNekudotayimToken) @@ -7380,7 +7380,7 @@ yydefault: yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenSquareBracket) @@ -7395,7 +7395,7 @@ yydefault: yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenCurlyBracesToken) @@ -7410,7 +7410,7 @@ yydefault: yyVAL.node = expr.NewPropertyFetch(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.ObjectOperatorToken) @@ -7424,7 +7424,7 @@ yydefault: yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PaamayimNekudotayimToken) @@ -7438,7 +7438,7 @@ yydefault: yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PaamayimNekudotayimToken) @@ -7452,7 +7452,7 @@ yydefault: yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.IdentifierToken) @@ -7486,7 +7486,7 @@ yydefault: yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.StringToken) @@ -7567,7 +7567,7 @@ yydefault: yyVAL.node = expr.NewArrayItem(yyDollar[1].node, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.DoubleArrowToken) @@ -7581,7 +7581,7 @@ yydefault: yyVAL.node = expr.NewArrayItem(nil, yyDollar[1].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7593,7 +7593,8 @@ yydefault: yyVAL.node = expr.NewArrayItem(yyDollar[1].node, reference) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) + reference.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[3].token, yyDollar[4].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.DoubleArrowToken) @@ -7603,13 +7604,14 @@ yydefault: } case 462: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4942 + //line php7/php7.y:4943 { reference := expr.NewReference(yyDollar[2].node) yyVAL.node = expr.NewArrayItem(nil, reference) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + reference.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments yylex.(*Parser).comments.AddFromToken(reference, yyDollar[1].token, comment.AmpersandToken) @@ -7618,15 +7620,15 @@ yydefault: } case 463: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:4955 + //line php7/php7.y:4957 { // TODO: Cannot use list() as standalone expression list := expr.NewList(yyDollar[5].list) yyVAL.node = expr.NewArrayItem(yyDollar[1].node, list) // save position - yylex.(*Parser).positions.AddPosition(list, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[3].token, yyDollar[6].token)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[6].token)) + list.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[3].token, yyDollar[6].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[6].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.DoubleArrowToken) @@ -7638,15 +7640,15 @@ yydefault: } case 464: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4973 + //line php7/php7.y:4975 { // TODO: Cannot use list() as standalone expression list := expr.NewList(yyDollar[3].list) yyVAL.node = expr.NewArrayItem(nil, list) // save position - yylex.(*Parser).positions.AddPosition(list, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + list.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments yylex.(*Parser).comments.AddFromToken(list, yyDollar[1].token, comment.ListToken) @@ -7657,7 +7659,7 @@ yydefault: } case 465: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4993 + //line php7/php7.y:4995 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -7665,13 +7667,13 @@ yydefault: } case 466: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4999 + //line php7/php7.y:5001 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yyVAL.list = append(yyDollar[1].list, encapsed) // save position - yylex.(*Parser).positions.AddPosition(encapsed, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) + encapsed.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) // save comments yylex.(*Parser).comments.AddFromToken(encapsed, yyDollar[2].token, comment.EncapsedAndWhitespaceToken) @@ -7680,7 +7682,7 @@ yydefault: } case 467: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5012 + //line php7/php7.y:5014 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -7688,13 +7690,13 @@ yydefault: } case 468: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5018 + //line php7/php7.y:5020 { encapsed := scalar.NewEncapsedStringPart(yyDollar[1].token.Value) yyVAL.list = []node.Node{encapsed, yyDollar[2].node} // save position - yylex.(*Parser).positions.AddPosition(encapsed, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + encapsed.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(encapsed, yyDollar[1].token, comment.EncapsedAndWhitespaceToken) @@ -7703,14 +7705,14 @@ yydefault: } case 469: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5034 + //line php7/php7.y:5036 { name := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(name) // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.VariableToken) @@ -7719,16 +7721,16 @@ yydefault: } case 470: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:5048 + //line php7/php7.y:5050 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) yyVAL.node = expr.NewArrayDimFetch(variable, yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments yylex.(*Parser).comments.AddFromToken(variable, yyDollar[1].token, comment.VariableToken) @@ -7739,7 +7741,7 @@ yydefault: } case 471: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5066 + //line php7/php7.y:5068 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -7747,10 +7749,10 @@ yydefault: yyVAL.node = expr.NewPropertyFetch(variable, fetch) // save position - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) + identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + fetch.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments yylex.(*Parser).comments.AddFromToken(variable, yyDollar[1].token, comment.VariableToken) @@ -7761,12 +7763,12 @@ yydefault: } case 472: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5086 + //line php7/php7.y:5088 { yyVAL.node = expr.NewVariable(yyDollar[2].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.DollarOpenCurlyBracesToken) @@ -7776,14 +7778,14 @@ yydefault: } case 473: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5099 + //line php7/php7.y:5101 { name := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = expr.NewVariable(name) // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.DollarOpenCurlyBracesToken) @@ -7794,16 +7796,16 @@ yydefault: } case 474: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:5115 + //line php7/php7.y:5117 { identifier := node.NewIdentifier(yyDollar[2].token.Value) variable := expr.NewVariable(identifier) yyVAL.node = expr.NewArrayDimFetch(variable, yyDollar[4].node) // save position - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[6].token)) + identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) + variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[6].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.DollarOpenCurlyBracesToken) @@ -7816,7 +7818,7 @@ yydefault: } case 475: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5135 + //line php7/php7.y:5137 { yyVAL.node = yyDollar[2].node @@ -7824,12 +7826,12 @@ yydefault: } case 476: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5144 + //line php7/php7.y:5146 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.StringToken) @@ -7838,7 +7840,7 @@ yydefault: } case 477: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5156 + //line php7/php7.y:5158 { // TODO: add option to handle 64 bit integer if _, err := strconv.Atoi(yyDollar[1].token.Value); err == nil { @@ -7848,7 +7850,7 @@ yydefault: } // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.NumStringToken) @@ -7857,7 +7859,7 @@ yydefault: } case 478: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5173 + //line php7/php7.y:5175 { var lnumber *scalar.Lnumber // TODO: add option to handle 64 bit integer @@ -7874,9 +7876,9 @@ yydefault: // save position if isInt { - yylex.(*Parser).positions.AddPosition(lnumber, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) + lnumber.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) } - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.MinusToken) @@ -7890,14 +7892,14 @@ yydefault: } case 479: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5204 + //line php7/php7.y:5206 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(identifier) // save position - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.VariableToken) @@ -7906,12 +7908,12 @@ yydefault: } case 480: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:5221 + //line php7/php7.y:5223 { yyVAL.node = expr.NewIsset(yyDollar[3].list) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[5].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[5].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.IssetToken) @@ -7925,12 +7927,12 @@ yydefault: } case 481: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:5238 + //line php7/php7.y:5240 { yyVAL.node = expr.NewEmpty(yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.EmptyToken) @@ -7941,12 +7943,12 @@ yydefault: } case 482: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5252 + //line php7/php7.y:5254 { yyVAL.node = expr.NewInclude(yyDollar[2].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.IncludeToken) @@ -7955,12 +7957,12 @@ yydefault: } case 483: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5264 + //line php7/php7.y:5266 { yyVAL.node = expr.NewIncludeOnce(yyDollar[2].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.IncludeOnceToken) @@ -7969,12 +7971,12 @@ yydefault: } case 484: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:5276 + //line php7/php7.y:5278 { yyVAL.node = expr.NewEval(yyDollar[3].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.EvalToken) @@ -7985,12 +7987,12 @@ yydefault: } case 485: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5290 + //line php7/php7.y:5292 { yyVAL.node = expr.NewRequire(yyDollar[2].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.RequireToken) @@ -7999,12 +8001,12 @@ yydefault: } case 486: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5302 + //line php7/php7.y:5304 { yyVAL.node = expr.NewRequireOnce(yyDollar[2].node) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.RequireOnceToken) @@ -8013,7 +8015,7 @@ yydefault: } case 487: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5317 + //line php7/php7.y:5319 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -8021,7 +8023,7 @@ yydefault: } case 488: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5323 + //line php7/php7.y:5325 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -8032,7 +8034,7 @@ yydefault: } case 489: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5335 + //line php7/php7.y:5337 { yyVAL.node = yyDollar[1].node diff --git a/php7/php7.y b/php7/php7.y index 1620098..eee2747 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -301,7 +301,7 @@ start: yylex.(*Parser).rootNode = node.NewRoot($1) // save position - yylex.(*Parser).positions.AddPosition(yylex.(*Parser).rootNode, yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) + yylex.(*Parser).rootNode.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -360,7 +360,7 @@ namespace_name: $$ = []node.Node{namePart} // save position - yylex.(*Parser).positions.AddPosition(namePart, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + namePart.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken(namePart, $1, comment.StringToken) @@ -373,7 +373,7 @@ namespace_name: $$ = append($1, namePart) // save position - yylex.(*Parser).positions.AddPosition(namePart, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) + namePart.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) // save comments yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.NsSeparatorToken) @@ -389,7 +389,7 @@ name: $$ = name.NewName($1) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -398,7 +398,7 @@ name: $$ = name.NewRelative($3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.NamespaceToken) @@ -411,7 +411,7 @@ name: $$ = name.NewFullyQualified($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.NsSeparatorToken) @@ -463,7 +463,7 @@ top_statement: $$ = stmt.NewHaltCompiler() // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.HaltCompilerToken) @@ -479,8 +479,8 @@ top_statement: $$ = stmt.NewNamespace(name, nil) // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.NamespaceToken) @@ -494,8 +494,8 @@ top_statement: $$ = stmt.NewNamespace(name, $4) // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.NamespaceToken) @@ -509,7 +509,7 @@ top_statement: $$ = stmt.NewNamespace(nil, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.NamespaceToken) @@ -523,7 +523,7 @@ top_statement: $$ = $2 // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.UseToken) @@ -536,7 +536,7 @@ top_statement: $$ = $3.(*stmt.GroupUse).SetUseType($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.UseToken) @@ -549,7 +549,7 @@ top_statement: $$ = stmt.NewUseList(nil, $2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.UseToken) @@ -562,7 +562,7 @@ top_statement: $$ = stmt.NewUseList($2, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.UseToken) @@ -575,7 +575,7 @@ top_statement: $$ = stmt.NewConstList($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.ConstToken) @@ -591,7 +591,7 @@ use_type: $$ = node.NewIdentifier($1.Value) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.FunctionToken) @@ -603,7 +603,7 @@ use_type: $$ = node.NewIdentifier($1.Value) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.ConstToken) @@ -619,8 +619,8 @@ group_use_declaration: $$ = stmt.NewGroupUse(nil, name, $4) // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $6)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $6)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.NsSeparatorToken) @@ -638,8 +638,8 @@ group_use_declaration: $$ = stmt.NewGroupUse(nil, name, $5) // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $7)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $7)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.NsSeparatorToken) @@ -661,8 +661,8 @@ mixed_group_use_declaration: $$ = stmt.NewGroupUse(nil, name, $4) // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $6)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $6)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.NsSeparatorToken) @@ -680,8 +680,8 @@ mixed_group_use_declaration: $$ = stmt.NewGroupUse(nil, name, $5) // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $7)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $7)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.NsSeparatorToken) @@ -783,8 +783,8 @@ unprefixed_use_declaration: $$ = stmt.NewUse(nil, name, nil) // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -795,9 +795,9 @@ unprefixed_use_declaration: $$ = stmt.NewUse(nil, name, alias) // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) - yylex.(*Parser).positions.AddPosition(alias, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $3)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) + alias.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.AsToken) @@ -903,7 +903,7 @@ inner_statement: $$ = stmt.NewHaltCompiler() // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.HaltCompilerToken) @@ -920,7 +920,7 @@ statement: $$ = stmt.NewStmtList($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.OpenCurlyBracesToken) @@ -952,7 +952,7 @@ statement: $$ = $5 // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.WhileToken) @@ -966,7 +966,7 @@ statement: $$ = stmt.NewDo($2, $5) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $7)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $7)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.DoToken) @@ -993,7 +993,7 @@ statement: $$ = $9 // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $9)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $9)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.ForToken) @@ -1018,7 +1018,7 @@ statement: $$ = $5 // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.SwitchToken) @@ -1032,7 +1032,7 @@ statement: $$ = stmt.NewBreak($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.BreakToken) @@ -1045,7 +1045,7 @@ statement: $$ = stmt.NewContinue($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.ContinueToken) @@ -1058,7 +1058,7 @@ statement: $$ = stmt.NewReturn($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.ReturnToken) @@ -1071,7 +1071,7 @@ statement: $$ = stmt.NewGlobal($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.GlobalToken) @@ -1084,7 +1084,7 @@ statement: $$ = stmt.NewStatic($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.StaticToken) @@ -1097,7 +1097,7 @@ statement: $$ = stmt.NewEcho($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.EchoToken) @@ -1110,7 +1110,7 @@ statement: $$ = stmt.NewInlineHtml($1.Value) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.InlineHTMLToken) @@ -1122,7 +1122,7 @@ statement: $$ = stmt.NewExpression($1) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.SemiColonToken) @@ -1134,7 +1134,7 @@ statement: $$ = stmt.NewUnset($3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $6)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $6)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.UnsetToken) @@ -1161,7 +1161,7 @@ statement: $$ = $7 // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $7)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $7)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.ForeachToken) @@ -1187,7 +1187,7 @@ statement: $$ = $9 // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $9)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $9)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.ForeachToken) @@ -1203,7 +1203,7 @@ statement: $$ = stmt.NewDeclare($3, $5) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.DeclareToken) @@ -1217,7 +1217,7 @@ statement: $$ = stmt.NewNop() // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.SemiColonToken) @@ -1228,10 +1228,10 @@ statement: { if $6 == nil { $$ = stmt.NewTry($3, $5, $6) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $5)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $5)) } else { $$ = stmt.NewTry($3, $5, $6) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $6)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $6)) } // save comments @@ -1246,7 +1246,7 @@ statement: $$ = stmt.NewThrow($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.ThrowToken) @@ -1260,8 +1260,8 @@ statement: $$ = stmt.NewGoto(label) // save position - yylex.(*Parser).positions.AddPosition(label, yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + label.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.GotoToken) @@ -1276,8 +1276,8 @@ statement: $$ = stmt.NewLabel(label) // save position - yylex.(*Parser).positions.AddPosition(label, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) + label.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken(label, $1, comment.StringToken) @@ -1301,9 +1301,9 @@ catch_list: $$ = append($1, catch) // save position - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($5)) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($5)) - yylex.(*Parser).positions.AddPosition(catch, yylex.(*Parser).positionBuilder.NewTokensPosition($2, $9)) + identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($5)) + variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($5)) + catch.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($2, $9)) // save comments yylex.(*Parser).comments.AddFromToken(catch, $2, comment.CatchToken) @@ -1346,7 +1346,7 @@ finally_statement: $$ = stmt.NewFinally($3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.FinallyToken) @@ -1391,8 +1391,8 @@ function_declaration_statement: $$ = stmt.NewFunction(name, $2 != nil, $6, $8, $10, $4) // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $11)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $11)) // save comments @@ -1439,8 +1439,8 @@ class_declaration_statement: $$ = stmt.NewClass(name, $1, nil, $4, $5, $8, $6) // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewOptionalListTokensPosition($1, $2, $9)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewOptionalListTokensPosition($1, $2, $9)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.ClassToken) @@ -1456,8 +1456,8 @@ class_declaration_statement: $$ = stmt.NewClass(name, nil, nil, $3, $4, $7, $5) // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $8)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $8)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.ClassToken) @@ -1490,7 +1490,7 @@ class_modifier: $$ = node.NewIdentifier($1.Value) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.AbstractToken) @@ -1502,7 +1502,7 @@ class_modifier: $$ = node.NewIdentifier($1.Value) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.FinalToken) @@ -1518,8 +1518,8 @@ trait_declaration_statement: $$ = stmt.NewTrait(name, $5, $3) // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $6)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $6)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.TraitToken) @@ -1538,8 +1538,8 @@ interface_declaration_statement: $$ = stmt.NewInterface(name, $3, $6, $4) // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $7)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $7)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.InterfaceToken) @@ -1563,7 +1563,7 @@ extends_from: $$ = stmt.NewClassExtends($2); // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.ExtendsToken) @@ -1584,7 +1584,7 @@ interface_extends_list: $$ = stmt.NewInterfaceExtends($2); // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.ExtendsToken) @@ -1605,7 +1605,7 @@ implements_list: $$ = stmt.NewClassImplements($2); // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.ImplementsToken) @@ -1626,7 +1626,7 @@ foreach_variable: $$ = expr.NewReference($2) // save position - yylex.(*Parser).positions.AddPosition($2, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.AmpersandToken) @@ -1638,7 +1638,7 @@ foreach_variable: $$ = expr.NewList($3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.ListToken) @@ -1652,7 +1652,7 @@ foreach_variable: $$ = expr.NewShortList($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.OpenSquareBracket) @@ -1668,7 +1668,7 @@ for_statement: $$ = stmt.NewFor(nil, nil, nil, $1) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodePosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1678,8 +1678,8 @@ for_statement: $$ = stmt.NewAltFor(nil, nil, nil, stmtList) // save position - yylex.(*Parser).positions.AddPosition(stmtList, yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + stmtList.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.ColonToken) @@ -1696,7 +1696,7 @@ foreach_statement: $$ = stmt.NewForeach(nil, nil, nil, $1) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodePosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1706,8 +1706,8 @@ foreach_statement: $$ = stmt.NewAltForeach(nil, nil, nil, stmtList) // save position - yylex.(*Parser).positions.AddPosition(stmtList, yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + stmtList.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.ColonToken) @@ -1730,7 +1730,7 @@ declare_statement: $$ = stmt.NewStmtList($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.ColonToken) @@ -1748,8 +1748,8 @@ switch_case_list: $$ = stmt.NewSwitch(nil, caseList) // save position - yylex.(*Parser).positions.AddPosition(caseList, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + caseList.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken(caseList, $1, comment.OpenCurlyBracesToken) @@ -1763,8 +1763,8 @@ switch_case_list: $$ = stmt.NewSwitch(nil, caseList) // save position - yylex.(*Parser).positions.AddPosition(caseList, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + caseList.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments yylex.(*Parser).comments.AddFromToken(caseList, $1, comment.OpenCurlyBracesToken) @@ -1779,8 +1779,8 @@ switch_case_list: $$ = stmt.NewAltSwitch(nil, caseList) // save position - yylex.(*Parser).positions.AddPosition(caseList, yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + caseList.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments yylex.(*Parser).comments.AddFromToken(caseList, $1, comment.ColonToken) @@ -1796,8 +1796,8 @@ switch_case_list: $$ = stmt.NewAltSwitch(nil, caseList) // save position - yylex.(*Parser).positions.AddPosition(caseList, yylex.(*Parser).positionBuilder.NewNodeListPosition($3)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5)) + caseList.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5)) // save comments yylex.(*Parser).comments.AddFromToken(caseList, $1, comment.ColonToken) @@ -1822,7 +1822,7 @@ case_list: $$ = append($1, _case) // save position - yylex.(*Parser).positions.AddPosition(_case, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $5)) + _case.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $5)) // save comments yylex.(*Parser).comments.AddFromToken(_case, $2, comment.CaseToken) @@ -1836,7 +1836,7 @@ case_list: $$ = append($1, _default) // save position - yylex.(*Parser).positions.AddPosition(_default, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $4)) + _default.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $4)) // save comments yylex.(*Parser).comments.AddFromToken(_default, $2, comment.DefaultToken) @@ -1863,7 +1863,7 @@ while_statement: $$ = stmt.NewWhile(nil, $1) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodePosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1873,8 +1873,8 @@ while_statement: $$ = stmt.NewAltWhile(nil, stmtList) // save position - yylex.(*Parser).positions.AddPosition(stmtList, yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + stmtList.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.ColonToken) @@ -1891,7 +1891,7 @@ if_stmt_without_else: $$ = stmt.NewIf($3, $5, nil, nil) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.IfToken) @@ -1906,8 +1906,8 @@ if_stmt_without_else: $$ = $1.(*stmt.If).AddElseIf(_elseIf) // save position - yylex.(*Parser).positions.AddPosition(_elseIf, yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $6)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $6)) + _elseIf.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $6)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $6)) // save comments yylex.(*Parser).comments.AddFromToken(_elseIf, $2, comment.ElseifToken) @@ -1931,8 +1931,8 @@ if_stmt: $$ = $1.(*stmt.If).SetElse(_else) // save position - yylex.(*Parser).positions.AddPosition(_else, yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $3)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + _else.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.ElseToken) @@ -1948,8 +1948,8 @@ alt_if_stmt_without_else: $$ = stmt.NewAltIf($3, stmts, nil, nil) // save position - yylex.(*Parser).positions.AddPosition(stmts, yylex.(*Parser).positionBuilder.NewNodeListPosition($6)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $6)) + stmts.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($6)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $6)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.IfToken) @@ -1966,8 +1966,8 @@ alt_if_stmt_without_else: $$ = $1.(*stmt.AltIf).AddElseIf(_elseIf) // save position - yylex.(*Parser).positions.AddPosition(stmts, yylex.(*Parser).positionBuilder.NewNodeListPosition($7)) - yylex.(*Parser).positions.AddPosition(_elseIf, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $7)) + stmts.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($7)) + _elseIf.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $7)) // save comments yylex.(*Parser).comments.AddFromToken(_elseIf, $2, comment.ElseifToken) @@ -1985,7 +1985,7 @@ alt_if_stmt: $$ = $1 // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.EndifToken) @@ -2000,9 +2000,9 @@ alt_if_stmt: $$ = $1.(*stmt.AltIf).SetElse(_else) // save position - yylex.(*Parser).positions.AddPosition(stmts, yylex.(*Parser).positionBuilder.NewNodeListPosition($4)) - yylex.(*Parser).positions.AddPosition(_else, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $4)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $6)) + stmts.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($4)) + _else.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $4)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $6)) // save comments yylex.(*Parser).comments.AddFromToken(_else, $2, comment.ElseToken) @@ -2055,16 +2055,16 @@ parameter: $$ = node.NewParameter($1, variable, nil, $2 != nil, $3 != nil) // save position - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) + identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($4)) + variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($4)) if $1 != nil { - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) } else if $2 != nil { - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($2, $4)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($2, $4)) } else if $3 != nil { - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($3, $4)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($3, $4)) } else { - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($4)) } // save comments @@ -2085,16 +2085,16 @@ parameter: $$ = node.NewParameter($1, variable, $6, $2 != nil, $3 != nil) // save position - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) + identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($4)) + variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($4)) if $1 != nil { - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $6)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $6)) } else if $2 != nil { - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $6)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $6)) } else if $3 != nil { - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $6)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $6)) } else { - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($4, $6)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($4, $6)) } // save comments @@ -2138,7 +2138,7 @@ type_expr: $$ = node.NewNullable($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.QuestionMarkToken) @@ -2153,7 +2153,7 @@ type: $$ = node.NewIdentifier($1.Value) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.ArrayToken) @@ -2165,7 +2165,7 @@ type: $$ = node.NewIdentifier($1.Value) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.CallableToken) @@ -2204,7 +2204,7 @@ argument_list: $$ = node.NewArgumentList(nil) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.OpenParenthesisToken) @@ -2217,7 +2217,7 @@ argument_list: $$ = node.NewArgumentList($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.OpenParenthesisToken) @@ -2254,7 +2254,7 @@ argument: $$ = node.NewArgument($1, false, false) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodePosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2263,7 +2263,7 @@ argument: $$ = node.NewArgument($2, true, false) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.EllipsisToken) @@ -2325,9 +2325,9 @@ static_var: $$ = stmt.NewStaticVar(variable, nil) // save position - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken(variable, $1, comment.VariableToken) @@ -2341,9 +2341,9 @@ static_var: $$ = stmt.NewStaticVar(variable, $3) // save position - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) + identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken(variable, $1, comment.VariableToken) @@ -2374,7 +2374,7 @@ class_statement: $$ = stmt.NewPropertyList($1, $2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $3, comment.SemiColonToken) @@ -2386,7 +2386,7 @@ class_statement: $$ = stmt.NewClassConstList($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewOptionalListTokensPosition($1, $2, $4)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewOptionalListTokensPosition($1, $2, $4)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.ConstToken) @@ -2409,7 +2409,7 @@ class_statement: $$ = stmt.NewTraitUse($2, adaptationList) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.UseToken) @@ -2422,11 +2422,11 @@ class_statement: $$ = stmt.NewClassMethod(name, $1, $3 != nil, $7, $9, $10, $5) // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($4)) if $1 == nil { - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $10)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $10)) } else { - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeListNodePosition($1, $10)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListNodePosition($1, $10)) } // save comments @@ -2465,7 +2465,7 @@ trait_adaptations: { $$ = stmt.NewNop() - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.SemiColonToken) @@ -2477,7 +2477,7 @@ trait_adaptations: { $$ = stmt.NewTraitAdaptationList(nil) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.OpenCurlyBracesToken) @@ -2489,7 +2489,7 @@ trait_adaptations: { $$ = stmt.NewTraitAdaptationList($2) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.OpenCurlyBracesToken) @@ -2541,7 +2541,7 @@ trait_precedence: $$ = stmt.NewTraitUsePrecedence($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeNodeListPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeNodeListPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.InsteadofToken) @@ -2557,8 +2557,8 @@ trait_alias: $$ = stmt.NewTraitUseAlias($1, nil, alias) // save position - yylex.(*Parser).positions.AddPosition(alias, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) + alias.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.AsToken) @@ -2572,8 +2572,8 @@ trait_alias: $$ = stmt.NewTraitUseAlias($1, nil, alias) // save position - yylex.(*Parser).positions.AddPosition(alias, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) + alias.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.AsToken) @@ -2587,8 +2587,8 @@ trait_alias: $$ = stmt.NewTraitUseAlias($1, $3, alias) // save position - yylex.(*Parser).positions.AddPosition(alias, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) + alias.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($4)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.AsToken) @@ -2601,7 +2601,7 @@ trait_alias: $$ = stmt.NewTraitUseAlias($1, $3, nil) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.AsToken) @@ -2617,8 +2617,8 @@ trait_method_reference: $$ = stmt.NewTraitMethodRef(nil, name) // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken(name, $1, comment.IdentifierToken) @@ -2640,8 +2640,8 @@ absolute_trait_method_reference: $$ = stmt.NewTraitMethodRef($1, target) // save position - yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) + target.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.PaamayimNekudotayimToken) @@ -2657,7 +2657,7 @@ method_body: $$ = stmt.NewNop() // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.SemiColonToken) @@ -2669,7 +2669,7 @@ method_body: $$ = stmt.NewStmtList($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.OpenCurlyBracesToken) @@ -2692,7 +2692,7 @@ variable_modifiers: $$ = []node.Node{modifier} // save position - yylex.(*Parser).positions.AddPosition(modifier, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + modifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken(modifier, $1, comment.VarToken) @@ -2737,7 +2737,7 @@ member_modifier: $$ = node.NewIdentifier($1.Value) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.PublicToken) @@ -2749,7 +2749,7 @@ member_modifier: $$ = node.NewIdentifier($1.Value) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.ProtectedToken) @@ -2761,7 +2761,7 @@ member_modifier: $$ = node.NewIdentifier($1.Value) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.PrivateToken) @@ -2773,7 +2773,7 @@ member_modifier: $$ = node.NewIdentifier($1.Value) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.StaticToken) @@ -2785,7 +2785,7 @@ member_modifier: $$ = node.NewIdentifier($1.Value) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.AbstractToken) @@ -2797,7 +2797,7 @@ member_modifier: $$ = node.NewIdentifier($1.Value) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.FinalToken) @@ -2832,9 +2832,9 @@ property: $$ = stmt.NewProperty(variable, nil, $2) // save position - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken(variable, $1, comment.VariableToken) @@ -2848,9 +2848,9 @@ property: $$ = stmt.NewProperty(variable, $3, $4) // save position - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) + identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken(variable, $1, comment.VariableToken) @@ -2885,8 +2885,8 @@ class_const_decl: $$ = stmt.NewConstant(name, $3, $4) // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken(name, $1, comment.IdentifierToken) @@ -2903,8 +2903,8 @@ const_decl: $$ = stmt.NewConstant(name, $3, $4) // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken(name, $1, comment.StringToken) @@ -2984,7 +2984,7 @@ anonymous_class: } // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $8)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $8)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.ClassToken) @@ -3000,10 +3000,10 @@ new_expr: { if $3 != nil { $$ = expr.NewNew($2, $3.(*node.ArgumentList)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) } else { $$ = expr.NewNew($2, nil) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) } // save comments @@ -3016,7 +3016,7 @@ new_expr: $$ = expr.NewNew($2, nil) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.NewToken) @@ -3032,8 +3032,8 @@ expr_without_variable: $$ = assign.NewAssign(list, $6) // save position - yylex.(*Parser).positions.AddPosition(list, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $6)) + list.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $6)) // save comments yylex.(*Parser).comments.AddFromToken(list, $1, comment.ListToken) @@ -3049,8 +3049,8 @@ expr_without_variable: $$ = assign.NewAssign(shortList, $5) // save position - yylex.(*Parser).positions.AddPosition(shortList, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5)) + shortList.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5)) // save comments yylex.(*Parser).comments.AddFromToken(shortList, $1, comment.OpenSquareBracket) @@ -3064,7 +3064,7 @@ expr_without_variable: $$ = assign.NewAssign($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.EqualToken) @@ -3076,7 +3076,7 @@ expr_without_variable: $$ = assign.NewReference($1, $4) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.EqualToken) @@ -3089,7 +3089,7 @@ expr_without_variable: $$ = expr.NewClone($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.CloneToken) @@ -3101,7 +3101,7 @@ expr_without_variable: $$ = assign.NewPlus($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.PlusEqualToken) @@ -3113,7 +3113,7 @@ expr_without_variable: $$ = assign.NewMinus($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.MinusEqualToken) @@ -3125,7 +3125,7 @@ expr_without_variable: $$ = assign.NewMul($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.MulEqualToken) @@ -3137,7 +3137,7 @@ expr_without_variable: $$ = assign.NewPow($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.PowEqualToken) @@ -3149,7 +3149,7 @@ expr_without_variable: $$ = assign.NewDiv($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.DivEqualToken) @@ -3161,7 +3161,7 @@ expr_without_variable: $$ = assign.NewConcat($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.ConcatEqualToken) @@ -3173,7 +3173,7 @@ expr_without_variable: $$ = assign.NewMod($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.ModEqualToken) @@ -3185,7 +3185,7 @@ expr_without_variable: $$ = assign.NewBitwiseAnd($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.AndEqualToken) @@ -3197,7 +3197,7 @@ expr_without_variable: $$ = assign.NewBitwiseOr($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.OrEqualToken) @@ -3209,7 +3209,7 @@ expr_without_variable: $$ = assign.NewBitwiseXor($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.XorEqualToken) @@ -3221,7 +3221,7 @@ expr_without_variable: $$ = assign.NewShiftLeft($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.SlEqualToken) @@ -3233,7 +3233,7 @@ expr_without_variable: $$ = assign.NewShiftRight($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.SrEqualToken) @@ -3245,7 +3245,7 @@ expr_without_variable: $$ = expr.NewPostInc($1) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.IncToken) @@ -3257,7 +3257,7 @@ expr_without_variable: $$ = expr.NewPreInc($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.IncToken) @@ -3269,7 +3269,7 @@ expr_without_variable: $$ = expr.NewPostDec($1) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.DecToken) @@ -3281,7 +3281,7 @@ expr_without_variable: $$ = expr.NewPreDec($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.DecToken) @@ -3293,7 +3293,7 @@ expr_without_variable: $$ = binary.NewBooleanOr($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.BooleanOrToken) @@ -3305,7 +3305,7 @@ expr_without_variable: $$ = binary.NewBooleanAnd($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.BooleanAndToken) @@ -3317,7 +3317,7 @@ expr_without_variable: $$ = binary.NewLogicalOr($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.LogicalOrToken) @@ -3329,7 +3329,7 @@ expr_without_variable: $$ = binary.NewLogicalAnd($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.LogicalAndToken) @@ -3341,7 +3341,7 @@ expr_without_variable: $$ = binary.NewLogicalXor($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.LogicalXorToken) @@ -3353,7 +3353,7 @@ expr_without_variable: $$ = binary.NewBitwiseOr($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.VerticalBarToken) @@ -3365,7 +3365,7 @@ expr_without_variable: $$ = binary.NewBitwiseAnd($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.AmpersandToken) @@ -3377,7 +3377,7 @@ expr_without_variable: $$ = binary.NewBitwiseXor($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.CaretToken) @@ -3389,7 +3389,7 @@ expr_without_variable: $$ = binary.NewConcat($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.DotToken) @@ -3401,7 +3401,7 @@ expr_without_variable: $$ = binary.NewPlus($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.PlusToken) @@ -3413,7 +3413,7 @@ expr_without_variable: $$ = binary.NewMinus($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.MinusToken) @@ -3425,7 +3425,7 @@ expr_without_variable: $$ = binary.NewMul($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.AsteriskToken) @@ -3437,7 +3437,7 @@ expr_without_variable: $$ = binary.NewPow($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.PowToken) @@ -3449,7 +3449,7 @@ expr_without_variable: $$ = binary.NewDiv($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.SlashToken) @@ -3461,7 +3461,7 @@ expr_without_variable: $$ = binary.NewMod($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.PercentToken) @@ -3473,7 +3473,7 @@ expr_without_variable: $$ = binary.NewShiftLeft($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.SlToken) @@ -3485,7 +3485,7 @@ expr_without_variable: $$ = binary.NewShiftRight($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.SrToken) @@ -3497,7 +3497,7 @@ expr_without_variable: $$ = expr.NewUnaryPlus($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.PlusToken) @@ -3509,7 +3509,7 @@ expr_without_variable: $$ = expr.NewUnaryMinus($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.MinusToken) @@ -3521,7 +3521,7 @@ expr_without_variable: $$ = expr.NewBooleanNot($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.ExclamationMarkToken) @@ -3533,7 +3533,7 @@ expr_without_variable: $$ = expr.NewBitwiseNot($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.TildeToken) @@ -3545,7 +3545,7 @@ expr_without_variable: $$ = binary.NewIdentical($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.IsIdenticalToken) @@ -3557,7 +3557,7 @@ expr_without_variable: $$ = binary.NewNotIdentical($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.IsNotIdenticalToken) @@ -3569,7 +3569,7 @@ expr_without_variable: $$ = binary.NewEqual($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.IsEqualToken) @@ -3581,7 +3581,7 @@ expr_without_variable: $$ = binary.NewNotEqual($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.IsNotEqualToken) @@ -3593,7 +3593,7 @@ expr_without_variable: $$ = binary.NewSmaller($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.LessToken) @@ -3605,7 +3605,7 @@ expr_without_variable: $$ = binary.NewSmallerOrEqual($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.IsSmallerOrEqualToken) @@ -3617,7 +3617,7 @@ expr_without_variable: $$ = binary.NewGreater($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.GreaterToken) @@ -3629,7 +3629,7 @@ expr_without_variable: $$ = binary.NewGreaterOrEqual($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.IsGreaterOrEqualToken) @@ -3641,7 +3641,7 @@ expr_without_variable: $$ = binary.NewSpaceship($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.SpaceshipToken) @@ -3653,7 +3653,7 @@ expr_without_variable: $$ = expr.NewInstanceOf($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.InstanceofToken) @@ -3681,7 +3681,7 @@ expr_without_variable: $$ = expr.NewTernary($1, $3, $5) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $5)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $5)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.QuestionMarkToken) @@ -3694,7 +3694,7 @@ expr_without_variable: $$ = expr.NewTernary($1, nil, $4) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.QuestionMarkToken) @@ -3707,7 +3707,7 @@ expr_without_variable: $$ = binary.NewCoalesce($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.CoalesceToken) @@ -3725,7 +3725,7 @@ expr_without_variable: $$ = cast.NewInt($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.IntCastToken) @@ -3737,7 +3737,7 @@ expr_without_variable: $$ = cast.NewDouble($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.DoubleCastToken) @@ -3749,7 +3749,7 @@ expr_without_variable: $$ = cast.NewString($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.StringCastToken) @@ -3761,7 +3761,7 @@ expr_without_variable: $$ = cast.NewArray($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.ArrayCastToken) @@ -3773,7 +3773,7 @@ expr_without_variable: $$ = cast.NewObject($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.ObjectCastToken) @@ -3785,7 +3785,7 @@ expr_without_variable: $$ = cast.NewBool($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.BoolCastToken) @@ -3797,7 +3797,7 @@ expr_without_variable: $$ = cast.NewUnset($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.UnsetCastToken) @@ -3820,9 +3820,9 @@ expr_without_variable: // save position if $2 == nil { - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) } else { - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) } // save comments @@ -3839,7 +3839,7 @@ expr_without_variable: $$ = expr.NewErrorSuppress($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.AtToken) @@ -3857,7 +3857,7 @@ expr_without_variable: $$ = expr.NewShellExec($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.BackquoteToken) @@ -3870,7 +3870,7 @@ expr_without_variable: $$ = expr.NewPrint($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.PrintToken) @@ -3882,7 +3882,7 @@ expr_without_variable: $$ = expr.NewYield(nil, nil) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.YieldToken) @@ -3894,7 +3894,7 @@ expr_without_variable: $$ = expr.NewYield(nil, $2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.YieldToken) @@ -3906,7 +3906,7 @@ expr_without_variable: $$ = expr.NewYield($2, $4) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $4)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $4)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.YieldToken) @@ -3919,7 +3919,7 @@ expr_without_variable: $$ = expr.NewYieldFrom($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.YieldFromToken) @@ -3931,7 +3931,7 @@ expr_without_variable: $$ = expr.NewClosure($5, $7, $8, $10, false, $2 != nil, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $11)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $11)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.FunctionToken) @@ -3950,7 +3950,7 @@ expr_without_variable: $$ = expr.NewClosure($6, $8, $9, $11, true, $3 != nil, $4) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $12)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $12)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.StaticToken) @@ -4000,7 +4000,7 @@ lexical_vars: $$ = expr.NewClosureUse($3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.UseToken) @@ -4036,8 +4036,8 @@ lexical_var: $$ = expr.NewVariable(identifier) // save position - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.VariableToken) @@ -4051,9 +4051,9 @@ lexical_var: $$ = expr.NewReference(variable) // save position - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) + identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) + variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.AmpersandToken) @@ -4069,7 +4069,7 @@ function_call: $$ = expr.NewFunctionCall($1, $2.(*node.ArgumentList)) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $2)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4078,7 +4078,7 @@ function_call: $$ = expr.NewStaticCall($1, $3, $4.(*node.ArgumentList)) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.PaamayimNekudotayimToken) @@ -4090,7 +4090,7 @@ function_call: $$ = expr.NewStaticCall($1, $3, $4.(*node.ArgumentList)) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.PaamayimNekudotayimToken) @@ -4102,7 +4102,7 @@ function_call: $$ = expr.NewFunctionCall($1, $2.(*node.ArgumentList)) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $2)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4114,7 +4114,7 @@ class_name: $$ = node.NewIdentifier($1.Value) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.StaticToken) @@ -4156,7 +4156,7 @@ exit_expr: $$ = expr.NewExit($2); // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.OpenParenthesisToken) @@ -4208,7 +4208,7 @@ dereferencable_scalar: $$ = expr.NewArray($3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.ArrayToken) @@ -4222,7 +4222,7 @@ dereferencable_scalar: $$ = expr.NewShortArray($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.OpenSquareBracket) @@ -4235,7 +4235,7 @@ dereferencable_scalar: $$ = scalar.NewString($1.Value) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.ConstantEncapsedStringToken) @@ -4250,7 +4250,7 @@ scalar: $$ = scalar.NewLnumber($1.Value) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.LnumberToken) @@ -4262,7 +4262,7 @@ scalar: $$ = scalar.NewDnumber($1.Value) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.DnumberToken) @@ -4274,7 +4274,7 @@ scalar: $$ = scalar.NewMagicConstant($1.Value) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.LineToken) @@ -4286,7 +4286,7 @@ scalar: $$ = scalar.NewMagicConstant($1.Value) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.FileToken) @@ -4298,7 +4298,7 @@ scalar: $$ = scalar.NewMagicConstant($1.Value) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.DirToken) @@ -4310,7 +4310,7 @@ scalar: $$ = scalar.NewMagicConstant($1.Value) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.TraitCToken) @@ -4322,7 +4322,7 @@ scalar: $$ = scalar.NewMagicConstant($1.Value) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.MethodCToken) @@ -4334,7 +4334,7 @@ scalar: $$ = scalar.NewMagicConstant($1.Value) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.FuncCToken) @@ -4346,7 +4346,7 @@ scalar: $$ = scalar.NewMagicConstant($1.Value) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.NsCToken) @@ -4358,7 +4358,7 @@ scalar: $$ = scalar.NewMagicConstant($1.Value) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.ClassCToken) @@ -4371,8 +4371,8 @@ scalar: $$ = scalar.NewHeredoc($1.Value, []node.Node{encapsed}) // save position - yylex.(*Parser).positions.AddPosition(encapsed, yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + encapsed.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.StartHeredocToken) @@ -4384,7 +4384,7 @@ scalar: $$ = scalar.NewHeredoc($1.Value, nil) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.StartHeredocToken) @@ -4396,7 +4396,7 @@ scalar: $$ = scalar.NewEncapsed($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.DoubleQuoteToken) @@ -4408,7 +4408,7 @@ scalar: $$ = scalar.NewHeredoc($1.Value, $2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.StartHeredocToken) @@ -4435,7 +4435,7 @@ constant: $$ = expr.NewConstFetch($1) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodePosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4445,8 +4445,8 @@ constant: $$ = expr.NewClassConstFetch($1, target) // save position - yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) + target.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.PaamayimNekudotayimToken) @@ -4460,8 +4460,8 @@ constant: $$ = expr.NewClassConstFetch($1, target) // save position - yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) + target.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.PaamayimNekudotayimToken) @@ -4572,7 +4572,7 @@ callable_variable: $$ = expr.NewArrayDimFetch($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenSquareBracket) @@ -4585,7 +4585,7 @@ callable_variable: $$ = expr.NewArrayDimFetch($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenSquareBracket) @@ -4598,7 +4598,7 @@ callable_variable: $$ = expr.NewArrayDimFetch($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenCurlyBracesToken) @@ -4611,7 +4611,7 @@ callable_variable: $$ = expr.NewMethodCall($1, $3, $4.(*node.ArgumentList)) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.ObjectOperatorToken) @@ -4644,7 +4644,7 @@ variable: $$ = expr.NewPropertyFetch($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.ObjectOperatorToken) @@ -4660,8 +4660,8 @@ simple_variable: $$ = expr.NewVariable(name) // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.VariableToken) @@ -4673,7 +4673,7 @@ simple_variable: $$ = expr.NewVariable($3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.DollarToken) @@ -4687,7 +4687,7 @@ simple_variable: $$ = expr.NewVariable($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.DollarToken) @@ -4702,7 +4702,7 @@ static_member: $$ = expr.NewStaticPropertyFetch($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.PaamayimNekudotayimToken) @@ -4714,7 +4714,7 @@ static_member: $$ = expr.NewStaticPropertyFetch($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.PaamayimNekudotayimToken) @@ -4735,7 +4735,7 @@ new_variable: $$ = expr.NewArrayDimFetch($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenSquareBracket) @@ -4748,7 +4748,7 @@ new_variable: $$ = expr.NewArrayDimFetch($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenCurlyBracesToken) @@ -4761,7 +4761,7 @@ new_variable: $$ = expr.NewPropertyFetch($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.ObjectOperatorToken) @@ -4773,7 +4773,7 @@ new_variable: $$ = expr.NewStaticPropertyFetch($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.PaamayimNekudotayimToken) @@ -4785,7 +4785,7 @@ new_variable: $$ = expr.NewStaticPropertyFetch($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.PaamayimNekudotayimToken) @@ -4800,7 +4800,7 @@ member_name: $$ = node.NewIdentifier($1.Value) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.IdentifierToken) @@ -4831,7 +4831,7 @@ property_name: $$ = node.NewIdentifier($1.Value) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.StringToken) @@ -4908,7 +4908,7 @@ array_pair: $$ = expr.NewArrayItem($1, $3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.DoubleArrowToken) @@ -4920,7 +4920,7 @@ array_pair: $$ = expr.NewArrayItem(nil, $1) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodePosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4930,7 +4930,8 @@ array_pair: $$ = expr.NewArrayItem($1, reference) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) + reference.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $4)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.DoubleArrowToken) @@ -4944,7 +4945,8 @@ array_pair: $$ = expr.NewArrayItem(nil, reference) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + reference.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken(reference, $1, comment.AmpersandToken) @@ -4958,8 +4960,8 @@ array_pair: $$ = expr.NewArrayItem($1, list) // save position - yylex.(*Parser).positions.AddPosition(list, yylex.(*Parser).positionBuilder.NewTokensPosition($3, $6)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $6)) + list.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($3, $6)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $6)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.DoubleArrowToken) @@ -4976,8 +4978,8 @@ array_pair: $$ = expr.NewArrayItem(nil, list) // save position - yylex.(*Parser).positions.AddPosition(list, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + list.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments yylex.(*Parser).comments.AddFromToken(list, $1, comment.ListToken) @@ -5001,7 +5003,7 @@ encaps_list: $$ = append($1, encapsed) // save position - yylex.(*Parser).positions.AddPosition(encapsed, yylex.(*Parser).positionBuilder.NewTokenPosition($2)) + encapsed.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) // save comments yylex.(*Parser).comments.AddFromToken(encapsed, $2, comment.EncapsedAndWhitespaceToken) @@ -5020,7 +5022,7 @@ encaps_list: $$ = []node.Node{encapsed, $2} // save position - yylex.(*Parser).positions.AddPosition(encapsed, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + encapsed.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken(encapsed, $1, comment.EncapsedAndWhitespaceToken) @@ -5036,8 +5038,8 @@ encaps_var: $$ = expr.NewVariable(name) // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.VariableToken) @@ -5051,9 +5053,9 @@ encaps_var: $$ = expr.NewArrayDimFetch(variable, $3) // save position - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments yylex.(*Parser).comments.AddFromToken(variable, $1, comment.VariableToken) @@ -5070,10 +5072,10 @@ encaps_var: $$ = expr.NewPropertyFetch(variable, fetch) // save position - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + fetch.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken(variable, $1, comment.VariableToken) @@ -5087,7 +5089,7 @@ encaps_var: $$ = expr.NewVariable($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.DollarOpenCurlyBracesToken) @@ -5101,8 +5103,8 @@ encaps_var: $$ = expr.NewVariable(name) // save position - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.DollarOpenCurlyBracesToken) @@ -5118,9 +5120,9 @@ encaps_var: $$ = expr.NewArrayDimFetch(variable, $4) // save position - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $6)) + identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) + variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $6)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.DollarOpenCurlyBracesToken) @@ -5145,7 +5147,7 @@ encaps_var_offset: $$ = scalar.NewString($1.Value) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.StringToken) @@ -5162,7 +5164,7 @@ encaps_var_offset: } // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.NumStringToken) @@ -5186,9 +5188,9 @@ encaps_var_offset: // save position if isInt { - yylex.(*Parser).positions.AddPosition(lnumber, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) + lnumber.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) } - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.MinusToken) @@ -5206,8 +5208,8 @@ encaps_var_offset: $$ = expr.NewVariable(identifier) // save position - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.VariableToken) @@ -5222,7 +5224,7 @@ internal_functions_in_yacc: $$ = expr.NewIsset($3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.IssetToken) @@ -5239,7 +5241,7 @@ internal_functions_in_yacc: $$ = expr.NewEmpty($3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.EmptyToken) @@ -5253,7 +5255,7 @@ internal_functions_in_yacc: $$ = expr.NewInclude($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.IncludeToken) @@ -5265,7 +5267,7 @@ internal_functions_in_yacc: $$ = expr.NewIncludeOnce($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.IncludeOnceToken) @@ -5277,7 +5279,7 @@ internal_functions_in_yacc: $$ = expr.NewEval($3) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.EvalToken) @@ -5291,7 +5293,7 @@ internal_functions_in_yacc: $$ = expr.NewRequire($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.RequireToken) @@ -5303,7 +5305,7 @@ internal_functions_in_yacc: $$ = expr.NewRequireOnce($2) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.RequireOnceToken) diff --git a/php7/php7_test.go b/php7/php7_test.go index b466d4e..ec20ae1 100644 --- a/php7/php7_test.go +++ b/php7/php7_test.go @@ -12,9 +12,9 @@ import ( "github.com/z7zmey/php-parser/node/expr/cast" "github.com/z7zmey/php-parser/node/name" "github.com/z7zmey/php-parser/node/scalar" - "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node/stmt" + "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/php7" ) @@ -381,1109 +381,6431 @@ func TestPhp7(t *testing.T) { [1=>&$a, 2=>list($b)]; ` - expectedParams := []node.Node{ - &node.Parameter{ - ByRef: false, - Variadic: false, - VariableType: &node.Nullable{Expr: &name.Name{Parts: []node.Node{&name.NamePart{Value: "bar"}}}}, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "bar"}}, - DefaultValue: &expr.ConstFetch{Constant: &name.Name{Parts: []node.Node{&name.NamePart{Value: "null"}}}}, - }, - &node.Parameter{ - ByRef: true, - Variadic: true, - VariableType: &name.Name{Parts: []node.Node{&name.NamePart{Value: "baz"}}}, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "baz"}}, - }, - } - expected := &node.Root{ + Position: &position.Position{ + StartLine: 2, + EndLine: 347, + StartPos: 6, + EndPos: 6318, + }, Stmts: []node.Node{ &stmt.Expression{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 6, + EndPos: 20, + }, Expr: &expr.FunctionCall{ - Function: &name.Name{Parts: []node.Node{&name.NamePart{Value: "foo"}}}, - ArgumentList: &node.ArgumentList{ - Arguments: []node.Node{ - &node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, - &node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, - }, + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 6, + EndPos: 19, }, - }, - }, - &stmt.Expression{ - Expr: &expr.FunctionCall{ - Function: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, - ArgumentList: &node.ArgumentList{ - Arguments: []node.Node{ - &node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, - &node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + Function: &name.Name{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 6, + EndPos: 8, }, - }, - }, - }, - &stmt.Expression{ - Expr: &expr.MethodCall{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, - Method: &node.Identifier{Value: "bar"}, - ArgumentList: &node.ArgumentList{ - Arguments: []node.Node{ - &node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, - &node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, - }, - }, - }, - }, - &stmt.Expression{ - Expr: &expr.StaticCall{ - Class: &name.Name{Parts: []node.Node{&name.NamePart{Value: "foo"}}}, - Call: &node.Identifier{Value: "bar"}, - ArgumentList: &node.ArgumentList{ - Arguments: []node.Node{ - &node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, - &node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, - }, - }, - }, - }, - &stmt.Expression{ - Expr: &expr.StaticCall{ - Class: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, - Call: &node.Identifier{Value: "bar"}, - ArgumentList: &node.ArgumentList{ - Arguments: []node.Node{ - &node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, - &node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, - }, - }, - }, - }, - &stmt.Expression{ - Expr: &expr.New{ - Class: &name.Name{Parts: []node.Node{&name.NamePart{Value: "foo"}}}, - ArgumentList: &node.ArgumentList{ - Arguments: []node.Node{ - &node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, - &node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, - }, - }, - }, - }, - &stmt.Expression{ - Expr: &expr.New{ - Class: &stmt.Class{ - PhpDocComment: "/** anonymous class */", - ArgumentList: &node.ArgumentList{ - Arguments: []node.Node{ - &node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, - &node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 6, + EndPos: 8, + }, + Value: "foo", + }, + }, + }, + ArgumentList: &node.ArgumentList{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 9, + EndPos: 19, + }, + Arguments: []node.Node{ + &node.Argument{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 10, + EndPos: 11, + }, + Variadic: false, + IsReference: false, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 10, + EndPos: 11, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 10, + EndPos: 11, + }, + Value: "a", + }, + }, + }, + &node.Argument{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 14, + EndPos: 18, + }, + IsReference: false, + Variadic: true, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 17, + EndPos: 18, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 17, + EndPos: 18, + }, + Value: "b", + }, + }, }, }, - Stmts: []node.Node{}, }, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 3, + EndLine: 3, + StartPos: 24, + EndPos: 39, + }, + Expr: &expr.FunctionCall{ + Position: &position.Position{ + StartLine: 3, + EndLine: 3, + StartPos: 24, + EndPos: 38, + }, + Function: &expr.Variable{ + Position: &position.Position{ + StartLine: 3, + EndLine: 3, + StartPos: 24, + EndPos: 27, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 3, + EndLine: 3, + StartPos: 24, + EndPos: 27, + }, + Value: "foo", + }, + }, + ArgumentList: &node.ArgumentList{ + Position: &position.Position{ + StartLine: 3, + EndLine: 3, + StartPos: 28, + EndPos: 38, + }, + Arguments: []node.Node{ + &node.Argument{ + Position: &position.Position{ + StartLine: 3, + EndLine: 3, + StartPos: 29, + EndPos: 30, + }, + Variadic: false, + IsReference: false, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 3, + EndLine: 3, + StartPos: 29, + EndPos: 30, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 3, + EndLine: 3, + StartPos: 29, + EndPos: 30, + }, + Value: "a", + }, + }, + }, + &node.Argument{ + Position: &position.Position{ + StartLine: 3, + EndLine: 3, + StartPos: 33, + EndPos: 37, + }, + Variadic: true, + IsReference: false, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 3, + EndLine: 3, + StartPos: 36, + EndPos: 37, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 3, + EndLine: 3, + StartPos: 36, + EndPos: 37, + }, + Value: "b", + }, + }, + }, + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 43, + EndPos: 63, + }, + Expr: &expr.MethodCall{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 43, + EndPos: 62, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 43, + EndPos: 46, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 43, + EndPos: 46, + }, + Value: "foo", + }, + }, + Method: &node.Identifier{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 49, + EndPos: 51, + }, + Value: "bar", + }, + ArgumentList: &node.ArgumentList{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 52, + EndPos: 62, + }, + Arguments: []node.Node{ + &node.Argument{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 53, + EndPos: 54, + }, + Variadic: false, + IsReference: false, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 53, + EndPos: 54, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 53, + EndPos: 54, + }, + Value: "a", + }, + }, + }, + &node.Argument{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 57, + EndPos: 61, + }, + Variadic: true, + IsReference: false, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 60, + EndPos: 61, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 60, + EndPos: 61, + }, + Value: "b", + }, + }, + }, + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 67, + EndPos: 86, + }, + Expr: &expr.StaticCall{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 67, + EndPos: 85, + }, + Class: &name.Name{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 67, + EndPos: 69, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 67, + EndPos: 69, + }, + Value: "foo", + }, + }, + }, + Call: &node.Identifier{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 72, + EndPos: 74, + }, + Value: "bar", + }, + ArgumentList: &node.ArgumentList{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 75, + EndPos: 85, + }, + Arguments: []node.Node{ + &node.Argument{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 76, + EndPos: 77, + }, + Variadic: false, + IsReference: false, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 76, + EndPos: 77, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 76, + EndPos: 77, + }, + Value: "a", + }, + }, + }, + &node.Argument{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 80, + EndPos: 84, + }, + Variadic: true, + IsReference: false, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 83, + EndPos: 84, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 83, + EndPos: 84, + }, + Value: "b", + }, + }, + }, + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 90, + EndPos: 110, + }, + Expr: &expr.StaticCall{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 90, + EndPos: 109, + }, + Class: &expr.Variable{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 90, + EndPos: 93, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 90, + EndPos: 93, + }, + Value: "foo", + }, + }, + Call: &node.Identifier{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 96, + EndPos: 98, + }, + Value: "bar", + }, + ArgumentList: &node.ArgumentList{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 99, + EndPos: 109, + }, + Arguments: []node.Node{ + &node.Argument{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 100, + EndPos: 101, + }, + IsReference: false, + Variadic: false, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 100, + EndPos: 101, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 100, + EndPos: 101, + }, + Value: "a", + }, + }, + }, + &node.Argument{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 104, + EndPos: 108, + }, + Variadic: true, + IsReference: false, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 107, + EndPos: 108, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 107, + EndPos: 108, + }, + Value: "b", + }, + }, + }, + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 114, + EndPos: 132, + }, Expr: &expr.New{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 114, + EndPos: 131, + }, + Class: &name.Name{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 118, + EndPos: 120, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 118, + EndPos: 120, + }, + Value: "foo", + }, + }, + }, + ArgumentList: &node.ArgumentList{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 121, + EndPos: 131, + }, + Arguments: []node.Node{ + &node.Argument{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 122, + EndPos: 123, + }, + Variadic: false, + IsReference: false, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 122, + EndPos: 123, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 122, + EndPos: 123, + }, + Value: "a", + }, + }, + }, + &node.Argument{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 126, + EndPos: 130, + }, + Variadic: true, + IsReference: false, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 129, + EndPos: 130, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 129, + EndPos: 130, + }, + Value: "b", + }, + }, + }, + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 161, + EndPos: 185, + }, + Expr: &expr.New{ + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 161, + EndPos: 184, + }, Class: &stmt.Class{ + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 165, + EndPos: 184, + }, + PhpDocComment: "/** anonymous class */", + ArgumentList: &node.ArgumentList{ + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 171, + EndPos: 181, + }, + Arguments: []node.Node{ + &node.Argument{ + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 172, + EndPos: 173, + }, + Variadic: false, + IsReference: false, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 172, + EndPos: 173, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 172, + EndPos: 173, + }, + Value: "a", + }, + }, + }, + &node.Argument{ + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 176, + EndPos: 180, + }, + Variadic: true, + IsReference: false, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 179, + EndPos: 180, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 179, + EndPos: 180, + }, + Value: "b", + }, + }, + }, + }, + }, + Stmts: []node.Node{ + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 10, + EndLine: 10, + StartPos: 189, + EndPos: 201, + }, + Expr: &expr.New{ + Position: &position.Position{ + StartLine: 10, + EndLine: 10, + StartPos: 189, + EndPos: 200, + }, + Class: &stmt.Class{ + Position: &position.Position{ + StartLine: 10, + EndLine: 10, + StartPos: 193, + EndPos: 200, + }, PhpDocComment: "", - Stmts: []node.Node{}, + Stmts: []node.Node{ + }, }, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 11, + EndLine: 11, + StartPos: 205, + EndPos: 213, + }, Expr: &expr.New{ - Class: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, + Position: &position.Position{ + StartLine: 11, + EndLine: 11, + StartPos: 205, + EndPos: 212, + }, + Class: &expr.Variable{ + Position: &position.Position{ + StartLine: 11, + EndLine: 11, + StartPos: 209, + EndPos: 212, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 11, + EndLine: 11, + StartPos: 209, + EndPos: 212, + }, + Value: "foo", + }, + }, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 12, + EndLine: 12, + StartPos: 217, + EndPos: 228, + }, Expr: &expr.New{ + Position: &position.Position{ + StartLine: 12, + EndLine: 12, + StartPos: 217, + EndPos: 227, + }, Class: &expr.ArrayDimFetch{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, - Dim: &scalar.Lnumber{Value: "1"}, + Position: &position.Position{ + StartLine: 12, + EndLine: 12, + StartPos: 221, + EndPos: 227, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 12, + EndLine: 12, + StartPos: 221, + EndPos: 224, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 12, + EndLine: 12, + StartPos: 221, + EndPos: 224, + }, + Value: "foo", + }, + }, + Dim: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 12, + EndLine: 12, + StartPos: 226, + EndPos: 226, + }, + Value: "1", + }, }, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 13, + EndLine: 13, + StartPos: 232, + EndPos: 246, + }, Expr: &expr.New{ + Position: &position.Position{ + StartLine: 13, + EndLine: 13, + StartPos: 232, + EndPos: 245, + }, Class: &expr.ArrayDimFetch{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, - Dim: &expr.Variable{VarName: &node.Identifier{Value: "bar"}}, + Position: &position.Position{ + StartLine: 13, + EndLine: 13, + StartPos: 236, + EndPos: 245, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 13, + EndLine: 13, + StartPos: 236, + EndPos: 239, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 13, + EndLine: 13, + StartPos: 236, + EndPos: 239, + }, + Value: "foo", + }, + }, + Dim: &expr.Variable{ + Position: &position.Position{ + StartLine: 13, + EndLine: 13, + StartPos: 241, + EndPos: 244, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 13, + EndLine: 13, + StartPos: 241, + EndPos: 244, + }, + Value: "bar", + }, + }, }, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 14, + EndLine: 14, + StartPos: 250, + EndPos: 263, + }, Expr: &expr.New{ + Position: &position.Position{ + StartLine: 14, + EndLine: 14, + StartPos: 250, + EndPos: 262, + }, Class: &expr.PropertyFetch{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, - Property: &node.Identifier{Value: "bar"}, + Position: &position.Position{ + StartLine: 14, + EndLine: 14, + StartPos: 254, + EndPos: 262, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 14, + EndLine: 14, + StartPos: 254, + EndPos: 257, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 14, + EndLine: 14, + StartPos: 254, + EndPos: 257, + }, + Value: "foo", + }, + }, + Property: &node.Identifier{ + Position: &position.Position{ + StartLine: 14, + EndLine: 14, + StartPos: 260, + EndPos: 262, + }, + Value: "bar", + }, }, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 15, + EndLine: 15, + StartPos: 267, + EndPos: 281, + }, Expr: &expr.New{ + Position: &position.Position{ + StartLine: 15, + EndLine: 15, + StartPos: 267, + EndPos: 280, + }, Class: &expr.StaticPropertyFetch{ - Class: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, - Property: &expr.Variable{VarName: &node.Identifier{Value: "bar"}}, + Position: &position.Position{ + StartLine: 15, + EndLine: 15, + StartPos: 271, + EndPos: 280, + }, + Class: &expr.Variable{ + Position: &position.Position{ + StartLine: 15, + EndLine: 15, + StartPos: 271, + EndPos: 274, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 15, + EndLine: 15, + StartPos: 271, + EndPos: 274, + }, + Value: "foo", + }, + }, + Property: &expr.Variable{ + Position: &position.Position{ + StartLine: 15, + EndLine: 15, + StartPos: 277, + EndPos: 280, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 15, + EndLine: 15, + StartPos: 277, + EndPos: 280, + }, + Value: "bar", + }, + }, }, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 16, + EndLine: 16, + StartPos: 285, + EndPos: 301, + }, Expr: &expr.New{ + Position: &position.Position{ + StartLine: 16, + EndLine: 16, + StartPos: 285, + EndPos: 300, + }, Class: &expr.StaticPropertyFetch{ - Class: &node.Identifier{Value: "static"}, - Property: &expr.Variable{VarName: &node.Identifier{Value: "bar"}}, + Position: &position.Position{ + StartLine: 16, + EndLine: 16, + StartPos: 289, + EndPos: 300, + }, + Class: &node.Identifier{ + Position: &position.Position{ + StartLine: 16, + EndLine: 16, + StartPos: 289, + EndPos: 294, + }, + Value: "static", + }, + Property: &expr.Variable{ + Position: &position.Position{ + StartLine: 16, + EndLine: 16, + StartPos: 297, + EndPos: 300, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 16, + EndLine: 16, + StartPos: 297, + EndPos: 300, + }, + Value: "bar", + }, + }, }, }, }, &stmt.Function{ - ReturnsRef: false, + Position: &position.Position{ + StartLine: 18, + EndLine: 18, + StartPos: 306, + EndPos: 350, + }, PhpDocComment: "", - FunctionName: &node.Identifier{Value: "foo"}, - Params: expectedParams, - Stmts: []node.Node{}, + ReturnsRef: false, + FunctionName: &node.Identifier{ + Position: &position.Position{ + StartLine: 18, + EndLine: 18, + StartPos: 315, + EndPos: 317, + }, + Value: "foo", + }, + Params: []node.Node{ + &node.Parameter{ + Position: &position.Position{ + StartLine: 18, + EndLine: 18, + StartPos: 319, + EndPos: 332, + }, + ByRef: false, + Variadic: false, + VariableType: &node.Nullable{ + Position: &position.Position{ + StartLine: 18, + EndLine: 18, + StartPos: 319, + EndPos: 322, + }, + Expr: &name.Name{ + Position: &position.Position{ + StartLine: 18, + EndLine: 18, + StartPos: 320, + EndPos: 322, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 18, + EndLine: 18, + StartPos: 320, + EndPos: 322, + }, + Value: "bar", + }, + }, + }, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 18, + EndLine: 18, + StartPos: 324, + EndPos: 327, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 18, + EndLine: 18, + StartPos: 324, + EndPos: 327, + }, + Value: "bar", + }, + }, + DefaultValue: &expr.ConstFetch{ + Position: &position.Position{ + StartLine: 18, + EndLine: 18, + StartPos: 329, + EndPos: 332, + }, + Constant: &name.Name{ + Position: &position.Position{ + StartLine: 18, + EndLine: 18, + StartPos: 329, + EndPos: 332, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 18, + EndLine: 18, + StartPos: 329, + EndPos: 332, + }, + Value: "null", + }, + }, + }, + }, + }, + &node.Parameter{ + Position: &position.Position{ + StartLine: 18, + EndLine: 18, + StartPos: 335, + EndPos: 346, + }, + ByRef: true, + Variadic: true, + VariableType: &name.Name{ + Position: &position.Position{ + StartLine: 18, + EndLine: 18, + StartPos: 335, + EndPos: 337, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 18, + EndLine: 18, + StartPos: 335, + EndPos: 337, + }, + Value: "baz", + }, + }, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 18, + EndLine: 18, + StartPos: 343, + EndPos: 346, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 18, + EndLine: 18, + StartPos: 343, + EndPos: 346, + }, + Value: "baz", + }, + }, + }, + }, + Stmts: []node.Node{ + }, }, &stmt.Class{ - ClassName: &node.Identifier{Value: "foo"}, + Position: &position.Position{ + StartLine: 19, + EndLine: 19, + StartPos: 354, + EndPos: 417, + }, + PhpDocComment: "", + ClassName: &node.Identifier{ + Position: &position.Position{ + StartLine: 19, + EndLine: 19, + StartPos: 360, + EndPos: 362, + }, + Value: "foo", + }, Stmts: []node.Node{ &stmt.ClassMethod{ - MethodName: &node.Identifier{Value: "foo"}, - Modifiers: []node.Node{&node.Identifier{Value: "public"}}, - Params: expectedParams, + Position: &position.Position{ + StartLine: 19, + EndLine: 19, + StartPos: 365, + EndPos: 416, + }, + PhpDocComment: "", + ReturnsRef: false, + MethodName: &node.Identifier{ + Position: &position.Position{ + StartLine: 19, + EndLine: 19, + StartPos: 381, + EndPos: 383, + }, + Value: "foo", + }, + Modifiers: []node.Node{ + &node.Identifier{ + Position: &position.Position{ + StartLine: 19, + EndLine: 19, + StartPos: 365, + EndPos: 370, + }, + Value: "public", + }, + }, + Params: []node.Node{ + &node.Parameter{ + Position: &position.Position{ + StartLine: 19, + EndLine: 19, + StartPos: 385, + EndPos: 398, + }, + ByRef: false, + Variadic: false, + VariableType: &node.Nullable{ + Position: &position.Position{ + StartLine: 19, + EndLine: 19, + StartPos: 385, + EndPos: 388, + }, + Expr: &name.Name{ + Position: &position.Position{ + StartLine: 19, + EndLine: 19, + StartPos: 386, + EndPos: 388, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 19, + EndLine: 19, + StartPos: 386, + EndPos: 388, + }, + Value: "bar", + }, + }, + }, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 19, + EndLine: 19, + StartPos: 390, + EndPos: 393, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 19, + EndLine: 19, + StartPos: 390, + EndPos: 393, + }, + Value: "bar", + }, + }, + DefaultValue: &expr.ConstFetch{ + Position: &position.Position{ + StartLine: 19, + EndLine: 19, + StartPos: 395, + EndPos: 398, + }, + Constant: &name.Name{ + Position: &position.Position{ + StartLine: 19, + EndLine: 19, + StartPos: 395, + EndPos: 398, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 19, + EndLine: 19, + StartPos: 395, + EndPos: 398, + }, + Value: "null", + }, + }, + }, + }, + }, + &node.Parameter{ + Position: &position.Position{ + StartLine: 19, + EndLine: 19, + StartPos: 401, + EndPos: 412, + }, + ByRef: true, + Variadic: true, + VariableType: &name.Name{ + Position: &position.Position{ + StartLine: 19, + EndLine: 19, + StartPos: 401, + EndPos: 403, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 19, + EndLine: 19, + StartPos: 401, + EndPos: 403, + }, + Value: "baz", + }, + }, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 19, + EndLine: 19, + StartPos: 409, + EndPos: 412, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 19, + EndLine: 19, + StartPos: 409, + EndPos: 412, + }, + Value: "baz", + }, + }, + }, + }, Stmt: &stmt.StmtList{ - Stmts: []node.Node{}, - }, - }, - }, - }, - &stmt.Expression{ - Expr: &expr.Closure{ - Params: expectedParams, - Stmts: []node.Node{}, - }, - }, - &stmt.Expression{ - Expr: &expr.Closure{ - Static: true, - Params: expectedParams, - Stmts: []node.Node{}, - }, - }, - &stmt.Expression{ - Expr: &scalar.Lnumber{Value: "1234567890123456789"}, - }, - &stmt.Expression{ - Expr: &scalar.Dnumber{Value: "12345678901234567890"}, - }, - &stmt.Expression{ - Expr: &scalar.Dnumber{Value: "0."}, - }, - &stmt.Expression{ - Expr: &scalar.Lnumber{Value: "0b0111111111111111111111111111111111111111111111111111111111111111"}, - }, - &stmt.Expression{ - Expr: &scalar.Dnumber{Value: "0b1111111111111111111111111111111111111111111111111111111111111111"}, - }, - &stmt.Expression{ - Expr: &scalar.Lnumber{Value: "0x007111111111111111"}, - }, - &stmt.Expression{ - Expr: &scalar.Dnumber{Value: "0x8111111111111111"}, - }, - - &stmt.Expression{ - Expr: &scalar.MagicConstant{Value: "__CLASS__"}, - }, - &stmt.Expression{ - Expr: &scalar.MagicConstant{Value: "__DIR__"}, - }, - &stmt.Expression{ - Expr: &scalar.MagicConstant{Value: "__FILE__"}, - }, - &stmt.Expression{ - Expr: &scalar.MagicConstant{Value: "__FUNCTION__"}, - }, - &stmt.Expression{ - Expr: &scalar.MagicConstant{Value: "__LINE__"}, - }, - &stmt.Expression{ - Expr: &scalar.MagicConstant{Value: "__NAMESPACE__"}, - }, - &stmt.Expression{ - Expr: &scalar.MagicConstant{Value: "__METHOD__"}, - }, - &stmt.Expression{ - Expr: &scalar.MagicConstant{Value: "__TRAIT__"}, - }, - - &stmt.Expression{ - Expr: &scalar.Encapsed{ - Parts: []node.Node{ - &scalar.EncapsedStringPart{Value: "test "}, - &expr.Variable{VarName: &node.Identifier{Value: "var"}}, - }, - }, - }, - &stmt.Expression{ - Expr: &scalar.Encapsed{ - Parts: []node.Node{ - &scalar.EncapsedStringPart{Value: "test "}, - &expr.ArrayDimFetch{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, - Dim: &scalar.Lnumber{Value: "1"}, - }, - }, - }, - }, - &stmt.Expression{ - Expr: &scalar.Encapsed{ - Parts: []node.Node{ - &scalar.EncapsedStringPart{Value: "test "}, - &expr.ArrayDimFetch{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, - Dim: &expr.UnaryMinus{ - Expr: &scalar.Lnumber{Value: "1"}, + Position: &position.Position{ + StartLine: 19, + EndLine: 19, + StartPos: 415, + EndPos: 416, + }, + Stmts: []node.Node{ }, }, }, }, }, &stmt.Expression{ - Expr: &scalar.Encapsed{ - Parts: []node.Node{ - &scalar.EncapsedStringPart{Value: "test "}, - &expr.ArrayDimFetch{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, - Dim: &scalar.String{Value: "1234567890123456789012345678901234567890"}, + Position: &position.Position{ + StartLine: 20, + EndLine: 20, + StartPos: 421, + EndPos: 462, + }, + Expr: &expr.Closure{ + Position: &position.Position{ + StartLine: 20, + EndLine: 20, + StartPos: 421, + EndPos: 461, + }, + PhpDocComment: "", + ReturnsRef: false, + Static: false, + Params: []node.Node{ + &node.Parameter{ + Position: &position.Position{ + StartLine: 20, + EndLine: 20, + StartPos: 430, + EndPos: 443, + }, + ByRef: false, + Variadic: false, + VariableType: &node.Nullable{ + Position: &position.Position{ + StartLine: 20, + EndLine: 20, + StartPos: 430, + EndPos: 433, + }, + Expr: &name.Name{ + Position: &position.Position{ + StartLine: 20, + EndLine: 20, + StartPos: 431, + EndPos: 433, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 20, + EndLine: 20, + StartPos: 431, + EndPos: 433, + }, + Value: "bar", + }, + }, + }, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 20, + EndLine: 20, + StartPos: 435, + EndPos: 438, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 20, + EndLine: 20, + StartPos: 435, + EndPos: 438, + }, + Value: "bar", + }, + }, + DefaultValue: &expr.ConstFetch{ + Position: &position.Position{ + StartLine: 20, + EndLine: 20, + StartPos: 440, + EndPos: 443, + }, + Constant: &name.Name{ + Position: &position.Position{ + StartLine: 20, + EndLine: 20, + StartPos: 440, + EndPos: 443, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 20, + EndLine: 20, + StartPos: 440, + EndPos: 443, + }, + Value: "null", + }, + }, + }, + }, + }, + &node.Parameter{ + Position: &position.Position{ + StartLine: 20, + EndLine: 20, + StartPos: 446, + EndPos: 457, + }, + ByRef: true, + Variadic: true, + VariableType: &name.Name{ + Position: &position.Position{ + StartLine: 20, + EndLine: 20, + StartPos: 446, + EndPos: 448, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 20, + EndLine: 20, + StartPos: 446, + EndPos: 448, + }, + Value: "baz", + }, + }, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 20, + EndLine: 20, + StartPos: 454, + EndPos: 457, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 20, + EndLine: 20, + StartPos: 454, + EndPos: 457, + }, + Value: "baz", + }, + }, }, }, - }, - }, - &stmt.Expression{ - Expr: &scalar.Encapsed{ - Parts: []node.Node{ - &scalar.EncapsedStringPart{Value: "test "}, - &expr.ArrayDimFetch{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, - Dim: &scalar.String{Value: "-1234567890123456789012345678901234567890"}, - }, - }, - }, - }, - &stmt.Expression{ - Expr: &scalar.Encapsed{ - Parts: []node.Node{ - &scalar.EncapsedStringPart{Value: "test "}, - &expr.ArrayDimFetch{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, - Dim: &scalar.String{Value: "bar"}, - }, - }, - }, - }, - &stmt.Expression{ - Expr: &scalar.Encapsed{ - Parts: []node.Node{ - &scalar.EncapsedStringPart{Value: "test "}, - &expr.ArrayDimFetch{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, - Dim: &expr.Variable{VarName: &node.Identifier{Value: "bar"}}, - }, - }, - }, - }, - &stmt.Expression{ - Expr: &scalar.Encapsed{ - Parts: []node.Node{ - &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, - &scalar.EncapsedStringPart{Value: " "}, - &expr.Variable{VarName: &node.Identifier{Value: "bar"}}, - }, - }, - }, - &stmt.Expression{ - Expr: &scalar.Encapsed{ - Parts: []node.Node{ - &scalar.EncapsedStringPart{Value: "test "}, - &expr.PropertyFetch{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, - Property: &node.Identifier{Value: "bar"}, - }, - &scalar.EncapsedStringPart{Value: "()"}, - }, - }, - }, - &stmt.Expression{ - Expr: &scalar.Encapsed{ - Parts: []node.Node{ - &scalar.EncapsedStringPart{Value: "test "}, - &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, - }, - }, - }, - &stmt.Expression{ - Expr: &scalar.Encapsed{ - Parts: []node.Node{ - &scalar.EncapsedStringPart{Value: "test "}, - &expr.ArrayDimFetch{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, - Dim: &scalar.Lnumber{Value: "0"}, - }, - }, - }, - }, - &stmt.Expression{ - Expr: &scalar.Encapsed{ - Parts: []node.Node{ - &scalar.EncapsedStringPart{Value: "test "}, - &expr.Variable{VarName: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}}, - }, - }, - }, - &stmt.Expression{ - Expr: &scalar.Encapsed{ - Parts: []node.Node{ - &scalar.EncapsedStringPart{Value: "test "}, - &expr.MethodCall{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, - Method: &node.Identifier{Value: "bar"}, - - ArgumentList: &node.ArgumentList{}, - }, - }, - }, - }, - - &stmt.AltIf{ - Cond: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Stmt: &stmt.StmtList{Stmts: []node.Node{}}, - }, - &stmt.AltIf{ - Cond: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Stmt: &stmt.StmtList{Stmts: []node.Node{}}, - ElseIf: []node.Node{ - &stmt.AltElseIf{ - Cond: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - Stmt: &stmt.StmtList{Stmts: []node.Node{}}, - }, - }, - }, - &stmt.AltIf{ - Cond: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Stmt: &stmt.StmtList{Stmts: []node.Node{}}, - Else: &stmt.AltElse{ - Stmt: &stmt.StmtList{Stmts: []node.Node{}}, - }, - }, - &stmt.AltIf{ - Cond: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Stmt: &stmt.StmtList{Stmts: []node.Node{}}, - ElseIf: []node.Node{ - &stmt.AltElseIf{ - Cond: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - Stmt: &stmt.StmtList{Stmts: []node.Node{}}, - }, - &stmt.AltElseIf{ - Cond: &expr.Variable{VarName: &node.Identifier{Value: "c"}}, - Stmt: &stmt.StmtList{Stmts: []node.Node{}}, - }, - }, - Else: &stmt.AltElse{ - Stmt: &stmt.StmtList{Stmts: []node.Node{}}, - }, - }, - &stmt.While{ - Cond: &scalar.Lnumber{Value: "1"}, - Stmt: &stmt.StmtList{ Stmts: []node.Node{ - &stmt.Break{}, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 21, + EndLine: 21, + StartPos: 466, + EndPos: 514, + }, + Expr: &expr.Closure{ + Position: &position.Position{ + StartLine: 21, + EndLine: 21, + StartPos: 466, + EndPos: 513, + }, + PhpDocComment: "", + ReturnsRef: false, + Static: true, + Params: []node.Node{ + &node.Parameter{ + Position: &position.Position{ + StartLine: 21, + EndLine: 21, + StartPos: 482, + EndPos: 495, + }, + ByRef: false, + Variadic: false, + VariableType: &node.Nullable{ + Position: &position.Position{ + StartLine: 21, + EndLine: 21, + StartPos: 482, + EndPos: 485, + }, + Expr: &name.Name{ + Position: &position.Position{ + StartLine: 21, + EndLine: 21, + StartPos: 483, + EndPos: 485, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 21, + EndLine: 21, + StartPos: 483, + EndPos: 485, + }, + Value: "bar", + }, + }, + }, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 21, + EndLine: 21, + StartPos: 487, + EndPos: 490, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 21, + EndLine: 21, + StartPos: 487, + EndPos: 490, + }, + Value: "bar", + }, + }, + DefaultValue: &expr.ConstFetch{ + Position: &position.Position{ + StartLine: 21, + EndLine: 21, + StartPos: 492, + EndPos: 495, + }, + Constant: &name.Name{ + Position: &position.Position{ + StartLine: 21, + EndLine: 21, + StartPos: 492, + EndPos: 495, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 21, + EndLine: 21, + StartPos: 492, + EndPos: 495, + }, + Value: "null", + }, + }, + }, + }, + }, + &node.Parameter{ + Position: &position.Position{ + StartLine: 21, + EndLine: 21, + StartPos: 498, + EndPos: 509, + }, + ByRef: true, + Variadic: true, + VariableType: &name.Name{ + Position: &position.Position{ + StartLine: 21, + EndLine: 21, + StartPos: 498, + EndPos: 500, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 21, + EndLine: 21, + StartPos: 498, + EndPos: 500, + }, + Value: "baz", + }, + }, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 21, + EndLine: 21, + StartPos: 506, + EndPos: 509, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 21, + EndLine: 21, + StartPos: 506, + EndPos: 509, + }, + Value: "baz", + }, + }, + }, + }, + Stmts: []node.Node{ + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 23, + EndLine: 23, + StartPos: 519, + EndPos: 538, + }, + Expr: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 23, + EndLine: 23, + StartPos: 519, + EndPos: 537, + }, + Value: "1234567890123456789", + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 24, + EndLine: 24, + StartPos: 542, + EndPos: 562, + }, + Expr: &scalar.Dnumber{ + Position: &position.Position{ + StartLine: 24, + EndLine: 24, + StartPos: 542, + EndPos: 561, + }, + Value: "12345678901234567890", + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 25, + EndLine: 25, + StartPos: 566, + EndPos: 568, + }, + Expr: &scalar.Dnumber{ + Position: &position.Position{ + StartLine: 25, + EndLine: 25, + StartPos: 566, + EndPos: 567, + }, + Value: "0.", + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 26, + EndLine: 26, + StartPos: 572, + EndPos: 638, + }, + Expr: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 26, + EndLine: 26, + StartPos: 572, + EndPos: 637, + }, + Value: "0b0111111111111111111111111111111111111111111111111111111111111111", + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 27, + EndLine: 27, + StartPos: 642, + EndPos: 708, + }, + Expr: &scalar.Dnumber{ + Position: &position.Position{ + StartLine: 27, + EndLine: 27, + StartPos: 642, + EndPos: 707, + }, + Value: "0b1111111111111111111111111111111111111111111111111111111111111111", + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 28, + EndLine: 28, + StartPos: 712, + EndPos: 732, + }, + Expr: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 28, + EndLine: 28, + StartPos: 712, + EndPos: 731, + }, + Value: "0x007111111111111111", + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 29, + EndLine: 29, + StartPos: 736, + EndPos: 754, + }, + Expr: &scalar.Dnumber{ + Position: &position.Position{ + StartLine: 29, + EndLine: 29, + StartPos: 736, + EndPos: 753, + }, + Value: "0x8111111111111111", + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 30, + EndLine: 30, + StartPos: 758, + EndPos: 767, + }, + Expr: &scalar.MagicConstant{ + Position: &position.Position{ + StartLine: 30, + EndLine: 30, + StartPos: 758, + EndPos: 766, + }, + Value: "__CLASS__", + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 31, + EndLine: 31, + StartPos: 771, + EndPos: 778, + }, + Expr: &scalar.MagicConstant{ + Position: &position.Position{ + StartLine: 31, + EndLine: 31, + StartPos: 771, + EndPos: 777, + }, + Value: "__DIR__", + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 32, + EndLine: 32, + StartPos: 782, + EndPos: 790, + }, + Expr: &scalar.MagicConstant{ + Position: &position.Position{ + StartLine: 32, + EndLine: 32, + StartPos: 782, + EndPos: 789, + }, + Value: "__FILE__", + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 33, + EndLine: 33, + StartPos: 794, + EndPos: 806, + }, + Expr: &scalar.MagicConstant{ + Position: &position.Position{ + StartLine: 33, + EndLine: 33, + StartPos: 794, + EndPos: 805, + }, + Value: "__FUNCTION__", + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 34, + EndLine: 34, + StartPos: 810, + EndPos: 818, + }, + Expr: &scalar.MagicConstant{ + Position: &position.Position{ + StartLine: 34, + EndLine: 34, + StartPos: 810, + EndPos: 817, + }, + Value: "__LINE__", + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 35, + EndLine: 35, + StartPos: 822, + EndPos: 835, + }, + Expr: &scalar.MagicConstant{ + Position: &position.Position{ + StartLine: 35, + EndLine: 35, + StartPos: 822, + EndPos: 834, + }, + Value: "__NAMESPACE__", + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 36, + EndLine: 36, + StartPos: 839, + EndPos: 849, + }, + Expr: &scalar.MagicConstant{ + Position: &position.Position{ + StartLine: 36, + EndLine: 36, + StartPos: 839, + EndPos: 848, + }, + Value: "__METHOD__", + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 37, + EndLine: 37, + StartPos: 853, + EndPos: 862, + }, + Expr: &scalar.MagicConstant{ + Position: &position.Position{ + StartLine: 37, + EndLine: 37, + StartPos: 853, + EndPos: 861, + }, + Value: "__TRAIT__", + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 39, + EndLine: 39, + StartPos: 867, + EndPos: 878, + }, + Expr: &scalar.Encapsed{ + Position: &position.Position{ + StartLine: 39, + EndLine: 39, + StartPos: 867, + EndPos: 877, + }, + Parts: []node.Node{ + &scalar.EncapsedStringPart{ + Position: &position.Position{ + StartLine: 39, + EndLine: 39, + StartPos: 868, + EndPos: 872, + }, + Value: "test ", + }, + &expr.Variable{ + Position: &position.Position{ + StartLine: 39, + EndLine: 39, + StartPos: 873, + EndPos: 876, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 39, + EndLine: 39, + StartPos: 873, + EndPos: 876, + }, + Value: "var", + }, + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 40, + EndLine: 40, + StartPos: 882, + EndPos: 896, + }, + Expr: &scalar.Encapsed{ + Position: &position.Position{ + StartLine: 40, + EndLine: 40, + StartPos: 882, + EndPos: 895, + }, + Parts: []node.Node{ + &scalar.EncapsedStringPart{ + Position: &position.Position{ + StartLine: 40, + EndLine: 40, + StartPos: 883, + EndPos: 887, + }, + Value: "test ", + }, + &expr.ArrayDimFetch{ + Position: &position.Position{ + StartLine: 40, + EndLine: 40, + StartPos: 888, + EndPos: 894, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 40, + EndLine: 40, + StartPos: 888, + EndPos: 891, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 40, + EndLine: 40, + StartPos: 888, + EndPos: 891, + }, + Value: "var", + }, + }, + Dim: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 40, + EndLine: 40, + StartPos: 893, + EndPos: 893, + }, + Value: "1", + }, + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 41, + EndLine: 41, + StartPos: 900, + EndPos: 915, + }, + Expr: &scalar.Encapsed{ + Position: &position.Position{ + StartLine: 41, + EndLine: 41, + StartPos: 900, + EndPos: 914, + }, + Parts: []node.Node{ + &scalar.EncapsedStringPart{ + Position: &position.Position{ + StartLine: 41, + EndLine: 41, + StartPos: 901, + EndPos: 905, + }, + Value: "test ", + }, + &expr.ArrayDimFetch{ + Position: &position.Position{ + StartLine: 41, + EndLine: 41, + StartPos: 906, + EndPos: 913, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 41, + EndLine: 41, + StartPos: 906, + EndPos: 909, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 41, + EndLine: 41, + StartPos: 906, + EndPos: 909, + }, + Value: "var", + }, + }, + Dim: &expr.UnaryMinus{ + Position: &position.Position{ + StartLine: 41, + EndLine: 41, + StartPos: 911, + EndPos: 912, + }, + Expr: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 41, + EndLine: 41, + StartPos: 911, + EndPos: 912, + }, + Value: "1", + }, + }, + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 42, + EndLine: 42, + StartPos: 919, + EndPos: 972, + }, + Expr: &scalar.Encapsed{ + Position: &position.Position{ + StartLine: 42, + EndLine: 42, + StartPos: 919, + EndPos: 971, + }, + Parts: []node.Node{ + &scalar.EncapsedStringPart{ + Position: &position.Position{ + StartLine: 42, + EndLine: 42, + StartPos: 920, + EndPos: 924, + }, + Value: "test ", + }, + &expr.ArrayDimFetch{ + Position: &position.Position{ + StartLine: 42, + EndLine: 42, + StartPos: 925, + EndPos: 970, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 42, + EndLine: 42, + StartPos: 925, + EndPos: 928, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 42, + EndLine: 42, + StartPos: 925, + EndPos: 928, + }, + Value: "var", + }, + }, + Dim: &scalar.String{ + Position: &position.Position{ + StartLine: 42, + EndLine: 42, + StartPos: 930, + EndPos: 969, + }, + Value: "1234567890123456789012345678901234567890", + }, + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 43, + EndLine: 43, + StartPos: 976, + EndPos: 1030, + }, + Expr: &scalar.Encapsed{ + Position: &position.Position{ + StartLine: 43, + EndLine: 43, + StartPos: 976, + EndPos: 1029, + }, + Parts: []node.Node{ + &scalar.EncapsedStringPart{ + Position: &position.Position{ + StartLine: 43, + EndLine: 43, + StartPos: 977, + EndPos: 981, + }, + Value: "test ", + }, + &expr.ArrayDimFetch{ + Position: &position.Position{ + StartLine: 43, + EndLine: 43, + StartPos: 982, + EndPos: 1028, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 43, + EndLine: 43, + StartPos: 982, + EndPos: 985, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 43, + EndLine: 43, + StartPos: 982, + EndPos: 985, + }, + Value: "var", + }, + }, + Dim: &scalar.String{ + Position: &position.Position{ + StartLine: 43, + EndLine: 43, + StartPos: 987, + EndPos: 1027, + }, + Value: "-1234567890123456789012345678901234567890", + }, + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 44, + EndLine: 44, + StartPos: 1034, + EndPos: 1050, + }, + Expr: &scalar.Encapsed{ + Position: &position.Position{ + StartLine: 44, + EndLine: 44, + StartPos: 1034, + EndPos: 1049, + }, + Parts: []node.Node{ + &scalar.EncapsedStringPart{ + Position: &position.Position{ + StartLine: 44, + EndLine: 44, + StartPos: 1035, + EndPos: 1039, + }, + Value: "test ", + }, + &expr.ArrayDimFetch{ + Position: &position.Position{ + StartLine: 44, + EndLine: 44, + StartPos: 1040, + EndPos: 1048, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 44, + EndLine: 44, + StartPos: 1040, + EndPos: 1043, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 44, + EndLine: 44, + StartPos: 1040, + EndPos: 1043, + }, + Value: "var", + }, + }, + Dim: &scalar.String{ + Position: &position.Position{ + StartLine: 44, + EndLine: 44, + StartPos: 1045, + EndPos: 1047, + }, + Value: "bar", + }, + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 45, + EndLine: 45, + StartPos: 1054, + EndPos: 1071, + }, + Expr: &scalar.Encapsed{ + Position: &position.Position{ + StartLine: 45, + EndLine: 45, + StartPos: 1054, + EndPos: 1070, + }, + Parts: []node.Node{ + &scalar.EncapsedStringPart{ + Position: &position.Position{ + StartLine: 45, + EndLine: 45, + StartPos: 1055, + EndPos: 1059, + }, + Value: "test ", + }, + &expr.ArrayDimFetch{ + Position: &position.Position{ + StartLine: 45, + EndLine: 45, + StartPos: 1060, + EndPos: 1069, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 45, + EndLine: 45, + StartPos: 1060, + EndPos: 1063, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 45, + EndLine: 45, + StartPos: 1060, + EndPos: 1063, + }, + Value: "var", + }, + }, + Dim: &expr.Variable{ + Position: &position.Position{ + StartLine: 45, + EndLine: 45, + StartPos: 1065, + EndPos: 1068, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 45, + EndLine: 45, + StartPos: 1065, + EndPos: 1068, + }, + Value: "bar", + }, + }, + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 46, + EndLine: 46, + StartPos: 1075, + EndPos: 1086, + }, + Expr: &scalar.Encapsed{ + Position: &position.Position{ + StartLine: 46, + EndLine: 46, + StartPos: 1075, + EndPos: 1085, + }, + Parts: []node.Node{ + &expr.Variable{ + Position: &position.Position{ + StartLine: 46, + EndLine: 46, + StartPos: 1076, + EndPos: 1079, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 46, + EndLine: 46, + StartPos: 1076, + EndPos: 1079, + }, + Value: "foo", + }, + }, + &scalar.EncapsedStringPart{ + Position: &position.Position{ + StartLine: 46, + EndLine: 46, + StartPos: 1080, + EndPos: 1080, + }, + Value: " ", + }, + &expr.Variable{ + Position: &position.Position{ + StartLine: 46, + EndLine: 46, + StartPos: 1081, + EndPos: 1084, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 46, + EndLine: 46, + StartPos: 1081, + EndPos: 1084, + }, + Value: "bar", + }, + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 47, + EndLine: 47, + StartPos: 1090, + EndPos: 1108, + }, + Expr: &scalar.Encapsed{ + Position: &position.Position{ + StartLine: 47, + EndLine: 47, + StartPos: 1090, + EndPos: 1107, + }, + Parts: []node.Node{ + &scalar.EncapsedStringPart{ + Position: &position.Position{ + StartLine: 47, + EndLine: 47, + StartPos: 1091, + EndPos: 1095, + }, + Value: "test ", + }, + &expr.PropertyFetch{ + Position: &position.Position{ + StartLine: 47, + EndLine: 47, + StartPos: 1096, + EndPos: 1104, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 47, + EndLine: 47, + StartPos: 1096, + EndPos: 1099, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 47, + EndLine: 47, + StartPos: 1096, + EndPos: 1099, + }, + Value: "foo", + }, + }, + Property: &node.Identifier{ + Position: &position.Position{ + StartLine: 47, + EndLine: 47, + StartPos: 1102, + EndPos: 1104, + }, + Value: "bar", + }, + }, + &scalar.EncapsedStringPart{ + Position: &position.Position{ + StartLine: 47, + EndLine: 47, + StartPos: 1105, + EndPos: 1106, + }, + Value: "()", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 48, + EndLine: 48, + StartPos: 1112, + EndPos: 1125, + }, + Expr: &scalar.Encapsed{ + Position: &position.Position{ + StartLine: 48, + EndLine: 48, + StartPos: 1112, + EndPos: 1124, + }, + Parts: []node.Node{ + &scalar.EncapsedStringPart{ + Position: &position.Position{ + StartLine: 48, + EndLine: 48, + StartPos: 1113, + EndPos: 1117, + }, + Value: "test ", + }, + &expr.Variable{ + Position: &position.Position{ + StartLine: 48, + EndLine: 48, + StartPos: 1118, + EndPos: 1123, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 48, + EndLine: 48, + StartPos: 1120, + EndPos: 1122, + }, + Value: "foo", + }, + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 49, + EndLine: 49, + StartPos: 1129, + EndPos: 1145, + }, + Expr: &scalar.Encapsed{ + Position: &position.Position{ + StartLine: 49, + EndLine: 49, + StartPos: 1129, + EndPos: 1144, + }, + Parts: []node.Node{ + &scalar.EncapsedStringPart{ + Position: &position.Position{ + StartLine: 49, + EndLine: 49, + StartPos: 1130, + EndPos: 1134, + }, + Value: "test ", + }, + &expr.ArrayDimFetch{ + Position: &position.Position{ + StartLine: 49, + EndLine: 49, + StartPos: 1135, + EndPos: 1143, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 49, + EndLine: 49, + StartPos: 1137, + EndPos: 1139, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 49, + EndLine: 49, + StartPos: 1137, + EndPos: 1139, + }, + Value: "foo", + }, + }, + Dim: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 49, + EndLine: 49, + StartPos: 1141, + EndPos: 1141, + }, + Value: "0", + }, + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 50, + EndLine: 50, + StartPos: 1149, + EndPos: 1163, + }, + Expr: &scalar.Encapsed{ + Position: &position.Position{ + StartLine: 50, + EndLine: 50, + StartPos: 1149, + EndPos: 1162, + }, + Parts: []node.Node{ + &scalar.EncapsedStringPart{ + Position: &position.Position{ + StartLine: 50, + EndLine: 50, + StartPos: 1150, + EndPos: 1154, + }, + Value: "test ", + }, + &expr.Variable{ + Position: &position.Position{ + StartLine: 50, + EndLine: 50, + StartPos: 1155, + EndPos: 1161, + }, + VarName: &expr.Variable{ + Position: &position.Position{ + StartLine: 50, + EndLine: 50, + StartPos: 1157, + EndPos: 1160, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 50, + EndLine: 50, + StartPos: 1157, + EndPos: 1160, + }, + Value: "foo", + }, + }, + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 51, + EndLine: 51, + StartPos: 1167, + EndPos: 1187, + }, + Expr: &scalar.Encapsed{ + Position: &position.Position{ + StartLine: 51, + EndLine: 51, + StartPos: 1167, + EndPos: 1186, + }, + Parts: []node.Node{ + &scalar.EncapsedStringPart{ + Position: &position.Position{ + StartLine: 51, + EndLine: 51, + StartPos: 1168, + EndPos: 1172, + }, + Value: "test ", + }, + &expr.MethodCall{ + Position: &position.Position{ + StartLine: 51, + EndLine: 51, + StartPos: 1174, + EndPos: 1184, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 51, + EndLine: 51, + StartPos: 1174, + EndPos: 1177, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 51, + EndLine: 51, + StartPos: 1174, + EndPos: 1177, + }, + Value: "foo", + }, + }, + Method: &node.Identifier{ + Position: &position.Position{ + StartLine: 51, + EndLine: 51, + StartPos: 1180, + EndPos: 1182, + }, + Value: "bar", + }, + ArgumentList: &node.ArgumentList{ + Position: &position.Position{ + StartLine: 51, + EndLine: 51, + StartPos: 1183, + EndPos: 1184, + }, + }, + }, + }, + }, + }, + &stmt.AltIf{ + Position: &position.Position{ + StartLine: 53, + EndLine: 54, + StartPos: 1192, + EndPos: 1209, + }, + Cond: &expr.Variable{ + Position: &position.Position{ + StartLine: 53, + EndLine: 53, + StartPos: 1196, + EndPos: 1197, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 53, + EndLine: 53, + StartPos: 1196, + EndPos: 1197, + }, + Value: "a", + }, + }, + Stmt: &stmt.StmtList{ + Position: &position.Position{ + StartLine: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, + }, + Stmts: []node.Node{ + }, + }, + }, + &stmt.AltIf{ + Position: &position.Position{ + StartLine: 55, + EndLine: 57, + StartPos: 1213, + EndPos: 1245, + }, + Cond: &expr.Variable{ + Position: &position.Position{ + StartLine: 55, + EndLine: 55, + StartPos: 1217, + EndPos: 1218, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 55, + EndLine: 55, + StartPos: 1217, + EndPos: 1218, + }, + Value: "a", + }, + }, + Stmt: &stmt.StmtList{ + Position: &position.Position{ + StartLine: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, + }, + Stmts: []node.Node{ + }, + }, + ElseIf: []node.Node{ + &stmt.AltElseIf{ + Position: &position.Position{ + StartLine: 56, + EndLine: -1, + StartPos: 1225, + EndPos: -1, + }, + Cond: &expr.Variable{ + Position: &position.Position{ + StartLine: 56, + EndLine: 56, + StartPos: 1233, + EndPos: 1234, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 56, + EndLine: 56, + StartPos: 1233, + EndPos: 1234, + }, + Value: "b", + }, + }, + Stmt: &stmt.StmtList{ + Position: &position.Position{ + StartLine: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, + }, + Stmts: []node.Node{ + }, + }, + }, + }, + }, + &stmt.AltIf{ + Position: &position.Position{ + StartLine: 58, + EndLine: 60, + StartPos: 1249, + EndPos: 1274, + }, + Cond: &expr.Variable{ + Position: &position.Position{ + StartLine: 58, + EndLine: 58, + StartPos: 1253, + EndPos: 1254, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 58, + EndLine: 58, + StartPos: 1253, + EndPos: 1254, + }, + Value: "a", + }, + }, + Stmt: &stmt.StmtList{ + Position: &position.Position{ + StartLine: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, + }, + Stmts: []node.Node{ + }, + }, + Else: &stmt.AltElse{ + Position: &position.Position{ + StartLine: 59, + EndLine: -1, + StartPos: 1261, + EndPos: -1, + }, + Stmt: &stmt.StmtList{ + Position: &position.Position{ + StartLine: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, + }, + Stmts: []node.Node{ + }, + }, + }, + }, + &stmt.AltIf{ + Position: &position.Position{ + StartLine: 61, + EndLine: 65, + StartPos: 1278, + EndPos: 1333, + }, + Cond: &expr.Variable{ + Position: &position.Position{ + StartLine: 61, + EndLine: 61, + StartPos: 1282, + EndPos: 1283, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 61, + EndLine: 61, + StartPos: 1282, + EndPos: 1283, + }, + Value: "a", + }, + }, + Stmt: &stmt.StmtList{ + Position: &position.Position{ + StartLine: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, + }, + Stmts: []node.Node{ + }, + }, + ElseIf: []node.Node{ + &stmt.AltElseIf{ + Position: &position.Position{ + StartLine: 62, + EndLine: -1, + StartPos: 1290, + EndPos: -1, + }, + Cond: &expr.Variable{ + Position: &position.Position{ + StartLine: 62, + EndLine: 62, + StartPos: 1298, + EndPos: 1299, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 62, + EndLine: 62, + StartPos: 1298, + EndPos: 1299, + }, + Value: "b", + }, + }, + Stmt: &stmt.StmtList{ + Position: &position.Position{ + StartLine: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, + }, + Stmts: []node.Node{ + }, + }, + }, + &stmt.AltElseIf{ + Position: &position.Position{ + StartLine: 63, + EndLine: -1, + StartPos: 1305, + EndPos: -1, + }, + Cond: &expr.Variable{ + Position: &position.Position{ + StartLine: 63, + EndLine: 63, + StartPos: 1313, + EndPos: 1314, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 63, + EndLine: 63, + StartPos: 1313, + EndPos: 1314, + }, + Value: "c", + }, + }, + Stmt: &stmt.StmtList{ + Position: &position.Position{ + StartLine: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, + }, + Stmts: []node.Node{ + }, + }, + }, + }, + Else: &stmt.AltElse{ + Position: &position.Position{ + StartLine: 64, + EndLine: -1, + StartPos: 1320, + EndPos: -1, + }, + Stmt: &stmt.StmtList{ + Position: &position.Position{ + StartLine: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, + }, + Stmts: []node.Node{ + }, }, }, }, &stmt.While{ - Cond: &scalar.Lnumber{Value: "1"}, + Position: &position.Position{ + StartLine: 67, + EndLine: 67, + StartPos: 1338, + EndPos: 1357, + }, + Cond: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 67, + EndLine: 67, + StartPos: 1345, + EndPos: 1345, + }, + Value: "1", + }, Stmt: &stmt.StmtList{ + Position: &position.Position{ + StartLine: 67, + EndLine: 67, + StartPos: 1348, + EndPos: 1357, + }, Stmts: []node.Node{ &stmt.Break{ - Expr: &scalar.Lnumber{Value: "2"}, + Position: &position.Position{ + StartLine: 67, + EndLine: 67, + StartPos: 1350, + EndPos: 1355, + }, + }, + }, + }, + }, + &stmt.While{ + Position: &position.Position{ + StartLine: 68, + EndLine: 68, + StartPos: 1361, + EndPos: 1382, + }, + Cond: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 68, + EndLine: 68, + StartPos: 1368, + EndPos: 1368, + }, + Value: "1", + }, + Stmt: &stmt.StmtList{ + Position: &position.Position{ + StartLine: 68, + EndLine: 68, + StartPos: 1371, + EndPos: 1382, + }, + Stmts: []node.Node{ + &stmt.Break{ + Position: &position.Position{ + StartLine: 68, + EndLine: 68, + StartPos: 1373, + EndPos: 1380, + }, + Expr: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 68, + EndLine: 68, + StartPos: 1379, + EndPos: 1379, + }, + Value: "2", + }, }, }, }, }, &stmt.AltWhile{ - Cond: &scalar.Lnumber{Value: "1"}, + Position: &position.Position{ + StartLine: 69, + EndLine: 69, + StartPos: 1386, + EndPos: 1416, + }, + Cond: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 69, + EndLine: 69, + StartPos: 1393, + EndPos: 1393, + }, + Value: "1", + }, Stmt: &stmt.StmtList{ + Position: &position.Position{ + StartLine: 69, + EndLine: 69, + StartPos: 1398, + EndPos: 1406, + }, Stmts: []node.Node{ &stmt.Break{ - Expr: &scalar.Lnumber{Value: "3"}, + Position: &position.Position{ + StartLine: 69, + EndLine: 69, + StartPos: 1398, + EndPos: 1406, + }, + Expr: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 69, + EndLine: 69, + StartPos: 1404, + EndPos: 1404, + }, + Value: "3", + }, }, }, }, }, &stmt.Class{ - ClassName: &node.Identifier{Value: "foo"}, + Position: &position.Position{ + StartLine: 70, + EndLine: 70, + StartPos: 1420, + EndPos: 1462, + }, + PhpDocComment: "", + ClassName: &node.Identifier{ + Position: &position.Position{ + StartLine: 70, + EndLine: 70, + StartPos: 1426, + EndPos: 1428, + }, + Value: "foo", + }, Stmts: []node.Node{ &stmt.ClassConstList{ + Position: &position.Position{ + StartLine: 70, + EndLine: 70, + StartPos: 1431, + EndPos: 1460, + }, Modifiers: []node.Node{ - &node.Identifier{Value: "public"}, + &node.Identifier{ + Position: &position.Position{ + StartLine: 70, + EndLine: 70, + StartPos: 1431, + EndPos: 1436, + }, + Value: "public", + }, }, Consts: []node.Node{ &stmt.Constant{ + Position: &position.Position{ + StartLine: 70, + EndLine: 70, + StartPos: 1444, + EndPos: 1450, + }, PhpDocComment: "", - ConstantName: &node.Identifier{Value: "FOO"}, - Expr: &scalar.Lnumber{Value: "1"}, + ConstantName: &node.Identifier{ + Position: &position.Position{ + StartLine: 70, + EndLine: 70, + StartPos: 1444, + EndPos: 1446, + }, + Value: "FOO", + }, + Expr: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 70, + EndLine: 70, + StartPos: 1450, + EndPos: 1450, + }, + Value: "1", + }, }, &stmt.Constant{ + Position: &position.Position{ + StartLine: 70, + EndLine: 70, + StartPos: 1453, + EndPos: 1459, + }, PhpDocComment: "", - ConstantName: &node.Identifier{Value: "BAR"}, - Expr: &scalar.Lnumber{Value: "2"}, + ConstantName: &node.Identifier{ + Position: &position.Position{ + StartLine: 70, + EndLine: 70, + StartPos: 1453, + EndPos: 1455, + }, + Value: "BAR", + }, + Expr: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 70, + EndLine: 70, + StartPos: 1459, + EndPos: 1459, + }, + Value: "2", + }, }, }, }, }, }, &stmt.Class{ - ClassName: &node.Identifier{Value: "foo"}, + Position: &position.Position{ + StartLine: 71, + EndLine: 71, + StartPos: 1466, + EndPos: 1501, + }, + PhpDocComment: "", + ClassName: &node.Identifier{ + Position: &position.Position{ + StartLine: 71, + EndLine: 71, + StartPos: 1472, + EndPos: 1474, + }, + Value: "foo", + }, Stmts: []node.Node{ &stmt.ClassConstList{ + Position: &position.Position{ + StartLine: 71, + EndLine: 71, + StartPos: 1477, + EndPos: 1499, + }, Consts: []node.Node{ &stmt.Constant{ + Position: &position.Position{ + StartLine: 71, + EndLine: 71, + StartPos: 1483, + EndPos: 1489, + }, PhpDocComment: "", - ConstantName: &node.Identifier{Value: "FOO"}, - Expr: &scalar.Lnumber{Value: "1"}, + ConstantName: &node.Identifier{ + Position: &position.Position{ + StartLine: 71, + EndLine: 71, + StartPos: 1483, + EndPos: 1485, + }, + Value: "FOO", + }, + Expr: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 71, + EndLine: 71, + StartPos: 1489, + EndPos: 1489, + }, + Value: "1", + }, }, &stmt.Constant{ + Position: &position.Position{ + StartLine: 71, + EndLine: 71, + StartPos: 1492, + EndPos: 1498, + }, PhpDocComment: "", - ConstantName: &node.Identifier{Value: "BAR"}, - Expr: &scalar.Lnumber{Value: "2"}, + ConstantName: &node.Identifier{ + Position: &position.Position{ + StartLine: 71, + EndLine: 71, + StartPos: 1492, + EndPos: 1494, + }, + Value: "BAR", + }, + Expr: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 71, + EndLine: 71, + StartPos: 1498, + EndPos: 1498, + }, + Value: "2", + }, }, }, }, }, }, &stmt.Class{ - ClassName: &node.Identifier{Value: "foo"}, + Position: &position.Position{ + StartLine: 72, + EndLine: 72, + StartPos: 1505, + EndPos: 1534, + }, + PhpDocComment: "", + ClassName: &node.Identifier{ + Position: &position.Position{ + StartLine: 72, + EndLine: 72, + StartPos: 1511, + EndPos: 1513, + }, + Value: "foo", + }, Stmts: []node.Node{ &stmt.ClassMethod{ + Position: &position.Position{ + StartLine: 72, + EndLine: 72, + StartPos: 1516, + EndPos: 1532, + }, + ReturnsRef: false, PhpDocComment: "", - MethodName: &node.Identifier{Value: "bar"}, + MethodName: &node.Identifier{ + Position: &position.Position{ + StartLine: 72, + EndLine: 72, + StartPos: 1525, + EndPos: 1527, + }, + Value: "bar", + }, Stmt: &stmt.StmtList{ - Stmts: []node.Node{}, + Position: &position.Position{ + StartLine: 72, + EndLine: 72, + StartPos: 1531, + EndPos: 1532, + }, + Stmts: []node.Node{ + }, }, }, }, }, &stmt.Class{ - ClassName: &node.Identifier{Value: "foo"}, + Position: &position.Position{ + StartLine: 73, + EndLine: 73, + StartPos: 1538, + EndPos: 1582, + }, + PhpDocComment: "", + ClassName: &node.Identifier{ + Position: &position.Position{ + StartLine: 73, + EndLine: 73, + StartPos: 1544, + EndPos: 1546, + }, + Value: "foo", + }, Stmts: []node.Node{ &stmt.ClassMethod{ + Position: &position.Position{ + StartLine: 73, + EndLine: 73, + StartPos: 1549, + EndPos: 1580, + }, + ReturnsRef: true, PhpDocComment: "", - ReturnsRef: true, - MethodName: &node.Identifier{Value: "bar"}, + MethodName: &node.Identifier{ + Position: &position.Position{ + StartLine: 73, + EndLine: 73, + StartPos: 1573, + EndPos: 1575, + }, + Value: "bar", + }, Modifiers: []node.Node{ - &node.Identifier{Value: "public"}, - &node.Identifier{Value: "static"}, + &node.Identifier{ + Position: &position.Position{ + StartLine: 73, + EndLine: 73, + StartPos: 1549, + EndPos: 1554, + }, + Value: "public", + }, + &node.Identifier{ + Position: &position.Position{ + StartLine: 73, + EndLine: 73, + StartPos: 1556, + EndPos: 1561, + }, + Value: "static", + }, }, Stmt: &stmt.StmtList{ - Stmts: []node.Node{}, + Position: &position.Position{ + StartLine: 73, + EndLine: 73, + StartPos: 1579, + EndPos: 1580, + }, + Stmts: []node.Node{ + }, }, }, }, }, &stmt.Class{ - ClassName: &node.Identifier{Value: "foo"}, + Position: &position.Position{ + StartLine: 74, + EndLine: 74, + StartPos: 1586, + EndPos: 1636, + }, + PhpDocComment: "", + ClassName: &node.Identifier{ + Position: &position.Position{ + StartLine: 74, + EndLine: 74, + StartPos: 1592, + EndPos: 1594, + }, + Value: "foo", + }, Stmts: []node.Node{ &stmt.ClassMethod{ + Position: &position.Position{ + StartLine: 74, + EndLine: 74, + StartPos: 1597, + EndPos: 1634, + }, + ReturnsRef: true, PhpDocComment: "", - ReturnsRef: true, - MethodName: &node.Identifier{Value: "bar"}, + MethodName: &node.Identifier{ + Position: &position.Position{ + StartLine: 74, + EndLine: 74, + StartPos: 1621, + EndPos: 1623, + }, + Value: "bar", + }, Modifiers: []node.Node{ - &node.Identifier{Value: "public"}, - &node.Identifier{Value: "static"}, + &node.Identifier{ + Position: &position.Position{ + StartLine: 74, + EndLine: 74, + StartPos: 1597, + EndPos: 1602, + }, + Value: "public", + }, + &node.Identifier{ + Position: &position.Position{ + StartLine: 74, + EndLine: 74, + StartPos: 1604, + EndPos: 1609, + }, + Value: "static", + }, }, ReturnType: &name.Name{ + Position: &position.Position{ + StartLine: 74, + EndLine: 74, + StartPos: 1628, + EndPos: 1631, + }, Parts: []node.Node{ - &name.NamePart{Value: "void"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 74, + EndLine: 74, + StartPos: 1628, + EndPos: 1631, + }, + Value: "void", + }, }, }, Stmt: &stmt.StmtList{ - Stmts: []node.Node{}, + Position: &position.Position{ + StartLine: 74, + EndLine: 74, + StartPos: 1633, + EndPos: 1634, + }, + Stmts: []node.Node{ + }, }, }, }, }, &stmt.Class{ - ClassName: &node.Identifier{Value: "foo"}, - Modifiers: []node.Node{ - &node.Identifier{Value: "abstract"}, + Position: &position.Position{ + StartLine: 75, + EndLine: 75, + StartPos: 1640, + EndPos: 1660, + }, + PhpDocComment: "", + ClassName: &node.Identifier{ + Position: &position.Position{ + StartLine: 75, + EndLine: 75, + StartPos: 1655, + EndPos: 1657, + }, + Value: "foo", + }, + Modifiers: []node.Node{ + &node.Identifier{ + Position: &position.Position{ + StartLine: 75, + EndLine: 75, + StartPos: 1640, + EndPos: 1647, + }, + Value: "abstract", + }, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, &stmt.Class{ - ClassName: &node.Identifier{Value: "foo"}, + Position: &position.Position{ + StartLine: 76, + EndLine: 76, + StartPos: 1664, + EndPos: 1694, + }, + PhpDocComment: "", + ClassName: &node.Identifier{ + Position: &position.Position{ + StartLine: 76, + EndLine: 76, + StartPos: 1676, + EndPos: 1678, + }, + Value: "foo", + }, Modifiers: []node.Node{ - &node.Identifier{Value: "final"}, + &node.Identifier{ + Position: &position.Position{ + StartLine: 76, + EndLine: 76, + StartPos: 1664, + EndPos: 1668, + }, + Value: "final", + }, }, Extends: &stmt.ClassExtends{ + Position: &position.Position{ + StartLine: 76, + EndLine: 76, + StartPos: 1680, + EndPos: 1690, + }, ClassName: &name.Name{ + Position: &position.Position{ + StartLine: 76, + EndLine: 76, + StartPos: 1688, + EndPos: 1690, + }, Parts: []node.Node{ - &name.NamePart{Value: "bar"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 76, + EndLine: 76, + StartPos: 1688, + EndPos: 1690, + }, + Value: "bar", + }, }, }, }, - Stmts: []node.Node{}, + Stmts: []node.Node{ + }, }, &stmt.Class{ - ClassName: &node.Identifier{Value: "foo"}, + Position: &position.Position{ + StartLine: 77, + EndLine: 77, + StartPos: 1698, + EndPos: 1731, + }, + PhpDocComment: "", + ClassName: &node.Identifier{ + Position: &position.Position{ + StartLine: 77, + EndLine: 77, + StartPos: 1710, + EndPos: 1712, + }, + Value: "foo", + }, Modifiers: []node.Node{ - &node.Identifier{Value: "final"}, + &node.Identifier{ + Position: &position.Position{ + StartLine: 77, + EndLine: 77, + StartPos: 1698, + EndPos: 1702, + }, + Value: "final", + }, }, Implements: &stmt.ClassImplements{ + Position: &position.Position{ + StartLine: 77, + EndLine: 77, + StartPos: 1714, + EndPos: 1727, + }, InterfaceNames: []node.Node{ &name.Name{ + Position: &position.Position{ + StartLine: 77, + EndLine: 77, + StartPos: 1725, + EndPos: 1727, + }, Parts: []node.Node{ - &name.NamePart{Value: "bar"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 77, + EndLine: 77, + StartPos: 1725, + EndPos: 1727, + }, + Value: "bar", + }, }, }, }, }, - Stmts: []node.Node{}, + Stmts: []node.Node{ + }, }, &stmt.Class{ - ClassName: &node.Identifier{Value: "foo"}, + Position: &position.Position{ + StartLine: 78, + EndLine: 78, + StartPos: 1735, + EndPos: 1773, + }, + PhpDocComment: "", + ClassName: &node.Identifier{ + Position: &position.Position{ + StartLine: 78, + EndLine: 78, + StartPos: 1747, + EndPos: 1749, + }, + Value: "foo", + }, Modifiers: []node.Node{ - &node.Identifier{Value: "final"}, + &node.Identifier{ + Position: &position.Position{ + StartLine: 78, + EndLine: 78, + StartPos: 1735, + EndPos: 1739, + }, + Value: "final", + }, }, Implements: &stmt.ClassImplements{ + Position: &position.Position{ + StartLine: 78, + EndLine: 78, + StartPos: 1751, + EndPos: 1769, + }, InterfaceNames: []node.Node{ &name.Name{ + Position: &position.Position{ + StartLine: 78, + EndLine: 78, + StartPos: 1762, + EndPos: 1764, + }, Parts: []node.Node{ - &name.NamePart{Value: "bar"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 78, + EndLine: 78, + StartPos: 1762, + EndPos: 1764, + }, + Value: "bar", + }, }, }, &name.Name{ + Position: &position.Position{ + StartLine: 78, + EndLine: 78, + StartPos: 1767, + EndPos: 1769, + }, Parts: []node.Node{ - &name.NamePart{Value: "baz"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 78, + EndLine: 78, + StartPos: 1767, + EndPos: 1769, + }, + Value: "baz", + }, }, }, }, }, - Stmts: []node.Node{}, + Stmts: []node.Node{ + }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 79, + EndLine: 79, + StartPos: 1777, + EndPos: 1824, + }, Expr: &expr.New{ + Position: &position.Position{ + StartLine: 79, + EndLine: 79, + StartPos: 1777, + EndPos: 1823, + }, Class: &stmt.Class{ - - ArgumentList: &node.ArgumentList{}, + Position: &position.Position{ + StartLine: 79, + EndLine: 79, + StartPos: 1781, + EndPos: 1823, + }, + PhpDocComment: "", + ArgumentList: &node.ArgumentList{ + Position: &position.Position{ + StartLine: 79, + EndLine: 79, + StartPos: 1786, + EndPos: 1787, + }, + }, Extends: &stmt.ClassExtends{ + Position: &position.Position{ + StartLine: 79, + EndLine: 79, + StartPos: 1789, + EndPos: 1799, + }, ClassName: &name.Name{ + Position: &position.Position{ + StartLine: 79, + EndLine: 79, + StartPos: 1797, + EndPos: 1799, + }, Parts: []node.Node{ - &name.NamePart{Value: "foo"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 79, + EndLine: 79, + StartPos: 1797, + EndPos: 1799, + }, + Value: "foo", + }, }, }, }, Implements: &stmt.ClassImplements{ + Position: &position.Position{ + StartLine: 79, + EndLine: 79, + StartPos: 1801, + EndPos: 1819, + }, InterfaceNames: []node.Node{ &name.Name{ + Position: &position.Position{ + StartLine: 79, + EndLine: 79, + StartPos: 1812, + EndPos: 1814, + }, Parts: []node.Node{ - &name.NamePart{Value: "bar"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 79, + EndLine: 79, + StartPos: 1812, + EndPos: 1814, + }, + Value: "bar", + }, }, }, &name.Name{ + Position: &position.Position{ + StartLine: 79, + EndLine: 79, + StartPos: 1817, + EndPos: 1819, + }, Parts: []node.Node{ - &name.NamePart{Value: "baz"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 79, + EndLine: 79, + StartPos: 1817, + EndPos: 1819, + }, + Value: "baz", + }, }, }, }, }, - Stmts: []node.Node{}, + Stmts: []node.Node{ + }, }, }, }, &stmt.ConstList{ + Position: &position.Position{ + StartLine: 81, + EndLine: 81, + StartPos: 1829, + EndPos: 1851, + }, Consts: []node.Node{ &stmt.Constant{ + Position: &position.Position{ + StartLine: 81, + EndLine: 81, + StartPos: 1835, + EndPos: 1841, + }, PhpDocComment: "", - ConstantName: &node.Identifier{Value: "FOO"}, - Expr: &scalar.Lnumber{Value: "1"}, + ConstantName: &node.Identifier{ + Position: &position.Position{ + StartLine: 81, + EndLine: 81, + StartPos: 1835, + EndPos: 1837, + }, + Value: "FOO", + }, + Expr: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 81, + EndLine: 81, + StartPos: 1841, + EndPos: 1841, + }, + Value: "1", + }, }, &stmt.Constant{ + Position: &position.Position{ + StartLine: 81, + EndLine: 81, + StartPos: 1844, + EndPos: 1850, + }, PhpDocComment: "", - ConstantName: &node.Identifier{Value: "BAR"}, - Expr: &scalar.Lnumber{Value: "2"}, - }, - }, - }, - &stmt.While{ - Cond: &scalar.Lnumber{Value: "1"}, - Stmt: &stmt.StmtList{ - Stmts: []node.Node{ - &stmt.Continue{Expr: nil}, - }, - }, - }, - &stmt.While{ - Cond: &scalar.Lnumber{Value: "1"}, - Stmt: &stmt.StmtList{ - Stmts: []node.Node{ - &stmt.Continue{ - Expr: &scalar.Lnumber{Value: "2"}, + ConstantName: &node.Identifier{ + Position: &position.Position{ + StartLine: 81, + EndLine: 81, + StartPos: 1844, + EndPos: 1846, + }, + Value: "BAR", + }, + Expr: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 81, + EndLine: 81, + StartPos: 1850, + EndPos: 1850, + }, + Value: "2", }, }, }, }, &stmt.While{ - Cond: &scalar.Lnumber{Value: "1"}, + Position: &position.Position{ + StartLine: 82, + EndLine: 82, + StartPos: 1855, + EndPos: 1877, + }, + Cond: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 82, + EndLine: 82, + StartPos: 1862, + EndPos: 1862, + }, + Value: "1", + }, Stmt: &stmt.StmtList{ + Position: &position.Position{ + StartLine: 82, + EndLine: 82, + StartPos: 1865, + EndPos: 1877, + }, Stmts: []node.Node{ &stmt.Continue{ - Expr: &scalar.Lnumber{Value: "3"}, + Position: &position.Position{ + StartLine: 82, + EndLine: 82, + StartPos: 1867, + EndPos: 1875, + }, + }, + }, + }, + }, + &stmt.While{ + Position: &position.Position{ + StartLine: 83, + EndLine: 83, + StartPos: 1881, + EndPos: 1905, + }, + Cond: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 83, + EndLine: 83, + StartPos: 1888, + EndPos: 1888, + }, + Value: "1", + }, + Stmt: &stmt.StmtList{ + Position: &position.Position{ + StartLine: 83, + EndLine: 83, + StartPos: 1891, + EndPos: 1905, + }, + Stmts: []node.Node{ + &stmt.Continue{ + Position: &position.Position{ + StartLine: 83, + EndLine: 83, + StartPos: 1893, + EndPos: 1903, + }, + Expr: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 83, + EndLine: 83, + StartPos: 1902, + EndPos: 1902, + }, + Value: "2", + }, + }, + }, + }, + }, + &stmt.While{ + Position: &position.Position{ + StartLine: 84, + EndLine: 84, + StartPos: 1909, + EndPos: 1934, + }, + Cond: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 84, + EndLine: 84, + StartPos: 1916, + EndPos: 1916, + }, + Value: "1", + }, + Stmt: &stmt.StmtList{ + Position: &position.Position{ + StartLine: 84, + EndLine: 84, + StartPos: 1919, + EndPos: 1934, + }, + Stmts: []node.Node{ + &stmt.Continue{ + Position: &position.Position{ + StartLine: 84, + EndLine: 84, + StartPos: 1921, + EndPos: 1932, + }, + Expr: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 84, + EndLine: 84, + StartPos: 1930, + EndPos: 1930, + }, + Value: "3", + }, }, }, }, }, &stmt.Declare{ + Position: &position.Position{ + StartLine: 85, + EndLine: 85, + StartPos: 1938, + EndPos: 1954, + }, Consts: []node.Node{ &stmt.Constant{ + Position: &position.Position{ + StartLine: 85, + EndLine: 85, + StartPos: 1946, + EndPos: 1952, + }, PhpDocComment: "", - ConstantName: &node.Identifier{Value: "ticks"}, - Expr: &scalar.Lnumber{Value: "1"}, + ConstantName: &node.Identifier{ + Position: &position.Position{ + StartLine: 85, + EndLine: 85, + StartPos: 1946, + EndPos: 1950, + }, + Value: "ticks", + }, + Expr: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 85, + EndLine: 85, + StartPos: 1952, + EndPos: 1952, + }, + Value: "1", + }, }, }, - Stmt: &stmt.Nop{}, - }, - &stmt.Declare{ - Consts: []node.Node{ - &stmt.Constant{ - PhpDocComment: "", - ConstantName: &node.Identifier{Value: "ticks"}, - Expr: &scalar.Lnumber{Value: "1"}, + Stmt: &stmt.Nop{ + Position: &position.Position{ + StartLine: 85, + EndLine: 85, + StartPos: 1954, + EndPos: 1954, }, }, - Stmt: &stmt.StmtList{ - Stmts: []node.Node{}, - }, }, &stmt.Declare{ + Position: &position.Position{ + StartLine: 86, + EndLine: 86, + StartPos: 1958, + EndPos: 1976, + }, Consts: []node.Node{ &stmt.Constant{ + Position: &position.Position{ + StartLine: 86, + EndLine: 86, + StartPos: 1966, + EndPos: 1972, + }, PhpDocComment: "", - ConstantName: &node.Identifier{Value: "ticks"}, - Expr: &scalar.Lnumber{Value: "1"}, + ConstantName: &node.Identifier{ + Position: &position.Position{ + StartLine: 86, + EndLine: 86, + StartPos: 1966, + EndPos: 1970, + }, + Value: "ticks", + }, + Expr: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 86, + EndLine: 86, + StartPos: 1972, + EndPos: 1972, + }, + Value: "1", + }, }, }, Stmt: &stmt.StmtList{ - Stmts: []node.Node{}, + Position: &position.Position{ + StartLine: 86, + EndLine: 86, + StartPos: 1975, + EndPos: 1976, + }, + Stmts: []node.Node{ + }, + }, + }, + &stmt.Declare{ + Position: &position.Position{ + StartLine: 87, + EndLine: 87, + StartPos: 1980, + EndPos: 2008, + }, + Consts: []node.Node{ + &stmt.Constant{ + Position: &position.Position{ + StartLine: 87, + EndLine: 87, + StartPos: 1988, + EndPos: 1994, + }, + PhpDocComment: "", + ConstantName: &node.Identifier{ + Position: &position.Position{ + StartLine: 87, + EndLine: 87, + StartPos: 1988, + EndPos: 1992, + }, + Value: "ticks", + }, + Expr: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 87, + EndLine: 87, + StartPos: 1994, + EndPos: 1994, + }, + Value: "1", + }, + }, + }, + Stmt: &stmt.StmtList{ + Position: &position.Position{ + StartLine: 87, + EndLine: 87, + StartPos: 1996, + EndPos: 2008, + }, + Stmts: []node.Node{ + }, }, }, &stmt.Do{ + Position: &position.Position{ + StartLine: 88, + EndLine: 88, + StartPos: 2012, + EndPos: 2026, + }, Stmt: &stmt.StmtList{ - Stmts: []node.Node{}, - }, - Cond: &scalar.Lnumber{Value: "1"}, - }, - &stmt.Echo{ - Exprs: []node.Node{ - &expr.Variable{ - VarName: &node.Identifier{Value: "a"}, + Position: &position.Position{ + StartLine: 88, + EndLine: 88, + StartPos: 2015, + EndPos: 2016, }, - &scalar.Lnumber{Value: "1"}, + Stmts: []node.Node{ + }, + }, + Cond: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 88, + EndLine: 88, + StartPos: 2024, + EndPos: 2024, + }, + Value: "1", }, }, &stmt.Echo{ + Position: &position.Position{ + StartLine: 89, + EndLine: 89, + StartPos: 2030, + EndPos: 2040, + }, Exprs: []node.Node{ &expr.Variable{ - VarName: &node.Identifier{Value: "a"}, + Position: &position.Position{ + StartLine: 89, + EndLine: 89, + StartPos: 2035, + EndPos: 2036, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 89, + EndLine: 89, + StartPos: 2035, + EndPos: 2036, + }, + Value: "a", + }, + }, + &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 89, + EndLine: 89, + StartPos: 2039, + EndPos: 2039, + }, + Value: "1", + }, + }, + }, + &stmt.Echo{ + Position: &position.Position{ + StartLine: 90, + EndLine: 90, + StartPos: 2044, + EndPos: 2052, + }, + Exprs: []node.Node{ + &expr.Variable{ + Position: &position.Position{ + StartLine: 90, + EndLine: 90, + StartPos: 2049, + EndPos: 2050, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 90, + EndLine: 90, + StartPos: 2049, + EndPos: 2050, + }, + Value: "a", + }, }, }, }, &stmt.For{ + Position: &position.Position{ + StartLine: 91, + EndLine: 91, + StartPos: 2056, + EndPos: 2090, + }, Init: []node.Node{ &assign.Assign{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "i"}}, - Expression: &scalar.Lnumber{Value: "0"}, + Position: &position.Position{ + StartLine: 91, + EndLine: 91, + StartPos: 2060, + EndPos: 2065, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 91, + EndLine: 91, + StartPos: 2060, + EndPos: 2061, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 91, + EndLine: 91, + StartPos: 2060, + EndPos: 2061, + }, + Value: "i", + }, + }, + Expression: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 91, + EndLine: 91, + StartPos: 2065, + EndPos: 2065, + }, + Value: "0", + }, }, }, Cond: []node.Node{ &binary.Smaller{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "i"}}, - Right: &scalar.Lnumber{Value: "10"}, + Position: &position.Position{ + StartLine: 91, + EndLine: 91, + StartPos: 2068, + EndPos: 2074, + }, + Left: &expr.Variable{ + Position: &position.Position{ + StartLine: 91, + EndLine: 91, + StartPos: 2068, + EndPos: 2069, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 91, + EndLine: 91, + StartPos: 2068, + EndPos: 2069, + }, + Value: "i", + }, + }, + Right: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 91, + EndLine: 91, + StartPos: 2073, + EndPos: 2074, + }, + Value: "10", + }, }, }, Loop: []node.Node{ &expr.PostInc{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "i"}}, + Position: &position.Position{ + StartLine: 91, + EndLine: 91, + StartPos: 2077, + EndPos: 2080, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 91, + EndLine: 91, + StartPos: 2077, + EndPos: 2078, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 91, + EndLine: 91, + StartPos: 2077, + EndPos: 2078, + }, + Value: "i", + }, + }, }, &expr.PostInc{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "i"}}, + Position: &position.Position{ + StartLine: 91, + EndLine: 91, + StartPos: 2083, + EndPos: 2086, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 91, + EndLine: 91, + StartPos: 2083, + EndPos: 2084, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 91, + EndLine: 91, + StartPos: 2083, + EndPos: 2084, + }, + Value: "i", + }, + }, + }, + }, + Stmt: &stmt.StmtList{ + Position: &position.Position{ + StartLine: 91, + EndLine: 91, + StartPos: 2089, + EndPos: 2090, + }, + Stmts: []node.Node{ }, }, - Stmt: &stmt.StmtList{Stmts: []node.Node{}}, }, &stmt.AltFor{ + Position: &position.Position{ + StartLine: 92, + EndLine: 92, + StartPos: 2094, + EndPos: 2129, + }, Cond: []node.Node{ &binary.Smaller{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "i"}}, - Right: &scalar.Lnumber{Value: "10"}, + Position: &position.Position{ + StartLine: 92, + EndLine: 92, + StartPos: 2100, + EndPos: 2106, + }, + Left: &expr.Variable{ + Position: &position.Position{ + StartLine: 92, + EndLine: 92, + StartPos: 2100, + EndPos: 2101, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 92, + EndLine: 92, + StartPos: 2100, + EndPos: 2101, + }, + Value: "i", + }, + }, + Right: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 92, + EndLine: 92, + StartPos: 2105, + EndPos: 2106, + }, + Value: "10", + }, }, }, Loop: []node.Node{ &expr.PostInc{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "i"}}, + Position: &position.Position{ + StartLine: 92, + EndLine: 92, + StartPos: 2109, + EndPos: 2112, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 92, + EndLine: 92, + StartPos: 2109, + EndPos: 2110, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 92, + EndLine: 92, + StartPos: 2109, + EndPos: 2110, + }, + Value: "i", + }, + }, }, &expr.PostInc{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "i"}}, + Position: &position.Position{ + StartLine: 92, + EndLine: 92, + StartPos: 2115, + EndPos: 2118, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 92, + EndLine: 92, + StartPos: 2115, + EndPos: 2116, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 92, + EndLine: 92, + StartPos: 2115, + EndPos: 2116, + }, + Value: "i", + }, + }, + }, + }, + Stmt: &stmt.StmtList{ + Position: &position.Position{ + StartLine: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, + }, + Stmts: []node.Node{ }, }, - Stmt: &stmt.StmtList{Stmts: []node.Node{}}, }, &stmt.Foreach{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "v"}}, - Stmt: &stmt.StmtList{Stmts: []node.Node{}}, + Position: &position.Position{ + StartLine: 93, + EndLine: 93, + StartPos: 2133, + EndPos: 2153, + }, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 93, + EndLine: 93, + StartPos: 2142, + EndPos: 2143, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 93, + EndLine: 93, + StartPos: 2142, + EndPos: 2143, + }, + Value: "a", + }, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 93, + EndLine: 93, + StartPos: 2148, + EndPos: 2149, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 93, + EndLine: 93, + StartPos: 2148, + EndPos: 2149, + }, + Value: "v", + }, + }, + Stmt: &stmt.StmtList{ + Position: &position.Position{ + StartLine: 93, + EndLine: 93, + StartPos: 2152, + EndPos: 2153, + }, + Stmts: []node.Node{ + }, + }, }, &stmt.AltForeach{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "v"}}, - Stmt: &stmt.StmtList{Stmts: []node.Node{}}, + Position: &position.Position{ + StartLine: 94, + EndLine: 94, + StartPos: 2157, + EndPos: 2188, + }, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 94, + EndLine: 94, + StartPos: 2166, + EndPos: 2167, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 94, + EndLine: 94, + StartPos: 2166, + EndPos: 2167, + }, + Value: "a", + }, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 94, + EndLine: 94, + StartPos: 2172, + EndPos: 2173, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 94, + EndLine: 94, + StartPos: 2172, + EndPos: 2173, + }, + Value: "v", + }, + }, + Stmt: &stmt.StmtList{ + Position: &position.Position{ + StartLine: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, + }, + Stmts: []node.Node{ + }, + }, }, &stmt.Foreach{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Key: &expr.Variable{VarName: &node.Identifier{Value: "k"}}, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "v"}}, - Stmt: &stmt.StmtList{Stmts: []node.Node{}}, + Position: &position.Position{ + StartLine: 95, + EndLine: 95, + StartPos: 2192, + EndPos: 2218, + }, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 95, + EndLine: 95, + StartPos: 2201, + EndPos: 2202, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 95, + EndLine: 95, + StartPos: 2201, + EndPos: 2202, + }, + Value: "a", + }, + }, + Key: &expr.Variable{ + Position: &position.Position{ + StartLine: 95, + EndLine: 95, + StartPos: 2207, + EndPos: 2208, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 95, + EndLine: 95, + StartPos: 2207, + EndPos: 2208, + }, + Value: "k", + }, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 95, + EndLine: 95, + StartPos: 2213, + EndPos: 2214, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 95, + EndLine: 95, + StartPos: 2213, + EndPos: 2214, + }, + Value: "v", + }, + }, + Stmt: &stmt.StmtList{ + Position: &position.Position{ + StartLine: 95, + EndLine: 95, + StartPos: 2217, + EndPos: 2218, + }, + Stmts: []node.Node{ + }, + }, }, &stmt.Foreach{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Key: &expr.Variable{VarName: &node.Identifier{Value: "k"}}, + Position: &position.Position{ + StartLine: 96, + EndLine: 96, + StartPos: 2222, + EndPos: 2249, + }, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 96, + EndLine: 96, + StartPos: 2231, + EndPos: 2232, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 96, + EndLine: 96, + StartPos: 2231, + EndPos: 2232, + }, + Value: "a", + }, + }, + Key: &expr.Variable{ + Position: &position.Position{ + StartLine: 96, + EndLine: 96, + StartPos: 2237, + EndPos: 2238, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 96, + EndLine: 96, + StartPos: 2237, + EndPos: 2238, + }, + Value: "k", + }, + }, Variable: &expr.Reference{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "v"}}, + Position: &position.Position{ + StartLine: 96, + EndLine: 96, + StartPos: 2243, + EndPos: 2245, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 96, + EndLine: 96, + StartPos: 2244, + EndPos: 2245, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 96, + EndLine: 96, + StartPos: 2244, + EndPos: 2245, + }, + Value: "v", + }, + }, + }, + Stmt: &stmt.StmtList{ + Position: &position.Position{ + StartLine: 96, + EndLine: 96, + StartPos: 2248, + EndPos: 2249, + }, + Stmts: []node.Node{ + }, }, - Stmt: &stmt.StmtList{Stmts: []node.Node{}}, }, &stmt.Foreach{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Key: &expr.Variable{VarName: &node.Identifier{Value: "k"}}, + Position: &position.Position{ + StartLine: 97, + EndLine: 97, + StartPos: 2253, + EndPos: 2285, + }, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 97, + EndLine: 97, + StartPos: 2262, + EndPos: 2263, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 97, + EndLine: 97, + StartPos: 2262, + EndPos: 2263, + }, + Value: "a", + }, + }, + Key: &expr.Variable{ + Position: &position.Position{ + StartLine: 97, + EndLine: 97, + StartPos: 2268, + EndPos: 2269, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 97, + EndLine: 97, + StartPos: 2268, + EndPos: 2269, + }, + Value: "k", + }, + }, Variable: &expr.List{ + Position: &position.Position{ + StartLine: 97, + EndLine: 97, + StartPos: 2274, + EndPos: 2281, + }, Items: []node.Node{ &expr.ArrayItem{ - Val: &expr.Variable{VarName: &node.Identifier{Value: "v"}}, + Position: &position.Position{ + StartLine: 97, + EndLine: 97, + StartPos: 2279, + EndPos: 2280, + }, + Val: &expr.Variable{ + Position: &position.Position{ + StartLine: 97, + EndLine: 97, + StartPos: 2279, + EndPos: 2280, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 97, + EndLine: 97, + StartPos: 2279, + EndPos: 2280, + }, + Value: "v", + }, + }, }, }, }, - Stmt: &stmt.StmtList{Stmts: []node.Node{}}, + Stmt: &stmt.StmtList{ + Position: &position.Position{ + StartLine: 97, + EndLine: 97, + StartPos: 2284, + EndPos: 2285, + }, + Stmts: []node.Node{ + }, + }, }, &stmt.Foreach{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Key: &expr.Variable{VarName: &node.Identifier{Value: "k"}}, + Position: &position.Position{ + StartLine: 98, + EndLine: 98, + StartPos: 2289, + EndPos: 2317, + }, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 98, + EndLine: 98, + StartPos: 2298, + EndPos: 2299, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 98, + EndLine: 98, + StartPos: 2298, + EndPos: 2299, + }, + Value: "a", + }, + }, + Key: &expr.Variable{ + Position: &position.Position{ + StartLine: 98, + EndLine: 98, + StartPos: 2304, + EndPos: 2305, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 98, + EndLine: 98, + StartPos: 2304, + EndPos: 2305, + }, + Value: "k", + }, + }, Variable: &expr.ShortList{ + Position: &position.Position{ + StartLine: 98, + EndLine: 98, + StartPos: 2310, + EndPos: 2313, + }, Items: []node.Node{ &expr.ArrayItem{ - Val: &expr.Variable{VarName: &node.Identifier{Value: "v"}}, + Position: &position.Position{ + StartLine: 98, + EndLine: 98, + StartPos: 2311, + EndPos: 2312, + }, + Val: &expr.Variable{ + Position: &position.Position{ + StartLine: 98, + EndLine: 98, + StartPos: 2311, + EndPos: 2312, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 98, + EndLine: 98, + StartPos: 2311, + EndPos: 2312, + }, + Value: "v", + }, + }, }, }, }, - Stmt: &stmt.StmtList{Stmts: []node.Node{}}, - }, - &stmt.Function{ - ReturnsRef: false, - PhpDocComment: "", - FunctionName: &node.Identifier{Value: "foo"}, - Stmts: []node.Node{}, - }, - &stmt.Function{ - ReturnsRef: false, - PhpDocComment: "", - FunctionName: &node.Identifier{Value: "foo"}, - Stmts: []node.Node{ - &stmt.Return{}, + Stmt: &stmt.StmtList{ + Position: &position.Position{ + StartLine: 98, + EndLine: 98, + StartPos: 2316, + EndPos: 2317, + }, + Stmts: []node.Node{ + }, }, }, &stmt.Function{ - ReturnsRef: true, + Position: &position.Position{ + StartLine: 99, + EndLine: 99, + StartPos: 2321, + EndPos: 2337, + }, + ReturnsRef: false, PhpDocComment: "", - FunctionName: &node.Identifier{Value: "foo"}, + FunctionName: &node.Identifier{ + Position: &position.Position{ + StartLine: 99, + EndLine: 99, + StartPos: 2330, + EndPos: 2332, + }, + Value: "foo", + }, + Stmts: []node.Node{ + }, + }, + &stmt.Function{ + Position: &position.Position{ + StartLine: 100, + EndLine: 100, + StartPos: 2341, + EndPos: 2364, + }, + ReturnsRef: false, + PhpDocComment: "", + FunctionName: &node.Identifier{ + Position: &position.Position{ + StartLine: 100, + EndLine: 100, + StartPos: 2350, + EndPos: 2352, + }, + Value: "foo", + }, Stmts: []node.Node{ &stmt.Return{ - Expr: &scalar.Lnumber{Value: "1"}, + Position: &position.Position{ + StartLine: 100, + EndLine: 100, + StartPos: 2357, + EndPos: 2363, + }, }, }, }, &stmt.Function{ - ReturnsRef: true, + Position: &position.Position{ + StartLine: 101, + EndLine: 101, + StartPos: 2368, + EndPos: 2394, + }, + ReturnsRef: true, PhpDocComment: "", - FunctionName: &node.Identifier{Value: "foo"}, - ReturnType: &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "void"}, + FunctionName: &node.Identifier{ + Position: &position.Position{ + StartLine: 101, + EndLine: 101, + StartPos: 2378, + EndPos: 2380, + }, + Value: "foo", + }, + Stmts: []node.Node{ + &stmt.Return{ + Position: &position.Position{ + StartLine: 101, + EndLine: 101, + StartPos: 2385, + EndPos: 2393, + }, + Expr: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 101, + EndLine: 101, + StartPos: 2392, + EndPos: 2392, + }, + Value: "1", + }, }, }, - Stmts: []node.Node{}, + }, + &stmt.Function{ + Position: &position.Position{ + StartLine: 102, + EndLine: 102, + StartPos: 2398, + EndPos: 2421, + }, + ReturnsRef: true, + PhpDocComment: "", + FunctionName: &node.Identifier{ + Position: &position.Position{ + StartLine: 102, + EndLine: 102, + StartPos: 2408, + EndPos: 2410, + }, + Value: "foo", + }, + ReturnType: &name.Name{ + Position: &position.Position{ + StartLine: 102, + EndLine: 102, + StartPos: 2415, + EndPos: 2418, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 102, + EndLine: 102, + StartPos: 2415, + EndPos: 2418, + }, + Value: "void", + }, + }, + }, + Stmts: []node.Node{ + }, }, &stmt.Global{ + Position: &position.Position{ + StartLine: 103, + EndLine: 103, + StartPos: 2425, + EndPos: 2438, + }, Vars: []node.Node{ - &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + &expr.Variable{ + Position: &position.Position{ + StartLine: 103, + EndLine: 103, + StartPos: 2432, + EndPos: 2433, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 103, + EndLine: 103, + StartPos: 2432, + EndPos: 2433, + }, + Value: "a", + }, + }, + &expr.Variable{ + Position: &position.Position{ + StartLine: 103, + EndLine: 103, + StartPos: 2436, + EndPos: 2437, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 103, + EndLine: 103, + StartPos: 2436, + EndPos: 2437, + }, + Value: "b", + }, + }, }, }, &stmt.Label{ - LabelName: &node.Identifier{Value: "a"}, + Position: &position.Position{ + StartLine: 104, + EndLine: 104, + StartPos: 2442, + EndPos: 2443, + }, + LabelName: &node.Identifier{ + Position: &position.Position{ + StartLine: 104, + EndLine: 104, + StartPos: 2442, + EndPos: 2442, + }, + Value: "a", + }, }, &stmt.Goto{ - Label: &node.Identifier{Value: "a"}, + Position: &position.Position{ + StartLine: 105, + EndLine: 105, + StartPos: 2448, + EndPos: 2454, + }, + Label: &node.Identifier{ + Position: &position.Position{ + StartLine: 105, + EndLine: 105, + StartPos: 2453, + EndPos: 2453, + }, + Value: "a", + }, }, - &stmt.HaltCompiler{}, - &stmt.If{ - Cond: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Stmt: &stmt.StmtList{Stmts: []node.Node{}}, + &stmt.HaltCompiler{ + Position: &position.Position{ + StartLine: 106, + EndLine: 106, + StartPos: 2458, + EndPos: 2475, + }, }, &stmt.If{ - Cond: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Stmt: &stmt.StmtList{Stmts: []node.Node{}}, - ElseIf: []node.Node{ - &stmt.ElseIf{ - Cond: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - Stmt: &stmt.StmtList{Stmts: []node.Node{}}, + Position: &position.Position{ + StartLine: 107, + EndLine: 107, + StartPos: 2479, + EndPos: 2488, + }, + Cond: &expr.Variable{ + Position: &position.Position{ + StartLine: 107, + EndLine: 107, + StartPos: 2483, + EndPos: 2484, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 107, + EndLine: 107, + StartPos: 2483, + EndPos: 2484, + }, + Value: "a", + }, + }, + Stmt: &stmt.StmtList{ + Position: &position.Position{ + StartLine: 107, + EndLine: 107, + StartPos: 2487, + EndPos: 2488, + }, + Stmts: []node.Node{ }, }, }, &stmt.If{ - Cond: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Stmt: &stmt.StmtList{Stmts: []node.Node{}}, - Else: &stmt.Else{ - Stmt: &stmt.StmtList{Stmts: []node.Node{}}, + Position: &position.Position{ + StartLine: 108, + EndLine: 108, + StartPos: 2492, + EndPos: 2516, + }, + Cond: &expr.Variable{ + Position: &position.Position{ + StartLine: 108, + EndLine: 108, + StartPos: 2496, + EndPos: 2497, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 108, + EndLine: 108, + StartPos: 2496, + EndPos: 2497, + }, + Value: "a", + }, + }, + Stmt: &stmt.StmtList{ + Position: &position.Position{ + StartLine: 108, + EndLine: 108, + StartPos: 2500, + EndPos: 2501, + }, + Stmts: []node.Node{ + }, + }, + ElseIf: []node.Node{ + &stmt.ElseIf{ + Position: &position.Position{ + StartLine: 108, + EndLine: 108, + StartPos: 2503, + EndPos: 2516, + }, + Cond: &expr.Variable{ + Position: &position.Position{ + StartLine: 108, + EndLine: 108, + StartPos: 2511, + EndPos: 2512, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 108, + EndLine: 108, + StartPos: 2511, + EndPos: 2512, + }, + Value: "b", + }, + }, + Stmt: &stmt.StmtList{ + Position: &position.Position{ + StartLine: 108, + EndLine: 108, + StartPos: 2515, + EndPos: 2516, + }, + Stmts: []node.Node{ + }, + }, + }, }, }, &stmt.If{ - Cond: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Stmt: &stmt.StmtList{Stmts: []node.Node{}}, - ElseIf: []node.Node{ - &stmt.ElseIf{ - Cond: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - Stmt: &stmt.StmtList{Stmts: []node.Node{}}, + Position: &position.Position{ + StartLine: 109, + EndLine: 109, + StartPos: 2520, + EndPos: 2537, + }, + Cond: &expr.Variable{ + Position: &position.Position{ + StartLine: 109, + EndLine: 109, + StartPos: 2524, + EndPos: 2525, }, - &stmt.ElseIf{ - Cond: &expr.Variable{VarName: &node.Identifier{Value: "c"}}, - Stmt: &stmt.StmtList{Stmts: []node.Node{}}, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 109, + EndLine: 109, + StartPos: 2524, + EndPos: 2525, + }, + Value: "a", + }, + }, + Stmt: &stmt.StmtList{ + Position: &position.Position{ + StartLine: 109, + EndLine: 109, + StartPos: 2528, + EndPos: 2529, + }, + Stmts: []node.Node{ }, }, Else: &stmt.Else{ - Stmt: &stmt.StmtList{Stmts: []node.Node{}}, + Position: &position.Position{ + StartLine: 109, + EndLine: 109, + StartPos: 2531, + EndPos: 2537, + }, + Stmt: &stmt.StmtList{ + Position: &position.Position{ + StartLine: 109, + EndLine: 109, + StartPos: 2536, + EndPos: 2537, + }, + Stmts: []node.Node{ + }, + }, }, }, &stmt.If{ - Cond: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Stmt: &stmt.StmtList{Stmts: []node.Node{}}, + Position: &position.Position{ + StartLine: 110, + EndLine: 110, + StartPos: 2541, + EndPos: 2588, + }, + Cond: &expr.Variable{ + Position: &position.Position{ + StartLine: 110, + EndLine: 110, + StartPos: 2545, + EndPos: 2546, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 110, + EndLine: 110, + StartPos: 2545, + EndPos: 2546, + }, + Value: "a", + }, + }, + Stmt: &stmt.StmtList{ + Position: &position.Position{ + StartLine: 110, + EndLine: 110, + StartPos: 2549, + EndPos: 2550, + }, + Stmts: []node.Node{ + }, + }, ElseIf: []node.Node{ &stmt.ElseIf{ - Cond: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - Stmt: &stmt.StmtList{Stmts: []node.Node{}}, + Position: &position.Position{ + StartLine: 110, + EndLine: 110, + StartPos: 2552, + EndPos: 2565, + }, + Cond: &expr.Variable{ + Position: &position.Position{ + StartLine: 110, + EndLine: 110, + StartPos: 2560, + EndPos: 2561, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 110, + EndLine: 110, + StartPos: 2560, + EndPos: 2561, + }, + Value: "b", + }, + }, + Stmt: &stmt.StmtList{ + Position: &position.Position{ + StartLine: 110, + EndLine: 110, + StartPos: 2564, + EndPos: 2565, + }, + Stmts: []node.Node{ + }, + }, + }, + &stmt.ElseIf{ + Position: &position.Position{ + StartLine: 110, + EndLine: 110, + StartPos: 2567, + EndPos: 2580, + }, + Cond: &expr.Variable{ + Position: &position.Position{ + StartLine: 110, + EndLine: 110, + StartPos: 2575, + EndPos: 2576, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 110, + EndLine: 110, + StartPos: 2575, + EndPos: 2576, + }, + Value: "c", + }, + }, + Stmt: &stmt.StmtList{ + Position: &position.Position{ + StartLine: 110, + EndLine: 110, + StartPos: 2579, + EndPos: 2580, + }, + Stmts: []node.Node{ + }, + }, }, }, Else: &stmt.Else{ + Position: &position.Position{ + StartLine: 110, + EndLine: 110, + StartPos: 2582, + EndPos: 2588, + }, + Stmt: &stmt.StmtList{ + Position: &position.Position{ + StartLine: 110, + EndLine: 110, + StartPos: 2587, + EndPos: 2588, + }, + Stmts: []node.Node{ + }, + }, + }, + }, + &stmt.If{ + Position: &position.Position{ + StartLine: 111, + EndLine: 111, + StartPos: 2592, + EndPos: 2640, + }, + Cond: &expr.Variable{ + Position: &position.Position{ + StartLine: 111, + EndLine: 111, + StartPos: 2596, + EndPos: 2597, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 111, + EndLine: 111, + StartPos: 2596, + EndPos: 2597, + }, + Value: "a", + }, + }, + Stmt: &stmt.StmtList{ + Position: &position.Position{ + StartLine: 111, + EndLine: 111, + StartPos: 2600, + EndPos: 2601, + }, + Stmts: []node.Node{ + }, + }, + ElseIf: []node.Node{ + &stmt.ElseIf{ + Position: &position.Position{ + StartLine: 111, + EndLine: 111, + StartPos: 2603, + EndPos: 2616, + }, + Cond: &expr.Variable{ + Position: &position.Position{ + StartLine: 111, + EndLine: 111, + StartPos: 2611, + EndPos: 2612, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 111, + EndLine: 111, + StartPos: 2611, + EndPos: 2612, + }, + Value: "b", + }, + }, + Stmt: &stmt.StmtList{ + Position: &position.Position{ + StartLine: 111, + EndLine: 111, + StartPos: 2615, + EndPos: 2616, + }, + Stmts: []node.Node{ + }, + }, + }, + }, + Else: &stmt.Else{ + Position: &position.Position{ + StartLine: 111, + EndLine: 111, + StartPos: 2618, + EndPos: 2640, + }, Stmt: &stmt.If{ - Cond: &expr.Variable{VarName: &node.Identifier{Value: "c"}}, - Stmt: &stmt.StmtList{Stmts: []node.Node{}}, + Position: &position.Position{ + StartLine: 111, + EndLine: 111, + StartPos: 2623, + EndPos: 2640, + }, + Cond: &expr.Variable{ + Position: &position.Position{ + StartLine: 111, + EndLine: 111, + StartPos: 2627, + EndPos: 2628, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 111, + EndLine: 111, + StartPos: 2627, + EndPos: 2628, + }, + Value: "c", + }, + }, + Stmt: &stmt.StmtList{ + Position: &position.Position{ + StartLine: 111, + EndLine: 111, + StartPos: 2631, + EndPos: 2632, + }, + Stmts: []node.Node{ + }, + }, Else: &stmt.Else{ - Stmt: &stmt.StmtList{Stmts: []node.Node{}}, + Position: &position.Position{ + StartLine: 111, + EndLine: 111, + StartPos: 2634, + EndPos: 2640, + }, + Stmt: &stmt.StmtList{ + Position: &position.Position{ + StartLine: 111, + EndLine: 111, + StartPos: 2639, + EndPos: 2640, + }, + Stmts: []node.Node{ + }, + }, }, }, }, }, - &stmt.Nop{}, - &stmt.InlineHtml{Value: "
"}, - &stmt.Interface{ - PhpDocComment: "", - InterfaceName: &node.Identifier{Value: "Foo"}, - Stmts: []node.Node{}, + &stmt.Nop{ + Position: &position.Position{ + StartLine: 112, + EndLine: 112, + StartPos: 2644, + EndPos: 2645, + }, + }, + &stmt.InlineHtml{ + Position: &position.Position{ + StartLine: 112, + EndLine: 112, + StartPos: 2647, + EndPos: 2658, + }, + Value: "
", }, &stmt.Interface{ + Position: &position.Position{ + StartLine: 113, + EndLine: 113, + StartPos: 2664, + EndPos: 2679, + }, PhpDocComment: "", - InterfaceName: &node.Identifier{Value: "Foo"}, + InterfaceName: &node.Identifier{ + Position: &position.Position{ + StartLine: 113, + EndLine: 113, + StartPos: 2674, + EndPos: 2676, + }, + Value: "Foo", + }, + Stmts: []node.Node{ + }, + }, + &stmt.Interface{ + Position: &position.Position{ + StartLine: 114, + EndLine: 114, + StartPos: 2683, + EndPos: 2710, + }, + PhpDocComment: "", + InterfaceName: &node.Identifier{ + Position: &position.Position{ + StartLine: 114, + EndLine: 114, + StartPos: 2693, + EndPos: 2695, + }, + Value: "Foo", + }, Extends: &stmt.InterfaceExtends{ + Position: &position.Position{ + StartLine: 114, + EndLine: 114, + StartPos: 2697, + EndPos: 2707, + }, InterfaceNames: []node.Node{ &name.Name{ + Position: &position.Position{ + StartLine: 114, + EndLine: 114, + StartPos: 2705, + EndPos: 2707, + }, Parts: []node.Node{ - &name.NamePart{Value: "Bar"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 114, + EndLine: 114, + StartPos: 2705, + EndPos: 2707, + }, + Value: "Bar", + }, }, }, }, }, - Stmts: []node.Node{}, + Stmts: []node.Node{ + }, }, &stmt.Interface{ + Position: &position.Position{ + StartLine: 115, + EndLine: 115, + StartPos: 2714, + EndPos: 2746, + }, PhpDocComment: "", - InterfaceName: &node.Identifier{Value: "Foo"}, + InterfaceName: &node.Identifier{ + Position: &position.Position{ + StartLine: 115, + EndLine: 115, + StartPos: 2724, + EndPos: 2726, + }, + Value: "Foo", + }, Extends: &stmt.InterfaceExtends{ + Position: &position.Position{ + StartLine: 115, + EndLine: 115, + StartPos: 2728, + EndPos: 2743, + }, InterfaceNames: []node.Node{ &name.Name{ + Position: &position.Position{ + StartLine: 115, + EndLine: 115, + StartPos: 2736, + EndPos: 2738, + }, Parts: []node.Node{ - &name.NamePart{Value: "Bar"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 115, + EndLine: 115, + StartPos: 2736, + EndPos: 2738, + }, + Value: "Bar", + }, }, }, &name.Name{ + Position: &position.Position{ + StartLine: 115, + EndLine: 115, + StartPos: 2741, + EndPos: 2743, + }, Parts: []node.Node{ - &name.NamePart{Value: "Baz"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 115, + EndLine: 115, + StartPos: 2741, + EndPos: 2743, + }, + Value: "Baz", + }, }, }, }, }, - Stmts: []node.Node{}, + Stmts: []node.Node{ + }, }, &stmt.Namespace{ + Position: &position.Position{ + StartLine: 116, + EndLine: 116, + StartPos: 2750, + EndPos: 2763, + }, NamespaceName: &name.Name{ + Position: &position.Position{ + StartLine: 116, + EndLine: 116, + StartPos: 2760, + EndPos: 2762, + }, Parts: []node.Node{ - &name.NamePart{Value: "Foo"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 116, + EndLine: 116, + StartPos: 2760, + EndPos: 2762, + }, + Value: "Foo", + }, }, }, }, &stmt.Namespace{ + Position: &position.Position{ + StartLine: 117, + EndLine: 117, + StartPos: 2767, + EndPos: 2782, + }, NamespaceName: &name.Name{ + Position: &position.Position{ + StartLine: 117, + EndLine: 117, + StartPos: 2777, + EndPos: 2779, + }, Parts: []node.Node{ - &name.NamePart{Value: "Foo"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 117, + EndLine: 117, + StartPos: 2777, + EndPos: 2779, + }, + Value: "Foo", + }, }, }, - Stmts: []node.Node{}, + Stmts: []node.Node{ + }, }, &stmt.Namespace{ - Stmts: []node.Node{}, + Position: &position.Position{ + StartLine: 118, + EndLine: 118, + StartPos: 2786, + EndPos: 2797, + }, + Stmts: []node.Node{ + }, }, &stmt.Class{ - ClassName: &node.Identifier{Value: "foo"}, + Position: &position.Position{ + StartLine: 119, + EndLine: 119, + StartPos: 2801, + EndPos: 2819, + }, + PhpDocComment: "", + ClassName: &node.Identifier{ + Position: &position.Position{ + StartLine: 119, + EndLine: 119, + StartPos: 2807, + EndPos: 2809, + }, + Value: "foo", + }, Stmts: []node.Node{ &stmt.PropertyList{ + Position: &position.Position{ + StartLine: 119, + EndLine: 119, + StartPos: 2812, + EndPos: 2818, + }, Modifiers: []node.Node{ - &node.Identifier{Value: "var"}, + &node.Identifier{ + Position: &position.Position{ + StartLine: 119, + EndLine: 119, + StartPos: 2812, + EndPos: 2814, + }, + Value: "var", + }, }, Properties: []node.Node{ &stmt.Property{ + Position: &position.Position{ + StartLine: 119, + EndLine: 119, + StartPos: 2816, + EndPos: 2817, + }, PhpDocComment: "", - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 119, + EndLine: 119, + StartPos: 2816, + EndPos: 2817, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 119, + EndLine: 119, + StartPos: 2816, + EndPos: 2817, + }, + Value: "a", + }, + }, }, }, }, }, }, &stmt.Class{ - ClassName: &node.Identifier{Value: "foo"}, + Position: &position.Position{ + StartLine: 120, + EndLine: 120, + StartPos: 2823, + EndPos: 2859, + }, + PhpDocComment: "", + ClassName: &node.Identifier{ + Position: &position.Position{ + StartLine: 120, + EndLine: 120, + StartPos: 2829, + EndPos: 2831, + }, + Value: "foo", + }, Stmts: []node.Node{ &stmt.PropertyList{ + Position: &position.Position{ + StartLine: 120, + EndLine: 120, + StartPos: 2834, + EndPos: 2858, + }, Modifiers: []node.Node{ - &node.Identifier{Value: "public"}, - &node.Identifier{Value: "static"}, + &node.Identifier{ + Position: &position.Position{ + StartLine: 120, + EndLine: 120, + StartPos: 2834, + EndPos: 2839, + }, + Value: "public", + }, + &node.Identifier{ + Position: &position.Position{ + StartLine: 120, + EndLine: 120, + StartPos: 2841, + EndPos: 2846, + }, + Value: "static", + }, }, Properties: []node.Node{ &stmt.Property{ + Position: &position.Position{ + StartLine: 120, + EndLine: 120, + StartPos: 2848, + EndPos: 2849, + }, PhpDocComment: "", - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 120, + EndLine: 120, + StartPos: 2848, + EndPos: 2849, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 120, + EndLine: 120, + StartPos: 2848, + EndPos: 2849, + }, + Value: "a", + }, + }, }, &stmt.Property{ + Position: &position.Position{ + StartLine: 120, + EndLine: 120, + StartPos: 2852, + EndPos: 2857, + }, PhpDocComment: "", - Variable: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - Expr: &scalar.Lnumber{Value: "1"}, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 120, + EndLine: 120, + StartPos: 2852, + EndPos: 2853, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 120, + EndLine: 120, + StartPos: 2852, + EndPos: 2853, + }, + Value: "b", + }, + }, + Expr: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 120, + EndLine: 120, + StartPos: 2857, + EndPos: 2857, + }, + Value: "1", + }, }, }, }, }, }, &stmt.Static{ + Position: &position.Position{ + StartLine: 121, + EndLine: 121, + StartPos: 2863, + EndPos: 2880, + }, Vars: []node.Node{ &stmt.StaticVar{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Position: &position.Position{ + StartLine: 121, + EndLine: 121, + StartPos: 2870, + EndPos: 2871, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 121, + EndLine: 121, + StartPos: 2870, + EndPos: 2871, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 121, + EndLine: 121, + StartPos: 2870, + EndPos: 2871, + }, + Value: "a", + }, + }, }, &stmt.StaticVar{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - Expr: &scalar.Lnumber{Value: "1"}, + Position: &position.Position{ + StartLine: 121, + EndLine: 121, + StartPos: 2874, + EndPos: 2879, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 121, + EndLine: 121, + StartPos: 2874, + EndPos: 2875, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 121, + EndLine: 121, + StartPos: 2874, + EndPos: 2875, + }, + Value: "b", + }, + }, + Expr: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 121, + EndLine: 121, + StartPos: 2879, + EndPos: 2879, + }, + Value: "1", + }, }, }, }, &stmt.AltSwitch{ - Cond: &scalar.Lnumber{Value: "1"}, + Position: &position.Position{ + StartLine: 123, + EndLine: 127, + StartPos: 2885, + EndPos: 2943, + }, + Cond: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 123, + EndLine: 123, + StartPos: 2893, + EndPos: 2893, + }, + Value: "1", + }, CaseList: &stmt.CaseList{ + Position: &position.Position{ + StartLine: 124, + EndLine: -1, + StartPos: 2901, + EndPos: -1, + }, Cases: []node.Node{ &stmt.Case{ - Cond: &scalar.Lnumber{Value: "1"}, - Stmts: []node.Node{}, + Position: &position.Position{ + StartLine: 124, + EndLine: -1, + StartPos: 2901, + EndPos: -1, + }, + Cond: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 124, + EndLine: 124, + StartPos: 2906, + EndPos: 2906, + }, + Value: "1", + }, + Stmts: []node.Node{ + }, }, &stmt.Default{ - Stmts: []node.Node{}, + Position: &position.Position{ + StartLine: 125, + EndLine: -1, + StartPos: 2912, + EndPos: -1, + }, + Stmts: []node.Node{ + }, }, &stmt.Case{ - Cond: &scalar.Lnumber{Value: "2"}, - Stmts: []node.Node{}, + Position: &position.Position{ + StartLine: 126, + EndLine: -1, + StartPos: 2924, + EndPos: -1, + }, + Cond: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 126, + EndLine: 126, + StartPos: 2929, + EndPos: 2929, + }, + Value: "2", + }, + Stmts: []node.Node{ + }, }, }, }, }, &stmt.AltSwitch{ - Cond: &scalar.Lnumber{Value: "1"}, - CaseList: &stmt.CaseList{ - Cases: []node.Node{ - &stmt.Case{ - Cond: &scalar.Lnumber{Value: "1"}, - Stmts: []node.Node{}, - }, - &stmt.Case{ - Cond: &scalar.Lnumber{Value: "2"}, - Stmts: []node.Node{}, - }, - }, + Position: &position.Position{ + StartLine: 129, + EndLine: 132, + StartPos: 2948, + EndPos: 2995, + }, + Cond: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 129, + EndLine: 129, + StartPos: 2956, + EndPos: 2956, + }, + Value: "1", }, - }, - &stmt.Switch{ - Cond: &scalar.Lnumber{Value: "1"}, CaseList: &stmt.CaseList{ + Position: &position.Position{ + StartLine: 130, + EndLine: -1, + StartPos: 2965, + EndPos: -1, + }, Cases: []node.Node{ &stmt.Case{ - Cond: &scalar.Lnumber{Value: "1"}, + Position: &position.Position{ + StartLine: 130, + EndLine: -1, + StartPos: 2965, + EndPos: -1, + }, + Cond: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 130, + EndLine: 130, + StartPos: 2970, + EndPos: 2970, + }, + Value: "1", + }, Stmts: []node.Node{ - &stmt.Break{}, }, }, &stmt.Case{ - Cond: &scalar.Lnumber{Value: "2"}, + Position: &position.Position{ + StartLine: 131, + EndLine: -1, + StartPos: 2976, + EndPos: -1, + }, + Cond: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 131, + EndLine: 131, + StartPos: 2981, + EndPos: 2981, + }, + Value: "2", + }, Stmts: []node.Node{ - &stmt.Break{}, }, }, }, }, }, &stmt.Switch{ - Cond: &scalar.Lnumber{Value: "1"}, + Position: &position.Position{ + StartLine: 134, + EndLine: 137, + StartPos: 3002, + EndPos: 3053, + }, + Cond: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 134, + EndLine: 134, + StartPos: 3010, + EndPos: 3010, + }, + Value: "1", + }, CaseList: &stmt.CaseList{ + Position: &position.Position{ + StartLine: 134, + EndLine: 137, + StartPos: 3013, + EndPos: 3053, + }, Cases: []node.Node{ &stmt.Case{ - Cond: &scalar.Lnumber{Value: "1"}, + Position: &position.Position{ + StartLine: 135, + EndLine: 135, + StartPos: 3018, + EndPos: 3031, + }, + Cond: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 135, + EndLine: 135, + StartPos: 3023, + EndPos: 3023, + }, + Value: "1", + }, Stmts: []node.Node{ - &stmt.Break{}, + &stmt.Break{ + Position: &position.Position{ + StartLine: 135, + EndLine: 135, + StartPos: 3026, + EndPos: 3031, + }, + }, }, }, &stmt.Case{ - Cond: &scalar.Lnumber{Value: "2"}, + Position: &position.Position{ + StartLine: 136, + EndLine: 136, + StartPos: 3036, + EndPos: 3049, + }, + Cond: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 136, + EndLine: 136, + StartPos: 3041, + EndPos: 3041, + }, + Value: "2", + }, Stmts: []node.Node{ - &stmt.Break{}, + &stmt.Break{ + Position: &position.Position{ + StartLine: 136, + EndLine: 136, + StartPos: 3044, + EndPos: 3049, + }, + }, + }, + }, + }, + }, + }, + &stmt.Switch{ + Position: &position.Position{ + StartLine: 139, + EndLine: 142, + StartPos: 3060, + EndPos: 3112, + }, + Cond: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 139, + EndLine: 139, + StartPos: 3068, + EndPos: 3068, + }, + Value: "1", + }, + CaseList: &stmt.CaseList{ + Position: &position.Position{ + StartLine: 139, + EndLine: 142, + StartPos: 3071, + EndPos: 3112, + }, + Cases: []node.Node{ + &stmt.Case{ + Position: &position.Position{ + StartLine: 140, + EndLine: 140, + StartPos: 3077, + EndPos: 3090, + }, + Cond: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 140, + EndLine: 140, + StartPos: 3082, + EndPos: 3082, + }, + Value: "1", + }, + Stmts: []node.Node{ + &stmt.Break{ + Position: &position.Position{ + StartLine: 140, + EndLine: 140, + StartPos: 3085, + EndPos: 3090, + }, + }, + }, + }, + &stmt.Case{ + Position: &position.Position{ + StartLine: 141, + EndLine: 141, + StartPos: 3095, + EndPos: 3108, + }, + Cond: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 141, + EndLine: 141, + StartPos: 3100, + EndPos: 3100, + }, + Value: "2", + }, + Stmts: []node.Node{ + &stmt.Break{ + Position: &position.Position{ + StartLine: 141, + EndLine: 141, + StartPos: 3103, + EndPos: 3108, + }, + }, }, }, }, }, }, &stmt.Throw{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "e"}}, + Position: &position.Position{ + StartLine: 144, + EndLine: 144, + StartPos: 3117, + EndPos: 3125, + }, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 144, + EndLine: 144, + StartPos: 3123, + EndPos: 3124, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 144, + EndLine: 144, + StartPos: 3123, + EndPos: 3124, + }, + Value: "e", + }, + }, }, &stmt.Trait{ + Position: &position.Position{ + StartLine: 146, + EndLine: 146, + StartPos: 3130, + EndPos: 3141, + }, PhpDocComment: "", - TraitName: &node.Identifier{Value: "Foo"}, - Stmts: []node.Node{}, + TraitName: &node.Identifier{ + Position: &position.Position{ + StartLine: 146, + EndLine: 146, + StartPos: 3136, + EndPos: 3138, + }, + Value: "Foo", + }, + Stmts: []node.Node{ + }, }, &stmt.Class{ + Position: &position.Position{ + StartLine: 147, + EndLine: 147, + StartPos: 3145, + EndPos: 3166, + }, PhpDocComment: "", - ClassName: &node.Identifier{Value: "Foo"}, + ClassName: &node.Identifier{ + Position: &position.Position{ + StartLine: 147, + EndLine: 147, + StartPos: 3151, + EndPos: 3153, + }, + Value: "Foo", + }, Stmts: []node.Node{ &stmt.TraitUse{ + Position: &position.Position{ + StartLine: 147, + EndLine: 147, + StartPos: 3157, + EndPos: 3164, + }, Traits: []node.Node{ &name.Name{ + Position: &position.Position{ + StartLine: 147, + EndLine: 147, + StartPos: 3161, + EndPos: 3163, + }, Parts: []node.Node{ - &name.NamePart{Value: "Bar"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 147, + EndLine: 147, + StartPos: 3161, + EndPos: 3163, + }, + Value: "Bar", + }, }, }, }, @@ -1491,50 +6813,187 @@ func TestPhp7(t *testing.T) { }, }, &stmt.Class{ - PhpDocComment: "", - ClassName: &node.Identifier{Value: "Foo"}, - Stmts: []node.Node{ - &stmt.TraitUse{ - Traits: []node.Node{ - &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "Bar"}, - }, - }, - &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "Baz"}, - }, - }, - }, - TraitAdaptationList: &stmt.TraitAdaptationList{}, - }, + Position: &position.Position{ + StartLine: 148, + EndLine: 148, + StartPos: 3170, + EndPos: 3198, }, - }, - &stmt.Class{ PhpDocComment: "", - ClassName: &node.Identifier{Value: "Foo"}, + ClassName: &node.Identifier{ + Position: &position.Position{ + StartLine: 148, + EndLine: 148, + StartPos: 3176, + EndPos: 3178, + }, + Value: "Foo", + }, Stmts: []node.Node{ &stmt.TraitUse{ + Position: &position.Position{ + StartLine: 148, + EndLine: 148, + StartPos: 3182, + EndPos: 3196, + }, Traits: []node.Node{ &name.Name{ + Position: &position.Position{ + StartLine: 148, + EndLine: 148, + StartPos: 3186, + EndPos: 3188, + }, Parts: []node.Node{ - &name.NamePart{Value: "Bar"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 148, + EndLine: 148, + StartPos: 3186, + EndPos: 3188, + }, + Value: "Bar", + }, }, }, &name.Name{ + Position: &position.Position{ + StartLine: 148, + EndLine: 148, + StartPos: 3191, + EndPos: 3193, + }, Parts: []node.Node{ - &name.NamePart{Value: "Baz"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 148, + EndLine: 148, + StartPos: 3191, + EndPos: 3193, + }, + Value: "Baz", + }, }, }, }, TraitAdaptationList: &stmt.TraitAdaptationList{ + Position: &position.Position{ + StartLine: 148, + EndLine: 148, + StartPos: 3195, + EndPos: 3196, + }, + }, + }, + }, + }, + &stmt.Class{ + Position: &position.Position{ + StartLine: 149, + EndLine: 149, + StartPos: 3202, + EndPos: 3247, + }, + PhpDocComment: "", + ClassName: &node.Identifier{ + Position: &position.Position{ + StartLine: 149, + EndLine: 149, + StartPos: 3208, + EndPos: 3210, + }, + Value: "Foo", + }, + Stmts: []node.Node{ + &stmt.TraitUse{ + Position: &position.Position{ + StartLine: 149, + EndLine: 149, + StartPos: 3214, + EndPos: 3245, + }, + Traits: []node.Node{ + &name.Name{ + Position: &position.Position{ + StartLine: 149, + EndLine: 149, + StartPos: 3218, + EndPos: 3220, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 149, + EndLine: 149, + StartPos: 3218, + EndPos: 3220, + }, + Value: "Bar", + }, + }, + }, + &name.Name{ + Position: &position.Position{ + StartLine: 149, + EndLine: 149, + StartPos: 3223, + EndPos: 3225, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 149, + EndLine: 149, + StartPos: 3223, + EndPos: 3225, + }, + Value: "Baz", + }, + }, + }, + }, + TraitAdaptationList: &stmt.TraitAdaptationList{ + Position: &position.Position{ + StartLine: 149, + EndLine: 149, + StartPos: 3227, + EndPos: 3245, + }, Adaptations: []node.Node{ &stmt.TraitUseAlias{ - Ref: &stmt.TraitMethodRef{ - Method: &node.Identifier{Value: "one"}, + Position: &position.Position{ + StartLine: 149, + EndLine: 149, + StartPos: 3229, + EndPos: 3242, + }, + Ref: &stmt.TraitMethodRef{ + Position: &position.Position{ + StartLine: 149, + EndLine: 149, + StartPos: 3229, + EndPos: 3231, + }, + Method: &node.Identifier{ + Position: &position.Position{ + StartLine: 149, + EndLine: 149, + StartPos: 3229, + EndPos: 3231, + }, + Value: "one", + }, + }, + Alias: &node.Identifier{ + Position: &position.Position{ + StartLine: 149, + EndLine: 149, + StartPos: 3236, + EndPos: 3242, + }, + Value: "include", }, - Alias: &node.Identifier{Value: "include"}, }, }, }, @@ -1542,29 +7001,111 @@ func TestPhp7(t *testing.T) { }, }, &stmt.Class{ + Position: &position.Position{ + StartLine: 150, + EndLine: 150, + StartPos: 3251, + EndPos: 3295, + }, PhpDocComment: "", - ClassName: &node.Identifier{Value: "Foo"}, + ClassName: &node.Identifier{ + Position: &position.Position{ + StartLine: 150, + EndLine: 150, + StartPos: 3257, + EndPos: 3259, + }, + Value: "Foo", + }, Stmts: []node.Node{ &stmt.TraitUse{ + Position: &position.Position{ + StartLine: 150, + EndLine: 150, + StartPos: 3263, + EndPos: 3293, + }, Traits: []node.Node{ &name.Name{ + Position: &position.Position{ + StartLine: 150, + EndLine: 150, + StartPos: 3267, + EndPos: 3269, + }, Parts: []node.Node{ - &name.NamePart{Value: "Bar"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 150, + EndLine: 150, + StartPos: 3267, + EndPos: 3269, + }, + Value: "Bar", + }, }, }, &name.Name{ + Position: &position.Position{ + StartLine: 150, + EndLine: 150, + StartPos: 3272, + EndPos: 3274, + }, Parts: []node.Node{ - &name.NamePart{Value: "Baz"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 150, + EndLine: 150, + StartPos: 3272, + EndPos: 3274, + }, + Value: "Baz", + }, }, }, }, TraitAdaptationList: &stmt.TraitAdaptationList{ + Position: &position.Position{ + StartLine: 150, + EndLine: 150, + StartPos: 3276, + EndPos: 3293, + }, Adaptations: []node.Node{ &stmt.TraitUseAlias{ - Ref: &stmt.TraitMethodRef{ - Method: &node.Identifier{Value: "one"}, + Position: &position.Position{ + StartLine: 150, + EndLine: 150, + StartPos: 3278, + EndPos: 3290, + }, + Ref: &stmt.TraitMethodRef{ + Position: &position.Position{ + StartLine: 150, + EndLine: 150, + StartPos: 3278, + EndPos: 3280, + }, + Method: &node.Identifier{ + Position: &position.Position{ + StartLine: 150, + EndLine: 150, + StartPos: 3278, + EndPos: 3280, + }, + Value: "one", + }, + }, + Modifier: &node.Identifier{ + Position: &position.Position{ + StartLine: 150, + EndLine: 150, + StartPos: 3285, + EndPos: 3290, + }, + Value: "public", }, - Modifier: &node.Identifier{Value: "public"}, }, }, }, @@ -1572,30 +7113,120 @@ func TestPhp7(t *testing.T) { }, }, &stmt.Class{ + Position: &position.Position{ + StartLine: 151, + EndLine: 151, + StartPos: 3299, + EndPos: 3347, + }, PhpDocComment: "", - ClassName: &node.Identifier{Value: "Foo"}, + ClassName: &node.Identifier{ + Position: &position.Position{ + StartLine: 151, + EndLine: 151, + StartPos: 3305, + EndPos: 3307, + }, + Value: "Foo", + }, Stmts: []node.Node{ &stmt.TraitUse{ + Position: &position.Position{ + StartLine: 151, + EndLine: 151, + StartPos: 3311, + EndPos: 3345, + }, Traits: []node.Node{ &name.Name{ + Position: &position.Position{ + StartLine: 151, + EndLine: 151, + StartPos: 3315, + EndPos: 3317, + }, Parts: []node.Node{ - &name.NamePart{Value: "Bar"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 151, + EndLine: 151, + StartPos: 3315, + EndPos: 3317, + }, + Value: "Bar", + }, }, }, &name.Name{ + Position: &position.Position{ + StartLine: 151, + EndLine: 151, + StartPos: 3320, + EndPos: 3322, + }, Parts: []node.Node{ - &name.NamePart{Value: "Baz"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 151, + EndLine: 151, + StartPos: 3320, + EndPos: 3322, + }, + Value: "Baz", + }, }, }, }, TraitAdaptationList: &stmt.TraitAdaptationList{ + Position: &position.Position{ + StartLine: 151, + EndLine: 151, + StartPos: 3324, + EndPos: 3345, + }, Adaptations: []node.Node{ &stmt.TraitUseAlias{ - Ref: &stmt.TraitMethodRef{ - Method: &node.Identifier{Value: "one"}, + Position: &position.Position{ + StartLine: 151, + EndLine: 151, + StartPos: 3326, + EndPos: 3342, + }, + Ref: &stmt.TraitMethodRef{ + Position: &position.Position{ + StartLine: 151, + EndLine: 151, + StartPos: 3326, + EndPos: 3328, + }, + Method: &node.Identifier{ + Position: &position.Position{ + StartLine: 151, + EndLine: 151, + StartPos: 3326, + EndPos: 3328, + }, + Value: "one", + }, + }, + Modifier: &node.Identifier{ + Position: &position.Position{ + StartLine: 151, + EndLine: 151, + StartPos: 3333, + EndPos: 3338, + }, + Value: "public", + }, + Alias: &node.Identifier{ + Position: &position.Position{ + StartLine: 151, + EndLine: 151, + StartPos: 3340, + EndPos: 3342, + }, + Value: "two", }, - Modifier: &node.Identifier{Value: "public"}, - Alias: &node.Identifier{Value: "two"}, }, }, }, @@ -1603,56 +7234,214 @@ func TestPhp7(t *testing.T) { }, }, &stmt.Class{ + Position: &position.Position{ + StartLine: 152, + EndLine: 152, + StartPos: 3351, + EndPos: 3427, + }, PhpDocComment: "", - ClassName: &node.Identifier{Value: "Foo"}, + ClassName: &node.Identifier{ + Position: &position.Position{ + StartLine: 152, + EndLine: 152, + StartPos: 3357, + EndPos: 3359, + }, + Value: "Foo", + }, Stmts: []node.Node{ &stmt.TraitUse{ + Position: &position.Position{ + StartLine: 152, + EndLine: 152, + StartPos: 3363, + EndPos: 3425, + }, Traits: []node.Node{ &name.Name{ + Position: &position.Position{ + StartLine: 152, + EndLine: 152, + StartPos: 3367, + EndPos: 3369, + }, Parts: []node.Node{ - &name.NamePart{Value: "Bar"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 152, + EndLine: 152, + StartPos: 3367, + EndPos: 3369, + }, + Value: "Bar", + }, }, }, &name.Name{ + Position: &position.Position{ + StartLine: 152, + EndLine: 152, + StartPos: 3372, + EndPos: 3374, + }, Parts: []node.Node{ - &name.NamePart{Value: "Baz"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 152, + EndLine: 152, + StartPos: 3372, + EndPos: 3374, + }, + Value: "Baz", + }, }, }, }, TraitAdaptationList: &stmt.TraitAdaptationList{ + Position: &position.Position{ + StartLine: 152, + EndLine: 152, + StartPos: 3376, + EndPos: 3425, + }, Adaptations: []node.Node{ &stmt.TraitUsePrecedence{ + Position: &position.Position{ + StartLine: 152, + EndLine: 152, + StartPos: 3378, + EndPos: 3405, + }, Ref: &stmt.TraitMethodRef{ + Position: &position.Position{ + StartLine: 152, + EndLine: 152, + StartPos: 3378, + EndPos: 3385, + }, Trait: &name.Name{ + Position: &position.Position{ + StartLine: 152, + EndLine: 152, + StartPos: 3378, + EndPos: 3380, + }, Parts: []node.Node{ - &name.NamePart{Value: "Bar"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 152, + EndLine: 152, + StartPos: 3378, + EndPos: 3380, + }, + Value: "Bar", + }, }, }, - Method: &node.Identifier{Value: "one"}, + Method: &node.Identifier{ + Position: &position.Position{ + StartLine: 152, + EndLine: 152, + StartPos: 3383, + EndPos: 3385, + }, + Value: "one", + }, }, Insteadof: []node.Node{ &name.Name{ + Position: &position.Position{ + StartLine: 152, + EndLine: 152, + StartPos: 3397, + EndPos: 3399, + }, Parts: []node.Node{ - &name.NamePart{Value: "Baz"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 152, + EndLine: 152, + StartPos: 3397, + EndPos: 3399, + }, + Value: "Baz", + }, }, }, &name.Name{ + Position: &position.Position{ + StartLine: 152, + EndLine: 152, + StartPos: 3402, + EndPos: 3405, + }, Parts: []node.Node{ - &name.NamePart{Value: "Quux"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 152, + EndLine: 152, + StartPos: 3402, + EndPos: 3405, + }, + Value: "Quux", + }, }, }, }, }, &stmt.TraitUseAlias{ + Position: &position.Position{ + StartLine: 152, + EndLine: 152, + StartPos: 3408, + EndPos: 3422, + }, Ref: &stmt.TraitMethodRef{ + Position: &position.Position{ + StartLine: 152, + EndLine: 152, + StartPos: 3408, + EndPos: 3415, + }, Trait: &name.Name{ + Position: &position.Position{ + StartLine: 152, + EndLine: 152, + StartPos: 3408, + EndPos: 3410, + }, Parts: []node.Node{ - &name.NamePart{Value: "Baz"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 152, + EndLine: 152, + StartPos: 3408, + EndPos: 3410, + }, + Value: "Baz", + }, }, }, - Method: &node.Identifier{Value: "one"}, + Method: &node.Identifier{ + Position: &position.Position{ + StartLine: 152, + EndLine: 152, + StartPos: 3413, + EndPos: 3415, + }, + Value: "one", + }, + }, + Alias: &node.Identifier{ + Position: &position.Position{ + StartLine: 152, + EndLine: 152, + StartPos: 3420, + EndPos: 3422, + }, + Value: "two", }, - Alias: &node.Identifier{Value: "two"}, }, }, }, @@ -1660,1555 +7449,8747 @@ func TestPhp7(t *testing.T) { }, }, &stmt.Try{ - Stmts: []node.Node{}, - Catches: []node.Node{}, + Position: &position.Position{ + StartLine: 154, + EndLine: -1, + StartPos: 3432, + EndPos: -1, + }, + Stmts: []node.Node{ + }, + Catches: []node.Node{ + }, }, &stmt.Try{ - Stmts: []node.Node{}, + Position: &position.Position{ + StartLine: 155, + EndLine: 155, + StartPos: 3441, + EndPos: 3470, + }, + Stmts: []node.Node{ + }, Catches: []node.Node{ &stmt.Catch{ + Position: &position.Position{ + StartLine: 155, + EndLine: 155, + StartPos: 3448, + EndPos: 3470, + }, Types: []node.Node{ &name.Name{ + Position: &position.Position{ + StartLine: 155, + EndLine: 155, + StartPos: 3455, + EndPos: 3463, + }, Parts: []node.Node{ - &name.NamePart{Value: "Exception"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 155, + EndLine: 155, + StartPos: 3455, + EndPos: 3463, + }, + Value: "Exception", + }, }, }, }, Variable: &expr.Variable{ - VarName: &node.Identifier{Value: "e"}, + Position: &position.Position{ + StartLine: 155, + EndLine: 155, + StartPos: 3465, + EndPos: 3466, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 155, + EndLine: 155, + StartPos: 3465, + EndPos: 3466, + }, + Value: "e", + }, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, }, }, &stmt.Try{ - Stmts: []node.Node{}, + Position: &position.Position{ + StartLine: 156, + EndLine: 156, + StartPos: 3474, + EndPos: 3520, + }, + Stmts: []node.Node{ + }, Catches: []node.Node{ &stmt.Catch{ + Position: &position.Position{ + StartLine: 156, + EndLine: 156, + StartPos: 3481, + EndPos: 3520, + }, Types: []node.Node{ &name.Name{ + Position: &position.Position{ + StartLine: 156, + EndLine: 156, + StartPos: 3488, + EndPos: 3496, + }, Parts: []node.Node{ - &name.NamePart{Value: "Exception"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 156, + EndLine: 156, + StartPos: 3488, + EndPos: 3496, + }, + Value: "Exception", + }, }, }, &name.Name{ + Position: &position.Position{ + StartLine: 156, + EndLine: 156, + StartPos: 3498, + EndPos: 3513, + }, Parts: []node.Node{ - &name.NamePart{Value: "RuntimeException"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 156, + EndLine: 156, + StartPos: 3498, + EndPos: 3513, + }, + Value: "RuntimeException", + }, }, }, }, Variable: &expr.Variable{ - VarName: &node.Identifier{Value: "e"}, + Position: &position.Position{ + StartLine: 156, + EndLine: 156, + StartPos: 3515, + EndPos: 3516, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 156, + EndLine: 156, + StartPos: 3515, + EndPos: 3516, + }, + Value: "e", + }, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, }, }, &stmt.Try{ - Stmts: []node.Node{}, + Position: &position.Position{ + StartLine: 157, + EndLine: 157, + StartPos: 3524, + EndPos: 3584, + }, + Stmts: []node.Node{ + }, Catches: []node.Node{ &stmt.Catch{ + Position: &position.Position{ + StartLine: 157, + EndLine: 157, + StartPos: 3531, + EndPos: 3553, + }, Types: []node.Node{ &name.Name{ + Position: &position.Position{ + StartLine: 157, + EndLine: 157, + StartPos: 3538, + EndPos: 3546, + }, Parts: []node.Node{ - &name.NamePart{Value: "Exception"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 157, + EndLine: 157, + StartPos: 3538, + EndPos: 3546, + }, + Value: "Exception", + }, }, }, }, Variable: &expr.Variable{ - VarName: &node.Identifier{Value: "e"}, + Position: &position.Position{ + StartLine: 157, + EndLine: 157, + StartPos: 3548, + EndPos: 3549, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 157, + EndLine: 157, + StartPos: 3548, + EndPos: 3549, + }, + Value: "e", + }, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, &stmt.Catch{ + Position: &position.Position{ + StartLine: 157, + EndLine: 157, + StartPos: 3555, + EndPos: 3584, + }, Types: []node.Node{ &name.Name{ + Position: &position.Position{ + StartLine: 157, + EndLine: 157, + StartPos: 3562, + EndPos: 3577, + }, Parts: []node.Node{ - &name.NamePart{Value: "RuntimeException"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 157, + EndLine: 157, + StartPos: 3562, + EndPos: 3577, + }, + Value: "RuntimeException", + }, }, }, }, Variable: &expr.Variable{ - VarName: &node.Identifier{Value: "e"}, + Position: &position.Position{ + StartLine: 157, + EndLine: 157, + StartPos: 3579, + EndPos: 3580, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 157, + EndLine: 157, + StartPos: 3579, + EndPos: 3580, + }, + Value: "e", + }, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, }, }, &stmt.Try{ - Stmts: []node.Node{}, + Position: &position.Position{ + StartLine: 158, + EndLine: 158, + StartPos: 3588, + EndPos: 3628, + }, + Stmts: []node.Node{ + }, Catches: []node.Node{ &stmt.Catch{ + Position: &position.Position{ + StartLine: 158, + EndLine: 158, + StartPos: 3595, + EndPos: 3617, + }, Types: []node.Node{ &name.Name{ + Position: &position.Position{ + StartLine: 158, + EndLine: 158, + StartPos: 3602, + EndPos: 3610, + }, Parts: []node.Node{ - &name.NamePart{Value: "Exception"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 158, + EndLine: 158, + StartPos: 3602, + EndPos: 3610, + }, + Value: "Exception", + }, }, }, }, Variable: &expr.Variable{ - VarName: &node.Identifier{Value: "e"}, + Position: &position.Position{ + StartLine: 158, + EndLine: 158, + StartPos: 3612, + EndPos: 3613, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 158, + EndLine: 158, + StartPos: 3612, + EndPos: 3613, + }, + Value: "e", + }, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, }, Finally: &stmt.Finally{ - Stmts: []node.Node{}, + Position: &position.Position{ + StartLine: 158, + EndLine: 158, + StartPos: 3619, + EndPos: 3628, + }, + Stmts: []node.Node{ + }, }, }, &stmt.Unset{ + Position: &position.Position{ + StartLine: 160, + EndLine: 160, + StartPos: 3633, + EndPos: 3647, + }, Vars: []node.Node{ - &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + &expr.Variable{ + Position: &position.Position{ + StartLine: 160, + EndLine: 160, + StartPos: 3639, + EndPos: 3640, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 160, + EndLine: 160, + StartPos: 3639, + EndPos: 3640, + }, + Value: "a", + }, + }, + &expr.Variable{ + Position: &position.Position{ + StartLine: 160, + EndLine: 160, + StartPos: 3643, + EndPos: 3644, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 160, + EndLine: 160, + StartPos: 3643, + EndPos: 3644, + }, + Value: "b", + }, + }, }, }, &stmt.UseList{ + Position: &position.Position{ + StartLine: 162, + EndLine: 162, + StartPos: 3652, + EndPos: 3659, + }, Uses: []node.Node{ &stmt.Use{ + Position: &position.Position{ + StartLine: 162, + EndLine: 162, + StartPos: 3656, + EndPos: 3658, + }, Use: &name.Name{ + Position: &position.Position{ + StartLine: 162, + EndLine: 162, + StartPos: 3656, + EndPos: 3658, + }, Parts: []node.Node{ - &name.NamePart{Value: "Foo"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 162, + EndLine: 162, + StartPos: 3656, + EndPos: 3658, + }, + Value: "Foo", + }, }, }, }, }, }, &stmt.UseList{ + Position: &position.Position{ + StartLine: 163, + EndLine: 163, + StartPos: 3663, + EndPos: 3671, + }, Uses: []node.Node{ &stmt.Use{ + Position: &position.Position{ + StartLine: 163, + EndLine: 163, + StartPos: 3668, + EndPos: 3670, + }, Use: &name.Name{ + Position: &position.Position{ + StartLine: 163, + EndLine: 163, + StartPos: 3668, + EndPos: 3670, + }, Parts: []node.Node{ - &name.NamePart{Value: "Foo"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 163, + EndLine: 163, + StartPos: 3668, + EndPos: 3670, + }, + Value: "Foo", + }, }, }, }, }, }, &stmt.UseList{ + Position: &position.Position{ + StartLine: 164, + EndLine: 164, + StartPos: 3675, + EndPos: 3690, + }, Uses: []node.Node{ &stmt.Use{ + Position: &position.Position{ + StartLine: 164, + EndLine: 164, + StartPos: 3680, + EndPos: 3689, + }, Use: &name.Name{ + Position: &position.Position{ + StartLine: 164, + EndLine: 164, + StartPos: 3680, + EndPos: 3682, + }, Parts: []node.Node{ - &name.NamePart{Value: "Foo"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 164, + EndLine: 164, + StartPos: 3680, + EndPos: 3682, + }, + Value: "Foo", + }, }, }, - Alias: &node.Identifier{Value: "Bar"}, + Alias: &node.Identifier{ + Position: &position.Position{ + StartLine: 164, + EndLine: 164, + StartPos: 3687, + EndPos: 3689, + }, + Value: "Bar", + }, }, }, }, &stmt.UseList{ + Position: &position.Position{ + StartLine: 165, + EndLine: 165, + StartPos: 3694, + EndPos: 3706, + }, Uses: []node.Node{ &stmt.Use{ + Position: &position.Position{ + StartLine: 165, + EndLine: 165, + StartPos: 3698, + EndPos: 3700, + }, Use: &name.Name{ + Position: &position.Position{ + StartLine: 165, + EndLine: 165, + StartPos: 3698, + EndPos: 3700, + }, Parts: []node.Node{ - &name.NamePart{Value: "Foo"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 165, + EndLine: 165, + StartPos: 3698, + EndPos: 3700, + }, + Value: "Foo", + }, }, }, }, &stmt.Use{ + Position: &position.Position{ + StartLine: 165, + EndLine: 165, + StartPos: 3703, + EndPos: 3705, + }, Use: &name.Name{ + Position: &position.Position{ + StartLine: 165, + EndLine: 165, + StartPos: 3703, + EndPos: 3705, + }, Parts: []node.Node{ - &name.NamePart{Value: "Bar"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 165, + EndLine: 165, + StartPos: 3703, + EndPos: 3705, + }, + Value: "Bar", + }, }, }, }, }, }, &stmt.UseList{ + Position: &position.Position{ + StartLine: 166, + EndLine: 166, + StartPos: 3710, + EndPos: 3729, + }, Uses: []node.Node{ &stmt.Use{ + Position: &position.Position{ + StartLine: 166, + EndLine: 166, + StartPos: 3714, + EndPos: 3716, + }, Use: &name.Name{ + Position: &position.Position{ + StartLine: 166, + EndLine: 166, + StartPos: 3714, + EndPos: 3716, + }, Parts: []node.Node{ - &name.NamePart{Value: "Foo"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 166, + EndLine: 166, + StartPos: 3714, + EndPos: 3716, + }, + Value: "Foo", + }, }, }, }, &stmt.Use{ + Position: &position.Position{ + StartLine: 166, + EndLine: 166, + StartPos: 3719, + EndPos: 3728, + }, Use: &name.Name{ + Position: &position.Position{ + StartLine: 166, + EndLine: 166, + StartPos: 3719, + EndPos: 3721, + }, Parts: []node.Node{ - &name.NamePart{Value: "Bar"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 166, + EndLine: 166, + StartPos: 3719, + EndPos: 3721, + }, + Value: "Bar", + }, }, }, - Alias: &node.Identifier{Value: "Baz"}, + Alias: &node.Identifier{ + Position: &position.Position{ + StartLine: 166, + EndLine: 166, + StartPos: 3726, + EndPos: 3728, + }, + Value: "Baz", + }, }, }, }, &stmt.UseList{ - UseType: &node.Identifier{Value: "function"}, + Position: &position.Position{ + StartLine: 167, + EndLine: 167, + StartPos: 3733, + EndPos: 3755, + }, + UseType: &node.Identifier{ + Position: &position.Position{ + StartLine: 167, + EndLine: 167, + StartPos: 3737, + EndPos: 3744, + }, + Value: "function", + }, Uses: []node.Node{ &stmt.Use{ + Position: &position.Position{ + StartLine: 167, + EndLine: 167, + StartPos: 3746, + EndPos: 3748, + }, Use: &name.Name{ + Position: &position.Position{ + StartLine: 167, + EndLine: 167, + StartPos: 3746, + EndPos: 3748, + }, Parts: []node.Node{ - &name.NamePart{Value: "Foo"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 167, + EndLine: 167, + StartPos: 3746, + EndPos: 3748, + }, + Value: "Foo", + }, }, }, }, &stmt.Use{ + Position: &position.Position{ + StartLine: 167, + EndLine: 167, + StartPos: 3752, + EndPos: 3754, + }, Use: &name.Name{ + Position: &position.Position{ + StartLine: 167, + EndLine: 167, + StartPos: 3752, + EndPos: 3754, + }, Parts: []node.Node{ - &name.NamePart{Value: "Bar"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 167, + EndLine: 167, + StartPos: 3752, + EndPos: 3754, + }, + Value: "Bar", + }, }, }, }, }, }, &stmt.UseList{ - UseType: &node.Identifier{Value: "function"}, + Position: &position.Position{ + StartLine: 168, + EndLine: 168, + StartPos: 3759, + EndPos: 3795, + }, + UseType: &node.Identifier{ + Position: &position.Position{ + StartLine: 168, + EndLine: 168, + StartPos: 3763, + EndPos: 3770, + }, + Value: "function", + }, Uses: []node.Node{ &stmt.Use{ + Position: &position.Position{ + StartLine: 168, + EndLine: 168, + StartPos: 3772, + EndPos: 3781, + }, Use: &name.Name{ + Position: &position.Position{ + StartLine: 168, + EndLine: 168, + StartPos: 3772, + EndPos: 3774, + }, Parts: []node.Node{ - &name.NamePart{Value: "Foo"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 168, + EndLine: 168, + StartPos: 3772, + EndPos: 3774, + }, + Value: "Foo", + }, }, }, - Alias: &node.Identifier{Value: "foo"}, + Alias: &node.Identifier{ + Position: &position.Position{ + StartLine: 168, + EndLine: 168, + StartPos: 3779, + EndPos: 3781, + }, + Value: "foo", + }, }, &stmt.Use{ + Position: &position.Position{ + StartLine: 168, + EndLine: 168, + StartPos: 3785, + EndPos: 3794, + }, Use: &name.Name{ + Position: &position.Position{ + StartLine: 168, + EndLine: 168, + StartPos: 3785, + EndPos: 3787, + }, Parts: []node.Node{ - &name.NamePart{Value: "Bar"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 168, + EndLine: 168, + StartPos: 3785, + EndPos: 3787, + }, + Value: "Bar", + }, }, }, - Alias: &node.Identifier{Value: "bar"}, + Alias: &node.Identifier{ + Position: &position.Position{ + StartLine: 168, + EndLine: 168, + StartPos: 3792, + EndPos: 3794, + }, + Value: "bar", + }, }, }, }, &stmt.UseList{ - UseType: &node.Identifier{Value: "const"}, + Position: &position.Position{ + StartLine: 169, + EndLine: 169, + StartPos: 3799, + EndPos: 3818, + }, + UseType: &node.Identifier{ + Position: &position.Position{ + StartLine: 169, + EndLine: 169, + StartPos: 3803, + EndPos: 3807, + }, + Value: "const", + }, Uses: []node.Node{ &stmt.Use{ + Position: &position.Position{ + StartLine: 169, + EndLine: 169, + StartPos: 3809, + EndPos: 3811, + }, Use: &name.Name{ + Position: &position.Position{ + StartLine: 169, + EndLine: 169, + StartPos: 3809, + EndPos: 3811, + }, Parts: []node.Node{ - &name.NamePart{Value: "Foo"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 169, + EndLine: 169, + StartPos: 3809, + EndPos: 3811, + }, + Value: "Foo", + }, }, }, }, &stmt.Use{ + Position: &position.Position{ + StartLine: 169, + EndLine: 169, + StartPos: 3815, + EndPos: 3817, + }, Use: &name.Name{ + Position: &position.Position{ + StartLine: 169, + EndLine: 169, + StartPos: 3815, + EndPos: 3817, + }, Parts: []node.Node{ - &name.NamePart{Value: "Bar"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 169, + EndLine: 169, + StartPos: 3815, + EndPos: 3817, + }, + Value: "Bar", + }, }, }, }, }, }, &stmt.UseList{ - UseType: &node.Identifier{Value: "const"}, + Position: &position.Position{ + StartLine: 170, + EndLine: 170, + StartPos: 3822, + EndPos: 3855, + }, + UseType: &node.Identifier{ + Position: &position.Position{ + StartLine: 170, + EndLine: 170, + StartPos: 3826, + EndPos: 3830, + }, + Value: "const", + }, Uses: []node.Node{ &stmt.Use{ + Position: &position.Position{ + StartLine: 170, + EndLine: 170, + StartPos: 3832, + EndPos: 3841, + }, Use: &name.Name{ + Position: &position.Position{ + StartLine: 170, + EndLine: 170, + StartPos: 3832, + EndPos: 3834, + }, Parts: []node.Node{ - &name.NamePart{Value: "Foo"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 170, + EndLine: 170, + StartPos: 3832, + EndPos: 3834, + }, + Value: "Foo", + }, }, }, - Alias: &node.Identifier{Value: "foo"}, + Alias: &node.Identifier{ + Position: &position.Position{ + StartLine: 170, + EndLine: 170, + StartPos: 3839, + EndPos: 3841, + }, + Value: "foo", + }, }, &stmt.Use{ + Position: &position.Position{ + StartLine: 170, + EndLine: 170, + StartPos: 3845, + EndPos: 3854, + }, Use: &name.Name{ + Position: &position.Position{ + StartLine: 170, + EndLine: 170, + StartPos: 3845, + EndPos: 3847, + }, Parts: []node.Node{ - &name.NamePart{Value: "Bar"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 170, + EndLine: 170, + StartPos: 3845, + EndPos: 3847, + }, + Value: "Bar", + }, }, }, - Alias: &node.Identifier{Value: "bar"}, + Alias: &node.Identifier{ + Position: &position.Position{ + StartLine: 170, + EndLine: 170, + StartPos: 3852, + EndPos: 3854, + }, + Value: "bar", + }, }, }, }, &stmt.GroupUse{ + Position: &position.Position{ + StartLine: 172, + EndLine: 172, + StartPos: 3860, + EndPos: 3879, + }, Prefix: &name.Name{ + Position: &position.Position{ + StartLine: 172, + EndLine: 172, + StartPos: 3865, + EndPos: 3867, + }, Parts: []node.Node{ - &name.NamePart{Value: "Foo"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 172, + EndLine: 172, + StartPos: 3865, + EndPos: 3867, + }, + Value: "Foo", + }, }, }, UseList: []node.Node{ &stmt.Use{ + Position: &position.Position{ + StartLine: 172, + EndLine: 172, + StartPos: 3870, + EndPos: 3872, + }, Use: &name.Name{ + Position: &position.Position{ + StartLine: 172, + EndLine: 172, + StartPos: 3870, + EndPos: 3872, + }, Parts: []node.Node{ - &name.NamePart{Value: "Bar"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 172, + EndLine: 172, + StartPos: 3870, + EndPos: 3872, + }, + Value: "Bar", + }, }, }, }, &stmt.Use{ + Position: &position.Position{ + StartLine: 172, + EndLine: 172, + StartPos: 3875, + EndPos: 3877, + }, Use: &name.Name{ + Position: &position.Position{ + StartLine: 172, + EndLine: 172, + StartPos: 3875, + EndPos: 3877, + }, Parts: []node.Node{ - &name.NamePart{Value: "Baz"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 172, + EndLine: 172, + StartPos: 3875, + EndPos: 3877, + }, + Value: "Baz", + }, }, }, }, }, }, &stmt.GroupUse{ + Position: &position.Position{ + StartLine: 173, + EndLine: 173, + StartPos: 3883, + EndPos: 3909, + }, Prefix: &name.Name{ + Position: &position.Position{ + StartLine: 173, + EndLine: 173, + StartPos: 3887, + EndPos: 3889, + }, Parts: []node.Node{ - &name.NamePart{Value: "Foo"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 173, + EndLine: 173, + StartPos: 3887, + EndPos: 3889, + }, + Value: "Foo", + }, }, }, UseList: []node.Node{ &stmt.Use{ + Position: &position.Position{ + StartLine: 173, + EndLine: 173, + StartPos: 3892, + EndPos: 3894, + }, Use: &name.Name{ + Position: &position.Position{ + StartLine: 173, + EndLine: 173, + StartPos: 3892, + EndPos: 3894, + }, Parts: []node.Node{ - &name.NamePart{Value: "Bar"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 173, + EndLine: 173, + StartPos: 3892, + EndPos: 3894, + }, + Value: "Bar", + }, }, }, }, &stmt.Use{ + Position: &position.Position{ + StartLine: 173, + EndLine: 173, + StartPos: 3897, + EndPos: 3907, + }, Use: &name.Name{ + Position: &position.Position{ + StartLine: 173, + EndLine: 173, + StartPos: 3897, + EndPos: 3899, + }, Parts: []node.Node{ - &name.NamePart{Value: "Baz"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 173, + EndLine: 173, + StartPos: 3897, + EndPos: 3899, + }, + Value: "Baz", + }, }, }, - Alias: &node.Identifier{Value: "quux"}, + Alias: &node.Identifier{ + Position: &position.Position{ + StartLine: 173, + EndLine: 173, + StartPos: 3904, + EndPos: 3907, + }, + Value: "quux", + }, }, }, }, &stmt.GroupUse{ - UseType: &node.Identifier{Value: "function"}, + Position: &position.Position{ + StartLine: 174, + EndLine: 174, + StartPos: 3913, + EndPos: 3940, + }, + UseType: &node.Identifier{ + Position: &position.Position{ + StartLine: 174, + EndLine: 174, + StartPos: 3917, + EndPos: 3924, + }, + Value: "function", + }, Prefix: &name.Name{ + Position: &position.Position{ + StartLine: 174, + EndLine: 174, + StartPos: 3926, + EndPos: 3928, + }, Parts: []node.Node{ - &name.NamePart{Value: "Foo"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 174, + EndLine: 174, + StartPos: 3926, + EndPos: 3928, + }, + Value: "Foo", + }, }, }, UseList: []node.Node{ &stmt.Use{ + Position: &position.Position{ + StartLine: 174, + EndLine: 174, + StartPos: 3931, + EndPos: 3933, + }, Use: &name.Name{ + Position: &position.Position{ + StartLine: 174, + EndLine: 174, + StartPos: 3931, + EndPos: 3933, + }, Parts: []node.Node{ - &name.NamePart{Value: "Bar"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 174, + EndLine: 174, + StartPos: 3931, + EndPos: 3933, + }, + Value: "Bar", + }, }, }, }, &stmt.Use{ + Position: &position.Position{ + StartLine: 174, + EndLine: 174, + StartPos: 3936, + EndPos: 3938, + }, Use: &name.Name{ + Position: &position.Position{ + StartLine: 174, + EndLine: 174, + StartPos: 3936, + EndPos: 3938, + }, Parts: []node.Node{ - &name.NamePart{Value: "Baz"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 174, + EndLine: 174, + StartPos: 3936, + EndPos: 3938, + }, + Value: "Baz", + }, }, }, }, }, }, &stmt.GroupUse{ - UseType: &node.Identifier{Value: "const"}, + Position: &position.Position{ + StartLine: 175, + EndLine: 175, + StartPos: 3944, + EndPos: 3969, + }, + UseType: &node.Identifier{ + Position: &position.Position{ + StartLine: 175, + EndLine: 175, + StartPos: 3948, + EndPos: 3952, + }, + Value: "const", + }, Prefix: &name.Name{ + Position: &position.Position{ + StartLine: 175, + EndLine: 175, + StartPos: 3955, + EndPos: 3957, + }, Parts: []node.Node{ - &name.NamePart{Value: "Foo"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 175, + EndLine: 175, + StartPos: 3955, + EndPos: 3957, + }, + Value: "Foo", + }, }, }, UseList: []node.Node{ &stmt.Use{ + Position: &position.Position{ + StartLine: 175, + EndLine: 175, + StartPos: 3960, + EndPos: 3962, + }, Use: &name.Name{ + Position: &position.Position{ + StartLine: 175, + EndLine: 175, + StartPos: 3960, + EndPos: 3962, + }, Parts: []node.Node{ - &name.NamePart{Value: "Bar"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 175, + EndLine: 175, + StartPos: 3960, + EndPos: 3962, + }, + Value: "Bar", + }, }, }, }, &stmt.Use{ + Position: &position.Position{ + StartLine: 175, + EndLine: 175, + StartPos: 3965, + EndPos: 3967, + }, Use: &name.Name{ + Position: &position.Position{ + StartLine: 175, + EndLine: 175, + StartPos: 3965, + EndPos: 3967, + }, Parts: []node.Node{ - &name.NamePart{Value: "Baz"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 175, + EndLine: 175, + StartPos: 3965, + EndPos: 3967, + }, + Value: "Baz", + }, }, }, }, }, }, &stmt.GroupUse{ + Position: &position.Position{ + StartLine: 176, + EndLine: 176, + StartPos: 3973, + EndPos: 4006, + }, Prefix: &name.Name{ + Position: &position.Position{ + StartLine: 176, + EndLine: 176, + StartPos: 3977, + EndPos: 3979, + }, Parts: []node.Node{ - &name.NamePart{Value: "Foo"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 176, + EndLine: 176, + StartPos: 3977, + EndPos: 3979, + }, + Value: "Foo", + }, }, }, UseList: []node.Node{ &stmt.Use{ - UseType: &node.Identifier{Value: "const"}, + Position: &position.Position{ + StartLine: 176, + EndLine: 176, + StartPos: 3988, + EndPos: 3990, + }, + UseType: &node.Identifier{ + Position: &position.Position{ + StartLine: 176, + EndLine: 176, + StartPos: 3982, + EndPos: 3986, + }, + Value: "const", + }, Use: &name.Name{ + Position: &position.Position{ + StartLine: 176, + EndLine: 176, + StartPos: 3988, + EndPos: 3990, + }, Parts: []node.Node{ - &name.NamePart{Value: "Bar"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 176, + EndLine: 176, + StartPos: 3988, + EndPos: 3990, + }, + Value: "Bar", + }, }, }, }, &stmt.Use{ - UseType: &node.Identifier{Value: "function"}, + Position: &position.Position{ + StartLine: 176, + EndLine: 176, + StartPos: 4002, + EndPos: 4004, + }, + UseType: &node.Identifier{ + Position: &position.Position{ + StartLine: 176, + EndLine: 176, + StartPos: 3993, + EndPos: 4000, + }, + Value: "function", + }, Use: &name.Name{ + Position: &position.Position{ + StartLine: 176, + EndLine: 176, + StartPos: 4002, + EndPos: 4004, + }, Parts: []node.Node{ - &name.NamePart{Value: "Baz"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 176, + EndLine: 176, + StartPos: 4002, + EndPos: 4004, + }, + Value: "Baz", + }, }, }, }, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 178, + EndLine: 178, + StartPos: 4011, + EndPos: 4016, + }, Expr: &expr.ArrayDimFetch{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Dim: &scalar.Lnumber{Value: "1"}, + Position: &position.Position{ + StartLine: 178, + EndLine: 178, + StartPos: 4011, + EndPos: 4015, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 178, + EndLine: 178, + StartPos: 4011, + EndPos: 4012, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 178, + EndLine: 178, + StartPos: 4011, + EndPos: 4012, + }, + Value: "a", + }, + }, + Dim: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 178, + EndLine: 178, + StartPos: 4014, + EndPos: 4014, + }, + Value: "1", + }, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 179, + EndLine: 179, + StartPos: 4020, + EndPos: 4028, + }, Expr: &expr.ArrayDimFetch{ + Position: &position.Position{ + StartLine: 179, + EndLine: 179, + StartPos: 4020, + EndPos: 4027, + }, Variable: &expr.ArrayDimFetch{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Dim: &scalar.Lnumber{Value: "1"}, + Position: &position.Position{ + StartLine: 179, + EndLine: 179, + StartPos: 4020, + EndPos: 4024, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 179, + EndLine: 179, + StartPos: 4020, + EndPos: 4021, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 179, + EndLine: 179, + StartPos: 4020, + EndPos: 4021, + }, + Value: "a", + }, + }, + Dim: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 179, + EndLine: 179, + StartPos: 4023, + EndPos: 4023, + }, + Value: "1", + }, + }, + Dim: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 179, + EndLine: 179, + StartPos: 4026, + EndPos: 4026, + }, + Value: "2", }, - Dim: &scalar.Lnumber{Value: "2"}, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 180, + EndLine: 180, + StartPos: 4032, + EndPos: 4039, + }, Expr: &expr.Array{ - Items: []node.Node{}, + Position: &position.Position{ + StartLine: 180, + EndLine: 180, + StartPos: 4032, + EndPos: 4038, + }, + Items: []node.Node{ + }, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 181, + EndLine: 181, + StartPos: 4043, + EndPos: 4051, + }, Expr: &expr.Array{ + Position: &position.Position{ + StartLine: 181, + EndLine: 181, + StartPos: 4043, + EndPos: 4050, + }, Items: []node.Node{ &expr.ArrayItem{ - Val: &scalar.Lnumber{Value: "1"}, + Position: &position.Position{ + StartLine: 181, + EndLine: 181, + StartPos: 4049, + EndPos: 4049, + }, + Val: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 181, + EndLine: 181, + StartPos: 4049, + EndPos: 4049, + }, + Value: "1", + }, }, }, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 182, + EndLine: 182, + StartPos: 4055, + EndPos: 4072, + }, Expr: &expr.Array{ + Position: &position.Position{ + StartLine: 182, + EndLine: 182, + StartPos: 4055, + EndPos: 4071, + }, Items: []node.Node{ &expr.ArrayItem{ - Key: &scalar.Lnumber{Value: "1"}, - Val: &scalar.Lnumber{Value: "1"}, + Position: &position.Position{ + StartLine: 182, + EndLine: 182, + StartPos: 4061, + EndPos: 4064, + }, + Key: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 182, + EndLine: 182, + StartPos: 4061, + EndPos: 4061, + }, + Value: "1", + }, + Val: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 182, + EndLine: 182, + StartPos: 4064, + EndPos: 4064, + }, + Value: "1", + }, }, &expr.ArrayItem{ - Val: &expr.Reference{Variable: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + Position: &position.Position{ + StartLine: 182, + EndLine: 182, + StartPos: 4067, + EndPos: 4069, + }, + Val: &expr.Reference{ + Position: &position.Position{ + StartLine: 182, + EndLine: 182, + StartPos: 4067, + EndPos: 4069, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 182, + EndLine: 182, + StartPos: 4068, + EndPos: 4069, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 182, + EndLine: 182, + StartPos: 4068, + EndPos: 4069, + }, + Value: "b", + }, + }, + }, }, }, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 183, + EndLine: 183, + StartPos: 4076, + EndPos: 4079, + }, Expr: &expr.BitwiseNot{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - }, - }, - &stmt.Expression{ - Expr: &expr.BooleanNot{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - }, - }, - &stmt.Expression{ - Expr: &expr.ClassConstFetch{ - Class: &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "Foo"}, + Position: &position.Position{ + StartLine: 183, + EndLine: 183, + StartPos: 4076, + EndPos: 4078, + }, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 183, + EndLine: 183, + StartPos: 4077, + EndPos: 4078, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 183, + EndLine: 183, + StartPos: 4077, + EndPos: 4078, + }, + Value: "a", }, }, - ConstantName: &node.Identifier{Value: "Bar"}, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 184, + EndLine: 184, + StartPos: 4083, + EndPos: 4086, + }, + Expr: &expr.BooleanNot{ + Position: &position.Position{ + StartLine: 184, + EndLine: 184, + StartPos: 4083, + EndPos: 4085, + }, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 184, + EndLine: 184, + StartPos: 4084, + EndPos: 4085, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 184, + EndLine: 184, + StartPos: 4084, + EndPos: 4085, + }, + Value: "a", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 186, + EndLine: 186, + StartPos: 4091, + EndPos: 4099, + }, Expr: &expr.ClassConstFetch{ - Class: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, - ConstantName: &node.Identifier{Value: "Bar"}, + Position: &position.Position{ + StartLine: 186, + EndLine: 186, + StartPos: 4091, + EndPos: 4098, + }, + Class: &name.Name{ + Position: &position.Position{ + StartLine: 186, + EndLine: 186, + StartPos: 4091, + EndPos: 4093, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 186, + EndLine: 186, + StartPos: 4091, + EndPos: 4093, + }, + Value: "Foo", + }, + }, + }, + ConstantName: &node.Identifier{ + Position: &position.Position{ + StartLine: 186, + EndLine: 186, + StartPos: 4096, + EndPos: 4098, + }, + Value: "Bar", + }, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 187, + EndLine: 187, + StartPos: 4103, + EndPos: 4112, + }, + Expr: &expr.ClassConstFetch{ + Position: &position.Position{ + StartLine: 187, + EndLine: 187, + StartPos: 4103, + EndPos: 4111, + }, + Class: &expr.Variable{ + Position: &position.Position{ + StartLine: 187, + EndLine: 187, + StartPos: 4103, + EndPos: 4106, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 187, + EndLine: 187, + StartPos: 4103, + EndPos: 4106, + }, + Value: "foo", + }, + }, + ConstantName: &node.Identifier{ + Position: &position.Position{ + StartLine: 187, + EndLine: 187, + StartPos: 4109, + EndPos: 4111, + }, + Value: "Bar", + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 188, + EndLine: 188, + StartPos: 4116, + EndPos: 4125, + }, Expr: &expr.Clone{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Position: &position.Position{ + StartLine: 188, + EndLine: 188, + StartPos: 4116, + EndPos: 4123, + }, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 188, + EndLine: 188, + StartPos: 4122, + EndPos: 4123, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 188, + EndLine: 188, + StartPos: 4122, + EndPos: 4123, + }, + Value: "a", + }, + }, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 189, + EndLine: 189, + StartPos: 4129, + EndPos: 4137, + }, Expr: &expr.Clone{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Position: &position.Position{ + StartLine: 189, + EndLine: 189, + StartPos: 4129, + EndPos: 4136, + }, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 189, + EndLine: 189, + StartPos: 4135, + EndPos: 4136, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 189, + EndLine: 189, + StartPos: 4135, + EndPos: 4136, + }, + Value: "a", + }, + }, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 190, + EndLine: 190, + StartPos: 4141, + EndPos: 4153, + }, Expr: &expr.Closure{ - ReturnsRef: false, - Static: false, + Position: &position.Position{ + StartLine: 190, + EndLine: 190, + StartPos: 4141, + EndPos: 4152, + }, + ReturnsRef: false, + Static: false, PhpDocComment: "", - Stmts: []node.Node{}, + Stmts: []node.Node{ + }, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 191, + EndLine: 191, + StartPos: 4157, + EndPos: 4190, + }, Expr: &expr.Closure{ - ReturnsRef: false, - Static: false, + Position: &position.Position{ + StartLine: 191, + EndLine: 191, + StartPos: 4157, + EndPos: 4189, + }, + Static: false, PhpDocComment: "", + ReturnsRef: false, Params: []node.Node{ &node.Parameter{ - ByRef: false, + Position: &position.Position{ + StartLine: 191, + EndLine: 191, + StartPos: 4166, + EndPos: 4167, + }, + ByRef: false, Variadic: false, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 191, + EndLine: 191, + StartPos: 4166, + EndPos: 4167, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 191, + EndLine: 191, + StartPos: 4166, + EndPos: 4167, + }, + Value: "a", + }, + }, }, &node.Parameter{ - ByRef: false, + Position: &position.Position{ + StartLine: 191, + EndLine: 191, + StartPos: 4170, + EndPos: 4171, + }, Variadic: false, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + ByRef: false, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 191, + EndLine: 191, + StartPos: 4170, + EndPos: 4171, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 191, + EndLine: 191, + StartPos: 4170, + EndPos: 4171, + }, + Value: "b", + }, + }, }, }, ClosureUse: &expr.ClosureUse{ + Position: &position.Position{ + StartLine: 191, + EndLine: 191, + StartPos: 4174, + EndPos: 4186, + }, Uses: []node.Node{ - &expr.Variable{VarName: &node.Identifier{Value: "c"}}, - &expr.Reference{Variable: &expr.Variable{VarName: &node.Identifier{Value: "d"}}}, + &expr.Variable{ + Position: &position.Position{ + StartLine: 191, + EndLine: 191, + StartPos: 4179, + EndPos: 4180, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 191, + EndLine: 191, + StartPos: 4179, + EndPos: 4180, + }, + Value: "c", + }, + }, + &expr.Reference{ + Position: &position.Position{ + StartLine: 191, + EndLine: 191, + StartPos: 4183, + EndPos: 4185, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 191, + EndLine: 191, + StartPos: 4184, + EndPos: 4185, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 191, + EndLine: 191, + StartPos: 4184, + EndPos: 4185, + }, + Value: "d", + }, + }, + }, }, }, - Stmts: []node.Node{}, + Stmts: []node.Node{ + }, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 192, + EndLine: 192, + StartPos: 4194, + EndPos: 4213, + }, Expr: &expr.Closure{ - ReturnsRef: false, - Static: false, + Position: &position.Position{ + StartLine: 192, + EndLine: 192, + StartPos: 4194, + EndPos: 4212, + }, + ReturnsRef: false, + Static: false, PhpDocComment: "", ReturnType: &name.Name{ - Parts: []node.Node{&name.NamePart{Value: "void"}}, + Position: &position.Position{ + StartLine: 192, + EndLine: 192, + StartPos: 4206, + EndPos: 4209, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 192, + EndLine: 192, + StartPos: 4206, + EndPos: 4209, + }, + Value: "void", + }, + }, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 193, + EndLine: 193, + StartPos: 4217, + EndPos: 4220, + }, Expr: &expr.ConstFetch{ - Constant: &name.Name{Parts: []node.Node{&name.NamePart{Value: "foo"}}}, + Position: &position.Position{ + StartLine: 193, + EndLine: 193, + StartPos: 4217, + EndPos: 4219, + }, + Constant: &name.Name{ + Position: &position.Position{ + StartLine: 193, + EndLine: 193, + StartPos: 4217, + EndPos: 4219, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 193, + EndLine: 193, + StartPos: 4217, + EndPos: 4219, + }, + Value: "foo", + }, + }, + }, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 194, + EndLine: 194, + StartPos: 4224, + EndPos: 4237, + }, Expr: &expr.ConstFetch{ - Constant: &name.Relative{Parts: []node.Node{&name.NamePart{Value: "foo"}}}, + Position: &position.Position{ + StartLine: 194, + EndLine: 194, + StartPos: 4224, + EndPos: 4236, + }, + Constant: &name.Relative{ + Position: &position.Position{ + StartLine: 194, + EndLine: 194, + StartPos: 4224, + EndPos: 4236, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 194, + EndLine: 194, + StartPos: 4234, + EndPos: 4236, + }, + Value: "foo", + }, + }, + }, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 195, + EndLine: 195, + StartPos: 4241, + EndPos: 4245, + }, Expr: &expr.ConstFetch{ - Constant: &name.FullyQualified{Parts: []node.Node{&name.NamePart{Value: "foo"}}}, + Position: &position.Position{ + StartLine: 195, + EndLine: 195, + StartPos: 4241, + EndPos: 4244, + }, + Constant: &name.FullyQualified{ + Position: &position.Position{ + StartLine: 195, + EndLine: 195, + StartPos: 4241, + EndPos: 4244, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 195, + EndLine: 195, + StartPos: 4242, + EndPos: 4244, + }, + Value: "foo", + }, + }, + }, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 197, + EndLine: 197, + StartPos: 4250, + EndPos: 4259, + }, Expr: &expr.Empty{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Position: &position.Position{ + StartLine: 197, + EndLine: 197, + StartPos: 4250, + EndPos: 4258, + }, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 197, + EndLine: 197, + StartPos: 4256, + EndPos: 4257, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 197, + EndLine: 197, + StartPos: 4256, + EndPos: 4257, + }, + Value: "a", + }, + }, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 198, + EndLine: 198, + StartPos: 4263, + EndPos: 4266, + }, Expr: &expr.ErrorSuppress{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Position: &position.Position{ + StartLine: 198, + EndLine: 198, + StartPos: 4263, + EndPos: 4265, + }, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 198, + EndLine: 198, + StartPos: 4264, + EndPos: 4265, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 198, + EndLine: 198, + StartPos: 4264, + EndPos: 4265, + }, + Value: "a", + }, + }, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 199, + EndLine: 199, + StartPos: 4270, + EndPos: 4278, + }, Expr: &expr.Eval{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Position: &position.Position{ + StartLine: 199, + EndLine: 199, + StartPos: 4270, + EndPos: 4277, + }, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 199, + EndLine: 199, + StartPos: 4275, + EndPos: 4276, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 199, + EndLine: 199, + StartPos: 4275, + EndPos: 4276, + }, + Value: "a", + }, + }, }, }, &stmt.Expression{ - Expr: &expr.Exit{}, - }, - &stmt.Expression{ + Position: &position.Position{ + StartLine: 200, + EndLine: 200, + StartPos: 4282, + EndPos: 4286, + }, Expr: &expr.Exit{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Position: &position.Position{ + StartLine: 200, + EndLine: 200, + StartPos: 4282, + EndPos: 4285, + }, }, }, &stmt.Expression{ - Expr: &expr.Die{}, + Position: &position.Position{ + StartLine: 201, + EndLine: 201, + StartPos: 4290, + EndPos: 4298, + }, + Expr: &expr.Exit{ + Position: &position.Position{ + StartLine: 201, + EndLine: 201, + StartPos: 4290, + EndPos: 4297, + }, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 201, + EndLine: 201, + StartPos: 4295, + EndPos: 4296, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 201, + EndLine: 201, + StartPos: 4295, + EndPos: 4296, + }, + Value: "a", + }, + }, + }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 202, + EndLine: 202, + StartPos: 4302, + EndPos: 4305, + }, Expr: &expr.Die{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Position: &position.Position{ + StartLine: 202, + EndLine: 202, + StartPos: 4302, + EndPos: 4304, + }, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 203, + EndLine: 203, + StartPos: 4309, + EndPos: 4316, + }, + Expr: &expr.Die{ + Position: &position.Position{ + StartLine: 203, + EndLine: 203, + StartPos: 4309, + EndPos: 4315, + }, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 203, + EndLine: 203, + StartPos: 4313, + EndPos: 4314, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 203, + EndLine: 203, + StartPos: 4313, + EndPos: 4314, + }, + Value: "a", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 204, + EndLine: 204, + StartPos: 4320, + EndPos: 4325, + }, Expr: &expr.FunctionCall{ + Position: &position.Position{ + StartLine: 204, + EndLine: 204, + StartPos: 4320, + EndPos: 4324, + }, Function: &name.Name{ + Position: &position.Position{ + StartLine: 204, + EndLine: 204, + StartPos: 4320, + EndPos: 4322, + }, Parts: []node.Node{ - &name.NamePart{Value: "foo"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 204, + EndLine: 204, + StartPos: 4320, + EndPos: 4322, + }, + Value: "foo", + }, + }, + }, + ArgumentList: &node.ArgumentList{ + Position: &position.Position{ + StartLine: 204, + EndLine: 204, + StartPos: 4323, + EndPos: 4324, }, }, - - ArgumentList: &node.ArgumentList{}, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 205, + EndLine: 205, + StartPos: 4329, + EndPos: 4344, + }, Expr: &expr.FunctionCall{ + Position: &position.Position{ + StartLine: 205, + EndLine: 205, + StartPos: 4329, + EndPos: 4343, + }, Function: &name.Relative{ + Position: &position.Position{ + StartLine: 205, + EndLine: 205, + StartPos: 4329, + EndPos: 4341, + }, Parts: []node.Node{ - &name.NamePart{Value: "foo"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 205, + EndLine: 205, + StartPos: 4339, + EndPos: 4341, + }, + Value: "foo", + }, + }, + }, + ArgumentList: &node.ArgumentList{ + Position: &position.Position{ + StartLine: 205, + EndLine: 205, + StartPos: 4342, + EndPos: 4343, }, }, - - ArgumentList: &node.ArgumentList{}, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 206, + EndLine: 206, + StartPos: 4348, + EndPos: 4354, + }, Expr: &expr.FunctionCall{ + Position: &position.Position{ + StartLine: 206, + EndLine: 206, + StartPos: 4348, + EndPos: 4353, + }, Function: &name.FullyQualified{ + Position: &position.Position{ + StartLine: 206, + EndLine: 206, + StartPos: 4348, + EndPos: 4351, + }, Parts: []node.Node{ - &name.NamePart{Value: "foo"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 206, + EndLine: 206, + StartPos: 4349, + EndPos: 4351, + }, + Value: "foo", + }, + }, + }, + ArgumentList: &node.ArgumentList{ + Position: &position.Position{ + StartLine: 206, + EndLine: 206, + StartPos: 4352, + EndPos: 4353, }, }, - - ArgumentList: &node.ArgumentList{}, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 207, + EndLine: 207, + StartPos: 4358, + EndPos: 4364, + }, Expr: &expr.FunctionCall{ - Function: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, - - ArgumentList: &node.ArgumentList{}, + Position: &position.Position{ + StartLine: 207, + EndLine: 207, + StartPos: 4358, + EndPos: 4363, + }, + Function: &expr.Variable{ + Position: &position.Position{ + StartLine: 207, + EndLine: 207, + StartPos: 4358, + EndPos: 4361, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 207, + EndLine: 207, + StartPos: 4358, + EndPos: 4361, + }, + Value: "foo", + }, + }, + ArgumentList: &node.ArgumentList{ + Position: &position.Position{ + StartLine: 207, + EndLine: 207, + StartPos: 4362, + EndPos: 4363, + }, + }, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 209, + EndLine: 209, + StartPos: 4369, + EndPos: 4373, + }, Expr: &expr.PostDec{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Position: &position.Position{ + StartLine: 209, + EndLine: 209, + StartPos: 4369, + EndPos: 4372, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 209, + EndLine: 209, + StartPos: 4369, + EndPos: 4370, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 209, + EndLine: 209, + StartPos: 4369, + EndPos: 4370, + }, + Value: "a", + }, + }, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 210, + EndLine: 210, + StartPos: 4377, + EndPos: 4381, + }, Expr: &expr.PostInc{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Position: &position.Position{ + StartLine: 210, + EndLine: 210, + StartPos: 4377, + EndPos: 4380, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 210, + EndLine: 210, + StartPos: 4377, + EndPos: 4378, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 210, + EndLine: 210, + StartPos: 4377, + EndPos: 4378, + }, + Value: "a", + }, + }, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 211, + EndLine: 211, + StartPos: 4385, + EndPos: 4389, + }, Expr: &expr.PreDec{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Position: &position.Position{ + StartLine: 211, + EndLine: 211, + StartPos: 4385, + EndPos: 4388, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 211, + EndLine: 211, + StartPos: 4387, + EndPos: 4388, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 211, + EndLine: 211, + StartPos: 4387, + EndPos: 4388, + }, + Value: "a", + }, + }, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 212, + EndLine: 212, + StartPos: 4393, + EndPos: 4397, + }, Expr: &expr.PreInc{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Position: &position.Position{ + StartLine: 212, + EndLine: 212, + StartPos: 4393, + EndPos: 4396, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 212, + EndLine: 212, + StartPos: 4395, + EndPos: 4396, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 212, + EndLine: 212, + StartPos: 4395, + EndPos: 4396, + }, + Value: "a", + }, + }, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 214, + EndLine: 214, + StartPos: 4402, + EndPos: 4412, + }, Expr: &expr.Include{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Position: &position.Position{ + StartLine: 214, + EndLine: 214, + StartPos: 4402, + EndPos: 4411, + }, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 214, + EndLine: 214, + StartPos: 4410, + EndPos: 4411, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 214, + EndLine: 214, + StartPos: 4410, + EndPos: 4411, + }, + Value: "a", + }, + }, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 215, + EndLine: 215, + StartPos: 4416, + EndPos: 4431, + }, Expr: &expr.IncludeOnce{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Position: &position.Position{ + StartLine: 215, + EndLine: 215, + StartPos: 4416, + EndPos: 4430, + }, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 215, + EndLine: 215, + StartPos: 4429, + EndPos: 4430, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 215, + EndLine: 215, + StartPos: 4429, + EndPos: 4430, + }, + Value: "a", + }, + }, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 216, + EndLine: 216, + StartPos: 4435, + EndPos: 4445, + }, Expr: &expr.Require{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Position: &position.Position{ + StartLine: 216, + EndLine: 216, + StartPos: 4435, + EndPos: 4444, + }, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 216, + EndLine: 216, + StartPos: 4443, + EndPos: 4444, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 216, + EndLine: 216, + StartPos: 4443, + EndPos: 4444, + }, + Value: "a", + }, + }, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 217, + EndLine: 217, + StartPos: 4449, + EndPos: 4464, + }, Expr: &expr.RequireOnce{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Position: &position.Position{ + StartLine: 217, + EndLine: 217, + StartPos: 4449, + EndPos: 4463, + }, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 217, + EndLine: 217, + StartPos: 4462, + EndPos: 4463, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 217, + EndLine: 217, + StartPos: 4462, + EndPos: 4463, + }, + Value: "a", + }, + }, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 219, + EndLine: 219, + StartPos: 4469, + EndPos: 4486, + }, Expr: &expr.InstanceOf{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Position: &position.Position{ + StartLine: 219, + EndLine: 219, + StartPos: 4469, + EndPos: 4485, + }, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 219, + EndLine: 219, + StartPos: 4469, + EndPos: 4470, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 219, + EndLine: 219, + StartPos: 4469, + EndPos: 4470, + }, + Value: "a", + }, + }, Class: &name.Name{ + Position: &position.Position{ + StartLine: 219, + EndLine: 219, + StartPos: 4483, + EndPos: 4485, + }, Parts: []node.Node{ - &name.NamePart{Value: "Foo"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 219, + EndLine: 219, + StartPos: 4483, + EndPos: 4485, + }, + Value: "Foo", + }, }, }, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 220, + EndLine: 220, + StartPos: 4490, + EndPos: 4517, + }, Expr: &expr.InstanceOf{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Position: &position.Position{ + StartLine: 220, + EndLine: 220, + StartPos: 4490, + EndPos: 4516, + }, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 220, + EndLine: 220, + StartPos: 4490, + EndPos: 4491, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 220, + EndLine: 220, + StartPos: 4490, + EndPos: 4491, + }, + Value: "a", + }, + }, Class: &name.Relative{ + Position: &position.Position{ + StartLine: 220, + EndLine: 220, + StartPos: 4504, + EndPos: 4516, + }, Parts: []node.Node{ - &name.NamePart{Value: "Foo"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 220, + EndLine: 220, + StartPos: 4514, + EndPos: 4516, + }, + Value: "Foo", + }, }, }, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 221, + EndLine: 221, + StartPos: 4521, + EndPos: 4539, + }, Expr: &expr.InstanceOf{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Position: &position.Position{ + StartLine: 221, + EndLine: 221, + StartPos: 4521, + EndPos: 4538, + }, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 221, + EndLine: 221, + StartPos: 4521, + EndPos: 4522, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 221, + EndLine: 221, + StartPos: 4521, + EndPos: 4522, + }, + Value: "a", + }, + }, Class: &name.FullyQualified{ + Position: &position.Position{ + StartLine: 221, + EndLine: 221, + StartPos: 4535, + EndPos: 4538, + }, Parts: []node.Node{ - &name.NamePart{Value: "Foo"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 221, + EndLine: 221, + StartPos: 4536, + EndPos: 4538, + }, + Value: "Foo", + }, }, }, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 223, + EndLine: 223, + StartPos: 4544, + EndPos: 4557, + }, Expr: &expr.Isset{ + Position: &position.Position{ + StartLine: 223, + EndLine: 223, + StartPos: 4544, + EndPos: 4556, + }, Variables: []node.Node{ - &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - }, - }, - &stmt.Expression{ - Expr: &assign.Assign{ - Variable: &expr.List{ - Items: []node.Node{ - &expr.ArrayItem{ - Val: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + &expr.Variable{ + Position: &position.Position{ + StartLine: 223, + EndLine: 223, + StartPos: 4550, + EndPos: 4551, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 223, + EndLine: 223, + StartPos: 4550, + EndPos: 4551, + }, + Value: "a", + }, + }, + &expr.Variable{ + Position: &position.Position{ + StartLine: 223, + EndLine: 223, + StartPos: 4554, + EndPos: 4555, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 223, + EndLine: 223, + StartPos: 4554, + EndPos: 4555, + }, + Value: "b", }, }, }, - Expression: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 224, + EndLine: 224, + StartPos: 4561, + EndPos: 4574, + }, Expr: &assign.Assign{ + Position: &position.Position{ + StartLine: 224, + EndLine: 224, + StartPos: 4561, + EndPos: 4573, + }, Variable: &expr.List{ + Position: &position.Position{ + StartLine: 224, + EndLine: 224, + StartPos: 4561, + EndPos: 4568, + }, Items: []node.Node{ &expr.ArrayItem{ - Val: &expr.ArrayDimFetch{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Position: &position.Position{ + StartLine: 224, + EndLine: 224, + StartPos: 4566, + EndPos: 4567, + }, + Val: &expr.Variable{ + Position: &position.Position{ + StartLine: 224, + EndLine: 224, + StartPos: 4566, + EndPos: 4567, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 224, + EndLine: 224, + StartPos: 4566, + EndPos: 4567, + }, + Value: "a", + }, }, }, }, }, - Expression: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Expression: &expr.Variable{ + Position: &position.Position{ + StartLine: 224, + EndLine: 224, + StartPos: 4572, + EndPos: 4573, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 224, + EndLine: 224, + StartPos: 4572, + EndPos: 4573, + }, + Value: "b", + }, + }, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 225, + EndLine: 225, + StartPos: 4578, + EndPos: 4593, + }, Expr: &assign.Assign{ + Position: &position.Position{ + StartLine: 225, + EndLine: 225, + StartPos: 4578, + EndPos: 4592, + }, Variable: &expr.List{ + Position: &position.Position{ + StartLine: 225, + EndLine: 225, + StartPos: 4578, + EndPos: 4587, + }, Items: []node.Node{ &expr.ArrayItem{ - Val: &expr.List{ - Items: []node.Node{ - &expr.ArrayItem{ - Val: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Position: &position.Position{ + StartLine: 225, + EndLine: 225, + StartPos: 4583, + EndPos: 4586, + }, + Val: &expr.ArrayDimFetch{ + Position: &position.Position{ + StartLine: 225, + EndLine: 225, + StartPos: 4583, + EndPos: 4586, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 225, + EndLine: 225, + StartPos: 4583, + EndPos: 4584, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 225, + EndLine: 225, + StartPos: 4583, + EndPos: 4584, + }, + Value: "a", }, }, }, }, }, }, - Expression: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Expression: &expr.Variable{ + Position: &position.Position{ + StartLine: 225, + EndLine: 225, + StartPos: 4591, + EndPos: 4592, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 225, + EndLine: 225, + StartPos: 4591, + EndPos: 4592, + }, + Value: "b", + }, + }, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 226, + EndLine: 226, + StartPos: 4597, + EndPos: 4616, + }, + Expr: &assign.Assign{ + Position: &position.Position{ + StartLine: 226, + EndLine: 226, + StartPos: 4597, + EndPos: 4615, + }, + Variable: &expr.List{ + Position: &position.Position{ + StartLine: 226, + EndLine: 226, + StartPos: 4597, + EndPos: 4610, + }, + Items: []node.Node{ + &expr.ArrayItem{ + Position: &position.Position{ + StartLine: 226, + EndLine: 226, + StartPos: 4602, + EndPos: 4609, + }, + Val: &expr.List{ + Position: &position.Position{ + StartLine: 226, + EndLine: 226, + StartPos: 4602, + EndPos: 4609, + }, + Items: []node.Node{ + &expr.ArrayItem{ + Position: &position.Position{ + StartLine: 226, + EndLine: 226, + StartPos: 4607, + EndPos: 4608, + }, + Val: &expr.Variable{ + Position: &position.Position{ + StartLine: 226, + EndLine: 226, + StartPos: 4607, + EndPos: 4608, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 226, + EndLine: 226, + StartPos: 4607, + EndPos: 4608, + }, + Value: "a", + }, + }, + }, + }, + }, + }, + }, + }, + Expression: &expr.Variable{ + Position: &position.Position{ + StartLine: 226, + EndLine: 226, + StartPos: 4614, + EndPos: 4615, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 226, + EndLine: 226, + StartPos: 4614, + EndPos: 4615, + }, + Value: "b", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 228, + EndLine: 228, + StartPos: 4621, + EndPos: 4630, + }, Expr: &expr.MethodCall{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Method: &node.Identifier{Value: "foo"}, - - ArgumentList: &node.ArgumentList{}, + Position: &position.Position{ + StartLine: 228, + EndLine: 228, + StartPos: 4621, + EndPos: 4629, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 228, + EndLine: 228, + StartPos: 4621, + EndPos: 4622, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 228, + EndLine: 228, + StartPos: 4621, + EndPos: 4622, + }, + Value: "a", + }, + }, + Method: &node.Identifier{ + Position: &position.Position{ + StartLine: 228, + EndLine: 228, + StartPos: 4625, + EndPos: 4627, + }, + Value: "foo", + }, + ArgumentList: &node.ArgumentList{ + Position: &position.Position{ + StartLine: 228, + EndLine: 228, + StartPos: 4628, + EndPos: 4629, + }, + }, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 229, + EndLine: 229, + StartPos: 4634, + EndPos: 4643, + }, Expr: &expr.New{ + Position: &position.Position{ + StartLine: 229, + EndLine: 229, + StartPos: 4634, + EndPos: 4642, + }, Class: &name.Name{ + Position: &position.Position{ + StartLine: 229, + EndLine: 229, + StartPos: 4638, + EndPos: 4640, + }, Parts: []node.Node{ - &name.NamePart{Value: "Foo"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 229, + EndLine: 229, + StartPos: 4638, + EndPos: 4640, + }, + Value: "Foo", + }, + }, + }, + ArgumentList: &node.ArgumentList{ + Position: &position.Position{ + StartLine: 229, + EndLine: 229, + StartPos: 4641, + EndPos: 4642, }, }, - - ArgumentList: &node.ArgumentList{}, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 230, + EndLine: 230, + StartPos: 4647, + EndPos: 4666, + }, Expr: &expr.New{ + Position: &position.Position{ + StartLine: 230, + EndLine: 230, + StartPos: 4647, + EndPos: 4665, + }, Class: &name.Relative{ + Position: &position.Position{ + StartLine: 230, + EndLine: 230, + StartPos: 4651, + EndPos: 4663, + }, Parts: []node.Node{ - &name.NamePart{Value: "Foo"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 230, + EndLine: 230, + StartPos: 4661, + EndPos: 4663, + }, + Value: "Foo", + }, + }, + }, + ArgumentList: &node.ArgumentList{ + Position: &position.Position{ + StartLine: 230, + EndLine: 230, + StartPos: 4664, + EndPos: 4665, }, }, - - ArgumentList: &node.ArgumentList{}, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 231, + EndLine: 231, + StartPos: 4670, + EndPos: 4680, + }, Expr: &expr.New{ + Position: &position.Position{ + StartLine: 231, + EndLine: 231, + StartPos: 4670, + EndPos: 4679, + }, Class: &name.FullyQualified{ + Position: &position.Position{ + StartLine: 231, + EndLine: 231, + StartPos: 4674, + EndPos: 4677, + }, Parts: []node.Node{ - &name.NamePart{Value: "Foo"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 231, + EndLine: 231, + StartPos: 4675, + EndPos: 4677, + }, + Value: "Foo", + }, + }, + }, + ArgumentList: &node.ArgumentList{ + Position: &position.Position{ + StartLine: 231, + EndLine: 231, + StartPos: 4678, + EndPos: 4679, }, }, - - ArgumentList: &node.ArgumentList{}, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 232, + EndLine: 232, + StartPos: 4684, + EndPos: 4708, + }, Expr: &expr.New{ + Position: &position.Position{ + StartLine: 232, + EndLine: 232, + StartPos: 4684, + EndPos: 4707, + }, Class: &stmt.Class{ + Position: &position.Position{ + StartLine: 232, + EndLine: 232, + StartPos: 4688, + EndPos: 4707, + }, PhpDocComment: "", - ArgumentList: &node.ArgumentList{ + Position: &position.Position{ + StartLine: 232, + EndLine: 232, + StartPos: 4694, + EndPos: 4704, + }, Arguments: []node.Node{ - &node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, - &node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + &node.Argument{ + Position: &position.Position{ + StartLine: 232, + EndLine: 232, + StartPos: 4695, + EndPos: 4696, + }, + Variadic: false, + IsReference: false, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 232, + EndLine: 232, + StartPos: 4695, + EndPos: 4696, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 232, + EndLine: 232, + StartPos: 4695, + EndPos: 4696, + }, + Value: "a", + }, + }, + }, + &node.Argument{ + Position: &position.Position{ + StartLine: 232, + EndLine: 232, + StartPos: 4699, + EndPos: 4703, + }, + Variadic: true, + IsReference: false, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 232, + EndLine: 232, + StartPos: 4702, + EndPos: 4703, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 232, + EndLine: 232, + StartPos: 4702, + EndPos: 4703, + }, + Value: "b", + }, + }, + }, }, }, - Stmts: []node.Node{}, + Stmts: []node.Node{ + }, }, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 233, + EndLine: 233, + StartPos: 4712, + EndPos: 4721, + }, Expr: &expr.Print{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Position: &position.Position{ + StartLine: 233, + EndLine: 233, + StartPos: 4712, + EndPos: 4719, + }, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 233, + EndLine: 233, + StartPos: 4718, + EndPos: 4719, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 233, + EndLine: 233, + StartPos: 4718, + EndPos: 4719, + }, + Value: "a", + }, + }, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 234, + EndLine: 234, + StartPos: 4725, + EndPos: 4732, + }, Expr: &expr.PropertyFetch{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Property: &node.Identifier{Value: "foo"}, + Position: &position.Position{ + StartLine: 234, + EndLine: 234, + StartPos: 4725, + EndPos: 4731, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 234, + EndLine: 234, + StartPos: 4725, + EndPos: 4726, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 234, + EndLine: 234, + StartPos: 4725, + EndPos: 4726, + }, + Value: "a", + }, + }, + Property: &node.Identifier{ + Position: &position.Position{ + StartLine: 234, + EndLine: 234, + StartPos: 4729, + EndPos: 4731, + }, + Value: "foo", + }, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 235, + EndLine: 235, + StartPos: 4736, + EndPos: 4744, + }, Expr: &expr.ShellExec{ + Position: &position.Position{ + StartLine: 235, + EndLine: 235, + StartPos: 4736, + EndPos: 4743, + }, Parts: []node.Node{ - &scalar.EncapsedStringPart{Value: "cmd "}, - &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - }, - }, - }, - &stmt.Expression{ - Expr: &expr.ShellExec{ - Parts: []node.Node{ - &scalar.EncapsedStringPart{Value: "cmd"}, - }, - }, - }, - &stmt.Expression{ - Expr: &expr.ShellExec{ - Parts: []node.Node{}, - }, - }, - &stmt.Expression{ - Expr: &expr.ShortArray{ - Items: []node.Node{}, - }, - }, - &stmt.Expression{ - Expr: &expr.ShortArray{ - Items: []node.Node{ - &expr.ArrayItem{ - Val: &scalar.Lnumber{Value: "1"}, + &scalar.EncapsedStringPart{ + Position: &position.Position{ + StartLine: 235, + EndLine: 235, + StartPos: 4737, + EndPos: 4740, + }, + Value: "cmd ", }, - }, - }, - }, - &stmt.Expression{ - Expr: &expr.ShortArray{ - Items: []node.Node{ - &expr.ArrayItem{ - Key: &scalar.Lnumber{Value: "1"}, - Val: &scalar.Lnumber{Value: "1"}, - }, - &expr.ArrayItem{ - Val: &expr.Reference{Variable: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, - }, - }, - }, - }, - &stmt.Expression{ - Expr: &assign.Assign{ - Variable: &expr.ShortList{ - Items: []node.Node{ - &expr.ArrayItem{ - Val: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + &expr.Variable{ + Position: &position.Position{ + StartLine: 235, + EndLine: 235, + StartPos: 4741, + EndPos: 4742, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 235, + EndLine: 235, + StartPos: 4741, + EndPos: 4742, + }, + Value: "a", }, }, }, - Expression: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, }, }, &stmt.Expression{ - Expr: &assign.Assign{ - Variable: &expr.ShortList{ - Items: []node.Node{ - &expr.ArrayItem{ - Val: &expr.ArrayDimFetch{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Position: &position.Position{ + StartLine: 236, + EndLine: 236, + StartPos: 4748, + EndPos: 4753, + }, + Expr: &expr.ShellExec{ + Position: &position.Position{ + StartLine: 236, + EndLine: 236, + StartPos: 4748, + EndPos: 4752, + }, + Parts: []node.Node{ + &scalar.EncapsedStringPart{ + Value: "cmd", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 237, + EndLine: 237, + StartPos: 4757, + EndPos: 4759, + }, + Expr: &expr.ShellExec{ + Position: &position.Position{ + StartLine: 237, + EndLine: 237, + StartPos: 4757, + EndPos: 4758, + }, + Parts: []node.Node{ + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 238, + EndLine: 238, + StartPos: 4763, + EndPos: 4765, + }, + Expr: &expr.ShortArray{ + Position: &position.Position{ + StartLine: 238, + EndLine: 238, + StartPos: 4763, + EndPos: 4764, + }, + Items: []node.Node{ + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 239, + EndLine: 239, + StartPos: 4769, + EndPos: 4772, + }, + Expr: &expr.ShortArray{ + Position: &position.Position{ + StartLine: 239, + EndLine: 239, + StartPos: 4769, + EndPos: 4771, + }, + Items: []node.Node{ + &expr.ArrayItem{ + Position: &position.Position{ + StartLine: 239, + EndLine: 239, + StartPos: 4770, + EndPos: 4770, + }, + Val: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 239, + EndLine: 239, + StartPos: 4770, + EndPos: 4770, + }, + Value: "1", + }, + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 240, + EndLine: 240, + StartPos: 4776, + EndPos: 4788, + }, + Expr: &expr.ShortArray{ + Position: &position.Position{ + StartLine: 240, + EndLine: 240, + StartPos: 4776, + EndPos: 4787, + }, + Items: []node.Node{ + &expr.ArrayItem{ + Position: &position.Position{ + StartLine: 240, + EndLine: 240, + StartPos: 4777, + EndPos: 4780, + }, + Key: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 240, + EndLine: 240, + StartPos: 4777, + EndPos: 4777, + }, + Value: "1", + }, + Val: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 240, + EndLine: 240, + StartPos: 4780, + EndPos: 4780, + }, + Value: "1", + }, + }, + &expr.ArrayItem{ + Position: &position.Position{ + StartLine: 240, + EndLine: 240, + StartPos: 4783, + EndPos: 4785, + }, + Val: &expr.Reference{ + Position: &position.Position{ + StartLine: 240, + EndLine: 240, + StartPos: 4783, + EndPos: 4785, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 240, + EndLine: 240, + StartPos: 4784, + EndPos: 4785, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 240, + EndLine: 240, + StartPos: 4784, + EndPos: 4785, + }, + Value: "b", + }, }, }, }, }, - Expression: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 242, + EndLine: 242, + StartPos: 4793, + EndPos: 4802, + }, Expr: &assign.Assign{ + Position: &position.Position{ + StartLine: 242, + EndLine: 242, + StartPos: 4793, + EndPos: 4801, + }, Variable: &expr.ShortList{ + Position: &position.Position{ + StartLine: 242, + EndLine: 242, + StartPos: 4793, + EndPos: 4796, + }, Items: []node.Node{ &expr.ArrayItem{ - Val: &expr.List{ - Items: []node.Node{ - &expr.ArrayItem{ - Val: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Position: &position.Position{ + StartLine: 242, + EndLine: 242, + StartPos: 4794, + EndPos: 4795, + }, + Val: &expr.Variable{ + Position: &position.Position{ + StartLine: 242, + EndLine: 242, + StartPos: 4794, + EndPos: 4795, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 242, + EndLine: 242, + StartPos: 4794, + EndPos: 4795, + }, + Value: "a", + }, + }, + }, + }, + }, + Expression: &expr.Variable{ + Position: &position.Position{ + StartLine: 242, + EndLine: 242, + StartPos: 4800, + EndPos: 4801, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 242, + EndLine: 242, + StartPos: 4800, + EndPos: 4801, + }, + Value: "b", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 243, + EndLine: 243, + StartPos: 4806, + EndPos: 4817, + }, + Expr: &assign.Assign{ + Position: &position.Position{ + StartLine: 243, + EndLine: 243, + StartPos: 4806, + EndPos: 4816, + }, + Variable: &expr.ShortList{ + Position: &position.Position{ + StartLine: 243, + EndLine: 243, + StartPos: 4806, + EndPos: 4811, + }, + Items: []node.Node{ + &expr.ArrayItem{ + Position: &position.Position{ + StartLine: 243, + EndLine: 243, + StartPos: 4807, + EndPos: 4810, + }, + Val: &expr.ArrayDimFetch{ + Position: &position.Position{ + StartLine: 243, + EndLine: 243, + StartPos: 4807, + EndPos: 4810, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 243, + EndLine: 243, + StartPos: 4807, + EndPos: 4808, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 243, + EndLine: 243, + StartPos: 4807, + EndPos: 4808, + }, + Value: "a", }, }, }, }, }, }, - Expression: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - }, - &stmt.Expression{ - Expr: &expr.StaticCall{ - Class: &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "Foo"}, + Expression: &expr.Variable{ + Position: &position.Position{ + StartLine: 243, + EndLine: 243, + StartPos: 4815, + EndPos: 4816, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 243, + EndLine: 243, + StartPos: 4815, + EndPos: 4816, + }, + Value: "b", }, }, - Call: &node.Identifier{Value: "bar"}, - - ArgumentList: &node.ArgumentList{}, }, }, &stmt.Expression{ - Expr: &expr.StaticCall{ - Class: &name.Relative{ - Parts: []node.Node{ - &name.NamePart{Value: "Foo"}, - }, - }, - Call: &node.Identifier{Value: "bar"}, - - ArgumentList: &node.ArgumentList{}, + Position: &position.Position{ + StartLine: 244, + EndLine: 244, + StartPos: 4821, + EndPos: 4836, }, - }, - &stmt.Expression{ - Expr: &expr.StaticCall{ - Class: &name.FullyQualified{ - Parts: []node.Node{ - &name.NamePart{Value: "Foo"}, - }, - }, - Call: &node.Identifier{Value: "bar"}, - - ArgumentList: &node.ArgumentList{}, - }, - }, - &stmt.Expression{ - Expr: &expr.StaticPropertyFetch{ - Class: &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "Foo"}, - }, - }, - Property: &expr.Variable{VarName: &node.Identifier{Value: "bar"}}, - }, - }, - &stmt.Expression{ - Expr: &expr.StaticPropertyFetch{ - Class: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, - Property: &expr.Variable{VarName: &node.Identifier{Value: "bar"}}, - }, - }, - &stmt.Expression{ - Expr: &expr.StaticPropertyFetch{ - Class: &name.Relative{ - Parts: []node.Node{ - &name.NamePart{Value: "Foo"}, - }, - }, - Property: &expr.Variable{VarName: &node.Identifier{Value: "bar"}}, - }, - }, - &stmt.Expression{ - Expr: &expr.StaticPropertyFetch{ - Class: &name.FullyQualified{ - Parts: []node.Node{ - &name.NamePart{Value: "Foo"}, - }, - }, - Property: &expr.Variable{VarName: &node.Identifier{Value: "bar"}}, - }, - }, - &stmt.Expression{ - Expr: &expr.Ternary{ - Condition: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - IfTrue: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - IfFalse: &expr.Variable{VarName: &node.Identifier{Value: "c"}}, - }, - }, - &stmt.Expression{ - Expr: &expr.Ternary{ - Condition: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - IfFalse: &expr.Variable{VarName: &node.Identifier{Value: "c"}}, - }, - }, - &stmt.Expression{ - Expr: &expr.Ternary{ - Condition: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - IfTrue: &expr.Ternary{ - Condition: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - IfTrue: &expr.Variable{VarName: &node.Identifier{Value: "c"}}, - IfFalse: &expr.Variable{VarName: &node.Identifier{Value: "d"}}, - }, - IfFalse: &expr.Variable{VarName: &node.Identifier{Value: "e"}}, - }, - }, - &stmt.Expression{ - Expr: &expr.Ternary{ - Condition: &expr.Ternary{ - Condition: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - IfTrue: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - IfFalse: &expr.Variable{VarName: &node.Identifier{Value: "c"}}, - }, - IfTrue: &expr.Variable{VarName: &node.Identifier{Value: "d"}}, - IfFalse: &expr.Variable{VarName: &node.Identifier{Value: "e"}}, - }, - }, - &stmt.Expression{ - Expr: &expr.UnaryMinus{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - }, - }, - &stmt.Expression{ - Expr: &expr.UnaryPlus{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - }, - }, - &stmt.Expression{ - Expr: &expr.Variable{VarName: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, - }, - &stmt.Expression{ - Expr: &expr.Yield{}, - }, - &stmt.Expression{ - Expr: &expr.Yield{ - Value: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - }, - }, - &stmt.Expression{ - Expr: &expr.Yield{ - Key: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Value: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - }, - &stmt.Expression{ - Expr: &expr.YieldFrom{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - }, - }, - &stmt.Expression{ - Expr: &cast.Array{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - }, - }, - &stmt.Expression{ - Expr: &cast.Bool{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - }, - }, - &stmt.Expression{ - Expr: &cast.Bool{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - }, - }, - &stmt.Expression{ - Expr: &cast.Double{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - }, - }, - &stmt.Expression{ - Expr: &cast.Double{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - }, - }, - &stmt.Expression{ - Expr: &cast.Int{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - }, - }, - &stmt.Expression{ - Expr: &cast.Int{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - }, - }, - &stmt.Expression{ - Expr: &cast.Object{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - }, - }, - &stmt.Expression{ - Expr: &cast.String{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - }, - }, - &stmt.Expression{ - Expr: &cast.Unset{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - }, - }, - &stmt.Expression{ - Expr: &binary.BitwiseAnd{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - }, - &stmt.Expression{ - Expr: &binary.BitwiseOr{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - }, - &stmt.Expression{ - Expr: &binary.BitwiseXor{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - }, - &stmt.Expression{ - Expr: &binary.BooleanAnd{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - }, - &stmt.Expression{ - Expr: &binary.BooleanOr{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - }, - &stmt.Expression{ - Expr: &binary.Coalesce{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - }, - &stmt.Expression{ - Expr: &binary.Concat{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - }, - &stmt.Expression{ - Expr: &binary.Div{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - }, - &stmt.Expression{ - Expr: &binary.Equal{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - }, - &stmt.Expression{ - Expr: &binary.GreaterOrEqual{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - }, - &stmt.Expression{ - Expr: &binary.Greater{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - }, - &stmt.Expression{ - Expr: &binary.Identical{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - }, - &stmt.Expression{ - Expr: &binary.LogicalAnd{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - }, - &stmt.Expression{ - Expr: &binary.LogicalOr{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - }, - &stmt.Expression{ - Expr: &binary.LogicalXor{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - }, - &stmt.Expression{ - Expr: &binary.Minus{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - }, - &stmt.Expression{ - Expr: &binary.Mod{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - }, - &stmt.Expression{ - Expr: &binary.Mul{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - }, - &stmt.Expression{ - Expr: &binary.NotEqual{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - }, - &stmt.Expression{ - Expr: &binary.NotIdentical{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - }, - &stmt.Expression{ - Expr: &binary.Plus{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - }, - &stmt.Expression{ - Expr: &binary.Pow{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - }, - &stmt.Expression{ - Expr: &binary.ShiftLeft{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - }, - &stmt.Expression{ - Expr: &binary.ShiftRight{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - }, - &stmt.Expression{ - Expr: &binary.SmallerOrEqual{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - }, - &stmt.Expression{ - Expr: &binary.Smaller{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - }, - &stmt.Expression{ - Expr: &binary.Spaceship{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - }, - &stmt.Expression{ - Expr: &assign.Reference{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expression: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - }, - &stmt.Expression{ Expr: &assign.Assign{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expression: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Position: &position.Position{ + StartLine: 244, + EndLine: 244, + StartPos: 4821, + EndPos: 4835, + }, + Variable: &expr.ShortList{ + Position: &position.Position{ + StartLine: 244, + EndLine: 244, + StartPos: 4821, + EndPos: 4830, + }, + Items: []node.Node{ + &expr.ArrayItem{ + Position: &position.Position{ + StartLine: 244, + EndLine: 244, + StartPos: 4822, + EndPos: 4829, + }, + Val: &expr.List{ + Position: &position.Position{ + StartLine: 244, + EndLine: 244, + StartPos: 4822, + EndPos: 4829, + }, + Items: []node.Node{ + &expr.ArrayItem{ + Position: &position.Position{ + StartLine: 244, + EndLine: 244, + StartPos: 4827, + EndPos: 4828, + }, + Val: &expr.Variable{ + Position: &position.Position{ + StartLine: 244, + EndLine: 244, + StartPos: 4827, + EndPos: 4828, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 244, + EndLine: 244, + StartPos: 4827, + EndPos: 4828, + }, + Value: "a", + }, + }, + }, + }, + }, + }, + }, + }, + Expression: &expr.Variable{ + Position: &position.Position{ + StartLine: 244, + EndLine: 244, + StartPos: 4834, + EndPos: 4835, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 244, + EndLine: 244, + StartPos: 4834, + EndPos: 4835, + }, + Value: "b", + }, + }, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 245, + EndLine: 245, + StartPos: 4840, + EndPos: 4850, + }, + Expr: &expr.StaticCall{ + Position: &position.Position{ + StartLine: 245, + EndLine: 245, + StartPos: 4840, + EndPos: 4849, + }, + Class: &name.Name{ + Position: &position.Position{ + StartLine: 245, + EndLine: 245, + StartPos: 4840, + EndPos: 4842, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 245, + EndLine: 245, + StartPos: 4840, + EndPos: 4842, + }, + Value: "Foo", + }, + }, + }, + Call: &node.Identifier{ + Position: &position.Position{ + StartLine: 245, + EndLine: 245, + StartPos: 4845, + EndPos: 4847, + }, + Value: "bar", + }, + ArgumentList: &node.ArgumentList{ + Position: &position.Position{ + StartLine: 245, + EndLine: 245, + StartPos: 4848, + EndPos: 4849, + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 246, + EndLine: 246, + StartPos: 4854, + EndPos: 4874, + }, + Expr: &expr.StaticCall{ + Position: &position.Position{ + StartLine: 246, + EndLine: 246, + StartPos: 4854, + EndPos: 4873, + }, + Class: &name.Relative{ + Position: &position.Position{ + StartLine: 246, + EndLine: 246, + StartPos: 4854, + EndPos: 4866, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 246, + EndLine: 246, + StartPos: 4864, + EndPos: 4866, + }, + Value: "Foo", + }, + }, + }, + Call: &node.Identifier{ + Position: &position.Position{ + StartLine: 246, + EndLine: 246, + StartPos: 4869, + EndPos: 4871, + }, + Value: "bar", + }, + ArgumentList: &node.ArgumentList{ + Position: &position.Position{ + StartLine: 246, + EndLine: 246, + StartPos: 4872, + EndPos: 4873, + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 247, + EndLine: 247, + StartPos: 4878, + EndPos: 4889, + }, + Expr: &expr.StaticCall{ + Position: &position.Position{ + StartLine: 247, + EndLine: 247, + StartPos: 4878, + EndPos: 4888, + }, + Class: &name.FullyQualified{ + Position: &position.Position{ + StartLine: 247, + EndLine: 247, + StartPos: 4878, + EndPos: 4881, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 247, + EndLine: 247, + StartPos: 4879, + EndPos: 4881, + }, + Value: "Foo", + }, + }, + }, + Call: &node.Identifier{ + Position: &position.Position{ + StartLine: 247, + EndLine: 247, + StartPos: 4884, + EndPos: 4886, + }, + Value: "bar", + }, + ArgumentList: &node.ArgumentList{ + Position: &position.Position{ + StartLine: 247, + EndLine: 247, + StartPos: 4887, + EndPos: 4888, + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 248, + EndLine: 248, + StartPos: 4893, + EndPos: 4902, + }, + Expr: &expr.StaticPropertyFetch{ + Position: &position.Position{ + StartLine: 248, + EndLine: 248, + StartPos: 4893, + EndPos: 4901, + }, + Class: &name.Name{ + Position: &position.Position{ + StartLine: 248, + EndLine: 248, + StartPos: 4893, + EndPos: 4895, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 248, + EndLine: 248, + StartPos: 4893, + EndPos: 4895, + }, + Value: "Foo", + }, + }, + }, + Property: &expr.Variable{ + Position: &position.Position{ + StartLine: 248, + EndLine: 248, + StartPos: 4898, + EndPos: 4901, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 248, + EndLine: 248, + StartPos: 4898, + EndPos: 4901, + }, + Value: "bar", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 249, + EndLine: 249, + StartPos: 4906, + EndPos: 4916, + }, + Expr: &expr.StaticPropertyFetch{ + Position: &position.Position{ + StartLine: 249, + EndLine: 249, + StartPos: 4906, + EndPos: 4915, + }, + Class: &expr.Variable{ + Position: &position.Position{ + StartLine: 249, + EndLine: 249, + StartPos: 4906, + EndPos: 4909, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 249, + EndLine: 249, + StartPos: 4906, + EndPos: 4909, + }, + Value: "foo", + }, + }, + Property: &expr.Variable{ + Position: &position.Position{ + StartLine: 249, + EndLine: 249, + StartPos: 4912, + EndPos: 4915, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 249, + EndLine: 249, + StartPos: 4912, + EndPos: 4915, + }, + Value: "bar", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 250, + EndLine: 250, + StartPos: 4920, + EndPos: 4939, + }, + Expr: &expr.StaticPropertyFetch{ + Position: &position.Position{ + StartLine: 250, + EndLine: 250, + StartPos: 4920, + EndPos: 4938, + }, + Class: &name.Relative{ + Position: &position.Position{ + StartLine: 250, + EndLine: 250, + StartPos: 4920, + EndPos: 4932, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 250, + EndLine: 250, + StartPos: 4930, + EndPos: 4932, + }, + Value: "Foo", + }, + }, + }, + Property: &expr.Variable{ + Position: &position.Position{ + StartLine: 250, + EndLine: 250, + StartPos: 4935, + EndPos: 4938, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 250, + EndLine: 250, + StartPos: 4935, + EndPos: 4938, + }, + Value: "bar", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 251, + EndLine: 251, + StartPos: 4943, + EndPos: 4953, + }, + Expr: &expr.StaticPropertyFetch{ + Position: &position.Position{ + StartLine: 251, + EndLine: 251, + StartPos: 4943, + EndPos: 4952, + }, + Class: &name.FullyQualified{ + Position: &position.Position{ + StartLine: 251, + EndLine: 251, + StartPos: 4943, + EndPos: 4946, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 251, + EndLine: 251, + StartPos: 4944, + EndPos: 4946, + }, + Value: "Foo", + }, + }, + }, + Property: &expr.Variable{ + Position: &position.Position{ + StartLine: 251, + EndLine: 251, + StartPos: 4949, + EndPos: 4952, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 251, + EndLine: 251, + StartPos: 4949, + EndPos: 4952, + }, + Value: "bar", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 252, + EndLine: 252, + StartPos: 4957, + EndPos: 4969, + }, + Expr: &expr.Ternary{ + Position: &position.Position{ + StartLine: 252, + EndLine: 252, + StartPos: 4957, + EndPos: 4968, + }, + Condition: &expr.Variable{ + Position: &position.Position{ + StartLine: 252, + EndLine: 252, + StartPos: 4957, + EndPos: 4958, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 252, + EndLine: 252, + StartPos: 4957, + EndPos: 4958, + }, + Value: "a", + }, + }, + IfTrue: &expr.Variable{ + Position: &position.Position{ + StartLine: 252, + EndLine: 252, + StartPos: 4962, + EndPos: 4963, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 252, + EndLine: 252, + StartPos: 4962, + EndPos: 4963, + }, + Value: "b", + }, + }, + IfFalse: &expr.Variable{ + Position: &position.Position{ + StartLine: 252, + EndLine: 252, + StartPos: 4967, + EndPos: 4968, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 252, + EndLine: 252, + StartPos: 4967, + EndPos: 4968, + }, + Value: "c", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 253, + EndLine: 253, + StartPos: 4973, + EndPos: 4982, + }, + Expr: &expr.Ternary{ + Position: &position.Position{ + StartLine: 253, + EndLine: 253, + StartPos: 4973, + EndPos: 4981, + }, + Condition: &expr.Variable{ + Position: &position.Position{ + StartLine: 253, + EndLine: 253, + StartPos: 4973, + EndPos: 4974, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 253, + EndLine: 253, + StartPos: 4973, + EndPos: 4974, + }, + Value: "a", + }, + }, + IfFalse: &expr.Variable{ + Position: &position.Position{ + StartLine: 253, + EndLine: 253, + StartPos: 4980, + EndPos: 4981, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 253, + EndLine: 253, + StartPos: 4980, + EndPos: 4981, + }, + Value: "c", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 254, + EndLine: 254, + StartPos: 4986, + EndPos: 5008, + }, + Expr: &expr.Ternary{ + Position: &position.Position{ + StartLine: 254, + EndLine: 254, + StartPos: 4986, + EndPos: 5007, + }, + Condition: &expr.Variable{ + Position: &position.Position{ + StartLine: 254, + EndLine: 254, + StartPos: 4986, + EndPos: 4987, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 254, + EndLine: 254, + StartPos: 4986, + EndPos: 4987, + }, + Value: "a", + }, + }, + IfTrue: &expr.Ternary{ + Position: &position.Position{ + StartLine: 254, + EndLine: 254, + StartPos: 4991, + EndPos: 5002, + }, + Condition: &expr.Variable{ + Position: &position.Position{ + StartLine: 254, + EndLine: 254, + StartPos: 4991, + EndPos: 4992, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 254, + EndLine: 254, + StartPos: 4991, + EndPos: 4992, + }, + Value: "b", + }, + }, + IfTrue: &expr.Variable{ + Position: &position.Position{ + StartLine: 254, + EndLine: 254, + StartPos: 4996, + EndPos: 4997, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 254, + EndLine: 254, + StartPos: 4996, + EndPos: 4997, + }, + Value: "c", + }, + }, + IfFalse: &expr.Variable{ + Position: &position.Position{ + StartLine: 254, + EndLine: 254, + StartPos: 5001, + EndPos: 5002, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 254, + EndLine: 254, + StartPos: 5001, + EndPos: 5002, + }, + Value: "d", + }, + }, + }, + IfFalse: &expr.Variable{ + Position: &position.Position{ + StartLine: 254, + EndLine: 254, + StartPos: 5006, + EndPos: 5007, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 254, + EndLine: 254, + StartPos: 5006, + EndPos: 5007, + }, + Value: "e", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 255, + EndLine: 255, + StartPos: 5012, + EndPos: 5034, + }, + Expr: &expr.Ternary{ + Position: &position.Position{ + StartLine: 255, + EndLine: 255, + StartPos: 5012, + EndPos: 5033, + }, + Condition: &expr.Ternary{ + Position: &position.Position{ + StartLine: 255, + EndLine: 255, + StartPos: 5012, + EndPos: 5023, + }, + Condition: &expr.Variable{ + Position: &position.Position{ + StartLine: 255, + EndLine: 255, + StartPos: 5012, + EndPos: 5013, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 255, + EndLine: 255, + StartPos: 5012, + EndPos: 5013, + }, + Value: "a", + }, + }, + IfTrue: &expr.Variable{ + Position: &position.Position{ + StartLine: 255, + EndLine: 255, + StartPos: 5017, + EndPos: 5018, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 255, + EndLine: 255, + StartPos: 5017, + EndPos: 5018, + }, + Value: "b", + }, + }, + IfFalse: &expr.Variable{ + Position: &position.Position{ + StartLine: 255, + EndLine: 255, + StartPos: 5022, + EndPos: 5023, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 255, + EndLine: 255, + StartPos: 5022, + EndPos: 5023, + }, + Value: "c", + }, + }, + }, + IfTrue: &expr.Variable{ + Position: &position.Position{ + StartLine: 255, + EndLine: 255, + StartPos: 5027, + EndPos: 5028, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 255, + EndLine: 255, + StartPos: 5027, + EndPos: 5028, + }, + Value: "d", + }, + }, + IfFalse: &expr.Variable{ + Position: &position.Position{ + StartLine: 255, + EndLine: 255, + StartPos: 5032, + EndPos: 5033, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 255, + EndLine: 255, + StartPos: 5032, + EndPos: 5033, + }, + Value: "e", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 256, + EndLine: 256, + StartPos: 5038, + EndPos: 5041, + }, + Expr: &expr.UnaryMinus{ + Position: &position.Position{ + StartLine: 256, + EndLine: 256, + StartPos: 5038, + EndPos: 5040, + }, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 256, + EndLine: 256, + StartPos: 5039, + EndPos: 5040, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 256, + EndLine: 256, + StartPos: 5039, + EndPos: 5040, + }, + Value: "a", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 257, + EndLine: 257, + StartPos: 5045, + EndPos: 5048, + }, + Expr: &expr.UnaryPlus{ + Position: &position.Position{ + StartLine: 257, + EndLine: 257, + StartPos: 5045, + EndPos: 5047, + }, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 257, + EndLine: 257, + StartPos: 5046, + EndPos: 5047, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 257, + EndLine: 257, + StartPos: 5046, + EndPos: 5047, + }, + Value: "a", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 258, + EndLine: 258, + StartPos: 5052, + EndPos: 5055, + }, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 258, + EndLine: 258, + StartPos: 5052, + EndPos: 5054, + }, + VarName: &expr.Variable{ + Position: &position.Position{ + StartLine: 258, + EndLine: 258, + StartPos: 5053, + EndPos: 5054, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 258, + EndLine: 258, + StartPos: 5053, + EndPos: 5054, + }, + Value: "a", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 259, + EndLine: 259, + StartPos: 5059, + EndPos: 5064, + }, + Expr: &expr.Yield{ + Position: &position.Position{ + StartLine: 259, + EndLine: 259, + StartPos: 5059, + EndPos: 5063, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 260, + EndLine: 260, + StartPos: 5068, + EndPos: 5076, + }, + Expr: &expr.Yield{ + Position: &position.Position{ + StartLine: 260, + EndLine: 260, + StartPos: 5068, + EndPos: 5075, + }, + Value: &expr.Variable{ + Position: &position.Position{ + StartLine: 260, + EndLine: 260, + StartPos: 5074, + EndPos: 5075, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 260, + EndLine: 260, + StartPos: 5074, + EndPos: 5075, + }, + Value: "a", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 261, + EndLine: 261, + StartPos: 5080, + EndPos: 5094, + }, + Expr: &expr.Yield{ + Position: &position.Position{ + StartLine: 261, + EndLine: 261, + StartPos: 5080, + EndPos: 5093, + }, + Key: &expr.Variable{ + Position: &position.Position{ + StartLine: 261, + EndLine: 261, + StartPos: 5086, + EndPos: 5087, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 261, + EndLine: 261, + StartPos: 5086, + EndPos: 5087, + }, + Value: "a", + }, + }, + Value: &expr.Variable{ + Position: &position.Position{ + StartLine: 261, + EndLine: 261, + StartPos: 5092, + EndPos: 5093, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 261, + EndLine: 261, + StartPos: 5092, + EndPos: 5093, + }, + Value: "b", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 262, + EndLine: 262, + StartPos: 5098, + EndPos: 5111, + }, + Expr: &expr.YieldFrom{ + Position: &position.Position{ + StartLine: 262, + EndLine: 262, + StartPos: 5098, + EndPos: 5110, + }, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 262, + EndLine: 262, + StartPos: 5109, + EndPos: 5110, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 262, + EndLine: 262, + StartPos: 5109, + EndPos: 5110, + }, + Value: "a", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 264, + EndLine: 264, + StartPos: 5118, + EndPos: 5127, + }, + Expr: &cast.Array{ + Position: &position.Position{ + StartLine: 264, + EndLine: 264, + StartPos: 5118, + EndPos: 5126, + }, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 264, + EndLine: 264, + StartPos: 5125, + EndPos: 5126, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 264, + EndLine: 264, + StartPos: 5125, + EndPos: 5126, + }, + Value: "a", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 265, + EndLine: 265, + StartPos: 5131, + EndPos: 5142, + }, + Expr: &cast.Bool{ + Position: &position.Position{ + StartLine: 265, + EndLine: 265, + StartPos: 5131, + EndPos: 5141, + }, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 265, + EndLine: 265, + StartPos: 5140, + EndPos: 5141, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 265, + EndLine: 265, + StartPos: 5140, + EndPos: 5141, + }, + Value: "a", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 266, + EndLine: 266, + StartPos: 5146, + EndPos: 5154, + }, + Expr: &cast.Bool{ + Position: &position.Position{ + StartLine: 266, + EndLine: 266, + StartPos: 5146, + EndPos: 5153, + }, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 266, + EndLine: 266, + StartPos: 5152, + EndPos: 5153, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 266, + EndLine: 266, + StartPos: 5152, + EndPos: 5153, + }, + Value: "a", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 267, + EndLine: 267, + StartPos: 5158, + EndPos: 5168, + }, + Expr: &cast.Double{ + Position: &position.Position{ + StartLine: 267, + EndLine: 267, + StartPos: 5158, + EndPos: 5167, + }, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 267, + EndLine: 267, + StartPos: 5166, + EndPos: 5167, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 267, + EndLine: 267, + StartPos: 5166, + EndPos: 5167, + }, + Value: "a", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 268, + EndLine: 268, + StartPos: 5172, + EndPos: 5181, + }, + Expr: &cast.Double{ + Position: &position.Position{ + StartLine: 268, + EndLine: 268, + StartPos: 5172, + EndPos: 5180, + }, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 268, + EndLine: 268, + StartPos: 5179, + EndPos: 5180, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 268, + EndLine: 268, + StartPos: 5179, + EndPos: 5180, + }, + Value: "a", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 269, + EndLine: 269, + StartPos: 5185, + EndPos: 5196, + }, + Expr: &cast.Int{ + Position: &position.Position{ + StartLine: 269, + EndLine: 269, + StartPos: 5185, + EndPos: 5195, + }, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 269, + EndLine: 269, + StartPos: 5194, + EndPos: 5195, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 269, + EndLine: 269, + StartPos: 5194, + EndPos: 5195, + }, + Value: "a", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 270, + EndLine: 270, + StartPos: 5200, + EndPos: 5207, + }, + Expr: &cast.Int{ + Position: &position.Position{ + StartLine: 270, + EndLine: 270, + StartPos: 5200, + EndPos: 5206, + }, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 270, + EndLine: 270, + StartPos: 5205, + EndPos: 5206, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 270, + EndLine: 270, + StartPos: 5205, + EndPos: 5206, + }, + Value: "a", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 271, + EndLine: 271, + StartPos: 5211, + EndPos: 5221, + }, + Expr: &cast.Object{ + Position: &position.Position{ + StartLine: 271, + EndLine: 271, + StartPos: 5211, + EndPos: 5220, + }, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 271, + EndLine: 271, + StartPos: 5219, + EndPos: 5220, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 271, + EndLine: 271, + StartPos: 5219, + EndPos: 5220, + }, + Value: "a", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 272, + EndLine: 272, + StartPos: 5225, + EndPos: 5235, + }, + Expr: &cast.String{ + Position: &position.Position{ + StartLine: 272, + EndLine: 272, + StartPos: 5225, + EndPos: 5234, + }, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 272, + EndLine: 272, + StartPos: 5233, + EndPos: 5234, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 272, + EndLine: 272, + StartPos: 5233, + EndPos: 5234, + }, + Value: "a", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 273, + EndLine: 273, + StartPos: 5239, + EndPos: 5248, + }, + Expr: &cast.Unset{ + Position: &position.Position{ + StartLine: 273, + EndLine: 273, + StartPos: 5239, + EndPos: 5247, + }, + Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 273, + EndLine: 273, + StartPos: 5246, + EndPos: 5247, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 273, + EndLine: 273, + StartPos: 5246, + EndPos: 5247, + }, + Value: "a", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 275, + EndLine: 275, + StartPos: 5253, + EndPos: 5260, + }, + Expr: &binary.BitwiseAnd{ + Position: &position.Position{ + StartLine: 275, + EndLine: 275, + StartPos: 5253, + EndPos: 5259, + }, + Left: &expr.Variable{ + Position: &position.Position{ + StartLine: 275, + EndLine: 275, + StartPos: 5253, + EndPos: 5254, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 275, + EndLine: 275, + StartPos: 5253, + EndPos: 5254, + }, + Value: "a", + }, + }, + Right: &expr.Variable{ + Position: &position.Position{ + StartLine: 275, + EndLine: 275, + StartPos: 5258, + EndPos: 5259, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 275, + EndLine: 275, + StartPos: 5258, + EndPos: 5259, + }, + Value: "b", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 276, + EndLine: 276, + StartPos: 5264, + EndPos: 5271, + }, + Expr: &binary.BitwiseOr{ + Position: &position.Position{ + StartLine: 276, + EndLine: 276, + StartPos: 5264, + EndPos: 5270, + }, + Left: &expr.Variable{ + Position: &position.Position{ + StartLine: 276, + EndLine: 276, + StartPos: 5264, + EndPos: 5265, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 276, + EndLine: 276, + StartPos: 5264, + EndPos: 5265, + }, + Value: "a", + }, + }, + Right: &expr.Variable{ + Position: &position.Position{ + StartLine: 276, + EndLine: 276, + StartPos: 5269, + EndPos: 5270, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 276, + EndLine: 276, + StartPos: 5269, + EndPos: 5270, + }, + Value: "b", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 277, + EndLine: 277, + StartPos: 5275, + EndPos: 5282, + }, + Expr: &binary.BitwiseXor{ + Position: &position.Position{ + StartLine: 277, + EndLine: 277, + StartPos: 5275, + EndPos: 5281, + }, + Left: &expr.Variable{ + Position: &position.Position{ + StartLine: 277, + EndLine: 277, + StartPos: 5275, + EndPos: 5276, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 277, + EndLine: 277, + StartPos: 5275, + EndPos: 5276, + }, + Value: "a", + }, + }, + Right: &expr.Variable{ + Position: &position.Position{ + StartLine: 277, + EndLine: 277, + StartPos: 5280, + EndPos: 5281, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 277, + EndLine: 277, + StartPos: 5280, + EndPos: 5281, + }, + Value: "b", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 278, + EndLine: 278, + StartPos: 5286, + EndPos: 5294, + }, + Expr: &binary.BooleanAnd{ + Position: &position.Position{ + StartLine: 278, + EndLine: 278, + StartPos: 5286, + EndPos: 5293, + }, + Left: &expr.Variable{ + Position: &position.Position{ + StartLine: 278, + EndLine: 278, + StartPos: 5286, + EndPos: 5287, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 278, + EndLine: 278, + StartPos: 5286, + EndPos: 5287, + }, + Value: "a", + }, + }, + Right: &expr.Variable{ + Position: &position.Position{ + StartLine: 278, + EndLine: 278, + StartPos: 5292, + EndPos: 5293, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 278, + EndLine: 278, + StartPos: 5292, + EndPos: 5293, + }, + Value: "b", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 279, + EndLine: 279, + StartPos: 5298, + EndPos: 5306, + }, + Expr: &binary.BooleanOr{ + Position: &position.Position{ + StartLine: 279, + EndLine: 279, + StartPos: 5298, + EndPos: 5305, + }, + Left: &expr.Variable{ + Position: &position.Position{ + StartLine: 279, + EndLine: 279, + StartPos: 5298, + EndPos: 5299, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 279, + EndLine: 279, + StartPos: 5298, + EndPos: 5299, + }, + Value: "a", + }, + }, + Right: &expr.Variable{ + Position: &position.Position{ + StartLine: 279, + EndLine: 279, + StartPos: 5304, + EndPos: 5305, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 279, + EndLine: 279, + StartPos: 5304, + EndPos: 5305, + }, + Value: "b", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 280, + EndLine: 280, + StartPos: 5310, + EndPos: 5318, + }, + Expr: &binary.Coalesce{ + Position: &position.Position{ + StartLine: 280, + EndLine: 280, + StartPos: 5310, + EndPos: 5317, + }, + Left: &expr.Variable{ + Position: &position.Position{ + StartLine: 280, + EndLine: 280, + StartPos: 5310, + EndPos: 5311, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 280, + EndLine: 280, + StartPos: 5310, + EndPos: 5311, + }, + Value: "a", + }, + }, + Right: &expr.Variable{ + Position: &position.Position{ + StartLine: 280, + EndLine: 280, + StartPos: 5316, + EndPos: 5317, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 280, + EndLine: 280, + StartPos: 5316, + EndPos: 5317, + }, + Value: "b", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 281, + EndLine: 281, + StartPos: 5322, + EndPos: 5329, + }, + Expr: &binary.Concat{ + Position: &position.Position{ + StartLine: 281, + EndLine: 281, + StartPos: 5322, + EndPos: 5328, + }, + Left: &expr.Variable{ + Position: &position.Position{ + StartLine: 281, + EndLine: 281, + StartPos: 5322, + EndPos: 5323, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 281, + EndLine: 281, + StartPos: 5322, + EndPos: 5323, + }, + Value: "a", + }, + }, + Right: &expr.Variable{ + Position: &position.Position{ + StartLine: 281, + EndLine: 281, + StartPos: 5327, + EndPos: 5328, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 281, + EndLine: 281, + StartPos: 5327, + EndPos: 5328, + }, + Value: "b", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 282, + EndLine: 282, + StartPos: 5333, + EndPos: 5340, + }, + Expr: &binary.Div{ + Position: &position.Position{ + StartLine: 282, + EndLine: 282, + StartPos: 5333, + EndPos: 5339, + }, + Left: &expr.Variable{ + Position: &position.Position{ + StartLine: 282, + EndLine: 282, + StartPos: 5333, + EndPos: 5334, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 282, + EndLine: 282, + StartPos: 5333, + EndPos: 5334, + }, + Value: "a", + }, + }, + Right: &expr.Variable{ + Position: &position.Position{ + StartLine: 282, + EndLine: 282, + StartPos: 5338, + EndPos: 5339, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 282, + EndLine: 282, + StartPos: 5338, + EndPos: 5339, + }, + Value: "b", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 283, + EndLine: 283, + StartPos: 5344, + EndPos: 5352, + }, + Expr: &binary.Equal{ + Position: &position.Position{ + StartLine: 283, + EndLine: 283, + StartPos: 5344, + EndPos: 5351, + }, + Left: &expr.Variable{ + Position: &position.Position{ + StartLine: 283, + EndLine: 283, + StartPos: 5344, + EndPos: 5345, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 283, + EndLine: 283, + StartPos: 5344, + EndPos: 5345, + }, + Value: "a", + }, + }, + Right: &expr.Variable{ + Position: &position.Position{ + StartLine: 283, + EndLine: 283, + StartPos: 5350, + EndPos: 5351, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 283, + EndLine: 283, + StartPos: 5350, + EndPos: 5351, + }, + Value: "b", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 284, + EndLine: 284, + StartPos: 5356, + EndPos: 5364, + }, + Expr: &binary.GreaterOrEqual{ + Position: &position.Position{ + StartLine: 284, + EndLine: 284, + StartPos: 5356, + EndPos: 5363, + }, + Left: &expr.Variable{ + Position: &position.Position{ + StartLine: 284, + EndLine: 284, + StartPos: 5356, + EndPos: 5357, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 284, + EndLine: 284, + StartPos: 5356, + EndPos: 5357, + }, + Value: "a", + }, + }, + Right: &expr.Variable{ + Position: &position.Position{ + StartLine: 284, + EndLine: 284, + StartPos: 5362, + EndPos: 5363, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 284, + EndLine: 284, + StartPos: 5362, + EndPos: 5363, + }, + Value: "b", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 285, + EndLine: 285, + StartPos: 5368, + EndPos: 5375, + }, + Expr: &binary.Greater{ + Position: &position.Position{ + StartLine: 285, + EndLine: 285, + StartPos: 5368, + EndPos: 5374, + }, + Left: &expr.Variable{ + Position: &position.Position{ + StartLine: 285, + EndLine: 285, + StartPos: 5368, + EndPos: 5369, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 285, + EndLine: 285, + StartPos: 5368, + EndPos: 5369, + }, + Value: "a", + }, + }, + Right: &expr.Variable{ + Position: &position.Position{ + StartLine: 285, + EndLine: 285, + StartPos: 5373, + EndPos: 5374, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 285, + EndLine: 285, + StartPos: 5373, + EndPos: 5374, + }, + Value: "b", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 286, + EndLine: 286, + StartPos: 5379, + EndPos: 5388, + }, + Expr: &binary.Identical{ + Position: &position.Position{ + StartLine: 286, + EndLine: 286, + StartPos: 5379, + EndPos: 5387, + }, + Left: &expr.Variable{ + Position: &position.Position{ + StartLine: 286, + EndLine: 286, + StartPos: 5379, + EndPos: 5380, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 286, + EndLine: 286, + StartPos: 5379, + EndPos: 5380, + }, + Value: "a", + }, + }, + Right: &expr.Variable{ + Position: &position.Position{ + StartLine: 286, + EndLine: 286, + StartPos: 5386, + EndPos: 5387, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 286, + EndLine: 286, + StartPos: 5386, + EndPos: 5387, + }, + Value: "b", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 287, + EndLine: 287, + StartPos: 5392, + EndPos: 5401, + }, + Expr: &binary.LogicalAnd{ + Position: &position.Position{ + StartLine: 287, + EndLine: 287, + StartPos: 5392, + EndPos: 5400, + }, + Left: &expr.Variable{ + Position: &position.Position{ + StartLine: 287, + EndLine: 287, + StartPos: 5392, + EndPos: 5393, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 287, + EndLine: 287, + StartPos: 5392, + EndPos: 5393, + }, + Value: "a", + }, + }, + Right: &expr.Variable{ + Position: &position.Position{ + StartLine: 287, + EndLine: 287, + StartPos: 5399, + EndPos: 5400, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 287, + EndLine: 287, + StartPos: 5399, + EndPos: 5400, + }, + Value: "b", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 288, + EndLine: 288, + StartPos: 5405, + EndPos: 5413, + }, + Expr: &binary.LogicalOr{ + Position: &position.Position{ + StartLine: 288, + EndLine: 288, + StartPos: 5405, + EndPos: 5412, + }, + Left: &expr.Variable{ + Position: &position.Position{ + StartLine: 288, + EndLine: 288, + StartPos: 5405, + EndPos: 5406, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 288, + EndLine: 288, + StartPos: 5405, + EndPos: 5406, + }, + Value: "a", + }, + }, + Right: &expr.Variable{ + Position: &position.Position{ + StartLine: 288, + EndLine: 288, + StartPos: 5411, + EndPos: 5412, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 288, + EndLine: 288, + StartPos: 5411, + EndPos: 5412, + }, + Value: "b", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 289, + EndLine: 289, + StartPos: 5417, + EndPos: 5426, + }, + Expr: &binary.LogicalXor{ + Position: &position.Position{ + StartLine: 289, + EndLine: 289, + StartPos: 5417, + EndPos: 5425, + }, + Left: &expr.Variable{ + Position: &position.Position{ + StartLine: 289, + EndLine: 289, + StartPos: 5417, + EndPos: 5418, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 289, + EndLine: 289, + StartPos: 5417, + EndPos: 5418, + }, + Value: "a", + }, + }, + Right: &expr.Variable{ + Position: &position.Position{ + StartLine: 289, + EndLine: 289, + StartPos: 5424, + EndPos: 5425, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 289, + EndLine: 289, + StartPos: 5424, + EndPos: 5425, + }, + Value: "b", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 290, + EndLine: 290, + StartPos: 5430, + EndPos: 5437, + }, + Expr: &binary.Minus{ + Position: &position.Position{ + StartLine: 290, + EndLine: 290, + StartPos: 5430, + EndPos: 5436, + }, + Left: &expr.Variable{ + Position: &position.Position{ + StartLine: 290, + EndLine: 290, + StartPos: 5430, + EndPos: 5431, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 290, + EndLine: 290, + StartPos: 5430, + EndPos: 5431, + }, + Value: "a", + }, + }, + Right: &expr.Variable{ + Position: &position.Position{ + StartLine: 290, + EndLine: 290, + StartPos: 5435, + EndPos: 5436, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 290, + EndLine: 290, + StartPos: 5435, + EndPos: 5436, + }, + Value: "b", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 291, + EndLine: 291, + StartPos: 5441, + EndPos: 5448, + }, + Expr: &binary.Mod{ + Position: &position.Position{ + StartLine: 291, + EndLine: 291, + StartPos: 5441, + EndPos: 5447, + }, + Left: &expr.Variable{ + Position: &position.Position{ + StartLine: 291, + EndLine: 291, + StartPos: 5441, + EndPos: 5442, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 291, + EndLine: 291, + StartPos: 5441, + EndPos: 5442, + }, + Value: "a", + }, + }, + Right: &expr.Variable{ + Position: &position.Position{ + StartLine: 291, + EndLine: 291, + StartPos: 5446, + EndPos: 5447, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 291, + EndLine: 291, + StartPos: 5446, + EndPos: 5447, + }, + Value: "b", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 292, + EndLine: 292, + StartPos: 5452, + EndPos: 5459, + }, + Expr: &binary.Mul{ + Position: &position.Position{ + StartLine: 292, + EndLine: 292, + StartPos: 5452, + EndPos: 5458, + }, + Left: &expr.Variable{ + Position: &position.Position{ + StartLine: 292, + EndLine: 292, + StartPos: 5452, + EndPos: 5453, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 292, + EndLine: 292, + StartPos: 5452, + EndPos: 5453, + }, + Value: "a", + }, + }, + Right: &expr.Variable{ + Position: &position.Position{ + StartLine: 292, + EndLine: 292, + StartPos: 5457, + EndPos: 5458, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 292, + EndLine: 292, + StartPos: 5457, + EndPos: 5458, + }, + Value: "b", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 293, + EndLine: 293, + StartPos: 5463, + EndPos: 5471, + }, + Expr: &binary.NotEqual{ + Position: &position.Position{ + StartLine: 293, + EndLine: 293, + StartPos: 5463, + EndPos: 5470, + }, + Left: &expr.Variable{ + Position: &position.Position{ + StartLine: 293, + EndLine: 293, + StartPos: 5463, + EndPos: 5464, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 293, + EndLine: 293, + StartPos: 5463, + EndPos: 5464, + }, + Value: "a", + }, + }, + Right: &expr.Variable{ + Position: &position.Position{ + StartLine: 293, + EndLine: 293, + StartPos: 5469, + EndPos: 5470, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 293, + EndLine: 293, + StartPos: 5469, + EndPos: 5470, + }, + Value: "b", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 294, + EndLine: 294, + StartPos: 5475, + EndPos: 5484, + }, + Expr: &binary.NotIdentical{ + Position: &position.Position{ + StartLine: 294, + EndLine: 294, + StartPos: 5475, + EndPos: 5483, + }, + Left: &expr.Variable{ + Position: &position.Position{ + StartLine: 294, + EndLine: 294, + StartPos: 5475, + EndPos: 5476, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 294, + EndLine: 294, + StartPos: 5475, + EndPos: 5476, + }, + Value: "a", + }, + }, + Right: &expr.Variable{ + Position: &position.Position{ + StartLine: 294, + EndLine: 294, + StartPos: 5482, + EndPos: 5483, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 294, + EndLine: 294, + StartPos: 5482, + EndPos: 5483, + }, + Value: "b", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 295, + EndLine: 295, + StartPos: 5488, + EndPos: 5495, + }, + Expr: &binary.Plus{ + Position: &position.Position{ + StartLine: 295, + EndLine: 295, + StartPos: 5488, + EndPos: 5494, + }, + Left: &expr.Variable{ + Position: &position.Position{ + StartLine: 295, + EndLine: 295, + StartPos: 5488, + EndPos: 5489, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 295, + EndLine: 295, + StartPos: 5488, + EndPos: 5489, + }, + Value: "a", + }, + }, + Right: &expr.Variable{ + Position: &position.Position{ + StartLine: 295, + EndLine: 295, + StartPos: 5493, + EndPos: 5494, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 295, + EndLine: 295, + StartPos: 5493, + EndPos: 5494, + }, + Value: "b", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 296, + EndLine: 296, + StartPos: 5499, + EndPos: 5507, + }, + Expr: &binary.Pow{ + Position: &position.Position{ + StartLine: 296, + EndLine: 296, + StartPos: 5499, + EndPos: 5506, + }, + Left: &expr.Variable{ + Position: &position.Position{ + StartLine: 296, + EndLine: 296, + StartPos: 5499, + EndPos: 5500, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 296, + EndLine: 296, + StartPos: 5499, + EndPos: 5500, + }, + Value: "a", + }, + }, + Right: &expr.Variable{ + Position: &position.Position{ + StartLine: 296, + EndLine: 296, + StartPos: 5505, + EndPos: 5506, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 296, + EndLine: 296, + StartPos: 5505, + EndPos: 5506, + }, + Value: "b", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 297, + EndLine: 297, + StartPos: 5511, + EndPos: 5519, + }, + Expr: &binary.ShiftLeft{ + Position: &position.Position{ + StartLine: 297, + EndLine: 297, + StartPos: 5511, + EndPos: 5518, + }, + Left: &expr.Variable{ + Position: &position.Position{ + StartLine: 297, + EndLine: 297, + StartPos: 5511, + EndPos: 5512, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 297, + EndLine: 297, + StartPos: 5511, + EndPos: 5512, + }, + Value: "a", + }, + }, + Right: &expr.Variable{ + Position: &position.Position{ + StartLine: 297, + EndLine: 297, + StartPos: 5517, + EndPos: 5518, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 297, + EndLine: 297, + StartPos: 5517, + EndPos: 5518, + }, + Value: "b", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 298, + EndLine: 298, + StartPos: 5523, + EndPos: 5531, + }, + Expr: &binary.ShiftRight{ + Position: &position.Position{ + StartLine: 298, + EndLine: 298, + StartPos: 5523, + EndPos: 5530, + }, + Left: &expr.Variable{ + Position: &position.Position{ + StartLine: 298, + EndLine: 298, + StartPos: 5523, + EndPos: 5524, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 298, + EndLine: 298, + StartPos: 5523, + EndPos: 5524, + }, + Value: "a", + }, + }, + Right: &expr.Variable{ + Position: &position.Position{ + StartLine: 298, + EndLine: 298, + StartPos: 5529, + EndPos: 5530, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 298, + EndLine: 298, + StartPos: 5529, + EndPos: 5530, + }, + Value: "b", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 299, + EndLine: 299, + StartPos: 5535, + EndPos: 5543, + }, + Expr: &binary.SmallerOrEqual{ + Position: &position.Position{ + StartLine: 299, + EndLine: 299, + StartPos: 5535, + EndPos: 5542, + }, + Left: &expr.Variable{ + Position: &position.Position{ + StartLine: 299, + EndLine: 299, + StartPos: 5535, + EndPos: 5536, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 299, + EndLine: 299, + StartPos: 5535, + EndPos: 5536, + }, + Value: "a", + }, + }, + Right: &expr.Variable{ + Position: &position.Position{ + StartLine: 299, + EndLine: 299, + StartPos: 5541, + EndPos: 5542, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 299, + EndLine: 299, + StartPos: 5541, + EndPos: 5542, + }, + Value: "b", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 300, + EndLine: 300, + StartPos: 5547, + EndPos: 5554, + }, + Expr: &binary.Smaller{ + Position: &position.Position{ + StartLine: 300, + EndLine: 300, + StartPos: 5547, + EndPos: 5553, + }, + Left: &expr.Variable{ + Position: &position.Position{ + StartLine: 300, + EndLine: 300, + StartPos: 5547, + EndPos: 5548, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 300, + EndLine: 300, + StartPos: 5547, + EndPos: 5548, + }, + Value: "a", + }, + }, + Right: &expr.Variable{ + Position: &position.Position{ + StartLine: 300, + EndLine: 300, + StartPos: 5552, + EndPos: 5553, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 300, + EndLine: 300, + StartPos: 5552, + EndPos: 5553, + }, + Value: "b", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 301, + EndLine: 301, + StartPos: 5558, + EndPos: 5567, + }, + Expr: &binary.Spaceship{ + Position: &position.Position{ + StartLine: 301, + EndLine: 301, + StartPos: 5558, + EndPos: 5566, + }, + Left: &expr.Variable{ + Position: &position.Position{ + StartLine: 301, + EndLine: 301, + StartPos: 5558, + EndPos: 5559, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 301, + EndLine: 301, + StartPos: 5558, + EndPos: 5559, + }, + Value: "a", + }, + }, + Right: &expr.Variable{ + Position: &position.Position{ + StartLine: 301, + EndLine: 301, + StartPos: 5565, + EndPos: 5566, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 301, + EndLine: 301, + StartPos: 5565, + EndPos: 5566, + }, + Value: "b", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 303, + EndLine: 303, + StartPos: 5572, + EndPos: 5580, + }, + Expr: &assign.Reference{ + Position: &position.Position{ + StartLine: 303, + EndLine: 303, + StartPos: 5572, + EndPos: 5579, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 303, + EndLine: 303, + StartPos: 5572, + EndPos: 5573, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 303, + EndLine: 303, + StartPos: 5572, + EndPos: 5573, + }, + Value: "a", + }, + }, + Expression: &expr.Variable{ + Position: &position.Position{ + StartLine: 303, + EndLine: 303, + StartPos: 5578, + EndPos: 5579, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 303, + EndLine: 303, + StartPos: 5578, + EndPos: 5579, + }, + Value: "b", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 304, + EndLine: 304, + StartPos: 5584, + EndPos: 5591, + }, + Expr: &assign.Assign{ + Position: &position.Position{ + StartLine: 304, + EndLine: 304, + StartPos: 5584, + EndPos: 5590, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 304, + EndLine: 304, + StartPos: 5584, + EndPos: 5585, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 304, + EndLine: 304, + StartPos: 5584, + EndPos: 5585, + }, + Value: "a", + }, + }, + Expression: &expr.Variable{ + Position: &position.Position{ + StartLine: 304, + EndLine: 304, + StartPos: 5589, + EndPos: 5590, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 304, + EndLine: 304, + StartPos: 5589, + EndPos: 5590, + }, + Value: "b", + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 305, + EndLine: 305, + StartPos: 5595, + EndPos: 5603, + }, Expr: &assign.BitwiseAnd{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expression: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Position: &position.Position{ + StartLine: 305, + EndLine: 305, + StartPos: 5595, + EndPos: 5602, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 305, + EndLine: 305, + StartPos: 5595, + EndPos: 5596, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 305, + EndLine: 305, + StartPos: 5595, + EndPos: 5596, + }, + Value: "a", + }, + }, + Expression: &expr.Variable{ + Position: &position.Position{ + StartLine: 305, + EndLine: 305, + StartPos: 5601, + EndPos: 5602, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 305, + EndLine: 305, + StartPos: 5601, + EndPos: 5602, + }, + Value: "b", + }, + }, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 306, + EndLine: 306, + StartPos: 5607, + EndPos: 5615, + }, Expr: &assign.BitwiseOr{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expression: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Position: &position.Position{ + StartLine: 306, + EndLine: 306, + StartPos: 5607, + EndPos: 5614, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 306, + EndLine: 306, + StartPos: 5607, + EndPos: 5608, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 306, + EndLine: 306, + StartPos: 5607, + EndPos: 5608, + }, + Value: "a", + }, + }, + Expression: &expr.Variable{ + Position: &position.Position{ + StartLine: 306, + EndLine: 306, + StartPos: 5613, + EndPos: 5614, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 306, + EndLine: 306, + StartPos: 5613, + EndPos: 5614, + }, + Value: "b", + }, + }, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 307, + EndLine: 307, + StartPos: 5619, + EndPos: 5627, + }, Expr: &assign.BitwiseXor{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expression: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Position: &position.Position{ + StartLine: 307, + EndLine: 307, + StartPos: 5619, + EndPos: 5626, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 307, + EndLine: 307, + StartPos: 5619, + EndPos: 5620, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 307, + EndLine: 307, + StartPos: 5619, + EndPos: 5620, + }, + Value: "a", + }, + }, + Expression: &expr.Variable{ + Position: &position.Position{ + StartLine: 307, + EndLine: 307, + StartPos: 5625, + EndPos: 5626, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 307, + EndLine: 307, + StartPos: 5625, + EndPos: 5626, + }, + Value: "b", + }, + }, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 308, + EndLine: 308, + StartPos: 5631, + EndPos: 5639, + }, Expr: &assign.Concat{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expression: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Position: &position.Position{ + StartLine: 308, + EndLine: 308, + StartPos: 5631, + EndPos: 5638, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 308, + EndLine: 308, + StartPos: 5631, + EndPos: 5632, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 308, + EndLine: 308, + StartPos: 5631, + EndPos: 5632, + }, + Value: "a", + }, + }, + Expression: &expr.Variable{ + Position: &position.Position{ + StartLine: 308, + EndLine: 308, + StartPos: 5637, + EndPos: 5638, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 308, + EndLine: 308, + StartPos: 5637, + EndPos: 5638, + }, + Value: "b", + }, + }, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 309, + EndLine: 309, + StartPos: 5643, + EndPos: 5651, + }, Expr: &assign.Div{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expression: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Position: &position.Position{ + StartLine: 309, + EndLine: 309, + StartPos: 5643, + EndPos: 5650, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 309, + EndLine: 309, + StartPos: 5643, + EndPos: 5644, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 309, + EndLine: 309, + StartPos: 5643, + EndPos: 5644, + }, + Value: "a", + }, + }, + Expression: &expr.Variable{ + Position: &position.Position{ + StartLine: 309, + EndLine: 309, + StartPos: 5649, + EndPos: 5650, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 309, + EndLine: 309, + StartPos: 5649, + EndPos: 5650, + }, + Value: "b", + }, + }, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 310, + EndLine: 310, + StartPos: 5655, + EndPos: 5663, + }, Expr: &assign.Minus{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expression: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Position: &position.Position{ + StartLine: 310, + EndLine: 310, + StartPos: 5655, + EndPos: 5662, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 310, + EndLine: 310, + StartPos: 5655, + EndPos: 5656, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 310, + EndLine: 310, + StartPos: 5655, + EndPos: 5656, + }, + Value: "a", + }, + }, + Expression: &expr.Variable{ + Position: &position.Position{ + StartLine: 310, + EndLine: 310, + StartPos: 5661, + EndPos: 5662, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 310, + EndLine: 310, + StartPos: 5661, + EndPos: 5662, + }, + Value: "b", + }, + }, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 311, + EndLine: 311, + StartPos: 5667, + EndPos: 5675, + }, Expr: &assign.Mod{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expression: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Position: &position.Position{ + StartLine: 311, + EndLine: 311, + StartPos: 5667, + EndPos: 5674, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 311, + EndLine: 311, + StartPos: 5667, + EndPos: 5668, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 311, + EndLine: 311, + StartPos: 5667, + EndPos: 5668, + }, + Value: "a", + }, + }, + Expression: &expr.Variable{ + Position: &position.Position{ + StartLine: 311, + EndLine: 311, + StartPos: 5673, + EndPos: 5674, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 311, + EndLine: 311, + StartPos: 5673, + EndPos: 5674, + }, + Value: "b", + }, + }, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 312, + EndLine: 312, + StartPos: 5679, + EndPos: 5687, + }, Expr: &assign.Mul{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expression: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Position: &position.Position{ + StartLine: 312, + EndLine: 312, + StartPos: 5679, + EndPos: 5686, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 312, + EndLine: 312, + StartPos: 5679, + EndPos: 5680, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 312, + EndLine: 312, + StartPos: 5679, + EndPos: 5680, + }, + Value: "a", + }, + }, + Expression: &expr.Variable{ + Position: &position.Position{ + StartLine: 312, + EndLine: 312, + StartPos: 5685, + EndPos: 5686, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 312, + EndLine: 312, + StartPos: 5685, + EndPos: 5686, + }, + Value: "b", + }, + }, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 313, + EndLine: 313, + StartPos: 5691, + EndPos: 5699, + }, Expr: &assign.Plus{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expression: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Position: &position.Position{ + StartLine: 313, + EndLine: 313, + StartPos: 5691, + EndPos: 5698, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 313, + EndLine: 313, + StartPos: 5691, + EndPos: 5692, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 313, + EndLine: 313, + StartPos: 5691, + EndPos: 5692, + }, + Value: "a", + }, + }, + Expression: &expr.Variable{ + Position: &position.Position{ + StartLine: 313, + EndLine: 313, + StartPos: 5697, + EndPos: 5698, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 313, + EndLine: 313, + StartPos: 5697, + EndPos: 5698, + }, + Value: "b", + }, + }, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 314, + EndLine: 314, + StartPos: 5703, + EndPos: 5712, + }, Expr: &assign.Pow{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expression: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Position: &position.Position{ + StartLine: 314, + EndLine: 314, + StartPos: 5703, + EndPos: 5711, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 314, + EndLine: 314, + StartPos: 5703, + EndPos: 5704, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 314, + EndLine: 314, + StartPos: 5703, + EndPos: 5704, + }, + Value: "a", + }, + }, + Expression: &expr.Variable{ + Position: &position.Position{ + StartLine: 314, + EndLine: 314, + StartPos: 5710, + EndPos: 5711, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 314, + EndLine: 314, + StartPos: 5710, + EndPos: 5711, + }, + Value: "b", + }, + }, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 315, + EndLine: 315, + StartPos: 5716, + EndPos: 5725, + }, Expr: &assign.ShiftLeft{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expression: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Position: &position.Position{ + StartLine: 315, + EndLine: 315, + StartPos: 5716, + EndPos: 5724, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 315, + EndLine: 315, + StartPos: 5716, + EndPos: 5717, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 315, + EndLine: 315, + StartPos: 5716, + EndPos: 5717, + }, + Value: "a", + }, + }, + Expression: &expr.Variable{ + Position: &position.Position{ + StartLine: 315, + EndLine: 315, + StartPos: 5723, + EndPos: 5724, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 315, + EndLine: 315, + StartPos: 5723, + EndPos: 5724, + }, + Value: "b", + }, + }, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 316, + EndLine: 316, + StartPos: 5729, + EndPos: 5738, + }, Expr: &assign.ShiftRight{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expression: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Position: &position.Position{ + StartLine: 316, + EndLine: 316, + StartPos: 5729, + EndPos: 5737, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 316, + EndLine: 316, + StartPos: 5729, + EndPos: 5730, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 316, + EndLine: 316, + StartPos: 5729, + EndPos: 5730, + }, + Value: "a", + }, + }, + Expression: &expr.Variable{ + Position: &position.Position{ + StartLine: 316, + EndLine: 316, + StartPos: 5736, + EndPos: 5737, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 316, + EndLine: 316, + StartPos: 5736, + EndPos: 5737, + }, + Value: "b", + }, + }, }, }, &stmt.Class{ - ClassName: &node.Identifier{Value: "foo"}, + Position: &position.Position{ + StartLine: 318, + EndLine: 318, + StartPos: 5743, + EndPos: 5781, + }, + PhpDocComment: "", + ClassName: &node.Identifier{ + Position: &position.Position{ + StartLine: 318, + EndLine: 318, + StartPos: 5749, + EndPos: 5751, + }, + Value: "foo", + }, Stmts: []node.Node{ &stmt.ClassMethod{ - MethodName: &node.Identifier{Value: "class"}, - Modifiers: []node.Node{&node.Identifier{Value: "public"}}, + Position: &position.Position{ + StartLine: 318, + EndLine: 318, + StartPos: 5754, + EndPos: 5779, + }, + ReturnsRef: false, + PhpDocComment: "", + MethodName: &node.Identifier{ + Position: &position.Position{ + StartLine: 318, + EndLine: 318, + StartPos: 5770, + EndPos: 5774, + }, + Value: "class", + }, + Modifiers: []node.Node{ + &node.Identifier{ + Position: &position.Position{ + StartLine: 318, + EndLine: 318, + StartPos: 5754, + EndPos: 5759, + }, + Value: "public", + }, + }, Stmt: &stmt.StmtList{ - Stmts: []node.Node{}, + Position: &position.Position{ + StartLine: 318, + EndLine: 318, + StartPos: 5778, + EndPos: 5779, + }, + Stmts: []node.Node{ + }, }, }, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 319, + EndLine: 319, + StartPos: 5785, + EndPos: 5795, + }, Expr: &expr.FunctionCall{ + Position: &position.Position{ + StartLine: 319, + EndLine: 319, + StartPos: 5785, + EndPos: 5794, + }, Function: &name.FullyQualified{ + Position: &position.Position{ + StartLine: 319, + EndLine: 319, + StartPos: 5785, + EndPos: 5792, + }, Parts: []node.Node{ - &name.NamePart{Value: "foo"}, - &name.NamePart{Value: "bar"}, + &name.NamePart{ + Position: &position.Position{ + StartLine: 319, + EndLine: 319, + StartPos: 5786, + EndPos: 5788, + }, + Value: "foo", + }, + &name.NamePart{ + Position: &position.Position{ + StartLine: 319, + EndLine: 319, + StartPos: 5790, + EndPos: 5792, + }, + Value: "bar", + }, + }, + }, + ArgumentList: &node.ArgumentList{ + Position: &position.Position{ + StartLine: 319, + EndLine: 319, + StartPos: 5793, + EndPos: 5794, }, }, - - ArgumentList: &node.ArgumentList{}, }, }, &stmt.Function{ - FunctionName: &node.Identifier{Value: "foo"}, + Position: &position.Position{ + StartLine: 321, + EndLine: 327, + StartPos: 5800, + EndPos: 5926, + }, + ReturnsRef: false, + PhpDocComment: "", + FunctionName: &node.Identifier{ + Position: &position.Position{ + StartLine: 321, + EndLine: 321, + StartPos: 5809, + EndPos: 5811, + }, + Value: "foo", + }, Params: []node.Node{ &node.Parameter{ - ByRef: true, + Position: &position.Position{ + StartLine: 321, + EndLine: 321, + StartPos: 5813, + EndPos: 5815, + }, + ByRef: true, Variadic: false, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 321, + EndLine: 321, + StartPos: 5814, + EndPos: 5815, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 321, + EndLine: 321, + StartPos: 5814, + EndPos: 5815, + }, + Value: "a", + }, + }, }, &node.Parameter{ - ByRef: false, + Position: &position.Position{ + StartLine: 321, + EndLine: 321, + StartPos: 5818, + EndPos: 5822, + }, + ByRef: false, Variadic: true, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 321, + EndLine: 321, + StartPos: 5821, + EndPos: 5822, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 321, + EndLine: 321, + StartPos: 5821, + EndPos: 5822, + }, + Value: "b", + }, + }, }, }, Stmts: []node.Node{ - &stmt.HaltCompiler{}, + &stmt.HaltCompiler{ + Position: &position.Position{ + StartLine: 322, + EndLine: 322, + StartPos: 5830, + EndPos: 5847, + }, + }, &stmt.Function{ - FunctionName: &node.Identifier{Value: "bar"}, - Stmts: []node.Node{}, + Position: &position.Position{ + StartLine: 323, + EndLine: 323, + StartPos: 5852, + EndPos: 5868, + }, + PhpDocComment: "", + ReturnsRef: false, + FunctionName: &node.Identifier{ + Position: &position.Position{ + StartLine: 323, + EndLine: 323, + StartPos: 5861, + EndPos: 5863, + }, + Value: "bar", + }, + Stmts: []node.Node{ + }, }, &stmt.Class{ - ClassName: &node.Identifier{Value: "Baz"}, - Stmts: []node.Node{}, + Position: &position.Position{ + StartLine: 324, + EndLine: 324, + StartPos: 5873, + EndPos: 5884, + }, + PhpDocComment: "", + ClassName: &node.Identifier{ + Position: &position.Position{ + StartLine: 324, + EndLine: 324, + StartPos: 5879, + EndPos: 5881, + }, + Value: "Baz", + }, + Stmts: []node.Node{ + }, }, &stmt.Trait{ - TraitName: &node.Identifier{Value: "Quux"}, - Stmts: []node.Node{}, + Position: &position.Position{ + StartLine: 325, + EndLine: 325, + StartPos: 5889, + EndPos: 5900, + }, + PhpDocComment: "", + TraitName: &node.Identifier{ + Position: &position.Position{ + StartLine: 325, + EndLine: 325, + StartPos: 5895, + EndPos: 5898, + }, + Value: "Quux", + }, + Stmts: []node.Node{ + }, }, &stmt.Interface{ - InterfaceName: &node.Identifier{Value: "Quuux"}, - Stmts: []node.Node{}, + Position: &position.Position{ + StartLine: 326, + EndLine: 326, + StartPos: 5905, + EndPos: 5922, + }, + PhpDocComment: "", + InterfaceName: &node.Identifier{ + Position: &position.Position{ + StartLine: 326, + EndLine: 326, + StartPos: 5915, + EndPos: 5919, + }, + Value: "Quuux", + }, + Stmts: []node.Node{ + }, }, }, }, &stmt.Function{ - FunctionName: &node.Identifier{Value: "foo"}, + Position: &position.Position{ + StartLine: 329, + EndLine: 329, + StartPos: 5933, + EndPos: 5975, + }, + ReturnsRef: false, + PhpDocComment: "", + FunctionName: &node.Identifier{ + Position: &position.Position{ + StartLine: 329, + EndLine: 329, + StartPos: 5942, + EndPos: 5944, + }, + Value: "foo", + }, Params: []node.Node{ &node.Parameter{ - ByRef: true, - Variadic: false, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - DefaultValue: &scalar.Lnumber{Value: "1"}, + Position: &position.Position{ + StartLine: 329, + EndLine: 329, + StartPos: 5946, + EndPos: 5952, + }, + ByRef: true, + Variadic: false, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 329, + EndLine: 329, + StartPos: 5947, + EndPos: 5948, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 329, + EndLine: 329, + StartPos: 5947, + EndPos: 5948, + }, + Value: "a", + }, + }, + DefaultValue: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 329, + EndLine: 329, + StartPos: 5952, + EndPos: 5952, + }, + Value: "1", + }, }, &node.Parameter{ - ByRef: false, - Variadic: true, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - DefaultValue: &scalar.Lnumber{Value: "1"}, + Position: &position.Position{ + StartLine: 329, + EndLine: 329, + StartPos: 5955, + EndPos: 5963, + }, + Variadic: true, + ByRef: false, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 329, + EndLine: 329, + StartPos: 5958, + EndPos: 5959, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 329, + EndLine: 329, + StartPos: 5958, + EndPos: 5959, + }, + Value: "b", + }, + }, + DefaultValue: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 329, + EndLine: 329, + StartPos: 5963, + EndPos: 5963, + }, + Value: "1", + }, }, &node.Parameter{ - ByRef: false, - Variadic: false, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "c"}}, - DefaultValue: &scalar.Lnumber{Value: "1"}, + Position: &position.Position{ + StartLine: 329, + EndLine: 329, + StartPos: 5966, + EndPos: 5971, + }, + ByRef: false, + Variadic: false, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 329, + EndLine: 329, + StartPos: 5966, + EndPos: 5967, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 329, + EndLine: 329, + StartPos: 5966, + EndPos: 5967, + }, + Value: "c", + }, + }, + DefaultValue: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 329, + EndLine: 329, + StartPos: 5971, + EndPos: 5971, + }, + Value: "1", + }, }, }, - Stmts: []node.Node{}, + Stmts: []node.Node{ + }, }, &stmt.Function{ - FunctionName: &node.Identifier{Value: "foo"}, + Position: &position.Position{ + StartLine: 330, + EndLine: 330, + StartPos: 5979, + EndPos: 6016, + }, + ReturnsRef: false, + PhpDocComment: "", + FunctionName: &node.Identifier{ + Position: &position.Position{ + StartLine: 330, + EndLine: 330, + StartPos: 5988, + EndPos: 5990, + }, + Value: "foo", + }, Params: []node.Node{ &node.Parameter{ - ByRef: false, - Variadic: false, - VariableType: &node.Identifier{Value: "array"}, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Position: &position.Position{ + StartLine: 330, + EndLine: 330, + StartPos: 5992, + EndPos: 5999, + }, + ByRef: false, + Variadic: false, + VariableType: &node.Identifier{ + Position: &position.Position{ + StartLine: 330, + EndLine: 330, + StartPos: 5992, + EndPos: 5996, + }, + Value: "array", + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 330, + EndLine: 330, + StartPos: 5998, + EndPos: 5999, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 330, + EndLine: 330, + StartPos: 5998, + EndPos: 5999, + }, + Value: "a", + }, + }, }, &node.Parameter{ - ByRef: false, - Variadic: false, - VariableType: &node.Identifier{Value: "callable"}, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Position: &position.Position{ + StartLine: 330, + EndLine: 330, + StartPos: 6002, + EndPos: 6012, + }, + ByRef: false, + Variadic: false, + VariableType: &node.Identifier{ + Position: &position.Position{ + StartLine: 330, + EndLine: 330, + StartPos: 6002, + EndPos: 6009, + }, + Value: "callable", + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 330, + EndLine: 330, + StartPos: 6011, + EndPos: 6012, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 330, + EndLine: 330, + StartPos: 6011, + EndPos: 6012, + }, + Value: "b", + }, + }, }, }, - Stmts: []node.Node{}, + Stmts: []node.Node{ + }, }, &stmt.Class{ - ClassName: &node.Identifier{Value: "foo"}, + Position: &position.Position{ + StartLine: 331, + EndLine: 331, + StartPos: 6020, + EndPos: 6121, + }, + PhpDocComment: "", + ClassName: &node.Identifier{ + Position: &position.Position{ + StartLine: 331, + EndLine: 331, + StartPos: 6041, + EndPos: 6043, + }, + Value: "foo", + }, Modifiers: []node.Node{ - &node.Identifier{Value: "abstract"}, - &node.Identifier{Value: "final"}, + &node.Identifier{ + Position: &position.Position{ + StartLine: 331, + EndLine: 331, + StartPos: 6020, + EndPos: 6027, + }, + Value: "abstract", + }, + &node.Identifier{ + Position: &position.Position{ + StartLine: 331, + EndLine: 331, + StartPos: 6029, + EndPos: 6033, + }, + Value: "final", + }, }, Stmts: []node.Node{ &stmt.ClassMethod{ - MethodName: &node.Identifier{Value: "bar"}, - Modifiers: []node.Node{ - &node.Identifier{Value: "abstract"}, - &node.Identifier{Value: "protected"}, - &node.Identifier{Value: "static"}, + Position: &position.Position{ + StartLine: 331, + EndLine: 331, + StartPos: 6047, + EndPos: 6087, + }, + PhpDocComment: "", + ReturnsRef: false, + MethodName: &node.Identifier{ + Position: &position.Position{ + StartLine: 331, + EndLine: 331, + StartPos: 6082, + EndPos: 6084, + }, + Value: "bar", + }, + Modifiers: []node.Node{ + &node.Identifier{ + Position: &position.Position{ + StartLine: 331, + EndLine: 331, + StartPos: 6047, + EndPos: 6054, + }, + Value: "abstract", + }, + &node.Identifier{ + Position: &position.Position{ + StartLine: 331, + EndLine: 331, + StartPos: 6056, + EndPos: 6064, + }, + Value: "protected", + }, + &node.Identifier{ + Position: &position.Position{ + StartLine: 331, + EndLine: 331, + StartPos: 6066, + EndPos: 6071, + }, + Value: "static", + }, + }, + Stmt: &stmt.Nop{ + Position: &position.Position{ + StartLine: 331, + EndLine: 331, + StartPos: 6087, + EndPos: 6087, + }, }, - Stmt: &stmt.Nop{}, }, &stmt.ClassMethod{ - MethodName: &node.Identifier{Value: "baz"}, + Position: &position.Position{ + StartLine: 331, + EndLine: 331, + StartPos: 6089, + EndPos: 6119, + }, + ReturnsRef: false, + PhpDocComment: "", + MethodName: &node.Identifier{ + Position: &position.Position{ + StartLine: 331, + EndLine: 331, + StartPos: 6112, + EndPos: 6114, + }, + Value: "baz", + }, Modifiers: []node.Node{ - &node.Identifier{Value: "final"}, - &node.Identifier{Value: "private"}, + &node.Identifier{ + Position: &position.Position{ + StartLine: 331, + EndLine: 331, + StartPos: 6089, + EndPos: 6093, + }, + Value: "final", + }, + &node.Identifier{ + Position: &position.Position{ + StartLine: 331, + EndLine: 331, + StartPos: 6095, + EndPos: 6101, + }, + Value: "private", + }, }, Stmt: &stmt.StmtList{ - Stmts: []node.Node{}, + Position: &position.Position{ + StartLine: 331, + EndLine: 331, + StartPos: 6118, + EndPos: 6119, + }, + Stmts: []node.Node{ + }, }, }, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 333, + EndLine: 333, + StartPos: 6127, + EndPos: 6140, + }, Expr: &expr.PropertyFetch{ + Position: &position.Position{ + StartLine: 333, + EndLine: 333, + StartPos: 6127, + EndPos: 6139, + }, Variable: &expr.New{ - Class: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Foo"}}}, + Position: &position.Position{ + StartLine: 333, + EndLine: 333, + StartPos: 6127, + EndPos: 6133, + }, + Class: &name.Name{ + Position: &position.Position{ + StartLine: 333, + EndLine: 333, + StartPos: 6131, + EndPos: 6133, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 333, + EndLine: 333, + StartPos: 6131, + EndPos: 6133, + }, + Value: "Foo", + }, + }, + }, + }, + Property: &node.Identifier{ + Position: &position.Position{ + StartLine: 333, + EndLine: 333, + StartPos: 6137, + EndPos: 6139, + }, + Value: "bar", }, - Property: &node.Identifier{Value: "bar"}, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 334, + EndLine: 334, + StartPos: 6145, + EndPos: 6155, + }, Expr: &expr.FunctionCall{ + Position: &position.Position{ + StartLine: 334, + EndLine: 334, + StartPos: 6145, + EndPos: 6154, + }, Function: &expr.New{ - Class: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Foo"}}}, - }, - - ArgumentList: &node.ArgumentList{}, - }, - }, - &stmt.Expression{ - Expr: &expr.FunctionCall{ - Function: &expr.ArrayDimFetch{ - Variable: &expr.ShortArray{ - Items: []node.Node{ - &expr.ArrayItem{ - Val: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, + Position: &position.Position{ + StartLine: 334, + EndLine: 334, + StartPos: 6145, + EndPos: 6151, + }, + Class: &name.Name{ + Position: &position.Position{ + StartLine: 334, + EndLine: 334, + StartPos: 6149, + EndPos: 6151, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 334, + EndLine: 334, + StartPos: 6149, + EndPos: 6151, + }, + Value: "Foo", }, }, }, - Dim: &scalar.Lnumber{Value: "0"}, }, - - ArgumentList: &node.ArgumentList{}, + ArgumentList: &node.ArgumentList{ + Position: &position.Position{ + StartLine: 334, + EndLine: 334, + StartPos: 6153, + EndPos: 6154, + }, + }, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 335, + EndLine: 335, + StartPos: 6159, + EndPos: 6170, + }, Expr: &expr.FunctionCall{ + Position: &position.Position{ + StartLine: 335, + EndLine: 335, + StartPos: 6159, + EndPos: 6169, + }, Function: &expr.ArrayDimFetch{ + Position: &position.Position{ + StartLine: 335, + EndLine: 335, + StartPos: 6159, + EndPos: 6167, + }, + Variable: &expr.ShortArray{ + Position: &position.Position{ + StartLine: 335, + EndLine: 335, + StartPos: 6159, + EndPos: 6164, + }, + Items: []node.Node{ + &expr.ArrayItem{ + Position: &position.Position{ + StartLine: 335, + EndLine: 335, + StartPos: 6160, + EndPos: 6163, + }, + Val: &expr.Variable{ + Position: &position.Position{ + StartLine: 335, + EndLine: 335, + StartPos: 6160, + EndPos: 6163, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 335, + EndLine: 335, + StartPos: 6160, + EndPos: 6163, + }, + Value: "foo", + }, + }, + }, + }, + }, + Dim: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 335, + EndLine: 335, + StartPos: 6166, + EndPos: 6166, + }, + Value: "0", + }, + }, + ArgumentList: &node.ArgumentList{ + Position: &position.Position{ + StartLine: 335, + EndLine: 335, + StartPos: 6168, + EndPos: 6169, + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 336, + EndLine: 336, + StartPos: 6174, + EndPos: 6182, + }, + Expr: &expr.FunctionCall{ + Position: &position.Position{ + StartLine: 336, + EndLine: 336, + StartPos: 6174, + EndPos: 6181, + }, + Function: &expr.ArrayDimFetch{ + Position: &position.Position{ + StartLine: 336, + EndLine: 336, + StartPos: 6174, + EndPos: 6179, + }, Variable: &expr.ConstFetch{ - Constant: &name.Name{Parts: []node.Node{&name.NamePart{Value: "foo"}}}, - }, - Dim: &scalar.Lnumber{Value: "1"}, - }, - - ArgumentList: &node.ArgumentList{}, - }, - }, - &stmt.Expression{ - Expr: &expr.FunctionCall{ - Function: &scalar.String{Value: "\"foo\""}, - - ArgumentList: &node.ArgumentList{}, - }, - }, - &stmt.Expression{ - Expr: &expr.FunctionCall{ - Function: &expr.ArrayDimFetch{ - Variable: &expr.ShortArray{ - Items: []node.Node{ - &expr.ArrayItem{ - Val: &scalar.Lnumber{Value: "1"}, + Position: &position.Position{ + StartLine: 336, + EndLine: 336, + StartPos: 6174, + EndPos: 6176, + }, + Constant: &name.Name{ + Position: &position.Position{ + StartLine: 336, + EndLine: 336, + StartPos: 6174, + EndPos: 6176, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 336, + EndLine: 336, + StartPos: 6174, + EndPos: 6176, + }, + Value: "foo", + }, }, }, }, - Dim: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, + Dim: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 336, + EndLine: 336, + StartPos: 6178, + EndPos: 6178, + }, + Value: "1", + }, + }, + ArgumentList: &node.ArgumentList{ + Position: &position.Position{ + StartLine: 336, + EndLine: 336, + StartPos: 6180, + EndPos: 6181, + }, }, - - ArgumentList: &node.ArgumentList{}, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 337, + EndLine: 337, + StartPos: 6186, + EndPos: 6193, + }, + Expr: &expr.FunctionCall{ + Position: &position.Position{ + StartLine: 337, + EndLine: 337, + StartPos: 6186, + EndPos: 6192, + }, + Function: &scalar.String{ + Position: &position.Position{ + StartLine: 337, + EndLine: 337, + StartPos: 6186, + EndPos: 6190, + }, + Value: "\"foo\"", + }, + ArgumentList: &node.ArgumentList{ + Position: &position.Position{ + StartLine: 337, + EndLine: 337, + StartPos: 6191, + EndPos: 6192, + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 338, + EndLine: 338, + StartPos: 6197, + EndPos: 6208, + }, + Expr: &expr.FunctionCall{ + Position: &position.Position{ + StartLine: 338, + EndLine: 338, + StartPos: 6197, + EndPos: 6207, + }, + Function: &expr.ArrayDimFetch{ + Position: &position.Position{ + StartLine: 338, + EndLine: 338, + StartPos: 6197, + EndPos: 6205, + }, + Variable: &expr.ShortArray{ + Position: &position.Position{ + StartLine: 338, + EndLine: 338, + StartPos: 6197, + EndPos: 6199, + }, + Items: []node.Node{ + &expr.ArrayItem{ + Position: &position.Position{ + StartLine: 338, + EndLine: 338, + StartPos: 6198, + EndPos: 6198, + }, + Val: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 338, + EndLine: 338, + StartPos: 6198, + EndPos: 6198, + }, + Value: "1", + }, + }, + }, + }, + Dim: &expr.Variable{ + Position: &position.Position{ + StartLine: 338, + EndLine: 338, + StartPos: 6201, + EndPos: 6204, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 338, + EndLine: 338, + StartPos: 6201, + EndPos: 6204, + }, + Value: "foo", + }, + }, + }, + ArgumentList: &node.ArgumentList{ + Position: &position.Position{ + StartLine: 338, + EndLine: 338, + StartPos: 6206, + EndPos: 6207, + }, + }, + }, + }, + &stmt.Expression{ + Position: &position.Position{ + StartLine: 339, + EndLine: 339, + StartPos: 6212, + EndPos: 6220, + }, Expr: &expr.Variable{ + Position: &position.Position{ + StartLine: 339, + EndLine: 339, + StartPos: 6212, + EndPos: 6219, + }, VarName: &expr.FunctionCall{ - Function: &name.Name{Parts: []node.Node{&name.NamePart{Value: "foo"}}}, - - ArgumentList: &node.ArgumentList{}, + Position: &position.Position{ + StartLine: 339, + EndLine: 339, + StartPos: 6214, + EndPos: 6218, + }, + Function: &name.Name{ + Position: &position.Position{ + StartLine: 339, + EndLine: 339, + StartPos: 6214, + EndPos: 6216, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 339, + EndLine: 339, + StartPos: 6214, + EndPos: 6216, + }, + Value: "foo", + }, + }, + }, + ArgumentList: &node.ArgumentList{ + Position: &position.Position{ + StartLine: 339, + EndLine: 339, + StartPos: 6217, + EndPos: 6218, + }, + }, }, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 341, + EndLine: 341, + StartPos: 6225, + EndPos: 6236, + }, Expr: &expr.StaticCall{ - Class: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Foo"}}}, - Call: &expr.Variable{VarName: &node.Identifier{Value: "bar"}}, - - ArgumentList: &node.ArgumentList{}, + Position: &position.Position{ + StartLine: 341, + EndLine: 341, + StartPos: 6225, + EndPos: 6235, + }, + Class: &name.Name{ + Position: &position.Position{ + StartLine: 341, + EndLine: 341, + StartPos: 6225, + EndPos: 6227, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 341, + EndLine: 341, + StartPos: 6225, + EndPos: 6227, + }, + Value: "Foo", + }, + }, + }, + Call: &expr.Variable{ + Position: &position.Position{ + StartLine: 341, + EndLine: 341, + StartPos: 6230, + EndPos: 6233, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 341, + EndLine: 341, + StartPos: 6230, + EndPos: 6233, + }, + Value: "bar", + }, + }, + ArgumentList: &node.ArgumentList{ + Position: &position.Position{ + StartLine: 341, + EndLine: 341, + StartPos: 6234, + EndPos: 6235, + }, + }, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 342, + EndLine: 342, + StartPos: 6240, + EndPos: 6256, + }, Expr: &expr.StaticCall{ - Class: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Foo"}}}, + Position: &position.Position{ + StartLine: 342, + EndLine: 342, + StartPos: 6240, + EndPos: 6255, + }, + Class: &name.Name{ + Position: &position.Position{ + StartLine: 342, + EndLine: 342, + StartPos: 6240, + EndPos: 6242, + }, + Parts: []node.Node{ + &name.NamePart{ + Position: &position.Position{ + StartLine: 342, + EndLine: 342, + StartPos: 6240, + EndPos: 6242, + }, + Value: "Foo", + }, + }, + }, Call: &expr.ArrayDimFetch{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "bar"}}, - Dim: &scalar.Lnumber{Value: "0"}, + Position: &position.Position{ + StartLine: 342, + EndLine: 342, + StartPos: 6246, + EndPos: 6252, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 342, + EndLine: 342, + StartPos: 6246, + EndPos: 6249, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 342, + EndLine: 342, + StartPos: 6246, + EndPos: 6249, + }, + Value: "bar", + }, + }, + Dim: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 342, + EndLine: 342, + StartPos: 6251, + EndPos: 6251, + }, + Value: "0", + }, + }, + ArgumentList: &node.ArgumentList{ + Position: &position.Position{ + StartLine: 342, + EndLine: 342, + StartPos: 6254, + EndPos: 6255, + }, }, - - ArgumentList: &node.ArgumentList{}, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 344, + EndLine: 344, + StartPos: 6263, + EndPos: 6273, + }, Expr: &expr.PropertyFetch{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, - Property: &expr.Variable{VarName: &node.Identifier{Value: "bar"}}, + Position: &position.Position{ + StartLine: 344, + EndLine: 344, + StartPos: 6263, + EndPos: 6272, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 344, + EndLine: 344, + StartPos: 6263, + EndPos: 6266, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 344, + EndLine: 344, + StartPos: 6263, + EndPos: 6266, + }, + Value: "foo", + }, + }, + Property: &expr.Variable{ + Position: &position.Position{ + StartLine: 344, + EndLine: 344, + StartPos: 6269, + EndPos: 6272, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 344, + EndLine: 344, + StartPos: 6269, + EndPos: 6272, + }, + Value: "bar", + }, + }, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 345, + EndLine: 345, + StartPos: 6277, + EndPos: 6292, + }, Expr: &expr.PropertyFetch{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, + Position: &position.Position{ + StartLine: 345, + EndLine: 345, + StartPos: 6277, + EndPos: 6290, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 345, + EndLine: 345, + StartPos: 6277, + EndPos: 6280, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 345, + EndLine: 345, + StartPos: 6277, + EndPos: 6280, + }, + Value: "foo", + }, + }, Property: &expr.ArrayDimFetch{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "bar"}}, - Dim: &scalar.Lnumber{Value: "0"}, + Position: &position.Position{ + StartLine: 345, + EndLine: 345, + StartPos: 6284, + EndPos: 6290, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 345, + EndLine: 345, + StartPos: 6284, + EndPos: 6287, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 345, + EndLine: 345, + StartPos: 6284, + EndPos: 6287, + }, + Value: "bar", + }, + }, + Dim: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 345, + EndLine: 345, + StartPos: 6289, + EndPos: 6289, + }, + Value: "0", + }, }, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 347, + EndLine: 347, + StartPos: 6297, + EndPos: 6318, + }, Expr: &expr.ShortArray{ + Position: &position.Position{ + StartLine: 347, + EndLine: 347, + StartPos: 6297, + EndPos: 6317, + }, Items: []node.Node{ &expr.ArrayItem{ - Key: &scalar.Lnumber{Value: "1"}, - Val: &expr.Reference{Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, + Position: &position.Position{ + StartLine: 347, + EndLine: 347, + StartPos: 6298, + EndPos: 6303, + }, + Key: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 347, + EndLine: 347, + StartPos: 6298, + EndPos: 6298, + }, + Value: "1", + }, + Val: &expr.Reference{ + Position: &position.Position{ + StartLine: 347, + EndLine: 347, + StartPos: 6301, + EndPos: 6303, + }, + Variable: &expr.Variable{ + Position: &position.Position{ + StartLine: 347, + EndLine: 347, + StartPos: 6302, + EndPos: 6303, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 347, + EndLine: 347, + StartPos: 6302, + EndPos: 6303, + }, + Value: "a", + }, + }, + }, }, &expr.ArrayItem{ - Key: &scalar.Lnumber{Value: "2"}, + Position: &position.Position{ + StartLine: 347, + EndLine: 347, + StartPos: 6306, + EndPos: 6316, + }, + Key: &scalar.Lnumber{ + Position: &position.Position{ + StartLine: 347, + EndLine: 347, + StartPos: 6306, + EndPos: 6306, + }, + Value: "2", + }, Val: &expr.List{ + Position: &position.Position{ + StartLine: 347, + EndLine: 347, + StartPos: 6309, + EndPos: 6316, + }, Items: []node.Node{ &expr.ArrayItem{ - Val: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Position: &position.Position{ + StartLine: 347, + EndLine: 347, + StartPos: 6314, + EndPos: 6315, + }, + Val: &expr.Variable{ + Position: &position.Position{ + StartLine: 347, + EndLine: 347, + StartPos: 6314, + EndPos: 6315, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 347, + EndLine: 347, + StartPos: 6314, + EndPos: 6315, + }, + Value: "b", + }, + }, }, }, }, @@ -3218,6 +16199,7 @@ func TestPhp7(t *testing.T) { }, }, } + php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php") php7parser.Parse() @@ -3239,24 +16221,101 @@ func TestPhp5Strings(t *testing.T) { ` expected := &node.Root{ + Position: &position.Position{ + StartLine: 2, + EndLine: 10, + StartPos: 6, + EndPos: 70, + }, Stmts: []node.Node{ &stmt.Expression{ - Expr: &scalar.String{Value: "\"test\""}, + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 6, + EndPos: 12, + }, + Expr: &scalar.String{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 6, + EndPos: 11, + }, + Value: "\"test\"", + }, }, &stmt.Expression{ - Expr: &scalar.String{Value: "\"\\$test\""}, + Position: &position.Position{ + StartLine: 3, + EndLine: 3, + StartPos: 16, + EndPos: 24, + }, + Expr: &scalar.String{ + Position: &position.Position{ + StartLine: 3, + EndLine: 3, + StartPos: 16, + EndPos: 23, + }, + Value: "\"\\$test\"", + }, }, &stmt.Expression{ - Expr: &scalar.String{Value: "\"\n\t\t\ttest\n\t\t\""}, + Position: &position.Position{ + StartLine: 4, + EndLine: 6, + StartPos: 28, + EndPos: 41, + }, + Expr: &scalar.String{ + Position: &position.Position{ + StartLine: 4, + EndLine: 6, + StartPos: 28, + EndPos: 40, + }, + Value: "\"\n\t\t\ttest\n\t\t\"", + }, }, &stmt.Expression{ - Expr: &scalar.String{Value: "'$test'"}, + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 45, + EndPos: 52, + }, + Expr: &scalar.String{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 45, + EndPos: 51, + }, + Value: "'$test'", + }, }, &stmt.Expression{ - Expr: &scalar.String{Value: "'\n\t\t\t$test\n\t\t'"}, + Position: &position.Position{ + StartLine: 8, + EndLine: 10, + StartPos: 56, + EndPos: 70, + }, + Expr: &scalar.String{ + Position: &position.Position{ + StartLine: 8, + EndLine: 10, + StartPos: 56, + EndPos: 69, + }, + Value: "'\n\t\t\t$test\n\t\t'", + }, }, }, } + php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php") php7parser.Parse() @@ -3283,48 +16342,171 @@ CAD; ` expected := &node.Root{ + Position: &position.Position{ + StartLine: 2, + EndLine: 15, + StartPos: 9, + EndPos: 120, + }, Stmts: []node.Node{ &stmt.Expression{ + Position: &position.Position{ + StartLine: 2, + EndLine: 3, + StartPos: 9, + EndPos: 16, + }, Expr: &scalar.Heredoc{ + Position: &position.Position{ + StartLine: 2, + EndLine: 3, + StartPos: 9, + EndPos: 15, + }, Label: "CAD", }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 4, + EndLine: 6, + StartPos: 23, + EndPos: 37, + }, Expr: &scalar.Heredoc{ + Position: &position.Position{ + StartLine: 4, + EndLine: 6, + StartPos: 23, + EndPos: 36, + }, Label: "CAD", Parts: []node.Node{ - &scalar.EncapsedStringPart{Value: "\thello\n"}, + &scalar.EncapsedStringPart{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 27, + EndPos: 33, + }, + Value: "\thello\n", + }, }, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 7, + EndLine: 9, + StartPos: 44, + EndPos: 60, + }, Expr: &scalar.Heredoc{ + Position: &position.Position{ + StartLine: 7, + EndLine: 9, + StartPos: 44, + EndPos: 59, + }, Label: "\"CAD\"", Parts: []node.Node{ - &scalar.EncapsedStringPart{Value: "\thello\n"}, + &scalar.EncapsedStringPart{ + Position: &position.Position{ + StartLine: 8, + EndLine: 8, + StartPos: 50, + EndPos: 56, + }, + Value: "\thello\n", + }, }, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 10, + EndLine: 12, + StartPos: 67, + EndPos: 90, + }, Expr: &scalar.Heredoc{ + Position: &position.Position{ + StartLine: 10, + EndLine: 12, + StartPos: 67, + EndPos: 89, + }, Label: "\"CAD\"", Parts: []node.Node{ - &scalar.EncapsedStringPart{Value: "\thello "}, - &expr.Variable{VarName: &node.Identifier{Value: "world"}}, - &scalar.EncapsedStringPart{Value: "\n"}, + &scalar.EncapsedStringPart{ + Position: &position.Position{ + StartLine: 11, + EndLine: 11, + StartPos: 73, + EndPos: 79, + }, + Value: "\thello ", + }, + &expr.Variable{ + Position: &position.Position{ + StartLine: 11, + EndLine: 11, + StartPos: 80, + EndPos: 85, + }, + VarName: &node.Identifier{ + Position: &position.Position{ + StartLine: 11, + EndLine: 11, + StartPos: 80, + EndPos: 85, + }, + Value: "world", + }, + }, + &scalar.EncapsedStringPart{ + Position: &position.Position{ + StartLine: 11, + EndLine: 11, + StartPos: 86, + EndPos: 86, + }, + Value: "\n", + }, }, }, }, &stmt.Expression{ + Position: &position.Position{ + StartLine: 13, + EndLine: 15, + StartPos: 97, + EndPos: 120, + }, Expr: &scalar.Heredoc{ + Position: &position.Position{ + StartLine: 13, + EndLine: 15, + StartPos: 97, + EndPos: 119, + }, Label: "'CAD'", Parts: []node.Node{ - &scalar.EncapsedStringPart{Value: "\thello $world\n"}, + &scalar.EncapsedStringPart{ + Position: &position.Position{ + StartLine: 14, + EndLine: 14, + StartPos: 103, + EndPos: 116, + }, + Value: "\thello $world\n", + }, }, }, }, }, } + php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php") php7parser.Parse() diff --git a/scanner/lexer.go b/scanner/lexer.go index de85922..49a052f 100644 --- a/scanner/lexer.go +++ b/scanner/lexer.go @@ -445,7 +445,6 @@ type Lexer struct { heredocLabel string tokenBytesBuf *bytes.Buffer TokenPool sync.Pool - PositionPool sync.Pool } // Rune2Class returns the rune integer id @@ -484,9 +483,6 @@ func NewLexer(src io.Reader, fName string) *Lexer { TokenPool: sync.Pool{ New: func() interface{} { return &Token{} }, }, - PositionPool: sync.Pool{ - New: func() interface{} { return &position.Position{} }, - }, } } @@ -533,18 +529,15 @@ func (l *Lexer) createToken(chars []lex.Char) *Token { firstChar := chars[0] lastChar := chars[len(chars)-1] - pos := l.PositionPool.Get().(*position.Position) - - pos.StartLine = l.File.Line(firstChar.Pos()) - pos.EndLine = l.File.Line(lastChar.Pos()) - pos.StartPos = int(firstChar.Pos()) - pos.EndPos = int(lastChar.Pos()) - token := l.TokenPool.Get().(*Token) - token.Position = pos token.Comments = l.Comments token.Value = l.tokenString(chars) + token.StartLine = l.File.Line(firstChar.Pos()) + token.EndLine = l.File.Line(lastChar.Pos()) + token.StartPos = int(firstChar.Pos()) + token.EndPos = int(lastChar.Pos()) + return token } diff --git a/scanner/token.go b/scanner/token.go index 87e035a..330f537 100644 --- a/scanner/token.go +++ b/scanner/token.go @@ -2,14 +2,16 @@ package scanner import ( "github.com/z7zmey/php-parser/comment" - "github.com/z7zmey/php-parser/position" ) // Token value returned by lexer type Token struct { - Value string - Position *position.Position - Comments []*comment.Comment + Value string + Comments []*comment.Comment + StartLine int + EndLine int + StartPos int + EndPos int } func (t *Token) String() string { diff --git a/scanner/token_test.go b/scanner/token_test.go index 7650789..73ca938 100644 --- a/scanner/token_test.go +++ b/scanner/token_test.go @@ -4,18 +4,18 @@ import ( "reflect" "testing" - "github.com/z7zmey/php-parser/position" - "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/scanner" ) func TestToken(t *testing.T) { - pos := position.NewPosition(1, 1, 0, 3) tkn := &scanner.Token{ - Value: `foo`, - Position: pos, + Value: `foo`, + StartLine: 1, + EndLine: 1, + StartPos: 0, + EndPos: 3, } c := []*comment.Comment{ @@ -31,8 +31,4 @@ func TestToken(t *testing.T) { if tkn.String() != `foo` { t.Errorf("token value is not equal\n") } - - if tkn.Position != pos { - t.Errorf("token position is not equal\n") - } } diff --git a/visitor/dumper.go b/visitor/dumper.go index 862c3ca..ac4708b 100644 --- a/visitor/dumper.go +++ b/visitor/dumper.go @@ -20,7 +20,6 @@ type Dumper struct { Writer io.Writer Indent string Comments parser.Comments - Positions parser.Positions NsResolver *NamespaceResolver } @@ -30,10 +29,8 @@ func (d *Dumper) EnterNode(w walker.Walkable) bool { fmt.Fprintf(d.Writer, "%v[%v]\n", d.Indent, reflect.TypeOf(n)) - if d.Positions != nil { - if p := d.Positions[n]; p != nil { - fmt.Fprintf(d.Writer, "%v\"Position\": %s\n", d.Indent+" ", *p) - } + if n.GetPosition() != nil { + fmt.Fprintf(d.Writer, "%v\"Position\": %s\n", d.Indent+" ", n.GetPosition()) } if d.NsResolver != nil { diff --git a/visitor/dumper_test.go b/visitor/dumper_test.go index 127af48..f319dce 100644 --- a/visitor/dumper_test.go +++ b/visitor/dumper_test.go @@ -33,7 +33,6 @@ func ExampleDumper() { Writer: os.Stdout, Indent: "| ", Comments: php7parser.GetComments(), - Positions: php7parser.GetPositions(), NsResolver: nsResolver, } nodes.Walk(dumper) diff --git a/visitor/go_dumper.go b/visitor/go_dumper.go index a857cb0..49c08e1 100644 --- a/visitor/go_dumper.go +++ b/visitor/go_dumper.go @@ -42,6 +42,23 @@ func (d *GoDumper) EnterNode(w walker.Walkable) bool { d.depth++ + if p := n.GetPosition(); p != nil { + printIndent(d.Writer, d.depth) + fmt.Fprint(d.Writer, "Position: &position.Position{\n") + d.depth++ + printIndent(d.Writer, d.depth) + fmt.Fprintf(d.Writer, "StartLine: %d,\n", p.StartLine) + printIndent(d.Writer, d.depth) + fmt.Fprintf(d.Writer, "EndLine: %d,\n", p.EndLine) + printIndent(d.Writer, d.depth) + fmt.Fprintf(d.Writer, "StartPos: %d,\n", p.StartPos) + printIndent(d.Writer, d.depth) + fmt.Fprintf(d.Writer, "EndPos: %d,\n", p.EndPos) + d.depth-- + printIndent(d.Writer, d.depth) + fmt.Fprint(d.Writer, "},\n") + } + if a := n.Attributes(); len(a) > 0 { for key, attr := range a { printIndent(d.Writer, d.depth) diff --git a/visitor/go_dumper_test.go b/visitor/go_dumper_test.go index 7d29252..e2f23d8 100644 --- a/visitor/go_dumper_test.go +++ b/visitor/go_dumper_test.go @@ -36,53 +36,155 @@ func ExampleGoDumper() { // Unordered output: //&node.Root{ + // Position: &position.Position{ + // StartLine: 3, + // EndLine: 11, + // StartPos: 10, + // EndPos: 142, + // }, // Stmts: []node.Node{ // &stmt.Namespace{ + // Position: &position.Position{ + // StartLine: 3, + // EndLine: 11, + // StartPos: 10, + // EndPos: 142, + // }, // NamespaceName: &name.Name{ + // Position: &position.Position{ + // StartLine: 3, + // EndLine: 3, + // StartPos: 20, + // EndPos: 22, + // }, // Parts: []node.Node{ // &name.NamePart{ + // Position: &position.Position{ + // StartLine: 3, + // EndLine: 3, + // StartPos: 20, + // EndPos: 22, + // }, // Value: "Foo", // }, // }, // }, // Stmts: []node.Node{ // &stmt.Class{ + // Position: &position.Position{ + // StartLine: 4, + // EndLine: 10, + // StartPos: 29, + // EndPos: 138, + // }, // PhpDocComment: "", // ClassName: &node.Identifier{ + // Position: &position.Position{ + // StartLine: 4, + // EndLine: 4, + // StartPos: 35, + // EndPos: 37, + // }, // Value: "Bar", // }, // Stmts: []node.Node{ // &stmt.ClassMethod{ + // Position: &position.Position{ + // StartLine: 5, + // EndLine: 9, + // StartPos: 45, + // EndPos: 133, + // }, // ReturnsRef: false, // PhpDocComment: "", // MethodName: &node.Identifier{ + // Position: &position.Position{ + // StartLine: 5, + // EndLine: 5, + // StartPos: 61, + // EndPos: 72, + // }, // Value: "FunctionName", // }, // Modifiers: []node.Node{ // &node.Identifier{ + // Position: &position.Position{ + // StartLine: 5, + // EndLine: 5, + // StartPos: 45, + // EndPos: 50, + // }, // Value: "public", // }, // }, // Params: []node.Node{ // &node.Parameter{ - // ByRef: false, + // Position: &position.Position{ + // StartLine: 5, + // EndLine: 5, + // StartPos: 74, + // EndPos: 89, + // }, // Variadic: false, + // ByRef: false, // VariableType: &name.Name{ + // Position: &position.Position{ + // StartLine: 5, + // EndLine: 5, + // StartPos: 74, + // EndPos: 77, + // }, // Parts: []node.Node{ // &name.NamePart{ + // Position: &position.Position{ + // StartLine: 5, + // EndLine: 5, + // StartPos: 74, + // EndPos: 77, + // }, // Value: "Type", // }, // }, // }, // Variable: &expr.Variable{ + // Position: &position.Position{ + // StartLine: 5, + // EndLine: 5, + // StartPos: 79, + // EndPos: 82, + // }, // VarName: &node.Identifier{ + // Position: &position.Position{ + // StartLine: 5, + // EndLine: 5, + // StartPos: 79, + // EndPos: 82, + // }, // Value: "var", // }, // }, // DefaultValue: &expr.ConstFetch{ + // Position: &position.Position{ + // StartLine: 5, + // EndLine: 5, + // StartPos: 86, + // EndPos: 89, + // }, // Constant: &name.Name{ + // Position: &position.Position{ + // StartLine: 5, + // EndLine: 5, + // StartPos: 86, + // EndPos: 89, + // }, // Parts: []node.Node{ // &name.NamePart{ + // Position: &position.Position{ + // StartLine: 5, + // EndLine: 5, + // StartPos: 86, + // EndPos: 89, + // }, // Value: "null", // }, // }, @@ -91,10 +193,34 @@ func ExampleGoDumper() { // }, // }, // Stmt: &stmt.StmtList{ + // Position: &position.Position{ + // StartLine: 6, + // EndLine: 9, + // StartPos: 96, + // EndPos: 133, + // }, // Stmts: []node.Node{ // &stmt.Expression{ + // Position: &position.Position{ + // StartLine: 8, + // EndLine: 8, + // StartPos: 123, + // EndPos: 127, + // }, // Expr: &expr.Variable{ + // Position: &position.Position{ + // StartLine: 8, + // EndLine: 8, + // StartPos: 123, + // EndPos: 126, + // }, // VarName: &node.Identifier{ + // Position: &position.Position{ + // StartLine: 8, + // EndLine: 8, + // StartPos: 123, + // EndPos: 126, + // }, // Value: "var", // }, // }, diff --git a/visitor/json_dumper.go b/visitor/json_dumper.go index 9903000..8b21755 100644 --- a/visitor/json_dumper.go +++ b/visitor/json_dumper.go @@ -15,7 +15,6 @@ import ( type JsonDumper struct { Writer io.Writer Comments parser.Comments - Positions parser.Positions NsResolver *NamespaceResolver } @@ -27,15 +26,14 @@ func (d *JsonDumper) EnterNode(w walker.Walkable) bool { fmt.Fprintf(d.Writer, "{%q:%q", "type", nodeType) - if d.Positions != nil { - if p := d.Positions[n]; p != nil { - fmt.Fprintf(d.Writer, ",%q:{%q:%d,%q:%d,%q:%d,%q:%d}", - "position", - "startPos", p.StartPos, - "endPos", p.EndPos, - "startLine", p.StartLine, - "endLine", p.EndLine) - } + if p := n.GetPosition(); p != nil { + p := n.GetPosition() + fmt.Fprintf(d.Writer, ",%q:{%q:%d,%q:%d,%q:%d,%q:%d}", + "position", + "startPos", p.StartPos, + "endPos", p.EndPos, + "startLine", p.StartLine, + "endLine", p.EndLine) } if d.NsResolver != nil { diff --git a/visitor/json_dumper_test.go b/visitor/json_dumper_test.go index b53c39f..5539668 100644 --- a/visitor/json_dumper_test.go +++ b/visitor/json_dumper_test.go @@ -33,7 +33,6 @@ func ExampleJsonDumper() { dumper := &visitor.JsonDumper{ Writer: os.Stdout, Comments: php7parser.GetComments(), - Positions: php7parser.GetPositions(), NsResolver: nsResolver, } nodes.Walk(dumper) diff --git a/visitor/pretty_json_dumper.go b/visitor/pretty_json_dumper.go index 2afb599..b81d56f 100644 --- a/visitor/pretty_json_dumper.go +++ b/visitor/pretty_json_dumper.go @@ -15,7 +15,6 @@ import ( type PrettyJsonDumper struct { Writer io.Writer Comments parser.Comments - Positions parser.Positions NsResolver *NamespaceResolver depth int isChildNode bool @@ -44,24 +43,22 @@ func (d *PrettyJsonDumper) EnterNode(w walker.Walkable) bool { d.printIndent(d.Writer) fmt.Fprintf(d.Writer, "%q: %q", "type", nodeType) - if d.Positions != nil { - if p := d.Positions[n]; p != nil { - fmt.Fprint(d.Writer, ",\n") - d.printIndent(d.Writer) - fmt.Fprintf(d.Writer, "%q: {\n", "position") - d.depth++ - d.printIndent(d.Writer) - fmt.Fprintf(d.Writer, "%q: %d,\n", "startPos", p.StartPos) - d.printIndent(d.Writer) - fmt.Fprintf(d.Writer, "%q: %d,\n", "endPos", p.EndPos) - d.printIndent(d.Writer) - fmt.Fprintf(d.Writer, "%q: %d,\n", "startLine", p.StartLine) - d.printIndent(d.Writer) - fmt.Fprintf(d.Writer, "%q: %d\n", "endLine", p.EndLine) - d.depth-- - d.printIndent(d.Writer) - fmt.Fprint(d.Writer, "}") - } + if p := n.GetPosition(); p != nil { + fmt.Fprint(d.Writer, ",\n") + d.printIndent(d.Writer) + fmt.Fprintf(d.Writer, "%q: {\n", "position") + d.depth++ + d.printIndent(d.Writer) + fmt.Fprintf(d.Writer, "%q: %d,\n", "startPos", p.StartPos) + d.printIndent(d.Writer) + fmt.Fprintf(d.Writer, "%q: %d,\n", "endPos", p.EndPos) + d.printIndent(d.Writer) + fmt.Fprintf(d.Writer, "%q: %d,\n", "startLine", p.StartLine) + d.printIndent(d.Writer) + fmt.Fprintf(d.Writer, "%q: %d\n", "endLine", p.EndLine) + d.depth-- + d.printIndent(d.Writer) + fmt.Fprint(d.Writer, "}") } if d.NsResolver != nil { diff --git a/visitor/pretty_json_dumper_test.go b/visitor/pretty_json_dumper_test.go index c77ec87..e0d263d 100644 --- a/visitor/pretty_json_dumper_test.go +++ b/visitor/pretty_json_dumper_test.go @@ -33,7 +33,6 @@ func ExamplePrettyJsonDumper() { dumper := &visitor.PrettyJsonDumper{ Writer: os.Stdout, Comments: php7parser.GetComments(), - Positions: php7parser.GetPositions(), NsResolver: nsResolver, } nodes.Walk(dumper) From 3cd45ecac586d3c1b5ae7a81d0c3b58ccd8eada6 Mon Sep 17 00:00:00 2001 From: z7zmey Date: Mon, 25 Jun 2018 15:38:31 +0300 Subject: [PATCH 008/117] #25: save comments within node --- comment/comment.go | 26 +- comment/comment_test.go | 26 +- node/expr/assign/n_assign.go | 13 + node/expr/assign/n_assign_ref.go | 13 + node/expr/assign/n_bitwise_and.go | 13 + node/expr/assign/n_bitwise_or.go | 13 + node/expr/assign/n_bitwise_xor.go | 13 + node/expr/assign/n_concat.go | 13 + node/expr/assign/n_div.go | 13 + node/expr/assign/n_minus.go | 13 + node/expr/assign/n_mod.go | 13 + node/expr/assign/n_mul.go | 13 + node/expr/assign/n_plus.go | 13 + node/expr/assign/n_pow.go | 13 + node/expr/assign/n_shift_left.go | 13 + node/expr/assign/n_shift_right.go | 13 + node/expr/binary/n_bitwise_and.go | 13 + node/expr/binary/n_bitwise_or.go | 13 + node/expr/binary/n_bitwise_xor.go | 13 + node/expr/binary/n_boolean_and.go | 13 + node/expr/binary/n_boolean_or.go | 13 + node/expr/binary/n_coalesce.go | 13 + node/expr/binary/n_concat.go | 13 + node/expr/binary/n_div.go | 13 + node/expr/binary/n_equal.go | 13 + node/expr/binary/n_greater.go | 13 + node/expr/binary/n_greater_or_equal.go | 13 + node/expr/binary/n_identical.go | 13 + node/expr/binary/n_logical_and.go | 13 + node/expr/binary/n_logical_or.go | 13 + node/expr/binary/n_logical_xor.go | 13 + node/expr/binary/n_minus.go | 13 + node/expr/binary/n_mod.go | 13 + node/expr/binary/n_mul.go | 13 + node/expr/binary/n_not_equal.go | 13 + node/expr/binary/n_not_identical.go | 13 + node/expr/binary/n_plus.go | 13 + node/expr/binary/n_pow.go | 13 + node/expr/binary/n_shift_left.go | 13 + node/expr/binary/n_shift_right.go | 13 + node/expr/binary/n_smaller.go | 13 + node/expr/binary/n_smaller_or_equal.go | 13 + node/expr/binary/n_spaceship.go | 13 + node/expr/cast/n_cast_array.go | 13 + node/expr/cast/n_cast_bool.go | 13 + node/expr/cast/n_cast_double.go | 13 + node/expr/cast/n_cast_int.go | 13 + node/expr/cast/n_cast_object.go | 13 + node/expr/cast/n_cast_string.go | 13 + node/expr/cast/n_cast_unset.go | 13 + node/expr/n_array.go | 13 + node/expr/n_array_dim_fetch.go | 13 + node/expr/n_array_item.go | 13 + node/expr/n_bitwise_not.go | 13 + node/expr/n_boolean_not.go | 13 + node/expr/n_class_const_fetch.go | 13 + node/expr/n_clone.go | 13 + node/expr/n_closure.go | 13 + node/expr/n_closure_use.go | 13 + node/expr/n_const_fetch.go | 13 + node/expr/n_die.go | 13 + node/expr/n_empty.go | 13 + node/expr/n_error_suppress.go | 13 + node/expr/n_eval.go | 13 + node/expr/n_exit.go | 13 + node/expr/n_function_call.go | 13 + node/expr/n_include.go | 13 + node/expr/n_include_once.go | 13 + node/expr/n_instance_of.go | 13 + node/expr/n_isset.go | 13 + node/expr/n_list.go | 13 + node/expr/n_method_call.go | 13 + node/expr/n_new.go | 13 + node/expr/n_post_dec.go | 13 + node/expr/n_post_inc.go | 13 + node/expr/n_pre_dec.go | 13 + node/expr/n_pre_inc.go | 13 + node/expr/n_print.go | 13 + node/expr/n_property_fetch.go | 13 + node/expr/n_reference.go | 13 + node/expr/n_require.go | 13 + node/expr/n_require_once.go | 13 + node/expr/n_shell_exec.go | 13 + node/expr/n_short_array.go | 13 + node/expr/n_short_list.go | 13 + node/expr/n_static_call.go | 13 + node/expr/n_static_property_fetch.go | 13 + node/expr/n_ternary.go | 13 + node/expr/n_unary_minus.go | 13 + node/expr/n_unary_plus.go | 13 + node/expr/n_variable.go | 13 + node/expr/n_yield.go | 13 + node/expr/n_yield_from.go | 13 + node/n_argument.go | 13 + node/n_argument_list.go | 14 + node/n_identifier.go | 13 + node/n_nullable.go | 13 + node/n_parameter.go | 13 + node/n_root.go | 13 + node/name/n_fully_qualified.go | 13 + node/name/n_name.go | 13 + node/name/n_name_part.go | 13 + node/name/n_relative.go | 13 + node/node.go | 3 + node/scalar/node_dnumber.go | 13 + node/scalar/node_encapsed.go | 13 + node/scalar/node_encapsed_string_part.go | 13 + node/scalar/node_heredoc.go | 13 + node/scalar/node_lnumber.go | 13 + node/scalar/node_magic_constant.go | 13 + node/scalar/node_string.go | 13 + node/stmt/n_alt_else.go | 13 + node/stmt/n_alt_else_if.go | 13 + node/stmt/n_alt_for.go | 13 + node/stmt/n_alt_foreach.go | 13 + node/stmt/n_alt_if.go | 13 + node/stmt/n_alt_switch.go | 13 + node/stmt/n_alt_while.go | 13 + node/stmt/n_break.go | 13 + node/stmt/n_case.go | 13 + node/stmt/n_case_list.go | 13 + node/stmt/n_catch.go | 13 + node/stmt/n_class.go | 13 + node/stmt/n_class_const_list.go | 13 + node/stmt/n_class_extends.go | 13 + node/stmt/n_class_implements.go | 13 + node/stmt/n_class_method.go | 13 + node/stmt/n_const_list.go | 13 + node/stmt/n_constant.go | 13 + node/stmt/n_continue.go | 13 + node/stmt/n_declare.go | 13 + node/stmt/n_default.go | 13 + node/stmt/n_do.go | 13 + node/stmt/n_echo.go | 13 + node/stmt/n_else.go | 13 + node/stmt/n_else_if.go | 13 + node/stmt/n_expression.go | 13 + node/stmt/n_finally.go | 13 + node/stmt/n_for.go | 13 + node/stmt/n_foreach.go | 13 + node/stmt/n_function.go | 13 + node/stmt/n_global.go | 13 + node/stmt/n_goto.go | 13 + node/stmt/n_group_use.go | 13 + node/stmt/n_halt_compiler.go | 13 + node/stmt/n_if.go | 13 + node/stmt/n_inline_html.go | 13 + node/stmt/n_interface.go | 13 + node/stmt/n_interface_extends.go | 13 + node/stmt/n_label.go | 13 + node/stmt/n_namespace.go | 13 + node/stmt/n_nop.go | 13 + node/stmt/n_property.go | 13 + node/stmt/n_property_list.go | 13 + node/stmt/n_return.go | 13 + node/stmt/n_static.go | 13 + node/stmt/n_static_var.go | 13 + node/stmt/n_stmt_list.go | 13 + node/stmt/n_switch.go | 13 + node/stmt/n_throw.go | 13 + node/stmt/n_trait.go | 13 + node/stmt/n_trait_adaptation_list.go | 13 + node/stmt/n_trait_method_ref.go | 13 + node/stmt/n_trait_use.go | 13 + node/stmt/n_trait_use_alias.go | 13 + node/stmt/n_trait_use_precedence.go | 13 + node/stmt/n_try.go | 13 + node/stmt/n_unset.go | 13 + node/stmt/n_use.go | 13 + node/stmt/n_use_list.go | 13 + node/stmt/n_while.go | 13 + node/t_node_test.go | 21 +- php5/php5.go | 1623 +-- php5/php5.y | 1172 +- php5/php5_test.go | 12891 ++++++++++----------- php7/php7.go | 1014 +- php7/php7.y | 1012 +- php7/php7_test.go | 11325 +++++++++--------- visitor/dumper.go | 10 +- visitor/go_dumper.go | 38 + visitor/go_dumper_test.go | 12 + visitor/json_dumper.go | 20 +- visitor/pretty_json_dumper.go | 36 +- 183 files changed, 16743 insertions(+), 14671 deletions(-) diff --git a/comment/comment.go b/comment/comment.go index 943bd60..87252e9 100644 --- a/comment/comment.go +++ b/comment/comment.go @@ -6,35 +6,25 @@ import ( // Comment aggrigates information about comment /** type Comment struct { - value string - position *position.Position - tokenName TokenName + Value string + Position *position.Position + TokenName TokenName } // NewComment - Comment constructor func NewComment(value string, pos *position.Position) *Comment { return &Comment{ - value, - pos, - UnknownToken, + Value: value, + Position: pos, + TokenName: UnknownToken, } } // SetTokenName sets token name func (c *Comment) SetTokenName(tokenName TokenName) { - c.tokenName = tokenName -} - -// TokenName returns token name -func (c *Comment) TokenName() TokenName { - return c.tokenName + c.TokenName = tokenName } func (c *Comment) String() string { - return c.value -} - -// Position returns comment position -func (c *Comment) Position() *position.Position { - return c.position + return c.Value } diff --git a/comment/comment_test.go b/comment/comment_test.go index 72e1981..d9e671a 100644 --- a/comment/comment_test.go +++ b/comment/comment_test.go @@ -3,23 +3,9 @@ package comment_test import ( "testing" - "github.com/z7zmey/php-parser/position" - "github.com/z7zmey/php-parser/comment" ) -func TestCommentGetPosition(t *testing.T) { - expected := position.NewPosition(0, 0, 0, 0) - - comment := comment.NewComment("/** hello world */", expected) - - actual := comment.Position() - - if expected != actual { - t.Errorf("expected and actual are not equal\n") - } -} - func TestCommentPrint(t *testing.T) { expected := "/** hello world */" @@ -31,3 +17,15 @@ func TestCommentPrint(t *testing.T) { t.Errorf("expected and actual are not equal\n") } } + +func TestCommentSetTokenName(t *testing.T) { + expected := comment.ArrayToken + c := comment.NewComment("/** hello world */", nil) + c.SetTokenName(expected) + + actual := c.TokenName + + if expected != actual { + t.Errorf("expected and actual are not equal\n") + } +} diff --git a/node/expr/assign/n_assign.go b/node/expr/assign/n_assign.go index 7d99267..7f53f2a 100644 --- a/node/expr/assign/n_assign.go +++ b/node/expr/assign/n_assign.go @@ -1,6 +1,7 @@ package assign import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // Assign node type Assign struct { + Comments []*comment.Comment Position *position.Position Variable node.Node Expression node.Node @@ -31,6 +33,17 @@ func (n *Assign) GetPosition() *position.Position { return n.Position } +func (n *Assign) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *Assign) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *Assign) Attributes() map[string]interface{} { return nil diff --git a/node/expr/assign/n_assign_ref.go b/node/expr/assign/n_assign_ref.go index 92fbd45..9469162 100644 --- a/node/expr/assign/n_assign_ref.go +++ b/node/expr/assign/n_assign_ref.go @@ -1,6 +1,7 @@ package assign import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // Reference node type Reference struct { + Comments []*comment.Comment Position *position.Position Variable node.Node Expression node.Node @@ -31,6 +33,17 @@ func (n *Reference) GetPosition() *position.Position { return n.Position } +func (n *Reference) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *Reference) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *Reference) Attributes() map[string]interface{} { return nil diff --git a/node/expr/assign/n_bitwise_and.go b/node/expr/assign/n_bitwise_and.go index bc43e00..8ee3e06 100644 --- a/node/expr/assign/n_bitwise_and.go +++ b/node/expr/assign/n_bitwise_and.go @@ -1,6 +1,7 @@ package assign import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // BitwiseAnd node type BitwiseAnd struct { + Comments []*comment.Comment Position *position.Position Variable node.Node Expression node.Node @@ -31,6 +33,17 @@ func (n *BitwiseAnd) GetPosition() *position.Position { return n.Position } +func (n *BitwiseAnd) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *BitwiseAnd) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *BitwiseAnd) Attributes() map[string]interface{} { return nil diff --git a/node/expr/assign/n_bitwise_or.go b/node/expr/assign/n_bitwise_or.go index c758efc..b1662c2 100644 --- a/node/expr/assign/n_bitwise_or.go +++ b/node/expr/assign/n_bitwise_or.go @@ -1,6 +1,7 @@ package assign import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // BitwiseOr node type BitwiseOr struct { + Comments []*comment.Comment Position *position.Position Variable node.Node Expression node.Node @@ -31,6 +33,17 @@ func (n *BitwiseOr) GetPosition() *position.Position { return n.Position } +func (n *BitwiseOr) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *BitwiseOr) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *BitwiseOr) Attributes() map[string]interface{} { return nil diff --git a/node/expr/assign/n_bitwise_xor.go b/node/expr/assign/n_bitwise_xor.go index 76da08a..8dfca55 100644 --- a/node/expr/assign/n_bitwise_xor.go +++ b/node/expr/assign/n_bitwise_xor.go @@ -1,6 +1,7 @@ package assign import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // BitwiseXor node type BitwiseXor struct { + Comments []*comment.Comment Position *position.Position Variable node.Node Expression node.Node @@ -31,6 +33,17 @@ func (n *BitwiseXor) GetPosition() *position.Position { return n.Position } +func (n *BitwiseXor) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *BitwiseXor) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *BitwiseXor) Attributes() map[string]interface{} { return nil diff --git a/node/expr/assign/n_concat.go b/node/expr/assign/n_concat.go index 14484cf..2c818d4 100644 --- a/node/expr/assign/n_concat.go +++ b/node/expr/assign/n_concat.go @@ -1,6 +1,7 @@ package assign import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // Concat node type Concat struct { + Comments []*comment.Comment Position *position.Position Variable node.Node Expression node.Node @@ -31,6 +33,17 @@ func (n *Concat) GetPosition() *position.Position { return n.Position } +func (n *Concat) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *Concat) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *Concat) Attributes() map[string]interface{} { return nil diff --git a/node/expr/assign/n_div.go b/node/expr/assign/n_div.go index a10fdb6..58a9488 100644 --- a/node/expr/assign/n_div.go +++ b/node/expr/assign/n_div.go @@ -1,6 +1,7 @@ package assign import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // Div node type Div struct { + Comments []*comment.Comment Position *position.Position Variable node.Node Expression node.Node @@ -31,6 +33,17 @@ func (n *Div) GetPosition() *position.Position { return n.Position } +func (n *Div) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *Div) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *Div) Attributes() map[string]interface{} { return nil diff --git a/node/expr/assign/n_minus.go b/node/expr/assign/n_minus.go index 1b29561..a9e77ca 100644 --- a/node/expr/assign/n_minus.go +++ b/node/expr/assign/n_minus.go @@ -1,6 +1,7 @@ package assign import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // Minus node type Minus struct { + Comments []*comment.Comment Position *position.Position Variable node.Node Expression node.Node @@ -31,6 +33,17 @@ func (n *Minus) GetPosition() *position.Position { return n.Position } +func (n *Minus) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *Minus) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *Minus) Attributes() map[string]interface{} { return nil diff --git a/node/expr/assign/n_mod.go b/node/expr/assign/n_mod.go index ba98537..2ce65b4 100644 --- a/node/expr/assign/n_mod.go +++ b/node/expr/assign/n_mod.go @@ -1,6 +1,7 @@ package assign import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // Mod node type Mod struct { + Comments []*comment.Comment Position *position.Position Variable node.Node Expression node.Node @@ -31,6 +33,17 @@ func (n *Mod) GetPosition() *position.Position { return n.Position } +func (n *Mod) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *Mod) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *Mod) Attributes() map[string]interface{} { return nil diff --git a/node/expr/assign/n_mul.go b/node/expr/assign/n_mul.go index 8abc7c6..8278719 100644 --- a/node/expr/assign/n_mul.go +++ b/node/expr/assign/n_mul.go @@ -1,6 +1,7 @@ package assign import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // Mul node type Mul struct { + Comments []*comment.Comment Position *position.Position Variable node.Node Expression node.Node @@ -31,6 +33,17 @@ func (n *Mul) GetPosition() *position.Position { return n.Position } +func (n *Mul) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *Mul) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *Mul) Attributes() map[string]interface{} { return nil diff --git a/node/expr/assign/n_plus.go b/node/expr/assign/n_plus.go index b12f948..4a6e4ba 100644 --- a/node/expr/assign/n_plus.go +++ b/node/expr/assign/n_plus.go @@ -1,6 +1,7 @@ package assign import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // Plus node type Plus struct { + Comments []*comment.Comment Position *position.Position Variable node.Node Expression node.Node @@ -31,6 +33,17 @@ func (n *Plus) GetPosition() *position.Position { return n.Position } +func (n *Plus) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *Plus) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *Plus) Attributes() map[string]interface{} { return nil diff --git a/node/expr/assign/n_pow.go b/node/expr/assign/n_pow.go index 4b4edcf..538f73c 100644 --- a/node/expr/assign/n_pow.go +++ b/node/expr/assign/n_pow.go @@ -1,6 +1,7 @@ package assign import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // Pow node type Pow struct { + Comments []*comment.Comment Position *position.Position Variable node.Node Expression node.Node @@ -31,6 +33,17 @@ func (n *Pow) GetPosition() *position.Position { return n.Position } +func (n *Pow) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *Pow) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *Pow) Attributes() map[string]interface{} { return nil diff --git a/node/expr/assign/n_shift_left.go b/node/expr/assign/n_shift_left.go index 2d60059..d56a06f 100644 --- a/node/expr/assign/n_shift_left.go +++ b/node/expr/assign/n_shift_left.go @@ -1,6 +1,7 @@ package assign import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // ShiftLeft node type ShiftLeft struct { + Comments []*comment.Comment Position *position.Position Variable node.Node Expression node.Node @@ -31,6 +33,17 @@ func (n *ShiftLeft) GetPosition() *position.Position { return n.Position } +func (n *ShiftLeft) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *ShiftLeft) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *ShiftLeft) Attributes() map[string]interface{} { return nil diff --git a/node/expr/assign/n_shift_right.go b/node/expr/assign/n_shift_right.go index 715002d..ab3971b 100644 --- a/node/expr/assign/n_shift_right.go +++ b/node/expr/assign/n_shift_right.go @@ -1,6 +1,7 @@ package assign import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // ShiftRight node type ShiftRight struct { + Comments []*comment.Comment Position *position.Position Variable node.Node Expression node.Node @@ -31,6 +33,17 @@ func (n *ShiftRight) GetPosition() *position.Position { return n.Position } +func (n *ShiftRight) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *ShiftRight) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *ShiftRight) Attributes() map[string]interface{} { return nil diff --git a/node/expr/binary/n_bitwise_and.go b/node/expr/binary/n_bitwise_and.go index 1e18f70..fe66522 100644 --- a/node/expr/binary/n_bitwise_and.go +++ b/node/expr/binary/n_bitwise_and.go @@ -1,6 +1,7 @@ package binary import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // BitwiseAnd node type BitwiseAnd struct { + Comments []*comment.Comment Position *position.Position Left node.Node Right node.Node @@ -31,6 +33,17 @@ func (n *BitwiseAnd) GetPosition() *position.Position { return n.Position } +func (n *BitwiseAnd) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *BitwiseAnd) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *BitwiseAnd) Attributes() map[string]interface{} { return nil diff --git a/node/expr/binary/n_bitwise_or.go b/node/expr/binary/n_bitwise_or.go index 77449a6..3d4c1d1 100644 --- a/node/expr/binary/n_bitwise_or.go +++ b/node/expr/binary/n_bitwise_or.go @@ -1,6 +1,7 @@ package binary import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // BitwiseOr node type BitwiseOr struct { + Comments []*comment.Comment Position *position.Position Left node.Node Right node.Node @@ -31,6 +33,17 @@ func (n *BitwiseOr) GetPosition() *position.Position { return n.Position } +func (n *BitwiseOr) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *BitwiseOr) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *BitwiseOr) Attributes() map[string]interface{} { return nil diff --git a/node/expr/binary/n_bitwise_xor.go b/node/expr/binary/n_bitwise_xor.go index cbf6359..98dace5 100644 --- a/node/expr/binary/n_bitwise_xor.go +++ b/node/expr/binary/n_bitwise_xor.go @@ -1,6 +1,7 @@ package binary import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // BitwiseXor node type BitwiseXor struct { + Comments []*comment.Comment Position *position.Position Left node.Node Right node.Node @@ -31,6 +33,17 @@ func (n *BitwiseXor) GetPosition() *position.Position { return n.Position } +func (n *BitwiseXor) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *BitwiseXor) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *BitwiseXor) Attributes() map[string]interface{} { return nil diff --git a/node/expr/binary/n_boolean_and.go b/node/expr/binary/n_boolean_and.go index e47bcf4..ecfd326 100644 --- a/node/expr/binary/n_boolean_and.go +++ b/node/expr/binary/n_boolean_and.go @@ -1,6 +1,7 @@ package binary import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // BooleanAnd node type BooleanAnd struct { + Comments []*comment.Comment Position *position.Position Left node.Node Right node.Node @@ -31,6 +33,17 @@ func (n *BooleanAnd) GetPosition() *position.Position { return n.Position } +func (n *BooleanAnd) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *BooleanAnd) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *BooleanAnd) Attributes() map[string]interface{} { return nil diff --git a/node/expr/binary/n_boolean_or.go b/node/expr/binary/n_boolean_or.go index d374639..7d85a4b 100644 --- a/node/expr/binary/n_boolean_or.go +++ b/node/expr/binary/n_boolean_or.go @@ -1,6 +1,7 @@ package binary import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // BooleanOr node type BooleanOr struct { + Comments []*comment.Comment Position *position.Position Left node.Node Right node.Node @@ -31,6 +33,17 @@ func (n *BooleanOr) GetPosition() *position.Position { return n.Position } +func (n *BooleanOr) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *BooleanOr) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *BooleanOr) Attributes() map[string]interface{} { return nil diff --git a/node/expr/binary/n_coalesce.go b/node/expr/binary/n_coalesce.go index f852c26..2efd1a7 100644 --- a/node/expr/binary/n_coalesce.go +++ b/node/expr/binary/n_coalesce.go @@ -1,6 +1,7 @@ package binary import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // Coalesce node type Coalesce struct { + Comments []*comment.Comment Position *position.Position Left node.Node Right node.Node @@ -31,6 +33,17 @@ func (n *Coalesce) GetPosition() *position.Position { return n.Position } +func (n *Coalesce) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *Coalesce) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *Coalesce) Attributes() map[string]interface{} { return nil diff --git a/node/expr/binary/n_concat.go b/node/expr/binary/n_concat.go index a2949cc..c81dc4f 100644 --- a/node/expr/binary/n_concat.go +++ b/node/expr/binary/n_concat.go @@ -1,6 +1,7 @@ package binary import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // Concat node type Concat struct { + Comments []*comment.Comment Position *position.Position Left node.Node Right node.Node @@ -31,6 +33,17 @@ func (n *Concat) GetPosition() *position.Position { return n.Position } +func (n *Concat) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *Concat) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *Concat) Attributes() map[string]interface{} { return nil diff --git a/node/expr/binary/n_div.go b/node/expr/binary/n_div.go index 958c376..e165d96 100644 --- a/node/expr/binary/n_div.go +++ b/node/expr/binary/n_div.go @@ -1,6 +1,7 @@ package binary import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // Div node type Div struct { + Comments []*comment.Comment Position *position.Position Left node.Node Right node.Node @@ -31,6 +33,17 @@ func (n *Div) GetPosition() *position.Position { return n.Position } +func (n *Div) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *Div) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *Div) Attributes() map[string]interface{} { return nil diff --git a/node/expr/binary/n_equal.go b/node/expr/binary/n_equal.go index 6db8bd5..1086fa7 100644 --- a/node/expr/binary/n_equal.go +++ b/node/expr/binary/n_equal.go @@ -1,6 +1,7 @@ package binary import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // Equal node type Equal struct { + Comments []*comment.Comment Position *position.Position Left node.Node Right node.Node @@ -31,6 +33,17 @@ func (n *Equal) GetPosition() *position.Position { return n.Position } +func (n *Equal) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *Equal) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *Equal) Attributes() map[string]interface{} { return nil diff --git a/node/expr/binary/n_greater.go b/node/expr/binary/n_greater.go index 58f81e8..686dd1a 100644 --- a/node/expr/binary/n_greater.go +++ b/node/expr/binary/n_greater.go @@ -1,6 +1,7 @@ package binary import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // Greater node type Greater struct { + Comments []*comment.Comment Position *position.Position Left node.Node Right node.Node @@ -31,6 +33,17 @@ func (n *Greater) GetPosition() *position.Position { return n.Position } +func (n *Greater) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *Greater) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *Greater) Attributes() map[string]interface{} { return nil diff --git a/node/expr/binary/n_greater_or_equal.go b/node/expr/binary/n_greater_or_equal.go index f42b82c..9a84f83 100644 --- a/node/expr/binary/n_greater_or_equal.go +++ b/node/expr/binary/n_greater_or_equal.go @@ -1,6 +1,7 @@ package binary import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // GreaterOrEqual node type GreaterOrEqual struct { + Comments []*comment.Comment Position *position.Position Left node.Node Right node.Node @@ -31,6 +33,17 @@ func (n *GreaterOrEqual) GetPosition() *position.Position { return n.Position } +func (n *GreaterOrEqual) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *GreaterOrEqual) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *GreaterOrEqual) Attributes() map[string]interface{} { return nil diff --git a/node/expr/binary/n_identical.go b/node/expr/binary/n_identical.go index 31d913f..0aed14d 100644 --- a/node/expr/binary/n_identical.go +++ b/node/expr/binary/n_identical.go @@ -1,6 +1,7 @@ package binary import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // Identical node type Identical struct { + Comments []*comment.Comment Position *position.Position Left node.Node Right node.Node @@ -31,6 +33,17 @@ func (n *Identical) GetPosition() *position.Position { return n.Position } +func (n *Identical) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *Identical) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *Identical) Attributes() map[string]interface{} { return nil diff --git a/node/expr/binary/n_logical_and.go b/node/expr/binary/n_logical_and.go index 50b2749..3232bf9 100644 --- a/node/expr/binary/n_logical_and.go +++ b/node/expr/binary/n_logical_and.go @@ -1,6 +1,7 @@ package binary import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // LogicalAnd node type LogicalAnd struct { + Comments []*comment.Comment Position *position.Position Left node.Node Right node.Node @@ -31,6 +33,17 @@ func (n *LogicalAnd) GetPosition() *position.Position { return n.Position } +func (n *LogicalAnd) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *LogicalAnd) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *LogicalAnd) Attributes() map[string]interface{} { return nil diff --git a/node/expr/binary/n_logical_or.go b/node/expr/binary/n_logical_or.go index 17c9099..b96fcf6 100644 --- a/node/expr/binary/n_logical_or.go +++ b/node/expr/binary/n_logical_or.go @@ -1,6 +1,7 @@ package binary import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // LogicalOr node type LogicalOr struct { + Comments []*comment.Comment Position *position.Position Left node.Node Right node.Node @@ -31,6 +33,17 @@ func (n *LogicalOr) GetPosition() *position.Position { return n.Position } +func (n *LogicalOr) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *LogicalOr) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *LogicalOr) Attributes() map[string]interface{} { return nil diff --git a/node/expr/binary/n_logical_xor.go b/node/expr/binary/n_logical_xor.go index 6811160..49dc951 100644 --- a/node/expr/binary/n_logical_xor.go +++ b/node/expr/binary/n_logical_xor.go @@ -1,6 +1,7 @@ package binary import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // LogicalXor node type LogicalXor struct { + Comments []*comment.Comment Position *position.Position Left node.Node Right node.Node @@ -31,6 +33,17 @@ func (n *LogicalXor) GetPosition() *position.Position { return n.Position } +func (n *LogicalXor) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *LogicalXor) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *LogicalXor) Attributes() map[string]interface{} { return nil diff --git a/node/expr/binary/n_minus.go b/node/expr/binary/n_minus.go index 1e76457..9001cda 100644 --- a/node/expr/binary/n_minus.go +++ b/node/expr/binary/n_minus.go @@ -1,6 +1,7 @@ package binary import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // Minus node type Minus struct { + Comments []*comment.Comment Position *position.Position Left node.Node Right node.Node @@ -31,6 +33,17 @@ func (n *Minus) GetPosition() *position.Position { return n.Position } +func (n *Minus) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *Minus) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *Minus) Attributes() map[string]interface{} { return nil diff --git a/node/expr/binary/n_mod.go b/node/expr/binary/n_mod.go index 46d3f74..e9f5b42 100644 --- a/node/expr/binary/n_mod.go +++ b/node/expr/binary/n_mod.go @@ -1,6 +1,7 @@ package binary import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // Mod node type Mod struct { + Comments []*comment.Comment Position *position.Position Left node.Node Right node.Node @@ -31,6 +33,17 @@ func (n *Mod) GetPosition() *position.Position { return n.Position } +func (n *Mod) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *Mod) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *Mod) Attributes() map[string]interface{} { return nil diff --git a/node/expr/binary/n_mul.go b/node/expr/binary/n_mul.go index ea029a5..083ed1e 100644 --- a/node/expr/binary/n_mul.go +++ b/node/expr/binary/n_mul.go @@ -1,6 +1,7 @@ package binary import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // Mul node type Mul struct { + Comments []*comment.Comment Position *position.Position Left node.Node Right node.Node @@ -31,6 +33,17 @@ func (n *Mul) GetPosition() *position.Position { return n.Position } +func (n *Mul) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *Mul) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *Mul) Attributes() map[string]interface{} { return nil diff --git a/node/expr/binary/n_not_equal.go b/node/expr/binary/n_not_equal.go index 21ef277..e713676 100644 --- a/node/expr/binary/n_not_equal.go +++ b/node/expr/binary/n_not_equal.go @@ -1,6 +1,7 @@ package binary import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // NotEqual node type NotEqual struct { + Comments []*comment.Comment Position *position.Position Left node.Node Right node.Node @@ -31,6 +33,17 @@ func (n *NotEqual) GetPosition() *position.Position { return n.Position } +func (n *NotEqual) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *NotEqual) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *NotEqual) Attributes() map[string]interface{} { return nil diff --git a/node/expr/binary/n_not_identical.go b/node/expr/binary/n_not_identical.go index b013fbe..41491dc 100644 --- a/node/expr/binary/n_not_identical.go +++ b/node/expr/binary/n_not_identical.go @@ -1,6 +1,7 @@ package binary import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // NotIdentical node type NotIdentical struct { + Comments []*comment.Comment Position *position.Position Left node.Node Right node.Node @@ -31,6 +33,17 @@ func (n *NotIdentical) GetPosition() *position.Position { return n.Position } +func (n *NotIdentical) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *NotIdentical) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *NotIdentical) Attributes() map[string]interface{} { return nil diff --git a/node/expr/binary/n_plus.go b/node/expr/binary/n_plus.go index 2753099..10561b4 100644 --- a/node/expr/binary/n_plus.go +++ b/node/expr/binary/n_plus.go @@ -1,6 +1,7 @@ package binary import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // Plus node type Plus struct { + Comments []*comment.Comment Position *position.Position Left node.Node Right node.Node @@ -31,6 +33,17 @@ func (n *Plus) GetPosition() *position.Position { return n.Position } +func (n *Plus) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *Plus) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *Plus) Attributes() map[string]interface{} { return nil diff --git a/node/expr/binary/n_pow.go b/node/expr/binary/n_pow.go index 371c6bd..25af5c9 100644 --- a/node/expr/binary/n_pow.go +++ b/node/expr/binary/n_pow.go @@ -1,6 +1,7 @@ package binary import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // Pow node type Pow struct { + Comments []*comment.Comment Position *position.Position Left node.Node Right node.Node @@ -31,6 +33,17 @@ func (n *Pow) GetPosition() *position.Position { return n.Position } +func (n *Pow) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *Pow) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *Pow) Attributes() map[string]interface{} { return nil diff --git a/node/expr/binary/n_shift_left.go b/node/expr/binary/n_shift_left.go index f48b559..d6028fa 100644 --- a/node/expr/binary/n_shift_left.go +++ b/node/expr/binary/n_shift_left.go @@ -1,6 +1,7 @@ package binary import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // ShiftLeft node type ShiftLeft struct { + Comments []*comment.Comment Position *position.Position Left node.Node Right node.Node @@ -31,6 +33,17 @@ func (n *ShiftLeft) GetPosition() *position.Position { return n.Position } +func (n *ShiftLeft) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *ShiftLeft) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *ShiftLeft) Attributes() map[string]interface{} { return nil diff --git a/node/expr/binary/n_shift_right.go b/node/expr/binary/n_shift_right.go index 2ff7ea8..14b4f95 100644 --- a/node/expr/binary/n_shift_right.go +++ b/node/expr/binary/n_shift_right.go @@ -1,6 +1,7 @@ package binary import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // ShiftRight node type ShiftRight struct { + Comments []*comment.Comment Position *position.Position Left node.Node Right node.Node @@ -31,6 +33,17 @@ func (n *ShiftRight) GetPosition() *position.Position { return n.Position } +func (n *ShiftRight) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *ShiftRight) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *ShiftRight) Attributes() map[string]interface{} { return nil diff --git a/node/expr/binary/n_smaller.go b/node/expr/binary/n_smaller.go index 1e380a0..b3deb82 100644 --- a/node/expr/binary/n_smaller.go +++ b/node/expr/binary/n_smaller.go @@ -1,6 +1,7 @@ package binary import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // Smaller node type Smaller struct { + Comments []*comment.Comment Position *position.Position Left node.Node Right node.Node @@ -31,6 +33,17 @@ func (n *Smaller) GetPosition() *position.Position { return n.Position } +func (n *Smaller) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *Smaller) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *Smaller) Attributes() map[string]interface{} { return nil diff --git a/node/expr/binary/n_smaller_or_equal.go b/node/expr/binary/n_smaller_or_equal.go index de00106..d2b2aef 100644 --- a/node/expr/binary/n_smaller_or_equal.go +++ b/node/expr/binary/n_smaller_or_equal.go @@ -1,6 +1,7 @@ package binary import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // SmallerOrEqual node type SmallerOrEqual struct { + Comments []*comment.Comment Position *position.Position Left node.Node Right node.Node @@ -31,6 +33,17 @@ func (n *SmallerOrEqual) GetPosition() *position.Position { return n.Position } +func (n *SmallerOrEqual) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *SmallerOrEqual) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *SmallerOrEqual) Attributes() map[string]interface{} { return nil diff --git a/node/expr/binary/n_spaceship.go b/node/expr/binary/n_spaceship.go index 955fc72..99945d3 100644 --- a/node/expr/binary/n_spaceship.go +++ b/node/expr/binary/n_spaceship.go @@ -1,6 +1,7 @@ package binary import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // Spaceship node type Spaceship struct { + Comments []*comment.Comment Position *position.Position Left node.Node Right node.Node @@ -31,6 +33,17 @@ func (n *Spaceship) GetPosition() *position.Position { return n.Position } +func (n *Spaceship) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *Spaceship) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *Spaceship) Attributes() map[string]interface{} { return nil diff --git a/node/expr/cast/n_cast_array.go b/node/expr/cast/n_cast_array.go index fbaafd3..47b5524 100644 --- a/node/expr/cast/n_cast_array.go +++ b/node/expr/cast/n_cast_array.go @@ -1,6 +1,7 @@ package cast import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // Array node type Array struct { + Comments []*comment.Comment Position *position.Position Expr node.Node } @@ -29,6 +31,17 @@ func (n *Array) GetPosition() *position.Position { return n.Position } +func (n *Array) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *Array) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *Array) Attributes() map[string]interface{} { return nil diff --git a/node/expr/cast/n_cast_bool.go b/node/expr/cast/n_cast_bool.go index e580328..8af7697 100644 --- a/node/expr/cast/n_cast_bool.go +++ b/node/expr/cast/n_cast_bool.go @@ -1,6 +1,7 @@ package cast import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // Bool node type Bool struct { + Comments []*comment.Comment Position *position.Position Expr node.Node } @@ -29,6 +31,17 @@ func (n *Bool) GetPosition() *position.Position { return n.Position } +func (n *Bool) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *Bool) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *Bool) Attributes() map[string]interface{} { return nil diff --git a/node/expr/cast/n_cast_double.go b/node/expr/cast/n_cast_double.go index 2240d0d..56715e5 100644 --- a/node/expr/cast/n_cast_double.go +++ b/node/expr/cast/n_cast_double.go @@ -1,6 +1,7 @@ package cast import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // Double node type Double struct { + Comments []*comment.Comment Position *position.Position Expr node.Node } @@ -29,6 +31,17 @@ func (n *Double) GetPosition() *position.Position { return n.Position } +func (n *Double) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *Double) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *Double) Attributes() map[string]interface{} { return nil diff --git a/node/expr/cast/n_cast_int.go b/node/expr/cast/n_cast_int.go index d4ed5a3..4c6e730 100644 --- a/node/expr/cast/n_cast_int.go +++ b/node/expr/cast/n_cast_int.go @@ -1,6 +1,7 @@ package cast import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // Int node type Int struct { + Comments []*comment.Comment Position *position.Position Expr node.Node } @@ -29,6 +31,17 @@ func (n *Int) GetPosition() *position.Position { return n.Position } +func (n *Int) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *Int) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *Int) Attributes() map[string]interface{} { return nil diff --git a/node/expr/cast/n_cast_object.go b/node/expr/cast/n_cast_object.go index 6497b77..b44aa9c 100644 --- a/node/expr/cast/n_cast_object.go +++ b/node/expr/cast/n_cast_object.go @@ -1,6 +1,7 @@ package cast import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // Object node type Object struct { + Comments []*comment.Comment Position *position.Position Expr node.Node } @@ -29,6 +31,17 @@ func (n *Object) GetPosition() *position.Position { return n.Position } +func (n *Object) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *Object) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *Object) Attributes() map[string]interface{} { return nil diff --git a/node/expr/cast/n_cast_string.go b/node/expr/cast/n_cast_string.go index 3b026a9..7081b26 100644 --- a/node/expr/cast/n_cast_string.go +++ b/node/expr/cast/n_cast_string.go @@ -1,6 +1,7 @@ package cast import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // String node type String struct { + Comments []*comment.Comment Position *position.Position Expr node.Node } @@ -29,6 +31,17 @@ func (n *String) GetPosition() *position.Position { return n.Position } +func (n *String) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *String) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *String) Attributes() map[string]interface{} { return nil diff --git a/node/expr/cast/n_cast_unset.go b/node/expr/cast/n_cast_unset.go index cdc8fea..7eadb26 100644 --- a/node/expr/cast/n_cast_unset.go +++ b/node/expr/cast/n_cast_unset.go @@ -1,6 +1,7 @@ package cast import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // Unset node type Unset struct { + Comments []*comment.Comment Position *position.Position Expr node.Node } @@ -29,6 +31,17 @@ func (n *Unset) GetPosition() *position.Position { return n.Position } +func (n *Unset) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *Unset) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *Unset) Attributes() map[string]interface{} { return nil diff --git a/node/expr/n_array.go b/node/expr/n_array.go index 2a0f09b..e032563 100644 --- a/node/expr/n_array.go +++ b/node/expr/n_array.go @@ -1,6 +1,7 @@ package expr import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // Array node type Array struct { + Comments []*comment.Comment Position *position.Position Items []node.Node } @@ -29,6 +31,17 @@ func (n *Array) GetPosition() *position.Position { return n.Position } +func (n *Array) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *Array) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *Array) Attributes() map[string]interface{} { return nil diff --git a/node/expr/n_array_dim_fetch.go b/node/expr/n_array_dim_fetch.go index f5d4a20..9e61c68 100644 --- a/node/expr/n_array_dim_fetch.go +++ b/node/expr/n_array_dim_fetch.go @@ -1,6 +1,7 @@ package expr import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // ArrayDimFetch node type ArrayDimFetch struct { + Comments []*comment.Comment Position *position.Position Variable node.Node Dim node.Node @@ -31,6 +33,17 @@ func (n *ArrayDimFetch) GetPosition() *position.Position { return n.Position } +func (n *ArrayDimFetch) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *ArrayDimFetch) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *ArrayDimFetch) Attributes() map[string]interface{} { return nil diff --git a/node/expr/n_array_item.go b/node/expr/n_array_item.go index 5022650..48c01a4 100644 --- a/node/expr/n_array_item.go +++ b/node/expr/n_array_item.go @@ -1,6 +1,7 @@ package expr import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // ArrayItem node type ArrayItem struct { + Comments []*comment.Comment Position *position.Position Key node.Node Val node.Node @@ -31,6 +33,17 @@ func (n *ArrayItem) GetPosition() *position.Position { return n.Position } +func (n *ArrayItem) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *ArrayItem) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *ArrayItem) Attributes() map[string]interface{} { return nil diff --git a/node/expr/n_bitwise_not.go b/node/expr/n_bitwise_not.go index fd7fe76..37cc08f 100644 --- a/node/expr/n_bitwise_not.go +++ b/node/expr/n_bitwise_not.go @@ -1,6 +1,7 @@ package expr import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // BitwiseNot node type BitwiseNot struct { + Comments []*comment.Comment Position *position.Position Expr node.Node } @@ -29,6 +31,17 @@ func (n *BitwiseNot) GetPosition() *position.Position { return n.Position } +func (n *BitwiseNot) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *BitwiseNot) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *BitwiseNot) Attributes() map[string]interface{} { return nil diff --git a/node/expr/n_boolean_not.go b/node/expr/n_boolean_not.go index a3aa720..c5d8e0a 100644 --- a/node/expr/n_boolean_not.go +++ b/node/expr/n_boolean_not.go @@ -1,6 +1,7 @@ package expr import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // BooleanNot node type BooleanNot struct { + Comments []*comment.Comment Position *position.Position Expr node.Node } @@ -29,6 +31,17 @@ func (n *BooleanNot) GetPosition() *position.Position { return n.Position } +func (n *BooleanNot) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *BooleanNot) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *BooleanNot) Attributes() map[string]interface{} { return nil diff --git a/node/expr/n_class_const_fetch.go b/node/expr/n_class_const_fetch.go index 84a16ff..c223ebc 100644 --- a/node/expr/n_class_const_fetch.go +++ b/node/expr/n_class_const_fetch.go @@ -1,6 +1,7 @@ package expr import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // ClassConstFetch node type ClassConstFetch struct { + Comments []*comment.Comment Position *position.Position Class node.Node ConstantName node.Node @@ -31,6 +33,17 @@ func (n *ClassConstFetch) GetPosition() *position.Position { return n.Position } +func (n *ClassConstFetch) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *ClassConstFetch) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *ClassConstFetch) Attributes() map[string]interface{} { return nil diff --git a/node/expr/n_clone.go b/node/expr/n_clone.go index e126341..61b81dd 100644 --- a/node/expr/n_clone.go +++ b/node/expr/n_clone.go @@ -1,6 +1,7 @@ package expr import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // Clone node type Clone struct { + Comments []*comment.Comment Position *position.Position Expr node.Node } @@ -29,6 +31,17 @@ func (n *Clone) GetPosition() *position.Position { return n.Position } +func (n *Clone) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *Clone) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *Clone) Attributes() map[string]interface{} { return nil diff --git a/node/expr/n_closure.go b/node/expr/n_closure.go index c88c056..48e7e9a 100644 --- a/node/expr/n_closure.go +++ b/node/expr/n_closure.go @@ -1,6 +1,7 @@ package expr import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // Closure node type Closure struct { + Comments []*comment.Comment Position *position.Position ReturnsRef bool Static bool @@ -41,6 +43,17 @@ func (n *Closure) GetPosition() *position.Position { return n.Position } +func (n *Closure) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *Closure) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *Closure) Attributes() map[string]interface{} { return map[string]interface{}{ diff --git a/node/expr/n_closure_use.go b/node/expr/n_closure_use.go index 053fe3f..fd944f1 100644 --- a/node/expr/n_closure_use.go +++ b/node/expr/n_closure_use.go @@ -1,6 +1,7 @@ package expr import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // ClosureUse node type ClosureUse struct { + Comments []*comment.Comment Position *position.Position Uses []node.Node } @@ -29,6 +31,17 @@ func (n *ClosureUse) GetPosition() *position.Position { return n.Position } +func (n *ClosureUse) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *ClosureUse) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *ClosureUse) Attributes() map[string]interface{} { return nil diff --git a/node/expr/n_const_fetch.go b/node/expr/n_const_fetch.go index 1a97105..d10b0b4 100644 --- a/node/expr/n_const_fetch.go +++ b/node/expr/n_const_fetch.go @@ -1,6 +1,7 @@ package expr import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // ConstFetch node type ConstFetch struct { + Comments []*comment.Comment Position *position.Position Constant node.Node } @@ -29,6 +31,17 @@ func (n *ConstFetch) GetPosition() *position.Position { return n.Position } +func (n *ConstFetch) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *ConstFetch) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *ConstFetch) Attributes() map[string]interface{} { return nil diff --git a/node/expr/n_die.go b/node/expr/n_die.go index 9e57064..f4dcc9d 100644 --- a/node/expr/n_die.go +++ b/node/expr/n_die.go @@ -1,6 +1,7 @@ package expr import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // Die node type Die struct { + Comments []*comment.Comment Position *position.Position Expr node.Node } @@ -29,6 +31,17 @@ func (n *Die) GetPosition() *position.Position { return n.Position } +func (n *Die) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *Die) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *Die) Attributes() map[string]interface{} { return nil diff --git a/node/expr/n_empty.go b/node/expr/n_empty.go index b138a19..71eb94a 100644 --- a/node/expr/n_empty.go +++ b/node/expr/n_empty.go @@ -1,6 +1,7 @@ package expr import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // Empty node type Empty struct { + Comments []*comment.Comment Position *position.Position Expr node.Node } @@ -29,6 +31,17 @@ func (n *Empty) GetPosition() *position.Position { return n.Position } +func (n *Empty) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *Empty) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *Empty) Attributes() map[string]interface{} { return nil diff --git a/node/expr/n_error_suppress.go b/node/expr/n_error_suppress.go index 0aef767..f3b7371 100644 --- a/node/expr/n_error_suppress.go +++ b/node/expr/n_error_suppress.go @@ -1,6 +1,7 @@ package expr import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // ErrorSuppress node type ErrorSuppress struct { + Comments []*comment.Comment Position *position.Position Expr node.Node } @@ -29,6 +31,17 @@ func (n *ErrorSuppress) GetPosition() *position.Position { return n.Position } +func (n *ErrorSuppress) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *ErrorSuppress) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *ErrorSuppress) Attributes() map[string]interface{} { return nil diff --git a/node/expr/n_eval.go b/node/expr/n_eval.go index 33af462..6b002c2 100644 --- a/node/expr/n_eval.go +++ b/node/expr/n_eval.go @@ -1,6 +1,7 @@ package expr import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // Eval node type Eval struct { + Comments []*comment.Comment Position *position.Position Expr node.Node } @@ -29,6 +31,17 @@ func (n *Eval) GetPosition() *position.Position { return n.Position } +func (n *Eval) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *Eval) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *Eval) Attributes() map[string]interface{} { return nil diff --git a/node/expr/n_exit.go b/node/expr/n_exit.go index 2c11da3..306169a 100644 --- a/node/expr/n_exit.go +++ b/node/expr/n_exit.go @@ -1,6 +1,7 @@ package expr import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // Exit node type Exit struct { + Comments []*comment.Comment Position *position.Position Expr node.Node } @@ -29,6 +31,17 @@ func (n *Exit) GetPosition() *position.Position { return n.Position } +func (n *Exit) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *Exit) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *Exit) Attributes() map[string]interface{} { return nil diff --git a/node/expr/n_function_call.go b/node/expr/n_function_call.go index 1f0f96f..2762e09 100644 --- a/node/expr/n_function_call.go +++ b/node/expr/n_function_call.go @@ -1,6 +1,7 @@ package expr import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // FunctionCall node type FunctionCall struct { + Comments []*comment.Comment Position *position.Position Function node.Node ArgumentList *node.ArgumentList @@ -31,6 +33,17 @@ func (n *FunctionCall) GetPosition() *position.Position { return n.Position } +func (n *FunctionCall) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *FunctionCall) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *FunctionCall) Attributes() map[string]interface{} { return nil diff --git a/node/expr/n_include.go b/node/expr/n_include.go index 31bc192..1b15cb9 100644 --- a/node/expr/n_include.go +++ b/node/expr/n_include.go @@ -1,6 +1,7 @@ package expr import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // Include node type Include struct { + Comments []*comment.Comment Position *position.Position Expr node.Node } @@ -29,6 +31,17 @@ func (n *Include) GetPosition() *position.Position { return n.Position } +func (n *Include) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *Include) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *Include) Attributes() map[string]interface{} { return nil diff --git a/node/expr/n_include_once.go b/node/expr/n_include_once.go index 26c1b03..66a927e 100644 --- a/node/expr/n_include_once.go +++ b/node/expr/n_include_once.go @@ -1,6 +1,7 @@ package expr import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // IncludeOnce node type IncludeOnce struct { + Comments []*comment.Comment Position *position.Position Expr node.Node } @@ -29,6 +31,17 @@ func (n *IncludeOnce) GetPosition() *position.Position { return n.Position } +func (n *IncludeOnce) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *IncludeOnce) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *IncludeOnce) Attributes() map[string]interface{} { return nil diff --git a/node/expr/n_instance_of.go b/node/expr/n_instance_of.go index b661145..19a6472 100644 --- a/node/expr/n_instance_of.go +++ b/node/expr/n_instance_of.go @@ -1,6 +1,7 @@ package expr import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // InstanceOf node type InstanceOf struct { + Comments []*comment.Comment Position *position.Position Expr node.Node Class node.Node @@ -31,6 +33,17 @@ func (n *InstanceOf) GetPosition() *position.Position { return n.Position } +func (n *InstanceOf) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *InstanceOf) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *InstanceOf) Attributes() map[string]interface{} { return nil diff --git a/node/expr/n_isset.go b/node/expr/n_isset.go index 5629209..d09e18a 100644 --- a/node/expr/n_isset.go +++ b/node/expr/n_isset.go @@ -1,6 +1,7 @@ package expr import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // Isset node type Isset struct { + Comments []*comment.Comment Position *position.Position Variables []node.Node } @@ -29,6 +31,17 @@ func (n *Isset) GetPosition() *position.Position { return n.Position } +func (n *Isset) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *Isset) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *Isset) Attributes() map[string]interface{} { return nil diff --git a/node/expr/n_list.go b/node/expr/n_list.go index 31dd820..0f368c8 100644 --- a/node/expr/n_list.go +++ b/node/expr/n_list.go @@ -1,6 +1,7 @@ package expr import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // List node type List struct { + Comments []*comment.Comment Position *position.Position Items []node.Node } @@ -29,6 +31,17 @@ func (n *List) GetPosition() *position.Position { return n.Position } +func (n *List) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *List) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *List) Attributes() map[string]interface{} { return nil diff --git a/node/expr/n_method_call.go b/node/expr/n_method_call.go index 2620fa1..e2d8415 100644 --- a/node/expr/n_method_call.go +++ b/node/expr/n_method_call.go @@ -1,6 +1,7 @@ package expr import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // MethodCall node type MethodCall struct { + Comments []*comment.Comment Position *position.Position Variable node.Node Method node.Node @@ -33,6 +35,17 @@ func (n *MethodCall) GetPosition() *position.Position { return n.Position } +func (n *MethodCall) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *MethodCall) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *MethodCall) Attributes() map[string]interface{} { return nil diff --git a/node/expr/n_new.go b/node/expr/n_new.go index e8d80fb..7f28ae5 100644 --- a/node/expr/n_new.go +++ b/node/expr/n_new.go @@ -1,6 +1,7 @@ package expr import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // New node type New struct { + Comments []*comment.Comment Position *position.Position Class node.Node ArgumentList *node.ArgumentList @@ -31,6 +33,17 @@ func (n *New) GetPosition() *position.Position { return n.Position } +func (n *New) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *New) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *New) Attributes() map[string]interface{} { return nil diff --git a/node/expr/n_post_dec.go b/node/expr/n_post_dec.go index dccd05c..476d572 100644 --- a/node/expr/n_post_dec.go +++ b/node/expr/n_post_dec.go @@ -1,6 +1,7 @@ package expr import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // PostDec node type PostDec struct { + Comments []*comment.Comment Position *position.Position Variable node.Node } @@ -29,6 +31,17 @@ func (n *PostDec) GetPosition() *position.Position { return n.Position } +func (n *PostDec) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *PostDec) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *PostDec) Attributes() map[string]interface{} { return nil diff --git a/node/expr/n_post_inc.go b/node/expr/n_post_inc.go index 6c982ec..f9aaf0e 100644 --- a/node/expr/n_post_inc.go +++ b/node/expr/n_post_inc.go @@ -1,6 +1,7 @@ package expr import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // PostInc node type PostInc struct { + Comments []*comment.Comment Position *position.Position Variable node.Node } @@ -29,6 +31,17 @@ func (n *PostInc) GetPosition() *position.Position { return n.Position } +func (n *PostInc) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *PostInc) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *PostInc) Attributes() map[string]interface{} { return nil diff --git a/node/expr/n_pre_dec.go b/node/expr/n_pre_dec.go index c0ce7a1..93c65e5 100644 --- a/node/expr/n_pre_dec.go +++ b/node/expr/n_pre_dec.go @@ -1,6 +1,7 @@ package expr import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // PreDec node type PreDec struct { + Comments []*comment.Comment Position *position.Position Variable node.Node } @@ -29,6 +31,17 @@ func (n *PreDec) GetPosition() *position.Position { return n.Position } +func (n *PreDec) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *PreDec) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *PreDec) Attributes() map[string]interface{} { return nil diff --git a/node/expr/n_pre_inc.go b/node/expr/n_pre_inc.go index e2baed2..aac0747 100644 --- a/node/expr/n_pre_inc.go +++ b/node/expr/n_pre_inc.go @@ -1,6 +1,7 @@ package expr import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // PreInc node type PreInc struct { + Comments []*comment.Comment Position *position.Position Variable node.Node } @@ -29,6 +31,17 @@ func (n *PreInc) GetPosition() *position.Position { return n.Position } +func (n *PreInc) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *PreInc) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *PreInc) Attributes() map[string]interface{} { return nil diff --git a/node/expr/n_print.go b/node/expr/n_print.go index 6bc151c..cdfd4fb 100644 --- a/node/expr/n_print.go +++ b/node/expr/n_print.go @@ -1,6 +1,7 @@ package expr import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // Print node type Print struct { + Comments []*comment.Comment Position *position.Position Expr node.Node } @@ -29,6 +31,17 @@ func (n *Print) GetPosition() *position.Position { return n.Position } +func (n *Print) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *Print) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *Print) Attributes() map[string]interface{} { return nil diff --git a/node/expr/n_property_fetch.go b/node/expr/n_property_fetch.go index 15341d1..7256011 100644 --- a/node/expr/n_property_fetch.go +++ b/node/expr/n_property_fetch.go @@ -1,6 +1,7 @@ package expr import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // PropertyFetch node type PropertyFetch struct { + Comments []*comment.Comment Position *position.Position Variable node.Node Property node.Node @@ -31,6 +33,17 @@ func (n *PropertyFetch) GetPosition() *position.Position { return n.Position } +func (n *PropertyFetch) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *PropertyFetch) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *PropertyFetch) Attributes() map[string]interface{} { return nil diff --git a/node/expr/n_reference.go b/node/expr/n_reference.go index eab0fbb..df0cd5f 100644 --- a/node/expr/n_reference.go +++ b/node/expr/n_reference.go @@ -1,6 +1,7 @@ package expr import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // Reference node type Reference struct { + Comments []*comment.Comment Position *position.Position Variable node.Node } @@ -29,6 +31,17 @@ func (n *Reference) GetPosition() *position.Position { return n.Position } +func (n *Reference) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *Reference) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *Reference) Attributes() map[string]interface{} { return nil diff --git a/node/expr/n_require.go b/node/expr/n_require.go index c9dbae3..b145288 100644 --- a/node/expr/n_require.go +++ b/node/expr/n_require.go @@ -1,6 +1,7 @@ package expr import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // Require node type Require struct { + Comments []*comment.Comment Position *position.Position Expr node.Node } @@ -29,6 +31,17 @@ func (n *Require) GetPosition() *position.Position { return n.Position } +func (n *Require) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *Require) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *Require) Attributes() map[string]interface{} { return nil diff --git a/node/expr/n_require_once.go b/node/expr/n_require_once.go index 723f12c..b36ab63 100644 --- a/node/expr/n_require_once.go +++ b/node/expr/n_require_once.go @@ -1,6 +1,7 @@ package expr import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // RequireOnce node type RequireOnce struct { + Comments []*comment.Comment Position *position.Position Expr node.Node } @@ -29,6 +31,17 @@ func (n *RequireOnce) GetPosition() *position.Position { return n.Position } +func (n *RequireOnce) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *RequireOnce) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *RequireOnce) Attributes() map[string]interface{} { return nil diff --git a/node/expr/n_shell_exec.go b/node/expr/n_shell_exec.go index fb56a61..bbcf24d 100644 --- a/node/expr/n_shell_exec.go +++ b/node/expr/n_shell_exec.go @@ -1,6 +1,7 @@ package expr import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // ShellExec node type ShellExec struct { + Comments []*comment.Comment Position *position.Position Parts []node.Node } @@ -29,6 +31,17 @@ func (n *ShellExec) GetPosition() *position.Position { return n.Position } +func (n *ShellExec) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *ShellExec) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *ShellExec) Attributes() map[string]interface{} { return nil diff --git a/node/expr/n_short_array.go b/node/expr/n_short_array.go index 3f955a1..b6f5ebb 100644 --- a/node/expr/n_short_array.go +++ b/node/expr/n_short_array.go @@ -1,6 +1,7 @@ package expr import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // ShortArray node type ShortArray struct { + Comments []*comment.Comment Position *position.Position Items []node.Node } @@ -29,6 +31,17 @@ func (n *ShortArray) GetPosition() *position.Position { return n.Position } +func (n *ShortArray) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *ShortArray) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *ShortArray) Attributes() map[string]interface{} { return nil diff --git a/node/expr/n_short_list.go b/node/expr/n_short_list.go index 93d7042..3714832 100644 --- a/node/expr/n_short_list.go +++ b/node/expr/n_short_list.go @@ -1,6 +1,7 @@ package expr import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // ShortList node type ShortList struct { + Comments []*comment.Comment Position *position.Position Items []node.Node } @@ -29,6 +31,17 @@ func (n *ShortList) GetPosition() *position.Position { return n.Position } +func (n *ShortList) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *ShortList) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *ShortList) Attributes() map[string]interface{} { return nil diff --git a/node/expr/n_static_call.go b/node/expr/n_static_call.go index 6e16aae..be0c7f2 100644 --- a/node/expr/n_static_call.go +++ b/node/expr/n_static_call.go @@ -1,6 +1,7 @@ package expr import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // StaticCall node type StaticCall struct { + Comments []*comment.Comment Position *position.Position Class node.Node Call node.Node @@ -33,6 +35,17 @@ func (n *StaticCall) GetPosition() *position.Position { return n.Position } +func (n *StaticCall) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *StaticCall) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *StaticCall) Attributes() map[string]interface{} { return nil diff --git a/node/expr/n_static_property_fetch.go b/node/expr/n_static_property_fetch.go index d363f08..1e52c37 100644 --- a/node/expr/n_static_property_fetch.go +++ b/node/expr/n_static_property_fetch.go @@ -1,6 +1,7 @@ package expr import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // StaticPropertyFetch node type StaticPropertyFetch struct { + Comments []*comment.Comment Position *position.Position Class node.Node Property node.Node @@ -31,6 +33,17 @@ func (n *StaticPropertyFetch) GetPosition() *position.Position { return n.Position } +func (n *StaticPropertyFetch) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *StaticPropertyFetch) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *StaticPropertyFetch) Attributes() map[string]interface{} { return nil diff --git a/node/expr/n_ternary.go b/node/expr/n_ternary.go index fcb2b12..f94aef3 100644 --- a/node/expr/n_ternary.go +++ b/node/expr/n_ternary.go @@ -1,6 +1,7 @@ package expr import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // Ternary node type Ternary struct { + Comments []*comment.Comment Position *position.Position Condition node.Node IfTrue node.Node @@ -33,6 +35,17 @@ func (n *Ternary) GetPosition() *position.Position { return n.Position } +func (n *Ternary) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *Ternary) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *Ternary) Attributes() map[string]interface{} { return nil diff --git a/node/expr/n_unary_minus.go b/node/expr/n_unary_minus.go index fdbac5c..f1c21eb 100644 --- a/node/expr/n_unary_minus.go +++ b/node/expr/n_unary_minus.go @@ -1,6 +1,7 @@ package expr import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // UnaryMinus node type UnaryMinus struct { + Comments []*comment.Comment Position *position.Position Expr node.Node } @@ -29,6 +31,17 @@ func (n *UnaryMinus) GetPosition() *position.Position { return n.Position } +func (n *UnaryMinus) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *UnaryMinus) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *UnaryMinus) Attributes() map[string]interface{} { return nil diff --git a/node/expr/n_unary_plus.go b/node/expr/n_unary_plus.go index d0d5812..5e50fcd 100644 --- a/node/expr/n_unary_plus.go +++ b/node/expr/n_unary_plus.go @@ -1,6 +1,7 @@ package expr import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // UnaryPlus node type UnaryPlus struct { + Comments []*comment.Comment Position *position.Position Expr node.Node } @@ -29,6 +31,17 @@ func (n *UnaryPlus) GetPosition() *position.Position { return n.Position } +func (n *UnaryPlus) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *UnaryPlus) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *UnaryPlus) Attributes() map[string]interface{} { return nil diff --git a/node/expr/n_variable.go b/node/expr/n_variable.go index 3420eeb..b0dc735 100644 --- a/node/expr/n_variable.go +++ b/node/expr/n_variable.go @@ -1,6 +1,7 @@ package expr import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // Variable node type Variable struct { + Comments []*comment.Comment Position *position.Position VarName node.Node } @@ -29,6 +31,17 @@ func (n *Variable) GetPosition() *position.Position { return n.Position } +func (n *Variable) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *Variable) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *Variable) Attributes() map[string]interface{} { return nil diff --git a/node/expr/n_yield.go b/node/expr/n_yield.go index 9f6be45..999f0bf 100644 --- a/node/expr/n_yield.go +++ b/node/expr/n_yield.go @@ -1,6 +1,7 @@ package expr import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // Yield node type Yield struct { + Comments []*comment.Comment Position *position.Position Key node.Node Value node.Node @@ -31,6 +33,17 @@ func (n *Yield) GetPosition() *position.Position { return n.Position } +func (n *Yield) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *Yield) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *Yield) Attributes() map[string]interface{} { return nil diff --git a/node/expr/n_yield_from.go b/node/expr/n_yield_from.go index ef2ceda..6651856 100644 --- a/node/expr/n_yield_from.go +++ b/node/expr/n_yield_from.go @@ -1,6 +1,7 @@ package expr import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // YieldFrom node type YieldFrom struct { + Comments []*comment.Comment Position *position.Position Expr node.Node } @@ -29,6 +31,17 @@ func (n *YieldFrom) GetPosition() *position.Position { return n.Position } +func (n *YieldFrom) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *YieldFrom) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *YieldFrom) Attributes() map[string]interface{} { return nil diff --git a/node/n_argument.go b/node/n_argument.go index f31b173..c32582a 100644 --- a/node/n_argument.go +++ b/node/n_argument.go @@ -1,12 +1,14 @@ package node import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" ) // Argument node type Argument struct { + Comments []*comment.Comment Position *position.Position Variadic bool // if ... before variable IsReference bool // if & before variable @@ -32,6 +34,17 @@ func (n *Argument) GetPosition() *position.Position { return n.Position } +func (n *Argument) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *Argument) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *Argument) Attributes() map[string]interface{} { return map[string]interface{}{ diff --git a/node/n_argument_list.go b/node/n_argument_list.go index f01d3a1..49de0cc 100644 --- a/node/n_argument_list.go +++ b/node/n_argument_list.go @@ -1,12 +1,14 @@ package node import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" ) // ArgumentList node type ArgumentList struct { + Comments []*comment.Comment Position *position.Position Arguments []Node } @@ -28,6 +30,18 @@ func (n *ArgumentList) GetPosition() *position.Position { return n.Position } +func (n *ArgumentList) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + + n.Comments = append(n.Comments, cc...) +} + +func (n *ArgumentList) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *ArgumentList) Attributes() map[string]interface{} { return nil diff --git a/node/n_identifier.go b/node/n_identifier.go index 3e0d829..5d3ad0a 100644 --- a/node/n_identifier.go +++ b/node/n_identifier.go @@ -1,12 +1,14 @@ package node import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" ) // Identifier node type Identifier struct { + Comments []*comment.Comment Position *position.Position Value string } @@ -28,6 +30,17 @@ func (n *Identifier) GetPosition() *position.Position { return n.Position } +func (n *Identifier) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *Identifier) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *Identifier) Attributes() map[string]interface{} { return map[string]interface{}{ diff --git a/node/n_nullable.go b/node/n_nullable.go index 3ebd4cc..5354efd 100644 --- a/node/n_nullable.go +++ b/node/n_nullable.go @@ -1,12 +1,14 @@ package node import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" ) // Nullable node type Nullable struct { + Comments []*comment.Comment Position *position.Position Expr Node } @@ -28,6 +30,17 @@ func (n *Nullable) GetPosition() *position.Position { return n.Position } +func (n *Nullable) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *Nullable) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *Nullable) Attributes() map[string]interface{} { return nil diff --git a/node/n_parameter.go b/node/n_parameter.go index 127d314..236690e 100644 --- a/node/n_parameter.go +++ b/node/n_parameter.go @@ -1,12 +1,14 @@ package node import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" ) // Parameter node type Parameter struct { + Comments []*comment.Comment Position *position.Position ByRef bool Variadic bool @@ -36,6 +38,17 @@ func (n *Parameter) GetPosition() *position.Position { return n.Position } +func (n *Parameter) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *Parameter) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *Parameter) Attributes() map[string]interface{} { return map[string]interface{}{ diff --git a/node/n_root.go b/node/n_root.go index 58cf200..9f2ee53 100644 --- a/node/n_root.go +++ b/node/n_root.go @@ -1,12 +1,14 @@ package node import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" ) // Root node type Root struct { + Comments []*comment.Comment Position *position.Position Stmts []Node } @@ -28,6 +30,17 @@ func (n *Root) GetPosition() *position.Position { return n.Position } +func (n *Root) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *Root) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *Root) Attributes() map[string]interface{} { return nil diff --git a/node/name/n_fully_qualified.go b/node/name/n_fully_qualified.go index c921dfd..eb239bb 100644 --- a/node/name/n_fully_qualified.go +++ b/node/name/n_fully_qualified.go @@ -1,6 +1,7 @@ package name import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // FullyQualified node type FullyQualified struct { + Comments []*comment.Comment Position *position.Position Parts []node.Node } @@ -29,6 +31,17 @@ func (n *FullyQualified) GetPosition() *position.Position { return n.Position } +func (n *FullyQualified) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *FullyQualified) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *FullyQualified) Attributes() map[string]interface{} { return nil diff --git a/node/name/n_name.go b/node/name/n_name.go index bde31ed..d032b3c 100644 --- a/node/name/n_name.go +++ b/node/name/n_name.go @@ -1,6 +1,7 @@ package name import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // Name node type Name struct { + Comments []*comment.Comment Position *position.Position Parts []node.Node } @@ -29,6 +31,17 @@ func (n *Name) GetPosition() *position.Position { return n.Position } +func (n *Name) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *Name) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *Name) Attributes() map[string]interface{} { return nil diff --git a/node/name/n_name_part.go b/node/name/n_name_part.go index 4ebc524..a331231 100644 --- a/node/name/n_name_part.go +++ b/node/name/n_name_part.go @@ -1,12 +1,14 @@ package name import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" ) // NamePart node type NamePart struct { + Comments []*comment.Comment Position *position.Position Value string } @@ -28,6 +30,17 @@ func (n *NamePart) GetPosition() *position.Position { return n.Position } +func (n *NamePart) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *NamePart) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *NamePart) Attributes() map[string]interface{} { return map[string]interface{}{ diff --git a/node/name/n_relative.go b/node/name/n_relative.go index b4487e7..56230a1 100644 --- a/node/name/n_relative.go +++ b/node/name/n_relative.go @@ -1,6 +1,7 @@ package name import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // Relative node type Relative struct { + Comments []*comment.Comment Position *position.Position Parts []node.Node } @@ -29,6 +31,17 @@ func (n *Relative) GetPosition() *position.Position { return n.Position } +func (n *Relative) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *Relative) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *Relative) Attributes() map[string]interface{} { return nil diff --git a/node/node.go b/node/node.go index 9ef1621..dd53b20 100644 --- a/node/node.go +++ b/node/node.go @@ -1,6 +1,7 @@ package node import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" ) @@ -11,4 +12,6 @@ type Node interface { Attributes() map[string]interface{} // Attributes returns node attributes as map SetPosition(p *position.Position) GetPosition() *position.Position + AddComments(c []*comment.Comment, t comment.TokenName) + GetComments() []*comment.Comment } diff --git a/node/scalar/node_dnumber.go b/node/scalar/node_dnumber.go index 8b2b6e6..fa65f0a 100644 --- a/node/scalar/node_dnumber.go +++ b/node/scalar/node_dnumber.go @@ -1,12 +1,14 @@ package scalar import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" ) // Dnumber node type Dnumber struct { + Comments []*comment.Comment Position *position.Position Value string } @@ -28,6 +30,17 @@ func (n *Dnumber) GetPosition() *position.Position { return n.Position } +func (n *Dnumber) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *Dnumber) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *Dnumber) Attributes() map[string]interface{} { return map[string]interface{}{ diff --git a/node/scalar/node_encapsed.go b/node/scalar/node_encapsed.go index e8bd5e7..98b312d 100644 --- a/node/scalar/node_encapsed.go +++ b/node/scalar/node_encapsed.go @@ -1,6 +1,7 @@ package scalar import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // Encapsed node type Encapsed struct { + Comments []*comment.Comment Position *position.Position Parts []node.Node } @@ -29,6 +31,17 @@ func (n *Encapsed) GetPosition() *position.Position { return n.Position } +func (n *Encapsed) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *Encapsed) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *Encapsed) Attributes() map[string]interface{} { return nil diff --git a/node/scalar/node_encapsed_string_part.go b/node/scalar/node_encapsed_string_part.go index d1a12e3..71e596c 100644 --- a/node/scalar/node_encapsed_string_part.go +++ b/node/scalar/node_encapsed_string_part.go @@ -1,12 +1,14 @@ package scalar import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" ) // EncapsedStringPart node type EncapsedStringPart struct { + Comments []*comment.Comment Position *position.Position Value string } @@ -28,6 +30,17 @@ func (n *EncapsedStringPart) GetPosition() *position.Position { return n.Position } +func (n *EncapsedStringPart) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *EncapsedStringPart) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *EncapsedStringPart) Attributes() map[string]interface{} { return map[string]interface{}{ diff --git a/node/scalar/node_heredoc.go b/node/scalar/node_heredoc.go index 7fd19c0..31f72f5 100644 --- a/node/scalar/node_heredoc.go +++ b/node/scalar/node_heredoc.go @@ -1,6 +1,7 @@ package scalar import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // Heredoc node type Heredoc struct { + Comments []*comment.Comment Position *position.Position Label string Parts []node.Node @@ -31,6 +33,17 @@ func (n *Heredoc) GetPosition() *position.Position { return n.Position } +func (n *Heredoc) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *Heredoc) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *Heredoc) Attributes() map[string]interface{} { return map[string]interface{}{ diff --git a/node/scalar/node_lnumber.go b/node/scalar/node_lnumber.go index 0d65f9a..198d9e2 100644 --- a/node/scalar/node_lnumber.go +++ b/node/scalar/node_lnumber.go @@ -1,12 +1,14 @@ package scalar import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" ) // Lnumber node type Lnumber struct { + Comments []*comment.Comment Position *position.Position Value string } @@ -28,6 +30,17 @@ func (n *Lnumber) GetPosition() *position.Position { return n.Position } +func (n *Lnumber) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *Lnumber) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *Lnumber) Attributes() map[string]interface{} { return map[string]interface{}{ diff --git a/node/scalar/node_magic_constant.go b/node/scalar/node_magic_constant.go index 5df0130..0f06f7b 100644 --- a/node/scalar/node_magic_constant.go +++ b/node/scalar/node_magic_constant.go @@ -1,12 +1,14 @@ package scalar import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" ) // MagicConstant node type MagicConstant struct { + Comments []*comment.Comment Position *position.Position Value string } @@ -28,6 +30,17 @@ func (n *MagicConstant) GetPosition() *position.Position { return n.Position } +func (n *MagicConstant) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *MagicConstant) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *MagicConstant) Attributes() map[string]interface{} { return map[string]interface{}{ diff --git a/node/scalar/node_string.go b/node/scalar/node_string.go index 849881a..bbabf35 100644 --- a/node/scalar/node_string.go +++ b/node/scalar/node_string.go @@ -1,12 +1,14 @@ package scalar import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" ) // String node type String struct { + Comments []*comment.Comment Position *position.Position Value string } @@ -28,6 +30,17 @@ func (n *String) GetPosition() *position.Position { return n.Position } +func (n *String) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *String) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *String) Attributes() map[string]interface{} { return map[string]interface{}{ diff --git a/node/stmt/n_alt_else.go b/node/stmt/n_alt_else.go index e02f86b..682a155 100644 --- a/node/stmt/n_alt_else.go +++ b/node/stmt/n_alt_else.go @@ -1,6 +1,7 @@ package stmt import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // AltElse node type AltElse struct { + Comments []*comment.Comment Position *position.Position Stmt node.Node } @@ -29,6 +31,17 @@ func (n *AltElse) GetPosition() *position.Position { return n.Position } +func (n *AltElse) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *AltElse) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *AltElse) Attributes() map[string]interface{} { return nil diff --git a/node/stmt/n_alt_else_if.go b/node/stmt/n_alt_else_if.go index f6dd7ec..e2cb2dd 100644 --- a/node/stmt/n_alt_else_if.go +++ b/node/stmt/n_alt_else_if.go @@ -1,6 +1,7 @@ package stmt import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // AltElseIf node type AltElseIf struct { + Comments []*comment.Comment Position *position.Position Cond node.Node Stmt node.Node @@ -31,6 +33,17 @@ func (n *AltElseIf) GetPosition() *position.Position { return n.Position } +func (n *AltElseIf) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *AltElseIf) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *AltElseIf) Attributes() map[string]interface{} { return nil diff --git a/node/stmt/n_alt_for.go b/node/stmt/n_alt_for.go index 39078d2..e4fa03f 100644 --- a/node/stmt/n_alt_for.go +++ b/node/stmt/n_alt_for.go @@ -1,6 +1,7 @@ package stmt import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // AltFor node type AltFor struct { + Comments []*comment.Comment Position *position.Position Init []node.Node Cond []node.Node @@ -35,6 +37,17 @@ func (n *AltFor) GetPosition() *position.Position { return n.Position } +func (n *AltFor) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *AltFor) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *AltFor) Attributes() map[string]interface{} { return nil diff --git a/node/stmt/n_alt_foreach.go b/node/stmt/n_alt_foreach.go index 2e7cbe1..066fbc8 100644 --- a/node/stmt/n_alt_foreach.go +++ b/node/stmt/n_alt_foreach.go @@ -1,6 +1,7 @@ package stmt import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // AltForeach node type AltForeach struct { + Comments []*comment.Comment Position *position.Position Expr node.Node Key node.Node @@ -35,6 +37,17 @@ func (n *AltForeach) GetPosition() *position.Position { return n.Position } +func (n *AltForeach) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *AltForeach) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *AltForeach) Attributes() map[string]interface{} { return nil diff --git a/node/stmt/n_alt_if.go b/node/stmt/n_alt_if.go index 63e3b76..17ce857 100644 --- a/node/stmt/n_alt_if.go +++ b/node/stmt/n_alt_if.go @@ -1,6 +1,7 @@ package stmt import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // AltIf node type AltIf struct { + Comments []*comment.Comment Position *position.Position Cond node.Node Stmt node.Node @@ -35,6 +37,17 @@ func (n *AltIf) GetPosition() *position.Position { return n.Position } +func (n *AltIf) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *AltIf) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *AltIf) Attributes() map[string]interface{} { return nil diff --git a/node/stmt/n_alt_switch.go b/node/stmt/n_alt_switch.go index 3d93de3..8a5d6fe 100644 --- a/node/stmt/n_alt_switch.go +++ b/node/stmt/n_alt_switch.go @@ -1,6 +1,7 @@ package stmt import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // AltSwitch node type AltSwitch struct { + Comments []*comment.Comment Position *position.Position Cond node.Node CaseList *CaseList @@ -31,6 +33,17 @@ func (n *AltSwitch) GetPosition() *position.Position { return n.Position } +func (n *AltSwitch) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *AltSwitch) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *AltSwitch) Attributes() map[string]interface{} { return nil diff --git a/node/stmt/n_alt_while.go b/node/stmt/n_alt_while.go index a17b45d..e68abcc 100644 --- a/node/stmt/n_alt_while.go +++ b/node/stmt/n_alt_while.go @@ -1,6 +1,7 @@ package stmt import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // AltWhile node type AltWhile struct { + Comments []*comment.Comment Position *position.Position Cond node.Node Stmt node.Node @@ -31,6 +33,17 @@ func (n *AltWhile) GetPosition() *position.Position { return n.Position } +func (n *AltWhile) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *AltWhile) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *AltWhile) Attributes() map[string]interface{} { return nil diff --git a/node/stmt/n_break.go b/node/stmt/n_break.go index 06e49d8..3e037ec 100644 --- a/node/stmt/n_break.go +++ b/node/stmt/n_break.go @@ -1,6 +1,7 @@ package stmt import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // Break node type Break struct { + Comments []*comment.Comment Position *position.Position Expr node.Node } @@ -29,6 +31,17 @@ func (n *Break) GetPosition() *position.Position { return n.Position } +func (n *Break) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *Break) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *Break) Attributes() map[string]interface{} { return nil diff --git a/node/stmt/n_case.go b/node/stmt/n_case.go index 662136f..0da6917 100644 --- a/node/stmt/n_case.go +++ b/node/stmt/n_case.go @@ -1,6 +1,7 @@ package stmt import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // Case node type Case struct { + Comments []*comment.Comment Position *position.Position Cond node.Node Stmts []node.Node @@ -31,6 +33,17 @@ func (n *Case) GetPosition() *position.Position { return n.Position } +func (n *Case) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *Case) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *Case) Attributes() map[string]interface{} { return nil diff --git a/node/stmt/n_case_list.go b/node/stmt/n_case_list.go index 0fe6610..aa7ba24 100644 --- a/node/stmt/n_case_list.go +++ b/node/stmt/n_case_list.go @@ -1,6 +1,7 @@ package stmt import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // CaseList node type CaseList struct { + Comments []*comment.Comment Position *position.Position Cases []node.Node } @@ -29,6 +31,17 @@ func (n *CaseList) GetPosition() *position.Position { return n.Position } +func (n *CaseList) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *CaseList) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *CaseList) Attributes() map[string]interface{} { return nil diff --git a/node/stmt/n_catch.go b/node/stmt/n_catch.go index 3cc5b0d..826f0a1 100644 --- a/node/stmt/n_catch.go +++ b/node/stmt/n_catch.go @@ -1,6 +1,7 @@ package stmt import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // Catch node type Catch struct { + Comments []*comment.Comment Position *position.Position Types []node.Node Variable node.Node @@ -33,6 +35,17 @@ func (n *Catch) GetPosition() *position.Position { return n.Position } +func (n *Catch) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *Catch) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *Catch) Attributes() map[string]interface{} { return nil diff --git a/node/stmt/n_class.go b/node/stmt/n_class.go index 0362c60..564cd8c 100644 --- a/node/stmt/n_class.go +++ b/node/stmt/n_class.go @@ -1,6 +1,7 @@ package stmt import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // Class node type Class struct { + Comments []*comment.Comment Position *position.Position PhpDocComment string ClassName node.Node @@ -41,6 +43,17 @@ func (n *Class) GetPosition() *position.Position { return n.Position } +func (n *Class) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *Class) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *Class) Attributes() map[string]interface{} { return map[string]interface{}{ diff --git a/node/stmt/n_class_const_list.go b/node/stmt/n_class_const_list.go index b27f804..240f271 100644 --- a/node/stmt/n_class_const_list.go +++ b/node/stmt/n_class_const_list.go @@ -1,6 +1,7 @@ package stmt import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // ClassConstList node type ClassConstList struct { + Comments []*comment.Comment Position *position.Position Modifiers []node.Node Consts []node.Node @@ -31,6 +33,17 @@ func (n *ClassConstList) GetPosition() *position.Position { return n.Position } +func (n *ClassConstList) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *ClassConstList) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *ClassConstList) Attributes() map[string]interface{} { return nil diff --git a/node/stmt/n_class_extends.go b/node/stmt/n_class_extends.go index 45dba61..b95dbd7 100644 --- a/node/stmt/n_class_extends.go +++ b/node/stmt/n_class_extends.go @@ -1,6 +1,7 @@ package stmt import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // ClassExtends node type ClassExtends struct { + Comments []*comment.Comment Position *position.Position ClassName node.Node } @@ -29,6 +31,17 @@ func (n *ClassExtends) GetPosition() *position.Position { return n.Position } +func (n *ClassExtends) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *ClassExtends) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *ClassExtends) Attributes() map[string]interface{} { return nil diff --git a/node/stmt/n_class_implements.go b/node/stmt/n_class_implements.go index 720a345..f8f823f 100644 --- a/node/stmt/n_class_implements.go +++ b/node/stmt/n_class_implements.go @@ -1,6 +1,7 @@ package stmt import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // ClassImplements node type ClassImplements struct { + Comments []*comment.Comment Position *position.Position InterfaceNames []node.Node } @@ -29,6 +31,17 @@ func (n *ClassImplements) GetPosition() *position.Position { return n.Position } +func (n *ClassImplements) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *ClassImplements) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *ClassImplements) Attributes() map[string]interface{} { return nil diff --git a/node/stmt/n_class_method.go b/node/stmt/n_class_method.go index 38edf23..599e1e8 100644 --- a/node/stmt/n_class_method.go +++ b/node/stmt/n_class_method.go @@ -1,6 +1,7 @@ package stmt import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // ClassMethod node type ClassMethod struct { + Comments []*comment.Comment Position *position.Position ReturnsRef bool PhpDocComment string @@ -41,6 +43,17 @@ func (n *ClassMethod) GetPosition() *position.Position { return n.Position } +func (n *ClassMethod) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *ClassMethod) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *ClassMethod) Attributes() map[string]interface{} { return map[string]interface{}{ diff --git a/node/stmt/n_const_list.go b/node/stmt/n_const_list.go index e01ee76..65d758d 100644 --- a/node/stmt/n_const_list.go +++ b/node/stmt/n_const_list.go @@ -1,6 +1,7 @@ package stmt import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // ConstList node type ConstList struct { + Comments []*comment.Comment Position *position.Position Consts []node.Node } @@ -29,6 +31,17 @@ func (n *ConstList) GetPosition() *position.Position { return n.Position } +func (n *ConstList) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *ConstList) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *ConstList) Attributes() map[string]interface{} { return nil diff --git a/node/stmt/n_constant.go b/node/stmt/n_constant.go index c84a396..8a7dd43 100644 --- a/node/stmt/n_constant.go +++ b/node/stmt/n_constant.go @@ -1,6 +1,7 @@ package stmt import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // Constant node type Constant struct { + Comments []*comment.Comment Position *position.Position PhpDocComment string ConstantName node.Node @@ -33,6 +35,17 @@ func (n *Constant) GetPosition() *position.Position { return n.Position } +func (n *Constant) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *Constant) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *Constant) Attributes() map[string]interface{} { return map[string]interface{}{ diff --git a/node/stmt/n_continue.go b/node/stmt/n_continue.go index aaf1cec..c553b4c 100644 --- a/node/stmt/n_continue.go +++ b/node/stmt/n_continue.go @@ -1,6 +1,7 @@ package stmt import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // Continue node type Continue struct { + Comments []*comment.Comment Position *position.Position Expr node.Node } @@ -29,6 +31,17 @@ func (n *Continue) GetPosition() *position.Position { return n.Position } +func (n *Continue) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *Continue) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *Continue) Attributes() map[string]interface{} { return nil diff --git a/node/stmt/n_declare.go b/node/stmt/n_declare.go index 7cb7c91..1b71c9c 100644 --- a/node/stmt/n_declare.go +++ b/node/stmt/n_declare.go @@ -1,6 +1,7 @@ package stmt import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // Declare node type Declare struct { + Comments []*comment.Comment Position *position.Position Consts []node.Node Stmt node.Node @@ -31,6 +33,17 @@ func (n *Declare) GetPosition() *position.Position { return n.Position } +func (n *Declare) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *Declare) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *Declare) Attributes() map[string]interface{} { return nil diff --git a/node/stmt/n_default.go b/node/stmt/n_default.go index b5403e4..8c34e50 100644 --- a/node/stmt/n_default.go +++ b/node/stmt/n_default.go @@ -1,6 +1,7 @@ package stmt import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // Default node type Default struct { + Comments []*comment.Comment Position *position.Position Stmts []node.Node } @@ -29,6 +31,17 @@ func (n *Default) GetPosition() *position.Position { return n.Position } +func (n *Default) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *Default) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *Default) Attributes() map[string]interface{} { return nil diff --git a/node/stmt/n_do.go b/node/stmt/n_do.go index 845ab04..4786d07 100644 --- a/node/stmt/n_do.go +++ b/node/stmt/n_do.go @@ -1,6 +1,7 @@ package stmt import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // Do node type Do struct { + Comments []*comment.Comment Position *position.Position Stmt node.Node Cond node.Node @@ -31,6 +33,17 @@ func (n *Do) GetPosition() *position.Position { return n.Position } +func (n *Do) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *Do) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *Do) Attributes() map[string]interface{} { return nil diff --git a/node/stmt/n_echo.go b/node/stmt/n_echo.go index 24f1b2e..5e61660 100644 --- a/node/stmt/n_echo.go +++ b/node/stmt/n_echo.go @@ -1,6 +1,7 @@ package stmt import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // Echo node type Echo struct { + Comments []*comment.Comment Position *position.Position Exprs []node.Node } @@ -29,6 +31,17 @@ func (n *Echo) GetPosition() *position.Position { return n.Position } +func (n *Echo) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *Echo) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *Echo) Attributes() map[string]interface{} { return nil diff --git a/node/stmt/n_else.go b/node/stmt/n_else.go index e493a85..d97438a 100644 --- a/node/stmt/n_else.go +++ b/node/stmt/n_else.go @@ -1,6 +1,7 @@ package stmt import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // Else node type Else struct { + Comments []*comment.Comment Position *position.Position Stmt node.Node } @@ -29,6 +31,17 @@ func (n *Else) GetPosition() *position.Position { return n.Position } +func (n *Else) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *Else) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *Else) Attributes() map[string]interface{} { return nil diff --git a/node/stmt/n_else_if.go b/node/stmt/n_else_if.go index 321f253..06b6dbc 100644 --- a/node/stmt/n_else_if.go +++ b/node/stmt/n_else_if.go @@ -1,6 +1,7 @@ package stmt import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // ElseIf node type ElseIf struct { + Comments []*comment.Comment Position *position.Position Cond node.Node Stmt node.Node @@ -31,6 +33,17 @@ func (n *ElseIf) GetPosition() *position.Position { return n.Position } +func (n *ElseIf) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *ElseIf) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *ElseIf) Attributes() map[string]interface{} { return nil diff --git a/node/stmt/n_expression.go b/node/stmt/n_expression.go index 1c8d127..87d3fbd 100644 --- a/node/stmt/n_expression.go +++ b/node/stmt/n_expression.go @@ -1,6 +1,7 @@ package stmt import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // Expression node type Expression struct { + Comments []*comment.Comment Position *position.Position Expr node.Node } @@ -29,6 +31,17 @@ func (n *Expression) GetPosition() *position.Position { return n.Position } +func (n *Expression) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *Expression) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *Expression) Attributes() map[string]interface{} { return nil diff --git a/node/stmt/n_finally.go b/node/stmt/n_finally.go index 588098c..333e0fe 100644 --- a/node/stmt/n_finally.go +++ b/node/stmt/n_finally.go @@ -1,6 +1,7 @@ package stmt import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // Finally node type Finally struct { + Comments []*comment.Comment Position *position.Position Stmts []node.Node } @@ -29,6 +31,17 @@ func (n *Finally) GetPosition() *position.Position { return n.Position } +func (n *Finally) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *Finally) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *Finally) Attributes() map[string]interface{} { return nil diff --git a/node/stmt/n_for.go b/node/stmt/n_for.go index 940ba28..b4f8477 100644 --- a/node/stmt/n_for.go +++ b/node/stmt/n_for.go @@ -1,6 +1,7 @@ package stmt import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // For node type For struct { + Comments []*comment.Comment Position *position.Position Init []node.Node Cond []node.Node @@ -35,6 +37,17 @@ func (n *For) GetPosition() *position.Position { return n.Position } +func (n *For) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *For) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *For) Attributes() map[string]interface{} { return nil diff --git a/node/stmt/n_foreach.go b/node/stmt/n_foreach.go index 6410784..acea5f0 100644 --- a/node/stmt/n_foreach.go +++ b/node/stmt/n_foreach.go @@ -1,6 +1,7 @@ package stmt import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // Foreach node type Foreach struct { + Comments []*comment.Comment Position *position.Position Expr node.Node Key node.Node @@ -35,6 +37,17 @@ func (n *Foreach) GetPosition() *position.Position { return n.Position } +func (n *Foreach) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *Foreach) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *Foreach) Attributes() map[string]interface{} { return nil diff --git a/node/stmt/n_function.go b/node/stmt/n_function.go index f9984a8..eb62219 100644 --- a/node/stmt/n_function.go +++ b/node/stmt/n_function.go @@ -1,6 +1,7 @@ package stmt import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // Function node type Function struct { + Comments []*comment.Comment Position *position.Position ReturnsRef bool PhpDocComment string @@ -39,6 +41,17 @@ func (n *Function) GetPosition() *position.Position { return n.Position } +func (n *Function) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *Function) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *Function) Attributes() map[string]interface{} { // return n.attributes diff --git a/node/stmt/n_global.go b/node/stmt/n_global.go index d82c6a6..51c8deb 100644 --- a/node/stmt/n_global.go +++ b/node/stmt/n_global.go @@ -1,6 +1,7 @@ package stmt import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // Global node type Global struct { + Comments []*comment.Comment Position *position.Position Vars []node.Node } @@ -29,6 +31,17 @@ func (n *Global) GetPosition() *position.Position { return n.Position } +func (n *Global) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *Global) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *Global) Attributes() map[string]interface{} { return nil diff --git a/node/stmt/n_goto.go b/node/stmt/n_goto.go index df33bc1..f5d12ad 100644 --- a/node/stmt/n_goto.go +++ b/node/stmt/n_goto.go @@ -1,6 +1,7 @@ package stmt import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // Goto node type Goto struct { + Comments []*comment.Comment Position *position.Position Label node.Node } @@ -29,6 +31,17 @@ func (n *Goto) GetPosition() *position.Position { return n.Position } +func (n *Goto) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *Goto) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *Goto) Attributes() map[string]interface{} { return nil diff --git a/node/stmt/n_group_use.go b/node/stmt/n_group_use.go index 361ec67..e3f5946 100644 --- a/node/stmt/n_group_use.go +++ b/node/stmt/n_group_use.go @@ -1,6 +1,7 @@ package stmt import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // GroupUse node type GroupUse struct { + Comments []*comment.Comment Position *position.Position UseType node.Node Prefix node.Node @@ -33,6 +35,17 @@ func (n *GroupUse) GetPosition() *position.Position { return n.Position } +func (n *GroupUse) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *GroupUse) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *GroupUse) Attributes() map[string]interface{} { return nil diff --git a/node/stmt/n_halt_compiler.go b/node/stmt/n_halt_compiler.go index f1d6395..3b4e856 100644 --- a/node/stmt/n_halt_compiler.go +++ b/node/stmt/n_halt_compiler.go @@ -1,12 +1,14 @@ package stmt import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" ) // HaltCompiler node type HaltCompiler struct { + Comments []*comment.Comment Position *position.Position } @@ -25,6 +27,17 @@ func (n *HaltCompiler) GetPosition() *position.Position { return n.Position } +func (n *HaltCompiler) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *HaltCompiler) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *HaltCompiler) Attributes() map[string]interface{} { return nil diff --git a/node/stmt/n_if.go b/node/stmt/n_if.go index 5b14608..eb39917 100644 --- a/node/stmt/n_if.go +++ b/node/stmt/n_if.go @@ -1,6 +1,7 @@ package stmt import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // If node type If struct { + Comments []*comment.Comment Position *position.Position Cond node.Node Stmt node.Node @@ -35,6 +37,17 @@ func (n *If) GetPosition() *position.Position { return n.Position } +func (n *If) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *If) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *If) Attributes() map[string]interface{} { return nil diff --git a/node/stmt/n_inline_html.go b/node/stmt/n_inline_html.go index cf3b467..d16f45d 100644 --- a/node/stmt/n_inline_html.go +++ b/node/stmt/n_inline_html.go @@ -1,12 +1,14 @@ package stmt import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" ) // InlineHtml node type InlineHtml struct { + Comments []*comment.Comment Position *position.Position Value string } @@ -28,6 +30,17 @@ func (n *InlineHtml) GetPosition() *position.Position { return n.Position } +func (n *InlineHtml) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *InlineHtml) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *InlineHtml) Attributes() map[string]interface{} { return map[string]interface{}{ diff --git a/node/stmt/n_interface.go b/node/stmt/n_interface.go index 7d9029a..0a5d0fc 100644 --- a/node/stmt/n_interface.go +++ b/node/stmt/n_interface.go @@ -1,6 +1,7 @@ package stmt import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // Interface node type Interface struct { + Comments []*comment.Comment Position *position.Position PhpDocComment string InterfaceName node.Node @@ -35,6 +37,17 @@ func (n *Interface) GetPosition() *position.Position { return n.Position } +func (n *Interface) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *Interface) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *Interface) Attributes() map[string]interface{} { return map[string]interface{}{ diff --git a/node/stmt/n_interface_extends.go b/node/stmt/n_interface_extends.go index 3bab9ae..7422a67 100644 --- a/node/stmt/n_interface_extends.go +++ b/node/stmt/n_interface_extends.go @@ -1,6 +1,7 @@ package stmt import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // InterfaceExtends node type InterfaceExtends struct { + Comments []*comment.Comment Position *position.Position InterfaceNames []node.Node } @@ -29,6 +31,17 @@ func (n *InterfaceExtends) GetPosition() *position.Position { return n.Position } +func (n *InterfaceExtends) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *InterfaceExtends) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *InterfaceExtends) Attributes() map[string]interface{} { return nil diff --git a/node/stmt/n_label.go b/node/stmt/n_label.go index 76b6daa..d337797 100644 --- a/node/stmt/n_label.go +++ b/node/stmt/n_label.go @@ -1,6 +1,7 @@ package stmt import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // Label node type Label struct { + Comments []*comment.Comment Position *position.Position LabelName node.Node } @@ -29,6 +31,17 @@ func (n *Label) GetPosition() *position.Position { return n.Position } +func (n *Label) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *Label) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *Label) Attributes() map[string]interface{} { return nil diff --git a/node/stmt/n_namespace.go b/node/stmt/n_namespace.go index 2e643b4..96b4fea 100644 --- a/node/stmt/n_namespace.go +++ b/node/stmt/n_namespace.go @@ -1,6 +1,7 @@ package stmt import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // Namespace node type Namespace struct { + Comments []*comment.Comment Position *position.Position NamespaceName node.Node Stmts []node.Node @@ -31,6 +33,17 @@ func (n *Namespace) GetPosition() *position.Position { return n.Position } +func (n *Namespace) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *Namespace) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *Namespace) Attributes() map[string]interface{} { return nil diff --git a/node/stmt/n_nop.go b/node/stmt/n_nop.go index 26e460c..e5d92dd 100644 --- a/node/stmt/n_nop.go +++ b/node/stmt/n_nop.go @@ -1,12 +1,14 @@ package stmt import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" ) // Nop node type Nop struct { + Comments []*comment.Comment Position *position.Position } @@ -25,6 +27,17 @@ func (n *Nop) GetPosition() *position.Position { return n.Position } +func (n *Nop) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *Nop) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *Nop) Attributes() map[string]interface{} { return nil diff --git a/node/stmt/n_property.go b/node/stmt/n_property.go index 9693e67..0e02bcc 100644 --- a/node/stmt/n_property.go +++ b/node/stmt/n_property.go @@ -1,6 +1,7 @@ package stmt import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // Property node type Property struct { + Comments []*comment.Comment Position *position.Position PhpDocComment string Variable node.Node @@ -33,6 +35,17 @@ func (n *Property) GetPosition() *position.Position { return n.Position } +func (n *Property) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *Property) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *Property) Attributes() map[string]interface{} { return map[string]interface{}{ diff --git a/node/stmt/n_property_list.go b/node/stmt/n_property_list.go index 8710d0c..ba2af4b 100644 --- a/node/stmt/n_property_list.go +++ b/node/stmt/n_property_list.go @@ -1,6 +1,7 @@ package stmt import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // PropertyList node type PropertyList struct { + Comments []*comment.Comment Position *position.Position Modifiers []node.Node Properties []node.Node @@ -31,6 +33,17 @@ func (n *PropertyList) GetPosition() *position.Position { return n.Position } +func (n *PropertyList) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *PropertyList) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *PropertyList) Attributes() map[string]interface{} { return nil diff --git a/node/stmt/n_return.go b/node/stmt/n_return.go index 92b3273..5b5fe1e 100644 --- a/node/stmt/n_return.go +++ b/node/stmt/n_return.go @@ -1,6 +1,7 @@ package stmt import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // Return node type Return struct { + Comments []*comment.Comment Position *position.Position Expr node.Node } @@ -29,6 +31,17 @@ func (n *Return) GetPosition() *position.Position { return n.Position } +func (n *Return) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *Return) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *Return) Attributes() map[string]interface{} { return nil diff --git a/node/stmt/n_static.go b/node/stmt/n_static.go index e4bc183..717bfd3 100644 --- a/node/stmt/n_static.go +++ b/node/stmt/n_static.go @@ -1,6 +1,7 @@ package stmt import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // Static node type Static struct { + Comments []*comment.Comment Position *position.Position Vars []node.Node } @@ -29,6 +31,17 @@ func (n *Static) GetPosition() *position.Position { return n.Position } +func (n *Static) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *Static) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *Static) Attributes() map[string]interface{} { return nil diff --git a/node/stmt/n_static_var.go b/node/stmt/n_static_var.go index 5dda91e..6ee8ef6 100644 --- a/node/stmt/n_static_var.go +++ b/node/stmt/n_static_var.go @@ -1,6 +1,7 @@ package stmt import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // StaticVar node type StaticVar struct { + Comments []*comment.Comment Position *position.Position Variable node.Node Expr node.Node @@ -31,6 +33,17 @@ func (n *StaticVar) GetPosition() *position.Position { return n.Position } +func (n *StaticVar) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *StaticVar) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *StaticVar) Attributes() map[string]interface{} { return nil diff --git a/node/stmt/n_stmt_list.go b/node/stmt/n_stmt_list.go index 3b012e0..ae3e699 100644 --- a/node/stmt/n_stmt_list.go +++ b/node/stmt/n_stmt_list.go @@ -1,6 +1,7 @@ package stmt import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // StmtList node type StmtList struct { + Comments []*comment.Comment Position *position.Position Stmts []node.Node } @@ -29,6 +31,17 @@ func (n *StmtList) GetPosition() *position.Position { return n.Position } +func (n *StmtList) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *StmtList) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *StmtList) Attributes() map[string]interface{} { return nil diff --git a/node/stmt/n_switch.go b/node/stmt/n_switch.go index e4e9f7e..c8ff240 100644 --- a/node/stmt/n_switch.go +++ b/node/stmt/n_switch.go @@ -1,6 +1,7 @@ package stmt import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // Switch node type Switch struct { + Comments []*comment.Comment Position *position.Position Cond node.Node CaseList *CaseList @@ -31,6 +33,17 @@ func (n *Switch) GetPosition() *position.Position { return n.Position } +func (n *Switch) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *Switch) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *Switch) Attributes() map[string]interface{} { return nil diff --git a/node/stmt/n_throw.go b/node/stmt/n_throw.go index 7788ac5..aa4caef 100644 --- a/node/stmt/n_throw.go +++ b/node/stmt/n_throw.go @@ -1,6 +1,7 @@ package stmt import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // Throw node type Throw struct { + Comments []*comment.Comment Position *position.Position Expr node.Node } @@ -29,6 +31,17 @@ func (n *Throw) GetPosition() *position.Position { return n.Position } +func (n *Throw) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *Throw) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *Throw) Attributes() map[string]interface{} { return nil diff --git a/node/stmt/n_trait.go b/node/stmt/n_trait.go index a3531e6..8c8a3cd 100644 --- a/node/stmt/n_trait.go +++ b/node/stmt/n_trait.go @@ -1,6 +1,7 @@ package stmt import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // Trait node type Trait struct { + Comments []*comment.Comment Position *position.Position PhpDocComment string TraitName node.Node @@ -33,6 +35,17 @@ func (n *Trait) GetPosition() *position.Position { return n.Position } +func (n *Trait) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *Trait) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *Trait) Attributes() map[string]interface{} { return map[string]interface{}{ diff --git a/node/stmt/n_trait_adaptation_list.go b/node/stmt/n_trait_adaptation_list.go index 427781e..80d6902 100644 --- a/node/stmt/n_trait_adaptation_list.go +++ b/node/stmt/n_trait_adaptation_list.go @@ -1,6 +1,7 @@ package stmt import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // TraitAdaptationList node type TraitAdaptationList struct { + Comments []*comment.Comment Position *position.Position Adaptations []node.Node } @@ -29,6 +31,17 @@ func (n *TraitAdaptationList) GetPosition() *position.Position { return n.Position } +func (n *TraitAdaptationList) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *TraitAdaptationList) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *TraitAdaptationList) Attributes() map[string]interface{} { return nil diff --git a/node/stmt/n_trait_method_ref.go b/node/stmt/n_trait_method_ref.go index 9557883..9f7cd1f 100644 --- a/node/stmt/n_trait_method_ref.go +++ b/node/stmt/n_trait_method_ref.go @@ -1,6 +1,7 @@ package stmt import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // TraitMethodRef node type TraitMethodRef struct { + Comments []*comment.Comment Position *position.Position Trait node.Node Method node.Node @@ -31,6 +33,17 @@ func (n *TraitMethodRef) GetPosition() *position.Position { return n.Position } +func (n *TraitMethodRef) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *TraitMethodRef) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *TraitMethodRef) Attributes() map[string]interface{} { return nil diff --git a/node/stmt/n_trait_use.go b/node/stmt/n_trait_use.go index 2091c8e..1c5b49a 100644 --- a/node/stmt/n_trait_use.go +++ b/node/stmt/n_trait_use.go @@ -1,6 +1,7 @@ package stmt import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // TraitUse node type TraitUse struct { + Comments []*comment.Comment Position *position.Position Traits []node.Node TraitAdaptationList *TraitAdaptationList @@ -31,6 +33,17 @@ func (n *TraitUse) GetPosition() *position.Position { return n.Position } +func (n *TraitUse) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *TraitUse) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *TraitUse) Attributes() map[string]interface{} { return nil diff --git a/node/stmt/n_trait_use_alias.go b/node/stmt/n_trait_use_alias.go index 76f4ec2..32c311b 100644 --- a/node/stmt/n_trait_use_alias.go +++ b/node/stmt/n_trait_use_alias.go @@ -1,6 +1,7 @@ package stmt import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // TraitUseAlias node type TraitUseAlias struct { + Comments []*comment.Comment Position *position.Position Ref node.Node Modifier node.Node @@ -33,6 +35,17 @@ func (n *TraitUseAlias) GetPosition() *position.Position { return n.Position } +func (n *TraitUseAlias) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *TraitUseAlias) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *TraitUseAlias) Attributes() map[string]interface{} { return nil diff --git a/node/stmt/n_trait_use_precedence.go b/node/stmt/n_trait_use_precedence.go index 567711e..24f388c 100644 --- a/node/stmt/n_trait_use_precedence.go +++ b/node/stmt/n_trait_use_precedence.go @@ -1,6 +1,7 @@ package stmt import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // TraitUsePrecedence node type TraitUsePrecedence struct { + Comments []*comment.Comment Position *position.Position Ref node.Node Insteadof []node.Node @@ -31,6 +33,17 @@ func (n *TraitUsePrecedence) GetPosition() *position.Position { return n.Position } +func (n *TraitUsePrecedence) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *TraitUsePrecedence) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *TraitUsePrecedence) Attributes() map[string]interface{} { return nil diff --git a/node/stmt/n_try.go b/node/stmt/n_try.go index 08eb36f..865f6d4 100644 --- a/node/stmt/n_try.go +++ b/node/stmt/n_try.go @@ -1,6 +1,7 @@ package stmt import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // Try node type Try struct { + Comments []*comment.Comment Position *position.Position Stmts []node.Node Catches []node.Node @@ -33,6 +35,17 @@ func (n *Try) GetPosition() *position.Position { return n.Position } +func (n *Try) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *Try) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *Try) Attributes() map[string]interface{} { return nil diff --git a/node/stmt/n_unset.go b/node/stmt/n_unset.go index 995b123..d7480a2 100644 --- a/node/stmt/n_unset.go +++ b/node/stmt/n_unset.go @@ -1,6 +1,7 @@ package stmt import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // Unset node type Unset struct { + Comments []*comment.Comment Position *position.Position Vars []node.Node } @@ -29,6 +31,17 @@ func (n *Unset) GetPosition() *position.Position { return n.Position } +func (n *Unset) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *Unset) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *Unset) Attributes() map[string]interface{} { return nil diff --git a/node/stmt/n_use.go b/node/stmt/n_use.go index e484ca0..fd46664 100644 --- a/node/stmt/n_use.go +++ b/node/stmt/n_use.go @@ -1,6 +1,7 @@ package stmt import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // Use node type Use struct { + Comments []*comment.Comment Position *position.Position UseType node.Node Use node.Node @@ -33,6 +35,17 @@ func (n *Use) GetPosition() *position.Position { return n.Position } +func (n *Use) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *Use) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *Use) Attributes() map[string]interface{} { return nil diff --git a/node/stmt/n_use_list.go b/node/stmt/n_use_list.go index 34cb005..6dbf295 100644 --- a/node/stmt/n_use_list.go +++ b/node/stmt/n_use_list.go @@ -1,6 +1,7 @@ package stmt import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // UseList node type UseList struct { + Comments []*comment.Comment Position *position.Position UseType node.Node Uses []node.Node @@ -31,6 +33,17 @@ func (n *UseList) GetPosition() *position.Position { return n.Position } +func (n *UseList) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *UseList) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *UseList) Attributes() map[string]interface{} { return nil diff --git a/node/stmt/n_while.go b/node/stmt/n_while.go index efd1131..2252928 100644 --- a/node/stmt/n_while.go +++ b/node/stmt/n_while.go @@ -1,6 +1,7 @@ package stmt import ( + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -8,6 +9,7 @@ import ( // While node type While struct { + Comments []*comment.Comment Position *position.Position Cond node.Node Stmt node.Node @@ -31,6 +33,17 @@ func (n *While) GetPosition() *position.Position { return n.Position } +func (n *While) AddComments(cc []*comment.Comment, tn comment.TokenName) { + for _, c := range cc { + c.SetTokenName(tn) + } + n.Comments = append(n.Comments, cc...) +} + +func (n *While) GetComments() []*comment.Comment { + return n.Comments +} + // Attributes returns node attributes as map func (n *While) Attributes() map[string]interface{} { return nil diff --git a/node/t_node_test.go b/node/t_node_test.go index 8f66023..374dc6a 100644 --- a/node/t_node_test.go +++ b/node/t_node_test.go @@ -5,6 +5,7 @@ import ( "reflect" "testing" + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node/name" "github.com/z7zmey/php-parser/position" @@ -148,8 +149,8 @@ func TestPhp7ArgumentNode(t *testing.T) { StartPos: 11, EndPos: 12, }, - IsReference: false, Variadic: false, + IsReference: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 2, @@ -351,8 +352,8 @@ func TestPhp7ArgumentNode(t *testing.T) { StartPos: 54, EndPos: 55, }, - Variadic: false, IsReference: false, + Variadic: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 4, @@ -486,8 +487,8 @@ func TestPhp7ArgumentNode(t *testing.T) { StartPos: 81, EndPos: 85, }, - IsReference: false, Variadic: true, + IsReference: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 5, @@ -565,8 +566,8 @@ func TestPhp7ArgumentNode(t *testing.T) { StartPos: 101, EndPos: 102, }, - IsReference: false, Variadic: false, + IsReference: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 6, @@ -729,6 +730,18 @@ func TestPhp7ArgumentNode(t *testing.T) { StartPos: 162, EndPos: 185, }, + Comments: []*comment.Comment{ + { + Position: &position.Position{ + StartLine: 8, + EndLine: 8, + StartPos: 137, + EndPos: 158, + }, + Value: "/** anonymous class */", + TokenName: 'O', + }, + }, Class: &stmt.Class{ Position: &position.Position{ StartLine: 9, diff --git a/php5/php5.go b/php5/php5.go index 2c5bfad..87693f8 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -346,8 +346,7 @@ const yyEofCode = 1 const yyErrCode = 2 const yyInitialStackSize = 16 -//line php5/php5.y:6783 - +//line php5/php5.y:6785 type simpleIndirectReference struct { all []*expr.Variable last *expr.Variable @@ -2362,7 +2361,7 @@ yydefault: namePart.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(namePart, yyDollar[1].token, comment.StringToken) + namePart.AddComments(yyDollar[1].token.Comments, comment.StringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2377,8 +2376,8 @@ yydefault: namePart.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.NsSeparatorToken) - yylex.(*Parser).comments.AddFromToken(namePart, yyDollar[3].token, comment.StringToken) + lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.NsSeparatorToken) + namePart.AddComments(yyDollar[3].token.Comments, comment.StringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2425,10 +2424,10 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.HaltCompilerToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.CloseParenthesisToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.SemiColonToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.HaltCompilerToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenParenthesisToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.CloseParenthesisToken) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2444,8 +2443,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.NamespaceToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.SemiColonToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.NamespaceToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2461,9 +2460,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[5].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.NamespaceToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[5].token, comment.CloseCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.NamespaceToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.OpenCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[5].token.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2477,9 +2476,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.NamespaceToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.NamespaceToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2493,8 +2492,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.UseToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.SemiColonToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.UseToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2510,9 +2509,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.UseToken) - yylex.(*Parser).comments.AddFromToken(useType, yyDollar[2].token, comment.UseToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.SemiColonToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.UseToken) + useType.AddComments(yyDollar[2].token.Comments, comment.UseToken) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2528,9 +2527,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.UseToken) - yylex.(*Parser).comments.AddFromToken(useType, yyDollar[2].token, comment.UseToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.SemiColonToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.UseToken) + useType.AddComments(yyDollar[2].token.Comments, comment.UseToken) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2544,7 +2543,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.SemiColonToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2555,7 +2554,7 @@ yydefault: yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) + lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2594,8 +2593,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition(yyDollar[1].list, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.AsToken) - yylex.(*Parser).comments.AddFromToken(alias, yyDollar[3].token, comment.StringToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.AsToken) + alias.AddComments(yyDollar[3].token.Comments, comment.StringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2611,7 +2610,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.NsSeparatorToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.NsSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2629,9 +2628,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition(yyDollar[2].list, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.NsSeparatorToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.AsToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.StringToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.NsSeparatorToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.AsToken) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.StringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2642,7 +2641,7 @@ yydefault: yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) + lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2681,8 +2680,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition(yyDollar[1].list, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.AsToken) - yylex.(*Parser).comments.AddFromToken(alias, yyDollar[3].token, comment.StringToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.AsToken) + alias.AddComments(yyDollar[3].token.Comments, comment.StringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2698,7 +2697,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.NsSeparatorToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.NsSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2716,9 +2715,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition(yyDollar[2].list, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.NsSeparatorToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.AsToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.StringToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.NsSeparatorToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.AsToken) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.StringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2729,7 +2728,7 @@ yydefault: yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) + lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2768,8 +2767,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition(yyDollar[1].list, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.AsToken) - yylex.(*Parser).comments.AddFromToken(alias, yyDollar[3].token, comment.StringToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.AsToken) + alias.AddComments(yyDollar[3].token.Comments, comment.StringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2785,7 +2784,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.NsSeparatorToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.NsSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2803,9 +2802,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition(yyDollar[2].list, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.NsSeparatorToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.AsToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.StringToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.NsSeparatorToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.AsToken) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.StringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2825,9 +2824,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeNodeListPosition(yyDollar[1].node, constList.Consts)) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode(constList.Consts), yyDollar[2].token, comment.CommaToken) - yylex.(*Parser).comments.AddFromToken(name, yyDollar[3].token, comment.StringToken) - yylex.(*Parser).comments.AddFromToken(constant, yyDollar[4].token, comment.EqualToken) + lastNode(constList.Consts).AddComments(yyDollar[2].token.Comments, comment.CommaToken) + name.AddComments(yyDollar[3].token.Comments, comment.StringToken) + constant.AddComments(yyDollar[4].token.Comments, comment.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2846,9 +2845,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, constList)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ConstToken) - yylex.(*Parser).comments.AddFromToken(name, yyDollar[2].token, comment.StringToken) - yylex.(*Parser).comments.AddFromToken(constant, yyDollar[3].token, comment.EqualToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ConstToken) + name.AddComments(yyDollar[2].token.Comments, comment.StringToken) + constant.AddComments(yyDollar[3].token.Comments, comment.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2913,10 +2912,10 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.HaltCompilerToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.CloseParenthesisToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.SemiColonToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.HaltCompilerToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenParenthesisToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.CloseParenthesisToken) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2940,8 +2939,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - yylex.(*Parser).comments.AddFromToken(label, yyDollar[1].token, comment.StringToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.ColonToken) + label.AddComments(yyDollar[1].token.Comments, comment.StringToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.ColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2955,8 +2954,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.CloseCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.OpenCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2976,7 +2975,7 @@ yydefault: } // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.IfToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.IfToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2992,10 +2991,10 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[8].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.IfToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.ColonToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[7].token, comment.EndifToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[8].token, comment.SemiColonToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.IfToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.ColonToken) + yyVAL.node.AddComments(yyDollar[7].token.Comments, comment.EndifToken) + yyVAL.node.AddComments(yyDollar[8].token.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3016,7 +3015,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.WhileToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.WhileToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3030,9 +3029,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[5].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.DoToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.WhileToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[5].token, comment.SemiColonToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.DoToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.WhileToken) + yyVAL.node.AddComments(yyDollar[5].token.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3057,11 +3056,11 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[9].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ForToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.ForInitSemicolonToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[6].token, comment.ForCondSemicolonToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[8].token, comment.CloseParenthesisToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ForToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenParenthesisToken) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.ForInitSemicolonToken) + yyVAL.node.AddComments(yyDollar[6].token.Comments, comment.ForCondSemicolonToken) + yyVAL.node.AddComments(yyDollar[8].token.Comments, comment.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3084,7 +3083,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.SwitchToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.SwitchToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3098,8 +3097,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.BreakToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.SemiColonToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.BreakToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3113,8 +3112,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.BreakToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.SemiColonToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.BreakToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3128,8 +3127,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ContinueToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.SemiColonToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ContinueToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3143,8 +3142,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ContinueToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.SemiColonToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ContinueToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3158,8 +3157,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ReturnToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.SemiColonToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ReturnToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3173,8 +3172,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ReturnToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.SemiColonToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ReturnToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3188,8 +3187,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ReturnToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.SemiColonToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ReturnToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3203,7 +3202,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.SemiColonToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3217,8 +3216,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.GlobalToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.SemiColonToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.GlobalToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3232,8 +3231,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.StaticToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.SemiColonToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.StaticToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3247,8 +3246,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.EchoToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.SemiColonToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.EchoToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3262,7 +3261,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.InlineHTMLToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.InlineHTMLToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3276,7 +3275,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.SemiColonToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3290,10 +3289,10 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[5].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.UnsetToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseParenthesisToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[5].token, comment.SemiColonToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.UnsetToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenParenthesisToken) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseParenthesisToken) + yyVAL.node.AddComments(yyDollar[5].token.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3329,10 +3328,10 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[8].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ForeachToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.AsToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[7].token, comment.CloseParenthesisToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ForeachToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenParenthesisToken) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.AsToken) + yyVAL.node.AddComments(yyDollar[7].token.Comments, comment.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3368,10 +3367,10 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[8].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ForeachToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.AsToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[7].token, comment.CloseParenthesisToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ForeachToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenParenthesisToken) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.AsToken) + yyVAL.node.AddComments(yyDollar[7].token.Comments, comment.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3385,9 +3384,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[5].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.DeclareToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseParenthesisToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.DeclareToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenParenthesisToken) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3401,7 +3400,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.SemiColonToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3419,9 +3418,9 @@ yydefault: } // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.TryToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.TryToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3435,8 +3434,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ThrowToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.SemiColonToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ThrowToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3452,9 +3451,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.GotoToken) - yylex.(*Parser).comments.AddFromToken(label, yyDollar[2].token, comment.StringToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.SemiColonToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.GotoToken) + label.AddComments(yyDollar[2].token.Comments, comment.StringToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3481,12 +3480,12 @@ yydefault: catch.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[8].token)) // save comments - yylex.(*Parser).comments.AddFromToken(catch, yyDollar[1].token, comment.CatchToken) - yylex.(*Parser).comments.AddFromToken(catch, yyDollar[2].token, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken(variable, yyDollar[4].token, comment.StringToken) - yylex.(*Parser).comments.AddFromToken(catch, yyDollar[5].token, comment.CloseParenthesisToken) - yylex.(*Parser).comments.AddFromToken(catch, yyDollar[6].token, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken(catch, yyDollar[8].token, comment.CloseCurlyBracesToken) + catch.AddComments(yyDollar[1].token.Comments, comment.CatchToken) + catch.AddComments(yyDollar[2].token.Comments, comment.OpenParenthesisToken) + variable.AddComments(yyDollar[4].token.Comments, comment.StringToken) + catch.AddComments(yyDollar[5].token.Comments, comment.CloseParenthesisToken) + catch.AddComments(yyDollar[6].token.Comments, comment.OpenCurlyBracesToken) + catch.AddComments(yyDollar[8].token.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3508,9 +3507,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.FinallyToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.FinallyToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3560,12 +3559,12 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[8].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.CatchToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken(variable, yyDollar[4].token, comment.StringToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[5].token, comment.CloseParenthesisToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[6].token, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[8].token, comment.CloseCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.CatchToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenParenthesisToken) + variable.AddComments(yyDollar[4].token.Comments, comment.StringToken) + yyVAL.node.AddComments(yyDollar[5].token.Comments, comment.CloseParenthesisToken) + yyVAL.node.AddComments(yyDollar[6].token.Comments, comment.OpenCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[8].token.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3584,7 +3583,7 @@ yydefault: yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) + lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3648,15 +3647,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[9].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.FunctionToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.FunctionToken) if yyDollar[2].token != nil { - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.AmpersandToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.AmpersandToken) } - yylex.(*Parser).comments.AddFromToken(name, yyDollar[3].token, comment.StringToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[6].token, comment.CloseParenthesisToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[7].token, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[9].token, comment.CloseCurlyBracesToken) + name.AddComments(yyDollar[3].token.Comments, comment.StringToken) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.OpenParenthesisToken) + yyVAL.node.AddComments(yyDollar[6].token.Comments, comment.CloseParenthesisToken) + yyVAL.node.AddComments(yyDollar[7].token.Comments, comment.OpenCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[9].token.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3684,9 +3683,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[7].token)) // save comments - yylex.(*Parser).comments.AddFromToken(name, yyDollar[2].token, comment.StringToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[5].token, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[7].token, comment.CloseCurlyBracesToken) + name.AddComments(yyDollar[2].token.Comments, comment.StringToken) + yyVAL.node.AddComments(yyDollar[5].token.Comments, comment.OpenCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[7].token.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3702,9 +3701,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[6].token)) // save comments - yylex.(*Parser).comments.AddFromToken(name, yyDollar[2].token, comment.StringToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[6].token, comment.CloseCurlyBracesToken) + name.AddComments(yyDollar[2].token.Comments, comment.StringToken) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.OpenCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[6].token.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3718,7 +3717,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ClassToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ClassToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3734,8 +3733,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - yylex.(*Parser).comments.AddFromToken(classModifier, yyDollar[1].token, comment.AbstractToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.ClassToken) + classModifier.AddComments(yyDollar[1].token.Comments, comment.AbstractToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.ClassToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3749,7 +3748,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.TraitToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.TraitToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3765,8 +3764,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - yylex.(*Parser).comments.AddFromToken(classModifier, yyDollar[1].token, comment.FinalToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.ClassToken) + classModifier.AddComments(yyDollar[1].token.Comments, comment.FinalToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.ClassToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3788,7 +3787,7 @@ yydefault: yyVAL.ClassExtends.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.ClassExtends, yyDollar[1].token, comment.ExtendsToken) + yyVAL.ClassExtends.AddComments(yyDollar[1].token.Comments, comment.ExtendsToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3816,7 +3815,7 @@ yydefault: yyVAL.InterfaceExtends.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.InterfaceExtends, yyDollar[1].token, comment.ExtendsToken) + yyVAL.InterfaceExtends.AddComments(yyDollar[1].token.Comments, comment.ExtendsToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3838,7 +3837,7 @@ yydefault: yyVAL.ClassImplements.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.ClassImplements, yyDollar[1].token, comment.ImplementsToken) + yyVAL.ClassImplements.AddComments(yyDollar[1].token.Comments, comment.ImplementsToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3857,7 +3856,7 @@ yydefault: yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) + lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3876,7 +3875,7 @@ yydefault: yyVAL.node = yyDollar[2].node // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.DoubleArrowToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.DoubleArrowToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3898,7 +3897,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.AmpersandToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.AmpersandToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3912,9 +3911,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ListToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseParenthesisToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ListToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenParenthesisToken) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3941,9 +3940,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ColonToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.EndforToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.SemiColonToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ColonToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.EndforToken) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3970,9 +3969,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ColonToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.EndforeachToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.SemiColonToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ColonToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.EndforeachToken) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3994,9 +3993,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ColonToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.EnddeclareToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.SemiColonToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ColonToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.EnddeclareToken) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4013,8 +4012,8 @@ yydefault: constant.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(name, yyDollar[1].token, comment.StringToken) - yylex.(*Parser).comments.AddFromToken(constant, yyDollar[2].token, comment.EqualToken) + name.AddComments(yyDollar[1].token.Comments, comment.StringToken) + constant.AddComments(yyDollar[2].token.Comments, comment.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4031,9 +4030,9 @@ yydefault: constant.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[3].token, yyDollar[5].node)) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) - yylex.(*Parser).comments.AddFromToken(name, yyDollar[3].token, comment.StringToken) - yylex.(*Parser).comments.AddFromToken(constant, yyDollar[4].token, comment.EqualToken) + lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) + name.AddComments(yyDollar[3].token.Comments, comment.StringToken) + constant.AddComments(yyDollar[4].token.Comments, comment.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4049,8 +4048,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddFromToken(caseList, yyDollar[1].token, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken(caseList, yyDollar[3].token, comment.CloseCurlyBracesToken) + caseList.AddComments(yyDollar[1].token.Comments, comment.OpenCurlyBracesToken) + caseList.AddComments(yyDollar[3].token.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4066,9 +4065,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddFromToken(caseList, yyDollar[1].token, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken(caseList, yyDollar[2].token, comment.SemiColonToken) - yylex.(*Parser).comments.AddFromToken(caseList, yyDollar[4].token, comment.CloseCurlyBracesToken) + caseList.AddComments(yyDollar[1].token.Comments, comment.OpenCurlyBracesToken) + caseList.AddComments(yyDollar[2].token.Comments, comment.SemiColonToken) + caseList.AddComments(yyDollar[4].token.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4084,9 +4083,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddFromToken(caseList, yyDollar[1].token, comment.ColonToken) - yylex.(*Parser).comments.AddFromToken(caseList, yyDollar[3].token, comment.EndswitchToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.SemiColonToken) + caseList.AddComments(yyDollar[1].token.Comments, comment.ColonToken) + caseList.AddComments(yyDollar[3].token.Comments, comment.EndswitchToken) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4103,10 +4102,10 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[5].token)) // save comments - yylex.(*Parser).comments.AddFromToken(caseList, yyDollar[1].token, comment.ColonToken) - yylex.(*Parser).comments.AddFromToken(caseList, yyDollar[2].token, comment.SemiColonToken) - yylex.(*Parser).comments.AddFromToken(caseList, yyDollar[4].token, comment.EndswitchToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[5].token, comment.SemiColonToken) + caseList.AddComments(yyDollar[1].token.Comments, comment.ColonToken) + caseList.AddComments(yyDollar[2].token.Comments, comment.SemiColonToken) + caseList.AddComments(yyDollar[4].token.Comments, comment.EndswitchToken) + yyVAL.node.AddComments(yyDollar[5].token.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4129,8 +4128,8 @@ yydefault: _case.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[5].list)) // save comments - yylex.(*Parser).comments.AddFromToken(_case, yyDollar[2].token, comment.CaseToken) - yylex.(*Parser).comments.AddFromToken(_case, yyDollar[4].token, comment.CaseSeparatorToken) + _case.AddComments(yyDollar[2].token.Comments, comment.CaseToken) + _case.AddComments(yyDollar[4].token.Comments, comment.CaseSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4145,8 +4144,8 @@ yydefault: _default.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[4].list)) // save comments - yylex.(*Parser).comments.AddFromToken(_default, yyDollar[2].token, comment.DefaultToken) - yylex.(*Parser).comments.AddFromToken(_default, yyDollar[3].token, comment.CaseSeparatorToken) + _default.AddComments(yyDollar[2].token.Comments, comment.DefaultToken) + _default.AddComments(yyDollar[3].token.Comments, comment.CaseSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4185,9 +4184,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ColonToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.EndwhileToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.SemiColonToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ColonToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.EndwhileToken) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4210,7 +4209,7 @@ yydefault: _elseIf.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[2].token, yyDollar[4].node)) // save comments - yylex.(*Parser).comments.AddFromToken(_elseIf, yyDollar[2].token, comment.ElseifToken) + _elseIf.AddComments(yyDollar[2].token.Comments, comment.ElseifToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4235,8 +4234,8 @@ yydefault: _elseIf.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[5].list)) // save comments - yylex.(*Parser).comments.AddFromToken(_elseIf, yyDollar[2].token, comment.ElseifToken) - yylex.(*Parser).comments.AddFromToken(_elseIf, yyDollar[4].token, comment.ColonToken) + _elseIf.AddComments(yyDollar[2].token.Comments, comment.ElseifToken) + _elseIf.AddComments(yyDollar[4].token.Comments, comment.ColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4258,7 +4257,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ElseToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ElseToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4282,8 +4281,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ElseToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.ColonToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ElseToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.ColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4318,7 +4317,7 @@ yydefault: yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) + lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4345,12 +4344,12 @@ yydefault: // save comments if yyDollar[2].token != nil { - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.AmpersandToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.AmpersandToken) } if yyDollar[3].token != nil { - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.EllipsisToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.EllipsisToken) } - yylex.(*Parser).comments.AddFromToken(variable, yyDollar[4].token, comment.VariableToken) + variable.AddComments(yyDollar[4].token.Comments, comment.VariableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4377,13 +4376,13 @@ yydefault: // save comments if yyDollar[2].token != nil { - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.AmpersandToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.AmpersandToken) } if yyDollar[3].token != nil { - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.EllipsisToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.EllipsisToken) } - yylex.(*Parser).comments.AddFromToken(variable, yyDollar[4].token, comment.VariableToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[5].token, comment.EqualToken) + variable.AddComments(yyDollar[4].token.Comments, comment.VariableToken) + yyVAL.node.AddComments(yyDollar[5].token.Comments, comment.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4405,7 +4404,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ArrayToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ArrayToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4419,7 +4418,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.CallableToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.CallableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4441,8 +4440,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.CloseParenthesisToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.OpenParenthesisToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4456,8 +4455,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.CloseParenthesisToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.OpenParenthesisToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4473,8 +4472,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.CloseParenthesisToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.OpenParenthesisToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4493,7 +4492,7 @@ yydefault: yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) + lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4529,7 +4528,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.AmpersandToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.AmpersandToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4543,7 +4542,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.EllipsisToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.EllipsisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4554,7 +4553,7 @@ yydefault: yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) + lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4578,7 +4577,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.VariableToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.VariableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4592,7 +4591,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.DollarToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.DollarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4606,9 +4605,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.DollarToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.DollarToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4627,8 +4626,8 @@ yydefault: staticVar.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) - yylex.(*Parser).comments.AddFromToken(variable, yyDollar[3].token, comment.VariableToken) + lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) + variable.AddComments(yyDollar[3].token.Comments, comment.VariableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4647,9 +4646,9 @@ yydefault: staticVar.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[3].token, yyDollar[5].node)) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) - yylex.(*Parser).comments.AddFromToken(variable, yyDollar[3].token, comment.VariableToken) - yylex.(*Parser).comments.AddFromToken(staticVar, yyDollar[4].token, comment.EqualToken) + lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) + variable.AddComments(yyDollar[3].token.Comments, comment.VariableToken) + staticVar.AddComments(yyDollar[4].token.Comments, comment.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4668,7 +4667,7 @@ yydefault: staticVar.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(variable, yyDollar[1].token, comment.VariableToken) + variable.AddComments(yyDollar[1].token.Comments, comment.VariableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4687,8 +4686,8 @@ yydefault: staticVar.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(variable, yyDollar[1].token, comment.VariableToken) - yylex.(*Parser).comments.AddFromToken(staticVar, yyDollar[2].token, comment.EqualToken) + variable.AddComments(yyDollar[1].token.Comments, comment.VariableToken) + staticVar.AddComments(yyDollar[2].token.Comments, comment.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4718,7 +4717,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition(yyDollar[1].list, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.SemiColonToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4732,7 +4731,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.SemiColonToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4760,13 +4759,13 @@ yydefault: } // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.FunctionToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.FunctionToken) if yyDollar[3].token != nil { - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.AmpersandToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.AmpersandToken) } - yylex.(*Parser).comments.AddFromToken(name, yyDollar[4].token, comment.IdentifierToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[5].token, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[7].token, comment.CloseParenthesisToken) + name.AddComments(yyDollar[4].token.Comments, comment.IdentifierToken) + yyVAL.node.AddComments(yyDollar[5].token.Comments, comment.OpenParenthesisToken) + yyVAL.node.AddComments(yyDollar[7].token.Comments, comment.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4787,7 +4786,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.UseToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.UseToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4806,7 +4805,7 @@ yydefault: yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) + lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4819,7 +4818,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.SemiColonToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4832,8 +4831,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.CloseCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.OpenCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4876,7 +4875,7 @@ yydefault: yyVAL.node = yyDollar[1].node // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.SemiColonToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4887,7 +4886,7 @@ yydefault: yyVAL.node = yyDollar[1].node // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.SemiColonToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4901,7 +4900,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeNodeListPosition(yyDollar[1].node, yyDollar[3].list)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.InsteadofToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.InsteadofToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4920,7 +4919,7 @@ yydefault: yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) + lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4936,7 +4935,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(name, yyDollar[1].token, comment.IdentifierToken) + name.AddComments(yyDollar[1].token.Comments, comment.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4960,8 +4959,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PaamayimNekudotayimToken) - yylex.(*Parser).comments.AddFromToken(target, yyDollar[3].token, comment.IdentifierToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.PaamayimNekudotayimToken) + target.AddComments(yyDollar[3].token.Comments, comment.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4977,8 +4976,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.AsToken) - yylex.(*Parser).comments.AddFromToken(alias, yyDollar[4].token, comment.IdentifierToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.AsToken) + alias.AddComments(yyDollar[4].token.Comments, comment.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4992,7 +4991,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.AsToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.AsToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5022,7 +5021,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.SemiColonToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5036,8 +5035,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.CloseCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.OpenCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5060,7 +5059,7 @@ yydefault: modifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(modifier, yyDollar[1].token, comment.VarToken) + modifier.AddComments(yyDollar[1].token.Comments, comment.VarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5106,7 +5105,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.PublicToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.PublicToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5120,7 +5119,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ProtectedToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ProtectedToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5134,7 +5133,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.PrivateToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.PrivateToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5148,7 +5147,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.StaticToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.StaticToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5162,7 +5161,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.AbstractToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.AbstractToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5176,7 +5175,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.FinalToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.FinalToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5195,8 +5194,8 @@ yydefault: property.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) - yylex.(*Parser).comments.AddFromToken(variable, yyDollar[3].token, comment.VariableToken) + lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) + variable.AddComments(yyDollar[3].token.Comments, comment.VariableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5215,9 +5214,9 @@ yydefault: property.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[3].token, yyDollar[5].node)) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) - yylex.(*Parser).comments.AddFromToken(variable, yyDollar[3].token, comment.VariableToken) - yylex.(*Parser).comments.AddFromToken(property, yyDollar[4].token, comment.EqualToken) + lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) + variable.AddComments(yyDollar[3].token.Comments, comment.VariableToken) + property.AddComments(yyDollar[4].token.Comments, comment.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5236,7 +5235,7 @@ yydefault: property.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(variable, yyDollar[1].token, comment.VariableToken) + variable.AddComments(yyDollar[1].token.Comments, comment.VariableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5255,8 +5254,8 @@ yydefault: property.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(variable, yyDollar[1].token, comment.VariableToken) - yylex.(*Parser).comments.AddFromToken(property, yyDollar[2].token, comment.EqualToken) + variable.AddComments(yyDollar[1].token.Comments, comment.VariableToken) + property.AddComments(yyDollar[2].token.Comments, comment.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5276,9 +5275,9 @@ yydefault: yyDollar[1].node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[5].node)) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode(constList.Consts), yyDollar[2].token, comment.CommaToken) - yylex.(*Parser).comments.AddFromToken(name, yyDollar[3].token, comment.IdentifierToken) - yylex.(*Parser).comments.AddFromToken(constant, yyDollar[4].token, comment.EqualToken) + lastNode(constList.Consts).AddComments(yyDollar[2].token.Comments, comment.CommaToken) + name.AddComments(yyDollar[3].token.Comments, comment.IdentifierToken) + constant.AddComments(yyDollar[4].token.Comments, comment.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5296,9 +5295,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[4].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ConstToken) - yylex.(*Parser).comments.AddFromToken(name, yyDollar[2].token, comment.IdentifierToken) - yylex.(*Parser).comments.AddFromToken(constant, yyDollar[3].token, comment.EqualToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ConstToken) + name.AddComments(yyDollar[2].token.Comments, comment.IdentifierToken) + constant.AddComments(yyDollar[3].token.Comments, comment.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5309,7 +5308,7 @@ yydefault: yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) + lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5344,7 +5343,7 @@ yydefault: yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) + lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5383,8 +5382,8 @@ yydefault: fetch.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(fetch, yyDollar[2].token, comment.OpenSquareBracket) - yylex.(*Parser).comments.AddFromToken(fetch, yyDollar[4].token, comment.CloseSquareBracket) + fetch.AddComments(yyDollar[2].token.Comments, comment.OpenSquareBracket) + fetch.AddComments(yyDollar[4].token.Comments, comment.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5399,8 +5398,8 @@ yydefault: fetch.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddFromToken(fetch, yyDollar[1].token, comment.OpenSquareBracket) - yylex.(*Parser).comments.AddFromToken(fetch, yyDollar[3].token, comment.CloseSquareBracket) + fetch.AddComments(yyDollar[1].token.Comments, comment.OpenSquareBracket) + fetch.AddComments(yyDollar[3].token.Comments, comment.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5458,7 +5457,7 @@ yydefault: } // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.NewToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.NewToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5474,10 +5473,10 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[6].node)) // save comments - yylex.(*Parser).comments.AddFromToken(list, yyDollar[1].token, comment.ListToken) - yylex.(*Parser).comments.AddFromToken(list, yyDollar[2].token, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken(list, yyDollar[4].token, comment.CloseParenthesisToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[5].token, comment.EqualToken) + list.AddComments(yyDollar[1].token.Comments, comment.ListToken) + list.AddComments(yyDollar[2].token.Comments, comment.OpenParenthesisToken) + list.AddComments(yyDollar[4].token.Comments, comment.CloseParenthesisToken) + yyVAL.node.AddComments(yyDollar[5].token.Comments, comment.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5491,7 +5490,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.EqualToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5505,8 +5504,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.EqualToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.AmpersandToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.EqualToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.AmpersandToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5532,9 +5531,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, _new)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.EqualToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.AmpersandToken) - yylex.(*Parser).comments.AddFromToken(_new, yyDollar[4].token, comment.NewToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.EqualToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.AmpersandToken) + _new.AddComments(yyDollar[4].token.Comments, comment.NewToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5548,7 +5547,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.CloneToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.CloneToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5562,7 +5561,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PlusEqualToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.PlusEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5576,7 +5575,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.MinusEqualToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.MinusEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5590,7 +5589,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.MulEqualToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.MulEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5604,7 +5603,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PowEqualToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.PowEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5618,7 +5617,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.DivEqualToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.DivEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5632,7 +5631,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.ConcatEqualToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.ConcatEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5646,7 +5645,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.ModEqualToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.ModEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5660,7 +5659,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.AndEqualToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.AndEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5674,7 +5673,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OrEqualToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OrEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5688,7 +5687,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.XorEqualToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.XorEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5702,7 +5701,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.SlEqualToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.SlEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5716,7 +5715,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.SrEqualToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.SrEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5730,7 +5729,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.IncToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.IncToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5744,7 +5743,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.IncToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.IncToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5758,7 +5757,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.DecToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.DecToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5772,7 +5771,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.DecToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.DecToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5786,7 +5785,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.BooleanOrToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.BooleanOrToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5800,7 +5799,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.BooleanAndToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.BooleanAndToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5814,7 +5813,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.LogicalOrToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.LogicalOrToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5828,7 +5827,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.LogicalAndToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.LogicalAndToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5842,7 +5841,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.LogicalXorToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.LogicalXorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5856,7 +5855,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.VerticalBarToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.VerticalBarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5870,7 +5869,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.AmpersandToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.AmpersandToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5884,7 +5883,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.CaretToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.CaretToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5898,7 +5897,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.DotToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.DotToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5912,7 +5911,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PlusToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.PlusToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5926,7 +5925,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.MinusToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.MinusToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5940,7 +5939,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.AsteriskToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.AsteriskToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5954,7 +5953,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PowToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.PowToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5968,7 +5967,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.SlashToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.SlashToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5982,7 +5981,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PercentToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.PercentToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5996,7 +5995,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.SlToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.SlToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6010,7 +6009,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.SrToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.SrToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6024,7 +6023,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.PlusToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.PlusToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6038,7 +6037,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.MinusToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.MinusToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6052,7 +6051,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ExclamationMarkToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ExclamationMarkToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6066,7 +6065,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.TildeToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.TildeToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6080,7 +6079,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.IsIdenticalToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.IsIdenticalToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6094,7 +6093,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.IsNotIdenticalToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.IsNotIdenticalToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6108,7 +6107,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.IsEqualToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.IsEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6122,7 +6121,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.IsNotEqualToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.IsNotEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6136,7 +6135,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.LessToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.LessToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6150,7 +6149,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.IsSmallerOrEqualToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.IsSmallerOrEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6164,7 +6163,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.GreaterToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.GreaterToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6178,7 +6177,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.IsGreaterOrEqualToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.IsGreaterOrEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6192,7 +6191,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.InstanceofToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.InstanceofToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6238,8 +6237,8 @@ yydefault: } // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.CloseParenthesisToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.OpenParenthesisToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6253,8 +6252,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[5].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.QuestionMarkToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.ColonToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.QuestionMarkToken) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.ColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6268,8 +6267,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.QuestionMarkToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.ColonToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.QuestionMarkToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.ColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6291,7 +6290,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.IntCastToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.IntCastToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6305,7 +6304,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.DoubleCastToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.DoubleCastToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6319,7 +6318,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.StringCastToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.StringCastToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6333,7 +6332,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ArrayCastToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ArrayCastToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6347,7 +6346,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ObjectCastToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ObjectCastToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6361,7 +6360,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.BoolCastToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.BoolCastToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6375,7 +6374,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.UnsetCastToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.UnsetCastToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6398,12 +6397,14 @@ yydefault: // save position if yyDollar[2].node == nil { yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + } else if yylex.(*Parser).currentToken.Value == ")" { + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yylex.(*Parser).currentToken)) } else { yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) } // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ExitToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ExitToken) if yyDollar[2].node != nil { yylex.(*Parser).comments.AddFromChildNode(yyVAL.node, yyDollar[2].node) @@ -6413,7 +6414,7 @@ yydefault: } case 297: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4061 + //line php5/php5.y:4063 { yyVAL.node = expr.NewErrorSuppress(yyDollar[2].node) @@ -6421,13 +6422,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.AtToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.AtToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 298: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4073 + //line php5/php5.y:4075 { yyVAL.node = yyDollar[1].node @@ -6435,7 +6436,7 @@ yydefault: } case 299: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4079 + //line php5/php5.y:4081 { yyVAL.node = yyDollar[1].node @@ -6443,7 +6444,7 @@ yydefault: } case 300: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4085 + //line php5/php5.y:4087 { yyVAL.node = yyDollar[1].node @@ -6451,7 +6452,7 @@ yydefault: } case 301: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4091 + //line php5/php5.y:4093 { yyVAL.node = expr.NewShellExec(yyDollar[2].list) @@ -6459,14 +6460,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.BackquoteToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.BackquoteToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.BackquoteToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.BackquoteToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 302: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4104 + //line php5/php5.y:4106 { yyVAL.node = expr.NewPrint(yyDollar[2].node) @@ -6474,13 +6475,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.PrintToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.PrintToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 303: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4116 + //line php5/php5.y:4118 { yyVAL.node = expr.NewYield(nil, nil) @@ -6488,13 +6489,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.YieldToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.YieldToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 304: yyDollar = yyS[yypt-9 : yypt+1] - //line php5/php5.y:4128 + //line php5/php5.y:4130 { yyVAL.node = expr.NewClosure(yyDollar[4].list, yyDollar[6].ClosureUse, nil, yyDollar[8].list, false, yyDollar[2].token != nil, "") @@ -6502,20 +6503,20 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[9].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.FunctionToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.FunctionToken) if yyDollar[2].token != nil { - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.AmpersandToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.AmpersandToken) } - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[5].token, comment.CloseParenthesisToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[7].token, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[9].token, comment.CloseCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.OpenParenthesisToken) + yyVAL.node.AddComments(yyDollar[5].token.Comments, comment.CloseParenthesisToken) + yyVAL.node.AddComments(yyDollar[7].token.Comments, comment.OpenCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[9].token.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 305: yyDollar = yyS[yypt-10 : yypt+1] - //line php5/php5.y:4147 + //line php5/php5.y:4149 { yyVAL.node = expr.NewClosure(yyDollar[5].list, yyDollar[7].ClosureUse, nil, yyDollar[9].list, true, yyDollar[3].token != nil, "") @@ -6523,21 +6524,21 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[10].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.StaticToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.FunctionToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.StaticToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.FunctionToken) if yyDollar[3].token != nil { - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.AmpersandToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.AmpersandToken) } - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[6].token, comment.CloseParenthesisToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[8].token, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[10].token, comment.CloseCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.OpenParenthesisToken) + yyVAL.node.AddComments(yyDollar[6].token.Comments, comment.CloseParenthesisToken) + yyVAL.node.AddComments(yyDollar[8].token.Comments, comment.OpenCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[10].token.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 306: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4170 + //line php5/php5.y:4172 { yyVAL.node = expr.NewYield(nil, yyDollar[2].node) @@ -6545,13 +6546,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.YieldToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.YieldToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 307: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4182 + //line php5/php5.y:4184 { yyVAL.node = expr.NewYield(nil, yyDollar[2].node) @@ -6559,13 +6560,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.YieldToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.YieldToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 308: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4194 + //line php5/php5.y:4196 { yyVAL.node = expr.NewYield(yyDollar[2].node, yyDollar[4].node) @@ -6573,14 +6574,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[4].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.YieldToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.DoubleArrowToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.YieldToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.DoubleArrowToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 309: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4207 + //line php5/php5.y:4209 { yyVAL.node = expr.NewYield(yyDollar[2].node, yyDollar[4].node) @@ -6588,14 +6589,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[4].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.YieldToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.DoubleArrowToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.YieldToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.DoubleArrowToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 310: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4223 + //line php5/php5.y:4225 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -6603,14 +6604,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenSquareBracket) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseSquareBracket) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenSquareBracket) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 311: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4236 + //line php5/php5.y:4238 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -6618,14 +6619,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenSquareBracket) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseSquareBracket) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenSquareBracket) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 312: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4249 + //line php5/php5.y:4251 { str := scalar.NewString(yyDollar[1].token.Value) yyVAL.node = expr.NewArrayDimFetch(str, yyDollar[3].node) @@ -6635,14 +6636,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(str, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenSquareBracket) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseSquareBracket) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenSquareBracket) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 313: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4264 + //line php5/php5.y:4266 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -6650,14 +6651,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenSquareBracket) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseSquareBracket) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenSquareBracket) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 314: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4280 + //line php5/php5.y:4282 { yyVAL.node = expr.NewArray(yyDollar[3].list) @@ -6665,15 +6666,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ArrayToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseParenthesisToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ArrayToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenParenthesisToken) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 315: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4294 + //line php5/php5.y:4296 { yyVAL.node = expr.NewShortArray(yyDollar[2].list) @@ -6681,20 +6682,20 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.OpenSquareBracket) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.CloseSquareBracket) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.OpenSquareBracket) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 316: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4310 + //line php5/php5.y:4312 { yyVAL.token = yyDollar[1].token } case 317: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:4317 + //line php5/php5.y:4319 { yyVAL.ClosureUse = nil @@ -6702,7 +6703,7 @@ yydefault: } case 318: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4323 + //line php5/php5.y:4325 { yyVAL.ClosureUse = expr.NewClosureUse(yyDollar[3].list) @@ -6712,7 +6713,7 @@ yydefault: } case 319: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4334 + //line php5/php5.y:4336 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[3].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -6723,14 +6724,14 @@ yydefault: variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) - yylex.(*Parser).comments.AddFromToken(variable, yyDollar[3].token, comment.VariableToken) + lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) + variable.AddComments(yyDollar[3].token.Comments, comment.VariableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 320: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4350 + //line php5/php5.y:4352 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[4].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -6743,15 +6744,15 @@ yydefault: reference.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[3].token, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) - yylex.(*Parser).comments.AddFromToken(reference, yyDollar[3].token, comment.VariableToken) - yylex.(*Parser).comments.AddFromToken(variable, yyDollar[4].token, comment.VariableToken) + lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) + reference.AddComments(yyDollar[3].token.Comments, comment.VariableToken) + variable.AddComments(yyDollar[4].token.Comments, comment.VariableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 321: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4369 + //line php5/php5.y:4371 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -6762,13 +6763,13 @@ yydefault: variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(variable, yyDollar[1].token, comment.VariableToken) + variable.AddComments(yyDollar[1].token.Comments, comment.VariableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 322: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4384 + //line php5/php5.y:4386 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[2].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -6781,14 +6782,14 @@ yydefault: reference.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - yylex.(*Parser).comments.AddFromToken(reference, yyDollar[1].token, comment.VariableToken) - yylex.(*Parser).comments.AddFromToken(variable, yyDollar[2].token, comment.VariableToken) + reference.AddComments(yyDollar[1].token.Comments, comment.VariableToken) + variable.AddComments(yyDollar[2].token.Comments, comment.VariableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 323: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4405 + //line php5/php5.y:4407 { name := name.NewName(yyDollar[1].list) yyVAL.node = expr.NewFunctionCall(name, yyDollar[2].node.(*node.ArgumentList)) @@ -6801,7 +6802,7 @@ yydefault: } case 324: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4416 + //line php5/php5.y:4418 { funcName := name.NewRelative(yyDollar[3].list) yyVAL.node = expr.NewFunctionCall(funcName, yyDollar[4].node.(*node.ArgumentList)) @@ -6811,14 +6812,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(funcName, yyDollar[4].node)) // save comments - yylex.(*Parser).comments.AddFromToken(funcName, yyDollar[1].token, comment.NamespaceToken) - yylex.(*Parser).comments.AddFromToken(funcName, yyDollar[2].token, comment.NsSeparatorToken) + funcName.AddComments(yyDollar[1].token.Comments, comment.NamespaceToken) + funcName.AddComments(yyDollar[2].token.Comments, comment.NsSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 325: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4431 + //line php5/php5.y:4433 { funcName := name.NewFullyQualified(yyDollar[2].list) yyVAL.node = expr.NewFunctionCall(funcName, yyDollar[3].node.(*node.ArgumentList)) @@ -6828,13 +6829,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(funcName, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(funcName, yyDollar[1].token, comment.NsSeparatorToken) + funcName.AddComments(yyDollar[1].token.Comments, comment.NsSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 326: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4445 + //line php5/php5.y:4447 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -6842,13 +6843,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PaamayimNekudotayimToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.PaamayimNekudotayimToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 327: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4457 + //line php5/php5.y:4459 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -6856,13 +6857,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PaamayimNekudotayimToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.PaamayimNekudotayimToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 328: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4469 + //line php5/php5.y:4471 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -6870,13 +6871,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PaamayimNekudotayimToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.PaamayimNekudotayimToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 329: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4481 + //line php5/php5.y:4483 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -6884,13 +6885,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PaamayimNekudotayimToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.PaamayimNekudotayimToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 330: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4493 + //line php5/php5.y:4495 { yyVAL.node = expr.NewFunctionCall(yyDollar[1].node, yyDollar[2].node.(*node.ArgumentList)) @@ -6901,7 +6902,7 @@ yydefault: } case 331: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4505 + //line php5/php5.y:4507 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -6909,13 +6910,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.StaticToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.StaticToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 332: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4517 + //line php5/php5.y:4519 { yyVAL.node = name.NewName(yyDollar[1].list) @@ -6926,7 +6927,7 @@ yydefault: } case 333: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4526 + //line php5/php5.y:4528 { yyVAL.node = name.NewRelative(yyDollar[3].list) @@ -6934,14 +6935,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.NamespaceToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.NsSeparatorToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.NamespaceToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.NsSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 334: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4539 + //line php5/php5.y:4541 { yyVAL.node = name.NewFullyQualified(yyDollar[2].list) @@ -6949,13 +6950,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.NsSeparatorToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.NsSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 335: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4554 + //line php5/php5.y:4556 { yyVAL.node = name.NewName(yyDollar[1].list) @@ -6966,7 +6967,7 @@ yydefault: } case 336: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4563 + //line php5/php5.y:4565 { yyVAL.node = name.NewRelative(yyDollar[3].list) @@ -6974,14 +6975,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.NamespaceToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.NsSeparatorToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.NamespaceToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.NsSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 337: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4576 + //line php5/php5.y:4578 { yyVAL.node = name.NewFullyQualified(yyDollar[2].list) @@ -6989,13 +6990,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.NsSeparatorToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.NsSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 338: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4591 + //line php5/php5.y:4593 { yyVAL.node = yyDollar[1].node @@ -7003,7 +7004,7 @@ yydefault: } case 339: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4597 + //line php5/php5.y:4599 { yyVAL.node = yyDollar[1].node @@ -7011,12 +7012,12 @@ yydefault: } case 340: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4606 + //line php5/php5.y:4608 { yyVAL.node = yyDollar[1].node // save comments - yylex.(*Parser).comments.AddFromToken(yyDollar[3].list[0], yyDollar[2].token, comment.ObjectOperatorToken) + yyDollar[3].list[0].AddComments(yyDollar[2].token.Comments, comment.ObjectOperatorToken) for _, n := range yyDollar[3].list { switch nn := n.(type) { @@ -7050,7 +7051,7 @@ yydefault: } case 341: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4643 + //line php5/php5.y:4645 { yyVAL.node = yyDollar[1].node @@ -7058,7 +7059,7 @@ yydefault: } case 342: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4653 + //line php5/php5.y:4655 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) @@ -7066,7 +7067,7 @@ yydefault: } case 343: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:4659 + //line php5/php5.y:4661 { yyVAL.list = []node.Node{} @@ -7074,18 +7075,18 @@ yydefault: } case 344: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4669 + //line php5/php5.y:4671 { yyVAL.list = yyDollar[2].list // save comments - yylex.(*Parser).comments.AddFromToken(yyDollar[2].list[0], yyDollar[1].token, comment.ObjectOperatorToken) + yyDollar[2].list[0].AddComments(yyDollar[1].token.Comments, comment.ObjectOperatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 345: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:4681 + //line php5/php5.y:4683 { yyVAL.node = nil @@ -7093,7 +7094,7 @@ yydefault: } case 346: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4687 + //line php5/php5.y:4689 { yyVAL.node = expr.NewExit(nil) @@ -7101,14 +7102,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.CloseParenthesisToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.OpenParenthesisToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 347: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4700 + //line php5/php5.y:4702 { yyVAL.node = expr.NewExit(yyDollar[1].node) @@ -7119,7 +7120,7 @@ yydefault: } case 348: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:4712 + //line php5/php5.y:4714 { yyVAL.list = []node.Node{} @@ -7127,7 +7128,7 @@ yydefault: } case 349: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4718 + //line php5/php5.y:4720 { yyVAL.list = []node.Node{scalar.NewEncapsedStringPart(yyDollar[1].token.Value)} @@ -7135,7 +7136,7 @@ yydefault: } case 350: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4724 + //line php5/php5.y:4726 { yyVAL.list = yyDollar[1].list @@ -7143,7 +7144,7 @@ yydefault: } case 351: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:4733 + //line php5/php5.y:4735 { yyVAL.node = nil @@ -7151,7 +7152,7 @@ yydefault: } case 352: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4739 + //line php5/php5.y:4741 { yyVAL.node = yyDollar[1].node @@ -7159,7 +7160,7 @@ yydefault: } case 353: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4748 + //line php5/php5.y:4750 { yyVAL.node = scalar.NewLnumber(yyDollar[1].token.Value) @@ -7167,13 +7168,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.LnumberToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.LnumberToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 354: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4760 + //line php5/php5.y:4762 { yyVAL.node = scalar.NewDnumber(yyDollar[1].token.Value) @@ -7181,13 +7182,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.DnumberToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.DnumberToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 355: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4772 + //line php5/php5.y:4774 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) @@ -7195,13 +7196,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ConstantEncapsedStringToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ConstantEncapsedStringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 356: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4784 + //line php5/php5.y:4786 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7209,13 +7210,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.LineToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.LineToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 357: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4796 + //line php5/php5.y:4798 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7223,13 +7224,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.FileToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.FileToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 358: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4808 + //line php5/php5.y:4810 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7237,13 +7238,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.DirToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.DirToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 359: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4820 + //line php5/php5.y:4822 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7251,13 +7252,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.TraitCToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.TraitCToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 360: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4832 + //line php5/php5.y:4834 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7265,13 +7266,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.MethodCToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.MethodCToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 361: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4844 + //line php5/php5.y:4846 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7279,13 +7280,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.FuncCToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.FuncCToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 362: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4856 + //line php5/php5.y:4858 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7293,13 +7294,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.NsCToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.NsCToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 363: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4868 + //line php5/php5.y:4870 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, []node.Node{encapsed}) @@ -7309,13 +7310,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.StartHeredocToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.StartHeredocToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 364: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4882 + //line php5/php5.y:4884 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, nil) @@ -7323,13 +7324,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.StartHeredocToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.StartHeredocToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 365: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4897 + //line php5/php5.y:4899 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -7339,14 +7340,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PaamayimNekudotayimToken) - yylex.(*Parser).comments.AddFromToken(target, yyDollar[3].token, comment.IdentifierToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.PaamayimNekudotayimToken) + target.AddComments(yyDollar[3].token.Comments, comment.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 366: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4915 + //line php5/php5.y:4917 { yyVAL.node = yyDollar[1].node @@ -7354,7 +7355,7 @@ yydefault: } case 367: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4924 + //line php5/php5.y:4926 { yyVAL.node = yyDollar[1].node @@ -7362,7 +7363,7 @@ yydefault: } case 368: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4930 + //line php5/php5.y:4932 { yyVAL.node = yyDollar[1].node @@ -7370,7 +7371,7 @@ yydefault: } case 369: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4936 + //line php5/php5.y:4938 { name := name.NewName(yyDollar[1].list) yyVAL.node = expr.NewConstFetch(name) @@ -7383,7 +7384,7 @@ yydefault: } case 370: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4947 + //line php5/php5.y:4949 { name := name.NewRelative(yyDollar[3].list) yyVAL.node = expr.NewConstFetch(name) @@ -7393,14 +7394,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.NamespaceToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.NsSeparatorToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.NamespaceToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.NsSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 371: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4962 + //line php5/php5.y:4964 { name := name.NewFullyQualified(yyDollar[2].list) yyVAL.node = expr.NewConstFetch(name) @@ -7410,13 +7411,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.NsSeparatorToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.NsSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 372: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4976 + //line php5/php5.y:4978 { yyVAL.node = expr.NewArray(yyDollar[3].list) @@ -7424,15 +7425,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ArrayToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseParenthesisToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ArrayToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenParenthesisToken) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 373: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4990 + //line php5/php5.y:4992 { yyVAL.node = expr.NewShortArray(yyDollar[2].list) @@ -7440,14 +7441,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.OpenSquareBracket) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.CloseSquareBracket) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.OpenSquareBracket) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 374: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5003 + //line php5/php5.y:5005 { yyVAL.node = yyDollar[1].node @@ -7455,7 +7456,7 @@ yydefault: } case 375: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5009 + //line php5/php5.y:5011 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7463,13 +7464,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ClassCToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ClassCToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 376: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5021 + //line php5/php5.y:5023 { yyVAL.node = yyDollar[1].node @@ -7477,7 +7478,7 @@ yydefault: } case 377: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:5030 + //line php5/php5.y:5032 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -7485,14 +7486,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenSquareBracket) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseSquareBracket) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenSquareBracket) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 378: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5043 + //line php5/php5.y:5045 { yyVAL.node = binary.NewPlus(yyDollar[1].node, yyDollar[3].node) @@ -7500,13 +7501,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PlusToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.PlusToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 379: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5055 + //line php5/php5.y:5057 { yyVAL.node = binary.NewMinus(yyDollar[1].node, yyDollar[3].node) @@ -7514,13 +7515,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.MinusToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.MinusToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 380: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5067 + //line php5/php5.y:5069 { yyVAL.node = binary.NewMul(yyDollar[1].node, yyDollar[3].node) @@ -7528,13 +7529,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.AsteriskToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.AsteriskToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 381: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5079 + //line php5/php5.y:5081 { yyVAL.node = binary.NewPow(yyDollar[1].node, yyDollar[3].node) @@ -7542,13 +7543,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PowToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.PowToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 382: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5091 + //line php5/php5.y:5093 { yyVAL.node = binary.NewDiv(yyDollar[1].node, yyDollar[3].node) @@ -7556,13 +7557,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.SlashToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.SlashToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 383: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5103 + //line php5/php5.y:5105 { yyVAL.node = binary.NewMod(yyDollar[1].node, yyDollar[3].node) @@ -7570,13 +7571,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PercentToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.PercentToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 384: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5115 + //line php5/php5.y:5117 { yyVAL.node = expr.NewBooleanNot(yyDollar[2].node) @@ -7584,13 +7585,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ExclamationMarkToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ExclamationMarkToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 385: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5127 + //line php5/php5.y:5129 { yyVAL.node = expr.NewBitwiseNot(yyDollar[2].node) @@ -7598,13 +7599,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.TildeToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.TildeToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 386: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5139 + //line php5/php5.y:5141 { yyVAL.node = binary.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) @@ -7612,13 +7613,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.VerticalBarToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.VerticalBarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 387: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5151 + //line php5/php5.y:5153 { yyVAL.node = binary.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) @@ -7626,13 +7627,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.AmpersandToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.AmpersandToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 388: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5163 + //line php5/php5.y:5165 { yyVAL.node = binary.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) @@ -7640,13 +7641,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.CaretToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.CaretToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 389: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5175 + //line php5/php5.y:5177 { yyVAL.node = binary.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) @@ -7654,13 +7655,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.SlToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.SlToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 390: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5187 + //line php5/php5.y:5189 { yyVAL.node = binary.NewShiftRight(yyDollar[1].node, yyDollar[3].node) @@ -7668,13 +7669,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.SrToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.SrToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 391: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5199 + //line php5/php5.y:5201 { yyVAL.node = binary.NewConcat(yyDollar[1].node, yyDollar[3].node) @@ -7682,13 +7683,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.DotToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.DotToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 392: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5211 + //line php5/php5.y:5213 { yyVAL.node = binary.NewLogicalXor(yyDollar[1].node, yyDollar[3].node) @@ -7696,13 +7697,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.LogicalXorToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.LogicalXorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 393: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5223 + //line php5/php5.y:5225 { yyVAL.node = binary.NewLogicalAnd(yyDollar[1].node, yyDollar[3].node) @@ -7710,13 +7711,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.LogicalAndToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.LogicalAndToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 394: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5235 + //line php5/php5.y:5237 { yyVAL.node = binary.NewLogicalOr(yyDollar[1].node, yyDollar[3].node) @@ -7724,13 +7725,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.LogicalOrToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.LogicalOrToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 395: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5247 + //line php5/php5.y:5249 { yyVAL.node = binary.NewBooleanAnd(yyDollar[1].node, yyDollar[3].node) @@ -7738,13 +7739,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.BooleanAndToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.BooleanAndToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 396: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5259 + //line php5/php5.y:5261 { yyVAL.node = binary.NewBooleanOr(yyDollar[1].node, yyDollar[3].node) @@ -7752,13 +7753,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.BooleanOrToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.BooleanOrToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 397: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5271 + //line php5/php5.y:5273 { yyVAL.node = binary.NewIdentical(yyDollar[1].node, yyDollar[3].node) @@ -7766,13 +7767,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.IsIdenticalToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.IsIdenticalToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 398: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5283 + //line php5/php5.y:5285 { yyVAL.node = binary.NewNotIdentical(yyDollar[1].node, yyDollar[3].node) @@ -7780,13 +7781,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.IsNotIdenticalToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.IsNotIdenticalToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 399: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5295 + //line php5/php5.y:5297 { yyVAL.node = binary.NewEqual(yyDollar[1].node, yyDollar[3].node) @@ -7794,13 +7795,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.IsEqualToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.IsEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 400: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5307 + //line php5/php5.y:5309 { yyVAL.node = binary.NewNotEqual(yyDollar[1].node, yyDollar[3].node) @@ -7808,13 +7809,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.IsNotEqualToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.IsNotEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 401: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5319 + //line php5/php5.y:5321 { yyVAL.node = binary.NewSmaller(yyDollar[1].node, yyDollar[3].node) @@ -7822,13 +7823,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.LessToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.LessToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 402: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5331 + //line php5/php5.y:5333 { yyVAL.node = binary.NewGreater(yyDollar[1].node, yyDollar[3].node) @@ -7836,13 +7837,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.GreaterToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.GreaterToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 403: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5343 + //line php5/php5.y:5345 { yyVAL.node = binary.NewSmallerOrEqual(yyDollar[1].node, yyDollar[3].node) @@ -7850,13 +7851,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.IsSmallerOrEqualToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.IsSmallerOrEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 404: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5355 + //line php5/php5.y:5357 { yyVAL.node = binary.NewGreaterOrEqual(yyDollar[1].node, yyDollar[3].node) @@ -7864,13 +7865,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.IsGreaterOrEqualToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.IsGreaterOrEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 405: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:5367 + //line php5/php5.y:5369 { yyVAL.node = expr.NewTernary(yyDollar[1].node, nil, yyDollar[4].node) @@ -7878,14 +7879,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.QuestionMarkToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.ColonToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.QuestionMarkToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.ColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 406: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:5380 + //line php5/php5.y:5382 { yyVAL.node = expr.NewTernary(yyDollar[1].node, yyDollar[3].node, yyDollar[5].node) @@ -7893,14 +7894,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[5].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.QuestionMarkToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.ColonToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.QuestionMarkToken) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.ColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 407: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5393 + //line php5/php5.y:5395 { yyVAL.node = expr.NewUnaryPlus(yyDollar[2].node) @@ -7908,13 +7909,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.PlusToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.PlusToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 408: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5405 + //line php5/php5.y:5407 { yyVAL.node = expr.NewUnaryMinus(yyDollar[2].node) @@ -7922,25 +7923,25 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.MinusToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.MinusToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 409: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5417 + //line php5/php5.y:5419 { yyVAL.node = yyDollar[2].node // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.CloseParenthesisToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.OpenParenthesisToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 410: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5430 + //line php5/php5.y:5432 { yyVAL.node = yyDollar[1].node @@ -7948,7 +7949,7 @@ yydefault: } case 411: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5436 + //line php5/php5.y:5438 { name := name.NewName(yyDollar[1].list) yyVAL.node = expr.NewConstFetch(name) @@ -7961,7 +7962,7 @@ yydefault: } case 412: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5447 + //line php5/php5.y:5449 { name := name.NewRelative(yyDollar[3].list) yyVAL.node = expr.NewConstFetch(name) @@ -7969,14 +7970,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(name)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.NamespaceToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.NsSeparatorToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.NamespaceToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.NsSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 413: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5460 + //line php5/php5.y:5462 { name := name.NewFullyQualified(yyDollar[2].list) yyVAL.node = expr.NewConstFetch(name) @@ -7986,13 +7987,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(name)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.NsSeparatorToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.NsSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 414: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5477 + //line php5/php5.y:5479 { name := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = expr.NewVariable(name) @@ -8002,13 +8003,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(name, yyDollar[1].token, comment.StringVarnameToken) + name.AddComments(yyDollar[1].token.Comments, comment.StringVarnameToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 415: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5491 + //line php5/php5.y:5493 { yyVAL.node = yyDollar[1].node @@ -8016,7 +8017,7 @@ yydefault: } case 416: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5497 + //line php5/php5.y:5499 { yyVAL.node = yyDollar[1].node @@ -8024,7 +8025,7 @@ yydefault: } case 417: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5503 + //line php5/php5.y:5505 { yyVAL.node = yyDollar[1].node @@ -8032,7 +8033,7 @@ yydefault: } case 418: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5509 + //line php5/php5.y:5511 { yyVAL.node = scalar.NewEncapsed(yyDollar[2].list) @@ -8040,13 +8041,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.DoubleQuoteToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.DoubleQuoteToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 419: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5521 + //line php5/php5.y:5523 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, yyDollar[2].list) @@ -8054,13 +8055,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.StartHeredocToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.StartHeredocToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 420: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5533 + //line php5/php5.y:5535 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -8068,13 +8069,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ClassCToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ClassCToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 421: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:5548 + //line php5/php5.y:5550 { yyVAL.list = nil @@ -8082,32 +8083,32 @@ yydefault: } case 422: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5554 + //line php5/php5.y:5556 { yyVAL.list = yyDollar[1].list // save comments if yyDollar[2].token != nil { - yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) + lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 423: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:5568 + //line php5/php5.y:5570 { yyVAL.token = nil } case 424: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5572 + //line php5/php5.y:5574 { yyVAL.token = yyDollar[1].token } case 425: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:5579 + //line php5/php5.y:5581 { arrayItem := expr.NewArrayItem(yyDollar[3].node, yyDollar[5].node) yyVAL.list = append(yyDollar[1].list, arrayItem) @@ -8116,14 +8117,14 @@ yydefault: arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[3].node, yyDollar[5].node)) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) - yylex.(*Parser).comments.AddFromToken(arrayItem, yyDollar[4].token, comment.DoubleArrowToken) + lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) + arrayItem.AddComments(yyDollar[4].token.Comments, comment.DoubleArrowToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 426: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5593 + //line php5/php5.y:5595 { arrayItem := expr.NewArrayItem(nil, yyDollar[3].node) yyVAL.list = append(yyDollar[1].list, arrayItem) @@ -8132,13 +8133,13 @@ yydefault: arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) + lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 427: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5606 + //line php5/php5.y:5608 { arrayItem := expr.NewArrayItem(yyDollar[1].node, yyDollar[3].node) yyVAL.list = []node.Node{arrayItem} @@ -8147,13 +8148,13 @@ yydefault: arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(arrayItem, yyDollar[2].token, comment.DoubleArrowToken) + arrayItem.AddComments(yyDollar[2].token.Comments, comment.DoubleArrowToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 428: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5619 + //line php5/php5.y:5621 { arrayItem := expr.NewArrayItem(nil, yyDollar[1].node) yyVAL.list = []node.Node{arrayItem} @@ -8165,7 +8166,7 @@ yydefault: } case 429: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5632 + //line php5/php5.y:5634 { yyVAL.node = yyDollar[1].node @@ -8173,7 +8174,7 @@ yydefault: } case 430: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5638 + //line php5/php5.y:5640 { yyVAL.node = yyDollar[1].node @@ -8181,7 +8182,7 @@ yydefault: } case 431: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5647 + //line php5/php5.y:5649 { yyVAL.node = yyDollar[2].node @@ -8189,7 +8190,7 @@ yydefault: } case 432: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5653 + //line php5/php5.y:5655 { yyVAL.node = yyDollar[2].node @@ -8197,7 +8198,7 @@ yydefault: } case 433: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5663 + //line php5/php5.y:5665 { yyVAL.node = yyDollar[1].node @@ -8205,7 +8206,7 @@ yydefault: } case 434: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5673 + //line php5/php5.y:5675 { yyVAL.node = yyDollar[1].node @@ -8213,7 +8214,7 @@ yydefault: } case 435: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5682 + //line php5/php5.y:5684 { yyVAL.node = yyDollar[1].node @@ -8221,7 +8222,7 @@ yydefault: } case 436: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:5691 + //line php5/php5.y:5693 { yyVAL.node = yyDollar[1].node @@ -8231,7 +8232,7 @@ yydefault: } // save comments - yylex.(*Parser).comments.AddFromToken(yyDollar[3].list[0], yyDollar[2].token, comment.ObjectOperatorToken) + yyDollar[3].list[0].AddComments(yyDollar[2].token.Comments, comment.ObjectOperatorToken) for _, n := range yyDollar[3].list { switch nn := n.(type) { @@ -8275,7 +8276,7 @@ yydefault: } case 437: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5743 + //line php5/php5.y:5745 { yyVAL.node = yyDollar[1].node @@ -8283,7 +8284,7 @@ yydefault: } case 438: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5752 + //line php5/php5.y:5754 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) @@ -8291,7 +8292,7 @@ yydefault: } case 439: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:5758 + //line php5/php5.y:5760 { yyVAL.list = []node.Node{} @@ -8299,7 +8300,7 @@ yydefault: } case 440: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5768 + //line php5/php5.y:5770 { if yyDollar[3].list != nil { yyDollar[3].list[0].(*expr.MethodCall).Method = yyDollar[2].list[len(yyDollar[2].list)-1].(*expr.PropertyFetch).Property @@ -8309,13 +8310,13 @@ yydefault: yyVAL.list = yyDollar[2].list // save comments - yylex.(*Parser).comments.AddFromToken(yyDollar[2].list[0], yyDollar[1].token, comment.ObjectOperatorToken) + yyDollar[2].list[0].AddComments(yyDollar[1].token.Comments, comment.ObjectOperatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 441: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:5785 + //line php5/php5.y:5787 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yyVAL.list = append(yyDollar[1].list, fetch) @@ -8324,14 +8325,14 @@ yydefault: fetch.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(fetch, yyDollar[2].token, comment.OpenSquareBracket) - yylex.(*Parser).comments.AddFromToken(fetch, yyDollar[4].token, comment.CloseSquareBracket) + fetch.AddComments(yyDollar[2].token.Comments, comment.OpenSquareBracket) + fetch.AddComments(yyDollar[4].token.Comments, comment.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 442: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:5799 + //line php5/php5.y:5801 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yyVAL.list = []node.Node{yyDollar[1].node, fetch} @@ -8340,14 +8341,14 @@ yydefault: fetch.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(fetch, yyDollar[2].token, comment.OpenSquareBracket) - yylex.(*Parser).comments.AddFromToken(fetch, yyDollar[4].token, comment.CloseSquareBracket) + fetch.AddComments(yyDollar[2].token.Comments, comment.OpenSquareBracket) + fetch.AddComments(yyDollar[4].token.Comments, comment.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 443: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5816 + //line php5/php5.y:5818 { yyVAL.node = expr.NewMethodCall(nil, nil, yyDollar[1].node.(*node.ArgumentList)) @@ -8358,7 +8359,7 @@ yydefault: } case 444: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5828 + //line php5/php5.y:5830 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -8366,7 +8367,7 @@ yydefault: } case 445: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5834 + //line php5/php5.y:5836 { yyVAL.list = yyDollar[1].list @@ -8374,7 +8375,7 @@ yydefault: } case 446: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:5840 + //line php5/php5.y:5842 { yyVAL.list = nil @@ -8382,7 +8383,7 @@ yydefault: } case 447: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5849 + //line php5/php5.y:5851 { yyVAL.node = yyDollar[1].node @@ -8390,7 +8391,7 @@ yydefault: } case 448: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5855 + //line php5/php5.y:5857 { yyDollar[1].simpleIndirectReference.last.SetVarName(yyDollar[2].node) @@ -8404,7 +8405,7 @@ yydefault: } case 449: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5870 + //line php5/php5.y:5872 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -8412,13 +8413,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PaamayimNekudotayimToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.PaamayimNekudotayimToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 450: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5882 + //line php5/php5.y:5884 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -8426,13 +8427,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PaamayimNekudotayimToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.PaamayimNekudotayimToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 451: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5897 + //line php5/php5.y:5899 { yyVAL.node = yyDollar[1].node @@ -8440,7 +8441,7 @@ yydefault: } case 452: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:5906 + //line php5/php5.y:5908 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -8448,14 +8449,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenSquareBracket) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseSquareBracket) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenSquareBracket) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 453: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:5919 + //line php5/php5.y:5921 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -8463,14 +8464,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenSquareBracket) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseSquareBracket) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenSquareBracket) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 454: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5935 + //line php5/php5.y:5937 { yyVAL.node = yyDollar[1].node @@ -8478,7 +8479,7 @@ yydefault: } case 455: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5941 + //line php5/php5.y:5943 { yyVAL.node = yyDollar[1].node @@ -8486,7 +8487,7 @@ yydefault: } case 456: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5947 + //line php5/php5.y:5949 { yyVAL.node = yyDollar[1].node @@ -8494,7 +8495,7 @@ yydefault: } case 457: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5957 + //line php5/php5.y:5959 { yyVAL.node = yyDollar[1].node @@ -8502,7 +8503,7 @@ yydefault: } case 458: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5963 + //line php5/php5.y:5965 { yyDollar[1].simpleIndirectReference.last.SetVarName(yyDollar[2].node) @@ -8516,7 +8517,7 @@ yydefault: } case 459: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5975 + //line php5/php5.y:5977 { yyVAL.node = yyDollar[1].node @@ -8524,7 +8525,7 @@ yydefault: } case 460: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:5984 + //line php5/php5.y:5986 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -8532,14 +8533,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenSquareBracket) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseSquareBracket) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenSquareBracket) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 461: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:5997 + //line php5/php5.y:5999 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -8547,14 +8548,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 462: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6010 + //line php5/php5.y:6012 { yyVAL.node = yyDollar[1].node @@ -8562,7 +8563,7 @@ yydefault: } case 463: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6020 + //line php5/php5.y:6022 { name := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(name) @@ -8572,13 +8573,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.VariableToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.VariableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 464: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6034 + //line php5/php5.y:6036 { yyVAL.node = expr.NewVariable(yyDollar[3].node) @@ -8586,15 +8587,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.DollarToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.DollarToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 465: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:6051 + //line php5/php5.y:6053 { yyVAL.node = nil @@ -8602,7 +8603,7 @@ yydefault: } case 466: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6057 + //line php5/php5.y:6059 { yyVAL.node = yyDollar[1].node @@ -8610,7 +8611,7 @@ yydefault: } case 467: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6067 + //line php5/php5.y:6069 { yyVAL.list = yyDollar[1].list @@ -8618,7 +8619,7 @@ yydefault: } case 468: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6073 + //line php5/php5.y:6075 { fetch := expr.NewPropertyFetch(nil, yyDollar[1].node) yyVAL.list = []node.Node{fetch} @@ -8630,7 +8631,7 @@ yydefault: } case 469: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6086 + //line php5/php5.y:6088 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yyVAL.list = append(yyDollar[1].list, fetch) @@ -8639,14 +8640,14 @@ yydefault: fetch.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(fetch, yyDollar[2].token, comment.OpenSquareBracket) - yylex.(*Parser).comments.AddFromToken(fetch, yyDollar[4].token, comment.CloseSquareBracket) + fetch.AddComments(yyDollar[2].token.Comments, comment.OpenSquareBracket) + fetch.AddComments(yyDollar[4].token.Comments, comment.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 470: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6100 + //line php5/php5.y:6102 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yyVAL.list = append(yyDollar[1].list, fetch) @@ -8655,14 +8656,14 @@ yydefault: fetch.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(fetch, yyDollar[2].token, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken(fetch, yyDollar[4].token, comment.CloseCurlyBracesToken) + fetch.AddComments(yyDollar[2].token.Comments, comment.OpenCurlyBracesToken) + fetch.AddComments(yyDollar[4].token.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 471: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6114 + //line php5/php5.y:6116 { fetch := expr.NewPropertyFetch(nil, yyDollar[1].node) yyVAL.list = []node.Node{fetch} @@ -8674,7 +8675,7 @@ yydefault: } case 472: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6127 + //line php5/php5.y:6129 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -8682,13 +8683,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.StringToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.StringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 473: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6139 + //line php5/php5.y:6141 { yyVAL.node = yyDollar[2].node @@ -8696,14 +8697,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.CloseCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.OpenCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 474: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6155 + //line php5/php5.y:6157 { n := expr.NewVariable(nil) yyVAL.simpleIndirectReference = simpleIndirectReference{[]*expr.Variable{n}, n} @@ -8712,13 +8713,13 @@ yydefault: n.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(n, yyDollar[1].token, comment.DollarToken) + n.AddComments(yyDollar[1].token.Comments, comment.DollarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 475: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6168 + //line php5/php5.y:6170 { n := expr.NewVariable(nil) @@ -8731,24 +8732,24 @@ yydefault: n.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) // save comments - yylex.(*Parser).comments.AddFromToken(n, yyDollar[2].token, comment.DollarToken) + n.AddComments(yyDollar[2].token.Comments, comment.DollarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 476: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6188 + //line php5/php5.y:6190 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) + lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 477: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6197 + //line php5/php5.y:6199 { if yyDollar[1].node == nil { yyVAL.list = []node.Node{} @@ -8760,7 +8761,7 @@ yydefault: } case 478: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6211 + //line php5/php5.y:6213 { yyVAL.node = expr.NewArrayItem(nil, yyDollar[1].node) @@ -8771,7 +8772,7 @@ yydefault: } case 479: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6220 + //line php5/php5.y:6222 { item := expr.NewList(yyDollar[3].list) yyVAL.node = expr.NewArrayItem(nil, item) @@ -8781,15 +8782,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(item)) // save comments - yylex.(*Parser).comments.AddFromToken(item, yyDollar[1].token, comment.ListToken) - yylex.(*Parser).comments.AddFromToken(item, yyDollar[2].token, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken(item, yyDollar[4].token, comment.CloseParenthesisToken) + item.AddComments(yyDollar[1].token.Comments, comment.ListToken) + item.AddComments(yyDollar[2].token.Comments, comment.OpenParenthesisToken) + item.AddComments(yyDollar[4].token.Comments, comment.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 480: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:6236 + //line php5/php5.y:6238 { yyVAL.node = nil @@ -8797,7 +8798,7 @@ yydefault: } case 481: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:6246 + //line php5/php5.y:6248 { yyVAL.list = []node.Node{} @@ -8805,20 +8806,20 @@ yydefault: } case 482: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6252 + //line php5/php5.y:6254 { yyVAL.list = yyDollar[1].list // save comments if yyDollar[2].token != nil { - yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) + lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 483: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:6266 + //line php5/php5.y:6268 { arrayItem := expr.NewArrayItem(yyDollar[3].node, yyDollar[5].node) yyVAL.list = append(yyDollar[1].list, arrayItem) @@ -8827,14 +8828,14 @@ yydefault: arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[3].node, yyDollar[5].node)) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) - yylex.(*Parser).comments.AddFromToken(arrayItem, yyDollar[4].token, comment.DoubleArrowToken) + lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) + arrayItem.AddComments(yyDollar[4].token.Comments, comment.DoubleArrowToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 484: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6280 + //line php5/php5.y:6282 { arrayItem := expr.NewArrayItem(nil, yyDollar[3].node) yyVAL.list = append(yyDollar[1].list, arrayItem) @@ -8843,13 +8844,13 @@ yydefault: arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) + lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 485: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6293 + //line php5/php5.y:6295 { arrayItem := expr.NewArrayItem(yyDollar[1].node, yyDollar[3].node) yyVAL.list = []node.Node{arrayItem} @@ -8858,13 +8859,13 @@ yydefault: arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(arrayItem, yyDollar[2].token, comment.DoubleArrowToken) + arrayItem.AddComments(yyDollar[2].token.Comments, comment.DoubleArrowToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 486: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6306 + //line php5/php5.y:6308 { arrayItem := expr.NewArrayItem(nil, yyDollar[1].node) yyVAL.list = []node.Node{arrayItem} @@ -8876,7 +8877,7 @@ yydefault: } case 487: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:6316 + //line php5/php5.y:6318 { reference := expr.NewReference(yyDollar[6].node) arrayItem := expr.NewArrayItem(yyDollar[3].node, reference) @@ -8887,15 +8888,15 @@ yydefault: arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[3].node, yyDollar[6].node)) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) - yylex.(*Parser).comments.AddFromToken(arrayItem, yyDollar[4].token, comment.DoubleArrowToken) - yylex.(*Parser).comments.AddFromToken(reference, yyDollar[5].token, comment.AmpersandToken) + lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) + arrayItem.AddComments(yyDollar[4].token.Comments, comment.DoubleArrowToken) + reference.AddComments(yyDollar[5].token.Comments, comment.AmpersandToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 488: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6333 + //line php5/php5.y:6335 { reference := expr.NewReference(yyDollar[4].node) arrayItem := expr.NewArrayItem(nil, reference) @@ -8906,14 +8907,14 @@ yydefault: arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[3].token, yyDollar[4].node)) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) - yylex.(*Parser).comments.AddFromToken(reference, yyDollar[3].token, comment.AmpersandToken) + lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) + reference.AddComments(yyDollar[3].token.Comments, comment.AmpersandToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 489: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6349 + //line php5/php5.y:6351 { reference := expr.NewReference(yyDollar[4].node) arrayItem := expr.NewArrayItem(yyDollar[1].node, reference) @@ -8924,14 +8925,14 @@ yydefault: arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) // save comments - yylex.(*Parser).comments.AddFromToken(arrayItem, yyDollar[2].token, comment.DoubleArrowToken) - yylex.(*Parser).comments.AddFromToken(reference, yyDollar[3].token, comment.AmpersandToken) + arrayItem.AddComments(yyDollar[2].token.Comments, comment.DoubleArrowToken) + reference.AddComments(yyDollar[3].token.Comments, comment.AmpersandToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 490: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6365 + //line php5/php5.y:6367 { reference := expr.NewReference(yyDollar[2].node) arrayItem := expr.NewArrayItem(nil, reference) @@ -8942,13 +8943,13 @@ yydefault: arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddFromToken(reference, yyDollar[1].token, comment.AmpersandToken) + reference.AddComments(yyDollar[1].token.Comments, comment.AmpersandToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 491: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6383 + //line php5/php5.y:6385 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -8956,7 +8957,7 @@ yydefault: } case 492: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6389 + //line php5/php5.y:6391 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yyVAL.list = append(yyDollar[1].list, encapsed) @@ -8965,13 +8966,13 @@ yydefault: encapsed.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) // save comments - yylex.(*Parser).comments.AddFromToken(encapsed, yyDollar[2].token, comment.EncapsedAndWhitespaceToken) + encapsed.AddComments(yyDollar[2].token.Comments, comment.EncapsedAndWhitespaceToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 493: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6402 + //line php5/php5.y:6404 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -8979,7 +8980,7 @@ yydefault: } case 494: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6408 + //line php5/php5.y:6410 { encapsed := scalar.NewEncapsedStringPart(yyDollar[1].token.Value) yyVAL.list = []node.Node{encapsed, yyDollar[2].node} @@ -8988,13 +8989,13 @@ yydefault: encapsed.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(encapsed, yyDollar[1].token, comment.EncapsedAndWhitespaceToken) + encapsed.AddComments(yyDollar[1].token.Comments, comment.EncapsedAndWhitespaceToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 495: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6424 + //line php5/php5.y:6426 { name := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(name) @@ -9004,13 +9005,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.VariableToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.VariableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 496: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6438 + //line php5/php5.y:6440 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -9022,15 +9023,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddFromToken(variable, yyDollar[1].token, comment.VariableToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenSquareBracket) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseSquareBracket) + variable.AddComments(yyDollar[1].token.Comments, comment.VariableToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenSquareBracket) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 497: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6456 + //line php5/php5.y:6458 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -9044,15 +9045,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddFromToken(variable, yyDollar[1].token, comment.VariableToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.ObjectOperatorToken) - yylex.(*Parser).comments.AddFromToken(fetch, yyDollar[3].token, comment.StringToken) + variable.AddComments(yyDollar[1].token.Comments, comment.VariableToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.ObjectOperatorToken) + fetch.AddComments(yyDollar[3].token.Comments, comment.StringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 498: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6476 + //line php5/php5.y:6478 { yyVAL.node = expr.NewVariable(yyDollar[2].node) @@ -9060,14 +9061,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.DollarOpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.CloseCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.DollarOpenCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 499: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6489 + //line php5/php5.y:6491 { name := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = expr.NewVariable(name) @@ -9077,15 +9078,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.DollarOpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken(name, yyDollar[2].token, comment.StringVarnameToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.CloseCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.DollarOpenCurlyBracesToken) + name.AddComments(yyDollar[2].token.Comments, comment.StringVarnameToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 500: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:6505 + //line php5/php5.y:6507 { identifier := node.NewIdentifier(yyDollar[2].token.Value) variable := expr.NewVariable(identifier) @@ -9097,17 +9098,17 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[6].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.DollarOpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken(variable, yyDollar[2].token, comment.StringVarnameToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.OpenSquareBracket) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[5].token, comment.CloseSquareBracket) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[6].token, comment.CloseCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.DollarOpenCurlyBracesToken) + variable.AddComments(yyDollar[2].token.Comments, comment.StringVarnameToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.OpenSquareBracket) + yyVAL.node.AddComments(yyDollar[5].token.Comments, comment.CloseSquareBracket) + yyVAL.node.AddComments(yyDollar[6].token.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 501: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6525 + //line php5/php5.y:6527 { yyVAL.node = yyDollar[2].node @@ -9115,7 +9116,7 @@ yydefault: } case 502: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6534 + //line php5/php5.y:6536 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) @@ -9123,13 +9124,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.StringToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.StringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 503: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6546 + //line php5/php5.y:6548 { // TODO: add option to handle 64 bit integer if _, err := strconv.Atoi(yyDollar[1].token.Value); err == nil { @@ -9142,13 +9143,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.NumStringToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.NumStringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 504: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6563 + //line php5/php5.y:6565 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(identifier) @@ -9158,13 +9159,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.VariableToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.VariableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 505: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6580 + //line php5/php5.y:6582 { yyVAL.node = expr.NewIsset(yyDollar[3].list) @@ -9172,15 +9173,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.IssetToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseParenthesisToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.IssetToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenParenthesisToken) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 506: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6594 + //line php5/php5.y:6596 { yyVAL.node = expr.NewEmpty(yyDollar[3].node) @@ -9188,15 +9189,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.EmptyToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseParenthesisToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.EmptyToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenParenthesisToken) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 507: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6608 + //line php5/php5.y:6610 { yyVAL.node = expr.NewEmpty(yyDollar[3].node) @@ -9204,15 +9205,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.EmptyToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseParenthesisToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.EmptyToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenParenthesisToken) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 508: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6622 + //line php5/php5.y:6624 { yyVAL.node = expr.NewInclude(yyDollar[2].node) @@ -9220,13 +9221,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.IncludeToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.IncludeToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 509: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6634 + //line php5/php5.y:6636 { yyVAL.node = expr.NewIncludeOnce(yyDollar[2].node) @@ -9234,13 +9235,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.IncludeOnceToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.IncludeOnceToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 510: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6646 + //line php5/php5.y:6648 { yyVAL.node = expr.NewEval(yyDollar[3].node) @@ -9248,15 +9249,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.EvalToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseParenthesisToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.EvalToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenParenthesisToken) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 511: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6660 + //line php5/php5.y:6662 { yyVAL.node = expr.NewRequire(yyDollar[2].node) @@ -9264,13 +9265,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.RequireToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.RequireToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 512: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6672 + //line php5/php5.y:6674 { yyVAL.node = expr.NewRequireOnce(yyDollar[2].node) @@ -9278,13 +9279,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.RequireOnceToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.RequireOnceToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 513: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6687 + //line php5/php5.y:6689 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -9292,18 +9293,18 @@ yydefault: } case 514: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6693 + //line php5/php5.y:6695 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) + lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 515: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6705 + //line php5/php5.y:6707 { yyVAL.node = yyDollar[1].node @@ -9311,7 +9312,7 @@ yydefault: } case 516: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6711 + //line php5/php5.y:6713 { yyVAL.node = yyDollar[1].node @@ -9319,7 +9320,7 @@ yydefault: } case 517: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6720 + //line php5/php5.y:6722 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -9329,13 +9330,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PaamayimNekudotayimToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.PaamayimNekudotayimToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 518: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6734 + //line php5/php5.y:6736 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -9345,13 +9346,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PaamayimNekudotayimToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.PaamayimNekudotayimToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 519: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6751 + //line php5/php5.y:6753 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -9361,13 +9362,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PaamayimNekudotayimToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.PaamayimNekudotayimToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 520: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6768 + //line php5/php5.y:6770 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -9377,7 +9378,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PaamayimNekudotayimToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.PaamayimNekudotayimToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php5/php5.y b/php5/php5.y index c923ef8..e3963e4 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -313,7 +313,7 @@ namespace_name: namePart.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken(namePart, $1, comment.StringToken) + namePart.AddComments($1.Comments, comment.StringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -326,8 +326,8 @@ namespace_name: namePart.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.NsSeparatorToken) - yylex.(*Parser).comments.AddFromToken(namePart, $3, comment.StringToken) + lastNode($1).AddComments($2.Comments, comment.NsSeparatorToken) + namePart.AddComments($3.Comments, comment.StringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -367,10 +367,10 @@ top_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.HaltCompilerToken) - yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.CloseParenthesisToken) - yylex.(*Parser).comments.AddFromToken($$, $4, comment.SemiColonToken) + $$.AddComments($1.Comments, comment.HaltCompilerToken) + $$.AddComments($2.Comments, comment.OpenParenthesisToken) + $$.AddComments($3.Comments, comment.CloseParenthesisToken) + $$.AddComments($4.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -384,8 +384,8 @@ top_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.NamespaceToken) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.SemiColonToken) + $$.AddComments($1.Comments, comment.NamespaceToken) + $$.AddComments($3.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -399,9 +399,9 @@ top_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.NamespaceToken) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken($$, $5, comment.CloseCurlyBracesToken) + $$.AddComments($1.Comments, comment.NamespaceToken) + $$.AddComments($3.Comments, comment.OpenCurlyBracesToken) + $$.AddComments($5.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -413,9 +413,9 @@ top_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.NamespaceToken) - yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseCurlyBracesToken) + $$.AddComments($1.Comments, comment.NamespaceToken) + $$.AddComments($2.Comments, comment.OpenCurlyBracesToken) + $$.AddComments($4.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -427,8 +427,8 @@ top_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.UseToken) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.SemiColonToken) + $$.AddComments($1.Comments, comment.UseToken) + $$.AddComments($3.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -442,9 +442,9 @@ top_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.UseToken) - yylex.(*Parser).comments.AddFromToken(useType, $2, comment.UseToken) - yylex.(*Parser).comments.AddFromToken($$, $4, comment.SemiColonToken) + $$.AddComments($1.Comments, comment.UseToken) + useType.AddComments($2.Comments, comment.UseToken) + $$.AddComments($4.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -458,9 +458,9 @@ top_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.UseToken) - yylex.(*Parser).comments.AddFromToken(useType, $2, comment.UseToken) - yylex.(*Parser).comments.AddFromToken($$, $4, comment.SemiColonToken) + $$.AddComments($1.Comments, comment.UseToken) + useType.AddComments($2.Comments, comment.UseToken) + $$.AddComments($4.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -472,7 +472,7 @@ top_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.SemiColonToken) + $$.AddComments($2.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -484,7 +484,7 @@ use_declarations: $$ = append($1, $3) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) + lastNode($1).AddComments($2.Comments, comment.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -520,8 +520,8 @@ use_declaration: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.AsToken) - yylex.(*Parser).comments.AddFromToken(alias, $3, comment.StringToken) + $$.AddComments($2.Comments, comment.AsToken) + alias.AddComments($3.Comments, comment.StringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -535,7 +535,7 @@ use_declaration: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.NsSeparatorToken) + $$.AddComments($1.Comments, comment.NsSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -551,9 +551,9 @@ use_declaration: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($2, $4)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.NsSeparatorToken) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.AsToken) - yylex.(*Parser).comments.AddFromToken($$, $4, comment.StringToken) + $$.AddComments($1.Comments, comment.NsSeparatorToken) + $$.AddComments($3.Comments, comment.AsToken) + $$.AddComments($4.Comments, comment.StringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -565,7 +565,7 @@ use_function_declarations: $$ = append($1, $3) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) + lastNode($1).AddComments($2.Comments, comment.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -601,8 +601,8 @@ use_function_declaration: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.AsToken) - yylex.(*Parser).comments.AddFromToken(alias, $3, comment.StringToken) + $$.AddComments($2.Comments, comment.AsToken) + alias.AddComments($3.Comments, comment.StringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -616,7 +616,7 @@ use_function_declaration: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.NsSeparatorToken) + $$.AddComments($1.Comments, comment.NsSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -632,9 +632,9 @@ use_function_declaration: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($2, $4)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.NsSeparatorToken) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.AsToken) - yylex.(*Parser).comments.AddFromToken($$, $4, comment.StringToken) + $$.AddComments($1.Comments, comment.NsSeparatorToken) + $$.AddComments($3.Comments, comment.AsToken) + $$.AddComments($4.Comments, comment.StringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -646,7 +646,7 @@ use_const_declarations: $$ = append($1, $3) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) + lastNode($1).AddComments($2.Comments, comment.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -682,8 +682,8 @@ use_const_declaration: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.AsToken) - yylex.(*Parser).comments.AddFromToken(alias, $3, comment.StringToken) + $$.AddComments($2.Comments, comment.AsToken) + alias.AddComments($3.Comments, comment.StringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -697,7 +697,7 @@ use_const_declaration: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.NsSeparatorToken) + $$.AddComments($1.Comments, comment.NsSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -713,9 +713,9 @@ use_const_declaration: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($2, $4)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.NsSeparatorToken) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.AsToken) - yylex.(*Parser).comments.AddFromToken($$, $4, comment.StringToken) + $$.AddComments($1.Comments, comment.NsSeparatorToken) + $$.AddComments($3.Comments, comment.AsToken) + $$.AddComments($4.Comments, comment.StringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -736,9 +736,9 @@ constant_declaration: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeNodeListPosition($1, constList.Consts)) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode(constList.Consts), $2, comment.CommaToken) - yylex.(*Parser).comments.AddFromToken(name, $3, comment.StringToken) - yylex.(*Parser).comments.AddFromToken(constant, $4, comment.EqualToken) + lastNode(constList.Consts).AddComments($2.Comments, comment.CommaToken) + name.AddComments($3.Comments, comment.StringToken) + constant.AddComments($4.Comments, comment.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -755,9 +755,9 @@ constant_declaration: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, constList)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.ConstToken) - yylex.(*Parser).comments.AddFromToken(name, $2, comment.StringToken) - yylex.(*Parser).comments.AddFromToken(constant, $3, comment.EqualToken) + $$.AddComments($1.Comments, comment.ConstToken) + name.AddComments($2.Comments, comment.StringToken) + constant.AddComments($3.Comments, comment.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -815,10 +815,10 @@ inner_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.HaltCompilerToken) - yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.CloseParenthesisToken) - yylex.(*Parser).comments.AddFromToken($$, $4, comment.SemiColonToken) + $$.AddComments($1.Comments, comment.HaltCompilerToken) + $$.AddComments($2.Comments, comment.OpenParenthesisToken) + $$.AddComments($3.Comments, comment.CloseParenthesisToken) + $$.AddComments($4.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -842,8 +842,8 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken(label, $1, comment.StringToken) - yylex.(*Parser).comments.AddFromToken($$, $2, comment.ColonToken) + label.AddComments($1.Comments, comment.StringToken) + $$.AddComments($2.Comments, comment.ColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -858,8 +858,8 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.CloseCurlyBracesToken) + $$.AddComments($1.Comments, comment.OpenCurlyBracesToken) + $$.AddComments($3.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -877,7 +877,7 @@ unticked_statement: } // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.IfToken) + $$.AddComments($1.Comments, comment.IfToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -891,10 +891,10 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $8)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.IfToken) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.ColonToken) - yylex.(*Parser).comments.AddFromToken($$, $7, comment.EndifToken) - yylex.(*Parser).comments.AddFromToken($$, $8, comment.SemiColonToken) + $$.AddComments($1.Comments, comment.IfToken) + $$.AddComments($3.Comments, comment.ColonToken) + $$.AddComments($7.Comments, comment.EndifToken) + $$.AddComments($8.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -913,7 +913,7 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.WhileToken) + $$.AddComments($1.Comments, comment.WhileToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -925,9 +925,9 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.DoToken) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.WhileToken) - yylex.(*Parser).comments.AddFromToken($$, $5, comment.SemiColonToken) + $$.AddComments($1.Comments, comment.DoToken) + $$.AddComments($3.Comments, comment.WhileToken) + $$.AddComments($5.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -950,11 +950,11 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $9)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.ForToken) - yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken($$, $4, comment.ForInitSemicolonToken) - yylex.(*Parser).comments.AddFromToken($$, $6, comment.ForCondSemicolonToken) - yylex.(*Parser).comments.AddFromToken($$, $8, comment.CloseParenthesisToken) + $$.AddComments($1.Comments, comment.ForToken) + $$.AddComments($2.Comments, comment.OpenParenthesisToken) + $$.AddComments($4.Comments, comment.ForInitSemicolonToken) + $$.AddComments($6.Comments, comment.ForCondSemicolonToken) + $$.AddComments($8.Comments, comment.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -975,7 +975,7 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.SwitchToken) + $$.AddComments($1.Comments, comment.SwitchToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -987,8 +987,8 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.BreakToken) - yylex.(*Parser).comments.AddFromToken($$, $2, comment.SemiColonToken) + $$.AddComments($1.Comments, comment.BreakToken) + $$.AddComments($2.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1000,8 +1000,8 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.BreakToken) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.SemiColonToken) + $$.AddComments($1.Comments, comment.BreakToken) + $$.AddComments($3.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1013,8 +1013,8 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.ContinueToken) - yylex.(*Parser).comments.AddFromToken($$, $2, comment.SemiColonToken) + $$.AddComments($1.Comments, comment.ContinueToken) + $$.AddComments($2.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1026,8 +1026,8 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.ContinueToken) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.SemiColonToken) + $$.AddComments($1.Comments, comment.ContinueToken) + $$.AddComments($3.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1039,8 +1039,8 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.ReturnToken) - yylex.(*Parser).comments.AddFromToken($$, $2, comment.SemiColonToken) + $$.AddComments($1.Comments, comment.ReturnToken) + $$.AddComments($2.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1052,8 +1052,8 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.ReturnToken) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.SemiColonToken) + $$.AddComments($1.Comments, comment.ReturnToken) + $$.AddComments($3.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1065,8 +1065,8 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.ReturnToken) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.SemiColonToken) + $$.AddComments($1.Comments, comment.ReturnToken) + $$.AddComments($3.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1078,7 +1078,7 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.SemiColonToken) + $$.AddComments($2.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1090,8 +1090,8 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.GlobalToken) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.SemiColonToken) + $$.AddComments($1.Comments, comment.GlobalToken) + $$.AddComments($3.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1103,8 +1103,8 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.StaticToken) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.SemiColonToken) + $$.AddComments($1.Comments, comment.StaticToken) + $$.AddComments($3.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1116,8 +1116,8 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.EchoToken) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.SemiColonToken) + $$.AddComments($1.Comments, comment.EchoToken) + $$.AddComments($3.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1129,7 +1129,7 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.InlineHTMLToken) + $$.AddComments($1.Comments, comment.InlineHTMLToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1141,7 +1141,7 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.SemiColonToken) + $$.AddComments($2.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1153,10 +1153,10 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.UnsetToken) - yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseParenthesisToken) - yylex.(*Parser).comments.AddFromToken($$, $5, comment.SemiColonToken) + $$.AddComments($1.Comments, comment.UnsetToken) + $$.AddComments($2.Comments, comment.OpenParenthesisToken) + $$.AddComments($4.Comments, comment.CloseParenthesisToken) + $$.AddComments($5.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1190,10 +1190,10 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $8)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.ForeachToken) - yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken($$, $4, comment.AsToken) - yylex.(*Parser).comments.AddFromToken($$, $7, comment.CloseParenthesisToken) + $$.AddComments($1.Comments, comment.ForeachToken) + $$.AddComments($2.Comments, comment.OpenParenthesisToken) + $$.AddComments($4.Comments, comment.AsToken) + $$.AddComments($7.Comments, comment.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1227,10 +1227,10 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $8)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.ForeachToken) - yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken($$, $4, comment.AsToken) - yylex.(*Parser).comments.AddFromToken($$, $7, comment.CloseParenthesisToken) + $$.AddComments($1.Comments, comment.ForeachToken) + $$.AddComments($2.Comments, comment.OpenParenthesisToken) + $$.AddComments($4.Comments, comment.AsToken) + $$.AddComments($7.Comments, comment.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1242,9 +1242,9 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.DeclareToken) - yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseParenthesisToken) + $$.AddComments($1.Comments, comment.DeclareToken) + $$.AddComments($2.Comments, comment.OpenParenthesisToken) + $$.AddComments($4.Comments, comment.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1256,7 +1256,7 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.SemiColonToken) + $$.AddComments($1.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1272,9 +1272,9 @@ unticked_statement: } // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.TryToken) - yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseCurlyBracesToken) + $$.AddComments($1.Comments, comment.TryToken) + $$.AddComments($2.Comments, comment.OpenCurlyBracesToken) + $$.AddComments($4.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1286,8 +1286,8 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.ThrowToken) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.SemiColonToken) + $$.AddComments($1.Comments, comment.ThrowToken) + $$.AddComments($3.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1301,9 +1301,9 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.GotoToken) - yylex.(*Parser).comments.AddFromToken(label, $2, comment.StringToken) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.SemiColonToken) + $$.AddComments($1.Comments, comment.GotoToken) + label.AddComments($2.Comments, comment.StringToken) + $$.AddComments($3.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1329,12 +1329,12 @@ catch_statement: catch.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $8)) // save comments - yylex.(*Parser).comments.AddFromToken(catch, $1, comment.CatchToken) - yylex.(*Parser).comments.AddFromToken(catch, $2, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken(variable, $4, comment.StringToken) - yylex.(*Parser).comments.AddFromToken(catch, $5, comment.CloseParenthesisToken) - yylex.(*Parser).comments.AddFromToken(catch, $6, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken(catch, $8, comment.CloseCurlyBracesToken) + catch.AddComments($1.Comments, comment.CatchToken) + catch.AddComments($2.Comments, comment.OpenParenthesisToken) + variable.AddComments($4.Comments, comment.StringToken) + catch.AddComments($5.Comments, comment.CloseParenthesisToken) + catch.AddComments($6.Comments, comment.OpenCurlyBracesToken) + catch.AddComments($8.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1355,9 +1355,9 @@ finally_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.FinallyToken) - yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseCurlyBracesToken) + $$.AddComments($1.Comments, comment.FinallyToken) + $$.AddComments($2.Comments, comment.OpenCurlyBracesToken) + $$.AddComments($4.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1406,12 +1406,12 @@ additional_catch: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $8)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.CatchToken) - yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken(variable, $4, comment.StringToken) - yylex.(*Parser).comments.AddFromToken($$, $5, comment.CloseParenthesisToken) - yylex.(*Parser).comments.AddFromToken($$, $6, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken($$, $8, comment.CloseCurlyBracesToken) + $$.AddComments($1.Comments, comment.CatchToken) + $$.AddComments($2.Comments, comment.OpenParenthesisToken) + variable.AddComments($4.Comments, comment.StringToken) + $$.AddComments($5.Comments, comment.CloseParenthesisToken) + $$.AddComments($6.Comments, comment.OpenCurlyBracesToken) + $$.AddComments($8.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1429,7 +1429,7 @@ unset_variables: $$ = append($1, $3) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) + lastNode($1).AddComments($2.Comments, comment.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1495,15 +1495,15 @@ unticked_function_declaration_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $9)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.FunctionToken) + $$.AddComments($1.Comments, comment.FunctionToken) if $2 != nil { - yylex.(*Parser).comments.AddFromToken($$, $2, comment.AmpersandToken) + $$.AddComments($2.Comments, comment.AmpersandToken) } - yylex.(*Parser).comments.AddFromToken(name, $3, comment.StringToken) - yylex.(*Parser).comments.AddFromToken($$, $4, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken($$, $6, comment.CloseParenthesisToken) - yylex.(*Parser).comments.AddFromToken($$, $7, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken($$, $9, comment.CloseCurlyBracesToken) + name.AddComments($3.Comments, comment.StringToken) + $$.AddComments($4.Comments, comment.OpenParenthesisToken) + $$.AddComments($6.Comments, comment.CloseParenthesisToken) + $$.AddComments($7.Comments, comment.OpenCurlyBracesToken) + $$.AddComments($9.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1532,9 +1532,9 @@ unticked_class_declaration_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $7)) // save comments - yylex.(*Parser).comments.AddFromToken(name, $2, comment.StringToken) - yylex.(*Parser).comments.AddFromToken($$, $5, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken($$, $7, comment.CloseCurlyBracesToken) + name.AddComments($2.Comments, comment.StringToken) + $$.AddComments($5.Comments, comment.OpenCurlyBracesToken) + $$.AddComments($7.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1548,9 +1548,9 @@ unticked_class_declaration_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $6)) // save comments - yylex.(*Parser).comments.AddFromToken(name, $2, comment.StringToken) - yylex.(*Parser).comments.AddFromToken($$, $4, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken($$, $6, comment.CloseCurlyBracesToken) + name.AddComments($2.Comments, comment.StringToken) + $$.AddComments($4.Comments, comment.OpenCurlyBracesToken) + $$.AddComments($6.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1566,7 +1566,7 @@ class_entry_type: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.ClassToken) + $$.AddComments($1.Comments, comment.ClassToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1580,8 +1580,8 @@ class_entry_type: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken(classModifier, $1, comment.AbstractToken) - yylex.(*Parser).comments.AddFromToken($$, $2, comment.ClassToken) + classModifier.AddComments($1.Comments, comment.AbstractToken) + $$.AddComments($2.Comments, comment.ClassToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1593,7 +1593,7 @@ class_entry_type: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.TraitToken) + $$.AddComments($1.Comments, comment.TraitToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1607,8 +1607,8 @@ class_entry_type: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken(classModifier, $1, comment.FinalToken) - yylex.(*Parser).comments.AddFromToken($$, $2, comment.ClassToken) + classModifier.AddComments($1.Comments, comment.FinalToken) + $$.AddComments($2.Comments, comment.ClassToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1629,7 +1629,7 @@ extends_from: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.ExtendsToken) + $$.AddComments($1.Comments, comment.ExtendsToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1657,7 +1657,7 @@ interface_extends_list: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.ExtendsToken) + $$.AddComments($1.Comments, comment.ExtendsToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1678,7 +1678,7 @@ implements_list: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.ImplementsToken) + $$.AddComments($1.Comments, comment.ImplementsToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1696,7 +1696,7 @@ interface_list: $$ = append($1, $3) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) + lastNode($1).AddComments($2.Comments, comment.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1714,7 +1714,7 @@ foreach_optional_arg: $$ = $2 // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.DoubleArrowToken) + $$.AddComments($1.Comments, comment.DoubleArrowToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1735,7 +1735,7 @@ foreach_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.AmpersandToken) + $$.AddComments($1.Comments, comment.AmpersandToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1747,9 +1747,9 @@ foreach_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.ListToken) - yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseParenthesisToken) + $$.AddComments($1.Comments, comment.ListToken) + $$.AddComments($2.Comments, comment.OpenParenthesisToken) + $$.AddComments($4.Comments, comment.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1775,9 +1775,9 @@ for_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.ColonToken) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.EndforToken) - yylex.(*Parser).comments.AddFromToken($$, $4, comment.SemiColonToken) + $$.AddComments($1.Comments, comment.ColonToken) + $$.AddComments($3.Comments, comment.EndforToken) + $$.AddComments($4.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1803,9 +1803,9 @@ foreach_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.ColonToken) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.EndforeachToken) - yylex.(*Parser).comments.AddFromToken($$, $4, comment.SemiColonToken) + $$.AddComments($1.Comments, comment.ColonToken) + $$.AddComments($3.Comments, comment.EndforeachToken) + $$.AddComments($4.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1827,9 +1827,9 @@ declare_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.ColonToken) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.EnddeclareToken) - yylex.(*Parser).comments.AddFromToken($$, $4, comment.SemiColonToken) + $$.AddComments($1.Comments, comment.ColonToken) + $$.AddComments($3.Comments, comment.EnddeclareToken) + $$.AddComments($4.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1848,8 +1848,8 @@ declare_list: constant.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken(name, $1, comment.StringToken) - yylex.(*Parser).comments.AddFromToken(constant, $2, comment.EqualToken) + name.AddComments($1.Comments, comment.StringToken) + constant.AddComments($2.Comments, comment.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1864,9 +1864,9 @@ declare_list: constant.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $5)) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) - yylex.(*Parser).comments.AddFromToken(name, $3, comment.StringToken) - yylex.(*Parser).comments.AddFromToken(constant, $4, comment.EqualToken) + lastNode($1).AddComments($2.Comments, comment.CommaToken) + name.AddComments($3.Comments, comment.StringToken) + constant.AddComments($4.Comments, comment.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1884,8 +1884,8 @@ switch_case_list: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken(caseList, $1, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken(caseList, $3, comment.CloseCurlyBracesToken) + caseList.AddComments($1.Comments, comment.OpenCurlyBracesToken) + caseList.AddComments($3.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1899,9 +1899,9 @@ switch_case_list: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddFromToken(caseList, $1, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken(caseList, $2, comment.SemiColonToken) - yylex.(*Parser).comments.AddFromToken(caseList, $4, comment.CloseCurlyBracesToken) + caseList.AddComments($1.Comments, comment.OpenCurlyBracesToken) + caseList.AddComments($2.Comments, comment.SemiColonToken) + caseList.AddComments($4.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1915,9 +1915,9 @@ switch_case_list: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddFromToken(caseList, $1, comment.ColonToken) - yylex.(*Parser).comments.AddFromToken(caseList, $3, comment.EndswitchToken) - yylex.(*Parser).comments.AddFromToken($$, $4, comment.SemiColonToken) + caseList.AddComments($1.Comments, comment.ColonToken) + caseList.AddComments($3.Comments, comment.EndswitchToken) + $$.AddComments($4.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1932,10 +1932,10 @@ switch_case_list: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5)) // save comments - yylex.(*Parser).comments.AddFromToken(caseList, $1, comment.ColonToken) - yylex.(*Parser).comments.AddFromToken(caseList, $2, comment.SemiColonToken) - yylex.(*Parser).comments.AddFromToken(caseList, $4, comment.EndswitchToken) - yylex.(*Parser).comments.AddFromToken($$, $5, comment.SemiColonToken) + caseList.AddComments($1.Comments, comment.ColonToken) + caseList.AddComments($2.Comments, comment.SemiColonToken) + caseList.AddComments($4.Comments, comment.EndswitchToken) + $$.AddComments($5.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1958,8 +1958,8 @@ case_list: _case.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $5)) // save comments - yylex.(*Parser).comments.AddFromToken(_case, $2, comment.CaseToken) - yylex.(*Parser).comments.AddFromToken(_case, $4, comment.CaseSeparatorToken) + _case.AddComments($2.Comments, comment.CaseToken) + _case.AddComments($4.Comments, comment.CaseSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1972,8 +1972,8 @@ case_list: _default.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $4)) // save comments - yylex.(*Parser).comments.AddFromToken(_default, $2, comment.DefaultToken) - yylex.(*Parser).comments.AddFromToken(_default, $3, comment.CaseSeparatorToken) + _default.AddComments($2.Comments, comment.DefaultToken) + _default.AddComments($3.Comments, comment.CaseSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2012,9 +2012,9 @@ while_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.ColonToken) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.EndwhileToken) - yylex.(*Parser).comments.AddFromToken($$, $4, comment.SemiColonToken) + $$.AddComments($1.Comments, comment.ColonToken) + $$.AddComments($3.Comments, comment.EndwhileToken) + $$.AddComments($4.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2038,7 +2038,7 @@ elseif_list: _elseIf.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $4)) // save comments - yylex.(*Parser).comments.AddFromToken(_elseIf, $2, comment.ElseifToken) + _elseIf.AddComments($2.Comments, comment.ElseifToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2063,8 +2063,8 @@ new_elseif_list: _elseIf.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $5)) // save comments - yylex.(*Parser).comments.AddFromToken(_elseIf, $2, comment.ElseifToken) - yylex.(*Parser).comments.AddFromToken(_elseIf, $4, comment.ColonToken) + _elseIf.AddComments($2.Comments, comment.ElseifToken) + _elseIf.AddComments($4.Comments, comment.ColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2086,7 +2086,7 @@ else_single: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.ElseToken) + $$.AddComments($1.Comments, comment.ElseToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2110,8 +2110,8 @@ new_else_single: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.ElseToken) - yylex.(*Parser).comments.AddFromToken($$, $2, comment.ColonToken) + $$.AddComments($1.Comments, comment.ElseToken) + $$.AddComments($2.Comments, comment.ColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2145,7 +2145,7 @@ non_empty_parameter_list: $$ = append($1, $3) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) + lastNode($1).AddComments($2.Comments, comment.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2173,12 +2173,12 @@ parameter: // save comments if $2 != nil { - yylex.(*Parser).comments.AddFromToken($$, $2, comment.AmpersandToken) + $$.AddComments($2.Comments, comment.AmpersandToken) } if $3 != nil { - yylex.(*Parser).comments.AddFromToken($$, $3, comment.EllipsisToken) + $$.AddComments($3.Comments, comment.EllipsisToken) } - yylex.(*Parser).comments.AddFromToken(variable, $4, comment.VariableToken) + variable.AddComments($4.Comments, comment.VariableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2203,13 +2203,13 @@ parameter: // save comments if $2 != nil { - yylex.(*Parser).comments.AddFromToken($$, $2, comment.AmpersandToken) + $$.AddComments($2.Comments, comment.AmpersandToken) } if $3 != nil { - yylex.(*Parser).comments.AddFromToken($$, $3, comment.EllipsisToken) + $$.AddComments($3.Comments, comment.EllipsisToken) } - yylex.(*Parser).comments.AddFromToken(variable, $4, comment.VariableToken) - yylex.(*Parser).comments.AddFromToken($$, $5, comment.EqualToken) + variable.AddComments($4.Comments, comment.VariableToken) + $$.AddComments($5.Comments, comment.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2231,7 +2231,7 @@ optional_class_type: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.ArrayToken) + $$.AddComments($1.Comments, comment.ArrayToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2243,7 +2243,7 @@ optional_class_type: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.CallableToken) + $$.AddComments($1.Comments, comment.CallableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2265,8 +2265,8 @@ function_call_parameter_list: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken($$, $2, comment.CloseParenthesisToken) + $$.AddComments($1.Comments, comment.OpenParenthesisToken) + $$.AddComments($2.Comments, comment.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2278,8 +2278,8 @@ function_call_parameter_list: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.CloseParenthesisToken) + $$.AddComments($1.Comments, comment.OpenParenthesisToken) + $$.AddComments($3.Comments, comment.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2293,8 +2293,8 @@ function_call_parameter_list: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.CloseParenthesisToken) + $$.AddComments($1.Comments, comment.OpenParenthesisToken) + $$.AddComments($3.Comments, comment.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2313,7 +2313,7 @@ non_empty_function_call_parameter_list: $$ = append($1, $3) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) + lastNode($1).AddComments($2.Comments, comment.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2346,7 +2346,7 @@ function_call_parameter: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.AmpersandToken) + $$.AddComments($1.Comments, comment.AmpersandToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2358,7 +2358,7 @@ function_call_parameter: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.EllipsisToken) + $$.AddComments($1.Comments, comment.EllipsisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2370,7 +2370,7 @@ global_var_list: $$ = append($1, $3) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) + lastNode($1).AddComments($2.Comments, comment.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2394,7 +2394,7 @@ global_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.VariableToken) + $$.AddComments($1.Comments, comment.VariableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2406,7 +2406,7 @@ global_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.DollarToken) + $$.AddComments($1.Comments, comment.DollarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2418,9 +2418,9 @@ global_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.DollarToken) - yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseCurlyBracesToken) + $$.AddComments($1.Comments, comment.DollarToken) + $$.AddComments($2.Comments, comment.OpenCurlyBracesToken) + $$.AddComments($4.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2441,8 +2441,8 @@ static_var_list: staticVar.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) - yylex.(*Parser).comments.AddFromToken(variable, $3, comment.VariableToken) + lastNode($1).AddComments($2.Comments, comment.CommaToken) + variable.AddComments($3.Comments, comment.VariableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2459,9 +2459,9 @@ static_var_list: staticVar.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $5)) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) - yylex.(*Parser).comments.AddFromToken(variable, $3, comment.VariableToken) - yylex.(*Parser).comments.AddFromToken(staticVar, $4, comment.EqualToken) + lastNode($1).AddComments($2.Comments, comment.CommaToken) + variable.AddComments($3.Comments, comment.VariableToken) + staticVar.AddComments($4.Comments, comment.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2478,7 +2478,7 @@ static_var_list: staticVar.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken(variable, $1, comment.VariableToken) + variable.AddComments($1.Comments, comment.VariableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2495,8 +2495,8 @@ static_var_list: staticVar.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken(variable, $1, comment.VariableToken) - yylex.(*Parser).comments.AddFromToken(staticVar, $2, comment.EqualToken) + variable.AddComments($1.Comments, comment.VariableToken) + staticVar.AddComments($2.Comments, comment.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2528,7 +2528,7 @@ class_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $3, comment.SemiColonToken) + $$.AddComments($3.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2540,7 +2540,7 @@ class_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.SemiColonToken) + $$.AddComments($2.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2564,13 +2564,13 @@ class_statement: } // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.FunctionToken) + $$.AddComments($2.Comments, comment.FunctionToken) if $3 != nil { - yylex.(*Parser).comments.AddFromToken($$, $3, comment.AmpersandToken) + $$.AddComments($3.Comments, comment.AmpersandToken) } - yylex.(*Parser).comments.AddFromToken(name, $4, comment.IdentifierToken) - yylex.(*Parser).comments.AddFromToken($$, $5, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken($$, $7, comment.CloseParenthesisToken) + name.AddComments($4.Comments, comment.IdentifierToken) + $$.AddComments($5.Comments, comment.OpenParenthesisToken) + $$.AddComments($7.Comments, comment.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2592,7 +2592,7 @@ trait_use_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.UseToken) + $$.AddComments($1.Comments, comment.UseToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2610,7 +2610,7 @@ trait_list: $$ = append($1, $3) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) + lastNode($1).AddComments($2.Comments, comment.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2624,7 +2624,7 @@ trait_adaptations: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.SemiColonToken) + $$.AddComments($1.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -2636,8 +2636,8 @@ trait_adaptations: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.CloseCurlyBracesToken) + $$.AddComments($1.Comments, comment.OpenCurlyBracesToken) + $$.AddComments($3.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2679,7 +2679,7 @@ trait_adaptation_statement: $$ = $1; // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.SemiColonToken) + $$.AddComments($2.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2688,7 +2688,7 @@ trait_adaptation_statement: $$ = $1; // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.SemiColonToken) + $$.AddComments($2.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2703,7 +2703,7 @@ trait_precedence: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeNodeListPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.InsteadofToken) + $$.AddComments($2.Comments, comment.InsteadofToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2721,7 +2721,7 @@ trait_reference_list: $$ = append($1, $3) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) + lastNode($1).AddComments($2.Comments, comment.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2738,7 +2738,7 @@ trait_method_reference: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken(name, $1, comment.IdentifierToken) + name.AddComments($1.Comments, comment.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2761,8 +2761,8 @@ trait_method_reference_fully_qualified: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.PaamayimNekudotayimToken) - yylex.(*Parser).comments.AddFromToken(target, $3, comment.IdentifierToken) + $$.AddComments($2.Comments, comment.PaamayimNekudotayimToken) + target.AddComments($3.Comments, comment.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2779,8 +2779,8 @@ trait_alias: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.AsToken) - yylex.(*Parser).comments.AddFromToken(alias, $4, comment.IdentifierToken) + $$.AddComments($2.Comments, comment.AsToken) + alias.AddComments($4.Comments, comment.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2792,7 +2792,7 @@ trait_alias: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.AsToken) + $$.AddComments($2.Comments, comment.AsToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2822,7 +2822,7 @@ method_body: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.SemiColonToken) + $$.AddComments($1.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2834,8 +2834,8 @@ method_body: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.CloseCurlyBracesToken) + $$.AddComments($1.Comments, comment.OpenCurlyBracesToken) + $$.AddComments($3.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2857,7 +2857,7 @@ variable_modifiers: modifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken(modifier, $1, comment.VarToken) + modifier.AddComments($1.Comments, comment.VarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2902,7 +2902,7 @@ member_modifier: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.PublicToken) + $$.AddComments($1.Comments, comment.PublicToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2914,7 +2914,7 @@ member_modifier: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.ProtectedToken) + $$.AddComments($1.Comments, comment.ProtectedToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2926,7 +2926,7 @@ member_modifier: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.PrivateToken) + $$.AddComments($1.Comments, comment.PrivateToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2938,7 +2938,7 @@ member_modifier: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.StaticToken) + $$.AddComments($1.Comments, comment.StaticToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2950,7 +2950,7 @@ member_modifier: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.AbstractToken) + $$.AddComments($1.Comments, comment.AbstractToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2962,7 +2962,7 @@ member_modifier: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.FinalToken) + $$.AddComments($1.Comments, comment.FinalToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2982,8 +2982,8 @@ class_variable_declaration: property.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) - yylex.(*Parser).comments.AddFromToken(variable, $3, comment.VariableToken) + lastNode($1).AddComments($2.Comments, comment.CommaToken) + variable.AddComments($3.Comments, comment.VariableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3000,9 +3000,9 @@ class_variable_declaration: property.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $5)) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) - yylex.(*Parser).comments.AddFromToken(variable, $3, comment.VariableToken) - yylex.(*Parser).comments.AddFromToken(property, $4, comment.EqualToken) + lastNode($1).AddComments($2.Comments, comment.CommaToken) + variable.AddComments($3.Comments, comment.VariableToken) + property.AddComments($4.Comments, comment.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3019,7 +3019,7 @@ class_variable_declaration: property.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken(variable, $1, comment.VariableToken) + variable.AddComments($1.Comments, comment.VariableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3036,8 +3036,8 @@ class_variable_declaration: property.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken(variable, $1, comment.VariableToken) - yylex.(*Parser).comments.AddFromToken(property, $2, comment.EqualToken) + variable.AddComments($1.Comments, comment.VariableToken) + property.AddComments($2.Comments, comment.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3058,9 +3058,9 @@ class_constant_declaration: $1.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $5)) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode(constList.Consts), $2, comment.CommaToken) - yylex.(*Parser).comments.AddFromToken(name, $3, comment.IdentifierToken) - yylex.(*Parser).comments.AddFromToken(constant, $4, comment.EqualToken) + lastNode(constList.Consts).AddComments($2.Comments, comment.CommaToken) + name.AddComments($3.Comments, comment.IdentifierToken) + constant.AddComments($4.Comments, comment.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3076,9 +3076,9 @@ class_constant_declaration: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $4)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.ConstToken) - yylex.(*Parser).comments.AddFromToken(name, $2, comment.IdentifierToken) - yylex.(*Parser).comments.AddFromToken(constant, $3, comment.EqualToken) + $$.AddComments($1.Comments, comment.ConstToken) + name.AddComments($2.Comments, comment.IdentifierToken) + constant.AddComments($3.Comments, comment.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3090,7 +3090,7 @@ echo_expr_list: $$ = append($1, $3) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) + lastNode($1).AddComments($2.Comments, comment.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3124,7 +3124,7 @@ non_empty_for_expr: $$ = append($1, $3) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) + lastNode($1).AddComments($2.Comments, comment.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3161,8 +3161,8 @@ chaining_dereference: fetch.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($3)) // save comments - yylex.(*Parser).comments.AddFromToken(fetch, $2, comment.OpenSquareBracket) - yylex.(*Parser).comments.AddFromToken(fetch, $4, comment.CloseSquareBracket) + fetch.AddComments($2.Comments, comment.OpenSquareBracket) + fetch.AddComments($4.Comments, comment.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3175,8 +3175,8 @@ chaining_dereference: fetch.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($2)) // save comments - yylex.(*Parser).comments.AddFromToken(fetch, $1, comment.OpenSquareBracket) - yylex.(*Parser).comments.AddFromToken(fetch, $3, comment.CloseSquareBracket) + fetch.AddComments($1.Comments, comment.OpenSquareBracket) + fetch.AddComments($3.Comments, comment.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3231,7 +3231,7 @@ new_expr: } // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.NewToken) + $$.AddComments($1.Comments, comment.NewToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3248,10 +3248,10 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $6)) // save comments - yylex.(*Parser).comments.AddFromToken(list, $1, comment.ListToken) - yylex.(*Parser).comments.AddFromToken(list, $2, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken(list, $4, comment.CloseParenthesisToken) - yylex.(*Parser).comments.AddFromToken($$, $5, comment.EqualToken) + list.AddComments($1.Comments, comment.ListToken) + list.AddComments($2.Comments, comment.OpenParenthesisToken) + list.AddComments($4.Comments, comment.CloseParenthesisToken) + $$.AddComments($5.Comments, comment.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3263,7 +3263,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.EqualToken) + $$.AddComments($2.Comments, comment.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3275,8 +3275,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.EqualToken) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.AmpersandToken) + $$.AddComments($2.Comments, comment.EqualToken) + $$.AddComments($3.Comments, comment.AmpersandToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3300,9 +3300,9 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, _new)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.EqualToken) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.AmpersandToken) - yylex.(*Parser).comments.AddFromToken(_new, $4, comment.NewToken) + $$.AddComments($2.Comments, comment.EqualToken) + $$.AddComments($3.Comments, comment.AmpersandToken) + _new.AddComments($4.Comments, comment.NewToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3314,7 +3314,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.CloneToken) + $$.AddComments($1.Comments, comment.CloneToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3326,7 +3326,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.PlusEqualToken) + $$.AddComments($2.Comments, comment.PlusEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3338,7 +3338,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.MinusEqualToken) + $$.AddComments($2.Comments, comment.MinusEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3350,7 +3350,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.MulEqualToken) + $$.AddComments($2.Comments, comment.MulEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3362,7 +3362,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.PowEqualToken) + $$.AddComments($2.Comments, comment.PowEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3374,7 +3374,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.DivEqualToken) + $$.AddComments($2.Comments, comment.DivEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3386,7 +3386,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.ConcatEqualToken) + $$.AddComments($2.Comments, comment.ConcatEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3398,7 +3398,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.ModEqualToken) + $$.AddComments($2.Comments, comment.ModEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3410,7 +3410,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.AndEqualToken) + $$.AddComments($2.Comments, comment.AndEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3422,7 +3422,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.OrEqualToken) + $$.AddComments($2.Comments, comment.OrEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3434,7 +3434,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.XorEqualToken) + $$.AddComments($2.Comments, comment.XorEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3446,7 +3446,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.SlEqualToken) + $$.AddComments($2.Comments, comment.SlEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3458,7 +3458,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.SrEqualToken) + $$.AddComments($2.Comments, comment.SrEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3470,7 +3470,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.IncToken) + $$.AddComments($2.Comments, comment.IncToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3482,7 +3482,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.IncToken) + $$.AddComments($1.Comments, comment.IncToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3494,7 +3494,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.DecToken) + $$.AddComments($2.Comments, comment.DecToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3506,7 +3506,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.DecToken) + $$.AddComments($1.Comments, comment.DecToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3518,7 +3518,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.BooleanOrToken) + $$.AddComments($2.Comments, comment.BooleanOrToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3530,7 +3530,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.BooleanAndToken) + $$.AddComments($2.Comments, comment.BooleanAndToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3542,7 +3542,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.LogicalOrToken) + $$.AddComments($2.Comments, comment.LogicalOrToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3554,7 +3554,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.LogicalAndToken) + $$.AddComments($2.Comments, comment.LogicalAndToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3566,7 +3566,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.LogicalXorToken) + $$.AddComments($2.Comments, comment.LogicalXorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3578,7 +3578,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.VerticalBarToken) + $$.AddComments($2.Comments, comment.VerticalBarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3590,7 +3590,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.AmpersandToken) + $$.AddComments($2.Comments, comment.AmpersandToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3602,7 +3602,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.CaretToken) + $$.AddComments($2.Comments, comment.CaretToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3614,7 +3614,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.DotToken) + $$.AddComments($2.Comments, comment.DotToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3626,7 +3626,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.PlusToken) + $$.AddComments($2.Comments, comment.PlusToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3638,7 +3638,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.MinusToken) + $$.AddComments($2.Comments, comment.MinusToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3650,7 +3650,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.AsteriskToken) + $$.AddComments($2.Comments, comment.AsteriskToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3662,7 +3662,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.PowToken) + $$.AddComments($2.Comments, comment.PowToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3674,7 +3674,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.SlashToken) + $$.AddComments($2.Comments, comment.SlashToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3686,7 +3686,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.PercentToken) + $$.AddComments($2.Comments, comment.PercentToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3698,7 +3698,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.SlToken) + $$.AddComments($2.Comments, comment.SlToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3710,7 +3710,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.SrToken) + $$.AddComments($2.Comments, comment.SrToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3722,7 +3722,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.PlusToken) + $$.AddComments($1.Comments, comment.PlusToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3734,7 +3734,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.MinusToken) + $$.AddComments($1.Comments, comment.MinusToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3746,7 +3746,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.ExclamationMarkToken) + $$.AddComments($1.Comments, comment.ExclamationMarkToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3758,7 +3758,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.TildeToken) + $$.AddComments($1.Comments, comment.TildeToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3770,7 +3770,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.IsIdenticalToken) + $$.AddComments($2.Comments, comment.IsIdenticalToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3782,7 +3782,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.IsNotIdenticalToken) + $$.AddComments($2.Comments, comment.IsNotIdenticalToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3794,7 +3794,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.IsEqualToken) + $$.AddComments($2.Comments, comment.IsEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3806,7 +3806,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.IsNotEqualToken) + $$.AddComments($2.Comments, comment.IsNotEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3818,7 +3818,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.LessToken) + $$.AddComments($2.Comments, comment.LessToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3830,7 +3830,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.IsSmallerOrEqualToken) + $$.AddComments($2.Comments, comment.IsSmallerOrEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3842,7 +3842,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.GreaterToken) + $$.AddComments($2.Comments, comment.GreaterToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3854,7 +3854,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.IsGreaterOrEqualToken) + $$.AddComments($2.Comments, comment.IsGreaterOrEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3866,7 +3866,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.InstanceofToken) + $$.AddComments($2.Comments, comment.InstanceofToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3906,8 +3906,8 @@ expr_without_variable: } // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.CloseParenthesisToken) + $$.AddComments($1.Comments, comment.OpenParenthesisToken) + $$.AddComments($3.Comments, comment.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3919,8 +3919,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $5)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.QuestionMarkToken) - yylex.(*Parser).comments.AddFromToken($$, $4, comment.ColonToken) + $$.AddComments($2.Comments, comment.QuestionMarkToken) + $$.AddComments($4.Comments, comment.ColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3932,8 +3932,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.QuestionMarkToken) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.ColonToken) + $$.AddComments($2.Comments, comment.QuestionMarkToken) + $$.AddComments($3.Comments, comment.ColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3951,7 +3951,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.IntCastToken) + $$.AddComments($1.Comments, comment.IntCastToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3963,7 +3963,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.DoubleCastToken) + $$.AddComments($1.Comments, comment.DoubleCastToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3975,7 +3975,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.StringCastToken) + $$.AddComments($1.Comments, comment.StringCastToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3987,7 +3987,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.ArrayCastToken) + $$.AddComments($1.Comments, comment.ArrayCastToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3999,7 +3999,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.ObjectCastToken) + $$.AddComments($1.Comments, comment.ObjectCastToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4011,7 +4011,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.BoolCastToken) + $$.AddComments($1.Comments, comment.BoolCastToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4023,7 +4023,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.UnsetCastToken) + $$.AddComments($1.Comments, comment.UnsetCastToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4044,12 +4044,14 @@ expr_without_variable: // save position if $2 == nil { $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + } else if yylex.(*Parser).currentToken.Value == ")" { + $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, yylex.(*Parser).currentToken)) } else { $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) } // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.ExitToken) + $$.AddComments($1.Comments, comment.ExitToken) if $2 != nil { yylex.(*Parser).comments.AddFromChildNode($$, $2) @@ -4065,7 +4067,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.AtToken) + $$.AddComments($1.Comments, comment.AtToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4095,8 +4097,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.BackquoteToken) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.BackquoteToken) + $$.AddComments($1.Comments, comment.BackquoteToken) + $$.AddComments($3.Comments, comment.BackquoteToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4108,7 +4110,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.PrintToken) + $$.AddComments($1.Comments, comment.PrintToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4120,7 +4122,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.YieldToken) + $$.AddComments($1.Comments, comment.YieldToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4132,14 +4134,14 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $9)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.FunctionToken) + $$.AddComments($1.Comments, comment.FunctionToken) if $2 != nil { - yylex.(*Parser).comments.AddFromToken($$, $2, comment.AmpersandToken) + $$.AddComments($2.Comments, comment.AmpersandToken) } - yylex.(*Parser).comments.AddFromToken($$, $3, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken($$, $5, comment.CloseParenthesisToken) - yylex.(*Parser).comments.AddFromToken($$, $7, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken($$, $9, comment.CloseCurlyBracesToken) + $$.AddComments($3.Comments, comment.OpenParenthesisToken) + $$.AddComments($5.Comments, comment.CloseParenthesisToken) + $$.AddComments($7.Comments, comment.OpenCurlyBracesToken) + $$.AddComments($9.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4151,15 +4153,15 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $10)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.StaticToken) - yylex.(*Parser).comments.AddFromToken($$, $2, comment.FunctionToken) + $$.AddComments($1.Comments, comment.StaticToken) + $$.AddComments($2.Comments, comment.FunctionToken) if $3 != nil { - yylex.(*Parser).comments.AddFromToken($$, $3, comment.AmpersandToken) + $$.AddComments($3.Comments, comment.AmpersandToken) } - yylex.(*Parser).comments.AddFromToken($$, $4, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken($$, $6, comment.CloseParenthesisToken) - yylex.(*Parser).comments.AddFromToken($$, $8, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken($$, $10, comment.CloseCurlyBracesToken) + $$.AddComments($4.Comments, comment.OpenParenthesisToken) + $$.AddComments($6.Comments, comment.CloseParenthesisToken) + $$.AddComments($8.Comments, comment.OpenCurlyBracesToken) + $$.AddComments($10.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4174,7 +4176,7 @@ yield_expr: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.YieldToken) + $$.AddComments($1.Comments, comment.YieldToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4186,7 +4188,7 @@ yield_expr: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.YieldToken) + $$.AddComments($1.Comments, comment.YieldToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4198,8 +4200,8 @@ yield_expr: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $4)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.YieldToken) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.DoubleArrowToken) + $$.AddComments($1.Comments, comment.YieldToken) + $$.AddComments($3.Comments, comment.DoubleArrowToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4211,8 +4213,8 @@ yield_expr: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $4)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.YieldToken) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.DoubleArrowToken) + $$.AddComments($1.Comments, comment.YieldToken) + $$.AddComments($3.Comments, comment.DoubleArrowToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4227,8 +4229,8 @@ combined_scalar_offset: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenSquareBracket) - yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseSquareBracket) + $$.AddComments($2.Comments, comment.OpenSquareBracket) + $$.AddComments($4.Comments, comment.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4240,8 +4242,8 @@ combined_scalar_offset: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenSquareBracket) - yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseSquareBracket) + $$.AddComments($2.Comments, comment.OpenSquareBracket) + $$.AddComments($4.Comments, comment.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4255,8 +4257,8 @@ combined_scalar_offset: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(str, $4)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenSquareBracket) - yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseSquareBracket) + $$.AddComments($2.Comments, comment.OpenSquareBracket) + $$.AddComments($4.Comments, comment.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4268,8 +4270,8 @@ combined_scalar_offset: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenSquareBracket) - yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseSquareBracket) + $$.AddComments($2.Comments, comment.OpenSquareBracket) + $$.AddComments($4.Comments, comment.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4284,9 +4286,9 @@ combined_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.ArrayToken) - yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseParenthesisToken) + $$.AddComments($1.Comments, comment.ArrayToken) + $$.AddComments($2.Comments, comment.OpenParenthesisToken) + $$.AddComments($4.Comments, comment.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4298,8 +4300,8 @@ combined_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.OpenSquareBracket) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.CloseSquareBracket) + $$.AddComments($1.Comments, comment.OpenSquareBracket) + $$.AddComments($3.Comments, comment.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4341,8 +4343,8 @@ lexical_var_list: variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) - yylex.(*Parser).comments.AddFromToken(variable, $3, comment.VariableToken) + lastNode($1).AddComments($2.Comments, comment.CommaToken) + variable.AddComments($3.Comments, comment.VariableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4359,9 +4361,9 @@ lexical_var_list: reference.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($3, $4)) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) - yylex.(*Parser).comments.AddFromToken(reference, $3, comment.VariableToken) - yylex.(*Parser).comments.AddFromToken(variable, $4, comment.VariableToken) + lastNode($1).AddComments($2.Comments, comment.CommaToken) + reference.AddComments($3.Comments, comment.VariableToken) + variable.AddComments($4.Comments, comment.VariableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4376,7 +4378,7 @@ lexical_var_list: variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken(variable, $1, comment.VariableToken) + variable.AddComments($1.Comments, comment.VariableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4393,8 +4395,8 @@ lexical_var_list: reference.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken(reference, $1, comment.VariableToken) - yylex.(*Parser).comments.AddFromToken(variable, $2, comment.VariableToken) + reference.AddComments($1.Comments, comment.VariableToken) + variable.AddComments($2.Comments, comment.VariableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4422,8 +4424,8 @@ function_call: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(funcName, $4)) // save comments - yylex.(*Parser).comments.AddFromToken(funcName, $1, comment.NamespaceToken) - yylex.(*Parser).comments.AddFromToken(funcName, $2, comment.NsSeparatorToken) + funcName.AddComments($1.Comments, comment.NamespaceToken) + funcName.AddComments($2.Comments, comment.NsSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4437,7 +4439,7 @@ function_call: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(funcName, $3)) // save comments - yylex.(*Parser).comments.AddFromToken(funcName, $1, comment.NsSeparatorToken) + funcName.AddComments($1.Comments, comment.NsSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4449,7 +4451,7 @@ function_call: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.PaamayimNekudotayimToken) + $$.AddComments($2.Comments, comment.PaamayimNekudotayimToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4461,7 +4463,7 @@ function_call: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.PaamayimNekudotayimToken) + $$.AddComments($2.Comments, comment.PaamayimNekudotayimToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4473,7 +4475,7 @@ function_call: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.PaamayimNekudotayimToken) + $$.AddComments($2.Comments, comment.PaamayimNekudotayimToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4485,7 +4487,7 @@ function_call: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.PaamayimNekudotayimToken) + $$.AddComments($2.Comments, comment.PaamayimNekudotayimToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4509,7 +4511,7 @@ class_name: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.StaticToken) + $$.AddComments($1.Comments, comment.StaticToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4530,8 +4532,8 @@ class_name: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.NamespaceToken) - yylex.(*Parser).comments.AddFromToken($$, $2, comment.NsSeparatorToken) + $$.AddComments($1.Comments, comment.NamespaceToken) + $$.AddComments($2.Comments, comment.NsSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4543,7 +4545,7 @@ class_name: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.NsSeparatorToken) + $$.AddComments($1.Comments, comment.NsSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4567,8 +4569,8 @@ fully_qualified_class_name: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.NamespaceToken) - yylex.(*Parser).comments.AddFromToken($$, $2, comment.NsSeparatorToken) + $$.AddComments($1.Comments, comment.NamespaceToken) + $$.AddComments($2.Comments, comment.NsSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4580,7 +4582,7 @@ fully_qualified_class_name: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.NsSeparatorToken) + $$.AddComments($1.Comments, comment.NsSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4607,7 +4609,7 @@ dynamic_class_name_reference: $$ = $1 // save comments - yylex.(*Parser).comments.AddFromToken($3[0], $2, comment.ObjectOperatorToken) + $3[0].AddComments($2.Comments, comment.ObjectOperatorToken) for _, n := range($3) { switch nn := n.(type) { @@ -4670,7 +4672,7 @@ dynamic_class_name_variable_property: $$ = $2 // save comments - yylex.(*Parser).comments.AddFromToken($2[0], $1, comment.ObjectOperatorToken) + $2[0].AddComments($1.Comments, comment.ObjectOperatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4691,8 +4693,8 @@ exit_expr: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken($$, $2, comment.CloseParenthesisToken) + $$.AddComments($1.Comments, comment.OpenParenthesisToken) + $$.AddComments($2.Comments, comment.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4752,7 +4754,7 @@ common_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.LnumberToken) + $$.AddComments($1.Comments, comment.LnumberToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4764,7 +4766,7 @@ common_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.DnumberToken) + $$.AddComments($1.Comments, comment.DnumberToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4776,7 +4778,7 @@ common_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.ConstantEncapsedStringToken) + $$.AddComments($1.Comments, comment.ConstantEncapsedStringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4788,7 +4790,7 @@ common_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.LineToken) + $$.AddComments($1.Comments, comment.LineToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4800,7 +4802,7 @@ common_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.FileToken) + $$.AddComments($1.Comments, comment.FileToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4812,7 +4814,7 @@ common_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.DirToken) + $$.AddComments($1.Comments, comment.DirToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4824,7 +4826,7 @@ common_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.TraitCToken) + $$.AddComments($1.Comments, comment.TraitCToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4836,7 +4838,7 @@ common_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.MethodCToken) + $$.AddComments($1.Comments, comment.MethodCToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4848,7 +4850,7 @@ common_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.FuncCToken) + $$.AddComments($1.Comments, comment.FuncCToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4860,7 +4862,7 @@ common_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.NsCToken) + $$.AddComments($1.Comments, comment.NsCToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4874,7 +4876,7 @@ common_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.StartHeredocToken) + $$.AddComments($1.Comments, comment.StartHeredocToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4886,7 +4888,7 @@ common_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.StartHeredocToken) + $$.AddComments($1.Comments, comment.StartHeredocToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4903,8 +4905,8 @@ static_class_constant: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.PaamayimNekudotayimToken) - yylex.(*Parser).comments.AddFromToken(target, $3, comment.IdentifierToken) + $$.AddComments($2.Comments, comment.PaamayimNekudotayimToken) + target.AddComments($3.Comments, comment.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4953,8 +4955,8 @@ static_scalar_value: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.NamespaceToken) - yylex.(*Parser).comments.AddFromToken($$, $2, comment.NsSeparatorToken) + $$.AddComments($1.Comments, comment.NamespaceToken) + $$.AddComments($2.Comments, comment.NsSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4968,7 +4970,7 @@ static_scalar_value: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.NsSeparatorToken) + $$.AddComments($1.Comments, comment.NsSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4980,9 +4982,9 @@ static_scalar_value: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.ArrayToken) - yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseParenthesisToken) + $$.AddComments($1.Comments, comment.ArrayToken) + $$.AddComments($2.Comments, comment.OpenParenthesisToken) + $$.AddComments($4.Comments, comment.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4994,8 +4996,8 @@ static_scalar_value: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.OpenSquareBracket) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.CloseSquareBracket) + $$.AddComments($1.Comments, comment.OpenSquareBracket) + $$.AddComments($3.Comments, comment.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5013,7 +5015,7 @@ static_scalar_value: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.ClassCToken) + $$.AddComments($1.Comments, comment.ClassCToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5034,8 +5036,8 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenSquareBracket) - yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseSquareBracket) + $$.AddComments($2.Comments, comment.OpenSquareBracket) + $$.AddComments($4.Comments, comment.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5047,7 +5049,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.PlusToken) + $$.AddComments($2.Comments, comment.PlusToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5059,7 +5061,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.MinusToken) + $$.AddComments($2.Comments, comment.MinusToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5071,7 +5073,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.AsteriskToken) + $$.AddComments($2.Comments, comment.AsteriskToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5083,7 +5085,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.PowToken) + $$.AddComments($2.Comments, comment.PowToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5095,7 +5097,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.SlashToken) + $$.AddComments($2.Comments, comment.SlashToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5107,7 +5109,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.PercentToken) + $$.AddComments($2.Comments, comment.PercentToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5119,7 +5121,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.ExclamationMarkToken) + $$.AddComments($1.Comments, comment.ExclamationMarkToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5131,7 +5133,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.TildeToken) + $$.AddComments($1.Comments, comment.TildeToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5143,7 +5145,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.VerticalBarToken) + $$.AddComments($2.Comments, comment.VerticalBarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5155,7 +5157,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.AmpersandToken) + $$.AddComments($2.Comments, comment.AmpersandToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5167,7 +5169,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.CaretToken) + $$.AddComments($2.Comments, comment.CaretToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5179,7 +5181,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.SlToken) + $$.AddComments($2.Comments, comment.SlToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5191,7 +5193,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.SrToken) + $$.AddComments($2.Comments, comment.SrToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5203,7 +5205,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.DotToken) + $$.AddComments($2.Comments, comment.DotToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5215,7 +5217,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.LogicalXorToken) + $$.AddComments($2.Comments, comment.LogicalXorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5227,7 +5229,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.LogicalAndToken) + $$.AddComments($2.Comments, comment.LogicalAndToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5239,7 +5241,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.LogicalOrToken) + $$.AddComments($2.Comments, comment.LogicalOrToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5251,7 +5253,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.BooleanAndToken) + $$.AddComments($2.Comments, comment.BooleanAndToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5263,7 +5265,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.BooleanOrToken) + $$.AddComments($2.Comments, comment.BooleanOrToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5275,7 +5277,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.IsIdenticalToken) + $$.AddComments($2.Comments, comment.IsIdenticalToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5287,7 +5289,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.IsNotIdenticalToken) + $$.AddComments($2.Comments, comment.IsNotIdenticalToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5299,7 +5301,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.IsEqualToken) + $$.AddComments($2.Comments, comment.IsEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5311,7 +5313,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.IsNotEqualToken) + $$.AddComments($2.Comments, comment.IsNotEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5323,7 +5325,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.LessToken) + $$.AddComments($2.Comments, comment.LessToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5335,7 +5337,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.GreaterToken) + $$.AddComments($2.Comments, comment.GreaterToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5347,7 +5349,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.IsSmallerOrEqualToken) + $$.AddComments($2.Comments, comment.IsSmallerOrEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5359,7 +5361,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.IsGreaterOrEqualToken) + $$.AddComments($2.Comments, comment.IsGreaterOrEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5371,8 +5373,8 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.QuestionMarkToken) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.ColonToken) + $$.AddComments($2.Comments, comment.QuestionMarkToken) + $$.AddComments($3.Comments, comment.ColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5384,8 +5386,8 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $5)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.QuestionMarkToken) - yylex.(*Parser).comments.AddFromToken($$, $4, comment.ColonToken) + $$.AddComments($2.Comments, comment.QuestionMarkToken) + $$.AddComments($4.Comments, comment.ColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5397,7 +5399,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.PlusToken) + $$.AddComments($1.Comments, comment.PlusToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5409,7 +5411,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.MinusToken) + $$.AddComments($1.Comments, comment.MinusToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5418,8 +5420,8 @@ static_operation: $$ = $2 // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.CloseParenthesisToken) + $$.AddComments($1.Comments, comment.OpenParenthesisToken) + $$.AddComments($3.Comments, comment.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5451,8 +5453,8 @@ general_constant: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(name)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.NamespaceToken) - yylex.(*Parser).comments.AddFromToken($$, $2, comment.NsSeparatorToken) + $$.AddComments($1.Comments, comment.NamespaceToken) + $$.AddComments($2.Comments, comment.NsSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5466,7 +5468,7 @@ general_constant: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(name)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.NsSeparatorToken) + $$.AddComments($1.Comments, comment.NsSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5483,7 +5485,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken(name, $1, comment.StringVarnameToken) + name.AddComments($1.Comments, comment.StringVarnameToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5513,7 +5515,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.DoubleQuoteToken) + $$.AddComments($1.Comments, comment.DoubleQuoteToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5525,7 +5527,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.StartHeredocToken) + $$.AddComments($1.Comments, comment.StartHeredocToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5537,7 +5539,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.ClassCToken) + $$.AddComments($1.Comments, comment.ClassCToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5556,7 +5558,7 @@ static_array_pair_list: // save comments if $2 != nil { - yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) + lastNode($1).AddComments($2.Comments, comment.CommaToken) } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -5584,8 +5586,8 @@ non_empty_static_array_pair_list: arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($3, $5)) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) - yylex.(*Parser).comments.AddFromToken(arrayItem, $4, comment.DoubleArrowToken) + lastNode($1).AddComments($2.Comments, comment.CommaToken) + arrayItem.AddComments($4.Comments, comment.DoubleArrowToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5598,7 +5600,7 @@ non_empty_static_array_pair_list: arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($3)) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) + lastNode($1).AddComments($2.Comments, comment.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5611,7 +5613,7 @@ non_empty_static_array_pair_list: arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken(arrayItem, $2, comment.DoubleArrowToken) + arrayItem.AddComments($2.Comments, comment.DoubleArrowToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5697,7 +5699,7 @@ variable: } // save comments - yylex.(*Parser).comments.AddFromToken($3[0], $2, comment.ObjectOperatorToken) + $3[0].AddComments($2.Comments, comment.ObjectOperatorToken) for _, n := range($3) { switch nn := n.(type) { @@ -5774,7 +5776,7 @@ variable_property: $$ = $2 // save comments - yylex.(*Parser).comments.AddFromToken($2[0], $1, comment.ObjectOperatorToken) + $2[0].AddComments($1.Comments, comment.ObjectOperatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5790,8 +5792,8 @@ array_method_dereference: fetch.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($3)) // save comments - yylex.(*Parser).comments.AddFromToken(fetch, $2, comment.OpenSquareBracket) - yylex.(*Parser).comments.AddFromToken(fetch, $4, comment.CloseSquareBracket) + fetch.AddComments($2.Comments, comment.OpenSquareBracket) + fetch.AddComments($4.Comments, comment.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5804,8 +5806,8 @@ array_method_dereference: fetch.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($3)) // save comments - yylex.(*Parser).comments.AddFromToken(fetch, $2, comment.OpenSquareBracket) - yylex.(*Parser).comments.AddFromToken(fetch, $4, comment.CloseSquareBracket) + fetch.AddComments($2.Comments, comment.OpenSquareBracket) + fetch.AddComments($4.Comments, comment.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5874,7 +5876,7 @@ static_member: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.PaamayimNekudotayimToken) + $$.AddComments($2.Comments, comment.PaamayimNekudotayimToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5886,7 +5888,7 @@ static_member: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.PaamayimNekudotayimToken) + $$.AddComments($2.Comments, comment.PaamayimNekudotayimToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5910,8 +5912,8 @@ array_function_dereference: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenSquareBracket) - yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseSquareBracket) + $$.AddComments($2.Comments, comment.OpenSquareBracket) + $$.AddComments($4.Comments, comment.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5923,8 +5925,8 @@ array_function_dereference: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenSquareBracket) - yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseSquareBracket) + $$.AddComments($2.Comments, comment.OpenSquareBracket) + $$.AddComments($4.Comments, comment.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5988,8 +5990,8 @@ reference_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenSquareBracket) - yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseSquareBracket) + $$.AddComments($2.Comments, comment.OpenSquareBracket) + $$.AddComments($4.Comments, comment.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6001,8 +6003,8 @@ reference_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseCurlyBracesToken) + $$.AddComments($2.Comments, comment.OpenCurlyBracesToken) + $$.AddComments($4.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6026,7 +6028,7 @@ compound_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.VariableToken) + $$.AddComments($1.Comments, comment.VariableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6038,9 +6040,9 @@ compound_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.DollarToken) - yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseCurlyBracesToken) + $$.AddComments($1.Comments, comment.DollarToken) + $$.AddComments($2.Comments, comment.OpenCurlyBracesToken) + $$.AddComments($4.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6091,8 +6093,8 @@ object_dim_list: fetch.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($3)) // save comments - yylex.(*Parser).comments.AddFromToken(fetch, $2, comment.OpenSquareBracket) - yylex.(*Parser).comments.AddFromToken(fetch, $4, comment.CloseSquareBracket) + fetch.AddComments($2.Comments, comment.OpenSquareBracket) + fetch.AddComments($4.Comments, comment.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6105,8 +6107,8 @@ object_dim_list: fetch.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($3)) // save comments - yylex.(*Parser).comments.AddFromToken(fetch, $2, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken(fetch, $4, comment.CloseCurlyBracesToken) + fetch.AddComments($2.Comments, comment.OpenCurlyBracesToken) + fetch.AddComments($4.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6131,7 +6133,7 @@ variable_name: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.StringToken) + $$.AddComments($1.Comments, comment.StringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6143,8 +6145,8 @@ variable_name: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.CloseCurlyBracesToken) + $$.AddComments($1.Comments, comment.OpenCurlyBracesToken) + $$.AddComments($3.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6160,7 +6162,7 @@ simple_indirect_reference: n.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken(n, $1, comment.DollarToken) + n.AddComments($1.Comments, comment.DollarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6177,7 +6179,7 @@ simple_indirect_reference: n.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) // save comments - yylex.(*Parser).comments.AddFromToken(n, $2, comment.DollarToken) + n.AddComments($2.Comments, comment.DollarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6189,7 +6191,7 @@ assignment_list: $$ = append($1, $3) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) + lastNode($1).AddComments($2.Comments, comment.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6226,9 +6228,9 @@ assignment_list_element: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(item)) // save comments - yylex.(*Parser).comments.AddFromToken(item, $1, comment.ListToken) - yylex.(*Parser).comments.AddFromToken(item, $2, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken(item, $4, comment.CloseParenthesisToken) + item.AddComments($1.Comments, comment.ListToken) + item.AddComments($2.Comments, comment.OpenParenthesisToken) + item.AddComments($4.Comments, comment.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6254,7 +6256,7 @@ array_pair_list: // save comments if $2 != nil { - yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) + lastNode($1).AddComments($2.Comments, comment.CommaToken) } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -6271,8 +6273,8 @@ non_empty_array_pair_list: arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($3, $5)) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) - yylex.(*Parser).comments.AddFromToken(arrayItem, $4, comment.DoubleArrowToken) + lastNode($1).AddComments($2.Comments, comment.CommaToken) + arrayItem.AddComments($4.Comments, comment.DoubleArrowToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6285,7 +6287,7 @@ non_empty_array_pair_list: arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($3)) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) + lastNode($1).AddComments($2.Comments, comment.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6298,7 +6300,7 @@ non_empty_array_pair_list: arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken(arrayItem, $2, comment.DoubleArrowToken) + arrayItem.AddComments($2.Comments, comment.DoubleArrowToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6323,9 +6325,9 @@ non_empty_array_pair_list: arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($3, $6)) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) - yylex.(*Parser).comments.AddFromToken(arrayItem, $4, comment.DoubleArrowToken) - yylex.(*Parser).comments.AddFromToken(reference, $5, comment.AmpersandToken) + lastNode($1).AddComments($2.Comments, comment.CommaToken) + arrayItem.AddComments($4.Comments, comment.DoubleArrowToken) + reference.AddComments($5.Comments, comment.AmpersandToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6340,8 +6342,8 @@ non_empty_array_pair_list: arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $4)) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) - yylex.(*Parser).comments.AddFromToken(reference, $3, comment.AmpersandToken) + lastNode($1).AddComments($2.Comments, comment.CommaToken) + reference.AddComments($3.Comments, comment.AmpersandToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6356,8 +6358,8 @@ non_empty_array_pair_list: arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddFromToken(arrayItem, $2, comment.DoubleArrowToken) - yylex.(*Parser).comments.AddFromToken(reference, $3, comment.AmpersandToken) + arrayItem.AddComments($2.Comments, comment.DoubleArrowToken) + reference.AddComments($3.Comments, comment.AmpersandToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6372,7 +6374,7 @@ non_empty_array_pair_list: arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken(reference, $1, comment.AmpersandToken) + reference.AddComments($1.Comments, comment.AmpersandToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6394,7 +6396,7 @@ encaps_list: encapsed.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) // save comments - yylex.(*Parser).comments.AddFromToken(encapsed, $2, comment.EncapsedAndWhitespaceToken) + encapsed.AddComments($2.Comments, comment.EncapsedAndWhitespaceToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6413,7 +6415,7 @@ encaps_list: encapsed.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken(encapsed, $1, comment.EncapsedAndWhitespaceToken) + encapsed.AddComments($1.Comments, comment.EncapsedAndWhitespaceToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6430,7 +6432,7 @@ encaps_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.VariableToken) + $$.AddComments($1.Comments, comment.VariableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6446,9 +6448,9 @@ encaps_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddFromToken(variable, $1, comment.VariableToken) - yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenSquareBracket) - yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseSquareBracket) + variable.AddComments($1.Comments, comment.VariableToken) + $$.AddComments($2.Comments, comment.OpenSquareBracket) + $$.AddComments($4.Comments, comment.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6466,9 +6468,9 @@ encaps_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken(variable, $1, comment.VariableToken) - yylex.(*Parser).comments.AddFromToken($$, $2, comment.ObjectOperatorToken) - yylex.(*Parser).comments.AddFromToken(fetch, $3, comment.StringToken) + variable.AddComments($1.Comments, comment.VariableToken) + $$.AddComments($2.Comments, comment.ObjectOperatorToken) + fetch.AddComments($3.Comments, comment.StringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6480,8 +6482,8 @@ encaps_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.DollarOpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.CloseCurlyBracesToken) + $$.AddComments($1.Comments, comment.DollarOpenCurlyBracesToken) + $$.AddComments($3.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6495,9 +6497,9 @@ encaps_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.DollarOpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken(name, $2, comment.StringVarnameToken) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.CloseCurlyBracesToken) + $$.AddComments($1.Comments, comment.DollarOpenCurlyBracesToken) + name.AddComments($2.Comments, comment.StringVarnameToken) + $$.AddComments($3.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6513,11 +6515,11 @@ encaps_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $6)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.DollarOpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken(variable, $2, comment.StringVarnameToken) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.OpenSquareBracket) - yylex.(*Parser).comments.AddFromToken($$, $5, comment.CloseSquareBracket) - yylex.(*Parser).comments.AddFromToken($$, $6, comment.CloseCurlyBracesToken) + $$.AddComments($1.Comments, comment.DollarOpenCurlyBracesToken) + variable.AddComments($2.Comments, comment.StringVarnameToken) + $$.AddComments($3.Comments, comment.OpenSquareBracket) + $$.AddComments($5.Comments, comment.CloseSquareBracket) + $$.AddComments($6.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6538,7 +6540,7 @@ encaps_var_offset: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.StringToken) + $$.AddComments($1.Comments, comment.StringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6555,7 +6557,7 @@ encaps_var_offset: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.NumStringToken) + $$.AddComments($1.Comments, comment.NumStringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6569,7 +6571,7 @@ encaps_var_offset: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.VariableToken) + $$.AddComments($1.Comments, comment.VariableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6584,9 +6586,9 @@ internal_functions_in_yacc: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.IssetToken) - yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseParenthesisToken) + $$.AddComments($1.Comments, comment.IssetToken) + $$.AddComments($2.Comments, comment.OpenParenthesisToken) + $$.AddComments($4.Comments, comment.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6598,9 +6600,9 @@ internal_functions_in_yacc: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.EmptyToken) - yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseParenthesisToken) + $$.AddComments($1.Comments, comment.EmptyToken) + $$.AddComments($2.Comments, comment.OpenParenthesisToken) + $$.AddComments($4.Comments, comment.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6612,9 +6614,9 @@ internal_functions_in_yacc: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.EmptyToken) - yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseParenthesisToken) + $$.AddComments($1.Comments, comment.EmptyToken) + $$.AddComments($2.Comments, comment.OpenParenthesisToken) + $$.AddComments($4.Comments, comment.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6626,7 +6628,7 @@ internal_functions_in_yacc: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.IncludeToken) + $$.AddComments($1.Comments, comment.IncludeToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6638,7 +6640,7 @@ internal_functions_in_yacc: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.IncludeOnceToken) + $$.AddComments($1.Comments, comment.IncludeOnceToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6650,9 +6652,9 @@ internal_functions_in_yacc: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.EvalToken) - yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseParenthesisToken) + $$.AddComments($1.Comments, comment.EvalToken) + $$.AddComments($2.Comments, comment.OpenParenthesisToken) + $$.AddComments($4.Comments, comment.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6664,7 +6666,7 @@ internal_functions_in_yacc: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.RequireToken) + $$.AddComments($1.Comments, comment.RequireToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6676,7 +6678,7 @@ internal_functions_in_yacc: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.RequireOnceToken) + $$.AddComments($1.Comments, comment.RequireOnceToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6694,7 +6696,7 @@ isset_variables: $$ = append($1, $3) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) + lastNode($1).AddComments($2.Comments, comment.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6726,7 +6728,7 @@ class_constant: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.PaamayimNekudotayimToken) + $$.AddComments($2.Comments, comment.PaamayimNekudotayimToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6740,7 +6742,7 @@ class_constant: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.PaamayimNekudotayimToken) + $$.AddComments($2.Comments, comment.PaamayimNekudotayimToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6757,7 +6759,7 @@ static_class_name_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.PaamayimNekudotayimToken) + $$.AddComments($2.Comments, comment.PaamayimNekudotayimToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6774,7 +6776,7 @@ class_name_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.PaamayimNekudotayimToken) + $$.AddComments($2.Comments, comment.PaamayimNekudotayimToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php5/php5_test.go b/php5/php5_test.go index 52c634c..61aa16b 100644 --- a/php5/php5_test.go +++ b/php5/php5_test.go @@ -12,8 +12,8 @@ import ( "github.com/z7zmey/php-parser/node/expr/cast" "github.com/z7zmey/php-parser/node/name" "github.com/z7zmey/php-parser/node/scalar" - "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/php5" + "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node/stmt" @@ -417,39 +417,39 @@ func TestPhp5(t *testing.T) { expected := &node.Root{ Position: &position.Position{ StartLine: 2, - EndLine: 379, - StartPos: 6, - EndPos: 6965, + EndLine: 379, + StartPos: 6, + EndPos: 6965, }, Stmts: []node.Node{ &stmt.Expression{ Position: &position.Position{ StartLine: 2, - EndLine: 2, - StartPos: 6, - EndPos: 20, + EndLine: 2, + StartPos: 6, + EndPos: 20, }, Expr: &expr.FunctionCall{ Position: &position.Position{ StartLine: 2, - EndLine: 2, - StartPos: 6, - EndPos: 19, + EndLine: 2, + StartPos: 6, + EndPos: 19, }, Function: &name.Name{ Position: &position.Position{ StartLine: 2, - EndLine: 2, - StartPos: 6, - EndPos: 8, + EndLine: 2, + StartPos: 6, + EndPos: 8, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 2, - EndLine: 2, - StartPos: 6, - EndPos: 8, + EndLine: 2, + StartPos: 6, + EndPos: 8, }, Value: "foo", }, @@ -458,33 +458,33 @@ func TestPhp5(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 2, - EndLine: 2, - StartPos: 9, - EndPos: 19, + EndLine: 2, + StartPos: 9, + EndPos: 19, }, Arguments: []node.Node{ &node.Argument{ Position: &position.Position{ StartLine: 2, - EndLine: 2, - StartPos: 10, - EndPos: 11, + EndLine: 2, + StartPos: 10, + EndPos: 11, }, - Variadic: false, + Variadic: false, IsReference: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 2, - EndLine: 2, - StartPos: 10, - EndPos: 11, + EndLine: 2, + StartPos: 10, + EndPos: 11, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 2, - EndLine: 2, - StartPos: 10, - EndPos: 11, + EndLine: 2, + StartPos: 10, + EndPos: 11, }, Value: "a", }, @@ -493,25 +493,25 @@ func TestPhp5(t *testing.T) { &node.Argument{ Position: &position.Position{ StartLine: 2, - EndLine: 2, - StartPos: 14, - EndPos: 18, + EndLine: 2, + StartPos: 14, + EndPos: 18, }, - Variadic: true, + Variadic: true, IsReference: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 2, - EndLine: 2, - StartPos: 17, - EndPos: 18, + EndLine: 2, + StartPos: 17, + EndPos: 18, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 2, - EndLine: 2, - StartPos: 17, - EndPos: 18, + EndLine: 2, + StartPos: 17, + EndPos: 18, }, Value: "b", }, @@ -524,30 +524,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 3, - EndLine: 3, - StartPos: 24, - EndPos: 39, + EndLine: 3, + StartPos: 24, + EndPos: 39, }, Expr: &expr.FunctionCall{ Position: &position.Position{ StartLine: 3, - EndLine: 3, - StartPos: 24, - EndPos: 38, + EndLine: 3, + StartPos: 24, + EndPos: 38, }, Function: &expr.Variable{ Position: &position.Position{ StartLine: 3, - EndLine: 3, - StartPos: 24, - EndPos: 27, + EndLine: 3, + StartPos: 24, + EndPos: 27, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 3, - EndLine: 3, - StartPos: 24, - EndPos: 27, + EndLine: 3, + StartPos: 24, + EndPos: 27, }, Value: "foo", }, @@ -555,33 +555,33 @@ func TestPhp5(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 3, - EndLine: 3, - StartPos: 28, - EndPos: 38, + EndLine: 3, + StartPos: 28, + EndPos: 38, }, Arguments: []node.Node{ &node.Argument{ Position: &position.Position{ StartLine: 3, - EndLine: 3, - StartPos: 29, - EndPos: 30, + EndLine: 3, + StartPos: 29, + EndPos: 30, }, - Variadic: false, + Variadic: false, IsReference: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 3, - EndLine: 3, - StartPos: 29, - EndPos: 30, + EndLine: 3, + StartPos: 29, + EndPos: 30, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 3, - EndLine: 3, - StartPos: 29, - EndPos: 30, + EndLine: 3, + StartPos: 29, + EndPos: 30, }, Value: "a", }, @@ -590,25 +590,25 @@ func TestPhp5(t *testing.T) { &node.Argument{ Position: &position.Position{ StartLine: 3, - EndLine: 3, - StartPos: 33, - EndPos: 37, + EndLine: 3, + StartPos: 33, + EndPos: 37, }, - Variadic: true, IsReference: false, + Variadic: true, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 3, - EndLine: 3, - StartPos: 36, - EndPos: 37, + EndLine: 3, + StartPos: 36, + EndPos: 37, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 3, - EndLine: 3, - StartPos: 36, - EndPos: 37, + EndLine: 3, + StartPos: 36, + EndPos: 37, }, Value: "b", }, @@ -621,30 +621,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 4, - EndLine: 4, - StartPos: 43, - EndPos: 63, + EndLine: 4, + StartPos: 43, + EndPos: 63, }, Expr: &expr.MethodCall{ Position: &position.Position{ StartLine: 4, - EndLine: 4, - StartPos: 43, - EndPos: 62, + EndLine: 4, + StartPos: 43, + EndPos: 62, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 4, - EndLine: 4, - StartPos: 43, - EndPos: 46, + EndLine: 4, + StartPos: 43, + EndPos: 46, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 4, - EndLine: 4, - StartPos: 43, - EndPos: 46, + EndLine: 4, + StartPos: 43, + EndPos: 46, }, Value: "foo", }, @@ -652,42 +652,42 @@ func TestPhp5(t *testing.T) { Method: &node.Identifier{ Position: &position.Position{ StartLine: 4, - EndLine: 4, - StartPos: 49, - EndPos: 51, + EndLine: 4, + StartPos: 49, + EndPos: 51, }, Value: "bar", }, ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 4, - EndLine: 4, - StartPos: 52, - EndPos: 62, + EndLine: 4, + StartPos: 52, + EndPos: 62, }, Arguments: []node.Node{ &node.Argument{ Position: &position.Position{ StartLine: 4, - EndLine: 4, - StartPos: 53, - EndPos: 54, + EndLine: 4, + StartPos: 53, + EndPos: 54, }, - Variadic: false, + Variadic: false, IsReference: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 4, - EndLine: 4, - StartPos: 53, - EndPos: 54, + EndLine: 4, + StartPos: 53, + EndPos: 54, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 4, - EndLine: 4, - StartPos: 53, - EndPos: 54, + EndLine: 4, + StartPos: 53, + EndPos: 54, }, Value: "a", }, @@ -696,25 +696,25 @@ func TestPhp5(t *testing.T) { &node.Argument{ Position: &position.Position{ StartLine: 4, - EndLine: 4, - StartPos: 57, - EndPos: 61, + EndLine: 4, + StartPos: 57, + EndPos: 61, }, - Variadic: true, + Variadic: true, IsReference: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 4, - EndLine: 4, - StartPos: 60, - EndPos: 61, + EndLine: 4, + StartPos: 60, + EndPos: 61, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 4, - EndLine: 4, - StartPos: 60, - EndPos: 61, + EndLine: 4, + StartPos: 60, + EndPos: 61, }, Value: "b", }, @@ -727,31 +727,31 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 5, - EndLine: 5, - StartPos: 67, - EndPos: 86, + EndLine: 5, + StartPos: 67, + EndPos: 86, }, Expr: &expr.StaticCall{ Position: &position.Position{ StartLine: 5, - EndLine: 5, - StartPos: 67, - EndPos: 85, + EndLine: 5, + StartPos: 67, + EndPos: 85, }, Class: &name.Name{ Position: &position.Position{ StartLine: 5, - EndLine: 5, - StartPos: 67, - EndPos: 69, + EndLine: 5, + StartPos: 67, + EndPos: 69, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 5, - EndLine: 5, - StartPos: 67, - EndPos: 69, + EndLine: 5, + StartPos: 67, + EndPos: 69, }, Value: "foo", }, @@ -760,42 +760,42 @@ func TestPhp5(t *testing.T) { Call: &node.Identifier{ Position: &position.Position{ StartLine: 5, - EndLine: 5, - StartPos: 72, - EndPos: 74, + EndLine: 5, + StartPos: 72, + EndPos: 74, }, Value: "bar", }, ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 5, - EndLine: 5, - StartPos: 75, - EndPos: 85, + EndLine: 5, + StartPos: 75, + EndPos: 85, }, Arguments: []node.Node{ &node.Argument{ Position: &position.Position{ StartLine: 5, - EndLine: 5, - StartPos: 76, - EndPos: 77, + EndLine: 5, + StartPos: 76, + EndPos: 77, }, - Variadic: false, + Variadic: false, IsReference: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 5, - EndLine: 5, - StartPos: 76, - EndPos: 77, + EndLine: 5, + StartPos: 76, + EndPos: 77, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 5, - EndLine: 5, - StartPos: 76, - EndPos: 77, + EndLine: 5, + StartPos: 76, + EndPos: 77, }, Value: "a", }, @@ -804,25 +804,25 @@ func TestPhp5(t *testing.T) { &node.Argument{ Position: &position.Position{ StartLine: 5, - EndLine: 5, - StartPos: 80, - EndPos: 84, + EndLine: 5, + StartPos: 80, + EndPos: 84, }, - Variadic: true, + Variadic: true, IsReference: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 5, - EndLine: 5, - StartPos: 83, - EndPos: 84, + EndLine: 5, + StartPos: 83, + EndPos: 84, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 5, - EndLine: 5, - StartPos: 83, - EndPos: 84, + EndLine: 5, + StartPos: 83, + EndPos: 84, }, Value: "b", }, @@ -835,30 +835,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 6, - EndLine: 6, - StartPos: 90, - EndPos: 110, + EndLine: 6, + StartPos: 90, + EndPos: 110, }, Expr: &expr.StaticCall{ Position: &position.Position{ StartLine: 6, - EndLine: 6, - StartPos: 90, - EndPos: 109, + EndLine: 6, + StartPos: 90, + EndPos: 109, }, Class: &expr.Variable{ Position: &position.Position{ StartLine: 6, - EndLine: 6, - StartPos: 90, - EndPos: 93, + EndLine: 6, + StartPos: 90, + EndPos: 93, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 6, - EndLine: 6, - StartPos: 90, - EndPos: 93, + EndLine: 6, + StartPos: 90, + EndPos: 93, }, Value: "foo", }, @@ -866,42 +866,42 @@ func TestPhp5(t *testing.T) { Call: &node.Identifier{ Position: &position.Position{ StartLine: 6, - EndLine: 6, - StartPos: 96, - EndPos: 98, + EndLine: 6, + StartPos: 96, + EndPos: 98, }, Value: "bar", }, ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 6, - EndLine: 6, - StartPos: 99, - EndPos: 109, + EndLine: 6, + StartPos: 99, + EndPos: 109, }, Arguments: []node.Node{ &node.Argument{ Position: &position.Position{ StartLine: 6, - EndLine: 6, - StartPos: 100, - EndPos: 101, + EndLine: 6, + StartPos: 100, + EndPos: 101, }, - Variadic: false, + Variadic: false, IsReference: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 6, - EndLine: 6, - StartPos: 100, - EndPos: 101, + EndLine: 6, + StartPos: 100, + EndPos: 101, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 6, - EndLine: 6, - StartPos: 100, - EndPos: 101, + EndLine: 6, + StartPos: 100, + EndPos: 101, }, Value: "a", }, @@ -910,25 +910,25 @@ func TestPhp5(t *testing.T) { &node.Argument{ Position: &position.Position{ StartLine: 6, - EndLine: 6, - StartPos: 104, - EndPos: 108, + EndLine: 6, + StartPos: 104, + EndPos: 108, }, - Variadic: true, + Variadic: true, IsReference: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 6, - EndLine: 6, - StartPos: 107, - EndPos: 108, + EndLine: 6, + StartPos: 107, + EndPos: 108, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 6, - EndLine: 6, - StartPos: 107, - EndPos: 108, + EndLine: 6, + StartPos: 107, + EndPos: 108, }, Value: "b", }, @@ -941,31 +941,31 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 7, - EndLine: 7, - StartPos: 114, - EndPos: 132, + EndLine: 7, + StartPos: 114, + EndPos: 132, }, Expr: &expr.New{ Position: &position.Position{ StartLine: 7, - EndLine: 7, - StartPos: 114, - EndPos: 131, + EndLine: 7, + StartPos: 114, + EndPos: 131, }, Class: &name.Name{ Position: &position.Position{ StartLine: 7, - EndLine: 7, - StartPos: 118, - EndPos: 120, + EndLine: 7, + StartPos: 118, + EndPos: 120, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 7, - EndLine: 7, - StartPos: 118, - EndPos: 120, + EndLine: 7, + StartPos: 118, + EndPos: 120, }, Value: "foo", }, @@ -974,33 +974,33 @@ func TestPhp5(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 7, - EndLine: 7, - StartPos: 121, - EndPos: 131, + EndLine: 7, + StartPos: 121, + EndPos: 131, }, Arguments: []node.Node{ &node.Argument{ Position: &position.Position{ StartLine: 7, - EndLine: 7, - StartPos: 122, - EndPos: 123, + EndLine: 7, + StartPos: 122, + EndPos: 123, }, - Variadic: false, + Variadic: false, IsReference: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 7, - EndLine: 7, - StartPos: 122, - EndPos: 123, + EndLine: 7, + StartPos: 122, + EndPos: 123, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 7, - EndLine: 7, - StartPos: 122, - EndPos: 123, + EndLine: 7, + StartPos: 122, + EndPos: 123, }, Value: "a", }, @@ -1009,25 +1009,25 @@ func TestPhp5(t *testing.T) { &node.Argument{ Position: &position.Position{ StartLine: 7, - EndLine: 7, - StartPos: 126, - EndPos: 130, + EndLine: 7, + StartPos: 126, + EndPos: 130, }, - Variadic: true, + Variadic: true, IsReference: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 7, - EndLine: 7, - StartPos: 129, - EndPos: 130, + EndLine: 7, + StartPos: 129, + EndPos: 130, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 7, - EndLine: 7, - StartPos: 129, - EndPos: 130, + EndLine: 7, + StartPos: 129, + EndPos: 130, }, Value: "b", }, @@ -1040,18 +1040,18 @@ func TestPhp5(t *testing.T) { &stmt.Function{ Position: &position.Position{ StartLine: 9, - EndLine: 9, - StartPos: 137, - EndPos: 180, + EndLine: 9, + StartPos: 137, + EndPos: 180, }, - ReturnsRef: false, + ReturnsRef: false, PhpDocComment: "", FunctionName: &node.Identifier{ Position: &position.Position{ StartLine: 9, - EndLine: 9, - StartPos: 146, - EndPos: 148, + EndLine: 9, + StartPos: 146, + EndPos: 148, }, Value: "foo", }, @@ -1059,26 +1059,26 @@ func TestPhp5(t *testing.T) { &node.Parameter{ Position: &position.Position{ StartLine: 9, - EndLine: 9, - StartPos: 150, - EndPos: 162, + EndLine: 9, + StartPos: 150, + EndPos: 162, }, + ByRef: false, Variadic: false, - ByRef: false, VariableType: &name.Name{ Position: &position.Position{ StartLine: 9, - EndLine: 9, - StartPos: 150, - EndPos: 152, + EndLine: 9, + StartPos: 150, + EndPos: 152, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 9, - EndLine: 9, - StartPos: 150, - EndPos: 152, + EndLine: 9, + StartPos: 150, + EndPos: 152, }, Value: "bar", }, @@ -1087,16 +1087,16 @@ func TestPhp5(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 9, - EndLine: 9, - StartPos: 154, - EndPos: 157, + EndLine: 9, + StartPos: 154, + EndPos: 157, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 9, - EndLine: 9, - StartPos: 154, - EndPos: 157, + EndLine: 9, + StartPos: 154, + EndPos: 157, }, Value: "bar", }, @@ -1104,24 +1104,24 @@ func TestPhp5(t *testing.T) { DefaultValue: &expr.ConstFetch{ Position: &position.Position{ StartLine: 9, - EndLine: 9, - StartPos: 159, - EndPos: 162, + EndLine: 9, + StartPos: 159, + EndPos: 162, }, Constant: &name.Name{ Position: &position.Position{ StartLine: 9, - EndLine: 9, - StartPos: 159, - EndPos: 162, + EndLine: 9, + StartPos: 159, + EndPos: 162, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 9, - EndLine: 9, - StartPos: 159, - EndPos: 162, + EndLine: 9, + StartPos: 159, + EndPos: 162, }, Value: "null", }, @@ -1132,26 +1132,26 @@ func TestPhp5(t *testing.T) { &node.Parameter{ Position: &position.Position{ StartLine: 9, - EndLine: 9, - StartPos: 165, - EndPos: 176, + EndLine: 9, + StartPos: 165, + EndPos: 176, }, Variadic: true, - ByRef: true, + ByRef: true, VariableType: &name.Name{ Position: &position.Position{ StartLine: 9, - EndLine: 9, - StartPos: 165, - EndPos: 167, + EndLine: 9, + StartPos: 165, + EndPos: 167, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 9, - EndLine: 9, - StartPos: 165, - EndPos: 167, + EndLine: 9, + StartPos: 165, + EndPos: 167, }, Value: "baz", }, @@ -1160,39 +1160,38 @@ func TestPhp5(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 9, - EndLine: 9, - StartPos: 173, - EndPos: 176, + EndLine: 9, + StartPos: 173, + EndPos: 176, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 9, - EndLine: 9, - StartPos: 173, - EndPos: 176, + EndLine: 9, + StartPos: 173, + EndPos: 176, }, Value: "baz", }, }, }, }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, &stmt.Class{ Position: &position.Position{ StartLine: 10, - EndLine: 10, - StartPos: 184, - EndPos: 246, + EndLine: 10, + StartPos: 184, + EndPos: 246, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 10, - EndLine: 10, - StartPos: 190, - EndPos: 192, + EndLine: 10, + StartPos: 190, + EndPos: 192, }, Value: "foo", }, @@ -1200,18 +1199,18 @@ func TestPhp5(t *testing.T) { &stmt.ClassMethod{ Position: &position.Position{ StartLine: 10, - EndLine: 10, - StartPos: 195, - EndPos: 245, + EndLine: 10, + StartPos: 195, + EndPos: 245, }, PhpDocComment: "", - ReturnsRef: false, + ReturnsRef: false, MethodName: &node.Identifier{ Position: &position.Position{ StartLine: 10, - EndLine: 10, - StartPos: 211, - EndPos: 213, + EndLine: 10, + StartPos: 211, + EndPos: 213, }, Value: "foo", }, @@ -1219,9 +1218,9 @@ func TestPhp5(t *testing.T) { &node.Identifier{ Position: &position.Position{ StartLine: 10, - EndLine: 10, - StartPos: 195, - EndPos: 200, + EndLine: 10, + StartPos: 195, + EndPos: 200, }, Value: "public", }, @@ -1230,26 +1229,26 @@ func TestPhp5(t *testing.T) { &node.Parameter{ Position: &position.Position{ StartLine: 10, - EndLine: 10, - StartPos: 215, - EndPos: 227, + EndLine: 10, + StartPos: 215, + EndPos: 227, }, - ByRef: false, + ByRef: false, Variadic: false, VariableType: &name.Name{ Position: &position.Position{ StartLine: 10, - EndLine: 10, - StartPos: 215, - EndPos: 217, + EndLine: 10, + StartPos: 215, + EndPos: 217, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 10, - EndLine: 10, - StartPos: 215, - EndPos: 217, + EndLine: 10, + StartPos: 215, + EndPos: 217, }, Value: "bar", }, @@ -1258,16 +1257,16 @@ func TestPhp5(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 10, - EndLine: 10, - StartPos: 219, - EndPos: 222, + EndLine: 10, + StartPos: 219, + EndPos: 222, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 10, - EndLine: 10, - StartPos: 219, - EndPos: 222, + EndLine: 10, + StartPos: 219, + EndPos: 222, }, Value: "bar", }, @@ -1275,24 +1274,24 @@ func TestPhp5(t *testing.T) { DefaultValue: &expr.ConstFetch{ Position: &position.Position{ StartLine: 10, - EndLine: 10, - StartPos: 224, - EndPos: 227, + EndLine: 10, + StartPos: 224, + EndPos: 227, }, Constant: &name.Name{ Position: &position.Position{ StartLine: 10, - EndLine: 10, - StartPos: 224, - EndPos: 227, + EndLine: 10, + StartPos: 224, + EndPos: 227, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 10, - EndLine: 10, - StartPos: 224, - EndPos: 227, + EndLine: 10, + StartPos: 224, + EndPos: 227, }, Value: "null", }, @@ -1303,26 +1302,26 @@ func TestPhp5(t *testing.T) { &node.Parameter{ Position: &position.Position{ StartLine: 10, - EndLine: 10, - StartPos: 230, - EndPos: 241, + EndLine: 10, + StartPos: 230, + EndPos: 241, }, - ByRef: true, + ByRef: true, Variadic: true, VariableType: &name.Name{ Position: &position.Position{ StartLine: 10, - EndLine: 10, - StartPos: 230, - EndPos: 232, + EndLine: 10, + StartPos: 230, + EndPos: 232, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 10, - EndLine: 10, - StartPos: 230, - EndPos: 232, + EndLine: 10, + StartPos: 230, + EndPos: 232, }, Value: "baz", }, @@ -1331,16 +1330,16 @@ func TestPhp5(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 10, - EndLine: 10, - StartPos: 238, - EndPos: 241, + EndLine: 10, + StartPos: 238, + EndPos: 241, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 10, - EndLine: 10, - StartPos: 238, - EndPos: 241, + EndLine: 10, + StartPos: 238, + EndPos: 241, }, Value: "baz", }, @@ -1350,12 +1349,11 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 10, - EndLine: 10, - StartPos: 244, - EndPos: 245, - }, - Stmts: []node.Node{ + EndLine: 10, + StartPos: 244, + EndPos: 245, }, + Stmts: []node.Node{}, }, }, }, @@ -1363,44 +1361,44 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 11, - EndLine: 11, - StartPos: 250, - EndPos: 290, + EndLine: 11, + StartPos: 250, + EndPos: 290, }, Expr: &expr.Closure{ Position: &position.Position{ StartLine: 11, - EndLine: 11, - StartPos: 250, - EndPos: 289, + EndLine: 11, + StartPos: 250, + EndPos: 289, }, - ReturnsRef: false, - Static: false, + ReturnsRef: false, + Static: false, PhpDocComment: "", Params: []node.Node{ &node.Parameter{ Position: &position.Position{ StartLine: 11, - EndLine: 11, - StartPos: 259, - EndPos: 271, + EndLine: 11, + StartPos: 259, + EndPos: 271, }, - ByRef: false, + ByRef: false, Variadic: false, VariableType: &name.Name{ Position: &position.Position{ StartLine: 11, - EndLine: 11, - StartPos: 259, - EndPos: 261, + EndLine: 11, + StartPos: 259, + EndPos: 261, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 11, - EndLine: 11, - StartPos: 259, - EndPos: 261, + EndLine: 11, + StartPos: 259, + EndPos: 261, }, Value: "bar", }, @@ -1409,16 +1407,16 @@ func TestPhp5(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 11, - EndLine: 11, - StartPos: 263, - EndPos: 266, + EndLine: 11, + StartPos: 263, + EndPos: 266, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 11, - EndLine: 11, - StartPos: 263, - EndPos: 266, + EndLine: 11, + StartPos: 263, + EndPos: 266, }, Value: "bar", }, @@ -1426,24 +1424,24 @@ func TestPhp5(t *testing.T) { DefaultValue: &expr.ConstFetch{ Position: &position.Position{ StartLine: 11, - EndLine: 11, - StartPos: 268, - EndPos: 271, + EndLine: 11, + StartPos: 268, + EndPos: 271, }, Constant: &name.Name{ Position: &position.Position{ StartLine: 11, - EndLine: 11, - StartPos: 268, - EndPos: 271, + EndLine: 11, + StartPos: 268, + EndPos: 271, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 11, - EndLine: 11, - StartPos: 268, - EndPos: 271, + EndLine: 11, + StartPos: 268, + EndPos: 271, }, Value: "null", }, @@ -1454,26 +1452,26 @@ func TestPhp5(t *testing.T) { &node.Parameter{ Position: &position.Position{ StartLine: 11, - EndLine: 11, - StartPos: 274, - EndPos: 285, + EndLine: 11, + StartPos: 274, + EndPos: 285, }, - ByRef: true, + ByRef: true, Variadic: true, VariableType: &name.Name{ Position: &position.Position{ StartLine: 11, - EndLine: 11, - StartPos: 274, - EndPos: 276, + EndLine: 11, + StartPos: 274, + EndPos: 276, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 11, - EndLine: 11, - StartPos: 274, - EndPos: 276, + EndLine: 11, + StartPos: 274, + EndPos: 276, }, Value: "baz", }, @@ -1482,67 +1480,66 @@ func TestPhp5(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 11, - EndLine: 11, - StartPos: 282, - EndPos: 285, + EndLine: 11, + StartPos: 282, + EndPos: 285, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 11, - EndLine: 11, - StartPos: 282, - EndPos: 285, + EndLine: 11, + StartPos: 282, + EndPos: 285, }, Value: "baz", }, }, }, }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 12, - EndLine: 12, - StartPos: 294, - EndPos: 341, + EndLine: 12, + StartPos: 294, + EndPos: 341, }, Expr: &expr.Closure{ Position: &position.Position{ StartLine: 12, - EndLine: 12, - StartPos: 294, - EndPos: 340, + EndLine: 12, + StartPos: 294, + EndPos: 340, }, - ReturnsRef: false, - Static: true, + ReturnsRef: false, + Static: true, PhpDocComment: "", Params: []node.Node{ &node.Parameter{ Position: &position.Position{ StartLine: 12, - EndLine: 12, - StartPos: 310, - EndPos: 322, + EndLine: 12, + StartPos: 310, + EndPos: 322, }, - ByRef: false, + ByRef: false, Variadic: false, VariableType: &name.Name{ Position: &position.Position{ StartLine: 12, - EndLine: 12, - StartPos: 310, - EndPos: 312, + EndLine: 12, + StartPos: 310, + EndPos: 312, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 12, - EndLine: 12, - StartPos: 310, - EndPos: 312, + EndLine: 12, + StartPos: 310, + EndPos: 312, }, Value: "bar", }, @@ -1551,16 +1548,16 @@ func TestPhp5(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 12, - EndLine: 12, - StartPos: 314, - EndPos: 317, + EndLine: 12, + StartPos: 314, + EndPos: 317, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 12, - EndLine: 12, - StartPos: 314, - EndPos: 317, + EndLine: 12, + StartPos: 314, + EndPos: 317, }, Value: "bar", }, @@ -1568,24 +1565,24 @@ func TestPhp5(t *testing.T) { DefaultValue: &expr.ConstFetch{ Position: &position.Position{ StartLine: 12, - EndLine: 12, - StartPos: 319, - EndPos: 322, + EndLine: 12, + StartPos: 319, + EndPos: 322, }, Constant: &name.Name{ Position: &position.Position{ StartLine: 12, - EndLine: 12, - StartPos: 319, - EndPos: 322, + EndLine: 12, + StartPos: 319, + EndPos: 322, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 12, - EndLine: 12, - StartPos: 319, - EndPos: 322, + EndLine: 12, + StartPos: 319, + EndPos: 322, }, Value: "null", }, @@ -1596,26 +1593,26 @@ func TestPhp5(t *testing.T) { &node.Parameter{ Position: &position.Position{ StartLine: 12, - EndLine: 12, - StartPos: 325, - EndPos: 336, + EndLine: 12, + StartPos: 325, + EndPos: 336, }, - ByRef: true, + ByRef: true, Variadic: true, VariableType: &name.Name{ Position: &position.Position{ StartLine: 12, - EndLine: 12, - StartPos: 325, - EndPos: 327, + EndLine: 12, + StartPos: 325, + EndPos: 327, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 12, - EndLine: 12, - StartPos: 325, - EndPos: 327, + EndLine: 12, + StartPos: 325, + EndPos: 327, }, Value: "baz", }, @@ -1624,39 +1621,38 @@ func TestPhp5(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 12, - EndLine: 12, - StartPos: 333, - EndPos: 336, + EndLine: 12, + StartPos: 333, + EndPos: 336, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 12, - EndLine: 12, - StartPos: 333, - EndPos: 336, + EndLine: 12, + StartPos: 333, + EndPos: 336, }, Value: "baz", }, }, }, }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 14, - EndLine: 14, - StartPos: 346, - EndPos: 365, + EndLine: 14, + StartPos: 346, + EndPos: 365, }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 14, - EndLine: 14, - StartPos: 346, - EndPos: 364, + EndLine: 14, + StartPos: 346, + EndPos: 364, }, Value: "1234567890123456789", }, @@ -1664,16 +1660,16 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 15, - EndLine: 15, - StartPos: 369, - EndPos: 389, + EndLine: 15, + StartPos: 369, + EndPos: 389, }, Expr: &scalar.Dnumber{ Position: &position.Position{ StartLine: 15, - EndLine: 15, - StartPos: 369, - EndPos: 388, + EndLine: 15, + StartPos: 369, + EndPos: 388, }, Value: "12345678901234567890", }, @@ -1681,16 +1677,16 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 16, - EndLine: 16, - StartPos: 393, - EndPos: 395, + EndLine: 16, + StartPos: 393, + EndPos: 395, }, Expr: &scalar.Dnumber{ Position: &position.Position{ StartLine: 16, - EndLine: 16, - StartPos: 393, - EndPos: 394, + EndLine: 16, + StartPos: 393, + EndPos: 394, }, Value: "0.", }, @@ -1698,16 +1694,16 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 17, - EndLine: 17, - StartPos: 399, - EndPos: 465, + EndLine: 17, + StartPos: 399, + EndPos: 465, }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 17, - EndLine: 17, - StartPos: 399, - EndPos: 464, + EndLine: 17, + StartPos: 399, + EndPos: 464, }, Value: "0b0111111111111111111111111111111111111111111111111111111111111111", }, @@ -1715,16 +1711,16 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 18, - EndLine: 18, - StartPos: 469, - EndPos: 535, + EndLine: 18, + StartPos: 469, + EndPos: 535, }, Expr: &scalar.Dnumber{ Position: &position.Position{ StartLine: 18, - EndLine: 18, - StartPos: 469, - EndPos: 534, + EndLine: 18, + StartPos: 469, + EndPos: 534, }, Value: "0b1111111111111111111111111111111111111111111111111111111111111111", }, @@ -1732,16 +1728,16 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 19, - EndLine: 19, - StartPos: 539, - EndPos: 559, + EndLine: 19, + StartPos: 539, + EndPos: 559, }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 19, - EndLine: 19, - StartPos: 539, - EndPos: 558, + EndLine: 19, + StartPos: 539, + EndPos: 558, }, Value: "0x007111111111111111", }, @@ -1749,16 +1745,16 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 20, - EndLine: 20, - StartPos: 563, - EndPos: 581, + EndLine: 20, + StartPos: 563, + EndPos: 581, }, Expr: &scalar.Dnumber{ Position: &position.Position{ StartLine: 20, - EndLine: 20, - StartPos: 563, - EndPos: 580, + EndLine: 20, + StartPos: 563, + EndPos: 580, }, Value: "0x8111111111111111", }, @@ -1766,16 +1762,16 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 21, - EndLine: 21, - StartPos: 585, - EndPos: 594, + EndLine: 21, + StartPos: 585, + EndPos: 594, }, Expr: &scalar.MagicConstant{ Position: &position.Position{ StartLine: 21, - EndLine: 21, - StartPos: 585, - EndPos: 593, + EndLine: 21, + StartPos: 585, + EndPos: 593, }, Value: "__CLASS__", }, @@ -1783,16 +1779,16 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 22, - EndLine: 22, - StartPos: 598, - EndPos: 605, + EndLine: 22, + StartPos: 598, + EndPos: 605, }, Expr: &scalar.MagicConstant{ Position: &position.Position{ StartLine: 22, - EndLine: 22, - StartPos: 598, - EndPos: 604, + EndLine: 22, + StartPos: 598, + EndPos: 604, }, Value: "__DIR__", }, @@ -1800,16 +1796,16 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 23, - EndLine: 23, - StartPos: 609, - EndPos: 617, + EndLine: 23, + StartPos: 609, + EndPos: 617, }, Expr: &scalar.MagicConstant{ Position: &position.Position{ StartLine: 23, - EndLine: 23, - StartPos: 609, - EndPos: 616, + EndLine: 23, + StartPos: 609, + EndPos: 616, }, Value: "__FILE__", }, @@ -1817,16 +1813,16 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 24, - EndLine: 24, - StartPos: 621, - EndPos: 633, + EndLine: 24, + StartPos: 621, + EndPos: 633, }, Expr: &scalar.MagicConstant{ Position: &position.Position{ StartLine: 24, - EndLine: 24, - StartPos: 621, - EndPos: 632, + EndLine: 24, + StartPos: 621, + EndPos: 632, }, Value: "__FUNCTION__", }, @@ -1834,16 +1830,16 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 25, - EndLine: 25, - StartPos: 637, - EndPos: 645, + EndLine: 25, + StartPos: 637, + EndPos: 645, }, Expr: &scalar.MagicConstant{ Position: &position.Position{ StartLine: 25, - EndLine: 25, - StartPos: 637, - EndPos: 644, + EndLine: 25, + StartPos: 637, + EndPos: 644, }, Value: "__LINE__", }, @@ -1851,16 +1847,16 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 26, - EndLine: 26, - StartPos: 649, - EndPos: 662, + EndLine: 26, + StartPos: 649, + EndPos: 662, }, Expr: &scalar.MagicConstant{ Position: &position.Position{ StartLine: 26, - EndLine: 26, - StartPos: 649, - EndPos: 661, + EndLine: 26, + StartPos: 649, + EndPos: 661, }, Value: "__NAMESPACE__", }, @@ -1868,16 +1864,16 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 27, - EndLine: 27, - StartPos: 666, - EndPos: 676, + EndLine: 27, + StartPos: 666, + EndPos: 676, }, Expr: &scalar.MagicConstant{ Position: &position.Position{ StartLine: 27, - EndLine: 27, - StartPos: 666, - EndPos: 675, + EndLine: 27, + StartPos: 666, + EndPos: 675, }, Value: "__METHOD__", }, @@ -1885,16 +1881,16 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 28, - EndLine: 28, - StartPos: 680, - EndPos: 689, + EndLine: 28, + StartPos: 680, + EndPos: 689, }, Expr: &scalar.MagicConstant{ Position: &position.Position{ StartLine: 28, - EndLine: 28, - StartPos: 680, - EndPos: 688, + EndLine: 28, + StartPos: 680, + EndPos: 688, }, Value: "__TRAIT__", }, @@ -1902,40 +1898,40 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 30, - EndLine: 30, - StartPos: 694, - EndPos: 705, + EndLine: 30, + StartPos: 694, + EndPos: 705, }, Expr: &scalar.Encapsed{ Position: &position.Position{ StartLine: 30, - EndLine: 30, - StartPos: 694, - EndPos: 704, + EndLine: 30, + StartPos: 694, + EndPos: 704, }, Parts: []node.Node{ &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 30, - EndLine: 30, - StartPos: 695, - EndPos: 699, + EndLine: 30, + StartPos: 695, + EndPos: 699, }, Value: "test ", }, &expr.Variable{ Position: &position.Position{ StartLine: 30, - EndLine: 30, - StartPos: 700, - EndPos: 703, + EndLine: 30, + StartPos: 700, + EndPos: 703, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 30, - EndLine: 30, - StartPos: 700, - EndPos: 703, + EndLine: 30, + StartPos: 700, + EndPos: 703, }, Value: "var", }, @@ -1946,47 +1942,47 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 31, - EndLine: 31, - StartPos: 709, - EndPos: 723, + EndLine: 31, + StartPos: 709, + EndPos: 723, }, Expr: &scalar.Encapsed{ Position: &position.Position{ StartLine: 31, - EndLine: 31, - StartPos: 709, - EndPos: 722, + EndLine: 31, + StartPos: 709, + EndPos: 722, }, Parts: []node.Node{ &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 31, - EndLine: 31, - StartPos: 710, - EndPos: 714, + EndLine: 31, + StartPos: 710, + EndPos: 714, }, Value: "test ", }, &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 31, - EndLine: 31, - StartPos: 715, - EndPos: 721, + EndLine: 31, + StartPos: 715, + EndPos: 721, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 31, - EndLine: 31, - StartPos: 715, - EndPos: 718, + EndLine: 31, + StartPos: 715, + EndPos: 718, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 31, - EndLine: 31, - StartPos: 715, - EndPos: 718, + EndLine: 31, + StartPos: 715, + EndPos: 718, }, Value: "var", }, @@ -1994,9 +1990,9 @@ func TestPhp5(t *testing.T) { Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 31, - EndLine: 31, - StartPos: 720, - EndPos: 720, + EndLine: 31, + StartPos: 720, + EndPos: 720, }, Value: "1", }, @@ -2007,47 +2003,47 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 32, - EndLine: 32, - StartPos: 727, - EndPos: 780, + EndLine: 32, + StartPos: 727, + EndPos: 780, }, Expr: &scalar.Encapsed{ Position: &position.Position{ StartLine: 32, - EndLine: 32, - StartPos: 727, - EndPos: 779, + EndLine: 32, + StartPos: 727, + EndPos: 779, }, Parts: []node.Node{ &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 32, - EndLine: 32, - StartPos: 728, - EndPos: 732, + EndLine: 32, + StartPos: 728, + EndPos: 732, }, Value: "test ", }, &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 32, - EndLine: 32, - StartPos: 733, - EndPos: 778, + EndLine: 32, + StartPos: 733, + EndPos: 778, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 32, - EndLine: 32, - StartPos: 733, - EndPos: 736, + EndLine: 32, + StartPos: 733, + EndPos: 736, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 32, - EndLine: 32, - StartPos: 733, - EndPos: 736, + EndLine: 32, + StartPos: 733, + EndPos: 736, }, Value: "var", }, @@ -2055,9 +2051,9 @@ func TestPhp5(t *testing.T) { Dim: &scalar.String{ Position: &position.Position{ StartLine: 32, - EndLine: 32, - StartPos: 738, - EndPos: 777, + EndLine: 32, + StartPos: 738, + EndPos: 777, }, Value: "1234567890123456789012345678901234567890", }, @@ -2068,47 +2064,47 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 33, - EndLine: 33, - StartPos: 784, - EndPos: 800, + EndLine: 33, + StartPos: 784, + EndPos: 800, }, Expr: &scalar.Encapsed{ Position: &position.Position{ StartLine: 33, - EndLine: 33, - StartPos: 784, - EndPos: 799, + EndLine: 33, + StartPos: 784, + EndPos: 799, }, Parts: []node.Node{ &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 33, - EndLine: 33, - StartPos: 785, - EndPos: 789, + EndLine: 33, + StartPos: 785, + EndPos: 789, }, Value: "test ", }, &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 33, - EndLine: 33, - StartPos: 790, - EndPos: 798, + EndLine: 33, + StartPos: 790, + EndPos: 798, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 33, - EndLine: 33, - StartPos: 790, - EndPos: 793, + EndLine: 33, + StartPos: 790, + EndPos: 793, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 33, - EndLine: 33, - StartPos: 790, - EndPos: 793, + EndLine: 33, + StartPos: 790, + EndPos: 793, }, Value: "var", }, @@ -2116,9 +2112,9 @@ func TestPhp5(t *testing.T) { Dim: &scalar.String{ Position: &position.Position{ StartLine: 33, - EndLine: 33, - StartPos: 795, - EndPos: 797, + EndLine: 33, + StartPos: 795, + EndPos: 797, }, Value: "bar", }, @@ -2129,47 +2125,47 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 34, - EndLine: 34, - StartPos: 804, - EndPos: 821, + EndLine: 34, + StartPos: 804, + EndPos: 821, }, Expr: &scalar.Encapsed{ Position: &position.Position{ StartLine: 34, - EndLine: 34, - StartPos: 804, - EndPos: 820, + EndLine: 34, + StartPos: 804, + EndPos: 820, }, Parts: []node.Node{ &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 34, - EndLine: 34, - StartPos: 805, - EndPos: 809, + EndLine: 34, + StartPos: 805, + EndPos: 809, }, Value: "test ", }, &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 34, - EndLine: 34, - StartPos: 810, - EndPos: 819, + EndLine: 34, + StartPos: 810, + EndPos: 819, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 34, - EndLine: 34, - StartPos: 810, - EndPos: 813, + EndLine: 34, + StartPos: 810, + EndPos: 813, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 34, - EndLine: 34, - StartPos: 810, - EndPos: 813, + EndLine: 34, + StartPos: 810, + EndPos: 813, }, Value: "var", }, @@ -2177,16 +2173,16 @@ func TestPhp5(t *testing.T) { Dim: &expr.Variable{ Position: &position.Position{ StartLine: 34, - EndLine: 34, - StartPos: 815, - EndPos: 818, + EndLine: 34, + StartPos: 815, + EndPos: 818, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 34, - EndLine: 34, - StartPos: 815, - EndPos: 818, + EndLine: 34, + StartPos: 815, + EndPos: 818, }, Value: "bar", }, @@ -2198,31 +2194,31 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 35, - EndLine: 35, - StartPos: 825, - EndPos: 836, + EndLine: 35, + StartPos: 825, + EndPos: 836, }, Expr: &scalar.Encapsed{ Position: &position.Position{ StartLine: 35, - EndLine: 35, - StartPos: 825, - EndPos: 835, + EndLine: 35, + StartPos: 825, + EndPos: 835, }, Parts: []node.Node{ &expr.Variable{ Position: &position.Position{ StartLine: 35, - EndLine: 35, - StartPos: 826, - EndPos: 829, + EndLine: 35, + StartPos: 826, + EndPos: 829, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 35, - EndLine: 35, - StartPos: 826, - EndPos: 829, + EndLine: 35, + StartPos: 826, + EndPos: 829, }, Value: "foo", }, @@ -2230,25 +2226,25 @@ func TestPhp5(t *testing.T) { &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 35, - EndLine: 35, - StartPos: 830, - EndPos: 830, + EndLine: 35, + StartPos: 830, + EndPos: 830, }, Value: " ", }, &expr.Variable{ Position: &position.Position{ StartLine: 35, - EndLine: 35, - StartPos: 831, - EndPos: 834, + EndLine: 35, + StartPos: 831, + EndPos: 834, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 35, - EndLine: 35, - StartPos: 831, - EndPos: 834, + EndLine: 35, + StartPos: 831, + EndPos: 834, }, Value: "bar", }, @@ -2259,47 +2255,47 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 36, - EndLine: 36, - StartPos: 840, - EndPos: 858, + EndLine: 36, + StartPos: 840, + EndPos: 858, }, Expr: &scalar.Encapsed{ Position: &position.Position{ StartLine: 36, - EndLine: 36, - StartPos: 840, - EndPos: 857, + EndLine: 36, + StartPos: 840, + EndPos: 857, }, Parts: []node.Node{ &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 36, - EndLine: 36, - StartPos: 841, - EndPos: 845, + EndLine: 36, + StartPos: 841, + EndPos: 845, }, Value: "test ", }, &expr.PropertyFetch{ Position: &position.Position{ StartLine: 36, - EndLine: 36, - StartPos: 846, - EndPos: 854, + EndLine: 36, + StartPos: 846, + EndPos: 854, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 36, - EndLine: 36, - StartPos: 846, - EndPos: 849, + EndLine: 36, + StartPos: 846, + EndPos: 849, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 36, - EndLine: 36, - StartPos: 846, - EndPos: 849, + EndLine: 36, + StartPos: 846, + EndPos: 849, }, Value: "foo", }, @@ -2307,9 +2303,9 @@ func TestPhp5(t *testing.T) { Property: &node.Identifier{ Position: &position.Position{ StartLine: 36, - EndLine: 36, - StartPos: 852, - EndPos: 854, + EndLine: 36, + StartPos: 852, + EndPos: 854, }, Value: "bar", }, @@ -2317,9 +2313,9 @@ func TestPhp5(t *testing.T) { &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 36, - EndLine: 36, - StartPos: 855, - EndPos: 856, + EndLine: 36, + StartPos: 855, + EndPos: 856, }, Value: "()", }, @@ -2329,40 +2325,40 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 37, - EndLine: 37, - StartPos: 862, - EndPos: 875, + EndLine: 37, + StartPos: 862, + EndPos: 875, }, Expr: &scalar.Encapsed{ Position: &position.Position{ StartLine: 37, - EndLine: 37, - StartPos: 862, - EndPos: 874, + EndLine: 37, + StartPos: 862, + EndPos: 874, }, Parts: []node.Node{ &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 37, - EndLine: 37, - StartPos: 863, - EndPos: 867, + EndLine: 37, + StartPos: 863, + EndPos: 867, }, Value: "test ", }, &expr.Variable{ Position: &position.Position{ StartLine: 37, - EndLine: 37, - StartPos: 868, - EndPos: 873, + EndLine: 37, + StartPos: 868, + EndPos: 873, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 37, - EndLine: 37, - StartPos: 870, - EndPos: 872, + EndLine: 37, + StartPos: 870, + EndPos: 872, }, Value: "foo", }, @@ -2373,47 +2369,47 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 38, - EndLine: 38, - StartPos: 879, - EndPos: 895, + EndLine: 38, + StartPos: 879, + EndPos: 895, }, Expr: &scalar.Encapsed{ Position: &position.Position{ StartLine: 38, - EndLine: 38, - StartPos: 879, - EndPos: 894, + EndLine: 38, + StartPos: 879, + EndPos: 894, }, Parts: []node.Node{ &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 38, - EndLine: 38, - StartPos: 880, - EndPos: 884, + EndLine: 38, + StartPos: 880, + EndPos: 884, }, Value: "test ", }, &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 38, - EndLine: 38, - StartPos: 885, - EndPos: 893, + EndLine: 38, + StartPos: 885, + EndPos: 893, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 38, - EndLine: 38, - StartPos: 887, - EndPos: 889, + EndLine: 38, + StartPos: 887, + EndPos: 889, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 38, - EndLine: 38, - StartPos: 887, - EndPos: 889, + EndLine: 38, + StartPos: 887, + EndPos: 889, }, Value: "foo", }, @@ -2421,9 +2417,9 @@ func TestPhp5(t *testing.T) { Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 38, - EndLine: 38, - StartPos: 891, - EndPos: 891, + EndLine: 38, + StartPos: 891, + EndPos: 891, }, Value: "0", }, @@ -2434,47 +2430,47 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 39, - EndLine: 39, - StartPos: 899, - EndPos: 919, + EndLine: 39, + StartPos: 899, + EndPos: 919, }, Expr: &scalar.Encapsed{ Position: &position.Position{ StartLine: 39, - EndLine: 39, - StartPos: 899, - EndPos: 918, + EndLine: 39, + StartPos: 899, + EndPos: 918, }, Parts: []node.Node{ &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 39, - EndLine: 39, - StartPos: 900, - EndPos: 904, + EndLine: 39, + StartPos: 900, + EndPos: 904, }, Value: "test ", }, &expr.MethodCall{ Position: &position.Position{ StartLine: 39, - EndLine: 39, - StartPos: 906, - EndPos: 916, + EndLine: 39, + StartPos: 906, + EndPos: 916, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 39, - EndLine: 39, - StartPos: 906, - EndPos: 909, + EndLine: 39, + StartPos: 906, + EndPos: 909, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 39, - EndLine: 39, - StartPos: 906, - EndPos: 909, + EndLine: 39, + StartPos: 906, + EndPos: 909, }, Value: "foo", }, @@ -2482,18 +2478,18 @@ func TestPhp5(t *testing.T) { Method: &node.Identifier{ Position: &position.Position{ StartLine: 39, - EndLine: 39, - StartPos: 912, - EndPos: 914, + EndLine: 39, + StartPos: 912, + EndPos: 914, }, Value: "bar", }, ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 39, - EndLine: 39, - StartPos: 915, - EndPos: 916, + EndLine: 39, + StartPos: 915, + EndPos: 916, }, }, }, @@ -2503,23 +2499,23 @@ func TestPhp5(t *testing.T) { &stmt.AltIf{ Position: &position.Position{ StartLine: 41, - EndLine: 42, - StartPos: 924, - EndPos: 941, + EndLine: 42, + StartPos: 924, + EndPos: 941, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 41, - EndLine: 41, - StartPos: 928, - EndPos: 929, + EndLine: 41, + StartPos: 928, + EndPos: 929, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 41, - EndLine: 41, - StartPos: 928, - EndPos: 929, + EndLine: 41, + StartPos: 928, + EndPos: 929, }, Value: "a", }, @@ -2527,34 +2523,33 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - Stmts: []node.Node{ + EndLine: -1, + StartPos: -1, + EndPos: -1, }, + Stmts: []node.Node{}, }, }, &stmt.AltIf{ Position: &position.Position{ StartLine: 43, - EndLine: 45, - StartPos: 945, - EndPos: 977, + EndLine: 45, + StartPos: 945, + EndPos: 977, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 43, - EndLine: 43, - StartPos: 949, - EndPos: 950, + EndLine: 43, + StartPos: 949, + EndPos: 950, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 43, - EndLine: 43, - StartPos: 949, - EndPos: 950, + EndLine: 43, + StartPos: 949, + EndPos: 950, }, Value: "a", }, @@ -2562,34 +2557,33 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - Stmts: []node.Node{ + EndLine: -1, + StartPos: -1, + EndPos: -1, }, + Stmts: []node.Node{}, }, ElseIf: []node.Node{ &stmt.AltElseIf{ Position: &position.Position{ StartLine: 44, - EndLine: -1, - StartPos: 957, - EndPos: -1, + EndLine: -1, + StartPos: 957, + EndPos: -1, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 44, - EndLine: 44, - StartPos: 965, - EndPos: 966, + EndLine: 44, + StartPos: 965, + EndPos: 966, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 44, - EndLine: 44, - StartPos: 965, - EndPos: 966, + EndLine: 44, + StartPos: 965, + EndPos: 966, }, Value: "b", }, @@ -2597,12 +2591,11 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - Stmts: []node.Node{ + EndLine: -1, + StartPos: -1, + EndPos: -1, }, + Stmts: []node.Node{}, }, }, }, @@ -2610,23 +2603,23 @@ func TestPhp5(t *testing.T) { &stmt.AltIf{ Position: &position.Position{ StartLine: 46, - EndLine: 48, - StartPos: 981, - EndPos: 1006, + EndLine: 48, + StartPos: 981, + EndPos: 1006, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 46, - EndLine: 46, - StartPos: 985, - EndPos: 986, + EndLine: 46, + StartPos: 985, + EndPos: 986, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 46, - EndLine: 46, - StartPos: 985, - EndPos: 986, + EndLine: 46, + StartPos: 985, + EndPos: 986, }, Value: "a", }, @@ -2634,52 +2627,50 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - Stmts: []node.Node{ + EndLine: -1, + StartPos: -1, + EndPos: -1, }, + Stmts: []node.Node{}, }, Else: &stmt.AltElse{ Position: &position.Position{ StartLine: 47, - EndLine: -1, - StartPos: 993, - EndPos: -1, + EndLine: -1, + StartPos: 993, + EndPos: -1, }, Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - Stmts: []node.Node{ + EndLine: -1, + StartPos: -1, + EndPos: -1, }, + Stmts: []node.Node{}, }, }, }, &stmt.AltIf{ Position: &position.Position{ StartLine: 49, - EndLine: 53, - StartPos: 1010, - EndPos: 1065, + EndLine: 53, + StartPos: 1010, + EndPos: 1065, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 49, - EndLine: 49, - StartPos: 1014, - EndPos: 1015, + EndLine: 49, + StartPos: 1014, + EndPos: 1015, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 49, - EndLine: 49, - StartPos: 1014, - EndPos: 1015, + EndLine: 49, + StartPos: 1014, + EndPos: 1015, }, Value: "a", }, @@ -2687,34 +2678,33 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - Stmts: []node.Node{ + EndLine: -1, + StartPos: -1, + EndPos: -1, }, + Stmts: []node.Node{}, }, ElseIf: []node.Node{ &stmt.AltElseIf{ Position: &position.Position{ StartLine: 50, - EndLine: -1, - StartPos: 1022, - EndPos: -1, + EndLine: -1, + StartPos: 1022, + EndPos: -1, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 50, - EndLine: 50, - StartPos: 1030, - EndPos: 1031, + EndLine: 50, + StartPos: 1030, + EndPos: 1031, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 50, - EndLine: 50, - StartPos: 1030, - EndPos: 1031, + EndLine: 50, + StartPos: 1030, + EndPos: 1031, }, Value: "b", }, @@ -2722,34 +2712,33 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - Stmts: []node.Node{ + EndLine: -1, + StartPos: -1, + EndPos: -1, }, + Stmts: []node.Node{}, }, }, &stmt.AltElseIf{ Position: &position.Position{ StartLine: 51, - EndLine: -1, - StartPos: 1037, - EndPos: -1, + EndLine: -1, + StartPos: 1037, + EndPos: -1, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 51, - EndLine: 51, - StartPos: 1045, - EndPos: 1046, + EndLine: 51, + StartPos: 1045, + EndPos: 1046, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 51, - EndLine: 51, - StartPos: 1045, - EndPos: 1046, + EndLine: 51, + StartPos: 1045, + EndPos: 1046, }, Value: "c", }, @@ -2757,64 +2746,62 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - Stmts: []node.Node{ + EndLine: -1, + StartPos: -1, + EndPos: -1, }, + Stmts: []node.Node{}, }, }, }, Else: &stmt.AltElse{ Position: &position.Position{ StartLine: 52, - EndLine: -1, - StartPos: 1052, - EndPos: -1, + EndLine: -1, + StartPos: 1052, + EndPos: -1, }, Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - Stmts: []node.Node{ + EndLine: -1, + StartPos: -1, + EndPos: -1, }, + Stmts: []node.Node{}, }, }, }, &stmt.While{ Position: &position.Position{ StartLine: 55, - EndLine: 55, - StartPos: 1070, - EndPos: 1089, + EndLine: 55, + StartPos: 1070, + EndPos: 1089, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 55, - EndLine: 55, - StartPos: 1077, - EndPos: 1077, + EndLine: 55, + StartPos: 1077, + EndPos: 1077, }, Value: "1", }, Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 55, - EndLine: 55, - StartPos: 1080, - EndPos: 1089, + EndLine: 55, + StartPos: 1080, + EndPos: 1089, }, Stmts: []node.Node{ &stmt.Break{ Position: &position.Position{ StartLine: 55, - EndLine: 55, - StartPos: 1082, - EndPos: 1087, + EndLine: 55, + StartPos: 1082, + EndPos: 1087, }, }, }, @@ -2823,40 +2810,40 @@ func TestPhp5(t *testing.T) { &stmt.While{ Position: &position.Position{ StartLine: 56, - EndLine: 56, - StartPos: 1093, - EndPos: 1114, + EndLine: 56, + StartPos: 1093, + EndPos: 1114, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 56, - EndLine: 56, - StartPos: 1100, - EndPos: 1100, + EndLine: 56, + StartPos: 1100, + EndPos: 1100, }, Value: "1", }, Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 56, - EndLine: 56, - StartPos: 1103, - EndPos: 1114, + EndLine: 56, + StartPos: 1103, + EndPos: 1114, }, Stmts: []node.Node{ &stmt.Break{ Position: &position.Position{ StartLine: 56, - EndLine: 56, - StartPos: 1105, - EndPos: 1112, + EndLine: 56, + StartPos: 1105, + EndPos: 1112, }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 56, - EndLine: 56, - StartPos: 1111, - EndPos: 1111, + EndLine: 56, + StartPos: 1111, + EndPos: 1111, }, Value: "2", }, @@ -2867,40 +2854,40 @@ func TestPhp5(t *testing.T) { &stmt.AltWhile{ Position: &position.Position{ StartLine: 57, - EndLine: 57, - StartPos: 1118, - EndPos: 1148, + EndLine: 57, + StartPos: 1118, + EndPos: 1148, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 57, - EndLine: 57, - StartPos: 1125, - EndPos: 1125, + EndLine: 57, + StartPos: 1125, + EndPos: 1125, }, Value: "1", }, Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 57, - EndLine: 57, - StartPos: 1130, - EndPos: 1138, + EndLine: 57, + StartPos: 1130, + EndPos: 1138, }, Stmts: []node.Node{ &stmt.Break{ Position: &position.Position{ StartLine: 57, - EndLine: 57, - StartPos: 1130, - EndPos: 1138, + EndLine: 57, + StartPos: 1130, + EndPos: 1138, }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 57, - EndLine: 57, - StartPos: 1136, - EndPos: 1136, + EndLine: 57, + StartPos: 1136, + EndPos: 1136, }, Value: "3", }, @@ -2911,17 +2898,17 @@ func TestPhp5(t *testing.T) { &stmt.Class{ Position: &position.Position{ StartLine: 58, - EndLine: 58, - StartPos: 1152, - EndPos: 1187, + EndLine: 58, + StartPos: 1152, + EndPos: 1187, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 58, - EndLine: 58, - StartPos: 1158, - EndPos: 1160, + EndLine: 58, + StartPos: 1158, + EndPos: 1160, }, Value: "foo", }, @@ -2929,34 +2916,34 @@ func TestPhp5(t *testing.T) { &stmt.ClassConstList{ Position: &position.Position{ StartLine: 58, - EndLine: 58, - StartPos: 1163, - EndPos: 1185, + EndLine: 58, + StartPos: 1163, + EndPos: 1185, }, Consts: []node.Node{ &stmt.Constant{ Position: &position.Position{ StartLine: 58, - EndLine: 58, - StartPos: 1169, - EndPos: 1175, + EndLine: 58, + StartPos: 1169, + EndPos: 1175, }, PhpDocComment: "", ConstantName: &node.Identifier{ Position: &position.Position{ StartLine: 58, - EndLine: 58, - StartPos: 1169, - EndPos: 1171, + EndLine: 58, + StartPos: 1169, + EndPos: 1171, }, Value: "FOO", }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 58, - EndLine: 58, - StartPos: 1175, - EndPos: 1175, + EndLine: 58, + StartPos: 1175, + EndPos: 1175, }, Value: "1", }, @@ -2964,26 +2951,26 @@ func TestPhp5(t *testing.T) { &stmt.Constant{ Position: &position.Position{ StartLine: 58, - EndLine: 58, - StartPos: 1178, - EndPos: 1184, + EndLine: 58, + StartPos: 1178, + EndPos: 1184, }, PhpDocComment: "", ConstantName: &node.Identifier{ Position: &position.Position{ StartLine: 58, - EndLine: 58, - StartPos: 1178, - EndPos: 1180, + EndLine: 58, + StartPos: 1178, + EndPos: 1180, }, Value: "BAR", }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 58, - EndLine: 58, - StartPos: 1184, - EndPos: 1184, + EndLine: 58, + StartPos: 1184, + EndPos: 1184, }, Value: "2", }, @@ -2995,17 +2982,17 @@ func TestPhp5(t *testing.T) { &stmt.Class{ Position: &position.Position{ StartLine: 59, - EndLine: 59, - StartPos: 1191, - EndPos: 1220, + EndLine: 59, + StartPos: 1191, + EndPos: 1220, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 59, - EndLine: 59, - StartPos: 1197, - EndPos: 1199, + EndLine: 59, + StartPos: 1197, + EndPos: 1199, }, Value: "foo", }, @@ -3013,30 +3000,29 @@ func TestPhp5(t *testing.T) { &stmt.ClassMethod{ Position: &position.Position{ StartLine: 59, - EndLine: 59, - StartPos: 1202, - EndPos: 1218, + EndLine: 59, + StartPos: 1202, + EndPos: 1218, }, - ReturnsRef: false, + ReturnsRef: false, PhpDocComment: "", MethodName: &node.Identifier{ Position: &position.Position{ StartLine: 59, - EndLine: 59, - StartPos: 1211, - EndPos: 1213, + EndLine: 59, + StartPos: 1211, + EndPos: 1213, }, Value: "bar", }, Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 59, - EndLine: 59, - StartPos: 1217, - EndPos: 1218, - }, - Stmts: []node.Node{ + EndLine: 59, + StartPos: 1217, + EndPos: 1218, }, + Stmts: []node.Node{}, }, }, }, @@ -3044,17 +3030,17 @@ func TestPhp5(t *testing.T) { &stmt.Class{ Position: &position.Position{ StartLine: 60, - EndLine: 60, - StartPos: 1224, - EndPos: 1268, + EndLine: 60, + StartPos: 1224, + EndPos: 1268, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 60, - EndLine: 60, - StartPos: 1230, - EndPos: 1232, + EndLine: 60, + StartPos: 1230, + EndPos: 1232, }, Value: "foo", }, @@ -3062,18 +3048,18 @@ func TestPhp5(t *testing.T) { &stmt.ClassMethod{ Position: &position.Position{ StartLine: 60, - EndLine: 60, - StartPos: 1235, - EndPos: 1266, + EndLine: 60, + StartPos: 1235, + EndPos: 1266, }, - ReturnsRef: true, + ReturnsRef: true, PhpDocComment: "", MethodName: &node.Identifier{ Position: &position.Position{ StartLine: 60, - EndLine: 60, - StartPos: 1259, - EndPos: 1261, + EndLine: 60, + StartPos: 1259, + EndPos: 1261, }, Value: "bar", }, @@ -3081,18 +3067,18 @@ func TestPhp5(t *testing.T) { &node.Identifier{ Position: &position.Position{ StartLine: 60, - EndLine: 60, - StartPos: 1235, - EndPos: 1240, + EndLine: 60, + StartPos: 1235, + EndPos: 1240, }, Value: "public", }, &node.Identifier{ Position: &position.Position{ StartLine: 60, - EndLine: 60, - StartPos: 1242, - EndPos: 1247, + EndLine: 60, + StartPos: 1242, + EndPos: 1247, }, Value: "static", }, @@ -3100,12 +3086,11 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 60, - EndLine: 60, - StartPos: 1265, - EndPos: 1266, - }, - Stmts: []node.Node{ + EndLine: 60, + StartPos: 1265, + EndPos: 1266, }, + Stmts: []node.Node{}, }, }, }, @@ -3113,17 +3098,17 @@ func TestPhp5(t *testing.T) { &stmt.Class{ Position: &position.Position{ StartLine: 61, - EndLine: 61, - StartPos: 1272, - EndPos: 1343, + EndLine: 61, + StartPos: 1272, + EndPos: 1343, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 61, - EndLine: 61, - StartPos: 1278, - EndPos: 1280, + EndLine: 61, + StartPos: 1278, + EndPos: 1280, }, Value: "foo", }, @@ -3131,18 +3116,18 @@ func TestPhp5(t *testing.T) { &stmt.ClassMethod{ Position: &position.Position{ StartLine: 61, - EndLine: 61, - StartPos: 1283, - EndPos: 1313, + EndLine: 61, + StartPos: 1283, + EndPos: 1313, }, - ReturnsRef: false, + ReturnsRef: false, PhpDocComment: "", MethodName: &node.Identifier{ Position: &position.Position{ StartLine: 61, - EndLine: 61, - StartPos: 1306, - EndPos: 1308, + EndLine: 61, + StartPos: 1306, + EndPos: 1308, }, Value: "bar", }, @@ -3150,18 +3135,18 @@ func TestPhp5(t *testing.T) { &node.Identifier{ Position: &position.Position{ StartLine: 61, - EndLine: 61, - StartPos: 1283, - EndPos: 1287, + EndLine: 61, + StartPos: 1283, + EndPos: 1287, }, Value: "final", }, &node.Identifier{ Position: &position.Position{ StartLine: 61, - EndLine: 61, - StartPos: 1289, - EndPos: 1295, + EndLine: 61, + StartPos: 1289, + EndPos: 1295, }, Value: "private", }, @@ -3169,29 +3154,28 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 61, - EndLine: 61, - StartPos: 1312, - EndPos: 1313, - }, - Stmts: []node.Node{ + EndLine: 61, + StartPos: 1312, + EndPos: 1313, }, + Stmts: []node.Node{}, }, }, &stmt.ClassMethod{ Position: &position.Position{ StartLine: 61, - EndLine: 61, - StartPos: 1315, - EndPos: 1341, + EndLine: 61, + StartPos: 1315, + EndPos: 1341, }, - ReturnsRef: false, + ReturnsRef: false, PhpDocComment: "", MethodName: &node.Identifier{ Position: &position.Position{ StartLine: 61, - EndLine: 61, - StartPos: 1334, - EndPos: 1336, + EndLine: 61, + StartPos: 1334, + EndPos: 1336, }, Value: "baz", }, @@ -3199,9 +3183,9 @@ func TestPhp5(t *testing.T) { &node.Identifier{ Position: &position.Position{ StartLine: 61, - EndLine: 61, - StartPos: 1315, - EndPos: 1323, + EndLine: 61, + StartPos: 1315, + EndPos: 1323, }, Value: "protected", }, @@ -3209,12 +3193,11 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 61, - EndLine: 61, - StartPos: 1340, - EndPos: 1341, - }, - Stmts: []node.Node{ + EndLine: 61, + StartPos: 1340, + EndPos: 1341, }, + Stmts: []node.Node{}, }, }, }, @@ -3222,17 +3205,17 @@ func TestPhp5(t *testing.T) { &stmt.Class{ Position: &position.Position{ StartLine: 62, - EndLine: 62, - StartPos: 1347, - EndPos: 1399, + EndLine: 62, + StartPos: 1347, + EndPos: 1399, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 62, - EndLine: 62, - StartPos: 1362, - EndPos: 1364, + EndLine: 62, + StartPos: 1362, + EndPos: 1364, }, Value: "foo", }, @@ -3240,9 +3223,9 @@ func TestPhp5(t *testing.T) { &node.Identifier{ Position: &position.Position{ StartLine: 62, - EndLine: 62, - StartPos: 1347, - EndPos: 1354, + EndLine: 62, + StartPos: 1347, + EndPos: 1354, }, Value: "abstract", }, @@ -3251,18 +3234,18 @@ func TestPhp5(t *testing.T) { &stmt.ClassMethod{ Position: &position.Position{ StartLine: 62, - EndLine: 62, - StartPos: 1367, - EndPos: 1397, + EndLine: 62, + StartPos: 1367, + EndPos: 1397, }, - ReturnsRef: false, + ReturnsRef: false, PhpDocComment: "", MethodName: &node.Identifier{ Position: &position.Position{ StartLine: 62, - EndLine: 62, - StartPos: 1392, - EndPos: 1394, + EndLine: 62, + StartPos: 1392, + EndPos: 1394, }, Value: "bar", }, @@ -3270,18 +3253,18 @@ func TestPhp5(t *testing.T) { &node.Identifier{ Position: &position.Position{ StartLine: 62, - EndLine: 62, - StartPos: 1367, - EndPos: 1374, + EndLine: 62, + StartPos: 1367, + EndPos: 1374, }, Value: "abstract", }, &node.Identifier{ Position: &position.Position{ StartLine: 62, - EndLine: 62, - StartPos: 1376, - EndPos: 1381, + EndLine: 62, + StartPos: 1376, + EndPos: 1381, }, Value: "public", }, @@ -3289,9 +3272,9 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.Nop{ Position: &position.Position{ StartLine: 62, - EndLine: 62, - StartPos: 1397, - EndPos: 1397, + EndLine: 62, + StartPos: 1397, + EndPos: 1397, }, }, }, @@ -3300,17 +3283,17 @@ func TestPhp5(t *testing.T) { &stmt.Class{ Position: &position.Position{ StartLine: 63, - EndLine: 63, - StartPos: 1403, - EndPos: 1433, + EndLine: 63, + StartPos: 1403, + EndPos: 1433, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 63, - EndLine: 63, - StartPos: 1415, - EndPos: 1417, + EndLine: 63, + StartPos: 1415, + EndPos: 1417, }, Value: "foo", }, @@ -3318,9 +3301,9 @@ func TestPhp5(t *testing.T) { &node.Identifier{ Position: &position.Position{ StartLine: 63, - EndLine: 63, - StartPos: 1403, - EndPos: 1407, + EndLine: 63, + StartPos: 1403, + EndPos: 1407, }, Value: "final", }, @@ -3328,47 +3311,46 @@ func TestPhp5(t *testing.T) { Extends: &stmt.ClassExtends{ Position: &position.Position{ StartLine: 63, - EndLine: 63, - StartPos: 1419, - EndPos: 1429, + EndLine: 63, + StartPos: 1419, + EndPos: 1429, }, ClassName: &name.Name{ Position: &position.Position{ StartLine: 63, - EndLine: 63, - StartPos: 1427, - EndPos: 1429, + EndLine: 63, + StartPos: 1427, + EndPos: 1429, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 63, - EndLine: 63, - StartPos: 1427, - EndPos: 1429, + EndLine: 63, + StartPos: 1427, + EndPos: 1429, }, Value: "bar", }, }, }, }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, &stmt.Class{ Position: &position.Position{ StartLine: 64, - EndLine: 64, - StartPos: 1437, - EndPos: 1470, + EndLine: 64, + StartPos: 1437, + EndPos: 1470, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 64, - EndLine: 64, - StartPos: 1449, - EndPos: 1451, + EndLine: 64, + StartPos: 1449, + EndPos: 1451, }, Value: "foo", }, @@ -3376,9 +3358,9 @@ func TestPhp5(t *testing.T) { &node.Identifier{ Position: &position.Position{ StartLine: 64, - EndLine: 64, - StartPos: 1437, - EndPos: 1441, + EndLine: 64, + StartPos: 1437, + EndPos: 1441, }, Value: "final", }, @@ -3386,25 +3368,25 @@ func TestPhp5(t *testing.T) { Implements: &stmt.ClassImplements{ Position: &position.Position{ StartLine: 64, - EndLine: 64, - StartPos: 1453, - EndPos: 1466, + EndLine: 64, + StartPos: 1453, + EndPos: 1466, }, InterfaceNames: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 64, - EndLine: 64, - StartPos: 1464, - EndPos: 1466, + EndLine: 64, + StartPos: 1464, + EndPos: 1466, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 64, - EndLine: 64, - StartPos: 1464, - EndPos: 1466, + EndLine: 64, + StartPos: 1464, + EndPos: 1466, }, Value: "bar", }, @@ -3412,23 +3394,22 @@ func TestPhp5(t *testing.T) { }, }, }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, &stmt.Class{ Position: &position.Position{ StartLine: 65, - EndLine: 65, - StartPos: 1474, - EndPos: 1512, + EndLine: 65, + StartPos: 1474, + EndPos: 1512, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 65, - EndLine: 65, - StartPos: 1486, - EndPos: 1488, + EndLine: 65, + StartPos: 1486, + EndPos: 1488, }, Value: "foo", }, @@ -3436,9 +3417,9 @@ func TestPhp5(t *testing.T) { &node.Identifier{ Position: &position.Position{ StartLine: 65, - EndLine: 65, - StartPos: 1474, - EndPos: 1478, + EndLine: 65, + StartPos: 1474, + EndPos: 1478, }, Value: "final", }, @@ -3446,25 +3427,25 @@ func TestPhp5(t *testing.T) { Implements: &stmt.ClassImplements{ Position: &position.Position{ StartLine: 65, - EndLine: 65, - StartPos: 1490, - EndPos: 1508, + EndLine: 65, + StartPos: 1490, + EndPos: 1508, }, InterfaceNames: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 65, - EndLine: 65, - StartPos: 1501, - EndPos: 1503, + EndLine: 65, + StartPos: 1501, + EndPos: 1503, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 65, - EndLine: 65, - StartPos: 1501, - EndPos: 1503, + EndLine: 65, + StartPos: 1501, + EndPos: 1503, }, Value: "bar", }, @@ -3473,17 +3454,17 @@ func TestPhp5(t *testing.T) { &name.Name{ Position: &position.Position{ StartLine: 65, - EndLine: 65, - StartPos: 1506, - EndPos: 1508, + EndLine: 65, + StartPos: 1506, + EndPos: 1508, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 65, - EndLine: 65, - StartPos: 1506, - EndPos: 1508, + EndLine: 65, + StartPos: 1506, + EndPos: 1508, }, Value: "baz", }, @@ -3491,40 +3472,39 @@ func TestPhp5(t *testing.T) { }, }, }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, &stmt.ConstList{ Position: &position.Position{ StartLine: 67, - EndLine: 67, - StartPos: 1517, - EndPos: 1539, + EndLine: 67, + StartPos: 1517, + EndPos: 1539, }, Consts: []node.Node{ &stmt.Constant{ Position: &position.Position{ StartLine: 67, - EndLine: 67, - StartPos: 1523, - EndPos: 1529, + EndLine: 67, + StartPos: 1523, + EndPos: 1529, }, PhpDocComment: "", ConstantName: &node.Identifier{ Position: &position.Position{ StartLine: 67, - EndLine: 67, - StartPos: 1523, - EndPos: 1525, + EndLine: 67, + StartPos: 1523, + EndPos: 1525, }, Value: "FOO", }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 67, - EndLine: 67, - StartPos: 1529, - EndPos: 1529, + EndLine: 67, + StartPos: 1529, + EndPos: 1529, }, Value: "1", }, @@ -3532,26 +3512,26 @@ func TestPhp5(t *testing.T) { &stmt.Constant{ Position: &position.Position{ StartLine: 67, - EndLine: 67, - StartPos: 1532, - EndPos: 1538, + EndLine: 67, + StartPos: 1532, + EndPos: 1538, }, PhpDocComment: "", ConstantName: &node.Identifier{ Position: &position.Position{ StartLine: 67, - EndLine: 67, - StartPos: 1532, - EndPos: 1534, + EndLine: 67, + StartPos: 1532, + EndPos: 1534, }, Value: "BAR", }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 67, - EndLine: 67, - StartPos: 1538, - EndPos: 1538, + EndLine: 67, + StartPos: 1538, + EndPos: 1538, }, Value: "2", }, @@ -3561,33 +3541,33 @@ func TestPhp5(t *testing.T) { &stmt.While{ Position: &position.Position{ StartLine: 68, - EndLine: 68, - StartPos: 1543, - EndPos: 1565, + EndLine: 68, + StartPos: 1543, + EndPos: 1565, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 68, - EndLine: 68, - StartPos: 1550, - EndPos: 1550, + EndLine: 68, + StartPos: 1550, + EndPos: 1550, }, Value: "1", }, Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 68, - EndLine: 68, - StartPos: 1553, - EndPos: 1565, + EndLine: 68, + StartPos: 1553, + EndPos: 1565, }, Stmts: []node.Node{ &stmt.Continue{ Position: &position.Position{ StartLine: 68, - EndLine: 68, - StartPos: 1555, - EndPos: 1563, + EndLine: 68, + StartPos: 1555, + EndPos: 1563, }, }, }, @@ -3596,40 +3576,40 @@ func TestPhp5(t *testing.T) { &stmt.While{ Position: &position.Position{ StartLine: 69, - EndLine: 69, - StartPos: 1569, - EndPos: 1593, + EndLine: 69, + StartPos: 1569, + EndPos: 1593, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 69, - EndLine: 69, - StartPos: 1576, - EndPos: 1576, + EndLine: 69, + StartPos: 1576, + EndPos: 1576, }, Value: "1", }, Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 69, - EndLine: 69, - StartPos: 1579, - EndPos: 1593, + EndLine: 69, + StartPos: 1579, + EndPos: 1593, }, Stmts: []node.Node{ &stmt.Continue{ Position: &position.Position{ StartLine: 69, - EndLine: 69, - StartPos: 1581, - EndPos: 1591, + EndLine: 69, + StartPos: 1581, + EndPos: 1591, }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 69, - EndLine: 69, - StartPos: 1590, - EndPos: 1590, + EndLine: 69, + StartPos: 1590, + EndPos: 1590, }, Value: "2", }, @@ -3640,40 +3620,40 @@ func TestPhp5(t *testing.T) { &stmt.While{ Position: &position.Position{ StartLine: 70, - EndLine: 70, - StartPos: 1597, - EndPos: 1622, + EndLine: 70, + StartPos: 1597, + EndPos: 1622, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 70, - EndLine: 70, - StartPos: 1604, - EndPos: 1604, + EndLine: 70, + StartPos: 1604, + EndPos: 1604, }, Value: "1", }, Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 70, - EndLine: 70, - StartPos: 1607, - EndPos: 1622, + EndLine: 70, + StartPos: 1607, + EndPos: 1622, }, Stmts: []node.Node{ &stmt.Continue{ Position: &position.Position{ StartLine: 70, - EndLine: 70, - StartPos: 1609, - EndPos: 1620, + EndLine: 70, + StartPos: 1609, + EndPos: 1620, }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 70, - EndLine: 70, - StartPos: 1618, - EndPos: 1618, + EndLine: 70, + StartPos: 1618, + EndPos: 1618, }, Value: "3", }, @@ -3684,34 +3664,34 @@ func TestPhp5(t *testing.T) { &stmt.Declare{ Position: &position.Position{ StartLine: 71, - EndLine: 71, - StartPos: 1626, - EndPos: 1642, + EndLine: 71, + StartPos: 1626, + EndPos: 1642, }, Consts: []node.Node{ &stmt.Constant{ Position: &position.Position{ StartLine: 71, - EndLine: 71, - StartPos: 1634, - EndPos: 1640, + EndLine: 71, + StartPos: 1634, + EndPos: 1640, }, PhpDocComment: "", ConstantName: &node.Identifier{ Position: &position.Position{ StartLine: 71, - EndLine: 71, - StartPos: 1634, - EndPos: 1638, + EndLine: 71, + StartPos: 1634, + EndPos: 1638, }, Value: "ticks", }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 71, - EndLine: 71, - StartPos: 1640, - EndPos: 1640, + EndLine: 71, + StartPos: 1640, + EndPos: 1640, }, Value: "1", }, @@ -3720,43 +3700,43 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.Nop{ Position: &position.Position{ StartLine: 71, - EndLine: 71, - StartPos: 1642, - EndPos: 1642, + EndLine: 71, + StartPos: 1642, + EndPos: 1642, }, }, }, &stmt.Declare{ Position: &position.Position{ StartLine: 72, - EndLine: 72, - StartPos: 1646, - EndPos: 1680, + EndLine: 72, + StartPos: 1646, + EndPos: 1680, }, Consts: []node.Node{ &stmt.Constant{ Position: &position.Position{ StartLine: 72, - EndLine: 72, - StartPos: 1654, - EndPos: 1660, + EndLine: 72, + StartPos: 1654, + EndPos: 1660, }, PhpDocComment: "", ConstantName: &node.Identifier{ Position: &position.Position{ StartLine: 72, - EndLine: 72, - StartPos: 1654, - EndPos: 1658, + EndLine: 72, + StartPos: 1654, + EndPos: 1658, }, Value: "ticks", }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 72, - EndLine: 72, - StartPos: 1660, - EndPos: 1660, + EndLine: 72, + StartPos: 1660, + EndPos: 1660, }, Value: "1", }, @@ -3764,26 +3744,26 @@ func TestPhp5(t *testing.T) { &stmt.Constant{ Position: &position.Position{ StartLine: 72, - EndLine: 72, - StartPos: 1663, - EndPos: 1676, + EndLine: 72, + StartPos: 1663, + EndPos: 1676, }, PhpDocComment: "", ConstantName: &node.Identifier{ Position: &position.Position{ StartLine: 72, - EndLine: 72, - StartPos: 1663, - EndPos: 1674, + EndLine: 72, + StartPos: 1663, + EndPos: 1674, }, Value: "strict_types", }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 72, - EndLine: 72, - StartPos: 1676, - EndPos: 1676, + EndLine: 72, + StartPos: 1676, + EndPos: 1676, }, Value: "1", }, @@ -3792,45 +3772,44 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 72, - EndLine: 72, - StartPos: 1679, - EndPos: 1680, - }, - Stmts: []node.Node{ + EndLine: 72, + StartPos: 1679, + EndPos: 1680, }, + Stmts: []node.Node{}, }, }, &stmt.Declare{ Position: &position.Position{ StartLine: 73, - EndLine: 73, - StartPos: 1684, - EndPos: 1712, + EndLine: 73, + StartPos: 1684, + EndPos: 1712, }, Consts: []node.Node{ &stmt.Constant{ Position: &position.Position{ StartLine: 73, - EndLine: 73, - StartPos: 1692, - EndPos: 1698, + EndLine: 73, + StartPos: 1692, + EndPos: 1698, }, PhpDocComment: "", ConstantName: &node.Identifier{ Position: &position.Position{ StartLine: 73, - EndLine: 73, - StartPos: 1692, - EndPos: 1696, + EndLine: 73, + StartPos: 1692, + EndPos: 1696, }, Value: "ticks", }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 73, - EndLine: 73, - StartPos: 1698, - EndPos: 1698, + EndLine: 73, + StartPos: 1698, + EndPos: 1698, }, Value: "1", }, @@ -3839,37 +3818,35 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 73, - EndLine: 73, - StartPos: 1700, - EndPos: 1712, - }, - Stmts: []node.Node{ + EndLine: 73, + StartPos: 1700, + EndPos: 1712, }, + Stmts: []node.Node{}, }, }, &stmt.Do{ Position: &position.Position{ StartLine: 74, - EndLine: 74, - StartPos: 1716, - EndPos: 1730, + EndLine: 74, + StartPos: 1716, + EndPos: 1730, }, Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 74, - EndLine: 74, - StartPos: 1719, - EndPos: 1720, - }, - Stmts: []node.Node{ + EndLine: 74, + StartPos: 1719, + EndPos: 1720, }, + Stmts: []node.Node{}, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 74, - EndLine: 74, - StartPos: 1728, - EndPos: 1728, + EndLine: 74, + StartPos: 1728, + EndPos: 1728, }, Value: "1", }, @@ -3877,24 +3854,24 @@ func TestPhp5(t *testing.T) { &stmt.Echo{ Position: &position.Position{ StartLine: 75, - EndLine: 75, - StartPos: 1734, - EndPos: 1744, + EndLine: 75, + StartPos: 1734, + EndPos: 1744, }, Exprs: []node.Node{ &expr.Variable{ Position: &position.Position{ StartLine: 75, - EndLine: 75, - StartPos: 1739, - EndPos: 1740, + EndLine: 75, + StartPos: 1739, + EndPos: 1740, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 75, - EndLine: 75, - StartPos: 1739, - EndPos: 1740, + EndLine: 75, + StartPos: 1739, + EndPos: 1740, }, Value: "a", }, @@ -3902,9 +3879,9 @@ func TestPhp5(t *testing.T) { &scalar.Lnumber{ Position: &position.Position{ StartLine: 75, - EndLine: 75, - StartPos: 1743, - EndPos: 1743, + EndLine: 75, + StartPos: 1743, + EndPos: 1743, }, Value: "1", }, @@ -3913,24 +3890,24 @@ func TestPhp5(t *testing.T) { &stmt.Echo{ Position: &position.Position{ StartLine: 76, - EndLine: 76, - StartPos: 1748, - EndPos: 1756, + EndLine: 76, + StartPos: 1748, + EndPos: 1756, }, Exprs: []node.Node{ &expr.Variable{ Position: &position.Position{ StartLine: 76, - EndLine: 76, - StartPos: 1753, - EndPos: 1754, + EndLine: 76, + StartPos: 1753, + EndPos: 1754, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 76, - EndLine: 76, - StartPos: 1753, - EndPos: 1754, + EndLine: 76, + StartPos: 1753, + EndPos: 1754, }, Value: "a", }, @@ -3940,31 +3917,31 @@ func TestPhp5(t *testing.T) { &stmt.For{ Position: &position.Position{ StartLine: 77, - EndLine: 77, - StartPos: 1760, - EndPos: 1794, + EndLine: 77, + StartPos: 1760, + EndPos: 1794, }, Init: []node.Node{ &assign.Assign{ Position: &position.Position{ StartLine: 77, - EndLine: 77, - StartPos: 1764, - EndPos: 1769, + EndLine: 77, + StartPos: 1764, + EndPos: 1769, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 77, - EndLine: 77, - StartPos: 1764, - EndPos: 1765, + EndLine: 77, + StartPos: 1764, + EndPos: 1765, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 77, - EndLine: 77, - StartPos: 1764, - EndPos: 1765, + EndLine: 77, + StartPos: 1764, + EndPos: 1765, }, Value: "i", }, @@ -3972,9 +3949,9 @@ func TestPhp5(t *testing.T) { Expression: &scalar.Lnumber{ Position: &position.Position{ StartLine: 77, - EndLine: 77, - StartPos: 1769, - EndPos: 1769, + EndLine: 77, + StartPos: 1769, + EndPos: 1769, }, Value: "0", }, @@ -3984,23 +3961,23 @@ func TestPhp5(t *testing.T) { &binary.Smaller{ Position: &position.Position{ StartLine: 77, - EndLine: 77, - StartPos: 1772, - EndPos: 1778, + EndLine: 77, + StartPos: 1772, + EndPos: 1778, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 77, - EndLine: 77, - StartPos: 1772, - EndPos: 1773, + EndLine: 77, + StartPos: 1772, + EndPos: 1773, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 77, - EndLine: 77, - StartPos: 1772, - EndPos: 1773, + EndLine: 77, + StartPos: 1772, + EndPos: 1773, }, Value: "i", }, @@ -4008,9 +3985,9 @@ func TestPhp5(t *testing.T) { Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 77, - EndLine: 77, - StartPos: 1777, - EndPos: 1778, + EndLine: 77, + StartPos: 1777, + EndPos: 1778, }, Value: "10", }, @@ -4020,23 +3997,23 @@ func TestPhp5(t *testing.T) { &expr.PostInc{ Position: &position.Position{ StartLine: 77, - EndLine: 77, - StartPos: 1781, - EndPos: 1784, + EndLine: 77, + StartPos: 1781, + EndPos: 1784, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 77, - EndLine: 77, - StartPos: 1781, - EndPos: 1782, + EndLine: 77, + StartPos: 1781, + EndPos: 1782, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 77, - EndLine: 77, - StartPos: 1781, - EndPos: 1782, + EndLine: 77, + StartPos: 1781, + EndPos: 1782, }, Value: "i", }, @@ -4045,23 +4022,23 @@ func TestPhp5(t *testing.T) { &expr.PostInc{ Position: &position.Position{ StartLine: 77, - EndLine: 77, - StartPos: 1787, - EndPos: 1790, + EndLine: 77, + StartPos: 1787, + EndPos: 1790, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 77, - EndLine: 77, - StartPos: 1787, - EndPos: 1788, + EndLine: 77, + StartPos: 1787, + EndPos: 1788, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 77, - EndLine: 77, - StartPos: 1787, - EndPos: 1788, + EndLine: 77, + StartPos: 1787, + EndPos: 1788, }, Value: "i", }, @@ -4071,42 +4048,41 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 77, - EndLine: 77, - StartPos: 1793, - EndPos: 1794, - }, - Stmts: []node.Node{ + EndLine: 77, + StartPos: 1793, + EndPos: 1794, }, + Stmts: []node.Node{}, }, }, &stmt.AltFor{ Position: &position.Position{ StartLine: 78, - EndLine: 78, - StartPos: 1798, - EndPos: 1827, + EndLine: 78, + StartPos: 1798, + EndPos: 1827, }, Cond: []node.Node{ &binary.Smaller{ Position: &position.Position{ StartLine: 78, - EndLine: 78, - StartPos: 1804, - EndPos: 1810, + EndLine: 78, + StartPos: 1804, + EndPos: 1810, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 78, - EndLine: 78, - StartPos: 1804, - EndPos: 1805, + EndLine: 78, + StartPos: 1804, + EndPos: 1805, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 78, - EndLine: 78, - StartPos: 1804, - EndPos: 1805, + EndLine: 78, + StartPos: 1804, + EndPos: 1805, }, Value: "i", }, @@ -4114,9 +4090,9 @@ func TestPhp5(t *testing.T) { Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 78, - EndLine: 78, - StartPos: 1809, - EndPos: 1810, + EndLine: 78, + StartPos: 1809, + EndPos: 1810, }, Value: "10", }, @@ -4126,23 +4102,23 @@ func TestPhp5(t *testing.T) { &expr.PostInc{ Position: &position.Position{ StartLine: 78, - EndLine: 78, - StartPos: 1813, - EndPos: 1816, + EndLine: 78, + StartPos: 1813, + EndPos: 1816, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 78, - EndLine: 78, - StartPos: 1813, - EndPos: 1814, + EndLine: 78, + StartPos: 1813, + EndPos: 1814, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 78, - EndLine: 78, - StartPos: 1813, - EndPos: 1814, + EndLine: 78, + StartPos: 1813, + EndPos: 1814, }, Value: "i", }, @@ -4152,34 +4128,33 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - Stmts: []node.Node{ + EndLine: -1, + StartPos: -1, + EndPos: -1, }, + Stmts: []node.Node{}, }, }, &stmt.Foreach{ Position: &position.Position{ StartLine: 79, - EndLine: 79, - StartPos: 1831, - EndPos: 1851, + EndLine: 79, + StartPos: 1831, + EndPos: 1851, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 79, - EndLine: 79, - StartPos: 1840, - EndPos: 1841, + EndLine: 79, + StartPos: 1840, + EndPos: 1841, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 79, - EndLine: 79, - StartPos: 1840, - EndPos: 1841, + EndLine: 79, + StartPos: 1840, + EndPos: 1841, }, Value: "a", }, @@ -4187,16 +4162,16 @@ func TestPhp5(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 79, - EndLine: 79, - StartPos: 1846, - EndPos: 1847, + EndLine: 79, + StartPos: 1846, + EndPos: 1847, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 79, - EndLine: 79, - StartPos: 1846, - EndPos: 1847, + EndLine: 79, + StartPos: 1846, + EndPos: 1847, }, Value: "v", }, @@ -4204,44 +4179,42 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 79, - EndLine: 79, - StartPos: 1850, - EndPos: 1851, - }, - Stmts: []node.Node{ + EndLine: 79, + StartPos: 1850, + EndPos: 1851, }, + Stmts: []node.Node{}, }, }, &stmt.Foreach{ Position: &position.Position{ StartLine: 80, - EndLine: 80, - StartPos: 1855, - EndPos: 1875, + EndLine: 80, + StartPos: 1855, + EndPos: 1875, }, Expr: &expr.ShortArray{ Position: &position.Position{ StartLine: 80, - EndLine: 80, - StartPos: 1864, - EndPos: 1865, - }, - Items: []node.Node{ + EndLine: 80, + StartPos: 1864, + EndPos: 1865, }, + Items: []node.Node{}, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 80, - EndLine: 80, - StartPos: 1870, - EndPos: 1871, + EndLine: 80, + StartPos: 1870, + EndPos: 1871, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 80, - EndLine: 80, - StartPos: 1870, - EndPos: 1871, + EndLine: 80, + StartPos: 1870, + EndPos: 1871, }, Value: "v", }, @@ -4249,34 +4222,33 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 80, - EndLine: 80, - StartPos: 1874, - EndPos: 1875, - }, - Stmts: []node.Node{ + EndLine: 80, + StartPos: 1874, + EndPos: 1875, }, + Stmts: []node.Node{}, }, }, &stmt.AltForeach{ Position: &position.Position{ StartLine: 81, - EndLine: 81, - StartPos: 1879, - EndPos: 1910, + EndLine: 81, + StartPos: 1879, + EndPos: 1910, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 81, - EndLine: 81, - StartPos: 1888, - EndPos: 1889, + EndLine: 81, + StartPos: 1888, + EndPos: 1889, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 81, - EndLine: 81, - StartPos: 1888, - EndPos: 1889, + EndLine: 81, + StartPos: 1888, + EndPos: 1889, }, Value: "a", }, @@ -4284,16 +4256,16 @@ func TestPhp5(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 81, - EndLine: 81, - StartPos: 1894, - EndPos: 1895, + EndLine: 81, + StartPos: 1894, + EndPos: 1895, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 81, - EndLine: 81, - StartPos: 1894, - EndPos: 1895, + EndLine: 81, + StartPos: 1894, + EndPos: 1895, }, Value: "v", }, @@ -4301,34 +4273,33 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - Stmts: []node.Node{ + EndLine: -1, + StartPos: -1, + EndPos: -1, }, + Stmts: []node.Node{}, }, }, &stmt.Foreach{ Position: &position.Position{ StartLine: 82, - EndLine: 82, - StartPos: 1914, - EndPos: 1940, + EndLine: 82, + StartPos: 1914, + EndPos: 1940, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 82, - EndLine: 82, - StartPos: 1923, - EndPos: 1924, + EndLine: 82, + StartPos: 1923, + EndPos: 1924, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 82, - EndLine: 82, - StartPos: 1923, - EndPos: 1924, + EndLine: 82, + StartPos: 1923, + EndPos: 1924, }, Value: "a", }, @@ -4336,16 +4307,16 @@ func TestPhp5(t *testing.T) { Key: &expr.Variable{ Position: &position.Position{ StartLine: 82, - EndLine: 82, - StartPos: 1929, - EndPos: 1930, + EndLine: 82, + StartPos: 1929, + EndPos: 1930, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 82, - EndLine: 82, - StartPos: 1929, - EndPos: 1930, + EndLine: 82, + StartPos: 1929, + EndPos: 1930, }, Value: "k", }, @@ -4353,16 +4324,16 @@ func TestPhp5(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 82, - EndLine: 82, - StartPos: 1935, - EndPos: 1936, + EndLine: 82, + StartPos: 1935, + EndPos: 1936, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 82, - EndLine: 82, - StartPos: 1935, - EndPos: 1936, + EndLine: 82, + StartPos: 1935, + EndPos: 1936, }, Value: "v", }, @@ -4370,44 +4341,42 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 82, - EndLine: 82, - StartPos: 1939, - EndPos: 1940, - }, - Stmts: []node.Node{ + EndLine: 82, + StartPos: 1939, + EndPos: 1940, }, + Stmts: []node.Node{}, }, }, &stmt.Foreach{ Position: &position.Position{ StartLine: 83, - EndLine: 83, - StartPos: 1944, - EndPos: 1970, + EndLine: 83, + StartPos: 1944, + EndPos: 1970, }, Expr: &expr.ShortArray{ Position: &position.Position{ StartLine: 83, - EndLine: 83, - StartPos: 1953, - EndPos: 1954, - }, - Items: []node.Node{ + EndLine: 83, + StartPos: 1953, + EndPos: 1954, }, + Items: []node.Node{}, }, Key: &expr.Variable{ Position: &position.Position{ StartLine: 83, - EndLine: 83, - StartPos: 1959, - EndPos: 1960, + EndLine: 83, + StartPos: 1959, + EndPos: 1960, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 83, - EndLine: 83, - StartPos: 1959, - EndPos: 1960, + EndLine: 83, + StartPos: 1959, + EndPos: 1960, }, Value: "k", }, @@ -4415,16 +4384,16 @@ func TestPhp5(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 83, - EndLine: 83, - StartPos: 1965, - EndPos: 1966, + EndLine: 83, + StartPos: 1965, + EndPos: 1966, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 83, - EndLine: 83, - StartPos: 1965, - EndPos: 1966, + EndLine: 83, + StartPos: 1965, + EndPos: 1966, }, Value: "v", }, @@ -4432,34 +4401,33 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 83, - EndLine: 83, - StartPos: 1969, - EndPos: 1970, - }, - Stmts: []node.Node{ + EndLine: 83, + StartPos: 1969, + EndPos: 1970, }, + Stmts: []node.Node{}, }, }, &stmt.Foreach{ Position: &position.Position{ StartLine: 84, - EndLine: 84, - StartPos: 1974, - EndPos: 2001, + EndLine: 84, + StartPos: 1974, + EndPos: 2001, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 84, - EndLine: 84, - StartPos: 1983, - EndPos: 1984, + EndLine: 84, + StartPos: 1983, + EndPos: 1984, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 84, - EndLine: 84, - StartPos: 1983, - EndPos: 1984, + EndLine: 84, + StartPos: 1983, + EndPos: 1984, }, Value: "a", }, @@ -4467,16 +4435,16 @@ func TestPhp5(t *testing.T) { Key: &expr.Variable{ Position: &position.Position{ StartLine: 84, - EndLine: 84, - StartPos: 1989, - EndPos: 1990, + EndLine: 84, + StartPos: 1989, + EndPos: 1990, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 84, - EndLine: 84, - StartPos: 1989, - EndPos: 1990, + EndLine: 84, + StartPos: 1989, + EndPos: 1990, }, Value: "k", }, @@ -4484,23 +4452,23 @@ func TestPhp5(t *testing.T) { Variable: &expr.Reference{ Position: &position.Position{ StartLine: 84, - EndLine: 84, - StartPos: 1995, - EndPos: 1997, + EndLine: 84, + StartPos: 1995, + EndPos: 1997, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 84, - EndLine: 84, - StartPos: 1996, - EndPos: 1997, + EndLine: 84, + StartPos: 1996, + EndPos: 1997, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 84, - EndLine: 84, - StartPos: 1996, - EndPos: 1997, + EndLine: 84, + StartPos: 1996, + EndPos: 1997, }, Value: "v", }, @@ -4509,34 +4477,33 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 84, - EndLine: 84, - StartPos: 2000, - EndPos: 2001, - }, - Stmts: []node.Node{ + EndLine: 84, + StartPos: 2000, + EndPos: 2001, }, + Stmts: []node.Node{}, }, }, &stmt.Foreach{ Position: &position.Position{ StartLine: 85, - EndLine: 85, - StartPos: 2005, - EndPos: 2037, + EndLine: 85, + StartPos: 2005, + EndPos: 2037, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 85, - EndLine: 85, - StartPos: 2014, - EndPos: 2015, + EndLine: 85, + StartPos: 2014, + EndPos: 2015, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 85, - EndLine: 85, - StartPos: 2014, - EndPos: 2015, + EndLine: 85, + StartPos: 2014, + EndPos: 2015, }, Value: "a", }, @@ -4544,16 +4511,16 @@ func TestPhp5(t *testing.T) { Key: &expr.Variable{ Position: &position.Position{ StartLine: 85, - EndLine: 85, - StartPos: 2020, - EndPos: 2021, + EndLine: 85, + StartPos: 2020, + EndPos: 2021, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 85, - EndLine: 85, - StartPos: 2020, - EndPos: 2021, + EndLine: 85, + StartPos: 2020, + EndPos: 2021, }, Value: "k", }, @@ -4561,31 +4528,31 @@ func TestPhp5(t *testing.T) { Variable: &expr.List{ Position: &position.Position{ StartLine: 85, - EndLine: 85, - StartPos: 2026, - EndPos: 2033, + EndLine: 85, + StartPos: 2026, + EndPos: 2033, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 85, - EndLine: 85, - StartPos: 2031, - EndPos: 2032, + EndLine: 85, + StartPos: 2031, + EndPos: 2032, }, Val: &expr.Variable{ Position: &position.Position{ StartLine: 85, - EndLine: 85, - StartPos: 2031, - EndPos: 2032, + EndLine: 85, + StartPos: 2031, + EndPos: 2032, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 85, - EndLine: 85, - StartPos: 2031, - EndPos: 2032, + EndLine: 85, + StartPos: 2031, + EndPos: 2032, }, Value: "v", }, @@ -4596,50 +4563,48 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 85, - EndLine: 85, - StartPos: 2036, - EndPos: 2037, - }, - Stmts: []node.Node{ + EndLine: 85, + StartPos: 2036, + EndPos: 2037, }, + Stmts: []node.Node{}, }, }, &stmt.Function{ Position: &position.Position{ StartLine: 86, - EndLine: 86, - StartPos: 2041, - EndPos: 2057, + EndLine: 86, + StartPos: 2041, + EndPos: 2057, }, - ReturnsRef: false, + ReturnsRef: false, PhpDocComment: "", FunctionName: &node.Identifier{ Position: &position.Position{ StartLine: 86, - EndLine: 86, - StartPos: 2050, - EndPos: 2052, + EndLine: 86, + StartPos: 2050, + EndPos: 2052, }, Value: "foo", }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, &stmt.Function{ Position: &position.Position{ StartLine: 88, - EndLine: 93, - StartPos: 2062, - EndPos: 2154, + EndLine: 93, + StartPos: 2062, + EndPos: 2154, }, - ReturnsRef: false, + ReturnsRef: false, PhpDocComment: "", FunctionName: &node.Identifier{ Position: &position.Position{ StartLine: 88, - EndLine: 88, - StartPos: 2071, - EndPos: 2073, + EndLine: 88, + StartPos: 2071, + EndPos: 2073, }, Value: "foo", }, @@ -4647,72 +4612,70 @@ func TestPhp5(t *testing.T) { &stmt.HaltCompiler{ Position: &position.Position{ StartLine: 89, - EndLine: 89, - StartPos: 2082, - EndPos: 2099, + EndLine: 89, + StartPos: 2082, + EndPos: 2099, }, }, &stmt.Function{ Position: &position.Position{ StartLine: 90, - EndLine: 90, - StartPos: 2104, - EndPos: 2120, + EndLine: 90, + StartPos: 2104, + EndPos: 2120, }, - ReturnsRef: false, + ReturnsRef: false, PhpDocComment: "", FunctionName: &node.Identifier{ Position: &position.Position{ StartLine: 90, - EndLine: 90, - StartPos: 2113, - EndPos: 2115, + EndLine: 90, + StartPos: 2113, + EndPos: 2115, }, Value: "bar", }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, &stmt.Class{ Position: &position.Position{ StartLine: 91, - EndLine: 91, - StartPos: 2125, - EndPos: 2136, + EndLine: 91, + StartPos: 2125, + EndPos: 2136, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 91, - EndLine: 91, - StartPos: 2131, - EndPos: 2133, + EndLine: 91, + StartPos: 2131, + EndPos: 2133, }, Value: "Baz", }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, &stmt.Return{ Position: &position.Position{ StartLine: 92, - EndLine: 92, - StartPos: 2141, - EndPos: 2150, + EndLine: 92, + StartPos: 2141, + EndPos: 2150, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 92, - EndLine: 92, - StartPos: 2148, - EndPos: 2149, + EndLine: 92, + StartPos: 2148, + EndPos: 2149, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 92, - EndLine: 92, - StartPos: 2148, - EndPos: 2149, + EndLine: 92, + StartPos: 2148, + EndPos: 2149, }, Value: "a", }, @@ -4723,18 +4686,18 @@ func TestPhp5(t *testing.T) { &stmt.Function{ Position: &position.Position{ StartLine: 95, - EndLine: 95, - StartPos: 2161, - EndPos: 2205, + EndLine: 95, + StartPos: 2161, + EndPos: 2205, }, + ReturnsRef: false, PhpDocComment: "", - ReturnsRef: false, FunctionName: &node.Identifier{ Position: &position.Position{ StartLine: 95, - EndLine: 95, - StartPos: 2170, - EndPos: 2172, + EndLine: 95, + StartPos: 2170, + EndPos: 2172, }, Value: "foo", }, @@ -4742,34 +4705,34 @@ func TestPhp5(t *testing.T) { &node.Parameter{ Position: &position.Position{ StartLine: 95, - EndLine: 95, - StartPos: 2174, - EndPos: 2181, + EndLine: 95, + StartPos: 2174, + EndPos: 2181, }, - ByRef: false, Variadic: false, + ByRef: false, VariableType: &node.Identifier{ Position: &position.Position{ StartLine: 95, - EndLine: 95, - StartPos: 2174, - EndPos: 2178, + EndLine: 95, + StartPos: 2174, + EndPos: 2178, }, Value: "array", }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 95, - EndLine: 95, - StartPos: 2180, - EndPos: 2181, + EndLine: 95, + StartPos: 2180, + EndPos: 2181, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 95, - EndLine: 95, - StartPos: 2180, - EndPos: 2181, + EndLine: 95, + StartPos: 2180, + EndPos: 2181, }, Value: "a", }, @@ -4778,34 +4741,34 @@ func TestPhp5(t *testing.T) { &node.Parameter{ Position: &position.Position{ StartLine: 95, - EndLine: 95, - StartPos: 2184, - EndPos: 2194, + EndLine: 95, + StartPos: 2184, + EndPos: 2194, }, - ByRef: false, + ByRef: false, Variadic: false, VariableType: &node.Identifier{ Position: &position.Position{ StartLine: 95, - EndLine: 95, - StartPos: 2184, - EndPos: 2191, + EndLine: 95, + StartPos: 2184, + EndPos: 2191, }, Value: "callable", }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 95, - EndLine: 95, - StartPos: 2193, - EndPos: 2194, + EndLine: 95, + StartPos: 2193, + EndPos: 2194, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 95, - EndLine: 95, - StartPos: 2193, - EndPos: 2194, + EndLine: 95, + StartPos: 2193, + EndPos: 2194, }, Value: "b", }, @@ -4816,9 +4779,9 @@ func TestPhp5(t *testing.T) { &stmt.Return{ Position: &position.Position{ StartLine: 95, - EndLine: 95, - StartPos: 2198, - EndPos: 2204, + EndLine: 95, + StartPos: 2198, + EndPos: 2204, }, }, }, @@ -4826,18 +4789,18 @@ func TestPhp5(t *testing.T) { &stmt.Function{ Position: &position.Position{ StartLine: 96, - EndLine: 96, - StartPos: 2209, - EndPos: 2235, + EndLine: 96, + StartPos: 2209, + EndPos: 2235, }, - ReturnsRef: true, PhpDocComment: "", + ReturnsRef: true, FunctionName: &node.Identifier{ Position: &position.Position{ StartLine: 96, - EndLine: 96, - StartPos: 2219, - EndPos: 2221, + EndLine: 96, + StartPos: 2219, + EndPos: 2221, }, Value: "foo", }, @@ -4845,16 +4808,16 @@ func TestPhp5(t *testing.T) { &stmt.Return{ Position: &position.Position{ StartLine: 96, - EndLine: 96, - StartPos: 2226, - EndPos: 2234, + EndLine: 96, + StartPos: 2226, + EndPos: 2234, }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 96, - EndLine: 96, - StartPos: 2233, - EndPos: 2233, + EndLine: 96, + StartPos: 2233, + EndPos: 2233, }, Value: "1", }, @@ -4864,45 +4827,44 @@ func TestPhp5(t *testing.T) { &stmt.Function{ Position: &position.Position{ StartLine: 97, - EndLine: 97, - StartPos: 2239, - EndPos: 2256, + EndLine: 97, + StartPos: 2239, + EndPos: 2256, }, - ReturnsRef: true, + ReturnsRef: true, PhpDocComment: "", FunctionName: &node.Identifier{ Position: &position.Position{ StartLine: 97, - EndLine: 97, - StartPos: 2249, - EndPos: 2251, + EndLine: 97, + StartPos: 2249, + EndPos: 2251, }, Value: "foo", }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, &stmt.Global{ Position: &position.Position{ StartLine: 98, - EndLine: 98, - StartPos: 2260, - EndPos: 2288, + EndLine: 98, + StartPos: 2260, + EndPos: 2288, }, Vars: []node.Node{ &expr.Variable{ Position: &position.Position{ StartLine: 98, - EndLine: 98, - StartPos: 2267, - EndPos: 2268, + EndLine: 98, + StartPos: 2267, + EndPos: 2268, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 98, - EndLine: 98, - StartPos: 2267, - EndPos: 2268, + EndLine: 98, + StartPos: 2267, + EndPos: 2268, }, Value: "a", }, @@ -4910,16 +4872,16 @@ func TestPhp5(t *testing.T) { &expr.Variable{ Position: &position.Position{ StartLine: 98, - EndLine: 98, - StartPos: 2271, - EndPos: 2272, + EndLine: 98, + StartPos: 2271, + EndPos: 2272, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 98, - EndLine: 98, - StartPos: 2271, - EndPos: 2272, + EndLine: 98, + StartPos: 2271, + EndPos: 2272, }, Value: "b", }, @@ -4927,23 +4889,23 @@ func TestPhp5(t *testing.T) { &expr.Variable{ Position: &position.Position{ StartLine: 98, - EndLine: 98, - StartPos: 2275, - EndPos: 2277, + EndLine: 98, + StartPos: 2275, + EndPos: 2277, }, VarName: &expr.Variable{ Position: &position.Position{ StartLine: 98, - EndLine: 98, - StartPos: 2276, - EndPos: 2277, + EndLine: 98, + StartPos: 2276, + EndPos: 2277, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 98, - EndLine: 98, - StartPos: 2276, - EndPos: 2277, + EndLine: 98, + StartPos: 2276, + EndPos: 2277, }, Value: "c", }, @@ -4952,31 +4914,31 @@ func TestPhp5(t *testing.T) { &expr.Variable{ Position: &position.Position{ StartLine: 98, - EndLine: 98, - StartPos: 2280, - EndPos: 2287, + EndLine: 98, + StartPos: 2280, + EndPos: 2287, }, VarName: &expr.FunctionCall{ Position: &position.Position{ StartLine: 98, - EndLine: 98, - StartPos: 2282, - EndPos: 2286, + EndLine: 98, + StartPos: 2282, + EndPos: 2286, }, Function: &name.Name{ Position: &position.Position{ StartLine: 98, - EndLine: 98, - StartPos: 2282, - EndPos: 2284, + EndLine: 98, + StartPos: 2282, + EndPos: 2284, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 98, - EndLine: 98, - StartPos: 2282, - EndPos: 2284, + EndLine: 98, + StartPos: 2282, + EndPos: 2284, }, Value: "foo", }, @@ -4985,9 +4947,9 @@ func TestPhp5(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 98, - EndLine: 98, - StartPos: 2285, - EndPos: 2286, + EndLine: 98, + StartPos: 2285, + EndPos: 2286, }, }, }, @@ -4997,16 +4959,16 @@ func TestPhp5(t *testing.T) { &stmt.Label{ Position: &position.Position{ StartLine: 99, - EndLine: 99, - StartPos: 2292, - EndPos: 2293, + EndLine: 99, + StartPos: 2292, + EndPos: 2293, }, LabelName: &node.Identifier{ Position: &position.Position{ StartLine: 99, - EndLine: 99, - StartPos: 2292, - EndPos: 2292, + EndLine: 99, + StartPos: 2292, + EndPos: 2292, }, Value: "a", }, @@ -5014,16 +4976,16 @@ func TestPhp5(t *testing.T) { &stmt.Goto{ Position: &position.Position{ StartLine: 100, - EndLine: 100, - StartPos: 2298, - EndPos: 2304, + EndLine: 100, + StartPos: 2298, + EndPos: 2304, }, Label: &node.Identifier{ Position: &position.Position{ StartLine: 100, - EndLine: 100, - StartPos: 2303, - EndPos: 2303, + EndLine: 100, + StartPos: 2303, + EndPos: 2303, }, Value: "a", }, @@ -5031,31 +4993,31 @@ func TestPhp5(t *testing.T) { &stmt.HaltCompiler{ Position: &position.Position{ StartLine: 101, - EndLine: 101, - StartPos: 2308, - EndPos: 2325, + EndLine: 101, + StartPos: 2308, + EndPos: 2325, }, }, &stmt.If{ Position: &position.Position{ StartLine: 102, - EndLine: 102, - StartPos: 2329, - EndPos: 2338, + EndLine: 102, + StartPos: 2329, + EndPos: 2338, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 102, - EndLine: 102, - StartPos: 2333, - EndPos: 2334, + EndLine: 102, + StartPos: 2333, + EndPos: 2334, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 102, - EndLine: 102, - StartPos: 2333, - EndPos: 2334, + EndLine: 102, + StartPos: 2333, + EndPos: 2334, }, Value: "a", }, @@ -5063,34 +5025,33 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 102, - EndLine: 102, - StartPos: 2337, - EndPos: 2338, - }, - Stmts: []node.Node{ + EndLine: 102, + StartPos: 2337, + EndPos: 2338, }, + Stmts: []node.Node{}, }, }, &stmt.If{ Position: &position.Position{ StartLine: 103, - EndLine: 103, - StartPos: 2342, - EndPos: 2366, + EndLine: 103, + StartPos: 2342, + EndPos: 2366, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 103, - EndLine: 103, - StartPos: 2346, - EndPos: 2347, + EndLine: 103, + StartPos: 2346, + EndPos: 2347, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 103, - EndLine: 103, - StartPos: 2346, - EndPos: 2347, + EndLine: 103, + StartPos: 2346, + EndPos: 2347, }, Value: "a", }, @@ -5098,34 +5059,33 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 103, - EndLine: 103, - StartPos: 2350, - EndPos: 2351, - }, - Stmts: []node.Node{ + EndLine: 103, + StartPos: 2350, + EndPos: 2351, }, + Stmts: []node.Node{}, }, ElseIf: []node.Node{ &stmt.ElseIf{ Position: &position.Position{ StartLine: 103, - EndLine: 103, - StartPos: 2353, - EndPos: 2366, + EndLine: 103, + StartPos: 2353, + EndPos: 2366, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 103, - EndLine: 103, - StartPos: 2361, - EndPos: 2362, + EndLine: 103, + StartPos: 2361, + EndPos: 2362, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 103, - EndLine: 103, - StartPos: 2361, - EndPos: 2362, + EndLine: 103, + StartPos: 2361, + EndPos: 2362, }, Value: "b", }, @@ -5133,12 +5093,11 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 103, - EndLine: 103, - StartPos: 2365, - EndPos: 2366, - }, - Stmts: []node.Node{ + EndLine: 103, + StartPos: 2365, + EndPos: 2366, }, + Stmts: []node.Node{}, }, }, }, @@ -5146,23 +5105,23 @@ func TestPhp5(t *testing.T) { &stmt.If{ Position: &position.Position{ StartLine: 104, - EndLine: 104, - StartPos: 2370, - EndPos: 2387, + EndLine: 104, + StartPos: 2370, + EndPos: 2387, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 104, - EndLine: 104, - StartPos: 2374, - EndPos: 2375, + EndLine: 104, + StartPos: 2374, + EndPos: 2375, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 104, - EndLine: 104, - StartPos: 2374, - EndPos: 2375, + EndLine: 104, + StartPos: 2374, + EndPos: 2375, }, Value: "a", }, @@ -5170,52 +5129,50 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 104, - EndLine: 104, - StartPos: 2378, - EndPos: 2379, - }, - Stmts: []node.Node{ + EndLine: 104, + StartPos: 2378, + EndPos: 2379, }, + Stmts: []node.Node{}, }, Else: &stmt.Else{ Position: &position.Position{ StartLine: 104, - EndLine: 104, - StartPos: 2381, - EndPos: 2387, + EndLine: 104, + StartPos: 2381, + EndPos: 2387, }, Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 104, - EndLine: 104, - StartPos: 2386, - EndPos: 2387, - }, - Stmts: []node.Node{ + EndLine: 104, + StartPos: 2386, + EndPos: 2387, }, + Stmts: []node.Node{}, }, }, }, &stmt.If{ Position: &position.Position{ StartLine: 105, - EndLine: 105, - StartPos: 2391, - EndPos: 2438, + EndLine: 105, + StartPos: 2391, + EndPos: 2438, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 105, - EndLine: 105, - StartPos: 2395, - EndPos: 2396, + EndLine: 105, + StartPos: 2395, + EndPos: 2396, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 105, - EndLine: 105, - StartPos: 2395, - EndPos: 2396, + EndLine: 105, + StartPos: 2395, + EndPos: 2396, }, Value: "a", }, @@ -5223,34 +5180,33 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 105, - EndLine: 105, - StartPos: 2399, - EndPos: 2400, - }, - Stmts: []node.Node{ + EndLine: 105, + StartPos: 2399, + EndPos: 2400, }, + Stmts: []node.Node{}, }, ElseIf: []node.Node{ &stmt.ElseIf{ Position: &position.Position{ StartLine: 105, - EndLine: 105, - StartPos: 2402, - EndPos: 2415, + EndLine: 105, + StartPos: 2402, + EndPos: 2415, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 105, - EndLine: 105, - StartPos: 2410, - EndPos: 2411, + EndLine: 105, + StartPos: 2410, + EndPos: 2411, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 105, - EndLine: 105, - StartPos: 2410, - EndPos: 2411, + EndLine: 105, + StartPos: 2410, + EndPos: 2411, }, Value: "b", }, @@ -5258,34 +5214,33 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 105, - EndLine: 105, - StartPos: 2414, - EndPos: 2415, - }, - Stmts: []node.Node{ + EndLine: 105, + StartPos: 2414, + EndPos: 2415, }, + Stmts: []node.Node{}, }, }, &stmt.ElseIf{ Position: &position.Position{ StartLine: 105, - EndLine: 105, - StartPos: 2417, - EndPos: 2430, + EndLine: 105, + StartPos: 2417, + EndPos: 2430, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 105, - EndLine: 105, - StartPos: 2425, - EndPos: 2426, + EndLine: 105, + StartPos: 2425, + EndPos: 2426, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 105, - EndLine: 105, - StartPos: 2425, - EndPos: 2426, + EndLine: 105, + StartPos: 2425, + EndPos: 2426, }, Value: "c", }, @@ -5293,54 +5248,52 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 105, - EndLine: 105, - StartPos: 2429, - EndPos: 2430, - }, - Stmts: []node.Node{ + EndLine: 105, + StartPos: 2429, + EndPos: 2430, }, + Stmts: []node.Node{}, }, }, }, Else: &stmt.Else{ Position: &position.Position{ StartLine: 105, - EndLine: 105, - StartPos: 2432, - EndPos: 2438, + EndLine: 105, + StartPos: 2432, + EndPos: 2438, }, Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 105, - EndLine: 105, - StartPos: 2437, - EndPos: 2438, - }, - Stmts: []node.Node{ + EndLine: 105, + StartPos: 2437, + EndPos: 2438, }, + Stmts: []node.Node{}, }, }, }, &stmt.If{ Position: &position.Position{ StartLine: 106, - EndLine: 106, - StartPos: 2442, - EndPos: 2490, + EndLine: 106, + StartPos: 2442, + EndPos: 2490, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 106, - EndLine: 106, - StartPos: 2446, - EndPos: 2447, + EndLine: 106, + StartPos: 2446, + EndPos: 2447, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 106, - EndLine: 106, - StartPos: 2446, - EndPos: 2447, + EndLine: 106, + StartPos: 2446, + EndPos: 2447, }, Value: "a", }, @@ -5348,34 +5301,33 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 106, - EndLine: 106, - StartPos: 2450, - EndPos: 2451, - }, - Stmts: []node.Node{ + EndLine: 106, + StartPos: 2450, + EndPos: 2451, }, + Stmts: []node.Node{}, }, ElseIf: []node.Node{ &stmt.ElseIf{ Position: &position.Position{ StartLine: 106, - EndLine: 106, - StartPos: 2453, - EndPos: 2466, + EndLine: 106, + StartPos: 2453, + EndPos: 2466, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 106, - EndLine: 106, - StartPos: 2461, - EndPos: 2462, + EndLine: 106, + StartPos: 2461, + EndPos: 2462, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 106, - EndLine: 106, - StartPos: 2461, - EndPos: 2462, + EndLine: 106, + StartPos: 2461, + EndPos: 2462, }, Value: "b", }, @@ -5383,42 +5335,41 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 106, - EndLine: 106, - StartPos: 2465, - EndPos: 2466, - }, - Stmts: []node.Node{ + EndLine: 106, + StartPos: 2465, + EndPos: 2466, }, + Stmts: []node.Node{}, }, }, }, Else: &stmt.Else{ Position: &position.Position{ StartLine: 106, - EndLine: 106, - StartPos: 2468, - EndPos: 2490, + EndLine: 106, + StartPos: 2468, + EndPos: 2490, }, Stmt: &stmt.If{ Position: &position.Position{ StartLine: 106, - EndLine: 106, - StartPos: 2473, - EndPos: 2490, + EndLine: 106, + StartPos: 2473, + EndPos: 2490, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 106, - EndLine: 106, - StartPos: 2477, - EndPos: 2478, + EndLine: 106, + StartPos: 2477, + EndPos: 2478, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 106, - EndLine: 106, - StartPos: 2477, - EndPos: 2478, + EndLine: 106, + StartPos: 2477, + EndPos: 2478, }, Value: "c", }, @@ -5426,29 +5377,27 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 106, - EndLine: 106, - StartPos: 2481, - EndPos: 2482, - }, - Stmts: []node.Node{ + EndLine: 106, + StartPos: 2481, + EndPos: 2482, }, + Stmts: []node.Node{}, }, Else: &stmt.Else{ Position: &position.Position{ StartLine: 106, - EndLine: 106, - StartPos: 2484, - EndPos: 2490, + EndLine: 106, + StartPos: 2484, + EndPos: 2490, }, Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 106, - EndLine: 106, - StartPos: 2489, - EndPos: 2490, - }, - Stmts: []node.Node{ + EndLine: 106, + StartPos: 2489, + EndPos: 2490, }, + Stmts: []node.Node{}, }, }, }, @@ -5457,79 +5406,78 @@ func TestPhp5(t *testing.T) { &stmt.Nop{ Position: &position.Position{ StartLine: 107, - EndLine: 107, - StartPos: 2494, - EndPos: 2495, + EndLine: 107, + StartPos: 2494, + EndPos: 2495, }, }, &stmt.InlineHtml{ Position: &position.Position{ StartLine: 107, - EndLine: 107, - StartPos: 2497, - EndPos: 2508, + EndLine: 107, + StartPos: 2497, + EndPos: 2508, }, Value: "
", }, &stmt.Interface{ Position: &position.Position{ StartLine: 108, - EndLine: 108, - StartPos: 2514, - EndPos: 2529, + EndLine: 108, + StartPos: 2514, + EndPos: 2529, }, PhpDocComment: "", InterfaceName: &node.Identifier{ Position: &position.Position{ StartLine: 108, - EndLine: 108, - StartPos: 2524, - EndPos: 2526, + EndLine: 108, + StartPos: 2524, + EndPos: 2526, }, Value: "Foo", }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, &stmt.Interface{ Position: &position.Position{ StartLine: 109, - EndLine: 109, - StartPos: 2533, - EndPos: 2560, + EndLine: 109, + StartPos: 2533, + EndPos: 2560, }, PhpDocComment: "", InterfaceName: &node.Identifier{ Position: &position.Position{ StartLine: 109, - EndLine: 109, - StartPos: 2543, - EndPos: 2545, + EndLine: 109, + StartPos: 2543, + EndPos: 2545, }, Value: "Foo", }, Extends: &stmt.InterfaceExtends{ Position: &position.Position{ StartLine: 109, - EndLine: 109, - StartPos: 2547, - EndPos: 2557, + EndLine: 109, + StartPos: 2547, + EndPos: 2557, }, InterfaceNames: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 109, - EndLine: 109, - StartPos: 2555, - EndPos: 2557, + EndLine: 109, + StartPos: 2555, + EndPos: 2557, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 109, - EndLine: 109, - StartPos: 2555, - EndPos: 2557, + EndLine: 109, + StartPos: 2555, + EndPos: 2557, }, Value: "Bar", }, @@ -5537,48 +5485,47 @@ func TestPhp5(t *testing.T) { }, }, }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, &stmt.Interface{ Position: &position.Position{ StartLine: 110, - EndLine: 110, - StartPos: 2564, - EndPos: 2596, + EndLine: 110, + StartPos: 2564, + EndPos: 2596, }, PhpDocComment: "", InterfaceName: &node.Identifier{ Position: &position.Position{ StartLine: 110, - EndLine: 110, - StartPos: 2574, - EndPos: 2576, + EndLine: 110, + StartPos: 2574, + EndPos: 2576, }, Value: "Foo", }, Extends: &stmt.InterfaceExtends{ Position: &position.Position{ StartLine: 110, - EndLine: 110, - StartPos: 2578, - EndPos: 2593, + EndLine: 110, + StartPos: 2578, + EndPos: 2593, }, InterfaceNames: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 110, - EndLine: 110, - StartPos: 2586, - EndPos: 2588, + EndLine: 110, + StartPos: 2586, + EndPos: 2588, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 110, - EndLine: 110, - StartPos: 2586, - EndPos: 2588, + EndLine: 110, + StartPos: 2586, + EndPos: 2588, }, Value: "Bar", }, @@ -5587,17 +5534,17 @@ func TestPhp5(t *testing.T) { &name.Name{ Position: &position.Position{ StartLine: 110, - EndLine: 110, - StartPos: 2591, - EndPos: 2593, + EndLine: 110, + StartPos: 2591, + EndPos: 2593, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 110, - EndLine: 110, - StartPos: 2591, - EndPos: 2593, + EndLine: 110, + StartPos: 2591, + EndPos: 2593, }, Value: "Baz", }, @@ -5605,30 +5552,29 @@ func TestPhp5(t *testing.T) { }, }, }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, &stmt.Namespace{ Position: &position.Position{ StartLine: 111, - EndLine: 111, - StartPos: 2600, - EndPos: 2613, + EndLine: 111, + StartPos: 2600, + EndPos: 2613, }, NamespaceName: &name.Name{ Position: &position.Position{ StartLine: 111, - EndLine: 111, - StartPos: 2610, - EndPos: 2612, + EndLine: 111, + StartPos: 2610, + EndPos: 2612, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 111, - EndLine: 111, - StartPos: 2610, - EndPos: 2612, + EndLine: 111, + StartPos: 2610, + EndPos: 2612, }, Value: "Foo", }, @@ -5638,65 +5584,63 @@ func TestPhp5(t *testing.T) { &stmt.Namespace{ Position: &position.Position{ StartLine: 112, - EndLine: 112, - StartPos: 2617, - EndPos: 2636, + EndLine: 112, + StartPos: 2617, + EndPos: 2636, }, NamespaceName: &name.Name{ Position: &position.Position{ StartLine: 112, - EndLine: 112, - StartPos: 2627, - EndPos: 2633, + EndLine: 112, + StartPos: 2627, + EndPos: 2633, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 112, - EndLine: 112, - StartPos: 2627, - EndPos: 2629, + EndLine: 112, + StartPos: 2627, + EndPos: 2629, }, Value: "Foo", }, &name.NamePart{ Position: &position.Position{ StartLine: 112, - EndLine: 112, - StartPos: 2631, - EndPos: 2633, + EndLine: 112, + StartPos: 2631, + EndPos: 2633, }, Value: "Bar", }, }, }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, &stmt.Namespace{ Position: &position.Position{ StartLine: 113, - EndLine: 113, - StartPos: 2640, - EndPos: 2651, - }, - Stmts: []node.Node{ + EndLine: 113, + StartPos: 2640, + EndPos: 2651, }, + Stmts: []node.Node{}, }, &stmt.Class{ Position: &position.Position{ StartLine: 114, - EndLine: 114, - StartPos: 2655, - EndPos: 2673, + EndLine: 114, + StartPos: 2655, + EndPos: 2673, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 114, - EndLine: 114, - StartPos: 2661, - EndPos: 2663, + EndLine: 114, + StartPos: 2661, + EndPos: 2663, }, Value: "foo", }, @@ -5704,17 +5648,17 @@ func TestPhp5(t *testing.T) { &stmt.PropertyList{ Position: &position.Position{ StartLine: 114, - EndLine: 114, - StartPos: 2666, - EndPos: 2672, + EndLine: 114, + StartPos: 2666, + EndPos: 2672, }, Modifiers: []node.Node{ &node.Identifier{ Position: &position.Position{ StartLine: 114, - EndLine: 114, - StartPos: 2666, - EndPos: 2668, + EndLine: 114, + StartPos: 2666, + EndPos: 2668, }, Value: "var", }, @@ -5723,24 +5667,24 @@ func TestPhp5(t *testing.T) { &stmt.Property{ Position: &position.Position{ StartLine: 114, - EndLine: 114, - StartPos: 2670, - EndPos: 2671, + EndLine: 114, + StartPos: 2670, + EndPos: 2671, }, PhpDocComment: "", Variable: &expr.Variable{ Position: &position.Position{ StartLine: 114, - EndLine: 114, - StartPos: 2670, - EndPos: 2671, + EndLine: 114, + StartPos: 2670, + EndPos: 2671, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 114, - EndLine: 114, - StartPos: 2670, - EndPos: 2671, + EndLine: 114, + StartPos: 2670, + EndPos: 2671, }, Value: "a", }, @@ -5753,17 +5697,17 @@ func TestPhp5(t *testing.T) { &stmt.Class{ Position: &position.Position{ StartLine: 115, - EndLine: 115, - StartPos: 2677, - EndPos: 2713, + EndLine: 115, + StartPos: 2677, + EndPos: 2713, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 115, - EndLine: 115, - StartPos: 2683, - EndPos: 2685, + EndLine: 115, + StartPos: 2683, + EndPos: 2685, }, Value: "foo", }, @@ -5771,26 +5715,26 @@ func TestPhp5(t *testing.T) { &stmt.PropertyList{ Position: &position.Position{ StartLine: 115, - EndLine: 115, - StartPos: 2688, - EndPos: 2712, + EndLine: 115, + StartPos: 2688, + EndPos: 2712, }, Modifiers: []node.Node{ &node.Identifier{ Position: &position.Position{ StartLine: 115, - EndLine: 115, - StartPos: 2688, - EndPos: 2693, + EndLine: 115, + StartPos: 2688, + EndPos: 2693, }, Value: "public", }, &node.Identifier{ Position: &position.Position{ StartLine: 115, - EndLine: 115, - StartPos: 2695, - EndPos: 2700, + EndLine: 115, + StartPos: 2695, + EndPos: 2700, }, Value: "static", }, @@ -5799,24 +5743,24 @@ func TestPhp5(t *testing.T) { &stmt.Property{ Position: &position.Position{ StartLine: 115, - EndLine: 115, - StartPos: 2702, - EndPos: 2703, + EndLine: 115, + StartPos: 2702, + EndPos: 2703, }, PhpDocComment: "", Variable: &expr.Variable{ Position: &position.Position{ StartLine: 115, - EndLine: 115, - StartPos: 2702, - EndPos: 2703, + EndLine: 115, + StartPos: 2702, + EndPos: 2703, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 115, - EndLine: 115, - StartPos: 2702, - EndPos: 2703, + EndLine: 115, + StartPos: 2702, + EndPos: 2703, }, Value: "a", }, @@ -5825,24 +5769,24 @@ func TestPhp5(t *testing.T) { &stmt.Property{ Position: &position.Position{ StartLine: 115, - EndLine: 115, - StartPos: 2706, - EndPos: 2711, + EndLine: 115, + StartPos: 2706, + EndPos: 2711, }, PhpDocComment: "", Variable: &expr.Variable{ Position: &position.Position{ StartLine: 115, - EndLine: 115, - StartPos: 2706, - EndPos: 2707, + EndLine: 115, + StartPos: 2706, + EndPos: 2707, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 115, - EndLine: 115, - StartPos: 2706, - EndPos: 2707, + EndLine: 115, + StartPos: 2706, + EndPos: 2707, }, Value: "b", }, @@ -5850,9 +5794,9 @@ func TestPhp5(t *testing.T) { Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 115, - EndLine: 115, - StartPos: 2711, - EndPos: 2711, + EndLine: 115, + StartPos: 2711, + EndPos: 2711, }, Value: "1", }, @@ -5864,17 +5808,17 @@ func TestPhp5(t *testing.T) { &stmt.Class{ Position: &position.Position{ StartLine: 116, - EndLine: 116, - StartPos: 2717, - EndPos: 2753, + EndLine: 116, + StartPos: 2717, + EndPos: 2753, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 116, - EndLine: 116, - StartPos: 2723, - EndPos: 2725, + EndLine: 116, + StartPos: 2723, + EndPos: 2725, }, Value: "foo", }, @@ -5882,26 +5826,26 @@ func TestPhp5(t *testing.T) { &stmt.PropertyList{ Position: &position.Position{ StartLine: 116, - EndLine: 116, - StartPos: 2728, - EndPos: 2752, + EndLine: 116, + StartPos: 2728, + EndPos: 2752, }, Modifiers: []node.Node{ &node.Identifier{ Position: &position.Position{ StartLine: 116, - EndLine: 116, - StartPos: 2728, - EndPos: 2733, + EndLine: 116, + StartPos: 2728, + EndPos: 2733, }, Value: "public", }, &node.Identifier{ Position: &position.Position{ StartLine: 116, - EndLine: 116, - StartPos: 2735, - EndPos: 2740, + EndLine: 116, + StartPos: 2735, + EndPos: 2740, }, Value: "static", }, @@ -5910,24 +5854,24 @@ func TestPhp5(t *testing.T) { &stmt.Property{ Position: &position.Position{ StartLine: 116, - EndLine: 116, - StartPos: 2742, - EndPos: 2747, + EndLine: 116, + StartPos: 2742, + EndPos: 2747, }, PhpDocComment: "", Variable: &expr.Variable{ Position: &position.Position{ StartLine: 116, - EndLine: 116, - StartPos: 2742, - EndPos: 2743, + EndLine: 116, + StartPos: 2742, + EndPos: 2743, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 116, - EndLine: 116, - StartPos: 2742, - EndPos: 2743, + EndLine: 116, + StartPos: 2742, + EndPos: 2743, }, Value: "a", }, @@ -5935,9 +5879,9 @@ func TestPhp5(t *testing.T) { Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 116, - EndLine: 116, - StartPos: 2747, - EndPos: 2747, + EndLine: 116, + StartPos: 2747, + EndPos: 2747, }, Value: "1", }, @@ -5945,24 +5889,24 @@ func TestPhp5(t *testing.T) { &stmt.Property{ Position: &position.Position{ StartLine: 116, - EndLine: 116, - StartPos: 2750, - EndPos: 2751, + EndLine: 116, + StartPos: 2750, + EndPos: 2751, }, PhpDocComment: "", Variable: &expr.Variable{ Position: &position.Position{ StartLine: 116, - EndLine: 116, - StartPos: 2750, - EndPos: 2751, + EndLine: 116, + StartPos: 2750, + EndPos: 2751, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 116, - EndLine: 116, - StartPos: 2750, - EndPos: 2751, + EndLine: 116, + StartPos: 2750, + EndPos: 2751, }, Value: "b", }, @@ -5975,31 +5919,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 117, - EndLine: 117, - StartPos: 2757, - EndPos: 2774, + EndLine: 117, + StartPos: 2757, + EndPos: 2774, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 117, - EndLine: 117, - StartPos: 2764, - EndPos: 2765, + EndLine: 117, + StartPos: 2764, + EndPos: 2765, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 117, - EndLine: 117, - StartPos: 2764, - EndPos: 2765, + EndLine: 117, + StartPos: 2764, + EndPos: 2765, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 117, - EndLine: 117, - StartPos: 2764, - EndPos: 2765, + EndLine: 117, + StartPos: 2764, + EndPos: 2765, }, Value: "a", }, @@ -6008,23 +5952,23 @@ func TestPhp5(t *testing.T) { &stmt.StaticVar{ Position: &position.Position{ StartLine: 117, - EndLine: 117, - StartPos: 2768, - EndPos: 2773, + EndLine: 117, + StartPos: 2768, + EndPos: 2773, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 117, - EndLine: 117, - StartPos: 2768, - EndPos: 2769, + EndLine: 117, + StartPos: 2768, + EndPos: 2769, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 117, - EndLine: 117, - StartPos: 2768, - EndPos: 2769, + EndLine: 117, + StartPos: 2768, + EndPos: 2769, }, Value: "b", }, @@ -6032,9 +5976,9 @@ func TestPhp5(t *testing.T) { Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 117, - EndLine: 117, - StartPos: 2773, - EndPos: 2773, + EndLine: 117, + StartPos: 2773, + EndPos: 2773, }, Value: "1", }, @@ -6044,31 +5988,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 118, - EndLine: 118, - StartPos: 2778, - EndPos: 2795, + EndLine: 118, + StartPos: 2778, + EndPos: 2795, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 118, - EndLine: 118, - StartPos: 2785, - EndPos: 2790, + EndLine: 118, + StartPos: 2785, + EndPos: 2790, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 118, - EndLine: 118, - StartPos: 2785, - EndPos: 2786, + EndLine: 118, + StartPos: 2785, + EndPos: 2786, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 118, - EndLine: 118, - StartPos: 2785, - EndPos: 2786, + EndLine: 118, + StartPos: 2785, + EndPos: 2786, }, Value: "a", }, @@ -6076,9 +6020,9 @@ func TestPhp5(t *testing.T) { Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 118, - EndLine: 118, - StartPos: 2790, - EndPos: 2790, + EndLine: 118, + StartPos: 2790, + EndPos: 2790, }, Value: "1", }, @@ -6086,23 +6030,23 @@ func TestPhp5(t *testing.T) { &stmt.StaticVar{ Position: &position.Position{ StartLine: 118, - EndLine: 118, - StartPos: 2793, - EndPos: 2794, + EndLine: 118, + StartPos: 2793, + EndPos: 2794, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 118, - EndLine: 118, - StartPos: 2793, - EndPos: 2794, + EndLine: 118, + StartPos: 2793, + EndPos: 2794, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 118, - EndLine: 118, - StartPos: 2793, - EndPos: 2794, + EndLine: 118, + StartPos: 2793, + EndPos: 2794, }, Value: "b", }, @@ -6113,74 +6057,71 @@ func TestPhp5(t *testing.T) { &stmt.AltSwitch{ Position: &position.Position{ StartLine: 120, - EndLine: 124, - StartPos: 2800, - EndPos: 2858, + EndLine: 124, + StartPos: 2800, + EndPos: 2858, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 120, - EndLine: 120, - StartPos: 2808, - EndPos: 2808, + EndLine: 120, + StartPos: 2808, + EndPos: 2808, }, Value: "1", }, CaseList: &stmt.CaseList{ Position: &position.Position{ StartLine: 121, - EndLine: -1, - StartPos: 2816, - EndPos: -1, + EndLine: -1, + StartPos: 2816, + EndPos: -1, }, Cases: []node.Node{ &stmt.Case{ Position: &position.Position{ StartLine: 121, - EndLine: -1, - StartPos: 2816, - EndPos: -1, + EndLine: -1, + StartPos: 2816, + EndPos: -1, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 121, - EndLine: 121, - StartPos: 2821, - EndPos: 2821, + EndLine: 121, + StartPos: 2821, + EndPos: 2821, }, Value: "1", }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, &stmt.Default{ Position: &position.Position{ StartLine: 122, - EndLine: -1, - StartPos: 2827, - EndPos: -1, - }, - Stmts: []node.Node{ + EndLine: -1, + StartPos: 2827, + EndPos: -1, }, + Stmts: []node.Node{}, }, &stmt.Case{ Position: &position.Position{ StartLine: 123, - EndLine: -1, - StartPos: 2839, - EndPos: -1, + EndLine: -1, + StartPos: 2839, + EndPos: -1, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 123, - EndLine: 123, - StartPos: 2844, - EndPos: 2844, + EndLine: 123, + StartPos: 2844, + EndPos: 2844, }, Value: "2", }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, }, }, @@ -6188,64 +6129,62 @@ func TestPhp5(t *testing.T) { &stmt.AltSwitch{ Position: &position.Position{ StartLine: 126, - EndLine: 129, - StartPos: 2863, - EndPos: 2910, + EndLine: 129, + StartPos: 2863, + EndPos: 2910, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 126, - EndLine: 126, - StartPos: 2871, - EndPos: 2871, + EndLine: 126, + StartPos: 2871, + EndPos: 2871, }, Value: "1", }, CaseList: &stmt.CaseList{ Position: &position.Position{ StartLine: 127, - EndLine: -1, - StartPos: 2880, - EndPos: -1, + EndLine: -1, + StartPos: 2880, + EndPos: -1, }, Cases: []node.Node{ &stmt.Case{ Position: &position.Position{ StartLine: 127, - EndLine: -1, - StartPos: 2880, - EndPos: -1, + EndLine: -1, + StartPos: 2880, + EndPos: -1, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 127, - EndLine: 127, - StartPos: 2885, - EndPos: 2885, + EndLine: 127, + StartPos: 2885, + EndPos: 2885, }, Value: "1", }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, &stmt.Case{ Position: &position.Position{ StartLine: 128, - EndLine: -1, - StartPos: 2891, - EndPos: -1, + EndLine: -1, + StartPos: 2891, + EndPos: -1, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 128, - EndLine: 128, - StartPos: 2896, - EndPos: 2896, + EndLine: 128, + StartPos: 2896, + EndPos: 2896, }, Value: "2", }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, }, }, @@ -6253,40 +6192,40 @@ func TestPhp5(t *testing.T) { &stmt.Switch{ Position: &position.Position{ StartLine: 131, - EndLine: 134, - StartPos: 2917, - EndPos: 2968, + EndLine: 134, + StartPos: 2917, + EndPos: 2968, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 131, - EndLine: 131, - StartPos: 2925, - EndPos: 2925, + EndLine: 131, + StartPos: 2925, + EndPos: 2925, }, Value: "1", }, CaseList: &stmt.CaseList{ Position: &position.Position{ StartLine: 131, - EndLine: 134, - StartPos: 2928, - EndPos: 2968, + EndLine: 134, + StartPos: 2928, + EndPos: 2968, }, Cases: []node.Node{ &stmt.Case{ Position: &position.Position{ StartLine: 132, - EndLine: 132, - StartPos: 2933, - EndPos: 2946, + EndLine: 132, + StartPos: 2933, + EndPos: 2946, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 132, - EndLine: 132, - StartPos: 2938, - EndPos: 2938, + EndLine: 132, + StartPos: 2938, + EndPos: 2938, }, Value: "1", }, @@ -6294,9 +6233,9 @@ func TestPhp5(t *testing.T) { &stmt.Break{ Position: &position.Position{ StartLine: 132, - EndLine: 132, - StartPos: 2941, - EndPos: 2946, + EndLine: 132, + StartPos: 2941, + EndPos: 2946, }, }, }, @@ -6304,16 +6243,16 @@ func TestPhp5(t *testing.T) { &stmt.Case{ Position: &position.Position{ StartLine: 133, - EndLine: 133, - StartPos: 2951, - EndPos: 2964, + EndLine: 133, + StartPos: 2951, + EndPos: 2964, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 133, - EndLine: 133, - StartPos: 2956, - EndPos: 2956, + EndLine: 133, + StartPos: 2956, + EndPos: 2956, }, Value: "2", }, @@ -6321,9 +6260,9 @@ func TestPhp5(t *testing.T) { &stmt.Break{ Position: &position.Position{ StartLine: 133, - EndLine: 133, - StartPos: 2959, - EndPos: 2964, + EndLine: 133, + StartPos: 2959, + EndPos: 2964, }, }, }, @@ -6334,40 +6273,40 @@ func TestPhp5(t *testing.T) { &stmt.Switch{ Position: &position.Position{ StartLine: 136, - EndLine: 139, - StartPos: 2975, - EndPos: 3027, + EndLine: 139, + StartPos: 2975, + EndPos: 3027, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 136, - EndLine: 136, - StartPos: 2983, - EndPos: 2983, + EndLine: 136, + StartPos: 2983, + EndPos: 2983, }, Value: "1", }, CaseList: &stmt.CaseList{ Position: &position.Position{ StartLine: 136, - EndLine: 139, - StartPos: 2986, - EndPos: 3027, + EndLine: 139, + StartPos: 2986, + EndPos: 3027, }, Cases: []node.Node{ &stmt.Case{ Position: &position.Position{ StartLine: 137, - EndLine: 137, - StartPos: 2992, - EndPos: 3005, + EndLine: 137, + StartPos: 2992, + EndPos: 3005, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 137, - EndLine: 137, - StartPos: 2997, - EndPos: 2997, + EndLine: 137, + StartPos: 2997, + EndPos: 2997, }, Value: "1", }, @@ -6375,9 +6314,9 @@ func TestPhp5(t *testing.T) { &stmt.Break{ Position: &position.Position{ StartLine: 137, - EndLine: 137, - StartPos: 3000, - EndPos: 3005, + EndLine: 137, + StartPos: 3000, + EndPos: 3005, }, }, }, @@ -6385,16 +6324,16 @@ func TestPhp5(t *testing.T) { &stmt.Case{ Position: &position.Position{ StartLine: 138, - EndLine: 138, - StartPos: 3010, - EndPos: 3023, + EndLine: 138, + StartPos: 3010, + EndPos: 3023, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 138, - EndLine: 138, - StartPos: 3015, - EndPos: 3015, + EndLine: 138, + StartPos: 3015, + EndPos: 3015, }, Value: "2", }, @@ -6402,9 +6341,9 @@ func TestPhp5(t *testing.T) { &stmt.Break{ Position: &position.Position{ StartLine: 138, - EndLine: 138, - StartPos: 3018, - EndPos: 3023, + EndLine: 138, + StartPos: 3018, + EndPos: 3023, }, }, }, @@ -6415,23 +6354,23 @@ func TestPhp5(t *testing.T) { &stmt.Throw{ Position: &position.Position{ StartLine: 140, - EndLine: 140, - StartPos: 3031, - EndPos: 3039, + EndLine: 140, + StartPos: 3031, + EndPos: 3039, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 140, - EndLine: 140, - StartPos: 3037, - EndPos: 3038, + EndLine: 140, + StartPos: 3037, + EndPos: 3038, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 140, - EndLine: 140, - StartPos: 3037, - EndPos: 3038, + EndLine: 140, + StartPos: 3037, + EndPos: 3038, }, Value: "e", }, @@ -6440,37 +6379,36 @@ func TestPhp5(t *testing.T) { &stmt.Trait{ Position: &position.Position{ StartLine: 141, - EndLine: 141, - StartPos: 3043, - EndPos: 3054, + EndLine: 141, + StartPos: 3043, + EndPos: 3054, }, PhpDocComment: "", TraitName: &node.Identifier{ Position: &position.Position{ StartLine: 141, - EndLine: 141, - StartPos: 3049, - EndPos: 3051, + EndLine: 141, + StartPos: 3049, + EndPos: 3051, }, Value: "Foo", }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, &stmt.Class{ Position: &position.Position{ StartLine: 142, - EndLine: 142, - StartPos: 3058, - EndPos: 3079, + EndLine: 142, + StartPos: 3058, + EndPos: 3079, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 142, - EndLine: 142, - StartPos: 3064, - EndPos: 3066, + EndLine: 142, + StartPos: 3064, + EndPos: 3066, }, Value: "Foo", }, @@ -6478,25 +6416,25 @@ func TestPhp5(t *testing.T) { &stmt.TraitUse{ Position: &position.Position{ StartLine: 142, - EndLine: 142, - StartPos: 3070, - EndPos: 3077, + EndLine: 142, + StartPos: 3070, + EndPos: 3077, }, Traits: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 142, - EndLine: 142, - StartPos: 3074, - EndPos: 3076, + EndLine: 142, + StartPos: 3074, + EndPos: 3076, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 142, - EndLine: 142, - StartPos: 3074, - EndPos: 3076, + EndLine: 142, + StartPos: 3074, + EndPos: 3076, }, Value: "Bar", }, @@ -6509,17 +6447,17 @@ func TestPhp5(t *testing.T) { &stmt.Class{ Position: &position.Position{ StartLine: 143, - EndLine: 143, - StartPos: 3083, - EndPos: 3111, + EndLine: 143, + StartPos: 3083, + EndPos: 3111, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 143, - EndLine: 143, - StartPos: 3089, - EndPos: 3091, + EndLine: 143, + StartPos: 3089, + EndPos: 3091, }, Value: "Foo", }, @@ -6527,25 +6465,25 @@ func TestPhp5(t *testing.T) { &stmt.TraitUse{ Position: &position.Position{ StartLine: 143, - EndLine: 143, - StartPos: 3095, - EndPos: 3109, + EndLine: 143, + StartPos: 3095, + EndPos: 3109, }, Traits: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 143, - EndLine: 143, - StartPos: 3099, - EndPos: 3101, + EndLine: 143, + StartPos: 3099, + EndPos: 3101, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 143, - EndLine: 143, - StartPos: 3099, - EndPos: 3101, + EndLine: 143, + StartPos: 3099, + EndPos: 3101, }, Value: "Bar", }, @@ -6554,17 +6492,17 @@ func TestPhp5(t *testing.T) { &name.Name{ Position: &position.Position{ StartLine: 143, - EndLine: 143, - StartPos: 3104, - EndPos: 3106, + EndLine: 143, + StartPos: 3104, + EndPos: 3106, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 143, - EndLine: 143, - StartPos: 3104, - EndPos: 3106, + EndLine: 143, + StartPos: 3104, + EndPos: 3106, }, Value: "Baz", }, @@ -6574,9 +6512,9 @@ func TestPhp5(t *testing.T) { TraitAdaptationList: &stmt.TraitAdaptationList{ Position: &position.Position{ StartLine: 143, - EndLine: 143, - StartPos: 3108, - EndPos: 3109, + EndLine: 143, + StartPos: 3108, + EndPos: 3109, }, }, }, @@ -6585,17 +6523,17 @@ func TestPhp5(t *testing.T) { &stmt.Class{ Position: &position.Position{ StartLine: 144, - EndLine: 144, - StartPos: 3115, - EndPos: 3159, + EndLine: 144, + StartPos: 3115, + EndPos: 3159, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 144, - EndLine: 144, - StartPos: 3121, - EndPos: 3123, + EndLine: 144, + StartPos: 3121, + EndPos: 3123, }, Value: "Foo", }, @@ -6603,25 +6541,25 @@ func TestPhp5(t *testing.T) { &stmt.TraitUse{ Position: &position.Position{ StartLine: 144, - EndLine: 144, - StartPos: 3127, - EndPos: 3157, + EndLine: 144, + StartPos: 3127, + EndPos: 3157, }, Traits: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 144, - EndLine: 144, - StartPos: 3131, - EndPos: 3133, + EndLine: 144, + StartPos: 3131, + EndPos: 3133, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 144, - EndLine: 144, - StartPos: 3131, - EndPos: 3133, + EndLine: 144, + StartPos: 3131, + EndPos: 3133, }, Value: "Bar", }, @@ -6630,17 +6568,17 @@ func TestPhp5(t *testing.T) { &name.Name{ Position: &position.Position{ StartLine: 144, - EndLine: 144, - StartPos: 3136, - EndPos: 3138, + EndLine: 144, + StartPos: 3136, + EndPos: 3138, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 144, - EndLine: 144, - StartPos: 3136, - EndPos: 3138, + EndLine: 144, + StartPos: 3136, + EndPos: 3138, }, Value: "Baz", }, @@ -6650,31 +6588,31 @@ func TestPhp5(t *testing.T) { TraitAdaptationList: &stmt.TraitAdaptationList{ Position: &position.Position{ StartLine: 144, - EndLine: 144, - StartPos: 3140, - EndPos: 3157, + EndLine: 144, + StartPos: 3140, + EndPos: 3157, }, Adaptations: []node.Node{ &stmt.TraitUseAlias{ Position: &position.Position{ StartLine: 144, - EndLine: 144, - StartPos: 3142, - EndPos: 3154, + EndLine: 144, + StartPos: 3142, + EndPos: 3154, }, Ref: &stmt.TraitMethodRef{ Position: &position.Position{ StartLine: 144, - EndLine: 144, - StartPos: 3142, - EndPos: 3144, + EndLine: 144, + StartPos: 3142, + EndPos: 3144, }, Method: &node.Identifier{ Position: &position.Position{ StartLine: 144, - EndLine: 144, - StartPos: 3142, - EndPos: 3144, + EndLine: 144, + StartPos: 3142, + EndPos: 3144, }, Value: "one", }, @@ -6682,9 +6620,9 @@ func TestPhp5(t *testing.T) { Modifier: &node.Identifier{ Position: &position.Position{ StartLine: 144, - EndLine: 144, - StartPos: 3149, - EndPos: 3154, + EndLine: 144, + StartPos: 3149, + EndPos: 3154, }, Value: "public", }, @@ -6697,17 +6635,17 @@ func TestPhp5(t *testing.T) { &stmt.Class{ Position: &position.Position{ StartLine: 145, - EndLine: 145, - StartPos: 3163, - EndPos: 3211, + EndLine: 145, + StartPos: 3163, + EndPos: 3211, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 145, - EndLine: 145, - StartPos: 3169, - EndPos: 3171, + EndLine: 145, + StartPos: 3169, + EndPos: 3171, }, Value: "Foo", }, @@ -6715,25 +6653,25 @@ func TestPhp5(t *testing.T) { &stmt.TraitUse{ Position: &position.Position{ StartLine: 145, - EndLine: 145, - StartPos: 3175, - EndPos: 3209, + EndLine: 145, + StartPos: 3175, + EndPos: 3209, }, Traits: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 145, - EndLine: 145, - StartPos: 3179, - EndPos: 3181, + EndLine: 145, + StartPos: 3179, + EndPos: 3181, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 145, - EndLine: 145, - StartPos: 3179, - EndPos: 3181, + EndLine: 145, + StartPos: 3179, + EndPos: 3181, }, Value: "Bar", }, @@ -6742,17 +6680,17 @@ func TestPhp5(t *testing.T) { &name.Name{ Position: &position.Position{ StartLine: 145, - EndLine: 145, - StartPos: 3184, - EndPos: 3186, + EndLine: 145, + StartPos: 3184, + EndPos: 3186, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 145, - EndLine: 145, - StartPos: 3184, - EndPos: 3186, + EndLine: 145, + StartPos: 3184, + EndPos: 3186, }, Value: "Baz", }, @@ -6762,31 +6700,31 @@ func TestPhp5(t *testing.T) { TraitAdaptationList: &stmt.TraitAdaptationList{ Position: &position.Position{ StartLine: 145, - EndLine: 145, - StartPos: 3188, - EndPos: 3209, + EndLine: 145, + StartPos: 3188, + EndPos: 3209, }, Adaptations: []node.Node{ &stmt.TraitUseAlias{ Position: &position.Position{ StartLine: 145, - EndLine: 145, - StartPos: 3190, - EndPos: 3206, + EndLine: 145, + StartPos: 3190, + EndPos: 3206, }, Ref: &stmt.TraitMethodRef{ Position: &position.Position{ StartLine: 145, - EndLine: 145, - StartPos: 3190, - EndPos: 3192, + EndLine: 145, + StartPos: 3190, + EndPos: 3192, }, Method: &node.Identifier{ Position: &position.Position{ StartLine: 145, - EndLine: 145, - StartPos: 3190, - EndPos: 3192, + EndLine: 145, + StartPos: 3190, + EndPos: 3192, }, Value: "one", }, @@ -6794,18 +6732,18 @@ func TestPhp5(t *testing.T) { Modifier: &node.Identifier{ Position: &position.Position{ StartLine: 145, - EndLine: 145, - StartPos: 3197, - EndPos: 3202, + EndLine: 145, + StartPos: 3197, + EndPos: 3202, }, Value: "public", }, Alias: &node.Identifier{ Position: &position.Position{ StartLine: 145, - EndLine: 145, - StartPos: 3204, - EndPos: 3206, + EndLine: 145, + StartPos: 3204, + EndPos: 3206, }, Value: "two", }, @@ -6818,17 +6756,17 @@ func TestPhp5(t *testing.T) { &stmt.Class{ Position: &position.Position{ StartLine: 146, - EndLine: 146, - StartPos: 3215, - EndPos: 3291, + EndLine: 146, + StartPos: 3215, + EndPos: 3291, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 146, - EndLine: 146, - StartPos: 3221, - EndPos: 3223, + EndLine: 146, + StartPos: 3221, + EndPos: 3223, }, Value: "Foo", }, @@ -6836,25 +6774,25 @@ func TestPhp5(t *testing.T) { &stmt.TraitUse{ Position: &position.Position{ StartLine: 146, - EndLine: 146, - StartPos: 3227, - EndPos: 3289, + EndLine: 146, + StartPos: 3227, + EndPos: 3289, }, Traits: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 146, - EndLine: 146, - StartPos: 3231, - EndPos: 3233, + EndLine: 146, + StartPos: 3231, + EndPos: 3233, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 146, - EndLine: 146, - StartPos: 3231, - EndPos: 3233, + EndLine: 146, + StartPos: 3231, + EndPos: 3233, }, Value: "Bar", }, @@ -6863,17 +6801,17 @@ func TestPhp5(t *testing.T) { &name.Name{ Position: &position.Position{ StartLine: 146, - EndLine: 146, - StartPos: 3236, - EndPos: 3238, + EndLine: 146, + StartPos: 3236, + EndPos: 3238, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 146, - EndLine: 146, - StartPos: 3236, - EndPos: 3238, + EndLine: 146, + StartPos: 3236, + EndPos: 3238, }, Value: "Baz", }, @@ -6883,39 +6821,39 @@ func TestPhp5(t *testing.T) { TraitAdaptationList: &stmt.TraitAdaptationList{ Position: &position.Position{ StartLine: 146, - EndLine: 146, - StartPos: 3240, - EndPos: 3289, + EndLine: 146, + StartPos: 3240, + EndPos: 3289, }, Adaptations: []node.Node{ &stmt.TraitUsePrecedence{ Position: &position.Position{ StartLine: 146, - EndLine: 146, - StartPos: 3242, - EndPos: 3269, + EndLine: 146, + StartPos: 3242, + EndPos: 3269, }, Ref: &stmt.TraitMethodRef{ Position: &position.Position{ StartLine: 146, - EndLine: 146, - StartPos: 3242, - EndPos: 3249, + EndLine: 146, + StartPos: 3242, + EndPos: 3249, }, Trait: &name.Name{ Position: &position.Position{ StartLine: 146, - EndLine: 146, - StartPos: 3242, - EndPos: 3244, + EndLine: 146, + StartPos: 3242, + EndPos: 3244, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 146, - EndLine: 146, - StartPos: 3242, - EndPos: 3244, + EndLine: 146, + StartPos: 3242, + EndPos: 3244, }, Value: "Bar", }, @@ -6924,9 +6862,9 @@ func TestPhp5(t *testing.T) { Method: &node.Identifier{ Position: &position.Position{ StartLine: 146, - EndLine: 146, - StartPos: 3247, - EndPos: 3249, + EndLine: 146, + StartPos: 3247, + EndPos: 3249, }, Value: "one", }, @@ -6935,17 +6873,17 @@ func TestPhp5(t *testing.T) { &name.Name{ Position: &position.Position{ StartLine: 146, - EndLine: 146, - StartPos: 3261, - EndPos: 3263, + EndLine: 146, + StartPos: 3261, + EndPos: 3263, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 146, - EndLine: 146, - StartPos: 3261, - EndPos: 3263, + EndLine: 146, + StartPos: 3261, + EndPos: 3263, }, Value: "Baz", }, @@ -6954,17 +6892,17 @@ func TestPhp5(t *testing.T) { &name.Name{ Position: &position.Position{ StartLine: 146, - EndLine: 146, - StartPos: 3266, - EndPos: 3269, + EndLine: 146, + StartPos: 3266, + EndPos: 3269, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 146, - EndLine: 146, - StartPos: 3266, - EndPos: 3269, + EndLine: 146, + StartPos: 3266, + EndPos: 3269, }, Value: "Quux", }, @@ -6975,31 +6913,31 @@ func TestPhp5(t *testing.T) { &stmt.TraitUseAlias{ Position: &position.Position{ StartLine: 146, - EndLine: 146, - StartPos: 3272, - EndPos: 3286, + EndLine: 146, + StartPos: 3272, + EndPos: 3286, }, Ref: &stmt.TraitMethodRef{ Position: &position.Position{ StartLine: 146, - EndLine: 146, - StartPos: 3272, - EndPos: 3279, + EndLine: 146, + StartPos: 3272, + EndPos: 3279, }, Trait: &name.Name{ Position: &position.Position{ StartLine: 146, - EndLine: 146, - StartPos: 3272, - EndPos: 3274, + EndLine: 146, + StartPos: 3272, + EndPos: 3274, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 146, - EndLine: 146, - StartPos: 3272, - EndPos: 3274, + EndLine: 146, + StartPos: 3272, + EndPos: 3274, }, Value: "Baz", }, @@ -7008,9 +6946,9 @@ func TestPhp5(t *testing.T) { Method: &node.Identifier{ Position: &position.Position{ StartLine: 146, - EndLine: 146, - StartPos: 3277, - EndPos: 3279, + EndLine: 146, + StartPos: 3277, + EndPos: 3279, }, Value: "one", }, @@ -7018,9 +6956,9 @@ func TestPhp5(t *testing.T) { Alias: &node.Identifier{ Position: &position.Position{ StartLine: 146, - EndLine: 146, - StartPos: 3284, - EndPos: 3286, + EndLine: 146, + StartPos: 3284, + EndPos: 3286, }, Value: "two", }, @@ -7033,47 +6971,44 @@ func TestPhp5(t *testing.T) { &stmt.Try{ Position: &position.Position{ StartLine: 148, - EndLine: -1, - StartPos: 3296, - EndPos: -1, - }, - Stmts: []node.Node{ - }, - Catches: []node.Node{ + EndLine: -1, + StartPos: 3296, + EndPos: -1, }, + Stmts: []node.Node{}, + Catches: []node.Node{}, }, &stmt.Try{ Position: &position.Position{ StartLine: 149, - EndLine: 149, - StartPos: 3305, - EndPos: 3334, - }, - Stmts: []node.Node{ + EndLine: 149, + StartPos: 3305, + EndPos: 3334, }, + Stmts: []node.Node{}, Catches: []node.Node{ &stmt.Catch{ Position: &position.Position{ StartLine: 149, - EndLine: 149, - StartPos: 3312, - EndPos: 3334, + EndLine: 149, + StartPos: 3312, + EndPos: 3334, }, Types: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 149, - EndLine: 149, - StartPos: 3319, - EndPos: 3327, + EndLine: 149, + StartPos: 3319, + EndPos: 3327, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 149, - EndLine: 149, - StartPos: 3319, - EndPos: 3327, + EndLine: 149, + StartPos: 3319, + EndPos: 3327, }, Value: "Exception", }, @@ -7083,57 +7018,55 @@ func TestPhp5(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 149, - EndLine: 149, - StartPos: 3329, - EndPos: 3330, + EndLine: 149, + StartPos: 3329, + EndPos: 3330, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 149, - EndLine: 149, - StartPos: 3329, - EndPos: 3330, + EndLine: 149, + StartPos: 3329, + EndPos: 3330, }, Value: "e", }, }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, }, }, &stmt.Try{ Position: &position.Position{ StartLine: 150, - EndLine: 150, - StartPos: 3338, - EndPos: 3398, - }, - Stmts: []node.Node{ + EndLine: 150, + StartPos: 3338, + EndPos: 3398, }, + Stmts: []node.Node{}, Catches: []node.Node{ &stmt.Catch{ Position: &position.Position{ StartLine: 150, - EndLine: 150, - StartPos: 3345, - EndPos: 3367, + EndLine: 150, + StartPos: 3345, + EndPos: 3367, }, Types: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 150, - EndLine: 150, - StartPos: 3352, - EndPos: 3360, + EndLine: 150, + StartPos: 3352, + EndPos: 3360, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 150, - EndLine: 150, - StartPos: 3352, - EndPos: 3360, + EndLine: 150, + StartPos: 3352, + EndPos: 3360, }, Value: "Exception", }, @@ -7143,45 +7076,44 @@ func TestPhp5(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 150, - EndLine: 150, - StartPos: 3362, - EndPos: 3363, + EndLine: 150, + StartPos: 3362, + EndPos: 3363, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 150, - EndLine: 150, - StartPos: 3362, - EndPos: 3363, + EndLine: 150, + StartPos: 3362, + EndPos: 3363, }, Value: "e", }, }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, &stmt.Catch{ Position: &position.Position{ StartLine: 150, - EndLine: 150, - StartPos: 3369, - EndPos: 3398, + EndLine: 150, + StartPos: 3369, + EndPos: 3398, }, Types: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 150, - EndLine: 150, - StartPos: 3376, - EndPos: 3391, + EndLine: 150, + StartPos: 3376, + EndPos: 3391, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 150, - EndLine: 150, - StartPos: 3376, - EndPos: 3391, + EndLine: 150, + StartPos: 3376, + EndPos: 3391, }, Value: "RuntimeException", }, @@ -7191,57 +7123,55 @@ func TestPhp5(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 150, - EndLine: 150, - StartPos: 3393, - EndPos: 3394, + EndLine: 150, + StartPos: 3393, + EndPos: 3394, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 150, - EndLine: 150, - StartPos: 3393, - EndPos: 3394, + EndLine: 150, + StartPos: 3393, + EndPos: 3394, }, Value: "e", }, }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, }, }, &stmt.Try{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3402, - EndPos: 3505, - }, - Stmts: []node.Node{ + EndLine: 151, + StartPos: 3402, + EndPos: 3505, }, + Stmts: []node.Node{}, Catches: []node.Node{ &stmt.Catch{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3409, - EndPos: 3431, + EndLine: 151, + StartPos: 3409, + EndPos: 3431, }, Types: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3416, - EndPos: 3424, + EndLine: 151, + StartPos: 3416, + EndPos: 3424, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3416, - EndPos: 3424, + EndLine: 151, + StartPos: 3416, + EndPos: 3424, }, Value: "Exception", }, @@ -7251,45 +7181,44 @@ func TestPhp5(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3426, - EndPos: 3427, + EndLine: 151, + StartPos: 3426, + EndPos: 3427, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3426, - EndPos: 3427, + EndLine: 151, + StartPos: 3426, + EndPos: 3427, }, Value: "e", }, }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, &stmt.Catch{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3433, - EndPos: 3463, + EndLine: 151, + StartPos: 3433, + EndPos: 3463, }, Types: []node.Node{ &name.FullyQualified{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3440, - EndPos: 3456, + EndLine: 151, + StartPos: 3440, + EndPos: 3456, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3441, - EndPos: 3456, + EndLine: 151, + StartPos: 3441, + EndPos: 3456, }, Value: "RuntimeException", }, @@ -7299,45 +7228,44 @@ func TestPhp5(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3458, - EndPos: 3459, + EndLine: 151, + StartPos: 3458, + EndPos: 3459, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3458, - EndPos: 3459, + EndLine: 151, + StartPos: 3458, + EndPos: 3459, }, Value: "e", }, }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, &stmt.Catch{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3465, - EndPos: 3505, + EndLine: 151, + StartPos: 3465, + EndPos: 3505, }, Types: []node.Node{ &name.Relative{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3472, - EndPos: 3498, + EndLine: 151, + StartPos: 3472, + EndPos: 3498, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3482, - EndPos: 3498, + EndLine: 151, + StartPos: 3482, + EndPos: 3498, }, Value: "AdditionException", }, @@ -7347,57 +7275,55 @@ func TestPhp5(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3500, - EndPos: 3501, + EndLine: 151, + StartPos: 3500, + EndPos: 3501, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3500, - EndPos: 3501, + EndLine: 151, + StartPos: 3500, + EndPos: 3501, }, Value: "e", }, }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, }, }, &stmt.Try{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3509, - EndPos: 3549, - }, - Stmts: []node.Node{ + EndLine: 152, + StartPos: 3509, + EndPos: 3549, }, + Stmts: []node.Node{}, Catches: []node.Node{ &stmt.Catch{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3516, - EndPos: 3538, + EndLine: 152, + StartPos: 3516, + EndPos: 3538, }, Types: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3523, - EndPos: 3531, + EndLine: 152, + StartPos: 3523, + EndPos: 3531, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3523, - EndPos: 3531, + EndLine: 152, + StartPos: 3523, + EndPos: 3531, }, Value: "Exception", }, @@ -7407,56 +7333,54 @@ func TestPhp5(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3533, - EndPos: 3534, + EndLine: 152, + StartPos: 3533, + EndPos: 3534, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3533, - EndPos: 3534, + EndLine: 152, + StartPos: 3533, + EndPos: 3534, }, Value: "e", }, }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, }, Finally: &stmt.Finally{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3540, - EndPos: 3549, - }, - Stmts: []node.Node{ + EndLine: 152, + StartPos: 3540, + EndPos: 3549, }, + Stmts: []node.Node{}, }, }, &stmt.Unset{ Position: &position.Position{ StartLine: 154, - EndLine: 154, - StartPos: 3554, - EndPos: 3567, + EndLine: 154, + StartPos: 3554, + EndPos: 3567, }, Vars: []node.Node{ &expr.Variable{ Position: &position.Position{ StartLine: 154, - EndLine: 154, - StartPos: 3560, - EndPos: 3561, + EndLine: 154, + StartPos: 3560, + EndPos: 3561, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 154, - EndLine: 154, - StartPos: 3560, - EndPos: 3561, + EndLine: 154, + StartPos: 3560, + EndPos: 3561, }, Value: "a", }, @@ -7464,16 +7388,16 @@ func TestPhp5(t *testing.T) { &expr.Variable{ Position: &position.Position{ StartLine: 154, - EndLine: 154, - StartPos: 3564, - EndPos: 3565, + EndLine: 154, + StartPos: 3564, + EndPos: 3565, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 154, - EndLine: 154, - StartPos: 3564, - EndPos: 3565, + EndLine: 154, + StartPos: 3564, + EndPos: 3565, }, Value: "b", }, @@ -7483,32 +7407,32 @@ func TestPhp5(t *testing.T) { &stmt.UseList{ Position: &position.Position{ StartLine: 156, - EndLine: 156, - StartPos: 3572, - EndPos: 3579, + EndLine: 156, + StartPos: 3572, + EndPos: 3579, }, Uses: []node.Node{ &stmt.Use{ Position: &position.Position{ StartLine: 156, - EndLine: 156, - StartPos: 3576, - EndPos: 3578, + EndLine: 156, + StartPos: 3576, + EndPos: 3578, }, Use: &name.Name{ Position: &position.Position{ StartLine: 156, - EndLine: 156, - StartPos: 3576, - EndPos: 3578, + EndLine: 156, + StartPos: 3576, + EndPos: 3578, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 156, - EndLine: 156, - StartPos: 3576, - EndPos: 3578, + EndLine: 156, + StartPos: 3576, + EndPos: 3578, }, Value: "Foo", }, @@ -7520,32 +7444,32 @@ func TestPhp5(t *testing.T) { &stmt.UseList{ Position: &position.Position{ StartLine: 157, - EndLine: 157, - StartPos: 3583, - EndPos: 3591, + EndLine: 157, + StartPos: 3583, + EndPos: 3591, }, Uses: []node.Node{ &stmt.Use{ Position: &position.Position{ StartLine: 157, - EndLine: 157, - StartPos: 3588, - EndPos: 3590, + EndLine: 157, + StartPos: 3588, + EndPos: 3590, }, Use: &name.Name{ Position: &position.Position{ StartLine: 157, - EndLine: 157, - StartPos: 3588, - EndPos: 3590, + EndLine: 157, + StartPos: 3588, + EndPos: 3590, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 157, - EndLine: 157, - StartPos: 3588, - EndPos: 3590, + EndLine: 157, + StartPos: 3588, + EndPos: 3590, }, Value: "Foo", }, @@ -7557,32 +7481,32 @@ func TestPhp5(t *testing.T) { &stmt.UseList{ Position: &position.Position{ StartLine: 158, - EndLine: 158, - StartPos: 3595, - EndPos: 3610, + EndLine: 158, + StartPos: 3595, + EndPos: 3610, }, Uses: []node.Node{ &stmt.Use{ Position: &position.Position{ StartLine: 158, - EndLine: 158, - StartPos: 3600, - EndPos: 3609, + EndLine: 158, + StartPos: 3600, + EndPos: 3609, }, Use: &name.Name{ Position: &position.Position{ StartLine: 158, - EndLine: 158, - StartPos: 3600, - EndPos: 3602, + EndLine: 158, + StartPos: 3600, + EndPos: 3602, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 158, - EndLine: 158, - StartPos: 3600, - EndPos: 3602, + EndLine: 158, + StartPos: 3600, + EndPos: 3602, }, Value: "Foo", }, @@ -7591,9 +7515,9 @@ func TestPhp5(t *testing.T) { Alias: &node.Identifier{ Position: &position.Position{ StartLine: 158, - EndLine: 158, - StartPos: 3607, - EndPos: 3609, + EndLine: 158, + StartPos: 3607, + EndPos: 3609, }, Value: "Bar", }, @@ -7603,32 +7527,32 @@ func TestPhp5(t *testing.T) { &stmt.UseList{ Position: &position.Position{ StartLine: 159, - EndLine: 159, - StartPos: 3614, - EndPos: 3626, + EndLine: 159, + StartPos: 3614, + EndPos: 3626, }, Uses: []node.Node{ &stmt.Use{ Position: &position.Position{ StartLine: 159, - EndLine: 159, - StartPos: 3618, - EndPos: 3620, + EndLine: 159, + StartPos: 3618, + EndPos: 3620, }, Use: &name.Name{ Position: &position.Position{ StartLine: 159, - EndLine: 159, - StartPos: 3618, - EndPos: 3620, + EndLine: 159, + StartPos: 3618, + EndPos: 3620, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 159, - EndLine: 159, - StartPos: 3618, - EndPos: 3620, + EndLine: 159, + StartPos: 3618, + EndPos: 3620, }, Value: "Foo", }, @@ -7638,24 +7562,24 @@ func TestPhp5(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 159, - EndLine: 159, - StartPos: 3623, - EndPos: 3625, + EndLine: 159, + StartPos: 3623, + EndPos: 3625, }, Use: &name.Name{ Position: &position.Position{ StartLine: 159, - EndLine: 159, - StartPos: 3623, - EndPos: 3625, + EndLine: 159, + StartPos: 3623, + EndPos: 3625, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 159, - EndLine: 159, - StartPos: 3623, - EndPos: 3625, + EndLine: 159, + StartPos: 3623, + EndPos: 3625, }, Value: "Bar", }, @@ -7667,32 +7591,32 @@ func TestPhp5(t *testing.T) { &stmt.UseList{ Position: &position.Position{ StartLine: 160, - EndLine: 160, - StartPos: 3630, - EndPos: 3649, + EndLine: 160, + StartPos: 3630, + EndPos: 3649, }, Uses: []node.Node{ &stmt.Use{ Position: &position.Position{ StartLine: 160, - EndLine: 160, - StartPos: 3634, - EndPos: 3636, + EndLine: 160, + StartPos: 3634, + EndPos: 3636, }, Use: &name.Name{ Position: &position.Position{ StartLine: 160, - EndLine: 160, - StartPos: 3634, - EndPos: 3636, + EndLine: 160, + StartPos: 3634, + EndPos: 3636, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 160, - EndLine: 160, - StartPos: 3634, - EndPos: 3636, + EndLine: 160, + StartPos: 3634, + EndPos: 3636, }, Value: "Foo", }, @@ -7702,24 +7626,24 @@ func TestPhp5(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 160, - EndLine: 160, - StartPos: 3639, - EndPos: 3648, + EndLine: 160, + StartPos: 3639, + EndPos: 3648, }, Use: &name.Name{ Position: &position.Position{ StartLine: 160, - EndLine: 160, - StartPos: 3639, - EndPos: 3641, + EndLine: 160, + StartPos: 3639, + EndPos: 3641, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 160, - EndLine: 160, - StartPos: 3639, - EndPos: 3641, + EndLine: 160, + StartPos: 3639, + EndPos: 3641, }, Value: "Bar", }, @@ -7728,9 +7652,9 @@ func TestPhp5(t *testing.T) { Alias: &node.Identifier{ Position: &position.Position{ StartLine: 160, - EndLine: 160, - StartPos: 3646, - EndPos: 3648, + EndLine: 160, + StartPos: 3646, + EndPos: 3648, }, Value: "Baz", }, @@ -7740,16 +7664,16 @@ func TestPhp5(t *testing.T) { &stmt.UseList{ Position: &position.Position{ StartLine: 161, - EndLine: 161, - StartPos: 3653, - EndPos: 3675, + EndLine: 161, + StartPos: 3653, + EndPos: 3675, }, UseType: &node.Identifier{ Position: &position.Position{ StartLine: 161, - EndLine: 161, - StartPos: 3657, - EndPos: 3664, + EndLine: 161, + StartPos: 3657, + EndPos: 3664, }, Value: "function", }, @@ -7757,24 +7681,24 @@ func TestPhp5(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 161, - EndLine: 161, - StartPos: 3666, - EndPos: 3668, + EndLine: 161, + StartPos: 3666, + EndPos: 3668, }, Use: &name.Name{ Position: &position.Position{ StartLine: 161, - EndLine: 161, - StartPos: 3666, - EndPos: 3668, + EndLine: 161, + StartPos: 3666, + EndPos: 3668, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 161, - EndLine: 161, - StartPos: 3666, - EndPos: 3668, + EndLine: 161, + StartPos: 3666, + EndPos: 3668, }, Value: "Foo", }, @@ -7784,24 +7708,24 @@ func TestPhp5(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 161, - EndLine: 161, - StartPos: 3672, - EndPos: 3674, + EndLine: 161, + StartPos: 3672, + EndPos: 3674, }, Use: &name.Name{ Position: &position.Position{ StartLine: 161, - EndLine: 161, - StartPos: 3672, - EndPos: 3674, + EndLine: 161, + StartPos: 3672, + EndPos: 3674, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 161, - EndLine: 161, - StartPos: 3672, - EndPos: 3674, + EndLine: 161, + StartPos: 3672, + EndPos: 3674, }, Value: "Bar", }, @@ -7813,16 +7737,16 @@ func TestPhp5(t *testing.T) { &stmt.UseList{ Position: &position.Position{ StartLine: 162, - EndLine: 162, - StartPos: 3679, - EndPos: 3715, + EndLine: 162, + StartPos: 3679, + EndPos: 3715, }, UseType: &node.Identifier{ Position: &position.Position{ StartLine: 162, - EndLine: 162, - StartPos: 3683, - EndPos: 3690, + EndLine: 162, + StartPos: 3683, + EndPos: 3690, }, Value: "function", }, @@ -7830,24 +7754,24 @@ func TestPhp5(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 162, - EndLine: 162, - StartPos: 3692, - EndPos: 3701, + EndLine: 162, + StartPos: 3692, + EndPos: 3701, }, Use: &name.Name{ Position: &position.Position{ StartLine: 162, - EndLine: 162, - StartPos: 3692, - EndPos: 3694, + EndLine: 162, + StartPos: 3692, + EndPos: 3694, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 162, - EndLine: 162, - StartPos: 3692, - EndPos: 3694, + EndLine: 162, + StartPos: 3692, + EndPos: 3694, }, Value: "Foo", }, @@ -7856,9 +7780,9 @@ func TestPhp5(t *testing.T) { Alias: &node.Identifier{ Position: &position.Position{ StartLine: 162, - EndLine: 162, - StartPos: 3699, - EndPos: 3701, + EndLine: 162, + StartPos: 3699, + EndPos: 3701, }, Value: "foo", }, @@ -7866,24 +7790,24 @@ func TestPhp5(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 162, - EndLine: 162, - StartPos: 3705, - EndPos: 3714, + EndLine: 162, + StartPos: 3705, + EndPos: 3714, }, Use: &name.Name{ Position: &position.Position{ StartLine: 162, - EndLine: 162, - StartPos: 3705, - EndPos: 3707, + EndLine: 162, + StartPos: 3705, + EndPos: 3707, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 162, - EndLine: 162, - StartPos: 3705, - EndPos: 3707, + EndLine: 162, + StartPos: 3705, + EndPos: 3707, }, Value: "Bar", }, @@ -7892,9 +7816,9 @@ func TestPhp5(t *testing.T) { Alias: &node.Identifier{ Position: &position.Position{ StartLine: 162, - EndLine: 162, - StartPos: 3712, - EndPos: 3714, + EndLine: 162, + StartPos: 3712, + EndPos: 3714, }, Value: "bar", }, @@ -7904,16 +7828,16 @@ func TestPhp5(t *testing.T) { &stmt.UseList{ Position: &position.Position{ StartLine: 163, - EndLine: 163, - StartPos: 3719, - EndPos: 3738, + EndLine: 163, + StartPos: 3719, + EndPos: 3738, }, UseType: &node.Identifier{ Position: &position.Position{ StartLine: 163, - EndLine: 163, - StartPos: 3723, - EndPos: 3727, + EndLine: 163, + StartPos: 3723, + EndPos: 3727, }, Value: "const", }, @@ -7921,24 +7845,24 @@ func TestPhp5(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 163, - EndLine: 163, - StartPos: 3729, - EndPos: 3731, + EndLine: 163, + StartPos: 3729, + EndPos: 3731, }, Use: &name.Name{ Position: &position.Position{ StartLine: 163, - EndLine: 163, - StartPos: 3729, - EndPos: 3731, + EndLine: 163, + StartPos: 3729, + EndPos: 3731, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 163, - EndLine: 163, - StartPos: 3729, - EndPos: 3731, + EndLine: 163, + StartPos: 3729, + EndPos: 3731, }, Value: "Foo", }, @@ -7948,24 +7872,24 @@ func TestPhp5(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 163, - EndLine: 163, - StartPos: 3735, - EndPos: 3737, + EndLine: 163, + StartPos: 3735, + EndPos: 3737, }, Use: &name.Name{ Position: &position.Position{ StartLine: 163, - EndLine: 163, - StartPos: 3735, - EndPos: 3737, + EndLine: 163, + StartPos: 3735, + EndPos: 3737, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 163, - EndLine: 163, - StartPos: 3735, - EndPos: 3737, + EndLine: 163, + StartPos: 3735, + EndPos: 3737, }, Value: "Bar", }, @@ -7977,16 +7901,16 @@ func TestPhp5(t *testing.T) { &stmt.UseList{ Position: &position.Position{ StartLine: 164, - EndLine: 164, - StartPos: 3742, - EndPos: 3775, + EndLine: 164, + StartPos: 3742, + EndPos: 3775, }, UseType: &node.Identifier{ Position: &position.Position{ StartLine: 164, - EndLine: 164, - StartPos: 3746, - EndPos: 3750, + EndLine: 164, + StartPos: 3746, + EndPos: 3750, }, Value: "const", }, @@ -7994,24 +7918,24 @@ func TestPhp5(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 164, - EndLine: 164, - StartPos: 3752, - EndPos: 3761, + EndLine: 164, + StartPos: 3752, + EndPos: 3761, }, Use: &name.Name{ Position: &position.Position{ StartLine: 164, - EndLine: 164, - StartPos: 3752, - EndPos: 3754, + EndLine: 164, + StartPos: 3752, + EndPos: 3754, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 164, - EndLine: 164, - StartPos: 3752, - EndPos: 3754, + EndLine: 164, + StartPos: 3752, + EndPos: 3754, }, Value: "Foo", }, @@ -8020,9 +7944,9 @@ func TestPhp5(t *testing.T) { Alias: &node.Identifier{ Position: &position.Position{ StartLine: 164, - EndLine: 164, - StartPos: 3759, - EndPos: 3761, + EndLine: 164, + StartPos: 3759, + EndPos: 3761, }, Value: "foo", }, @@ -8030,24 +7954,24 @@ func TestPhp5(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 164, - EndLine: 164, - StartPos: 3765, - EndPos: 3774, + EndLine: 164, + StartPos: 3765, + EndPos: 3774, }, Use: &name.Name{ Position: &position.Position{ StartLine: 164, - EndLine: 164, - StartPos: 3765, - EndPos: 3767, + EndLine: 164, + StartPos: 3765, + EndPos: 3767, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 164, - EndLine: 164, - StartPos: 3765, - EndPos: 3767, + EndLine: 164, + StartPos: 3765, + EndPos: 3767, }, Value: "Bar", }, @@ -8056,9 +7980,9 @@ func TestPhp5(t *testing.T) { Alias: &node.Identifier{ Position: &position.Position{ StartLine: 164, - EndLine: 164, - StartPos: 3772, - EndPos: 3774, + EndLine: 164, + StartPos: 3772, + EndPos: 3774, }, Value: "bar", }, @@ -8068,30 +7992,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 166, - EndLine: 166, - StartPos: 3780, - EndPos: 3785, + EndLine: 166, + StartPos: 3780, + EndPos: 3785, }, Expr: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 166, - EndLine: 166, - StartPos: 3780, - EndPos: 3784, + EndLine: 166, + StartPos: 3780, + EndPos: 3784, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 166, - EndLine: 166, - StartPos: 3780, - EndPos: 3781, + EndLine: 166, + StartPos: 3780, + EndPos: 3781, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 166, - EndLine: 166, - StartPos: 3780, - EndPos: 3781, + EndLine: 166, + StartPos: 3780, + EndPos: 3781, }, Value: "a", }, @@ -8099,9 +8023,9 @@ func TestPhp5(t *testing.T) { Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 166, - EndLine: 166, - StartPos: 3783, - EndPos: 3783, + EndLine: 166, + StartPos: 3783, + EndPos: 3783, }, Value: "1", }, @@ -8110,37 +8034,37 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 167, - EndLine: 167, - StartPos: 3789, - EndPos: 3797, + EndLine: 167, + StartPos: 3789, + EndPos: 3797, }, Expr: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 167, - EndLine: 167, - StartPos: 3789, - EndPos: 3796, + EndLine: 167, + StartPos: 3789, + EndPos: 3796, }, Variable: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 167, - EndLine: 167, - StartPos: 3789, - EndPos: 3793, + EndLine: 167, + StartPos: 3789, + EndPos: 3793, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 167, - EndLine: 167, - StartPos: 3789, - EndPos: 3790, + EndLine: 167, + StartPos: 3789, + EndPos: 3790, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 167, - EndLine: 167, - StartPos: 3789, - EndPos: 3790, + EndLine: 167, + StartPos: 3789, + EndPos: 3790, }, Value: "a", }, @@ -8148,9 +8072,9 @@ func TestPhp5(t *testing.T) { Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 167, - EndLine: 167, - StartPos: 3792, - EndPos: 3792, + EndLine: 167, + StartPos: 3792, + EndPos: 3792, }, Value: "1", }, @@ -8158,9 +8082,9 @@ func TestPhp5(t *testing.T) { Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 167, - EndLine: 167, - StartPos: 3795, - EndPos: 3795, + EndLine: 167, + StartPos: 3795, + EndPos: 3795, }, Value: "2", }, @@ -8169,49 +8093,48 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 168, - EndLine: 168, - StartPos: 3801, - EndPos: 3808, + EndLine: 168, + StartPos: 3801, + EndPos: 3808, }, Expr: &expr.Array{ Position: &position.Position{ StartLine: 168, - EndLine: 168, - StartPos: 3801, - EndPos: 3807, - }, - Items: []node.Node{ + EndLine: 168, + StartPos: 3801, + EndPos: 3807, }, + Items: []node.Node{}, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 169, - EndLine: 169, - StartPos: 3812, - EndPos: 3820, + EndLine: 169, + StartPos: 3812, + EndPos: 3820, }, Expr: &expr.Array{ Position: &position.Position{ StartLine: 169, - EndLine: 169, - StartPos: 3812, - EndPos: 3819, + EndLine: 169, + StartPos: 3812, + EndPos: 3819, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 169, - EndLine: 169, - StartPos: 3818, - EndPos: 3818, + EndLine: 169, + StartPos: 3818, + EndPos: 3818, }, Val: &scalar.Lnumber{ Position: &position.Position{ StartLine: 169, - EndLine: 169, - StartPos: 3818, - EndPos: 3818, + EndLine: 169, + StartPos: 3818, + EndPos: 3818, }, Value: "1", }, @@ -8222,40 +8145,40 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 170, - EndLine: 170, - StartPos: 3824, - EndPos: 3841, + EndLine: 170, + StartPos: 3824, + EndPos: 3841, }, Expr: &expr.Array{ Position: &position.Position{ StartLine: 170, - EndLine: 170, - StartPos: 3824, - EndPos: 3840, + EndLine: 170, + StartPos: 3824, + EndPos: 3840, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 170, - EndLine: 170, - StartPos: 3830, - EndPos: 3833, + EndLine: 170, + StartPos: 3830, + EndPos: 3833, }, Key: &scalar.Lnumber{ Position: &position.Position{ StartLine: 170, - EndLine: 170, - StartPos: 3830, - EndPos: 3830, + EndLine: 170, + StartPos: 3830, + EndPos: 3830, }, Value: "1", }, Val: &scalar.Lnumber{ Position: &position.Position{ StartLine: 170, - EndLine: 170, - StartPos: 3833, - EndPos: 3833, + EndLine: 170, + StartPos: 3833, + EndPos: 3833, }, Value: "1", }, @@ -8263,30 +8186,30 @@ func TestPhp5(t *testing.T) { &expr.ArrayItem{ Position: &position.Position{ StartLine: 170, - EndLine: 170, - StartPos: 3836, - EndPos: 3838, + EndLine: 170, + StartPos: 3836, + EndPos: 3838, }, Val: &expr.Reference{ Position: &position.Position{ StartLine: 170, - EndLine: 170, - StartPos: 3836, - EndPos: 3838, + EndLine: 170, + StartPos: 3836, + EndPos: 3838, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 170, - EndLine: 170, - StartPos: 3837, - EndPos: 3838, + EndLine: 170, + StartPos: 3837, + EndPos: 3838, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 170, - EndLine: 170, - StartPos: 3837, - EndPos: 3838, + EndLine: 170, + StartPos: 3837, + EndPos: 3838, }, Value: "b", }, @@ -8299,54 +8222,54 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 171, - EndLine: 171, - StartPos: 3845, - EndPos: 3859, + EndLine: 171, + StartPos: 3845, + EndPos: 3859, }, Expr: &expr.Array{ Position: &position.Position{ StartLine: 171, - EndLine: 171, - StartPos: 3845, - EndPos: 3858, + EndLine: 171, + StartPos: 3845, + EndPos: 3858, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 171, - EndLine: 171, - StartPos: 3851, - EndPos: 3857, + EndLine: 171, + StartPos: 3851, + EndPos: 3857, }, Key: &scalar.Lnumber{ Position: &position.Position{ StartLine: 171, - EndLine: 171, - StartPos: 3851, - EndPos: 3851, + EndLine: 171, + StartPos: 3851, + EndPos: 3851, }, Value: "3", }, Val: &expr.Reference{ Position: &position.Position{ StartLine: 171, - EndLine: 171, - StartPos: 3855, - EndPos: 3857, + EndLine: 171, + StartPos: 3855, + EndPos: 3857, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 171, - EndLine: 171, - StartPos: 3856, - EndPos: 3857, + EndLine: 171, + StartPos: 3856, + EndPos: 3857, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 171, - EndLine: 171, - StartPos: 3856, - EndPos: 3857, + EndLine: 171, + StartPos: 3856, + EndPos: 3857, }, Value: "b", }, @@ -8359,45 +8282,45 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 172, - EndLine: 172, - StartPos: 3863, - EndPos: 3891, + EndLine: 172, + StartPos: 3863, + EndPos: 3891, }, Expr: &expr.Array{ Position: &position.Position{ StartLine: 172, - EndLine: 172, - StartPos: 3863, - EndPos: 3890, + EndLine: 172, + StartPos: 3863, + EndPos: 3890, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 172, - EndLine: 172, - StartPos: 3869, - EndPos: 3871, + EndLine: 172, + StartPos: 3869, + EndPos: 3871, }, Val: &expr.Reference{ Position: &position.Position{ StartLine: 172, - EndLine: 172, - StartPos: 3869, - EndPos: 3871, + EndLine: 172, + StartPos: 3869, + EndPos: 3871, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 172, - EndLine: 172, - StartPos: 3870, - EndPos: 3871, + EndLine: 172, + StartPos: 3870, + EndPos: 3871, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 172, - EndLine: 172, - StartPos: 3870, - EndPos: 3871, + EndLine: 172, + StartPos: 3870, + EndPos: 3871, }, Value: "b", }, @@ -8407,25 +8330,25 @@ func TestPhp5(t *testing.T) { &expr.ArrayItem{ Position: &position.Position{ StartLine: 172, - EndLine: 172, - StartPos: 3874, - EndPos: 3877, + EndLine: 172, + StartPos: 3874, + EndPos: 3877, }, Key: &scalar.Lnumber{ Position: &position.Position{ StartLine: 172, - EndLine: 172, - StartPos: 3874, - EndPos: 3874, + EndLine: 172, + StartPos: 3874, + EndPos: 3874, }, Value: "1", }, Val: &scalar.Lnumber{ Position: &position.Position{ StartLine: 172, - EndLine: 172, - StartPos: 3877, - EndPos: 3877, + EndLine: 172, + StartPos: 3877, + EndPos: 3877, }, Value: "1", }, @@ -8433,16 +8356,16 @@ func TestPhp5(t *testing.T) { &expr.ArrayItem{ Position: &position.Position{ StartLine: 172, - EndLine: 172, - StartPos: 3880, - EndPos: 3880, + EndLine: 172, + StartPos: 3880, + EndPos: 3880, }, Val: &scalar.Lnumber{ Position: &position.Position{ StartLine: 172, - EndLine: 172, - StartPos: 3880, - EndPos: 3880, + EndLine: 172, + StartPos: 3880, + EndPos: 3880, }, Value: "1", }, @@ -8450,39 +8373,39 @@ func TestPhp5(t *testing.T) { &expr.ArrayItem{ Position: &position.Position{ StartLine: 172, - EndLine: 172, - StartPos: 3883, - EndPos: 3889, + EndLine: 172, + StartPos: 3883, + EndPos: 3889, }, Key: &scalar.Lnumber{ Position: &position.Position{ StartLine: 172, - EndLine: 172, - StartPos: 3883, - EndPos: 3883, + EndLine: 172, + StartPos: 3883, + EndPos: 3883, }, Value: "3", }, Val: &expr.Reference{ Position: &position.Position{ StartLine: 172, - EndLine: 172, - StartPos: 3887, - EndPos: 3889, + EndLine: 172, + StartPos: 3887, + EndPos: 3889, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 172, - EndLine: 172, - StartPos: 3888, - EndPos: 3889, + EndLine: 172, + StartPos: 3888, + EndPos: 3889, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 172, - EndLine: 172, - StartPos: 3888, - EndPos: 3889, + EndLine: 172, + StartPos: 3888, + EndPos: 3889, }, Value: "b", }, @@ -8495,30 +8418,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 173, - EndLine: 173, - StartPos: 3895, - EndPos: 3898, + EndLine: 173, + StartPos: 3895, + EndPos: 3898, }, Expr: &expr.BitwiseNot{ Position: &position.Position{ StartLine: 173, - EndLine: 173, - StartPos: 3895, - EndPos: 3897, + EndLine: 173, + StartPos: 3895, + EndPos: 3897, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 173, - EndLine: 173, - StartPos: 3896, - EndPos: 3897, + EndLine: 173, + StartPos: 3896, + EndPos: 3897, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 173, - EndLine: 173, - StartPos: 3896, - EndPos: 3897, + EndLine: 173, + StartPos: 3896, + EndPos: 3897, }, Value: "a", }, @@ -8528,30 +8451,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 174, - EndLine: 174, - StartPos: 3902, - EndPos: 3905, + EndLine: 174, + StartPos: 3902, + EndPos: 3905, }, Expr: &expr.BooleanNot{ Position: &position.Position{ StartLine: 174, - EndLine: 174, - StartPos: 3902, - EndPos: 3904, + EndLine: 174, + StartPos: 3902, + EndPos: 3904, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 174, - EndLine: 174, - StartPos: 3903, - EndPos: 3904, + EndLine: 174, + StartPos: 3903, + EndPos: 3904, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 174, - EndLine: 174, - StartPos: 3903, - EndPos: 3904, + EndLine: 174, + StartPos: 3903, + EndPos: 3904, }, Value: "a", }, @@ -8561,31 +8484,31 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 176, - EndLine: 176, - StartPos: 3910, - EndPos: 3918, + EndLine: 176, + StartPos: 3910, + EndPos: 3918, }, Expr: &expr.ClassConstFetch{ Position: &position.Position{ StartLine: 176, - EndLine: 176, - StartPos: 3910, - EndPos: 3917, + EndLine: 176, + StartPos: 3910, + EndPos: 3917, }, Class: &name.Name{ Position: &position.Position{ StartLine: 176, - EndLine: 176, - StartPos: 3910, - EndPos: 3912, + EndLine: 176, + StartPos: 3910, + EndPos: 3912, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 176, - EndLine: 176, - StartPos: 3910, - EndPos: 3912, + EndLine: 176, + StartPos: 3910, + EndPos: 3912, }, Value: "Foo", }, @@ -8594,9 +8517,9 @@ func TestPhp5(t *testing.T) { ConstantName: &node.Identifier{ Position: &position.Position{ StartLine: 176, - EndLine: 176, - StartPos: 3915, - EndPos: 3917, + EndLine: 176, + StartPos: 3915, + EndPos: 3917, }, Value: "Bar", }, @@ -8605,30 +8528,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 177, - EndLine: 177, - StartPos: 3922, - EndPos: 3931, + EndLine: 177, + StartPos: 3922, + EndPos: 3931, }, Expr: &expr.Clone{ Position: &position.Position{ StartLine: 177, - EndLine: 177, - StartPos: 3922, - EndPos: 3929, + EndLine: 177, + StartPos: 3922, + EndPos: 3929, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 177, - EndLine: 177, - StartPos: 3928, - EndPos: 3929, + EndLine: 177, + StartPos: 3928, + EndPos: 3929, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 177, - EndLine: 177, - StartPos: 3928, - EndPos: 3929, + EndLine: 177, + StartPos: 3928, + EndPos: 3929, }, Value: "a", }, @@ -8638,30 +8561,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 178, - EndLine: 178, - StartPos: 3935, - EndPos: 3943, + EndLine: 178, + StartPos: 3935, + EndPos: 3943, }, Expr: &expr.Clone{ Position: &position.Position{ StartLine: 178, - EndLine: 178, - StartPos: 3935, - EndPos: 3942, + EndLine: 178, + StartPos: 3935, + EndPos: 3942, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 178, - EndLine: 178, - StartPos: 3941, - EndPos: 3942, + EndLine: 178, + StartPos: 3941, + EndPos: 3942, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 178, - EndLine: 178, - StartPos: 3941, - EndPos: 3942, + EndLine: 178, + StartPos: 3941, + EndPos: 3942, }, Value: "a", }, @@ -8671,64 +8594,63 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 179, - EndLine: 179, - StartPos: 3947, - EndPos: 3959, + EndLine: 179, + StartPos: 3947, + EndPos: 3959, }, Expr: &expr.Closure{ Position: &position.Position{ StartLine: 179, - EndLine: 179, - StartPos: 3947, - EndPos: 3958, + EndLine: 179, + StartPos: 3947, + EndPos: 3958, }, - ReturnsRef: false, - Static: false, + ReturnsRef: false, + Static: false, PhpDocComment: "", - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 180, - EndLine: 180, - StartPos: 3963, - EndPos: 3996, + EndLine: 180, + StartPos: 3963, + EndPos: 3996, }, Expr: &expr.Closure{ Position: &position.Position{ StartLine: 180, - EndLine: 180, - StartPos: 3963, - EndPos: 3995, + EndLine: 180, + StartPos: 3963, + EndPos: 3995, }, + ReturnsRef: false, + Static: false, PhpDocComment: "", - ReturnsRef: false, - Static: false, Params: []node.Node{ &node.Parameter{ Position: &position.Position{ StartLine: 180, - EndLine: 180, - StartPos: 3972, - EndPos: 3973, + EndLine: 180, + StartPos: 3972, + EndPos: 3973, }, - ByRef: false, + ByRef: false, Variadic: false, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 180, - EndLine: 180, - StartPos: 3972, - EndPos: 3973, + EndLine: 180, + StartPos: 3972, + EndPos: 3973, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 180, - EndLine: 180, - StartPos: 3972, - EndPos: 3973, + EndLine: 180, + StartPos: 3972, + EndPos: 3973, }, Value: "a", }, @@ -8737,25 +8659,25 @@ func TestPhp5(t *testing.T) { &node.Parameter{ Position: &position.Position{ StartLine: 180, - EndLine: 180, - StartPos: 3976, - EndPos: 3977, + EndLine: 180, + StartPos: 3976, + EndPos: 3977, }, - ByRef: false, + ByRef: false, Variadic: false, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 180, - EndLine: 180, - StartPos: 3976, - EndPos: 3977, + EndLine: 180, + StartPos: 3976, + EndPos: 3977, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 180, - EndLine: 180, - StartPos: 3976, - EndPos: 3977, + EndLine: 180, + StartPos: 3976, + EndPos: 3977, }, Value: "b", }, @@ -8765,24 +8687,24 @@ func TestPhp5(t *testing.T) { ClosureUse: &expr.ClosureUse{ Position: &position.Position{ StartLine: 180, - EndLine: 180, - StartPos: 3980, - EndPos: 3992, + EndLine: 180, + StartPos: 3980, + EndPos: 3992, }, Uses: []node.Node{ &expr.Variable{ Position: &position.Position{ StartLine: 180, - EndLine: 180, - StartPos: 3985, - EndPos: 3986, + EndLine: 180, + StartPos: 3985, + EndPos: 3986, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 180, - EndLine: 180, - StartPos: 3985, - EndPos: 3986, + EndLine: 180, + StartPos: 3985, + EndPos: 3986, }, Value: "c", }, @@ -8790,23 +8712,23 @@ func TestPhp5(t *testing.T) { &expr.Reference{ Position: &position.Position{ StartLine: 180, - EndLine: 180, - StartPos: 3989, - EndPos: 3991, + EndLine: 180, + StartPos: 3989, + EndPos: 3991, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 180, - EndLine: 180, - StartPos: 3990, - EndPos: 3991, + EndLine: 180, + StartPos: 3990, + EndPos: 3991, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 180, - EndLine: 180, - StartPos: 3990, - EndPos: 3991, + EndLine: 180, + StartPos: 3990, + EndPos: 3991, }, Value: "d", }, @@ -8814,50 +8736,49 @@ func TestPhp5(t *testing.T) { }, }, }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 181, - EndLine: 181, - StartPos: 4000, - EndPos: 4033, + EndLine: 181, + StartPos: 4000, + EndPos: 4033, }, Expr: &expr.Closure{ Position: &position.Position{ StartLine: 181, - EndLine: 181, - StartPos: 4000, - EndPos: 4032, + EndLine: 181, + StartPos: 4000, + EndPos: 4032, }, - ReturnsRef: false, - Static: false, + ReturnsRef: false, + Static: false, PhpDocComment: "", Params: []node.Node{ &node.Parameter{ Position: &position.Position{ StartLine: 181, - EndLine: 181, - StartPos: 4009, - EndPos: 4010, + EndLine: 181, + StartPos: 4009, + EndPos: 4010, }, - ByRef: false, + ByRef: false, Variadic: false, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 181, - EndLine: 181, - StartPos: 4009, - EndPos: 4010, + EndLine: 181, + StartPos: 4009, + EndPos: 4010, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 181, - EndLine: 181, - StartPos: 4009, - EndPos: 4010, + EndLine: 181, + StartPos: 4009, + EndPos: 4010, }, Value: "a", }, @@ -8866,25 +8787,25 @@ func TestPhp5(t *testing.T) { &node.Parameter{ Position: &position.Position{ StartLine: 181, - EndLine: 181, - StartPos: 4013, - EndPos: 4014, + EndLine: 181, + StartPos: 4013, + EndPos: 4014, }, + ByRef: false, Variadic: false, - ByRef: false, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 181, - EndLine: 181, - StartPos: 4013, - EndPos: 4014, + EndLine: 181, + StartPos: 4013, + EndPos: 4014, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 181, - EndLine: 181, - StartPos: 4013, - EndPos: 4014, + EndLine: 181, + StartPos: 4013, + EndPos: 4014, }, Value: "b", }, @@ -8894,31 +8815,31 @@ func TestPhp5(t *testing.T) { ClosureUse: &expr.ClosureUse{ Position: &position.Position{ StartLine: 181, - EndLine: 181, - StartPos: 4017, - EndPos: 4029, + EndLine: 181, + StartPos: 4017, + EndPos: 4029, }, Uses: []node.Node{ &expr.Reference{ Position: &position.Position{ StartLine: 181, - EndLine: 181, - StartPos: 4022, - EndPos: 4024, + EndLine: 181, + StartPos: 4022, + EndPos: 4024, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 181, - EndLine: 181, - StartPos: 4023, - EndPos: 4024, + EndLine: 181, + StartPos: 4023, + EndPos: 4024, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 181, - EndLine: 181, - StartPos: 4023, - EndPos: 4024, + EndLine: 181, + StartPos: 4023, + EndPos: 4024, }, Value: "c", }, @@ -8927,75 +8848,73 @@ func TestPhp5(t *testing.T) { &expr.Variable{ Position: &position.Position{ StartLine: 181, - EndLine: 181, - StartPos: 4027, - EndPos: 4028, + EndLine: 181, + StartPos: 4027, + EndPos: 4028, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 181, - EndLine: 181, - StartPos: 4027, - EndPos: 4028, + EndLine: 181, + StartPos: 4027, + EndPos: 4028, }, Value: "d", }, }, }, }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 182, - EndLine: 182, - StartPos: 4037, - EndPos: 4050, + EndLine: 182, + StartPos: 4037, + EndPos: 4050, }, Expr: &expr.Closure{ Position: &position.Position{ StartLine: 182, - EndLine: 182, - StartPos: 4037, - EndPos: 4049, + EndLine: 182, + StartPos: 4037, + EndPos: 4049, }, - ReturnsRef: false, - Static: false, + ReturnsRef: false, + Static: false, PhpDocComment: "", - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 183, - EndLine: 183, - StartPos: 4054, - EndPos: 4057, + EndLine: 183, + StartPos: 4054, + EndPos: 4057, }, Expr: &expr.ConstFetch{ Position: &position.Position{ StartLine: 183, - EndLine: 183, - StartPos: 4054, - EndPos: 4056, + EndLine: 183, + StartPos: 4054, + EndPos: 4056, }, Constant: &name.Name{ Position: &position.Position{ StartLine: 183, - EndLine: 183, - StartPos: 4054, - EndPos: 4056, + EndLine: 183, + StartPos: 4054, + EndPos: 4056, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 183, - EndLine: 183, - StartPos: 4054, - EndPos: 4056, + EndLine: 183, + StartPos: 4054, + EndPos: 4056, }, Value: "foo", }, @@ -9006,31 +8925,31 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 184, - EndLine: 184, - StartPos: 4061, - EndPos: 4074, + EndLine: 184, + StartPos: 4061, + EndPos: 4074, }, Expr: &expr.ConstFetch{ Position: &position.Position{ StartLine: 184, - EndLine: 184, - StartPos: 4061, - EndPos: 4073, + EndLine: 184, + StartPos: 4061, + EndPos: 4073, }, Constant: &name.Relative{ Position: &position.Position{ StartLine: 184, - EndLine: 184, - StartPos: 4061, - EndPos: 4073, + EndLine: 184, + StartPos: 4061, + EndPos: 4073, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 184, - EndLine: 184, - StartPos: 4071, - EndPos: 4073, + EndLine: 184, + StartPos: 4071, + EndPos: 4073, }, Value: "foo", }, @@ -9041,31 +8960,31 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 185, - EndLine: 185, - StartPos: 4078, - EndPos: 4082, + EndLine: 185, + StartPos: 4078, + EndPos: 4082, }, Expr: &expr.ConstFetch{ Position: &position.Position{ StartLine: 185, - EndLine: 185, - StartPos: 4078, - EndPos: 4081, + EndLine: 185, + StartPos: 4078, + EndPos: 4081, }, Constant: &name.FullyQualified{ Position: &position.Position{ StartLine: 185, - EndLine: 185, - StartPos: 4078, - EndPos: 4081, + EndLine: 185, + StartPos: 4078, + EndPos: 4081, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 185, - EndLine: 185, - StartPos: 4079, - EndPos: 4081, + EndLine: 185, + StartPos: 4079, + EndPos: 4081, }, Value: "foo", }, @@ -9076,30 +8995,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 187, - EndLine: 187, - StartPos: 4087, - EndPos: 4096, + EndLine: 187, + StartPos: 4087, + EndPos: 4096, }, Expr: &expr.Empty{ Position: &position.Position{ StartLine: 187, - EndLine: 187, - StartPos: 4087, - EndPos: 4095, + EndLine: 187, + StartPos: 4087, + EndPos: 4095, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 187, - EndLine: 187, - StartPos: 4093, - EndPos: 4094, + EndLine: 187, + StartPos: 4093, + EndPos: 4094, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 187, - EndLine: 187, - StartPos: 4093, - EndPos: 4094, + EndLine: 187, + StartPos: 4093, + EndPos: 4094, }, Value: "a", }, @@ -9109,38 +9028,38 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 188, - EndLine: 188, - StartPos: 4100, - EndPos: 4110, + EndLine: 188, + StartPos: 4100, + EndPos: 4110, }, Expr: &expr.Empty{ Position: &position.Position{ StartLine: 188, - EndLine: 188, - StartPos: 4100, - EndPos: 4109, + EndLine: 188, + StartPos: 4100, + EndPos: 4109, }, Expr: &expr.ConstFetch{ Position: &position.Position{ StartLine: 188, - EndLine: 188, - StartPos: 4106, - EndPos: 4108, + EndLine: 188, + StartPos: 4106, + EndPos: 4108, }, Constant: &name.Name{ Position: &position.Position{ StartLine: 188, - EndLine: 188, - StartPos: 4106, - EndPos: 4108, + EndLine: 188, + StartPos: 4106, + EndPos: 4108, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 188, - EndLine: 188, - StartPos: 4106, - EndPos: 4108, + EndLine: 188, + StartPos: 4106, + EndPos: 4108, }, Value: "Foo", }, @@ -9152,30 +9071,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 189, - EndLine: 189, - StartPos: 4114, - EndPos: 4117, + EndLine: 189, + StartPos: 4114, + EndPos: 4117, }, Expr: &expr.ErrorSuppress{ Position: &position.Position{ StartLine: 189, - EndLine: 189, - StartPos: 4114, - EndPos: 4116, + EndLine: 189, + StartPos: 4114, + EndPos: 4116, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 189, - EndLine: 189, - StartPos: 4115, - EndPos: 4116, + EndLine: 189, + StartPos: 4115, + EndPos: 4116, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 189, - EndLine: 189, - StartPos: 4115, - EndPos: 4116, + EndLine: 189, + StartPos: 4115, + EndPos: 4116, }, Value: "a", }, @@ -9185,30 +9104,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 190, - EndLine: 190, - StartPos: 4121, - EndPos: 4129, + EndLine: 190, + StartPos: 4121, + EndPos: 4129, }, Expr: &expr.Eval{ Position: &position.Position{ StartLine: 190, - EndLine: 190, - StartPos: 4121, - EndPos: 4128, + EndLine: 190, + StartPos: 4121, + EndPos: 4128, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 190, - EndLine: 190, - StartPos: 4126, - EndPos: 4127, + EndLine: 190, + StartPos: 4126, + EndPos: 4127, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 190, - EndLine: 190, - StartPos: 4126, - EndPos: 4127, + EndLine: 190, + StartPos: 4126, + EndPos: 4127, }, Value: "a", }, @@ -9218,46 +9137,46 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 191, - EndLine: 191, - StartPos: 4133, - EndPos: 4137, + EndLine: 191, + StartPos: 4133, + EndPos: 4137, }, Expr: &expr.Exit{ Position: &position.Position{ StartLine: 191, - EndLine: 191, - StartPos: 4133, - EndPos: 4136, + EndLine: 191, + StartPos: 4133, + EndPos: 4136, }, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 192, - EndLine: 192, - StartPos: 4141, - EndPos: 4149, + EndLine: 192, + StartPos: 4141, + EndPos: 4149, }, Expr: &expr.Exit{ Position: &position.Position{ StartLine: 192, - EndLine: 192, - StartPos: 4141, - EndPos: 4147, + EndLine: 192, + StartPos: 4141, + EndPos: 4148, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 192, - EndLine: 192, - StartPos: 4146, - EndPos: 4147, + EndLine: 192, + StartPos: 4146, + EndPos: 4147, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 192, - EndLine: 192, - StartPos: 4146, - EndPos: 4147, + EndLine: 192, + StartPos: 4146, + EndPos: 4147, }, Value: "a", }, @@ -9267,46 +9186,46 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 193, - EndLine: 193, - StartPos: 4153, - EndPos: 4158, + EndLine: 193, + StartPos: 4153, + EndPos: 4158, }, Expr: &expr.Die{ Position: &position.Position{ StartLine: 193, - EndLine: 193, - StartPos: 4153, - EndPos: 4157, + EndLine: 193, + StartPos: 4153, + EndPos: 4157, }, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 194, - EndLine: 194, - StartPos: 4162, - EndPos: 4169, + EndLine: 194, + StartPos: 4162, + EndPos: 4169, }, Expr: &expr.Die{ Position: &position.Position{ StartLine: 194, - EndLine: 194, - StartPos: 4162, - EndPos: 4167, + EndLine: 194, + StartPos: 4162, + EndPos: 4168, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 194, - EndLine: 194, - StartPos: 4166, - EndPos: 4167, + EndLine: 194, + StartPos: 4166, + EndPos: 4167, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 194, - EndLine: 194, - StartPos: 4166, - EndPos: 4167, + EndLine: 194, + StartPos: 4166, + EndPos: 4167, }, Value: "a", }, @@ -9316,31 +9235,31 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 195, - EndLine: 195, - StartPos: 4173, - EndPos: 4178, + EndLine: 195, + StartPos: 4173, + EndPos: 4178, }, Expr: &expr.FunctionCall{ Position: &position.Position{ StartLine: 195, - EndLine: 195, - StartPos: 4173, - EndPos: 4177, + EndLine: 195, + StartPos: 4173, + EndPos: 4177, }, Function: &name.Name{ Position: &position.Position{ StartLine: 195, - EndLine: 195, - StartPos: 4173, - EndPos: 4175, + EndLine: 195, + StartPos: 4173, + EndPos: 4175, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 195, - EndLine: 195, - StartPos: 4173, - EndPos: 4175, + EndLine: 195, + StartPos: 4173, + EndPos: 4175, }, Value: "foo", }, @@ -9349,9 +9268,9 @@ func TestPhp5(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 195, - EndLine: 195, - StartPos: 4176, - EndPos: 4177, + EndLine: 195, + StartPos: 4176, + EndPos: 4177, }, }, }, @@ -9359,31 +9278,31 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 196, - EndLine: 196, - StartPos: 4182, - EndPos: 4200, + EndLine: 196, + StartPos: 4182, + EndPos: 4200, }, Expr: &expr.FunctionCall{ Position: &position.Position{ StartLine: 196, - EndLine: 196, - StartPos: 4182, - EndPos: 4199, + EndLine: 196, + StartPos: 4182, + EndPos: 4199, }, Function: &name.Relative{ Position: &position.Position{ StartLine: 196, - EndLine: 196, - StartPos: 4182, - EndPos: 4194, + EndLine: 196, + StartPos: 4182, + EndPos: 4194, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 196, - EndLine: 196, - StartPos: 4192, - EndPos: 4194, + EndLine: 196, + StartPos: 4192, + EndPos: 4194, }, Value: "foo", }, @@ -9392,33 +9311,33 @@ func TestPhp5(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 196, - EndLine: 196, - StartPos: 4195, - EndPos: 4199, + EndLine: 196, + StartPos: 4195, + EndPos: 4199, }, Arguments: []node.Node{ &node.Argument{ Position: &position.Position{ StartLine: 196, - EndLine: 196, - StartPos: 4197, - EndPos: 4198, + EndLine: 196, + StartPos: 4197, + EndPos: 4198, }, - Variadic: false, + Variadic: false, IsReference: true, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 196, - EndLine: 196, - StartPos: 4197, - EndPos: 4198, + EndLine: 196, + StartPos: 4197, + EndPos: 4198, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 196, - EndLine: 196, - StartPos: 4197, - EndPos: 4198, + EndLine: 196, + StartPos: 4197, + EndPos: 4198, }, Value: "a", }, @@ -9431,31 +9350,31 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 197, - EndLine: 197, - StartPos: 4204, - EndPos: 4212, + EndLine: 197, + StartPos: 4204, + EndPos: 4212, }, Expr: &expr.FunctionCall{ Position: &position.Position{ StartLine: 197, - EndLine: 197, - StartPos: 4204, - EndPos: 4211, + EndLine: 197, + StartPos: 4204, + EndPos: 4211, }, Function: &name.FullyQualified{ Position: &position.Position{ StartLine: 197, - EndLine: 197, - StartPos: 4204, - EndPos: 4207, + EndLine: 197, + StartPos: 4204, + EndPos: 4207, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 197, - EndLine: 197, - StartPos: 4205, - EndPos: 4207, + EndLine: 197, + StartPos: 4205, + EndPos: 4207, }, Value: "foo", }, @@ -9464,29 +9383,28 @@ func TestPhp5(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 197, - EndLine: 197, - StartPos: 4208, - EndPos: 4211, + EndLine: 197, + StartPos: 4208, + EndPos: 4211, }, Arguments: []node.Node{ &node.Argument{ Position: &position.Position{ StartLine: 197, - EndLine: 197, - StartPos: 4209, - EndPos: 4210, + EndLine: 197, + StartPos: 4209, + EndPos: 4210, }, - Variadic: false, + Variadic: false, IsReference: false, Expr: &expr.ShortArray{ Position: &position.Position{ StartLine: 197, - EndLine: 197, - StartPos: 4209, - EndPos: 4210, - }, - Items: []node.Node{ + EndLine: 197, + StartPos: 4209, + EndPos: 4210, }, + Items: []node.Node{}, }, }, }, @@ -9496,30 +9414,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 198, - EndLine: 198, - StartPos: 4216, - EndPos: 4230, + EndLine: 198, + StartPos: 4216, + EndPos: 4230, }, Expr: &expr.FunctionCall{ Position: &position.Position{ StartLine: 198, - EndLine: 198, - StartPos: 4216, - EndPos: 4229, + EndLine: 198, + StartPos: 4216, + EndPos: 4229, }, Function: &expr.Variable{ Position: &position.Position{ StartLine: 198, - EndLine: 198, - StartPos: 4216, - EndPos: 4219, + EndLine: 198, + StartPos: 4216, + EndPos: 4219, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 198, - EndLine: 198, - StartPos: 4216, - EndPos: 4219, + EndLine: 198, + StartPos: 4216, + EndPos: 4219, }, Value: "foo", }, @@ -9527,40 +9445,40 @@ func TestPhp5(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 198, - EndLine: 198, - StartPos: 4220, - EndPos: 4229, + EndLine: 198, + StartPos: 4220, + EndPos: 4229, }, Arguments: []node.Node{ &node.Argument{ Position: &position.Position{ StartLine: 198, - EndLine: 198, - StartPos: 4221, - EndPos: 4228, + EndLine: 198, + StartPos: 4221, + EndPos: 4228, }, + Variadic: false, IsReference: false, - Variadic: false, Expr: &expr.Yield{ Position: &position.Position{ StartLine: 198, - EndLine: 198, - StartPos: 4221, - EndPos: 4228, + EndLine: 198, + StartPos: 4221, + EndPos: 4228, }, Value: &expr.Variable{ Position: &position.Position{ StartLine: 198, - EndLine: 198, - StartPos: 4227, - EndPos: 4228, + EndLine: 198, + StartPos: 4227, + EndPos: 4228, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 198, - EndLine: 198, - StartPos: 4227, - EndPos: 4228, + EndLine: 198, + StartPos: 4227, + EndPos: 4228, }, Value: "a", }, @@ -9574,30 +9492,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 200, - EndLine: 200, - StartPos: 4235, - EndPos: 4239, + EndLine: 200, + StartPos: 4235, + EndPos: 4239, }, Expr: &expr.PostDec{ Position: &position.Position{ StartLine: 200, - EndLine: 200, - StartPos: 4235, - EndPos: 4238, + EndLine: 200, + StartPos: 4235, + EndPos: 4238, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 200, - EndLine: 200, - StartPos: 4235, - EndPos: 4236, + EndLine: 200, + StartPos: 4235, + EndPos: 4236, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 200, - EndLine: 200, - StartPos: 4235, - EndPos: 4236, + EndLine: 200, + StartPos: 4235, + EndPos: 4236, }, Value: "a", }, @@ -9607,30 +9525,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 201, - EndLine: 201, - StartPos: 4243, - EndPos: 4247, + EndLine: 201, + StartPos: 4243, + EndPos: 4247, }, Expr: &expr.PostInc{ Position: &position.Position{ StartLine: 201, - EndLine: 201, - StartPos: 4243, - EndPos: 4246, + EndLine: 201, + StartPos: 4243, + EndPos: 4246, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 201, - EndLine: 201, - StartPos: 4243, - EndPos: 4244, + EndLine: 201, + StartPos: 4243, + EndPos: 4244, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 201, - EndLine: 201, - StartPos: 4243, - EndPos: 4244, + EndLine: 201, + StartPos: 4243, + EndPos: 4244, }, Value: "a", }, @@ -9640,30 +9558,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 202, - EndLine: 202, - StartPos: 4251, - EndPos: 4255, + EndLine: 202, + StartPos: 4251, + EndPos: 4255, }, Expr: &expr.PreDec{ Position: &position.Position{ StartLine: 202, - EndLine: 202, - StartPos: 4251, - EndPos: 4254, + EndLine: 202, + StartPos: 4251, + EndPos: 4254, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 202, - EndLine: 202, - StartPos: 4253, - EndPos: 4254, + EndLine: 202, + StartPos: 4253, + EndPos: 4254, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 202, - EndLine: 202, - StartPos: 4253, - EndPos: 4254, + EndLine: 202, + StartPos: 4253, + EndPos: 4254, }, Value: "a", }, @@ -9673,30 +9591,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 203, - EndLine: 203, - StartPos: 4259, - EndPos: 4263, + EndLine: 203, + StartPos: 4259, + EndPos: 4263, }, Expr: &expr.PreInc{ Position: &position.Position{ StartLine: 203, - EndLine: 203, - StartPos: 4259, - EndPos: 4262, + EndLine: 203, + StartPos: 4259, + EndPos: 4262, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 203, - EndLine: 203, - StartPos: 4261, - EndPos: 4262, + EndLine: 203, + StartPos: 4261, + EndPos: 4262, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 203, - EndLine: 203, - StartPos: 4261, - EndPos: 4262, + EndLine: 203, + StartPos: 4261, + EndPos: 4262, }, Value: "a", }, @@ -9706,30 +9624,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 205, - EndLine: 205, - StartPos: 4268, - EndPos: 4278, + EndLine: 205, + StartPos: 4268, + EndPos: 4278, }, Expr: &expr.Include{ Position: &position.Position{ StartLine: 205, - EndLine: 205, - StartPos: 4268, - EndPos: 4277, + EndLine: 205, + StartPos: 4268, + EndPos: 4277, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 205, - EndLine: 205, - StartPos: 4276, - EndPos: 4277, + EndLine: 205, + StartPos: 4276, + EndPos: 4277, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 205, - EndLine: 205, - StartPos: 4276, - EndPos: 4277, + EndLine: 205, + StartPos: 4276, + EndPos: 4277, }, Value: "a", }, @@ -9739,30 +9657,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 206, - EndLine: 206, - StartPos: 4282, - EndPos: 4297, + EndLine: 206, + StartPos: 4282, + EndPos: 4297, }, Expr: &expr.IncludeOnce{ Position: &position.Position{ StartLine: 206, - EndLine: 206, - StartPos: 4282, - EndPos: 4296, + EndLine: 206, + StartPos: 4282, + EndPos: 4296, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 206, - EndLine: 206, - StartPos: 4295, - EndPos: 4296, + EndLine: 206, + StartPos: 4295, + EndPos: 4296, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 206, - EndLine: 206, - StartPos: 4295, - EndPos: 4296, + EndLine: 206, + StartPos: 4295, + EndPos: 4296, }, Value: "a", }, @@ -9772,30 +9690,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 207, - EndLine: 207, - StartPos: 4301, - EndPos: 4311, + EndLine: 207, + StartPos: 4301, + EndPos: 4311, }, Expr: &expr.Require{ Position: &position.Position{ StartLine: 207, - EndLine: 207, - StartPos: 4301, - EndPos: 4310, + EndLine: 207, + StartPos: 4301, + EndPos: 4310, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 207, - EndLine: 207, - StartPos: 4309, - EndPos: 4310, + EndLine: 207, + StartPos: 4309, + EndPos: 4310, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 207, - EndLine: 207, - StartPos: 4309, - EndPos: 4310, + EndLine: 207, + StartPos: 4309, + EndPos: 4310, }, Value: "a", }, @@ -9805,30 +9723,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 208, - EndLine: 208, - StartPos: 4315, - EndPos: 4330, + EndLine: 208, + StartPos: 4315, + EndPos: 4330, }, Expr: &expr.RequireOnce{ Position: &position.Position{ StartLine: 208, - EndLine: 208, - StartPos: 4315, - EndPos: 4329, + EndLine: 208, + StartPos: 4315, + EndPos: 4329, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 208, - EndLine: 208, - StartPos: 4328, - EndPos: 4329, + EndLine: 208, + StartPos: 4328, + EndPos: 4329, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 208, - EndLine: 208, - StartPos: 4328, - EndPos: 4329, + EndLine: 208, + StartPos: 4328, + EndPos: 4329, }, Value: "a", }, @@ -9838,30 +9756,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 210, - EndLine: 210, - StartPos: 4335, - EndPos: 4352, + EndLine: 210, + StartPos: 4335, + EndPos: 4352, }, Expr: &expr.InstanceOf{ Position: &position.Position{ StartLine: 210, - EndLine: 210, - StartPos: 4335, - EndPos: 4351, + EndLine: 210, + StartPos: 4335, + EndPos: 4351, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 210, - EndLine: 210, - StartPos: 4335, - EndPos: 4336, + EndLine: 210, + StartPos: 4335, + EndPos: 4336, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 210, - EndLine: 210, - StartPos: 4335, - EndPos: 4336, + EndLine: 210, + StartPos: 4335, + EndPos: 4336, }, Value: "a", }, @@ -9869,17 +9787,17 @@ func TestPhp5(t *testing.T) { Class: &name.Name{ Position: &position.Position{ StartLine: 210, - EndLine: 210, - StartPos: 4349, - EndPos: 4351, + EndLine: 210, + StartPos: 4349, + EndPos: 4351, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 210, - EndLine: 210, - StartPos: 4349, - EndPos: 4351, + EndLine: 210, + StartPos: 4349, + EndPos: 4351, }, Value: "Foo", }, @@ -9890,30 +9808,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 211, - EndLine: 211, - StartPos: 4356, - EndPos: 4383, + EndLine: 211, + StartPos: 4356, + EndPos: 4383, }, Expr: &expr.InstanceOf{ Position: &position.Position{ StartLine: 211, - EndLine: 211, - StartPos: 4356, - EndPos: 4382, + EndLine: 211, + StartPos: 4356, + EndPos: 4382, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 211, - EndLine: 211, - StartPos: 4356, - EndPos: 4357, + EndLine: 211, + StartPos: 4356, + EndPos: 4357, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 211, - EndLine: 211, - StartPos: 4356, - EndPos: 4357, + EndLine: 211, + StartPos: 4356, + EndPos: 4357, }, Value: "a", }, @@ -9921,17 +9839,17 @@ func TestPhp5(t *testing.T) { Class: &name.Relative{ Position: &position.Position{ StartLine: 211, - EndLine: 211, - StartPos: 4370, - EndPos: 4382, + EndLine: 211, + StartPos: 4370, + EndPos: 4382, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 211, - EndLine: 211, - StartPos: 4380, - EndPos: 4382, + EndLine: 211, + StartPos: 4380, + EndPos: 4382, }, Value: "Foo", }, @@ -9942,30 +9860,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 212, - EndLine: 212, - StartPos: 4387, - EndPos: 4405, + EndLine: 212, + StartPos: 4387, + EndPos: 4405, }, Expr: &expr.InstanceOf{ Position: &position.Position{ StartLine: 212, - EndLine: 212, - StartPos: 4387, - EndPos: 4404, + EndLine: 212, + StartPos: 4387, + EndPos: 4404, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 212, - EndLine: 212, - StartPos: 4387, - EndPos: 4388, + EndLine: 212, + StartPos: 4387, + EndPos: 4388, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 212, - EndLine: 212, - StartPos: 4387, - EndPos: 4388, + EndLine: 212, + StartPos: 4387, + EndPos: 4388, }, Value: "a", }, @@ -9973,17 +9891,17 @@ func TestPhp5(t *testing.T) { Class: &name.FullyQualified{ Position: &position.Position{ StartLine: 212, - EndLine: 212, - StartPos: 4401, - EndPos: 4404, + EndLine: 212, + StartPos: 4401, + EndPos: 4404, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 212, - EndLine: 212, - StartPos: 4402, - EndPos: 4404, + EndLine: 212, + StartPos: 4402, + EndPos: 4404, }, Value: "Foo", }, @@ -9994,31 +9912,31 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 214, - EndLine: 214, - StartPos: 4410, - EndPos: 4423, + EndLine: 214, + StartPos: 4410, + EndPos: 4423, }, Expr: &expr.Isset{ Position: &position.Position{ StartLine: 214, - EndLine: 214, - StartPos: 4410, - EndPos: 4422, + EndLine: 214, + StartPos: 4410, + EndPos: 4422, }, Variables: []node.Node{ &expr.Variable{ Position: &position.Position{ StartLine: 214, - EndLine: 214, - StartPos: 4416, - EndPos: 4417, + EndLine: 214, + StartPos: 4416, + EndPos: 4417, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 214, - EndLine: 214, - StartPos: 4416, - EndPos: 4417, + EndLine: 214, + StartPos: 4416, + EndPos: 4417, }, Value: "a", }, @@ -10026,16 +9944,16 @@ func TestPhp5(t *testing.T) { &expr.Variable{ Position: &position.Position{ StartLine: 214, - EndLine: 214, - StartPos: 4420, - EndPos: 4421, + EndLine: 214, + StartPos: 4420, + EndPos: 4421, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 214, - EndLine: 214, - StartPos: 4420, - EndPos: 4421, + EndLine: 214, + StartPos: 4420, + EndPos: 4421, }, Value: "b", }, @@ -10046,39 +9964,39 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 215, - EndLine: 215, - StartPos: 4427, - EndPos: 4437, + EndLine: 215, + StartPos: 4427, + EndPos: 4437, }, Expr: &expr.Isset{ Position: &position.Position{ StartLine: 215, - EndLine: 215, - StartPos: 4427, - EndPos: 4436, + EndLine: 215, + StartPos: 4427, + EndPos: 4436, }, Variables: []node.Node{ &expr.ConstFetch{ Position: &position.Position{ StartLine: 215, - EndLine: 215, - StartPos: 4433, - EndPos: 4435, + EndLine: 215, + StartPos: 4433, + EndPos: 4435, }, Constant: &name.Name{ Position: &position.Position{ StartLine: 215, - EndLine: 215, - StartPos: 4433, - EndPos: 4435, + EndLine: 215, + StartPos: 4433, + EndPos: 4435, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 215, - EndLine: 215, - StartPos: 4433, - EndPos: 4435, + EndLine: 215, + StartPos: 4433, + EndPos: 4435, }, Value: "Foo", }, @@ -10091,40 +10009,39 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 216, - EndLine: 216, - StartPos: 4441, - EndPos: 4452, + EndLine: 216, + StartPos: 4441, + EndPos: 4452, }, Expr: &assign.Assign{ Position: &position.Position{ StartLine: 216, - EndLine: 216, - StartPos: 4441, - EndPos: 4451, + EndLine: 216, + StartPos: 4441, + EndPos: 4451, }, Variable: &expr.List{ Position: &position.Position{ StartLine: 216, - EndLine: 216, - StartPos: 4441, - EndPos: 4446, - }, - Items: []node.Node{ + EndLine: 216, + StartPos: 4441, + EndPos: 4446, }, + Items: []node.Node{}, }, Expression: &expr.Variable{ Position: &position.Position{ StartLine: 216, - EndLine: 216, - StartPos: 4450, - EndPos: 4451, + EndLine: 216, + StartPos: 4450, + EndPos: 4451, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 216, - EndLine: 216, - StartPos: 4450, - EndPos: 4451, + EndLine: 216, + StartPos: 4450, + EndPos: 4451, }, Value: "b", }, @@ -10134,45 +10051,45 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 217, - EndLine: 217, - StartPos: 4456, - EndPos: 4473, + EndLine: 217, + StartPos: 4456, + EndPos: 4473, }, Expr: &assign.Assign{ Position: &position.Position{ StartLine: 217, - EndLine: 217, - StartPos: 4456, - EndPos: 4472, + EndLine: 217, + StartPos: 4456, + EndPos: 4472, }, Variable: &expr.List{ Position: &position.Position{ StartLine: 217, - EndLine: 217, - StartPos: 4456, - EndPos: 4467, + EndLine: 217, + StartPos: 4456, + EndPos: 4467, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 217, - EndLine: 217, - StartPos: 4461, - EndPos: 4462, + EndLine: 217, + StartPos: 4461, + EndPos: 4462, }, Val: &expr.Variable{ Position: &position.Position{ StartLine: 217, - EndLine: 217, - StartPos: 4461, - EndPos: 4462, + EndLine: 217, + StartPos: 4461, + EndPos: 4462, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 217, - EndLine: 217, - StartPos: 4461, - EndPos: 4462, + EndLine: 217, + StartPos: 4461, + EndPos: 4462, }, Value: "a", }, @@ -10181,23 +10098,23 @@ func TestPhp5(t *testing.T) { &expr.ArrayItem{ Position: &position.Position{ StartLine: 217, - EndLine: 217, - StartPos: 4465, - EndPos: 4466, + EndLine: 217, + StartPos: 4465, + EndPos: 4466, }, Val: &expr.Variable{ Position: &position.Position{ StartLine: 217, - EndLine: 217, - StartPos: 4465, - EndPos: 4466, + EndLine: 217, + StartPos: 4465, + EndPos: 4466, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 217, - EndLine: 217, - StartPos: 4465, - EndPos: 4466, + EndLine: 217, + StartPos: 4465, + EndPos: 4466, }, Value: "b", }, @@ -10208,16 +10125,16 @@ func TestPhp5(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 217, - EndLine: 217, - StartPos: 4471, - EndPos: 4472, + EndLine: 217, + StartPos: 4471, + EndPos: 4472, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 217, - EndLine: 217, - StartPos: 4471, - EndPos: 4472, + EndLine: 217, + StartPos: 4471, + EndPos: 4472, }, Value: "b", }, @@ -10227,52 +10144,52 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 218, - EndLine: 218, - StartPos: 4477, - EndPos: 4492, + EndLine: 218, + StartPos: 4477, + EndPos: 4492, }, Expr: &assign.Assign{ Position: &position.Position{ StartLine: 218, - EndLine: 218, - StartPos: 4477, - EndPos: 4491, + EndLine: 218, + StartPos: 4477, + EndPos: 4491, }, Variable: &expr.List{ Position: &position.Position{ StartLine: 218, - EndLine: 218, - StartPos: 4477, - EndPos: 4486, + EndLine: 218, + StartPos: 4477, + EndPos: 4486, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 218, - EndLine: 218, - StartPos: 4482, - EndPos: 4485, + EndLine: 218, + StartPos: 4482, + EndPos: 4485, }, Val: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 218, - EndLine: 218, - StartPos: 4482, - EndPos: 4485, + EndLine: 218, + StartPos: 4482, + EndPos: 4485, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 218, - EndLine: 218, - StartPos: 4482, - EndPos: 4483, + EndLine: 218, + StartPos: 4482, + EndPos: 4483, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 218, - EndLine: 218, - StartPos: 4482, - EndPos: 4483, + EndLine: 218, + StartPos: 4482, + EndPos: 4483, }, Value: "a", }, @@ -10284,16 +10201,16 @@ func TestPhp5(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 218, - EndLine: 218, - StartPos: 4490, - EndPos: 4491, + EndLine: 218, + StartPos: 4490, + EndPos: 4491, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 218, - EndLine: 218, - StartPos: 4490, - EndPos: 4491, + EndLine: 218, + StartPos: 4490, + EndPos: 4491, }, Value: "b", }, @@ -10303,60 +10220,60 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 219, - EndLine: 219, - StartPos: 4496, - EndPos: 4515, + EndLine: 219, + StartPos: 4496, + EndPos: 4515, }, Expr: &assign.Assign{ Position: &position.Position{ StartLine: 219, - EndLine: 219, - StartPos: 4496, - EndPos: 4514, + EndLine: 219, + StartPos: 4496, + EndPos: 4514, }, Variable: &expr.List{ Position: &position.Position{ StartLine: 219, - EndLine: 219, - StartPos: 4496, - EndPos: 4509, + EndLine: 219, + StartPos: 4496, + EndPos: 4509, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 219, - EndLine: 219, - StartPos: 4501, - EndPos: 4508, + EndLine: 219, + StartPos: 4501, + EndPos: 4508, }, Val: &expr.List{ Position: &position.Position{ StartLine: 219, - EndLine: 219, - StartPos: 4501, - EndPos: 4508, + EndLine: 219, + StartPos: 4501, + EndPos: 4508, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 219, - EndLine: 219, - StartPos: 4506, - EndPos: 4507, + EndLine: 219, + StartPos: 4506, + EndPos: 4507, }, Val: &expr.Variable{ Position: &position.Position{ StartLine: 219, - EndLine: 219, - StartPos: 4506, - EndPos: 4507, + EndLine: 219, + StartPos: 4506, + EndPos: 4507, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 219, - EndLine: 219, - StartPos: 4506, - EndPos: 4507, + EndLine: 219, + StartPos: 4506, + EndPos: 4507, }, Value: "a", }, @@ -10370,16 +10287,16 @@ func TestPhp5(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 219, - EndLine: 219, - StartPos: 4513, - EndPos: 4514, + EndLine: 219, + StartPos: 4513, + EndPos: 4514, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 219, - EndLine: 219, - StartPos: 4513, - EndPos: 4514, + EndLine: 219, + StartPos: 4513, + EndPos: 4514, }, Value: "b", }, @@ -10389,30 +10306,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 221, - EndLine: 221, - StartPos: 4520, - EndPos: 4529, + EndLine: 221, + StartPos: 4520, + EndPos: 4529, }, Expr: &expr.MethodCall{ Position: &position.Position{ StartLine: 221, - EndLine: 221, - StartPos: 4520, - EndPos: 4528, + EndLine: 221, + StartPos: 4520, + EndPos: 4528, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 221, - EndLine: 221, - StartPos: 4520, - EndPos: 4521, + EndLine: 221, + StartPos: 4520, + EndPos: 4521, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 221, - EndLine: 221, - StartPos: 4520, - EndPos: 4521, + EndLine: 221, + StartPos: 4520, + EndPos: 4521, }, Value: "a", }, @@ -10420,18 +10337,18 @@ func TestPhp5(t *testing.T) { Method: &node.Identifier{ Position: &position.Position{ StartLine: 221, - EndLine: 221, - StartPos: 4524, - EndPos: 4526, + EndLine: 221, + StartPos: 4524, + EndPos: 4526, }, Value: "foo", }, ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 221, - EndLine: 221, - StartPos: 4527, - EndPos: 4528, + EndLine: 221, + StartPos: 4527, + EndPos: 4528, }, }, }, @@ -10439,31 +10356,31 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 222, - EndLine: 222, - StartPos: 4533, - EndPos: 4540, + EndLine: 222, + StartPos: 4533, + EndPos: 4540, }, Expr: &expr.New{ Position: &position.Position{ StartLine: 222, - EndLine: 222, - StartPos: 4533, - EndPos: 4539, + EndLine: 222, + StartPos: 4533, + EndPos: 4539, }, Class: &name.Name{ Position: &position.Position{ StartLine: 222, - EndLine: 222, - StartPos: 4537, - EndPos: 4539, + EndLine: 222, + StartPos: 4537, + EndPos: 4539, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 222, - EndLine: 222, - StartPos: 4537, - EndPos: 4539, + EndLine: 222, + StartPos: 4537, + EndPos: 4539, }, Value: "Foo", }, @@ -10474,31 +10391,31 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 223, - EndLine: 223, - StartPos: 4544, - EndPos: 4563, + EndLine: 223, + StartPos: 4544, + EndPos: 4563, }, Expr: &expr.New{ Position: &position.Position{ StartLine: 223, - EndLine: 223, - StartPos: 4544, - EndPos: 4562, + EndLine: 223, + StartPos: 4544, + EndPos: 4562, }, Class: &name.Relative{ Position: &position.Position{ StartLine: 223, - EndLine: 223, - StartPos: 4548, - EndPos: 4560, + EndLine: 223, + StartPos: 4548, + EndPos: 4560, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 223, - EndLine: 223, - StartPos: 4558, - EndPos: 4560, + EndLine: 223, + StartPos: 4558, + EndPos: 4560, }, Value: "Foo", }, @@ -10507,9 +10424,9 @@ func TestPhp5(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 223, - EndLine: 223, - StartPos: 4561, - EndPos: 4562, + EndLine: 223, + StartPos: 4561, + EndPos: 4562, }, }, }, @@ -10517,31 +10434,31 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 224, - EndLine: 224, - StartPos: 4567, - EndPos: 4577, + EndLine: 224, + StartPos: 4567, + EndPos: 4577, }, Expr: &expr.New{ Position: &position.Position{ StartLine: 224, - EndLine: 224, - StartPos: 4567, - EndPos: 4576, + EndLine: 224, + StartPos: 4567, + EndPos: 4576, }, Class: &name.FullyQualified{ Position: &position.Position{ StartLine: 224, - EndLine: 224, - StartPos: 4571, - EndPos: 4574, + EndLine: 224, + StartPos: 4571, + EndPos: 4574, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 224, - EndLine: 224, - StartPos: 4572, - EndPos: 4574, + EndLine: 224, + StartPos: 4572, + EndPos: 4574, }, Value: "Foo", }, @@ -10550,9 +10467,9 @@ func TestPhp5(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 224, - EndLine: 224, - StartPos: 4575, - EndPos: 4576, + EndLine: 224, + StartPos: 4575, + EndPos: 4576, }, }, }, @@ -10560,30 +10477,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 225, - EndLine: 225, - StartPos: 4581, - EndPos: 4590, + EndLine: 225, + StartPos: 4581, + EndPos: 4590, }, Expr: &expr.Print{ Position: &position.Position{ StartLine: 225, - EndLine: 225, - StartPos: 4581, - EndPos: 4588, + EndLine: 225, + StartPos: 4581, + EndPos: 4588, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 225, - EndLine: 225, - StartPos: 4587, - EndPos: 4588, + EndLine: 225, + StartPos: 4587, + EndPos: 4588, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 225, - EndLine: 225, - StartPos: 4587, - EndPos: 4588, + EndLine: 225, + StartPos: 4587, + EndPos: 4588, }, Value: "a", }, @@ -10593,30 +10510,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 226, - EndLine: 226, - StartPos: 4594, - EndPos: 4601, + EndLine: 226, + StartPos: 4594, + EndPos: 4601, }, Expr: &expr.PropertyFetch{ Position: &position.Position{ StartLine: 226, - EndLine: 226, - StartPos: 4594, - EndPos: 4600, + EndLine: 226, + StartPos: 4594, + EndPos: 4600, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 226, - EndLine: 226, - StartPos: 4594, - EndPos: 4595, + EndLine: 226, + StartPos: 4594, + EndPos: 4595, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 226, - EndLine: 226, - StartPos: 4594, - EndPos: 4595, + EndLine: 226, + StartPos: 4594, + EndPos: 4595, }, Value: "a", }, @@ -10624,9 +10541,9 @@ func TestPhp5(t *testing.T) { Property: &node.Identifier{ Position: &position.Position{ StartLine: 226, - EndLine: 226, - StartPos: 4598, - EndPos: 4600, + EndLine: 226, + StartPos: 4598, + EndPos: 4600, }, Value: "foo", }, @@ -10635,37 +10552,37 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 227, - EndLine: 227, - StartPos: 4605, - EndPos: 4615, + EndLine: 227, + StartPos: 4605, + EndPos: 4615, }, Expr: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 227, - EndLine: 227, - StartPos: 4605, - EndPos: 4613, + EndLine: 227, + StartPos: 4605, + EndPos: 4613, }, Variable: &expr.PropertyFetch{ Position: &position.Position{ StartLine: 227, - EndLine: 227, - StartPos: 4605, - EndPos: 4611, + EndLine: 227, + StartPos: 4605, + EndPos: 4611, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 227, - EndLine: 227, - StartPos: 4605, - EndPos: 4606, + EndLine: 227, + StartPos: 4605, + EndPos: 4606, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 227, - EndLine: 227, - StartPos: 4605, - EndPos: 4606, + EndLine: 227, + StartPos: 4605, + EndPos: 4606, }, Value: "a", }, @@ -10673,9 +10590,9 @@ func TestPhp5(t *testing.T) { Property: &node.Identifier{ Position: &position.Position{ StartLine: 227, - EndLine: 227, - StartPos: 4609, - EndPos: 4611, + EndLine: 227, + StartPos: 4609, + EndPos: 4611, }, Value: "foo", }, @@ -10683,9 +10600,9 @@ func TestPhp5(t *testing.T) { Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 227, - EndLine: 227, - StartPos: 4613, - EndPos: 4613, + EndLine: 227, + StartPos: 4613, + EndPos: 4613, }, Value: "1", }, @@ -10694,58 +10611,58 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 228, - EndLine: 228, - StartPos: 4619, - EndPos: 4647, + EndLine: 228, + StartPos: 4619, + EndPos: 4647, }, Expr: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 228, - EndLine: 228, - StartPos: 4619, - EndPos: 4645, + EndLine: 228, + StartPos: 4619, + EndPos: 4645, }, Variable: &expr.PropertyFetch{ Position: &position.Position{ StartLine: 228, - EndLine: 228, - StartPos: 4619, - EndPos: 4643, + EndLine: 228, + StartPos: 4619, + EndPos: 4643, }, Variable: &expr.MethodCall{ Position: &position.Position{ StartLine: 228, - EndLine: 228, - StartPos: 4619, - EndPos: 4637, + EndLine: 228, + StartPos: 4619, + EndPos: 4637, }, Variable: &expr.PropertyFetch{ Position: &position.Position{ StartLine: 228, - EndLine: 228, - StartPos: 4619, - EndPos: 4630, + EndLine: 228, + StartPos: 4619, + EndPos: 4630, }, Variable: &expr.PropertyFetch{ Position: &position.Position{ StartLine: 228, - EndLine: 228, - StartPos: 4619, - EndPos: 4625, + EndLine: 228, + StartPos: 4619, + EndPos: 4625, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 228, - EndLine: 228, - StartPos: 4619, - EndPos: 4620, + EndLine: 228, + StartPos: 4619, + EndPos: 4620, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 228, - EndLine: 228, - StartPos: 4619, - EndPos: 4620, + EndLine: 228, + StartPos: 4619, + EndPos: 4620, }, Value: "a", }, @@ -10753,9 +10670,9 @@ func TestPhp5(t *testing.T) { Property: &node.Identifier{ Position: &position.Position{ StartLine: 228, - EndLine: 228, - StartPos: 4623, - EndPos: 4625, + EndLine: 228, + StartPos: 4623, + EndPos: 4625, }, Value: "foo", }, @@ -10763,9 +10680,9 @@ func TestPhp5(t *testing.T) { Property: &node.Identifier{ Position: &position.Position{ StartLine: 228, - EndLine: 228, - StartPos: 4628, - EndPos: 4630, + EndLine: 228, + StartPos: 4628, + EndPos: 4630, }, Value: "bar", }, @@ -10773,27 +10690,27 @@ func TestPhp5(t *testing.T) { Method: &node.Identifier{ Position: &position.Position{ StartLine: 228, - EndLine: 228, - StartPos: 4633, - EndPos: 4635, + EndLine: 228, + StartPos: 4633, + EndPos: 4635, }, Value: "baz", }, ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 228, - EndLine: 228, - StartPos: 4636, - EndPos: 4637, + EndLine: 228, + StartPos: 4636, + EndPos: 4637, }, }, }, Property: &node.Identifier{ Position: &position.Position{ StartLine: 228, - EndLine: 228, - StartPos: 4640, - EndPos: 4643, + EndLine: 228, + StartPos: 4640, + EndPos: 4643, }, Value: "quux", }, @@ -10801,9 +10718,9 @@ func TestPhp5(t *testing.T) { Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 228, - EndLine: 228, - StartPos: 4645, - EndPos: 4645, + EndLine: 228, + StartPos: 4645, + EndPos: 4645, }, Value: "0", }, @@ -10812,44 +10729,44 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 229, - EndLine: 229, - StartPos: 4651, - EndPos: 4666, + EndLine: 229, + StartPos: 4651, + EndPos: 4666, }, Expr: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 229, - EndLine: 229, - StartPos: 4651, - EndPos: 4664, + EndLine: 229, + StartPos: 4651, + EndPos: 4664, }, Variable: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 229, - EndLine: 229, - StartPos: 4651, - EndPos: 4661, + EndLine: 229, + StartPos: 4651, + EndPos: 4661, }, Variable: &expr.MethodCall{ Position: &position.Position{ StartLine: 229, - EndLine: 229, - StartPos: 4651, - EndPos: 4659, + EndLine: 229, + StartPos: 4651, + EndPos: 4659, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 229, - EndLine: 229, - StartPos: 4651, - EndPos: 4652, + EndLine: 229, + StartPos: 4651, + EndPos: 4652, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 229, - EndLine: 229, - StartPos: 4651, - EndPos: 4652, + EndLine: 229, + StartPos: 4651, + EndPos: 4652, }, Value: "a", }, @@ -10857,27 +10774,27 @@ func TestPhp5(t *testing.T) { Method: &node.Identifier{ Position: &position.Position{ StartLine: 229, - EndLine: 229, - StartPos: 4655, - EndPos: 4657, + EndLine: 229, + StartPos: 4655, + EndPos: 4657, }, Value: "foo", }, ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 229, - EndLine: 229, - StartPos: 4658, - EndPos: 4659, + EndLine: 229, + StartPos: 4658, + EndPos: 4659, }, }, }, Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 229, - EndLine: 229, - StartPos: 4661, - EndPos: 4661, + EndLine: 229, + StartPos: 4661, + EndPos: 4661, }, Value: "1", }, @@ -10885,9 +10802,9 @@ func TestPhp5(t *testing.T) { Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 229, - EndLine: 229, - StartPos: 4664, - EndPos: 4664, + EndLine: 229, + StartPos: 4664, + EndPos: 4664, }, Value: "1", }, @@ -10896,40 +10813,40 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 230, - EndLine: 230, - StartPos: 4670, - EndPos: 4678, + EndLine: 230, + StartPos: 4670, + EndPos: 4678, }, Expr: &expr.ShellExec{ Position: &position.Position{ StartLine: 230, - EndLine: 230, - StartPos: 4670, - EndPos: 4677, + EndLine: 230, + StartPos: 4670, + EndPos: 4677, }, Parts: []node.Node{ &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 230, - EndLine: 230, - StartPos: 4671, - EndPos: 4674, + EndLine: 230, + StartPos: 4671, + EndPos: 4674, }, Value: "cmd ", }, &expr.Variable{ Position: &position.Position{ StartLine: 230, - EndLine: 230, - StartPos: 4675, - EndPos: 4676, + EndLine: 230, + StartPos: 4675, + EndPos: 4676, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 230, - EndLine: 230, - StartPos: 4675, - EndPos: 4676, + EndLine: 230, + StartPos: 4675, + EndPos: 4676, }, Value: "a", }, @@ -10940,16 +10857,16 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 231, - EndLine: 231, - StartPos: 4682, - EndPos: 4687, + EndLine: 231, + StartPos: 4682, + EndPos: 4687, }, Expr: &expr.ShellExec{ Position: &position.Position{ StartLine: 231, - EndLine: 231, - StartPos: 4682, - EndPos: 4686, + EndLine: 231, + StartPos: 4682, + EndPos: 4686, }, Parts: []node.Node{ &scalar.EncapsedStringPart{ @@ -10961,67 +10878,65 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 232, - EndLine: 232, - StartPos: 4691, - EndPos: 4693, + EndLine: 232, + StartPos: 4691, + EndPos: 4693, }, Expr: &expr.ShellExec{ Position: &position.Position{ StartLine: 232, - EndLine: 232, - StartPos: 4691, - EndPos: 4692, - }, - Parts: []node.Node{ + EndLine: 232, + StartPos: 4691, + EndPos: 4692, }, + Parts: []node.Node{}, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 233, - EndLine: 233, - StartPos: 4697, - EndPos: 4699, + EndLine: 233, + StartPos: 4697, + EndPos: 4699, }, Expr: &expr.ShortArray{ Position: &position.Position{ StartLine: 233, - EndLine: 233, - StartPos: 4697, - EndPos: 4698, - }, - Items: []node.Node{ + EndLine: 233, + StartPos: 4697, + EndPos: 4698, }, + Items: []node.Node{}, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 234, - EndLine: 234, - StartPos: 4703, - EndPos: 4706, + EndLine: 234, + StartPos: 4703, + EndPos: 4706, }, Expr: &expr.ShortArray{ Position: &position.Position{ StartLine: 234, - EndLine: 234, - StartPos: 4703, - EndPos: 4705, + EndLine: 234, + StartPos: 4703, + EndPos: 4705, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 234, - EndLine: 234, - StartPos: 4704, - EndPos: 4704, + EndLine: 234, + StartPos: 4704, + EndPos: 4704, }, Val: &scalar.Lnumber{ Position: &position.Position{ StartLine: 234, - EndLine: 234, - StartPos: 4704, - EndPos: 4704, + EndLine: 234, + StartPos: 4704, + EndPos: 4704, }, Value: "1", }, @@ -11032,40 +10947,40 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 235, - EndLine: 235, - StartPos: 4710, - EndPos: 4722, + EndLine: 235, + StartPos: 4710, + EndPos: 4722, }, Expr: &expr.ShortArray{ Position: &position.Position{ StartLine: 235, - EndLine: 235, - StartPos: 4710, - EndPos: 4721, + EndLine: 235, + StartPos: 4710, + EndPos: 4721, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 235, - EndLine: 235, - StartPos: 4711, - EndPos: 4714, + EndLine: 235, + StartPos: 4711, + EndPos: 4714, }, Key: &scalar.Lnumber{ Position: &position.Position{ StartLine: 235, - EndLine: 235, - StartPos: 4711, - EndPos: 4711, + EndLine: 235, + StartPos: 4711, + EndPos: 4711, }, Value: "1", }, Val: &scalar.Lnumber{ Position: &position.Position{ StartLine: 235, - EndLine: 235, - StartPos: 4714, - EndPos: 4714, + EndLine: 235, + StartPos: 4714, + EndPos: 4714, }, Value: "1", }, @@ -11073,30 +10988,30 @@ func TestPhp5(t *testing.T) { &expr.ArrayItem{ Position: &position.Position{ StartLine: 235, - EndLine: 235, - StartPos: 4717, - EndPos: 4719, + EndLine: 235, + StartPos: 4717, + EndPos: 4719, }, Val: &expr.Reference{ Position: &position.Position{ StartLine: 235, - EndLine: 235, - StartPos: 4717, - EndPos: 4719, + EndLine: 235, + StartPos: 4717, + EndPos: 4719, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 235, - EndLine: 235, - StartPos: 4718, - EndPos: 4719, + EndLine: 235, + StartPos: 4718, + EndPos: 4719, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 235, - EndLine: 235, - StartPos: 4718, - EndPos: 4719, + EndLine: 235, + StartPos: 4718, + EndPos: 4719, }, Value: "b", }, @@ -11109,31 +11024,31 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 237, - EndLine: 237, - StartPos: 4727, - EndPos: 4737, + EndLine: 237, + StartPos: 4727, + EndPos: 4737, }, Expr: &expr.StaticCall{ Position: &position.Position{ StartLine: 237, - EndLine: 237, - StartPos: 4727, - EndPos: 4736, + EndLine: 237, + StartPos: 4727, + EndPos: 4736, }, Class: &name.Name{ Position: &position.Position{ StartLine: 237, - EndLine: 237, - StartPos: 4727, - EndPos: 4729, + EndLine: 237, + StartPos: 4727, + EndPos: 4729, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 237, - EndLine: 237, - StartPos: 4727, - EndPos: 4729, + EndLine: 237, + StartPos: 4727, + EndPos: 4729, }, Value: "Foo", }, @@ -11142,18 +11057,18 @@ func TestPhp5(t *testing.T) { Call: &node.Identifier{ Position: &position.Position{ StartLine: 237, - EndLine: 237, - StartPos: 4732, - EndPos: 4734, + EndLine: 237, + StartPos: 4732, + EndPos: 4734, }, Value: "bar", }, ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 237, - EndLine: 237, - StartPos: 4735, - EndPos: 4736, + EndLine: 237, + StartPos: 4735, + EndPos: 4736, }, }, }, @@ -11161,31 +11076,31 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 238, - EndLine: 238, - StartPos: 4741, - EndPos: 4761, + EndLine: 238, + StartPos: 4741, + EndPos: 4761, }, Expr: &expr.StaticCall{ Position: &position.Position{ StartLine: 238, - EndLine: 238, - StartPos: 4741, - EndPos: 4760, + EndLine: 238, + StartPos: 4741, + EndPos: 4760, }, Class: &name.Relative{ Position: &position.Position{ StartLine: 238, - EndLine: 238, - StartPos: 4741, - EndPos: 4753, + EndLine: 238, + StartPos: 4741, + EndPos: 4753, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 238, - EndLine: 238, - StartPos: 4751, - EndPos: 4753, + EndLine: 238, + StartPos: 4751, + EndPos: 4753, }, Value: "Foo", }, @@ -11194,18 +11109,18 @@ func TestPhp5(t *testing.T) { Call: &node.Identifier{ Position: &position.Position{ StartLine: 238, - EndLine: 238, - StartPos: 4756, - EndPos: 4758, + EndLine: 238, + StartPos: 4756, + EndPos: 4758, }, Value: "bar", }, ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 238, - EndLine: 238, - StartPos: 4759, - EndPos: 4760, + EndLine: 238, + StartPos: 4759, + EndPos: 4760, }, }, }, @@ -11213,31 +11128,31 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 239, - EndLine: 239, - StartPos: 4765, - EndPos: 4776, + EndLine: 239, + StartPos: 4765, + EndPos: 4776, }, Expr: &expr.StaticCall{ Position: &position.Position{ StartLine: 239, - EndLine: 239, - StartPos: 4765, - EndPos: 4775, + EndLine: 239, + StartPos: 4765, + EndPos: 4775, }, Class: &name.FullyQualified{ Position: &position.Position{ StartLine: 239, - EndLine: 239, - StartPos: 4765, - EndPos: 4768, + EndLine: 239, + StartPos: 4765, + EndPos: 4768, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 239, - EndLine: 239, - StartPos: 4766, - EndPos: 4768, + EndLine: 239, + StartPos: 4766, + EndPos: 4768, }, Value: "Foo", }, @@ -11246,18 +11161,18 @@ func TestPhp5(t *testing.T) { Call: &node.Identifier{ Position: &position.Position{ StartLine: 239, - EndLine: 239, - StartPos: 4771, - EndPos: 4773, + EndLine: 239, + StartPos: 4771, + EndPos: 4773, }, Value: "bar", }, ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 239, - EndLine: 239, - StartPos: 4774, - EndPos: 4775, + EndLine: 239, + StartPos: 4774, + EndPos: 4775, }, }, }, @@ -11265,31 +11180,31 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 240, - EndLine: 240, - StartPos: 4780, - EndPos: 4791, + EndLine: 240, + StartPos: 4780, + EndPos: 4791, }, Expr: &expr.StaticCall{ Position: &position.Position{ StartLine: 240, - EndLine: 240, - StartPos: 4780, - EndPos: 4790, + EndLine: 240, + StartPos: 4780, + EndPos: 4790, }, Class: &name.Name{ Position: &position.Position{ StartLine: 240, - EndLine: 240, - StartPos: 4780, - EndPos: 4782, + EndLine: 240, + StartPos: 4780, + EndPos: 4782, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 240, - EndLine: 240, - StartPos: 4780, - EndPos: 4782, + EndLine: 240, + StartPos: 4780, + EndPos: 4782, }, Value: "Foo", }, @@ -11298,16 +11213,16 @@ func TestPhp5(t *testing.T) { Call: &expr.Variable{ Position: &position.Position{ StartLine: 240, - EndLine: 240, - StartPos: 4785, - EndPos: 4788, + EndLine: 240, + StartPos: 4785, + EndPos: 4788, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 240, - EndLine: 240, - StartPos: 4785, - EndPos: 4788, + EndLine: 240, + StartPos: 4785, + EndPos: 4788, }, Value: "bar", }, @@ -11315,9 +11230,9 @@ func TestPhp5(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 240, - EndLine: 240, - StartPos: 4789, - EndPos: 4790, + EndLine: 240, + StartPos: 4789, + EndPos: 4790, }, }, }, @@ -11325,30 +11240,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 241, - EndLine: 241, - StartPos: 4795, - EndPos: 4807, + EndLine: 241, + StartPos: 4795, + EndPos: 4807, }, Expr: &expr.StaticCall{ Position: &position.Position{ StartLine: 241, - EndLine: 241, - StartPos: 4795, - EndPos: 4806, + EndLine: 241, + StartPos: 4795, + EndPos: 4806, }, Class: &expr.Variable{ Position: &position.Position{ StartLine: 241, - EndLine: 241, - StartPos: 4795, - EndPos: 4798, + EndLine: 241, + StartPos: 4795, + EndPos: 4798, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 241, - EndLine: 241, - StartPos: 4795, - EndPos: 4798, + EndLine: 241, + StartPos: 4795, + EndPos: 4798, }, Value: "foo", }, @@ -11356,16 +11271,16 @@ func TestPhp5(t *testing.T) { Call: &expr.Variable{ Position: &position.Position{ StartLine: 241, - EndLine: 241, - StartPos: 4801, - EndPos: 4804, + EndLine: 241, + StartPos: 4801, + EndPos: 4804, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 241, - EndLine: 241, - StartPos: 4801, - EndPos: 4804, + EndLine: 241, + StartPos: 4801, + EndPos: 4804, }, Value: "bar", }, @@ -11373,9 +11288,9 @@ func TestPhp5(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 241, - EndLine: 241, - StartPos: 4805, - EndPos: 4806, + EndLine: 241, + StartPos: 4805, + EndPos: 4806, }, }, }, @@ -11383,31 +11298,31 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 242, - EndLine: 242, - StartPos: 4811, - EndPos: 4820, + EndLine: 242, + StartPos: 4811, + EndPos: 4820, }, Expr: &expr.StaticPropertyFetch{ Position: &position.Position{ StartLine: 242, - EndLine: 242, - StartPos: 4811, - EndPos: 4819, + EndLine: 242, + StartPos: 4811, + EndPos: 4819, }, Class: &name.Name{ Position: &position.Position{ StartLine: 242, - EndLine: 242, - StartPos: 4811, - EndPos: 4813, + EndLine: 242, + StartPos: 4811, + EndPos: 4813, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 242, - EndLine: 242, - StartPos: 4811, - EndPos: 4813, + EndLine: 242, + StartPos: 4811, + EndPos: 4813, }, Value: "Foo", }, @@ -11416,16 +11331,16 @@ func TestPhp5(t *testing.T) { Property: &expr.Variable{ Position: &position.Position{ StartLine: 242, - EndLine: 242, - StartPos: 4816, - EndPos: 4819, + EndLine: 242, + StartPos: 4816, + EndPos: 4819, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 242, - EndLine: 242, - StartPos: 4816, - EndPos: 4819, + EndLine: 242, + StartPos: 4816, + EndPos: 4819, }, Value: "bar", }, @@ -11435,31 +11350,31 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 243, - EndLine: 243, - StartPos: 4824, - EndPos: 4843, + EndLine: 243, + StartPos: 4824, + EndPos: 4843, }, Expr: &expr.StaticPropertyFetch{ Position: &position.Position{ StartLine: 243, - EndLine: 243, - StartPos: 4824, - EndPos: 4842, + EndLine: 243, + StartPos: 4824, + EndPos: 4842, }, Class: &name.Relative{ Position: &position.Position{ StartLine: 243, - EndLine: 243, - StartPos: 4824, - EndPos: 4836, + EndLine: 243, + StartPos: 4824, + EndPos: 4836, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 243, - EndLine: 243, - StartPos: 4834, - EndPos: 4836, + EndLine: 243, + StartPos: 4834, + EndPos: 4836, }, Value: "Foo", }, @@ -11468,16 +11383,16 @@ func TestPhp5(t *testing.T) { Property: &expr.Variable{ Position: &position.Position{ StartLine: 243, - EndLine: 243, - StartPos: 4839, - EndPos: 4842, + EndLine: 243, + StartPos: 4839, + EndPos: 4842, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 243, - EndLine: 243, - StartPos: 4839, - EndPos: 4842, + EndLine: 243, + StartPos: 4839, + EndPos: 4842, }, Value: "bar", }, @@ -11487,31 +11402,31 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 244, - EndLine: 244, - StartPos: 4847, - EndPos: 4857, + EndLine: 244, + StartPos: 4847, + EndPos: 4857, }, Expr: &expr.StaticPropertyFetch{ Position: &position.Position{ StartLine: 244, - EndLine: 244, - StartPos: 4847, - EndPos: 4856, + EndLine: 244, + StartPos: 4847, + EndPos: 4856, }, Class: &name.FullyQualified{ Position: &position.Position{ StartLine: 244, - EndLine: 244, - StartPos: 4847, - EndPos: 4850, + EndLine: 244, + StartPos: 4847, + EndPos: 4850, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 244, - EndLine: 244, - StartPos: 4848, - EndPos: 4850, + EndLine: 244, + StartPos: 4848, + EndPos: 4850, }, Value: "Foo", }, @@ -11520,16 +11435,16 @@ func TestPhp5(t *testing.T) { Property: &expr.Variable{ Position: &position.Position{ StartLine: 244, - EndLine: 244, - StartPos: 4853, - EndPos: 4856, + EndLine: 244, + StartPos: 4853, + EndPos: 4856, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 244, - EndLine: 244, - StartPos: 4853, - EndPos: 4856, + EndLine: 244, + StartPos: 4853, + EndPos: 4856, }, Value: "bar", }, @@ -11539,30 +11454,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 245, - EndLine: 245, - StartPos: 4861, - EndPos: 4873, + EndLine: 245, + StartPos: 4861, + EndPos: 4873, }, Expr: &expr.Ternary{ Position: &position.Position{ StartLine: 245, - EndLine: 245, - StartPos: 4861, - EndPos: 4872, + EndLine: 245, + StartPos: 4861, + EndPos: 4872, }, Condition: &expr.Variable{ Position: &position.Position{ StartLine: 245, - EndLine: 245, - StartPos: 4861, - EndPos: 4862, + EndLine: 245, + StartPos: 4861, + EndPos: 4862, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 245, - EndLine: 245, - StartPos: 4861, - EndPos: 4862, + EndLine: 245, + StartPos: 4861, + EndPos: 4862, }, Value: "a", }, @@ -11570,16 +11485,16 @@ func TestPhp5(t *testing.T) { IfTrue: &expr.Variable{ Position: &position.Position{ StartLine: 245, - EndLine: 245, - StartPos: 4866, - EndPos: 4867, + EndLine: 245, + StartPos: 4866, + EndPos: 4867, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 245, - EndLine: 245, - StartPos: 4866, - EndPos: 4867, + EndLine: 245, + StartPos: 4866, + EndPos: 4867, }, Value: "b", }, @@ -11587,16 +11502,16 @@ func TestPhp5(t *testing.T) { IfFalse: &expr.Variable{ Position: &position.Position{ StartLine: 245, - EndLine: 245, - StartPos: 4871, - EndPos: 4872, + EndLine: 245, + StartPos: 4871, + EndPos: 4872, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 245, - EndLine: 245, - StartPos: 4871, - EndPos: 4872, + EndLine: 245, + StartPos: 4871, + EndPos: 4872, }, Value: "c", }, @@ -11606,30 +11521,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 246, - EndLine: 246, - StartPos: 4877, - EndPos: 4886, + EndLine: 246, + StartPos: 4877, + EndPos: 4886, }, Expr: &expr.Ternary{ Position: &position.Position{ StartLine: 246, - EndLine: 246, - StartPos: 4877, - EndPos: 4885, + EndLine: 246, + StartPos: 4877, + EndPos: 4885, }, Condition: &expr.Variable{ Position: &position.Position{ StartLine: 246, - EndLine: 246, - StartPos: 4877, - EndPos: 4878, + EndLine: 246, + StartPos: 4877, + EndPos: 4878, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 246, - EndLine: 246, - StartPos: 4877, - EndPos: 4878, + EndLine: 246, + StartPos: 4877, + EndPos: 4878, }, Value: "a", }, @@ -11637,16 +11552,16 @@ func TestPhp5(t *testing.T) { IfFalse: &expr.Variable{ Position: &position.Position{ StartLine: 246, - EndLine: 246, - StartPos: 4884, - EndPos: 4885, + EndLine: 246, + StartPos: 4884, + EndPos: 4885, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 246, - EndLine: 246, - StartPos: 4884, - EndPos: 4885, + EndLine: 246, + StartPos: 4884, + EndPos: 4885, }, Value: "c", }, @@ -11656,30 +11571,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 247, - EndLine: 247, - StartPos: 4890, - EndPos: 4912, + EndLine: 247, + StartPos: 4890, + EndPos: 4912, }, Expr: &expr.Ternary{ Position: &position.Position{ StartLine: 247, - EndLine: 247, - StartPos: 4890, - EndPos: 4911, + EndLine: 247, + StartPos: 4890, + EndPos: 4911, }, Condition: &expr.Variable{ Position: &position.Position{ StartLine: 247, - EndLine: 247, - StartPos: 4890, - EndPos: 4891, + EndLine: 247, + StartPos: 4890, + EndPos: 4891, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 247, - EndLine: 247, - StartPos: 4890, - EndPos: 4891, + EndLine: 247, + StartPos: 4890, + EndPos: 4891, }, Value: "a", }, @@ -11687,23 +11602,23 @@ func TestPhp5(t *testing.T) { IfTrue: &expr.Ternary{ Position: &position.Position{ StartLine: 247, - EndLine: 247, - StartPos: 4895, - EndPos: 4906, + EndLine: 247, + StartPos: 4895, + EndPos: 4906, }, Condition: &expr.Variable{ Position: &position.Position{ StartLine: 247, - EndLine: 247, - StartPos: 4895, - EndPos: 4896, + EndLine: 247, + StartPos: 4895, + EndPos: 4896, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 247, - EndLine: 247, - StartPos: 4895, - EndPos: 4896, + EndLine: 247, + StartPos: 4895, + EndPos: 4896, }, Value: "b", }, @@ -11711,16 +11626,16 @@ func TestPhp5(t *testing.T) { IfTrue: &expr.Variable{ Position: &position.Position{ StartLine: 247, - EndLine: 247, - StartPos: 4900, - EndPos: 4901, + EndLine: 247, + StartPos: 4900, + EndPos: 4901, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 247, - EndLine: 247, - StartPos: 4900, - EndPos: 4901, + EndLine: 247, + StartPos: 4900, + EndPos: 4901, }, Value: "c", }, @@ -11728,16 +11643,16 @@ func TestPhp5(t *testing.T) { IfFalse: &expr.Variable{ Position: &position.Position{ StartLine: 247, - EndLine: 247, - StartPos: 4905, - EndPos: 4906, + EndLine: 247, + StartPos: 4905, + EndPos: 4906, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 247, - EndLine: 247, - StartPos: 4905, - EndPos: 4906, + EndLine: 247, + StartPos: 4905, + EndPos: 4906, }, Value: "d", }, @@ -11746,16 +11661,16 @@ func TestPhp5(t *testing.T) { IfFalse: &expr.Variable{ Position: &position.Position{ StartLine: 247, - EndLine: 247, - StartPos: 4910, - EndPos: 4911, + EndLine: 247, + StartPos: 4910, + EndPos: 4911, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 247, - EndLine: 247, - StartPos: 4910, - EndPos: 4911, + EndLine: 247, + StartPos: 4910, + EndPos: 4911, }, Value: "e", }, @@ -11765,37 +11680,37 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 248, - EndLine: 248, - StartPos: 4916, - EndPos: 4938, + EndLine: 248, + StartPos: 4916, + EndPos: 4938, }, Expr: &expr.Ternary{ Position: &position.Position{ StartLine: 248, - EndLine: 248, - StartPos: 4916, - EndPos: 4937, + EndLine: 248, + StartPos: 4916, + EndPos: 4937, }, Condition: &expr.Ternary{ Position: &position.Position{ StartLine: 248, - EndLine: 248, - StartPos: 4916, - EndPos: 4927, + EndLine: 248, + StartPos: 4916, + EndPos: 4927, }, Condition: &expr.Variable{ Position: &position.Position{ StartLine: 248, - EndLine: 248, - StartPos: 4916, - EndPos: 4917, + EndLine: 248, + StartPos: 4916, + EndPos: 4917, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 248, - EndLine: 248, - StartPos: 4916, - EndPos: 4917, + EndLine: 248, + StartPos: 4916, + EndPos: 4917, }, Value: "a", }, @@ -11803,16 +11718,16 @@ func TestPhp5(t *testing.T) { IfTrue: &expr.Variable{ Position: &position.Position{ StartLine: 248, - EndLine: 248, - StartPos: 4921, - EndPos: 4922, + EndLine: 248, + StartPos: 4921, + EndPos: 4922, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 248, - EndLine: 248, - StartPos: 4921, - EndPos: 4922, + EndLine: 248, + StartPos: 4921, + EndPos: 4922, }, Value: "b", }, @@ -11820,16 +11735,16 @@ func TestPhp5(t *testing.T) { IfFalse: &expr.Variable{ Position: &position.Position{ StartLine: 248, - EndLine: 248, - StartPos: 4926, - EndPos: 4927, + EndLine: 248, + StartPos: 4926, + EndPos: 4927, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 248, - EndLine: 248, - StartPos: 4926, - EndPos: 4927, + EndLine: 248, + StartPos: 4926, + EndPos: 4927, }, Value: "c", }, @@ -11838,16 +11753,16 @@ func TestPhp5(t *testing.T) { IfTrue: &expr.Variable{ Position: &position.Position{ StartLine: 248, - EndLine: 248, - StartPos: 4931, - EndPos: 4932, + EndLine: 248, + StartPos: 4931, + EndPos: 4932, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 248, - EndLine: 248, - StartPos: 4931, - EndPos: 4932, + EndLine: 248, + StartPos: 4931, + EndPos: 4932, }, Value: "d", }, @@ -11855,16 +11770,16 @@ func TestPhp5(t *testing.T) { IfFalse: &expr.Variable{ Position: &position.Position{ StartLine: 248, - EndLine: 248, - StartPos: 4936, - EndPos: 4937, + EndLine: 248, + StartPos: 4936, + EndPos: 4937, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 248, - EndLine: 248, - StartPos: 4936, - EndPos: 4937, + EndLine: 248, + StartPos: 4936, + EndPos: 4937, }, Value: "e", }, @@ -11874,30 +11789,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 249, - EndLine: 249, - StartPos: 4942, - EndPos: 4945, + EndLine: 249, + StartPos: 4942, + EndPos: 4945, }, Expr: &expr.UnaryMinus{ Position: &position.Position{ StartLine: 249, - EndLine: 249, - StartPos: 4942, - EndPos: 4944, + EndLine: 249, + StartPos: 4942, + EndPos: 4944, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 249, - EndLine: 249, - StartPos: 4943, - EndPos: 4944, + EndLine: 249, + StartPos: 4943, + EndPos: 4944, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 249, - EndLine: 249, - StartPos: 4943, - EndPos: 4944, + EndLine: 249, + StartPos: 4943, + EndPos: 4944, }, Value: "a", }, @@ -11907,30 +11822,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 250, - EndLine: 250, - StartPos: 4949, - EndPos: 4952, + EndLine: 250, + StartPos: 4949, + EndPos: 4952, }, Expr: &expr.UnaryPlus{ Position: &position.Position{ StartLine: 250, - EndLine: 250, - StartPos: 4949, - EndPos: 4951, + EndLine: 250, + StartPos: 4949, + EndPos: 4951, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 250, - EndLine: 250, - StartPos: 4950, - EndPos: 4951, + EndLine: 250, + StartPos: 4950, + EndPos: 4951, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 250, - EndLine: 250, - StartPos: 4950, - EndPos: 4951, + EndLine: 250, + StartPos: 4950, + EndPos: 4951, }, Value: "a", }, @@ -11940,30 +11855,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 251, - EndLine: 251, - StartPos: 4956, - EndPos: 4959, + EndLine: 251, + StartPos: 4956, + EndPos: 4959, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 251, - EndLine: 251, - StartPos: 4956, - EndPos: 4958, + EndLine: 251, + StartPos: 4956, + EndPos: 4958, }, VarName: &expr.Variable{ Position: &position.Position{ StartLine: 251, - EndLine: 251, - StartPos: 4957, - EndPos: 4958, + EndLine: 251, + StartPos: 4957, + EndPos: 4958, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 251, - EndLine: 251, - StartPos: 4957, - EndPos: 4958, + EndLine: 251, + StartPos: 4957, + EndPos: 4958, }, Value: "a", }, @@ -11973,37 +11888,37 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 252, - EndLine: 252, - StartPos: 4963, - EndPos: 4967, + EndLine: 252, + StartPos: 4963, + EndPos: 4967, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 252, - EndLine: 252, - StartPos: 4963, - EndPos: 4966, + EndLine: 252, + StartPos: 4963, + EndPos: 4966, }, VarName: &expr.Variable{ Position: &position.Position{ StartLine: 252, - EndLine: 252, - StartPos: 4964, - EndPos: 4966, + EndLine: 252, + StartPos: 4964, + EndPos: 4966, }, VarName: &expr.Variable{ Position: &position.Position{ StartLine: 252, - EndLine: 252, - StartPos: 4965, - EndPos: 4966, + EndLine: 252, + StartPos: 4965, + EndPos: 4966, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 252, - EndLine: 252, - StartPos: 4965, - EndPos: 4966, + EndLine: 252, + StartPos: 4965, + EndPos: 4966, }, Value: "a", }, @@ -12014,46 +11929,46 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 253, - EndLine: 253, - StartPos: 4971, - EndPos: 4976, + EndLine: 253, + StartPos: 4971, + EndPos: 4976, }, Expr: &expr.Yield{ Position: &position.Position{ StartLine: 253, - EndLine: 253, - StartPos: 4971, - EndPos: 4975, + EndLine: 253, + StartPos: 4971, + EndPos: 4975, }, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 254, - EndLine: 254, - StartPos: 4980, - EndPos: 4988, + EndLine: 254, + StartPos: 4980, + EndPos: 4988, }, Expr: &expr.Yield{ Position: &position.Position{ StartLine: 254, - EndLine: 254, - StartPos: 4980, - EndPos: 4987, + EndLine: 254, + StartPos: 4980, + EndPos: 4987, }, Value: &expr.Variable{ Position: &position.Position{ StartLine: 254, - EndLine: 254, - StartPos: 4986, - EndPos: 4987, + EndLine: 254, + StartPos: 4986, + EndPos: 4987, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 254, - EndLine: 254, - StartPos: 4986, - EndPos: 4987, + EndLine: 254, + StartPos: 4986, + EndPos: 4987, }, Value: "a", }, @@ -12063,30 +11978,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 255, - EndLine: 255, - StartPos: 4992, - EndPos: 5006, + EndLine: 255, + StartPos: 4992, + EndPos: 5006, }, Expr: &expr.Yield{ Position: &position.Position{ StartLine: 255, - EndLine: 255, - StartPos: 4992, - EndPos: 5005, + EndLine: 255, + StartPos: 4992, + EndPos: 5005, }, Key: &expr.Variable{ Position: &position.Position{ StartLine: 255, - EndLine: 255, - StartPos: 4998, - EndPos: 4999, + EndLine: 255, + StartPos: 4998, + EndPos: 4999, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 255, - EndLine: 255, - StartPos: 4998, - EndPos: 4999, + EndLine: 255, + StartPos: 4998, + EndPos: 4999, }, Value: "a", }, @@ -12094,16 +12009,16 @@ func TestPhp5(t *testing.T) { Value: &expr.Variable{ Position: &position.Position{ StartLine: 255, - EndLine: 255, - StartPos: 5004, - EndPos: 5005, + EndLine: 255, + StartPos: 5004, + EndPos: 5005, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 255, - EndLine: 255, - StartPos: 5004, - EndPos: 5005, + EndLine: 255, + StartPos: 5004, + EndPos: 5005, }, Value: "b", }, @@ -12113,38 +12028,38 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 256, - EndLine: 256, - StartPos: 5010, - EndPos: 5026, + EndLine: 256, + StartPos: 5010, + EndPos: 5026, }, Expr: &expr.Yield{ Position: &position.Position{ StartLine: 256, - EndLine: 256, - StartPos: 5010, - EndPos: 5025, + EndLine: 256, + StartPos: 5010, + EndPos: 5025, }, Value: &expr.ClassConstFetch{ Position: &position.Position{ StartLine: 256, - EndLine: 256, - StartPos: 5016, - EndPos: 5025, + EndLine: 256, + StartPos: 5016, + EndPos: 5025, }, Class: &name.Name{ Position: &position.Position{ StartLine: 256, - EndLine: 256, - StartPos: 5016, - EndPos: 5018, + EndLine: 256, + StartPos: 5016, + EndPos: 5018, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 256, - EndLine: 256, - StartPos: 5016, - EndPos: 5018, + EndLine: 256, + StartPos: 5016, + EndPos: 5018, }, Value: "Foo", }, @@ -12153,9 +12068,9 @@ func TestPhp5(t *testing.T) { ConstantName: &node.Identifier{ Position: &position.Position{ StartLine: 256, - EndLine: 256, - StartPos: 5021, - EndPos: 5025, + EndLine: 256, + StartPos: 5021, + EndPos: 5025, }, Value: "class", }, @@ -12165,30 +12080,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 257, - EndLine: 257, - StartPos: 5030, - EndPos: 5052, + EndLine: 257, + StartPos: 5030, + EndPos: 5052, }, Expr: &expr.Yield{ Position: &position.Position{ StartLine: 257, - EndLine: 257, - StartPos: 5030, - EndPos: 5051, + EndLine: 257, + StartPos: 5030, + EndPos: 5051, }, Key: &expr.Variable{ Position: &position.Position{ StartLine: 257, - EndLine: 257, - StartPos: 5036, - EndPos: 5037, + EndLine: 257, + StartPos: 5036, + EndPos: 5037, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 257, - EndLine: 257, - StartPos: 5036, - EndPos: 5037, + EndLine: 257, + StartPos: 5036, + EndPos: 5037, }, Value: "a", }, @@ -12196,24 +12111,24 @@ func TestPhp5(t *testing.T) { Value: &expr.ClassConstFetch{ Position: &position.Position{ StartLine: 257, - EndLine: 257, - StartPos: 5042, - EndPos: 5051, + EndLine: 257, + StartPos: 5042, + EndPos: 5051, }, Class: &name.Name{ Position: &position.Position{ StartLine: 257, - EndLine: 257, - StartPos: 5042, - EndPos: 5044, + EndLine: 257, + StartPos: 5042, + EndPos: 5044, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 257, - EndLine: 257, - StartPos: 5042, - EndPos: 5044, + EndLine: 257, + StartPos: 5042, + EndPos: 5044, }, Value: "Foo", }, @@ -12222,9 +12137,9 @@ func TestPhp5(t *testing.T) { ConstantName: &node.Identifier{ Position: &position.Position{ StartLine: 257, - EndLine: 257, - StartPos: 5047, - EndPos: 5051, + EndLine: 257, + StartPos: 5047, + EndPos: 5051, }, Value: "class", }, @@ -12234,30 +12149,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 259, - EndLine: 259, - StartPos: 5059, - EndPos: 5068, + EndLine: 259, + StartPos: 5059, + EndPos: 5068, }, Expr: &cast.Array{ Position: &position.Position{ StartLine: 259, - EndLine: 259, - StartPos: 5059, - EndPos: 5067, + EndLine: 259, + StartPos: 5059, + EndPos: 5067, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 259, - EndLine: 259, - StartPos: 5066, - EndPos: 5067, + EndLine: 259, + StartPos: 5066, + EndPos: 5067, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 259, - EndLine: 259, - StartPos: 5066, - EndPos: 5067, + EndLine: 259, + StartPos: 5066, + EndPos: 5067, }, Value: "a", }, @@ -12267,30 +12182,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 260, - EndLine: 260, - StartPos: 5072, - EndPos: 5083, + EndLine: 260, + StartPos: 5072, + EndPos: 5083, }, Expr: &cast.Bool{ Position: &position.Position{ StartLine: 260, - EndLine: 260, - StartPos: 5072, - EndPos: 5082, + EndLine: 260, + StartPos: 5072, + EndPos: 5082, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 260, - EndLine: 260, - StartPos: 5081, - EndPos: 5082, + EndLine: 260, + StartPos: 5081, + EndPos: 5082, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 260, - EndLine: 260, - StartPos: 5081, - EndPos: 5082, + EndLine: 260, + StartPos: 5081, + EndPos: 5082, }, Value: "a", }, @@ -12300,30 +12215,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 261, - EndLine: 261, - StartPos: 5087, - EndPos: 5095, + EndLine: 261, + StartPos: 5087, + EndPos: 5095, }, Expr: &cast.Bool{ Position: &position.Position{ StartLine: 261, - EndLine: 261, - StartPos: 5087, - EndPos: 5094, + EndLine: 261, + StartPos: 5087, + EndPos: 5094, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 261, - EndLine: 261, - StartPos: 5093, - EndPos: 5094, + EndLine: 261, + StartPos: 5093, + EndPos: 5094, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 261, - EndLine: 261, - StartPos: 5093, - EndPos: 5094, + EndLine: 261, + StartPos: 5093, + EndPos: 5094, }, Value: "a", }, @@ -12333,30 +12248,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 262, - EndLine: 262, - StartPos: 5099, - EndPos: 5109, + EndLine: 262, + StartPos: 5099, + EndPos: 5109, }, Expr: &cast.Double{ Position: &position.Position{ StartLine: 262, - EndLine: 262, - StartPos: 5099, - EndPos: 5108, + EndLine: 262, + StartPos: 5099, + EndPos: 5108, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 262, - EndLine: 262, - StartPos: 5107, - EndPos: 5108, + EndLine: 262, + StartPos: 5107, + EndPos: 5108, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 262, - EndLine: 262, - StartPos: 5107, - EndPos: 5108, + EndLine: 262, + StartPos: 5107, + EndPos: 5108, }, Value: "a", }, @@ -12366,30 +12281,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 263, - EndLine: 263, - StartPos: 5113, - EndPos: 5122, + EndLine: 263, + StartPos: 5113, + EndPos: 5122, }, Expr: &cast.Double{ Position: &position.Position{ StartLine: 263, - EndLine: 263, - StartPos: 5113, - EndPos: 5121, + EndLine: 263, + StartPos: 5113, + EndPos: 5121, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 263, - EndLine: 263, - StartPos: 5120, - EndPos: 5121, + EndLine: 263, + StartPos: 5120, + EndPos: 5121, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 263, - EndLine: 263, - StartPos: 5120, - EndPos: 5121, + EndLine: 263, + StartPos: 5120, + EndPos: 5121, }, Value: "a", }, @@ -12399,30 +12314,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 264, - EndLine: 264, - StartPos: 5126, - EndPos: 5137, + EndLine: 264, + StartPos: 5126, + EndPos: 5137, }, Expr: &cast.Int{ Position: &position.Position{ StartLine: 264, - EndLine: 264, - StartPos: 5126, - EndPos: 5136, + EndLine: 264, + StartPos: 5126, + EndPos: 5136, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 264, - EndLine: 264, - StartPos: 5135, - EndPos: 5136, + EndLine: 264, + StartPos: 5135, + EndPos: 5136, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 264, - EndLine: 264, - StartPos: 5135, - EndPos: 5136, + EndLine: 264, + StartPos: 5135, + EndPos: 5136, }, Value: "a", }, @@ -12432,30 +12347,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 265, - EndLine: 265, - StartPos: 5141, - EndPos: 5148, + EndLine: 265, + StartPos: 5141, + EndPos: 5148, }, Expr: &cast.Int{ Position: &position.Position{ StartLine: 265, - EndLine: 265, - StartPos: 5141, - EndPos: 5147, + EndLine: 265, + StartPos: 5141, + EndPos: 5147, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 265, - EndLine: 265, - StartPos: 5146, - EndPos: 5147, + EndLine: 265, + StartPos: 5146, + EndPos: 5147, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 265, - EndLine: 265, - StartPos: 5146, - EndPos: 5147, + EndLine: 265, + StartPos: 5146, + EndPos: 5147, }, Value: "a", }, @@ -12465,30 +12380,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 266, - EndLine: 266, - StartPos: 5152, - EndPos: 5162, + EndLine: 266, + StartPos: 5152, + EndPos: 5162, }, Expr: &cast.Object{ Position: &position.Position{ StartLine: 266, - EndLine: 266, - StartPos: 5152, - EndPos: 5161, + EndLine: 266, + StartPos: 5152, + EndPos: 5161, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 266, - EndLine: 266, - StartPos: 5160, - EndPos: 5161, + EndLine: 266, + StartPos: 5160, + EndPos: 5161, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 266, - EndLine: 266, - StartPos: 5160, - EndPos: 5161, + EndLine: 266, + StartPos: 5160, + EndPos: 5161, }, Value: "a", }, @@ -12498,30 +12413,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 267, - EndLine: 267, - StartPos: 5166, - EndPos: 5176, + EndLine: 267, + StartPos: 5166, + EndPos: 5176, }, Expr: &cast.String{ Position: &position.Position{ StartLine: 267, - EndLine: 267, - StartPos: 5166, - EndPos: 5175, + EndLine: 267, + StartPos: 5166, + EndPos: 5175, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 267, - EndLine: 267, - StartPos: 5174, - EndPos: 5175, + EndLine: 267, + StartPos: 5174, + EndPos: 5175, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 267, - EndLine: 267, - StartPos: 5174, - EndPos: 5175, + EndLine: 267, + StartPos: 5174, + EndPos: 5175, }, Value: "a", }, @@ -12531,30 +12446,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 268, - EndLine: 268, - StartPos: 5180, - EndPos: 5189, + EndLine: 268, + StartPos: 5180, + EndPos: 5189, }, Expr: &cast.Unset{ Position: &position.Position{ StartLine: 268, - EndLine: 268, - StartPos: 5180, - EndPos: 5188, + EndLine: 268, + StartPos: 5180, + EndPos: 5188, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 268, - EndLine: 268, - StartPos: 5187, - EndPos: 5188, + EndLine: 268, + StartPos: 5187, + EndPos: 5188, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 268, - EndLine: 268, - StartPos: 5187, - EndPos: 5188, + EndLine: 268, + StartPos: 5187, + EndPos: 5188, }, Value: "a", }, @@ -12564,30 +12479,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 270, - EndLine: 270, - StartPos: 5194, - EndPos: 5201, + EndLine: 270, + StartPos: 5194, + EndPos: 5201, }, Expr: &binary.BitwiseAnd{ Position: &position.Position{ StartLine: 270, - EndLine: 270, - StartPos: 5194, - EndPos: 5200, + EndLine: 270, + StartPos: 5194, + EndPos: 5200, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 270, - EndLine: 270, - StartPos: 5194, - EndPos: 5195, + EndLine: 270, + StartPos: 5194, + EndPos: 5195, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 270, - EndLine: 270, - StartPos: 5194, - EndPos: 5195, + EndLine: 270, + StartPos: 5194, + EndPos: 5195, }, Value: "a", }, @@ -12595,16 +12510,16 @@ func TestPhp5(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 270, - EndLine: 270, - StartPos: 5199, - EndPos: 5200, + EndLine: 270, + StartPos: 5199, + EndPos: 5200, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 270, - EndLine: 270, - StartPos: 5199, - EndPos: 5200, + EndLine: 270, + StartPos: 5199, + EndPos: 5200, }, Value: "b", }, @@ -12614,30 +12529,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 271, - EndLine: 271, - StartPos: 5205, - EndPos: 5212, + EndLine: 271, + StartPos: 5205, + EndPos: 5212, }, Expr: &binary.BitwiseOr{ Position: &position.Position{ StartLine: 271, - EndLine: 271, - StartPos: 5205, - EndPos: 5211, + EndLine: 271, + StartPos: 5205, + EndPos: 5211, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 271, - EndLine: 271, - StartPos: 5205, - EndPos: 5206, + EndLine: 271, + StartPos: 5205, + EndPos: 5206, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 271, - EndLine: 271, - StartPos: 5205, - EndPos: 5206, + EndLine: 271, + StartPos: 5205, + EndPos: 5206, }, Value: "a", }, @@ -12645,16 +12560,16 @@ func TestPhp5(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 271, - EndLine: 271, - StartPos: 5210, - EndPos: 5211, + EndLine: 271, + StartPos: 5210, + EndPos: 5211, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 271, - EndLine: 271, - StartPos: 5210, - EndPos: 5211, + EndLine: 271, + StartPos: 5210, + EndPos: 5211, }, Value: "b", }, @@ -12664,30 +12579,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 272, - EndLine: 272, - StartPos: 5216, - EndPos: 5223, + EndLine: 272, + StartPos: 5216, + EndPos: 5223, }, Expr: &binary.BitwiseXor{ Position: &position.Position{ StartLine: 272, - EndLine: 272, - StartPos: 5216, - EndPos: 5222, + EndLine: 272, + StartPos: 5216, + EndPos: 5222, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 272, - EndLine: 272, - StartPos: 5216, - EndPos: 5217, + EndLine: 272, + StartPos: 5216, + EndPos: 5217, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 272, - EndLine: 272, - StartPos: 5216, - EndPos: 5217, + EndLine: 272, + StartPos: 5216, + EndPos: 5217, }, Value: "a", }, @@ -12695,16 +12610,16 @@ func TestPhp5(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 272, - EndLine: 272, - StartPos: 5221, - EndPos: 5222, + EndLine: 272, + StartPos: 5221, + EndPos: 5222, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 272, - EndLine: 272, - StartPos: 5221, - EndPos: 5222, + EndLine: 272, + StartPos: 5221, + EndPos: 5222, }, Value: "b", }, @@ -12714,30 +12629,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 273, - EndLine: 273, - StartPos: 5227, - EndPos: 5235, + EndLine: 273, + StartPos: 5227, + EndPos: 5235, }, Expr: &binary.BooleanAnd{ Position: &position.Position{ StartLine: 273, - EndLine: 273, - StartPos: 5227, - EndPos: 5234, + EndLine: 273, + StartPos: 5227, + EndPos: 5234, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 273, - EndLine: 273, - StartPos: 5227, - EndPos: 5228, + EndLine: 273, + StartPos: 5227, + EndPos: 5228, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 273, - EndLine: 273, - StartPos: 5227, - EndPos: 5228, + EndLine: 273, + StartPos: 5227, + EndPos: 5228, }, Value: "a", }, @@ -12745,16 +12660,16 @@ func TestPhp5(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 273, - EndLine: 273, - StartPos: 5233, - EndPos: 5234, + EndLine: 273, + StartPos: 5233, + EndPos: 5234, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 273, - EndLine: 273, - StartPos: 5233, - EndPos: 5234, + EndLine: 273, + StartPos: 5233, + EndPos: 5234, }, Value: "b", }, @@ -12764,30 +12679,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 274, - EndLine: 274, - StartPos: 5239, - EndPos: 5247, + EndLine: 274, + StartPos: 5239, + EndPos: 5247, }, Expr: &binary.BooleanOr{ Position: &position.Position{ StartLine: 274, - EndLine: 274, - StartPos: 5239, - EndPos: 5246, + EndLine: 274, + StartPos: 5239, + EndPos: 5246, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 274, - EndLine: 274, - StartPos: 5239, - EndPos: 5240, + EndLine: 274, + StartPos: 5239, + EndPos: 5240, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 274, - EndLine: 274, - StartPos: 5239, - EndPos: 5240, + EndLine: 274, + StartPos: 5239, + EndPos: 5240, }, Value: "a", }, @@ -12795,16 +12710,16 @@ func TestPhp5(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 274, - EndLine: 274, - StartPos: 5245, - EndPos: 5246, + EndLine: 274, + StartPos: 5245, + EndPos: 5246, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 274, - EndLine: 274, - StartPos: 5245, - EndPos: 5246, + EndLine: 274, + StartPos: 5245, + EndPos: 5246, }, Value: "b", }, @@ -12814,30 +12729,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 275, - EndLine: 275, - StartPos: 5251, - EndPos: 5258, + EndLine: 275, + StartPos: 5251, + EndPos: 5258, }, Expr: &binary.Concat{ Position: &position.Position{ StartLine: 275, - EndLine: 275, - StartPos: 5251, - EndPos: 5257, + EndLine: 275, + StartPos: 5251, + EndPos: 5257, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 275, - EndLine: 275, - StartPos: 5251, - EndPos: 5252, + EndLine: 275, + StartPos: 5251, + EndPos: 5252, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 275, - EndLine: 275, - StartPos: 5251, - EndPos: 5252, + EndLine: 275, + StartPos: 5251, + EndPos: 5252, }, Value: "a", }, @@ -12845,16 +12760,16 @@ func TestPhp5(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 275, - EndLine: 275, - StartPos: 5256, - EndPos: 5257, + EndLine: 275, + StartPos: 5256, + EndPos: 5257, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 275, - EndLine: 275, - StartPos: 5256, - EndPos: 5257, + EndLine: 275, + StartPos: 5256, + EndPos: 5257, }, Value: "b", }, @@ -12864,30 +12779,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 276, - EndLine: 276, - StartPos: 5262, - EndPos: 5269, + EndLine: 276, + StartPos: 5262, + EndPos: 5269, }, Expr: &binary.Div{ Position: &position.Position{ StartLine: 276, - EndLine: 276, - StartPos: 5262, - EndPos: 5268, + EndLine: 276, + StartPos: 5262, + EndPos: 5268, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 276, - EndLine: 276, - StartPos: 5262, - EndPos: 5263, + EndLine: 276, + StartPos: 5262, + EndPos: 5263, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 276, - EndLine: 276, - StartPos: 5262, - EndPos: 5263, + EndLine: 276, + StartPos: 5262, + EndPos: 5263, }, Value: "a", }, @@ -12895,16 +12810,16 @@ func TestPhp5(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 276, - EndLine: 276, - StartPos: 5267, - EndPos: 5268, + EndLine: 276, + StartPos: 5267, + EndPos: 5268, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 276, - EndLine: 276, - StartPos: 5267, - EndPos: 5268, + EndLine: 276, + StartPos: 5267, + EndPos: 5268, }, Value: "b", }, @@ -12914,30 +12829,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 277, - EndLine: 277, - StartPos: 5273, - EndPos: 5281, + EndLine: 277, + StartPos: 5273, + EndPos: 5281, }, Expr: &binary.Equal{ Position: &position.Position{ StartLine: 277, - EndLine: 277, - StartPos: 5273, - EndPos: 5280, + EndLine: 277, + StartPos: 5273, + EndPos: 5280, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 277, - EndLine: 277, - StartPos: 5273, - EndPos: 5274, + EndLine: 277, + StartPos: 5273, + EndPos: 5274, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 277, - EndLine: 277, - StartPos: 5273, - EndPos: 5274, + EndLine: 277, + StartPos: 5273, + EndPos: 5274, }, Value: "a", }, @@ -12945,16 +12860,16 @@ func TestPhp5(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 277, - EndLine: 277, - StartPos: 5279, - EndPos: 5280, + EndLine: 277, + StartPos: 5279, + EndPos: 5280, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 277, - EndLine: 277, - StartPos: 5279, - EndPos: 5280, + EndLine: 277, + StartPos: 5279, + EndPos: 5280, }, Value: "b", }, @@ -12964,30 +12879,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 278, - EndLine: 278, - StartPos: 5285, - EndPos: 5293, + EndLine: 278, + StartPos: 5285, + EndPos: 5293, }, Expr: &binary.GreaterOrEqual{ Position: &position.Position{ StartLine: 278, - EndLine: 278, - StartPos: 5285, - EndPos: 5292, + EndLine: 278, + StartPos: 5285, + EndPos: 5292, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 278, - EndLine: 278, - StartPos: 5285, - EndPos: 5286, + EndLine: 278, + StartPos: 5285, + EndPos: 5286, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 278, - EndLine: 278, - StartPos: 5285, - EndPos: 5286, + EndLine: 278, + StartPos: 5285, + EndPos: 5286, }, Value: "a", }, @@ -12995,16 +12910,16 @@ func TestPhp5(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 278, - EndLine: 278, - StartPos: 5291, - EndPos: 5292, + EndLine: 278, + StartPos: 5291, + EndPos: 5292, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 278, - EndLine: 278, - StartPos: 5291, - EndPos: 5292, + EndLine: 278, + StartPos: 5291, + EndPos: 5292, }, Value: "b", }, @@ -13014,30 +12929,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 279, - EndLine: 279, - StartPos: 5297, - EndPos: 5304, + EndLine: 279, + StartPos: 5297, + EndPos: 5304, }, Expr: &binary.Greater{ Position: &position.Position{ StartLine: 279, - EndLine: 279, - StartPos: 5297, - EndPos: 5303, + EndLine: 279, + StartPos: 5297, + EndPos: 5303, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 279, - EndLine: 279, - StartPos: 5297, - EndPos: 5298, + EndLine: 279, + StartPos: 5297, + EndPos: 5298, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 279, - EndLine: 279, - StartPos: 5297, - EndPos: 5298, + EndLine: 279, + StartPos: 5297, + EndPos: 5298, }, Value: "a", }, @@ -13045,16 +12960,16 @@ func TestPhp5(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 279, - EndLine: 279, - StartPos: 5302, - EndPos: 5303, + EndLine: 279, + StartPos: 5302, + EndPos: 5303, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 279, - EndLine: 279, - StartPos: 5302, - EndPos: 5303, + EndLine: 279, + StartPos: 5302, + EndPos: 5303, }, Value: "b", }, @@ -13064,30 +12979,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 280, - EndLine: 280, - StartPos: 5308, - EndPos: 5317, + EndLine: 280, + StartPos: 5308, + EndPos: 5317, }, Expr: &binary.Identical{ Position: &position.Position{ StartLine: 280, - EndLine: 280, - StartPos: 5308, - EndPos: 5316, + EndLine: 280, + StartPos: 5308, + EndPos: 5316, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 280, - EndLine: 280, - StartPos: 5308, - EndPos: 5309, + EndLine: 280, + StartPos: 5308, + EndPos: 5309, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 280, - EndLine: 280, - StartPos: 5308, - EndPos: 5309, + EndLine: 280, + StartPos: 5308, + EndPos: 5309, }, Value: "a", }, @@ -13095,16 +13010,16 @@ func TestPhp5(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 280, - EndLine: 280, - StartPos: 5315, - EndPos: 5316, + EndLine: 280, + StartPos: 5315, + EndPos: 5316, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 280, - EndLine: 280, - StartPos: 5315, - EndPos: 5316, + EndLine: 280, + StartPos: 5315, + EndPos: 5316, }, Value: "b", }, @@ -13114,30 +13029,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 281, - EndLine: 281, - StartPos: 5321, - EndPos: 5330, + EndLine: 281, + StartPos: 5321, + EndPos: 5330, }, Expr: &binary.LogicalAnd{ Position: &position.Position{ StartLine: 281, - EndLine: 281, - StartPos: 5321, - EndPos: 5329, + EndLine: 281, + StartPos: 5321, + EndPos: 5329, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 281, - EndLine: 281, - StartPos: 5321, - EndPos: 5322, + EndLine: 281, + StartPos: 5321, + EndPos: 5322, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 281, - EndLine: 281, - StartPos: 5321, - EndPos: 5322, + EndLine: 281, + StartPos: 5321, + EndPos: 5322, }, Value: "a", }, @@ -13145,16 +13060,16 @@ func TestPhp5(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 281, - EndLine: 281, - StartPos: 5328, - EndPos: 5329, + EndLine: 281, + StartPos: 5328, + EndPos: 5329, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 281, - EndLine: 281, - StartPos: 5328, - EndPos: 5329, + EndLine: 281, + StartPos: 5328, + EndPos: 5329, }, Value: "b", }, @@ -13164,30 +13079,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 282, - EndLine: 282, - StartPos: 5334, - EndPos: 5342, + EndLine: 282, + StartPos: 5334, + EndPos: 5342, }, Expr: &binary.LogicalOr{ Position: &position.Position{ StartLine: 282, - EndLine: 282, - StartPos: 5334, - EndPos: 5341, + EndLine: 282, + StartPos: 5334, + EndPos: 5341, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 282, - EndLine: 282, - StartPos: 5334, - EndPos: 5335, + EndLine: 282, + StartPos: 5334, + EndPos: 5335, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 282, - EndLine: 282, - StartPos: 5334, - EndPos: 5335, + EndLine: 282, + StartPos: 5334, + EndPos: 5335, }, Value: "a", }, @@ -13195,16 +13110,16 @@ func TestPhp5(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 282, - EndLine: 282, - StartPos: 5340, - EndPos: 5341, + EndLine: 282, + StartPos: 5340, + EndPos: 5341, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 282, - EndLine: 282, - StartPos: 5340, - EndPos: 5341, + EndLine: 282, + StartPos: 5340, + EndPos: 5341, }, Value: "b", }, @@ -13214,30 +13129,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 283, - EndLine: 283, - StartPos: 5346, - EndPos: 5355, + EndLine: 283, + StartPos: 5346, + EndPos: 5355, }, Expr: &binary.LogicalXor{ Position: &position.Position{ StartLine: 283, - EndLine: 283, - StartPos: 5346, - EndPos: 5354, + EndLine: 283, + StartPos: 5346, + EndPos: 5354, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 283, - EndLine: 283, - StartPos: 5346, - EndPos: 5347, + EndLine: 283, + StartPos: 5346, + EndPos: 5347, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 283, - EndLine: 283, - StartPos: 5346, - EndPos: 5347, + EndLine: 283, + StartPos: 5346, + EndPos: 5347, }, Value: "a", }, @@ -13245,16 +13160,16 @@ func TestPhp5(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 283, - EndLine: 283, - StartPos: 5353, - EndPos: 5354, + EndLine: 283, + StartPos: 5353, + EndPos: 5354, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 283, - EndLine: 283, - StartPos: 5353, - EndPos: 5354, + EndLine: 283, + StartPos: 5353, + EndPos: 5354, }, Value: "b", }, @@ -13264,30 +13179,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 284, - EndLine: 284, - StartPos: 5359, - EndPos: 5366, + EndLine: 284, + StartPos: 5359, + EndPos: 5366, }, Expr: &binary.Minus{ Position: &position.Position{ StartLine: 284, - EndLine: 284, - StartPos: 5359, - EndPos: 5365, + EndLine: 284, + StartPos: 5359, + EndPos: 5365, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 284, - EndLine: 284, - StartPos: 5359, - EndPos: 5360, + EndLine: 284, + StartPos: 5359, + EndPos: 5360, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 284, - EndLine: 284, - StartPos: 5359, - EndPos: 5360, + EndLine: 284, + StartPos: 5359, + EndPos: 5360, }, Value: "a", }, @@ -13295,16 +13210,16 @@ func TestPhp5(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 284, - EndLine: 284, - StartPos: 5364, - EndPos: 5365, + EndLine: 284, + StartPos: 5364, + EndPos: 5365, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 284, - EndLine: 284, - StartPos: 5364, - EndPos: 5365, + EndLine: 284, + StartPos: 5364, + EndPos: 5365, }, Value: "b", }, @@ -13314,30 +13229,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 285, - EndLine: 285, - StartPos: 5370, - EndPos: 5377, + EndLine: 285, + StartPos: 5370, + EndPos: 5377, }, Expr: &binary.Mod{ Position: &position.Position{ StartLine: 285, - EndLine: 285, - StartPos: 5370, - EndPos: 5376, + EndLine: 285, + StartPos: 5370, + EndPos: 5376, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 285, - EndLine: 285, - StartPos: 5370, - EndPos: 5371, + EndLine: 285, + StartPos: 5370, + EndPos: 5371, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 285, - EndLine: 285, - StartPos: 5370, - EndPos: 5371, + EndLine: 285, + StartPos: 5370, + EndPos: 5371, }, Value: "a", }, @@ -13345,16 +13260,16 @@ func TestPhp5(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 285, - EndLine: 285, - StartPos: 5375, - EndPos: 5376, + EndLine: 285, + StartPos: 5375, + EndPos: 5376, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 285, - EndLine: 285, - StartPos: 5375, - EndPos: 5376, + EndLine: 285, + StartPos: 5375, + EndPos: 5376, }, Value: "b", }, @@ -13364,30 +13279,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 286, - EndLine: 286, - StartPos: 5381, - EndPos: 5388, + EndLine: 286, + StartPos: 5381, + EndPos: 5388, }, Expr: &binary.Mul{ Position: &position.Position{ StartLine: 286, - EndLine: 286, - StartPos: 5381, - EndPos: 5387, + EndLine: 286, + StartPos: 5381, + EndPos: 5387, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 286, - EndLine: 286, - StartPos: 5381, - EndPos: 5382, + EndLine: 286, + StartPos: 5381, + EndPos: 5382, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 286, - EndLine: 286, - StartPos: 5381, - EndPos: 5382, + EndLine: 286, + StartPos: 5381, + EndPos: 5382, }, Value: "a", }, @@ -13395,16 +13310,16 @@ func TestPhp5(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 286, - EndLine: 286, - StartPos: 5386, - EndPos: 5387, + EndLine: 286, + StartPos: 5386, + EndPos: 5387, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 286, - EndLine: 286, - StartPos: 5386, - EndPos: 5387, + EndLine: 286, + StartPos: 5386, + EndPos: 5387, }, Value: "b", }, @@ -13414,30 +13329,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 287, - EndLine: 287, - StartPos: 5392, - EndPos: 5400, + EndLine: 287, + StartPos: 5392, + EndPos: 5400, }, Expr: &binary.NotEqual{ Position: &position.Position{ StartLine: 287, - EndLine: 287, - StartPos: 5392, - EndPos: 5399, + EndLine: 287, + StartPos: 5392, + EndPos: 5399, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 287, - EndLine: 287, - StartPos: 5392, - EndPos: 5393, + EndLine: 287, + StartPos: 5392, + EndPos: 5393, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 287, - EndLine: 287, - StartPos: 5392, - EndPos: 5393, + EndLine: 287, + StartPos: 5392, + EndPos: 5393, }, Value: "a", }, @@ -13445,16 +13360,16 @@ func TestPhp5(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 287, - EndLine: 287, - StartPos: 5398, - EndPos: 5399, + EndLine: 287, + StartPos: 5398, + EndPos: 5399, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 287, - EndLine: 287, - StartPos: 5398, - EndPos: 5399, + EndLine: 287, + StartPos: 5398, + EndPos: 5399, }, Value: "b", }, @@ -13464,30 +13379,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 288, - EndLine: 288, - StartPos: 5404, - EndPos: 5413, + EndLine: 288, + StartPos: 5404, + EndPos: 5413, }, Expr: &binary.NotIdentical{ Position: &position.Position{ StartLine: 288, - EndLine: 288, - StartPos: 5404, - EndPos: 5412, + EndLine: 288, + StartPos: 5404, + EndPos: 5412, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 288, - EndLine: 288, - StartPos: 5404, - EndPos: 5405, + EndLine: 288, + StartPos: 5404, + EndPos: 5405, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 288, - EndLine: 288, - StartPos: 5404, - EndPos: 5405, + EndLine: 288, + StartPos: 5404, + EndPos: 5405, }, Value: "a", }, @@ -13495,16 +13410,16 @@ func TestPhp5(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 288, - EndLine: 288, - StartPos: 5411, - EndPos: 5412, + EndLine: 288, + StartPos: 5411, + EndPos: 5412, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 288, - EndLine: 288, - StartPos: 5411, - EndPos: 5412, + EndLine: 288, + StartPos: 5411, + EndPos: 5412, }, Value: "b", }, @@ -13514,30 +13429,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 289, - EndLine: 289, - StartPos: 5417, - EndPos: 5424, + EndLine: 289, + StartPos: 5417, + EndPos: 5424, }, Expr: &binary.Plus{ Position: &position.Position{ StartLine: 289, - EndLine: 289, - StartPos: 5417, - EndPos: 5423, + EndLine: 289, + StartPos: 5417, + EndPos: 5423, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 289, - EndLine: 289, - StartPos: 5417, - EndPos: 5418, + EndLine: 289, + StartPos: 5417, + EndPos: 5418, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 289, - EndLine: 289, - StartPos: 5417, - EndPos: 5418, + EndLine: 289, + StartPos: 5417, + EndPos: 5418, }, Value: "a", }, @@ -13545,16 +13460,16 @@ func TestPhp5(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 289, - EndLine: 289, - StartPos: 5422, - EndPos: 5423, + EndLine: 289, + StartPos: 5422, + EndPos: 5423, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 289, - EndLine: 289, - StartPos: 5422, - EndPos: 5423, + EndLine: 289, + StartPos: 5422, + EndPos: 5423, }, Value: "b", }, @@ -13564,30 +13479,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 290, - EndLine: 290, - StartPos: 5428, - EndPos: 5436, + EndLine: 290, + StartPos: 5428, + EndPos: 5436, }, Expr: &binary.Pow{ Position: &position.Position{ StartLine: 290, - EndLine: 290, - StartPos: 5428, - EndPos: 5435, + EndLine: 290, + StartPos: 5428, + EndPos: 5435, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 290, - EndLine: 290, - StartPos: 5428, - EndPos: 5429, + EndLine: 290, + StartPos: 5428, + EndPos: 5429, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 290, - EndLine: 290, - StartPos: 5428, - EndPos: 5429, + EndLine: 290, + StartPos: 5428, + EndPos: 5429, }, Value: "a", }, @@ -13595,16 +13510,16 @@ func TestPhp5(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 290, - EndLine: 290, - StartPos: 5434, - EndPos: 5435, + EndLine: 290, + StartPos: 5434, + EndPos: 5435, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 290, - EndLine: 290, - StartPos: 5434, - EndPos: 5435, + EndLine: 290, + StartPos: 5434, + EndPos: 5435, }, Value: "b", }, @@ -13614,30 +13529,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 291, - EndLine: 291, - StartPos: 5440, - EndPos: 5448, + EndLine: 291, + StartPos: 5440, + EndPos: 5448, }, Expr: &binary.ShiftLeft{ Position: &position.Position{ StartLine: 291, - EndLine: 291, - StartPos: 5440, - EndPos: 5447, + EndLine: 291, + StartPos: 5440, + EndPos: 5447, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 291, - EndLine: 291, - StartPos: 5440, - EndPos: 5441, + EndLine: 291, + StartPos: 5440, + EndPos: 5441, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 291, - EndLine: 291, - StartPos: 5440, - EndPos: 5441, + EndLine: 291, + StartPos: 5440, + EndPos: 5441, }, Value: "a", }, @@ -13645,16 +13560,16 @@ func TestPhp5(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 291, - EndLine: 291, - StartPos: 5446, - EndPos: 5447, + EndLine: 291, + StartPos: 5446, + EndPos: 5447, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 291, - EndLine: 291, - StartPos: 5446, - EndPos: 5447, + EndLine: 291, + StartPos: 5446, + EndPos: 5447, }, Value: "b", }, @@ -13664,30 +13579,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 292, - EndLine: 292, - StartPos: 5452, - EndPos: 5460, + EndLine: 292, + StartPos: 5452, + EndPos: 5460, }, Expr: &binary.ShiftRight{ Position: &position.Position{ StartLine: 292, - EndLine: 292, - StartPos: 5452, - EndPos: 5459, + EndLine: 292, + StartPos: 5452, + EndPos: 5459, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 292, - EndLine: 292, - StartPos: 5452, - EndPos: 5453, + EndLine: 292, + StartPos: 5452, + EndPos: 5453, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 292, - EndLine: 292, - StartPos: 5452, - EndPos: 5453, + EndLine: 292, + StartPos: 5452, + EndPos: 5453, }, Value: "a", }, @@ -13695,16 +13610,16 @@ func TestPhp5(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 292, - EndLine: 292, - StartPos: 5458, - EndPos: 5459, + EndLine: 292, + StartPos: 5458, + EndPos: 5459, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 292, - EndLine: 292, - StartPos: 5458, - EndPos: 5459, + EndLine: 292, + StartPos: 5458, + EndPos: 5459, }, Value: "b", }, @@ -13714,30 +13629,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 293, - EndLine: 293, - StartPos: 5464, - EndPos: 5472, + EndLine: 293, + StartPos: 5464, + EndPos: 5472, }, Expr: &binary.SmallerOrEqual{ Position: &position.Position{ StartLine: 293, - EndLine: 293, - StartPos: 5464, - EndPos: 5471, + EndLine: 293, + StartPos: 5464, + EndPos: 5471, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 293, - EndLine: 293, - StartPos: 5464, - EndPos: 5465, + EndLine: 293, + StartPos: 5464, + EndPos: 5465, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 293, - EndLine: 293, - StartPos: 5464, - EndPos: 5465, + EndLine: 293, + StartPos: 5464, + EndPos: 5465, }, Value: "a", }, @@ -13745,16 +13660,16 @@ func TestPhp5(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 293, - EndLine: 293, - StartPos: 5470, - EndPos: 5471, + EndLine: 293, + StartPos: 5470, + EndPos: 5471, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 293, - EndLine: 293, - StartPos: 5470, - EndPos: 5471, + EndLine: 293, + StartPos: 5470, + EndPos: 5471, }, Value: "b", }, @@ -13764,30 +13679,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 294, - EndLine: 294, - StartPos: 5476, - EndPos: 5483, + EndLine: 294, + StartPos: 5476, + EndPos: 5483, }, Expr: &binary.Smaller{ Position: &position.Position{ StartLine: 294, - EndLine: 294, - StartPos: 5476, - EndPos: 5482, + EndLine: 294, + StartPos: 5476, + EndPos: 5482, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 294, - EndLine: 294, - StartPos: 5476, - EndPos: 5477, + EndLine: 294, + StartPos: 5476, + EndPos: 5477, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 294, - EndLine: 294, - StartPos: 5476, - EndPos: 5477, + EndLine: 294, + StartPos: 5476, + EndPos: 5477, }, Value: "a", }, @@ -13795,16 +13710,16 @@ func TestPhp5(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 294, - EndLine: 294, - StartPos: 5481, - EndPos: 5482, + EndLine: 294, + StartPos: 5481, + EndPos: 5482, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 294, - EndLine: 294, - StartPos: 5481, - EndPos: 5482, + EndLine: 294, + StartPos: 5481, + EndPos: 5482, }, Value: "b", }, @@ -13814,30 +13729,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 296, - EndLine: 296, - StartPos: 5488, - EndPos: 5496, + EndLine: 296, + StartPos: 5488, + EndPos: 5496, }, Expr: &assign.Reference{ Position: &position.Position{ StartLine: 296, - EndLine: 296, - StartPos: 5488, - EndPos: 5495, + EndLine: 296, + StartPos: 5488, + EndPos: 5495, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 296, - EndLine: 296, - StartPos: 5488, - EndPos: 5489, + EndLine: 296, + StartPos: 5488, + EndPos: 5489, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 296, - EndLine: 296, - StartPos: 5488, - EndPos: 5489, + EndLine: 296, + StartPos: 5488, + EndPos: 5489, }, Value: "a", }, @@ -13845,16 +13760,16 @@ func TestPhp5(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 296, - EndLine: 296, - StartPos: 5494, - EndPos: 5495, + EndLine: 296, + StartPos: 5494, + EndPos: 5495, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 296, - EndLine: 296, - StartPos: 5494, - EndPos: 5495, + EndLine: 296, + StartPos: 5494, + EndPos: 5495, }, Value: "b", }, @@ -13864,30 +13779,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 297, - EndLine: 297, - StartPos: 5500, - EndPos: 5513, + EndLine: 297, + StartPos: 5500, + EndPos: 5513, }, Expr: &assign.Reference{ Position: &position.Position{ StartLine: 297, - EndLine: 297, - StartPos: 5500, - EndPos: 5512, + EndLine: 297, + StartPos: 5500, + EndPos: 5512, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 297, - EndLine: 297, - StartPos: 5500, - EndPos: 5501, + EndLine: 297, + StartPos: 5500, + EndPos: 5501, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 297, - EndLine: 297, - StartPos: 5500, - EndPos: 5501, + EndLine: 297, + StartPos: 5500, + EndPos: 5501, }, Value: "a", }, @@ -13895,24 +13810,24 @@ func TestPhp5(t *testing.T) { Expression: &expr.New{ Position: &position.Position{ StartLine: 297, - EndLine: 297, - StartPos: 5506, - EndPos: 5512, + EndLine: 297, + StartPos: 5506, + EndPos: 5512, }, Class: &name.Name{ Position: &position.Position{ StartLine: 297, - EndLine: 297, - StartPos: 5510, - EndPos: 5512, + EndLine: 297, + StartPos: 5510, + EndPos: 5512, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 297, - EndLine: 297, - StartPos: 5510, - EndPos: 5512, + EndLine: 297, + StartPos: 5510, + EndPos: 5512, }, Value: "Foo", }, @@ -13924,30 +13839,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 298, - EndLine: 298, - StartPos: 5517, - EndPos: 5534, + EndLine: 298, + StartPos: 5517, + EndPos: 5534, }, Expr: &assign.Reference{ Position: &position.Position{ StartLine: 298, - EndLine: 298, - StartPos: 5517, - EndPos: 5533, + EndLine: 298, + StartPos: 5517, + EndPos: 5533, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 298, - EndLine: 298, - StartPos: 5517, - EndPos: 5518, + EndLine: 298, + StartPos: 5517, + EndPos: 5518, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 298, - EndLine: 298, - StartPos: 5517, - EndPos: 5518, + EndLine: 298, + StartPos: 5517, + EndPos: 5518, }, Value: "a", }, @@ -13955,24 +13870,24 @@ func TestPhp5(t *testing.T) { Expression: &expr.New{ Position: &position.Position{ StartLine: 298, - EndLine: 298, - StartPos: 5523, - EndPos: 5533, + EndLine: 298, + StartPos: 5523, + EndPos: 5533, }, Class: &name.Name{ Position: &position.Position{ StartLine: 298, - EndLine: 298, - StartPos: 5527, - EndPos: 5529, + EndLine: 298, + StartPos: 5527, + EndPos: 5529, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 298, - EndLine: 298, - StartPos: 5527, - EndPos: 5529, + EndLine: 298, + StartPos: 5527, + EndPos: 5529, }, Value: "Foo", }, @@ -13981,33 +13896,33 @@ func TestPhp5(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 298, - EndLine: 298, - StartPos: 5530, - EndPos: 5533, + EndLine: 298, + StartPos: 5530, + EndPos: 5533, }, Arguments: []node.Node{ &node.Argument{ Position: &position.Position{ StartLine: 298, - EndLine: 298, - StartPos: 5531, - EndPos: 5532, + EndLine: 298, + StartPos: 5531, + EndPos: 5532, }, - Variadic: false, + Variadic: false, IsReference: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 298, - EndLine: 298, - StartPos: 5531, - EndPos: 5532, + EndLine: 298, + StartPos: 5531, + EndPos: 5532, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 298, - EndLine: 298, - StartPos: 5531, - EndPos: 5532, + EndLine: 298, + StartPos: 5531, + EndPos: 5532, }, Value: "b", }, @@ -14021,30 +13936,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 299, - EndLine: 299, - StartPos: 5538, - EndPos: 5545, + EndLine: 299, + StartPos: 5538, + EndPos: 5545, }, Expr: &assign.Assign{ Position: &position.Position{ StartLine: 299, - EndLine: 299, - StartPos: 5538, - EndPos: 5544, + EndLine: 299, + StartPos: 5538, + EndPos: 5544, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 299, - EndLine: 299, - StartPos: 5538, - EndPos: 5539, + EndLine: 299, + StartPos: 5538, + EndPos: 5539, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 299, - EndLine: 299, - StartPos: 5538, - EndPos: 5539, + EndLine: 299, + StartPos: 5538, + EndPos: 5539, }, Value: "a", }, @@ -14052,16 +13967,16 @@ func TestPhp5(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 299, - EndLine: 299, - StartPos: 5543, - EndPos: 5544, + EndLine: 299, + StartPos: 5543, + EndPos: 5544, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 299, - EndLine: 299, - StartPos: 5543, - EndPos: 5544, + EndLine: 299, + StartPos: 5543, + EndPos: 5544, }, Value: "b", }, @@ -14071,30 +13986,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 300, - EndLine: 300, - StartPos: 5549, - EndPos: 5557, + EndLine: 300, + StartPos: 5549, + EndPos: 5557, }, Expr: &assign.BitwiseAnd{ Position: &position.Position{ StartLine: 300, - EndLine: 300, - StartPos: 5549, - EndPos: 5556, + EndLine: 300, + StartPos: 5549, + EndPos: 5556, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 300, - EndLine: 300, - StartPos: 5549, - EndPos: 5550, + EndLine: 300, + StartPos: 5549, + EndPos: 5550, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 300, - EndLine: 300, - StartPos: 5549, - EndPos: 5550, + EndLine: 300, + StartPos: 5549, + EndPos: 5550, }, Value: "a", }, @@ -14102,16 +14017,16 @@ func TestPhp5(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 300, - EndLine: 300, - StartPos: 5555, - EndPos: 5556, + EndLine: 300, + StartPos: 5555, + EndPos: 5556, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 300, - EndLine: 300, - StartPos: 5555, - EndPos: 5556, + EndLine: 300, + StartPos: 5555, + EndPos: 5556, }, Value: "b", }, @@ -14121,30 +14036,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 301, - EndLine: 301, - StartPos: 5561, - EndPos: 5569, + EndLine: 301, + StartPos: 5561, + EndPos: 5569, }, Expr: &assign.BitwiseOr{ Position: &position.Position{ StartLine: 301, - EndLine: 301, - StartPos: 5561, - EndPos: 5568, + EndLine: 301, + StartPos: 5561, + EndPos: 5568, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 301, - EndLine: 301, - StartPos: 5561, - EndPos: 5562, + EndLine: 301, + StartPos: 5561, + EndPos: 5562, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 301, - EndLine: 301, - StartPos: 5561, - EndPos: 5562, + EndLine: 301, + StartPos: 5561, + EndPos: 5562, }, Value: "a", }, @@ -14152,16 +14067,16 @@ func TestPhp5(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 301, - EndLine: 301, - StartPos: 5567, - EndPos: 5568, + EndLine: 301, + StartPos: 5567, + EndPos: 5568, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 301, - EndLine: 301, - StartPos: 5567, - EndPos: 5568, + EndLine: 301, + StartPos: 5567, + EndPos: 5568, }, Value: "b", }, @@ -14171,30 +14086,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 302, - EndLine: 302, - StartPos: 5573, - EndPos: 5581, + EndLine: 302, + StartPos: 5573, + EndPos: 5581, }, Expr: &assign.BitwiseXor{ Position: &position.Position{ StartLine: 302, - EndLine: 302, - StartPos: 5573, - EndPos: 5580, + EndLine: 302, + StartPos: 5573, + EndPos: 5580, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 302, - EndLine: 302, - StartPos: 5573, - EndPos: 5574, + EndLine: 302, + StartPos: 5573, + EndPos: 5574, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 302, - EndLine: 302, - StartPos: 5573, - EndPos: 5574, + EndLine: 302, + StartPos: 5573, + EndPos: 5574, }, Value: "a", }, @@ -14202,16 +14117,16 @@ func TestPhp5(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 302, - EndLine: 302, - StartPos: 5579, - EndPos: 5580, + EndLine: 302, + StartPos: 5579, + EndPos: 5580, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 302, - EndLine: 302, - StartPos: 5579, - EndPos: 5580, + EndLine: 302, + StartPos: 5579, + EndPos: 5580, }, Value: "b", }, @@ -14221,30 +14136,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 303, - EndLine: 303, - StartPos: 5585, - EndPos: 5593, + EndLine: 303, + StartPos: 5585, + EndPos: 5593, }, Expr: &assign.Concat{ Position: &position.Position{ StartLine: 303, - EndLine: 303, - StartPos: 5585, - EndPos: 5592, + EndLine: 303, + StartPos: 5585, + EndPos: 5592, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 303, - EndLine: 303, - StartPos: 5585, - EndPos: 5586, + EndLine: 303, + StartPos: 5585, + EndPos: 5586, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 303, - EndLine: 303, - StartPos: 5585, - EndPos: 5586, + EndLine: 303, + StartPos: 5585, + EndPos: 5586, }, Value: "a", }, @@ -14252,16 +14167,16 @@ func TestPhp5(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 303, - EndLine: 303, - StartPos: 5591, - EndPos: 5592, + EndLine: 303, + StartPos: 5591, + EndPos: 5592, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 303, - EndLine: 303, - StartPos: 5591, - EndPos: 5592, + EndLine: 303, + StartPos: 5591, + EndPos: 5592, }, Value: "b", }, @@ -14271,30 +14186,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 304, - EndLine: 304, - StartPos: 5597, - EndPos: 5605, + EndLine: 304, + StartPos: 5597, + EndPos: 5605, }, Expr: &assign.Div{ Position: &position.Position{ StartLine: 304, - EndLine: 304, - StartPos: 5597, - EndPos: 5604, + EndLine: 304, + StartPos: 5597, + EndPos: 5604, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 304, - EndLine: 304, - StartPos: 5597, - EndPos: 5598, + EndLine: 304, + StartPos: 5597, + EndPos: 5598, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 304, - EndLine: 304, - StartPos: 5597, - EndPos: 5598, + EndLine: 304, + StartPos: 5597, + EndPos: 5598, }, Value: "a", }, @@ -14302,16 +14217,16 @@ func TestPhp5(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 304, - EndLine: 304, - StartPos: 5603, - EndPos: 5604, + EndLine: 304, + StartPos: 5603, + EndPos: 5604, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 304, - EndLine: 304, - StartPos: 5603, - EndPos: 5604, + EndLine: 304, + StartPos: 5603, + EndPos: 5604, }, Value: "b", }, @@ -14321,30 +14236,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 305, - EndLine: 305, - StartPos: 5609, - EndPos: 5617, + EndLine: 305, + StartPos: 5609, + EndPos: 5617, }, Expr: &assign.Minus{ Position: &position.Position{ StartLine: 305, - EndLine: 305, - StartPos: 5609, - EndPos: 5616, + EndLine: 305, + StartPos: 5609, + EndPos: 5616, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 305, - EndLine: 305, - StartPos: 5609, - EndPos: 5610, + EndLine: 305, + StartPos: 5609, + EndPos: 5610, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 305, - EndLine: 305, - StartPos: 5609, - EndPos: 5610, + EndLine: 305, + StartPos: 5609, + EndPos: 5610, }, Value: "a", }, @@ -14352,16 +14267,16 @@ func TestPhp5(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 305, - EndLine: 305, - StartPos: 5615, - EndPos: 5616, + EndLine: 305, + StartPos: 5615, + EndPos: 5616, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 305, - EndLine: 305, - StartPos: 5615, - EndPos: 5616, + EndLine: 305, + StartPos: 5615, + EndPos: 5616, }, Value: "b", }, @@ -14371,30 +14286,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 306, - EndLine: 306, - StartPos: 5621, - EndPos: 5629, + EndLine: 306, + StartPos: 5621, + EndPos: 5629, }, Expr: &assign.Mod{ Position: &position.Position{ StartLine: 306, - EndLine: 306, - StartPos: 5621, - EndPos: 5628, + EndLine: 306, + StartPos: 5621, + EndPos: 5628, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 306, - EndLine: 306, - StartPos: 5621, - EndPos: 5622, + EndLine: 306, + StartPos: 5621, + EndPos: 5622, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 306, - EndLine: 306, - StartPos: 5621, - EndPos: 5622, + EndLine: 306, + StartPos: 5621, + EndPos: 5622, }, Value: "a", }, @@ -14402,16 +14317,16 @@ func TestPhp5(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 306, - EndLine: 306, - StartPos: 5627, - EndPos: 5628, + EndLine: 306, + StartPos: 5627, + EndPos: 5628, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 306, - EndLine: 306, - StartPos: 5627, - EndPos: 5628, + EndLine: 306, + StartPos: 5627, + EndPos: 5628, }, Value: "b", }, @@ -14421,30 +14336,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 307, - EndLine: 307, - StartPos: 5633, - EndPos: 5641, + EndLine: 307, + StartPos: 5633, + EndPos: 5641, }, Expr: &assign.Mul{ Position: &position.Position{ StartLine: 307, - EndLine: 307, - StartPos: 5633, - EndPos: 5640, + EndLine: 307, + StartPos: 5633, + EndPos: 5640, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 307, - EndLine: 307, - StartPos: 5633, - EndPos: 5634, + EndLine: 307, + StartPos: 5633, + EndPos: 5634, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 307, - EndLine: 307, - StartPos: 5633, - EndPos: 5634, + EndLine: 307, + StartPos: 5633, + EndPos: 5634, }, Value: "a", }, @@ -14452,16 +14367,16 @@ func TestPhp5(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 307, - EndLine: 307, - StartPos: 5639, - EndPos: 5640, + EndLine: 307, + StartPos: 5639, + EndPos: 5640, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 307, - EndLine: 307, - StartPos: 5639, - EndPos: 5640, + EndLine: 307, + StartPos: 5639, + EndPos: 5640, }, Value: "b", }, @@ -14471,30 +14386,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 308, - EndLine: 308, - StartPos: 5645, - EndPos: 5653, + EndLine: 308, + StartPos: 5645, + EndPos: 5653, }, Expr: &assign.Plus{ Position: &position.Position{ StartLine: 308, - EndLine: 308, - StartPos: 5645, - EndPos: 5652, + EndLine: 308, + StartPos: 5645, + EndPos: 5652, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 308, - EndLine: 308, - StartPos: 5645, - EndPos: 5646, + EndLine: 308, + StartPos: 5645, + EndPos: 5646, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 308, - EndLine: 308, - StartPos: 5645, - EndPos: 5646, + EndLine: 308, + StartPos: 5645, + EndPos: 5646, }, Value: "a", }, @@ -14502,16 +14417,16 @@ func TestPhp5(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 308, - EndLine: 308, - StartPos: 5651, - EndPos: 5652, + EndLine: 308, + StartPos: 5651, + EndPos: 5652, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 308, - EndLine: 308, - StartPos: 5651, - EndPos: 5652, + EndLine: 308, + StartPos: 5651, + EndPos: 5652, }, Value: "b", }, @@ -14521,30 +14436,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 309, - EndLine: 309, - StartPos: 5657, - EndPos: 5666, + EndLine: 309, + StartPos: 5657, + EndPos: 5666, }, Expr: &assign.Pow{ Position: &position.Position{ StartLine: 309, - EndLine: 309, - StartPos: 5657, - EndPos: 5665, + EndLine: 309, + StartPos: 5657, + EndPos: 5665, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 309, - EndLine: 309, - StartPos: 5657, - EndPos: 5658, + EndLine: 309, + StartPos: 5657, + EndPos: 5658, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 309, - EndLine: 309, - StartPos: 5657, - EndPos: 5658, + EndLine: 309, + StartPos: 5657, + EndPos: 5658, }, Value: "a", }, @@ -14552,16 +14467,16 @@ func TestPhp5(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 309, - EndLine: 309, - StartPos: 5664, - EndPos: 5665, + EndLine: 309, + StartPos: 5664, + EndPos: 5665, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 309, - EndLine: 309, - StartPos: 5664, - EndPos: 5665, + EndLine: 309, + StartPos: 5664, + EndPos: 5665, }, Value: "b", }, @@ -14571,30 +14486,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 310, - EndLine: 310, - StartPos: 5670, - EndPos: 5679, + EndLine: 310, + StartPos: 5670, + EndPos: 5679, }, Expr: &assign.ShiftLeft{ Position: &position.Position{ StartLine: 310, - EndLine: 310, - StartPos: 5670, - EndPos: 5678, + EndLine: 310, + StartPos: 5670, + EndPos: 5678, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 310, - EndLine: 310, - StartPos: 5670, - EndPos: 5671, + EndLine: 310, + StartPos: 5670, + EndPos: 5671, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 310, - EndLine: 310, - StartPos: 5670, - EndPos: 5671, + EndLine: 310, + StartPos: 5670, + EndPos: 5671, }, Value: "a", }, @@ -14602,16 +14517,16 @@ func TestPhp5(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 310, - EndLine: 310, - StartPos: 5677, - EndPos: 5678, + EndLine: 310, + StartPos: 5677, + EndPos: 5678, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 310, - EndLine: 310, - StartPos: 5677, - EndPos: 5678, + EndLine: 310, + StartPos: 5677, + EndPos: 5678, }, Value: "b", }, @@ -14621,30 +14536,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 311, - EndLine: 311, - StartPos: 5683, - EndPos: 5692, + EndLine: 311, + StartPos: 5683, + EndPos: 5692, }, Expr: &assign.ShiftRight{ Position: &position.Position{ StartLine: 311, - EndLine: 311, - StartPos: 5683, - EndPos: 5691, + EndLine: 311, + StartPos: 5683, + EndPos: 5691, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 311, - EndLine: 311, - StartPos: 5683, - EndPos: 5684, + EndLine: 311, + StartPos: 5683, + EndPos: 5684, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 311, - EndLine: 311, - StartPos: 5683, - EndPos: 5684, + EndLine: 311, + StartPos: 5683, + EndPos: 5684, }, Value: "a", }, @@ -14652,16 +14567,16 @@ func TestPhp5(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 311, - EndLine: 311, - StartPos: 5690, - EndPos: 5691, + EndLine: 311, + StartPos: 5690, + EndPos: 5691, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 311, - EndLine: 311, - StartPos: 5690, - EndPos: 5691, + EndLine: 311, + StartPos: 5690, + EndPos: 5691, }, Value: "b", }, @@ -14671,31 +14586,31 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 314, - EndLine: 314, - StartPos: 5699, - EndPos: 5710, + EndLine: 314, + StartPos: 5699, + EndPos: 5710, }, Expr: &expr.New{ Position: &position.Position{ StartLine: 314, - EndLine: 314, - StartPos: 5699, - EndPos: 5708, + EndLine: 314, + StartPos: 5699, + EndPos: 5708, }, Class: &name.FullyQualified{ Position: &position.Position{ StartLine: 314, - EndLine: 314, - StartPos: 5703, - EndPos: 5706, + EndLine: 314, + StartPos: 5703, + EndPos: 5706, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 314, - EndLine: 314, - StartPos: 5704, - EndPos: 5706, + EndLine: 314, + StartPos: 5704, + EndPos: 5706, }, Value: "Foo", }, @@ -14704,9 +14619,9 @@ func TestPhp5(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 314, - EndLine: 314, - StartPos: 5707, - EndPos: 5708, + EndLine: 314, + StartPos: 5707, + EndPos: 5708, }, }, }, @@ -14714,45 +14629,45 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 315, - EndLine: 315, - StartPos: 5735, - EndPos: 5738, + EndLine: 315, + StartPos: 5735, + EndPos: 5738, }, Expr: &expr.PropertyFetch{ Position: &position.Position{ StartLine: 315, - EndLine: 315, - StartPos: 5735, - EndPos: 5737, + EndLine: 315, + StartPos: 5735, + EndPos: 5737, }, Variable: &expr.MethodCall{ Position: &position.Position{ StartLine: 315, - EndLine: 315, - StartPos: 5731, - EndPos: 5732, + EndLine: 315, + StartPos: 5731, + EndPos: 5732, }, Variable: &expr.New{ Position: &position.Position{ StartLine: 315, - EndLine: 315, - StartPos: 5715, - EndPos: 5724, + EndLine: 315, + StartPos: 5715, + EndPos: 5724, }, Class: &name.FullyQualified{ Position: &position.Position{ StartLine: 315, - EndLine: 315, - StartPos: 5719, - EndPos: 5722, + EndLine: 315, + StartPos: 5719, + EndPos: 5722, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 315, - EndLine: 315, - StartPos: 5720, - EndPos: 5722, + EndLine: 315, + StartPos: 5720, + EndPos: 5722, }, Value: "Foo", }, @@ -14761,36 +14676,36 @@ func TestPhp5(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 315, - EndLine: 315, - StartPos: 5723, - EndPos: 5724, + EndLine: 315, + StartPos: 5723, + EndPos: 5724, }, }, }, Method: &node.Identifier{ Position: &position.Position{ StartLine: 315, - EndLine: 315, - StartPos: 5728, - EndPos: 5730, + EndLine: 315, + StartPos: 5728, + EndPos: 5730, }, Value: "bar", }, ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 315, - EndLine: 315, - StartPos: 5731, - EndPos: 5732, + EndLine: 315, + StartPos: 5731, + EndPos: 5732, }, }, }, Property: &node.Identifier{ Position: &position.Position{ StartLine: 315, - EndLine: 315, - StartPos: 5735, - EndPos: 5737, + EndLine: 315, + StartPos: 5735, + EndPos: 5737, }, Value: "baz", }, @@ -14799,45 +14714,45 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 316, - EndLine: 316, - StartPos: 5758, - EndPos: 5760, + EndLine: 316, + StartPos: 5758, + EndPos: 5760, }, Expr: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 316, - EndLine: 316, - StartPos: 5758, - EndPos: 5758, + EndLine: 316, + StartPos: 5758, + EndPos: 5758, }, Variable: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 316, - EndLine: 316, - StartPos: 5755, - EndPos: 5755, + EndLine: 316, + StartPos: 5755, + EndPos: 5755, }, Variable: &expr.New{ Position: &position.Position{ StartLine: 316, - EndLine: 316, - StartPos: 5743, - EndPos: 5752, + EndLine: 316, + StartPos: 5743, + EndPos: 5752, }, Class: &name.FullyQualified{ Position: &position.Position{ StartLine: 316, - EndLine: 316, - StartPos: 5747, - EndPos: 5750, + EndLine: 316, + StartPos: 5747, + EndPos: 5750, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 316, - EndLine: 316, - StartPos: 5748, - EndPos: 5750, + EndLine: 316, + StartPos: 5748, + EndPos: 5750, }, Value: "Foo", }, @@ -14846,18 +14761,18 @@ func TestPhp5(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 316, - EndLine: 316, - StartPos: 5751, - EndPos: 5752, + EndLine: 316, + StartPos: 5751, + EndPos: 5752, }, }, }, Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 316, - EndLine: 316, - StartPos: 5755, - EndPos: 5755, + EndLine: 316, + StartPos: 5755, + EndPos: 5755, }, Value: "0", }, @@ -14865,9 +14780,9 @@ func TestPhp5(t *testing.T) { Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 316, - EndLine: 316, - StartPos: 5758, - EndPos: 5758, + EndLine: 316, + StartPos: 5758, + EndPos: 5758, }, Value: "0", }, @@ -14876,45 +14791,45 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 317, - EndLine: 317, - StartPos: 5784, - EndPos: 5786, + EndLine: 317, + StartPos: 5784, + EndPos: 5786, }, Expr: &expr.MethodCall{ Position: &position.Position{ StartLine: 317, - EndLine: 317, - StartPos: 5784, - EndPos: 5785, + EndLine: 317, + StartPos: 5784, + EndPos: 5785, }, Variable: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 317, - EndLine: 317, - StartPos: 5777, - EndPos: 5777, + EndLine: 317, + StartPos: 5777, + EndPos: 5777, }, Variable: &expr.New{ Position: &position.Position{ StartLine: 317, - EndLine: 317, - StartPos: 5765, - EndPos: 5774, + EndLine: 317, + StartPos: 5765, + EndPos: 5774, }, Class: &name.FullyQualified{ Position: &position.Position{ StartLine: 317, - EndLine: 317, - StartPos: 5769, - EndPos: 5772, + EndLine: 317, + StartPos: 5769, + EndPos: 5772, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 317, - EndLine: 317, - StartPos: 5770, - EndPos: 5772, + EndLine: 317, + StartPos: 5770, + EndPos: 5772, }, Value: "Foo", }, @@ -14923,18 +14838,18 @@ func TestPhp5(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 317, - EndLine: 317, - StartPos: 5773, - EndPos: 5774, + EndLine: 317, + StartPos: 5773, + EndPos: 5774, }, }, }, Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 317, - EndLine: 317, - StartPos: 5777, - EndPos: 5777, + EndLine: 317, + StartPos: 5777, + EndPos: 5777, }, Value: "0", }, @@ -14942,18 +14857,18 @@ func TestPhp5(t *testing.T) { Method: &node.Identifier{ Position: &position.Position{ StartLine: 317, - EndLine: 317, - StartPos: 5781, - EndPos: 5783, + EndLine: 317, + StartPos: 5781, + EndPos: 5783, }, Value: "bar", }, ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 317, - EndLine: 317, - StartPos: 5784, - EndPos: 5785, + EndLine: 317, + StartPos: 5784, + EndPos: 5785, }, }, }, @@ -14961,60 +14876,60 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 319, - EndLine: 319, - StartPos: 5791, - EndPos: 5807, + EndLine: 319, + StartPos: 5791, + EndPos: 5807, }, Expr: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 319, - EndLine: 319, - StartPos: 5791, - EndPos: 5806, + EndLine: 319, + StartPos: 5791, + EndPos: 5806, }, Variable: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 319, - EndLine: 319, - StartPos: 5791, - EndPos: 5803, + EndLine: 319, + StartPos: 5791, + EndPos: 5803, }, Variable: &expr.Array{ Position: &position.Position{ StartLine: 319, - EndLine: 319, - StartPos: 5791, - EndPos: 5800, + EndLine: 319, + StartPos: 5791, + EndPos: 5800, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 319, - EndLine: 319, - StartPos: 5797, - EndPos: 5799, + EndLine: 319, + StartPos: 5797, + EndPos: 5799, }, Val: &expr.ShortArray{ Position: &position.Position{ StartLine: 319, - EndLine: 319, - StartPos: 5797, - EndPos: 5799, + EndLine: 319, + StartPos: 5797, + EndPos: 5799, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 319, - EndLine: 319, - StartPos: 5798, - EndPos: 5798, + EndLine: 319, + StartPos: 5798, + EndPos: 5798, }, Val: &scalar.Lnumber{ Position: &position.Position{ StartLine: 319, - EndLine: 319, - StartPos: 5798, - EndPos: 5798, + EndLine: 319, + StartPos: 5798, + EndPos: 5798, }, Value: "0", }, @@ -15027,9 +14942,9 @@ func TestPhp5(t *testing.T) { Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 319, - EndLine: 319, - StartPos: 5802, - EndPos: 5802, + EndLine: 319, + StartPos: 5802, + EndPos: 5802, }, Value: "0", }, @@ -15037,9 +14952,9 @@ func TestPhp5(t *testing.T) { Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 319, - EndLine: 319, - StartPos: 5805, - EndPos: 5805, + EndLine: 319, + StartPos: 5805, + EndPos: 5805, }, Value: "0", }, @@ -15048,32 +14963,32 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 320, - EndLine: 320, - StartPos: 5811, - EndPos: 5819, + EndLine: 320, + StartPos: 5811, + EndPos: 5819, }, Expr: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 320, - EndLine: 320, - StartPos: 5811, - EndPos: 5818, + EndLine: 320, + StartPos: 5811, + EndPos: 5818, }, Variable: &scalar.String{ Position: &position.Position{ StartLine: 320, - EndLine: 320, - StartPos: 5811, - EndPos: 5815, + EndLine: 320, + StartPos: 5811, + EndPos: 5815, }, Value: "\"foo\"", }, Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 320, - EndLine: 320, - StartPos: 5817, - EndPos: 5817, + EndLine: 320, + StartPos: 5817, + EndPos: 5817, }, Value: "0", }, @@ -15082,38 +14997,38 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 321, - EndLine: 321, - StartPos: 5823, - EndPos: 5829, + EndLine: 321, + StartPos: 5823, + EndPos: 5829, }, Expr: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 321, - EndLine: 321, - StartPos: 5823, - EndPos: 5828, + EndLine: 321, + StartPos: 5823, + EndPos: 5828, }, Variable: &expr.ConstFetch{ Position: &position.Position{ StartLine: 321, - EndLine: 321, - StartPos: 5823, - EndPos: 5825, + EndLine: 321, + StartPos: 5823, + EndPos: 5825, }, Constant: &name.Name{ Position: &position.Position{ StartLine: 321, - EndLine: 321, - StartPos: 5823, - EndPos: 5825, + EndLine: 321, + StartPos: 5823, + EndPos: 5825, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 321, - EndLine: 321, - StartPos: 5823, - EndPos: 5825, + EndLine: 321, + StartPos: 5823, + EndPos: 5825, }, Value: "foo", }, @@ -15123,9 +15038,9 @@ func TestPhp5(t *testing.T) { Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 321, - EndLine: 321, - StartPos: 5827, - EndPos: 5827, + EndLine: 321, + StartPos: 5827, + EndPos: 5827, }, Value: "0", }, @@ -15134,32 +15049,32 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 322, - EndLine: 322, - StartPos: 5833, - EndPos: 5844, + EndLine: 322, + StartPos: 5833, + EndPos: 5844, }, Expr: &expr.ClassConstFetch{ Position: &position.Position{ StartLine: 322, - EndLine: 322, - StartPos: 5833, - EndPos: 5843, + EndLine: 322, + StartPos: 5833, + EndPos: 5843, }, Class: &node.Identifier{ Position: &position.Position{ StartLine: 322, - EndLine: 322, - StartPos: 5833, - EndPos: 5838, + EndLine: 322, + StartPos: 5833, + EndPos: 5838, }, Value: "static", }, ConstantName: &node.Identifier{ Position: &position.Position{ StartLine: 322, - EndLine: 322, - StartPos: 5841, - EndPos: 5843, + EndLine: 322, + StartPos: 5841, + EndPos: 5843, }, Value: "foo", }, @@ -15168,30 +15083,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 324, - EndLine: 324, - StartPos: 5849, - EndPos: 5857, + EndLine: 324, + StartPos: 5849, + EndPos: 5857, }, Expr: &expr.New{ Position: &position.Position{ StartLine: 324, - EndLine: 324, - StartPos: 5849, - EndPos: 5856, + EndLine: 324, + StartPos: 5849, + EndPos: 5856, }, Class: &expr.Variable{ Position: &position.Position{ StartLine: 324, - EndLine: 324, - StartPos: 5853, - EndPos: 5856, + EndLine: 324, + StartPos: 5853, + EndPos: 5856, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 324, - EndLine: 324, - StartPos: 5853, - EndPos: 5856, + EndLine: 324, + StartPos: 5853, + EndPos: 5856, }, Value: "foo", }, @@ -15201,37 +15116,37 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 325, - EndLine: 325, - StartPos: 5861, - EndPos: 5875, + EndLine: 325, + StartPos: 5861, + EndPos: 5875, }, Expr: &expr.New{ Position: &position.Position{ StartLine: 325, - EndLine: 325, - StartPos: 5861, - EndPos: 5874, + EndLine: 325, + StartPos: 5861, + EndPos: 5874, }, Class: &expr.StaticPropertyFetch{ Position: &position.Position{ StartLine: 325, - EndLine: 325, - StartPos: 5865, - EndPos: 5874, + EndLine: 325, + StartPos: 5865, + EndPos: 5874, }, Class: &expr.Variable{ Position: &position.Position{ StartLine: 325, - EndLine: 325, - StartPos: 5865, - EndPos: 5868, + EndLine: 325, + StartPos: 5865, + EndPos: 5868, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 325, - EndLine: 325, - StartPos: 5865, - EndPos: 5868, + EndLine: 325, + StartPos: 5865, + EndPos: 5868, }, Value: "foo", }, @@ -15239,16 +15154,16 @@ func TestPhp5(t *testing.T) { Property: &expr.Variable{ Position: &position.Position{ StartLine: 325, - EndLine: 325, - StartPos: 5871, - EndPos: 5874, + EndLine: 325, + StartPos: 5871, + EndPos: 5874, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 325, - EndLine: 325, - StartPos: 5871, - EndPos: 5874, + EndLine: 325, + StartPos: 5871, + EndPos: 5874, }, Value: "bar", }, @@ -15259,44 +15174,44 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 326, - EndLine: 326, - StartPos: 5879, - EndPos: 5891, + EndLine: 326, + StartPos: 5879, + EndPos: 5891, }, Expr: &expr.New{ Position: &position.Position{ StartLine: 326, - EndLine: 326, - StartPos: 5879, - EndPos: 5889, + EndLine: 326, + StartPos: 5879, + EndPos: 5889, }, Class: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 326, - EndLine: 326, - StartPos: 5889, - EndPos: 5889, + EndLine: 326, + StartPos: 5889, + EndPos: 5889, }, Variable: &expr.PropertyFetch{ Position: &position.Position{ StartLine: 326, - EndLine: 326, - StartPos: 5887, - EndPos: 5889, + EndLine: 326, + StartPos: 5887, + EndPos: 5889, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 326, - EndLine: 326, - StartPos: 5883, - EndPos: 5887, + EndLine: 326, + StartPos: 5883, + EndPos: 5887, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 326, - EndLine: 326, - StartPos: 5883, - EndPos: 5884, + EndLine: 326, + StartPos: 5883, + EndPos: 5884, }, Value: "a", }, @@ -15304,9 +15219,9 @@ func TestPhp5(t *testing.T) { Property: &node.Identifier{ Position: &position.Position{ StartLine: 326, - EndLine: 326, - StartPos: 5887, - EndPos: 5887, + EndLine: 326, + StartPos: 5887, + EndPos: 5887, }, Value: "b", }, @@ -15314,9 +15229,9 @@ func TestPhp5(t *testing.T) { Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 326, - EndLine: 326, - StartPos: 5889, - EndPos: 5889, + EndLine: 326, + StartPos: 5889, + EndPos: 5889, }, Value: "0", }, @@ -15326,65 +15241,65 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5895, - EndPos: 5926, + EndLine: 327, + StartPos: 5895, + EndPos: 5926, }, Expr: &expr.New{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5895, - EndPos: 5924, + EndLine: 327, + StartPos: 5895, + EndPos: 5924, }, Class: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5924, - EndPos: 5924, + EndLine: 327, + StartPos: 5924, + EndPos: 5924, }, Variable: &expr.PropertyFetch{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5922, - EndPos: 5924, + EndLine: 327, + StartPos: 5922, + EndPos: 5924, }, Variable: &expr.PropertyFetch{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5918, - EndPos: 5922, + EndLine: 327, + StartPos: 5918, + EndPos: 5922, }, Variable: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5905, - EndPos: 5919, + EndLine: 327, + StartPos: 5905, + EndPos: 5919, }, Variable: &expr.PropertyFetch{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5903, - EndPos: 5914, + EndLine: 327, + StartPos: 5903, + EndPos: 5914, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5899, - EndPos: 5903, + EndLine: 327, + StartPos: 5899, + EndPos: 5903, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5899, - EndPos: 5900, + EndLine: 327, + StartPos: 5899, + EndPos: 5900, }, Value: "a", }, @@ -15392,9 +15307,9 @@ func TestPhp5(t *testing.T) { Property: &node.Identifier{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5903, - EndPos: 5903, + EndLine: 327, + StartPos: 5903, + EndPos: 5903, }, Value: "b", }, @@ -15402,23 +15317,23 @@ func TestPhp5(t *testing.T) { Dim: &expr.Ternary{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5905, - EndPos: 5914, + EndLine: 327, + StartPos: 5905, + EndPos: 5914, }, Condition: &expr.Variable{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5905, - EndPos: 5906, + EndLine: 327, + StartPos: 5905, + EndPos: 5906, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5905, - EndPos: 5906, + EndLine: 327, + StartPos: 5905, + EndPos: 5906, }, Value: "b", }, @@ -15426,24 +15341,24 @@ func TestPhp5(t *testing.T) { IfFalse: &expr.ConstFetch{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5911, - EndPos: 5914, + EndLine: 327, + StartPos: 5911, + EndPos: 5914, }, Constant: &name.Name{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5911, - EndPos: 5914, + EndLine: 327, + StartPos: 5911, + EndPos: 5914, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5911, - EndPos: 5914, + EndLine: 327, + StartPos: 5911, + EndPos: 5914, }, Value: "null", }, @@ -15455,16 +15370,16 @@ func TestPhp5(t *testing.T) { Property: &expr.Variable{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5918, - EndPos: 5919, + EndLine: 327, + StartPos: 5918, + EndPos: 5919, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5918, - EndPos: 5919, + EndLine: 327, + StartPos: 5918, + EndPos: 5919, }, Value: "c", }, @@ -15473,9 +15388,9 @@ func TestPhp5(t *testing.T) { Property: &node.Identifier{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5922, - EndPos: 5922, + EndLine: 327, + StartPos: 5922, + EndPos: 5922, }, Value: "d", }, @@ -15483,9 +15398,9 @@ func TestPhp5(t *testing.T) { Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5924, - EndPos: 5924, + EndLine: 327, + StartPos: 5924, + EndPos: 5924, }, Value: "0", }, @@ -15495,31 +15410,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5927, - EndPos: 5945, + EndLine: 327, + StartPos: 5927, + EndPos: 5945, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5934, - EndPos: 5944, + EndLine: 327, + StartPos: 5934, + EndPos: 5944, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5934, - EndPos: 5935, + EndLine: 327, + StartPos: 5934, + EndPos: 5935, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5934, - EndPos: 5935, + EndLine: 327, + StartPos: 5934, + EndPos: 5935, }, Value: "a", }, @@ -15527,31 +15442,31 @@ func TestPhp5(t *testing.T) { Expr: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5939, - EndPos: 5944, + EndLine: 327, + StartPos: 5939, + EndPos: 5944, }, Variable: &expr.ShortArray{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5939, - EndPos: 5941, + EndLine: 327, + StartPos: 5939, + EndPos: 5941, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5940, - EndPos: 5940, + EndLine: 327, + StartPos: 5940, + EndPos: 5940, }, Val: &scalar.Lnumber{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5940, - EndPos: 5940, + EndLine: 327, + StartPos: 5940, + EndPos: 5940, }, Value: "1", }, @@ -15561,9 +15476,9 @@ func TestPhp5(t *testing.T) { Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5943, - EndPos: 5943, + EndLine: 327, + StartPos: 5943, + EndPos: 5943, }, Value: "0", }, @@ -15574,31 +15489,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 329, - EndLine: 329, - StartPos: 5950, - EndPos: 5964, + EndLine: 329, + StartPos: 5950, + EndPos: 5964, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 329, - EndLine: 329, - StartPos: 5957, - EndPos: 5963, + EndLine: 329, + StartPos: 5957, + EndPos: 5963, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 329, - EndLine: 329, - StartPos: 5957, - EndPos: 5958, + EndLine: 329, + StartPos: 5957, + EndPos: 5958, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 329, - EndLine: 329, - StartPos: 5957, - EndPos: 5958, + EndLine: 329, + StartPos: 5957, + EndPos: 5958, }, Value: "a", }, @@ -15606,16 +15521,16 @@ func TestPhp5(t *testing.T) { Expr: &expr.BooleanNot{ Position: &position.Position{ StartLine: 329, - EndLine: 329, - StartPos: 5962, - EndPos: 5963, + EndLine: 329, + StartPos: 5962, + EndPos: 5963, }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 329, - EndLine: 329, - StartPos: 5963, - EndPos: 5963, + EndLine: 329, + StartPos: 5963, + EndPos: 5963, }, Value: "1", }, @@ -15626,31 +15541,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 330, - EndLine: 330, - StartPos: 5968, - EndPos: 5982, + EndLine: 330, + StartPos: 5968, + EndPos: 5982, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 330, - EndLine: 330, - StartPos: 5975, - EndPos: 5981, + EndLine: 330, + StartPos: 5975, + EndPos: 5981, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 330, - EndLine: 330, - StartPos: 5975, - EndPos: 5976, + EndLine: 330, + StartPos: 5975, + EndPos: 5976, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 330, - EndLine: 330, - StartPos: 5975, - EndPos: 5976, + EndLine: 330, + StartPos: 5975, + EndPos: 5976, }, Value: "a", }, @@ -15658,16 +15573,16 @@ func TestPhp5(t *testing.T) { Expr: &expr.BitwiseNot{ Position: &position.Position{ StartLine: 330, - EndLine: 330, - StartPos: 5980, - EndPos: 5981, + EndLine: 330, + StartPos: 5980, + EndPos: 5981, }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 330, - EndLine: 330, - StartPos: 5981, - EndPos: 5981, + EndLine: 330, + StartPos: 5981, + EndPos: 5981, }, Value: "1", }, @@ -15678,31 +15593,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 331, - EndLine: 331, - StartPos: 5986, - EndPos: 6000, + EndLine: 331, + StartPos: 5986, + EndPos: 6000, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 331, - EndLine: 331, - StartPos: 5993, - EndPos: 5999, + EndLine: 331, + StartPos: 5993, + EndPos: 5999, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 331, - EndLine: 331, - StartPos: 5993, - EndPos: 5994, + EndLine: 331, + StartPos: 5993, + EndPos: 5994, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 331, - EndLine: 331, - StartPos: 5993, - EndPos: 5994, + EndLine: 331, + StartPos: 5993, + EndPos: 5994, }, Value: "a", }, @@ -15710,16 +15625,16 @@ func TestPhp5(t *testing.T) { Expr: &expr.UnaryPlus{ Position: &position.Position{ StartLine: 331, - EndLine: 331, - StartPos: 5998, - EndPos: 5999, + EndLine: 331, + StartPos: 5998, + EndPos: 5999, }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 331, - EndLine: 331, - StartPos: 5999, - EndPos: 5999, + EndLine: 331, + StartPos: 5999, + EndPos: 5999, }, Value: "1", }, @@ -15730,31 +15645,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 332, - EndLine: 332, - StartPos: 6004, - EndPos: 6018, + EndLine: 332, + StartPos: 6004, + EndPos: 6018, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 332, - EndLine: 332, - StartPos: 6011, - EndPos: 6017, + EndLine: 332, + StartPos: 6011, + EndPos: 6017, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 332, - EndLine: 332, - StartPos: 6011, - EndPos: 6012, + EndLine: 332, + StartPos: 6011, + EndPos: 6012, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 332, - EndLine: 332, - StartPos: 6011, - EndPos: 6012, + EndLine: 332, + StartPos: 6011, + EndPos: 6012, }, Value: "a", }, @@ -15762,16 +15677,16 @@ func TestPhp5(t *testing.T) { Expr: &expr.UnaryMinus{ Position: &position.Position{ StartLine: 332, - EndLine: 332, - StartPos: 6016, - EndPos: 6017, + EndLine: 332, + StartPos: 6016, + EndPos: 6017, }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 332, - EndLine: 332, - StartPos: 6017, - EndPos: 6017, + EndLine: 332, + StartPos: 6017, + EndPos: 6017, }, Value: "1", }, @@ -15782,31 +15697,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 333, - EndLine: 333, - StartPos: 6022, - EndPos: 6037, + EndLine: 333, + StartPos: 6022, + EndPos: 6037, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 333, - EndLine: 333, - StartPos: 6029, - EndPos: 6035, + EndLine: 333, + StartPos: 6029, + EndPos: 6035, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 333, - EndLine: 333, - StartPos: 6029, - EndPos: 6030, + EndLine: 333, + StartPos: 6029, + EndPos: 6030, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 333, - EndLine: 333, - StartPos: 6029, - EndPos: 6030, + EndLine: 333, + StartPos: 6029, + EndPos: 6030, }, Value: "a", }, @@ -15814,9 +15729,9 @@ func TestPhp5(t *testing.T) { Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 333, - EndLine: 333, - StartPos: 6035, - EndPos: 6035, + EndLine: 333, + StartPos: 6035, + EndPos: 6035, }, Value: "1", }, @@ -15826,31 +15741,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 334, - EndLine: 334, - StartPos: 6041, - EndPos: 6059, + EndLine: 334, + StartPos: 6041, + EndPos: 6059, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 334, - EndLine: 334, - StartPos: 6048, - EndPos: 6058, + EndLine: 334, + StartPos: 6048, + EndPos: 6058, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 334, - EndLine: 334, - StartPos: 6048, - EndPos: 6049, + EndLine: 334, + StartPos: 6048, + EndPos: 6049, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 334, - EndLine: 334, - StartPos: 6048, - EndPos: 6049, + EndLine: 334, + StartPos: 6048, + EndPos: 6049, }, Value: "a", }, @@ -15858,25 +15773,25 @@ func TestPhp5(t *testing.T) { Expr: &expr.Ternary{ Position: &position.Position{ StartLine: 334, - EndLine: 334, - StartPos: 6053, - EndPos: 6058, + EndLine: 334, + StartPos: 6053, + EndPos: 6058, }, Condition: &scalar.Lnumber{ Position: &position.Position{ StartLine: 334, - EndLine: 334, - StartPos: 6053, - EndPos: 6053, + EndLine: 334, + StartPos: 6053, + EndPos: 6053, }, Value: "1", }, IfFalse: &scalar.Lnumber{ Position: &position.Position{ StartLine: 334, - EndLine: 334, - StartPos: 6058, - EndPos: 6058, + EndLine: 334, + StartPos: 6058, + EndPos: 6058, }, Value: "2", }, @@ -15887,31 +15802,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 335, - EndLine: 335, - StartPos: 6063, - EndPos: 6084, + EndLine: 335, + StartPos: 6063, + EndPos: 6084, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 335, - EndLine: 335, - StartPos: 6070, - EndPos: 6083, + EndLine: 335, + StartPos: 6070, + EndPos: 6083, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 335, - EndLine: 335, - StartPos: 6070, - EndPos: 6071, + EndLine: 335, + StartPos: 6070, + EndPos: 6071, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 335, - EndLine: 335, - StartPos: 6070, - EndPos: 6071, + EndLine: 335, + StartPos: 6070, + EndPos: 6071, }, Value: "a", }, @@ -15919,34 +15834,34 @@ func TestPhp5(t *testing.T) { Expr: &expr.Ternary{ Position: &position.Position{ StartLine: 335, - EndLine: 335, - StartPos: 6075, - EndPos: 6083, + EndLine: 335, + StartPos: 6075, + EndPos: 6083, }, Condition: &scalar.Lnumber{ Position: &position.Position{ StartLine: 335, - EndLine: 335, - StartPos: 6075, - EndPos: 6075, + EndLine: 335, + StartPos: 6075, + EndPos: 6075, }, Value: "1", }, IfTrue: &scalar.Lnumber{ Position: &position.Position{ StartLine: 335, - EndLine: 335, - StartPos: 6079, - EndPos: 6079, + EndLine: 335, + StartPos: 6079, + EndPos: 6079, }, Value: "2", }, IfFalse: &scalar.Lnumber{ Position: &position.Position{ StartLine: 335, - EndLine: 335, - StartPos: 6083, - EndPos: 6083, + EndLine: 335, + StartPos: 6083, + EndPos: 6083, }, Value: "3", }, @@ -15957,31 +15872,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 336, - EndLine: 336, - StartPos: 6088, - EndPos: 6105, + EndLine: 336, + StartPos: 6088, + EndPos: 6105, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 336, - EndLine: 336, - StartPos: 6095, - EndPos: 6104, + EndLine: 336, + StartPos: 6095, + EndPos: 6104, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 336, - EndLine: 336, - StartPos: 6095, - EndPos: 6096, + EndLine: 336, + StartPos: 6095, + EndPos: 6096, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 336, - EndLine: 336, - StartPos: 6095, - EndPos: 6096, + EndLine: 336, + StartPos: 6095, + EndPos: 6096, }, Value: "a", }, @@ -15989,25 +15904,25 @@ func TestPhp5(t *testing.T) { Expr: &binary.BitwiseAnd{ Position: &position.Position{ StartLine: 336, - EndLine: 336, - StartPos: 6100, - EndPos: 6104, + EndLine: 336, + StartPos: 6100, + EndPos: 6104, }, Left: &scalar.Lnumber{ Position: &position.Position{ StartLine: 336, - EndLine: 336, - StartPos: 6100, - EndPos: 6100, + EndLine: 336, + StartPos: 6100, + EndPos: 6100, }, Value: "1", }, Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 336, - EndLine: 336, - StartPos: 6104, - EndPos: 6104, + EndLine: 336, + StartPos: 6104, + EndPos: 6104, }, Value: "2", }, @@ -16018,31 +15933,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 337, - EndLine: 337, - StartPos: 6109, - EndPos: 6126, + EndLine: 337, + StartPos: 6109, + EndPos: 6126, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 337, - EndLine: 337, - StartPos: 6116, - EndPos: 6125, + EndLine: 337, + StartPos: 6116, + EndPos: 6125, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 337, - EndLine: 337, - StartPos: 6116, - EndPos: 6117, + EndLine: 337, + StartPos: 6116, + EndPos: 6117, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 337, - EndLine: 337, - StartPos: 6116, - EndPos: 6117, + EndLine: 337, + StartPos: 6116, + EndPos: 6117, }, Value: "a", }, @@ -16050,25 +15965,25 @@ func TestPhp5(t *testing.T) { Expr: &binary.BitwiseOr{ Position: &position.Position{ StartLine: 337, - EndLine: 337, - StartPos: 6121, - EndPos: 6125, + EndLine: 337, + StartPos: 6121, + EndPos: 6125, }, Left: &scalar.Lnumber{ Position: &position.Position{ StartLine: 337, - EndLine: 337, - StartPos: 6121, - EndPos: 6121, + EndLine: 337, + StartPos: 6121, + EndPos: 6121, }, Value: "1", }, Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 337, - EndLine: 337, - StartPos: 6125, - EndPos: 6125, + EndLine: 337, + StartPos: 6125, + EndPos: 6125, }, Value: "2", }, @@ -16079,31 +15994,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 338, - EndLine: 338, - StartPos: 6130, - EndPos: 6147, + EndLine: 338, + StartPos: 6130, + EndPos: 6147, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 338, - EndLine: 338, - StartPos: 6137, - EndPos: 6146, + EndLine: 338, + StartPos: 6137, + EndPos: 6146, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 338, - EndLine: 338, - StartPos: 6137, - EndPos: 6138, + EndLine: 338, + StartPos: 6137, + EndPos: 6138, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 338, - EndLine: 338, - StartPos: 6137, - EndPos: 6138, + EndLine: 338, + StartPos: 6137, + EndPos: 6138, }, Value: "a", }, @@ -16111,25 +16026,25 @@ func TestPhp5(t *testing.T) { Expr: &binary.BitwiseXor{ Position: &position.Position{ StartLine: 338, - EndLine: 338, - StartPos: 6142, - EndPos: 6146, + EndLine: 338, + StartPos: 6142, + EndPos: 6146, }, Left: &scalar.Lnumber{ Position: &position.Position{ StartLine: 338, - EndLine: 338, - StartPos: 6142, - EndPos: 6142, + EndLine: 338, + StartPos: 6142, + EndPos: 6142, }, Value: "1", }, Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 338, - EndLine: 338, - StartPos: 6146, - EndPos: 6146, + EndLine: 338, + StartPos: 6146, + EndPos: 6146, }, Value: "2", }, @@ -16140,31 +16055,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 339, - EndLine: 339, - StartPos: 6151, - EndPos: 6169, + EndLine: 339, + StartPos: 6151, + EndPos: 6169, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 339, - EndLine: 339, - StartPos: 6158, - EndPos: 6168, + EndLine: 339, + StartPos: 6158, + EndPos: 6168, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 339, - EndLine: 339, - StartPos: 6158, - EndPos: 6159, + EndLine: 339, + StartPos: 6158, + EndPos: 6159, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 339, - EndLine: 339, - StartPos: 6158, - EndPos: 6159, + EndLine: 339, + StartPos: 6158, + EndPos: 6159, }, Value: "a", }, @@ -16172,25 +16087,25 @@ func TestPhp5(t *testing.T) { Expr: &binary.BooleanAnd{ Position: &position.Position{ StartLine: 339, - EndLine: 339, - StartPos: 6163, - EndPos: 6168, + EndLine: 339, + StartPos: 6163, + EndPos: 6168, }, Left: &scalar.Lnumber{ Position: &position.Position{ StartLine: 339, - EndLine: 339, - StartPos: 6163, - EndPos: 6163, + EndLine: 339, + StartPos: 6163, + EndPos: 6163, }, Value: "1", }, Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 339, - EndLine: 339, - StartPos: 6168, - EndPos: 6168, + EndLine: 339, + StartPos: 6168, + EndPos: 6168, }, Value: "2", }, @@ -16201,31 +16116,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 340, - EndLine: 340, - StartPos: 6173, - EndPos: 6191, + EndLine: 340, + StartPos: 6173, + EndPos: 6191, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 340, - EndLine: 340, - StartPos: 6180, - EndPos: 6190, + EndLine: 340, + StartPos: 6180, + EndPos: 6190, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 340, - EndLine: 340, - StartPos: 6180, - EndPos: 6181, + EndLine: 340, + StartPos: 6180, + EndPos: 6181, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 340, - EndLine: 340, - StartPos: 6180, - EndPos: 6181, + EndLine: 340, + StartPos: 6180, + EndPos: 6181, }, Value: "a", }, @@ -16233,25 +16148,25 @@ func TestPhp5(t *testing.T) { Expr: &binary.BooleanOr{ Position: &position.Position{ StartLine: 340, - EndLine: 340, - StartPos: 6185, - EndPos: 6190, + EndLine: 340, + StartPos: 6185, + EndPos: 6190, }, Left: &scalar.Lnumber{ Position: &position.Position{ StartLine: 340, - EndLine: 340, - StartPos: 6185, - EndPos: 6185, + EndLine: 340, + StartPos: 6185, + EndPos: 6185, }, Value: "1", }, Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 340, - EndLine: 340, - StartPos: 6190, - EndPos: 6190, + EndLine: 340, + StartPos: 6190, + EndPos: 6190, }, Value: "2", }, @@ -16262,31 +16177,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 341, - EndLine: 341, - StartPos: 6195, - EndPos: 6212, + EndLine: 341, + StartPos: 6195, + EndPos: 6212, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 341, - EndLine: 341, - StartPos: 6202, - EndPos: 6211, + EndLine: 341, + StartPos: 6202, + EndPos: 6211, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 341, - EndLine: 341, - StartPos: 6202, - EndPos: 6203, + EndLine: 341, + StartPos: 6202, + EndPos: 6203, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 341, - EndLine: 341, - StartPos: 6202, - EndPos: 6203, + EndLine: 341, + StartPos: 6202, + EndPos: 6203, }, Value: "a", }, @@ -16294,25 +16209,25 @@ func TestPhp5(t *testing.T) { Expr: &binary.Concat{ Position: &position.Position{ StartLine: 341, - EndLine: 341, - StartPos: 6207, - EndPos: 6211, + EndLine: 341, + StartPos: 6207, + EndPos: 6211, }, Left: &scalar.Lnumber{ Position: &position.Position{ StartLine: 341, - EndLine: 341, - StartPos: 6207, - EndPos: 6207, + EndLine: 341, + StartPos: 6207, + EndPos: 6207, }, Value: "1", }, Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 341, - EndLine: 341, - StartPos: 6211, - EndPos: 6211, + EndLine: 341, + StartPos: 6211, + EndPos: 6211, }, Value: "2", }, @@ -16323,31 +16238,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 342, - EndLine: 342, - StartPos: 6216, - EndPos: 6233, + EndLine: 342, + StartPos: 6216, + EndPos: 6233, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 342, - EndLine: 342, - StartPos: 6223, - EndPos: 6232, + EndLine: 342, + StartPos: 6223, + EndPos: 6232, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 342, - EndLine: 342, - StartPos: 6223, - EndPos: 6224, + EndLine: 342, + StartPos: 6223, + EndPos: 6224, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 342, - EndLine: 342, - StartPos: 6223, - EndPos: 6224, + EndLine: 342, + StartPos: 6223, + EndPos: 6224, }, Value: "a", }, @@ -16355,25 +16270,25 @@ func TestPhp5(t *testing.T) { Expr: &binary.Div{ Position: &position.Position{ StartLine: 342, - EndLine: 342, - StartPos: 6228, - EndPos: 6232, + EndLine: 342, + StartPos: 6228, + EndPos: 6232, }, Left: &scalar.Lnumber{ Position: &position.Position{ StartLine: 342, - EndLine: 342, - StartPos: 6228, - EndPos: 6228, + EndLine: 342, + StartPos: 6228, + EndPos: 6228, }, Value: "1", }, Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 342, - EndLine: 342, - StartPos: 6232, - EndPos: 6232, + EndLine: 342, + StartPos: 6232, + EndPos: 6232, }, Value: "2", }, @@ -16384,31 +16299,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 343, - EndLine: 343, - StartPos: 6237, - EndPos: 6255, + EndLine: 343, + StartPos: 6237, + EndPos: 6255, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 343, - EndLine: 343, - StartPos: 6244, - EndPos: 6254, + EndLine: 343, + StartPos: 6244, + EndPos: 6254, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 343, - EndLine: 343, - StartPos: 6244, - EndPos: 6245, + EndLine: 343, + StartPos: 6244, + EndPos: 6245, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 343, - EndLine: 343, - StartPos: 6244, - EndPos: 6245, + EndLine: 343, + StartPos: 6244, + EndPos: 6245, }, Value: "a", }, @@ -16416,25 +16331,25 @@ func TestPhp5(t *testing.T) { Expr: &binary.Equal{ Position: &position.Position{ StartLine: 343, - EndLine: 343, - StartPos: 6249, - EndPos: 6254, + EndLine: 343, + StartPos: 6249, + EndPos: 6254, }, Left: &scalar.Lnumber{ Position: &position.Position{ StartLine: 343, - EndLine: 343, - StartPos: 6249, - EndPos: 6249, + EndLine: 343, + StartPos: 6249, + EndPos: 6249, }, Value: "1", }, Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 343, - EndLine: 343, - StartPos: 6254, - EndPos: 6254, + EndLine: 343, + StartPos: 6254, + EndPos: 6254, }, Value: "2", }, @@ -16445,31 +16360,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 344, - EndLine: 344, - StartPos: 6259, - EndPos: 6277, + EndLine: 344, + StartPos: 6259, + EndPos: 6277, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 344, - EndLine: 344, - StartPos: 6266, - EndPos: 6276, + EndLine: 344, + StartPos: 6266, + EndPos: 6276, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 344, - EndLine: 344, - StartPos: 6266, - EndPos: 6267, + EndLine: 344, + StartPos: 6266, + EndPos: 6267, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 344, - EndLine: 344, - StartPos: 6266, - EndPos: 6267, + EndLine: 344, + StartPos: 6266, + EndPos: 6267, }, Value: "a", }, @@ -16477,25 +16392,25 @@ func TestPhp5(t *testing.T) { Expr: &binary.GreaterOrEqual{ Position: &position.Position{ StartLine: 344, - EndLine: 344, - StartPos: 6271, - EndPos: 6276, + EndLine: 344, + StartPos: 6271, + EndPos: 6276, }, Left: &scalar.Lnumber{ Position: &position.Position{ StartLine: 344, - EndLine: 344, - StartPos: 6271, - EndPos: 6271, + EndLine: 344, + StartPos: 6271, + EndPos: 6271, }, Value: "1", }, Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 344, - EndLine: 344, - StartPos: 6276, - EndPos: 6276, + EndLine: 344, + StartPos: 6276, + EndPos: 6276, }, Value: "2", }, @@ -16506,31 +16421,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 345, - EndLine: 345, - StartPos: 6281, - EndPos: 6298, + EndLine: 345, + StartPos: 6281, + EndPos: 6298, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 345, - EndLine: 345, - StartPos: 6288, - EndPos: 6297, + EndLine: 345, + StartPos: 6288, + EndPos: 6297, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 345, - EndLine: 345, - StartPos: 6288, - EndPos: 6289, + EndLine: 345, + StartPos: 6288, + EndPos: 6289, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 345, - EndLine: 345, - StartPos: 6288, - EndPos: 6289, + EndLine: 345, + StartPos: 6288, + EndPos: 6289, }, Value: "a", }, @@ -16538,25 +16453,25 @@ func TestPhp5(t *testing.T) { Expr: &binary.Greater{ Position: &position.Position{ StartLine: 345, - EndLine: 345, - StartPos: 6293, - EndPos: 6297, + EndLine: 345, + StartPos: 6293, + EndPos: 6297, }, Left: &scalar.Lnumber{ Position: &position.Position{ StartLine: 345, - EndLine: 345, - StartPos: 6293, - EndPos: 6293, + EndLine: 345, + StartPos: 6293, + EndPos: 6293, }, Value: "1", }, Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 345, - EndLine: 345, - StartPos: 6297, - EndPos: 6297, + EndLine: 345, + StartPos: 6297, + EndPos: 6297, }, Value: "2", }, @@ -16567,31 +16482,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 346, - EndLine: 346, - StartPos: 6302, - EndPos: 6321, + EndLine: 346, + StartPos: 6302, + EndPos: 6321, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 346, - EndLine: 346, - StartPos: 6309, - EndPos: 6320, + EndLine: 346, + StartPos: 6309, + EndPos: 6320, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 346, - EndLine: 346, - StartPos: 6309, - EndPos: 6310, + EndLine: 346, + StartPos: 6309, + EndPos: 6310, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 346, - EndLine: 346, - StartPos: 6309, - EndPos: 6310, + EndLine: 346, + StartPos: 6309, + EndPos: 6310, }, Value: "a", }, @@ -16599,25 +16514,25 @@ func TestPhp5(t *testing.T) { Expr: &binary.Identical{ Position: &position.Position{ StartLine: 346, - EndLine: 346, - StartPos: 6314, - EndPos: 6320, + EndLine: 346, + StartPos: 6314, + EndPos: 6320, }, Left: &scalar.Lnumber{ Position: &position.Position{ StartLine: 346, - EndLine: 346, - StartPos: 6314, - EndPos: 6314, + EndLine: 346, + StartPos: 6314, + EndPos: 6314, }, Value: "1", }, Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 346, - EndLine: 346, - StartPos: 6320, - EndPos: 6320, + EndLine: 346, + StartPos: 6320, + EndPos: 6320, }, Value: "2", }, @@ -16628,31 +16543,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 347, - EndLine: 347, - StartPos: 6325, - EndPos: 6344, + EndLine: 347, + StartPos: 6325, + EndPos: 6344, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 347, - EndLine: 347, - StartPos: 6332, - EndPos: 6343, + EndLine: 347, + StartPos: 6332, + EndPos: 6343, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 347, - EndLine: 347, - StartPos: 6332, - EndPos: 6333, + EndLine: 347, + StartPos: 6332, + EndPos: 6333, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 347, - EndLine: 347, - StartPos: 6332, - EndPos: 6333, + EndLine: 347, + StartPos: 6332, + EndPos: 6333, }, Value: "a", }, @@ -16660,25 +16575,25 @@ func TestPhp5(t *testing.T) { Expr: &binary.LogicalAnd{ Position: &position.Position{ StartLine: 347, - EndLine: 347, - StartPos: 6337, - EndPos: 6343, + EndLine: 347, + StartPos: 6337, + EndPos: 6343, }, Left: &scalar.Lnumber{ Position: &position.Position{ StartLine: 347, - EndLine: 347, - StartPos: 6337, - EndPos: 6337, + EndLine: 347, + StartPos: 6337, + EndPos: 6337, }, Value: "1", }, Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 347, - EndLine: 347, - StartPos: 6343, - EndPos: 6343, + EndLine: 347, + StartPos: 6343, + EndPos: 6343, }, Value: "2", }, @@ -16689,31 +16604,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 348, - EndLine: 348, - StartPos: 6348, - EndPos: 6366, + EndLine: 348, + StartPos: 6348, + EndPos: 6366, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 348, - EndLine: 348, - StartPos: 6355, - EndPos: 6365, + EndLine: 348, + StartPos: 6355, + EndPos: 6365, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 348, - EndLine: 348, - StartPos: 6355, - EndPos: 6356, + EndLine: 348, + StartPos: 6355, + EndPos: 6356, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 348, - EndLine: 348, - StartPos: 6355, - EndPos: 6356, + EndLine: 348, + StartPos: 6355, + EndPos: 6356, }, Value: "a", }, @@ -16721,25 +16636,25 @@ func TestPhp5(t *testing.T) { Expr: &binary.LogicalOr{ Position: &position.Position{ StartLine: 348, - EndLine: 348, - StartPos: 6360, - EndPos: 6365, + EndLine: 348, + StartPos: 6360, + EndPos: 6365, }, Left: &scalar.Lnumber{ Position: &position.Position{ StartLine: 348, - EndLine: 348, - StartPos: 6360, - EndPos: 6360, + EndLine: 348, + StartPos: 6360, + EndPos: 6360, }, Value: "1", }, Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 348, - EndLine: 348, - StartPos: 6365, - EndPos: 6365, + EndLine: 348, + StartPos: 6365, + EndPos: 6365, }, Value: "2", }, @@ -16750,31 +16665,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 349, - EndLine: 349, - StartPos: 6370, - EndPos: 6389, + EndLine: 349, + StartPos: 6370, + EndPos: 6389, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 349, - EndLine: 349, - StartPos: 6377, - EndPos: 6388, + EndLine: 349, + StartPos: 6377, + EndPos: 6388, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 349, - EndLine: 349, - StartPos: 6377, - EndPos: 6378, + EndLine: 349, + StartPos: 6377, + EndPos: 6378, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 349, - EndLine: 349, - StartPos: 6377, - EndPos: 6378, + EndLine: 349, + StartPos: 6377, + EndPos: 6378, }, Value: "a", }, @@ -16782,25 +16697,25 @@ func TestPhp5(t *testing.T) { Expr: &binary.LogicalXor{ Position: &position.Position{ StartLine: 349, - EndLine: 349, - StartPos: 6382, - EndPos: 6388, + EndLine: 349, + StartPos: 6382, + EndPos: 6388, }, Left: &scalar.Lnumber{ Position: &position.Position{ StartLine: 349, - EndLine: 349, - StartPos: 6382, - EndPos: 6382, + EndLine: 349, + StartPos: 6382, + EndPos: 6382, }, Value: "1", }, Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 349, - EndLine: 349, - StartPos: 6388, - EndPos: 6388, + EndLine: 349, + StartPos: 6388, + EndPos: 6388, }, Value: "2", }, @@ -16811,31 +16726,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 350, - EndLine: 350, - StartPos: 6393, - EndPos: 6410, + EndLine: 350, + StartPos: 6393, + EndPos: 6410, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 350, - EndLine: 350, - StartPos: 6400, - EndPos: 6409, + EndLine: 350, + StartPos: 6400, + EndPos: 6409, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 350, - EndLine: 350, - StartPos: 6400, - EndPos: 6401, + EndLine: 350, + StartPos: 6400, + EndPos: 6401, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 350, - EndLine: 350, - StartPos: 6400, - EndPos: 6401, + EndLine: 350, + StartPos: 6400, + EndPos: 6401, }, Value: "a", }, @@ -16843,25 +16758,25 @@ func TestPhp5(t *testing.T) { Expr: &binary.Minus{ Position: &position.Position{ StartLine: 350, - EndLine: 350, - StartPos: 6405, - EndPos: 6409, + EndLine: 350, + StartPos: 6405, + EndPos: 6409, }, Left: &scalar.Lnumber{ Position: &position.Position{ StartLine: 350, - EndLine: 350, - StartPos: 6405, - EndPos: 6405, + EndLine: 350, + StartPos: 6405, + EndPos: 6405, }, Value: "1", }, Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 350, - EndLine: 350, - StartPos: 6409, - EndPos: 6409, + EndLine: 350, + StartPos: 6409, + EndPos: 6409, }, Value: "2", }, @@ -16872,31 +16787,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 351, - EndLine: 351, - StartPos: 6414, - EndPos: 6431, + EndLine: 351, + StartPos: 6414, + EndPos: 6431, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 351, - EndLine: 351, - StartPos: 6421, - EndPos: 6430, + EndLine: 351, + StartPos: 6421, + EndPos: 6430, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 351, - EndLine: 351, - StartPos: 6421, - EndPos: 6422, + EndLine: 351, + StartPos: 6421, + EndPos: 6422, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 351, - EndLine: 351, - StartPos: 6421, - EndPos: 6422, + EndLine: 351, + StartPos: 6421, + EndPos: 6422, }, Value: "a", }, @@ -16904,25 +16819,25 @@ func TestPhp5(t *testing.T) { Expr: &binary.Mod{ Position: &position.Position{ StartLine: 351, - EndLine: 351, - StartPos: 6426, - EndPos: 6430, + EndLine: 351, + StartPos: 6426, + EndPos: 6430, }, Left: &scalar.Lnumber{ Position: &position.Position{ StartLine: 351, - EndLine: 351, - StartPos: 6426, - EndPos: 6426, + EndLine: 351, + StartPos: 6426, + EndPos: 6426, }, Value: "1", }, Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 351, - EndLine: 351, - StartPos: 6430, - EndPos: 6430, + EndLine: 351, + StartPos: 6430, + EndPos: 6430, }, Value: "2", }, @@ -16933,31 +16848,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 352, - EndLine: 352, - StartPos: 6435, - EndPos: 6452, + EndLine: 352, + StartPos: 6435, + EndPos: 6452, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 352, - EndLine: 352, - StartPos: 6442, - EndPos: 6451, + EndLine: 352, + StartPos: 6442, + EndPos: 6451, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 352, - EndLine: 352, - StartPos: 6442, - EndPos: 6443, + EndLine: 352, + StartPos: 6442, + EndPos: 6443, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 352, - EndLine: 352, - StartPos: 6442, - EndPos: 6443, + EndLine: 352, + StartPos: 6442, + EndPos: 6443, }, Value: "a", }, @@ -16965,25 +16880,25 @@ func TestPhp5(t *testing.T) { Expr: &binary.Mul{ Position: &position.Position{ StartLine: 352, - EndLine: 352, - StartPos: 6447, - EndPos: 6451, + EndLine: 352, + StartPos: 6447, + EndPos: 6451, }, Left: &scalar.Lnumber{ Position: &position.Position{ StartLine: 352, - EndLine: 352, - StartPos: 6447, - EndPos: 6447, + EndLine: 352, + StartPos: 6447, + EndPos: 6447, }, Value: "1", }, Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 352, - EndLine: 352, - StartPos: 6451, - EndPos: 6451, + EndLine: 352, + StartPos: 6451, + EndPos: 6451, }, Value: "2", }, @@ -16994,31 +16909,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 353, - EndLine: 353, - StartPos: 6456, - EndPos: 6474, + EndLine: 353, + StartPos: 6456, + EndPos: 6474, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 353, - EndLine: 353, - StartPos: 6463, - EndPos: 6473, + EndLine: 353, + StartPos: 6463, + EndPos: 6473, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 353, - EndLine: 353, - StartPos: 6463, - EndPos: 6464, + EndLine: 353, + StartPos: 6463, + EndPos: 6464, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 353, - EndLine: 353, - StartPos: 6463, - EndPos: 6464, + EndLine: 353, + StartPos: 6463, + EndPos: 6464, }, Value: "a", }, @@ -17026,25 +16941,25 @@ func TestPhp5(t *testing.T) { Expr: &binary.NotEqual{ Position: &position.Position{ StartLine: 353, - EndLine: 353, - StartPos: 6468, - EndPos: 6473, + EndLine: 353, + StartPos: 6468, + EndPos: 6473, }, Left: &scalar.Lnumber{ Position: &position.Position{ StartLine: 353, - EndLine: 353, - StartPos: 6468, - EndPos: 6468, + EndLine: 353, + StartPos: 6468, + EndPos: 6468, }, Value: "1", }, Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 353, - EndLine: 353, - StartPos: 6473, - EndPos: 6473, + EndLine: 353, + StartPos: 6473, + EndPos: 6473, }, Value: "2", }, @@ -17055,31 +16970,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 354, - EndLine: 354, - StartPos: 6478, - EndPos: 6497, + EndLine: 354, + StartPos: 6478, + EndPos: 6497, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 354, - EndLine: 354, - StartPos: 6485, - EndPos: 6496, + EndLine: 354, + StartPos: 6485, + EndPos: 6496, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 354, - EndLine: 354, - StartPos: 6485, - EndPos: 6486, + EndLine: 354, + StartPos: 6485, + EndPos: 6486, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 354, - EndLine: 354, - StartPos: 6485, - EndPos: 6486, + EndLine: 354, + StartPos: 6485, + EndPos: 6486, }, Value: "a", }, @@ -17087,25 +17002,25 @@ func TestPhp5(t *testing.T) { Expr: &binary.NotIdentical{ Position: &position.Position{ StartLine: 354, - EndLine: 354, - StartPos: 6490, - EndPos: 6496, + EndLine: 354, + StartPos: 6490, + EndPos: 6496, }, Left: &scalar.Lnumber{ Position: &position.Position{ StartLine: 354, - EndLine: 354, - StartPos: 6490, - EndPos: 6490, + EndLine: 354, + StartPos: 6490, + EndPos: 6490, }, Value: "1", }, Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 354, - EndLine: 354, - StartPos: 6496, - EndPos: 6496, + EndLine: 354, + StartPos: 6496, + EndPos: 6496, }, Value: "2", }, @@ -17116,31 +17031,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 355, - EndLine: 355, - StartPos: 6501, - EndPos: 6518, + EndLine: 355, + StartPos: 6501, + EndPos: 6518, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 355, - EndLine: 355, - StartPos: 6508, - EndPos: 6517, + EndLine: 355, + StartPos: 6508, + EndPos: 6517, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 355, - EndLine: 355, - StartPos: 6508, - EndPos: 6509, + EndLine: 355, + StartPos: 6508, + EndPos: 6509, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 355, - EndLine: 355, - StartPos: 6508, - EndPos: 6509, + EndLine: 355, + StartPos: 6508, + EndPos: 6509, }, Value: "a", }, @@ -17148,25 +17063,25 @@ func TestPhp5(t *testing.T) { Expr: &binary.Plus{ Position: &position.Position{ StartLine: 355, - EndLine: 355, - StartPos: 6513, - EndPos: 6517, + EndLine: 355, + StartPos: 6513, + EndPos: 6517, }, Left: &scalar.Lnumber{ Position: &position.Position{ StartLine: 355, - EndLine: 355, - StartPos: 6513, - EndPos: 6513, + EndLine: 355, + StartPos: 6513, + EndPos: 6513, }, Value: "1", }, Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 355, - EndLine: 355, - StartPos: 6517, - EndPos: 6517, + EndLine: 355, + StartPos: 6517, + EndPos: 6517, }, Value: "2", }, @@ -17177,31 +17092,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 356, - EndLine: 356, - StartPos: 6522, - EndPos: 6540, + EndLine: 356, + StartPos: 6522, + EndPos: 6540, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 356, - EndLine: 356, - StartPos: 6529, - EndPos: 6539, + EndLine: 356, + StartPos: 6529, + EndPos: 6539, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 356, - EndLine: 356, - StartPos: 6529, - EndPos: 6530, + EndLine: 356, + StartPos: 6529, + EndPos: 6530, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 356, - EndLine: 356, - StartPos: 6529, - EndPos: 6530, + EndLine: 356, + StartPos: 6529, + EndPos: 6530, }, Value: "a", }, @@ -17209,25 +17124,25 @@ func TestPhp5(t *testing.T) { Expr: &binary.Pow{ Position: &position.Position{ StartLine: 356, - EndLine: 356, - StartPos: 6534, - EndPos: 6539, + EndLine: 356, + StartPos: 6534, + EndPos: 6539, }, Left: &scalar.Lnumber{ Position: &position.Position{ StartLine: 356, - EndLine: 356, - StartPos: 6534, - EndPos: 6534, + EndLine: 356, + StartPos: 6534, + EndPos: 6534, }, Value: "1", }, Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 356, - EndLine: 356, - StartPos: 6539, - EndPos: 6539, + EndLine: 356, + StartPos: 6539, + EndPos: 6539, }, Value: "2", }, @@ -17238,31 +17153,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 357, - EndLine: 357, - StartPos: 6544, - EndPos: 6562, + EndLine: 357, + StartPos: 6544, + EndPos: 6562, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 357, - EndLine: 357, - StartPos: 6551, - EndPos: 6561, + EndLine: 357, + StartPos: 6551, + EndPos: 6561, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 357, - EndLine: 357, - StartPos: 6551, - EndPos: 6552, + EndLine: 357, + StartPos: 6551, + EndPos: 6552, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 357, - EndLine: 357, - StartPos: 6551, - EndPos: 6552, + EndLine: 357, + StartPos: 6551, + EndPos: 6552, }, Value: "a", }, @@ -17270,25 +17185,25 @@ func TestPhp5(t *testing.T) { Expr: &binary.ShiftLeft{ Position: &position.Position{ StartLine: 357, - EndLine: 357, - StartPos: 6556, - EndPos: 6561, + EndLine: 357, + StartPos: 6556, + EndPos: 6561, }, Left: &scalar.Lnumber{ Position: &position.Position{ StartLine: 357, - EndLine: 357, - StartPos: 6556, - EndPos: 6556, + EndLine: 357, + StartPos: 6556, + EndPos: 6556, }, Value: "1", }, Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 357, - EndLine: 357, - StartPos: 6561, - EndPos: 6561, + EndLine: 357, + StartPos: 6561, + EndPos: 6561, }, Value: "2", }, @@ -17299,31 +17214,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 358, - EndLine: 358, - StartPos: 6566, - EndPos: 6584, + EndLine: 358, + StartPos: 6566, + EndPos: 6584, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 358, - EndLine: 358, - StartPos: 6573, - EndPos: 6583, + EndLine: 358, + StartPos: 6573, + EndPos: 6583, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 358, - EndLine: 358, - StartPos: 6573, - EndPos: 6574, + EndLine: 358, + StartPos: 6573, + EndPos: 6574, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 358, - EndLine: 358, - StartPos: 6573, - EndPos: 6574, + EndLine: 358, + StartPos: 6573, + EndPos: 6574, }, Value: "a", }, @@ -17331,25 +17246,25 @@ func TestPhp5(t *testing.T) { Expr: &binary.ShiftRight{ Position: &position.Position{ StartLine: 358, - EndLine: 358, - StartPos: 6578, - EndPos: 6583, + EndLine: 358, + StartPos: 6578, + EndPos: 6583, }, Left: &scalar.Lnumber{ Position: &position.Position{ StartLine: 358, - EndLine: 358, - StartPos: 6578, - EndPos: 6578, + EndLine: 358, + StartPos: 6578, + EndPos: 6578, }, Value: "1", }, Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 358, - EndLine: 358, - StartPos: 6583, - EndPos: 6583, + EndLine: 358, + StartPos: 6583, + EndPos: 6583, }, Value: "2", }, @@ -17360,31 +17275,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 359, - EndLine: 359, - StartPos: 6588, - EndPos: 6606, + EndLine: 359, + StartPos: 6588, + EndPos: 6606, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 359, - EndLine: 359, - StartPos: 6595, - EndPos: 6605, + EndLine: 359, + StartPos: 6595, + EndPos: 6605, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 359, - EndLine: 359, - StartPos: 6595, - EndPos: 6596, + EndLine: 359, + StartPos: 6595, + EndPos: 6596, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 359, - EndLine: 359, - StartPos: 6595, - EndPos: 6596, + EndLine: 359, + StartPos: 6595, + EndPos: 6596, }, Value: "a", }, @@ -17392,25 +17307,25 @@ func TestPhp5(t *testing.T) { Expr: &binary.SmallerOrEqual{ Position: &position.Position{ StartLine: 359, - EndLine: 359, - StartPos: 6600, - EndPos: 6605, + EndLine: 359, + StartPos: 6600, + EndPos: 6605, }, Left: &scalar.Lnumber{ Position: &position.Position{ StartLine: 359, - EndLine: 359, - StartPos: 6600, - EndPos: 6600, + EndLine: 359, + StartPos: 6600, + EndPos: 6600, }, Value: "1", }, Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 359, - EndLine: 359, - StartPos: 6605, - EndPos: 6605, + EndLine: 359, + StartPos: 6605, + EndPos: 6605, }, Value: "2", }, @@ -17421,31 +17336,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 360, - EndLine: 360, - StartPos: 6610, - EndPos: 6627, + EndLine: 360, + StartPos: 6610, + EndPos: 6627, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 360, - EndLine: 360, - StartPos: 6617, - EndPos: 6626, + EndLine: 360, + StartPos: 6617, + EndPos: 6626, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 360, - EndLine: 360, - StartPos: 6617, - EndPos: 6618, + EndLine: 360, + StartPos: 6617, + EndPos: 6618, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 360, - EndLine: 360, - StartPos: 6617, - EndPos: 6618, + EndLine: 360, + StartPos: 6617, + EndPos: 6618, }, Value: "a", }, @@ -17453,25 +17368,25 @@ func TestPhp5(t *testing.T) { Expr: &binary.Smaller{ Position: &position.Position{ StartLine: 360, - EndLine: 360, - StartPos: 6622, - EndPos: 6626, + EndLine: 360, + StartPos: 6622, + EndPos: 6626, }, Left: &scalar.Lnumber{ Position: &position.Position{ StartLine: 360, - EndLine: 360, - StartPos: 6622, - EndPos: 6622, + EndLine: 360, + StartPos: 6622, + EndPos: 6622, }, Value: "1", }, Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 360, - EndLine: 360, - StartPos: 6626, - EndPos: 6626, + EndLine: 360, + StartPos: 6626, + EndPos: 6626, }, Value: "2", }, @@ -17482,31 +17397,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 361, - EndLine: 361, - StartPos: 6631, - EndPos: 6651, + EndLine: 361, + StartPos: 6631, + EndPos: 6651, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 361, - EndLine: 361, - StartPos: 6638, - EndPos: 6650, + EndLine: 361, + StartPos: 6638, + EndPos: 6650, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 361, - EndLine: 361, - StartPos: 6638, - EndPos: 6639, + EndLine: 361, + StartPos: 6638, + EndPos: 6639, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 361, - EndLine: 361, - StartPos: 6638, - EndPos: 6639, + EndLine: 361, + StartPos: 6638, + EndPos: 6639, }, Value: "a", }, @@ -17514,24 +17429,24 @@ func TestPhp5(t *testing.T) { Expr: &expr.ClassConstFetch{ Position: &position.Position{ StartLine: 361, - EndLine: 361, - StartPos: 6643, - EndPos: 6650, + EndLine: 361, + StartPos: 6643, + EndPos: 6650, }, Class: &name.Name{ Position: &position.Position{ StartLine: 361, - EndLine: 361, - StartPos: 6643, - EndPos: 6645, + EndLine: 361, + StartPos: 6643, + EndPos: 6645, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 361, - EndLine: 361, - StartPos: 6643, - EndPos: 6645, + EndLine: 361, + StartPos: 6643, + EndPos: 6645, }, Value: "Foo", }, @@ -17540,9 +17455,9 @@ func TestPhp5(t *testing.T) { ConstantName: &node.Identifier{ Position: &position.Position{ StartLine: 361, - EndLine: 361, - StartPos: 6648, - EndPos: 6650, + EndLine: 361, + StartPos: 6648, + EndPos: 6650, }, Value: "bar", }, @@ -17553,31 +17468,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 362, - EndLine: 362, - StartPos: 6655, - EndPos: 6677, + EndLine: 362, + StartPos: 6655, + EndPos: 6677, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 362, - EndLine: 362, - StartPos: 6662, - EndPos: 6676, + EndLine: 362, + StartPos: 6662, + EndPos: 6676, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 362, - EndLine: 362, - StartPos: 6662, - EndPos: 6663, + EndLine: 362, + StartPos: 6662, + EndPos: 6663, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 362, - EndLine: 362, - StartPos: 6662, - EndPos: 6663, + EndLine: 362, + StartPos: 6662, + EndPos: 6663, }, Value: "a", }, @@ -17585,24 +17500,24 @@ func TestPhp5(t *testing.T) { Expr: &expr.ClassConstFetch{ Position: &position.Position{ StartLine: 362, - EndLine: 362, - StartPos: 6667, - EndPos: 6676, + EndLine: 362, + StartPos: 6667, + EndPos: 6676, }, Class: &name.Name{ Position: &position.Position{ StartLine: 362, - EndLine: 362, - StartPos: 6667, - EndPos: 6669, + EndLine: 362, + StartPos: 6667, + EndPos: 6669, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 362, - EndLine: 362, - StartPos: 6667, - EndPos: 6669, + EndLine: 362, + StartPos: 6667, + EndPos: 6669, }, Value: "Foo", }, @@ -17611,9 +17526,9 @@ func TestPhp5(t *testing.T) { ConstantName: &node.Identifier{ Position: &position.Position{ StartLine: 362, - EndLine: 362, - StartPos: 6672, - EndPos: 6676, + EndLine: 362, + StartPos: 6672, + EndPos: 6676, }, Value: "class", }, @@ -17624,31 +17539,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 363, - EndLine: 363, - StartPos: 6681, - EndPos: 6702, + EndLine: 363, + StartPos: 6681, + EndPos: 6702, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 363, - EndLine: 363, - StartPos: 6688, - EndPos: 6701, + EndLine: 363, + StartPos: 6688, + EndPos: 6701, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 363, - EndLine: 363, - StartPos: 6688, - EndPos: 6689, + EndLine: 363, + StartPos: 6688, + EndPos: 6689, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 363, - EndLine: 363, - StartPos: 6688, - EndPos: 6689, + EndLine: 363, + StartPos: 6688, + EndPos: 6689, }, Value: "a", }, @@ -17656,9 +17571,9 @@ func TestPhp5(t *testing.T) { Expr: &scalar.MagicConstant{ Position: &position.Position{ StartLine: 363, - EndLine: 363, - StartPos: 6693, - EndPos: 6701, + EndLine: 363, + StartPos: 6693, + EndPos: 6701, }, Value: "__CLASS__", }, @@ -17668,31 +17583,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 364, - EndLine: 364, - StartPos: 6706, - EndPos: 6721, + EndLine: 364, + StartPos: 6706, + EndPos: 6721, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 364, - EndLine: 364, - StartPos: 6713, - EndPos: 6720, + EndLine: 364, + StartPos: 6713, + EndPos: 6720, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 364, - EndLine: 364, - StartPos: 6713, - EndPos: 6714, + EndLine: 364, + StartPos: 6713, + EndPos: 6714, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 364, - EndLine: 364, - StartPos: 6713, - EndPos: 6714, + EndLine: 364, + StartPos: 6713, + EndPos: 6714, }, Value: "a", }, @@ -17700,24 +17615,24 @@ func TestPhp5(t *testing.T) { Expr: &expr.ConstFetch{ Position: &position.Position{ StartLine: 364, - EndLine: 364, - StartPos: 6718, - EndPos: 6720, + EndLine: 364, + StartPos: 6718, + EndPos: 6720, }, Constant: &name.Name{ Position: &position.Position{ StartLine: 364, - EndLine: 364, - StartPos: 6718, - EndPos: 6720, + EndLine: 364, + StartPos: 6718, + EndPos: 6720, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 364, - EndLine: 364, - StartPos: 6718, - EndPos: 6720, + EndLine: 364, + StartPos: 6718, + EndPos: 6720, }, Value: "Foo", }, @@ -17730,31 +17645,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 365, - EndLine: 365, - StartPos: 6725, - EndPos: 6750, + EndLine: 365, + StartPos: 6725, + EndPos: 6750, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 365, - EndLine: 365, - StartPos: 6732, - EndPos: 6749, + EndLine: 365, + StartPos: 6732, + EndPos: 6749, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 365, - EndLine: 365, - StartPos: 6732, - EndPos: 6733, + EndLine: 365, + StartPos: 6732, + EndPos: 6733, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 365, - EndLine: 365, - StartPos: 6732, - EndPos: 6733, + EndLine: 365, + StartPos: 6732, + EndPos: 6733, }, Value: "a", }, @@ -17762,24 +17677,24 @@ func TestPhp5(t *testing.T) { Expr: &expr.ConstFetch{ Position: &position.Position{ StartLine: 365, - EndLine: 365, - StartPos: 6737, - EndPos: 6749, + EndLine: 365, + StartPos: 6737, + EndPos: 6749, }, Constant: &name.Relative{ Position: &position.Position{ StartLine: 365, - EndLine: 365, - StartPos: 6737, - EndPos: 6749, + EndLine: 365, + StartPos: 6737, + EndPos: 6749, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 365, - EndLine: 365, - StartPos: 6747, - EndPos: 6749, + EndLine: 365, + StartPos: 6747, + EndPos: 6749, }, Value: "Foo", }, @@ -17792,31 +17707,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 366, - EndLine: 366, - StartPos: 6754, - EndPos: 6770, + EndLine: 366, + StartPos: 6754, + EndPos: 6770, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 366, - EndLine: 366, - StartPos: 6761, - EndPos: 6769, + EndLine: 366, + StartPos: 6761, + EndPos: 6769, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 366, - EndLine: 366, - StartPos: 6761, - EndPos: 6762, + EndLine: 366, + StartPos: 6761, + EndPos: 6762, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 366, - EndLine: 366, - StartPos: 6761, - EndPos: 6762, + EndLine: 366, + StartPos: 6761, + EndPos: 6762, }, Value: "a", }, @@ -17824,24 +17739,24 @@ func TestPhp5(t *testing.T) { Expr: &expr.ConstFetch{ Position: &position.Position{ StartLine: 366, - EndLine: 366, - StartPos: 6766, - EndPos: 6769, + EndLine: 366, + StartPos: 6766, + EndPos: 6769, }, Constant: &name.FullyQualified{ Position: &position.Position{ StartLine: 366, - EndLine: 366, - StartPos: 6766, - EndPos: 6769, + EndLine: 366, + StartPos: 6766, + EndPos: 6769, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 366, - EndLine: 366, - StartPos: 6767, - EndPos: 6769, + EndLine: 366, + StartPos: 6767, + EndPos: 6769, }, Value: "Foo", }, @@ -17854,31 +17769,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 367, - EndLine: 367, - StartPos: 6774, - EndPos: 6793, + EndLine: 367, + StartPos: 6774, + EndPos: 6793, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 367, - EndLine: 367, - StartPos: 6781, - EndPos: 6792, + EndLine: 367, + StartPos: 6781, + EndPos: 6792, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 367, - EndLine: 367, - StartPos: 6781, - EndPos: 6782, + EndLine: 367, + StartPos: 6781, + EndPos: 6782, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 367, - EndLine: 367, - StartPos: 6781, - EndPos: 6782, + EndLine: 367, + StartPos: 6781, + EndPos: 6782, }, Value: "a", }, @@ -17886,9 +17801,9 @@ func TestPhp5(t *testing.T) { Expr: &expr.Array{ Position: &position.Position{ StartLine: 367, - EndLine: 367, - StartPos: 6786, - EndPos: 6792, + EndLine: 367, + StartPos: 6786, + EndPos: 6792, }, }, }, @@ -17897,31 +17812,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 368, - EndLine: 368, - StartPos: 6797, - EndPos: 6825, + EndLine: 368, + StartPos: 6797, + EndPos: 6825, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 368, - EndLine: 368, - StartPos: 6804, - EndPos: 6824, + EndLine: 368, + StartPos: 6804, + EndPos: 6824, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 368, - EndLine: 368, - StartPos: 6804, - EndPos: 6805, + EndLine: 368, + StartPos: 6804, + EndPos: 6805, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 368, - EndLine: 368, - StartPos: 6804, - EndPos: 6805, + EndLine: 368, + StartPos: 6804, + EndPos: 6805, }, Value: "a", }, @@ -17929,33 +17844,33 @@ func TestPhp5(t *testing.T) { Expr: &expr.Array{ Position: &position.Position{ StartLine: 368, - EndLine: 368, - StartPos: 6809, - EndPos: 6824, + EndLine: 368, + StartPos: 6809, + EndPos: 6824, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 368, - EndLine: 368, - StartPos: 6815, - EndPos: 6820, + EndLine: 368, + StartPos: 6815, + EndPos: 6820, }, Key: &scalar.Lnumber{ Position: &position.Position{ StartLine: 368, - EndLine: 368, - StartPos: 6815, - EndPos: 6815, + EndLine: 368, + StartPos: 6815, + EndPos: 6815, }, Value: "1", }, Val: &scalar.Lnumber{ Position: &position.Position{ StartLine: 368, - EndLine: 368, - StartPos: 6820, - EndPos: 6820, + EndLine: 368, + StartPos: 6820, + EndPos: 6820, }, Value: "1", }, @@ -17963,16 +17878,16 @@ func TestPhp5(t *testing.T) { &expr.ArrayItem{ Position: &position.Position{ StartLine: 368, - EndLine: 368, - StartPos: 6823, - EndPos: 6823, + EndLine: 368, + StartPos: 6823, + EndPos: 6823, }, Val: &scalar.Lnumber{ Position: &position.Position{ StartLine: 368, - EndLine: 368, - StartPos: 6823, - EndPos: 6823, + EndLine: 368, + StartPos: 6823, + EndPos: 6823, }, Value: "2", }, @@ -17985,31 +17900,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 369, - EndLine: 369, - StartPos: 6829, - EndPos: 6855, + EndLine: 369, + StartPos: 6829, + EndPos: 6855, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 369, - EndLine: 369, - StartPos: 6836, - EndPos: 6854, + EndLine: 369, + StartPos: 6836, + EndPos: 6854, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 369, - EndLine: 369, - StartPos: 6836, - EndPos: 6837, + EndLine: 369, + StartPos: 6836, + EndPos: 6837, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 369, - EndLine: 369, - StartPos: 6836, - EndPos: 6837, + EndLine: 369, + StartPos: 6836, + EndPos: 6837, }, Value: "a", }, @@ -18017,31 +17932,31 @@ func TestPhp5(t *testing.T) { Expr: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 369, - EndLine: 369, - StartPos: 6841, - EndPos: 6854, + EndLine: 369, + StartPos: 6841, + EndPos: 6854, }, Variable: &expr.ShortArray{ Position: &position.Position{ StartLine: 369, - EndLine: 369, - StartPos: 6841, - EndPos: 6851, + EndLine: 369, + StartPos: 6841, + EndPos: 6851, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 369, - EndLine: 369, - StartPos: 6842, - EndPos: 6842, + EndLine: 369, + StartPos: 6842, + EndPos: 6842, }, Val: &scalar.Lnumber{ Position: &position.Position{ StartLine: 369, - EndLine: 369, - StartPos: 6842, - EndPos: 6842, + EndLine: 369, + StartPos: 6842, + EndPos: 6842, }, Value: "1", }, @@ -18049,25 +17964,25 @@ func TestPhp5(t *testing.T) { &expr.ArrayItem{ Position: &position.Position{ StartLine: 369, - EndLine: 369, - StartPos: 6845, - EndPos: 6850, + EndLine: 369, + StartPos: 6845, + EndPos: 6850, }, Key: &scalar.Lnumber{ Position: &position.Position{ StartLine: 369, - EndLine: 369, - StartPos: 6845, - EndPos: 6845, + EndLine: 369, + StartPos: 6845, + EndPos: 6845, }, Value: "2", }, Val: &scalar.Lnumber{ Position: &position.Position{ StartLine: 369, - EndLine: 369, - StartPos: 6850, - EndPos: 6850, + EndLine: 369, + StartPos: 6850, + EndPos: 6850, }, Value: "2", }, @@ -18077,9 +17992,9 @@ func TestPhp5(t *testing.T) { Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 369, - EndLine: 369, - StartPos: 6853, - EndPos: 6853, + EndLine: 369, + StartPos: 6853, + EndPos: 6853, }, Value: "0", }, @@ -18090,23 +18005,23 @@ func TestPhp5(t *testing.T) { &stmt.If{ Position: &position.Position{ StartLine: 371, - EndLine: 371, - StartPos: 6860, - EndPos: 6874, + EndLine: 371, + StartPos: 6860, + EndPos: 6874, }, Cond: &expr.Yield{ Position: &position.Position{ StartLine: 371, - EndLine: 371, - StartPos: 6864, - EndPos: 6870, + EndLine: 371, + StartPos: 6864, + EndPos: 6870, }, Value: &scalar.Lnumber{ Position: &position.Position{ StartLine: 371, - EndLine: 371, - StartPos: 6870, - EndPos: 6870, + EndLine: 371, + StartPos: 6870, + EndPos: 6870, }, Value: "1", }, @@ -18114,42 +18029,41 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 371, - EndLine: 371, - StartPos: 6873, - EndPos: 6874, - }, - Stmts: []node.Node{ + EndLine: 371, + StartPos: 6873, + EndPos: 6874, }, + Stmts: []node.Node{}, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 372, - EndLine: 372, - StartPos: 6878, - EndPos: 6888, + EndLine: 372, + StartPos: 6878, + EndPos: 6888, }, Expr: &expr.StaticPropertyFetch{ Position: &position.Position{ StartLine: 372, - EndLine: 372, - StartPos: 6878, - EndPos: 6887, + EndLine: 372, + StartPos: 6878, + EndPos: 6887, }, Class: &name.Name{ Position: &position.Position{ StartLine: 372, - EndLine: 372, - StartPos: 6878, - EndPos: 6880, + EndLine: 372, + StartPos: 6878, + EndPos: 6880, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 372, - EndLine: 372, - StartPos: 6878, - EndPos: 6880, + EndLine: 372, + StartPos: 6878, + EndPos: 6880, }, Value: "Foo", }, @@ -18158,23 +18072,23 @@ func TestPhp5(t *testing.T) { Property: &expr.Variable{ Position: &position.Position{ StartLine: 372, - EndLine: 372, - StartPos: 6883, - EndPos: 6887, + EndLine: 372, + StartPos: 6883, + EndPos: 6887, }, VarName: &expr.Variable{ Position: &position.Position{ StartLine: 372, - EndLine: 372, - StartPos: 6884, - EndPos: 6887, + EndLine: 372, + StartPos: 6884, + EndPos: 6887, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 372, - EndLine: 372, - StartPos: 6884, - EndPos: 6887, + EndLine: 372, + StartPos: 6884, + EndPos: 6887, }, Value: "bar", }, @@ -18185,30 +18099,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 374, - EndLine: 374, - StartPos: 6893, - EndPos: 6899, + EndLine: 374, + StartPos: 6893, + EndPos: 6899, }, Expr: &expr.FunctionCall{ Position: &position.Position{ StartLine: 374, - EndLine: 374, - StartPos: 6893, - EndPos: 6898, + EndLine: 374, + StartPos: 6893, + EndPos: 6898, }, Function: &expr.Variable{ Position: &position.Position{ StartLine: 374, - EndLine: 374, - StartPos: 6893, - EndPos: 6896, + EndLine: 374, + StartPos: 6893, + EndPos: 6896, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 374, - EndLine: 374, - StartPos: 6893, - EndPos: 6896, + EndLine: 374, + StartPos: 6893, + EndPos: 6896, }, Value: "foo", }, @@ -18216,9 +18130,9 @@ func TestPhp5(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 374, - EndLine: 374, - StartPos: 6897, - EndPos: 6898, + EndLine: 374, + StartPos: 6897, + EndPos: 6898, }, }, }, @@ -18226,44 +18140,44 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 375, - EndLine: 375, - StartPos: 6903, - EndPos: 6915, + EndLine: 375, + StartPos: 6903, + EndPos: 6915, }, Expr: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 375, - EndLine: 375, - StartPos: 6903, - EndPos: 6914, + EndLine: 375, + StartPos: 6903, + EndPos: 6914, }, Variable: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 375, - EndLine: 375, - StartPos: 6903, - EndPos: 6911, + EndLine: 375, + StartPos: 6903, + EndPos: 6911, }, Variable: &expr.FunctionCall{ Position: &position.Position{ StartLine: 375, - EndLine: 375, - StartPos: 6903, - EndPos: 6908, + EndLine: 375, + StartPos: 6903, + EndPos: 6908, }, Function: &expr.Variable{ Position: &position.Position{ StartLine: 375, - EndLine: 375, - StartPos: 6903, - EndPos: 6906, + EndLine: 375, + StartPos: 6903, + EndPos: 6906, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 375, - EndLine: 375, - StartPos: 6903, - EndPos: 6906, + EndLine: 375, + StartPos: 6903, + EndPos: 6906, }, Value: "foo", }, @@ -18271,18 +18185,18 @@ func TestPhp5(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 375, - EndLine: 375, - StartPos: 6907, - EndPos: 6908, + EndLine: 375, + StartPos: 6907, + EndPos: 6908, }, }, }, Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 375, - EndLine: 375, - StartPos: 6910, - EndPos: 6910, + EndLine: 375, + StartPos: 6910, + EndPos: 6910, }, Value: "0", }, @@ -18290,9 +18204,9 @@ func TestPhp5(t *testing.T) { Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 375, - EndLine: 375, - StartPos: 6913, - EndPos: 6913, + EndLine: 375, + StartPos: 6913, + EndPos: 6913, }, Value: "0", }, @@ -18301,30 +18215,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 376, - EndLine: 376, - StartPos: 6919, - EndPos: 6925, + EndLine: 376, + StartPos: 6919, + EndPos: 6925, }, Expr: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 376, - EndLine: 376, - StartPos: 6919, - EndPos: 6924, + EndLine: 376, + StartPos: 6919, + EndPos: 6924, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 376, - EndLine: 376, - StartPos: 6919, - EndPos: 6920, + EndLine: 376, + StartPos: 6919, + EndPos: 6920, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 376, - EndLine: 376, - StartPos: 6919, - EndPos: 6920, + EndLine: 376, + StartPos: 6919, + EndPos: 6920, }, Value: "a", }, @@ -18332,16 +18246,16 @@ func TestPhp5(t *testing.T) { Dim: &expr.Variable{ Position: &position.Position{ StartLine: 376, - EndLine: 376, - StartPos: 6922, - EndPos: 6923, + EndLine: 376, + StartPos: 6922, + EndPos: 6923, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 376, - EndLine: 376, - StartPos: 6922, - EndPos: 6923, + EndLine: 376, + StartPos: 6922, + EndPos: 6923, }, Value: "b", }, @@ -18351,30 +18265,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 377, - EndLine: 377, - StartPos: 6929, - EndPos: 6934, + EndLine: 377, + StartPos: 6929, + EndPos: 6934, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 377, - EndLine: 377, - StartPos: 6929, - EndPos: 6933, + EndLine: 377, + StartPos: 6929, + EndPos: 6933, }, VarName: &expr.Variable{ Position: &position.Position{ StartLine: 377, - EndLine: 377, - StartPos: 6931, - EndPos: 6932, + EndLine: 377, + StartPos: 6931, + EndPos: 6932, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 377, - EndLine: 377, - StartPos: 6931, - EndPos: 6932, + EndLine: 377, + StartPos: 6931, + EndPos: 6932, }, Value: "a", }, @@ -18384,30 +18298,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 378, - EndLine: 378, - StartPos: 6938, - EndPos: 6952, + EndLine: 378, + StartPos: 6938, + EndPos: 6952, }, Expr: &expr.StaticCall{ Position: &position.Position{ StartLine: 378, - EndLine: 378, - StartPos: 6938, - EndPos: 6951, + EndLine: 378, + StartPos: 6938, + EndPos: 6951, }, Class: &expr.Variable{ Position: &position.Position{ StartLine: 378, - EndLine: 378, - StartPos: 6938, - EndPos: 6941, + EndLine: 378, + StartPos: 6938, + EndPos: 6941, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 378, - EndLine: 378, - StartPos: 6938, - EndPos: 6941, + EndLine: 378, + StartPos: 6938, + EndPos: 6941, }, Value: "foo", }, @@ -18415,16 +18329,16 @@ func TestPhp5(t *testing.T) { Call: &expr.Variable{ Position: &position.Position{ StartLine: 378, - EndLine: 378, - StartPos: 6944, - EndPos: 6949, + EndLine: 378, + StartPos: 6944, + EndPos: 6949, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 378, - EndLine: 378, - StartPos: 6945, - EndPos: 6948, + EndLine: 378, + StartPos: 6945, + EndPos: 6948, }, Value: "bar", }, @@ -18432,9 +18346,9 @@ func TestPhp5(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 378, - EndLine: 378, - StartPos: 6950, - EndPos: 6951, + EndLine: 378, + StartPos: 6950, + EndPos: 6951, }, }, }, @@ -18442,30 +18356,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 379, - EndLine: 379, - StartPos: 6956, - EndPos: 6965, + EndLine: 379, + StartPos: 6956, + EndPos: 6965, }, Expr: &expr.ClassConstFetch{ Position: &position.Position{ StartLine: 379, - EndLine: 379, - StartPos: 6956, - EndPos: 6964, + EndLine: 379, + StartPos: 6956, + EndPos: 6964, }, Class: &expr.Variable{ Position: &position.Position{ StartLine: 379, - EndLine: 379, - StartPos: 6956, - EndPos: 6959, + EndLine: 379, + StartPos: 6956, + EndPos: 6959, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 379, - EndLine: 379, - StartPos: 6956, - EndPos: 6959, + EndLine: 379, + StartPos: 6956, + EndPos: 6959, }, Value: "foo", }, @@ -18473,9 +18387,9 @@ func TestPhp5(t *testing.T) { ConstantName: &node.Identifier{ Position: &position.Position{ StartLine: 379, - EndLine: 379, - StartPos: 6962, - EndPos: 6964, + EndLine: 379, + StartPos: 6962, + EndPos: 6964, }, Value: "bar", }, @@ -18483,7 +18397,6 @@ func TestPhp5(t *testing.T) { }, }, } - php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php") php5parser.Parse() @@ -18504,27 +18417,27 @@ func TestPhp5Strings(t *testing.T) { '; ` - expected :=&node.Root{ + expected := &node.Root{ Position: &position.Position{ StartLine: 2, - EndLine: 10, - StartPos: 6, - EndPos: 70, + EndLine: 10, + StartPos: 6, + EndPos: 70, }, Stmts: []node.Node{ &stmt.Expression{ Position: &position.Position{ StartLine: 2, - EndLine: 2, - StartPos: 6, - EndPos: 12, + EndLine: 2, + StartPos: 6, + EndPos: 12, }, Expr: &scalar.String{ Position: &position.Position{ StartLine: 2, - EndLine: 2, - StartPos: 6, - EndPos: 11, + EndLine: 2, + StartPos: 6, + EndPos: 11, }, Value: "\"test\"", }, @@ -18532,16 +18445,16 @@ func TestPhp5Strings(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 3, - EndLine: 3, - StartPos: 16, - EndPos: 24, + EndLine: 3, + StartPos: 16, + EndPos: 24, }, Expr: &scalar.String{ Position: &position.Position{ StartLine: 3, - EndLine: 3, - StartPos: 16, - EndPos: 23, + EndLine: 3, + StartPos: 16, + EndPos: 23, }, Value: "\"\\$test\"", }, @@ -18549,16 +18462,16 @@ func TestPhp5Strings(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 4, - EndLine: 6, - StartPos: 28, - EndPos: 41, + EndLine: 6, + StartPos: 28, + EndPos: 41, }, Expr: &scalar.String{ Position: &position.Position{ StartLine: 4, - EndLine: 6, - StartPos: 28, - EndPos: 40, + EndLine: 6, + StartPos: 28, + EndPos: 40, }, Value: "\"\n\t\t\ttest\n\t\t\"", }, @@ -18566,16 +18479,16 @@ func TestPhp5Strings(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 7, - EndLine: 7, - StartPos: 45, - EndPos: 52, + EndLine: 7, + StartPos: 45, + EndPos: 52, }, Expr: &scalar.String{ Position: &position.Position{ StartLine: 7, - EndLine: 7, - StartPos: 45, - EndPos: 51, + EndLine: 7, + StartPos: 45, + EndPos: 51, }, Value: "'$test'", }, @@ -18583,23 +18496,22 @@ func TestPhp5Strings(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 8, - EndLine: 10, - StartPos: 56, - EndPos: 70, + EndLine: 10, + StartPos: 56, + EndPos: 70, }, Expr: &scalar.String{ Position: &position.Position{ StartLine: 8, - EndLine: 10, - StartPos: 56, - EndPos: 69, + EndLine: 10, + StartPos: 56, + EndPos: 69, }, Value: "'\n\t\t\t$test\n\t\t'", }, }, }, } - php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php") php5parser.Parse() @@ -18628,24 +18540,24 @@ CAD; expected := &node.Root{ Position: &position.Position{ StartLine: 2, - EndLine: 15, - StartPos: 9, - EndPos: 120, + EndLine: 15, + StartPos: 9, + EndPos: 120, }, Stmts: []node.Node{ &stmt.Expression{ Position: &position.Position{ StartLine: 2, - EndLine: 3, - StartPos: 9, - EndPos: 16, + EndLine: 3, + StartPos: 9, + EndPos: 16, }, Expr: &scalar.Heredoc{ Position: &position.Position{ StartLine: 2, - EndLine: 3, - StartPos: 9, - EndPos: 15, + EndLine: 3, + StartPos: 9, + EndPos: 15, }, Label: "CAD", }, @@ -18653,25 +18565,25 @@ CAD; &stmt.Expression{ Position: &position.Position{ StartLine: 4, - EndLine: 6, - StartPos: 23, - EndPos: 37, + EndLine: 6, + StartPos: 23, + EndPos: 37, }, Expr: &scalar.Heredoc{ Position: &position.Position{ StartLine: 4, - EndLine: 6, - StartPos: 23, - EndPos: 36, + EndLine: 6, + StartPos: 23, + EndPos: 36, }, Label: "CAD", Parts: []node.Node{ &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 5, - EndLine: 5, - StartPos: 27, - EndPos: 33, + EndLine: 5, + StartPos: 27, + EndPos: 33, }, Value: "\thello\n", }, @@ -18681,25 +18593,25 @@ CAD; &stmt.Expression{ Position: &position.Position{ StartLine: 7, - EndLine: 9, - StartPos: 44, - EndPos: 60, + EndLine: 9, + StartPos: 44, + EndPos: 60, }, Expr: &scalar.Heredoc{ Position: &position.Position{ StartLine: 7, - EndLine: 9, - StartPos: 44, - EndPos: 59, + EndLine: 9, + StartPos: 44, + EndPos: 59, }, Label: "\"CAD\"", Parts: []node.Node{ &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 8, - EndLine: 8, - StartPos: 50, - EndPos: 56, + EndLine: 8, + StartPos: 50, + EndPos: 56, }, Value: "\thello\n", }, @@ -18709,41 +18621,41 @@ CAD; &stmt.Expression{ Position: &position.Position{ StartLine: 10, - EndLine: 12, - StartPos: 67, - EndPos: 90, + EndLine: 12, + StartPos: 67, + EndPos: 90, }, Expr: &scalar.Heredoc{ Position: &position.Position{ StartLine: 10, - EndLine: 12, - StartPos: 67, - EndPos: 89, + EndLine: 12, + StartPos: 67, + EndPos: 89, }, Label: "\"CAD\"", Parts: []node.Node{ &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 11, - EndLine: 11, - StartPos: 73, - EndPos: 79, + EndLine: 11, + StartPos: 73, + EndPos: 79, }, Value: "\thello ", }, &expr.Variable{ Position: &position.Position{ StartLine: 11, - EndLine: 11, - StartPos: 80, - EndPos: 85, + EndLine: 11, + StartPos: 80, + EndPos: 85, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 11, - EndLine: 11, - StartPos: 80, - EndPos: 85, + EndLine: 11, + StartPos: 80, + EndPos: 85, }, Value: "world", }, @@ -18751,9 +18663,9 @@ CAD; &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 11, - EndLine: 11, - StartPos: 86, - EndPos: 86, + EndLine: 11, + StartPos: 86, + EndPos: 86, }, Value: "\n", }, @@ -18763,25 +18675,25 @@ CAD; &stmt.Expression{ Position: &position.Position{ StartLine: 13, - EndLine: 15, - StartPos: 97, - EndPos: 120, + EndLine: 15, + StartPos: 97, + EndPos: 120, }, Expr: &scalar.Heredoc{ Position: &position.Position{ StartLine: 13, - EndLine: 15, - StartPos: 97, - EndPos: 119, + EndLine: 15, + StartPos: 97, + EndPos: 119, }, Label: "'CAD'", Parts: []node.Node{ &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 14, - EndLine: 14, - StartPos: 103, - EndPos: 116, + EndLine: 14, + StartPos: 103, + EndPos: 116, }, Value: "\thello $world\n", }, @@ -18790,7 +18702,6 @@ CAD; }, }, } - php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php") php5parser.Parse() diff --git a/php7/php7.go b/php7/php7.go index 26893c8..dab044a 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -2608,7 +2608,7 @@ yydefault: namePart.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(namePart, yyDollar[1].token, comment.StringToken) + namePart.AddComments(yyDollar[1].token.Comments, comment.StringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2623,8 +2623,8 @@ yydefault: namePart.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.NsSeparatorToken) - yylex.(*Parser).comments.AddFromToken(namePart, yyDollar[3].token, comment.StringToken) + lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.NsSeparatorToken) + namePart.AddComments(yyDollar[3].token.Comments, comment.StringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2649,8 +2649,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.NamespaceToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.NsSeparatorToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.NamespaceToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.NsSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2664,7 +2664,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.NsSeparatorToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.NsSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2727,10 +2727,10 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.HaltCompilerToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.CloseParenthesisToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.SemiColonToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.HaltCompilerToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenParenthesisToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.CloseParenthesisToken) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2746,8 +2746,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.NamespaceToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.SemiColonToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.NamespaceToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2763,9 +2763,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[5].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.NamespaceToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[5].token, comment.CloseCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.NamespaceToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.OpenCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[5].token.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2779,9 +2779,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.NamespaceToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.NamespaceToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2795,8 +2795,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.UseToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.SemiColonToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.UseToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2810,8 +2810,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.UseToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.SemiColonToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.UseToken) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2825,8 +2825,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.UseToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.SemiColonToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.UseToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2840,8 +2840,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.UseToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.SemiColonToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.UseToken) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2855,8 +2855,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ConstToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.SemiColonToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ConstToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2870,7 +2870,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.FunctionToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.FunctionToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2884,7 +2884,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ConstToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ConstToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2900,12 +2900,12 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition(yyDollar[1].list, yyDollar[6].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.NsSeparatorToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.OpenCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.NsSeparatorToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.OpenCurlyBracesToken) if yyDollar[5].token != nil { - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[5].token, comment.CommaToken) + yyVAL.node.AddComments(yyDollar[5].token.Comments, comment.CommaToken) } - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[6].token, comment.CloseCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[6].token.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2921,13 +2921,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[7].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.NsSeparatorToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.NsSeparatorToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.OpenCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.NsSeparatorToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.NsSeparatorToken) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.OpenCurlyBracesToken) if yyDollar[6].token != nil { - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[6].token, comment.CommaToken) + yyVAL.node.AddComments(yyDollar[6].token.Comments, comment.CommaToken) } - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[7].token, comment.CloseCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[7].token.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2943,12 +2943,12 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition(yyDollar[1].list, yyDollar[6].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.NsSeparatorToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.OpenCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.NsSeparatorToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.OpenCurlyBracesToken) if yyDollar[5].token != nil { - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[5].token, comment.CommaToken) + yyVAL.node.AddComments(yyDollar[5].token.Comments, comment.CommaToken) } - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[6].token, comment.CloseCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[6].token.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2964,13 +2964,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[7].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.NsSeparatorToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.NsSeparatorToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.OpenCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.NsSeparatorToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.NsSeparatorToken) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.OpenCurlyBracesToken) if yyDollar[6].token != nil { - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[6].token, comment.CommaToken) + yyVAL.node.AddComments(yyDollar[6].token.Comments, comment.CommaToken) } - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[7].token, comment.CloseCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[7].token.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2993,7 +2993,7 @@ yydefault: yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) + lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3012,7 +3012,7 @@ yydefault: yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) + lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3031,7 +3031,7 @@ yydefault: yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) + lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3086,8 +3086,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition(yyDollar[1].list, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.AsToken) - yylex.(*Parser).comments.AddFromToken(alias, yyDollar[3].token, comment.StringToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.AsToken) + alias.AddComments(yyDollar[3].token.Comments, comment.StringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3106,7 +3106,7 @@ yydefault: yyVAL.node = yyDollar[2].node // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.NsSeparatorToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.NsSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3117,7 +3117,7 @@ yydefault: yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) + lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3206,10 +3206,10 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.HaltCompilerToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.CloseParenthesisToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.SemiColonToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.HaltCompilerToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenParenthesisToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.CloseParenthesisToken) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3223,8 +3223,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.CloseCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.OpenCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3261,9 +3261,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[5].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.WhileToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseParenthesisToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.WhileToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenParenthesisToken) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3277,11 +3277,11 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[7].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.DoToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.WhileToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[6].token, comment.CloseParenthesisToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[7].token, comment.SemiColonToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.DoToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.WhileToken) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.OpenParenthesisToken) + yyVAL.node.AddComments(yyDollar[6].token.Comments, comment.CloseParenthesisToken) + yyVAL.node.AddComments(yyDollar[7].token.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3306,11 +3306,11 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[9].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ForToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.ForInitSemicolonToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[6].token, comment.ForCondSemicolonToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[8].token, comment.CloseParenthesisToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ForToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenParenthesisToken) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.ForInitSemicolonToken) + yyVAL.node.AddComments(yyDollar[6].token.Comments, comment.ForCondSemicolonToken) + yyVAL.node.AddComments(yyDollar[8].token.Comments, comment.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3333,9 +3333,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[5].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.SwitchToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseParenthesisToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.SwitchToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenParenthesisToken) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3349,8 +3349,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.BreakToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.SemiColonToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.BreakToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3364,8 +3364,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ContinueToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.SemiColonToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ContinueToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3379,8 +3379,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ReturnToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.SemiColonToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ReturnToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3394,8 +3394,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.GlobalToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.SemiColonToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.GlobalToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3409,8 +3409,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.StaticToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.SemiColonToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.StaticToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3424,8 +3424,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.EchoToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.SemiColonToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.EchoToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3439,7 +3439,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.InlineHTMLToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.InlineHTMLToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3453,7 +3453,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.SemiColonToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3467,13 +3467,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[6].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.UnsetToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenParenthesisToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.UnsetToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenParenthesisToken) if yyDollar[4].token != nil { - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CommaToken) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CommaToken) } - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[5].token, comment.CloseParenthesisToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[6].token, comment.SemiColonToken) + yyVAL.node.AddComments(yyDollar[5].token.Comments, comment.CloseParenthesisToken) + yyVAL.node.AddComments(yyDollar[6].token.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3496,10 +3496,10 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[7].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ForeachToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.AsToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[6].token, comment.CloseParenthesisToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ForeachToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenParenthesisToken) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.AsToken) + yyVAL.node.AddComments(yyDollar[6].token.Comments, comment.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3524,11 +3524,11 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[9].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ForeachToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.AsToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[6].token, comment.DoubleArrowToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[8].token, comment.CloseParenthesisToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ForeachToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenParenthesisToken) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.AsToken) + yyVAL.node.AddComments(yyDollar[6].token.Comments, comment.DoubleArrowToken) + yyVAL.node.AddComments(yyDollar[8].token.Comments, comment.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3542,9 +3542,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[5].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.DeclareToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseParenthesisToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.DeclareToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenParenthesisToken) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3558,7 +3558,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.SemiColonToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3575,9 +3575,9 @@ yydefault: } // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.TryToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.TryToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3591,8 +3591,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ThrowToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.SemiColonToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ThrowToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3608,9 +3608,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.GotoToken) - yylex.(*Parser).comments.AddFromToken(label, yyDollar[2].token, comment.StringToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.SemiColonToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.GotoToken) + label.AddComments(yyDollar[2].token.Comments, comment.StringToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3626,8 +3626,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - yylex.(*Parser).comments.AddFromToken(label, yyDollar[1].token, comment.StringToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.ColonToken) + label.AddComments(yyDollar[1].token.Comments, comment.StringToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.ColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3654,12 +3654,12 @@ yydefault: catch.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[2].token, yyDollar[9].token)) // save comments - yylex.(*Parser).comments.AddFromToken(catch, yyDollar[2].token, comment.CatchToken) - yylex.(*Parser).comments.AddFromToken(catch, yyDollar[3].token, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken(variable, yyDollar[5].token, comment.StringToken) - yylex.(*Parser).comments.AddFromToken(catch, yyDollar[6].token, comment.CloseParenthesisToken) - yylex.(*Parser).comments.AddFromToken(catch, yyDollar[7].token, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken(catch, yyDollar[9].token, comment.CloseCurlyBracesToken) + catch.AddComments(yyDollar[2].token.Comments, comment.CatchToken) + catch.AddComments(yyDollar[3].token.Comments, comment.OpenParenthesisToken) + variable.AddComments(yyDollar[5].token.Comments, comment.StringToken) + catch.AddComments(yyDollar[6].token.Comments, comment.CloseParenthesisToken) + catch.AddComments(yyDollar[7].token.Comments, comment.OpenCurlyBracesToken) + catch.AddComments(yyDollar[9].token.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3678,7 +3678,7 @@ yydefault: yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.VerticalBarToken) + lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.VerticalBarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3700,9 +3700,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.FinallyToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.FinallyToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3721,7 +3721,7 @@ yydefault: yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) + lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3745,15 +3745,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[11].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.FunctionToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.FunctionToken) if yyDollar[2].token != nil { - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.AmpersandToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.AmpersandToken) } - yylex.(*Parser).comments.AddFromToken(name, yyDollar[3].token, comment.StringToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[5].token, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[7].token, comment.CloseParenthesisToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[9].token, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[11].token, comment.CloseCurlyBracesToken) + name.AddComments(yyDollar[3].token.Comments, comment.StringToken) + yyVAL.node.AddComments(yyDollar[5].token.Comments, comment.OpenParenthesisToken) + yyVAL.node.AddComments(yyDollar[7].token.Comments, comment.CloseParenthesisToken) + yyVAL.node.AddComments(yyDollar[9].token.Comments, comment.OpenCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[11].token.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3793,10 +3793,10 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewOptionalListTokensPosition(yyDollar[1].list, yyDollar[2].token, yyDollar[9].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.ClassToken) - yylex.(*Parser).comments.AddFromToken(name, yyDollar[3].token, comment.StringToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[7].token, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[9].token, comment.CloseCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.ClassToken) + name.AddComments(yyDollar[3].token.Comments, comment.StringToken) + yyVAL.node.AddComments(yyDollar[7].token.Comments, comment.OpenCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[9].token.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3812,10 +3812,10 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[8].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ClassToken) - yylex.(*Parser).comments.AddFromToken(name, yyDollar[2].token, comment.StringToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[6].token, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[8].token, comment.CloseCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ClassToken) + name.AddComments(yyDollar[2].token.Comments, comment.StringToken) + yyVAL.node.AddComments(yyDollar[6].token.Comments, comment.OpenCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[8].token.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3845,7 +3845,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.AbstractToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.AbstractToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3859,7 +3859,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.FinalToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.FinalToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3875,10 +3875,10 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[6].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.TraitToken) - yylex.(*Parser).comments.AddFromToken(name, yyDollar[2].token, comment.StringToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[6].token, comment.CloseCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.TraitToken) + name.AddComments(yyDollar[2].token.Comments, comment.StringToken) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.OpenCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[6].token.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3894,10 +3894,10 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[7].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.InterfaceToken) - yylex.(*Parser).comments.AddFromToken(name, yyDollar[2].token, comment.StringToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[5].token, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[7].token, comment.CloseCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.InterfaceToken) + name.AddComments(yyDollar[2].token.Comments, comment.StringToken) + yyVAL.node.AddComments(yyDollar[5].token.Comments, comment.OpenCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[7].token.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3919,7 +3919,7 @@ yydefault: yyVAL.ClassExtends.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.ClassExtends, yyDollar[1].token, comment.ExtendsToken) + yyVAL.ClassExtends.AddComments(yyDollar[1].token.Comments, comment.ExtendsToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3941,7 +3941,7 @@ yydefault: yyVAL.InterfaceExtends.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.InterfaceExtends, yyDollar[1].token, comment.ExtendsToken) + yyVAL.InterfaceExtends.AddComments(yyDollar[1].token.Comments, comment.ExtendsToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3963,7 +3963,7 @@ yydefault: yyVAL.ClassImplements.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.ClassImplements, yyDollar[1].token, comment.ImplementsToken) + yyVAL.ClassImplements.AddComments(yyDollar[1].token.Comments, comment.ImplementsToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3985,7 +3985,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.AmpersandToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.AmpersandToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3999,9 +3999,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ListToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseParenthesisToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ListToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenParenthesisToken) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4015,8 +4015,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.OpenSquareBracket) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.CloseSquareBracket) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.OpenSquareBracket) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4043,9 +4043,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ColonToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.EndforToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.SemiColonToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ColonToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.EndforToken) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4072,9 +4072,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ColonToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.EndforeachToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.SemiColonToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ColonToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.EndforeachToken) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4096,9 +4096,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ColonToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.EnddeclareToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.SemiColonToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ColonToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.EnddeclareToken) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4114,8 +4114,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddFromToken(caseList, yyDollar[1].token, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken(caseList, yyDollar[3].token, comment.CloseCurlyBracesToken) + caseList.AddComments(yyDollar[1].token.Comments, comment.OpenCurlyBracesToken) + caseList.AddComments(yyDollar[3].token.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4131,9 +4131,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddFromToken(caseList, yyDollar[1].token, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken(caseList, yyDollar[2].token, comment.SemiColonToken) - yylex.(*Parser).comments.AddFromToken(caseList, yyDollar[4].token, comment.CloseCurlyBracesToken) + caseList.AddComments(yyDollar[1].token.Comments, comment.OpenCurlyBracesToken) + caseList.AddComments(yyDollar[2].token.Comments, comment.SemiColonToken) + caseList.AddComments(yyDollar[4].token.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4149,9 +4149,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddFromToken(caseList, yyDollar[1].token, comment.ColonToken) - yylex.(*Parser).comments.AddFromToken(caseList, yyDollar[3].token, comment.EndswitchToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.SemiColonToken) + caseList.AddComments(yyDollar[1].token.Comments, comment.ColonToken) + caseList.AddComments(yyDollar[3].token.Comments, comment.EndswitchToken) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4168,10 +4168,10 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[5].token)) // save comments - yylex.(*Parser).comments.AddFromToken(caseList, yyDollar[1].token, comment.ColonToken) - yylex.(*Parser).comments.AddFromToken(caseList, yyDollar[2].token, comment.SemiColonToken) - yylex.(*Parser).comments.AddFromToken(caseList, yyDollar[4].token, comment.EndswitchToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[5].token, comment.SemiColonToken) + caseList.AddComments(yyDollar[1].token.Comments, comment.ColonToken) + caseList.AddComments(yyDollar[2].token.Comments, comment.SemiColonToken) + caseList.AddComments(yyDollar[4].token.Comments, comment.EndswitchToken) + yyVAL.node.AddComments(yyDollar[5].token.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4194,8 +4194,8 @@ yydefault: _case.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[5].list)) // save comments - yylex.(*Parser).comments.AddFromToken(_case, yyDollar[2].token, comment.CaseToken) - yylex.(*Parser).comments.AddFromToken(_case, yyDollar[4].token, comment.CaseSeparatorToken) + _case.AddComments(yyDollar[2].token.Comments, comment.CaseToken) + _case.AddComments(yyDollar[4].token.Comments, comment.CaseSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4210,8 +4210,8 @@ yydefault: _default.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[4].list)) // save comments - yylex.(*Parser).comments.AddFromToken(_default, yyDollar[2].token, comment.DefaultToken) - yylex.(*Parser).comments.AddFromToken(_default, yyDollar[3].token, comment.CaseSeparatorToken) + _default.AddComments(yyDollar[2].token.Comments, comment.DefaultToken) + _default.AddComments(yyDollar[3].token.Comments, comment.CaseSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4250,9 +4250,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ColonToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.EndwhileToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.SemiColonToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ColonToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.EndwhileToken) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4266,9 +4266,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[5].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.IfToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseParenthesisToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.IfToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenParenthesisToken) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4284,9 +4284,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[6].node)) // save comments - yylex.(*Parser).comments.AddFromToken(_elseIf, yyDollar[2].token, comment.ElseifToken) - yylex.(*Parser).comments.AddFromToken(_elseIf, yyDollar[3].token, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken(_elseIf, yyDollar[5].token, comment.CloseParenthesisToken) + _elseIf.AddComments(yyDollar[2].token.Comments, comment.ElseifToken) + _elseIf.AddComments(yyDollar[3].token.Comments, comment.OpenParenthesisToken) + _elseIf.AddComments(yyDollar[5].token.Comments, comment.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4310,7 +4310,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.ElseToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.ElseToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4326,10 +4326,10 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[6].list)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.IfToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseParenthesisToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[5].token, comment.ColonToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.IfToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenParenthesisToken) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseParenthesisToken) + yyVAL.node.AddComments(yyDollar[5].token.Comments, comment.ColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4346,10 +4346,10 @@ yydefault: _elseIf.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[7].list)) // save comments - yylex.(*Parser).comments.AddFromToken(_elseIf, yyDollar[2].token, comment.ElseifToken) - yylex.(*Parser).comments.AddFromToken(_elseIf, yyDollar[3].token, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken(_elseIf, yyDollar[5].token, comment.CloseParenthesisToken) - yylex.(*Parser).comments.AddFromToken(_elseIf, yyDollar[6].token, comment.ColonToken) + _elseIf.AddComments(yyDollar[2].token.Comments, comment.ElseifToken) + _elseIf.AddComments(yyDollar[3].token.Comments, comment.OpenParenthesisToken) + _elseIf.AddComments(yyDollar[5].token.Comments, comment.CloseParenthesisToken) + _elseIf.AddComments(yyDollar[6].token.Comments, comment.ColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4363,8 +4363,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.EndifToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.SemiColonToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.EndifToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4382,10 +4382,10 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[6].token)) // save comments - yylex.(*Parser).comments.AddFromToken(_else, yyDollar[2].token, comment.ElseToken) - yylex.(*Parser).comments.AddFromToken(_else, yyDollar[3].token, comment.ColonToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[5].token, comment.EndifToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[6].token, comment.SemiColonToken) + _else.AddComments(yyDollar[2].token.Comments, comment.ElseToken) + _else.AddComments(yyDollar[3].token.Comments, comment.ColonToken) + yyVAL.node.AddComments(yyDollar[5].token.Comments, comment.EndifToken) + yyVAL.node.AddComments(yyDollar[6].token.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4420,7 +4420,7 @@ yydefault: yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) + lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4447,12 +4447,12 @@ yydefault: // save comments if yyDollar[2].token != nil { - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.AmpersandToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.AmpersandToken) } if yyDollar[3].token != nil { - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.EllipsisToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.EllipsisToken) } - yylex.(*Parser).comments.AddFromToken(variable, yyDollar[4].token, comment.VariableToken) + variable.AddComments(yyDollar[4].token.Comments, comment.VariableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4479,13 +4479,13 @@ yydefault: // save comments if yyDollar[2].token != nil { - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.AmpersandToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.AmpersandToken) } if yyDollar[3].token != nil { - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.EllipsisToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.EllipsisToken) } - yylex.(*Parser).comments.AddFromToken(variable, yyDollar[4].token, comment.VariableToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[5].token, comment.EqualToken) + variable.AddComments(yyDollar[4].token.Comments, comment.VariableToken) + yyVAL.node.AddComments(yyDollar[5].token.Comments, comment.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4523,7 +4523,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.QuestionMarkToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.QuestionMarkToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4537,7 +4537,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ArrayToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ArrayToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4551,7 +4551,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.CallableToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.CallableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4578,7 +4578,7 @@ yydefault: yyVAL.node = yyDollar[2].node // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ColonToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4592,8 +4592,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.CloseParenthesisToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.OpenParenthesisToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4607,11 +4607,11 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.OpenParenthesisToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.OpenParenthesisToken) if yyDollar[3].token != nil { - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.CommaToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.CommaToken) } - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseParenthesisToken) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4630,7 +4630,7 @@ yydefault: yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) + lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4655,7 +4655,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.EllipsisToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.EllipsisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4666,7 +4666,7 @@ yydefault: yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) + lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4693,7 +4693,7 @@ yydefault: yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) + lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4719,7 +4719,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(variable, yyDollar[1].token, comment.VariableToken) + variable.AddComments(yyDollar[1].token.Comments, comment.VariableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4737,8 +4737,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(variable, yyDollar[1].token, comment.VariableToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.EqualToken) + variable.AddComments(yyDollar[1].token.Comments, comment.VariableToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4768,7 +4768,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition(yyDollar[1].list, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.SemiColonToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4782,8 +4782,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewOptionalListTokensPosition(yyDollar[1].list, yyDollar[2].token, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.ConstToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.SemiColonToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.ConstToken) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4807,7 +4807,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.UseToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.UseToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4827,13 +4827,13 @@ yydefault: } // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.FunctionToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.FunctionToken) if yyDollar[3].token != nil { - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.AmpersandToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.AmpersandToken) } - yylex.(*Parser).comments.AddFromToken(name, yyDollar[4].token, comment.IdentifierToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[6].token, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[8].token, comment.CloseParenthesisToken) + name.AddComments(yyDollar[4].token.Comments, comment.IdentifierToken) + yyVAL.node.AddComments(yyDollar[6].token.Comments, comment.OpenParenthesisToken) + yyVAL.node.AddComments(yyDollar[8].token.Comments, comment.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4852,7 +4852,7 @@ yydefault: yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) + lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4865,7 +4865,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.SemiColonToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4878,8 +4878,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.CloseCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.OpenCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4892,8 +4892,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.CloseCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.OpenCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4920,7 +4920,7 @@ yydefault: yyVAL.node = yyDollar[1].node // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.SemiColonToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4931,7 +4931,7 @@ yydefault: yyVAL.node = yyDollar[1].node // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.SemiColonToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4945,7 +4945,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeNodeListPosition(yyDollar[1].node, yyDollar[3].list)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.InsteadofToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.InsteadofToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4961,8 +4961,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.AsToken) - yylex.(*Parser).comments.AddFromToken(alias, yyDollar[3].token, comment.StringToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.AsToken) + alias.AddComments(yyDollar[3].token.Comments, comment.StringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4978,8 +4978,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.AsToken) - yylex.(*Parser).comments.AddFromToken(alias, yyDollar[3].token, comment.StringToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.AsToken) + alias.AddComments(yyDollar[3].token.Comments, comment.StringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4995,8 +4995,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.AsToken) - yylex.(*Parser).comments.AddFromToken(alias, yyDollar[4].token, comment.IdentifierToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.AsToken) + alias.AddComments(yyDollar[4].token.Comments, comment.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5010,7 +5010,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.AsToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.AsToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5026,7 +5026,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(name, yyDollar[1].token, comment.IdentifierToken) + name.AddComments(yyDollar[1].token.Comments, comment.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5050,8 +5050,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PaamayimNekudotayimToken) - yylex.(*Parser).comments.AddFromToken(target, yyDollar[3].token, comment.IdentifierToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.PaamayimNekudotayimToken) + target.AddComments(yyDollar[3].token.Comments, comment.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5065,7 +5065,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.SemiColonToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5079,8 +5079,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.CloseCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.OpenCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5103,7 +5103,7 @@ yydefault: modifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(modifier, yyDollar[1].token, comment.VarToken) + modifier.AddComments(yyDollar[1].token.Comments, comment.VarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5149,7 +5149,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.PublicToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.PublicToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5163,7 +5163,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ProtectedToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ProtectedToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5177,7 +5177,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.PrivateToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.PrivateToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5191,7 +5191,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.StaticToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.StaticToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5205,7 +5205,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.AbstractToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.AbstractToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5219,7 +5219,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.FinalToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.FinalToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5230,7 +5230,7 @@ yydefault: yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) + lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5256,7 +5256,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(variable, yyDollar[1].token, comment.VariableToken) + variable.AddComments(yyDollar[1].token.Comments, comment.VariableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5274,8 +5274,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(variable, yyDollar[1].token, comment.VariableToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.EqualToken) + variable.AddComments(yyDollar[1].token.Comments, comment.VariableToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5286,7 +5286,7 @@ yydefault: yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) + lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5310,8 +5310,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(name, yyDollar[1].token, comment.IdentifierToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.EqualToken) + name.AddComments(yyDollar[1].token.Comments, comment.IdentifierToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5327,8 +5327,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(name, yyDollar[1].token, comment.StringToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.EqualToken) + name.AddComments(yyDollar[1].token.Comments, comment.StringToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5339,7 +5339,7 @@ yydefault: yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) + lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5382,7 +5382,7 @@ yydefault: yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) + lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5408,9 +5408,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[8].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ClassToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[6].token, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[8].token, comment.CloseCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ClassToken) + yyVAL.node.AddComments(yyDollar[6].token.Comments, comment.OpenCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[8].token.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5427,7 +5427,7 @@ yydefault: } // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.NewToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.NewToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5441,7 +5441,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.NewToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.NewToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5457,10 +5457,10 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[6].node)) // save comments - yylex.(*Parser).comments.AddFromToken(list, yyDollar[1].token, comment.ListToken) - yylex.(*Parser).comments.AddFromToken(list, yyDollar[2].token, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken(list, yyDollar[4].token, comment.CloseParenthesisToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[5].token, comment.EqualToken) + list.AddComments(yyDollar[1].token.Comments, comment.ListToken) + list.AddComments(yyDollar[2].token.Comments, comment.OpenParenthesisToken) + list.AddComments(yyDollar[4].token.Comments, comment.CloseParenthesisToken) + yyVAL.node.AddComments(yyDollar[5].token.Comments, comment.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5476,9 +5476,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[5].node)) // save comments - yylex.(*Parser).comments.AddFromToken(shortList, yyDollar[1].token, comment.OpenSquareBracket) - yylex.(*Parser).comments.AddFromToken(shortList, yyDollar[3].token, comment.CloseSquareBracket) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.EqualToken) + shortList.AddComments(yyDollar[1].token.Comments, comment.OpenSquareBracket) + shortList.AddComments(yyDollar[3].token.Comments, comment.CloseSquareBracket) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5492,7 +5492,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.EqualToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5506,8 +5506,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.EqualToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.AmpersandToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.EqualToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.AmpersandToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5521,7 +5521,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.CloneToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.CloneToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5535,7 +5535,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PlusEqualToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.PlusEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5549,7 +5549,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.MinusEqualToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.MinusEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5563,7 +5563,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.MulEqualToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.MulEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5577,7 +5577,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PowEqualToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.PowEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5591,7 +5591,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.DivEqualToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.DivEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5605,7 +5605,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.ConcatEqualToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.ConcatEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5619,7 +5619,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.ModEqualToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.ModEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5633,7 +5633,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.AndEqualToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.AndEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5647,7 +5647,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OrEqualToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OrEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5661,7 +5661,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.XorEqualToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.XorEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5675,7 +5675,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.SlEqualToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.SlEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5689,7 +5689,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.SrEqualToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.SrEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5703,7 +5703,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.IncToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.IncToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5717,7 +5717,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.IncToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.IncToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5731,7 +5731,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.DecToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.DecToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5745,7 +5745,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.DecToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.DecToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5759,7 +5759,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.BooleanOrToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.BooleanOrToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5773,7 +5773,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.BooleanAndToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.BooleanAndToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5787,7 +5787,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.LogicalOrToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.LogicalOrToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5801,7 +5801,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.LogicalAndToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.LogicalAndToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5815,7 +5815,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.LogicalXorToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.LogicalXorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5829,7 +5829,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.VerticalBarToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.VerticalBarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5843,7 +5843,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.AmpersandToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.AmpersandToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5857,7 +5857,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.CaretToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.CaretToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5871,7 +5871,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.DotToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.DotToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5885,7 +5885,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PlusToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.PlusToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5899,7 +5899,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.MinusToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.MinusToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5913,7 +5913,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.AsteriskToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.AsteriskToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5927,7 +5927,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PowToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.PowToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5941,7 +5941,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.SlashToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.SlashToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5955,7 +5955,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PercentToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.PercentToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5969,7 +5969,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.SlToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.SlToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5983,7 +5983,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.SrToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.SrToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5997,7 +5997,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.PlusToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.PlusToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6011,7 +6011,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.MinusToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.MinusToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6025,7 +6025,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ExclamationMarkToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ExclamationMarkToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6039,7 +6039,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.TildeToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.TildeToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6053,7 +6053,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.IsIdenticalToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.IsIdenticalToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6067,7 +6067,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.IsNotIdenticalToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.IsNotIdenticalToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6081,7 +6081,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.IsEqualToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.IsEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6095,7 +6095,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.IsNotEqualToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.IsNotEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6109,7 +6109,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.LessToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.LessToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6123,7 +6123,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.IsSmallerOrEqualToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.IsSmallerOrEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6137,7 +6137,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.GreaterToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.GreaterToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6151,7 +6151,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.IsGreaterOrEqualToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.IsGreaterOrEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6165,7 +6165,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.SpaceshipToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.SpaceshipToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6179,7 +6179,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.InstanceofToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.InstanceofToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6190,8 +6190,8 @@ yydefault: yyVAL.node = yyDollar[2].node // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.CloseParenthesisToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.OpenParenthesisToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6213,8 +6213,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[5].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.QuestionMarkToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.ColonToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.QuestionMarkToken) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.ColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6228,8 +6228,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.QuestionMarkToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.ColonToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.QuestionMarkToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.ColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6243,7 +6243,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.CoalesceToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.CoalesceToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6265,7 +6265,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.IntCastToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.IntCastToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6279,7 +6279,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.DoubleCastToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.DoubleCastToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6293,7 +6293,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.StringCastToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.StringCastToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6307,7 +6307,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ArrayCastToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ArrayCastToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6321,7 +6321,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ObjectCastToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ObjectCastToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6335,7 +6335,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.BoolCastToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.BoolCastToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6349,7 +6349,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.UnsetCastToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.UnsetCastToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6377,7 +6377,7 @@ yydefault: } // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ExitToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ExitToken) if yyDollar[2].node != nil { yylex.(*Parser).comments.AddFromChildNode(yyVAL.node, yyDollar[2].node) @@ -6395,7 +6395,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.AtToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.AtToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6417,8 +6417,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.BackquoteToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.BackquoteToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.BackquoteToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.BackquoteToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6432,7 +6432,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.PrintToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.PrintToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6446,7 +6446,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.YieldToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.YieldToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6460,7 +6460,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.YieldToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.YieldToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6474,8 +6474,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[4].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.YieldToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.DoubleArrowToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.YieldToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.DoubleArrowToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6489,7 +6489,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.YieldFromToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.YieldFromToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6503,14 +6503,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[11].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.FunctionToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.FunctionToken) if yyDollar[2].token != nil { - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.AmpersandToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.AmpersandToken) } - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[6].token, comment.CloseParenthesisToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[9].token, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[11].token, comment.CloseCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.OpenParenthesisToken) + yyVAL.node.AddComments(yyDollar[6].token.Comments, comment.CloseParenthesisToken) + yyVAL.node.AddComments(yyDollar[9].token.Comments, comment.OpenCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[11].token.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6524,15 +6524,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[12].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.StaticToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.FunctionToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.StaticToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.FunctionToken) if yyDollar[3].token != nil { - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.AmpersandToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.AmpersandToken) } - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[5].token, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[7].token, comment.CloseParenthesisToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[10].token, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[12].token, comment.CloseCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[5].token.Comments, comment.OpenParenthesisToken) + yyVAL.node.AddComments(yyDollar[7].token.Comments, comment.CloseParenthesisToken) + yyVAL.node.AddComments(yyDollar[10].token.Comments, comment.OpenCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[12].token.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6575,9 +6575,9 @@ yydefault: yyVAL.ClosureUse.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.ClosureUse, yyDollar[1].token, comment.UseToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.ClosureUse, yyDollar[2].token, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.ClosureUse, yyDollar[4].token, comment.CloseParenthesisToken) + yyVAL.ClosureUse.AddComments(yyDollar[1].token.Comments, comment.UseToken) + yyVAL.ClosureUse.AddComments(yyDollar[2].token.Comments, comment.OpenParenthesisToken) + yyVAL.ClosureUse.AddComments(yyDollar[4].token.Comments, comment.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6588,7 +6588,7 @@ yydefault: yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) + lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6612,7 +6612,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.VariableToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.VariableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6630,8 +6630,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.AmpersandToken) - yylex.(*Parser).comments.AddFromToken(variable, yyDollar[2].token, comment.VariableToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.AmpersandToken) + variable.AddComments(yyDollar[2].token.Comments, comment.VariableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6656,7 +6656,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PaamayimNekudotayimToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.PaamayimNekudotayimToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6670,7 +6670,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PaamayimNekudotayimToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.PaamayimNekudotayimToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6695,7 +6695,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.StaticToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.StaticToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6741,8 +6741,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.CloseParenthesisToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.OpenParenthesisToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6796,9 +6796,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ArrayToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseParenthesisToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ArrayToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenParenthesisToken) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6812,8 +6812,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.OpenSquareBracket) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.CloseSquareBracket) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.OpenSquareBracket) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6827,7 +6827,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ConstantEncapsedStringToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ConstantEncapsedStringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6841,7 +6841,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.LnumberToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.LnumberToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6855,7 +6855,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.DnumberToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.DnumberToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6869,7 +6869,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.LineToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.LineToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6883,7 +6883,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.FileToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.FileToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6897,7 +6897,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.DirToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.DirToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6911,7 +6911,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.TraitCToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.TraitCToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6925,7 +6925,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.MethodCToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.MethodCToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6939,7 +6939,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.FuncCToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.FuncCToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6953,7 +6953,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.NsCToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.NsCToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6967,7 +6967,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ClassCToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ClassCToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6983,7 +6983,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.StartHeredocToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.StartHeredocToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6997,7 +6997,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.StartHeredocToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.StartHeredocToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7011,7 +7011,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.DoubleQuoteToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.DoubleQuoteToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7025,7 +7025,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.StartHeredocToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.StartHeredocToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7068,8 +7068,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PaamayimNekudotayimToken) - yylex.(*Parser).comments.AddFromToken(target, yyDollar[3].token, comment.IdentifierToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.PaamayimNekudotayimToken) + target.AddComments(yyDollar[3].token.Comments, comment.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7085,8 +7085,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PaamayimNekudotayimToken) - yylex.(*Parser).comments.AddFromToken(target, yyDollar[3].token, comment.IdentifierToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.PaamayimNekudotayimToken) + target.AddComments(yyDollar[3].token.Comments, comment.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7145,8 +7145,8 @@ yydefault: yyVAL.node = yyDollar[2].node // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.CloseParenthesisToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.OpenParenthesisToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7173,8 +7173,8 @@ yydefault: yyVAL.node = yyDollar[2].node // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.CloseParenthesisToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.OpenParenthesisToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7204,8 +7204,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenSquareBracket) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseSquareBracket) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenSquareBracket) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7219,8 +7219,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenSquareBracket) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseSquareBracket) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenSquareBracket) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7234,8 +7234,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7249,7 +7249,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.ObjectOperatorToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.ObjectOperatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7287,7 +7287,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.ObjectOperatorToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.ObjectOperatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7303,7 +7303,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.VariableToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.VariableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7317,9 +7317,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.DollarToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.DollarToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7333,7 +7333,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.DollarToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.DollarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7347,7 +7347,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PaamayimNekudotayimToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.PaamayimNekudotayimToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7361,7 +7361,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PaamayimNekudotayimToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.PaamayimNekudotayimToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7383,8 +7383,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenSquareBracket) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseSquareBracket) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenSquareBracket) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7398,8 +7398,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7413,7 +7413,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.ObjectOperatorToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.ObjectOperatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7427,7 +7427,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PaamayimNekudotayimToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.PaamayimNekudotayimToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7441,7 +7441,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PaamayimNekudotayimToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.PaamayimNekudotayimToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7455,7 +7455,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.IdentifierToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7466,8 +7466,8 @@ yydefault: yyVAL.node = yyDollar[2].node // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.CloseCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.OpenCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7489,7 +7489,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.StringToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.StringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7500,8 +7500,8 @@ yydefault: yyVAL.node = yyDollar[2].node // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.CloseCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.OpenCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7548,7 +7548,9 @@ yydefault: yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) + if yyDollar[3].node != nil { + yyDollar[3].node.AddComments(yyDollar[2].token.Comments, comment.CommaToken) + } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7570,7 +7572,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.DoubleArrowToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.DoubleArrowToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7597,8 +7599,8 @@ yydefault: reference.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[3].token, yyDollar[4].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.DoubleArrowToken) - yylex.(*Parser).comments.AddFromToken(reference, yyDollar[3].token, comment.AmpersandToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.DoubleArrowToken) + reference.AddComments(yyDollar[3].token.Comments, comment.AmpersandToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7614,7 +7616,7 @@ yydefault: reference.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddFromToken(reference, yyDollar[1].token, comment.AmpersandToken) + reference.AddComments(yyDollar[1].token.Comments, comment.AmpersandToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7631,10 +7633,10 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[6].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.DoubleArrowToken) - yylex.(*Parser).comments.AddFromToken(list, yyDollar[3].token, comment.ListToken) - yylex.(*Parser).comments.AddFromToken(list, yyDollar[4].token, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken(list, yyDollar[6].token, comment.CloseParenthesisToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.DoubleArrowToken) + list.AddComments(yyDollar[3].token.Comments, comment.ListToken) + list.AddComments(yyDollar[4].token.Comments, comment.OpenParenthesisToken) + list.AddComments(yyDollar[6].token.Comments, comment.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7651,9 +7653,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddFromToken(list, yyDollar[1].token, comment.ListToken) - yylex.(*Parser).comments.AddFromToken(list, yyDollar[2].token, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken(list, yyDollar[4].token, comment.CloseParenthesisToken) + list.AddComments(yyDollar[1].token.Comments, comment.ListToken) + list.AddComments(yyDollar[2].token.Comments, comment.OpenParenthesisToken) + list.AddComments(yyDollar[4].token.Comments, comment.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7676,7 +7678,7 @@ yydefault: encapsed.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) // save comments - yylex.(*Parser).comments.AddFromToken(encapsed, yyDollar[2].token, comment.EncapsedAndWhitespaceToken) + encapsed.AddComments(yyDollar[2].token.Comments, comment.EncapsedAndWhitespaceToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7699,7 +7701,7 @@ yydefault: encapsed.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(encapsed, yyDollar[1].token, comment.EncapsedAndWhitespaceToken) + encapsed.AddComments(yyDollar[1].token.Comments, comment.EncapsedAndWhitespaceToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7715,7 +7717,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.VariableToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.VariableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7733,9 +7735,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddFromToken(variable, yyDollar[1].token, comment.VariableToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenSquareBracket) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseSquareBracket) + variable.AddComments(yyDollar[1].token.Comments, comment.VariableToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenSquareBracket) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7755,9 +7757,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddFromToken(variable, yyDollar[1].token, comment.VariableToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.ObjectOperatorToken) - yylex.(*Parser).comments.AddFromToken(fetch, yyDollar[3].token, comment.StringToken) + variable.AddComments(yyDollar[1].token.Comments, comment.VariableToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.ObjectOperatorToken) + fetch.AddComments(yyDollar[3].token.Comments, comment.StringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7771,8 +7773,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.DollarOpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.CloseCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.DollarOpenCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7788,9 +7790,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.DollarOpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken(name, yyDollar[2].token, comment.StringVarnameToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.CloseCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.DollarOpenCurlyBracesToken) + name.AddComments(yyDollar[2].token.Comments, comment.StringVarnameToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7808,11 +7810,11 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[6].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.DollarOpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken(variable, yyDollar[2].token, comment.StringVarnameToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.OpenSquareBracket) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[5].token, comment.CloseSquareBracket) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[6].token, comment.CloseCurlyBracesToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.DollarOpenCurlyBracesToken) + variable.AddComments(yyDollar[2].token.Comments, comment.StringVarnameToken) + yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.OpenSquareBracket) + yyVAL.node.AddComments(yyDollar[5].token.Comments, comment.CloseSquareBracket) + yyVAL.node.AddComments(yyDollar[6].token.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7834,7 +7836,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.StringToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.StringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7853,7 +7855,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.NumStringToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.NumStringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7881,11 +7883,11 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.MinusToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.MinusToken) if isInt { - yylex.(*Parser).comments.AddFromToken(lnumber, yyDollar[2].token, comment.NumStringToken) + lnumber.AddComments(yyDollar[2].token.Comments, comment.NumStringToken) } else { - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.NumStringToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.NumStringToken) } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -7902,7 +7904,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.VariableToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.VariableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7916,12 +7918,12 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[5].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.IssetToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenParenthesisToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.IssetToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenParenthesisToken) if yyDollar[4].token != nil { - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CommaToken) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CommaToken) } - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[5].token, comment.CloseParenthesisToken) + yyVAL.node.AddComments(yyDollar[5].token.Comments, comment.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7935,9 +7937,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.EmptyToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseParenthesisToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.EmptyToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenParenthesisToken) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7951,7 +7953,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.IncludeToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.IncludeToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7965,7 +7967,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.IncludeOnceToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.IncludeOnceToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7979,9 +7981,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.EvalToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseParenthesisToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.EvalToken) + yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenParenthesisToken) + yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7995,7 +7997,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.RequireToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.RequireToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -8009,7 +8011,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.RequireOnceToken) + yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.RequireOnceToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -8028,7 +8030,7 @@ yydefault: yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) + lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php7/php7.y b/php7/php7.y index eee2747..cfd20c1 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -363,7 +363,7 @@ namespace_name: namePart.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken(namePart, $1, comment.StringToken) + namePart.AddComments($1.Comments, comment.StringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -376,8 +376,8 @@ namespace_name: namePart.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.NsSeparatorToken) - yylex.(*Parser).comments.AddFromToken(namePart, $3, comment.StringToken) + lastNode($1).AddComments($2.Comments, comment.NsSeparatorToken) + namePart.AddComments($3.Comments, comment.StringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -401,8 +401,8 @@ name: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.NamespaceToken) - yylex.(*Parser).comments.AddFromToken($$, $2, comment.NsSeparatorToken) + $$.AddComments($1.Comments, comment.NamespaceToken) + $$.AddComments($2.Comments, comment.NsSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -414,7 +414,7 @@ name: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.NsSeparatorToken) + $$.AddComments($1.Comments, comment.NsSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -466,10 +466,10 @@ top_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.HaltCompilerToken) - yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.CloseParenthesisToken) - yylex.(*Parser).comments.AddFromToken($$, $4, comment.SemiColonToken) + $$.AddComments($1.Comments, comment.HaltCompilerToken) + $$.AddComments($2.Comments, comment.OpenParenthesisToken) + $$.AddComments($3.Comments, comment.CloseParenthesisToken) + $$.AddComments($4.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -483,8 +483,8 @@ top_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.NamespaceToken) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.SemiColonToken) + $$.AddComments($1.Comments, comment.NamespaceToken) + $$.AddComments($3.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -498,9 +498,9 @@ top_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.NamespaceToken) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken($$, $5, comment.CloseCurlyBracesToken) + $$.AddComments($1.Comments, comment.NamespaceToken) + $$.AddComments($3.Comments, comment.OpenCurlyBracesToken) + $$.AddComments($5.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -512,9 +512,9 @@ top_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.NamespaceToken) - yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseCurlyBracesToken) + $$.AddComments($1.Comments, comment.NamespaceToken) + $$.AddComments($2.Comments, comment.OpenCurlyBracesToken) + $$.AddComments($4.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -526,8 +526,8 @@ top_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.UseToken) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.SemiColonToken) + $$.AddComments($1.Comments, comment.UseToken) + $$.AddComments($3.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -539,8 +539,8 @@ top_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.UseToken) - yylex.(*Parser).comments.AddFromToken($$, $4, comment.SemiColonToken) + $$.AddComments($1.Comments, comment.UseToken) + $$.AddComments($4.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -552,8 +552,8 @@ top_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.UseToken) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.SemiColonToken) + $$.AddComments($1.Comments, comment.UseToken) + $$.AddComments($3.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -565,8 +565,8 @@ top_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.UseToken) - yylex.(*Parser).comments.AddFromToken($$, $4, comment.SemiColonToken) + $$.AddComments($1.Comments, comment.UseToken) + $$.AddComments($4.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -578,8 +578,8 @@ top_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.ConstToken) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.SemiColonToken) + $$.AddComments($1.Comments, comment.ConstToken) + $$.AddComments($3.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -594,7 +594,7 @@ use_type: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.FunctionToken) + $$.AddComments($1.Comments, comment.FunctionToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -606,7 +606,7 @@ use_type: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.ConstToken) + $$.AddComments($1.Comments, comment.ConstToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -623,12 +623,12 @@ group_use_declaration: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $6)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.NsSeparatorToken) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.OpenCurlyBracesToken) + $$.AddComments($2.Comments, comment.NsSeparatorToken) + $$.AddComments($3.Comments, comment.OpenCurlyBracesToken) if $5 != nil { - yylex.(*Parser).comments.AddFromToken($$, $5, comment.CommaToken) + $$.AddComments($5.Comments, comment.CommaToken) } - yylex.(*Parser).comments.AddFromToken($$, $6, comment.CloseCurlyBracesToken) + $$.AddComments($6.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -642,13 +642,13 @@ group_use_declaration: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $7)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.NsSeparatorToken) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.NsSeparatorToken) - yylex.(*Parser).comments.AddFromToken($$, $4, comment.OpenCurlyBracesToken) + $$.AddComments($1.Comments, comment.NsSeparatorToken) + $$.AddComments($3.Comments, comment.NsSeparatorToken) + $$.AddComments($4.Comments, comment.OpenCurlyBracesToken) if $6 != nil { - yylex.(*Parser).comments.AddFromToken($$, $6, comment.CommaToken) + $$.AddComments($6.Comments, comment.CommaToken) } - yylex.(*Parser).comments.AddFromToken($$, $7, comment.CloseCurlyBracesToken) + $$.AddComments($7.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -665,12 +665,12 @@ mixed_group_use_declaration: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $6)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.NsSeparatorToken) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.OpenCurlyBracesToken) + $$.AddComments($2.Comments, comment.NsSeparatorToken) + $$.AddComments($3.Comments, comment.OpenCurlyBracesToken) if $5 != nil { - yylex.(*Parser).comments.AddFromToken($$, $5, comment.CommaToken) + $$.AddComments($5.Comments, comment.CommaToken) } - yylex.(*Parser).comments.AddFromToken($$, $6, comment.CloseCurlyBracesToken) + $$.AddComments($6.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -684,13 +684,13 @@ mixed_group_use_declaration: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $7)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.NsSeparatorToken) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.NsSeparatorToken) - yylex.(*Parser).comments.AddFromToken($$, $4, comment.OpenCurlyBracesToken) + $$.AddComments($1.Comments, comment.NsSeparatorToken) + $$.AddComments($3.Comments, comment.NsSeparatorToken) + $$.AddComments($4.Comments, comment.OpenCurlyBracesToken) if $6 != nil { - yylex.(*Parser).comments.AddFromToken($$, $6, comment.CommaToken) + $$.AddComments($6.Comments, comment.CommaToken) } - yylex.(*Parser).comments.AddFromToken($$, $7, comment.CloseCurlyBracesToken) + $$.AddComments($7.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -713,7 +713,7 @@ inline_use_declarations: $$ = append($1, $3) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) + lastNode($1).AddComments($2.Comments, comment.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -731,7 +731,7 @@ unprefixed_use_declarations: $$ = append($1, $3) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) + lastNode($1).AddComments($2.Comments, comment.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -749,7 +749,7 @@ use_declarations: $$ = append($1, $3) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) + lastNode($1).AddComments($2.Comments, comment.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -800,8 +800,8 @@ unprefixed_use_declaration: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.AsToken) - yylex.(*Parser).comments.AddFromToken(alias, $3, comment.StringToken) + $$.AddComments($2.Comments, comment.AsToken) + alias.AddComments($3.Comments, comment.StringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -819,7 +819,7 @@ use_declaration: $$ = $2; // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.NsSeparatorToken) + $$.AddComments($1.Comments, comment.NsSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -831,7 +831,7 @@ const_list: $$ = append($1, $3) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) + lastNode($1).AddComments($2.Comments, comment.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -906,10 +906,10 @@ inner_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.HaltCompilerToken) - yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.CloseParenthesisToken) - yylex.(*Parser).comments.AddFromToken($$, $4, comment.SemiColonToken) + $$.AddComments($1.Comments, comment.HaltCompilerToken) + $$.AddComments($2.Comments, comment.OpenParenthesisToken) + $$.AddComments($3.Comments, comment.CloseParenthesisToken) + $$.AddComments($4.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -923,8 +923,8 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.CloseCurlyBracesToken) + $$.AddComments($1.Comments, comment.OpenCurlyBracesToken) + $$.AddComments($3.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -955,9 +955,9 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.WhileToken) - yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseParenthesisToken) + $$.AddComments($1.Comments, comment.WhileToken) + $$.AddComments($2.Comments, comment.OpenParenthesisToken) + $$.AddComments($4.Comments, comment.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -969,11 +969,11 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $7)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.DoToken) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.WhileToken) - yylex.(*Parser).comments.AddFromToken($$, $4, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken($$, $6, comment.CloseParenthesisToken) - yylex.(*Parser).comments.AddFromToken($$, $7, comment.SemiColonToken) + $$.AddComments($1.Comments, comment.DoToken) + $$.AddComments($3.Comments, comment.WhileToken) + $$.AddComments($4.Comments, comment.OpenParenthesisToken) + $$.AddComments($6.Comments, comment.CloseParenthesisToken) + $$.AddComments($7.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -996,11 +996,11 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $9)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.ForToken) - yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken($$, $4, comment.ForInitSemicolonToken) - yylex.(*Parser).comments.AddFromToken($$, $6, comment.ForCondSemicolonToken) - yylex.(*Parser).comments.AddFromToken($$, $8, comment.CloseParenthesisToken) + $$.AddComments($1.Comments, comment.ForToken) + $$.AddComments($2.Comments, comment.OpenParenthesisToken) + $$.AddComments($4.Comments, comment.ForInitSemicolonToken) + $$.AddComments($6.Comments, comment.ForCondSemicolonToken) + $$.AddComments($8.Comments, comment.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1021,9 +1021,9 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.SwitchToken) - yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseParenthesisToken) + $$.AddComments($1.Comments, comment.SwitchToken) + $$.AddComments($2.Comments, comment.OpenParenthesisToken) + $$.AddComments($4.Comments, comment.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1035,8 +1035,8 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.BreakToken) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.SemiColonToken) + $$.AddComments($1.Comments, comment.BreakToken) + $$.AddComments($3.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1048,8 +1048,8 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.ContinueToken) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.SemiColonToken) + $$.AddComments($1.Comments, comment.ContinueToken) + $$.AddComments($3.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1061,8 +1061,8 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.ReturnToken) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.SemiColonToken) + $$.AddComments($1.Comments, comment.ReturnToken) + $$.AddComments($3.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1074,8 +1074,8 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.GlobalToken) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.SemiColonToken) + $$.AddComments($1.Comments, comment.GlobalToken) + $$.AddComments($3.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1087,8 +1087,8 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.StaticToken) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.SemiColonToken) + $$.AddComments($1.Comments, comment.StaticToken) + $$.AddComments($3.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1100,8 +1100,8 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.EchoToken) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.SemiColonToken) + $$.AddComments($1.Comments, comment.EchoToken) + $$.AddComments($3.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1113,7 +1113,7 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.InlineHTMLToken) + $$.AddComments($1.Comments, comment.InlineHTMLToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1125,7 +1125,7 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.SemiColonToken) + $$.AddComments($2.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1137,13 +1137,13 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $6)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.UnsetToken) - yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenParenthesisToken) + $$.AddComments($1.Comments, comment.UnsetToken) + $$.AddComments($2.Comments, comment.OpenParenthesisToken) if $4 != nil { - yylex.(*Parser).comments.AddFromToken($$, $4, comment.CommaToken) + $$.AddComments($4.Comments, comment.CommaToken) } - yylex.(*Parser).comments.AddFromToken($$, $5, comment.CloseParenthesisToken) - yylex.(*Parser).comments.AddFromToken($$, $6, comment.SemiColonToken) + $$.AddComments($5.Comments, comment.CloseParenthesisToken) + $$.AddComments($6.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1164,10 +1164,10 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $7)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.ForeachToken) - yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken($$, $4, comment.AsToken) - yylex.(*Parser).comments.AddFromToken($$, $6, comment.CloseParenthesisToken) + $$.AddComments($1.Comments, comment.ForeachToken) + $$.AddComments($2.Comments, comment.OpenParenthesisToken) + $$.AddComments($4.Comments, comment.AsToken) + $$.AddComments($6.Comments, comment.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1190,11 +1190,11 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $9)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.ForeachToken) - yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken($$, $4, comment.AsToken) - yylex.(*Parser).comments.AddFromToken($$, $6, comment.DoubleArrowToken) - yylex.(*Parser).comments.AddFromToken($$, $8, comment.CloseParenthesisToken) + $$.AddComments($1.Comments, comment.ForeachToken) + $$.AddComments($2.Comments, comment.OpenParenthesisToken) + $$.AddComments($4.Comments, comment.AsToken) + $$.AddComments($6.Comments, comment.DoubleArrowToken) + $$.AddComments($8.Comments, comment.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1206,9 +1206,9 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.DeclareToken) - yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseParenthesisToken) + $$.AddComments($1.Comments, comment.DeclareToken) + $$.AddComments($2.Comments, comment.OpenParenthesisToken) + $$.AddComments($4.Comments, comment.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1220,7 +1220,7 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.SemiColonToken) + $$.AddComments($1.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1235,9 +1235,9 @@ statement: } // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.TryToken) - yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseCurlyBracesToken) + $$.AddComments($1.Comments, comment.TryToken) + $$.AddComments($2.Comments, comment.OpenCurlyBracesToken) + $$.AddComments($4.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1249,8 +1249,8 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.ThrowToken) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.SemiColonToken) + $$.AddComments($1.Comments, comment.ThrowToken) + $$.AddComments($3.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1264,9 +1264,9 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.GotoToken) - yylex.(*Parser).comments.AddFromToken(label, $2, comment.StringToken) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.SemiColonToken) + $$.AddComments($1.Comments, comment.GotoToken) + label.AddComments($2.Comments, comment.StringToken) + $$.AddComments($3.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1280,8 +1280,8 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken(label, $1, comment.StringToken) - yylex.(*Parser).comments.AddFromToken($$, $2, comment.ColonToken) + label.AddComments($1.Comments, comment.StringToken) + $$.AddComments($2.Comments, comment.ColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1306,12 +1306,12 @@ catch_list: catch.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($2, $9)) // save comments - yylex.(*Parser).comments.AddFromToken(catch, $2, comment.CatchToken) - yylex.(*Parser).comments.AddFromToken(catch, $3, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken(variable, $5, comment.StringToken) - yylex.(*Parser).comments.AddFromToken(catch, $6, comment.CloseParenthesisToken) - yylex.(*Parser).comments.AddFromToken(catch, $7, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken(catch, $9, comment.CloseCurlyBracesToken) + catch.AddComments($2.Comments, comment.CatchToken) + catch.AddComments($3.Comments, comment.OpenParenthesisToken) + variable.AddComments($5.Comments, comment.StringToken) + catch.AddComments($6.Comments, comment.CloseParenthesisToken) + catch.AddComments($7.Comments, comment.OpenCurlyBracesToken) + catch.AddComments($9.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1328,7 +1328,7 @@ catch_name_list: $$ = append($1, $3) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.VerticalBarToken) + lastNode($1).AddComments($2.Comments, comment.VerticalBarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1349,9 +1349,9 @@ finally_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.FinallyToken) - yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseCurlyBracesToken) + $$.AddComments($1.Comments, comment.FinallyToken) + $$.AddComments($2.Comments, comment.OpenCurlyBracesToken) + $$.AddComments($4.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1369,7 +1369,7 @@ unset_variables: $$ = append($1, $3) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) + lastNode($1).AddComments($2.Comments, comment.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1396,15 +1396,15 @@ function_declaration_statement: // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.FunctionToken) + $$.AddComments($1.Comments, comment.FunctionToken) if $2 != nil { - yylex.(*Parser).comments.AddFromToken($$, $2, comment.AmpersandToken) + $$.AddComments($2.Comments, comment.AmpersandToken) } - yylex.(*Parser).comments.AddFromToken(name, $3, comment.StringToken) - yylex.(*Parser).comments.AddFromToken($$, $5, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken($$, $7, comment.CloseParenthesisToken) - yylex.(*Parser).comments.AddFromToken($$, $9, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken($$, $11, comment.CloseCurlyBracesToken) + name.AddComments($3.Comments, comment.StringToken) + $$.AddComments($5.Comments, comment.OpenParenthesisToken) + $$.AddComments($7.Comments, comment.CloseParenthesisToken) + $$.AddComments($9.Comments, comment.OpenCurlyBracesToken) + $$.AddComments($11.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1443,10 +1443,10 @@ class_declaration_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewOptionalListTokensPosition($1, $2, $9)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.ClassToken) - yylex.(*Parser).comments.AddFromToken(name, $3, comment.StringToken) - yylex.(*Parser).comments.AddFromToken($$, $7, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken($$, $9, comment.CloseCurlyBracesToken) + $$.AddComments($2.Comments, comment.ClassToken) + name.AddComments($3.Comments, comment.StringToken) + $$.AddComments($7.Comments, comment.OpenCurlyBracesToken) + $$.AddComments($9.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1460,10 +1460,10 @@ class_declaration_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $8)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.ClassToken) - yylex.(*Parser).comments.AddFromToken(name, $2, comment.StringToken) - yylex.(*Parser).comments.AddFromToken($$, $6, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken($$, $8, comment.CloseCurlyBracesToken) + $$.AddComments($1.Comments, comment.ClassToken) + name.AddComments($2.Comments, comment.StringToken) + $$.AddComments($6.Comments, comment.OpenCurlyBracesToken) + $$.AddComments($8.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1493,7 +1493,7 @@ class_modifier: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.AbstractToken) + $$.AddComments($1.Comments, comment.AbstractToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1505,7 +1505,7 @@ class_modifier: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.FinalToken) + $$.AddComments($1.Comments, comment.FinalToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1522,10 +1522,10 @@ trait_declaration_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $6)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.TraitToken) - yylex.(*Parser).comments.AddFromToken(name, $2, comment.StringToken) - yylex.(*Parser).comments.AddFromToken($$, $4, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken($$, $6, comment.CloseCurlyBracesToken) + $$.AddComments($1.Comments, comment.TraitToken) + name.AddComments($2.Comments, comment.StringToken) + $$.AddComments($4.Comments, comment.OpenCurlyBracesToken) + $$.AddComments($6.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1542,10 +1542,10 @@ interface_declaration_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $7)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.InterfaceToken) - yylex.(*Parser).comments.AddFromToken(name, $2, comment.StringToken) - yylex.(*Parser).comments.AddFromToken($$, $5, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken($$, $7, comment.CloseCurlyBracesToken) + $$.AddComments($1.Comments, comment.InterfaceToken) + name.AddComments($2.Comments, comment.StringToken) + $$.AddComments($5.Comments, comment.OpenCurlyBracesToken) + $$.AddComments($7.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1566,7 +1566,7 @@ extends_from: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.ExtendsToken) + $$.AddComments($1.Comments, comment.ExtendsToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1587,7 +1587,7 @@ interface_extends_list: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.ExtendsToken) + $$.AddComments($1.Comments, comment.ExtendsToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1608,7 +1608,7 @@ implements_list: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.ImplementsToken) + $$.AddComments($1.Comments, comment.ImplementsToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1629,7 +1629,7 @@ foreach_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.AmpersandToken) + $$.AddComments($1.Comments, comment.AmpersandToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1641,9 +1641,9 @@ foreach_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.ListToken) - yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseParenthesisToken) + $$.AddComments($1.Comments, comment.ListToken) + $$.AddComments($2.Comments, comment.OpenParenthesisToken) + $$.AddComments($4.Comments, comment.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1655,8 +1655,8 @@ foreach_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.OpenSquareBracket) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.CloseSquareBracket) + $$.AddComments($1.Comments, comment.OpenSquareBracket) + $$.AddComments($3.Comments, comment.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1682,9 +1682,9 @@ for_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.ColonToken) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.EndforToken) - yylex.(*Parser).comments.AddFromToken($$, $4, comment.SemiColonToken) + $$.AddComments($1.Comments, comment.ColonToken) + $$.AddComments($3.Comments, comment.EndforToken) + $$.AddComments($4.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1710,9 +1710,9 @@ foreach_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.ColonToken) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.EndforeachToken) - yylex.(*Parser).comments.AddFromToken($$, $4, comment.SemiColonToken) + $$.AddComments($1.Comments, comment.ColonToken) + $$.AddComments($3.Comments, comment.EndforeachToken) + $$.AddComments($4.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1733,9 +1733,9 @@ declare_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.ColonToken) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.EnddeclareToken) - yylex.(*Parser).comments.AddFromToken($$, $4, comment.SemiColonToken) + $$.AddComments($1.Comments, comment.ColonToken) + $$.AddComments($3.Comments, comment.EnddeclareToken) + $$.AddComments($4.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1752,8 +1752,8 @@ switch_case_list: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken(caseList, $1, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken(caseList, $3, comment.CloseCurlyBracesToken) + caseList.AddComments($1.Comments, comment.OpenCurlyBracesToken) + caseList.AddComments($3.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1767,9 +1767,9 @@ switch_case_list: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddFromToken(caseList, $1, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken(caseList, $2, comment.SemiColonToken) - yylex.(*Parser).comments.AddFromToken(caseList, $4, comment.CloseCurlyBracesToken) + caseList.AddComments($1.Comments, comment.OpenCurlyBracesToken) + caseList.AddComments($2.Comments, comment.SemiColonToken) + caseList.AddComments($4.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1783,9 +1783,9 @@ switch_case_list: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddFromToken(caseList, $1, comment.ColonToken) - yylex.(*Parser).comments.AddFromToken(caseList, $3, comment.EndswitchToken) - yylex.(*Parser).comments.AddFromToken($$, $4, comment.SemiColonToken) + caseList.AddComments($1.Comments, comment.ColonToken) + caseList.AddComments($3.Comments, comment.EndswitchToken) + $$.AddComments($4.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1800,10 +1800,10 @@ switch_case_list: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5)) // save comments - yylex.(*Parser).comments.AddFromToken(caseList, $1, comment.ColonToken) - yylex.(*Parser).comments.AddFromToken(caseList, $2, comment.SemiColonToken) - yylex.(*Parser).comments.AddFromToken(caseList, $4, comment.EndswitchToken) - yylex.(*Parser).comments.AddFromToken($$, $5, comment.SemiColonToken) + caseList.AddComments($1.Comments, comment.ColonToken) + caseList.AddComments($2.Comments, comment.SemiColonToken) + caseList.AddComments($4.Comments, comment.EndswitchToken) + $$.AddComments($5.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1825,8 +1825,8 @@ case_list: _case.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $5)) // save comments - yylex.(*Parser).comments.AddFromToken(_case, $2, comment.CaseToken) - yylex.(*Parser).comments.AddFromToken(_case, $4, comment.CaseSeparatorToken) + _case.AddComments($2.Comments, comment.CaseToken) + _case.AddComments($4.Comments, comment.CaseSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1839,8 +1839,8 @@ case_list: _default.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $4)) // save comments - yylex.(*Parser).comments.AddFromToken(_default, $2, comment.DefaultToken) - yylex.(*Parser).comments.AddFromToken(_default, $3, comment.CaseSeparatorToken) + _default.AddComments($2.Comments, comment.DefaultToken) + _default.AddComments($3.Comments, comment.CaseSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1877,9 +1877,9 @@ while_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.ColonToken) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.EndwhileToken) - yylex.(*Parser).comments.AddFromToken($$, $4, comment.SemiColonToken) + $$.AddComments($1.Comments, comment.ColonToken) + $$.AddComments($3.Comments, comment.EndwhileToken) + $$.AddComments($4.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1894,9 +1894,9 @@ if_stmt_without_else: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.IfToken) - yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseParenthesisToken) + $$.AddComments($1.Comments, comment.IfToken) + $$.AddComments($2.Comments, comment.OpenParenthesisToken) + $$.AddComments($4.Comments, comment.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1910,9 +1910,9 @@ if_stmt_without_else: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $6)) // save comments - yylex.(*Parser).comments.AddFromToken(_elseIf, $2, comment.ElseifToken) - yylex.(*Parser).comments.AddFromToken(_elseIf, $3, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken(_elseIf, $5, comment.CloseParenthesisToken) + _elseIf.AddComments($2.Comments, comment.ElseifToken) + _elseIf.AddComments($3.Comments, comment.OpenParenthesisToken) + _elseIf.AddComments($5.Comments, comment.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1935,7 +1935,7 @@ if_stmt: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.ElseToken) + $$.AddComments($2.Comments, comment.ElseToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1952,10 +1952,10 @@ alt_if_stmt_without_else: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $6)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.IfToken) - yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseParenthesisToken) - yylex.(*Parser).comments.AddFromToken($$, $5, comment.ColonToken) + $$.AddComments($1.Comments, comment.IfToken) + $$.AddComments($2.Comments, comment.OpenParenthesisToken) + $$.AddComments($4.Comments, comment.CloseParenthesisToken) + $$.AddComments($5.Comments, comment.ColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1970,10 +1970,10 @@ alt_if_stmt_without_else: _elseIf.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $7)) // save comments - yylex.(*Parser).comments.AddFromToken(_elseIf, $2, comment.ElseifToken) - yylex.(*Parser).comments.AddFromToken(_elseIf, $3, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken(_elseIf, $5, comment.CloseParenthesisToken) - yylex.(*Parser).comments.AddFromToken(_elseIf, $6, comment.ColonToken) + _elseIf.AddComments($2.Comments, comment.ElseifToken) + _elseIf.AddComments($3.Comments, comment.OpenParenthesisToken) + _elseIf.AddComments($5.Comments, comment.CloseParenthesisToken) + _elseIf.AddComments($6.Comments, comment.ColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1988,8 +1988,8 @@ alt_if_stmt: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.EndifToken) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.SemiColonToken) + $$.AddComments($2.Comments, comment.EndifToken) + $$.AddComments($3.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2005,10 +2005,10 @@ alt_if_stmt: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $6)) // save comments - yylex.(*Parser).comments.AddFromToken(_else, $2, comment.ElseToken) - yylex.(*Parser).comments.AddFromToken(_else, $3, comment.ColonToken) - yylex.(*Parser).comments.AddFromToken($$, $5, comment.EndifToken) - yylex.(*Parser).comments.AddFromToken($$, $6, comment.SemiColonToken) + _else.AddComments($2.Comments, comment.ElseToken) + _else.AddComments($3.Comments, comment.ColonToken) + $$.AddComments($5.Comments, comment.EndifToken) + $$.AddComments($6.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2041,7 +2041,7 @@ non_empty_parameter_list: $$ = append($1, $3) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) + lastNode($1).AddComments($2.Comments, comment.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2069,12 +2069,12 @@ parameter: // save comments if $2 != nil { - yylex.(*Parser).comments.AddFromToken($$, $2, comment.AmpersandToken) + $$.AddComments($2.Comments, comment.AmpersandToken) } if $3 != nil { - yylex.(*Parser).comments.AddFromToken($$, $3, comment.EllipsisToken) + $$.AddComments($3.Comments, comment.EllipsisToken) } - yylex.(*Parser).comments.AddFromToken(variable, $4, comment.VariableToken) + variable.AddComments($4.Comments, comment.VariableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2099,13 +2099,13 @@ parameter: // save comments if $2 != nil { - yylex.(*Parser).comments.AddFromToken($$, $2, comment.AmpersandToken) + $$.AddComments($2.Comments, comment.AmpersandToken) } if $3 != nil { - yylex.(*Parser).comments.AddFromToken($$, $3, comment.EllipsisToken) + $$.AddComments($3.Comments, comment.EllipsisToken) } - yylex.(*Parser).comments.AddFromToken(variable, $4, comment.VariableToken) - yylex.(*Parser).comments.AddFromToken($$, $5, comment.EqualToken) + variable.AddComments($4.Comments, comment.VariableToken) + $$.AddComments($5.Comments, comment.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2141,7 +2141,7 @@ type_expr: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.QuestionMarkToken) + $$.AddComments($1.Comments, comment.QuestionMarkToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2156,7 +2156,7 @@ type: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.ArrayToken) + $$.AddComments($1.Comments, comment.ArrayToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2168,7 +2168,7 @@ type: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.CallableToken) + $$.AddComments($1.Comments, comment.CallableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2192,7 +2192,7 @@ return_type: $$ = $2; // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.ColonToken) + $$.AddComments($1.Comments, comment.ColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2207,8 +2207,8 @@ argument_list: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken($$, $2, comment.CloseParenthesisToken) + $$.AddComments($1.Comments, comment.OpenParenthesisToken) + $$.AddComments($2.Comments, comment.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2220,11 +2220,11 @@ argument_list: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.OpenParenthesisToken) + $$.AddComments($1.Comments, comment.OpenParenthesisToken) if $3 != nil { - yylex.(*Parser).comments.AddFromToken($$, $3, comment.CommaToken) + $$.AddComments($3.Comments, comment.CommaToken) } - yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseParenthesisToken) + $$.AddComments($4.Comments, comment.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2242,7 +2242,7 @@ non_empty_argument_list: $$ = append($1, $3) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) + lastNode($1).AddComments($2.Comments, comment.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2266,7 +2266,7 @@ argument: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.EllipsisToken) + $$.AddComments($1.Comments, comment.EllipsisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2278,7 +2278,7 @@ global_var_list: $$ = append($1, $3) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) + lastNode($1).AddComments($2.Comments, comment.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2305,7 +2305,7 @@ static_var_list: $$ = append($1, $3) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) + lastNode($1).AddComments($2.Comments, comment.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2330,7 +2330,7 @@ static_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken(variable, $1, comment.VariableToken) + variable.AddComments($1.Comments, comment.VariableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2346,8 +2346,8 @@ static_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken(variable, $1, comment.VariableToken) - yylex.(*Parser).comments.AddFromToken($$, $2, comment.EqualToken) + variable.AddComments($1.Comments, comment.VariableToken) + $$.AddComments($2.Comments, comment.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2377,7 +2377,7 @@ class_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $3, comment.SemiColonToken) + $$.AddComments($3.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2389,8 +2389,8 @@ class_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewOptionalListTokensPosition($1, $2, $4)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.ConstToken) - yylex.(*Parser).comments.AddFromToken($$, $4, comment.SemiColonToken) + $$.AddComments($2.Comments, comment.ConstToken) + $$.AddComments($4.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2412,7 +2412,7 @@ class_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.UseToken) + $$.AddComments($1.Comments, comment.UseToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2430,13 +2430,13 @@ class_statement: } // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.FunctionToken) + $$.AddComments($2.Comments, comment.FunctionToken) if $3 != nil { - yylex.(*Parser).comments.AddFromToken($$, $3, comment.AmpersandToken) + $$.AddComments($3.Comments, comment.AmpersandToken) } - yylex.(*Parser).comments.AddFromToken(name, $4, comment.IdentifierToken) - yylex.(*Parser).comments.AddFromToken($$, $6, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken($$, $8, comment.CloseParenthesisToken) + name.AddComments($4.Comments, comment.IdentifierToken) + $$.AddComments($6.Comments, comment.OpenParenthesisToken) + $$.AddComments($8.Comments, comment.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2454,7 +2454,7 @@ name_list: $$ = append($1, $3) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) + lastNode($1).AddComments($2.Comments, comment.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2468,7 +2468,7 @@ trait_adaptations: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.SemiColonToken) + $$.AddComments($1.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -2480,8 +2480,8 @@ trait_adaptations: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken($$, $2, comment.CloseCurlyBracesToken) + $$.AddComments($1.Comments, comment.OpenCurlyBracesToken) + $$.AddComments($2.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2492,8 +2492,8 @@ trait_adaptations: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.CloseCurlyBracesToken) + $$.AddComments($1.Comments, comment.OpenCurlyBracesToken) + $$.AddComments($3.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2520,7 +2520,7 @@ trait_adaptation: $$ = $1; // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.SemiColonToken) + $$.AddComments($2.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2529,7 +2529,7 @@ trait_adaptation: $$ = $1; // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.SemiColonToken) + $$.AddComments($2.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2544,7 +2544,7 @@ trait_precedence: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeNodeListPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.InsteadofToken) + $$.AddComments($2.Comments, comment.InsteadofToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2561,8 +2561,8 @@ trait_alias: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.AsToken) - yylex.(*Parser).comments.AddFromToken(alias, $3, comment.StringToken) + $$.AddComments($2.Comments, comment.AsToken) + alias.AddComments($3.Comments, comment.StringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2576,8 +2576,8 @@ trait_alias: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.AsToken) - yylex.(*Parser).comments.AddFromToken(alias, $3, comment.StringToken) + $$.AddComments($2.Comments, comment.AsToken) + alias.AddComments($3.Comments, comment.StringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2591,8 +2591,8 @@ trait_alias: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.AsToken) - yylex.(*Parser).comments.AddFromToken(alias, $4, comment.IdentifierToken) + $$.AddComments($2.Comments, comment.AsToken) + alias.AddComments($4.Comments, comment.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2604,7 +2604,7 @@ trait_alias: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.AsToken) + $$.AddComments($2.Comments, comment.AsToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2621,7 +2621,7 @@ trait_method_reference: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken(name, $1, comment.IdentifierToken) + name.AddComments($1.Comments, comment.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2644,8 +2644,8 @@ absolute_trait_method_reference: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.PaamayimNekudotayimToken) - yylex.(*Parser).comments.AddFromToken(target, $3, comment.IdentifierToken) + $$.AddComments($2.Comments, comment.PaamayimNekudotayimToken) + target.AddComments($3.Comments, comment.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2660,7 +2660,7 @@ method_body: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.SemiColonToken) + $$.AddComments($1.Comments, comment.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2672,8 +2672,8 @@ method_body: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.CloseCurlyBracesToken) + $$.AddComments($1.Comments, comment.OpenCurlyBracesToken) + $$.AddComments($3.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2695,7 +2695,7 @@ variable_modifiers: modifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken(modifier, $1, comment.VarToken) + modifier.AddComments($1.Comments, comment.VarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2740,7 +2740,7 @@ member_modifier: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.PublicToken) + $$.AddComments($1.Comments, comment.PublicToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2752,7 +2752,7 @@ member_modifier: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.ProtectedToken) + $$.AddComments($1.Comments, comment.ProtectedToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2764,7 +2764,7 @@ member_modifier: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.PrivateToken) + $$.AddComments($1.Comments, comment.PrivateToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2776,7 +2776,7 @@ member_modifier: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.StaticToken) + $$.AddComments($1.Comments, comment.StaticToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2788,7 +2788,7 @@ member_modifier: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.AbstractToken) + $$.AddComments($1.Comments, comment.AbstractToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2800,7 +2800,7 @@ member_modifier: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.FinalToken) + $$.AddComments($1.Comments, comment.FinalToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2812,7 +2812,7 @@ property_list: $$ = append($1, $3) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) + lastNode($1).AddComments($2.Comments, comment.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2837,7 +2837,7 @@ property: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken(variable, $1, comment.VariableToken) + variable.AddComments($1.Comments, comment.VariableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2853,8 +2853,8 @@ property: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken(variable, $1, comment.VariableToken) - yylex.(*Parser).comments.AddFromToken($$, $2, comment.EqualToken) + variable.AddComments($1.Comments, comment.VariableToken) + $$.AddComments($2.Comments, comment.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2866,7 +2866,7 @@ class_const_list: $$ = append($1, $3) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) + lastNode($1).AddComments($2.Comments, comment.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2889,8 +2889,8 @@ class_const_decl: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken(name, $1, comment.IdentifierToken) - yylex.(*Parser).comments.AddFromToken($$, $2, comment.EqualToken) + name.AddComments($1.Comments, comment.IdentifierToken) + $$.AddComments($2.Comments, comment.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2907,8 +2907,8 @@ const_decl: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken(name, $1, comment.StringToken) - yylex.(*Parser).comments.AddFromToken($$, $2, comment.EqualToken) + name.AddComments($1.Comments, comment.StringToken) + $$.AddComments($2.Comments, comment.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2920,7 +2920,7 @@ echo_expr_list: $$ = append($1, $3) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) + lastNode($1).AddComments($2.Comments, comment.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2962,7 +2962,7 @@ non_empty_for_exprs: $$ = append($1, $3) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) + lastNode($1).AddComments($2.Comments, comment.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2987,9 +2987,9 @@ anonymous_class: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $8)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.ClassToken) - yylex.(*Parser).comments.AddFromToken($$, $6, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken($$, $8, comment.CloseCurlyBracesToken) + $$.AddComments($1.Comments, comment.ClassToken) + $$.AddComments($6.Comments, comment.OpenCurlyBracesToken) + $$.AddComments($8.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3007,7 +3007,7 @@ new_expr: } // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.NewToken) + $$.AddComments($1.Comments, comment.NewToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3019,7 +3019,7 @@ new_expr: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.NewToken) + $$.AddComments($1.Comments, comment.NewToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3036,10 +3036,10 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $6)) // save comments - yylex.(*Parser).comments.AddFromToken(list, $1, comment.ListToken) - yylex.(*Parser).comments.AddFromToken(list, $2, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken(list, $4, comment.CloseParenthesisToken) - yylex.(*Parser).comments.AddFromToken($$, $5, comment.EqualToken) + list.AddComments($1.Comments, comment.ListToken) + list.AddComments($2.Comments, comment.OpenParenthesisToken) + list.AddComments($4.Comments, comment.CloseParenthesisToken) + $$.AddComments($5.Comments, comment.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3053,9 +3053,9 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5)) // save comments - yylex.(*Parser).comments.AddFromToken(shortList, $1, comment.OpenSquareBracket) - yylex.(*Parser).comments.AddFromToken(shortList, $3, comment.CloseSquareBracket) - yylex.(*Parser).comments.AddFromToken($$, $4, comment.EqualToken) + shortList.AddComments($1.Comments, comment.OpenSquareBracket) + shortList.AddComments($3.Comments, comment.CloseSquareBracket) + $$.AddComments($4.Comments, comment.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3067,7 +3067,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.EqualToken) + $$.AddComments($2.Comments, comment.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3079,8 +3079,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.EqualToken) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.AmpersandToken) + $$.AddComments($2.Comments, comment.EqualToken) + $$.AddComments($3.Comments, comment.AmpersandToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3092,7 +3092,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.CloneToken) + $$.AddComments($1.Comments, comment.CloneToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3104,7 +3104,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.PlusEqualToken) + $$.AddComments($2.Comments, comment.PlusEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3116,7 +3116,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.MinusEqualToken) + $$.AddComments($2.Comments, comment.MinusEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3128,7 +3128,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.MulEqualToken) + $$.AddComments($2.Comments, comment.MulEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3140,7 +3140,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.PowEqualToken) + $$.AddComments($2.Comments, comment.PowEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3152,7 +3152,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.DivEqualToken) + $$.AddComments($2.Comments, comment.DivEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3164,7 +3164,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.ConcatEqualToken) + $$.AddComments($2.Comments, comment.ConcatEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3176,7 +3176,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.ModEqualToken) + $$.AddComments($2.Comments, comment.ModEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3188,7 +3188,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.AndEqualToken) + $$.AddComments($2.Comments, comment.AndEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3200,7 +3200,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.OrEqualToken) + $$.AddComments($2.Comments, comment.OrEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3212,7 +3212,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.XorEqualToken) + $$.AddComments($2.Comments, comment.XorEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3224,7 +3224,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.SlEqualToken) + $$.AddComments($2.Comments, comment.SlEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3236,7 +3236,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.SrEqualToken) + $$.AddComments($2.Comments, comment.SrEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3248,7 +3248,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.IncToken) + $$.AddComments($2.Comments, comment.IncToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3260,7 +3260,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.IncToken) + $$.AddComments($1.Comments, comment.IncToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3272,7 +3272,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.DecToken) + $$.AddComments($2.Comments, comment.DecToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3284,7 +3284,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.DecToken) + $$.AddComments($1.Comments, comment.DecToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3296,7 +3296,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.BooleanOrToken) + $$.AddComments($2.Comments, comment.BooleanOrToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3308,7 +3308,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.BooleanAndToken) + $$.AddComments($2.Comments, comment.BooleanAndToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3320,7 +3320,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.LogicalOrToken) + $$.AddComments($2.Comments, comment.LogicalOrToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3332,7 +3332,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.LogicalAndToken) + $$.AddComments($2.Comments, comment.LogicalAndToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3344,7 +3344,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.LogicalXorToken) + $$.AddComments($2.Comments, comment.LogicalXorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3356,7 +3356,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.VerticalBarToken) + $$.AddComments($2.Comments, comment.VerticalBarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3368,7 +3368,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.AmpersandToken) + $$.AddComments($2.Comments, comment.AmpersandToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3380,7 +3380,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.CaretToken) + $$.AddComments($2.Comments, comment.CaretToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3392,7 +3392,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.DotToken) + $$.AddComments($2.Comments, comment.DotToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3404,7 +3404,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.PlusToken) + $$.AddComments($2.Comments, comment.PlusToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3416,7 +3416,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.MinusToken) + $$.AddComments($2.Comments, comment.MinusToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3428,7 +3428,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.AsteriskToken) + $$.AddComments($2.Comments, comment.AsteriskToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3440,7 +3440,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.PowToken) + $$.AddComments($2.Comments, comment.PowToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3452,7 +3452,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.SlashToken) + $$.AddComments($2.Comments, comment.SlashToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3464,7 +3464,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.PercentToken) + $$.AddComments($2.Comments, comment.PercentToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3476,7 +3476,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.SlToken) + $$.AddComments($2.Comments, comment.SlToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3488,7 +3488,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.SrToken) + $$.AddComments($2.Comments, comment.SrToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3500,7 +3500,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.PlusToken) + $$.AddComments($1.Comments, comment.PlusToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3512,7 +3512,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.MinusToken) + $$.AddComments($1.Comments, comment.MinusToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3524,7 +3524,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.ExclamationMarkToken) + $$.AddComments($1.Comments, comment.ExclamationMarkToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3536,7 +3536,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.TildeToken) + $$.AddComments($1.Comments, comment.TildeToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3548,7 +3548,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.IsIdenticalToken) + $$.AddComments($2.Comments, comment.IsIdenticalToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3560,7 +3560,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.IsNotIdenticalToken) + $$.AddComments($2.Comments, comment.IsNotIdenticalToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3572,7 +3572,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.IsEqualToken) + $$.AddComments($2.Comments, comment.IsEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3584,7 +3584,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.IsNotEqualToken) + $$.AddComments($2.Comments, comment.IsNotEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3596,7 +3596,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.LessToken) + $$.AddComments($2.Comments, comment.LessToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3608,7 +3608,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.IsSmallerOrEqualToken) + $$.AddComments($2.Comments, comment.IsSmallerOrEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3620,7 +3620,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.GreaterToken) + $$.AddComments($2.Comments, comment.GreaterToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3632,7 +3632,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.IsGreaterOrEqualToken) + $$.AddComments($2.Comments, comment.IsGreaterOrEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3644,7 +3644,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.SpaceshipToken) + $$.AddComments($2.Comments, comment.SpaceshipToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3656,7 +3656,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.InstanceofToken) + $$.AddComments($2.Comments, comment.InstanceofToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3665,8 +3665,8 @@ expr_without_variable: $$ = $2; // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.CloseParenthesisToken) + $$.AddComments($1.Comments, comment.OpenParenthesisToken) + $$.AddComments($3.Comments, comment.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3684,8 +3684,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $5)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.QuestionMarkToken) - yylex.(*Parser).comments.AddFromToken($$, $4, comment.ColonToken) + $$.AddComments($2.Comments, comment.QuestionMarkToken) + $$.AddComments($4.Comments, comment.ColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3697,8 +3697,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.QuestionMarkToken) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.ColonToken) + $$.AddComments($2.Comments, comment.QuestionMarkToken) + $$.AddComments($3.Comments, comment.ColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3710,7 +3710,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.CoalesceToken) + $$.AddComments($2.Comments, comment.CoalesceToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3728,7 +3728,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.IntCastToken) + $$.AddComments($1.Comments, comment.IntCastToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3740,7 +3740,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.DoubleCastToken) + $$.AddComments($1.Comments, comment.DoubleCastToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3752,7 +3752,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.StringCastToken) + $$.AddComments($1.Comments, comment.StringCastToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3764,7 +3764,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.ArrayCastToken) + $$.AddComments($1.Comments, comment.ArrayCastToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3776,7 +3776,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.ObjectCastToken) + $$.AddComments($1.Comments, comment.ObjectCastToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3788,7 +3788,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.BoolCastToken) + $$.AddComments($1.Comments, comment.BoolCastToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3800,7 +3800,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.UnsetCastToken) + $$.AddComments($1.Comments, comment.UnsetCastToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3826,7 +3826,7 @@ expr_without_variable: } // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.ExitToken) + $$.AddComments($1.Comments, comment.ExitToken) if $2 != nil { yylex.(*Parser).comments.AddFromChildNode($$, $2) @@ -3842,7 +3842,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.AtToken) + $$.AddComments($1.Comments, comment.AtToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3860,8 +3860,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.BackquoteToken) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.BackquoteToken) + $$.AddComments($1.Comments, comment.BackquoteToken) + $$.AddComments($3.Comments, comment.BackquoteToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3873,7 +3873,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.PrintToken) + $$.AddComments($1.Comments, comment.PrintToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3885,7 +3885,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.YieldToken) + $$.AddComments($1.Comments, comment.YieldToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3897,7 +3897,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.YieldToken) + $$.AddComments($1.Comments, comment.YieldToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3909,8 +3909,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $4)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.YieldToken) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.DoubleArrowToken) + $$.AddComments($1.Comments, comment.YieldToken) + $$.AddComments($3.Comments, comment.DoubleArrowToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3922,7 +3922,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.YieldFromToken) + $$.AddComments($1.Comments, comment.YieldFromToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3934,14 +3934,14 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $11)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.FunctionToken) + $$.AddComments($1.Comments, comment.FunctionToken) if $2 != nil { - yylex.(*Parser).comments.AddFromToken($$, $2, comment.AmpersandToken) + $$.AddComments($2.Comments, comment.AmpersandToken) } - yylex.(*Parser).comments.AddFromToken($$, $4, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken($$, $6, comment.CloseParenthesisToken) - yylex.(*Parser).comments.AddFromToken($$, $9, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken($$, $11, comment.CloseCurlyBracesToken) + $$.AddComments($4.Comments, comment.OpenParenthesisToken) + $$.AddComments($6.Comments, comment.CloseParenthesisToken) + $$.AddComments($9.Comments, comment.OpenCurlyBracesToken) + $$.AddComments($11.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3953,15 +3953,15 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $12)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.StaticToken) - yylex.(*Parser).comments.AddFromToken($$, $2, comment.FunctionToken) + $$.AddComments($1.Comments, comment.StaticToken) + $$.AddComments($2.Comments, comment.FunctionToken) if $3 != nil { - yylex.(*Parser).comments.AddFromToken($$, $3, comment.AmpersandToken) + $$.AddComments($3.Comments, comment.AmpersandToken) } - yylex.(*Parser).comments.AddFromToken($$, $5, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken($$, $7, comment.CloseParenthesisToken) - yylex.(*Parser).comments.AddFromToken($$, $10, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken($$, $12, comment.CloseCurlyBracesToken) + $$.AddComments($5.Comments, comment.OpenParenthesisToken) + $$.AddComments($7.Comments, comment.CloseParenthesisToken) + $$.AddComments($10.Comments, comment.OpenCurlyBracesToken) + $$.AddComments($12.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4003,9 +4003,9 @@ lexical_vars: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.UseToken) - yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseParenthesisToken) + $$.AddComments($1.Comments, comment.UseToken) + $$.AddComments($2.Comments, comment.OpenParenthesisToken) + $$.AddComments($4.Comments, comment.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4017,7 +4017,7 @@ lexical_var_list: $$ = append($1, $3) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) + lastNode($1).AddComments($2.Comments, comment.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4040,7 +4040,7 @@ lexical_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.VariableToken) + $$.AddComments($1.Comments, comment.VariableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4056,8 +4056,8 @@ lexical_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.AmpersandToken) - yylex.(*Parser).comments.AddFromToken(variable, $2, comment.VariableToken) + $$.AddComments($1.Comments, comment.AmpersandToken) + variable.AddComments($2.Comments, comment.VariableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4081,7 +4081,7 @@ function_call: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.PaamayimNekudotayimToken) + $$.AddComments($2.Comments, comment.PaamayimNekudotayimToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4093,7 +4093,7 @@ function_call: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.PaamayimNekudotayimToken) + $$.AddComments($2.Comments, comment.PaamayimNekudotayimToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4117,7 +4117,7 @@ class_name: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.StaticToken) + $$.AddComments($1.Comments, comment.StaticToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4159,8 +4159,8 @@ exit_expr: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.CloseParenthesisToken) + $$.AddComments($1.Comments, comment.OpenParenthesisToken) + $$.AddComments($3.Comments, comment.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4211,9 +4211,9 @@ dereferencable_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.ArrayToken) - yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseParenthesisToken) + $$.AddComments($1.Comments, comment.ArrayToken) + $$.AddComments($2.Comments, comment.OpenParenthesisToken) + $$.AddComments($4.Comments, comment.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4225,8 +4225,8 @@ dereferencable_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.OpenSquareBracket) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.CloseSquareBracket) + $$.AddComments($1.Comments, comment.OpenSquareBracket) + $$.AddComments($3.Comments, comment.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4238,7 +4238,7 @@ dereferencable_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.ConstantEncapsedStringToken) + $$.AddComments($1.Comments, comment.ConstantEncapsedStringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4253,7 +4253,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.LnumberToken) + $$.AddComments($1.Comments, comment.LnumberToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4265,7 +4265,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.DnumberToken) + $$.AddComments($1.Comments, comment.DnumberToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4277,7 +4277,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.LineToken) + $$.AddComments($1.Comments, comment.LineToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4289,7 +4289,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.FileToken) + $$.AddComments($1.Comments, comment.FileToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4301,7 +4301,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.DirToken) + $$.AddComments($1.Comments, comment.DirToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4313,7 +4313,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.TraitCToken) + $$.AddComments($1.Comments, comment.TraitCToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4325,7 +4325,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.MethodCToken) + $$.AddComments($1.Comments, comment.MethodCToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4337,7 +4337,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.FuncCToken) + $$.AddComments($1.Comments, comment.FuncCToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4349,7 +4349,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.NsCToken) + $$.AddComments($1.Comments, comment.NsCToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4361,7 +4361,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.ClassCToken) + $$.AddComments($1.Comments, comment.ClassCToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4375,7 +4375,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.StartHeredocToken) + $$.AddComments($1.Comments, comment.StartHeredocToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4387,7 +4387,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.StartHeredocToken) + $$.AddComments($1.Comments, comment.StartHeredocToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4399,7 +4399,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.DoubleQuoteToken) + $$.AddComments($1.Comments, comment.DoubleQuoteToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4411,7 +4411,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.StartHeredocToken) + $$.AddComments($1.Comments, comment.StartHeredocToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4449,8 +4449,8 @@ constant: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.PaamayimNekudotayimToken) - yylex.(*Parser).comments.AddFromToken(target, $3, comment.IdentifierToken) + $$.AddComments($2.Comments, comment.PaamayimNekudotayimToken) + target.AddComments($3.Comments, comment.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4464,8 +4464,8 @@ constant: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.PaamayimNekudotayimToken) - yylex.(*Parser).comments.AddFromToken(target, $3, comment.IdentifierToken) + $$.AddComments($2.Comments, comment.PaamayimNekudotayimToken) + target.AddComments($3.Comments, comment.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4522,8 +4522,8 @@ dereferencable: $$ = $2; // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.CloseParenthesisToken) + $$.AddComments($1.Comments, comment.OpenParenthesisToken) + $$.AddComments($3.Comments, comment.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4547,8 +4547,8 @@ callable_expr: $$ = $2; // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.CloseParenthesisToken) + $$.AddComments($1.Comments, comment.OpenParenthesisToken) + $$.AddComments($3.Comments, comment.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4575,8 +4575,8 @@ callable_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenSquareBracket) - yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseSquareBracket) + $$.AddComments($2.Comments, comment.OpenSquareBracket) + $$.AddComments($4.Comments, comment.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4588,8 +4588,8 @@ callable_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenSquareBracket) - yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseSquareBracket) + $$.AddComments($2.Comments, comment.OpenSquareBracket) + $$.AddComments($4.Comments, comment.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4601,8 +4601,8 @@ callable_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseCurlyBracesToken) + $$.AddComments($2.Comments, comment.OpenCurlyBracesToken) + $$.AddComments($4.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4614,7 +4614,7 @@ callable_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.ObjectOperatorToken) + $$.AddComments($2.Comments, comment.ObjectOperatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4647,7 +4647,7 @@ variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.ObjectOperatorToken) + $$.AddComments($2.Comments, comment.ObjectOperatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4664,7 +4664,7 @@ simple_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.VariableToken) + $$.AddComments($1.Comments, comment.VariableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4676,9 +4676,9 @@ simple_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.DollarToken) - yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseCurlyBracesToken) + $$.AddComments($1.Comments, comment.DollarToken) + $$.AddComments($2.Comments, comment.OpenCurlyBracesToken) + $$.AddComments($4.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4690,7 +4690,7 @@ simple_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.DollarToken) + $$.AddComments($1.Comments, comment.DollarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4705,7 +4705,7 @@ static_member: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.PaamayimNekudotayimToken) + $$.AddComments($2.Comments, comment.PaamayimNekudotayimToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4717,7 +4717,7 @@ static_member: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.PaamayimNekudotayimToken) + $$.AddComments($2.Comments, comment.PaamayimNekudotayimToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4738,8 +4738,8 @@ new_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenSquareBracket) - yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseSquareBracket) + $$.AddComments($2.Comments, comment.OpenSquareBracket) + $$.AddComments($4.Comments, comment.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4751,8 +4751,8 @@ new_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseCurlyBracesToken) + $$.AddComments($2.Comments, comment.OpenCurlyBracesToken) + $$.AddComments($4.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4764,7 +4764,7 @@ new_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.ObjectOperatorToken) + $$.AddComments($2.Comments, comment.ObjectOperatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4776,7 +4776,7 @@ new_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.PaamayimNekudotayimToken) + $$.AddComments($2.Comments, comment.PaamayimNekudotayimToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4788,7 +4788,7 @@ new_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.PaamayimNekudotayimToken) + $$.AddComments($2.Comments, comment.PaamayimNekudotayimToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4803,7 +4803,7 @@ member_name: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.IdentifierToken) + $$.AddComments($1.Comments, comment.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4812,8 +4812,8 @@ member_name: $$ = $2; // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.CloseCurlyBracesToken) + $$.AddComments($1.Comments, comment.OpenCurlyBracesToken) + $$.AddComments($3.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4834,7 +4834,7 @@ property_name: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.StringToken) + $$.AddComments($1.Comments, comment.StringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4843,8 +4843,8 @@ property_name: $$ = $2; // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.OpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.CloseCurlyBracesToken) + $$.AddComments($1.Comments, comment.OpenCurlyBracesToken) + $$.AddComments($3.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4890,7 +4890,7 @@ non_empty_array_pair_list: $$ = append($1, $3) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) + if $3 != nil {$3.AddComments($2.Comments, comment.CommaToken)} yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4911,7 +4911,7 @@ array_pair: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.DoubleArrowToken) + $$.AddComments($2.Comments, comment.DoubleArrowToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4934,8 +4934,8 @@ array_pair: reference.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $4)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.DoubleArrowToken) - yylex.(*Parser).comments.AddFromToken(reference, $3, comment.AmpersandToken) + $$.AddComments($2.Comments, comment.DoubleArrowToken) + reference.AddComments($3.Comments, comment.AmpersandToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4949,7 +4949,7 @@ array_pair: reference.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken(reference, $1, comment.AmpersandToken) + reference.AddComments($1.Comments, comment.AmpersandToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4964,10 +4964,10 @@ array_pair: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $6)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $2, comment.DoubleArrowToken) - yylex.(*Parser).comments.AddFromToken(list, $3, comment.ListToken) - yylex.(*Parser).comments.AddFromToken(list, $4, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken(list, $6, comment.CloseParenthesisToken) + $$.AddComments($2.Comments, comment.DoubleArrowToken) + list.AddComments($3.Comments, comment.ListToken) + list.AddComments($4.Comments, comment.OpenParenthesisToken) + list.AddComments($6.Comments, comment.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4982,9 +4982,9 @@ array_pair: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddFromToken(list, $1, comment.ListToken) - yylex.(*Parser).comments.AddFromToken(list, $2, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken(list, $4, comment.CloseParenthesisToken) + list.AddComments($1.Comments, comment.ListToken) + list.AddComments($2.Comments, comment.OpenParenthesisToken) + list.AddComments($4.Comments, comment.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5006,7 +5006,7 @@ encaps_list: encapsed.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) // save comments - yylex.(*Parser).comments.AddFromToken(encapsed, $2, comment.EncapsedAndWhitespaceToken) + encapsed.AddComments($2.Comments, comment.EncapsedAndWhitespaceToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5025,7 +5025,7 @@ encaps_list: encapsed.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken(encapsed, $1, comment.EncapsedAndWhitespaceToken) + encapsed.AddComments($1.Comments, comment.EncapsedAndWhitespaceToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5042,7 +5042,7 @@ encaps_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.VariableToken) + $$.AddComments($1.Comments, comment.VariableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5058,9 +5058,9 @@ encaps_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddFromToken(variable, $1, comment.VariableToken) - yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenSquareBracket) - yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseSquareBracket) + variable.AddComments($1.Comments, comment.VariableToken) + $$.AddComments($2.Comments, comment.OpenSquareBracket) + $$.AddComments($4.Comments, comment.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5078,9 +5078,9 @@ encaps_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken(variable, $1, comment.VariableToken) - yylex.(*Parser).comments.AddFromToken($$, $2, comment.ObjectOperatorToken) - yylex.(*Parser).comments.AddFromToken(fetch, $3, comment.StringToken) + variable.AddComments($1.Comments, comment.VariableToken) + $$.AddComments($2.Comments, comment.ObjectOperatorToken) + fetch.AddComments($3.Comments, comment.StringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5092,8 +5092,8 @@ encaps_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.DollarOpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.CloseCurlyBracesToken) + $$.AddComments($1.Comments, comment.DollarOpenCurlyBracesToken) + $$.AddComments($3.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5107,9 +5107,9 @@ encaps_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.DollarOpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken(name, $2, comment.StringVarnameToken) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.CloseCurlyBracesToken) + $$.AddComments($1.Comments, comment.DollarOpenCurlyBracesToken) + name.AddComments($2.Comments, comment.StringVarnameToken) + $$.AddComments($3.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5125,11 +5125,11 @@ encaps_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $6)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.DollarOpenCurlyBracesToken) - yylex.(*Parser).comments.AddFromToken(variable, $2, comment.StringVarnameToken) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.OpenSquareBracket) - yylex.(*Parser).comments.AddFromToken($$, $5, comment.CloseSquareBracket) - yylex.(*Parser).comments.AddFromToken($$, $6, comment.CloseCurlyBracesToken) + $$.AddComments($1.Comments, comment.DollarOpenCurlyBracesToken) + variable.AddComments($2.Comments, comment.StringVarnameToken) + $$.AddComments($3.Comments, comment.OpenSquareBracket) + $$.AddComments($5.Comments, comment.CloseSquareBracket) + $$.AddComments($6.Comments, comment.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5150,7 +5150,7 @@ encaps_var_offset: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.StringToken) + $$.AddComments($1.Comments, comment.StringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5167,7 +5167,7 @@ encaps_var_offset: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.NumStringToken) + $$.AddComments($1.Comments, comment.NumStringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5193,11 +5193,11 @@ encaps_var_offset: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.MinusToken) + $$.AddComments($1.Comments, comment.MinusToken) if isInt { - yylex.(*Parser).comments.AddFromToken(lnumber, $2, comment.NumStringToken) + lnumber.AddComments($2.Comments, comment.NumStringToken) } else { - yylex.(*Parser).comments.AddFromToken($$, $2, comment.NumStringToken) + $$.AddComments($2.Comments, comment.NumStringToken) } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -5212,7 +5212,7 @@ encaps_var_offset: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.VariableToken) + $$.AddComments($1.Comments, comment.VariableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5227,12 +5227,12 @@ internal_functions_in_yacc: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.IssetToken) - yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenParenthesisToken) + $$.AddComments($1.Comments, comment.IssetToken) + $$.AddComments($2.Comments, comment.OpenParenthesisToken) if $4 != nil { - yylex.(*Parser).comments.AddFromToken($$, $4, comment.CommaToken) + $$.AddComments($4.Comments, comment.CommaToken) } - yylex.(*Parser).comments.AddFromToken($$, $5, comment.CloseParenthesisToken) + $$.AddComments($5.Comments, comment.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5244,9 +5244,9 @@ internal_functions_in_yacc: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.EmptyToken) - yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseParenthesisToken) + $$.AddComments($1.Comments, comment.EmptyToken) + $$.AddComments($2.Comments, comment.OpenParenthesisToken) + $$.AddComments($4.Comments, comment.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5258,7 +5258,7 @@ internal_functions_in_yacc: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.IncludeToken) + $$.AddComments($1.Comments, comment.IncludeToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5270,7 +5270,7 @@ internal_functions_in_yacc: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.IncludeOnceToken) + $$.AddComments($1.Comments, comment.IncludeOnceToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5282,9 +5282,9 @@ internal_functions_in_yacc: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.EvalToken) - yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseParenthesisToken) + $$.AddComments($1.Comments, comment.EvalToken) + $$.AddComments($2.Comments, comment.OpenParenthesisToken) + $$.AddComments($4.Comments, comment.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5296,7 +5296,7 @@ internal_functions_in_yacc: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.RequireToken) + $$.AddComments($1.Comments, comment.RequireToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5308,7 +5308,7 @@ internal_functions_in_yacc: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.RequireOnceToken) + $$.AddComments($1.Comments, comment.RequireOnceToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5326,7 +5326,7 @@ isset_variables: $$ = append($1, $3) // save comments - yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) + lastNode($1).AddComments($2.Comments, comment.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php7/php7_test.go b/php7/php7_test.go index ec20ae1..85c977c 100644 --- a/php7/php7_test.go +++ b/php7/php7_test.go @@ -6,16 +6,17 @@ import ( "testing" "github.com/kylelemons/godebug/pretty" + "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node/expr" "github.com/z7zmey/php-parser/node/expr/assign" "github.com/z7zmey/php-parser/node/expr/binary" "github.com/z7zmey/php-parser/node/expr/cast" "github.com/z7zmey/php-parser/node/name" "github.com/z7zmey/php-parser/node/scalar" - "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node/stmt" - "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/php7" + "github.com/z7zmey/php-parser/position" ) func assertEqual(t *testing.T, expected interface{}, actual interface{}) { @@ -384,39 +385,39 @@ func TestPhp7(t *testing.T) { expected := &node.Root{ Position: &position.Position{ StartLine: 2, - EndLine: 347, - StartPos: 6, - EndPos: 6318, + EndLine: 347, + StartPos: 6, + EndPos: 6318, }, Stmts: []node.Node{ &stmt.Expression{ Position: &position.Position{ StartLine: 2, - EndLine: 2, - StartPos: 6, - EndPos: 20, + EndLine: 2, + StartPos: 6, + EndPos: 20, }, Expr: &expr.FunctionCall{ Position: &position.Position{ StartLine: 2, - EndLine: 2, - StartPos: 6, - EndPos: 19, + EndLine: 2, + StartPos: 6, + EndPos: 19, }, Function: &name.Name{ Position: &position.Position{ StartLine: 2, - EndLine: 2, - StartPos: 6, - EndPos: 8, + EndLine: 2, + StartPos: 6, + EndPos: 8, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 2, - EndLine: 2, - StartPos: 6, - EndPos: 8, + EndLine: 2, + StartPos: 6, + EndPos: 8, }, Value: "foo", }, @@ -425,33 +426,33 @@ func TestPhp7(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 2, - EndLine: 2, - StartPos: 9, - EndPos: 19, + EndLine: 2, + StartPos: 9, + EndPos: 19, }, Arguments: []node.Node{ &node.Argument{ Position: &position.Position{ StartLine: 2, - EndLine: 2, - StartPos: 10, - EndPos: 11, + EndLine: 2, + StartPos: 10, + EndPos: 11, }, - Variadic: false, + Variadic: false, IsReference: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 2, - EndLine: 2, - StartPos: 10, - EndPos: 11, + EndLine: 2, + StartPos: 10, + EndPos: 11, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 2, - EndLine: 2, - StartPos: 10, - EndPos: 11, + EndLine: 2, + StartPos: 10, + EndPos: 11, }, Value: "a", }, @@ -460,25 +461,25 @@ func TestPhp7(t *testing.T) { &node.Argument{ Position: &position.Position{ StartLine: 2, - EndLine: 2, - StartPos: 14, - EndPos: 18, + EndLine: 2, + StartPos: 14, + EndPos: 18, }, + Variadic: true, IsReference: false, - Variadic: true, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 2, - EndLine: 2, - StartPos: 17, - EndPos: 18, + EndLine: 2, + StartPos: 17, + EndPos: 18, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 2, - EndLine: 2, - StartPos: 17, - EndPos: 18, + EndLine: 2, + StartPos: 17, + EndPos: 18, }, Value: "b", }, @@ -491,30 +492,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 3, - EndLine: 3, - StartPos: 24, - EndPos: 39, + EndLine: 3, + StartPos: 24, + EndPos: 39, }, Expr: &expr.FunctionCall{ Position: &position.Position{ StartLine: 3, - EndLine: 3, - StartPos: 24, - EndPos: 38, + EndLine: 3, + StartPos: 24, + EndPos: 38, }, Function: &expr.Variable{ Position: &position.Position{ StartLine: 3, - EndLine: 3, - StartPos: 24, - EndPos: 27, + EndLine: 3, + StartPos: 24, + EndPos: 27, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 3, - EndLine: 3, - StartPos: 24, - EndPos: 27, + EndLine: 3, + StartPos: 24, + EndPos: 27, }, Value: "foo", }, @@ -522,33 +523,33 @@ func TestPhp7(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 3, - EndLine: 3, - StartPos: 28, - EndPos: 38, + EndLine: 3, + StartPos: 28, + EndPos: 38, }, Arguments: []node.Node{ &node.Argument{ Position: &position.Position{ StartLine: 3, - EndLine: 3, - StartPos: 29, - EndPos: 30, + EndLine: 3, + StartPos: 29, + EndPos: 30, }, - Variadic: false, + Variadic: false, IsReference: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 3, - EndLine: 3, - StartPos: 29, - EndPos: 30, + EndLine: 3, + StartPos: 29, + EndPos: 30, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 3, - EndLine: 3, - StartPos: 29, - EndPos: 30, + EndLine: 3, + StartPos: 29, + EndPos: 30, }, Value: "a", }, @@ -557,25 +558,25 @@ func TestPhp7(t *testing.T) { &node.Argument{ Position: &position.Position{ StartLine: 3, - EndLine: 3, - StartPos: 33, - EndPos: 37, + EndLine: 3, + StartPos: 33, + EndPos: 37, }, - Variadic: true, + Variadic: true, IsReference: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 3, - EndLine: 3, - StartPos: 36, - EndPos: 37, + EndLine: 3, + StartPos: 36, + EndPos: 37, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 3, - EndLine: 3, - StartPos: 36, - EndPos: 37, + EndLine: 3, + StartPos: 36, + EndPos: 37, }, Value: "b", }, @@ -588,30 +589,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 4, - EndLine: 4, - StartPos: 43, - EndPos: 63, + EndLine: 4, + StartPos: 43, + EndPos: 63, }, Expr: &expr.MethodCall{ Position: &position.Position{ StartLine: 4, - EndLine: 4, - StartPos: 43, - EndPos: 62, + EndLine: 4, + StartPos: 43, + EndPos: 62, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 4, - EndLine: 4, - StartPos: 43, - EndPos: 46, + EndLine: 4, + StartPos: 43, + EndPos: 46, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 4, - EndLine: 4, - StartPos: 43, - EndPos: 46, + EndLine: 4, + StartPos: 43, + EndPos: 46, }, Value: "foo", }, @@ -619,42 +620,42 @@ func TestPhp7(t *testing.T) { Method: &node.Identifier{ Position: &position.Position{ StartLine: 4, - EndLine: 4, - StartPos: 49, - EndPos: 51, + EndLine: 4, + StartPos: 49, + EndPos: 51, }, Value: "bar", }, ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 4, - EndLine: 4, - StartPos: 52, - EndPos: 62, + EndLine: 4, + StartPos: 52, + EndPos: 62, }, Arguments: []node.Node{ &node.Argument{ Position: &position.Position{ StartLine: 4, - EndLine: 4, - StartPos: 53, - EndPos: 54, + EndLine: 4, + StartPos: 53, + EndPos: 54, }, - Variadic: false, + Variadic: false, IsReference: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 4, - EndLine: 4, - StartPos: 53, - EndPos: 54, + EndLine: 4, + StartPos: 53, + EndPos: 54, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 4, - EndLine: 4, - StartPos: 53, - EndPos: 54, + EndLine: 4, + StartPos: 53, + EndPos: 54, }, Value: "a", }, @@ -663,25 +664,25 @@ func TestPhp7(t *testing.T) { &node.Argument{ Position: &position.Position{ StartLine: 4, - EndLine: 4, - StartPos: 57, - EndPos: 61, + EndLine: 4, + StartPos: 57, + EndPos: 61, }, - Variadic: true, + Variadic: true, IsReference: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 4, - EndLine: 4, - StartPos: 60, - EndPos: 61, + EndLine: 4, + StartPos: 60, + EndPos: 61, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 4, - EndLine: 4, - StartPos: 60, - EndPos: 61, + EndLine: 4, + StartPos: 60, + EndPos: 61, }, Value: "b", }, @@ -694,31 +695,31 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 5, - EndLine: 5, - StartPos: 67, - EndPos: 86, + EndLine: 5, + StartPos: 67, + EndPos: 86, }, Expr: &expr.StaticCall{ Position: &position.Position{ StartLine: 5, - EndLine: 5, - StartPos: 67, - EndPos: 85, + EndLine: 5, + StartPos: 67, + EndPos: 85, }, Class: &name.Name{ Position: &position.Position{ StartLine: 5, - EndLine: 5, - StartPos: 67, - EndPos: 69, + EndLine: 5, + StartPos: 67, + EndPos: 69, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 5, - EndLine: 5, - StartPos: 67, - EndPos: 69, + EndLine: 5, + StartPos: 67, + EndPos: 69, }, Value: "foo", }, @@ -727,42 +728,42 @@ func TestPhp7(t *testing.T) { Call: &node.Identifier{ Position: &position.Position{ StartLine: 5, - EndLine: 5, - StartPos: 72, - EndPos: 74, + EndLine: 5, + StartPos: 72, + EndPos: 74, }, Value: "bar", }, ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 5, - EndLine: 5, - StartPos: 75, - EndPos: 85, + EndLine: 5, + StartPos: 75, + EndPos: 85, }, Arguments: []node.Node{ &node.Argument{ Position: &position.Position{ StartLine: 5, - EndLine: 5, - StartPos: 76, - EndPos: 77, + EndLine: 5, + StartPos: 76, + EndPos: 77, }, - Variadic: false, + Variadic: false, IsReference: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 5, - EndLine: 5, - StartPos: 76, - EndPos: 77, + EndLine: 5, + StartPos: 76, + EndPos: 77, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 5, - EndLine: 5, - StartPos: 76, - EndPos: 77, + EndLine: 5, + StartPos: 76, + EndPos: 77, }, Value: "a", }, @@ -771,25 +772,25 @@ func TestPhp7(t *testing.T) { &node.Argument{ Position: &position.Position{ StartLine: 5, - EndLine: 5, - StartPos: 80, - EndPos: 84, + EndLine: 5, + StartPos: 80, + EndPos: 84, }, - Variadic: true, + Variadic: true, IsReference: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 5, - EndLine: 5, - StartPos: 83, - EndPos: 84, + EndLine: 5, + StartPos: 83, + EndPos: 84, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 5, - EndLine: 5, - StartPos: 83, - EndPos: 84, + EndLine: 5, + StartPos: 83, + EndPos: 84, }, Value: "b", }, @@ -802,30 +803,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 6, - EndLine: 6, - StartPos: 90, - EndPos: 110, + EndLine: 6, + StartPos: 90, + EndPos: 110, }, Expr: &expr.StaticCall{ Position: &position.Position{ StartLine: 6, - EndLine: 6, - StartPos: 90, - EndPos: 109, + EndLine: 6, + StartPos: 90, + EndPos: 109, }, Class: &expr.Variable{ Position: &position.Position{ StartLine: 6, - EndLine: 6, - StartPos: 90, - EndPos: 93, + EndLine: 6, + StartPos: 90, + EndPos: 93, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 6, - EndLine: 6, - StartPos: 90, - EndPos: 93, + EndLine: 6, + StartPos: 90, + EndPos: 93, }, Value: "foo", }, @@ -833,42 +834,42 @@ func TestPhp7(t *testing.T) { Call: &node.Identifier{ Position: &position.Position{ StartLine: 6, - EndLine: 6, - StartPos: 96, - EndPos: 98, + EndLine: 6, + StartPos: 96, + EndPos: 98, }, Value: "bar", }, ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 6, - EndLine: 6, - StartPos: 99, - EndPos: 109, + EndLine: 6, + StartPos: 99, + EndPos: 109, }, Arguments: []node.Node{ &node.Argument{ Position: &position.Position{ StartLine: 6, - EndLine: 6, - StartPos: 100, - EndPos: 101, + EndLine: 6, + StartPos: 100, + EndPos: 101, }, + Variadic: false, IsReference: false, - Variadic: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 6, - EndLine: 6, - StartPos: 100, - EndPos: 101, + EndLine: 6, + StartPos: 100, + EndPos: 101, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 6, - EndLine: 6, - StartPos: 100, - EndPos: 101, + EndLine: 6, + StartPos: 100, + EndPos: 101, }, Value: "a", }, @@ -877,25 +878,25 @@ func TestPhp7(t *testing.T) { &node.Argument{ Position: &position.Position{ StartLine: 6, - EndLine: 6, - StartPos: 104, - EndPos: 108, + EndLine: 6, + StartPos: 104, + EndPos: 108, }, - Variadic: true, IsReference: false, + Variadic: true, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 6, - EndLine: 6, - StartPos: 107, - EndPos: 108, + EndLine: 6, + StartPos: 107, + EndPos: 108, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 6, - EndLine: 6, - StartPos: 107, - EndPos: 108, + EndLine: 6, + StartPos: 107, + EndPos: 108, }, Value: "b", }, @@ -908,31 +909,31 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 7, - EndLine: 7, - StartPos: 114, - EndPos: 132, + EndLine: 7, + StartPos: 114, + EndPos: 132, }, Expr: &expr.New{ Position: &position.Position{ StartLine: 7, - EndLine: 7, - StartPos: 114, - EndPos: 131, + EndLine: 7, + StartPos: 114, + EndPos: 131, }, Class: &name.Name{ Position: &position.Position{ StartLine: 7, - EndLine: 7, - StartPos: 118, - EndPos: 120, + EndLine: 7, + StartPos: 118, + EndPos: 120, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 7, - EndLine: 7, - StartPos: 118, - EndPos: 120, + EndLine: 7, + StartPos: 118, + EndPos: 120, }, Value: "foo", }, @@ -941,33 +942,33 @@ func TestPhp7(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 7, - EndLine: 7, - StartPos: 121, - EndPos: 131, + EndLine: 7, + StartPos: 121, + EndPos: 131, }, Arguments: []node.Node{ &node.Argument{ Position: &position.Position{ StartLine: 7, - EndLine: 7, - StartPos: 122, - EndPos: 123, + EndLine: 7, + StartPos: 122, + EndPos: 123, }, - Variadic: false, + Variadic: false, IsReference: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 7, - EndLine: 7, - StartPos: 122, - EndPos: 123, + EndLine: 7, + StartPos: 122, + EndPos: 123, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 7, - EndLine: 7, - StartPos: 122, - EndPos: 123, + EndLine: 7, + StartPos: 122, + EndPos: 123, }, Value: "a", }, @@ -976,25 +977,25 @@ func TestPhp7(t *testing.T) { &node.Argument{ Position: &position.Position{ StartLine: 7, - EndLine: 7, - StartPos: 126, - EndPos: 130, + EndLine: 7, + StartPos: 126, + EndPos: 130, }, - Variadic: true, + Variadic: true, IsReference: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 7, - EndLine: 7, - StartPos: 129, - EndPos: 130, + EndLine: 7, + StartPos: 129, + EndPos: 130, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 7, - EndLine: 7, - StartPos: 129, - EndPos: 130, + EndLine: 7, + StartPos: 129, + EndPos: 130, }, Value: "b", }, @@ -1007,55 +1008,67 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 9, - EndLine: 9, - StartPos: 161, - EndPos: 185, + EndLine: 9, + StartPos: 161, + EndPos: 185, }, Expr: &expr.New{ Position: &position.Position{ StartLine: 9, - EndLine: 9, - StartPos: 161, - EndPos: 184, + EndLine: 9, + StartPos: 161, + EndPos: 184, + }, + Comments: []*comment.Comment{ + { + Position: &position.Position{ + StartLine: 8, + EndLine: 8, + StartPos: 136, + EndPos: 157, + }, + Value: "/** anonymous class */", + TokenName: 'O', + }, }, Class: &stmt.Class{ Position: &position.Position{ StartLine: 9, - EndLine: 9, - StartPos: 165, - EndPos: 184, + EndLine: 9, + StartPos: 165, + EndPos: 184, }, PhpDocComment: "/** anonymous class */", ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 9, - EndLine: 9, - StartPos: 171, - EndPos: 181, + EndLine: 9, + StartPos: 171, + EndPos: 181, }, Arguments: []node.Node{ &node.Argument{ Position: &position.Position{ StartLine: 9, - EndLine: 9, - StartPos: 172, - EndPos: 173, + EndLine: 9, + StartPos: 172, + EndPos: 173, }, - Variadic: false, + Variadic: false, IsReference: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 9, - EndLine: 9, - StartPos: 172, - EndPos: 173, + EndLine: 9, + StartPos: 172, + EndPos: 173, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 9, - EndLine: 9, - StartPos: 172, - EndPos: 173, + EndLine: 9, + StartPos: 172, + EndPos: 173, }, Value: "a", }, @@ -1064,25 +1077,25 @@ func TestPhp7(t *testing.T) { &node.Argument{ Position: &position.Position{ StartLine: 9, - EndLine: 9, - StartPos: 176, - EndPos: 180, + EndLine: 9, + StartPos: 176, + EndPos: 180, }, - Variadic: true, + Variadic: true, IsReference: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 9, - EndLine: 9, - StartPos: 179, - EndPos: 180, + EndLine: 9, + StartPos: 179, + EndPos: 180, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 9, - EndLine: 9, - StartPos: 179, - EndPos: 180, + EndLine: 9, + StartPos: 179, + EndPos: 180, }, Value: "b", }, @@ -1090,65 +1103,63 @@ func TestPhp7(t *testing.T) { }, }, }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 10, - EndLine: 10, - StartPos: 189, - EndPos: 201, + EndLine: 10, + StartPos: 189, + EndPos: 201, }, Expr: &expr.New{ Position: &position.Position{ StartLine: 10, - EndLine: 10, - StartPos: 189, - EndPos: 200, + EndLine: 10, + StartPos: 189, + EndPos: 200, }, Class: &stmt.Class{ Position: &position.Position{ StartLine: 10, - EndLine: 10, - StartPos: 193, - EndPos: 200, + EndLine: 10, + StartPos: 193, + EndPos: 200, }, PhpDocComment: "", - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 11, - EndLine: 11, - StartPos: 205, - EndPos: 213, + EndLine: 11, + StartPos: 205, + EndPos: 213, }, Expr: &expr.New{ Position: &position.Position{ StartLine: 11, - EndLine: 11, - StartPos: 205, - EndPos: 212, + EndLine: 11, + StartPos: 205, + EndPos: 212, }, Class: &expr.Variable{ Position: &position.Position{ StartLine: 11, - EndLine: 11, - StartPos: 209, - EndPos: 212, + EndLine: 11, + StartPos: 209, + EndPos: 212, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 11, - EndLine: 11, - StartPos: 209, - EndPos: 212, + EndLine: 11, + StartPos: 209, + EndPos: 212, }, Value: "foo", }, @@ -1158,37 +1169,37 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 12, - EndLine: 12, - StartPos: 217, - EndPos: 228, + EndLine: 12, + StartPos: 217, + EndPos: 228, }, Expr: &expr.New{ Position: &position.Position{ StartLine: 12, - EndLine: 12, - StartPos: 217, - EndPos: 227, + EndLine: 12, + StartPos: 217, + EndPos: 227, }, Class: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 12, - EndLine: 12, - StartPos: 221, - EndPos: 227, + EndLine: 12, + StartPos: 221, + EndPos: 227, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 12, - EndLine: 12, - StartPos: 221, - EndPos: 224, + EndLine: 12, + StartPos: 221, + EndPos: 224, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 12, - EndLine: 12, - StartPos: 221, - EndPos: 224, + EndLine: 12, + StartPos: 221, + EndPos: 224, }, Value: "foo", }, @@ -1196,9 +1207,9 @@ func TestPhp7(t *testing.T) { Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 12, - EndLine: 12, - StartPos: 226, - EndPos: 226, + EndLine: 12, + StartPos: 226, + EndPos: 226, }, Value: "1", }, @@ -1208,37 +1219,37 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 13, - EndLine: 13, - StartPos: 232, - EndPos: 246, + EndLine: 13, + StartPos: 232, + EndPos: 246, }, Expr: &expr.New{ Position: &position.Position{ StartLine: 13, - EndLine: 13, - StartPos: 232, - EndPos: 245, + EndLine: 13, + StartPos: 232, + EndPos: 245, }, Class: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 13, - EndLine: 13, - StartPos: 236, - EndPos: 245, + EndLine: 13, + StartPos: 236, + EndPos: 245, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 13, - EndLine: 13, - StartPos: 236, - EndPos: 239, + EndLine: 13, + StartPos: 236, + EndPos: 239, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 13, - EndLine: 13, - StartPos: 236, - EndPos: 239, + EndLine: 13, + StartPos: 236, + EndPos: 239, }, Value: "foo", }, @@ -1246,16 +1257,16 @@ func TestPhp7(t *testing.T) { Dim: &expr.Variable{ Position: &position.Position{ StartLine: 13, - EndLine: 13, - StartPos: 241, - EndPos: 244, + EndLine: 13, + StartPos: 241, + EndPos: 244, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 13, - EndLine: 13, - StartPos: 241, - EndPos: 244, + EndLine: 13, + StartPos: 241, + EndPos: 244, }, Value: "bar", }, @@ -1266,37 +1277,37 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 14, - EndLine: 14, - StartPos: 250, - EndPos: 263, + EndLine: 14, + StartPos: 250, + EndPos: 263, }, Expr: &expr.New{ Position: &position.Position{ StartLine: 14, - EndLine: 14, - StartPos: 250, - EndPos: 262, + EndLine: 14, + StartPos: 250, + EndPos: 262, }, Class: &expr.PropertyFetch{ Position: &position.Position{ StartLine: 14, - EndLine: 14, - StartPos: 254, - EndPos: 262, + EndLine: 14, + StartPos: 254, + EndPos: 262, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 14, - EndLine: 14, - StartPos: 254, - EndPos: 257, + EndLine: 14, + StartPos: 254, + EndPos: 257, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 14, - EndLine: 14, - StartPos: 254, - EndPos: 257, + EndLine: 14, + StartPos: 254, + EndPos: 257, }, Value: "foo", }, @@ -1304,9 +1315,9 @@ func TestPhp7(t *testing.T) { Property: &node.Identifier{ Position: &position.Position{ StartLine: 14, - EndLine: 14, - StartPos: 260, - EndPos: 262, + EndLine: 14, + StartPos: 260, + EndPos: 262, }, Value: "bar", }, @@ -1316,37 +1327,37 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 15, - EndLine: 15, - StartPos: 267, - EndPos: 281, + EndLine: 15, + StartPos: 267, + EndPos: 281, }, Expr: &expr.New{ Position: &position.Position{ StartLine: 15, - EndLine: 15, - StartPos: 267, - EndPos: 280, + EndLine: 15, + StartPos: 267, + EndPos: 280, }, Class: &expr.StaticPropertyFetch{ Position: &position.Position{ StartLine: 15, - EndLine: 15, - StartPos: 271, - EndPos: 280, + EndLine: 15, + StartPos: 271, + EndPos: 280, }, Class: &expr.Variable{ Position: &position.Position{ StartLine: 15, - EndLine: 15, - StartPos: 271, - EndPos: 274, + EndLine: 15, + StartPos: 271, + EndPos: 274, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 15, - EndLine: 15, - StartPos: 271, - EndPos: 274, + EndLine: 15, + StartPos: 271, + EndPos: 274, }, Value: "foo", }, @@ -1354,16 +1365,16 @@ func TestPhp7(t *testing.T) { Property: &expr.Variable{ Position: &position.Position{ StartLine: 15, - EndLine: 15, - StartPos: 277, - EndPos: 280, + EndLine: 15, + StartPos: 277, + EndPos: 280, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 15, - EndLine: 15, - StartPos: 277, - EndPos: 280, + EndLine: 15, + StartPos: 277, + EndPos: 280, }, Value: "bar", }, @@ -1374,46 +1385,46 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 16, - EndLine: 16, - StartPos: 285, - EndPos: 301, + EndLine: 16, + StartPos: 285, + EndPos: 301, }, Expr: &expr.New{ Position: &position.Position{ StartLine: 16, - EndLine: 16, - StartPos: 285, - EndPos: 300, + EndLine: 16, + StartPos: 285, + EndPos: 300, }, Class: &expr.StaticPropertyFetch{ Position: &position.Position{ StartLine: 16, - EndLine: 16, - StartPos: 289, - EndPos: 300, + EndLine: 16, + StartPos: 289, + EndPos: 300, }, Class: &node.Identifier{ Position: &position.Position{ StartLine: 16, - EndLine: 16, - StartPos: 289, - EndPos: 294, + EndLine: 16, + StartPos: 289, + EndPos: 294, }, Value: "static", }, Property: &expr.Variable{ Position: &position.Position{ StartLine: 16, - EndLine: 16, - StartPos: 297, - EndPos: 300, + EndLine: 16, + StartPos: 297, + EndPos: 300, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 16, - EndLine: 16, - StartPos: 297, - EndPos: 300, + EndLine: 16, + StartPos: 297, + EndPos: 300, }, Value: "bar", }, @@ -1424,18 +1435,18 @@ func TestPhp7(t *testing.T) { &stmt.Function{ Position: &position.Position{ StartLine: 18, - EndLine: 18, - StartPos: 306, - EndPos: 350, + EndLine: 18, + StartPos: 306, + EndPos: 350, }, + ReturnsRef: false, PhpDocComment: "", - ReturnsRef: false, FunctionName: &node.Identifier{ Position: &position.Position{ StartLine: 18, - EndLine: 18, - StartPos: 315, - EndPos: 317, + EndLine: 18, + StartPos: 315, + EndPos: 317, }, Value: "foo", }, @@ -1443,33 +1454,33 @@ func TestPhp7(t *testing.T) { &node.Parameter{ Position: &position.Position{ StartLine: 18, - EndLine: 18, - StartPos: 319, - EndPos: 332, + EndLine: 18, + StartPos: 319, + EndPos: 332, }, - ByRef: false, + ByRef: false, Variadic: false, VariableType: &node.Nullable{ Position: &position.Position{ StartLine: 18, - EndLine: 18, - StartPos: 319, - EndPos: 322, + EndLine: 18, + StartPos: 319, + EndPos: 322, }, Expr: &name.Name{ Position: &position.Position{ StartLine: 18, - EndLine: 18, - StartPos: 320, - EndPos: 322, + EndLine: 18, + StartPos: 320, + EndPos: 322, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 18, - EndLine: 18, - StartPos: 320, - EndPos: 322, + EndLine: 18, + StartPos: 320, + EndPos: 322, }, Value: "bar", }, @@ -1479,16 +1490,16 @@ func TestPhp7(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 18, - EndLine: 18, - StartPos: 324, - EndPos: 327, + EndLine: 18, + StartPos: 324, + EndPos: 327, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 18, - EndLine: 18, - StartPos: 324, - EndPos: 327, + EndLine: 18, + StartPos: 324, + EndPos: 327, }, Value: "bar", }, @@ -1496,24 +1507,24 @@ func TestPhp7(t *testing.T) { DefaultValue: &expr.ConstFetch{ Position: &position.Position{ StartLine: 18, - EndLine: 18, - StartPos: 329, - EndPos: 332, + EndLine: 18, + StartPos: 329, + EndPos: 332, }, Constant: &name.Name{ Position: &position.Position{ StartLine: 18, - EndLine: 18, - StartPos: 329, - EndPos: 332, + EndLine: 18, + StartPos: 329, + EndPos: 332, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 18, - EndLine: 18, - StartPos: 329, - EndPos: 332, + EndLine: 18, + StartPos: 329, + EndPos: 332, }, Value: "null", }, @@ -1524,26 +1535,26 @@ func TestPhp7(t *testing.T) { &node.Parameter{ Position: &position.Position{ StartLine: 18, - EndLine: 18, - StartPos: 335, - EndPos: 346, + EndLine: 18, + StartPos: 335, + EndPos: 346, }, - ByRef: true, + ByRef: true, Variadic: true, VariableType: &name.Name{ Position: &position.Position{ StartLine: 18, - EndLine: 18, - StartPos: 335, - EndPos: 337, + EndLine: 18, + StartPos: 335, + EndPos: 337, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 18, - EndLine: 18, - StartPos: 335, - EndPos: 337, + EndLine: 18, + StartPos: 335, + EndPos: 337, }, Value: "baz", }, @@ -1552,39 +1563,38 @@ func TestPhp7(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 18, - EndLine: 18, - StartPos: 343, - EndPos: 346, + EndLine: 18, + StartPos: 343, + EndPos: 346, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 18, - EndLine: 18, - StartPos: 343, - EndPos: 346, + EndLine: 18, + StartPos: 343, + EndPos: 346, }, Value: "baz", }, }, }, }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, &stmt.Class{ Position: &position.Position{ StartLine: 19, - EndLine: 19, - StartPos: 354, - EndPos: 417, + EndLine: 19, + StartPos: 354, + EndPos: 417, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 19, - EndLine: 19, - StartPos: 360, - EndPos: 362, + EndLine: 19, + StartPos: 360, + EndPos: 362, }, Value: "foo", }, @@ -1592,18 +1602,18 @@ func TestPhp7(t *testing.T) { &stmt.ClassMethod{ Position: &position.Position{ StartLine: 19, - EndLine: 19, - StartPos: 365, - EndPos: 416, + EndLine: 19, + StartPos: 365, + EndPos: 416, }, + ReturnsRef: false, PhpDocComment: "", - ReturnsRef: false, MethodName: &node.Identifier{ Position: &position.Position{ StartLine: 19, - EndLine: 19, - StartPos: 381, - EndPos: 383, + EndLine: 19, + StartPos: 381, + EndPos: 383, }, Value: "foo", }, @@ -1611,9 +1621,9 @@ func TestPhp7(t *testing.T) { &node.Identifier{ Position: &position.Position{ StartLine: 19, - EndLine: 19, - StartPos: 365, - EndPos: 370, + EndLine: 19, + StartPos: 365, + EndPos: 370, }, Value: "public", }, @@ -1622,33 +1632,33 @@ func TestPhp7(t *testing.T) { &node.Parameter{ Position: &position.Position{ StartLine: 19, - EndLine: 19, - StartPos: 385, - EndPos: 398, + EndLine: 19, + StartPos: 385, + EndPos: 398, }, - ByRef: false, + ByRef: false, Variadic: false, VariableType: &node.Nullable{ Position: &position.Position{ StartLine: 19, - EndLine: 19, - StartPos: 385, - EndPos: 388, + EndLine: 19, + StartPos: 385, + EndPos: 388, }, Expr: &name.Name{ Position: &position.Position{ StartLine: 19, - EndLine: 19, - StartPos: 386, - EndPos: 388, + EndLine: 19, + StartPos: 386, + EndPos: 388, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 19, - EndLine: 19, - StartPos: 386, - EndPos: 388, + EndLine: 19, + StartPos: 386, + EndPos: 388, }, Value: "bar", }, @@ -1658,16 +1668,16 @@ func TestPhp7(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 19, - EndLine: 19, - StartPos: 390, - EndPos: 393, + EndLine: 19, + StartPos: 390, + EndPos: 393, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 19, - EndLine: 19, - StartPos: 390, - EndPos: 393, + EndLine: 19, + StartPos: 390, + EndPos: 393, }, Value: "bar", }, @@ -1675,24 +1685,24 @@ func TestPhp7(t *testing.T) { DefaultValue: &expr.ConstFetch{ Position: &position.Position{ StartLine: 19, - EndLine: 19, - StartPos: 395, - EndPos: 398, + EndLine: 19, + StartPos: 395, + EndPos: 398, }, Constant: &name.Name{ Position: &position.Position{ StartLine: 19, - EndLine: 19, - StartPos: 395, - EndPos: 398, + EndLine: 19, + StartPos: 395, + EndPos: 398, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 19, - EndLine: 19, - StartPos: 395, - EndPos: 398, + EndLine: 19, + StartPos: 395, + EndPos: 398, }, Value: "null", }, @@ -1703,26 +1713,26 @@ func TestPhp7(t *testing.T) { &node.Parameter{ Position: &position.Position{ StartLine: 19, - EndLine: 19, - StartPos: 401, - EndPos: 412, + EndLine: 19, + StartPos: 401, + EndPos: 412, }, - ByRef: true, + ByRef: true, Variadic: true, VariableType: &name.Name{ Position: &position.Position{ StartLine: 19, - EndLine: 19, - StartPos: 401, - EndPos: 403, + EndLine: 19, + StartPos: 401, + EndPos: 403, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 19, - EndLine: 19, - StartPos: 401, - EndPos: 403, + EndLine: 19, + StartPos: 401, + EndPos: 403, }, Value: "baz", }, @@ -1731,16 +1741,16 @@ func TestPhp7(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 19, - EndLine: 19, - StartPos: 409, - EndPos: 412, + EndLine: 19, + StartPos: 409, + EndPos: 412, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 19, - EndLine: 19, - StartPos: 409, - EndPos: 412, + EndLine: 19, + StartPos: 409, + EndPos: 412, }, Value: "baz", }, @@ -1750,12 +1760,11 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 19, - EndLine: 19, - StartPos: 415, - EndPos: 416, - }, - Stmts: []node.Node{ + EndLine: 19, + StartPos: 415, + EndPos: 416, }, + Stmts: []node.Node{}, }, }, }, @@ -1763,51 +1772,51 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 20, - EndLine: 20, - StartPos: 421, - EndPos: 462, + EndLine: 20, + StartPos: 421, + EndPos: 462, }, Expr: &expr.Closure{ Position: &position.Position{ StartLine: 20, - EndLine: 20, - StartPos: 421, - EndPos: 461, + EndLine: 20, + StartPos: 421, + EndPos: 461, }, + Static: false, PhpDocComment: "", - ReturnsRef: false, - Static: false, + ReturnsRef: false, Params: []node.Node{ &node.Parameter{ Position: &position.Position{ StartLine: 20, - EndLine: 20, - StartPos: 430, - EndPos: 443, + EndLine: 20, + StartPos: 430, + EndPos: 443, }, - ByRef: false, + ByRef: false, Variadic: false, VariableType: &node.Nullable{ Position: &position.Position{ StartLine: 20, - EndLine: 20, - StartPos: 430, - EndPos: 433, + EndLine: 20, + StartPos: 430, + EndPos: 433, }, Expr: &name.Name{ Position: &position.Position{ StartLine: 20, - EndLine: 20, - StartPos: 431, - EndPos: 433, + EndLine: 20, + StartPos: 431, + EndPos: 433, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 20, - EndLine: 20, - StartPos: 431, - EndPos: 433, + EndLine: 20, + StartPos: 431, + EndPos: 433, }, Value: "bar", }, @@ -1817,16 +1826,16 @@ func TestPhp7(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 20, - EndLine: 20, - StartPos: 435, - EndPos: 438, + EndLine: 20, + StartPos: 435, + EndPos: 438, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 20, - EndLine: 20, - StartPos: 435, - EndPos: 438, + EndLine: 20, + StartPos: 435, + EndPos: 438, }, Value: "bar", }, @@ -1834,24 +1843,24 @@ func TestPhp7(t *testing.T) { DefaultValue: &expr.ConstFetch{ Position: &position.Position{ StartLine: 20, - EndLine: 20, - StartPos: 440, - EndPos: 443, + EndLine: 20, + StartPos: 440, + EndPos: 443, }, Constant: &name.Name{ Position: &position.Position{ StartLine: 20, - EndLine: 20, - StartPos: 440, - EndPos: 443, + EndLine: 20, + StartPos: 440, + EndPos: 443, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 20, - EndLine: 20, - StartPos: 440, - EndPos: 443, + EndLine: 20, + StartPos: 440, + EndPos: 443, }, Value: "null", }, @@ -1862,26 +1871,26 @@ func TestPhp7(t *testing.T) { &node.Parameter{ Position: &position.Position{ StartLine: 20, - EndLine: 20, - StartPos: 446, - EndPos: 457, + EndLine: 20, + StartPos: 446, + EndPos: 457, }, - ByRef: true, + ByRef: true, Variadic: true, VariableType: &name.Name{ Position: &position.Position{ StartLine: 20, - EndLine: 20, - StartPos: 446, - EndPos: 448, + EndLine: 20, + StartPos: 446, + EndPos: 448, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 20, - EndLine: 20, - StartPos: 446, - EndPos: 448, + EndLine: 20, + StartPos: 446, + EndPos: 448, }, Value: "baz", }, @@ -1890,74 +1899,73 @@ func TestPhp7(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 20, - EndLine: 20, - StartPos: 454, - EndPos: 457, + EndLine: 20, + StartPos: 454, + EndPos: 457, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 20, - EndLine: 20, - StartPos: 454, - EndPos: 457, + EndLine: 20, + StartPos: 454, + EndPos: 457, }, Value: "baz", }, }, }, }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 21, - EndLine: 21, - StartPos: 466, - EndPos: 514, + EndLine: 21, + StartPos: 466, + EndPos: 514, }, Expr: &expr.Closure{ Position: &position.Position{ StartLine: 21, - EndLine: 21, - StartPos: 466, - EndPos: 513, + EndLine: 21, + StartPos: 466, + EndPos: 513, }, + Static: true, PhpDocComment: "", - ReturnsRef: false, - Static: true, + ReturnsRef: false, Params: []node.Node{ &node.Parameter{ Position: &position.Position{ StartLine: 21, - EndLine: 21, - StartPos: 482, - EndPos: 495, + EndLine: 21, + StartPos: 482, + EndPos: 495, }, - ByRef: false, + ByRef: false, Variadic: false, VariableType: &node.Nullable{ Position: &position.Position{ StartLine: 21, - EndLine: 21, - StartPos: 482, - EndPos: 485, + EndLine: 21, + StartPos: 482, + EndPos: 485, }, Expr: &name.Name{ Position: &position.Position{ StartLine: 21, - EndLine: 21, - StartPos: 483, - EndPos: 485, + EndLine: 21, + StartPos: 483, + EndPos: 485, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 21, - EndLine: 21, - StartPos: 483, - EndPos: 485, + EndLine: 21, + StartPos: 483, + EndPos: 485, }, Value: "bar", }, @@ -1967,16 +1975,16 @@ func TestPhp7(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 21, - EndLine: 21, - StartPos: 487, - EndPos: 490, + EndLine: 21, + StartPos: 487, + EndPos: 490, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 21, - EndLine: 21, - StartPos: 487, - EndPos: 490, + EndLine: 21, + StartPos: 487, + EndPos: 490, }, Value: "bar", }, @@ -1984,24 +1992,24 @@ func TestPhp7(t *testing.T) { DefaultValue: &expr.ConstFetch{ Position: &position.Position{ StartLine: 21, - EndLine: 21, - StartPos: 492, - EndPos: 495, + EndLine: 21, + StartPos: 492, + EndPos: 495, }, Constant: &name.Name{ Position: &position.Position{ StartLine: 21, - EndLine: 21, - StartPos: 492, - EndPos: 495, + EndLine: 21, + StartPos: 492, + EndPos: 495, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 21, - EndLine: 21, - StartPos: 492, - EndPos: 495, + EndLine: 21, + StartPos: 492, + EndPos: 495, }, Value: "null", }, @@ -2012,26 +2020,26 @@ func TestPhp7(t *testing.T) { &node.Parameter{ Position: &position.Position{ StartLine: 21, - EndLine: 21, - StartPos: 498, - EndPos: 509, + EndLine: 21, + StartPos: 498, + EndPos: 509, }, - ByRef: true, + ByRef: true, Variadic: true, VariableType: &name.Name{ Position: &position.Position{ StartLine: 21, - EndLine: 21, - StartPos: 498, - EndPos: 500, + EndLine: 21, + StartPos: 498, + EndPos: 500, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 21, - EndLine: 21, - StartPos: 498, - EndPos: 500, + EndLine: 21, + StartPos: 498, + EndPos: 500, }, Value: "baz", }, @@ -2040,39 +2048,38 @@ func TestPhp7(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 21, - EndLine: 21, - StartPos: 506, - EndPos: 509, + EndLine: 21, + StartPos: 506, + EndPos: 509, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 21, - EndLine: 21, - StartPos: 506, - EndPos: 509, + EndLine: 21, + StartPos: 506, + EndPos: 509, }, Value: "baz", }, }, }, }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 23, - EndLine: 23, - StartPos: 519, - EndPos: 538, + EndLine: 23, + StartPos: 519, + EndPos: 538, }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 23, - EndLine: 23, - StartPos: 519, - EndPos: 537, + EndLine: 23, + StartPos: 519, + EndPos: 537, }, Value: "1234567890123456789", }, @@ -2080,16 +2087,16 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 24, - EndLine: 24, - StartPos: 542, - EndPos: 562, + EndLine: 24, + StartPos: 542, + EndPos: 562, }, Expr: &scalar.Dnumber{ Position: &position.Position{ StartLine: 24, - EndLine: 24, - StartPos: 542, - EndPos: 561, + EndLine: 24, + StartPos: 542, + EndPos: 561, }, Value: "12345678901234567890", }, @@ -2097,16 +2104,16 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 25, - EndLine: 25, - StartPos: 566, - EndPos: 568, + EndLine: 25, + StartPos: 566, + EndPos: 568, }, Expr: &scalar.Dnumber{ Position: &position.Position{ StartLine: 25, - EndLine: 25, - StartPos: 566, - EndPos: 567, + EndLine: 25, + StartPos: 566, + EndPos: 567, }, Value: "0.", }, @@ -2114,16 +2121,16 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 26, - EndLine: 26, - StartPos: 572, - EndPos: 638, + EndLine: 26, + StartPos: 572, + EndPos: 638, }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 26, - EndLine: 26, - StartPos: 572, - EndPos: 637, + EndLine: 26, + StartPos: 572, + EndPos: 637, }, Value: "0b0111111111111111111111111111111111111111111111111111111111111111", }, @@ -2131,16 +2138,16 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 27, - EndLine: 27, - StartPos: 642, - EndPos: 708, + EndLine: 27, + StartPos: 642, + EndPos: 708, }, Expr: &scalar.Dnumber{ Position: &position.Position{ StartLine: 27, - EndLine: 27, - StartPos: 642, - EndPos: 707, + EndLine: 27, + StartPos: 642, + EndPos: 707, }, Value: "0b1111111111111111111111111111111111111111111111111111111111111111", }, @@ -2148,16 +2155,16 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 28, - EndLine: 28, - StartPos: 712, - EndPos: 732, + EndLine: 28, + StartPos: 712, + EndPos: 732, }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 28, - EndLine: 28, - StartPos: 712, - EndPos: 731, + EndLine: 28, + StartPos: 712, + EndPos: 731, }, Value: "0x007111111111111111", }, @@ -2165,16 +2172,16 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 29, - EndLine: 29, - StartPos: 736, - EndPos: 754, + EndLine: 29, + StartPos: 736, + EndPos: 754, }, Expr: &scalar.Dnumber{ Position: &position.Position{ StartLine: 29, - EndLine: 29, - StartPos: 736, - EndPos: 753, + EndLine: 29, + StartPos: 736, + EndPos: 753, }, Value: "0x8111111111111111", }, @@ -2182,16 +2189,16 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 30, - EndLine: 30, - StartPos: 758, - EndPos: 767, + EndLine: 30, + StartPos: 758, + EndPos: 767, }, Expr: &scalar.MagicConstant{ Position: &position.Position{ StartLine: 30, - EndLine: 30, - StartPos: 758, - EndPos: 766, + EndLine: 30, + StartPos: 758, + EndPos: 766, }, Value: "__CLASS__", }, @@ -2199,16 +2206,16 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 31, - EndLine: 31, - StartPos: 771, - EndPos: 778, + EndLine: 31, + StartPos: 771, + EndPos: 778, }, Expr: &scalar.MagicConstant{ Position: &position.Position{ StartLine: 31, - EndLine: 31, - StartPos: 771, - EndPos: 777, + EndLine: 31, + StartPos: 771, + EndPos: 777, }, Value: "__DIR__", }, @@ -2216,16 +2223,16 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 32, - EndLine: 32, - StartPos: 782, - EndPos: 790, + EndLine: 32, + StartPos: 782, + EndPos: 790, }, Expr: &scalar.MagicConstant{ Position: &position.Position{ StartLine: 32, - EndLine: 32, - StartPos: 782, - EndPos: 789, + EndLine: 32, + StartPos: 782, + EndPos: 789, }, Value: "__FILE__", }, @@ -2233,16 +2240,16 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 33, - EndLine: 33, - StartPos: 794, - EndPos: 806, + EndLine: 33, + StartPos: 794, + EndPos: 806, }, Expr: &scalar.MagicConstant{ Position: &position.Position{ StartLine: 33, - EndLine: 33, - StartPos: 794, - EndPos: 805, + EndLine: 33, + StartPos: 794, + EndPos: 805, }, Value: "__FUNCTION__", }, @@ -2250,16 +2257,16 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 34, - EndLine: 34, - StartPos: 810, - EndPos: 818, + EndLine: 34, + StartPos: 810, + EndPos: 818, }, Expr: &scalar.MagicConstant{ Position: &position.Position{ StartLine: 34, - EndLine: 34, - StartPos: 810, - EndPos: 817, + EndLine: 34, + StartPos: 810, + EndPos: 817, }, Value: "__LINE__", }, @@ -2267,16 +2274,16 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 35, - EndLine: 35, - StartPos: 822, - EndPos: 835, + EndLine: 35, + StartPos: 822, + EndPos: 835, }, Expr: &scalar.MagicConstant{ Position: &position.Position{ StartLine: 35, - EndLine: 35, - StartPos: 822, - EndPos: 834, + EndLine: 35, + StartPos: 822, + EndPos: 834, }, Value: "__NAMESPACE__", }, @@ -2284,16 +2291,16 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 36, - EndLine: 36, - StartPos: 839, - EndPos: 849, + EndLine: 36, + StartPos: 839, + EndPos: 849, }, Expr: &scalar.MagicConstant{ Position: &position.Position{ StartLine: 36, - EndLine: 36, - StartPos: 839, - EndPos: 848, + EndLine: 36, + StartPos: 839, + EndPos: 848, }, Value: "__METHOD__", }, @@ -2301,16 +2308,16 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 37, - EndLine: 37, - StartPos: 853, - EndPos: 862, + EndLine: 37, + StartPos: 853, + EndPos: 862, }, Expr: &scalar.MagicConstant{ Position: &position.Position{ StartLine: 37, - EndLine: 37, - StartPos: 853, - EndPos: 861, + EndLine: 37, + StartPos: 853, + EndPos: 861, }, Value: "__TRAIT__", }, @@ -2318,40 +2325,40 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 39, - EndLine: 39, - StartPos: 867, - EndPos: 878, + EndLine: 39, + StartPos: 867, + EndPos: 878, }, Expr: &scalar.Encapsed{ Position: &position.Position{ StartLine: 39, - EndLine: 39, - StartPos: 867, - EndPos: 877, + EndLine: 39, + StartPos: 867, + EndPos: 877, }, Parts: []node.Node{ &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 39, - EndLine: 39, - StartPos: 868, - EndPos: 872, + EndLine: 39, + StartPos: 868, + EndPos: 872, }, Value: "test ", }, &expr.Variable{ Position: &position.Position{ StartLine: 39, - EndLine: 39, - StartPos: 873, - EndPos: 876, + EndLine: 39, + StartPos: 873, + EndPos: 876, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 39, - EndLine: 39, - StartPos: 873, - EndPos: 876, + EndLine: 39, + StartPos: 873, + EndPos: 876, }, Value: "var", }, @@ -2362,47 +2369,47 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 40, - EndLine: 40, - StartPos: 882, - EndPos: 896, + EndLine: 40, + StartPos: 882, + EndPos: 896, }, Expr: &scalar.Encapsed{ Position: &position.Position{ StartLine: 40, - EndLine: 40, - StartPos: 882, - EndPos: 895, + EndLine: 40, + StartPos: 882, + EndPos: 895, }, Parts: []node.Node{ &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 40, - EndLine: 40, - StartPos: 883, - EndPos: 887, + EndLine: 40, + StartPos: 883, + EndPos: 887, }, Value: "test ", }, &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 40, - EndLine: 40, - StartPos: 888, - EndPos: 894, + EndLine: 40, + StartPos: 888, + EndPos: 894, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 40, - EndLine: 40, - StartPos: 888, - EndPos: 891, + EndLine: 40, + StartPos: 888, + EndPos: 891, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 40, - EndLine: 40, - StartPos: 888, - EndPos: 891, + EndLine: 40, + StartPos: 888, + EndPos: 891, }, Value: "var", }, @@ -2410,9 +2417,9 @@ func TestPhp7(t *testing.T) { Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 40, - EndLine: 40, - StartPos: 893, - EndPos: 893, + EndLine: 40, + StartPos: 893, + EndPos: 893, }, Value: "1", }, @@ -2423,47 +2430,47 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 41, - EndLine: 41, - StartPos: 900, - EndPos: 915, + EndLine: 41, + StartPos: 900, + EndPos: 915, }, Expr: &scalar.Encapsed{ Position: &position.Position{ StartLine: 41, - EndLine: 41, - StartPos: 900, - EndPos: 914, + EndLine: 41, + StartPos: 900, + EndPos: 914, }, Parts: []node.Node{ &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 41, - EndLine: 41, - StartPos: 901, - EndPos: 905, + EndLine: 41, + StartPos: 901, + EndPos: 905, }, Value: "test ", }, &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 41, - EndLine: 41, - StartPos: 906, - EndPos: 913, + EndLine: 41, + StartPos: 906, + EndPos: 913, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 41, - EndLine: 41, - StartPos: 906, - EndPos: 909, + EndLine: 41, + StartPos: 906, + EndPos: 909, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 41, - EndLine: 41, - StartPos: 906, - EndPos: 909, + EndLine: 41, + StartPos: 906, + EndPos: 909, }, Value: "var", }, @@ -2471,16 +2478,16 @@ func TestPhp7(t *testing.T) { Dim: &expr.UnaryMinus{ Position: &position.Position{ StartLine: 41, - EndLine: 41, - StartPos: 911, - EndPos: 912, + EndLine: 41, + StartPos: 911, + EndPos: 912, }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 41, - EndLine: 41, - StartPos: 911, - EndPos: 912, + EndLine: 41, + StartPos: 911, + EndPos: 912, }, Value: "1", }, @@ -2492,47 +2499,47 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 42, - EndLine: 42, - StartPos: 919, - EndPos: 972, + EndLine: 42, + StartPos: 919, + EndPos: 972, }, Expr: &scalar.Encapsed{ Position: &position.Position{ StartLine: 42, - EndLine: 42, - StartPos: 919, - EndPos: 971, + EndLine: 42, + StartPos: 919, + EndPos: 971, }, Parts: []node.Node{ &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 42, - EndLine: 42, - StartPos: 920, - EndPos: 924, + EndLine: 42, + StartPos: 920, + EndPos: 924, }, Value: "test ", }, &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 42, - EndLine: 42, - StartPos: 925, - EndPos: 970, + EndLine: 42, + StartPos: 925, + EndPos: 970, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 42, - EndLine: 42, - StartPos: 925, - EndPos: 928, + EndLine: 42, + StartPos: 925, + EndPos: 928, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 42, - EndLine: 42, - StartPos: 925, - EndPos: 928, + EndLine: 42, + StartPos: 925, + EndPos: 928, }, Value: "var", }, @@ -2540,9 +2547,9 @@ func TestPhp7(t *testing.T) { Dim: &scalar.String{ Position: &position.Position{ StartLine: 42, - EndLine: 42, - StartPos: 930, - EndPos: 969, + EndLine: 42, + StartPos: 930, + EndPos: 969, }, Value: "1234567890123456789012345678901234567890", }, @@ -2553,47 +2560,47 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 43, - EndLine: 43, - StartPos: 976, - EndPos: 1030, + EndLine: 43, + StartPos: 976, + EndPos: 1030, }, Expr: &scalar.Encapsed{ Position: &position.Position{ StartLine: 43, - EndLine: 43, - StartPos: 976, - EndPos: 1029, + EndLine: 43, + StartPos: 976, + EndPos: 1029, }, Parts: []node.Node{ &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 43, - EndLine: 43, - StartPos: 977, - EndPos: 981, + EndLine: 43, + StartPos: 977, + EndPos: 981, }, Value: "test ", }, &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 43, - EndLine: 43, - StartPos: 982, - EndPos: 1028, + EndLine: 43, + StartPos: 982, + EndPos: 1028, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 43, - EndLine: 43, - StartPos: 982, - EndPos: 985, + EndLine: 43, + StartPos: 982, + EndPos: 985, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 43, - EndLine: 43, - StartPos: 982, - EndPos: 985, + EndLine: 43, + StartPos: 982, + EndPos: 985, }, Value: "var", }, @@ -2601,9 +2608,9 @@ func TestPhp7(t *testing.T) { Dim: &scalar.String{ Position: &position.Position{ StartLine: 43, - EndLine: 43, - StartPos: 987, - EndPos: 1027, + EndLine: 43, + StartPos: 987, + EndPos: 1027, }, Value: "-1234567890123456789012345678901234567890", }, @@ -2614,47 +2621,47 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 44, - EndLine: 44, - StartPos: 1034, - EndPos: 1050, + EndLine: 44, + StartPos: 1034, + EndPos: 1050, }, Expr: &scalar.Encapsed{ Position: &position.Position{ StartLine: 44, - EndLine: 44, - StartPos: 1034, - EndPos: 1049, + EndLine: 44, + StartPos: 1034, + EndPos: 1049, }, Parts: []node.Node{ &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 44, - EndLine: 44, - StartPos: 1035, - EndPos: 1039, + EndLine: 44, + StartPos: 1035, + EndPos: 1039, }, Value: "test ", }, &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 44, - EndLine: 44, - StartPos: 1040, - EndPos: 1048, + EndLine: 44, + StartPos: 1040, + EndPos: 1048, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 44, - EndLine: 44, - StartPos: 1040, - EndPos: 1043, + EndLine: 44, + StartPos: 1040, + EndPos: 1043, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 44, - EndLine: 44, - StartPos: 1040, - EndPos: 1043, + EndLine: 44, + StartPos: 1040, + EndPos: 1043, }, Value: "var", }, @@ -2662,9 +2669,9 @@ func TestPhp7(t *testing.T) { Dim: &scalar.String{ Position: &position.Position{ StartLine: 44, - EndLine: 44, - StartPos: 1045, - EndPos: 1047, + EndLine: 44, + StartPos: 1045, + EndPos: 1047, }, Value: "bar", }, @@ -2675,47 +2682,47 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 45, - EndLine: 45, - StartPos: 1054, - EndPos: 1071, + EndLine: 45, + StartPos: 1054, + EndPos: 1071, }, Expr: &scalar.Encapsed{ Position: &position.Position{ StartLine: 45, - EndLine: 45, - StartPos: 1054, - EndPos: 1070, + EndLine: 45, + StartPos: 1054, + EndPos: 1070, }, Parts: []node.Node{ &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 45, - EndLine: 45, - StartPos: 1055, - EndPos: 1059, + EndLine: 45, + StartPos: 1055, + EndPos: 1059, }, Value: "test ", }, &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 45, - EndLine: 45, - StartPos: 1060, - EndPos: 1069, + EndLine: 45, + StartPos: 1060, + EndPos: 1069, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 45, - EndLine: 45, - StartPos: 1060, - EndPos: 1063, + EndLine: 45, + StartPos: 1060, + EndPos: 1063, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 45, - EndLine: 45, - StartPos: 1060, - EndPos: 1063, + EndLine: 45, + StartPos: 1060, + EndPos: 1063, }, Value: "var", }, @@ -2723,16 +2730,16 @@ func TestPhp7(t *testing.T) { Dim: &expr.Variable{ Position: &position.Position{ StartLine: 45, - EndLine: 45, - StartPos: 1065, - EndPos: 1068, + EndLine: 45, + StartPos: 1065, + EndPos: 1068, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 45, - EndLine: 45, - StartPos: 1065, - EndPos: 1068, + EndLine: 45, + StartPos: 1065, + EndPos: 1068, }, Value: "bar", }, @@ -2744,31 +2751,31 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 46, - EndLine: 46, - StartPos: 1075, - EndPos: 1086, + EndLine: 46, + StartPos: 1075, + EndPos: 1086, }, Expr: &scalar.Encapsed{ Position: &position.Position{ StartLine: 46, - EndLine: 46, - StartPos: 1075, - EndPos: 1085, + EndLine: 46, + StartPos: 1075, + EndPos: 1085, }, Parts: []node.Node{ &expr.Variable{ Position: &position.Position{ StartLine: 46, - EndLine: 46, - StartPos: 1076, - EndPos: 1079, + EndLine: 46, + StartPos: 1076, + EndPos: 1079, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 46, - EndLine: 46, - StartPos: 1076, - EndPos: 1079, + EndLine: 46, + StartPos: 1076, + EndPos: 1079, }, Value: "foo", }, @@ -2776,25 +2783,25 @@ func TestPhp7(t *testing.T) { &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 46, - EndLine: 46, - StartPos: 1080, - EndPos: 1080, + EndLine: 46, + StartPos: 1080, + EndPos: 1080, }, Value: " ", }, &expr.Variable{ Position: &position.Position{ StartLine: 46, - EndLine: 46, - StartPos: 1081, - EndPos: 1084, + EndLine: 46, + StartPos: 1081, + EndPos: 1084, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 46, - EndLine: 46, - StartPos: 1081, - EndPos: 1084, + EndLine: 46, + StartPos: 1081, + EndPos: 1084, }, Value: "bar", }, @@ -2805,47 +2812,47 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 47, - EndLine: 47, - StartPos: 1090, - EndPos: 1108, + EndLine: 47, + StartPos: 1090, + EndPos: 1108, }, Expr: &scalar.Encapsed{ Position: &position.Position{ StartLine: 47, - EndLine: 47, - StartPos: 1090, - EndPos: 1107, + EndLine: 47, + StartPos: 1090, + EndPos: 1107, }, Parts: []node.Node{ &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 47, - EndLine: 47, - StartPos: 1091, - EndPos: 1095, + EndLine: 47, + StartPos: 1091, + EndPos: 1095, }, Value: "test ", }, &expr.PropertyFetch{ Position: &position.Position{ StartLine: 47, - EndLine: 47, - StartPos: 1096, - EndPos: 1104, + EndLine: 47, + StartPos: 1096, + EndPos: 1104, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 47, - EndLine: 47, - StartPos: 1096, - EndPos: 1099, + EndLine: 47, + StartPos: 1096, + EndPos: 1099, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 47, - EndLine: 47, - StartPos: 1096, - EndPos: 1099, + EndLine: 47, + StartPos: 1096, + EndPos: 1099, }, Value: "foo", }, @@ -2853,9 +2860,9 @@ func TestPhp7(t *testing.T) { Property: &node.Identifier{ Position: &position.Position{ StartLine: 47, - EndLine: 47, - StartPos: 1102, - EndPos: 1104, + EndLine: 47, + StartPos: 1102, + EndPos: 1104, }, Value: "bar", }, @@ -2863,9 +2870,9 @@ func TestPhp7(t *testing.T) { &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 47, - EndLine: 47, - StartPos: 1105, - EndPos: 1106, + EndLine: 47, + StartPos: 1105, + EndPos: 1106, }, Value: "()", }, @@ -2875,40 +2882,40 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 48, - EndLine: 48, - StartPos: 1112, - EndPos: 1125, + EndLine: 48, + StartPos: 1112, + EndPos: 1125, }, Expr: &scalar.Encapsed{ Position: &position.Position{ StartLine: 48, - EndLine: 48, - StartPos: 1112, - EndPos: 1124, + EndLine: 48, + StartPos: 1112, + EndPos: 1124, }, Parts: []node.Node{ &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 48, - EndLine: 48, - StartPos: 1113, - EndPos: 1117, + EndLine: 48, + StartPos: 1113, + EndPos: 1117, }, Value: "test ", }, &expr.Variable{ Position: &position.Position{ StartLine: 48, - EndLine: 48, - StartPos: 1118, - EndPos: 1123, + EndLine: 48, + StartPos: 1118, + EndPos: 1123, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 48, - EndLine: 48, - StartPos: 1120, - EndPos: 1122, + EndLine: 48, + StartPos: 1120, + EndPos: 1122, }, Value: "foo", }, @@ -2919,47 +2926,47 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 49, - EndLine: 49, - StartPos: 1129, - EndPos: 1145, + EndLine: 49, + StartPos: 1129, + EndPos: 1145, }, Expr: &scalar.Encapsed{ Position: &position.Position{ StartLine: 49, - EndLine: 49, - StartPos: 1129, - EndPos: 1144, + EndLine: 49, + StartPos: 1129, + EndPos: 1144, }, Parts: []node.Node{ &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 49, - EndLine: 49, - StartPos: 1130, - EndPos: 1134, + EndLine: 49, + StartPos: 1130, + EndPos: 1134, }, Value: "test ", }, &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 49, - EndLine: 49, - StartPos: 1135, - EndPos: 1143, + EndLine: 49, + StartPos: 1135, + EndPos: 1143, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 49, - EndLine: 49, - StartPos: 1137, - EndPos: 1139, + EndLine: 49, + StartPos: 1137, + EndPos: 1139, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 49, - EndLine: 49, - StartPos: 1137, - EndPos: 1139, + EndLine: 49, + StartPos: 1137, + EndPos: 1139, }, Value: "foo", }, @@ -2967,9 +2974,9 @@ func TestPhp7(t *testing.T) { Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 49, - EndLine: 49, - StartPos: 1141, - EndPos: 1141, + EndLine: 49, + StartPos: 1141, + EndPos: 1141, }, Value: "0", }, @@ -2980,47 +2987,47 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 50, - EndLine: 50, - StartPos: 1149, - EndPos: 1163, + EndLine: 50, + StartPos: 1149, + EndPos: 1163, }, Expr: &scalar.Encapsed{ Position: &position.Position{ StartLine: 50, - EndLine: 50, - StartPos: 1149, - EndPos: 1162, + EndLine: 50, + StartPos: 1149, + EndPos: 1162, }, Parts: []node.Node{ &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 50, - EndLine: 50, - StartPos: 1150, - EndPos: 1154, + EndLine: 50, + StartPos: 1150, + EndPos: 1154, }, Value: "test ", }, &expr.Variable{ Position: &position.Position{ StartLine: 50, - EndLine: 50, - StartPos: 1155, - EndPos: 1161, + EndLine: 50, + StartPos: 1155, + EndPos: 1161, }, VarName: &expr.Variable{ Position: &position.Position{ StartLine: 50, - EndLine: 50, - StartPos: 1157, - EndPos: 1160, + EndLine: 50, + StartPos: 1157, + EndPos: 1160, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 50, - EndLine: 50, - StartPos: 1157, - EndPos: 1160, + EndLine: 50, + StartPos: 1157, + EndPos: 1160, }, Value: "foo", }, @@ -3032,47 +3039,47 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 51, - EndLine: 51, - StartPos: 1167, - EndPos: 1187, + EndLine: 51, + StartPos: 1167, + EndPos: 1187, }, Expr: &scalar.Encapsed{ Position: &position.Position{ StartLine: 51, - EndLine: 51, - StartPos: 1167, - EndPos: 1186, + EndLine: 51, + StartPos: 1167, + EndPos: 1186, }, Parts: []node.Node{ &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 51, - EndLine: 51, - StartPos: 1168, - EndPos: 1172, + EndLine: 51, + StartPos: 1168, + EndPos: 1172, }, Value: "test ", }, &expr.MethodCall{ Position: &position.Position{ StartLine: 51, - EndLine: 51, - StartPos: 1174, - EndPos: 1184, + EndLine: 51, + StartPos: 1174, + EndPos: 1184, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 51, - EndLine: 51, - StartPos: 1174, - EndPos: 1177, + EndLine: 51, + StartPos: 1174, + EndPos: 1177, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 51, - EndLine: 51, - StartPos: 1174, - EndPos: 1177, + EndLine: 51, + StartPos: 1174, + EndPos: 1177, }, Value: "foo", }, @@ -3080,18 +3087,18 @@ func TestPhp7(t *testing.T) { Method: &node.Identifier{ Position: &position.Position{ StartLine: 51, - EndLine: 51, - StartPos: 1180, - EndPos: 1182, + EndLine: 51, + StartPos: 1180, + EndPos: 1182, }, Value: "bar", }, ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 51, - EndLine: 51, - StartPos: 1183, - EndPos: 1184, + EndLine: 51, + StartPos: 1183, + EndPos: 1184, }, }, }, @@ -3101,23 +3108,23 @@ func TestPhp7(t *testing.T) { &stmt.AltIf{ Position: &position.Position{ StartLine: 53, - EndLine: 54, - StartPos: 1192, - EndPos: 1209, + EndLine: 54, + StartPos: 1192, + EndPos: 1209, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 53, - EndLine: 53, - StartPos: 1196, - EndPos: 1197, + EndLine: 53, + StartPos: 1196, + EndPos: 1197, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 53, - EndLine: 53, - StartPos: 1196, - EndPos: 1197, + EndLine: 53, + StartPos: 1196, + EndPos: 1197, }, Value: "a", }, @@ -3125,34 +3132,33 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - Stmts: []node.Node{ + EndLine: -1, + StartPos: -1, + EndPos: -1, }, + Stmts: []node.Node{}, }, }, &stmt.AltIf{ Position: &position.Position{ StartLine: 55, - EndLine: 57, - StartPos: 1213, - EndPos: 1245, + EndLine: 57, + StartPos: 1213, + EndPos: 1245, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 55, - EndLine: 55, - StartPos: 1217, - EndPos: 1218, + EndLine: 55, + StartPos: 1217, + EndPos: 1218, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 55, - EndLine: 55, - StartPos: 1217, - EndPos: 1218, + EndLine: 55, + StartPos: 1217, + EndPos: 1218, }, Value: "a", }, @@ -3160,34 +3166,33 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - Stmts: []node.Node{ + EndLine: -1, + StartPos: -1, + EndPos: -1, }, + Stmts: []node.Node{}, }, ElseIf: []node.Node{ &stmt.AltElseIf{ Position: &position.Position{ StartLine: 56, - EndLine: -1, - StartPos: 1225, - EndPos: -1, + EndLine: -1, + StartPos: 1225, + EndPos: -1, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 56, - EndLine: 56, - StartPos: 1233, - EndPos: 1234, + EndLine: 56, + StartPos: 1233, + EndPos: 1234, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 56, - EndLine: 56, - StartPos: 1233, - EndPos: 1234, + EndLine: 56, + StartPos: 1233, + EndPos: 1234, }, Value: "b", }, @@ -3195,12 +3200,11 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - Stmts: []node.Node{ + EndLine: -1, + StartPos: -1, + EndPos: -1, }, + Stmts: []node.Node{}, }, }, }, @@ -3208,23 +3212,23 @@ func TestPhp7(t *testing.T) { &stmt.AltIf{ Position: &position.Position{ StartLine: 58, - EndLine: 60, - StartPos: 1249, - EndPos: 1274, + EndLine: 60, + StartPos: 1249, + EndPos: 1274, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 58, - EndLine: 58, - StartPos: 1253, - EndPos: 1254, + EndLine: 58, + StartPos: 1253, + EndPos: 1254, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 58, - EndLine: 58, - StartPos: 1253, - EndPos: 1254, + EndLine: 58, + StartPos: 1253, + EndPos: 1254, }, Value: "a", }, @@ -3232,52 +3236,50 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - Stmts: []node.Node{ + EndLine: -1, + StartPos: -1, + EndPos: -1, }, + Stmts: []node.Node{}, }, Else: &stmt.AltElse{ Position: &position.Position{ StartLine: 59, - EndLine: -1, - StartPos: 1261, - EndPos: -1, + EndLine: -1, + StartPos: 1261, + EndPos: -1, }, Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - Stmts: []node.Node{ + EndLine: -1, + StartPos: -1, + EndPos: -1, }, + Stmts: []node.Node{}, }, }, }, &stmt.AltIf{ Position: &position.Position{ StartLine: 61, - EndLine: 65, - StartPos: 1278, - EndPos: 1333, + EndLine: 65, + StartPos: 1278, + EndPos: 1333, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 61, - EndLine: 61, - StartPos: 1282, - EndPos: 1283, + EndLine: 61, + StartPos: 1282, + EndPos: 1283, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 61, - EndLine: 61, - StartPos: 1282, - EndPos: 1283, + EndLine: 61, + StartPos: 1282, + EndPos: 1283, }, Value: "a", }, @@ -3285,34 +3287,33 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - Stmts: []node.Node{ + EndLine: -1, + StartPos: -1, + EndPos: -1, }, + Stmts: []node.Node{}, }, ElseIf: []node.Node{ &stmt.AltElseIf{ Position: &position.Position{ StartLine: 62, - EndLine: -1, - StartPos: 1290, - EndPos: -1, + EndLine: -1, + StartPos: 1290, + EndPos: -1, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 62, - EndLine: 62, - StartPos: 1298, - EndPos: 1299, + EndLine: 62, + StartPos: 1298, + EndPos: 1299, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 62, - EndLine: 62, - StartPos: 1298, - EndPos: 1299, + EndLine: 62, + StartPos: 1298, + EndPos: 1299, }, Value: "b", }, @@ -3320,34 +3321,33 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - Stmts: []node.Node{ + EndLine: -1, + StartPos: -1, + EndPos: -1, }, + Stmts: []node.Node{}, }, }, &stmt.AltElseIf{ Position: &position.Position{ StartLine: 63, - EndLine: -1, - StartPos: 1305, - EndPos: -1, + EndLine: -1, + StartPos: 1305, + EndPos: -1, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 63, - EndLine: 63, - StartPos: 1313, - EndPos: 1314, + EndLine: 63, + StartPos: 1313, + EndPos: 1314, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 63, - EndLine: 63, - StartPos: 1313, - EndPos: 1314, + EndLine: 63, + StartPos: 1313, + EndPos: 1314, }, Value: "c", }, @@ -3355,64 +3355,62 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - Stmts: []node.Node{ + EndLine: -1, + StartPos: -1, + EndPos: -1, }, + Stmts: []node.Node{}, }, }, }, Else: &stmt.AltElse{ Position: &position.Position{ StartLine: 64, - EndLine: -1, - StartPos: 1320, - EndPos: -1, + EndLine: -1, + StartPos: 1320, + EndPos: -1, }, Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - Stmts: []node.Node{ + EndLine: -1, + StartPos: -1, + EndPos: -1, }, + Stmts: []node.Node{}, }, }, }, &stmt.While{ Position: &position.Position{ StartLine: 67, - EndLine: 67, - StartPos: 1338, - EndPos: 1357, + EndLine: 67, + StartPos: 1338, + EndPos: 1357, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 67, - EndLine: 67, - StartPos: 1345, - EndPos: 1345, + EndLine: 67, + StartPos: 1345, + EndPos: 1345, }, Value: "1", }, Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 67, - EndLine: 67, - StartPos: 1348, - EndPos: 1357, + EndLine: 67, + StartPos: 1348, + EndPos: 1357, }, Stmts: []node.Node{ &stmt.Break{ Position: &position.Position{ StartLine: 67, - EndLine: 67, - StartPos: 1350, - EndPos: 1355, + EndLine: 67, + StartPos: 1350, + EndPos: 1355, }, }, }, @@ -3421,40 +3419,40 @@ func TestPhp7(t *testing.T) { &stmt.While{ Position: &position.Position{ StartLine: 68, - EndLine: 68, - StartPos: 1361, - EndPos: 1382, + EndLine: 68, + StartPos: 1361, + EndPos: 1382, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 68, - EndLine: 68, - StartPos: 1368, - EndPos: 1368, + EndLine: 68, + StartPos: 1368, + EndPos: 1368, }, Value: "1", }, Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 68, - EndLine: 68, - StartPos: 1371, - EndPos: 1382, + EndLine: 68, + StartPos: 1371, + EndPos: 1382, }, Stmts: []node.Node{ &stmt.Break{ Position: &position.Position{ StartLine: 68, - EndLine: 68, - StartPos: 1373, - EndPos: 1380, + EndLine: 68, + StartPos: 1373, + EndPos: 1380, }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 68, - EndLine: 68, - StartPos: 1379, - EndPos: 1379, + EndLine: 68, + StartPos: 1379, + EndPos: 1379, }, Value: "2", }, @@ -3465,40 +3463,40 @@ func TestPhp7(t *testing.T) { &stmt.AltWhile{ Position: &position.Position{ StartLine: 69, - EndLine: 69, - StartPos: 1386, - EndPos: 1416, + EndLine: 69, + StartPos: 1386, + EndPos: 1416, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 69, - EndLine: 69, - StartPos: 1393, - EndPos: 1393, + EndLine: 69, + StartPos: 1393, + EndPos: 1393, }, Value: "1", }, Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 69, - EndLine: 69, - StartPos: 1398, - EndPos: 1406, + EndLine: 69, + StartPos: 1398, + EndPos: 1406, }, Stmts: []node.Node{ &stmt.Break{ Position: &position.Position{ StartLine: 69, - EndLine: 69, - StartPos: 1398, - EndPos: 1406, + EndLine: 69, + StartPos: 1398, + EndPos: 1406, }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 69, - EndLine: 69, - StartPos: 1404, - EndPos: 1404, + EndLine: 69, + StartPos: 1404, + EndPos: 1404, }, Value: "3", }, @@ -3509,17 +3507,17 @@ func TestPhp7(t *testing.T) { &stmt.Class{ Position: &position.Position{ StartLine: 70, - EndLine: 70, - StartPos: 1420, - EndPos: 1462, + EndLine: 70, + StartPos: 1420, + EndPos: 1462, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 70, - EndLine: 70, - StartPos: 1426, - EndPos: 1428, + EndLine: 70, + StartPos: 1426, + EndPos: 1428, }, Value: "foo", }, @@ -3527,17 +3525,17 @@ func TestPhp7(t *testing.T) { &stmt.ClassConstList{ Position: &position.Position{ StartLine: 70, - EndLine: 70, - StartPos: 1431, - EndPos: 1460, + EndLine: 70, + StartPos: 1431, + EndPos: 1460, }, Modifiers: []node.Node{ &node.Identifier{ Position: &position.Position{ StartLine: 70, - EndLine: 70, - StartPos: 1431, - EndPos: 1436, + EndLine: 70, + StartPos: 1431, + EndPos: 1436, }, Value: "public", }, @@ -3546,26 +3544,26 @@ func TestPhp7(t *testing.T) { &stmt.Constant{ Position: &position.Position{ StartLine: 70, - EndLine: 70, - StartPos: 1444, - EndPos: 1450, + EndLine: 70, + StartPos: 1444, + EndPos: 1450, }, PhpDocComment: "", ConstantName: &node.Identifier{ Position: &position.Position{ StartLine: 70, - EndLine: 70, - StartPos: 1444, - EndPos: 1446, + EndLine: 70, + StartPos: 1444, + EndPos: 1446, }, Value: "FOO", }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 70, - EndLine: 70, - StartPos: 1450, - EndPos: 1450, + EndLine: 70, + StartPos: 1450, + EndPos: 1450, }, Value: "1", }, @@ -3573,26 +3571,26 @@ func TestPhp7(t *testing.T) { &stmt.Constant{ Position: &position.Position{ StartLine: 70, - EndLine: 70, - StartPos: 1453, - EndPos: 1459, + EndLine: 70, + StartPos: 1453, + EndPos: 1459, }, PhpDocComment: "", ConstantName: &node.Identifier{ Position: &position.Position{ StartLine: 70, - EndLine: 70, - StartPos: 1453, - EndPos: 1455, + EndLine: 70, + StartPos: 1453, + EndPos: 1455, }, Value: "BAR", }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 70, - EndLine: 70, - StartPos: 1459, - EndPos: 1459, + EndLine: 70, + StartPos: 1459, + EndPos: 1459, }, Value: "2", }, @@ -3604,17 +3602,17 @@ func TestPhp7(t *testing.T) { &stmt.Class{ Position: &position.Position{ StartLine: 71, - EndLine: 71, - StartPos: 1466, - EndPos: 1501, + EndLine: 71, + StartPos: 1466, + EndPos: 1501, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 71, - EndLine: 71, - StartPos: 1472, - EndPos: 1474, + EndLine: 71, + StartPos: 1472, + EndPos: 1474, }, Value: "foo", }, @@ -3622,34 +3620,34 @@ func TestPhp7(t *testing.T) { &stmt.ClassConstList{ Position: &position.Position{ StartLine: 71, - EndLine: 71, - StartPos: 1477, - EndPos: 1499, + EndLine: 71, + StartPos: 1477, + EndPos: 1499, }, Consts: []node.Node{ &stmt.Constant{ Position: &position.Position{ StartLine: 71, - EndLine: 71, - StartPos: 1483, - EndPos: 1489, + EndLine: 71, + StartPos: 1483, + EndPos: 1489, }, PhpDocComment: "", ConstantName: &node.Identifier{ Position: &position.Position{ StartLine: 71, - EndLine: 71, - StartPos: 1483, - EndPos: 1485, + EndLine: 71, + StartPos: 1483, + EndPos: 1485, }, Value: "FOO", }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 71, - EndLine: 71, - StartPos: 1489, - EndPos: 1489, + EndLine: 71, + StartPos: 1489, + EndPos: 1489, }, Value: "1", }, @@ -3657,26 +3655,26 @@ func TestPhp7(t *testing.T) { &stmt.Constant{ Position: &position.Position{ StartLine: 71, - EndLine: 71, - StartPos: 1492, - EndPos: 1498, + EndLine: 71, + StartPos: 1492, + EndPos: 1498, }, PhpDocComment: "", ConstantName: &node.Identifier{ Position: &position.Position{ StartLine: 71, - EndLine: 71, - StartPos: 1492, - EndPos: 1494, + EndLine: 71, + StartPos: 1492, + EndPos: 1494, }, Value: "BAR", }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 71, - EndLine: 71, - StartPos: 1498, - EndPos: 1498, + EndLine: 71, + StartPos: 1498, + EndPos: 1498, }, Value: "2", }, @@ -3688,17 +3686,17 @@ func TestPhp7(t *testing.T) { &stmt.Class{ Position: &position.Position{ StartLine: 72, - EndLine: 72, - StartPos: 1505, - EndPos: 1534, + EndLine: 72, + StartPos: 1505, + EndPos: 1534, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 72, - EndLine: 72, - StartPos: 1511, - EndPos: 1513, + EndLine: 72, + StartPos: 1511, + EndPos: 1513, }, Value: "foo", }, @@ -3706,30 +3704,29 @@ func TestPhp7(t *testing.T) { &stmt.ClassMethod{ Position: &position.Position{ StartLine: 72, - EndLine: 72, - StartPos: 1516, - EndPos: 1532, + EndLine: 72, + StartPos: 1516, + EndPos: 1532, }, - ReturnsRef: false, + ReturnsRef: false, PhpDocComment: "", MethodName: &node.Identifier{ Position: &position.Position{ StartLine: 72, - EndLine: 72, - StartPos: 1525, - EndPos: 1527, + EndLine: 72, + StartPos: 1525, + EndPos: 1527, }, Value: "bar", }, Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 72, - EndLine: 72, - StartPos: 1531, - EndPos: 1532, - }, - Stmts: []node.Node{ + EndLine: 72, + StartPos: 1531, + EndPos: 1532, }, + Stmts: []node.Node{}, }, }, }, @@ -3737,17 +3734,17 @@ func TestPhp7(t *testing.T) { &stmt.Class{ Position: &position.Position{ StartLine: 73, - EndLine: 73, - StartPos: 1538, - EndPos: 1582, + EndLine: 73, + StartPos: 1538, + EndPos: 1582, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 73, - EndLine: 73, - StartPos: 1544, - EndPos: 1546, + EndLine: 73, + StartPos: 1544, + EndPos: 1546, }, Value: "foo", }, @@ -3755,18 +3752,18 @@ func TestPhp7(t *testing.T) { &stmt.ClassMethod{ Position: &position.Position{ StartLine: 73, - EndLine: 73, - StartPos: 1549, - EndPos: 1580, + EndLine: 73, + StartPos: 1549, + EndPos: 1580, }, - ReturnsRef: true, PhpDocComment: "", + ReturnsRef: true, MethodName: &node.Identifier{ Position: &position.Position{ StartLine: 73, - EndLine: 73, - StartPos: 1573, - EndPos: 1575, + EndLine: 73, + StartPos: 1573, + EndPos: 1575, }, Value: "bar", }, @@ -3774,18 +3771,18 @@ func TestPhp7(t *testing.T) { &node.Identifier{ Position: &position.Position{ StartLine: 73, - EndLine: 73, - StartPos: 1549, - EndPos: 1554, + EndLine: 73, + StartPos: 1549, + EndPos: 1554, }, Value: "public", }, &node.Identifier{ Position: &position.Position{ StartLine: 73, - EndLine: 73, - StartPos: 1556, - EndPos: 1561, + EndLine: 73, + StartPos: 1556, + EndPos: 1561, }, Value: "static", }, @@ -3793,12 +3790,11 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 73, - EndLine: 73, - StartPos: 1579, - EndPos: 1580, - }, - Stmts: []node.Node{ + EndLine: 73, + StartPos: 1579, + EndPos: 1580, }, + Stmts: []node.Node{}, }, }, }, @@ -3806,17 +3802,17 @@ func TestPhp7(t *testing.T) { &stmt.Class{ Position: &position.Position{ StartLine: 74, - EndLine: 74, - StartPos: 1586, - EndPos: 1636, + EndLine: 74, + StartPos: 1586, + EndPos: 1636, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 74, - EndLine: 74, - StartPos: 1592, - EndPos: 1594, + EndLine: 74, + StartPos: 1592, + EndPos: 1594, }, Value: "foo", }, @@ -3824,18 +3820,18 @@ func TestPhp7(t *testing.T) { &stmt.ClassMethod{ Position: &position.Position{ StartLine: 74, - EndLine: 74, - StartPos: 1597, - EndPos: 1634, + EndLine: 74, + StartPos: 1597, + EndPos: 1634, }, - ReturnsRef: true, + ReturnsRef: true, PhpDocComment: "", MethodName: &node.Identifier{ Position: &position.Position{ StartLine: 74, - EndLine: 74, - StartPos: 1621, - EndPos: 1623, + EndLine: 74, + StartPos: 1621, + EndPos: 1623, }, Value: "bar", }, @@ -3843,18 +3839,18 @@ func TestPhp7(t *testing.T) { &node.Identifier{ Position: &position.Position{ StartLine: 74, - EndLine: 74, - StartPos: 1597, - EndPos: 1602, + EndLine: 74, + StartPos: 1597, + EndPos: 1602, }, Value: "public", }, &node.Identifier{ Position: &position.Position{ StartLine: 74, - EndLine: 74, - StartPos: 1604, - EndPos: 1609, + EndLine: 74, + StartPos: 1604, + EndPos: 1609, }, Value: "static", }, @@ -3862,17 +3858,17 @@ func TestPhp7(t *testing.T) { ReturnType: &name.Name{ Position: &position.Position{ StartLine: 74, - EndLine: 74, - StartPos: 1628, - EndPos: 1631, + EndLine: 74, + StartPos: 1628, + EndPos: 1631, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 74, - EndLine: 74, - StartPos: 1628, - EndPos: 1631, + EndLine: 74, + StartPos: 1628, + EndPos: 1631, }, Value: "void", }, @@ -3881,12 +3877,11 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 74, - EndLine: 74, - StartPos: 1633, - EndPos: 1634, - }, - Stmts: []node.Node{ + EndLine: 74, + StartPos: 1633, + EndPos: 1634, }, + Stmts: []node.Node{}, }, }, }, @@ -3894,17 +3889,17 @@ func TestPhp7(t *testing.T) { &stmt.Class{ Position: &position.Position{ StartLine: 75, - EndLine: 75, - StartPos: 1640, - EndPos: 1660, + EndLine: 75, + StartPos: 1640, + EndPos: 1660, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 75, - EndLine: 75, - StartPos: 1655, - EndPos: 1657, + EndLine: 75, + StartPos: 1655, + EndPos: 1657, }, Value: "foo", }, @@ -3912,30 +3907,29 @@ func TestPhp7(t *testing.T) { &node.Identifier{ Position: &position.Position{ StartLine: 75, - EndLine: 75, - StartPos: 1640, - EndPos: 1647, + EndLine: 75, + StartPos: 1640, + EndPos: 1647, }, Value: "abstract", }, }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, &stmt.Class{ Position: &position.Position{ StartLine: 76, - EndLine: 76, - StartPos: 1664, - EndPos: 1694, + EndLine: 76, + StartPos: 1664, + EndPos: 1694, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 76, - EndLine: 76, - StartPos: 1676, - EndPos: 1678, + EndLine: 76, + StartPos: 1676, + EndPos: 1678, }, Value: "foo", }, @@ -3943,9 +3937,9 @@ func TestPhp7(t *testing.T) { &node.Identifier{ Position: &position.Position{ StartLine: 76, - EndLine: 76, - StartPos: 1664, - EndPos: 1668, + EndLine: 76, + StartPos: 1664, + EndPos: 1668, }, Value: "final", }, @@ -3953,47 +3947,46 @@ func TestPhp7(t *testing.T) { Extends: &stmt.ClassExtends{ Position: &position.Position{ StartLine: 76, - EndLine: 76, - StartPos: 1680, - EndPos: 1690, + EndLine: 76, + StartPos: 1680, + EndPos: 1690, }, ClassName: &name.Name{ Position: &position.Position{ StartLine: 76, - EndLine: 76, - StartPos: 1688, - EndPos: 1690, + EndLine: 76, + StartPos: 1688, + EndPos: 1690, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 76, - EndLine: 76, - StartPos: 1688, - EndPos: 1690, + EndLine: 76, + StartPos: 1688, + EndPos: 1690, }, Value: "bar", }, }, }, }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, &stmt.Class{ Position: &position.Position{ StartLine: 77, - EndLine: 77, - StartPos: 1698, - EndPos: 1731, + EndLine: 77, + StartPos: 1698, + EndPos: 1731, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 77, - EndLine: 77, - StartPos: 1710, - EndPos: 1712, + EndLine: 77, + StartPos: 1710, + EndPos: 1712, }, Value: "foo", }, @@ -4001,9 +3994,9 @@ func TestPhp7(t *testing.T) { &node.Identifier{ Position: &position.Position{ StartLine: 77, - EndLine: 77, - StartPos: 1698, - EndPos: 1702, + EndLine: 77, + StartPos: 1698, + EndPos: 1702, }, Value: "final", }, @@ -4011,25 +4004,25 @@ func TestPhp7(t *testing.T) { Implements: &stmt.ClassImplements{ Position: &position.Position{ StartLine: 77, - EndLine: 77, - StartPos: 1714, - EndPos: 1727, + EndLine: 77, + StartPos: 1714, + EndPos: 1727, }, InterfaceNames: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 77, - EndLine: 77, - StartPos: 1725, - EndPos: 1727, + EndLine: 77, + StartPos: 1725, + EndPos: 1727, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 77, - EndLine: 77, - StartPos: 1725, - EndPos: 1727, + EndLine: 77, + StartPos: 1725, + EndPos: 1727, }, Value: "bar", }, @@ -4037,23 +4030,22 @@ func TestPhp7(t *testing.T) { }, }, }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, &stmt.Class{ Position: &position.Position{ StartLine: 78, - EndLine: 78, - StartPos: 1735, - EndPos: 1773, + EndLine: 78, + StartPos: 1735, + EndPos: 1773, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 78, - EndLine: 78, - StartPos: 1747, - EndPos: 1749, + EndLine: 78, + StartPos: 1747, + EndPos: 1749, }, Value: "foo", }, @@ -4061,9 +4053,9 @@ func TestPhp7(t *testing.T) { &node.Identifier{ Position: &position.Position{ StartLine: 78, - EndLine: 78, - StartPos: 1735, - EndPos: 1739, + EndLine: 78, + StartPos: 1735, + EndPos: 1739, }, Value: "final", }, @@ -4071,25 +4063,25 @@ func TestPhp7(t *testing.T) { Implements: &stmt.ClassImplements{ Position: &position.Position{ StartLine: 78, - EndLine: 78, - StartPos: 1751, - EndPos: 1769, + EndLine: 78, + StartPos: 1751, + EndPos: 1769, }, InterfaceNames: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 78, - EndLine: 78, - StartPos: 1762, - EndPos: 1764, + EndLine: 78, + StartPos: 1762, + EndPos: 1764, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 78, - EndLine: 78, - StartPos: 1762, - EndPos: 1764, + EndLine: 78, + StartPos: 1762, + EndPos: 1764, }, Value: "bar", }, @@ -4098,17 +4090,17 @@ func TestPhp7(t *testing.T) { &name.Name{ Position: &position.Position{ StartLine: 78, - EndLine: 78, - StartPos: 1767, - EndPos: 1769, + EndLine: 78, + StartPos: 1767, + EndPos: 1769, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 78, - EndLine: 78, - StartPos: 1767, - EndPos: 1769, + EndLine: 78, + StartPos: 1767, + EndPos: 1769, }, Value: "baz", }, @@ -4116,60 +4108,59 @@ func TestPhp7(t *testing.T) { }, }, }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, &stmt.Expression{ Position: &position.Position{ StartLine: 79, - EndLine: 79, - StartPos: 1777, - EndPos: 1824, + EndLine: 79, + StartPos: 1777, + EndPos: 1824, }, Expr: &expr.New{ Position: &position.Position{ StartLine: 79, - EndLine: 79, - StartPos: 1777, - EndPos: 1823, + EndLine: 79, + StartPos: 1777, + EndPos: 1823, }, Class: &stmt.Class{ Position: &position.Position{ StartLine: 79, - EndLine: 79, - StartPos: 1781, - EndPos: 1823, + EndLine: 79, + StartPos: 1781, + EndPos: 1823, }, PhpDocComment: "", ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 79, - EndLine: 79, - StartPos: 1786, - EndPos: 1787, + EndLine: 79, + StartPos: 1786, + EndPos: 1787, }, }, Extends: &stmt.ClassExtends{ Position: &position.Position{ StartLine: 79, - EndLine: 79, - StartPos: 1789, - EndPos: 1799, + EndLine: 79, + StartPos: 1789, + EndPos: 1799, }, ClassName: &name.Name{ Position: &position.Position{ StartLine: 79, - EndLine: 79, - StartPos: 1797, - EndPos: 1799, + EndLine: 79, + StartPos: 1797, + EndPos: 1799, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 79, - EndLine: 79, - StartPos: 1797, - EndPos: 1799, + EndLine: 79, + StartPos: 1797, + EndPos: 1799, }, Value: "foo", }, @@ -4179,25 +4170,25 @@ func TestPhp7(t *testing.T) { Implements: &stmt.ClassImplements{ Position: &position.Position{ StartLine: 79, - EndLine: 79, - StartPos: 1801, - EndPos: 1819, + EndLine: 79, + StartPos: 1801, + EndPos: 1819, }, InterfaceNames: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 79, - EndLine: 79, - StartPos: 1812, - EndPos: 1814, + EndLine: 79, + StartPos: 1812, + EndPos: 1814, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 79, - EndLine: 79, - StartPos: 1812, - EndPos: 1814, + EndLine: 79, + StartPos: 1812, + EndPos: 1814, }, Value: "bar", }, @@ -4206,17 +4197,17 @@ func TestPhp7(t *testing.T) { &name.Name{ Position: &position.Position{ StartLine: 79, - EndLine: 79, - StartPos: 1817, - EndPos: 1819, + EndLine: 79, + StartPos: 1817, + EndPos: 1819, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 79, - EndLine: 79, - StartPos: 1817, - EndPos: 1819, + EndLine: 79, + StartPos: 1817, + EndPos: 1819, }, Value: "baz", }, @@ -4224,42 +4215,41 @@ func TestPhp7(t *testing.T) { }, }, }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, }, }, &stmt.ConstList{ Position: &position.Position{ StartLine: 81, - EndLine: 81, - StartPos: 1829, - EndPos: 1851, + EndLine: 81, + StartPos: 1829, + EndPos: 1851, }, Consts: []node.Node{ &stmt.Constant{ Position: &position.Position{ StartLine: 81, - EndLine: 81, - StartPos: 1835, - EndPos: 1841, + EndLine: 81, + StartPos: 1835, + EndPos: 1841, }, PhpDocComment: "", ConstantName: &node.Identifier{ Position: &position.Position{ StartLine: 81, - EndLine: 81, - StartPos: 1835, - EndPos: 1837, + EndLine: 81, + StartPos: 1835, + EndPos: 1837, }, Value: "FOO", }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 81, - EndLine: 81, - StartPos: 1841, - EndPos: 1841, + EndLine: 81, + StartPos: 1841, + EndPos: 1841, }, Value: "1", }, @@ -4267,26 +4257,26 @@ func TestPhp7(t *testing.T) { &stmt.Constant{ Position: &position.Position{ StartLine: 81, - EndLine: 81, - StartPos: 1844, - EndPos: 1850, + EndLine: 81, + StartPos: 1844, + EndPos: 1850, }, PhpDocComment: "", ConstantName: &node.Identifier{ Position: &position.Position{ StartLine: 81, - EndLine: 81, - StartPos: 1844, - EndPos: 1846, + EndLine: 81, + StartPos: 1844, + EndPos: 1846, }, Value: "BAR", }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 81, - EndLine: 81, - StartPos: 1850, - EndPos: 1850, + EndLine: 81, + StartPos: 1850, + EndPos: 1850, }, Value: "2", }, @@ -4296,33 +4286,33 @@ func TestPhp7(t *testing.T) { &stmt.While{ Position: &position.Position{ StartLine: 82, - EndLine: 82, - StartPos: 1855, - EndPos: 1877, + EndLine: 82, + StartPos: 1855, + EndPos: 1877, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 82, - EndLine: 82, - StartPos: 1862, - EndPos: 1862, + EndLine: 82, + StartPos: 1862, + EndPos: 1862, }, Value: "1", }, Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 82, - EndLine: 82, - StartPos: 1865, - EndPos: 1877, + EndLine: 82, + StartPos: 1865, + EndPos: 1877, }, Stmts: []node.Node{ &stmt.Continue{ Position: &position.Position{ StartLine: 82, - EndLine: 82, - StartPos: 1867, - EndPos: 1875, + EndLine: 82, + StartPos: 1867, + EndPos: 1875, }, }, }, @@ -4331,40 +4321,40 @@ func TestPhp7(t *testing.T) { &stmt.While{ Position: &position.Position{ StartLine: 83, - EndLine: 83, - StartPos: 1881, - EndPos: 1905, + EndLine: 83, + StartPos: 1881, + EndPos: 1905, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 83, - EndLine: 83, - StartPos: 1888, - EndPos: 1888, + EndLine: 83, + StartPos: 1888, + EndPos: 1888, }, Value: "1", }, Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 83, - EndLine: 83, - StartPos: 1891, - EndPos: 1905, + EndLine: 83, + StartPos: 1891, + EndPos: 1905, }, Stmts: []node.Node{ &stmt.Continue{ Position: &position.Position{ StartLine: 83, - EndLine: 83, - StartPos: 1893, - EndPos: 1903, + EndLine: 83, + StartPos: 1893, + EndPos: 1903, }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 83, - EndLine: 83, - StartPos: 1902, - EndPos: 1902, + EndLine: 83, + StartPos: 1902, + EndPos: 1902, }, Value: "2", }, @@ -4375,40 +4365,40 @@ func TestPhp7(t *testing.T) { &stmt.While{ Position: &position.Position{ StartLine: 84, - EndLine: 84, - StartPos: 1909, - EndPos: 1934, + EndLine: 84, + StartPos: 1909, + EndPos: 1934, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 84, - EndLine: 84, - StartPos: 1916, - EndPos: 1916, + EndLine: 84, + StartPos: 1916, + EndPos: 1916, }, Value: "1", }, Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 84, - EndLine: 84, - StartPos: 1919, - EndPos: 1934, + EndLine: 84, + StartPos: 1919, + EndPos: 1934, }, Stmts: []node.Node{ &stmt.Continue{ Position: &position.Position{ StartLine: 84, - EndLine: 84, - StartPos: 1921, - EndPos: 1932, + EndLine: 84, + StartPos: 1921, + EndPos: 1932, }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 84, - EndLine: 84, - StartPos: 1930, - EndPos: 1930, + EndLine: 84, + StartPos: 1930, + EndPos: 1930, }, Value: "3", }, @@ -4419,34 +4409,34 @@ func TestPhp7(t *testing.T) { &stmt.Declare{ Position: &position.Position{ StartLine: 85, - EndLine: 85, - StartPos: 1938, - EndPos: 1954, + EndLine: 85, + StartPos: 1938, + EndPos: 1954, }, Consts: []node.Node{ &stmt.Constant{ Position: &position.Position{ StartLine: 85, - EndLine: 85, - StartPos: 1946, - EndPos: 1952, + EndLine: 85, + StartPos: 1946, + EndPos: 1952, }, PhpDocComment: "", ConstantName: &node.Identifier{ Position: &position.Position{ StartLine: 85, - EndLine: 85, - StartPos: 1946, - EndPos: 1950, + EndLine: 85, + StartPos: 1946, + EndPos: 1950, }, Value: "ticks", }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 85, - EndLine: 85, - StartPos: 1952, - EndPos: 1952, + EndLine: 85, + StartPos: 1952, + EndPos: 1952, }, Value: "1", }, @@ -4455,43 +4445,43 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.Nop{ Position: &position.Position{ StartLine: 85, - EndLine: 85, - StartPos: 1954, - EndPos: 1954, + EndLine: 85, + StartPos: 1954, + EndPos: 1954, }, }, }, &stmt.Declare{ Position: &position.Position{ StartLine: 86, - EndLine: 86, - StartPos: 1958, - EndPos: 1976, + EndLine: 86, + StartPos: 1958, + EndPos: 1976, }, Consts: []node.Node{ &stmt.Constant{ Position: &position.Position{ StartLine: 86, - EndLine: 86, - StartPos: 1966, - EndPos: 1972, + EndLine: 86, + StartPos: 1966, + EndPos: 1972, }, PhpDocComment: "", ConstantName: &node.Identifier{ Position: &position.Position{ StartLine: 86, - EndLine: 86, - StartPos: 1966, - EndPos: 1970, + EndLine: 86, + StartPos: 1966, + EndPos: 1970, }, Value: "ticks", }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 86, - EndLine: 86, - StartPos: 1972, - EndPos: 1972, + EndLine: 86, + StartPos: 1972, + EndPos: 1972, }, Value: "1", }, @@ -4500,45 +4490,44 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 86, - EndLine: 86, - StartPos: 1975, - EndPos: 1976, - }, - Stmts: []node.Node{ + EndLine: 86, + StartPos: 1975, + EndPos: 1976, }, + Stmts: []node.Node{}, }, }, &stmt.Declare{ Position: &position.Position{ StartLine: 87, - EndLine: 87, - StartPos: 1980, - EndPos: 2008, + EndLine: 87, + StartPos: 1980, + EndPos: 2008, }, Consts: []node.Node{ &stmt.Constant{ Position: &position.Position{ StartLine: 87, - EndLine: 87, - StartPos: 1988, - EndPos: 1994, + EndLine: 87, + StartPos: 1988, + EndPos: 1994, }, PhpDocComment: "", ConstantName: &node.Identifier{ Position: &position.Position{ StartLine: 87, - EndLine: 87, - StartPos: 1988, - EndPos: 1992, + EndLine: 87, + StartPos: 1988, + EndPos: 1992, }, Value: "ticks", }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 87, - EndLine: 87, - StartPos: 1994, - EndPos: 1994, + EndLine: 87, + StartPos: 1994, + EndPos: 1994, }, Value: "1", }, @@ -4547,37 +4536,35 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 87, - EndLine: 87, - StartPos: 1996, - EndPos: 2008, - }, - Stmts: []node.Node{ + EndLine: 87, + StartPos: 1996, + EndPos: 2008, }, + Stmts: []node.Node{}, }, }, &stmt.Do{ Position: &position.Position{ StartLine: 88, - EndLine: 88, - StartPos: 2012, - EndPos: 2026, + EndLine: 88, + StartPos: 2012, + EndPos: 2026, }, Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 88, - EndLine: 88, - StartPos: 2015, - EndPos: 2016, - }, - Stmts: []node.Node{ + EndLine: 88, + StartPos: 2015, + EndPos: 2016, }, + Stmts: []node.Node{}, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 88, - EndLine: 88, - StartPos: 2024, - EndPos: 2024, + EndLine: 88, + StartPos: 2024, + EndPos: 2024, }, Value: "1", }, @@ -4585,24 +4572,24 @@ func TestPhp7(t *testing.T) { &stmt.Echo{ Position: &position.Position{ StartLine: 89, - EndLine: 89, - StartPos: 2030, - EndPos: 2040, + EndLine: 89, + StartPos: 2030, + EndPos: 2040, }, Exprs: []node.Node{ &expr.Variable{ Position: &position.Position{ StartLine: 89, - EndLine: 89, - StartPos: 2035, - EndPos: 2036, + EndLine: 89, + StartPos: 2035, + EndPos: 2036, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 89, - EndLine: 89, - StartPos: 2035, - EndPos: 2036, + EndLine: 89, + StartPos: 2035, + EndPos: 2036, }, Value: "a", }, @@ -4610,9 +4597,9 @@ func TestPhp7(t *testing.T) { &scalar.Lnumber{ Position: &position.Position{ StartLine: 89, - EndLine: 89, - StartPos: 2039, - EndPos: 2039, + EndLine: 89, + StartPos: 2039, + EndPos: 2039, }, Value: "1", }, @@ -4621,24 +4608,24 @@ func TestPhp7(t *testing.T) { &stmt.Echo{ Position: &position.Position{ StartLine: 90, - EndLine: 90, - StartPos: 2044, - EndPos: 2052, + EndLine: 90, + StartPos: 2044, + EndPos: 2052, }, Exprs: []node.Node{ &expr.Variable{ Position: &position.Position{ StartLine: 90, - EndLine: 90, - StartPos: 2049, - EndPos: 2050, + EndLine: 90, + StartPos: 2049, + EndPos: 2050, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 90, - EndLine: 90, - StartPos: 2049, - EndPos: 2050, + EndLine: 90, + StartPos: 2049, + EndPos: 2050, }, Value: "a", }, @@ -4648,31 +4635,31 @@ func TestPhp7(t *testing.T) { &stmt.For{ Position: &position.Position{ StartLine: 91, - EndLine: 91, - StartPos: 2056, - EndPos: 2090, + EndLine: 91, + StartPos: 2056, + EndPos: 2090, }, Init: []node.Node{ &assign.Assign{ Position: &position.Position{ StartLine: 91, - EndLine: 91, - StartPos: 2060, - EndPos: 2065, + EndLine: 91, + StartPos: 2060, + EndPos: 2065, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 91, - EndLine: 91, - StartPos: 2060, - EndPos: 2061, + EndLine: 91, + StartPos: 2060, + EndPos: 2061, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 91, - EndLine: 91, - StartPos: 2060, - EndPos: 2061, + EndLine: 91, + StartPos: 2060, + EndPos: 2061, }, Value: "i", }, @@ -4680,9 +4667,9 @@ func TestPhp7(t *testing.T) { Expression: &scalar.Lnumber{ Position: &position.Position{ StartLine: 91, - EndLine: 91, - StartPos: 2065, - EndPos: 2065, + EndLine: 91, + StartPos: 2065, + EndPos: 2065, }, Value: "0", }, @@ -4692,23 +4679,23 @@ func TestPhp7(t *testing.T) { &binary.Smaller{ Position: &position.Position{ StartLine: 91, - EndLine: 91, - StartPos: 2068, - EndPos: 2074, + EndLine: 91, + StartPos: 2068, + EndPos: 2074, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 91, - EndLine: 91, - StartPos: 2068, - EndPos: 2069, + EndLine: 91, + StartPos: 2068, + EndPos: 2069, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 91, - EndLine: 91, - StartPos: 2068, - EndPos: 2069, + EndLine: 91, + StartPos: 2068, + EndPos: 2069, }, Value: "i", }, @@ -4716,9 +4703,9 @@ func TestPhp7(t *testing.T) { Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 91, - EndLine: 91, - StartPos: 2073, - EndPos: 2074, + EndLine: 91, + StartPos: 2073, + EndPos: 2074, }, Value: "10", }, @@ -4728,23 +4715,23 @@ func TestPhp7(t *testing.T) { &expr.PostInc{ Position: &position.Position{ StartLine: 91, - EndLine: 91, - StartPos: 2077, - EndPos: 2080, + EndLine: 91, + StartPos: 2077, + EndPos: 2080, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 91, - EndLine: 91, - StartPos: 2077, - EndPos: 2078, + EndLine: 91, + StartPos: 2077, + EndPos: 2078, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 91, - EndLine: 91, - StartPos: 2077, - EndPos: 2078, + EndLine: 91, + StartPos: 2077, + EndPos: 2078, }, Value: "i", }, @@ -4753,23 +4740,23 @@ func TestPhp7(t *testing.T) { &expr.PostInc{ Position: &position.Position{ StartLine: 91, - EndLine: 91, - StartPos: 2083, - EndPos: 2086, + EndLine: 91, + StartPos: 2083, + EndPos: 2086, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 91, - EndLine: 91, - StartPos: 2083, - EndPos: 2084, + EndLine: 91, + StartPos: 2083, + EndPos: 2084, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 91, - EndLine: 91, - StartPos: 2083, - EndPos: 2084, + EndLine: 91, + StartPos: 2083, + EndPos: 2084, }, Value: "i", }, @@ -4779,42 +4766,41 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 91, - EndLine: 91, - StartPos: 2089, - EndPos: 2090, - }, - Stmts: []node.Node{ + EndLine: 91, + StartPos: 2089, + EndPos: 2090, }, + Stmts: []node.Node{}, }, }, &stmt.AltFor{ Position: &position.Position{ StartLine: 92, - EndLine: 92, - StartPos: 2094, - EndPos: 2129, + EndLine: 92, + StartPos: 2094, + EndPos: 2129, }, Cond: []node.Node{ &binary.Smaller{ Position: &position.Position{ StartLine: 92, - EndLine: 92, - StartPos: 2100, - EndPos: 2106, + EndLine: 92, + StartPos: 2100, + EndPos: 2106, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 92, - EndLine: 92, - StartPos: 2100, - EndPos: 2101, + EndLine: 92, + StartPos: 2100, + EndPos: 2101, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 92, - EndLine: 92, - StartPos: 2100, - EndPos: 2101, + EndLine: 92, + StartPos: 2100, + EndPos: 2101, }, Value: "i", }, @@ -4822,9 +4808,9 @@ func TestPhp7(t *testing.T) { Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 92, - EndLine: 92, - StartPos: 2105, - EndPos: 2106, + EndLine: 92, + StartPos: 2105, + EndPos: 2106, }, Value: "10", }, @@ -4834,23 +4820,23 @@ func TestPhp7(t *testing.T) { &expr.PostInc{ Position: &position.Position{ StartLine: 92, - EndLine: 92, - StartPos: 2109, - EndPos: 2112, + EndLine: 92, + StartPos: 2109, + EndPos: 2112, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 92, - EndLine: 92, - StartPos: 2109, - EndPos: 2110, + EndLine: 92, + StartPos: 2109, + EndPos: 2110, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 92, - EndLine: 92, - StartPos: 2109, - EndPos: 2110, + EndLine: 92, + StartPos: 2109, + EndPos: 2110, }, Value: "i", }, @@ -4859,23 +4845,23 @@ func TestPhp7(t *testing.T) { &expr.PostInc{ Position: &position.Position{ StartLine: 92, - EndLine: 92, - StartPos: 2115, - EndPos: 2118, + EndLine: 92, + StartPos: 2115, + EndPos: 2118, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 92, - EndLine: 92, - StartPos: 2115, - EndPos: 2116, + EndLine: 92, + StartPos: 2115, + EndPos: 2116, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 92, - EndLine: 92, - StartPos: 2115, - EndPos: 2116, + EndLine: 92, + StartPos: 2115, + EndPos: 2116, }, Value: "i", }, @@ -4885,34 +4871,33 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - Stmts: []node.Node{ + EndLine: -1, + StartPos: -1, + EndPos: -1, }, + Stmts: []node.Node{}, }, }, &stmt.Foreach{ Position: &position.Position{ StartLine: 93, - EndLine: 93, - StartPos: 2133, - EndPos: 2153, + EndLine: 93, + StartPos: 2133, + EndPos: 2153, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 93, - EndLine: 93, - StartPos: 2142, - EndPos: 2143, + EndLine: 93, + StartPos: 2142, + EndPos: 2143, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 93, - EndLine: 93, - StartPos: 2142, - EndPos: 2143, + EndLine: 93, + StartPos: 2142, + EndPos: 2143, }, Value: "a", }, @@ -4920,16 +4905,16 @@ func TestPhp7(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 93, - EndLine: 93, - StartPos: 2148, - EndPos: 2149, + EndLine: 93, + StartPos: 2148, + EndPos: 2149, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 93, - EndLine: 93, - StartPos: 2148, - EndPos: 2149, + EndLine: 93, + StartPos: 2148, + EndPos: 2149, }, Value: "v", }, @@ -4937,34 +4922,33 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 93, - EndLine: 93, - StartPos: 2152, - EndPos: 2153, - }, - Stmts: []node.Node{ + EndLine: 93, + StartPos: 2152, + EndPos: 2153, }, + Stmts: []node.Node{}, }, }, &stmt.AltForeach{ Position: &position.Position{ StartLine: 94, - EndLine: 94, - StartPos: 2157, - EndPos: 2188, + EndLine: 94, + StartPos: 2157, + EndPos: 2188, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 94, - EndLine: 94, - StartPos: 2166, - EndPos: 2167, + EndLine: 94, + StartPos: 2166, + EndPos: 2167, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 94, - EndLine: 94, - StartPos: 2166, - EndPos: 2167, + EndLine: 94, + StartPos: 2166, + EndPos: 2167, }, Value: "a", }, @@ -4972,16 +4956,16 @@ func TestPhp7(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 94, - EndLine: 94, - StartPos: 2172, - EndPos: 2173, + EndLine: 94, + StartPos: 2172, + EndPos: 2173, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 94, - EndLine: 94, - StartPos: 2172, - EndPos: 2173, + EndLine: 94, + StartPos: 2172, + EndPos: 2173, }, Value: "v", }, @@ -4989,34 +4973,33 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - Stmts: []node.Node{ + EndLine: -1, + StartPos: -1, + EndPos: -1, }, + Stmts: []node.Node{}, }, }, &stmt.Foreach{ Position: &position.Position{ StartLine: 95, - EndLine: 95, - StartPos: 2192, - EndPos: 2218, + EndLine: 95, + StartPos: 2192, + EndPos: 2218, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 95, - EndLine: 95, - StartPos: 2201, - EndPos: 2202, + EndLine: 95, + StartPos: 2201, + EndPos: 2202, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 95, - EndLine: 95, - StartPos: 2201, - EndPos: 2202, + EndLine: 95, + StartPos: 2201, + EndPos: 2202, }, Value: "a", }, @@ -5024,16 +5007,16 @@ func TestPhp7(t *testing.T) { Key: &expr.Variable{ Position: &position.Position{ StartLine: 95, - EndLine: 95, - StartPos: 2207, - EndPos: 2208, + EndLine: 95, + StartPos: 2207, + EndPos: 2208, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 95, - EndLine: 95, - StartPos: 2207, - EndPos: 2208, + EndLine: 95, + StartPos: 2207, + EndPos: 2208, }, Value: "k", }, @@ -5041,16 +5024,16 @@ func TestPhp7(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 95, - EndLine: 95, - StartPos: 2213, - EndPos: 2214, + EndLine: 95, + StartPos: 2213, + EndPos: 2214, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 95, - EndLine: 95, - StartPos: 2213, - EndPos: 2214, + EndLine: 95, + StartPos: 2213, + EndPos: 2214, }, Value: "v", }, @@ -5058,34 +5041,33 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 95, - EndLine: 95, - StartPos: 2217, - EndPos: 2218, - }, - Stmts: []node.Node{ + EndLine: 95, + StartPos: 2217, + EndPos: 2218, }, + Stmts: []node.Node{}, }, }, &stmt.Foreach{ Position: &position.Position{ StartLine: 96, - EndLine: 96, - StartPos: 2222, - EndPos: 2249, + EndLine: 96, + StartPos: 2222, + EndPos: 2249, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 96, - EndLine: 96, - StartPos: 2231, - EndPos: 2232, + EndLine: 96, + StartPos: 2231, + EndPos: 2232, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 96, - EndLine: 96, - StartPos: 2231, - EndPos: 2232, + EndLine: 96, + StartPos: 2231, + EndPos: 2232, }, Value: "a", }, @@ -5093,16 +5075,16 @@ func TestPhp7(t *testing.T) { Key: &expr.Variable{ Position: &position.Position{ StartLine: 96, - EndLine: 96, - StartPos: 2237, - EndPos: 2238, + EndLine: 96, + StartPos: 2237, + EndPos: 2238, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 96, - EndLine: 96, - StartPos: 2237, - EndPos: 2238, + EndLine: 96, + StartPos: 2237, + EndPos: 2238, }, Value: "k", }, @@ -5110,23 +5092,23 @@ func TestPhp7(t *testing.T) { Variable: &expr.Reference{ Position: &position.Position{ StartLine: 96, - EndLine: 96, - StartPos: 2243, - EndPos: 2245, + EndLine: 96, + StartPos: 2243, + EndPos: 2245, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 96, - EndLine: 96, - StartPos: 2244, - EndPos: 2245, + EndLine: 96, + StartPos: 2244, + EndPos: 2245, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 96, - EndLine: 96, - StartPos: 2244, - EndPos: 2245, + EndLine: 96, + StartPos: 2244, + EndPos: 2245, }, Value: "v", }, @@ -5135,34 +5117,33 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 96, - EndLine: 96, - StartPos: 2248, - EndPos: 2249, - }, - Stmts: []node.Node{ + EndLine: 96, + StartPos: 2248, + EndPos: 2249, }, + Stmts: []node.Node{}, }, }, &stmt.Foreach{ Position: &position.Position{ StartLine: 97, - EndLine: 97, - StartPos: 2253, - EndPos: 2285, + EndLine: 97, + StartPos: 2253, + EndPos: 2285, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 97, - EndLine: 97, - StartPos: 2262, - EndPos: 2263, + EndLine: 97, + StartPos: 2262, + EndPos: 2263, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 97, - EndLine: 97, - StartPos: 2262, - EndPos: 2263, + EndLine: 97, + StartPos: 2262, + EndPos: 2263, }, Value: "a", }, @@ -5170,16 +5151,16 @@ func TestPhp7(t *testing.T) { Key: &expr.Variable{ Position: &position.Position{ StartLine: 97, - EndLine: 97, - StartPos: 2268, - EndPos: 2269, + EndLine: 97, + StartPos: 2268, + EndPos: 2269, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 97, - EndLine: 97, - StartPos: 2268, - EndPos: 2269, + EndLine: 97, + StartPos: 2268, + EndPos: 2269, }, Value: "k", }, @@ -5187,31 +5168,31 @@ func TestPhp7(t *testing.T) { Variable: &expr.List{ Position: &position.Position{ StartLine: 97, - EndLine: 97, - StartPos: 2274, - EndPos: 2281, + EndLine: 97, + StartPos: 2274, + EndPos: 2281, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 97, - EndLine: 97, - StartPos: 2279, - EndPos: 2280, + EndLine: 97, + StartPos: 2279, + EndPos: 2280, }, Val: &expr.Variable{ Position: &position.Position{ StartLine: 97, - EndLine: 97, - StartPos: 2279, - EndPos: 2280, + EndLine: 97, + StartPos: 2279, + EndPos: 2280, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 97, - EndLine: 97, - StartPos: 2279, - EndPos: 2280, + EndLine: 97, + StartPos: 2279, + EndPos: 2280, }, Value: "v", }, @@ -5222,34 +5203,33 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 97, - EndLine: 97, - StartPos: 2284, - EndPos: 2285, - }, - Stmts: []node.Node{ + EndLine: 97, + StartPos: 2284, + EndPos: 2285, }, + Stmts: []node.Node{}, }, }, &stmt.Foreach{ Position: &position.Position{ StartLine: 98, - EndLine: 98, - StartPos: 2289, - EndPos: 2317, + EndLine: 98, + StartPos: 2289, + EndPos: 2317, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 98, - EndLine: 98, - StartPos: 2298, - EndPos: 2299, + EndLine: 98, + StartPos: 2298, + EndPos: 2299, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 98, - EndLine: 98, - StartPos: 2298, - EndPos: 2299, + EndLine: 98, + StartPos: 2298, + EndPos: 2299, }, Value: "a", }, @@ -5257,16 +5237,16 @@ func TestPhp7(t *testing.T) { Key: &expr.Variable{ Position: &position.Position{ StartLine: 98, - EndLine: 98, - StartPos: 2304, - EndPos: 2305, + EndLine: 98, + StartPos: 2304, + EndPos: 2305, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 98, - EndLine: 98, - StartPos: 2304, - EndPos: 2305, + EndLine: 98, + StartPos: 2304, + EndPos: 2305, }, Value: "k", }, @@ -5274,31 +5254,31 @@ func TestPhp7(t *testing.T) { Variable: &expr.ShortList{ Position: &position.Position{ StartLine: 98, - EndLine: 98, - StartPos: 2310, - EndPos: 2313, + EndLine: 98, + StartPos: 2310, + EndPos: 2313, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 98, - EndLine: 98, - StartPos: 2311, - EndPos: 2312, + EndLine: 98, + StartPos: 2311, + EndPos: 2312, }, Val: &expr.Variable{ Position: &position.Position{ StartLine: 98, - EndLine: 98, - StartPos: 2311, - EndPos: 2312, + EndLine: 98, + StartPos: 2311, + EndPos: 2312, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 98, - EndLine: 98, - StartPos: 2311, - EndPos: 2312, + EndLine: 98, + StartPos: 2311, + EndPos: 2312, }, Value: "v", }, @@ -5309,50 +5289,48 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 98, - EndLine: 98, - StartPos: 2316, - EndPos: 2317, - }, - Stmts: []node.Node{ + EndLine: 98, + StartPos: 2316, + EndPos: 2317, }, + Stmts: []node.Node{}, }, }, &stmt.Function{ Position: &position.Position{ StartLine: 99, - EndLine: 99, - StartPos: 2321, - EndPos: 2337, + EndLine: 99, + StartPos: 2321, + EndPos: 2337, }, - ReturnsRef: false, + ReturnsRef: false, PhpDocComment: "", FunctionName: &node.Identifier{ Position: &position.Position{ StartLine: 99, - EndLine: 99, - StartPos: 2330, - EndPos: 2332, + EndLine: 99, + StartPos: 2330, + EndPos: 2332, }, Value: "foo", }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, &stmt.Function{ Position: &position.Position{ StartLine: 100, - EndLine: 100, - StartPos: 2341, - EndPos: 2364, + EndLine: 100, + StartPos: 2341, + EndPos: 2364, }, - ReturnsRef: false, + ReturnsRef: false, PhpDocComment: "", FunctionName: &node.Identifier{ Position: &position.Position{ StartLine: 100, - EndLine: 100, - StartPos: 2350, - EndPos: 2352, + EndLine: 100, + StartPos: 2350, + EndPos: 2352, }, Value: "foo", }, @@ -5360,9 +5338,9 @@ func TestPhp7(t *testing.T) { &stmt.Return{ Position: &position.Position{ StartLine: 100, - EndLine: 100, - StartPos: 2357, - EndPos: 2363, + EndLine: 100, + StartPos: 2357, + EndPos: 2363, }, }, }, @@ -5370,18 +5348,18 @@ func TestPhp7(t *testing.T) { &stmt.Function{ Position: &position.Position{ StartLine: 101, - EndLine: 101, - StartPos: 2368, - EndPos: 2394, + EndLine: 101, + StartPos: 2368, + EndPos: 2394, }, - ReturnsRef: true, + ReturnsRef: true, PhpDocComment: "", FunctionName: &node.Identifier{ Position: &position.Position{ StartLine: 101, - EndLine: 101, - StartPos: 2378, - EndPos: 2380, + EndLine: 101, + StartPos: 2378, + EndPos: 2380, }, Value: "foo", }, @@ -5389,16 +5367,16 @@ func TestPhp7(t *testing.T) { &stmt.Return{ Position: &position.Position{ StartLine: 101, - EndLine: 101, - StartPos: 2385, - EndPos: 2393, + EndLine: 101, + StartPos: 2385, + EndPos: 2393, }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 101, - EndLine: 101, - StartPos: 2392, - EndPos: 2392, + EndLine: 101, + StartPos: 2392, + EndPos: 2392, }, Value: "1", }, @@ -5408,64 +5386,63 @@ func TestPhp7(t *testing.T) { &stmt.Function{ Position: &position.Position{ StartLine: 102, - EndLine: 102, - StartPos: 2398, - EndPos: 2421, + EndLine: 102, + StartPos: 2398, + EndPos: 2421, }, - ReturnsRef: true, + ReturnsRef: true, PhpDocComment: "", FunctionName: &node.Identifier{ Position: &position.Position{ StartLine: 102, - EndLine: 102, - StartPos: 2408, - EndPos: 2410, + EndLine: 102, + StartPos: 2408, + EndPos: 2410, }, Value: "foo", }, ReturnType: &name.Name{ Position: &position.Position{ StartLine: 102, - EndLine: 102, - StartPos: 2415, - EndPos: 2418, + EndLine: 102, + StartPos: 2415, + EndPos: 2418, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 102, - EndLine: 102, - StartPos: 2415, - EndPos: 2418, + EndLine: 102, + StartPos: 2415, + EndPos: 2418, }, Value: "void", }, }, }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, &stmt.Global{ Position: &position.Position{ StartLine: 103, - EndLine: 103, - StartPos: 2425, - EndPos: 2438, + EndLine: 103, + StartPos: 2425, + EndPos: 2438, }, Vars: []node.Node{ &expr.Variable{ Position: &position.Position{ StartLine: 103, - EndLine: 103, - StartPos: 2432, - EndPos: 2433, + EndLine: 103, + StartPos: 2432, + EndPos: 2433, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 103, - EndLine: 103, - StartPos: 2432, - EndPos: 2433, + EndLine: 103, + StartPos: 2432, + EndPos: 2433, }, Value: "a", }, @@ -5473,16 +5450,16 @@ func TestPhp7(t *testing.T) { &expr.Variable{ Position: &position.Position{ StartLine: 103, - EndLine: 103, - StartPos: 2436, - EndPos: 2437, + EndLine: 103, + StartPos: 2436, + EndPos: 2437, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 103, - EndLine: 103, - StartPos: 2436, - EndPos: 2437, + EndLine: 103, + StartPos: 2436, + EndPos: 2437, }, Value: "b", }, @@ -5492,16 +5469,16 @@ func TestPhp7(t *testing.T) { &stmt.Label{ Position: &position.Position{ StartLine: 104, - EndLine: 104, - StartPos: 2442, - EndPos: 2443, + EndLine: 104, + StartPos: 2442, + EndPos: 2443, }, LabelName: &node.Identifier{ Position: &position.Position{ StartLine: 104, - EndLine: 104, - StartPos: 2442, - EndPos: 2442, + EndLine: 104, + StartPos: 2442, + EndPos: 2442, }, Value: "a", }, @@ -5509,16 +5486,16 @@ func TestPhp7(t *testing.T) { &stmt.Goto{ Position: &position.Position{ StartLine: 105, - EndLine: 105, - StartPos: 2448, - EndPos: 2454, + EndLine: 105, + StartPos: 2448, + EndPos: 2454, }, Label: &node.Identifier{ Position: &position.Position{ StartLine: 105, - EndLine: 105, - StartPos: 2453, - EndPos: 2453, + EndLine: 105, + StartPos: 2453, + EndPos: 2453, }, Value: "a", }, @@ -5526,31 +5503,31 @@ func TestPhp7(t *testing.T) { &stmt.HaltCompiler{ Position: &position.Position{ StartLine: 106, - EndLine: 106, - StartPos: 2458, - EndPos: 2475, + EndLine: 106, + StartPos: 2458, + EndPos: 2475, }, }, &stmt.If{ Position: &position.Position{ StartLine: 107, - EndLine: 107, - StartPos: 2479, - EndPos: 2488, + EndLine: 107, + StartPos: 2479, + EndPos: 2488, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 107, - EndLine: 107, - StartPos: 2483, - EndPos: 2484, + EndLine: 107, + StartPos: 2483, + EndPos: 2484, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 107, - EndLine: 107, - StartPos: 2483, - EndPos: 2484, + EndLine: 107, + StartPos: 2483, + EndPos: 2484, }, Value: "a", }, @@ -5558,34 +5535,33 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 107, - EndLine: 107, - StartPos: 2487, - EndPos: 2488, - }, - Stmts: []node.Node{ + EndLine: 107, + StartPos: 2487, + EndPos: 2488, }, + Stmts: []node.Node{}, }, }, &stmt.If{ Position: &position.Position{ StartLine: 108, - EndLine: 108, - StartPos: 2492, - EndPos: 2516, + EndLine: 108, + StartPos: 2492, + EndPos: 2516, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 108, - EndLine: 108, - StartPos: 2496, - EndPos: 2497, + EndLine: 108, + StartPos: 2496, + EndPos: 2497, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 108, - EndLine: 108, - StartPos: 2496, - EndPos: 2497, + EndLine: 108, + StartPos: 2496, + EndPos: 2497, }, Value: "a", }, @@ -5593,34 +5569,33 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 108, - EndLine: 108, - StartPos: 2500, - EndPos: 2501, - }, - Stmts: []node.Node{ + EndLine: 108, + StartPos: 2500, + EndPos: 2501, }, + Stmts: []node.Node{}, }, ElseIf: []node.Node{ &stmt.ElseIf{ Position: &position.Position{ StartLine: 108, - EndLine: 108, - StartPos: 2503, - EndPos: 2516, + EndLine: 108, + StartPos: 2503, + EndPos: 2516, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 108, - EndLine: 108, - StartPos: 2511, - EndPos: 2512, + EndLine: 108, + StartPos: 2511, + EndPos: 2512, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 108, - EndLine: 108, - StartPos: 2511, - EndPos: 2512, + EndLine: 108, + StartPos: 2511, + EndPos: 2512, }, Value: "b", }, @@ -5628,12 +5603,11 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 108, - EndLine: 108, - StartPos: 2515, - EndPos: 2516, - }, - Stmts: []node.Node{ + EndLine: 108, + StartPos: 2515, + EndPos: 2516, }, + Stmts: []node.Node{}, }, }, }, @@ -5641,23 +5615,23 @@ func TestPhp7(t *testing.T) { &stmt.If{ Position: &position.Position{ StartLine: 109, - EndLine: 109, - StartPos: 2520, - EndPos: 2537, + EndLine: 109, + StartPos: 2520, + EndPos: 2537, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 109, - EndLine: 109, - StartPos: 2524, - EndPos: 2525, + EndLine: 109, + StartPos: 2524, + EndPos: 2525, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 109, - EndLine: 109, - StartPos: 2524, - EndPos: 2525, + EndLine: 109, + StartPos: 2524, + EndPos: 2525, }, Value: "a", }, @@ -5665,52 +5639,50 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 109, - EndLine: 109, - StartPos: 2528, - EndPos: 2529, - }, - Stmts: []node.Node{ + EndLine: 109, + StartPos: 2528, + EndPos: 2529, }, + Stmts: []node.Node{}, }, Else: &stmt.Else{ Position: &position.Position{ StartLine: 109, - EndLine: 109, - StartPos: 2531, - EndPos: 2537, + EndLine: 109, + StartPos: 2531, + EndPos: 2537, }, Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 109, - EndLine: 109, - StartPos: 2536, - EndPos: 2537, - }, - Stmts: []node.Node{ + EndLine: 109, + StartPos: 2536, + EndPos: 2537, }, + Stmts: []node.Node{}, }, }, }, &stmt.If{ Position: &position.Position{ StartLine: 110, - EndLine: 110, - StartPos: 2541, - EndPos: 2588, + EndLine: 110, + StartPos: 2541, + EndPos: 2588, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 110, - EndLine: 110, - StartPos: 2545, - EndPos: 2546, + EndLine: 110, + StartPos: 2545, + EndPos: 2546, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 110, - EndLine: 110, - StartPos: 2545, - EndPos: 2546, + EndLine: 110, + StartPos: 2545, + EndPos: 2546, }, Value: "a", }, @@ -5718,34 +5690,33 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 110, - EndLine: 110, - StartPos: 2549, - EndPos: 2550, - }, - Stmts: []node.Node{ + EndLine: 110, + StartPos: 2549, + EndPos: 2550, }, + Stmts: []node.Node{}, }, ElseIf: []node.Node{ &stmt.ElseIf{ Position: &position.Position{ StartLine: 110, - EndLine: 110, - StartPos: 2552, - EndPos: 2565, + EndLine: 110, + StartPos: 2552, + EndPos: 2565, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 110, - EndLine: 110, - StartPos: 2560, - EndPos: 2561, + EndLine: 110, + StartPos: 2560, + EndPos: 2561, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 110, - EndLine: 110, - StartPos: 2560, - EndPos: 2561, + EndLine: 110, + StartPos: 2560, + EndPos: 2561, }, Value: "b", }, @@ -5753,34 +5724,33 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 110, - EndLine: 110, - StartPos: 2564, - EndPos: 2565, - }, - Stmts: []node.Node{ + EndLine: 110, + StartPos: 2564, + EndPos: 2565, }, + Stmts: []node.Node{}, }, }, &stmt.ElseIf{ Position: &position.Position{ StartLine: 110, - EndLine: 110, - StartPos: 2567, - EndPos: 2580, + EndLine: 110, + StartPos: 2567, + EndPos: 2580, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 110, - EndLine: 110, - StartPos: 2575, - EndPos: 2576, + EndLine: 110, + StartPos: 2575, + EndPos: 2576, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 110, - EndLine: 110, - StartPos: 2575, - EndPos: 2576, + EndLine: 110, + StartPos: 2575, + EndPos: 2576, }, Value: "c", }, @@ -5788,54 +5758,52 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 110, - EndLine: 110, - StartPos: 2579, - EndPos: 2580, - }, - Stmts: []node.Node{ + EndLine: 110, + StartPos: 2579, + EndPos: 2580, }, + Stmts: []node.Node{}, }, }, }, Else: &stmt.Else{ Position: &position.Position{ StartLine: 110, - EndLine: 110, - StartPos: 2582, - EndPos: 2588, + EndLine: 110, + StartPos: 2582, + EndPos: 2588, }, Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 110, - EndLine: 110, - StartPos: 2587, - EndPos: 2588, - }, - Stmts: []node.Node{ + EndLine: 110, + StartPos: 2587, + EndPos: 2588, }, + Stmts: []node.Node{}, }, }, }, &stmt.If{ Position: &position.Position{ StartLine: 111, - EndLine: 111, - StartPos: 2592, - EndPos: 2640, + EndLine: 111, + StartPos: 2592, + EndPos: 2640, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 111, - EndLine: 111, - StartPos: 2596, - EndPos: 2597, + EndLine: 111, + StartPos: 2596, + EndPos: 2597, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 111, - EndLine: 111, - StartPos: 2596, - EndPos: 2597, + EndLine: 111, + StartPos: 2596, + EndPos: 2597, }, Value: "a", }, @@ -5843,34 +5811,33 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 111, - EndLine: 111, - StartPos: 2600, - EndPos: 2601, - }, - Stmts: []node.Node{ + EndLine: 111, + StartPos: 2600, + EndPos: 2601, }, + Stmts: []node.Node{}, }, ElseIf: []node.Node{ &stmt.ElseIf{ Position: &position.Position{ StartLine: 111, - EndLine: 111, - StartPos: 2603, - EndPos: 2616, + EndLine: 111, + StartPos: 2603, + EndPos: 2616, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 111, - EndLine: 111, - StartPos: 2611, - EndPos: 2612, + EndLine: 111, + StartPos: 2611, + EndPos: 2612, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 111, - EndLine: 111, - StartPos: 2611, - EndPos: 2612, + EndLine: 111, + StartPos: 2611, + EndPos: 2612, }, Value: "b", }, @@ -5878,42 +5845,41 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 111, - EndLine: 111, - StartPos: 2615, - EndPos: 2616, - }, - Stmts: []node.Node{ + EndLine: 111, + StartPos: 2615, + EndPos: 2616, }, + Stmts: []node.Node{}, }, }, }, Else: &stmt.Else{ Position: &position.Position{ StartLine: 111, - EndLine: 111, - StartPos: 2618, - EndPos: 2640, + EndLine: 111, + StartPos: 2618, + EndPos: 2640, }, Stmt: &stmt.If{ Position: &position.Position{ StartLine: 111, - EndLine: 111, - StartPos: 2623, - EndPos: 2640, + EndLine: 111, + StartPos: 2623, + EndPos: 2640, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 111, - EndLine: 111, - StartPos: 2627, - EndPos: 2628, + EndLine: 111, + StartPos: 2627, + EndPos: 2628, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 111, - EndLine: 111, - StartPos: 2627, - EndPos: 2628, + EndLine: 111, + StartPos: 2627, + EndPos: 2628, }, Value: "c", }, @@ -5921,29 +5887,27 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 111, - EndLine: 111, - StartPos: 2631, - EndPos: 2632, - }, - Stmts: []node.Node{ + EndLine: 111, + StartPos: 2631, + EndPos: 2632, }, + Stmts: []node.Node{}, }, Else: &stmt.Else{ Position: &position.Position{ StartLine: 111, - EndLine: 111, - StartPos: 2634, - EndPos: 2640, + EndLine: 111, + StartPos: 2634, + EndPos: 2640, }, Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 111, - EndLine: 111, - StartPos: 2639, - EndPos: 2640, - }, - Stmts: []node.Node{ + EndLine: 111, + StartPos: 2639, + EndPos: 2640, }, + Stmts: []node.Node{}, }, }, }, @@ -5952,79 +5916,78 @@ func TestPhp7(t *testing.T) { &stmt.Nop{ Position: &position.Position{ StartLine: 112, - EndLine: 112, - StartPos: 2644, - EndPos: 2645, + EndLine: 112, + StartPos: 2644, + EndPos: 2645, }, }, &stmt.InlineHtml{ Position: &position.Position{ StartLine: 112, - EndLine: 112, - StartPos: 2647, - EndPos: 2658, + EndLine: 112, + StartPos: 2647, + EndPos: 2658, }, Value: "
", }, &stmt.Interface{ Position: &position.Position{ StartLine: 113, - EndLine: 113, - StartPos: 2664, - EndPos: 2679, + EndLine: 113, + StartPos: 2664, + EndPos: 2679, }, PhpDocComment: "", InterfaceName: &node.Identifier{ Position: &position.Position{ StartLine: 113, - EndLine: 113, - StartPos: 2674, - EndPos: 2676, + EndLine: 113, + StartPos: 2674, + EndPos: 2676, }, Value: "Foo", }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, &stmt.Interface{ Position: &position.Position{ StartLine: 114, - EndLine: 114, - StartPos: 2683, - EndPos: 2710, + EndLine: 114, + StartPos: 2683, + EndPos: 2710, }, PhpDocComment: "", InterfaceName: &node.Identifier{ Position: &position.Position{ StartLine: 114, - EndLine: 114, - StartPos: 2693, - EndPos: 2695, + EndLine: 114, + StartPos: 2693, + EndPos: 2695, }, Value: "Foo", }, Extends: &stmt.InterfaceExtends{ Position: &position.Position{ StartLine: 114, - EndLine: 114, - StartPos: 2697, - EndPos: 2707, + EndLine: 114, + StartPos: 2697, + EndPos: 2707, }, InterfaceNames: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 114, - EndLine: 114, - StartPos: 2705, - EndPos: 2707, + EndLine: 114, + StartPos: 2705, + EndPos: 2707, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 114, - EndLine: 114, - StartPos: 2705, - EndPos: 2707, + EndLine: 114, + StartPos: 2705, + EndPos: 2707, }, Value: "Bar", }, @@ -6032,48 +5995,47 @@ func TestPhp7(t *testing.T) { }, }, }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, &stmt.Interface{ Position: &position.Position{ StartLine: 115, - EndLine: 115, - StartPos: 2714, - EndPos: 2746, + EndLine: 115, + StartPos: 2714, + EndPos: 2746, }, PhpDocComment: "", InterfaceName: &node.Identifier{ Position: &position.Position{ StartLine: 115, - EndLine: 115, - StartPos: 2724, - EndPos: 2726, + EndLine: 115, + StartPos: 2724, + EndPos: 2726, }, Value: "Foo", }, Extends: &stmt.InterfaceExtends{ Position: &position.Position{ StartLine: 115, - EndLine: 115, - StartPos: 2728, - EndPos: 2743, + EndLine: 115, + StartPos: 2728, + EndPos: 2743, }, InterfaceNames: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 115, - EndLine: 115, - StartPos: 2736, - EndPos: 2738, + EndLine: 115, + StartPos: 2736, + EndPos: 2738, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 115, - EndLine: 115, - StartPos: 2736, - EndPos: 2738, + EndLine: 115, + StartPos: 2736, + EndPos: 2738, }, Value: "Bar", }, @@ -6082,17 +6044,17 @@ func TestPhp7(t *testing.T) { &name.Name{ Position: &position.Position{ StartLine: 115, - EndLine: 115, - StartPos: 2741, - EndPos: 2743, + EndLine: 115, + StartPos: 2741, + EndPos: 2743, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 115, - EndLine: 115, - StartPos: 2741, - EndPos: 2743, + EndLine: 115, + StartPos: 2741, + EndPos: 2743, }, Value: "Baz", }, @@ -6100,30 +6062,29 @@ func TestPhp7(t *testing.T) { }, }, }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, &stmt.Namespace{ Position: &position.Position{ StartLine: 116, - EndLine: 116, - StartPos: 2750, - EndPos: 2763, + EndLine: 116, + StartPos: 2750, + EndPos: 2763, }, NamespaceName: &name.Name{ Position: &position.Position{ StartLine: 116, - EndLine: 116, - StartPos: 2760, - EndPos: 2762, + EndLine: 116, + StartPos: 2760, + EndPos: 2762, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 116, - EndLine: 116, - StartPos: 2760, - EndPos: 2762, + EndLine: 116, + StartPos: 2760, + EndPos: 2762, }, Value: "Foo", }, @@ -6133,56 +6094,54 @@ func TestPhp7(t *testing.T) { &stmt.Namespace{ Position: &position.Position{ StartLine: 117, - EndLine: 117, - StartPos: 2767, - EndPos: 2782, + EndLine: 117, + StartPos: 2767, + EndPos: 2782, }, NamespaceName: &name.Name{ Position: &position.Position{ StartLine: 117, - EndLine: 117, - StartPos: 2777, - EndPos: 2779, + EndLine: 117, + StartPos: 2777, + EndPos: 2779, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 117, - EndLine: 117, - StartPos: 2777, - EndPos: 2779, + EndLine: 117, + StartPos: 2777, + EndPos: 2779, }, Value: "Foo", }, }, }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, &stmt.Namespace{ Position: &position.Position{ StartLine: 118, - EndLine: 118, - StartPos: 2786, - EndPos: 2797, - }, - Stmts: []node.Node{ + EndLine: 118, + StartPos: 2786, + EndPos: 2797, }, + Stmts: []node.Node{}, }, &stmt.Class{ Position: &position.Position{ StartLine: 119, - EndLine: 119, - StartPos: 2801, - EndPos: 2819, + EndLine: 119, + StartPos: 2801, + EndPos: 2819, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 119, - EndLine: 119, - StartPos: 2807, - EndPos: 2809, + EndLine: 119, + StartPos: 2807, + EndPos: 2809, }, Value: "foo", }, @@ -6190,17 +6149,17 @@ func TestPhp7(t *testing.T) { &stmt.PropertyList{ Position: &position.Position{ StartLine: 119, - EndLine: 119, - StartPos: 2812, - EndPos: 2818, + EndLine: 119, + StartPos: 2812, + EndPos: 2818, }, Modifiers: []node.Node{ &node.Identifier{ Position: &position.Position{ StartLine: 119, - EndLine: 119, - StartPos: 2812, - EndPos: 2814, + EndLine: 119, + StartPos: 2812, + EndPos: 2814, }, Value: "var", }, @@ -6209,24 +6168,24 @@ func TestPhp7(t *testing.T) { &stmt.Property{ Position: &position.Position{ StartLine: 119, - EndLine: 119, - StartPos: 2816, - EndPos: 2817, + EndLine: 119, + StartPos: 2816, + EndPos: 2817, }, PhpDocComment: "", Variable: &expr.Variable{ Position: &position.Position{ StartLine: 119, - EndLine: 119, - StartPos: 2816, - EndPos: 2817, + EndLine: 119, + StartPos: 2816, + EndPos: 2817, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 119, - EndLine: 119, - StartPos: 2816, - EndPos: 2817, + EndLine: 119, + StartPos: 2816, + EndPos: 2817, }, Value: "a", }, @@ -6239,17 +6198,17 @@ func TestPhp7(t *testing.T) { &stmt.Class{ Position: &position.Position{ StartLine: 120, - EndLine: 120, - StartPos: 2823, - EndPos: 2859, + EndLine: 120, + StartPos: 2823, + EndPos: 2859, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 120, - EndLine: 120, - StartPos: 2829, - EndPos: 2831, + EndLine: 120, + StartPos: 2829, + EndPos: 2831, }, Value: "foo", }, @@ -6257,26 +6216,26 @@ func TestPhp7(t *testing.T) { &stmt.PropertyList{ Position: &position.Position{ StartLine: 120, - EndLine: 120, - StartPos: 2834, - EndPos: 2858, + EndLine: 120, + StartPos: 2834, + EndPos: 2858, }, Modifiers: []node.Node{ &node.Identifier{ Position: &position.Position{ StartLine: 120, - EndLine: 120, - StartPos: 2834, - EndPos: 2839, + EndLine: 120, + StartPos: 2834, + EndPos: 2839, }, Value: "public", }, &node.Identifier{ Position: &position.Position{ StartLine: 120, - EndLine: 120, - StartPos: 2841, - EndPos: 2846, + EndLine: 120, + StartPos: 2841, + EndPos: 2846, }, Value: "static", }, @@ -6285,24 +6244,24 @@ func TestPhp7(t *testing.T) { &stmt.Property{ Position: &position.Position{ StartLine: 120, - EndLine: 120, - StartPos: 2848, - EndPos: 2849, + EndLine: 120, + StartPos: 2848, + EndPos: 2849, }, PhpDocComment: "", Variable: &expr.Variable{ Position: &position.Position{ StartLine: 120, - EndLine: 120, - StartPos: 2848, - EndPos: 2849, + EndLine: 120, + StartPos: 2848, + EndPos: 2849, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 120, - EndLine: 120, - StartPos: 2848, - EndPos: 2849, + EndLine: 120, + StartPos: 2848, + EndPos: 2849, }, Value: "a", }, @@ -6311,24 +6270,24 @@ func TestPhp7(t *testing.T) { &stmt.Property{ Position: &position.Position{ StartLine: 120, - EndLine: 120, - StartPos: 2852, - EndPos: 2857, + EndLine: 120, + StartPos: 2852, + EndPos: 2857, }, PhpDocComment: "", Variable: &expr.Variable{ Position: &position.Position{ StartLine: 120, - EndLine: 120, - StartPos: 2852, - EndPos: 2853, + EndLine: 120, + StartPos: 2852, + EndPos: 2853, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 120, - EndLine: 120, - StartPos: 2852, - EndPos: 2853, + EndLine: 120, + StartPos: 2852, + EndPos: 2853, }, Value: "b", }, @@ -6336,9 +6295,9 @@ func TestPhp7(t *testing.T) { Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 120, - EndLine: 120, - StartPos: 2857, - EndPos: 2857, + EndLine: 120, + StartPos: 2857, + EndPos: 2857, }, Value: "1", }, @@ -6350,31 +6309,31 @@ func TestPhp7(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 121, - EndLine: 121, - StartPos: 2863, - EndPos: 2880, + EndLine: 121, + StartPos: 2863, + EndPos: 2880, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 121, - EndLine: 121, - StartPos: 2870, - EndPos: 2871, + EndLine: 121, + StartPos: 2870, + EndPos: 2871, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 121, - EndLine: 121, - StartPos: 2870, - EndPos: 2871, + EndLine: 121, + StartPos: 2870, + EndPos: 2871, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 121, - EndLine: 121, - StartPos: 2870, - EndPos: 2871, + EndLine: 121, + StartPos: 2870, + EndPos: 2871, }, Value: "a", }, @@ -6383,23 +6342,23 @@ func TestPhp7(t *testing.T) { &stmt.StaticVar{ Position: &position.Position{ StartLine: 121, - EndLine: 121, - StartPos: 2874, - EndPos: 2879, + EndLine: 121, + StartPos: 2874, + EndPos: 2879, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 121, - EndLine: 121, - StartPos: 2874, - EndPos: 2875, + EndLine: 121, + StartPos: 2874, + EndPos: 2875, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 121, - EndLine: 121, - StartPos: 2874, - EndPos: 2875, + EndLine: 121, + StartPos: 2874, + EndPos: 2875, }, Value: "b", }, @@ -6407,9 +6366,9 @@ func TestPhp7(t *testing.T) { Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 121, - EndLine: 121, - StartPos: 2879, - EndPos: 2879, + EndLine: 121, + StartPos: 2879, + EndPos: 2879, }, Value: "1", }, @@ -6419,74 +6378,71 @@ func TestPhp7(t *testing.T) { &stmt.AltSwitch{ Position: &position.Position{ StartLine: 123, - EndLine: 127, - StartPos: 2885, - EndPos: 2943, + EndLine: 127, + StartPos: 2885, + EndPos: 2943, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 123, - EndLine: 123, - StartPos: 2893, - EndPos: 2893, + EndLine: 123, + StartPos: 2893, + EndPos: 2893, }, Value: "1", }, CaseList: &stmt.CaseList{ Position: &position.Position{ StartLine: 124, - EndLine: -1, - StartPos: 2901, - EndPos: -1, + EndLine: -1, + StartPos: 2901, + EndPos: -1, }, Cases: []node.Node{ &stmt.Case{ Position: &position.Position{ StartLine: 124, - EndLine: -1, - StartPos: 2901, - EndPos: -1, + EndLine: -1, + StartPos: 2901, + EndPos: -1, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 124, - EndLine: 124, - StartPos: 2906, - EndPos: 2906, + EndLine: 124, + StartPos: 2906, + EndPos: 2906, }, Value: "1", }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, &stmt.Default{ Position: &position.Position{ StartLine: 125, - EndLine: -1, - StartPos: 2912, - EndPos: -1, - }, - Stmts: []node.Node{ + EndLine: -1, + StartPos: 2912, + EndPos: -1, }, + Stmts: []node.Node{}, }, &stmt.Case{ Position: &position.Position{ StartLine: 126, - EndLine: -1, - StartPos: 2924, - EndPos: -1, + EndLine: -1, + StartPos: 2924, + EndPos: -1, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 126, - EndLine: 126, - StartPos: 2929, - EndPos: 2929, + EndLine: 126, + StartPos: 2929, + EndPos: 2929, }, Value: "2", }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, }, }, @@ -6494,64 +6450,62 @@ func TestPhp7(t *testing.T) { &stmt.AltSwitch{ Position: &position.Position{ StartLine: 129, - EndLine: 132, - StartPos: 2948, - EndPos: 2995, + EndLine: 132, + StartPos: 2948, + EndPos: 2995, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 129, - EndLine: 129, - StartPos: 2956, - EndPos: 2956, + EndLine: 129, + StartPos: 2956, + EndPos: 2956, }, Value: "1", }, CaseList: &stmt.CaseList{ Position: &position.Position{ StartLine: 130, - EndLine: -1, - StartPos: 2965, - EndPos: -1, + EndLine: -1, + StartPos: 2965, + EndPos: -1, }, Cases: []node.Node{ &stmt.Case{ Position: &position.Position{ StartLine: 130, - EndLine: -1, - StartPos: 2965, - EndPos: -1, + EndLine: -1, + StartPos: 2965, + EndPos: -1, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 130, - EndLine: 130, - StartPos: 2970, - EndPos: 2970, + EndLine: 130, + StartPos: 2970, + EndPos: 2970, }, Value: "1", }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, &stmt.Case{ Position: &position.Position{ StartLine: 131, - EndLine: -1, - StartPos: 2976, - EndPos: -1, + EndLine: -1, + StartPos: 2976, + EndPos: -1, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 131, - EndLine: 131, - StartPos: 2981, - EndPos: 2981, + EndLine: 131, + StartPos: 2981, + EndPos: 2981, }, Value: "2", }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, }, }, @@ -6559,40 +6513,40 @@ func TestPhp7(t *testing.T) { &stmt.Switch{ Position: &position.Position{ StartLine: 134, - EndLine: 137, - StartPos: 3002, - EndPos: 3053, + EndLine: 137, + StartPos: 3002, + EndPos: 3053, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 134, - EndLine: 134, - StartPos: 3010, - EndPos: 3010, + EndLine: 134, + StartPos: 3010, + EndPos: 3010, }, Value: "1", }, CaseList: &stmt.CaseList{ Position: &position.Position{ StartLine: 134, - EndLine: 137, - StartPos: 3013, - EndPos: 3053, + EndLine: 137, + StartPos: 3013, + EndPos: 3053, }, Cases: []node.Node{ &stmt.Case{ Position: &position.Position{ StartLine: 135, - EndLine: 135, - StartPos: 3018, - EndPos: 3031, + EndLine: 135, + StartPos: 3018, + EndPos: 3031, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 135, - EndLine: 135, - StartPos: 3023, - EndPos: 3023, + EndLine: 135, + StartPos: 3023, + EndPos: 3023, }, Value: "1", }, @@ -6600,9 +6554,9 @@ func TestPhp7(t *testing.T) { &stmt.Break{ Position: &position.Position{ StartLine: 135, - EndLine: 135, - StartPos: 3026, - EndPos: 3031, + EndLine: 135, + StartPos: 3026, + EndPos: 3031, }, }, }, @@ -6610,16 +6564,16 @@ func TestPhp7(t *testing.T) { &stmt.Case{ Position: &position.Position{ StartLine: 136, - EndLine: 136, - StartPos: 3036, - EndPos: 3049, + EndLine: 136, + StartPos: 3036, + EndPos: 3049, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 136, - EndLine: 136, - StartPos: 3041, - EndPos: 3041, + EndLine: 136, + StartPos: 3041, + EndPos: 3041, }, Value: "2", }, @@ -6627,9 +6581,9 @@ func TestPhp7(t *testing.T) { &stmt.Break{ Position: &position.Position{ StartLine: 136, - EndLine: 136, - StartPos: 3044, - EndPos: 3049, + EndLine: 136, + StartPos: 3044, + EndPos: 3049, }, }, }, @@ -6640,40 +6594,40 @@ func TestPhp7(t *testing.T) { &stmt.Switch{ Position: &position.Position{ StartLine: 139, - EndLine: 142, - StartPos: 3060, - EndPos: 3112, + EndLine: 142, + StartPos: 3060, + EndPos: 3112, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 139, - EndLine: 139, - StartPos: 3068, - EndPos: 3068, + EndLine: 139, + StartPos: 3068, + EndPos: 3068, }, Value: "1", }, CaseList: &stmt.CaseList{ Position: &position.Position{ StartLine: 139, - EndLine: 142, - StartPos: 3071, - EndPos: 3112, + EndLine: 142, + StartPos: 3071, + EndPos: 3112, }, Cases: []node.Node{ &stmt.Case{ Position: &position.Position{ StartLine: 140, - EndLine: 140, - StartPos: 3077, - EndPos: 3090, + EndLine: 140, + StartPos: 3077, + EndPos: 3090, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 140, - EndLine: 140, - StartPos: 3082, - EndPos: 3082, + EndLine: 140, + StartPos: 3082, + EndPos: 3082, }, Value: "1", }, @@ -6681,9 +6635,9 @@ func TestPhp7(t *testing.T) { &stmt.Break{ Position: &position.Position{ StartLine: 140, - EndLine: 140, - StartPos: 3085, - EndPos: 3090, + EndLine: 140, + StartPos: 3085, + EndPos: 3090, }, }, }, @@ -6691,16 +6645,16 @@ func TestPhp7(t *testing.T) { &stmt.Case{ Position: &position.Position{ StartLine: 141, - EndLine: 141, - StartPos: 3095, - EndPos: 3108, + EndLine: 141, + StartPos: 3095, + EndPos: 3108, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 141, - EndLine: 141, - StartPos: 3100, - EndPos: 3100, + EndLine: 141, + StartPos: 3100, + EndPos: 3100, }, Value: "2", }, @@ -6708,9 +6662,9 @@ func TestPhp7(t *testing.T) { &stmt.Break{ Position: &position.Position{ StartLine: 141, - EndLine: 141, - StartPos: 3103, - EndPos: 3108, + EndLine: 141, + StartPos: 3103, + EndPos: 3108, }, }, }, @@ -6721,23 +6675,23 @@ func TestPhp7(t *testing.T) { &stmt.Throw{ Position: &position.Position{ StartLine: 144, - EndLine: 144, - StartPos: 3117, - EndPos: 3125, + EndLine: 144, + StartPos: 3117, + EndPos: 3125, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 144, - EndLine: 144, - StartPos: 3123, - EndPos: 3124, + EndLine: 144, + StartPos: 3123, + EndPos: 3124, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 144, - EndLine: 144, - StartPos: 3123, - EndPos: 3124, + EndLine: 144, + StartPos: 3123, + EndPos: 3124, }, Value: "e", }, @@ -6746,37 +6700,36 @@ func TestPhp7(t *testing.T) { &stmt.Trait{ Position: &position.Position{ StartLine: 146, - EndLine: 146, - StartPos: 3130, - EndPos: 3141, + EndLine: 146, + StartPos: 3130, + EndPos: 3141, }, PhpDocComment: "", TraitName: &node.Identifier{ Position: &position.Position{ StartLine: 146, - EndLine: 146, - StartPos: 3136, - EndPos: 3138, + EndLine: 146, + StartPos: 3136, + EndPos: 3138, }, Value: "Foo", }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, &stmt.Class{ Position: &position.Position{ StartLine: 147, - EndLine: 147, - StartPos: 3145, - EndPos: 3166, + EndLine: 147, + StartPos: 3145, + EndPos: 3166, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 147, - EndLine: 147, - StartPos: 3151, - EndPos: 3153, + EndLine: 147, + StartPos: 3151, + EndPos: 3153, }, Value: "Foo", }, @@ -6784,25 +6737,25 @@ func TestPhp7(t *testing.T) { &stmt.TraitUse{ Position: &position.Position{ StartLine: 147, - EndLine: 147, - StartPos: 3157, - EndPos: 3164, + EndLine: 147, + StartPos: 3157, + EndPos: 3164, }, Traits: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 147, - EndLine: 147, - StartPos: 3161, - EndPos: 3163, + EndLine: 147, + StartPos: 3161, + EndPos: 3163, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 147, - EndLine: 147, - StartPos: 3161, - EndPos: 3163, + EndLine: 147, + StartPos: 3161, + EndPos: 3163, }, Value: "Bar", }, @@ -6815,17 +6768,17 @@ func TestPhp7(t *testing.T) { &stmt.Class{ Position: &position.Position{ StartLine: 148, - EndLine: 148, - StartPos: 3170, - EndPos: 3198, + EndLine: 148, + StartPos: 3170, + EndPos: 3198, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 148, - EndLine: 148, - StartPos: 3176, - EndPos: 3178, + EndLine: 148, + StartPos: 3176, + EndPos: 3178, }, Value: "Foo", }, @@ -6833,25 +6786,25 @@ func TestPhp7(t *testing.T) { &stmt.TraitUse{ Position: &position.Position{ StartLine: 148, - EndLine: 148, - StartPos: 3182, - EndPos: 3196, + EndLine: 148, + StartPos: 3182, + EndPos: 3196, }, Traits: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 148, - EndLine: 148, - StartPos: 3186, - EndPos: 3188, + EndLine: 148, + StartPos: 3186, + EndPos: 3188, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 148, - EndLine: 148, - StartPos: 3186, - EndPos: 3188, + EndLine: 148, + StartPos: 3186, + EndPos: 3188, }, Value: "Bar", }, @@ -6860,17 +6813,17 @@ func TestPhp7(t *testing.T) { &name.Name{ Position: &position.Position{ StartLine: 148, - EndLine: 148, - StartPos: 3191, - EndPos: 3193, + EndLine: 148, + StartPos: 3191, + EndPos: 3193, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 148, - EndLine: 148, - StartPos: 3191, - EndPos: 3193, + EndLine: 148, + StartPos: 3191, + EndPos: 3193, }, Value: "Baz", }, @@ -6880,9 +6833,9 @@ func TestPhp7(t *testing.T) { TraitAdaptationList: &stmt.TraitAdaptationList{ Position: &position.Position{ StartLine: 148, - EndLine: 148, - StartPos: 3195, - EndPos: 3196, + EndLine: 148, + StartPos: 3195, + EndPos: 3196, }, }, }, @@ -6891,17 +6844,17 @@ func TestPhp7(t *testing.T) { &stmt.Class{ Position: &position.Position{ StartLine: 149, - EndLine: 149, - StartPos: 3202, - EndPos: 3247, + EndLine: 149, + StartPos: 3202, + EndPos: 3247, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 149, - EndLine: 149, - StartPos: 3208, - EndPos: 3210, + EndLine: 149, + StartPos: 3208, + EndPos: 3210, }, Value: "Foo", }, @@ -6909,25 +6862,25 @@ func TestPhp7(t *testing.T) { &stmt.TraitUse{ Position: &position.Position{ StartLine: 149, - EndLine: 149, - StartPos: 3214, - EndPos: 3245, + EndLine: 149, + StartPos: 3214, + EndPos: 3245, }, Traits: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 149, - EndLine: 149, - StartPos: 3218, - EndPos: 3220, + EndLine: 149, + StartPos: 3218, + EndPos: 3220, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 149, - EndLine: 149, - StartPos: 3218, - EndPos: 3220, + EndLine: 149, + StartPos: 3218, + EndPos: 3220, }, Value: "Bar", }, @@ -6936,17 +6889,17 @@ func TestPhp7(t *testing.T) { &name.Name{ Position: &position.Position{ StartLine: 149, - EndLine: 149, - StartPos: 3223, - EndPos: 3225, + EndLine: 149, + StartPos: 3223, + EndPos: 3225, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 149, - EndLine: 149, - StartPos: 3223, - EndPos: 3225, + EndLine: 149, + StartPos: 3223, + EndPos: 3225, }, Value: "Baz", }, @@ -6956,31 +6909,31 @@ func TestPhp7(t *testing.T) { TraitAdaptationList: &stmt.TraitAdaptationList{ Position: &position.Position{ StartLine: 149, - EndLine: 149, - StartPos: 3227, - EndPos: 3245, + EndLine: 149, + StartPos: 3227, + EndPos: 3245, }, Adaptations: []node.Node{ &stmt.TraitUseAlias{ Position: &position.Position{ StartLine: 149, - EndLine: 149, - StartPos: 3229, - EndPos: 3242, + EndLine: 149, + StartPos: 3229, + EndPos: 3242, }, Ref: &stmt.TraitMethodRef{ Position: &position.Position{ StartLine: 149, - EndLine: 149, - StartPos: 3229, - EndPos: 3231, + EndLine: 149, + StartPos: 3229, + EndPos: 3231, }, Method: &node.Identifier{ Position: &position.Position{ StartLine: 149, - EndLine: 149, - StartPos: 3229, - EndPos: 3231, + EndLine: 149, + StartPos: 3229, + EndPos: 3231, }, Value: "one", }, @@ -6988,9 +6941,9 @@ func TestPhp7(t *testing.T) { Alias: &node.Identifier{ Position: &position.Position{ StartLine: 149, - EndLine: 149, - StartPos: 3236, - EndPos: 3242, + EndLine: 149, + StartPos: 3236, + EndPos: 3242, }, Value: "include", }, @@ -7003,17 +6956,17 @@ func TestPhp7(t *testing.T) { &stmt.Class{ Position: &position.Position{ StartLine: 150, - EndLine: 150, - StartPos: 3251, - EndPos: 3295, + EndLine: 150, + StartPos: 3251, + EndPos: 3295, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 150, - EndLine: 150, - StartPos: 3257, - EndPos: 3259, + EndLine: 150, + StartPos: 3257, + EndPos: 3259, }, Value: "Foo", }, @@ -7021,25 +6974,25 @@ func TestPhp7(t *testing.T) { &stmt.TraitUse{ Position: &position.Position{ StartLine: 150, - EndLine: 150, - StartPos: 3263, - EndPos: 3293, + EndLine: 150, + StartPos: 3263, + EndPos: 3293, }, Traits: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 150, - EndLine: 150, - StartPos: 3267, - EndPos: 3269, + EndLine: 150, + StartPos: 3267, + EndPos: 3269, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 150, - EndLine: 150, - StartPos: 3267, - EndPos: 3269, + EndLine: 150, + StartPos: 3267, + EndPos: 3269, }, Value: "Bar", }, @@ -7048,17 +7001,17 @@ func TestPhp7(t *testing.T) { &name.Name{ Position: &position.Position{ StartLine: 150, - EndLine: 150, - StartPos: 3272, - EndPos: 3274, + EndLine: 150, + StartPos: 3272, + EndPos: 3274, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 150, - EndLine: 150, - StartPos: 3272, - EndPos: 3274, + EndLine: 150, + StartPos: 3272, + EndPos: 3274, }, Value: "Baz", }, @@ -7068,31 +7021,31 @@ func TestPhp7(t *testing.T) { TraitAdaptationList: &stmt.TraitAdaptationList{ Position: &position.Position{ StartLine: 150, - EndLine: 150, - StartPos: 3276, - EndPos: 3293, + EndLine: 150, + StartPos: 3276, + EndPos: 3293, }, Adaptations: []node.Node{ &stmt.TraitUseAlias{ Position: &position.Position{ StartLine: 150, - EndLine: 150, - StartPos: 3278, - EndPos: 3290, + EndLine: 150, + StartPos: 3278, + EndPos: 3290, }, Ref: &stmt.TraitMethodRef{ Position: &position.Position{ StartLine: 150, - EndLine: 150, - StartPos: 3278, - EndPos: 3280, + EndLine: 150, + StartPos: 3278, + EndPos: 3280, }, Method: &node.Identifier{ Position: &position.Position{ StartLine: 150, - EndLine: 150, - StartPos: 3278, - EndPos: 3280, + EndLine: 150, + StartPos: 3278, + EndPos: 3280, }, Value: "one", }, @@ -7100,9 +7053,9 @@ func TestPhp7(t *testing.T) { Modifier: &node.Identifier{ Position: &position.Position{ StartLine: 150, - EndLine: 150, - StartPos: 3285, - EndPos: 3290, + EndLine: 150, + StartPos: 3285, + EndPos: 3290, }, Value: "public", }, @@ -7115,17 +7068,17 @@ func TestPhp7(t *testing.T) { &stmt.Class{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3299, - EndPos: 3347, + EndLine: 151, + StartPos: 3299, + EndPos: 3347, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3305, - EndPos: 3307, + EndLine: 151, + StartPos: 3305, + EndPos: 3307, }, Value: "Foo", }, @@ -7133,25 +7086,25 @@ func TestPhp7(t *testing.T) { &stmt.TraitUse{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3311, - EndPos: 3345, + EndLine: 151, + StartPos: 3311, + EndPos: 3345, }, Traits: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3315, - EndPos: 3317, + EndLine: 151, + StartPos: 3315, + EndPos: 3317, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3315, - EndPos: 3317, + EndLine: 151, + StartPos: 3315, + EndPos: 3317, }, Value: "Bar", }, @@ -7160,17 +7113,17 @@ func TestPhp7(t *testing.T) { &name.Name{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3320, - EndPos: 3322, + EndLine: 151, + StartPos: 3320, + EndPos: 3322, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3320, - EndPos: 3322, + EndLine: 151, + StartPos: 3320, + EndPos: 3322, }, Value: "Baz", }, @@ -7180,31 +7133,31 @@ func TestPhp7(t *testing.T) { TraitAdaptationList: &stmt.TraitAdaptationList{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3324, - EndPos: 3345, + EndLine: 151, + StartPos: 3324, + EndPos: 3345, }, Adaptations: []node.Node{ &stmt.TraitUseAlias{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3326, - EndPos: 3342, + EndLine: 151, + StartPos: 3326, + EndPos: 3342, }, Ref: &stmt.TraitMethodRef{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3326, - EndPos: 3328, + EndLine: 151, + StartPos: 3326, + EndPos: 3328, }, Method: &node.Identifier{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3326, - EndPos: 3328, + EndLine: 151, + StartPos: 3326, + EndPos: 3328, }, Value: "one", }, @@ -7212,18 +7165,18 @@ func TestPhp7(t *testing.T) { Modifier: &node.Identifier{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3333, - EndPos: 3338, + EndLine: 151, + StartPos: 3333, + EndPos: 3338, }, Value: "public", }, Alias: &node.Identifier{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3340, - EndPos: 3342, + EndLine: 151, + StartPos: 3340, + EndPos: 3342, }, Value: "two", }, @@ -7236,17 +7189,17 @@ func TestPhp7(t *testing.T) { &stmt.Class{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3351, - EndPos: 3427, + EndLine: 152, + StartPos: 3351, + EndPos: 3427, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3357, - EndPos: 3359, + EndLine: 152, + StartPos: 3357, + EndPos: 3359, }, Value: "Foo", }, @@ -7254,25 +7207,25 @@ func TestPhp7(t *testing.T) { &stmt.TraitUse{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3363, - EndPos: 3425, + EndLine: 152, + StartPos: 3363, + EndPos: 3425, }, Traits: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3367, - EndPos: 3369, + EndLine: 152, + StartPos: 3367, + EndPos: 3369, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3367, - EndPos: 3369, + EndLine: 152, + StartPos: 3367, + EndPos: 3369, }, Value: "Bar", }, @@ -7281,17 +7234,17 @@ func TestPhp7(t *testing.T) { &name.Name{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3372, - EndPos: 3374, + EndLine: 152, + StartPos: 3372, + EndPos: 3374, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3372, - EndPos: 3374, + EndLine: 152, + StartPos: 3372, + EndPos: 3374, }, Value: "Baz", }, @@ -7301,39 +7254,39 @@ func TestPhp7(t *testing.T) { TraitAdaptationList: &stmt.TraitAdaptationList{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3376, - EndPos: 3425, + EndLine: 152, + StartPos: 3376, + EndPos: 3425, }, Adaptations: []node.Node{ &stmt.TraitUsePrecedence{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3378, - EndPos: 3405, + EndLine: 152, + StartPos: 3378, + EndPos: 3405, }, Ref: &stmt.TraitMethodRef{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3378, - EndPos: 3385, + EndLine: 152, + StartPos: 3378, + EndPos: 3385, }, Trait: &name.Name{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3378, - EndPos: 3380, + EndLine: 152, + StartPos: 3378, + EndPos: 3380, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3378, - EndPos: 3380, + EndLine: 152, + StartPos: 3378, + EndPos: 3380, }, Value: "Bar", }, @@ -7342,9 +7295,9 @@ func TestPhp7(t *testing.T) { Method: &node.Identifier{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3383, - EndPos: 3385, + EndLine: 152, + StartPos: 3383, + EndPos: 3385, }, Value: "one", }, @@ -7353,17 +7306,17 @@ func TestPhp7(t *testing.T) { &name.Name{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3397, - EndPos: 3399, + EndLine: 152, + StartPos: 3397, + EndPos: 3399, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3397, - EndPos: 3399, + EndLine: 152, + StartPos: 3397, + EndPos: 3399, }, Value: "Baz", }, @@ -7372,17 +7325,17 @@ func TestPhp7(t *testing.T) { &name.Name{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3402, - EndPos: 3405, + EndLine: 152, + StartPos: 3402, + EndPos: 3405, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3402, - EndPos: 3405, + EndLine: 152, + StartPos: 3402, + EndPos: 3405, }, Value: "Quux", }, @@ -7393,31 +7346,31 @@ func TestPhp7(t *testing.T) { &stmt.TraitUseAlias{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3408, - EndPos: 3422, + EndLine: 152, + StartPos: 3408, + EndPos: 3422, }, Ref: &stmt.TraitMethodRef{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3408, - EndPos: 3415, + EndLine: 152, + StartPos: 3408, + EndPos: 3415, }, Trait: &name.Name{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3408, - EndPos: 3410, + EndLine: 152, + StartPos: 3408, + EndPos: 3410, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3408, - EndPos: 3410, + EndLine: 152, + StartPos: 3408, + EndPos: 3410, }, Value: "Baz", }, @@ -7426,9 +7379,9 @@ func TestPhp7(t *testing.T) { Method: &node.Identifier{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3413, - EndPos: 3415, + EndLine: 152, + StartPos: 3413, + EndPos: 3415, }, Value: "one", }, @@ -7436,9 +7389,9 @@ func TestPhp7(t *testing.T) { Alias: &node.Identifier{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3420, - EndPos: 3422, + EndLine: 152, + StartPos: 3420, + EndPos: 3422, }, Value: "two", }, @@ -7451,47 +7404,44 @@ func TestPhp7(t *testing.T) { &stmt.Try{ Position: &position.Position{ StartLine: 154, - EndLine: -1, - StartPos: 3432, - EndPos: -1, - }, - Stmts: []node.Node{ - }, - Catches: []node.Node{ + EndLine: -1, + StartPos: 3432, + EndPos: -1, }, + Stmts: []node.Node{}, + Catches: []node.Node{}, }, &stmt.Try{ Position: &position.Position{ StartLine: 155, - EndLine: 155, - StartPos: 3441, - EndPos: 3470, - }, - Stmts: []node.Node{ + EndLine: 155, + StartPos: 3441, + EndPos: 3470, }, + Stmts: []node.Node{}, Catches: []node.Node{ &stmt.Catch{ Position: &position.Position{ StartLine: 155, - EndLine: 155, - StartPos: 3448, - EndPos: 3470, + EndLine: 155, + StartPos: 3448, + EndPos: 3470, }, Types: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 155, - EndLine: 155, - StartPos: 3455, - EndPos: 3463, + EndLine: 155, + StartPos: 3455, + EndPos: 3463, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 155, - EndLine: 155, - StartPos: 3455, - EndPos: 3463, + EndLine: 155, + StartPos: 3455, + EndPos: 3463, }, Value: "Exception", }, @@ -7501,57 +7451,55 @@ func TestPhp7(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 155, - EndLine: 155, - StartPos: 3465, - EndPos: 3466, + EndLine: 155, + StartPos: 3465, + EndPos: 3466, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 155, - EndLine: 155, - StartPos: 3465, - EndPos: 3466, + EndLine: 155, + StartPos: 3465, + EndPos: 3466, }, Value: "e", }, }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, }, }, &stmt.Try{ Position: &position.Position{ StartLine: 156, - EndLine: 156, - StartPos: 3474, - EndPos: 3520, - }, - Stmts: []node.Node{ + EndLine: 156, + StartPos: 3474, + EndPos: 3520, }, + Stmts: []node.Node{}, Catches: []node.Node{ &stmt.Catch{ Position: &position.Position{ StartLine: 156, - EndLine: 156, - StartPos: 3481, - EndPos: 3520, + EndLine: 156, + StartPos: 3481, + EndPos: 3520, }, Types: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 156, - EndLine: 156, - StartPos: 3488, - EndPos: 3496, + EndLine: 156, + StartPos: 3488, + EndPos: 3496, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 156, - EndLine: 156, - StartPos: 3488, - EndPos: 3496, + EndLine: 156, + StartPos: 3488, + EndPos: 3496, }, Value: "Exception", }, @@ -7560,17 +7508,17 @@ func TestPhp7(t *testing.T) { &name.Name{ Position: &position.Position{ StartLine: 156, - EndLine: 156, - StartPos: 3498, - EndPos: 3513, + EndLine: 156, + StartPos: 3498, + EndPos: 3513, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 156, - EndLine: 156, - StartPos: 3498, - EndPos: 3513, + EndLine: 156, + StartPos: 3498, + EndPos: 3513, }, Value: "RuntimeException", }, @@ -7580,57 +7528,55 @@ func TestPhp7(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 156, - EndLine: 156, - StartPos: 3515, - EndPos: 3516, + EndLine: 156, + StartPos: 3515, + EndPos: 3516, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 156, - EndLine: 156, - StartPos: 3515, - EndPos: 3516, + EndLine: 156, + StartPos: 3515, + EndPos: 3516, }, Value: "e", }, }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, }, }, &stmt.Try{ Position: &position.Position{ StartLine: 157, - EndLine: 157, - StartPos: 3524, - EndPos: 3584, - }, - Stmts: []node.Node{ + EndLine: 157, + StartPos: 3524, + EndPos: 3584, }, + Stmts: []node.Node{}, Catches: []node.Node{ &stmt.Catch{ Position: &position.Position{ StartLine: 157, - EndLine: 157, - StartPos: 3531, - EndPos: 3553, + EndLine: 157, + StartPos: 3531, + EndPos: 3553, }, Types: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 157, - EndLine: 157, - StartPos: 3538, - EndPos: 3546, + EndLine: 157, + StartPos: 3538, + EndPos: 3546, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 157, - EndLine: 157, - StartPos: 3538, - EndPos: 3546, + EndLine: 157, + StartPos: 3538, + EndPos: 3546, }, Value: "Exception", }, @@ -7640,45 +7586,44 @@ func TestPhp7(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 157, - EndLine: 157, - StartPos: 3548, - EndPos: 3549, + EndLine: 157, + StartPos: 3548, + EndPos: 3549, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 157, - EndLine: 157, - StartPos: 3548, - EndPos: 3549, + EndLine: 157, + StartPos: 3548, + EndPos: 3549, }, Value: "e", }, }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, &stmt.Catch{ Position: &position.Position{ StartLine: 157, - EndLine: 157, - StartPos: 3555, - EndPos: 3584, + EndLine: 157, + StartPos: 3555, + EndPos: 3584, }, Types: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 157, - EndLine: 157, - StartPos: 3562, - EndPos: 3577, + EndLine: 157, + StartPos: 3562, + EndPos: 3577, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 157, - EndLine: 157, - StartPos: 3562, - EndPos: 3577, + EndLine: 157, + StartPos: 3562, + EndPos: 3577, }, Value: "RuntimeException", }, @@ -7688,57 +7633,55 @@ func TestPhp7(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 157, - EndLine: 157, - StartPos: 3579, - EndPos: 3580, + EndLine: 157, + StartPos: 3579, + EndPos: 3580, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 157, - EndLine: 157, - StartPos: 3579, - EndPos: 3580, + EndLine: 157, + StartPos: 3579, + EndPos: 3580, }, Value: "e", }, }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, }, }, &stmt.Try{ Position: &position.Position{ StartLine: 158, - EndLine: 158, - StartPos: 3588, - EndPos: 3628, - }, - Stmts: []node.Node{ + EndLine: 158, + StartPos: 3588, + EndPos: 3628, }, + Stmts: []node.Node{}, Catches: []node.Node{ &stmt.Catch{ Position: &position.Position{ StartLine: 158, - EndLine: 158, - StartPos: 3595, - EndPos: 3617, + EndLine: 158, + StartPos: 3595, + EndPos: 3617, }, Types: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 158, - EndLine: 158, - StartPos: 3602, - EndPos: 3610, + EndLine: 158, + StartPos: 3602, + EndPos: 3610, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 158, - EndLine: 158, - StartPos: 3602, - EndPos: 3610, + EndLine: 158, + StartPos: 3602, + EndPos: 3610, }, Value: "Exception", }, @@ -7748,56 +7691,54 @@ func TestPhp7(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 158, - EndLine: 158, - StartPos: 3612, - EndPos: 3613, + EndLine: 158, + StartPos: 3612, + EndPos: 3613, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 158, - EndLine: 158, - StartPos: 3612, - EndPos: 3613, + EndLine: 158, + StartPos: 3612, + EndPos: 3613, }, Value: "e", }, }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, }, Finally: &stmt.Finally{ Position: &position.Position{ StartLine: 158, - EndLine: 158, - StartPos: 3619, - EndPos: 3628, - }, - Stmts: []node.Node{ + EndLine: 158, + StartPos: 3619, + EndPos: 3628, }, + Stmts: []node.Node{}, }, }, &stmt.Unset{ Position: &position.Position{ StartLine: 160, - EndLine: 160, - StartPos: 3633, - EndPos: 3647, + EndLine: 160, + StartPos: 3633, + EndPos: 3647, }, Vars: []node.Node{ &expr.Variable{ Position: &position.Position{ StartLine: 160, - EndLine: 160, - StartPos: 3639, - EndPos: 3640, + EndLine: 160, + StartPos: 3639, + EndPos: 3640, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 160, - EndLine: 160, - StartPos: 3639, - EndPos: 3640, + EndLine: 160, + StartPos: 3639, + EndPos: 3640, }, Value: "a", }, @@ -7805,16 +7746,16 @@ func TestPhp7(t *testing.T) { &expr.Variable{ Position: &position.Position{ StartLine: 160, - EndLine: 160, - StartPos: 3643, - EndPos: 3644, + EndLine: 160, + StartPos: 3643, + EndPos: 3644, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 160, - EndLine: 160, - StartPos: 3643, - EndPos: 3644, + EndLine: 160, + StartPos: 3643, + EndPos: 3644, }, Value: "b", }, @@ -7824,32 +7765,32 @@ func TestPhp7(t *testing.T) { &stmt.UseList{ Position: &position.Position{ StartLine: 162, - EndLine: 162, - StartPos: 3652, - EndPos: 3659, + EndLine: 162, + StartPos: 3652, + EndPos: 3659, }, Uses: []node.Node{ &stmt.Use{ Position: &position.Position{ StartLine: 162, - EndLine: 162, - StartPos: 3656, - EndPos: 3658, + EndLine: 162, + StartPos: 3656, + EndPos: 3658, }, Use: &name.Name{ Position: &position.Position{ StartLine: 162, - EndLine: 162, - StartPos: 3656, - EndPos: 3658, + EndLine: 162, + StartPos: 3656, + EndPos: 3658, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 162, - EndLine: 162, - StartPos: 3656, - EndPos: 3658, + EndLine: 162, + StartPos: 3656, + EndPos: 3658, }, Value: "Foo", }, @@ -7861,32 +7802,32 @@ func TestPhp7(t *testing.T) { &stmt.UseList{ Position: &position.Position{ StartLine: 163, - EndLine: 163, - StartPos: 3663, - EndPos: 3671, + EndLine: 163, + StartPos: 3663, + EndPos: 3671, }, Uses: []node.Node{ &stmt.Use{ Position: &position.Position{ StartLine: 163, - EndLine: 163, - StartPos: 3668, - EndPos: 3670, + EndLine: 163, + StartPos: 3668, + EndPos: 3670, }, Use: &name.Name{ Position: &position.Position{ StartLine: 163, - EndLine: 163, - StartPos: 3668, - EndPos: 3670, + EndLine: 163, + StartPos: 3668, + EndPos: 3670, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 163, - EndLine: 163, - StartPos: 3668, - EndPos: 3670, + EndLine: 163, + StartPos: 3668, + EndPos: 3670, }, Value: "Foo", }, @@ -7898,32 +7839,32 @@ func TestPhp7(t *testing.T) { &stmt.UseList{ Position: &position.Position{ StartLine: 164, - EndLine: 164, - StartPos: 3675, - EndPos: 3690, + EndLine: 164, + StartPos: 3675, + EndPos: 3690, }, Uses: []node.Node{ &stmt.Use{ Position: &position.Position{ StartLine: 164, - EndLine: 164, - StartPos: 3680, - EndPos: 3689, + EndLine: 164, + StartPos: 3680, + EndPos: 3689, }, Use: &name.Name{ Position: &position.Position{ StartLine: 164, - EndLine: 164, - StartPos: 3680, - EndPos: 3682, + EndLine: 164, + StartPos: 3680, + EndPos: 3682, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 164, - EndLine: 164, - StartPos: 3680, - EndPos: 3682, + EndLine: 164, + StartPos: 3680, + EndPos: 3682, }, Value: "Foo", }, @@ -7932,9 +7873,9 @@ func TestPhp7(t *testing.T) { Alias: &node.Identifier{ Position: &position.Position{ StartLine: 164, - EndLine: 164, - StartPos: 3687, - EndPos: 3689, + EndLine: 164, + StartPos: 3687, + EndPos: 3689, }, Value: "Bar", }, @@ -7944,32 +7885,32 @@ func TestPhp7(t *testing.T) { &stmt.UseList{ Position: &position.Position{ StartLine: 165, - EndLine: 165, - StartPos: 3694, - EndPos: 3706, + EndLine: 165, + StartPos: 3694, + EndPos: 3706, }, Uses: []node.Node{ &stmt.Use{ Position: &position.Position{ StartLine: 165, - EndLine: 165, - StartPos: 3698, - EndPos: 3700, + EndLine: 165, + StartPos: 3698, + EndPos: 3700, }, Use: &name.Name{ Position: &position.Position{ StartLine: 165, - EndLine: 165, - StartPos: 3698, - EndPos: 3700, + EndLine: 165, + StartPos: 3698, + EndPos: 3700, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 165, - EndLine: 165, - StartPos: 3698, - EndPos: 3700, + EndLine: 165, + StartPos: 3698, + EndPos: 3700, }, Value: "Foo", }, @@ -7979,24 +7920,24 @@ func TestPhp7(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 165, - EndLine: 165, - StartPos: 3703, - EndPos: 3705, + EndLine: 165, + StartPos: 3703, + EndPos: 3705, }, Use: &name.Name{ Position: &position.Position{ StartLine: 165, - EndLine: 165, - StartPos: 3703, - EndPos: 3705, + EndLine: 165, + StartPos: 3703, + EndPos: 3705, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 165, - EndLine: 165, - StartPos: 3703, - EndPos: 3705, + EndLine: 165, + StartPos: 3703, + EndPos: 3705, }, Value: "Bar", }, @@ -8008,32 +7949,32 @@ func TestPhp7(t *testing.T) { &stmt.UseList{ Position: &position.Position{ StartLine: 166, - EndLine: 166, - StartPos: 3710, - EndPos: 3729, + EndLine: 166, + StartPos: 3710, + EndPos: 3729, }, Uses: []node.Node{ &stmt.Use{ Position: &position.Position{ StartLine: 166, - EndLine: 166, - StartPos: 3714, - EndPos: 3716, + EndLine: 166, + StartPos: 3714, + EndPos: 3716, }, Use: &name.Name{ Position: &position.Position{ StartLine: 166, - EndLine: 166, - StartPos: 3714, - EndPos: 3716, + EndLine: 166, + StartPos: 3714, + EndPos: 3716, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 166, - EndLine: 166, - StartPos: 3714, - EndPos: 3716, + EndLine: 166, + StartPos: 3714, + EndPos: 3716, }, Value: "Foo", }, @@ -8043,24 +7984,24 @@ func TestPhp7(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 166, - EndLine: 166, - StartPos: 3719, - EndPos: 3728, + EndLine: 166, + StartPos: 3719, + EndPos: 3728, }, Use: &name.Name{ Position: &position.Position{ StartLine: 166, - EndLine: 166, - StartPos: 3719, - EndPos: 3721, + EndLine: 166, + StartPos: 3719, + EndPos: 3721, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 166, - EndLine: 166, - StartPos: 3719, - EndPos: 3721, + EndLine: 166, + StartPos: 3719, + EndPos: 3721, }, Value: "Bar", }, @@ -8069,9 +8010,9 @@ func TestPhp7(t *testing.T) { Alias: &node.Identifier{ Position: &position.Position{ StartLine: 166, - EndLine: 166, - StartPos: 3726, - EndPos: 3728, + EndLine: 166, + StartPos: 3726, + EndPos: 3728, }, Value: "Baz", }, @@ -8081,16 +8022,16 @@ func TestPhp7(t *testing.T) { &stmt.UseList{ Position: &position.Position{ StartLine: 167, - EndLine: 167, - StartPos: 3733, - EndPos: 3755, + EndLine: 167, + StartPos: 3733, + EndPos: 3755, }, UseType: &node.Identifier{ Position: &position.Position{ StartLine: 167, - EndLine: 167, - StartPos: 3737, - EndPos: 3744, + EndLine: 167, + StartPos: 3737, + EndPos: 3744, }, Value: "function", }, @@ -8098,24 +8039,24 @@ func TestPhp7(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 167, - EndLine: 167, - StartPos: 3746, - EndPos: 3748, + EndLine: 167, + StartPos: 3746, + EndPos: 3748, }, Use: &name.Name{ Position: &position.Position{ StartLine: 167, - EndLine: 167, - StartPos: 3746, - EndPos: 3748, + EndLine: 167, + StartPos: 3746, + EndPos: 3748, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 167, - EndLine: 167, - StartPos: 3746, - EndPos: 3748, + EndLine: 167, + StartPos: 3746, + EndPos: 3748, }, Value: "Foo", }, @@ -8125,24 +8066,24 @@ func TestPhp7(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 167, - EndLine: 167, - StartPos: 3752, - EndPos: 3754, + EndLine: 167, + StartPos: 3752, + EndPos: 3754, }, Use: &name.Name{ Position: &position.Position{ StartLine: 167, - EndLine: 167, - StartPos: 3752, - EndPos: 3754, + EndLine: 167, + StartPos: 3752, + EndPos: 3754, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 167, - EndLine: 167, - StartPos: 3752, - EndPos: 3754, + EndLine: 167, + StartPos: 3752, + EndPos: 3754, }, Value: "Bar", }, @@ -8154,16 +8095,16 @@ func TestPhp7(t *testing.T) { &stmt.UseList{ Position: &position.Position{ StartLine: 168, - EndLine: 168, - StartPos: 3759, - EndPos: 3795, + EndLine: 168, + StartPos: 3759, + EndPos: 3795, }, UseType: &node.Identifier{ Position: &position.Position{ StartLine: 168, - EndLine: 168, - StartPos: 3763, - EndPos: 3770, + EndLine: 168, + StartPos: 3763, + EndPos: 3770, }, Value: "function", }, @@ -8171,24 +8112,24 @@ func TestPhp7(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 168, - EndLine: 168, - StartPos: 3772, - EndPos: 3781, + EndLine: 168, + StartPos: 3772, + EndPos: 3781, }, Use: &name.Name{ Position: &position.Position{ StartLine: 168, - EndLine: 168, - StartPos: 3772, - EndPos: 3774, + EndLine: 168, + StartPos: 3772, + EndPos: 3774, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 168, - EndLine: 168, - StartPos: 3772, - EndPos: 3774, + EndLine: 168, + StartPos: 3772, + EndPos: 3774, }, Value: "Foo", }, @@ -8197,9 +8138,9 @@ func TestPhp7(t *testing.T) { Alias: &node.Identifier{ Position: &position.Position{ StartLine: 168, - EndLine: 168, - StartPos: 3779, - EndPos: 3781, + EndLine: 168, + StartPos: 3779, + EndPos: 3781, }, Value: "foo", }, @@ -8207,24 +8148,24 @@ func TestPhp7(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 168, - EndLine: 168, - StartPos: 3785, - EndPos: 3794, + EndLine: 168, + StartPos: 3785, + EndPos: 3794, }, Use: &name.Name{ Position: &position.Position{ StartLine: 168, - EndLine: 168, - StartPos: 3785, - EndPos: 3787, + EndLine: 168, + StartPos: 3785, + EndPos: 3787, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 168, - EndLine: 168, - StartPos: 3785, - EndPos: 3787, + EndLine: 168, + StartPos: 3785, + EndPos: 3787, }, Value: "Bar", }, @@ -8233,9 +8174,9 @@ func TestPhp7(t *testing.T) { Alias: &node.Identifier{ Position: &position.Position{ StartLine: 168, - EndLine: 168, - StartPos: 3792, - EndPos: 3794, + EndLine: 168, + StartPos: 3792, + EndPos: 3794, }, Value: "bar", }, @@ -8245,16 +8186,16 @@ func TestPhp7(t *testing.T) { &stmt.UseList{ Position: &position.Position{ StartLine: 169, - EndLine: 169, - StartPos: 3799, - EndPos: 3818, + EndLine: 169, + StartPos: 3799, + EndPos: 3818, }, UseType: &node.Identifier{ Position: &position.Position{ StartLine: 169, - EndLine: 169, - StartPos: 3803, - EndPos: 3807, + EndLine: 169, + StartPos: 3803, + EndPos: 3807, }, Value: "const", }, @@ -8262,24 +8203,24 @@ func TestPhp7(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 169, - EndLine: 169, - StartPos: 3809, - EndPos: 3811, + EndLine: 169, + StartPos: 3809, + EndPos: 3811, }, Use: &name.Name{ Position: &position.Position{ StartLine: 169, - EndLine: 169, - StartPos: 3809, - EndPos: 3811, + EndLine: 169, + StartPos: 3809, + EndPos: 3811, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 169, - EndLine: 169, - StartPos: 3809, - EndPos: 3811, + EndLine: 169, + StartPos: 3809, + EndPos: 3811, }, Value: "Foo", }, @@ -8289,24 +8230,24 @@ func TestPhp7(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 169, - EndLine: 169, - StartPos: 3815, - EndPos: 3817, + EndLine: 169, + StartPos: 3815, + EndPos: 3817, }, Use: &name.Name{ Position: &position.Position{ StartLine: 169, - EndLine: 169, - StartPos: 3815, - EndPos: 3817, + EndLine: 169, + StartPos: 3815, + EndPos: 3817, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 169, - EndLine: 169, - StartPos: 3815, - EndPos: 3817, + EndLine: 169, + StartPos: 3815, + EndPos: 3817, }, Value: "Bar", }, @@ -8318,16 +8259,16 @@ func TestPhp7(t *testing.T) { &stmt.UseList{ Position: &position.Position{ StartLine: 170, - EndLine: 170, - StartPos: 3822, - EndPos: 3855, + EndLine: 170, + StartPos: 3822, + EndPos: 3855, }, UseType: &node.Identifier{ Position: &position.Position{ StartLine: 170, - EndLine: 170, - StartPos: 3826, - EndPos: 3830, + EndLine: 170, + StartPos: 3826, + EndPos: 3830, }, Value: "const", }, @@ -8335,24 +8276,24 @@ func TestPhp7(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 170, - EndLine: 170, - StartPos: 3832, - EndPos: 3841, + EndLine: 170, + StartPos: 3832, + EndPos: 3841, }, Use: &name.Name{ Position: &position.Position{ StartLine: 170, - EndLine: 170, - StartPos: 3832, - EndPos: 3834, + EndLine: 170, + StartPos: 3832, + EndPos: 3834, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 170, - EndLine: 170, - StartPos: 3832, - EndPos: 3834, + EndLine: 170, + StartPos: 3832, + EndPos: 3834, }, Value: "Foo", }, @@ -8361,9 +8302,9 @@ func TestPhp7(t *testing.T) { Alias: &node.Identifier{ Position: &position.Position{ StartLine: 170, - EndLine: 170, - StartPos: 3839, - EndPos: 3841, + EndLine: 170, + StartPos: 3839, + EndPos: 3841, }, Value: "foo", }, @@ -8371,24 +8312,24 @@ func TestPhp7(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 170, - EndLine: 170, - StartPos: 3845, - EndPos: 3854, + EndLine: 170, + StartPos: 3845, + EndPos: 3854, }, Use: &name.Name{ Position: &position.Position{ StartLine: 170, - EndLine: 170, - StartPos: 3845, - EndPos: 3847, + EndLine: 170, + StartPos: 3845, + EndPos: 3847, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 170, - EndLine: 170, - StartPos: 3845, - EndPos: 3847, + EndLine: 170, + StartPos: 3845, + EndPos: 3847, }, Value: "Bar", }, @@ -8397,9 +8338,9 @@ func TestPhp7(t *testing.T) { Alias: &node.Identifier{ Position: &position.Position{ StartLine: 170, - EndLine: 170, - StartPos: 3852, - EndPos: 3854, + EndLine: 170, + StartPos: 3852, + EndPos: 3854, }, Value: "bar", }, @@ -8409,24 +8350,24 @@ func TestPhp7(t *testing.T) { &stmt.GroupUse{ Position: &position.Position{ StartLine: 172, - EndLine: 172, - StartPos: 3860, - EndPos: 3879, + EndLine: 172, + StartPos: 3860, + EndPos: 3879, }, Prefix: &name.Name{ Position: &position.Position{ StartLine: 172, - EndLine: 172, - StartPos: 3865, - EndPos: 3867, + EndLine: 172, + StartPos: 3865, + EndPos: 3867, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 172, - EndLine: 172, - StartPos: 3865, - EndPos: 3867, + EndLine: 172, + StartPos: 3865, + EndPos: 3867, }, Value: "Foo", }, @@ -8436,24 +8377,24 @@ func TestPhp7(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 172, - EndLine: 172, - StartPos: 3870, - EndPos: 3872, + EndLine: 172, + StartPos: 3870, + EndPos: 3872, }, Use: &name.Name{ Position: &position.Position{ StartLine: 172, - EndLine: 172, - StartPos: 3870, - EndPos: 3872, + EndLine: 172, + StartPos: 3870, + EndPos: 3872, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 172, - EndLine: 172, - StartPos: 3870, - EndPos: 3872, + EndLine: 172, + StartPos: 3870, + EndPos: 3872, }, Value: "Bar", }, @@ -8463,24 +8404,24 @@ func TestPhp7(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 172, - EndLine: 172, - StartPos: 3875, - EndPos: 3877, + EndLine: 172, + StartPos: 3875, + EndPos: 3877, }, Use: &name.Name{ Position: &position.Position{ StartLine: 172, - EndLine: 172, - StartPos: 3875, - EndPos: 3877, + EndLine: 172, + StartPos: 3875, + EndPos: 3877, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 172, - EndLine: 172, - StartPos: 3875, - EndPos: 3877, + EndLine: 172, + StartPos: 3875, + EndPos: 3877, }, Value: "Baz", }, @@ -8492,24 +8433,24 @@ func TestPhp7(t *testing.T) { &stmt.GroupUse{ Position: &position.Position{ StartLine: 173, - EndLine: 173, - StartPos: 3883, - EndPos: 3909, + EndLine: 173, + StartPos: 3883, + EndPos: 3909, }, Prefix: &name.Name{ Position: &position.Position{ StartLine: 173, - EndLine: 173, - StartPos: 3887, - EndPos: 3889, + EndLine: 173, + StartPos: 3887, + EndPos: 3889, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 173, - EndLine: 173, - StartPos: 3887, - EndPos: 3889, + EndLine: 173, + StartPos: 3887, + EndPos: 3889, }, Value: "Foo", }, @@ -8519,24 +8460,24 @@ func TestPhp7(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 173, - EndLine: 173, - StartPos: 3892, - EndPos: 3894, + EndLine: 173, + StartPos: 3892, + EndPos: 3894, }, Use: &name.Name{ Position: &position.Position{ StartLine: 173, - EndLine: 173, - StartPos: 3892, - EndPos: 3894, + EndLine: 173, + StartPos: 3892, + EndPos: 3894, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 173, - EndLine: 173, - StartPos: 3892, - EndPos: 3894, + EndLine: 173, + StartPos: 3892, + EndPos: 3894, }, Value: "Bar", }, @@ -8546,24 +8487,24 @@ func TestPhp7(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 173, - EndLine: 173, - StartPos: 3897, - EndPos: 3907, + EndLine: 173, + StartPos: 3897, + EndPos: 3907, }, Use: &name.Name{ Position: &position.Position{ StartLine: 173, - EndLine: 173, - StartPos: 3897, - EndPos: 3899, + EndLine: 173, + StartPos: 3897, + EndPos: 3899, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 173, - EndLine: 173, - StartPos: 3897, - EndPos: 3899, + EndLine: 173, + StartPos: 3897, + EndPos: 3899, }, Value: "Baz", }, @@ -8572,9 +8513,9 @@ func TestPhp7(t *testing.T) { Alias: &node.Identifier{ Position: &position.Position{ StartLine: 173, - EndLine: 173, - StartPos: 3904, - EndPos: 3907, + EndLine: 173, + StartPos: 3904, + EndPos: 3907, }, Value: "quux", }, @@ -8584,33 +8525,33 @@ func TestPhp7(t *testing.T) { &stmt.GroupUse{ Position: &position.Position{ StartLine: 174, - EndLine: 174, - StartPos: 3913, - EndPos: 3940, + EndLine: 174, + StartPos: 3913, + EndPos: 3940, }, UseType: &node.Identifier{ Position: &position.Position{ StartLine: 174, - EndLine: 174, - StartPos: 3917, - EndPos: 3924, + EndLine: 174, + StartPos: 3917, + EndPos: 3924, }, Value: "function", }, Prefix: &name.Name{ Position: &position.Position{ StartLine: 174, - EndLine: 174, - StartPos: 3926, - EndPos: 3928, + EndLine: 174, + StartPos: 3926, + EndPos: 3928, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 174, - EndLine: 174, - StartPos: 3926, - EndPos: 3928, + EndLine: 174, + StartPos: 3926, + EndPos: 3928, }, Value: "Foo", }, @@ -8620,24 +8561,24 @@ func TestPhp7(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 174, - EndLine: 174, - StartPos: 3931, - EndPos: 3933, + EndLine: 174, + StartPos: 3931, + EndPos: 3933, }, Use: &name.Name{ Position: &position.Position{ StartLine: 174, - EndLine: 174, - StartPos: 3931, - EndPos: 3933, + EndLine: 174, + StartPos: 3931, + EndPos: 3933, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 174, - EndLine: 174, - StartPos: 3931, - EndPos: 3933, + EndLine: 174, + StartPos: 3931, + EndPos: 3933, }, Value: "Bar", }, @@ -8647,24 +8588,24 @@ func TestPhp7(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 174, - EndLine: 174, - StartPos: 3936, - EndPos: 3938, + EndLine: 174, + StartPos: 3936, + EndPos: 3938, }, Use: &name.Name{ Position: &position.Position{ StartLine: 174, - EndLine: 174, - StartPos: 3936, - EndPos: 3938, + EndLine: 174, + StartPos: 3936, + EndPos: 3938, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 174, - EndLine: 174, - StartPos: 3936, - EndPos: 3938, + EndLine: 174, + StartPos: 3936, + EndPos: 3938, }, Value: "Baz", }, @@ -8676,33 +8617,33 @@ func TestPhp7(t *testing.T) { &stmt.GroupUse{ Position: &position.Position{ StartLine: 175, - EndLine: 175, - StartPos: 3944, - EndPos: 3969, + EndLine: 175, + StartPos: 3944, + EndPos: 3969, }, UseType: &node.Identifier{ Position: &position.Position{ StartLine: 175, - EndLine: 175, - StartPos: 3948, - EndPos: 3952, + EndLine: 175, + StartPos: 3948, + EndPos: 3952, }, Value: "const", }, Prefix: &name.Name{ Position: &position.Position{ StartLine: 175, - EndLine: 175, - StartPos: 3955, - EndPos: 3957, + EndLine: 175, + StartPos: 3955, + EndPos: 3957, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 175, - EndLine: 175, - StartPos: 3955, - EndPos: 3957, + EndLine: 175, + StartPos: 3955, + EndPos: 3957, }, Value: "Foo", }, @@ -8712,24 +8653,24 @@ func TestPhp7(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 175, - EndLine: 175, - StartPos: 3960, - EndPos: 3962, + EndLine: 175, + StartPos: 3960, + EndPos: 3962, }, Use: &name.Name{ Position: &position.Position{ StartLine: 175, - EndLine: 175, - StartPos: 3960, - EndPos: 3962, + EndLine: 175, + StartPos: 3960, + EndPos: 3962, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 175, - EndLine: 175, - StartPos: 3960, - EndPos: 3962, + EndLine: 175, + StartPos: 3960, + EndPos: 3962, }, Value: "Bar", }, @@ -8739,24 +8680,24 @@ func TestPhp7(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 175, - EndLine: 175, - StartPos: 3965, - EndPos: 3967, + EndLine: 175, + StartPos: 3965, + EndPos: 3967, }, Use: &name.Name{ Position: &position.Position{ StartLine: 175, - EndLine: 175, - StartPos: 3965, - EndPos: 3967, + EndLine: 175, + StartPos: 3965, + EndPos: 3967, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 175, - EndLine: 175, - StartPos: 3965, - EndPos: 3967, + EndLine: 175, + StartPos: 3965, + EndPos: 3967, }, Value: "Baz", }, @@ -8768,24 +8709,24 @@ func TestPhp7(t *testing.T) { &stmt.GroupUse{ Position: &position.Position{ StartLine: 176, - EndLine: 176, - StartPos: 3973, - EndPos: 4006, + EndLine: 176, + StartPos: 3973, + EndPos: 4006, }, Prefix: &name.Name{ Position: &position.Position{ StartLine: 176, - EndLine: 176, - StartPos: 3977, - EndPos: 3979, + EndLine: 176, + StartPos: 3977, + EndPos: 3979, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 176, - EndLine: 176, - StartPos: 3977, - EndPos: 3979, + EndLine: 176, + StartPos: 3977, + EndPos: 3979, }, Value: "Foo", }, @@ -8795,33 +8736,33 @@ func TestPhp7(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 176, - EndLine: 176, - StartPos: 3988, - EndPos: 3990, + EndLine: 176, + StartPos: 3988, + EndPos: 3990, }, UseType: &node.Identifier{ Position: &position.Position{ StartLine: 176, - EndLine: 176, - StartPos: 3982, - EndPos: 3986, + EndLine: 176, + StartPos: 3982, + EndPos: 3986, }, Value: "const", }, Use: &name.Name{ Position: &position.Position{ StartLine: 176, - EndLine: 176, - StartPos: 3988, - EndPos: 3990, + EndLine: 176, + StartPos: 3988, + EndPos: 3990, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 176, - EndLine: 176, - StartPos: 3988, - EndPos: 3990, + EndLine: 176, + StartPos: 3988, + EndPos: 3990, }, Value: "Bar", }, @@ -8831,33 +8772,33 @@ func TestPhp7(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 176, - EndLine: 176, - StartPos: 4002, - EndPos: 4004, + EndLine: 176, + StartPos: 4002, + EndPos: 4004, }, UseType: &node.Identifier{ Position: &position.Position{ StartLine: 176, - EndLine: 176, - StartPos: 3993, - EndPos: 4000, + EndLine: 176, + StartPos: 3993, + EndPos: 4000, }, Value: "function", }, Use: &name.Name{ Position: &position.Position{ StartLine: 176, - EndLine: 176, - StartPos: 4002, - EndPos: 4004, + EndLine: 176, + StartPos: 4002, + EndPos: 4004, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 176, - EndLine: 176, - StartPos: 4002, - EndPos: 4004, + EndLine: 176, + StartPos: 4002, + EndPos: 4004, }, Value: "Baz", }, @@ -8869,30 +8810,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 178, - EndLine: 178, - StartPos: 4011, - EndPos: 4016, + EndLine: 178, + StartPos: 4011, + EndPos: 4016, }, Expr: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 178, - EndLine: 178, - StartPos: 4011, - EndPos: 4015, + EndLine: 178, + StartPos: 4011, + EndPos: 4015, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 178, - EndLine: 178, - StartPos: 4011, - EndPos: 4012, + EndLine: 178, + StartPos: 4011, + EndPos: 4012, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 178, - EndLine: 178, - StartPos: 4011, - EndPos: 4012, + EndLine: 178, + StartPos: 4011, + EndPos: 4012, }, Value: "a", }, @@ -8900,9 +8841,9 @@ func TestPhp7(t *testing.T) { Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 178, - EndLine: 178, - StartPos: 4014, - EndPos: 4014, + EndLine: 178, + StartPos: 4014, + EndPos: 4014, }, Value: "1", }, @@ -8911,37 +8852,37 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 179, - EndLine: 179, - StartPos: 4020, - EndPos: 4028, + EndLine: 179, + StartPos: 4020, + EndPos: 4028, }, Expr: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 179, - EndLine: 179, - StartPos: 4020, - EndPos: 4027, + EndLine: 179, + StartPos: 4020, + EndPos: 4027, }, Variable: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 179, - EndLine: 179, - StartPos: 4020, - EndPos: 4024, + EndLine: 179, + StartPos: 4020, + EndPos: 4024, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 179, - EndLine: 179, - StartPos: 4020, - EndPos: 4021, + EndLine: 179, + StartPos: 4020, + EndPos: 4021, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 179, - EndLine: 179, - StartPos: 4020, - EndPos: 4021, + EndLine: 179, + StartPos: 4020, + EndPos: 4021, }, Value: "a", }, @@ -8949,9 +8890,9 @@ func TestPhp7(t *testing.T) { Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 179, - EndLine: 179, - StartPos: 4023, - EndPos: 4023, + EndLine: 179, + StartPos: 4023, + EndPos: 4023, }, Value: "1", }, @@ -8959,9 +8900,9 @@ func TestPhp7(t *testing.T) { Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 179, - EndLine: 179, - StartPos: 4026, - EndPos: 4026, + EndLine: 179, + StartPos: 4026, + EndPos: 4026, }, Value: "2", }, @@ -8970,49 +8911,48 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 180, - EndLine: 180, - StartPos: 4032, - EndPos: 4039, + EndLine: 180, + StartPos: 4032, + EndPos: 4039, }, Expr: &expr.Array{ Position: &position.Position{ StartLine: 180, - EndLine: 180, - StartPos: 4032, - EndPos: 4038, - }, - Items: []node.Node{ + EndLine: 180, + StartPos: 4032, + EndPos: 4038, }, + Items: []node.Node{}, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 181, - EndLine: 181, - StartPos: 4043, - EndPos: 4051, + EndLine: 181, + StartPos: 4043, + EndPos: 4051, }, Expr: &expr.Array{ Position: &position.Position{ StartLine: 181, - EndLine: 181, - StartPos: 4043, - EndPos: 4050, + EndLine: 181, + StartPos: 4043, + EndPos: 4050, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 181, - EndLine: 181, - StartPos: 4049, - EndPos: 4049, + EndLine: 181, + StartPos: 4049, + EndPos: 4049, }, Val: &scalar.Lnumber{ Position: &position.Position{ StartLine: 181, - EndLine: 181, - StartPos: 4049, - EndPos: 4049, + EndLine: 181, + StartPos: 4049, + EndPos: 4049, }, Value: "1", }, @@ -9023,40 +8963,40 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 182, - EndLine: 182, - StartPos: 4055, - EndPos: 4072, + EndLine: 182, + StartPos: 4055, + EndPos: 4072, }, Expr: &expr.Array{ Position: &position.Position{ StartLine: 182, - EndLine: 182, - StartPos: 4055, - EndPos: 4071, + EndLine: 182, + StartPos: 4055, + EndPos: 4071, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 182, - EndLine: 182, - StartPos: 4061, - EndPos: 4064, + EndLine: 182, + StartPos: 4061, + EndPos: 4064, }, Key: &scalar.Lnumber{ Position: &position.Position{ StartLine: 182, - EndLine: 182, - StartPos: 4061, - EndPos: 4061, + EndLine: 182, + StartPos: 4061, + EndPos: 4061, }, Value: "1", }, Val: &scalar.Lnumber{ Position: &position.Position{ StartLine: 182, - EndLine: 182, - StartPos: 4064, - EndPos: 4064, + EndLine: 182, + StartPos: 4064, + EndPos: 4064, }, Value: "1", }, @@ -9064,30 +9004,30 @@ func TestPhp7(t *testing.T) { &expr.ArrayItem{ Position: &position.Position{ StartLine: 182, - EndLine: 182, - StartPos: 4067, - EndPos: 4069, + EndLine: 182, + StartPos: 4067, + EndPos: 4069, }, Val: &expr.Reference{ Position: &position.Position{ StartLine: 182, - EndLine: 182, - StartPos: 4067, - EndPos: 4069, + EndLine: 182, + StartPos: 4067, + EndPos: 4069, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 182, - EndLine: 182, - StartPos: 4068, - EndPos: 4069, + EndLine: 182, + StartPos: 4068, + EndPos: 4069, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 182, - EndLine: 182, - StartPos: 4068, - EndPos: 4069, + EndLine: 182, + StartPos: 4068, + EndPos: 4069, }, Value: "b", }, @@ -9100,30 +9040,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 183, - EndLine: 183, - StartPos: 4076, - EndPos: 4079, + EndLine: 183, + StartPos: 4076, + EndPos: 4079, }, Expr: &expr.BitwiseNot{ Position: &position.Position{ StartLine: 183, - EndLine: 183, - StartPos: 4076, - EndPos: 4078, + EndLine: 183, + StartPos: 4076, + EndPos: 4078, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 183, - EndLine: 183, - StartPos: 4077, - EndPos: 4078, + EndLine: 183, + StartPos: 4077, + EndPos: 4078, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 183, - EndLine: 183, - StartPos: 4077, - EndPos: 4078, + EndLine: 183, + StartPos: 4077, + EndPos: 4078, }, Value: "a", }, @@ -9133,30 +9073,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 184, - EndLine: 184, - StartPos: 4083, - EndPos: 4086, + EndLine: 184, + StartPos: 4083, + EndPos: 4086, }, Expr: &expr.BooleanNot{ Position: &position.Position{ StartLine: 184, - EndLine: 184, - StartPos: 4083, - EndPos: 4085, + EndLine: 184, + StartPos: 4083, + EndPos: 4085, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 184, - EndLine: 184, - StartPos: 4084, - EndPos: 4085, + EndLine: 184, + StartPos: 4084, + EndPos: 4085, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 184, - EndLine: 184, - StartPos: 4084, - EndPos: 4085, + EndLine: 184, + StartPos: 4084, + EndPos: 4085, }, Value: "a", }, @@ -9166,31 +9106,31 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 186, - EndLine: 186, - StartPos: 4091, - EndPos: 4099, + EndLine: 186, + StartPos: 4091, + EndPos: 4099, }, Expr: &expr.ClassConstFetch{ Position: &position.Position{ StartLine: 186, - EndLine: 186, - StartPos: 4091, - EndPos: 4098, + EndLine: 186, + StartPos: 4091, + EndPos: 4098, }, Class: &name.Name{ Position: &position.Position{ StartLine: 186, - EndLine: 186, - StartPos: 4091, - EndPos: 4093, + EndLine: 186, + StartPos: 4091, + EndPos: 4093, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 186, - EndLine: 186, - StartPos: 4091, - EndPos: 4093, + EndLine: 186, + StartPos: 4091, + EndPos: 4093, }, Value: "Foo", }, @@ -9199,9 +9139,9 @@ func TestPhp7(t *testing.T) { ConstantName: &node.Identifier{ Position: &position.Position{ StartLine: 186, - EndLine: 186, - StartPos: 4096, - EndPos: 4098, + EndLine: 186, + StartPos: 4096, + EndPos: 4098, }, Value: "Bar", }, @@ -9210,30 +9150,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 187, - EndLine: 187, - StartPos: 4103, - EndPos: 4112, + EndLine: 187, + StartPos: 4103, + EndPos: 4112, }, Expr: &expr.ClassConstFetch{ Position: &position.Position{ StartLine: 187, - EndLine: 187, - StartPos: 4103, - EndPos: 4111, + EndLine: 187, + StartPos: 4103, + EndPos: 4111, }, Class: &expr.Variable{ Position: &position.Position{ StartLine: 187, - EndLine: 187, - StartPos: 4103, - EndPos: 4106, + EndLine: 187, + StartPos: 4103, + EndPos: 4106, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 187, - EndLine: 187, - StartPos: 4103, - EndPos: 4106, + EndLine: 187, + StartPos: 4103, + EndPos: 4106, }, Value: "foo", }, @@ -9241,9 +9181,9 @@ func TestPhp7(t *testing.T) { ConstantName: &node.Identifier{ Position: &position.Position{ StartLine: 187, - EndLine: 187, - StartPos: 4109, - EndPos: 4111, + EndLine: 187, + StartPos: 4109, + EndPos: 4111, }, Value: "Bar", }, @@ -9252,30 +9192,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 188, - EndLine: 188, - StartPos: 4116, - EndPos: 4125, + EndLine: 188, + StartPos: 4116, + EndPos: 4125, }, Expr: &expr.Clone{ Position: &position.Position{ StartLine: 188, - EndLine: 188, - StartPos: 4116, - EndPos: 4123, + EndLine: 188, + StartPos: 4116, + EndPos: 4123, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 188, - EndLine: 188, - StartPos: 4122, - EndPos: 4123, + EndLine: 188, + StartPos: 4122, + EndPos: 4123, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 188, - EndLine: 188, - StartPos: 4122, - EndPos: 4123, + EndLine: 188, + StartPos: 4122, + EndPos: 4123, }, Value: "a", }, @@ -9285,30 +9225,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 189, - EndLine: 189, - StartPos: 4129, - EndPos: 4137, + EndLine: 189, + StartPos: 4129, + EndPos: 4137, }, Expr: &expr.Clone{ Position: &position.Position{ StartLine: 189, - EndLine: 189, - StartPos: 4129, - EndPos: 4136, + EndLine: 189, + StartPos: 4129, + EndPos: 4136, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 189, - EndLine: 189, - StartPos: 4135, - EndPos: 4136, + EndLine: 189, + StartPos: 4135, + EndPos: 4136, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 189, - EndLine: 189, - StartPos: 4135, - EndPos: 4136, + EndLine: 189, + StartPos: 4135, + EndPos: 4136, }, Value: "a", }, @@ -9318,64 +9258,63 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 190, - EndLine: 190, - StartPos: 4141, - EndPos: 4153, + EndLine: 190, + StartPos: 4141, + EndPos: 4153, }, Expr: &expr.Closure{ Position: &position.Position{ StartLine: 190, - EndLine: 190, - StartPos: 4141, - EndPos: 4152, + EndLine: 190, + StartPos: 4141, + EndPos: 4152, }, - ReturnsRef: false, - Static: false, + ReturnsRef: false, + Static: false, PhpDocComment: "", - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 191, - EndLine: 191, - StartPos: 4157, - EndPos: 4190, + EndLine: 191, + StartPos: 4157, + EndPos: 4190, }, Expr: &expr.Closure{ Position: &position.Position{ StartLine: 191, - EndLine: 191, - StartPos: 4157, - EndPos: 4189, + EndLine: 191, + StartPos: 4157, + EndPos: 4189, }, - Static: false, + Static: false, PhpDocComment: "", - ReturnsRef: false, + ReturnsRef: false, Params: []node.Node{ &node.Parameter{ Position: &position.Position{ StartLine: 191, - EndLine: 191, - StartPos: 4166, - EndPos: 4167, + EndLine: 191, + StartPos: 4166, + EndPos: 4167, }, - ByRef: false, + ByRef: false, Variadic: false, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 191, - EndLine: 191, - StartPos: 4166, - EndPos: 4167, + EndLine: 191, + StartPos: 4166, + EndPos: 4167, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 191, - EndLine: 191, - StartPos: 4166, - EndPos: 4167, + EndLine: 191, + StartPos: 4166, + EndPos: 4167, }, Value: "a", }, @@ -9384,25 +9323,25 @@ func TestPhp7(t *testing.T) { &node.Parameter{ Position: &position.Position{ StartLine: 191, - EndLine: 191, - StartPos: 4170, - EndPos: 4171, + EndLine: 191, + StartPos: 4170, + EndPos: 4171, }, + ByRef: false, Variadic: false, - ByRef: false, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 191, - EndLine: 191, - StartPos: 4170, - EndPos: 4171, + EndLine: 191, + StartPos: 4170, + EndPos: 4171, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 191, - EndLine: 191, - StartPos: 4170, - EndPos: 4171, + EndLine: 191, + StartPos: 4170, + EndPos: 4171, }, Value: "b", }, @@ -9412,24 +9351,24 @@ func TestPhp7(t *testing.T) { ClosureUse: &expr.ClosureUse{ Position: &position.Position{ StartLine: 191, - EndLine: 191, - StartPos: 4174, - EndPos: 4186, + EndLine: 191, + StartPos: 4174, + EndPos: 4186, }, Uses: []node.Node{ &expr.Variable{ Position: &position.Position{ StartLine: 191, - EndLine: 191, - StartPos: 4179, - EndPos: 4180, + EndLine: 191, + StartPos: 4179, + EndPos: 4180, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 191, - EndLine: 191, - StartPos: 4179, - EndPos: 4180, + EndLine: 191, + StartPos: 4179, + EndPos: 4180, }, Value: "c", }, @@ -9437,23 +9376,23 @@ func TestPhp7(t *testing.T) { &expr.Reference{ Position: &position.Position{ StartLine: 191, - EndLine: 191, - StartPos: 4183, - EndPos: 4185, + EndLine: 191, + StartPos: 4183, + EndPos: 4185, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 191, - EndLine: 191, - StartPos: 4184, - EndPos: 4185, + EndLine: 191, + StartPos: 4184, + EndPos: 4185, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 191, - EndLine: 191, - StartPos: 4184, - EndPos: 4185, + EndLine: 191, + StartPos: 4184, + EndPos: 4185, }, Value: "d", }, @@ -9461,78 +9400,76 @@ func TestPhp7(t *testing.T) { }, }, }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 192, - EndLine: 192, - StartPos: 4194, - EndPos: 4213, + EndLine: 192, + StartPos: 4194, + EndPos: 4213, }, Expr: &expr.Closure{ Position: &position.Position{ StartLine: 192, - EndLine: 192, - StartPos: 4194, - EndPos: 4212, + EndLine: 192, + StartPos: 4194, + EndPos: 4212, }, - ReturnsRef: false, - Static: false, + Static: false, PhpDocComment: "", + ReturnsRef: false, ReturnType: &name.Name{ Position: &position.Position{ StartLine: 192, - EndLine: 192, - StartPos: 4206, - EndPos: 4209, + EndLine: 192, + StartPos: 4206, + EndPos: 4209, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 192, - EndLine: 192, - StartPos: 4206, - EndPos: 4209, + EndLine: 192, + StartPos: 4206, + EndPos: 4209, }, Value: "void", }, }, }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 193, - EndLine: 193, - StartPos: 4217, - EndPos: 4220, + EndLine: 193, + StartPos: 4217, + EndPos: 4220, }, Expr: &expr.ConstFetch{ Position: &position.Position{ StartLine: 193, - EndLine: 193, - StartPos: 4217, - EndPos: 4219, + EndLine: 193, + StartPos: 4217, + EndPos: 4219, }, Constant: &name.Name{ Position: &position.Position{ StartLine: 193, - EndLine: 193, - StartPos: 4217, - EndPos: 4219, + EndLine: 193, + StartPos: 4217, + EndPos: 4219, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 193, - EndLine: 193, - StartPos: 4217, - EndPos: 4219, + EndLine: 193, + StartPos: 4217, + EndPos: 4219, }, Value: "foo", }, @@ -9543,31 +9480,31 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 194, - EndLine: 194, - StartPos: 4224, - EndPos: 4237, + EndLine: 194, + StartPos: 4224, + EndPos: 4237, }, Expr: &expr.ConstFetch{ Position: &position.Position{ StartLine: 194, - EndLine: 194, - StartPos: 4224, - EndPos: 4236, + EndLine: 194, + StartPos: 4224, + EndPos: 4236, }, Constant: &name.Relative{ Position: &position.Position{ StartLine: 194, - EndLine: 194, - StartPos: 4224, - EndPos: 4236, + EndLine: 194, + StartPos: 4224, + EndPos: 4236, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 194, - EndLine: 194, - StartPos: 4234, - EndPos: 4236, + EndLine: 194, + StartPos: 4234, + EndPos: 4236, }, Value: "foo", }, @@ -9578,31 +9515,31 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 195, - EndLine: 195, - StartPos: 4241, - EndPos: 4245, + EndLine: 195, + StartPos: 4241, + EndPos: 4245, }, Expr: &expr.ConstFetch{ Position: &position.Position{ StartLine: 195, - EndLine: 195, - StartPos: 4241, - EndPos: 4244, + EndLine: 195, + StartPos: 4241, + EndPos: 4244, }, Constant: &name.FullyQualified{ Position: &position.Position{ StartLine: 195, - EndLine: 195, - StartPos: 4241, - EndPos: 4244, + EndLine: 195, + StartPos: 4241, + EndPos: 4244, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 195, - EndLine: 195, - StartPos: 4242, - EndPos: 4244, + EndLine: 195, + StartPos: 4242, + EndPos: 4244, }, Value: "foo", }, @@ -9613,30 +9550,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 197, - EndLine: 197, - StartPos: 4250, - EndPos: 4259, + EndLine: 197, + StartPos: 4250, + EndPos: 4259, }, Expr: &expr.Empty{ Position: &position.Position{ StartLine: 197, - EndLine: 197, - StartPos: 4250, - EndPos: 4258, + EndLine: 197, + StartPos: 4250, + EndPos: 4258, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 197, - EndLine: 197, - StartPos: 4256, - EndPos: 4257, + EndLine: 197, + StartPos: 4256, + EndPos: 4257, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 197, - EndLine: 197, - StartPos: 4256, - EndPos: 4257, + EndLine: 197, + StartPos: 4256, + EndPos: 4257, }, Value: "a", }, @@ -9646,30 +9583,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 198, - EndLine: 198, - StartPos: 4263, - EndPos: 4266, + EndLine: 198, + StartPos: 4263, + EndPos: 4266, }, Expr: &expr.ErrorSuppress{ Position: &position.Position{ StartLine: 198, - EndLine: 198, - StartPos: 4263, - EndPos: 4265, + EndLine: 198, + StartPos: 4263, + EndPos: 4265, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 198, - EndLine: 198, - StartPos: 4264, - EndPos: 4265, + EndLine: 198, + StartPos: 4264, + EndPos: 4265, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 198, - EndLine: 198, - StartPos: 4264, - EndPos: 4265, + EndLine: 198, + StartPos: 4264, + EndPos: 4265, }, Value: "a", }, @@ -9679,30 +9616,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 199, - EndLine: 199, - StartPos: 4270, - EndPos: 4278, + EndLine: 199, + StartPos: 4270, + EndPos: 4278, }, Expr: &expr.Eval{ Position: &position.Position{ StartLine: 199, - EndLine: 199, - StartPos: 4270, - EndPos: 4277, + EndLine: 199, + StartPos: 4270, + EndPos: 4277, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 199, - EndLine: 199, - StartPos: 4275, - EndPos: 4276, + EndLine: 199, + StartPos: 4275, + EndPos: 4276, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 199, - EndLine: 199, - StartPos: 4275, - EndPos: 4276, + EndLine: 199, + StartPos: 4275, + EndPos: 4276, }, Value: "a", }, @@ -9712,46 +9649,46 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 200, - EndLine: 200, - StartPos: 4282, - EndPos: 4286, + EndLine: 200, + StartPos: 4282, + EndPos: 4286, }, Expr: &expr.Exit{ Position: &position.Position{ StartLine: 200, - EndLine: 200, - StartPos: 4282, - EndPos: 4285, + EndLine: 200, + StartPos: 4282, + EndPos: 4285, }, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 201, - EndLine: 201, - StartPos: 4290, - EndPos: 4298, + EndLine: 201, + StartPos: 4290, + EndPos: 4298, }, Expr: &expr.Exit{ Position: &position.Position{ StartLine: 201, - EndLine: 201, - StartPos: 4290, - EndPos: 4297, + EndLine: 201, + StartPos: 4290, + EndPos: 4297, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 201, - EndLine: 201, - StartPos: 4295, - EndPos: 4296, + EndLine: 201, + StartPos: 4295, + EndPos: 4296, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 201, - EndLine: 201, - StartPos: 4295, - EndPos: 4296, + EndLine: 201, + StartPos: 4295, + EndPos: 4296, }, Value: "a", }, @@ -9761,46 +9698,46 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 202, - EndLine: 202, - StartPos: 4302, - EndPos: 4305, + EndLine: 202, + StartPos: 4302, + EndPos: 4305, }, Expr: &expr.Die{ Position: &position.Position{ StartLine: 202, - EndLine: 202, - StartPos: 4302, - EndPos: 4304, + EndLine: 202, + StartPos: 4302, + EndPos: 4304, }, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 203, - EndLine: 203, - StartPos: 4309, - EndPos: 4316, + EndLine: 203, + StartPos: 4309, + EndPos: 4316, }, Expr: &expr.Die{ Position: &position.Position{ StartLine: 203, - EndLine: 203, - StartPos: 4309, - EndPos: 4315, + EndLine: 203, + StartPos: 4309, + EndPos: 4315, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 203, - EndLine: 203, - StartPos: 4313, - EndPos: 4314, + EndLine: 203, + StartPos: 4313, + EndPos: 4314, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 203, - EndLine: 203, - StartPos: 4313, - EndPos: 4314, + EndLine: 203, + StartPos: 4313, + EndPos: 4314, }, Value: "a", }, @@ -9810,31 +9747,31 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 204, - EndLine: 204, - StartPos: 4320, - EndPos: 4325, + EndLine: 204, + StartPos: 4320, + EndPos: 4325, }, Expr: &expr.FunctionCall{ Position: &position.Position{ StartLine: 204, - EndLine: 204, - StartPos: 4320, - EndPos: 4324, + EndLine: 204, + StartPos: 4320, + EndPos: 4324, }, Function: &name.Name{ Position: &position.Position{ StartLine: 204, - EndLine: 204, - StartPos: 4320, - EndPos: 4322, + EndLine: 204, + StartPos: 4320, + EndPos: 4322, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 204, - EndLine: 204, - StartPos: 4320, - EndPos: 4322, + EndLine: 204, + StartPos: 4320, + EndPos: 4322, }, Value: "foo", }, @@ -9843,9 +9780,9 @@ func TestPhp7(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 204, - EndLine: 204, - StartPos: 4323, - EndPos: 4324, + EndLine: 204, + StartPos: 4323, + EndPos: 4324, }, }, }, @@ -9853,31 +9790,31 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 205, - EndLine: 205, - StartPos: 4329, - EndPos: 4344, + EndLine: 205, + StartPos: 4329, + EndPos: 4344, }, Expr: &expr.FunctionCall{ Position: &position.Position{ StartLine: 205, - EndLine: 205, - StartPos: 4329, - EndPos: 4343, + EndLine: 205, + StartPos: 4329, + EndPos: 4343, }, Function: &name.Relative{ Position: &position.Position{ StartLine: 205, - EndLine: 205, - StartPos: 4329, - EndPos: 4341, + EndLine: 205, + StartPos: 4329, + EndPos: 4341, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 205, - EndLine: 205, - StartPos: 4339, - EndPos: 4341, + EndLine: 205, + StartPos: 4339, + EndPos: 4341, }, Value: "foo", }, @@ -9886,9 +9823,9 @@ func TestPhp7(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 205, - EndLine: 205, - StartPos: 4342, - EndPos: 4343, + EndLine: 205, + StartPos: 4342, + EndPos: 4343, }, }, }, @@ -9896,31 +9833,31 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 206, - EndLine: 206, - StartPos: 4348, - EndPos: 4354, + EndLine: 206, + StartPos: 4348, + EndPos: 4354, }, Expr: &expr.FunctionCall{ Position: &position.Position{ StartLine: 206, - EndLine: 206, - StartPos: 4348, - EndPos: 4353, + EndLine: 206, + StartPos: 4348, + EndPos: 4353, }, Function: &name.FullyQualified{ Position: &position.Position{ StartLine: 206, - EndLine: 206, - StartPos: 4348, - EndPos: 4351, + EndLine: 206, + StartPos: 4348, + EndPos: 4351, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 206, - EndLine: 206, - StartPos: 4349, - EndPos: 4351, + EndLine: 206, + StartPos: 4349, + EndPos: 4351, }, Value: "foo", }, @@ -9929,9 +9866,9 @@ func TestPhp7(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 206, - EndLine: 206, - StartPos: 4352, - EndPos: 4353, + EndLine: 206, + StartPos: 4352, + EndPos: 4353, }, }, }, @@ -9939,30 +9876,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 207, - EndLine: 207, - StartPos: 4358, - EndPos: 4364, + EndLine: 207, + StartPos: 4358, + EndPos: 4364, }, Expr: &expr.FunctionCall{ Position: &position.Position{ StartLine: 207, - EndLine: 207, - StartPos: 4358, - EndPos: 4363, + EndLine: 207, + StartPos: 4358, + EndPos: 4363, }, Function: &expr.Variable{ Position: &position.Position{ StartLine: 207, - EndLine: 207, - StartPos: 4358, - EndPos: 4361, + EndLine: 207, + StartPos: 4358, + EndPos: 4361, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 207, - EndLine: 207, - StartPos: 4358, - EndPos: 4361, + EndLine: 207, + StartPos: 4358, + EndPos: 4361, }, Value: "foo", }, @@ -9970,9 +9907,9 @@ func TestPhp7(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 207, - EndLine: 207, - StartPos: 4362, - EndPos: 4363, + EndLine: 207, + StartPos: 4362, + EndPos: 4363, }, }, }, @@ -9980,30 +9917,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 209, - EndLine: 209, - StartPos: 4369, - EndPos: 4373, + EndLine: 209, + StartPos: 4369, + EndPos: 4373, }, Expr: &expr.PostDec{ Position: &position.Position{ StartLine: 209, - EndLine: 209, - StartPos: 4369, - EndPos: 4372, + EndLine: 209, + StartPos: 4369, + EndPos: 4372, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 209, - EndLine: 209, - StartPos: 4369, - EndPos: 4370, + EndLine: 209, + StartPos: 4369, + EndPos: 4370, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 209, - EndLine: 209, - StartPos: 4369, - EndPos: 4370, + EndLine: 209, + StartPos: 4369, + EndPos: 4370, }, Value: "a", }, @@ -10013,30 +9950,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 210, - EndLine: 210, - StartPos: 4377, - EndPos: 4381, + EndLine: 210, + StartPos: 4377, + EndPos: 4381, }, Expr: &expr.PostInc{ Position: &position.Position{ StartLine: 210, - EndLine: 210, - StartPos: 4377, - EndPos: 4380, + EndLine: 210, + StartPos: 4377, + EndPos: 4380, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 210, - EndLine: 210, - StartPos: 4377, - EndPos: 4378, + EndLine: 210, + StartPos: 4377, + EndPos: 4378, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 210, - EndLine: 210, - StartPos: 4377, - EndPos: 4378, + EndLine: 210, + StartPos: 4377, + EndPos: 4378, }, Value: "a", }, @@ -10046,30 +9983,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 211, - EndLine: 211, - StartPos: 4385, - EndPos: 4389, + EndLine: 211, + StartPos: 4385, + EndPos: 4389, }, Expr: &expr.PreDec{ Position: &position.Position{ StartLine: 211, - EndLine: 211, - StartPos: 4385, - EndPos: 4388, + EndLine: 211, + StartPos: 4385, + EndPos: 4388, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 211, - EndLine: 211, - StartPos: 4387, - EndPos: 4388, + EndLine: 211, + StartPos: 4387, + EndPos: 4388, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 211, - EndLine: 211, - StartPos: 4387, - EndPos: 4388, + EndLine: 211, + StartPos: 4387, + EndPos: 4388, }, Value: "a", }, @@ -10079,30 +10016,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 212, - EndLine: 212, - StartPos: 4393, - EndPos: 4397, + EndLine: 212, + StartPos: 4393, + EndPos: 4397, }, Expr: &expr.PreInc{ Position: &position.Position{ StartLine: 212, - EndLine: 212, - StartPos: 4393, - EndPos: 4396, + EndLine: 212, + StartPos: 4393, + EndPos: 4396, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 212, - EndLine: 212, - StartPos: 4395, - EndPos: 4396, + EndLine: 212, + StartPos: 4395, + EndPos: 4396, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 212, - EndLine: 212, - StartPos: 4395, - EndPos: 4396, + EndLine: 212, + StartPos: 4395, + EndPos: 4396, }, Value: "a", }, @@ -10112,30 +10049,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 214, - EndLine: 214, - StartPos: 4402, - EndPos: 4412, + EndLine: 214, + StartPos: 4402, + EndPos: 4412, }, Expr: &expr.Include{ Position: &position.Position{ StartLine: 214, - EndLine: 214, - StartPos: 4402, - EndPos: 4411, + EndLine: 214, + StartPos: 4402, + EndPos: 4411, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 214, - EndLine: 214, - StartPos: 4410, - EndPos: 4411, + EndLine: 214, + StartPos: 4410, + EndPos: 4411, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 214, - EndLine: 214, - StartPos: 4410, - EndPos: 4411, + EndLine: 214, + StartPos: 4410, + EndPos: 4411, }, Value: "a", }, @@ -10145,30 +10082,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 215, - EndLine: 215, - StartPos: 4416, - EndPos: 4431, + EndLine: 215, + StartPos: 4416, + EndPos: 4431, }, Expr: &expr.IncludeOnce{ Position: &position.Position{ StartLine: 215, - EndLine: 215, - StartPos: 4416, - EndPos: 4430, + EndLine: 215, + StartPos: 4416, + EndPos: 4430, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 215, - EndLine: 215, - StartPos: 4429, - EndPos: 4430, + EndLine: 215, + StartPos: 4429, + EndPos: 4430, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 215, - EndLine: 215, - StartPos: 4429, - EndPos: 4430, + EndLine: 215, + StartPos: 4429, + EndPos: 4430, }, Value: "a", }, @@ -10178,30 +10115,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 216, - EndLine: 216, - StartPos: 4435, - EndPos: 4445, + EndLine: 216, + StartPos: 4435, + EndPos: 4445, }, Expr: &expr.Require{ Position: &position.Position{ StartLine: 216, - EndLine: 216, - StartPos: 4435, - EndPos: 4444, + EndLine: 216, + StartPos: 4435, + EndPos: 4444, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 216, - EndLine: 216, - StartPos: 4443, - EndPos: 4444, + EndLine: 216, + StartPos: 4443, + EndPos: 4444, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 216, - EndLine: 216, - StartPos: 4443, - EndPos: 4444, + EndLine: 216, + StartPos: 4443, + EndPos: 4444, }, Value: "a", }, @@ -10211,30 +10148,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 217, - EndLine: 217, - StartPos: 4449, - EndPos: 4464, + EndLine: 217, + StartPos: 4449, + EndPos: 4464, }, Expr: &expr.RequireOnce{ Position: &position.Position{ StartLine: 217, - EndLine: 217, - StartPos: 4449, - EndPos: 4463, + EndLine: 217, + StartPos: 4449, + EndPos: 4463, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 217, - EndLine: 217, - StartPos: 4462, - EndPos: 4463, + EndLine: 217, + StartPos: 4462, + EndPos: 4463, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 217, - EndLine: 217, - StartPos: 4462, - EndPos: 4463, + EndLine: 217, + StartPos: 4462, + EndPos: 4463, }, Value: "a", }, @@ -10244,30 +10181,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 219, - EndLine: 219, - StartPos: 4469, - EndPos: 4486, + EndLine: 219, + StartPos: 4469, + EndPos: 4486, }, Expr: &expr.InstanceOf{ Position: &position.Position{ StartLine: 219, - EndLine: 219, - StartPos: 4469, - EndPos: 4485, + EndLine: 219, + StartPos: 4469, + EndPos: 4485, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 219, - EndLine: 219, - StartPos: 4469, - EndPos: 4470, + EndLine: 219, + StartPos: 4469, + EndPos: 4470, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 219, - EndLine: 219, - StartPos: 4469, - EndPos: 4470, + EndLine: 219, + StartPos: 4469, + EndPos: 4470, }, Value: "a", }, @@ -10275,17 +10212,17 @@ func TestPhp7(t *testing.T) { Class: &name.Name{ Position: &position.Position{ StartLine: 219, - EndLine: 219, - StartPos: 4483, - EndPos: 4485, + EndLine: 219, + StartPos: 4483, + EndPos: 4485, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 219, - EndLine: 219, - StartPos: 4483, - EndPos: 4485, + EndLine: 219, + StartPos: 4483, + EndPos: 4485, }, Value: "Foo", }, @@ -10296,30 +10233,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 220, - EndLine: 220, - StartPos: 4490, - EndPos: 4517, + EndLine: 220, + StartPos: 4490, + EndPos: 4517, }, Expr: &expr.InstanceOf{ Position: &position.Position{ StartLine: 220, - EndLine: 220, - StartPos: 4490, - EndPos: 4516, + EndLine: 220, + StartPos: 4490, + EndPos: 4516, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 220, - EndLine: 220, - StartPos: 4490, - EndPos: 4491, + EndLine: 220, + StartPos: 4490, + EndPos: 4491, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 220, - EndLine: 220, - StartPos: 4490, - EndPos: 4491, + EndLine: 220, + StartPos: 4490, + EndPos: 4491, }, Value: "a", }, @@ -10327,17 +10264,17 @@ func TestPhp7(t *testing.T) { Class: &name.Relative{ Position: &position.Position{ StartLine: 220, - EndLine: 220, - StartPos: 4504, - EndPos: 4516, + EndLine: 220, + StartPos: 4504, + EndPos: 4516, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 220, - EndLine: 220, - StartPos: 4514, - EndPos: 4516, + EndLine: 220, + StartPos: 4514, + EndPos: 4516, }, Value: "Foo", }, @@ -10348,30 +10285,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 221, - EndLine: 221, - StartPos: 4521, - EndPos: 4539, + EndLine: 221, + StartPos: 4521, + EndPos: 4539, }, Expr: &expr.InstanceOf{ Position: &position.Position{ StartLine: 221, - EndLine: 221, - StartPos: 4521, - EndPos: 4538, + EndLine: 221, + StartPos: 4521, + EndPos: 4538, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 221, - EndLine: 221, - StartPos: 4521, - EndPos: 4522, + EndLine: 221, + StartPos: 4521, + EndPos: 4522, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 221, - EndLine: 221, - StartPos: 4521, - EndPos: 4522, + EndLine: 221, + StartPos: 4521, + EndPos: 4522, }, Value: "a", }, @@ -10379,17 +10316,17 @@ func TestPhp7(t *testing.T) { Class: &name.FullyQualified{ Position: &position.Position{ StartLine: 221, - EndLine: 221, - StartPos: 4535, - EndPos: 4538, + EndLine: 221, + StartPos: 4535, + EndPos: 4538, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 221, - EndLine: 221, - StartPos: 4536, - EndPos: 4538, + EndLine: 221, + StartPos: 4536, + EndPos: 4538, }, Value: "Foo", }, @@ -10400,31 +10337,31 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 223, - EndLine: 223, - StartPos: 4544, - EndPos: 4557, + EndLine: 223, + StartPos: 4544, + EndPos: 4557, }, Expr: &expr.Isset{ Position: &position.Position{ StartLine: 223, - EndLine: 223, - StartPos: 4544, - EndPos: 4556, + EndLine: 223, + StartPos: 4544, + EndPos: 4556, }, Variables: []node.Node{ &expr.Variable{ Position: &position.Position{ StartLine: 223, - EndLine: 223, - StartPos: 4550, - EndPos: 4551, + EndLine: 223, + StartPos: 4550, + EndPos: 4551, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 223, - EndLine: 223, - StartPos: 4550, - EndPos: 4551, + EndLine: 223, + StartPos: 4550, + EndPos: 4551, }, Value: "a", }, @@ -10432,16 +10369,16 @@ func TestPhp7(t *testing.T) { &expr.Variable{ Position: &position.Position{ StartLine: 223, - EndLine: 223, - StartPos: 4554, - EndPos: 4555, + EndLine: 223, + StartPos: 4554, + EndPos: 4555, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 223, - EndLine: 223, - StartPos: 4554, - EndPos: 4555, + EndLine: 223, + StartPos: 4554, + EndPos: 4555, }, Value: "b", }, @@ -10452,45 +10389,45 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 224, - EndLine: 224, - StartPos: 4561, - EndPos: 4574, + EndLine: 224, + StartPos: 4561, + EndPos: 4574, }, Expr: &assign.Assign{ Position: &position.Position{ StartLine: 224, - EndLine: 224, - StartPos: 4561, - EndPos: 4573, + EndLine: 224, + StartPos: 4561, + EndPos: 4573, }, Variable: &expr.List{ Position: &position.Position{ StartLine: 224, - EndLine: 224, - StartPos: 4561, - EndPos: 4568, + EndLine: 224, + StartPos: 4561, + EndPos: 4568, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 224, - EndLine: 224, - StartPos: 4566, - EndPos: 4567, + EndLine: 224, + StartPos: 4566, + EndPos: 4567, }, Val: &expr.Variable{ Position: &position.Position{ StartLine: 224, - EndLine: 224, - StartPos: 4566, - EndPos: 4567, + EndLine: 224, + StartPos: 4566, + EndPos: 4567, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 224, - EndLine: 224, - StartPos: 4566, - EndPos: 4567, + EndLine: 224, + StartPos: 4566, + EndPos: 4567, }, Value: "a", }, @@ -10501,16 +10438,16 @@ func TestPhp7(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 224, - EndLine: 224, - StartPos: 4572, - EndPos: 4573, + EndLine: 224, + StartPos: 4572, + EndPos: 4573, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 224, - EndLine: 224, - StartPos: 4572, - EndPos: 4573, + EndLine: 224, + StartPos: 4572, + EndPos: 4573, }, Value: "b", }, @@ -10520,52 +10457,52 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 225, - EndLine: 225, - StartPos: 4578, - EndPos: 4593, + EndLine: 225, + StartPos: 4578, + EndPos: 4593, }, Expr: &assign.Assign{ Position: &position.Position{ StartLine: 225, - EndLine: 225, - StartPos: 4578, - EndPos: 4592, + EndLine: 225, + StartPos: 4578, + EndPos: 4592, }, Variable: &expr.List{ Position: &position.Position{ StartLine: 225, - EndLine: 225, - StartPos: 4578, - EndPos: 4587, + EndLine: 225, + StartPos: 4578, + EndPos: 4587, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 225, - EndLine: 225, - StartPos: 4583, - EndPos: 4586, + EndLine: 225, + StartPos: 4583, + EndPos: 4586, }, Val: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 225, - EndLine: 225, - StartPos: 4583, - EndPos: 4586, + EndLine: 225, + StartPos: 4583, + EndPos: 4586, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 225, - EndLine: 225, - StartPos: 4583, - EndPos: 4584, + EndLine: 225, + StartPos: 4583, + EndPos: 4584, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 225, - EndLine: 225, - StartPos: 4583, - EndPos: 4584, + EndLine: 225, + StartPos: 4583, + EndPos: 4584, }, Value: "a", }, @@ -10577,16 +10514,16 @@ func TestPhp7(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 225, - EndLine: 225, - StartPos: 4591, - EndPos: 4592, + EndLine: 225, + StartPos: 4591, + EndPos: 4592, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 225, - EndLine: 225, - StartPos: 4591, - EndPos: 4592, + EndLine: 225, + StartPos: 4591, + EndPos: 4592, }, Value: "b", }, @@ -10596,60 +10533,60 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 226, - EndLine: 226, - StartPos: 4597, - EndPos: 4616, + EndLine: 226, + StartPos: 4597, + EndPos: 4616, }, Expr: &assign.Assign{ Position: &position.Position{ StartLine: 226, - EndLine: 226, - StartPos: 4597, - EndPos: 4615, + EndLine: 226, + StartPos: 4597, + EndPos: 4615, }, Variable: &expr.List{ Position: &position.Position{ StartLine: 226, - EndLine: 226, - StartPos: 4597, - EndPos: 4610, + EndLine: 226, + StartPos: 4597, + EndPos: 4610, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 226, - EndLine: 226, - StartPos: 4602, - EndPos: 4609, + EndLine: 226, + StartPos: 4602, + EndPos: 4609, }, Val: &expr.List{ Position: &position.Position{ StartLine: 226, - EndLine: 226, - StartPos: 4602, - EndPos: 4609, + EndLine: 226, + StartPos: 4602, + EndPos: 4609, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 226, - EndLine: 226, - StartPos: 4607, - EndPos: 4608, + EndLine: 226, + StartPos: 4607, + EndPos: 4608, }, Val: &expr.Variable{ Position: &position.Position{ StartLine: 226, - EndLine: 226, - StartPos: 4607, - EndPos: 4608, + EndLine: 226, + StartPos: 4607, + EndPos: 4608, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 226, - EndLine: 226, - StartPos: 4607, - EndPos: 4608, + EndLine: 226, + StartPos: 4607, + EndPos: 4608, }, Value: "a", }, @@ -10663,16 +10600,16 @@ func TestPhp7(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 226, - EndLine: 226, - StartPos: 4614, - EndPos: 4615, + EndLine: 226, + StartPos: 4614, + EndPos: 4615, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 226, - EndLine: 226, - StartPos: 4614, - EndPos: 4615, + EndLine: 226, + StartPos: 4614, + EndPos: 4615, }, Value: "b", }, @@ -10682,30 +10619,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 228, - EndLine: 228, - StartPos: 4621, - EndPos: 4630, + EndLine: 228, + StartPos: 4621, + EndPos: 4630, }, Expr: &expr.MethodCall{ Position: &position.Position{ StartLine: 228, - EndLine: 228, - StartPos: 4621, - EndPos: 4629, + EndLine: 228, + StartPos: 4621, + EndPos: 4629, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 228, - EndLine: 228, - StartPos: 4621, - EndPos: 4622, + EndLine: 228, + StartPos: 4621, + EndPos: 4622, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 228, - EndLine: 228, - StartPos: 4621, - EndPos: 4622, + EndLine: 228, + StartPos: 4621, + EndPos: 4622, }, Value: "a", }, @@ -10713,18 +10650,18 @@ func TestPhp7(t *testing.T) { Method: &node.Identifier{ Position: &position.Position{ StartLine: 228, - EndLine: 228, - StartPos: 4625, - EndPos: 4627, + EndLine: 228, + StartPos: 4625, + EndPos: 4627, }, Value: "foo", }, ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 228, - EndLine: 228, - StartPos: 4628, - EndPos: 4629, + EndLine: 228, + StartPos: 4628, + EndPos: 4629, }, }, }, @@ -10732,31 +10669,31 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 229, - EndLine: 229, - StartPos: 4634, - EndPos: 4643, + EndLine: 229, + StartPos: 4634, + EndPos: 4643, }, Expr: &expr.New{ Position: &position.Position{ StartLine: 229, - EndLine: 229, - StartPos: 4634, - EndPos: 4642, + EndLine: 229, + StartPos: 4634, + EndPos: 4642, }, Class: &name.Name{ Position: &position.Position{ StartLine: 229, - EndLine: 229, - StartPos: 4638, - EndPos: 4640, + EndLine: 229, + StartPos: 4638, + EndPos: 4640, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 229, - EndLine: 229, - StartPos: 4638, - EndPos: 4640, + EndLine: 229, + StartPos: 4638, + EndPos: 4640, }, Value: "Foo", }, @@ -10765,9 +10702,9 @@ func TestPhp7(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 229, - EndLine: 229, - StartPos: 4641, - EndPos: 4642, + EndLine: 229, + StartPos: 4641, + EndPos: 4642, }, }, }, @@ -10775,31 +10712,31 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 230, - EndLine: 230, - StartPos: 4647, - EndPos: 4666, + EndLine: 230, + StartPos: 4647, + EndPos: 4666, }, Expr: &expr.New{ Position: &position.Position{ StartLine: 230, - EndLine: 230, - StartPos: 4647, - EndPos: 4665, + EndLine: 230, + StartPos: 4647, + EndPos: 4665, }, Class: &name.Relative{ Position: &position.Position{ StartLine: 230, - EndLine: 230, - StartPos: 4651, - EndPos: 4663, + EndLine: 230, + StartPos: 4651, + EndPos: 4663, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 230, - EndLine: 230, - StartPos: 4661, - EndPos: 4663, + EndLine: 230, + StartPos: 4661, + EndPos: 4663, }, Value: "Foo", }, @@ -10808,9 +10745,9 @@ func TestPhp7(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 230, - EndLine: 230, - StartPos: 4664, - EndPos: 4665, + EndLine: 230, + StartPos: 4664, + EndPos: 4665, }, }, }, @@ -10818,31 +10755,31 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 231, - EndLine: 231, - StartPos: 4670, - EndPos: 4680, + EndLine: 231, + StartPos: 4670, + EndPos: 4680, }, Expr: &expr.New{ Position: &position.Position{ StartLine: 231, - EndLine: 231, - StartPos: 4670, - EndPos: 4679, + EndLine: 231, + StartPos: 4670, + EndPos: 4679, }, Class: &name.FullyQualified{ Position: &position.Position{ StartLine: 231, - EndLine: 231, - StartPos: 4674, - EndPos: 4677, + EndLine: 231, + StartPos: 4674, + EndPos: 4677, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 231, - EndLine: 231, - StartPos: 4675, - EndPos: 4677, + EndLine: 231, + StartPos: 4675, + EndPos: 4677, }, Value: "Foo", }, @@ -10851,9 +10788,9 @@ func TestPhp7(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 231, - EndLine: 231, - StartPos: 4678, - EndPos: 4679, + EndLine: 231, + StartPos: 4678, + EndPos: 4679, }, }, }, @@ -10861,55 +10798,55 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 232, - EndLine: 232, - StartPos: 4684, - EndPos: 4708, + EndLine: 232, + StartPos: 4684, + EndPos: 4708, }, Expr: &expr.New{ Position: &position.Position{ StartLine: 232, - EndLine: 232, - StartPos: 4684, - EndPos: 4707, + EndLine: 232, + StartPos: 4684, + EndPos: 4707, }, Class: &stmt.Class{ Position: &position.Position{ StartLine: 232, - EndLine: 232, - StartPos: 4688, - EndPos: 4707, + EndLine: 232, + StartPos: 4688, + EndPos: 4707, }, PhpDocComment: "", ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 232, - EndLine: 232, - StartPos: 4694, - EndPos: 4704, + EndLine: 232, + StartPos: 4694, + EndPos: 4704, }, Arguments: []node.Node{ &node.Argument{ Position: &position.Position{ StartLine: 232, - EndLine: 232, - StartPos: 4695, - EndPos: 4696, + EndLine: 232, + StartPos: 4695, + EndPos: 4696, }, - Variadic: false, IsReference: false, + Variadic: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 232, - EndLine: 232, - StartPos: 4695, - EndPos: 4696, + EndLine: 232, + StartPos: 4695, + EndPos: 4696, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 232, - EndLine: 232, - StartPos: 4695, - EndPos: 4696, + EndLine: 232, + StartPos: 4695, + EndPos: 4696, }, Value: "a", }, @@ -10918,25 +10855,25 @@ func TestPhp7(t *testing.T) { &node.Argument{ Position: &position.Position{ StartLine: 232, - EndLine: 232, - StartPos: 4699, - EndPos: 4703, + EndLine: 232, + StartPos: 4699, + EndPos: 4703, }, - Variadic: true, + Variadic: true, IsReference: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 232, - EndLine: 232, - StartPos: 4702, - EndPos: 4703, + EndLine: 232, + StartPos: 4702, + EndPos: 4703, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 232, - EndLine: 232, - StartPos: 4702, - EndPos: 4703, + EndLine: 232, + StartPos: 4702, + EndPos: 4703, }, Value: "b", }, @@ -10944,38 +10881,37 @@ func TestPhp7(t *testing.T) { }, }, }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 233, - EndLine: 233, - StartPos: 4712, - EndPos: 4721, + EndLine: 233, + StartPos: 4712, + EndPos: 4721, }, Expr: &expr.Print{ Position: &position.Position{ StartLine: 233, - EndLine: 233, - StartPos: 4712, - EndPos: 4719, + EndLine: 233, + StartPos: 4712, + EndPos: 4719, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 233, - EndLine: 233, - StartPos: 4718, - EndPos: 4719, + EndLine: 233, + StartPos: 4718, + EndPos: 4719, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 233, - EndLine: 233, - StartPos: 4718, - EndPos: 4719, + EndLine: 233, + StartPos: 4718, + EndPos: 4719, }, Value: "a", }, @@ -10985,30 +10921,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 234, - EndLine: 234, - StartPos: 4725, - EndPos: 4732, + EndLine: 234, + StartPos: 4725, + EndPos: 4732, }, Expr: &expr.PropertyFetch{ Position: &position.Position{ StartLine: 234, - EndLine: 234, - StartPos: 4725, - EndPos: 4731, + EndLine: 234, + StartPos: 4725, + EndPos: 4731, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 234, - EndLine: 234, - StartPos: 4725, - EndPos: 4726, + EndLine: 234, + StartPos: 4725, + EndPos: 4726, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 234, - EndLine: 234, - StartPos: 4725, - EndPos: 4726, + EndLine: 234, + StartPos: 4725, + EndPos: 4726, }, Value: "a", }, @@ -11016,9 +10952,9 @@ func TestPhp7(t *testing.T) { Property: &node.Identifier{ Position: &position.Position{ StartLine: 234, - EndLine: 234, - StartPos: 4729, - EndPos: 4731, + EndLine: 234, + StartPos: 4729, + EndPos: 4731, }, Value: "foo", }, @@ -11027,40 +10963,40 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 235, - EndLine: 235, - StartPos: 4736, - EndPos: 4744, + EndLine: 235, + StartPos: 4736, + EndPos: 4744, }, Expr: &expr.ShellExec{ Position: &position.Position{ StartLine: 235, - EndLine: 235, - StartPos: 4736, - EndPos: 4743, + EndLine: 235, + StartPos: 4736, + EndPos: 4743, }, Parts: []node.Node{ &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 235, - EndLine: 235, - StartPos: 4737, - EndPos: 4740, + EndLine: 235, + StartPos: 4737, + EndPos: 4740, }, Value: "cmd ", }, &expr.Variable{ Position: &position.Position{ StartLine: 235, - EndLine: 235, - StartPos: 4741, - EndPos: 4742, + EndLine: 235, + StartPos: 4741, + EndPos: 4742, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 235, - EndLine: 235, - StartPos: 4741, - EndPos: 4742, + EndLine: 235, + StartPos: 4741, + EndPos: 4742, }, Value: "a", }, @@ -11071,16 +11007,16 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 236, - EndLine: 236, - StartPos: 4748, - EndPos: 4753, + EndLine: 236, + StartPos: 4748, + EndPos: 4753, }, Expr: &expr.ShellExec{ Position: &position.Position{ StartLine: 236, - EndLine: 236, - StartPos: 4748, - EndPos: 4752, + EndLine: 236, + StartPos: 4748, + EndPos: 4752, }, Parts: []node.Node{ &scalar.EncapsedStringPart{ @@ -11092,67 +11028,65 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 237, - EndLine: 237, - StartPos: 4757, - EndPos: 4759, + EndLine: 237, + StartPos: 4757, + EndPos: 4759, }, Expr: &expr.ShellExec{ Position: &position.Position{ StartLine: 237, - EndLine: 237, - StartPos: 4757, - EndPos: 4758, - }, - Parts: []node.Node{ + EndLine: 237, + StartPos: 4757, + EndPos: 4758, }, + Parts: []node.Node{}, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 238, - EndLine: 238, - StartPos: 4763, - EndPos: 4765, + EndLine: 238, + StartPos: 4763, + EndPos: 4765, }, Expr: &expr.ShortArray{ Position: &position.Position{ StartLine: 238, - EndLine: 238, - StartPos: 4763, - EndPos: 4764, - }, - Items: []node.Node{ + EndLine: 238, + StartPos: 4763, + EndPos: 4764, }, + Items: []node.Node{}, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 239, - EndLine: 239, - StartPos: 4769, - EndPos: 4772, + EndLine: 239, + StartPos: 4769, + EndPos: 4772, }, Expr: &expr.ShortArray{ Position: &position.Position{ StartLine: 239, - EndLine: 239, - StartPos: 4769, - EndPos: 4771, + EndLine: 239, + StartPos: 4769, + EndPos: 4771, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 239, - EndLine: 239, - StartPos: 4770, - EndPos: 4770, + EndLine: 239, + StartPos: 4770, + EndPos: 4770, }, Val: &scalar.Lnumber{ Position: &position.Position{ StartLine: 239, - EndLine: 239, - StartPos: 4770, - EndPos: 4770, + EndLine: 239, + StartPos: 4770, + EndPos: 4770, }, Value: "1", }, @@ -11163,40 +11097,40 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 240, - EndLine: 240, - StartPos: 4776, - EndPos: 4788, + EndLine: 240, + StartPos: 4776, + EndPos: 4788, }, Expr: &expr.ShortArray{ Position: &position.Position{ StartLine: 240, - EndLine: 240, - StartPos: 4776, - EndPos: 4787, + EndLine: 240, + StartPos: 4776, + EndPos: 4787, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 240, - EndLine: 240, - StartPos: 4777, - EndPos: 4780, + EndLine: 240, + StartPos: 4777, + EndPos: 4780, }, Key: &scalar.Lnumber{ Position: &position.Position{ StartLine: 240, - EndLine: 240, - StartPos: 4777, - EndPos: 4777, + EndLine: 240, + StartPos: 4777, + EndPos: 4777, }, Value: "1", }, Val: &scalar.Lnumber{ Position: &position.Position{ StartLine: 240, - EndLine: 240, - StartPos: 4780, - EndPos: 4780, + EndLine: 240, + StartPos: 4780, + EndPos: 4780, }, Value: "1", }, @@ -11204,30 +11138,30 @@ func TestPhp7(t *testing.T) { &expr.ArrayItem{ Position: &position.Position{ StartLine: 240, - EndLine: 240, - StartPos: 4783, - EndPos: 4785, + EndLine: 240, + StartPos: 4783, + EndPos: 4785, }, Val: &expr.Reference{ Position: &position.Position{ StartLine: 240, - EndLine: 240, - StartPos: 4783, - EndPos: 4785, + EndLine: 240, + StartPos: 4783, + EndPos: 4785, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 240, - EndLine: 240, - StartPos: 4784, - EndPos: 4785, + EndLine: 240, + StartPos: 4784, + EndPos: 4785, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 240, - EndLine: 240, - StartPos: 4784, - EndPos: 4785, + EndLine: 240, + StartPos: 4784, + EndPos: 4785, }, Value: "b", }, @@ -11240,45 +11174,45 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 242, - EndLine: 242, - StartPos: 4793, - EndPos: 4802, + EndLine: 242, + StartPos: 4793, + EndPos: 4802, }, Expr: &assign.Assign{ Position: &position.Position{ StartLine: 242, - EndLine: 242, - StartPos: 4793, - EndPos: 4801, + EndLine: 242, + StartPos: 4793, + EndPos: 4801, }, Variable: &expr.ShortList{ Position: &position.Position{ StartLine: 242, - EndLine: 242, - StartPos: 4793, - EndPos: 4796, + EndLine: 242, + StartPos: 4793, + EndPos: 4796, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 242, - EndLine: 242, - StartPos: 4794, - EndPos: 4795, + EndLine: 242, + StartPos: 4794, + EndPos: 4795, }, Val: &expr.Variable{ Position: &position.Position{ StartLine: 242, - EndLine: 242, - StartPos: 4794, - EndPos: 4795, + EndLine: 242, + StartPos: 4794, + EndPos: 4795, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 242, - EndLine: 242, - StartPos: 4794, - EndPos: 4795, + EndLine: 242, + StartPos: 4794, + EndPos: 4795, }, Value: "a", }, @@ -11289,16 +11223,16 @@ func TestPhp7(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 242, - EndLine: 242, - StartPos: 4800, - EndPos: 4801, + EndLine: 242, + StartPos: 4800, + EndPos: 4801, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 242, - EndLine: 242, - StartPos: 4800, - EndPos: 4801, + EndLine: 242, + StartPos: 4800, + EndPos: 4801, }, Value: "b", }, @@ -11308,52 +11242,52 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 243, - EndLine: 243, - StartPos: 4806, - EndPos: 4817, + EndLine: 243, + StartPos: 4806, + EndPos: 4817, }, Expr: &assign.Assign{ Position: &position.Position{ StartLine: 243, - EndLine: 243, - StartPos: 4806, - EndPos: 4816, + EndLine: 243, + StartPos: 4806, + EndPos: 4816, }, Variable: &expr.ShortList{ Position: &position.Position{ StartLine: 243, - EndLine: 243, - StartPos: 4806, - EndPos: 4811, + EndLine: 243, + StartPos: 4806, + EndPos: 4811, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 243, - EndLine: 243, - StartPos: 4807, - EndPos: 4810, + EndLine: 243, + StartPos: 4807, + EndPos: 4810, }, Val: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 243, - EndLine: 243, - StartPos: 4807, - EndPos: 4810, + EndLine: 243, + StartPos: 4807, + EndPos: 4810, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 243, - EndLine: 243, - StartPos: 4807, - EndPos: 4808, + EndLine: 243, + StartPos: 4807, + EndPos: 4808, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 243, - EndLine: 243, - StartPos: 4807, - EndPos: 4808, + EndLine: 243, + StartPos: 4807, + EndPos: 4808, }, Value: "a", }, @@ -11365,16 +11299,16 @@ func TestPhp7(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 243, - EndLine: 243, - StartPos: 4815, - EndPos: 4816, + EndLine: 243, + StartPos: 4815, + EndPos: 4816, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 243, - EndLine: 243, - StartPos: 4815, - EndPos: 4816, + EndLine: 243, + StartPos: 4815, + EndPos: 4816, }, Value: "b", }, @@ -11384,60 +11318,60 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 244, - EndLine: 244, - StartPos: 4821, - EndPos: 4836, + EndLine: 244, + StartPos: 4821, + EndPos: 4836, }, Expr: &assign.Assign{ Position: &position.Position{ StartLine: 244, - EndLine: 244, - StartPos: 4821, - EndPos: 4835, + EndLine: 244, + StartPos: 4821, + EndPos: 4835, }, Variable: &expr.ShortList{ Position: &position.Position{ StartLine: 244, - EndLine: 244, - StartPos: 4821, - EndPos: 4830, + EndLine: 244, + StartPos: 4821, + EndPos: 4830, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 244, - EndLine: 244, - StartPos: 4822, - EndPos: 4829, + EndLine: 244, + StartPos: 4822, + EndPos: 4829, }, Val: &expr.List{ Position: &position.Position{ StartLine: 244, - EndLine: 244, - StartPos: 4822, - EndPos: 4829, + EndLine: 244, + StartPos: 4822, + EndPos: 4829, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 244, - EndLine: 244, - StartPos: 4827, - EndPos: 4828, + EndLine: 244, + StartPos: 4827, + EndPos: 4828, }, Val: &expr.Variable{ Position: &position.Position{ StartLine: 244, - EndLine: 244, - StartPos: 4827, - EndPos: 4828, + EndLine: 244, + StartPos: 4827, + EndPos: 4828, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 244, - EndLine: 244, - StartPos: 4827, - EndPos: 4828, + EndLine: 244, + StartPos: 4827, + EndPos: 4828, }, Value: "a", }, @@ -11451,16 +11385,16 @@ func TestPhp7(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 244, - EndLine: 244, - StartPos: 4834, - EndPos: 4835, + EndLine: 244, + StartPos: 4834, + EndPos: 4835, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 244, - EndLine: 244, - StartPos: 4834, - EndPos: 4835, + EndLine: 244, + StartPos: 4834, + EndPos: 4835, }, Value: "b", }, @@ -11470,31 +11404,31 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 245, - EndLine: 245, - StartPos: 4840, - EndPos: 4850, + EndLine: 245, + StartPos: 4840, + EndPos: 4850, }, Expr: &expr.StaticCall{ Position: &position.Position{ StartLine: 245, - EndLine: 245, - StartPos: 4840, - EndPos: 4849, + EndLine: 245, + StartPos: 4840, + EndPos: 4849, }, Class: &name.Name{ Position: &position.Position{ StartLine: 245, - EndLine: 245, - StartPos: 4840, - EndPos: 4842, + EndLine: 245, + StartPos: 4840, + EndPos: 4842, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 245, - EndLine: 245, - StartPos: 4840, - EndPos: 4842, + EndLine: 245, + StartPos: 4840, + EndPos: 4842, }, Value: "Foo", }, @@ -11503,18 +11437,18 @@ func TestPhp7(t *testing.T) { Call: &node.Identifier{ Position: &position.Position{ StartLine: 245, - EndLine: 245, - StartPos: 4845, - EndPos: 4847, + EndLine: 245, + StartPos: 4845, + EndPos: 4847, }, Value: "bar", }, ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 245, - EndLine: 245, - StartPos: 4848, - EndPos: 4849, + EndLine: 245, + StartPos: 4848, + EndPos: 4849, }, }, }, @@ -11522,31 +11456,31 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 246, - EndLine: 246, - StartPos: 4854, - EndPos: 4874, + EndLine: 246, + StartPos: 4854, + EndPos: 4874, }, Expr: &expr.StaticCall{ Position: &position.Position{ StartLine: 246, - EndLine: 246, - StartPos: 4854, - EndPos: 4873, + EndLine: 246, + StartPos: 4854, + EndPos: 4873, }, Class: &name.Relative{ Position: &position.Position{ StartLine: 246, - EndLine: 246, - StartPos: 4854, - EndPos: 4866, + EndLine: 246, + StartPos: 4854, + EndPos: 4866, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 246, - EndLine: 246, - StartPos: 4864, - EndPos: 4866, + EndLine: 246, + StartPos: 4864, + EndPos: 4866, }, Value: "Foo", }, @@ -11555,18 +11489,18 @@ func TestPhp7(t *testing.T) { Call: &node.Identifier{ Position: &position.Position{ StartLine: 246, - EndLine: 246, - StartPos: 4869, - EndPos: 4871, + EndLine: 246, + StartPos: 4869, + EndPos: 4871, }, Value: "bar", }, ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 246, - EndLine: 246, - StartPos: 4872, - EndPos: 4873, + EndLine: 246, + StartPos: 4872, + EndPos: 4873, }, }, }, @@ -11574,31 +11508,31 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 247, - EndLine: 247, - StartPos: 4878, - EndPos: 4889, + EndLine: 247, + StartPos: 4878, + EndPos: 4889, }, Expr: &expr.StaticCall{ Position: &position.Position{ StartLine: 247, - EndLine: 247, - StartPos: 4878, - EndPos: 4888, + EndLine: 247, + StartPos: 4878, + EndPos: 4888, }, Class: &name.FullyQualified{ Position: &position.Position{ StartLine: 247, - EndLine: 247, - StartPos: 4878, - EndPos: 4881, + EndLine: 247, + StartPos: 4878, + EndPos: 4881, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 247, - EndLine: 247, - StartPos: 4879, - EndPos: 4881, + EndLine: 247, + StartPos: 4879, + EndPos: 4881, }, Value: "Foo", }, @@ -11607,18 +11541,18 @@ func TestPhp7(t *testing.T) { Call: &node.Identifier{ Position: &position.Position{ StartLine: 247, - EndLine: 247, - StartPos: 4884, - EndPos: 4886, + EndLine: 247, + StartPos: 4884, + EndPos: 4886, }, Value: "bar", }, ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 247, - EndLine: 247, - StartPos: 4887, - EndPos: 4888, + EndLine: 247, + StartPos: 4887, + EndPos: 4888, }, }, }, @@ -11626,31 +11560,31 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 248, - EndLine: 248, - StartPos: 4893, - EndPos: 4902, + EndLine: 248, + StartPos: 4893, + EndPos: 4902, }, Expr: &expr.StaticPropertyFetch{ Position: &position.Position{ StartLine: 248, - EndLine: 248, - StartPos: 4893, - EndPos: 4901, + EndLine: 248, + StartPos: 4893, + EndPos: 4901, }, Class: &name.Name{ Position: &position.Position{ StartLine: 248, - EndLine: 248, - StartPos: 4893, - EndPos: 4895, + EndLine: 248, + StartPos: 4893, + EndPos: 4895, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 248, - EndLine: 248, - StartPos: 4893, - EndPos: 4895, + EndLine: 248, + StartPos: 4893, + EndPos: 4895, }, Value: "Foo", }, @@ -11659,16 +11593,16 @@ func TestPhp7(t *testing.T) { Property: &expr.Variable{ Position: &position.Position{ StartLine: 248, - EndLine: 248, - StartPos: 4898, - EndPos: 4901, + EndLine: 248, + StartPos: 4898, + EndPos: 4901, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 248, - EndLine: 248, - StartPos: 4898, - EndPos: 4901, + EndLine: 248, + StartPos: 4898, + EndPos: 4901, }, Value: "bar", }, @@ -11678,30 +11612,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 249, - EndLine: 249, - StartPos: 4906, - EndPos: 4916, + EndLine: 249, + StartPos: 4906, + EndPos: 4916, }, Expr: &expr.StaticPropertyFetch{ Position: &position.Position{ StartLine: 249, - EndLine: 249, - StartPos: 4906, - EndPos: 4915, + EndLine: 249, + StartPos: 4906, + EndPos: 4915, }, Class: &expr.Variable{ Position: &position.Position{ StartLine: 249, - EndLine: 249, - StartPos: 4906, - EndPos: 4909, + EndLine: 249, + StartPos: 4906, + EndPos: 4909, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 249, - EndLine: 249, - StartPos: 4906, - EndPos: 4909, + EndLine: 249, + StartPos: 4906, + EndPos: 4909, }, Value: "foo", }, @@ -11709,16 +11643,16 @@ func TestPhp7(t *testing.T) { Property: &expr.Variable{ Position: &position.Position{ StartLine: 249, - EndLine: 249, - StartPos: 4912, - EndPos: 4915, + EndLine: 249, + StartPos: 4912, + EndPos: 4915, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 249, - EndLine: 249, - StartPos: 4912, - EndPos: 4915, + EndLine: 249, + StartPos: 4912, + EndPos: 4915, }, Value: "bar", }, @@ -11728,31 +11662,31 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 250, - EndLine: 250, - StartPos: 4920, - EndPos: 4939, + EndLine: 250, + StartPos: 4920, + EndPos: 4939, }, Expr: &expr.StaticPropertyFetch{ Position: &position.Position{ StartLine: 250, - EndLine: 250, - StartPos: 4920, - EndPos: 4938, + EndLine: 250, + StartPos: 4920, + EndPos: 4938, }, Class: &name.Relative{ Position: &position.Position{ StartLine: 250, - EndLine: 250, - StartPos: 4920, - EndPos: 4932, + EndLine: 250, + StartPos: 4920, + EndPos: 4932, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 250, - EndLine: 250, - StartPos: 4930, - EndPos: 4932, + EndLine: 250, + StartPos: 4930, + EndPos: 4932, }, Value: "Foo", }, @@ -11761,16 +11695,16 @@ func TestPhp7(t *testing.T) { Property: &expr.Variable{ Position: &position.Position{ StartLine: 250, - EndLine: 250, - StartPos: 4935, - EndPos: 4938, + EndLine: 250, + StartPos: 4935, + EndPos: 4938, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 250, - EndLine: 250, - StartPos: 4935, - EndPos: 4938, + EndLine: 250, + StartPos: 4935, + EndPos: 4938, }, Value: "bar", }, @@ -11780,31 +11714,31 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 251, - EndLine: 251, - StartPos: 4943, - EndPos: 4953, + EndLine: 251, + StartPos: 4943, + EndPos: 4953, }, Expr: &expr.StaticPropertyFetch{ Position: &position.Position{ StartLine: 251, - EndLine: 251, - StartPos: 4943, - EndPos: 4952, + EndLine: 251, + StartPos: 4943, + EndPos: 4952, }, Class: &name.FullyQualified{ Position: &position.Position{ StartLine: 251, - EndLine: 251, - StartPos: 4943, - EndPos: 4946, + EndLine: 251, + StartPos: 4943, + EndPos: 4946, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 251, - EndLine: 251, - StartPos: 4944, - EndPos: 4946, + EndLine: 251, + StartPos: 4944, + EndPos: 4946, }, Value: "Foo", }, @@ -11813,16 +11747,16 @@ func TestPhp7(t *testing.T) { Property: &expr.Variable{ Position: &position.Position{ StartLine: 251, - EndLine: 251, - StartPos: 4949, - EndPos: 4952, + EndLine: 251, + StartPos: 4949, + EndPos: 4952, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 251, - EndLine: 251, - StartPos: 4949, - EndPos: 4952, + EndLine: 251, + StartPos: 4949, + EndPos: 4952, }, Value: "bar", }, @@ -11832,30 +11766,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 252, - EndLine: 252, - StartPos: 4957, - EndPos: 4969, + EndLine: 252, + StartPos: 4957, + EndPos: 4969, }, Expr: &expr.Ternary{ Position: &position.Position{ StartLine: 252, - EndLine: 252, - StartPos: 4957, - EndPos: 4968, + EndLine: 252, + StartPos: 4957, + EndPos: 4968, }, Condition: &expr.Variable{ Position: &position.Position{ StartLine: 252, - EndLine: 252, - StartPos: 4957, - EndPos: 4958, + EndLine: 252, + StartPos: 4957, + EndPos: 4958, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 252, - EndLine: 252, - StartPos: 4957, - EndPos: 4958, + EndLine: 252, + StartPos: 4957, + EndPos: 4958, }, Value: "a", }, @@ -11863,16 +11797,16 @@ func TestPhp7(t *testing.T) { IfTrue: &expr.Variable{ Position: &position.Position{ StartLine: 252, - EndLine: 252, - StartPos: 4962, - EndPos: 4963, + EndLine: 252, + StartPos: 4962, + EndPos: 4963, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 252, - EndLine: 252, - StartPos: 4962, - EndPos: 4963, + EndLine: 252, + StartPos: 4962, + EndPos: 4963, }, Value: "b", }, @@ -11880,16 +11814,16 @@ func TestPhp7(t *testing.T) { IfFalse: &expr.Variable{ Position: &position.Position{ StartLine: 252, - EndLine: 252, - StartPos: 4967, - EndPos: 4968, + EndLine: 252, + StartPos: 4967, + EndPos: 4968, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 252, - EndLine: 252, - StartPos: 4967, - EndPos: 4968, + EndLine: 252, + StartPos: 4967, + EndPos: 4968, }, Value: "c", }, @@ -11899,30 +11833,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 253, - EndLine: 253, - StartPos: 4973, - EndPos: 4982, + EndLine: 253, + StartPos: 4973, + EndPos: 4982, }, Expr: &expr.Ternary{ Position: &position.Position{ StartLine: 253, - EndLine: 253, - StartPos: 4973, - EndPos: 4981, + EndLine: 253, + StartPos: 4973, + EndPos: 4981, }, Condition: &expr.Variable{ Position: &position.Position{ StartLine: 253, - EndLine: 253, - StartPos: 4973, - EndPos: 4974, + EndLine: 253, + StartPos: 4973, + EndPos: 4974, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 253, - EndLine: 253, - StartPos: 4973, - EndPos: 4974, + EndLine: 253, + StartPos: 4973, + EndPos: 4974, }, Value: "a", }, @@ -11930,16 +11864,16 @@ func TestPhp7(t *testing.T) { IfFalse: &expr.Variable{ Position: &position.Position{ StartLine: 253, - EndLine: 253, - StartPos: 4980, - EndPos: 4981, + EndLine: 253, + StartPos: 4980, + EndPos: 4981, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 253, - EndLine: 253, - StartPos: 4980, - EndPos: 4981, + EndLine: 253, + StartPos: 4980, + EndPos: 4981, }, Value: "c", }, @@ -11949,30 +11883,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 254, - EndLine: 254, - StartPos: 4986, - EndPos: 5008, + EndLine: 254, + StartPos: 4986, + EndPos: 5008, }, Expr: &expr.Ternary{ Position: &position.Position{ StartLine: 254, - EndLine: 254, - StartPos: 4986, - EndPos: 5007, + EndLine: 254, + StartPos: 4986, + EndPos: 5007, }, Condition: &expr.Variable{ Position: &position.Position{ StartLine: 254, - EndLine: 254, - StartPos: 4986, - EndPos: 4987, + EndLine: 254, + StartPos: 4986, + EndPos: 4987, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 254, - EndLine: 254, - StartPos: 4986, - EndPos: 4987, + EndLine: 254, + StartPos: 4986, + EndPos: 4987, }, Value: "a", }, @@ -11980,23 +11914,23 @@ func TestPhp7(t *testing.T) { IfTrue: &expr.Ternary{ Position: &position.Position{ StartLine: 254, - EndLine: 254, - StartPos: 4991, - EndPos: 5002, + EndLine: 254, + StartPos: 4991, + EndPos: 5002, }, Condition: &expr.Variable{ Position: &position.Position{ StartLine: 254, - EndLine: 254, - StartPos: 4991, - EndPos: 4992, + EndLine: 254, + StartPos: 4991, + EndPos: 4992, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 254, - EndLine: 254, - StartPos: 4991, - EndPos: 4992, + EndLine: 254, + StartPos: 4991, + EndPos: 4992, }, Value: "b", }, @@ -12004,16 +11938,16 @@ func TestPhp7(t *testing.T) { IfTrue: &expr.Variable{ Position: &position.Position{ StartLine: 254, - EndLine: 254, - StartPos: 4996, - EndPos: 4997, + EndLine: 254, + StartPos: 4996, + EndPos: 4997, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 254, - EndLine: 254, - StartPos: 4996, - EndPos: 4997, + EndLine: 254, + StartPos: 4996, + EndPos: 4997, }, Value: "c", }, @@ -12021,16 +11955,16 @@ func TestPhp7(t *testing.T) { IfFalse: &expr.Variable{ Position: &position.Position{ StartLine: 254, - EndLine: 254, - StartPos: 5001, - EndPos: 5002, + EndLine: 254, + StartPos: 5001, + EndPos: 5002, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 254, - EndLine: 254, - StartPos: 5001, - EndPos: 5002, + EndLine: 254, + StartPos: 5001, + EndPos: 5002, }, Value: "d", }, @@ -12039,16 +11973,16 @@ func TestPhp7(t *testing.T) { IfFalse: &expr.Variable{ Position: &position.Position{ StartLine: 254, - EndLine: 254, - StartPos: 5006, - EndPos: 5007, + EndLine: 254, + StartPos: 5006, + EndPos: 5007, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 254, - EndLine: 254, - StartPos: 5006, - EndPos: 5007, + EndLine: 254, + StartPos: 5006, + EndPos: 5007, }, Value: "e", }, @@ -12058,37 +11992,37 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 255, - EndLine: 255, - StartPos: 5012, - EndPos: 5034, + EndLine: 255, + StartPos: 5012, + EndPos: 5034, }, Expr: &expr.Ternary{ Position: &position.Position{ StartLine: 255, - EndLine: 255, - StartPos: 5012, - EndPos: 5033, + EndLine: 255, + StartPos: 5012, + EndPos: 5033, }, Condition: &expr.Ternary{ Position: &position.Position{ StartLine: 255, - EndLine: 255, - StartPos: 5012, - EndPos: 5023, + EndLine: 255, + StartPos: 5012, + EndPos: 5023, }, Condition: &expr.Variable{ Position: &position.Position{ StartLine: 255, - EndLine: 255, - StartPos: 5012, - EndPos: 5013, + EndLine: 255, + StartPos: 5012, + EndPos: 5013, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 255, - EndLine: 255, - StartPos: 5012, - EndPos: 5013, + EndLine: 255, + StartPos: 5012, + EndPos: 5013, }, Value: "a", }, @@ -12096,16 +12030,16 @@ func TestPhp7(t *testing.T) { IfTrue: &expr.Variable{ Position: &position.Position{ StartLine: 255, - EndLine: 255, - StartPos: 5017, - EndPos: 5018, + EndLine: 255, + StartPos: 5017, + EndPos: 5018, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 255, - EndLine: 255, - StartPos: 5017, - EndPos: 5018, + EndLine: 255, + StartPos: 5017, + EndPos: 5018, }, Value: "b", }, @@ -12113,16 +12047,16 @@ func TestPhp7(t *testing.T) { IfFalse: &expr.Variable{ Position: &position.Position{ StartLine: 255, - EndLine: 255, - StartPos: 5022, - EndPos: 5023, + EndLine: 255, + StartPos: 5022, + EndPos: 5023, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 255, - EndLine: 255, - StartPos: 5022, - EndPos: 5023, + EndLine: 255, + StartPos: 5022, + EndPos: 5023, }, Value: "c", }, @@ -12131,16 +12065,16 @@ func TestPhp7(t *testing.T) { IfTrue: &expr.Variable{ Position: &position.Position{ StartLine: 255, - EndLine: 255, - StartPos: 5027, - EndPos: 5028, + EndLine: 255, + StartPos: 5027, + EndPos: 5028, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 255, - EndLine: 255, - StartPos: 5027, - EndPos: 5028, + EndLine: 255, + StartPos: 5027, + EndPos: 5028, }, Value: "d", }, @@ -12148,16 +12082,16 @@ func TestPhp7(t *testing.T) { IfFalse: &expr.Variable{ Position: &position.Position{ StartLine: 255, - EndLine: 255, - StartPos: 5032, - EndPos: 5033, + EndLine: 255, + StartPos: 5032, + EndPos: 5033, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 255, - EndLine: 255, - StartPos: 5032, - EndPos: 5033, + EndLine: 255, + StartPos: 5032, + EndPos: 5033, }, Value: "e", }, @@ -12167,30 +12101,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 256, - EndLine: 256, - StartPos: 5038, - EndPos: 5041, + EndLine: 256, + StartPos: 5038, + EndPos: 5041, }, Expr: &expr.UnaryMinus{ Position: &position.Position{ StartLine: 256, - EndLine: 256, - StartPos: 5038, - EndPos: 5040, + EndLine: 256, + StartPos: 5038, + EndPos: 5040, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 256, - EndLine: 256, - StartPos: 5039, - EndPos: 5040, + EndLine: 256, + StartPos: 5039, + EndPos: 5040, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 256, - EndLine: 256, - StartPos: 5039, - EndPos: 5040, + EndLine: 256, + StartPos: 5039, + EndPos: 5040, }, Value: "a", }, @@ -12200,30 +12134,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 257, - EndLine: 257, - StartPos: 5045, - EndPos: 5048, + EndLine: 257, + StartPos: 5045, + EndPos: 5048, }, Expr: &expr.UnaryPlus{ Position: &position.Position{ StartLine: 257, - EndLine: 257, - StartPos: 5045, - EndPos: 5047, + EndLine: 257, + StartPos: 5045, + EndPos: 5047, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 257, - EndLine: 257, - StartPos: 5046, - EndPos: 5047, + EndLine: 257, + StartPos: 5046, + EndPos: 5047, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 257, - EndLine: 257, - StartPos: 5046, - EndPos: 5047, + EndLine: 257, + StartPos: 5046, + EndPos: 5047, }, Value: "a", }, @@ -12233,30 +12167,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 258, - EndLine: 258, - StartPos: 5052, - EndPos: 5055, + EndLine: 258, + StartPos: 5052, + EndPos: 5055, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 258, - EndLine: 258, - StartPos: 5052, - EndPos: 5054, + EndLine: 258, + StartPos: 5052, + EndPos: 5054, }, VarName: &expr.Variable{ Position: &position.Position{ StartLine: 258, - EndLine: 258, - StartPos: 5053, - EndPos: 5054, + EndLine: 258, + StartPos: 5053, + EndPos: 5054, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 258, - EndLine: 258, - StartPos: 5053, - EndPos: 5054, + EndLine: 258, + StartPos: 5053, + EndPos: 5054, }, Value: "a", }, @@ -12266,46 +12200,46 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 259, - EndLine: 259, - StartPos: 5059, - EndPos: 5064, + EndLine: 259, + StartPos: 5059, + EndPos: 5064, }, Expr: &expr.Yield{ Position: &position.Position{ StartLine: 259, - EndLine: 259, - StartPos: 5059, - EndPos: 5063, + EndLine: 259, + StartPos: 5059, + EndPos: 5063, }, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 260, - EndLine: 260, - StartPos: 5068, - EndPos: 5076, + EndLine: 260, + StartPos: 5068, + EndPos: 5076, }, Expr: &expr.Yield{ Position: &position.Position{ StartLine: 260, - EndLine: 260, - StartPos: 5068, - EndPos: 5075, + EndLine: 260, + StartPos: 5068, + EndPos: 5075, }, Value: &expr.Variable{ Position: &position.Position{ StartLine: 260, - EndLine: 260, - StartPos: 5074, - EndPos: 5075, + EndLine: 260, + StartPos: 5074, + EndPos: 5075, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 260, - EndLine: 260, - StartPos: 5074, - EndPos: 5075, + EndLine: 260, + StartPos: 5074, + EndPos: 5075, }, Value: "a", }, @@ -12315,30 +12249,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 261, - EndLine: 261, - StartPos: 5080, - EndPos: 5094, + EndLine: 261, + StartPos: 5080, + EndPos: 5094, }, Expr: &expr.Yield{ Position: &position.Position{ StartLine: 261, - EndLine: 261, - StartPos: 5080, - EndPos: 5093, + EndLine: 261, + StartPos: 5080, + EndPos: 5093, }, Key: &expr.Variable{ Position: &position.Position{ StartLine: 261, - EndLine: 261, - StartPos: 5086, - EndPos: 5087, + EndLine: 261, + StartPos: 5086, + EndPos: 5087, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 261, - EndLine: 261, - StartPos: 5086, - EndPos: 5087, + EndLine: 261, + StartPos: 5086, + EndPos: 5087, }, Value: "a", }, @@ -12346,16 +12280,16 @@ func TestPhp7(t *testing.T) { Value: &expr.Variable{ Position: &position.Position{ StartLine: 261, - EndLine: 261, - StartPos: 5092, - EndPos: 5093, + EndLine: 261, + StartPos: 5092, + EndPos: 5093, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 261, - EndLine: 261, - StartPos: 5092, - EndPos: 5093, + EndLine: 261, + StartPos: 5092, + EndPos: 5093, }, Value: "b", }, @@ -12365,30 +12299,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 262, - EndLine: 262, - StartPos: 5098, - EndPos: 5111, + EndLine: 262, + StartPos: 5098, + EndPos: 5111, }, Expr: &expr.YieldFrom{ Position: &position.Position{ StartLine: 262, - EndLine: 262, - StartPos: 5098, - EndPos: 5110, + EndLine: 262, + StartPos: 5098, + EndPos: 5110, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 262, - EndLine: 262, - StartPos: 5109, - EndPos: 5110, + EndLine: 262, + StartPos: 5109, + EndPos: 5110, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 262, - EndLine: 262, - StartPos: 5109, - EndPos: 5110, + EndLine: 262, + StartPos: 5109, + EndPos: 5110, }, Value: "a", }, @@ -12398,30 +12332,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 264, - EndLine: 264, - StartPos: 5118, - EndPos: 5127, + EndLine: 264, + StartPos: 5118, + EndPos: 5127, }, Expr: &cast.Array{ Position: &position.Position{ StartLine: 264, - EndLine: 264, - StartPos: 5118, - EndPos: 5126, + EndLine: 264, + StartPos: 5118, + EndPos: 5126, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 264, - EndLine: 264, - StartPos: 5125, - EndPos: 5126, + EndLine: 264, + StartPos: 5125, + EndPos: 5126, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 264, - EndLine: 264, - StartPos: 5125, - EndPos: 5126, + EndLine: 264, + StartPos: 5125, + EndPos: 5126, }, Value: "a", }, @@ -12431,30 +12365,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 265, - EndLine: 265, - StartPos: 5131, - EndPos: 5142, + EndLine: 265, + StartPos: 5131, + EndPos: 5142, }, Expr: &cast.Bool{ Position: &position.Position{ StartLine: 265, - EndLine: 265, - StartPos: 5131, - EndPos: 5141, + EndLine: 265, + StartPos: 5131, + EndPos: 5141, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 265, - EndLine: 265, - StartPos: 5140, - EndPos: 5141, + EndLine: 265, + StartPos: 5140, + EndPos: 5141, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 265, - EndLine: 265, - StartPos: 5140, - EndPos: 5141, + EndLine: 265, + StartPos: 5140, + EndPos: 5141, }, Value: "a", }, @@ -12464,30 +12398,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 266, - EndLine: 266, - StartPos: 5146, - EndPos: 5154, + EndLine: 266, + StartPos: 5146, + EndPos: 5154, }, Expr: &cast.Bool{ Position: &position.Position{ StartLine: 266, - EndLine: 266, - StartPos: 5146, - EndPos: 5153, + EndLine: 266, + StartPos: 5146, + EndPos: 5153, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 266, - EndLine: 266, - StartPos: 5152, - EndPos: 5153, + EndLine: 266, + StartPos: 5152, + EndPos: 5153, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 266, - EndLine: 266, - StartPos: 5152, - EndPos: 5153, + EndLine: 266, + StartPos: 5152, + EndPos: 5153, }, Value: "a", }, @@ -12497,30 +12431,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 267, - EndLine: 267, - StartPos: 5158, - EndPos: 5168, + EndLine: 267, + StartPos: 5158, + EndPos: 5168, }, Expr: &cast.Double{ Position: &position.Position{ StartLine: 267, - EndLine: 267, - StartPos: 5158, - EndPos: 5167, + EndLine: 267, + StartPos: 5158, + EndPos: 5167, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 267, - EndLine: 267, - StartPos: 5166, - EndPos: 5167, + EndLine: 267, + StartPos: 5166, + EndPos: 5167, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 267, - EndLine: 267, - StartPos: 5166, - EndPos: 5167, + EndLine: 267, + StartPos: 5166, + EndPos: 5167, }, Value: "a", }, @@ -12530,30 +12464,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 268, - EndLine: 268, - StartPos: 5172, - EndPos: 5181, + EndLine: 268, + StartPos: 5172, + EndPos: 5181, }, Expr: &cast.Double{ Position: &position.Position{ StartLine: 268, - EndLine: 268, - StartPos: 5172, - EndPos: 5180, + EndLine: 268, + StartPos: 5172, + EndPos: 5180, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 268, - EndLine: 268, - StartPos: 5179, - EndPos: 5180, + EndLine: 268, + StartPos: 5179, + EndPos: 5180, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 268, - EndLine: 268, - StartPos: 5179, - EndPos: 5180, + EndLine: 268, + StartPos: 5179, + EndPos: 5180, }, Value: "a", }, @@ -12563,30 +12497,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 269, - EndLine: 269, - StartPos: 5185, - EndPos: 5196, + EndLine: 269, + StartPos: 5185, + EndPos: 5196, }, Expr: &cast.Int{ Position: &position.Position{ StartLine: 269, - EndLine: 269, - StartPos: 5185, - EndPos: 5195, + EndLine: 269, + StartPos: 5185, + EndPos: 5195, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 269, - EndLine: 269, - StartPos: 5194, - EndPos: 5195, + EndLine: 269, + StartPos: 5194, + EndPos: 5195, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 269, - EndLine: 269, - StartPos: 5194, - EndPos: 5195, + EndLine: 269, + StartPos: 5194, + EndPos: 5195, }, Value: "a", }, @@ -12596,30 +12530,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 270, - EndLine: 270, - StartPos: 5200, - EndPos: 5207, + EndLine: 270, + StartPos: 5200, + EndPos: 5207, }, Expr: &cast.Int{ Position: &position.Position{ StartLine: 270, - EndLine: 270, - StartPos: 5200, - EndPos: 5206, + EndLine: 270, + StartPos: 5200, + EndPos: 5206, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 270, - EndLine: 270, - StartPos: 5205, - EndPos: 5206, + EndLine: 270, + StartPos: 5205, + EndPos: 5206, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 270, - EndLine: 270, - StartPos: 5205, - EndPos: 5206, + EndLine: 270, + StartPos: 5205, + EndPos: 5206, }, Value: "a", }, @@ -12629,30 +12563,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 271, - EndLine: 271, - StartPos: 5211, - EndPos: 5221, + EndLine: 271, + StartPos: 5211, + EndPos: 5221, }, Expr: &cast.Object{ Position: &position.Position{ StartLine: 271, - EndLine: 271, - StartPos: 5211, - EndPos: 5220, + EndLine: 271, + StartPos: 5211, + EndPos: 5220, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 271, - EndLine: 271, - StartPos: 5219, - EndPos: 5220, + EndLine: 271, + StartPos: 5219, + EndPos: 5220, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 271, - EndLine: 271, - StartPos: 5219, - EndPos: 5220, + EndLine: 271, + StartPos: 5219, + EndPos: 5220, }, Value: "a", }, @@ -12662,30 +12596,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 272, - EndLine: 272, - StartPos: 5225, - EndPos: 5235, + EndLine: 272, + StartPos: 5225, + EndPos: 5235, }, Expr: &cast.String{ Position: &position.Position{ StartLine: 272, - EndLine: 272, - StartPos: 5225, - EndPos: 5234, + EndLine: 272, + StartPos: 5225, + EndPos: 5234, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 272, - EndLine: 272, - StartPos: 5233, - EndPos: 5234, + EndLine: 272, + StartPos: 5233, + EndPos: 5234, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 272, - EndLine: 272, - StartPos: 5233, - EndPos: 5234, + EndLine: 272, + StartPos: 5233, + EndPos: 5234, }, Value: "a", }, @@ -12695,30 +12629,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 273, - EndLine: 273, - StartPos: 5239, - EndPos: 5248, + EndLine: 273, + StartPos: 5239, + EndPos: 5248, }, Expr: &cast.Unset{ Position: &position.Position{ StartLine: 273, - EndLine: 273, - StartPos: 5239, - EndPos: 5247, + EndLine: 273, + StartPos: 5239, + EndPos: 5247, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 273, - EndLine: 273, - StartPos: 5246, - EndPos: 5247, + EndLine: 273, + StartPos: 5246, + EndPos: 5247, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 273, - EndLine: 273, - StartPos: 5246, - EndPos: 5247, + EndLine: 273, + StartPos: 5246, + EndPos: 5247, }, Value: "a", }, @@ -12728,30 +12662,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 275, - EndLine: 275, - StartPos: 5253, - EndPos: 5260, + EndLine: 275, + StartPos: 5253, + EndPos: 5260, }, Expr: &binary.BitwiseAnd{ Position: &position.Position{ StartLine: 275, - EndLine: 275, - StartPos: 5253, - EndPos: 5259, + EndLine: 275, + StartPos: 5253, + EndPos: 5259, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 275, - EndLine: 275, - StartPos: 5253, - EndPos: 5254, + EndLine: 275, + StartPos: 5253, + EndPos: 5254, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 275, - EndLine: 275, - StartPos: 5253, - EndPos: 5254, + EndLine: 275, + StartPos: 5253, + EndPos: 5254, }, Value: "a", }, @@ -12759,16 +12693,16 @@ func TestPhp7(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 275, - EndLine: 275, - StartPos: 5258, - EndPos: 5259, + EndLine: 275, + StartPos: 5258, + EndPos: 5259, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 275, - EndLine: 275, - StartPos: 5258, - EndPos: 5259, + EndLine: 275, + StartPos: 5258, + EndPos: 5259, }, Value: "b", }, @@ -12778,30 +12712,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 276, - EndLine: 276, - StartPos: 5264, - EndPos: 5271, + EndLine: 276, + StartPos: 5264, + EndPos: 5271, }, Expr: &binary.BitwiseOr{ Position: &position.Position{ StartLine: 276, - EndLine: 276, - StartPos: 5264, - EndPos: 5270, + EndLine: 276, + StartPos: 5264, + EndPos: 5270, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 276, - EndLine: 276, - StartPos: 5264, - EndPos: 5265, + EndLine: 276, + StartPos: 5264, + EndPos: 5265, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 276, - EndLine: 276, - StartPos: 5264, - EndPos: 5265, + EndLine: 276, + StartPos: 5264, + EndPos: 5265, }, Value: "a", }, @@ -12809,16 +12743,16 @@ func TestPhp7(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 276, - EndLine: 276, - StartPos: 5269, - EndPos: 5270, + EndLine: 276, + StartPos: 5269, + EndPos: 5270, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 276, - EndLine: 276, - StartPos: 5269, - EndPos: 5270, + EndLine: 276, + StartPos: 5269, + EndPos: 5270, }, Value: "b", }, @@ -12828,30 +12762,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 277, - EndLine: 277, - StartPos: 5275, - EndPos: 5282, + EndLine: 277, + StartPos: 5275, + EndPos: 5282, }, Expr: &binary.BitwiseXor{ Position: &position.Position{ StartLine: 277, - EndLine: 277, - StartPos: 5275, - EndPos: 5281, + EndLine: 277, + StartPos: 5275, + EndPos: 5281, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 277, - EndLine: 277, - StartPos: 5275, - EndPos: 5276, + EndLine: 277, + StartPos: 5275, + EndPos: 5276, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 277, - EndLine: 277, - StartPos: 5275, - EndPos: 5276, + EndLine: 277, + StartPos: 5275, + EndPos: 5276, }, Value: "a", }, @@ -12859,16 +12793,16 @@ func TestPhp7(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 277, - EndLine: 277, - StartPos: 5280, - EndPos: 5281, + EndLine: 277, + StartPos: 5280, + EndPos: 5281, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 277, - EndLine: 277, - StartPos: 5280, - EndPos: 5281, + EndLine: 277, + StartPos: 5280, + EndPos: 5281, }, Value: "b", }, @@ -12878,30 +12812,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 278, - EndLine: 278, - StartPos: 5286, - EndPos: 5294, + EndLine: 278, + StartPos: 5286, + EndPos: 5294, }, Expr: &binary.BooleanAnd{ Position: &position.Position{ StartLine: 278, - EndLine: 278, - StartPos: 5286, - EndPos: 5293, + EndLine: 278, + StartPos: 5286, + EndPos: 5293, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 278, - EndLine: 278, - StartPos: 5286, - EndPos: 5287, + EndLine: 278, + StartPos: 5286, + EndPos: 5287, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 278, - EndLine: 278, - StartPos: 5286, - EndPos: 5287, + EndLine: 278, + StartPos: 5286, + EndPos: 5287, }, Value: "a", }, @@ -12909,16 +12843,16 @@ func TestPhp7(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 278, - EndLine: 278, - StartPos: 5292, - EndPos: 5293, + EndLine: 278, + StartPos: 5292, + EndPos: 5293, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 278, - EndLine: 278, - StartPos: 5292, - EndPos: 5293, + EndLine: 278, + StartPos: 5292, + EndPos: 5293, }, Value: "b", }, @@ -12928,30 +12862,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 279, - EndLine: 279, - StartPos: 5298, - EndPos: 5306, + EndLine: 279, + StartPos: 5298, + EndPos: 5306, }, Expr: &binary.BooleanOr{ Position: &position.Position{ StartLine: 279, - EndLine: 279, - StartPos: 5298, - EndPos: 5305, + EndLine: 279, + StartPos: 5298, + EndPos: 5305, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 279, - EndLine: 279, - StartPos: 5298, - EndPos: 5299, + EndLine: 279, + StartPos: 5298, + EndPos: 5299, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 279, - EndLine: 279, - StartPos: 5298, - EndPos: 5299, + EndLine: 279, + StartPos: 5298, + EndPos: 5299, }, Value: "a", }, @@ -12959,16 +12893,16 @@ func TestPhp7(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 279, - EndLine: 279, - StartPos: 5304, - EndPos: 5305, + EndLine: 279, + StartPos: 5304, + EndPos: 5305, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 279, - EndLine: 279, - StartPos: 5304, - EndPos: 5305, + EndLine: 279, + StartPos: 5304, + EndPos: 5305, }, Value: "b", }, @@ -12978,30 +12912,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 280, - EndLine: 280, - StartPos: 5310, - EndPos: 5318, + EndLine: 280, + StartPos: 5310, + EndPos: 5318, }, Expr: &binary.Coalesce{ Position: &position.Position{ StartLine: 280, - EndLine: 280, - StartPos: 5310, - EndPos: 5317, + EndLine: 280, + StartPos: 5310, + EndPos: 5317, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 280, - EndLine: 280, - StartPos: 5310, - EndPos: 5311, + EndLine: 280, + StartPos: 5310, + EndPos: 5311, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 280, - EndLine: 280, - StartPos: 5310, - EndPos: 5311, + EndLine: 280, + StartPos: 5310, + EndPos: 5311, }, Value: "a", }, @@ -13009,16 +12943,16 @@ func TestPhp7(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 280, - EndLine: 280, - StartPos: 5316, - EndPos: 5317, + EndLine: 280, + StartPos: 5316, + EndPos: 5317, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 280, - EndLine: 280, - StartPos: 5316, - EndPos: 5317, + EndLine: 280, + StartPos: 5316, + EndPos: 5317, }, Value: "b", }, @@ -13028,30 +12962,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 281, - EndLine: 281, - StartPos: 5322, - EndPos: 5329, + EndLine: 281, + StartPos: 5322, + EndPos: 5329, }, Expr: &binary.Concat{ Position: &position.Position{ StartLine: 281, - EndLine: 281, - StartPos: 5322, - EndPos: 5328, + EndLine: 281, + StartPos: 5322, + EndPos: 5328, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 281, - EndLine: 281, - StartPos: 5322, - EndPos: 5323, + EndLine: 281, + StartPos: 5322, + EndPos: 5323, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 281, - EndLine: 281, - StartPos: 5322, - EndPos: 5323, + EndLine: 281, + StartPos: 5322, + EndPos: 5323, }, Value: "a", }, @@ -13059,16 +12993,16 @@ func TestPhp7(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 281, - EndLine: 281, - StartPos: 5327, - EndPos: 5328, + EndLine: 281, + StartPos: 5327, + EndPos: 5328, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 281, - EndLine: 281, - StartPos: 5327, - EndPos: 5328, + EndLine: 281, + StartPos: 5327, + EndPos: 5328, }, Value: "b", }, @@ -13078,30 +13012,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 282, - EndLine: 282, - StartPos: 5333, - EndPos: 5340, + EndLine: 282, + StartPos: 5333, + EndPos: 5340, }, Expr: &binary.Div{ Position: &position.Position{ StartLine: 282, - EndLine: 282, - StartPos: 5333, - EndPos: 5339, + EndLine: 282, + StartPos: 5333, + EndPos: 5339, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 282, - EndLine: 282, - StartPos: 5333, - EndPos: 5334, + EndLine: 282, + StartPos: 5333, + EndPos: 5334, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 282, - EndLine: 282, - StartPos: 5333, - EndPos: 5334, + EndLine: 282, + StartPos: 5333, + EndPos: 5334, }, Value: "a", }, @@ -13109,16 +13043,16 @@ func TestPhp7(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 282, - EndLine: 282, - StartPos: 5338, - EndPos: 5339, + EndLine: 282, + StartPos: 5338, + EndPos: 5339, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 282, - EndLine: 282, - StartPos: 5338, - EndPos: 5339, + EndLine: 282, + StartPos: 5338, + EndPos: 5339, }, Value: "b", }, @@ -13128,30 +13062,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 283, - EndLine: 283, - StartPos: 5344, - EndPos: 5352, + EndLine: 283, + StartPos: 5344, + EndPos: 5352, }, Expr: &binary.Equal{ Position: &position.Position{ StartLine: 283, - EndLine: 283, - StartPos: 5344, - EndPos: 5351, + EndLine: 283, + StartPos: 5344, + EndPos: 5351, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 283, - EndLine: 283, - StartPos: 5344, - EndPos: 5345, + EndLine: 283, + StartPos: 5344, + EndPos: 5345, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 283, - EndLine: 283, - StartPos: 5344, - EndPos: 5345, + EndLine: 283, + StartPos: 5344, + EndPos: 5345, }, Value: "a", }, @@ -13159,16 +13093,16 @@ func TestPhp7(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 283, - EndLine: 283, - StartPos: 5350, - EndPos: 5351, + EndLine: 283, + StartPos: 5350, + EndPos: 5351, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 283, - EndLine: 283, - StartPos: 5350, - EndPos: 5351, + EndLine: 283, + StartPos: 5350, + EndPos: 5351, }, Value: "b", }, @@ -13178,30 +13112,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 284, - EndLine: 284, - StartPos: 5356, - EndPos: 5364, + EndLine: 284, + StartPos: 5356, + EndPos: 5364, }, Expr: &binary.GreaterOrEqual{ Position: &position.Position{ StartLine: 284, - EndLine: 284, - StartPos: 5356, - EndPos: 5363, + EndLine: 284, + StartPos: 5356, + EndPos: 5363, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 284, - EndLine: 284, - StartPos: 5356, - EndPos: 5357, + EndLine: 284, + StartPos: 5356, + EndPos: 5357, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 284, - EndLine: 284, - StartPos: 5356, - EndPos: 5357, + EndLine: 284, + StartPos: 5356, + EndPos: 5357, }, Value: "a", }, @@ -13209,16 +13143,16 @@ func TestPhp7(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 284, - EndLine: 284, - StartPos: 5362, - EndPos: 5363, + EndLine: 284, + StartPos: 5362, + EndPos: 5363, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 284, - EndLine: 284, - StartPos: 5362, - EndPos: 5363, + EndLine: 284, + StartPos: 5362, + EndPos: 5363, }, Value: "b", }, @@ -13228,30 +13162,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 285, - EndLine: 285, - StartPos: 5368, - EndPos: 5375, + EndLine: 285, + StartPos: 5368, + EndPos: 5375, }, Expr: &binary.Greater{ Position: &position.Position{ StartLine: 285, - EndLine: 285, - StartPos: 5368, - EndPos: 5374, + EndLine: 285, + StartPos: 5368, + EndPos: 5374, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 285, - EndLine: 285, - StartPos: 5368, - EndPos: 5369, + EndLine: 285, + StartPos: 5368, + EndPos: 5369, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 285, - EndLine: 285, - StartPos: 5368, - EndPos: 5369, + EndLine: 285, + StartPos: 5368, + EndPos: 5369, }, Value: "a", }, @@ -13259,16 +13193,16 @@ func TestPhp7(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 285, - EndLine: 285, - StartPos: 5373, - EndPos: 5374, + EndLine: 285, + StartPos: 5373, + EndPos: 5374, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 285, - EndLine: 285, - StartPos: 5373, - EndPos: 5374, + EndLine: 285, + StartPos: 5373, + EndPos: 5374, }, Value: "b", }, @@ -13278,30 +13212,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 286, - EndLine: 286, - StartPos: 5379, - EndPos: 5388, + EndLine: 286, + StartPos: 5379, + EndPos: 5388, }, Expr: &binary.Identical{ Position: &position.Position{ StartLine: 286, - EndLine: 286, - StartPos: 5379, - EndPos: 5387, + EndLine: 286, + StartPos: 5379, + EndPos: 5387, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 286, - EndLine: 286, - StartPos: 5379, - EndPos: 5380, + EndLine: 286, + StartPos: 5379, + EndPos: 5380, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 286, - EndLine: 286, - StartPos: 5379, - EndPos: 5380, + EndLine: 286, + StartPos: 5379, + EndPos: 5380, }, Value: "a", }, @@ -13309,16 +13243,16 @@ func TestPhp7(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 286, - EndLine: 286, - StartPos: 5386, - EndPos: 5387, + EndLine: 286, + StartPos: 5386, + EndPos: 5387, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 286, - EndLine: 286, - StartPos: 5386, - EndPos: 5387, + EndLine: 286, + StartPos: 5386, + EndPos: 5387, }, Value: "b", }, @@ -13328,30 +13262,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 287, - EndLine: 287, - StartPos: 5392, - EndPos: 5401, + EndLine: 287, + StartPos: 5392, + EndPos: 5401, }, Expr: &binary.LogicalAnd{ Position: &position.Position{ StartLine: 287, - EndLine: 287, - StartPos: 5392, - EndPos: 5400, + EndLine: 287, + StartPos: 5392, + EndPos: 5400, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 287, - EndLine: 287, - StartPos: 5392, - EndPos: 5393, + EndLine: 287, + StartPos: 5392, + EndPos: 5393, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 287, - EndLine: 287, - StartPos: 5392, - EndPos: 5393, + EndLine: 287, + StartPos: 5392, + EndPos: 5393, }, Value: "a", }, @@ -13359,16 +13293,16 @@ func TestPhp7(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 287, - EndLine: 287, - StartPos: 5399, - EndPos: 5400, + EndLine: 287, + StartPos: 5399, + EndPos: 5400, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 287, - EndLine: 287, - StartPos: 5399, - EndPos: 5400, + EndLine: 287, + StartPos: 5399, + EndPos: 5400, }, Value: "b", }, @@ -13378,30 +13312,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 288, - EndLine: 288, - StartPos: 5405, - EndPos: 5413, + EndLine: 288, + StartPos: 5405, + EndPos: 5413, }, Expr: &binary.LogicalOr{ Position: &position.Position{ StartLine: 288, - EndLine: 288, - StartPos: 5405, - EndPos: 5412, + EndLine: 288, + StartPos: 5405, + EndPos: 5412, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 288, - EndLine: 288, - StartPos: 5405, - EndPos: 5406, + EndLine: 288, + StartPos: 5405, + EndPos: 5406, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 288, - EndLine: 288, - StartPos: 5405, - EndPos: 5406, + EndLine: 288, + StartPos: 5405, + EndPos: 5406, }, Value: "a", }, @@ -13409,16 +13343,16 @@ func TestPhp7(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 288, - EndLine: 288, - StartPos: 5411, - EndPos: 5412, + EndLine: 288, + StartPos: 5411, + EndPos: 5412, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 288, - EndLine: 288, - StartPos: 5411, - EndPos: 5412, + EndLine: 288, + StartPos: 5411, + EndPos: 5412, }, Value: "b", }, @@ -13428,30 +13362,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 289, - EndLine: 289, - StartPos: 5417, - EndPos: 5426, + EndLine: 289, + StartPos: 5417, + EndPos: 5426, }, Expr: &binary.LogicalXor{ Position: &position.Position{ StartLine: 289, - EndLine: 289, - StartPos: 5417, - EndPos: 5425, + EndLine: 289, + StartPos: 5417, + EndPos: 5425, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 289, - EndLine: 289, - StartPos: 5417, - EndPos: 5418, + EndLine: 289, + StartPos: 5417, + EndPos: 5418, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 289, - EndLine: 289, - StartPos: 5417, - EndPos: 5418, + EndLine: 289, + StartPos: 5417, + EndPos: 5418, }, Value: "a", }, @@ -13459,16 +13393,16 @@ func TestPhp7(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 289, - EndLine: 289, - StartPos: 5424, - EndPos: 5425, + EndLine: 289, + StartPos: 5424, + EndPos: 5425, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 289, - EndLine: 289, - StartPos: 5424, - EndPos: 5425, + EndLine: 289, + StartPos: 5424, + EndPos: 5425, }, Value: "b", }, @@ -13478,30 +13412,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 290, - EndLine: 290, - StartPos: 5430, - EndPos: 5437, + EndLine: 290, + StartPos: 5430, + EndPos: 5437, }, Expr: &binary.Minus{ Position: &position.Position{ StartLine: 290, - EndLine: 290, - StartPos: 5430, - EndPos: 5436, + EndLine: 290, + StartPos: 5430, + EndPos: 5436, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 290, - EndLine: 290, - StartPos: 5430, - EndPos: 5431, + EndLine: 290, + StartPos: 5430, + EndPos: 5431, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 290, - EndLine: 290, - StartPos: 5430, - EndPos: 5431, + EndLine: 290, + StartPos: 5430, + EndPos: 5431, }, Value: "a", }, @@ -13509,16 +13443,16 @@ func TestPhp7(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 290, - EndLine: 290, - StartPos: 5435, - EndPos: 5436, + EndLine: 290, + StartPos: 5435, + EndPos: 5436, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 290, - EndLine: 290, - StartPos: 5435, - EndPos: 5436, + EndLine: 290, + StartPos: 5435, + EndPos: 5436, }, Value: "b", }, @@ -13528,30 +13462,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 291, - EndLine: 291, - StartPos: 5441, - EndPos: 5448, + EndLine: 291, + StartPos: 5441, + EndPos: 5448, }, Expr: &binary.Mod{ Position: &position.Position{ StartLine: 291, - EndLine: 291, - StartPos: 5441, - EndPos: 5447, + EndLine: 291, + StartPos: 5441, + EndPos: 5447, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 291, - EndLine: 291, - StartPos: 5441, - EndPos: 5442, + EndLine: 291, + StartPos: 5441, + EndPos: 5442, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 291, - EndLine: 291, - StartPos: 5441, - EndPos: 5442, + EndLine: 291, + StartPos: 5441, + EndPos: 5442, }, Value: "a", }, @@ -13559,16 +13493,16 @@ func TestPhp7(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 291, - EndLine: 291, - StartPos: 5446, - EndPos: 5447, + EndLine: 291, + StartPos: 5446, + EndPos: 5447, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 291, - EndLine: 291, - StartPos: 5446, - EndPos: 5447, + EndLine: 291, + StartPos: 5446, + EndPos: 5447, }, Value: "b", }, @@ -13578,30 +13512,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 292, - EndLine: 292, - StartPos: 5452, - EndPos: 5459, + EndLine: 292, + StartPos: 5452, + EndPos: 5459, }, Expr: &binary.Mul{ Position: &position.Position{ StartLine: 292, - EndLine: 292, - StartPos: 5452, - EndPos: 5458, + EndLine: 292, + StartPos: 5452, + EndPos: 5458, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 292, - EndLine: 292, - StartPos: 5452, - EndPos: 5453, + EndLine: 292, + StartPos: 5452, + EndPos: 5453, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 292, - EndLine: 292, - StartPos: 5452, - EndPos: 5453, + EndLine: 292, + StartPos: 5452, + EndPos: 5453, }, Value: "a", }, @@ -13609,16 +13543,16 @@ func TestPhp7(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 292, - EndLine: 292, - StartPos: 5457, - EndPos: 5458, + EndLine: 292, + StartPos: 5457, + EndPos: 5458, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 292, - EndLine: 292, - StartPos: 5457, - EndPos: 5458, + EndLine: 292, + StartPos: 5457, + EndPos: 5458, }, Value: "b", }, @@ -13628,30 +13562,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 293, - EndLine: 293, - StartPos: 5463, - EndPos: 5471, + EndLine: 293, + StartPos: 5463, + EndPos: 5471, }, Expr: &binary.NotEqual{ Position: &position.Position{ StartLine: 293, - EndLine: 293, - StartPos: 5463, - EndPos: 5470, + EndLine: 293, + StartPos: 5463, + EndPos: 5470, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 293, - EndLine: 293, - StartPos: 5463, - EndPos: 5464, + EndLine: 293, + StartPos: 5463, + EndPos: 5464, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 293, - EndLine: 293, - StartPos: 5463, - EndPos: 5464, + EndLine: 293, + StartPos: 5463, + EndPos: 5464, }, Value: "a", }, @@ -13659,16 +13593,16 @@ func TestPhp7(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 293, - EndLine: 293, - StartPos: 5469, - EndPos: 5470, + EndLine: 293, + StartPos: 5469, + EndPos: 5470, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 293, - EndLine: 293, - StartPos: 5469, - EndPos: 5470, + EndLine: 293, + StartPos: 5469, + EndPos: 5470, }, Value: "b", }, @@ -13678,30 +13612,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 294, - EndLine: 294, - StartPos: 5475, - EndPos: 5484, + EndLine: 294, + StartPos: 5475, + EndPos: 5484, }, Expr: &binary.NotIdentical{ Position: &position.Position{ StartLine: 294, - EndLine: 294, - StartPos: 5475, - EndPos: 5483, + EndLine: 294, + StartPos: 5475, + EndPos: 5483, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 294, - EndLine: 294, - StartPos: 5475, - EndPos: 5476, + EndLine: 294, + StartPos: 5475, + EndPos: 5476, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 294, - EndLine: 294, - StartPos: 5475, - EndPos: 5476, + EndLine: 294, + StartPos: 5475, + EndPos: 5476, }, Value: "a", }, @@ -13709,16 +13643,16 @@ func TestPhp7(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 294, - EndLine: 294, - StartPos: 5482, - EndPos: 5483, + EndLine: 294, + StartPos: 5482, + EndPos: 5483, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 294, - EndLine: 294, - StartPos: 5482, - EndPos: 5483, + EndLine: 294, + StartPos: 5482, + EndPos: 5483, }, Value: "b", }, @@ -13728,30 +13662,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 295, - EndLine: 295, - StartPos: 5488, - EndPos: 5495, + EndLine: 295, + StartPos: 5488, + EndPos: 5495, }, Expr: &binary.Plus{ Position: &position.Position{ StartLine: 295, - EndLine: 295, - StartPos: 5488, - EndPos: 5494, + EndLine: 295, + StartPos: 5488, + EndPos: 5494, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 295, - EndLine: 295, - StartPos: 5488, - EndPos: 5489, + EndLine: 295, + StartPos: 5488, + EndPos: 5489, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 295, - EndLine: 295, - StartPos: 5488, - EndPos: 5489, + EndLine: 295, + StartPos: 5488, + EndPos: 5489, }, Value: "a", }, @@ -13759,16 +13693,16 @@ func TestPhp7(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 295, - EndLine: 295, - StartPos: 5493, - EndPos: 5494, + EndLine: 295, + StartPos: 5493, + EndPos: 5494, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 295, - EndLine: 295, - StartPos: 5493, - EndPos: 5494, + EndLine: 295, + StartPos: 5493, + EndPos: 5494, }, Value: "b", }, @@ -13778,30 +13712,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 296, - EndLine: 296, - StartPos: 5499, - EndPos: 5507, + EndLine: 296, + StartPos: 5499, + EndPos: 5507, }, Expr: &binary.Pow{ Position: &position.Position{ StartLine: 296, - EndLine: 296, - StartPos: 5499, - EndPos: 5506, + EndLine: 296, + StartPos: 5499, + EndPos: 5506, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 296, - EndLine: 296, - StartPos: 5499, - EndPos: 5500, + EndLine: 296, + StartPos: 5499, + EndPos: 5500, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 296, - EndLine: 296, - StartPos: 5499, - EndPos: 5500, + EndLine: 296, + StartPos: 5499, + EndPos: 5500, }, Value: "a", }, @@ -13809,16 +13743,16 @@ func TestPhp7(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 296, - EndLine: 296, - StartPos: 5505, - EndPos: 5506, + EndLine: 296, + StartPos: 5505, + EndPos: 5506, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 296, - EndLine: 296, - StartPos: 5505, - EndPos: 5506, + EndLine: 296, + StartPos: 5505, + EndPos: 5506, }, Value: "b", }, @@ -13828,30 +13762,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 297, - EndLine: 297, - StartPos: 5511, - EndPos: 5519, + EndLine: 297, + StartPos: 5511, + EndPos: 5519, }, Expr: &binary.ShiftLeft{ Position: &position.Position{ StartLine: 297, - EndLine: 297, - StartPos: 5511, - EndPos: 5518, + EndLine: 297, + StartPos: 5511, + EndPos: 5518, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 297, - EndLine: 297, - StartPos: 5511, - EndPos: 5512, + EndLine: 297, + StartPos: 5511, + EndPos: 5512, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 297, - EndLine: 297, - StartPos: 5511, - EndPos: 5512, + EndLine: 297, + StartPos: 5511, + EndPos: 5512, }, Value: "a", }, @@ -13859,16 +13793,16 @@ func TestPhp7(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 297, - EndLine: 297, - StartPos: 5517, - EndPos: 5518, + EndLine: 297, + StartPos: 5517, + EndPos: 5518, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 297, - EndLine: 297, - StartPos: 5517, - EndPos: 5518, + EndLine: 297, + StartPos: 5517, + EndPos: 5518, }, Value: "b", }, @@ -13878,30 +13812,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 298, - EndLine: 298, - StartPos: 5523, - EndPos: 5531, + EndLine: 298, + StartPos: 5523, + EndPos: 5531, }, Expr: &binary.ShiftRight{ Position: &position.Position{ StartLine: 298, - EndLine: 298, - StartPos: 5523, - EndPos: 5530, + EndLine: 298, + StartPos: 5523, + EndPos: 5530, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 298, - EndLine: 298, - StartPos: 5523, - EndPos: 5524, + EndLine: 298, + StartPos: 5523, + EndPos: 5524, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 298, - EndLine: 298, - StartPos: 5523, - EndPos: 5524, + EndLine: 298, + StartPos: 5523, + EndPos: 5524, }, Value: "a", }, @@ -13909,16 +13843,16 @@ func TestPhp7(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 298, - EndLine: 298, - StartPos: 5529, - EndPos: 5530, + EndLine: 298, + StartPos: 5529, + EndPos: 5530, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 298, - EndLine: 298, - StartPos: 5529, - EndPos: 5530, + EndLine: 298, + StartPos: 5529, + EndPos: 5530, }, Value: "b", }, @@ -13928,30 +13862,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 299, - EndLine: 299, - StartPos: 5535, - EndPos: 5543, + EndLine: 299, + StartPos: 5535, + EndPos: 5543, }, Expr: &binary.SmallerOrEqual{ Position: &position.Position{ StartLine: 299, - EndLine: 299, - StartPos: 5535, - EndPos: 5542, + EndLine: 299, + StartPos: 5535, + EndPos: 5542, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 299, - EndLine: 299, - StartPos: 5535, - EndPos: 5536, + EndLine: 299, + StartPos: 5535, + EndPos: 5536, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 299, - EndLine: 299, - StartPos: 5535, - EndPos: 5536, + EndLine: 299, + StartPos: 5535, + EndPos: 5536, }, Value: "a", }, @@ -13959,16 +13893,16 @@ func TestPhp7(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 299, - EndLine: 299, - StartPos: 5541, - EndPos: 5542, + EndLine: 299, + StartPos: 5541, + EndPos: 5542, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 299, - EndLine: 299, - StartPos: 5541, - EndPos: 5542, + EndLine: 299, + StartPos: 5541, + EndPos: 5542, }, Value: "b", }, @@ -13978,30 +13912,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 300, - EndLine: 300, - StartPos: 5547, - EndPos: 5554, + EndLine: 300, + StartPos: 5547, + EndPos: 5554, }, Expr: &binary.Smaller{ Position: &position.Position{ StartLine: 300, - EndLine: 300, - StartPos: 5547, - EndPos: 5553, + EndLine: 300, + StartPos: 5547, + EndPos: 5553, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 300, - EndLine: 300, - StartPos: 5547, - EndPos: 5548, + EndLine: 300, + StartPos: 5547, + EndPos: 5548, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 300, - EndLine: 300, - StartPos: 5547, - EndPos: 5548, + EndLine: 300, + StartPos: 5547, + EndPos: 5548, }, Value: "a", }, @@ -14009,16 +13943,16 @@ func TestPhp7(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 300, - EndLine: 300, - StartPos: 5552, - EndPos: 5553, + EndLine: 300, + StartPos: 5552, + EndPos: 5553, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 300, - EndLine: 300, - StartPos: 5552, - EndPos: 5553, + EndLine: 300, + StartPos: 5552, + EndPos: 5553, }, Value: "b", }, @@ -14028,30 +13962,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 301, - EndLine: 301, - StartPos: 5558, - EndPos: 5567, + EndLine: 301, + StartPos: 5558, + EndPos: 5567, }, Expr: &binary.Spaceship{ Position: &position.Position{ StartLine: 301, - EndLine: 301, - StartPos: 5558, - EndPos: 5566, + EndLine: 301, + StartPos: 5558, + EndPos: 5566, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 301, - EndLine: 301, - StartPos: 5558, - EndPos: 5559, + EndLine: 301, + StartPos: 5558, + EndPos: 5559, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 301, - EndLine: 301, - StartPos: 5558, - EndPos: 5559, + EndLine: 301, + StartPos: 5558, + EndPos: 5559, }, Value: "a", }, @@ -14059,16 +13993,16 @@ func TestPhp7(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 301, - EndLine: 301, - StartPos: 5565, - EndPos: 5566, + EndLine: 301, + StartPos: 5565, + EndPos: 5566, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 301, - EndLine: 301, - StartPos: 5565, - EndPos: 5566, + EndLine: 301, + StartPos: 5565, + EndPos: 5566, }, Value: "b", }, @@ -14078,30 +14012,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 303, - EndLine: 303, - StartPos: 5572, - EndPos: 5580, + EndLine: 303, + StartPos: 5572, + EndPos: 5580, }, Expr: &assign.Reference{ Position: &position.Position{ StartLine: 303, - EndLine: 303, - StartPos: 5572, - EndPos: 5579, + EndLine: 303, + StartPos: 5572, + EndPos: 5579, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 303, - EndLine: 303, - StartPos: 5572, - EndPos: 5573, + EndLine: 303, + StartPos: 5572, + EndPos: 5573, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 303, - EndLine: 303, - StartPos: 5572, - EndPos: 5573, + EndLine: 303, + StartPos: 5572, + EndPos: 5573, }, Value: "a", }, @@ -14109,16 +14043,16 @@ func TestPhp7(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 303, - EndLine: 303, - StartPos: 5578, - EndPos: 5579, + EndLine: 303, + StartPos: 5578, + EndPos: 5579, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 303, - EndLine: 303, - StartPos: 5578, - EndPos: 5579, + EndLine: 303, + StartPos: 5578, + EndPos: 5579, }, Value: "b", }, @@ -14128,30 +14062,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 304, - EndLine: 304, - StartPos: 5584, - EndPos: 5591, + EndLine: 304, + StartPos: 5584, + EndPos: 5591, }, Expr: &assign.Assign{ Position: &position.Position{ StartLine: 304, - EndLine: 304, - StartPos: 5584, - EndPos: 5590, + EndLine: 304, + StartPos: 5584, + EndPos: 5590, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 304, - EndLine: 304, - StartPos: 5584, - EndPos: 5585, + EndLine: 304, + StartPos: 5584, + EndPos: 5585, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 304, - EndLine: 304, - StartPos: 5584, - EndPos: 5585, + EndLine: 304, + StartPos: 5584, + EndPos: 5585, }, Value: "a", }, @@ -14159,16 +14093,16 @@ func TestPhp7(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 304, - EndLine: 304, - StartPos: 5589, - EndPos: 5590, + EndLine: 304, + StartPos: 5589, + EndPos: 5590, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 304, - EndLine: 304, - StartPos: 5589, - EndPos: 5590, + EndLine: 304, + StartPos: 5589, + EndPos: 5590, }, Value: "b", }, @@ -14178,30 +14112,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 305, - EndLine: 305, - StartPos: 5595, - EndPos: 5603, + EndLine: 305, + StartPos: 5595, + EndPos: 5603, }, Expr: &assign.BitwiseAnd{ Position: &position.Position{ StartLine: 305, - EndLine: 305, - StartPos: 5595, - EndPos: 5602, + EndLine: 305, + StartPos: 5595, + EndPos: 5602, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 305, - EndLine: 305, - StartPos: 5595, - EndPos: 5596, + EndLine: 305, + StartPos: 5595, + EndPos: 5596, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 305, - EndLine: 305, - StartPos: 5595, - EndPos: 5596, + EndLine: 305, + StartPos: 5595, + EndPos: 5596, }, Value: "a", }, @@ -14209,16 +14143,16 @@ func TestPhp7(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 305, - EndLine: 305, - StartPos: 5601, - EndPos: 5602, + EndLine: 305, + StartPos: 5601, + EndPos: 5602, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 305, - EndLine: 305, - StartPos: 5601, - EndPos: 5602, + EndLine: 305, + StartPos: 5601, + EndPos: 5602, }, Value: "b", }, @@ -14228,30 +14162,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 306, - EndLine: 306, - StartPos: 5607, - EndPos: 5615, + EndLine: 306, + StartPos: 5607, + EndPos: 5615, }, Expr: &assign.BitwiseOr{ Position: &position.Position{ StartLine: 306, - EndLine: 306, - StartPos: 5607, - EndPos: 5614, + EndLine: 306, + StartPos: 5607, + EndPos: 5614, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 306, - EndLine: 306, - StartPos: 5607, - EndPos: 5608, + EndLine: 306, + StartPos: 5607, + EndPos: 5608, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 306, - EndLine: 306, - StartPos: 5607, - EndPos: 5608, + EndLine: 306, + StartPos: 5607, + EndPos: 5608, }, Value: "a", }, @@ -14259,16 +14193,16 @@ func TestPhp7(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 306, - EndLine: 306, - StartPos: 5613, - EndPos: 5614, + EndLine: 306, + StartPos: 5613, + EndPos: 5614, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 306, - EndLine: 306, - StartPos: 5613, - EndPos: 5614, + EndLine: 306, + StartPos: 5613, + EndPos: 5614, }, Value: "b", }, @@ -14278,30 +14212,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 307, - EndLine: 307, - StartPos: 5619, - EndPos: 5627, + EndLine: 307, + StartPos: 5619, + EndPos: 5627, }, Expr: &assign.BitwiseXor{ Position: &position.Position{ StartLine: 307, - EndLine: 307, - StartPos: 5619, - EndPos: 5626, + EndLine: 307, + StartPos: 5619, + EndPos: 5626, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 307, - EndLine: 307, - StartPos: 5619, - EndPos: 5620, + EndLine: 307, + StartPos: 5619, + EndPos: 5620, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 307, - EndLine: 307, - StartPos: 5619, - EndPos: 5620, + EndLine: 307, + StartPos: 5619, + EndPos: 5620, }, Value: "a", }, @@ -14309,16 +14243,16 @@ func TestPhp7(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 307, - EndLine: 307, - StartPos: 5625, - EndPos: 5626, + EndLine: 307, + StartPos: 5625, + EndPos: 5626, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 307, - EndLine: 307, - StartPos: 5625, - EndPos: 5626, + EndLine: 307, + StartPos: 5625, + EndPos: 5626, }, Value: "b", }, @@ -14328,30 +14262,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 308, - EndLine: 308, - StartPos: 5631, - EndPos: 5639, + EndLine: 308, + StartPos: 5631, + EndPos: 5639, }, Expr: &assign.Concat{ Position: &position.Position{ StartLine: 308, - EndLine: 308, - StartPos: 5631, - EndPos: 5638, + EndLine: 308, + StartPos: 5631, + EndPos: 5638, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 308, - EndLine: 308, - StartPos: 5631, - EndPos: 5632, + EndLine: 308, + StartPos: 5631, + EndPos: 5632, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 308, - EndLine: 308, - StartPos: 5631, - EndPos: 5632, + EndLine: 308, + StartPos: 5631, + EndPos: 5632, }, Value: "a", }, @@ -14359,16 +14293,16 @@ func TestPhp7(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 308, - EndLine: 308, - StartPos: 5637, - EndPos: 5638, + EndLine: 308, + StartPos: 5637, + EndPos: 5638, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 308, - EndLine: 308, - StartPos: 5637, - EndPos: 5638, + EndLine: 308, + StartPos: 5637, + EndPos: 5638, }, Value: "b", }, @@ -14378,30 +14312,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 309, - EndLine: 309, - StartPos: 5643, - EndPos: 5651, + EndLine: 309, + StartPos: 5643, + EndPos: 5651, }, Expr: &assign.Div{ Position: &position.Position{ StartLine: 309, - EndLine: 309, - StartPos: 5643, - EndPos: 5650, + EndLine: 309, + StartPos: 5643, + EndPos: 5650, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 309, - EndLine: 309, - StartPos: 5643, - EndPos: 5644, + EndLine: 309, + StartPos: 5643, + EndPos: 5644, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 309, - EndLine: 309, - StartPos: 5643, - EndPos: 5644, + EndLine: 309, + StartPos: 5643, + EndPos: 5644, }, Value: "a", }, @@ -14409,16 +14343,16 @@ func TestPhp7(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 309, - EndLine: 309, - StartPos: 5649, - EndPos: 5650, + EndLine: 309, + StartPos: 5649, + EndPos: 5650, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 309, - EndLine: 309, - StartPos: 5649, - EndPos: 5650, + EndLine: 309, + StartPos: 5649, + EndPos: 5650, }, Value: "b", }, @@ -14428,30 +14362,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 310, - EndLine: 310, - StartPos: 5655, - EndPos: 5663, + EndLine: 310, + StartPos: 5655, + EndPos: 5663, }, Expr: &assign.Minus{ Position: &position.Position{ StartLine: 310, - EndLine: 310, - StartPos: 5655, - EndPos: 5662, + EndLine: 310, + StartPos: 5655, + EndPos: 5662, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 310, - EndLine: 310, - StartPos: 5655, - EndPos: 5656, + EndLine: 310, + StartPos: 5655, + EndPos: 5656, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 310, - EndLine: 310, - StartPos: 5655, - EndPos: 5656, + EndLine: 310, + StartPos: 5655, + EndPos: 5656, }, Value: "a", }, @@ -14459,16 +14393,16 @@ func TestPhp7(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 310, - EndLine: 310, - StartPos: 5661, - EndPos: 5662, + EndLine: 310, + StartPos: 5661, + EndPos: 5662, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 310, - EndLine: 310, - StartPos: 5661, - EndPos: 5662, + EndLine: 310, + StartPos: 5661, + EndPos: 5662, }, Value: "b", }, @@ -14478,30 +14412,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 311, - EndLine: 311, - StartPos: 5667, - EndPos: 5675, + EndLine: 311, + StartPos: 5667, + EndPos: 5675, }, Expr: &assign.Mod{ Position: &position.Position{ StartLine: 311, - EndLine: 311, - StartPos: 5667, - EndPos: 5674, + EndLine: 311, + StartPos: 5667, + EndPos: 5674, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 311, - EndLine: 311, - StartPos: 5667, - EndPos: 5668, + EndLine: 311, + StartPos: 5667, + EndPos: 5668, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 311, - EndLine: 311, - StartPos: 5667, - EndPos: 5668, + EndLine: 311, + StartPos: 5667, + EndPos: 5668, }, Value: "a", }, @@ -14509,16 +14443,16 @@ func TestPhp7(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 311, - EndLine: 311, - StartPos: 5673, - EndPos: 5674, + EndLine: 311, + StartPos: 5673, + EndPos: 5674, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 311, - EndLine: 311, - StartPos: 5673, - EndPos: 5674, + EndLine: 311, + StartPos: 5673, + EndPos: 5674, }, Value: "b", }, @@ -14528,30 +14462,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 312, - EndLine: 312, - StartPos: 5679, - EndPos: 5687, + EndLine: 312, + StartPos: 5679, + EndPos: 5687, }, Expr: &assign.Mul{ Position: &position.Position{ StartLine: 312, - EndLine: 312, - StartPos: 5679, - EndPos: 5686, + EndLine: 312, + StartPos: 5679, + EndPos: 5686, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 312, - EndLine: 312, - StartPos: 5679, - EndPos: 5680, + EndLine: 312, + StartPos: 5679, + EndPos: 5680, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 312, - EndLine: 312, - StartPos: 5679, - EndPos: 5680, + EndLine: 312, + StartPos: 5679, + EndPos: 5680, }, Value: "a", }, @@ -14559,16 +14493,16 @@ func TestPhp7(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 312, - EndLine: 312, - StartPos: 5685, - EndPos: 5686, + EndLine: 312, + StartPos: 5685, + EndPos: 5686, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 312, - EndLine: 312, - StartPos: 5685, - EndPos: 5686, + EndLine: 312, + StartPos: 5685, + EndPos: 5686, }, Value: "b", }, @@ -14578,30 +14512,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 313, - EndLine: 313, - StartPos: 5691, - EndPos: 5699, + EndLine: 313, + StartPos: 5691, + EndPos: 5699, }, Expr: &assign.Plus{ Position: &position.Position{ StartLine: 313, - EndLine: 313, - StartPos: 5691, - EndPos: 5698, + EndLine: 313, + StartPos: 5691, + EndPos: 5698, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 313, - EndLine: 313, - StartPos: 5691, - EndPos: 5692, + EndLine: 313, + StartPos: 5691, + EndPos: 5692, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 313, - EndLine: 313, - StartPos: 5691, - EndPos: 5692, + EndLine: 313, + StartPos: 5691, + EndPos: 5692, }, Value: "a", }, @@ -14609,16 +14543,16 @@ func TestPhp7(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 313, - EndLine: 313, - StartPos: 5697, - EndPos: 5698, + EndLine: 313, + StartPos: 5697, + EndPos: 5698, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 313, - EndLine: 313, - StartPos: 5697, - EndPos: 5698, + EndLine: 313, + StartPos: 5697, + EndPos: 5698, }, Value: "b", }, @@ -14628,30 +14562,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 314, - EndLine: 314, - StartPos: 5703, - EndPos: 5712, + EndLine: 314, + StartPos: 5703, + EndPos: 5712, }, Expr: &assign.Pow{ Position: &position.Position{ StartLine: 314, - EndLine: 314, - StartPos: 5703, - EndPos: 5711, + EndLine: 314, + StartPos: 5703, + EndPos: 5711, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 314, - EndLine: 314, - StartPos: 5703, - EndPos: 5704, + EndLine: 314, + StartPos: 5703, + EndPos: 5704, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 314, - EndLine: 314, - StartPos: 5703, - EndPos: 5704, + EndLine: 314, + StartPos: 5703, + EndPos: 5704, }, Value: "a", }, @@ -14659,16 +14593,16 @@ func TestPhp7(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 314, - EndLine: 314, - StartPos: 5710, - EndPos: 5711, + EndLine: 314, + StartPos: 5710, + EndPos: 5711, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 314, - EndLine: 314, - StartPos: 5710, - EndPos: 5711, + EndLine: 314, + StartPos: 5710, + EndPos: 5711, }, Value: "b", }, @@ -14678,30 +14612,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 315, - EndLine: 315, - StartPos: 5716, - EndPos: 5725, + EndLine: 315, + StartPos: 5716, + EndPos: 5725, }, Expr: &assign.ShiftLeft{ Position: &position.Position{ StartLine: 315, - EndLine: 315, - StartPos: 5716, - EndPos: 5724, + EndLine: 315, + StartPos: 5716, + EndPos: 5724, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 315, - EndLine: 315, - StartPos: 5716, - EndPos: 5717, + EndLine: 315, + StartPos: 5716, + EndPos: 5717, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 315, - EndLine: 315, - StartPos: 5716, - EndPos: 5717, + EndLine: 315, + StartPos: 5716, + EndPos: 5717, }, Value: "a", }, @@ -14709,16 +14643,16 @@ func TestPhp7(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 315, - EndLine: 315, - StartPos: 5723, - EndPos: 5724, + EndLine: 315, + StartPos: 5723, + EndPos: 5724, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 315, - EndLine: 315, - StartPos: 5723, - EndPos: 5724, + EndLine: 315, + StartPos: 5723, + EndPos: 5724, }, Value: "b", }, @@ -14728,30 +14662,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 316, - EndLine: 316, - StartPos: 5729, - EndPos: 5738, + EndLine: 316, + StartPos: 5729, + EndPos: 5738, }, Expr: &assign.ShiftRight{ Position: &position.Position{ StartLine: 316, - EndLine: 316, - StartPos: 5729, - EndPos: 5737, + EndLine: 316, + StartPos: 5729, + EndPos: 5737, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 316, - EndLine: 316, - StartPos: 5729, - EndPos: 5730, + EndLine: 316, + StartPos: 5729, + EndPos: 5730, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 316, - EndLine: 316, - StartPos: 5729, - EndPos: 5730, + EndLine: 316, + StartPos: 5729, + EndPos: 5730, }, Value: "a", }, @@ -14759,16 +14693,16 @@ func TestPhp7(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 316, - EndLine: 316, - StartPos: 5736, - EndPos: 5737, + EndLine: 316, + StartPos: 5736, + EndPos: 5737, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 316, - EndLine: 316, - StartPos: 5736, - EndPos: 5737, + EndLine: 316, + StartPos: 5736, + EndPos: 5737, }, Value: "b", }, @@ -14778,17 +14712,17 @@ func TestPhp7(t *testing.T) { &stmt.Class{ Position: &position.Position{ StartLine: 318, - EndLine: 318, - StartPos: 5743, - EndPos: 5781, + EndLine: 318, + StartPos: 5743, + EndPos: 5781, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 318, - EndLine: 318, - StartPos: 5749, - EndPos: 5751, + EndLine: 318, + StartPos: 5749, + EndPos: 5751, }, Value: "foo", }, @@ -14796,18 +14730,18 @@ func TestPhp7(t *testing.T) { &stmt.ClassMethod{ Position: &position.Position{ StartLine: 318, - EndLine: 318, - StartPos: 5754, - EndPos: 5779, + EndLine: 318, + StartPos: 5754, + EndPos: 5779, }, - ReturnsRef: false, + ReturnsRef: false, PhpDocComment: "", MethodName: &node.Identifier{ Position: &position.Position{ StartLine: 318, - EndLine: 318, - StartPos: 5770, - EndPos: 5774, + EndLine: 318, + StartPos: 5770, + EndPos: 5774, }, Value: "class", }, @@ -14815,9 +14749,9 @@ func TestPhp7(t *testing.T) { &node.Identifier{ Position: &position.Position{ StartLine: 318, - EndLine: 318, - StartPos: 5754, - EndPos: 5759, + EndLine: 318, + StartPos: 5754, + EndPos: 5759, }, Value: "public", }, @@ -14825,12 +14759,11 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 318, - EndLine: 318, - StartPos: 5778, - EndPos: 5779, - }, - Stmts: []node.Node{ + EndLine: 318, + StartPos: 5778, + EndPos: 5779, }, + Stmts: []node.Node{}, }, }, }, @@ -14838,40 +14771,40 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 319, - EndLine: 319, - StartPos: 5785, - EndPos: 5795, + EndLine: 319, + StartPos: 5785, + EndPos: 5795, }, Expr: &expr.FunctionCall{ Position: &position.Position{ StartLine: 319, - EndLine: 319, - StartPos: 5785, - EndPos: 5794, + EndLine: 319, + StartPos: 5785, + EndPos: 5794, }, Function: &name.FullyQualified{ Position: &position.Position{ StartLine: 319, - EndLine: 319, - StartPos: 5785, - EndPos: 5792, + EndLine: 319, + StartPos: 5785, + EndPos: 5792, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 319, - EndLine: 319, - StartPos: 5786, - EndPos: 5788, + EndLine: 319, + StartPos: 5786, + EndPos: 5788, }, Value: "foo", }, &name.NamePart{ Position: &position.Position{ StartLine: 319, - EndLine: 319, - StartPos: 5790, - EndPos: 5792, + EndLine: 319, + StartPos: 5790, + EndPos: 5792, }, Value: "bar", }, @@ -14880,9 +14813,9 @@ func TestPhp7(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 319, - EndLine: 319, - StartPos: 5793, - EndPos: 5794, + EndLine: 319, + StartPos: 5793, + EndPos: 5794, }, }, }, @@ -14890,18 +14823,18 @@ func TestPhp7(t *testing.T) { &stmt.Function{ Position: &position.Position{ StartLine: 321, - EndLine: 327, - StartPos: 5800, - EndPos: 5926, + EndLine: 327, + StartPos: 5800, + EndPos: 5926, }, - ReturnsRef: false, + ReturnsRef: false, PhpDocComment: "", FunctionName: &node.Identifier{ Position: &position.Position{ StartLine: 321, - EndLine: 321, - StartPos: 5809, - EndPos: 5811, + EndLine: 321, + StartPos: 5809, + EndPos: 5811, }, Value: "foo", }, @@ -14909,25 +14842,25 @@ func TestPhp7(t *testing.T) { &node.Parameter{ Position: &position.Position{ StartLine: 321, - EndLine: 321, - StartPos: 5813, - EndPos: 5815, + EndLine: 321, + StartPos: 5813, + EndPos: 5815, }, - ByRef: true, + ByRef: true, Variadic: false, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 321, - EndLine: 321, - StartPos: 5814, - EndPos: 5815, + EndLine: 321, + StartPos: 5814, + EndPos: 5815, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 321, - EndLine: 321, - StartPos: 5814, - EndPos: 5815, + EndLine: 321, + StartPos: 5814, + EndPos: 5815, }, Value: "a", }, @@ -14936,25 +14869,25 @@ func TestPhp7(t *testing.T) { &node.Parameter{ Position: &position.Position{ StartLine: 321, - EndLine: 321, - StartPos: 5818, - EndPos: 5822, + EndLine: 321, + StartPos: 5818, + EndPos: 5822, }, - ByRef: false, + ByRef: false, Variadic: true, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 321, - EndLine: 321, - StartPos: 5821, - EndPos: 5822, + EndLine: 321, + StartPos: 5821, + EndPos: 5822, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 321, - EndLine: 321, - StartPos: 5821, - EndPos: 5822, + EndLine: 321, + StartPos: 5821, + EndPos: 5822, }, Value: "b", }, @@ -14965,109 +14898,105 @@ func TestPhp7(t *testing.T) { &stmt.HaltCompiler{ Position: &position.Position{ StartLine: 322, - EndLine: 322, - StartPos: 5830, - EndPos: 5847, + EndLine: 322, + StartPos: 5830, + EndPos: 5847, }, }, &stmt.Function{ Position: &position.Position{ StartLine: 323, - EndLine: 323, - StartPos: 5852, - EndPos: 5868, + EndLine: 323, + StartPos: 5852, + EndPos: 5868, }, + ReturnsRef: false, PhpDocComment: "", - ReturnsRef: false, FunctionName: &node.Identifier{ Position: &position.Position{ StartLine: 323, - EndLine: 323, - StartPos: 5861, - EndPos: 5863, + EndLine: 323, + StartPos: 5861, + EndPos: 5863, }, Value: "bar", }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, &stmt.Class{ Position: &position.Position{ StartLine: 324, - EndLine: 324, - StartPos: 5873, - EndPos: 5884, + EndLine: 324, + StartPos: 5873, + EndPos: 5884, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 324, - EndLine: 324, - StartPos: 5879, - EndPos: 5881, + EndLine: 324, + StartPos: 5879, + EndPos: 5881, }, Value: "Baz", }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, &stmt.Trait{ Position: &position.Position{ StartLine: 325, - EndLine: 325, - StartPos: 5889, - EndPos: 5900, + EndLine: 325, + StartPos: 5889, + EndPos: 5900, }, PhpDocComment: "", TraitName: &node.Identifier{ Position: &position.Position{ StartLine: 325, - EndLine: 325, - StartPos: 5895, - EndPos: 5898, + EndLine: 325, + StartPos: 5895, + EndPos: 5898, }, Value: "Quux", }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, &stmt.Interface{ Position: &position.Position{ StartLine: 326, - EndLine: 326, - StartPos: 5905, - EndPos: 5922, + EndLine: 326, + StartPos: 5905, + EndPos: 5922, }, PhpDocComment: "", InterfaceName: &node.Identifier{ Position: &position.Position{ StartLine: 326, - EndLine: 326, - StartPos: 5915, - EndPos: 5919, + EndLine: 326, + StartPos: 5915, + EndPos: 5919, }, Value: "Quuux", }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, }, }, &stmt.Function{ Position: &position.Position{ StartLine: 329, - EndLine: 329, - StartPos: 5933, - EndPos: 5975, + EndLine: 329, + StartPos: 5933, + EndPos: 5975, }, - ReturnsRef: false, + ReturnsRef: false, PhpDocComment: "", FunctionName: &node.Identifier{ Position: &position.Position{ StartLine: 329, - EndLine: 329, - StartPos: 5942, - EndPos: 5944, + EndLine: 329, + StartPos: 5942, + EndPos: 5944, }, Value: "foo", }, @@ -15075,25 +15004,25 @@ func TestPhp7(t *testing.T) { &node.Parameter{ Position: &position.Position{ StartLine: 329, - EndLine: 329, - StartPos: 5946, - EndPos: 5952, + EndLine: 329, + StartPos: 5946, + EndPos: 5952, }, - ByRef: true, + ByRef: true, Variadic: false, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 329, - EndLine: 329, - StartPos: 5947, - EndPos: 5948, + EndLine: 329, + StartPos: 5947, + EndPos: 5948, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 329, - EndLine: 329, - StartPos: 5947, - EndPos: 5948, + EndLine: 329, + StartPos: 5947, + EndPos: 5948, }, Value: "a", }, @@ -15101,9 +15030,9 @@ func TestPhp7(t *testing.T) { DefaultValue: &scalar.Lnumber{ Position: &position.Position{ StartLine: 329, - EndLine: 329, - StartPos: 5952, - EndPos: 5952, + EndLine: 329, + StartPos: 5952, + EndPos: 5952, }, Value: "1", }, @@ -15111,25 +15040,25 @@ func TestPhp7(t *testing.T) { &node.Parameter{ Position: &position.Position{ StartLine: 329, - EndLine: 329, - StartPos: 5955, - EndPos: 5963, + EndLine: 329, + StartPos: 5955, + EndPos: 5963, }, + ByRef: false, Variadic: true, - ByRef: false, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 329, - EndLine: 329, - StartPos: 5958, - EndPos: 5959, + EndLine: 329, + StartPos: 5958, + EndPos: 5959, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 329, - EndLine: 329, - StartPos: 5958, - EndPos: 5959, + EndLine: 329, + StartPos: 5958, + EndPos: 5959, }, Value: "b", }, @@ -15137,9 +15066,9 @@ func TestPhp7(t *testing.T) { DefaultValue: &scalar.Lnumber{ Position: &position.Position{ StartLine: 329, - EndLine: 329, - StartPos: 5963, - EndPos: 5963, + EndLine: 329, + StartPos: 5963, + EndPos: 5963, }, Value: "1", }, @@ -15147,25 +15076,25 @@ func TestPhp7(t *testing.T) { &node.Parameter{ Position: &position.Position{ StartLine: 329, - EndLine: 329, - StartPos: 5966, - EndPos: 5971, + EndLine: 329, + StartPos: 5966, + EndPos: 5971, }, - ByRef: false, + ByRef: false, Variadic: false, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 329, - EndLine: 329, - StartPos: 5966, - EndPos: 5967, + EndLine: 329, + StartPos: 5966, + EndPos: 5967, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 329, - EndLine: 329, - StartPos: 5966, - EndPos: 5967, + EndLine: 329, + StartPos: 5966, + EndPos: 5967, }, Value: "c", }, @@ -15173,32 +15102,31 @@ func TestPhp7(t *testing.T) { DefaultValue: &scalar.Lnumber{ Position: &position.Position{ StartLine: 329, - EndLine: 329, - StartPos: 5971, - EndPos: 5971, + EndLine: 329, + StartPos: 5971, + EndPos: 5971, }, Value: "1", }, }, }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, &stmt.Function{ Position: &position.Position{ StartLine: 330, - EndLine: 330, - StartPos: 5979, - EndPos: 6016, + EndLine: 330, + StartPos: 5979, + EndPos: 6016, }, - ReturnsRef: false, + ReturnsRef: false, PhpDocComment: "", FunctionName: &node.Identifier{ Position: &position.Position{ StartLine: 330, - EndLine: 330, - StartPos: 5988, - EndPos: 5990, + EndLine: 330, + StartPos: 5988, + EndPos: 5990, }, Value: "foo", }, @@ -15206,34 +15134,34 @@ func TestPhp7(t *testing.T) { &node.Parameter{ Position: &position.Position{ StartLine: 330, - EndLine: 330, - StartPos: 5992, - EndPos: 5999, + EndLine: 330, + StartPos: 5992, + EndPos: 5999, }, - ByRef: false, + ByRef: false, Variadic: false, VariableType: &node.Identifier{ Position: &position.Position{ StartLine: 330, - EndLine: 330, - StartPos: 5992, - EndPos: 5996, + EndLine: 330, + StartPos: 5992, + EndPos: 5996, }, Value: "array", }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 330, - EndLine: 330, - StartPos: 5998, - EndPos: 5999, + EndLine: 330, + StartPos: 5998, + EndPos: 5999, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 330, - EndLine: 330, - StartPos: 5998, - EndPos: 5999, + EndLine: 330, + StartPos: 5998, + EndPos: 5999, }, Value: "a", }, @@ -15242,57 +15170,56 @@ func TestPhp7(t *testing.T) { &node.Parameter{ Position: &position.Position{ StartLine: 330, - EndLine: 330, - StartPos: 6002, - EndPos: 6012, + EndLine: 330, + StartPos: 6002, + EndPos: 6012, }, - ByRef: false, Variadic: false, + ByRef: false, VariableType: &node.Identifier{ Position: &position.Position{ StartLine: 330, - EndLine: 330, - StartPos: 6002, - EndPos: 6009, + EndLine: 330, + StartPos: 6002, + EndPos: 6009, }, Value: "callable", }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 330, - EndLine: 330, - StartPos: 6011, - EndPos: 6012, + EndLine: 330, + StartPos: 6011, + EndPos: 6012, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 330, - EndLine: 330, - StartPos: 6011, - EndPos: 6012, + EndLine: 330, + StartPos: 6011, + EndPos: 6012, }, Value: "b", }, }, }, }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, &stmt.Class{ Position: &position.Position{ StartLine: 331, - EndLine: 331, - StartPos: 6020, - EndPos: 6121, + EndLine: 331, + StartPos: 6020, + EndPos: 6121, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 331, - EndLine: 331, - StartPos: 6041, - EndPos: 6043, + EndLine: 331, + StartPos: 6041, + EndPos: 6043, }, Value: "foo", }, @@ -15300,18 +15227,18 @@ func TestPhp7(t *testing.T) { &node.Identifier{ Position: &position.Position{ StartLine: 331, - EndLine: 331, - StartPos: 6020, - EndPos: 6027, + EndLine: 331, + StartPos: 6020, + EndPos: 6027, }, Value: "abstract", }, &node.Identifier{ Position: &position.Position{ StartLine: 331, - EndLine: 331, - StartPos: 6029, - EndPos: 6033, + EndLine: 331, + StartPos: 6029, + EndPos: 6033, }, Value: "final", }, @@ -15320,18 +15247,18 @@ func TestPhp7(t *testing.T) { &stmt.ClassMethod{ Position: &position.Position{ StartLine: 331, - EndLine: 331, - StartPos: 6047, - EndPos: 6087, + EndLine: 331, + StartPos: 6047, + EndPos: 6087, }, + ReturnsRef: false, PhpDocComment: "", - ReturnsRef: false, MethodName: &node.Identifier{ Position: &position.Position{ StartLine: 331, - EndLine: 331, - StartPos: 6082, - EndPos: 6084, + EndLine: 331, + StartPos: 6082, + EndPos: 6084, }, Value: "bar", }, @@ -15339,27 +15266,27 @@ func TestPhp7(t *testing.T) { &node.Identifier{ Position: &position.Position{ StartLine: 331, - EndLine: 331, - StartPos: 6047, - EndPos: 6054, + EndLine: 331, + StartPos: 6047, + EndPos: 6054, }, Value: "abstract", }, &node.Identifier{ Position: &position.Position{ StartLine: 331, - EndLine: 331, - StartPos: 6056, - EndPos: 6064, + EndLine: 331, + StartPos: 6056, + EndPos: 6064, }, Value: "protected", }, &node.Identifier{ Position: &position.Position{ StartLine: 331, - EndLine: 331, - StartPos: 6066, - EndPos: 6071, + EndLine: 331, + StartPos: 6066, + EndPos: 6071, }, Value: "static", }, @@ -15367,27 +15294,27 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.Nop{ Position: &position.Position{ StartLine: 331, - EndLine: 331, - StartPos: 6087, - EndPos: 6087, + EndLine: 331, + StartPos: 6087, + EndPos: 6087, }, }, }, &stmt.ClassMethod{ Position: &position.Position{ StartLine: 331, - EndLine: 331, - StartPos: 6089, - EndPos: 6119, + EndLine: 331, + StartPos: 6089, + EndPos: 6119, }, - ReturnsRef: false, + ReturnsRef: false, PhpDocComment: "", MethodName: &node.Identifier{ Position: &position.Position{ StartLine: 331, - EndLine: 331, - StartPos: 6112, - EndPos: 6114, + EndLine: 331, + StartPos: 6112, + EndPos: 6114, }, Value: "baz", }, @@ -15395,18 +15322,18 @@ func TestPhp7(t *testing.T) { &node.Identifier{ Position: &position.Position{ StartLine: 331, - EndLine: 331, - StartPos: 6089, - EndPos: 6093, + EndLine: 331, + StartPos: 6089, + EndPos: 6093, }, Value: "final", }, &node.Identifier{ Position: &position.Position{ StartLine: 331, - EndLine: 331, - StartPos: 6095, - EndPos: 6101, + EndLine: 331, + StartPos: 6095, + EndPos: 6101, }, Value: "private", }, @@ -15414,12 +15341,11 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 331, - EndLine: 331, - StartPos: 6118, - EndPos: 6119, - }, - Stmts: []node.Node{ + EndLine: 331, + StartPos: 6118, + EndPos: 6119, }, + Stmts: []node.Node{}, }, }, }, @@ -15427,38 +15353,38 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 333, - EndLine: 333, - StartPos: 6127, - EndPos: 6140, + EndLine: 333, + StartPos: 6127, + EndPos: 6140, }, Expr: &expr.PropertyFetch{ Position: &position.Position{ StartLine: 333, - EndLine: 333, - StartPos: 6127, - EndPos: 6139, + EndLine: 333, + StartPos: 6127, + EndPos: 6139, }, Variable: &expr.New{ Position: &position.Position{ StartLine: 333, - EndLine: 333, - StartPos: 6127, - EndPos: 6133, + EndLine: 333, + StartPos: 6127, + EndPos: 6133, }, Class: &name.Name{ Position: &position.Position{ StartLine: 333, - EndLine: 333, - StartPos: 6131, - EndPos: 6133, + EndLine: 333, + StartPos: 6131, + EndPos: 6133, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 333, - EndLine: 333, - StartPos: 6131, - EndPos: 6133, + EndLine: 333, + StartPos: 6131, + EndPos: 6133, }, Value: "Foo", }, @@ -15468,9 +15394,9 @@ func TestPhp7(t *testing.T) { Property: &node.Identifier{ Position: &position.Position{ StartLine: 333, - EndLine: 333, - StartPos: 6137, - EndPos: 6139, + EndLine: 333, + StartPos: 6137, + EndPos: 6139, }, Value: "bar", }, @@ -15479,38 +15405,38 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 334, - EndLine: 334, - StartPos: 6145, - EndPos: 6155, + EndLine: 334, + StartPos: 6145, + EndPos: 6155, }, Expr: &expr.FunctionCall{ Position: &position.Position{ StartLine: 334, - EndLine: 334, - StartPos: 6145, - EndPos: 6154, + EndLine: 334, + StartPos: 6145, + EndPos: 6154, }, Function: &expr.New{ Position: &position.Position{ StartLine: 334, - EndLine: 334, - StartPos: 6145, - EndPos: 6151, + EndLine: 334, + StartPos: 6145, + EndPos: 6151, }, Class: &name.Name{ Position: &position.Position{ StartLine: 334, - EndLine: 334, - StartPos: 6149, - EndPos: 6151, + EndLine: 334, + StartPos: 6149, + EndPos: 6151, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 334, - EndLine: 334, - StartPos: 6149, - EndPos: 6151, + EndLine: 334, + StartPos: 6149, + EndPos: 6151, }, Value: "Foo", }, @@ -15520,9 +15446,9 @@ func TestPhp7(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 334, - EndLine: 334, - StartPos: 6153, - EndPos: 6154, + EndLine: 334, + StartPos: 6153, + EndPos: 6154, }, }, }, @@ -15530,52 +15456,52 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 335, - EndLine: 335, - StartPos: 6159, - EndPos: 6170, + EndLine: 335, + StartPos: 6159, + EndPos: 6170, }, Expr: &expr.FunctionCall{ Position: &position.Position{ StartLine: 335, - EndLine: 335, - StartPos: 6159, - EndPos: 6169, + EndLine: 335, + StartPos: 6159, + EndPos: 6169, }, Function: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 335, - EndLine: 335, - StartPos: 6159, - EndPos: 6167, + EndLine: 335, + StartPos: 6159, + EndPos: 6167, }, Variable: &expr.ShortArray{ Position: &position.Position{ StartLine: 335, - EndLine: 335, - StartPos: 6159, - EndPos: 6164, + EndLine: 335, + StartPos: 6159, + EndPos: 6164, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 335, - EndLine: 335, - StartPos: 6160, - EndPos: 6163, + EndLine: 335, + StartPos: 6160, + EndPos: 6163, }, Val: &expr.Variable{ Position: &position.Position{ StartLine: 335, - EndLine: 335, - StartPos: 6160, - EndPos: 6163, + EndLine: 335, + StartPos: 6160, + EndPos: 6163, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 335, - EndLine: 335, - StartPos: 6160, - EndPos: 6163, + EndLine: 335, + StartPos: 6160, + EndPos: 6163, }, Value: "foo", }, @@ -15586,9 +15512,9 @@ func TestPhp7(t *testing.T) { Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 335, - EndLine: 335, - StartPos: 6166, - EndPos: 6166, + EndLine: 335, + StartPos: 6166, + EndPos: 6166, }, Value: "0", }, @@ -15596,9 +15522,9 @@ func TestPhp7(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 335, - EndLine: 335, - StartPos: 6168, - EndPos: 6169, + EndLine: 335, + StartPos: 6168, + EndPos: 6169, }, }, }, @@ -15606,45 +15532,45 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 336, - EndLine: 336, - StartPos: 6174, - EndPos: 6182, + EndLine: 336, + StartPos: 6174, + EndPos: 6182, }, Expr: &expr.FunctionCall{ Position: &position.Position{ StartLine: 336, - EndLine: 336, - StartPos: 6174, - EndPos: 6181, + EndLine: 336, + StartPos: 6174, + EndPos: 6181, }, Function: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 336, - EndLine: 336, - StartPos: 6174, - EndPos: 6179, + EndLine: 336, + StartPos: 6174, + EndPos: 6179, }, Variable: &expr.ConstFetch{ Position: &position.Position{ StartLine: 336, - EndLine: 336, - StartPos: 6174, - EndPos: 6176, + EndLine: 336, + StartPos: 6174, + EndPos: 6176, }, Constant: &name.Name{ Position: &position.Position{ StartLine: 336, - EndLine: 336, - StartPos: 6174, - EndPos: 6176, + EndLine: 336, + StartPos: 6174, + EndPos: 6176, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 336, - EndLine: 336, - StartPos: 6174, - EndPos: 6176, + EndLine: 336, + StartPos: 6174, + EndPos: 6176, }, Value: "foo", }, @@ -15654,9 +15580,9 @@ func TestPhp7(t *testing.T) { Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 336, - EndLine: 336, - StartPos: 6178, - EndPos: 6178, + EndLine: 336, + StartPos: 6178, + EndPos: 6178, }, Value: "1", }, @@ -15664,9 +15590,9 @@ func TestPhp7(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 336, - EndLine: 336, - StartPos: 6180, - EndPos: 6181, + EndLine: 336, + StartPos: 6180, + EndPos: 6181, }, }, }, @@ -15674,32 +15600,32 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 337, - EndLine: 337, - StartPos: 6186, - EndPos: 6193, + EndLine: 337, + StartPos: 6186, + EndPos: 6193, }, Expr: &expr.FunctionCall{ Position: &position.Position{ StartLine: 337, - EndLine: 337, - StartPos: 6186, - EndPos: 6192, + EndLine: 337, + StartPos: 6186, + EndPos: 6192, }, Function: &scalar.String{ Position: &position.Position{ StartLine: 337, - EndLine: 337, - StartPos: 6186, - EndPos: 6190, + EndLine: 337, + StartPos: 6186, + EndPos: 6190, }, Value: "\"foo\"", }, ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 337, - EndLine: 337, - StartPos: 6191, - EndPos: 6192, + EndLine: 337, + StartPos: 6191, + EndPos: 6192, }, }, }, @@ -15707,45 +15633,45 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 338, - EndLine: 338, - StartPos: 6197, - EndPos: 6208, + EndLine: 338, + StartPos: 6197, + EndPos: 6208, }, Expr: &expr.FunctionCall{ Position: &position.Position{ StartLine: 338, - EndLine: 338, - StartPos: 6197, - EndPos: 6207, + EndLine: 338, + StartPos: 6197, + EndPos: 6207, }, Function: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 338, - EndLine: 338, - StartPos: 6197, - EndPos: 6205, + EndLine: 338, + StartPos: 6197, + EndPos: 6205, }, Variable: &expr.ShortArray{ Position: &position.Position{ StartLine: 338, - EndLine: 338, - StartPos: 6197, - EndPos: 6199, + EndLine: 338, + StartPos: 6197, + EndPos: 6199, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 338, - EndLine: 338, - StartPos: 6198, - EndPos: 6198, + EndLine: 338, + StartPos: 6198, + EndPos: 6198, }, Val: &scalar.Lnumber{ Position: &position.Position{ StartLine: 338, - EndLine: 338, - StartPos: 6198, - EndPos: 6198, + EndLine: 338, + StartPos: 6198, + EndPos: 6198, }, Value: "1", }, @@ -15755,16 +15681,16 @@ func TestPhp7(t *testing.T) { Dim: &expr.Variable{ Position: &position.Position{ StartLine: 338, - EndLine: 338, - StartPos: 6201, - EndPos: 6204, + EndLine: 338, + StartPos: 6201, + EndPos: 6204, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 338, - EndLine: 338, - StartPos: 6201, - EndPos: 6204, + EndLine: 338, + StartPos: 6201, + EndPos: 6204, }, Value: "foo", }, @@ -15773,9 +15699,9 @@ func TestPhp7(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 338, - EndLine: 338, - StartPos: 6206, - EndPos: 6207, + EndLine: 338, + StartPos: 6206, + EndPos: 6207, }, }, }, @@ -15783,38 +15709,38 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 339, - EndLine: 339, - StartPos: 6212, - EndPos: 6220, + EndLine: 339, + StartPos: 6212, + EndPos: 6220, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 339, - EndLine: 339, - StartPos: 6212, - EndPos: 6219, + EndLine: 339, + StartPos: 6212, + EndPos: 6219, }, VarName: &expr.FunctionCall{ Position: &position.Position{ StartLine: 339, - EndLine: 339, - StartPos: 6214, - EndPos: 6218, + EndLine: 339, + StartPos: 6214, + EndPos: 6218, }, Function: &name.Name{ Position: &position.Position{ StartLine: 339, - EndLine: 339, - StartPos: 6214, - EndPos: 6216, + EndLine: 339, + StartPos: 6214, + EndPos: 6216, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 339, - EndLine: 339, - StartPos: 6214, - EndPos: 6216, + EndLine: 339, + StartPos: 6214, + EndPos: 6216, }, Value: "foo", }, @@ -15823,9 +15749,9 @@ func TestPhp7(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 339, - EndLine: 339, - StartPos: 6217, - EndPos: 6218, + EndLine: 339, + StartPos: 6217, + EndPos: 6218, }, }, }, @@ -15834,31 +15760,31 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 341, - EndLine: 341, - StartPos: 6225, - EndPos: 6236, + EndLine: 341, + StartPos: 6225, + EndPos: 6236, }, Expr: &expr.StaticCall{ Position: &position.Position{ StartLine: 341, - EndLine: 341, - StartPos: 6225, - EndPos: 6235, + EndLine: 341, + StartPos: 6225, + EndPos: 6235, }, Class: &name.Name{ Position: &position.Position{ StartLine: 341, - EndLine: 341, - StartPos: 6225, - EndPos: 6227, + EndLine: 341, + StartPos: 6225, + EndPos: 6227, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 341, - EndLine: 341, - StartPos: 6225, - EndPos: 6227, + EndLine: 341, + StartPos: 6225, + EndPos: 6227, }, Value: "Foo", }, @@ -15867,16 +15793,16 @@ func TestPhp7(t *testing.T) { Call: &expr.Variable{ Position: &position.Position{ StartLine: 341, - EndLine: 341, - StartPos: 6230, - EndPos: 6233, + EndLine: 341, + StartPos: 6230, + EndPos: 6233, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 341, - EndLine: 341, - StartPos: 6230, - EndPos: 6233, + EndLine: 341, + StartPos: 6230, + EndPos: 6233, }, Value: "bar", }, @@ -15884,9 +15810,9 @@ func TestPhp7(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 341, - EndLine: 341, - StartPos: 6234, - EndPos: 6235, + EndLine: 341, + StartPos: 6234, + EndPos: 6235, }, }, }, @@ -15894,31 +15820,31 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 342, - EndLine: 342, - StartPos: 6240, - EndPos: 6256, + EndLine: 342, + StartPos: 6240, + EndPos: 6256, }, Expr: &expr.StaticCall{ Position: &position.Position{ StartLine: 342, - EndLine: 342, - StartPos: 6240, - EndPos: 6255, + EndLine: 342, + StartPos: 6240, + EndPos: 6255, }, Class: &name.Name{ Position: &position.Position{ StartLine: 342, - EndLine: 342, - StartPos: 6240, - EndPos: 6242, + EndLine: 342, + StartPos: 6240, + EndPos: 6242, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 342, - EndLine: 342, - StartPos: 6240, - EndPos: 6242, + EndLine: 342, + StartPos: 6240, + EndPos: 6242, }, Value: "Foo", }, @@ -15927,23 +15853,23 @@ func TestPhp7(t *testing.T) { Call: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 342, - EndLine: 342, - StartPos: 6246, - EndPos: 6252, + EndLine: 342, + StartPos: 6246, + EndPos: 6252, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 342, - EndLine: 342, - StartPos: 6246, - EndPos: 6249, + EndLine: 342, + StartPos: 6246, + EndPos: 6249, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 342, - EndLine: 342, - StartPos: 6246, - EndPos: 6249, + EndLine: 342, + StartPos: 6246, + EndPos: 6249, }, Value: "bar", }, @@ -15951,9 +15877,9 @@ func TestPhp7(t *testing.T) { Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 342, - EndLine: 342, - StartPos: 6251, - EndPos: 6251, + EndLine: 342, + StartPos: 6251, + EndPos: 6251, }, Value: "0", }, @@ -15961,9 +15887,9 @@ func TestPhp7(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 342, - EndLine: 342, - StartPos: 6254, - EndPos: 6255, + EndLine: 342, + StartPos: 6254, + EndPos: 6255, }, }, }, @@ -15971,30 +15897,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 344, - EndLine: 344, - StartPos: 6263, - EndPos: 6273, + EndLine: 344, + StartPos: 6263, + EndPos: 6273, }, Expr: &expr.PropertyFetch{ Position: &position.Position{ StartLine: 344, - EndLine: 344, - StartPos: 6263, - EndPos: 6272, + EndLine: 344, + StartPos: 6263, + EndPos: 6272, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 344, - EndLine: 344, - StartPos: 6263, - EndPos: 6266, + EndLine: 344, + StartPos: 6263, + EndPos: 6266, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 344, - EndLine: 344, - StartPos: 6263, - EndPos: 6266, + EndLine: 344, + StartPos: 6263, + EndPos: 6266, }, Value: "foo", }, @@ -16002,16 +15928,16 @@ func TestPhp7(t *testing.T) { Property: &expr.Variable{ Position: &position.Position{ StartLine: 344, - EndLine: 344, - StartPos: 6269, - EndPos: 6272, + EndLine: 344, + StartPos: 6269, + EndPos: 6272, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 344, - EndLine: 344, - StartPos: 6269, - EndPos: 6272, + EndLine: 344, + StartPos: 6269, + EndPos: 6272, }, Value: "bar", }, @@ -16021,30 +15947,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 345, - EndLine: 345, - StartPos: 6277, - EndPos: 6292, + EndLine: 345, + StartPos: 6277, + EndPos: 6292, }, Expr: &expr.PropertyFetch{ Position: &position.Position{ StartLine: 345, - EndLine: 345, - StartPos: 6277, - EndPos: 6290, + EndLine: 345, + StartPos: 6277, + EndPos: 6290, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 345, - EndLine: 345, - StartPos: 6277, - EndPos: 6280, + EndLine: 345, + StartPos: 6277, + EndPos: 6280, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 345, - EndLine: 345, - StartPos: 6277, - EndPos: 6280, + EndLine: 345, + StartPos: 6277, + EndPos: 6280, }, Value: "foo", }, @@ -16052,23 +15978,23 @@ func TestPhp7(t *testing.T) { Property: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 345, - EndLine: 345, - StartPos: 6284, - EndPos: 6290, + EndLine: 345, + StartPos: 6284, + EndPos: 6290, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 345, - EndLine: 345, - StartPos: 6284, - EndPos: 6287, + EndLine: 345, + StartPos: 6284, + EndPos: 6287, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 345, - EndLine: 345, - StartPos: 6284, - EndPos: 6287, + EndLine: 345, + StartPos: 6284, + EndPos: 6287, }, Value: "bar", }, @@ -16076,9 +16002,9 @@ func TestPhp7(t *testing.T) { Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 345, - EndLine: 345, - StartPos: 6289, - EndPos: 6289, + EndLine: 345, + StartPos: 6289, + EndPos: 6289, }, Value: "0", }, @@ -16088,54 +16014,54 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 347, - EndLine: 347, - StartPos: 6297, - EndPos: 6318, + EndLine: 347, + StartPos: 6297, + EndPos: 6318, }, Expr: &expr.ShortArray{ Position: &position.Position{ StartLine: 347, - EndLine: 347, - StartPos: 6297, - EndPos: 6317, + EndLine: 347, + StartPos: 6297, + EndPos: 6317, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 347, - EndLine: 347, - StartPos: 6298, - EndPos: 6303, + EndLine: 347, + StartPos: 6298, + EndPos: 6303, }, Key: &scalar.Lnumber{ Position: &position.Position{ StartLine: 347, - EndLine: 347, - StartPos: 6298, - EndPos: 6298, + EndLine: 347, + StartPos: 6298, + EndPos: 6298, }, Value: "1", }, Val: &expr.Reference{ Position: &position.Position{ StartLine: 347, - EndLine: 347, - StartPos: 6301, - EndPos: 6303, + EndLine: 347, + StartPos: 6301, + EndPos: 6303, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 347, - EndLine: 347, - StartPos: 6302, - EndPos: 6303, + EndLine: 347, + StartPos: 6302, + EndPos: 6303, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 347, - EndLine: 347, - StartPos: 6302, - EndPos: 6303, + EndLine: 347, + StartPos: 6302, + EndPos: 6303, }, Value: "a", }, @@ -16145,47 +16071,47 @@ func TestPhp7(t *testing.T) { &expr.ArrayItem{ Position: &position.Position{ StartLine: 347, - EndLine: 347, - StartPos: 6306, - EndPos: 6316, + EndLine: 347, + StartPos: 6306, + EndPos: 6316, }, Key: &scalar.Lnumber{ Position: &position.Position{ StartLine: 347, - EndLine: 347, - StartPos: 6306, - EndPos: 6306, + EndLine: 347, + StartPos: 6306, + EndPos: 6306, }, Value: "2", }, Val: &expr.List{ Position: &position.Position{ StartLine: 347, - EndLine: 347, - StartPos: 6309, - EndPos: 6316, + EndLine: 347, + StartPos: 6309, + EndPos: 6316, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 347, - EndLine: 347, - StartPos: 6314, - EndPos: 6315, + EndLine: 347, + StartPos: 6314, + EndPos: 6315, }, Val: &expr.Variable{ Position: &position.Position{ StartLine: 347, - EndLine: 347, - StartPos: 6314, - EndPos: 6315, + EndLine: 347, + StartPos: 6314, + EndPos: 6315, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 347, - EndLine: 347, - StartPos: 6314, - EndPos: 6315, + EndLine: 347, + StartPos: 6314, + EndPos: 6315, }, Value: "b", }, @@ -16199,7 +16125,6 @@ func TestPhp7(t *testing.T) { }, }, } - php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php") php7parser.Parse() @@ -16223,24 +16148,24 @@ func TestPhp5Strings(t *testing.T) { expected := &node.Root{ Position: &position.Position{ StartLine: 2, - EndLine: 10, - StartPos: 6, - EndPos: 70, + EndLine: 10, + StartPos: 6, + EndPos: 70, }, Stmts: []node.Node{ &stmt.Expression{ Position: &position.Position{ StartLine: 2, - EndLine: 2, - StartPos: 6, - EndPos: 12, + EndLine: 2, + StartPos: 6, + EndPos: 12, }, Expr: &scalar.String{ Position: &position.Position{ StartLine: 2, - EndLine: 2, - StartPos: 6, - EndPos: 11, + EndLine: 2, + StartPos: 6, + EndPos: 11, }, Value: "\"test\"", }, @@ -16248,16 +16173,16 @@ func TestPhp5Strings(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 3, - EndLine: 3, - StartPos: 16, - EndPos: 24, + EndLine: 3, + StartPos: 16, + EndPos: 24, }, Expr: &scalar.String{ Position: &position.Position{ StartLine: 3, - EndLine: 3, - StartPos: 16, - EndPos: 23, + EndLine: 3, + StartPos: 16, + EndPos: 23, }, Value: "\"\\$test\"", }, @@ -16265,16 +16190,16 @@ func TestPhp5Strings(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 4, - EndLine: 6, - StartPos: 28, - EndPos: 41, + EndLine: 6, + StartPos: 28, + EndPos: 41, }, Expr: &scalar.String{ Position: &position.Position{ StartLine: 4, - EndLine: 6, - StartPos: 28, - EndPos: 40, + EndLine: 6, + StartPos: 28, + EndPos: 40, }, Value: "\"\n\t\t\ttest\n\t\t\"", }, @@ -16282,16 +16207,16 @@ func TestPhp5Strings(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 7, - EndLine: 7, - StartPos: 45, - EndPos: 52, + EndLine: 7, + StartPos: 45, + EndPos: 52, }, Expr: &scalar.String{ Position: &position.Position{ StartLine: 7, - EndLine: 7, - StartPos: 45, - EndPos: 51, + EndLine: 7, + StartPos: 45, + EndPos: 51, }, Value: "'$test'", }, @@ -16299,23 +16224,22 @@ func TestPhp5Strings(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 8, - EndLine: 10, - StartPos: 56, - EndPos: 70, + EndLine: 10, + StartPos: 56, + EndPos: 70, }, Expr: &scalar.String{ Position: &position.Position{ StartLine: 8, - EndLine: 10, - StartPos: 56, - EndPos: 69, + EndLine: 10, + StartPos: 56, + EndPos: 69, }, Value: "'\n\t\t\t$test\n\t\t'", }, }, }, } - php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php") php7parser.Parse() @@ -16344,24 +16268,24 @@ CAD; expected := &node.Root{ Position: &position.Position{ StartLine: 2, - EndLine: 15, - StartPos: 9, - EndPos: 120, + EndLine: 15, + StartPos: 9, + EndPos: 120, }, Stmts: []node.Node{ &stmt.Expression{ Position: &position.Position{ StartLine: 2, - EndLine: 3, - StartPos: 9, - EndPos: 16, + EndLine: 3, + StartPos: 9, + EndPos: 16, }, Expr: &scalar.Heredoc{ Position: &position.Position{ StartLine: 2, - EndLine: 3, - StartPos: 9, - EndPos: 15, + EndLine: 3, + StartPos: 9, + EndPos: 15, }, Label: "CAD", }, @@ -16369,25 +16293,25 @@ CAD; &stmt.Expression{ Position: &position.Position{ StartLine: 4, - EndLine: 6, - StartPos: 23, - EndPos: 37, + EndLine: 6, + StartPos: 23, + EndPos: 37, }, Expr: &scalar.Heredoc{ Position: &position.Position{ StartLine: 4, - EndLine: 6, - StartPos: 23, - EndPos: 36, + EndLine: 6, + StartPos: 23, + EndPos: 36, }, Label: "CAD", Parts: []node.Node{ &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 5, - EndLine: 5, - StartPos: 27, - EndPos: 33, + EndLine: 5, + StartPos: 27, + EndPos: 33, }, Value: "\thello\n", }, @@ -16397,25 +16321,25 @@ CAD; &stmt.Expression{ Position: &position.Position{ StartLine: 7, - EndLine: 9, - StartPos: 44, - EndPos: 60, + EndLine: 9, + StartPos: 44, + EndPos: 60, }, Expr: &scalar.Heredoc{ Position: &position.Position{ StartLine: 7, - EndLine: 9, - StartPos: 44, - EndPos: 59, + EndLine: 9, + StartPos: 44, + EndPos: 59, }, Label: "\"CAD\"", Parts: []node.Node{ &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 8, - EndLine: 8, - StartPos: 50, - EndPos: 56, + EndLine: 8, + StartPos: 50, + EndPos: 56, }, Value: "\thello\n", }, @@ -16425,41 +16349,41 @@ CAD; &stmt.Expression{ Position: &position.Position{ StartLine: 10, - EndLine: 12, - StartPos: 67, - EndPos: 90, + EndLine: 12, + StartPos: 67, + EndPos: 90, }, Expr: &scalar.Heredoc{ Position: &position.Position{ StartLine: 10, - EndLine: 12, - StartPos: 67, - EndPos: 89, + EndLine: 12, + StartPos: 67, + EndPos: 89, }, Label: "\"CAD\"", Parts: []node.Node{ &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 11, - EndLine: 11, - StartPos: 73, - EndPos: 79, + EndLine: 11, + StartPos: 73, + EndPos: 79, }, Value: "\thello ", }, &expr.Variable{ Position: &position.Position{ StartLine: 11, - EndLine: 11, - StartPos: 80, - EndPos: 85, + EndLine: 11, + StartPos: 80, + EndPos: 85, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 11, - EndLine: 11, - StartPos: 80, - EndPos: 85, + EndLine: 11, + StartPos: 80, + EndPos: 85, }, Value: "world", }, @@ -16467,9 +16391,9 @@ CAD; &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 11, - EndLine: 11, - StartPos: 86, - EndPos: 86, + EndLine: 11, + StartPos: 86, + EndPos: 86, }, Value: "\n", }, @@ -16479,25 +16403,25 @@ CAD; &stmt.Expression{ Position: &position.Position{ StartLine: 13, - EndLine: 15, - StartPos: 97, - EndPos: 120, + EndLine: 15, + StartPos: 97, + EndPos: 120, }, Expr: &scalar.Heredoc{ Position: &position.Position{ StartLine: 13, - EndLine: 15, - StartPos: 97, - EndPos: 119, + EndLine: 15, + StartPos: 97, + EndPos: 119, }, Label: "'CAD'", Parts: []node.Node{ &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 14, - EndLine: 14, - StartPos: 103, - EndPos: 116, + EndLine: 14, + StartPos: 103, + EndPos: 116, }, Value: "\thello $world\n", }, @@ -16506,7 +16430,6 @@ CAD; }, }, } - php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php") php7parser.Parse() diff --git a/visitor/dumper.go b/visitor/dumper.go index ac4708b..88582fa 100644 --- a/visitor/dumper.go +++ b/visitor/dumper.go @@ -39,12 +39,10 @@ func (d *Dumper) EnterNode(w walker.Walkable) bool { } } - if d.Comments != nil { - if c := d.Comments[n]; len(c) > 0 { - fmt.Fprintf(d.Writer, "%v\"Comments\":\n", d.Indent+" ") - for _, cc := range c { - fmt.Fprintf(d.Writer, "%v%q before %q\n", d.Indent+" ", cc, comment.TokenNames[cc.TokenName()]) - } + if c := n.GetComments(); len(c) > 0 { + fmt.Fprintf(d.Writer, "%v\"Comments\":\n", d.Indent+" ") + for _, cc := range c { + fmt.Fprintf(d.Writer, "%v%q before %q\n", d.Indent+" ", cc, comment.TokenNames[cc.TokenName]) } } diff --git a/visitor/go_dumper.go b/visitor/go_dumper.go index 49c08e1..97ba85a 100644 --- a/visitor/go_dumper.go +++ b/visitor/go_dumper.go @@ -59,6 +59,44 @@ func (d *GoDumper) EnterNode(w walker.Walkable) bool { fmt.Fprint(d.Writer, "},\n") } + if cc := n.GetComments(); len(cc) > 0 { + printIndent(d.Writer, d.depth) + fmt.Fprint(d.Writer, "Comments: []*comment.Comment{\n") + d.depth++ + for _, c := range cc { + printIndent(d.Writer, d.depth) + fmt.Fprint(d.Writer, "&comment.Comment{\n") + d.depth++ + + printIndent(d.Writer, d.depth) + fmt.Fprint(d.Writer, "Position: &position.Position{\n") + d.depth++ + printIndent(d.Writer, d.depth) + fmt.Fprintf(d.Writer, "StartLine: %d,\n", c.Position.StartLine) + printIndent(d.Writer, d.depth) + fmt.Fprintf(d.Writer, "EndLine: %d,\n", c.Position.EndLine) + printIndent(d.Writer, d.depth) + fmt.Fprintf(d.Writer, "StartPos: %d,\n", c.Position.StartPos) + printIndent(d.Writer, d.depth) + fmt.Fprintf(d.Writer, "EndPos: %d,\n", c.Position.EndPos) + d.depth-- + printIndent(d.Writer, d.depth) + fmt.Fprint(d.Writer, "},\n") + + printIndent(d.Writer, d.depth) + fmt.Fprintf(d.Writer, "Value: %q,\n", c.Value) + printIndent(d.Writer, d.depth) + fmt.Fprintf(d.Writer, "TokenName: %q,\n", c.TokenName) + + d.depth-- + printIndent(d.Writer, d.depth) + fmt.Fprint(d.Writer, "},\n") + } + d.depth-- + printIndent(d.Writer, d.depth) + fmt.Fprint(d.Writer, "},\n") + } + if a := n.Attributes(); len(a) > 0 { for key, attr := range a { printIndent(d.Writer, d.depth) diff --git a/visitor/go_dumper_test.go b/visitor/go_dumper_test.go index e2f23d8..154ca73 100644 --- a/visitor/go_dumper_test.go +++ b/visitor/go_dumper_test.go @@ -214,6 +214,18 @@ func ExampleGoDumper() { // StartPos: 123, // EndPos: 126, // }, + // Comments: []*comment.Comment{ + // &comment.Comment{ + // Position: &position.Position{ + // StartLine: 7, + // EndLine: 7, + // StartPos: 103, + // EndPos: 117, + // }, + // Value: "//some comment\n", + // TokenName: '\t', + // }, + // }, // VarName: &node.Identifier{ // Position: &position.Position{ // StartLine: 8, diff --git a/visitor/json_dumper.go b/visitor/json_dumper.go index 8b21755..dfc2c0f 100644 --- a/visitor/json_dumper.go +++ b/visitor/json_dumper.go @@ -42,20 +42,18 @@ func (d *JsonDumper) EnterNode(w walker.Walkable) bool { } } - if d.Comments != nil { - if c := d.Comments[n]; len(c) > 0 { - fmt.Fprintf(d.Writer, ",%q:[", "comments") + if c := n.GetComments(); len(c) > 0 { + fmt.Fprintf(d.Writer, ",%q:[", "comments") - for k, cc := range c { - if k == 0 { - fmt.Fprintf(d.Writer, "%q", cc) - } else { - fmt.Fprintf(d.Writer, ",%q", cc) - } + for k, cc := range c { + if k == 0 { + fmt.Fprintf(d.Writer, "%q", cc) + } else { + fmt.Fprintf(d.Writer, ",%q", cc) } - - fmt.Fprint(d.Writer, "]") } + + fmt.Fprint(d.Writer, "]") } if a := n.Attributes(); len(a) > 0 { diff --git a/visitor/pretty_json_dumper.go b/visitor/pretty_json_dumper.go index b81d56f..6a34e16 100644 --- a/visitor/pretty_json_dumper.go +++ b/visitor/pretty_json_dumper.go @@ -69,27 +69,25 @@ func (d *PrettyJsonDumper) EnterNode(w walker.Walkable) bool { } } - if d.Comments != nil { - if c := d.Comments[n]; len(c) > 0 { - fmt.Fprint(d.Writer, ",\n") - d.printIndent(d.Writer) - fmt.Fprint(d.Writer, "\"comments\": [\n") - d.depth++ - for k, cc := range c { - if k == 0 { - d.printIndent(d.Writer) - fmt.Fprintf(d.Writer, "%q", cc) - } else { - fmt.Fprint(d.Writer, ",\n") - d.printIndent(d.Writer) - fmt.Fprintf(d.Writer, "%q", cc) - } + if c := n.GetComments(); len(c) > 0 { + fmt.Fprint(d.Writer, ",\n") + d.printIndent(d.Writer) + fmt.Fprint(d.Writer, "\"comments\": [\n") + d.depth++ + for k, cc := range c { + if k == 0 { + d.printIndent(d.Writer) + fmt.Fprintf(d.Writer, "%q", cc) + } else { + fmt.Fprint(d.Writer, ",\n") + d.printIndent(d.Writer) + fmt.Fprintf(d.Writer, "%q", cc) } - d.depth-- - fmt.Fprint(d.Writer, "\n") - d.printIndent(d.Writer) - fmt.Fprint(d.Writer, "]") } + d.depth-- + fmt.Fprint(d.Writer, "\n") + d.printIndent(d.Writer) + fmt.Fprint(d.Writer, "]") } if a := n.Attributes(); len(a) > 0 { From 36d0cf482352dffb573fad4c178417135139fcea Mon Sep 17 00:00:00 2001 From: z7zmey Date: Tue, 26 Jun 2018 23:49:00 +0300 Subject: [PATCH 009/117] use empty *expr.ArrayItem to represent missed a list and array items. --- node/expr/t_array_test.go | 2 +- node/expr/t_list_test.go | 8 +-- node/expr/t_short_array_test.go | 2 +- php5/php5.go | 15 +++--- php5/php5.y | 12 ++--- php5/php5_test.go | 4 +- php7/php7.go | 94 +++++++++++++++++---------------- php7/php7.y | 22 ++++---- php7/php7_test.go | 4 +- 9 files changed, 83 insertions(+), 80 deletions(-) diff --git a/node/expr/t_array_test.go b/node/expr/t_array_test.go index 1c9bcf2..5b482c2 100644 --- a/node/expr/t_array_test.go +++ b/node/expr/t_array_test.go @@ -202,7 +202,7 @@ func TestArrayItems(t *testing.T) { }, }, }, - nil, + &expr.ArrayItem{}, }, }, }, diff --git a/node/expr/t_list_test.go b/node/expr/t_list_test.go index f03ac79..365912d 100644 --- a/node/expr/t_list_test.go +++ b/node/expr/t_list_test.go @@ -420,7 +420,7 @@ func TestListEmptyItem(t *testing.T) { EndPos: 13, }, Items: []node.Node{ - nil, + &expr.ArrayItem{}, &expr.ArrayItem{ Position: &position.Position{ StartLine: 1, @@ -514,8 +514,8 @@ func TestListEmptyItems(t *testing.T) { EndPos: 17, }, Items: []node.Node{ - nil, - nil, + &expr.ArrayItem{}, + &expr.ArrayItem{}, &expr.ArrayItem{ Position: &position.Position{ StartLine: 1, @@ -541,7 +541,7 @@ func TestListEmptyItems(t *testing.T) { }, }, }, - nil, + &expr.ArrayItem{}, }, }, Expression: &expr.Variable{ diff --git a/node/expr/t_short_array_test.go b/node/expr/t_short_array_test.go index 85c7663..f4617ac 100644 --- a/node/expr/t_short_array_test.go +++ b/node/expr/t_short_array_test.go @@ -202,7 +202,7 @@ func TestShortArrayItems(t *testing.T) { }, }, }, - nil, + &expr.ArrayItem{}, }, }, }, diff --git a/php5/php5.go b/php5/php5.go index c405b0c..d733f91 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -347,6 +347,7 @@ const yyErrCode = 2 const yyInitialStackSize = 16 //line php5/php5.y:6795 + type simpleIndirectReference struct { all []*expr.Variable last *expr.Variable @@ -8741,15 +8742,15 @@ yydefault: //line php5/php5.y:6190 { if len(yyDollar[1].list) == 0 { - yyDollar[1].list = []node.Node{nil} + yyDollar[1].list = []node.Node{expr.NewArrayItem(nil, nil)} } yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - if lastNode(yyDollar[1].list) != nil { - lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) - } + // if lastNode($1) != nil { + lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) + // } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -8757,7 +8758,7 @@ yydefault: yyDollar = yyS[yypt-1 : yypt+1] //line php5/php5.y:6205 { - if yyDollar[1].node == nil { + if yyDollar[1].node.(*expr.ArrayItem).Key == nil && yyDollar[1].node.(*expr.ArrayItem).Val == nil { yyVAL.list = []node.Node{} } else { yyVAL.list = []node.Node{yyDollar[1].node} @@ -8798,7 +8799,7 @@ yydefault: yyDollar = yyS[yypt-0 : yypt+1] //line php5/php5.y:6244 { - yyVAL.node = nil + yyVAL.node = expr.NewArrayItem(nil, nil) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -8817,7 +8818,7 @@ yydefault: yyVAL.list = yyDollar[1].list if yyDollar[2].token != nil { - yyVAL.list = append(yyDollar[1].list, nil) + yyVAL.list = append(yyDollar[1].list, expr.NewArrayItem(nil, nil)) } // save comments diff --git a/php5/php5.y b/php5/php5.y index 7b86c9d..ac1ef60 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -6189,21 +6189,19 @@ assignment_list: assignment_list ',' assignment_list_element { if len($1) == 0 { - $1 = []node.Node{nil} + $1 = []node.Node{expr.NewArrayItem(nil, nil)} } $$ = append($1, $3) // save comments - if lastNode($1) != nil { - lastNode($1).AddComments($2.Comments, comment.CommaToken) - } + lastNode($1).AddComments($2.Comments, comment.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | assignment_list_element { - if $1 == nil { + if $1.(*expr.ArrayItem).Key == nil && $1.(*expr.ArrayItem).Val == nil { $$ = []node.Node{} } else { $$ = []node.Node{$1} @@ -6242,7 +6240,7 @@ assignment_list_element: } | /* empty */ { - $$ = nil + $$ = expr.NewArrayItem(nil, nil) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6261,7 +6259,7 @@ array_pair_list: $$ = $1 if $2 != nil { - $$ = append($1, nil) + $$ = append($1, expr.NewArrayItem(nil, nil)) } // save comments diff --git a/php5/php5_test.go b/php5/php5_test.go index 125003c..9320288 100644 --- a/php5/php5_test.go +++ b/php5/php5_test.go @@ -8216,7 +8216,7 @@ func TestPhp5(t *testing.T) { }, }, }, - nil, + &expr.ArrayItem{}, }, }, }, @@ -11019,7 +11019,7 @@ func TestPhp5(t *testing.T) { }, }, }, - nil, + &expr.ArrayItem{}, }, }, }, diff --git a/php7/php7.go b/php7/php7.go index 4ffbf20..149e7de 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -346,7 +346,7 @@ const yyEofCode = 1 const yyErrCode = 2 const yyInitialStackSize = 16 -//line php7/php7.y:5348 +//line php7/php7.y:5350 //line yacctab:1 var yyExca = [...]int{ @@ -7517,25 +7517,21 @@ yydefault: yyDollar = yyS[yypt-1 : yypt+1] //line php7/php7.y:4861 { - if len(yyDollar[1].list) == 1 && yyDollar[1].list[0] == nil { - yyVAL.list = yyDollar[1].list[:0] - } else { - yyVAL.list = yyDollar[1].list - } + yyVAL.list = yyDollar[1].list yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 455: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4874 + //line php7/php7.y:4870 { - yyVAL.node = nil + yyVAL.node = expr.NewArrayItem(nil, nil) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 456: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4880 + //line php7/php7.y:4876 { yyVAL.node = yyDollar[1].node @@ -7543,28 +7539,34 @@ yydefault: } case 457: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4889 + //line php7/php7.y:4885 { + if len(yyDollar[1].list) == 0 { + yyDollar[1].list = []node.Node{expr.NewArrayItem(nil, nil)} + } + yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - if lastNode(yyDollar[1].list) != nil { - lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) - } + lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 458: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4900 + //line php7/php7.y:4898 { - yyVAL.list = []node.Node{yyDollar[1].node} + if yyDollar[1].node.(*expr.ArrayItem).Key == nil && yyDollar[1].node.(*expr.ArrayItem).Val == nil { + yyVAL.list = []node.Node{} + } else { + yyVAL.list = []node.Node{yyDollar[1].node} + } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 459: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4909 + //line php7/php7.y:4911 { yyVAL.node = expr.NewArrayItem(yyDollar[1].node, yyDollar[3].node) @@ -7578,7 +7580,7 @@ yydefault: } case 460: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4921 + //line php7/php7.y:4923 { yyVAL.node = expr.NewArrayItem(nil, yyDollar[1].node) @@ -7589,7 +7591,7 @@ yydefault: } case 461: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4930 + //line php7/php7.y:4932 { reference := expr.NewReference(yyDollar[4].node) yyVAL.node = expr.NewArrayItem(yyDollar[1].node, reference) @@ -7606,7 +7608,7 @@ yydefault: } case 462: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4945 + //line php7/php7.y:4947 { reference := expr.NewReference(yyDollar[2].node) yyVAL.node = expr.NewArrayItem(nil, reference) @@ -7622,7 +7624,7 @@ yydefault: } case 463: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:4959 + //line php7/php7.y:4961 { // TODO: Cannot use list() as standalone expression list := expr.NewList(yyDollar[5].list) @@ -7642,7 +7644,7 @@ yydefault: } case 464: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4977 + //line php7/php7.y:4979 { // TODO: Cannot use list() as standalone expression list := expr.NewList(yyDollar[3].list) @@ -7661,7 +7663,7 @@ yydefault: } case 465: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4997 + //line php7/php7.y:4999 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -7669,7 +7671,7 @@ yydefault: } case 466: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5003 + //line php7/php7.y:5005 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yyVAL.list = append(yyDollar[1].list, encapsed) @@ -7684,7 +7686,7 @@ yydefault: } case 467: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5016 + //line php7/php7.y:5018 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -7692,7 +7694,7 @@ yydefault: } case 468: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5022 + //line php7/php7.y:5024 { encapsed := scalar.NewEncapsedStringPart(yyDollar[1].token.Value) yyVAL.list = []node.Node{encapsed, yyDollar[2].node} @@ -7707,7 +7709,7 @@ yydefault: } case 469: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5038 + //line php7/php7.y:5040 { name := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(name) @@ -7723,7 +7725,7 @@ yydefault: } case 470: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:5052 + //line php7/php7.y:5054 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -7743,7 +7745,7 @@ yydefault: } case 471: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5070 + //line php7/php7.y:5072 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -7765,7 +7767,7 @@ yydefault: } case 472: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5090 + //line php7/php7.y:5092 { yyVAL.node = expr.NewVariable(yyDollar[2].node) @@ -7780,7 +7782,7 @@ yydefault: } case 473: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5103 + //line php7/php7.y:5105 { name := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = expr.NewVariable(name) @@ -7798,7 +7800,7 @@ yydefault: } case 474: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:5119 + //line php7/php7.y:5121 { identifier := node.NewIdentifier(yyDollar[2].token.Value) variable := expr.NewVariable(identifier) @@ -7820,7 +7822,7 @@ yydefault: } case 475: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5139 + //line php7/php7.y:5141 { yyVAL.node = yyDollar[2].node @@ -7828,7 +7830,7 @@ yydefault: } case 476: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5148 + //line php7/php7.y:5150 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) @@ -7842,7 +7844,7 @@ yydefault: } case 477: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5160 + //line php7/php7.y:5162 { // TODO: add option to handle 64 bit integer if _, err := strconv.Atoi(yyDollar[1].token.Value); err == nil { @@ -7861,7 +7863,7 @@ yydefault: } case 478: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5177 + //line php7/php7.y:5179 { var lnumber *scalar.Lnumber // TODO: add option to handle 64 bit integer @@ -7894,7 +7896,7 @@ yydefault: } case 479: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5208 + //line php7/php7.y:5210 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(identifier) @@ -7910,7 +7912,7 @@ yydefault: } case 480: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:5225 + //line php7/php7.y:5227 { yyVAL.node = expr.NewIsset(yyDollar[3].list) @@ -7929,7 +7931,7 @@ yydefault: } case 481: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:5242 + //line php7/php7.y:5244 { yyVAL.node = expr.NewEmpty(yyDollar[3].node) @@ -7945,7 +7947,7 @@ yydefault: } case 482: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5256 + //line php7/php7.y:5258 { yyVAL.node = expr.NewInclude(yyDollar[2].node) @@ -7959,7 +7961,7 @@ yydefault: } case 483: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5268 + //line php7/php7.y:5270 { yyVAL.node = expr.NewIncludeOnce(yyDollar[2].node) @@ -7973,7 +7975,7 @@ yydefault: } case 484: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:5280 + //line php7/php7.y:5282 { yyVAL.node = expr.NewEval(yyDollar[3].node) @@ -7989,7 +7991,7 @@ yydefault: } case 485: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5294 + //line php7/php7.y:5296 { yyVAL.node = expr.NewRequire(yyDollar[2].node) @@ -8003,7 +8005,7 @@ yydefault: } case 486: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5306 + //line php7/php7.y:5308 { yyVAL.node = expr.NewRequireOnce(yyDollar[2].node) @@ -8017,7 +8019,7 @@ yydefault: } case 487: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5321 + //line php7/php7.y:5323 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -8025,7 +8027,7 @@ yydefault: } case 488: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5327 + //line php7/php7.y:5329 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -8036,7 +8038,7 @@ yydefault: } case 489: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5339 + //line php7/php7.y:5341 { yyVAL.node = yyDollar[1].node diff --git a/php7/php7.y b/php7/php7.y index f6aa803..3d50c00 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -4859,11 +4859,7 @@ property_name: array_pair_list: non_empty_array_pair_list { - if (len($1) == 1 && $1[0] == nil) { - $$ = $1[:0] - } else { - $$ = $1 - } + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4872,7 +4868,7 @@ array_pair_list: possible_array_pair: /* empty */ { - $$ = nil + $$ = expr.NewArrayItem(nil, nil) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4887,18 +4883,24 @@ possible_array_pair: non_empty_array_pair_list: non_empty_array_pair_list ',' possible_array_pair { + if len($1) == 0 { + $1 = []node.Node{expr.NewArrayItem(nil, nil)} + } + $$ = append($1, $3) // save comments - if lastNode($1) != nil { - lastNode($1).AddComments($2.Comments, comment.CommaToken) - } + lastNode($1).AddComments($2.Comments, comment.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | possible_array_pair { - $$ = []node.Node{$1} + if $1.(*expr.ArrayItem).Key == nil && $1.(*expr.ArrayItem).Val == nil { + $$ = []node.Node{} + } else { + $$ = []node.Node{$1} + } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php7/php7_test.go b/php7/php7_test.go index 7a2380e..8028ec9 100644 --- a/php7/php7_test.go +++ b/php7/php7_test.go @@ -9034,7 +9034,7 @@ func TestPhp7(t *testing.T) { }, }, }, - nil, + &expr.ArrayItem{}, }, }, }, @@ -11169,7 +11169,7 @@ func TestPhp7(t *testing.T) { }, }, }, - nil, + &expr.ArrayItem{}, }, }, }, From e90df8ef5f1226267204cdf81c1623d5a380aca7 Mon Sep 17 00:00:00 2001 From: z7zmey Date: Sat, 30 Jun 2018 00:51:11 +0300 Subject: [PATCH 010/117] #33 comment package has renamed to meta and parser now saves whitespaces --- README.md | 4 +- comment/comment_test.go | 31 - main.go | 16 +- {comment => meta}/comment.go | 11 +- meta/comment_test.go | 44 + meta/meta.go | 12 + {comment => meta}/tokenNames.go | 2 +- meta/white_space.go | 37 + meta/white_space_test.go | 44 + node/expr/assign/n_assign.go | 15 +- node/expr/assign/n_assign_ref.go | 15 +- node/expr/assign/n_bitwise_and.go | 15 +- node/expr/assign/n_bitwise_or.go | 15 +- node/expr/assign/n_bitwise_xor.go | 15 +- node/expr/assign/n_concat.go | 15 +- node/expr/assign/n_div.go | 15 +- node/expr/assign/n_minus.go | 15 +- node/expr/assign/n_mod.go | 15 +- node/expr/assign/n_mul.go | 15 +- node/expr/assign/n_plus.go | 15 +- node/expr/assign/n_pow.go | 15 +- node/expr/assign/n_shift_left.go | 15 +- node/expr/assign/n_shift_right.go | 15 +- node/expr/binary/n_bitwise_and.go | 15 +- node/expr/binary/n_bitwise_or.go | 15 +- node/expr/binary/n_bitwise_xor.go | 15 +- node/expr/binary/n_boolean_and.go | 15 +- node/expr/binary/n_boolean_or.go | 15 +- node/expr/binary/n_coalesce.go | 15 +- node/expr/binary/n_concat.go | 15 +- node/expr/binary/n_div.go | 15 +- node/expr/binary/n_equal.go | 15 +- node/expr/binary/n_greater.go | 15 +- node/expr/binary/n_greater_or_equal.go | 15 +- node/expr/binary/n_identical.go | 15 +- node/expr/binary/n_logical_and.go | 15 +- node/expr/binary/n_logical_or.go | 15 +- node/expr/binary/n_logical_xor.go | 15 +- node/expr/binary/n_minus.go | 15 +- node/expr/binary/n_mod.go | 15 +- node/expr/binary/n_mul.go | 15 +- node/expr/binary/n_not_equal.go | 15 +- node/expr/binary/n_not_identical.go | 15 +- node/expr/binary/n_plus.go | 15 +- node/expr/binary/n_pow.go | 15 +- node/expr/binary/n_shift_left.go | 15 +- node/expr/binary/n_shift_right.go | 15 +- node/expr/binary/n_smaller.go | 15 +- node/expr/binary/n_smaller_or_equal.go | 15 +- node/expr/binary/n_spaceship.go | 15 +- node/expr/cast/n_cast_array.go | 15 +- node/expr/cast/n_cast_bool.go | 15 +- node/expr/cast/n_cast_double.go | 15 +- node/expr/cast/n_cast_int.go | 15 +- node/expr/cast/n_cast_object.go | 15 +- node/expr/cast/n_cast_string.go | 15 +- node/expr/cast/n_cast_unset.go | 15 +- node/expr/n_array.go | 15 +- node/expr/n_array_dim_fetch.go | 15 +- node/expr/n_array_item.go | 15 +- node/expr/n_bitwise_not.go | 15 +- node/expr/n_boolean_not.go | 15 +- node/expr/n_class_const_fetch.go | 15 +- node/expr/n_clone.go | 15 +- node/expr/n_closure.go | 15 +- node/expr/n_closure_use.go | 15 +- node/expr/n_const_fetch.go | 15 +- node/expr/n_die.go | 15 +- node/expr/n_empty.go | 15 +- node/expr/n_error_suppress.go | 15 +- node/expr/n_eval.go | 15 +- node/expr/n_exit.go | 15 +- node/expr/n_function_call.go | 15 +- node/expr/n_include.go | 15 +- node/expr/n_include_once.go | 15 +- node/expr/n_instance_of.go | 15 +- node/expr/n_isset.go | 15 +- node/expr/n_list.go | 15 +- node/expr/n_method_call.go | 15 +- node/expr/n_new.go | 15 +- node/expr/n_post_dec.go | 15 +- node/expr/n_post_inc.go | 15 +- node/expr/n_pre_dec.go | 15 +- node/expr/n_pre_inc.go | 15 +- node/expr/n_print.go | 15 +- node/expr/n_property_fetch.go | 15 +- node/expr/n_reference.go | 15 +- node/expr/n_require.go | 15 +- node/expr/n_require_once.go | 15 +- node/expr/n_shell_exec.go | 15 +- node/expr/n_short_array.go | 15 +- node/expr/n_short_list.go | 15 +- node/expr/n_static_call.go | 15 +- node/expr/n_static_property_fetch.go | 15 +- node/expr/n_ternary.go | 15 +- node/expr/n_unary_minus.go | 15 +- node/expr/n_unary_plus.go | 15 +- node/expr/n_variable.go | 15 +- node/expr/n_yield.go | 15 +- node/expr/n_yield_from.go | 15 +- node/n_argument.go | 15 +- node/n_argument_list.go | 16 +- node/n_identifier.go | 15 +- node/n_nullable.go | 15 +- node/n_parameter.go | 15 +- node/n_root.go | 15 +- node/name/n_fully_qualified.go | 15 +- node/name/n_name.go | 15 +- node/name/n_name_part.go | 15 +- node/name/n_relative.go | 15 +- node/node.go | 6 +- node/scalar/node_dnumber.go | 15 +- node/scalar/node_encapsed.go | 15 +- node/scalar/node_encapsed_string_part.go | 15 +- node/scalar/node_heredoc.go | 15 +- node/scalar/node_lnumber.go | 15 +- node/scalar/node_magic_constant.go | 15 +- node/scalar/node_string.go | 15 +- node/stmt/n_alt_else.go | 15 +- node/stmt/n_alt_else_if.go | 15 +- node/stmt/n_alt_for.go | 15 +- node/stmt/n_alt_foreach.go | 15 +- node/stmt/n_alt_if.go | 15 +- node/stmt/n_alt_switch.go | 15 +- node/stmt/n_alt_while.go | 15 +- node/stmt/n_break.go | 15 +- node/stmt/n_case.go | 15 +- node/stmt/n_case_list.go | 15 +- node/stmt/n_catch.go | 15 +- node/stmt/n_class.go | 15 +- node/stmt/n_class_const_list.go | 15 +- node/stmt/n_class_extends.go | 15 +- node/stmt/n_class_implements.go | 15 +- node/stmt/n_class_method.go | 15 +- node/stmt/n_const_list.go | 15 +- node/stmt/n_constant.go | 15 +- node/stmt/n_continue.go | 15 +- node/stmt/n_declare.go | 15 +- node/stmt/n_default.go | 15 +- node/stmt/n_do.go | 15 +- node/stmt/n_echo.go | 15 +- node/stmt/n_else.go | 15 +- node/stmt/n_else_if.go | 15 +- node/stmt/n_expression.go | 15 +- node/stmt/n_finally.go | 15 +- node/stmt/n_for.go | 15 +- node/stmt/n_foreach.go | 15 +- node/stmt/n_function.go | 15 +- node/stmt/n_global.go | 15 +- node/stmt/n_goto.go | 15 +- node/stmt/n_group_use.go | 15 +- node/stmt/n_halt_compiler.go | 15 +- node/stmt/n_if.go | 15 +- node/stmt/n_inline_html.go | 15 +- node/stmt/n_interface.go | 15 +- node/stmt/n_interface_extends.go | 15 +- node/stmt/n_label.go | 15 +- node/stmt/n_namespace.go | 15 +- node/stmt/n_nop.go | 15 +- node/stmt/n_property.go | 15 +- node/stmt/n_property_list.go | 15 +- node/stmt/n_return.go | 15 +- node/stmt/n_static.go | 15 +- node/stmt/n_static_var.go | 15 +- node/stmt/n_stmt_list.go | 15 +- node/stmt/n_switch.go | 15 +- node/stmt/n_throw.go | 15 +- node/stmt/n_trait.go | 15 +- node/stmt/n_trait_adaptation_list.go | 15 +- node/stmt/n_trait_method_ref.go | 15 +- node/stmt/n_trait_use.go | 15 +- node/stmt/n_trait_use_alias.go | 15 +- node/stmt/n_trait_use_precedence.go | 15 +- node/stmt/n_try.go | 15 +- node/stmt/n_unset.go | 15 +- node/stmt/n_use.go | 15 +- node/stmt/n_use_list.go | 15 +- node/stmt/n_while.go | 15 +- node/t_node_test.go | 13 - parser/comments.go | 30 - parser/comments_test.go | 28 - parser/parser.go | 2 +- php5/parser.go | 26 +- php5/php5.go | 1628 ++- php5/php5.y | 1176 +- php5/php5_test.go | 12716 +++++++++++---------- php7/parser.go | 22 +- php7/php7.go | 1511 ++- php7/php7.y | 1019 +- php7/php7_test.go | 11150 +++++++++--------- scanner/lexer.go | 38 +- scanner/scanner.go | 15 +- scanner/scanner.l | 12 +- scanner/scanner_test.go | 74 +- scanner/token.go | 4 +- scanner/token_test.go | 10 +- visitor/dumper.go | 12 +- visitor/dumper_test.go | 34 +- visitor/go_dumper.go | 27 +- visitor/go_dumper_test.go | 210 +- visitor/json_dumper.go | 38 +- visitor/json_dumper_test.go | 7 +- visitor/namespace_resolver_test.go | 1 - visitor/pretty_json_dumper.go | 60 +- visitor/pretty_json_dumper_test.go | 196 +- 205 files changed, 16485 insertions(+), 16302 deletions(-) delete mode 100644 comment/comment_test.go rename {comment => meta}/comment.go (74%) create mode 100644 meta/comment_test.go create mode 100644 meta/meta.go rename {comment => meta}/tokenNames.go (99%) create mode 100644 meta/white_space.go create mode 100644 meta/white_space_test.go delete mode 100644 parser/comments.go delete mode 100644 parser/comments_test.go diff --git a/README.md b/README.md index a6dc150..c347b95 100644 --- a/README.md +++ b/README.md @@ -53,10 +53,10 @@ php-parser [flags] ... | flag | type | description | |-------|------|----------------------------------------------| | -d |string| dump format: [custom, go, json, pretty-json] | -| -prof |string| start profiler: [cpu, mem] | | -p | bool | show positions | -| -c | bool | show comments | | -r | bool | resolve names | +| -prof |string| start profiler: [cpu, mem] | +| -meta | bool | show meta info | | -php5 | bool | parse as PHP5 | Dump AST to stdout. diff --git a/comment/comment_test.go b/comment/comment_test.go deleted file mode 100644 index d9e671a..0000000 --- a/comment/comment_test.go +++ /dev/null @@ -1,31 +0,0 @@ -package comment_test - -import ( - "testing" - - "github.com/z7zmey/php-parser/comment" -) - -func TestCommentPrint(t *testing.T) { - expected := "/** hello world */" - - comment := comment.NewComment(expected, nil) - - actual := comment.String() - - if expected != actual { - t.Errorf("expected and actual are not equal\n") - } -} - -func TestCommentSetTokenName(t *testing.T) { - expected := comment.ArrayToken - c := comment.NewComment("/** hello world */", nil) - c.SetTokenName(expected) - - actual := c.TokenName - - if expected != actual { - t.Errorf("expected and actual are not equal\n") - } -} diff --git a/main.go b/main.go index 6233d3d..2c46f11 100644 --- a/main.go +++ b/main.go @@ -21,12 +21,12 @@ var wg sync.WaitGroup var usePhp5 *bool var dumpType string var profiler string -var showComments *bool +var withMeta *bool var showResolvedNs *bool func main() { usePhp5 = flag.Bool("php5", false, "parse as PHP5") - showComments = flag.Bool("c", false, "show comments") + withMeta = flag.Bool("meta", false, "show meta") showResolvedNs = flag.Bool("r", false, "resolve names") flag.StringVar(&dumpType, "d", "", "dump format: [custom, go, json, pretty_json]") flag.StringVar(&profiler, "prof", "", "start profiler: [cpu, mem]") @@ -107,6 +107,10 @@ func parserWorker(pathCh <-chan string, result chan<- parser.Parser) { parserWorker = php7.NewParser(src, path) } + if *withMeta { + parserWorker.WithMeta() + } + parserWorker.Parse() src.Close() @@ -138,31 +142,23 @@ func printer(result <-chan parser.Parser) { parserWorker.GetRootNode().Walk(nsResolver) } - var comments parser.Comments - if *showComments { - comments = parserWorker.GetComments() - } - switch dumpType { case "custom": dumper := &visitor.Dumper{ Writer: os.Stdout, Indent: "| ", - Comments: comments, NsResolver: nsResolver, } parserWorker.GetRootNode().Walk(dumper) case "json": dumper := &visitor.JsonDumper{ Writer: os.Stdout, - Comments: comments, NsResolver: nsResolver, } parserWorker.GetRootNode().Walk(dumper) case "pretty_json": dumper := &visitor.PrettyJsonDumper{ Writer: os.Stdout, - Comments: comments, NsResolver: nsResolver, } parserWorker.GetRootNode().Walk(dumper) diff --git a/comment/comment.go b/meta/comment.go similarity index 74% rename from comment/comment.go rename to meta/comment.go index 87252e9..c264f58 100644 --- a/comment/comment.go +++ b/meta/comment.go @@ -1,4 +1,4 @@ -package comment +package meta import ( "github.com/z7zmey/php-parser/position" @@ -25,6 +25,15 @@ func (c *Comment) SetTokenName(tokenName TokenName) { c.TokenName = tokenName } +// GetTokenName returns token name +func (c *Comment) GetTokenName() TokenName { + return c.TokenName +} + func (c *Comment) String() string { return c.Value } + +func (c *Comment) GetPosition() *position.Position { + return c.Position +} diff --git a/meta/comment_test.go b/meta/comment_test.go new file mode 100644 index 0000000..d509113 --- /dev/null +++ b/meta/comment_test.go @@ -0,0 +1,44 @@ +package meta_test + +import ( + "testing" + + "github.com/z7zmey/php-parser/position" + + "github.com/z7zmey/php-parser/meta" +) + +func TestCommentPrint(t *testing.T) { + expected := "/** hello world */" + + comment := meta.NewComment(expected, nil) + + actual := comment.String() + + if expected != actual { + t.Errorf("expected and actual are not equal\n") + } +} + +func TestCommentSetGetTokenName(t *testing.T) { + expected := meta.ArrayToken + c := meta.NewComment("/** hello world */", nil) + c.SetTokenName(expected) + + actual := c.GetTokenName() + + if expected != actual { + t.Errorf("expected and actual are not equal\n") + } +} + +func TestCommentGetPosition(t *testing.T) { + expected := position.NewPosition(1, 1, 1, 1) + c := meta.NewComment("/** hello world */", expected) + + actual := c.GetPosition() + + if expected != actual { + t.Errorf("expected and actual are not equal\n") + } +} diff --git a/meta/meta.go b/meta/meta.go new file mode 100644 index 0000000..d14d504 --- /dev/null +++ b/meta/meta.go @@ -0,0 +1,12 @@ +package meta + +import ( + "github.com/z7zmey/php-parser/position" +) + +type Meta interface { + String() string + SetTokenName(tn TokenName) + GetTokenName() TokenName + GetPosition() *position.Position +} diff --git a/comment/tokenNames.go b/meta/tokenNames.go similarity index 99% rename from comment/tokenNames.go rename to meta/tokenNames.go index f02c45b..87ab28f 100644 --- a/comment/tokenNames.go +++ b/meta/tokenNames.go @@ -1,4 +1,4 @@ -package comment +package meta // TokenName is used to specify a comment position type TokenName int diff --git a/meta/white_space.go b/meta/white_space.go new file mode 100644 index 0000000..ea12613 --- /dev/null +++ b/meta/white_space.go @@ -0,0 +1,37 @@ +package meta + +import ( + "github.com/z7zmey/php-parser/position" +) + +type WhiteSpace struct { + Value string + Position *position.Position + TokenName TokenName +} + +func NewWhiteSpace(value string, pos *position.Position) *WhiteSpace { + return &WhiteSpace{ + Value: value, + Position: pos, + TokenName: UnknownToken, + } +} + +// SetTokenName sets token name +func (c *WhiteSpace) SetTokenName(tokenName TokenName) { + c.TokenName = tokenName +} + +// GetTokenName returns token name +func (c *WhiteSpace) GetTokenName() TokenName { + return c.TokenName +} + +func (el *WhiteSpace) String() string { + return el.Value +} + +func (el *WhiteSpace) GetPosition() *position.Position { + return el.Position +} diff --git a/meta/white_space_test.go b/meta/white_space_test.go new file mode 100644 index 0000000..b609126 --- /dev/null +++ b/meta/white_space_test.go @@ -0,0 +1,44 @@ +package meta_test + +import ( + "testing" + + "github.com/z7zmey/php-parser/position" + + "github.com/z7zmey/php-parser/meta" +) + +func TestWhiteSpacePrint(t *testing.T) { + expected := "\n " + + w := meta.NewWhiteSpace(expected, nil) + + actual := w.String() + + if expected != actual { + t.Errorf("expected and actual are not equal\n") + } +} + +func TestWhiteSpaceSetGetTokenName(t *testing.T) { + expected := meta.ArrayToken + w := meta.NewWhiteSpace("\n ", nil) + w.SetTokenName(expected) + + actual := w.GetTokenName() + + if expected != actual { + t.Errorf("expected and actual are not equal\n") + } +} + +func TestWhiteSpaceGetPosition(t *testing.T) { + expected := position.NewPosition(1, 1, 1, 1) + q := meta.NewWhiteSpace("\n ", expected) + + actual := q.GetPosition() + + if expected != actual { + t.Errorf("expected and actual are not equal\n") + } +} diff --git a/node/expr/assign/n_assign.go b/node/expr/assign/n_assign.go index 7f53f2a..87048b0 100644 --- a/node/expr/assign/n_assign.go +++ b/node/expr/assign/n_assign.go @@ -1,7 +1,7 @@ package assign import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // Assign node type Assign struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Variable node.Node Expression node.Node @@ -33,15 +33,12 @@ func (n *Assign) GetPosition() *position.Position { return n.Position } -func (n *Assign) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *Assign) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *Assign) GetComments() []*comment.Comment { - return n.Comments +func (n *Assign) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/assign/n_assign_ref.go b/node/expr/assign/n_assign_ref.go index 9469162..ec9970e 100644 --- a/node/expr/assign/n_assign_ref.go +++ b/node/expr/assign/n_assign_ref.go @@ -1,7 +1,7 @@ package assign import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // Reference node type Reference struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Variable node.Node Expression node.Node @@ -33,15 +33,12 @@ func (n *Reference) GetPosition() *position.Position { return n.Position } -func (n *Reference) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *Reference) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *Reference) GetComments() []*comment.Comment { - return n.Comments +func (n *Reference) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/assign/n_bitwise_and.go b/node/expr/assign/n_bitwise_and.go index 8ee3e06..088e125 100644 --- a/node/expr/assign/n_bitwise_and.go +++ b/node/expr/assign/n_bitwise_and.go @@ -1,7 +1,7 @@ package assign import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // BitwiseAnd node type BitwiseAnd struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Variable node.Node Expression node.Node @@ -33,15 +33,12 @@ func (n *BitwiseAnd) GetPosition() *position.Position { return n.Position } -func (n *BitwiseAnd) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *BitwiseAnd) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *BitwiseAnd) GetComments() []*comment.Comment { - return n.Comments +func (n *BitwiseAnd) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/assign/n_bitwise_or.go b/node/expr/assign/n_bitwise_or.go index b1662c2..216d511 100644 --- a/node/expr/assign/n_bitwise_or.go +++ b/node/expr/assign/n_bitwise_or.go @@ -1,7 +1,7 @@ package assign import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // BitwiseOr node type BitwiseOr struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Variable node.Node Expression node.Node @@ -33,15 +33,12 @@ func (n *BitwiseOr) GetPosition() *position.Position { return n.Position } -func (n *BitwiseOr) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *BitwiseOr) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *BitwiseOr) GetComments() []*comment.Comment { - return n.Comments +func (n *BitwiseOr) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/assign/n_bitwise_xor.go b/node/expr/assign/n_bitwise_xor.go index 8dfca55..2d43254 100644 --- a/node/expr/assign/n_bitwise_xor.go +++ b/node/expr/assign/n_bitwise_xor.go @@ -1,7 +1,7 @@ package assign import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // BitwiseXor node type BitwiseXor struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Variable node.Node Expression node.Node @@ -33,15 +33,12 @@ func (n *BitwiseXor) GetPosition() *position.Position { return n.Position } -func (n *BitwiseXor) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *BitwiseXor) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *BitwiseXor) GetComments() []*comment.Comment { - return n.Comments +func (n *BitwiseXor) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/assign/n_concat.go b/node/expr/assign/n_concat.go index 2c818d4..9b8f65a 100644 --- a/node/expr/assign/n_concat.go +++ b/node/expr/assign/n_concat.go @@ -1,7 +1,7 @@ package assign import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // Concat node type Concat struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Variable node.Node Expression node.Node @@ -33,15 +33,12 @@ func (n *Concat) GetPosition() *position.Position { return n.Position } -func (n *Concat) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *Concat) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *Concat) GetComments() []*comment.Comment { - return n.Comments +func (n *Concat) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/assign/n_div.go b/node/expr/assign/n_div.go index 58a9488..ca53aa9 100644 --- a/node/expr/assign/n_div.go +++ b/node/expr/assign/n_div.go @@ -1,7 +1,7 @@ package assign import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // Div node type Div struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Variable node.Node Expression node.Node @@ -33,15 +33,12 @@ func (n *Div) GetPosition() *position.Position { return n.Position } -func (n *Div) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *Div) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *Div) GetComments() []*comment.Comment { - return n.Comments +func (n *Div) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/assign/n_minus.go b/node/expr/assign/n_minus.go index a9e77ca..af84b16 100644 --- a/node/expr/assign/n_minus.go +++ b/node/expr/assign/n_minus.go @@ -1,7 +1,7 @@ package assign import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // Minus node type Minus struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Variable node.Node Expression node.Node @@ -33,15 +33,12 @@ func (n *Minus) GetPosition() *position.Position { return n.Position } -func (n *Minus) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *Minus) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *Minus) GetComments() []*comment.Comment { - return n.Comments +func (n *Minus) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/assign/n_mod.go b/node/expr/assign/n_mod.go index 2ce65b4..64c9dac 100644 --- a/node/expr/assign/n_mod.go +++ b/node/expr/assign/n_mod.go @@ -1,7 +1,7 @@ package assign import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // Mod node type Mod struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Variable node.Node Expression node.Node @@ -33,15 +33,12 @@ func (n *Mod) GetPosition() *position.Position { return n.Position } -func (n *Mod) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *Mod) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *Mod) GetComments() []*comment.Comment { - return n.Comments +func (n *Mod) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/assign/n_mul.go b/node/expr/assign/n_mul.go index 8278719..5e9b4fe 100644 --- a/node/expr/assign/n_mul.go +++ b/node/expr/assign/n_mul.go @@ -1,7 +1,7 @@ package assign import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // Mul node type Mul struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Variable node.Node Expression node.Node @@ -33,15 +33,12 @@ func (n *Mul) GetPosition() *position.Position { return n.Position } -func (n *Mul) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *Mul) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *Mul) GetComments() []*comment.Comment { - return n.Comments +func (n *Mul) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/assign/n_plus.go b/node/expr/assign/n_plus.go index 4a6e4ba..fd3d6a3 100644 --- a/node/expr/assign/n_plus.go +++ b/node/expr/assign/n_plus.go @@ -1,7 +1,7 @@ package assign import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // Plus node type Plus struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Variable node.Node Expression node.Node @@ -33,15 +33,12 @@ func (n *Plus) GetPosition() *position.Position { return n.Position } -func (n *Plus) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *Plus) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *Plus) GetComments() []*comment.Comment { - return n.Comments +func (n *Plus) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/assign/n_pow.go b/node/expr/assign/n_pow.go index 538f73c..e42ee3e 100644 --- a/node/expr/assign/n_pow.go +++ b/node/expr/assign/n_pow.go @@ -1,7 +1,7 @@ package assign import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // Pow node type Pow struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Variable node.Node Expression node.Node @@ -33,15 +33,12 @@ func (n *Pow) GetPosition() *position.Position { return n.Position } -func (n *Pow) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *Pow) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *Pow) GetComments() []*comment.Comment { - return n.Comments +func (n *Pow) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/assign/n_shift_left.go b/node/expr/assign/n_shift_left.go index d56a06f..38184e4 100644 --- a/node/expr/assign/n_shift_left.go +++ b/node/expr/assign/n_shift_left.go @@ -1,7 +1,7 @@ package assign import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // ShiftLeft node type ShiftLeft struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Variable node.Node Expression node.Node @@ -33,15 +33,12 @@ func (n *ShiftLeft) GetPosition() *position.Position { return n.Position } -func (n *ShiftLeft) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *ShiftLeft) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *ShiftLeft) GetComments() []*comment.Comment { - return n.Comments +func (n *ShiftLeft) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/assign/n_shift_right.go b/node/expr/assign/n_shift_right.go index ab3971b..728ccd3 100644 --- a/node/expr/assign/n_shift_right.go +++ b/node/expr/assign/n_shift_right.go @@ -1,7 +1,7 @@ package assign import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // ShiftRight node type ShiftRight struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Variable node.Node Expression node.Node @@ -33,15 +33,12 @@ func (n *ShiftRight) GetPosition() *position.Position { return n.Position } -func (n *ShiftRight) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *ShiftRight) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *ShiftRight) GetComments() []*comment.Comment { - return n.Comments +func (n *ShiftRight) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/binary/n_bitwise_and.go b/node/expr/binary/n_bitwise_and.go index fe66522..667cf67 100644 --- a/node/expr/binary/n_bitwise_and.go +++ b/node/expr/binary/n_bitwise_and.go @@ -1,7 +1,7 @@ package binary import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // BitwiseAnd node type BitwiseAnd struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Left node.Node Right node.Node @@ -33,15 +33,12 @@ func (n *BitwiseAnd) GetPosition() *position.Position { return n.Position } -func (n *BitwiseAnd) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *BitwiseAnd) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *BitwiseAnd) GetComments() []*comment.Comment { - return n.Comments +func (n *BitwiseAnd) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/binary/n_bitwise_or.go b/node/expr/binary/n_bitwise_or.go index 3d4c1d1..3acce02 100644 --- a/node/expr/binary/n_bitwise_or.go +++ b/node/expr/binary/n_bitwise_or.go @@ -1,7 +1,7 @@ package binary import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // BitwiseOr node type BitwiseOr struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Left node.Node Right node.Node @@ -33,15 +33,12 @@ func (n *BitwiseOr) GetPosition() *position.Position { return n.Position } -func (n *BitwiseOr) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *BitwiseOr) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *BitwiseOr) GetComments() []*comment.Comment { - return n.Comments +func (n *BitwiseOr) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/binary/n_bitwise_xor.go b/node/expr/binary/n_bitwise_xor.go index 98dace5..56885e3 100644 --- a/node/expr/binary/n_bitwise_xor.go +++ b/node/expr/binary/n_bitwise_xor.go @@ -1,7 +1,7 @@ package binary import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // BitwiseXor node type BitwiseXor struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Left node.Node Right node.Node @@ -33,15 +33,12 @@ func (n *BitwiseXor) GetPosition() *position.Position { return n.Position } -func (n *BitwiseXor) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *BitwiseXor) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *BitwiseXor) GetComments() []*comment.Comment { - return n.Comments +func (n *BitwiseXor) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/binary/n_boolean_and.go b/node/expr/binary/n_boolean_and.go index ecfd326..ef62f9d 100644 --- a/node/expr/binary/n_boolean_and.go +++ b/node/expr/binary/n_boolean_and.go @@ -1,7 +1,7 @@ package binary import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // BooleanAnd node type BooleanAnd struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Left node.Node Right node.Node @@ -33,15 +33,12 @@ func (n *BooleanAnd) GetPosition() *position.Position { return n.Position } -func (n *BooleanAnd) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *BooleanAnd) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *BooleanAnd) GetComments() []*comment.Comment { - return n.Comments +func (n *BooleanAnd) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/binary/n_boolean_or.go b/node/expr/binary/n_boolean_or.go index 7d85a4b..6cc1aaa 100644 --- a/node/expr/binary/n_boolean_or.go +++ b/node/expr/binary/n_boolean_or.go @@ -1,7 +1,7 @@ package binary import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // BooleanOr node type BooleanOr struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Left node.Node Right node.Node @@ -33,15 +33,12 @@ func (n *BooleanOr) GetPosition() *position.Position { return n.Position } -func (n *BooleanOr) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *BooleanOr) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *BooleanOr) GetComments() []*comment.Comment { - return n.Comments +func (n *BooleanOr) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/binary/n_coalesce.go b/node/expr/binary/n_coalesce.go index 2efd1a7..f015108 100644 --- a/node/expr/binary/n_coalesce.go +++ b/node/expr/binary/n_coalesce.go @@ -1,7 +1,7 @@ package binary import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // Coalesce node type Coalesce struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Left node.Node Right node.Node @@ -33,15 +33,12 @@ func (n *Coalesce) GetPosition() *position.Position { return n.Position } -func (n *Coalesce) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *Coalesce) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *Coalesce) GetComments() []*comment.Comment { - return n.Comments +func (n *Coalesce) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/binary/n_concat.go b/node/expr/binary/n_concat.go index c81dc4f..2a35877 100644 --- a/node/expr/binary/n_concat.go +++ b/node/expr/binary/n_concat.go @@ -1,7 +1,7 @@ package binary import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // Concat node type Concat struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Left node.Node Right node.Node @@ -33,15 +33,12 @@ func (n *Concat) GetPosition() *position.Position { return n.Position } -func (n *Concat) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *Concat) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *Concat) GetComments() []*comment.Comment { - return n.Comments +func (n *Concat) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/binary/n_div.go b/node/expr/binary/n_div.go index e165d96..833ba44 100644 --- a/node/expr/binary/n_div.go +++ b/node/expr/binary/n_div.go @@ -1,7 +1,7 @@ package binary import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // Div node type Div struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Left node.Node Right node.Node @@ -33,15 +33,12 @@ func (n *Div) GetPosition() *position.Position { return n.Position } -func (n *Div) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *Div) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *Div) GetComments() []*comment.Comment { - return n.Comments +func (n *Div) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/binary/n_equal.go b/node/expr/binary/n_equal.go index 1086fa7..d5ff654 100644 --- a/node/expr/binary/n_equal.go +++ b/node/expr/binary/n_equal.go @@ -1,7 +1,7 @@ package binary import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // Equal node type Equal struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Left node.Node Right node.Node @@ -33,15 +33,12 @@ func (n *Equal) GetPosition() *position.Position { return n.Position } -func (n *Equal) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *Equal) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *Equal) GetComments() []*comment.Comment { - return n.Comments +func (n *Equal) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/binary/n_greater.go b/node/expr/binary/n_greater.go index 686dd1a..d177855 100644 --- a/node/expr/binary/n_greater.go +++ b/node/expr/binary/n_greater.go @@ -1,7 +1,7 @@ package binary import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // Greater node type Greater struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Left node.Node Right node.Node @@ -33,15 +33,12 @@ func (n *Greater) GetPosition() *position.Position { return n.Position } -func (n *Greater) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *Greater) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *Greater) GetComments() []*comment.Comment { - return n.Comments +func (n *Greater) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/binary/n_greater_or_equal.go b/node/expr/binary/n_greater_or_equal.go index 9a84f83..abf9bb6 100644 --- a/node/expr/binary/n_greater_or_equal.go +++ b/node/expr/binary/n_greater_or_equal.go @@ -1,7 +1,7 @@ package binary import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // GreaterOrEqual node type GreaterOrEqual struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Left node.Node Right node.Node @@ -33,15 +33,12 @@ func (n *GreaterOrEqual) GetPosition() *position.Position { return n.Position } -func (n *GreaterOrEqual) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *GreaterOrEqual) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *GreaterOrEqual) GetComments() []*comment.Comment { - return n.Comments +func (n *GreaterOrEqual) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/binary/n_identical.go b/node/expr/binary/n_identical.go index 0aed14d..885f6d7 100644 --- a/node/expr/binary/n_identical.go +++ b/node/expr/binary/n_identical.go @@ -1,7 +1,7 @@ package binary import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // Identical node type Identical struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Left node.Node Right node.Node @@ -33,15 +33,12 @@ func (n *Identical) GetPosition() *position.Position { return n.Position } -func (n *Identical) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *Identical) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *Identical) GetComments() []*comment.Comment { - return n.Comments +func (n *Identical) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/binary/n_logical_and.go b/node/expr/binary/n_logical_and.go index 3232bf9..7296a1d 100644 --- a/node/expr/binary/n_logical_and.go +++ b/node/expr/binary/n_logical_and.go @@ -1,7 +1,7 @@ package binary import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // LogicalAnd node type LogicalAnd struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Left node.Node Right node.Node @@ -33,15 +33,12 @@ func (n *LogicalAnd) GetPosition() *position.Position { return n.Position } -func (n *LogicalAnd) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *LogicalAnd) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *LogicalAnd) GetComments() []*comment.Comment { - return n.Comments +func (n *LogicalAnd) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/binary/n_logical_or.go b/node/expr/binary/n_logical_or.go index b96fcf6..35d1609 100644 --- a/node/expr/binary/n_logical_or.go +++ b/node/expr/binary/n_logical_or.go @@ -1,7 +1,7 @@ package binary import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // LogicalOr node type LogicalOr struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Left node.Node Right node.Node @@ -33,15 +33,12 @@ func (n *LogicalOr) GetPosition() *position.Position { return n.Position } -func (n *LogicalOr) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *LogicalOr) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *LogicalOr) GetComments() []*comment.Comment { - return n.Comments +func (n *LogicalOr) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/binary/n_logical_xor.go b/node/expr/binary/n_logical_xor.go index 49dc951..f986eb9 100644 --- a/node/expr/binary/n_logical_xor.go +++ b/node/expr/binary/n_logical_xor.go @@ -1,7 +1,7 @@ package binary import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // LogicalXor node type LogicalXor struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Left node.Node Right node.Node @@ -33,15 +33,12 @@ func (n *LogicalXor) GetPosition() *position.Position { return n.Position } -func (n *LogicalXor) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *LogicalXor) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *LogicalXor) GetComments() []*comment.Comment { - return n.Comments +func (n *LogicalXor) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/binary/n_minus.go b/node/expr/binary/n_minus.go index 9001cda..89909e8 100644 --- a/node/expr/binary/n_minus.go +++ b/node/expr/binary/n_minus.go @@ -1,7 +1,7 @@ package binary import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // Minus node type Minus struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Left node.Node Right node.Node @@ -33,15 +33,12 @@ func (n *Minus) GetPosition() *position.Position { return n.Position } -func (n *Minus) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *Minus) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *Minus) GetComments() []*comment.Comment { - return n.Comments +func (n *Minus) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/binary/n_mod.go b/node/expr/binary/n_mod.go index e9f5b42..aeaaa67 100644 --- a/node/expr/binary/n_mod.go +++ b/node/expr/binary/n_mod.go @@ -1,7 +1,7 @@ package binary import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // Mod node type Mod struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Left node.Node Right node.Node @@ -33,15 +33,12 @@ func (n *Mod) GetPosition() *position.Position { return n.Position } -func (n *Mod) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *Mod) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *Mod) GetComments() []*comment.Comment { - return n.Comments +func (n *Mod) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/binary/n_mul.go b/node/expr/binary/n_mul.go index 083ed1e..9f92791 100644 --- a/node/expr/binary/n_mul.go +++ b/node/expr/binary/n_mul.go @@ -1,7 +1,7 @@ package binary import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // Mul node type Mul struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Left node.Node Right node.Node @@ -33,15 +33,12 @@ func (n *Mul) GetPosition() *position.Position { return n.Position } -func (n *Mul) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *Mul) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *Mul) GetComments() []*comment.Comment { - return n.Comments +func (n *Mul) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/binary/n_not_equal.go b/node/expr/binary/n_not_equal.go index e713676..9a684c1 100644 --- a/node/expr/binary/n_not_equal.go +++ b/node/expr/binary/n_not_equal.go @@ -1,7 +1,7 @@ package binary import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // NotEqual node type NotEqual struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Left node.Node Right node.Node @@ -33,15 +33,12 @@ func (n *NotEqual) GetPosition() *position.Position { return n.Position } -func (n *NotEqual) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *NotEqual) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *NotEqual) GetComments() []*comment.Comment { - return n.Comments +func (n *NotEqual) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/binary/n_not_identical.go b/node/expr/binary/n_not_identical.go index 41491dc..de510ba 100644 --- a/node/expr/binary/n_not_identical.go +++ b/node/expr/binary/n_not_identical.go @@ -1,7 +1,7 @@ package binary import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // NotIdentical node type NotIdentical struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Left node.Node Right node.Node @@ -33,15 +33,12 @@ func (n *NotIdentical) GetPosition() *position.Position { return n.Position } -func (n *NotIdentical) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *NotIdentical) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *NotIdentical) GetComments() []*comment.Comment { - return n.Comments +func (n *NotIdentical) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/binary/n_plus.go b/node/expr/binary/n_plus.go index 10561b4..1c2e9ec 100644 --- a/node/expr/binary/n_plus.go +++ b/node/expr/binary/n_plus.go @@ -1,7 +1,7 @@ package binary import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // Plus node type Plus struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Left node.Node Right node.Node @@ -33,15 +33,12 @@ func (n *Plus) GetPosition() *position.Position { return n.Position } -func (n *Plus) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *Plus) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *Plus) GetComments() []*comment.Comment { - return n.Comments +func (n *Plus) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/binary/n_pow.go b/node/expr/binary/n_pow.go index 25af5c9..82a7993 100644 --- a/node/expr/binary/n_pow.go +++ b/node/expr/binary/n_pow.go @@ -1,7 +1,7 @@ package binary import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // Pow node type Pow struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Left node.Node Right node.Node @@ -33,15 +33,12 @@ func (n *Pow) GetPosition() *position.Position { return n.Position } -func (n *Pow) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *Pow) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *Pow) GetComments() []*comment.Comment { - return n.Comments +func (n *Pow) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/binary/n_shift_left.go b/node/expr/binary/n_shift_left.go index d6028fa..5cb657d 100644 --- a/node/expr/binary/n_shift_left.go +++ b/node/expr/binary/n_shift_left.go @@ -1,7 +1,7 @@ package binary import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // ShiftLeft node type ShiftLeft struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Left node.Node Right node.Node @@ -33,15 +33,12 @@ func (n *ShiftLeft) GetPosition() *position.Position { return n.Position } -func (n *ShiftLeft) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *ShiftLeft) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *ShiftLeft) GetComments() []*comment.Comment { - return n.Comments +func (n *ShiftLeft) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/binary/n_shift_right.go b/node/expr/binary/n_shift_right.go index 14b4f95..aa94382 100644 --- a/node/expr/binary/n_shift_right.go +++ b/node/expr/binary/n_shift_right.go @@ -1,7 +1,7 @@ package binary import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // ShiftRight node type ShiftRight struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Left node.Node Right node.Node @@ -33,15 +33,12 @@ func (n *ShiftRight) GetPosition() *position.Position { return n.Position } -func (n *ShiftRight) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *ShiftRight) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *ShiftRight) GetComments() []*comment.Comment { - return n.Comments +func (n *ShiftRight) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/binary/n_smaller.go b/node/expr/binary/n_smaller.go index b3deb82..cdaeeba 100644 --- a/node/expr/binary/n_smaller.go +++ b/node/expr/binary/n_smaller.go @@ -1,7 +1,7 @@ package binary import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // Smaller node type Smaller struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Left node.Node Right node.Node @@ -33,15 +33,12 @@ func (n *Smaller) GetPosition() *position.Position { return n.Position } -func (n *Smaller) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *Smaller) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *Smaller) GetComments() []*comment.Comment { - return n.Comments +func (n *Smaller) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/binary/n_smaller_or_equal.go b/node/expr/binary/n_smaller_or_equal.go index d2b2aef..c2b81e4 100644 --- a/node/expr/binary/n_smaller_or_equal.go +++ b/node/expr/binary/n_smaller_or_equal.go @@ -1,7 +1,7 @@ package binary import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // SmallerOrEqual node type SmallerOrEqual struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Left node.Node Right node.Node @@ -33,15 +33,12 @@ func (n *SmallerOrEqual) GetPosition() *position.Position { return n.Position } -func (n *SmallerOrEqual) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *SmallerOrEqual) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *SmallerOrEqual) GetComments() []*comment.Comment { - return n.Comments +func (n *SmallerOrEqual) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/binary/n_spaceship.go b/node/expr/binary/n_spaceship.go index 99945d3..3c18715 100644 --- a/node/expr/binary/n_spaceship.go +++ b/node/expr/binary/n_spaceship.go @@ -1,7 +1,7 @@ package binary import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // Spaceship node type Spaceship struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Left node.Node Right node.Node @@ -33,15 +33,12 @@ func (n *Spaceship) GetPosition() *position.Position { return n.Position } -func (n *Spaceship) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *Spaceship) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *Spaceship) GetComments() []*comment.Comment { - return n.Comments +func (n *Spaceship) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/cast/n_cast_array.go b/node/expr/cast/n_cast_array.go index 47b5524..7d5c417 100644 --- a/node/expr/cast/n_cast_array.go +++ b/node/expr/cast/n_cast_array.go @@ -1,7 +1,7 @@ package cast import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // Array node type Array struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Expr node.Node } @@ -31,15 +31,12 @@ func (n *Array) GetPosition() *position.Position { return n.Position } -func (n *Array) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *Array) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *Array) GetComments() []*comment.Comment { - return n.Comments +func (n *Array) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/cast/n_cast_bool.go b/node/expr/cast/n_cast_bool.go index 8af7697..00e807c 100644 --- a/node/expr/cast/n_cast_bool.go +++ b/node/expr/cast/n_cast_bool.go @@ -1,7 +1,7 @@ package cast import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // Bool node type Bool struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Expr node.Node } @@ -31,15 +31,12 @@ func (n *Bool) GetPosition() *position.Position { return n.Position } -func (n *Bool) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *Bool) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *Bool) GetComments() []*comment.Comment { - return n.Comments +func (n *Bool) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/cast/n_cast_double.go b/node/expr/cast/n_cast_double.go index 56715e5..0abc582 100644 --- a/node/expr/cast/n_cast_double.go +++ b/node/expr/cast/n_cast_double.go @@ -1,7 +1,7 @@ package cast import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // Double node type Double struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Expr node.Node } @@ -31,15 +31,12 @@ func (n *Double) GetPosition() *position.Position { return n.Position } -func (n *Double) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *Double) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *Double) GetComments() []*comment.Comment { - return n.Comments +func (n *Double) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/cast/n_cast_int.go b/node/expr/cast/n_cast_int.go index 4c6e730..d9247b2 100644 --- a/node/expr/cast/n_cast_int.go +++ b/node/expr/cast/n_cast_int.go @@ -1,7 +1,7 @@ package cast import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // Int node type Int struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Expr node.Node } @@ -31,15 +31,12 @@ func (n *Int) GetPosition() *position.Position { return n.Position } -func (n *Int) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *Int) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *Int) GetComments() []*comment.Comment { - return n.Comments +func (n *Int) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/cast/n_cast_object.go b/node/expr/cast/n_cast_object.go index b44aa9c..02de408 100644 --- a/node/expr/cast/n_cast_object.go +++ b/node/expr/cast/n_cast_object.go @@ -1,7 +1,7 @@ package cast import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // Object node type Object struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Expr node.Node } @@ -31,15 +31,12 @@ func (n *Object) GetPosition() *position.Position { return n.Position } -func (n *Object) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *Object) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *Object) GetComments() []*comment.Comment { - return n.Comments +func (n *Object) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/cast/n_cast_string.go b/node/expr/cast/n_cast_string.go index 7081b26..e58fb5e 100644 --- a/node/expr/cast/n_cast_string.go +++ b/node/expr/cast/n_cast_string.go @@ -1,7 +1,7 @@ package cast import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // String node type String struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Expr node.Node } @@ -31,15 +31,12 @@ func (n *String) GetPosition() *position.Position { return n.Position } -func (n *String) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *String) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *String) GetComments() []*comment.Comment { - return n.Comments +func (n *String) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/cast/n_cast_unset.go b/node/expr/cast/n_cast_unset.go index 7eadb26..8e52521 100644 --- a/node/expr/cast/n_cast_unset.go +++ b/node/expr/cast/n_cast_unset.go @@ -1,7 +1,7 @@ package cast import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // Unset node type Unset struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Expr node.Node } @@ -31,15 +31,12 @@ func (n *Unset) GetPosition() *position.Position { return n.Position } -func (n *Unset) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *Unset) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *Unset) GetComments() []*comment.Comment { - return n.Comments +func (n *Unset) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/n_array.go b/node/expr/n_array.go index e032563..986d070 100644 --- a/node/expr/n_array.go +++ b/node/expr/n_array.go @@ -1,7 +1,7 @@ package expr import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // Array node type Array struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Items []node.Node } @@ -31,15 +31,12 @@ func (n *Array) GetPosition() *position.Position { return n.Position } -func (n *Array) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *Array) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *Array) GetComments() []*comment.Comment { - return n.Comments +func (n *Array) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/n_array_dim_fetch.go b/node/expr/n_array_dim_fetch.go index 9e61c68..71e9bce 100644 --- a/node/expr/n_array_dim_fetch.go +++ b/node/expr/n_array_dim_fetch.go @@ -1,7 +1,7 @@ package expr import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // ArrayDimFetch node type ArrayDimFetch struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Variable node.Node Dim node.Node @@ -33,15 +33,12 @@ func (n *ArrayDimFetch) GetPosition() *position.Position { return n.Position } -func (n *ArrayDimFetch) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *ArrayDimFetch) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *ArrayDimFetch) GetComments() []*comment.Comment { - return n.Comments +func (n *ArrayDimFetch) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/n_array_item.go b/node/expr/n_array_item.go index 48c01a4..e41c6e7 100644 --- a/node/expr/n_array_item.go +++ b/node/expr/n_array_item.go @@ -1,7 +1,7 @@ package expr import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // ArrayItem node type ArrayItem struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Key node.Node Val node.Node @@ -33,15 +33,12 @@ func (n *ArrayItem) GetPosition() *position.Position { return n.Position } -func (n *ArrayItem) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *ArrayItem) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *ArrayItem) GetComments() []*comment.Comment { - return n.Comments +func (n *ArrayItem) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/n_bitwise_not.go b/node/expr/n_bitwise_not.go index 37cc08f..102acbc 100644 --- a/node/expr/n_bitwise_not.go +++ b/node/expr/n_bitwise_not.go @@ -1,7 +1,7 @@ package expr import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // BitwiseNot node type BitwiseNot struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Expr node.Node } @@ -31,15 +31,12 @@ func (n *BitwiseNot) GetPosition() *position.Position { return n.Position } -func (n *BitwiseNot) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *BitwiseNot) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *BitwiseNot) GetComments() []*comment.Comment { - return n.Comments +func (n *BitwiseNot) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/n_boolean_not.go b/node/expr/n_boolean_not.go index c5d8e0a..7f688fa 100644 --- a/node/expr/n_boolean_not.go +++ b/node/expr/n_boolean_not.go @@ -1,7 +1,7 @@ package expr import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // BooleanNot node type BooleanNot struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Expr node.Node } @@ -31,15 +31,12 @@ func (n *BooleanNot) GetPosition() *position.Position { return n.Position } -func (n *BooleanNot) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *BooleanNot) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *BooleanNot) GetComments() []*comment.Comment { - return n.Comments +func (n *BooleanNot) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/n_class_const_fetch.go b/node/expr/n_class_const_fetch.go index c223ebc..093a3b9 100644 --- a/node/expr/n_class_const_fetch.go +++ b/node/expr/n_class_const_fetch.go @@ -1,7 +1,7 @@ package expr import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // ClassConstFetch node type ClassConstFetch struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Class node.Node ConstantName node.Node @@ -33,15 +33,12 @@ func (n *ClassConstFetch) GetPosition() *position.Position { return n.Position } -func (n *ClassConstFetch) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *ClassConstFetch) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *ClassConstFetch) GetComments() []*comment.Comment { - return n.Comments +func (n *ClassConstFetch) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/n_clone.go b/node/expr/n_clone.go index 61b81dd..09a4a1b 100644 --- a/node/expr/n_clone.go +++ b/node/expr/n_clone.go @@ -1,7 +1,7 @@ package expr import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // Clone node type Clone struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Expr node.Node } @@ -31,15 +31,12 @@ func (n *Clone) GetPosition() *position.Position { return n.Position } -func (n *Clone) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *Clone) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *Clone) GetComments() []*comment.Comment { - return n.Comments +func (n *Clone) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/n_closure.go b/node/expr/n_closure.go index 48e7e9a..57e455e 100644 --- a/node/expr/n_closure.go +++ b/node/expr/n_closure.go @@ -1,7 +1,7 @@ package expr import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // Closure node type Closure struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position ReturnsRef bool Static bool @@ -43,15 +43,12 @@ func (n *Closure) GetPosition() *position.Position { return n.Position } -func (n *Closure) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *Closure) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *Closure) GetComments() []*comment.Comment { - return n.Comments +func (n *Closure) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/n_closure_use.go b/node/expr/n_closure_use.go index fd944f1..d17cbe7 100644 --- a/node/expr/n_closure_use.go +++ b/node/expr/n_closure_use.go @@ -1,7 +1,7 @@ package expr import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // ClosureUse node type ClosureUse struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Uses []node.Node } @@ -31,15 +31,12 @@ func (n *ClosureUse) GetPosition() *position.Position { return n.Position } -func (n *ClosureUse) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *ClosureUse) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *ClosureUse) GetComments() []*comment.Comment { - return n.Comments +func (n *ClosureUse) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/n_const_fetch.go b/node/expr/n_const_fetch.go index d10b0b4..ef027da 100644 --- a/node/expr/n_const_fetch.go +++ b/node/expr/n_const_fetch.go @@ -1,7 +1,7 @@ package expr import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // ConstFetch node type ConstFetch struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Constant node.Node } @@ -31,15 +31,12 @@ func (n *ConstFetch) GetPosition() *position.Position { return n.Position } -func (n *ConstFetch) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *ConstFetch) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *ConstFetch) GetComments() []*comment.Comment { - return n.Comments +func (n *ConstFetch) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/n_die.go b/node/expr/n_die.go index f4dcc9d..6346645 100644 --- a/node/expr/n_die.go +++ b/node/expr/n_die.go @@ -1,7 +1,7 @@ package expr import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // Die node type Die struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Expr node.Node } @@ -31,15 +31,12 @@ func (n *Die) GetPosition() *position.Position { return n.Position } -func (n *Die) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *Die) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *Die) GetComments() []*comment.Comment { - return n.Comments +func (n *Die) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/n_empty.go b/node/expr/n_empty.go index 71eb94a..a46f25e 100644 --- a/node/expr/n_empty.go +++ b/node/expr/n_empty.go @@ -1,7 +1,7 @@ package expr import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // Empty node type Empty struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Expr node.Node } @@ -31,15 +31,12 @@ func (n *Empty) GetPosition() *position.Position { return n.Position } -func (n *Empty) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *Empty) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *Empty) GetComments() []*comment.Comment { - return n.Comments +func (n *Empty) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/n_error_suppress.go b/node/expr/n_error_suppress.go index f3b7371..8c61212 100644 --- a/node/expr/n_error_suppress.go +++ b/node/expr/n_error_suppress.go @@ -1,7 +1,7 @@ package expr import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // ErrorSuppress node type ErrorSuppress struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Expr node.Node } @@ -31,15 +31,12 @@ func (n *ErrorSuppress) GetPosition() *position.Position { return n.Position } -func (n *ErrorSuppress) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *ErrorSuppress) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *ErrorSuppress) GetComments() []*comment.Comment { - return n.Comments +func (n *ErrorSuppress) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/n_eval.go b/node/expr/n_eval.go index 6b002c2..4b6e32c 100644 --- a/node/expr/n_eval.go +++ b/node/expr/n_eval.go @@ -1,7 +1,7 @@ package expr import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // Eval node type Eval struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Expr node.Node } @@ -31,15 +31,12 @@ func (n *Eval) GetPosition() *position.Position { return n.Position } -func (n *Eval) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *Eval) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *Eval) GetComments() []*comment.Comment { - return n.Comments +func (n *Eval) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/n_exit.go b/node/expr/n_exit.go index 306169a..d2e90be 100644 --- a/node/expr/n_exit.go +++ b/node/expr/n_exit.go @@ -1,7 +1,7 @@ package expr import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // Exit node type Exit struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Expr node.Node } @@ -31,15 +31,12 @@ func (n *Exit) GetPosition() *position.Position { return n.Position } -func (n *Exit) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *Exit) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *Exit) GetComments() []*comment.Comment { - return n.Comments +func (n *Exit) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/n_function_call.go b/node/expr/n_function_call.go index 2762e09..ef12d05 100644 --- a/node/expr/n_function_call.go +++ b/node/expr/n_function_call.go @@ -1,7 +1,7 @@ package expr import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // FunctionCall node type FunctionCall struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Function node.Node ArgumentList *node.ArgumentList @@ -33,15 +33,12 @@ func (n *FunctionCall) GetPosition() *position.Position { return n.Position } -func (n *FunctionCall) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *FunctionCall) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *FunctionCall) GetComments() []*comment.Comment { - return n.Comments +func (n *FunctionCall) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/n_include.go b/node/expr/n_include.go index 1b15cb9..ccae9be 100644 --- a/node/expr/n_include.go +++ b/node/expr/n_include.go @@ -1,7 +1,7 @@ package expr import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // Include node type Include struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Expr node.Node } @@ -31,15 +31,12 @@ func (n *Include) GetPosition() *position.Position { return n.Position } -func (n *Include) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *Include) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *Include) GetComments() []*comment.Comment { - return n.Comments +func (n *Include) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/n_include_once.go b/node/expr/n_include_once.go index 66a927e..5e54048 100644 --- a/node/expr/n_include_once.go +++ b/node/expr/n_include_once.go @@ -1,7 +1,7 @@ package expr import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // IncludeOnce node type IncludeOnce struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Expr node.Node } @@ -31,15 +31,12 @@ func (n *IncludeOnce) GetPosition() *position.Position { return n.Position } -func (n *IncludeOnce) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *IncludeOnce) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *IncludeOnce) GetComments() []*comment.Comment { - return n.Comments +func (n *IncludeOnce) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/n_instance_of.go b/node/expr/n_instance_of.go index 19a6472..1e2d6ce 100644 --- a/node/expr/n_instance_of.go +++ b/node/expr/n_instance_of.go @@ -1,7 +1,7 @@ package expr import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // InstanceOf node type InstanceOf struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Expr node.Node Class node.Node @@ -33,15 +33,12 @@ func (n *InstanceOf) GetPosition() *position.Position { return n.Position } -func (n *InstanceOf) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *InstanceOf) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *InstanceOf) GetComments() []*comment.Comment { - return n.Comments +func (n *InstanceOf) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/n_isset.go b/node/expr/n_isset.go index d09e18a..6d556b2 100644 --- a/node/expr/n_isset.go +++ b/node/expr/n_isset.go @@ -1,7 +1,7 @@ package expr import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // Isset node type Isset struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Variables []node.Node } @@ -31,15 +31,12 @@ func (n *Isset) GetPosition() *position.Position { return n.Position } -func (n *Isset) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *Isset) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *Isset) GetComments() []*comment.Comment { - return n.Comments +func (n *Isset) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/n_list.go b/node/expr/n_list.go index 0f368c8..d1862a3 100644 --- a/node/expr/n_list.go +++ b/node/expr/n_list.go @@ -1,7 +1,7 @@ package expr import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // List node type List struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Items []node.Node } @@ -31,15 +31,12 @@ func (n *List) GetPosition() *position.Position { return n.Position } -func (n *List) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *List) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *List) GetComments() []*comment.Comment { - return n.Comments +func (n *List) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/n_method_call.go b/node/expr/n_method_call.go index e2d8415..6cd1b33 100644 --- a/node/expr/n_method_call.go +++ b/node/expr/n_method_call.go @@ -1,7 +1,7 @@ package expr import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // MethodCall node type MethodCall struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Variable node.Node Method node.Node @@ -35,15 +35,12 @@ func (n *MethodCall) GetPosition() *position.Position { return n.Position } -func (n *MethodCall) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *MethodCall) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *MethodCall) GetComments() []*comment.Comment { - return n.Comments +func (n *MethodCall) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/n_new.go b/node/expr/n_new.go index 7f28ae5..3ff14fb 100644 --- a/node/expr/n_new.go +++ b/node/expr/n_new.go @@ -1,7 +1,7 @@ package expr import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // New node type New struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Class node.Node ArgumentList *node.ArgumentList @@ -33,15 +33,12 @@ func (n *New) GetPosition() *position.Position { return n.Position } -func (n *New) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *New) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *New) GetComments() []*comment.Comment { - return n.Comments +func (n *New) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/n_post_dec.go b/node/expr/n_post_dec.go index 476d572..ef5d0c2 100644 --- a/node/expr/n_post_dec.go +++ b/node/expr/n_post_dec.go @@ -1,7 +1,7 @@ package expr import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // PostDec node type PostDec struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Variable node.Node } @@ -31,15 +31,12 @@ func (n *PostDec) GetPosition() *position.Position { return n.Position } -func (n *PostDec) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *PostDec) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *PostDec) GetComments() []*comment.Comment { - return n.Comments +func (n *PostDec) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/n_post_inc.go b/node/expr/n_post_inc.go index f9aaf0e..2d1e917 100644 --- a/node/expr/n_post_inc.go +++ b/node/expr/n_post_inc.go @@ -1,7 +1,7 @@ package expr import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // PostInc node type PostInc struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Variable node.Node } @@ -31,15 +31,12 @@ func (n *PostInc) GetPosition() *position.Position { return n.Position } -func (n *PostInc) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *PostInc) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *PostInc) GetComments() []*comment.Comment { - return n.Comments +func (n *PostInc) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/n_pre_dec.go b/node/expr/n_pre_dec.go index 93c65e5..f5bf0fb 100644 --- a/node/expr/n_pre_dec.go +++ b/node/expr/n_pre_dec.go @@ -1,7 +1,7 @@ package expr import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // PreDec node type PreDec struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Variable node.Node } @@ -31,15 +31,12 @@ func (n *PreDec) GetPosition() *position.Position { return n.Position } -func (n *PreDec) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *PreDec) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *PreDec) GetComments() []*comment.Comment { - return n.Comments +func (n *PreDec) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/n_pre_inc.go b/node/expr/n_pre_inc.go index aac0747..8b31e4e 100644 --- a/node/expr/n_pre_inc.go +++ b/node/expr/n_pre_inc.go @@ -1,7 +1,7 @@ package expr import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // PreInc node type PreInc struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Variable node.Node } @@ -31,15 +31,12 @@ func (n *PreInc) GetPosition() *position.Position { return n.Position } -func (n *PreInc) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *PreInc) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *PreInc) GetComments() []*comment.Comment { - return n.Comments +func (n *PreInc) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/n_print.go b/node/expr/n_print.go index cdfd4fb..52bef36 100644 --- a/node/expr/n_print.go +++ b/node/expr/n_print.go @@ -1,7 +1,7 @@ package expr import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // Print node type Print struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Expr node.Node } @@ -31,15 +31,12 @@ func (n *Print) GetPosition() *position.Position { return n.Position } -func (n *Print) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *Print) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *Print) GetComments() []*comment.Comment { - return n.Comments +func (n *Print) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/n_property_fetch.go b/node/expr/n_property_fetch.go index 7256011..4b7f56d 100644 --- a/node/expr/n_property_fetch.go +++ b/node/expr/n_property_fetch.go @@ -1,7 +1,7 @@ package expr import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // PropertyFetch node type PropertyFetch struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Variable node.Node Property node.Node @@ -33,15 +33,12 @@ func (n *PropertyFetch) GetPosition() *position.Position { return n.Position } -func (n *PropertyFetch) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *PropertyFetch) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *PropertyFetch) GetComments() []*comment.Comment { - return n.Comments +func (n *PropertyFetch) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/n_reference.go b/node/expr/n_reference.go index df0cd5f..22f305a 100644 --- a/node/expr/n_reference.go +++ b/node/expr/n_reference.go @@ -1,7 +1,7 @@ package expr import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // Reference node type Reference struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Variable node.Node } @@ -31,15 +31,12 @@ func (n *Reference) GetPosition() *position.Position { return n.Position } -func (n *Reference) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *Reference) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *Reference) GetComments() []*comment.Comment { - return n.Comments +func (n *Reference) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/n_require.go b/node/expr/n_require.go index b145288..0a3144e 100644 --- a/node/expr/n_require.go +++ b/node/expr/n_require.go @@ -1,7 +1,7 @@ package expr import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // Require node type Require struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Expr node.Node } @@ -31,15 +31,12 @@ func (n *Require) GetPosition() *position.Position { return n.Position } -func (n *Require) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *Require) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *Require) GetComments() []*comment.Comment { - return n.Comments +func (n *Require) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/n_require_once.go b/node/expr/n_require_once.go index b36ab63..2dc6161 100644 --- a/node/expr/n_require_once.go +++ b/node/expr/n_require_once.go @@ -1,7 +1,7 @@ package expr import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // RequireOnce node type RequireOnce struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Expr node.Node } @@ -31,15 +31,12 @@ func (n *RequireOnce) GetPosition() *position.Position { return n.Position } -func (n *RequireOnce) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *RequireOnce) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *RequireOnce) GetComments() []*comment.Comment { - return n.Comments +func (n *RequireOnce) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/n_shell_exec.go b/node/expr/n_shell_exec.go index bbcf24d..749a51b 100644 --- a/node/expr/n_shell_exec.go +++ b/node/expr/n_shell_exec.go @@ -1,7 +1,7 @@ package expr import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // ShellExec node type ShellExec struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Parts []node.Node } @@ -31,15 +31,12 @@ func (n *ShellExec) GetPosition() *position.Position { return n.Position } -func (n *ShellExec) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *ShellExec) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *ShellExec) GetComments() []*comment.Comment { - return n.Comments +func (n *ShellExec) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/n_short_array.go b/node/expr/n_short_array.go index b6f5ebb..ab04658 100644 --- a/node/expr/n_short_array.go +++ b/node/expr/n_short_array.go @@ -1,7 +1,7 @@ package expr import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // ShortArray node type ShortArray struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Items []node.Node } @@ -31,15 +31,12 @@ func (n *ShortArray) GetPosition() *position.Position { return n.Position } -func (n *ShortArray) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *ShortArray) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *ShortArray) GetComments() []*comment.Comment { - return n.Comments +func (n *ShortArray) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/n_short_list.go b/node/expr/n_short_list.go index 3714832..c2ba2a7 100644 --- a/node/expr/n_short_list.go +++ b/node/expr/n_short_list.go @@ -1,7 +1,7 @@ package expr import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // ShortList node type ShortList struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Items []node.Node } @@ -31,15 +31,12 @@ func (n *ShortList) GetPosition() *position.Position { return n.Position } -func (n *ShortList) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *ShortList) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *ShortList) GetComments() []*comment.Comment { - return n.Comments +func (n *ShortList) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/n_static_call.go b/node/expr/n_static_call.go index be0c7f2..61ac3ff 100644 --- a/node/expr/n_static_call.go +++ b/node/expr/n_static_call.go @@ -1,7 +1,7 @@ package expr import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // StaticCall node type StaticCall struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Class node.Node Call node.Node @@ -35,15 +35,12 @@ func (n *StaticCall) GetPosition() *position.Position { return n.Position } -func (n *StaticCall) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *StaticCall) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *StaticCall) GetComments() []*comment.Comment { - return n.Comments +func (n *StaticCall) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/n_static_property_fetch.go b/node/expr/n_static_property_fetch.go index 1e52c37..58b2b96 100644 --- a/node/expr/n_static_property_fetch.go +++ b/node/expr/n_static_property_fetch.go @@ -1,7 +1,7 @@ package expr import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // StaticPropertyFetch node type StaticPropertyFetch struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Class node.Node Property node.Node @@ -33,15 +33,12 @@ func (n *StaticPropertyFetch) GetPosition() *position.Position { return n.Position } -func (n *StaticPropertyFetch) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *StaticPropertyFetch) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *StaticPropertyFetch) GetComments() []*comment.Comment { - return n.Comments +func (n *StaticPropertyFetch) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/n_ternary.go b/node/expr/n_ternary.go index f94aef3..99bbb50 100644 --- a/node/expr/n_ternary.go +++ b/node/expr/n_ternary.go @@ -1,7 +1,7 @@ package expr import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // Ternary node type Ternary struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Condition node.Node IfTrue node.Node @@ -35,15 +35,12 @@ func (n *Ternary) GetPosition() *position.Position { return n.Position } -func (n *Ternary) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *Ternary) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *Ternary) GetComments() []*comment.Comment { - return n.Comments +func (n *Ternary) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/n_unary_minus.go b/node/expr/n_unary_minus.go index f1c21eb..aa89cd8 100644 --- a/node/expr/n_unary_minus.go +++ b/node/expr/n_unary_minus.go @@ -1,7 +1,7 @@ package expr import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // UnaryMinus node type UnaryMinus struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Expr node.Node } @@ -31,15 +31,12 @@ func (n *UnaryMinus) GetPosition() *position.Position { return n.Position } -func (n *UnaryMinus) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *UnaryMinus) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *UnaryMinus) GetComments() []*comment.Comment { - return n.Comments +func (n *UnaryMinus) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/n_unary_plus.go b/node/expr/n_unary_plus.go index 5e50fcd..4de08aa 100644 --- a/node/expr/n_unary_plus.go +++ b/node/expr/n_unary_plus.go @@ -1,7 +1,7 @@ package expr import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // UnaryPlus node type UnaryPlus struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Expr node.Node } @@ -31,15 +31,12 @@ func (n *UnaryPlus) GetPosition() *position.Position { return n.Position } -func (n *UnaryPlus) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *UnaryPlus) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *UnaryPlus) GetComments() []*comment.Comment { - return n.Comments +func (n *UnaryPlus) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/n_variable.go b/node/expr/n_variable.go index b0dc735..5b29038 100644 --- a/node/expr/n_variable.go +++ b/node/expr/n_variable.go @@ -1,7 +1,7 @@ package expr import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // Variable node type Variable struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position VarName node.Node } @@ -31,15 +31,12 @@ func (n *Variable) GetPosition() *position.Position { return n.Position } -func (n *Variable) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *Variable) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *Variable) GetComments() []*comment.Comment { - return n.Comments +func (n *Variable) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/n_yield.go b/node/expr/n_yield.go index 999f0bf..453b479 100644 --- a/node/expr/n_yield.go +++ b/node/expr/n_yield.go @@ -1,7 +1,7 @@ package expr import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // Yield node type Yield struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Key node.Node Value node.Node @@ -33,15 +33,12 @@ func (n *Yield) GetPosition() *position.Position { return n.Position } -func (n *Yield) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *Yield) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *Yield) GetComments() []*comment.Comment { - return n.Comments +func (n *Yield) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/n_yield_from.go b/node/expr/n_yield_from.go index 6651856..561cec1 100644 --- a/node/expr/n_yield_from.go +++ b/node/expr/n_yield_from.go @@ -1,7 +1,7 @@ package expr import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // YieldFrom node type YieldFrom struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Expr node.Node } @@ -31,15 +31,12 @@ func (n *YieldFrom) GetPosition() *position.Position { return n.Position } -func (n *YieldFrom) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *YieldFrom) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *YieldFrom) GetComments() []*comment.Comment { - return n.Comments +func (n *YieldFrom) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/n_argument.go b/node/n_argument.go index c32582a..5d42fb4 100644 --- a/node/n_argument.go +++ b/node/n_argument.go @@ -1,14 +1,14 @@ package node import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" ) // Argument node type Argument struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Variadic bool // if ... before variable IsReference bool // if & before variable @@ -34,15 +34,12 @@ func (n *Argument) GetPosition() *position.Position { return n.Position } -func (n *Argument) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *Argument) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *Argument) GetComments() []*comment.Comment { - return n.Comments +func (n *Argument) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/n_argument_list.go b/node/n_argument_list.go index 49de0cc..ef5563f 100644 --- a/node/n_argument_list.go +++ b/node/n_argument_list.go @@ -1,14 +1,14 @@ package node import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" ) // ArgumentList node type ArgumentList struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Arguments []Node } @@ -30,16 +30,12 @@ func (n *ArgumentList) GetPosition() *position.Position { return n.Position } -func (n *ArgumentList) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - - n.Comments = append(n.Comments, cc...) +func (n *ArgumentList) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *ArgumentList) GetComments() []*comment.Comment { - return n.Comments +func (n *ArgumentList) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/n_identifier.go b/node/n_identifier.go index 5d3ad0a..9604465 100644 --- a/node/n_identifier.go +++ b/node/n_identifier.go @@ -1,14 +1,14 @@ package node import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" ) // Identifier node type Identifier struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Value string } @@ -30,15 +30,12 @@ func (n *Identifier) GetPosition() *position.Position { return n.Position } -func (n *Identifier) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *Identifier) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *Identifier) GetComments() []*comment.Comment { - return n.Comments +func (n *Identifier) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/n_nullable.go b/node/n_nullable.go index 5354efd..aa1e745 100644 --- a/node/n_nullable.go +++ b/node/n_nullable.go @@ -1,14 +1,14 @@ package node import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" ) // Nullable node type Nullable struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Expr Node } @@ -30,15 +30,12 @@ func (n *Nullable) GetPosition() *position.Position { return n.Position } -func (n *Nullable) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *Nullable) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *Nullable) GetComments() []*comment.Comment { - return n.Comments +func (n *Nullable) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/n_parameter.go b/node/n_parameter.go index 236690e..6a571e3 100644 --- a/node/n_parameter.go +++ b/node/n_parameter.go @@ -1,14 +1,14 @@ package node import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" ) // Parameter node type Parameter struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position ByRef bool Variadic bool @@ -38,15 +38,12 @@ func (n *Parameter) GetPosition() *position.Position { return n.Position } -func (n *Parameter) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *Parameter) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *Parameter) GetComments() []*comment.Comment { - return n.Comments +func (n *Parameter) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/n_root.go b/node/n_root.go index 9f2ee53..1b14629 100644 --- a/node/n_root.go +++ b/node/n_root.go @@ -1,14 +1,14 @@ package node import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" ) // Root node type Root struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Stmts []Node } @@ -30,15 +30,12 @@ func (n *Root) GetPosition() *position.Position { return n.Position } -func (n *Root) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *Root) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *Root) GetComments() []*comment.Comment { - return n.Comments +func (n *Root) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/name/n_fully_qualified.go b/node/name/n_fully_qualified.go index eb239bb..ca936b9 100644 --- a/node/name/n_fully_qualified.go +++ b/node/name/n_fully_qualified.go @@ -1,7 +1,7 @@ package name import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // FullyQualified node type FullyQualified struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Parts []node.Node } @@ -31,15 +31,12 @@ func (n *FullyQualified) GetPosition() *position.Position { return n.Position } -func (n *FullyQualified) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *FullyQualified) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *FullyQualified) GetComments() []*comment.Comment { - return n.Comments +func (n *FullyQualified) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/name/n_name.go b/node/name/n_name.go index d032b3c..d6cc74d 100644 --- a/node/name/n_name.go +++ b/node/name/n_name.go @@ -1,7 +1,7 @@ package name import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // Name node type Name struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Parts []node.Node } @@ -31,15 +31,12 @@ func (n *Name) GetPosition() *position.Position { return n.Position } -func (n *Name) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *Name) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *Name) GetComments() []*comment.Comment { - return n.Comments +func (n *Name) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/name/n_name_part.go b/node/name/n_name_part.go index a331231..3074009 100644 --- a/node/name/n_name_part.go +++ b/node/name/n_name_part.go @@ -1,14 +1,14 @@ package name import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" ) // NamePart node type NamePart struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Value string } @@ -30,15 +30,12 @@ func (n *NamePart) GetPosition() *position.Position { return n.Position } -func (n *NamePart) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *NamePart) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *NamePart) GetComments() []*comment.Comment { - return n.Comments +func (n *NamePart) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/name/n_relative.go b/node/name/n_relative.go index 56230a1..271110e 100644 --- a/node/name/n_relative.go +++ b/node/name/n_relative.go @@ -1,7 +1,7 @@ package name import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // Relative node type Relative struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Parts []node.Node } @@ -31,15 +31,12 @@ func (n *Relative) GetPosition() *position.Position { return n.Position } -func (n *Relative) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *Relative) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *Relative) GetComments() []*comment.Comment { - return n.Comments +func (n *Relative) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/node.go b/node/node.go index dd53b20..c3c94e1 100644 --- a/node/node.go +++ b/node/node.go @@ -1,7 +1,7 @@ package node import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" ) @@ -12,6 +12,6 @@ type Node interface { Attributes() map[string]interface{} // Attributes returns node attributes as map SetPosition(p *position.Position) GetPosition() *position.Position - AddComments(c []*comment.Comment, t comment.TokenName) - GetComments() []*comment.Comment + AddMeta(m []meta.Meta) + GetMeta() []meta.Meta } diff --git a/node/scalar/node_dnumber.go b/node/scalar/node_dnumber.go index fa65f0a..06e1946 100644 --- a/node/scalar/node_dnumber.go +++ b/node/scalar/node_dnumber.go @@ -1,14 +1,14 @@ package scalar import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" ) // Dnumber node type Dnumber struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Value string } @@ -30,15 +30,12 @@ func (n *Dnumber) GetPosition() *position.Position { return n.Position } -func (n *Dnumber) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *Dnumber) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *Dnumber) GetComments() []*comment.Comment { - return n.Comments +func (n *Dnumber) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/scalar/node_encapsed.go b/node/scalar/node_encapsed.go index 98b312d..1a971e5 100644 --- a/node/scalar/node_encapsed.go +++ b/node/scalar/node_encapsed.go @@ -1,7 +1,7 @@ package scalar import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // Encapsed node type Encapsed struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Parts []node.Node } @@ -31,15 +31,12 @@ func (n *Encapsed) GetPosition() *position.Position { return n.Position } -func (n *Encapsed) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *Encapsed) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *Encapsed) GetComments() []*comment.Comment { - return n.Comments +func (n *Encapsed) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/scalar/node_encapsed_string_part.go b/node/scalar/node_encapsed_string_part.go index 71e596c..a0d6ab7 100644 --- a/node/scalar/node_encapsed_string_part.go +++ b/node/scalar/node_encapsed_string_part.go @@ -1,14 +1,14 @@ package scalar import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" ) // EncapsedStringPart node type EncapsedStringPart struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Value string } @@ -30,15 +30,12 @@ func (n *EncapsedStringPart) GetPosition() *position.Position { return n.Position } -func (n *EncapsedStringPart) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *EncapsedStringPart) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *EncapsedStringPart) GetComments() []*comment.Comment { - return n.Comments +func (n *EncapsedStringPart) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/scalar/node_heredoc.go b/node/scalar/node_heredoc.go index 31f72f5..6d49063 100644 --- a/node/scalar/node_heredoc.go +++ b/node/scalar/node_heredoc.go @@ -1,7 +1,7 @@ package scalar import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // Heredoc node type Heredoc struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Label string Parts []node.Node @@ -33,15 +33,12 @@ func (n *Heredoc) GetPosition() *position.Position { return n.Position } -func (n *Heredoc) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *Heredoc) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *Heredoc) GetComments() []*comment.Comment { - return n.Comments +func (n *Heredoc) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/scalar/node_lnumber.go b/node/scalar/node_lnumber.go index 198d9e2..96fd4d3 100644 --- a/node/scalar/node_lnumber.go +++ b/node/scalar/node_lnumber.go @@ -1,14 +1,14 @@ package scalar import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" ) // Lnumber node type Lnumber struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Value string } @@ -30,15 +30,12 @@ func (n *Lnumber) GetPosition() *position.Position { return n.Position } -func (n *Lnumber) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *Lnumber) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *Lnumber) GetComments() []*comment.Comment { - return n.Comments +func (n *Lnumber) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/scalar/node_magic_constant.go b/node/scalar/node_magic_constant.go index 0f06f7b..5edc129 100644 --- a/node/scalar/node_magic_constant.go +++ b/node/scalar/node_magic_constant.go @@ -1,14 +1,14 @@ package scalar import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" ) // MagicConstant node type MagicConstant struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Value string } @@ -30,15 +30,12 @@ func (n *MagicConstant) GetPosition() *position.Position { return n.Position } -func (n *MagicConstant) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *MagicConstant) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *MagicConstant) GetComments() []*comment.Comment { - return n.Comments +func (n *MagicConstant) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/scalar/node_string.go b/node/scalar/node_string.go index bbabf35..8692098 100644 --- a/node/scalar/node_string.go +++ b/node/scalar/node_string.go @@ -1,14 +1,14 @@ package scalar import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" ) // String node type String struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Value string } @@ -30,15 +30,12 @@ func (n *String) GetPosition() *position.Position { return n.Position } -func (n *String) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *String) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *String) GetComments() []*comment.Comment { - return n.Comments +func (n *String) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_alt_else.go b/node/stmt/n_alt_else.go index 682a155..d3534e7 100644 --- a/node/stmt/n_alt_else.go +++ b/node/stmt/n_alt_else.go @@ -1,7 +1,7 @@ package stmt import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // AltElse node type AltElse struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Stmt node.Node } @@ -31,15 +31,12 @@ func (n *AltElse) GetPosition() *position.Position { return n.Position } -func (n *AltElse) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *AltElse) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *AltElse) GetComments() []*comment.Comment { - return n.Comments +func (n *AltElse) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_alt_else_if.go b/node/stmt/n_alt_else_if.go index e2cb2dd..e42f4c3 100644 --- a/node/stmt/n_alt_else_if.go +++ b/node/stmt/n_alt_else_if.go @@ -1,7 +1,7 @@ package stmt import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // AltElseIf node type AltElseIf struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Cond node.Node Stmt node.Node @@ -33,15 +33,12 @@ func (n *AltElseIf) GetPosition() *position.Position { return n.Position } -func (n *AltElseIf) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *AltElseIf) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *AltElseIf) GetComments() []*comment.Comment { - return n.Comments +func (n *AltElseIf) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_alt_for.go b/node/stmt/n_alt_for.go index e4fa03f..df75b75 100644 --- a/node/stmt/n_alt_for.go +++ b/node/stmt/n_alt_for.go @@ -1,7 +1,7 @@ package stmt import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // AltFor node type AltFor struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Init []node.Node Cond []node.Node @@ -37,15 +37,12 @@ func (n *AltFor) GetPosition() *position.Position { return n.Position } -func (n *AltFor) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *AltFor) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *AltFor) GetComments() []*comment.Comment { - return n.Comments +func (n *AltFor) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_alt_foreach.go b/node/stmt/n_alt_foreach.go index 066fbc8..d953524 100644 --- a/node/stmt/n_alt_foreach.go +++ b/node/stmt/n_alt_foreach.go @@ -1,7 +1,7 @@ package stmt import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // AltForeach node type AltForeach struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Expr node.Node Key node.Node @@ -37,15 +37,12 @@ func (n *AltForeach) GetPosition() *position.Position { return n.Position } -func (n *AltForeach) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *AltForeach) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *AltForeach) GetComments() []*comment.Comment { - return n.Comments +func (n *AltForeach) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_alt_if.go b/node/stmt/n_alt_if.go index 17ce857..928bc1b 100644 --- a/node/stmt/n_alt_if.go +++ b/node/stmt/n_alt_if.go @@ -1,7 +1,7 @@ package stmt import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // AltIf node type AltIf struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Cond node.Node Stmt node.Node @@ -37,15 +37,12 @@ func (n *AltIf) GetPosition() *position.Position { return n.Position } -func (n *AltIf) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *AltIf) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *AltIf) GetComments() []*comment.Comment { - return n.Comments +func (n *AltIf) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_alt_switch.go b/node/stmt/n_alt_switch.go index 8a5d6fe..7156324 100644 --- a/node/stmt/n_alt_switch.go +++ b/node/stmt/n_alt_switch.go @@ -1,7 +1,7 @@ package stmt import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // AltSwitch node type AltSwitch struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Cond node.Node CaseList *CaseList @@ -33,15 +33,12 @@ func (n *AltSwitch) GetPosition() *position.Position { return n.Position } -func (n *AltSwitch) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *AltSwitch) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *AltSwitch) GetComments() []*comment.Comment { - return n.Comments +func (n *AltSwitch) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_alt_while.go b/node/stmt/n_alt_while.go index e68abcc..563477c 100644 --- a/node/stmt/n_alt_while.go +++ b/node/stmt/n_alt_while.go @@ -1,7 +1,7 @@ package stmt import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // AltWhile node type AltWhile struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Cond node.Node Stmt node.Node @@ -33,15 +33,12 @@ func (n *AltWhile) GetPosition() *position.Position { return n.Position } -func (n *AltWhile) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *AltWhile) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *AltWhile) GetComments() []*comment.Comment { - return n.Comments +func (n *AltWhile) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_break.go b/node/stmt/n_break.go index 3e037ec..ef0edb0 100644 --- a/node/stmt/n_break.go +++ b/node/stmt/n_break.go @@ -1,7 +1,7 @@ package stmt import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // Break node type Break struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Expr node.Node } @@ -31,15 +31,12 @@ func (n *Break) GetPosition() *position.Position { return n.Position } -func (n *Break) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *Break) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *Break) GetComments() []*comment.Comment { - return n.Comments +func (n *Break) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_case.go b/node/stmt/n_case.go index 0da6917..4e811fe 100644 --- a/node/stmt/n_case.go +++ b/node/stmt/n_case.go @@ -1,7 +1,7 @@ package stmt import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // Case node type Case struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Cond node.Node Stmts []node.Node @@ -33,15 +33,12 @@ func (n *Case) GetPosition() *position.Position { return n.Position } -func (n *Case) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *Case) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *Case) GetComments() []*comment.Comment { - return n.Comments +func (n *Case) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_case_list.go b/node/stmt/n_case_list.go index aa7ba24..11a4db3 100644 --- a/node/stmt/n_case_list.go +++ b/node/stmt/n_case_list.go @@ -1,7 +1,7 @@ package stmt import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // CaseList node type CaseList struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Cases []node.Node } @@ -31,15 +31,12 @@ func (n *CaseList) GetPosition() *position.Position { return n.Position } -func (n *CaseList) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *CaseList) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *CaseList) GetComments() []*comment.Comment { - return n.Comments +func (n *CaseList) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_catch.go b/node/stmt/n_catch.go index 826f0a1..124660b 100644 --- a/node/stmt/n_catch.go +++ b/node/stmt/n_catch.go @@ -1,7 +1,7 @@ package stmt import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // Catch node type Catch struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Types []node.Node Variable node.Node @@ -35,15 +35,12 @@ func (n *Catch) GetPosition() *position.Position { return n.Position } -func (n *Catch) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *Catch) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *Catch) GetComments() []*comment.Comment { - return n.Comments +func (n *Catch) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_class.go b/node/stmt/n_class.go index 564cd8c..c47225b 100644 --- a/node/stmt/n_class.go +++ b/node/stmt/n_class.go @@ -1,7 +1,7 @@ package stmt import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // Class node type Class struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position PhpDocComment string ClassName node.Node @@ -43,15 +43,12 @@ func (n *Class) GetPosition() *position.Position { return n.Position } -func (n *Class) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *Class) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *Class) GetComments() []*comment.Comment { - return n.Comments +func (n *Class) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_class_const_list.go b/node/stmt/n_class_const_list.go index 240f271..5370239 100644 --- a/node/stmt/n_class_const_list.go +++ b/node/stmt/n_class_const_list.go @@ -1,7 +1,7 @@ package stmt import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // ClassConstList node type ClassConstList struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Modifiers []node.Node Consts []node.Node @@ -33,15 +33,12 @@ func (n *ClassConstList) GetPosition() *position.Position { return n.Position } -func (n *ClassConstList) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *ClassConstList) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *ClassConstList) GetComments() []*comment.Comment { - return n.Comments +func (n *ClassConstList) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_class_extends.go b/node/stmt/n_class_extends.go index b95dbd7..5400b21 100644 --- a/node/stmt/n_class_extends.go +++ b/node/stmt/n_class_extends.go @@ -1,7 +1,7 @@ package stmt import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // ClassExtends node type ClassExtends struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position ClassName node.Node } @@ -31,15 +31,12 @@ func (n *ClassExtends) GetPosition() *position.Position { return n.Position } -func (n *ClassExtends) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *ClassExtends) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *ClassExtends) GetComments() []*comment.Comment { - return n.Comments +func (n *ClassExtends) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_class_implements.go b/node/stmt/n_class_implements.go index f8f823f..e47a83f 100644 --- a/node/stmt/n_class_implements.go +++ b/node/stmt/n_class_implements.go @@ -1,7 +1,7 @@ package stmt import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // ClassImplements node type ClassImplements struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position InterfaceNames []node.Node } @@ -31,15 +31,12 @@ func (n *ClassImplements) GetPosition() *position.Position { return n.Position } -func (n *ClassImplements) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *ClassImplements) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *ClassImplements) GetComments() []*comment.Comment { - return n.Comments +func (n *ClassImplements) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_class_method.go b/node/stmt/n_class_method.go index 599e1e8..7d849f0 100644 --- a/node/stmt/n_class_method.go +++ b/node/stmt/n_class_method.go @@ -1,7 +1,7 @@ package stmt import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // ClassMethod node type ClassMethod struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position ReturnsRef bool PhpDocComment string @@ -43,15 +43,12 @@ func (n *ClassMethod) GetPosition() *position.Position { return n.Position } -func (n *ClassMethod) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *ClassMethod) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *ClassMethod) GetComments() []*comment.Comment { - return n.Comments +func (n *ClassMethod) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_const_list.go b/node/stmt/n_const_list.go index 65d758d..3a284fe 100644 --- a/node/stmt/n_const_list.go +++ b/node/stmt/n_const_list.go @@ -1,7 +1,7 @@ package stmt import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // ConstList node type ConstList struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Consts []node.Node } @@ -31,15 +31,12 @@ func (n *ConstList) GetPosition() *position.Position { return n.Position } -func (n *ConstList) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *ConstList) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *ConstList) GetComments() []*comment.Comment { - return n.Comments +func (n *ConstList) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_constant.go b/node/stmt/n_constant.go index 8a7dd43..c544cdc 100644 --- a/node/stmt/n_constant.go +++ b/node/stmt/n_constant.go @@ -1,7 +1,7 @@ package stmt import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // Constant node type Constant struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position PhpDocComment string ConstantName node.Node @@ -35,15 +35,12 @@ func (n *Constant) GetPosition() *position.Position { return n.Position } -func (n *Constant) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *Constant) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *Constant) GetComments() []*comment.Comment { - return n.Comments +func (n *Constant) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_continue.go b/node/stmt/n_continue.go index c553b4c..a155b0f 100644 --- a/node/stmt/n_continue.go +++ b/node/stmt/n_continue.go @@ -1,7 +1,7 @@ package stmt import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // Continue node type Continue struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Expr node.Node } @@ -31,15 +31,12 @@ func (n *Continue) GetPosition() *position.Position { return n.Position } -func (n *Continue) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *Continue) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *Continue) GetComments() []*comment.Comment { - return n.Comments +func (n *Continue) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_declare.go b/node/stmt/n_declare.go index 1b71c9c..e5a5805 100644 --- a/node/stmt/n_declare.go +++ b/node/stmt/n_declare.go @@ -1,7 +1,7 @@ package stmt import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // Declare node type Declare struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Consts []node.Node Stmt node.Node @@ -33,15 +33,12 @@ func (n *Declare) GetPosition() *position.Position { return n.Position } -func (n *Declare) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *Declare) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *Declare) GetComments() []*comment.Comment { - return n.Comments +func (n *Declare) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_default.go b/node/stmt/n_default.go index 8c34e50..7197b44 100644 --- a/node/stmt/n_default.go +++ b/node/stmt/n_default.go @@ -1,7 +1,7 @@ package stmt import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // Default node type Default struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Stmts []node.Node } @@ -31,15 +31,12 @@ func (n *Default) GetPosition() *position.Position { return n.Position } -func (n *Default) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *Default) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *Default) GetComments() []*comment.Comment { - return n.Comments +func (n *Default) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_do.go b/node/stmt/n_do.go index 4786d07..ebcd3d9 100644 --- a/node/stmt/n_do.go +++ b/node/stmt/n_do.go @@ -1,7 +1,7 @@ package stmt import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // Do node type Do struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Stmt node.Node Cond node.Node @@ -33,15 +33,12 @@ func (n *Do) GetPosition() *position.Position { return n.Position } -func (n *Do) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *Do) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *Do) GetComments() []*comment.Comment { - return n.Comments +func (n *Do) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_echo.go b/node/stmt/n_echo.go index 5e61660..5770cdc 100644 --- a/node/stmt/n_echo.go +++ b/node/stmt/n_echo.go @@ -1,7 +1,7 @@ package stmt import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // Echo node type Echo struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Exprs []node.Node } @@ -31,15 +31,12 @@ func (n *Echo) GetPosition() *position.Position { return n.Position } -func (n *Echo) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *Echo) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *Echo) GetComments() []*comment.Comment { - return n.Comments +func (n *Echo) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_else.go b/node/stmt/n_else.go index d97438a..209caa0 100644 --- a/node/stmt/n_else.go +++ b/node/stmt/n_else.go @@ -1,7 +1,7 @@ package stmt import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // Else node type Else struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Stmt node.Node } @@ -31,15 +31,12 @@ func (n *Else) GetPosition() *position.Position { return n.Position } -func (n *Else) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *Else) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *Else) GetComments() []*comment.Comment { - return n.Comments +func (n *Else) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_else_if.go b/node/stmt/n_else_if.go index 06b6dbc..504a800 100644 --- a/node/stmt/n_else_if.go +++ b/node/stmt/n_else_if.go @@ -1,7 +1,7 @@ package stmt import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // ElseIf node type ElseIf struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Cond node.Node Stmt node.Node @@ -33,15 +33,12 @@ func (n *ElseIf) GetPosition() *position.Position { return n.Position } -func (n *ElseIf) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *ElseIf) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *ElseIf) GetComments() []*comment.Comment { - return n.Comments +func (n *ElseIf) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_expression.go b/node/stmt/n_expression.go index 87d3fbd..189f8f0 100644 --- a/node/stmt/n_expression.go +++ b/node/stmt/n_expression.go @@ -1,7 +1,7 @@ package stmt import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // Expression node type Expression struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Expr node.Node } @@ -31,15 +31,12 @@ func (n *Expression) GetPosition() *position.Position { return n.Position } -func (n *Expression) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *Expression) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *Expression) GetComments() []*comment.Comment { - return n.Comments +func (n *Expression) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_finally.go b/node/stmt/n_finally.go index 333e0fe..a5e2803 100644 --- a/node/stmt/n_finally.go +++ b/node/stmt/n_finally.go @@ -1,7 +1,7 @@ package stmt import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // Finally node type Finally struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Stmts []node.Node } @@ -31,15 +31,12 @@ func (n *Finally) GetPosition() *position.Position { return n.Position } -func (n *Finally) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *Finally) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *Finally) GetComments() []*comment.Comment { - return n.Comments +func (n *Finally) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_for.go b/node/stmt/n_for.go index b4f8477..e9c04d9 100644 --- a/node/stmt/n_for.go +++ b/node/stmt/n_for.go @@ -1,7 +1,7 @@ package stmt import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // For node type For struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Init []node.Node Cond []node.Node @@ -37,15 +37,12 @@ func (n *For) GetPosition() *position.Position { return n.Position } -func (n *For) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *For) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *For) GetComments() []*comment.Comment { - return n.Comments +func (n *For) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_foreach.go b/node/stmt/n_foreach.go index acea5f0..243618b 100644 --- a/node/stmt/n_foreach.go +++ b/node/stmt/n_foreach.go @@ -1,7 +1,7 @@ package stmt import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // Foreach node type Foreach struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Expr node.Node Key node.Node @@ -37,15 +37,12 @@ func (n *Foreach) GetPosition() *position.Position { return n.Position } -func (n *Foreach) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *Foreach) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *Foreach) GetComments() []*comment.Comment { - return n.Comments +func (n *Foreach) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_function.go b/node/stmt/n_function.go index eb62219..8138a37 100644 --- a/node/stmt/n_function.go +++ b/node/stmt/n_function.go @@ -1,7 +1,7 @@ package stmt import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // Function node type Function struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position ReturnsRef bool PhpDocComment string @@ -41,15 +41,12 @@ func (n *Function) GetPosition() *position.Position { return n.Position } -func (n *Function) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *Function) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *Function) GetComments() []*comment.Comment { - return n.Comments +func (n *Function) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_global.go b/node/stmt/n_global.go index 51c8deb..61e23a2 100644 --- a/node/stmt/n_global.go +++ b/node/stmt/n_global.go @@ -1,7 +1,7 @@ package stmt import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // Global node type Global struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Vars []node.Node } @@ -31,15 +31,12 @@ func (n *Global) GetPosition() *position.Position { return n.Position } -func (n *Global) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *Global) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *Global) GetComments() []*comment.Comment { - return n.Comments +func (n *Global) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_goto.go b/node/stmt/n_goto.go index f5d12ad..b5531ec 100644 --- a/node/stmt/n_goto.go +++ b/node/stmt/n_goto.go @@ -1,7 +1,7 @@ package stmt import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // Goto node type Goto struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Label node.Node } @@ -31,15 +31,12 @@ func (n *Goto) GetPosition() *position.Position { return n.Position } -func (n *Goto) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *Goto) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *Goto) GetComments() []*comment.Comment { - return n.Comments +func (n *Goto) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_group_use.go b/node/stmt/n_group_use.go index e3f5946..ad857de 100644 --- a/node/stmt/n_group_use.go +++ b/node/stmt/n_group_use.go @@ -1,7 +1,7 @@ package stmt import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // GroupUse node type GroupUse struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position UseType node.Node Prefix node.Node @@ -35,15 +35,12 @@ func (n *GroupUse) GetPosition() *position.Position { return n.Position } -func (n *GroupUse) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *GroupUse) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *GroupUse) GetComments() []*comment.Comment { - return n.Comments +func (n *GroupUse) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_halt_compiler.go b/node/stmt/n_halt_compiler.go index 3b4e856..4e13216 100644 --- a/node/stmt/n_halt_compiler.go +++ b/node/stmt/n_halt_compiler.go @@ -1,14 +1,14 @@ package stmt import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" ) // HaltCompiler node type HaltCompiler struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position } @@ -27,15 +27,12 @@ func (n *HaltCompiler) GetPosition() *position.Position { return n.Position } -func (n *HaltCompiler) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *HaltCompiler) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *HaltCompiler) GetComments() []*comment.Comment { - return n.Comments +func (n *HaltCompiler) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_if.go b/node/stmt/n_if.go index eb39917..b88f4db 100644 --- a/node/stmt/n_if.go +++ b/node/stmt/n_if.go @@ -1,7 +1,7 @@ package stmt import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // If node type If struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Cond node.Node Stmt node.Node @@ -37,15 +37,12 @@ func (n *If) GetPosition() *position.Position { return n.Position } -func (n *If) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *If) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *If) GetComments() []*comment.Comment { - return n.Comments +func (n *If) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_inline_html.go b/node/stmt/n_inline_html.go index d16f45d..0e0d073 100644 --- a/node/stmt/n_inline_html.go +++ b/node/stmt/n_inline_html.go @@ -1,14 +1,14 @@ package stmt import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" ) // InlineHtml node type InlineHtml struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Value string } @@ -30,15 +30,12 @@ func (n *InlineHtml) GetPosition() *position.Position { return n.Position } -func (n *InlineHtml) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *InlineHtml) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *InlineHtml) GetComments() []*comment.Comment { - return n.Comments +func (n *InlineHtml) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_interface.go b/node/stmt/n_interface.go index 0a5d0fc..4d69753 100644 --- a/node/stmt/n_interface.go +++ b/node/stmt/n_interface.go @@ -1,7 +1,7 @@ package stmt import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // Interface node type Interface struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position PhpDocComment string InterfaceName node.Node @@ -37,15 +37,12 @@ func (n *Interface) GetPosition() *position.Position { return n.Position } -func (n *Interface) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *Interface) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *Interface) GetComments() []*comment.Comment { - return n.Comments +func (n *Interface) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_interface_extends.go b/node/stmt/n_interface_extends.go index 7422a67..1e6950f 100644 --- a/node/stmt/n_interface_extends.go +++ b/node/stmt/n_interface_extends.go @@ -1,7 +1,7 @@ package stmt import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // InterfaceExtends node type InterfaceExtends struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position InterfaceNames []node.Node } @@ -31,15 +31,12 @@ func (n *InterfaceExtends) GetPosition() *position.Position { return n.Position } -func (n *InterfaceExtends) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *InterfaceExtends) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *InterfaceExtends) GetComments() []*comment.Comment { - return n.Comments +func (n *InterfaceExtends) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_label.go b/node/stmt/n_label.go index d337797..06d850a 100644 --- a/node/stmt/n_label.go +++ b/node/stmt/n_label.go @@ -1,7 +1,7 @@ package stmt import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // Label node type Label struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position LabelName node.Node } @@ -31,15 +31,12 @@ func (n *Label) GetPosition() *position.Position { return n.Position } -func (n *Label) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *Label) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *Label) GetComments() []*comment.Comment { - return n.Comments +func (n *Label) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_namespace.go b/node/stmt/n_namespace.go index 96b4fea..8680b0c 100644 --- a/node/stmt/n_namespace.go +++ b/node/stmt/n_namespace.go @@ -1,7 +1,7 @@ package stmt import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // Namespace node type Namespace struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position NamespaceName node.Node Stmts []node.Node @@ -33,15 +33,12 @@ func (n *Namespace) GetPosition() *position.Position { return n.Position } -func (n *Namespace) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *Namespace) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *Namespace) GetComments() []*comment.Comment { - return n.Comments +func (n *Namespace) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_nop.go b/node/stmt/n_nop.go index e5d92dd..1b1282c 100644 --- a/node/stmt/n_nop.go +++ b/node/stmt/n_nop.go @@ -1,14 +1,14 @@ package stmt import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" ) // Nop node type Nop struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position } @@ -27,15 +27,12 @@ func (n *Nop) GetPosition() *position.Position { return n.Position } -func (n *Nop) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *Nop) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *Nop) GetComments() []*comment.Comment { - return n.Comments +func (n *Nop) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_property.go b/node/stmt/n_property.go index 0e02bcc..0e8d595 100644 --- a/node/stmt/n_property.go +++ b/node/stmt/n_property.go @@ -1,7 +1,7 @@ package stmt import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // Property node type Property struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position PhpDocComment string Variable node.Node @@ -35,15 +35,12 @@ func (n *Property) GetPosition() *position.Position { return n.Position } -func (n *Property) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *Property) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *Property) GetComments() []*comment.Comment { - return n.Comments +func (n *Property) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_property_list.go b/node/stmt/n_property_list.go index ba2af4b..0819af5 100644 --- a/node/stmt/n_property_list.go +++ b/node/stmt/n_property_list.go @@ -1,7 +1,7 @@ package stmt import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // PropertyList node type PropertyList struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Modifiers []node.Node Properties []node.Node @@ -33,15 +33,12 @@ func (n *PropertyList) GetPosition() *position.Position { return n.Position } -func (n *PropertyList) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *PropertyList) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *PropertyList) GetComments() []*comment.Comment { - return n.Comments +func (n *PropertyList) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_return.go b/node/stmt/n_return.go index 5b5fe1e..8a6fea2 100644 --- a/node/stmt/n_return.go +++ b/node/stmt/n_return.go @@ -1,7 +1,7 @@ package stmt import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // Return node type Return struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Expr node.Node } @@ -31,15 +31,12 @@ func (n *Return) GetPosition() *position.Position { return n.Position } -func (n *Return) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *Return) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *Return) GetComments() []*comment.Comment { - return n.Comments +func (n *Return) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_static.go b/node/stmt/n_static.go index 717bfd3..f4486af 100644 --- a/node/stmt/n_static.go +++ b/node/stmt/n_static.go @@ -1,7 +1,7 @@ package stmt import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // Static node type Static struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Vars []node.Node } @@ -31,15 +31,12 @@ func (n *Static) GetPosition() *position.Position { return n.Position } -func (n *Static) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *Static) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *Static) GetComments() []*comment.Comment { - return n.Comments +func (n *Static) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_static_var.go b/node/stmt/n_static_var.go index 6ee8ef6..8b25dbd 100644 --- a/node/stmt/n_static_var.go +++ b/node/stmt/n_static_var.go @@ -1,7 +1,7 @@ package stmt import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // StaticVar node type StaticVar struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Variable node.Node Expr node.Node @@ -33,15 +33,12 @@ func (n *StaticVar) GetPosition() *position.Position { return n.Position } -func (n *StaticVar) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *StaticVar) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *StaticVar) GetComments() []*comment.Comment { - return n.Comments +func (n *StaticVar) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_stmt_list.go b/node/stmt/n_stmt_list.go index ae3e699..929765c 100644 --- a/node/stmt/n_stmt_list.go +++ b/node/stmt/n_stmt_list.go @@ -1,7 +1,7 @@ package stmt import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // StmtList node type StmtList struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Stmts []node.Node } @@ -31,15 +31,12 @@ func (n *StmtList) GetPosition() *position.Position { return n.Position } -func (n *StmtList) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *StmtList) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *StmtList) GetComments() []*comment.Comment { - return n.Comments +func (n *StmtList) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_switch.go b/node/stmt/n_switch.go index c8ff240..7db1b82 100644 --- a/node/stmt/n_switch.go +++ b/node/stmt/n_switch.go @@ -1,7 +1,7 @@ package stmt import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // Switch node type Switch struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Cond node.Node CaseList *CaseList @@ -33,15 +33,12 @@ func (n *Switch) GetPosition() *position.Position { return n.Position } -func (n *Switch) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *Switch) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *Switch) GetComments() []*comment.Comment { - return n.Comments +func (n *Switch) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_throw.go b/node/stmt/n_throw.go index aa4caef..bc80c84 100644 --- a/node/stmt/n_throw.go +++ b/node/stmt/n_throw.go @@ -1,7 +1,7 @@ package stmt import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // Throw node type Throw struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Expr node.Node } @@ -31,15 +31,12 @@ func (n *Throw) GetPosition() *position.Position { return n.Position } -func (n *Throw) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *Throw) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *Throw) GetComments() []*comment.Comment { - return n.Comments +func (n *Throw) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_trait.go b/node/stmt/n_trait.go index 8c8a3cd..9b54109 100644 --- a/node/stmt/n_trait.go +++ b/node/stmt/n_trait.go @@ -1,7 +1,7 @@ package stmt import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // Trait node type Trait struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position PhpDocComment string TraitName node.Node @@ -35,15 +35,12 @@ func (n *Trait) GetPosition() *position.Position { return n.Position } -func (n *Trait) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *Trait) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *Trait) GetComments() []*comment.Comment { - return n.Comments +func (n *Trait) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_trait_adaptation_list.go b/node/stmt/n_trait_adaptation_list.go index 80d6902..0624c72 100644 --- a/node/stmt/n_trait_adaptation_list.go +++ b/node/stmt/n_trait_adaptation_list.go @@ -1,7 +1,7 @@ package stmt import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // TraitAdaptationList node type TraitAdaptationList struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Adaptations []node.Node } @@ -31,15 +31,12 @@ func (n *TraitAdaptationList) GetPosition() *position.Position { return n.Position } -func (n *TraitAdaptationList) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *TraitAdaptationList) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *TraitAdaptationList) GetComments() []*comment.Comment { - return n.Comments +func (n *TraitAdaptationList) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_trait_method_ref.go b/node/stmt/n_trait_method_ref.go index 9f7cd1f..7f90bbb 100644 --- a/node/stmt/n_trait_method_ref.go +++ b/node/stmt/n_trait_method_ref.go @@ -1,7 +1,7 @@ package stmt import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // TraitMethodRef node type TraitMethodRef struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Trait node.Node Method node.Node @@ -33,15 +33,12 @@ func (n *TraitMethodRef) GetPosition() *position.Position { return n.Position } -func (n *TraitMethodRef) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *TraitMethodRef) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *TraitMethodRef) GetComments() []*comment.Comment { - return n.Comments +func (n *TraitMethodRef) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_trait_use.go b/node/stmt/n_trait_use.go index 1c5b49a..18316df 100644 --- a/node/stmt/n_trait_use.go +++ b/node/stmt/n_trait_use.go @@ -1,7 +1,7 @@ package stmt import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // TraitUse node type TraitUse struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Traits []node.Node TraitAdaptationList *TraitAdaptationList @@ -33,15 +33,12 @@ func (n *TraitUse) GetPosition() *position.Position { return n.Position } -func (n *TraitUse) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *TraitUse) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *TraitUse) GetComments() []*comment.Comment { - return n.Comments +func (n *TraitUse) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_trait_use_alias.go b/node/stmt/n_trait_use_alias.go index 32c311b..0b23a20 100644 --- a/node/stmt/n_trait_use_alias.go +++ b/node/stmt/n_trait_use_alias.go @@ -1,7 +1,7 @@ package stmt import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // TraitUseAlias node type TraitUseAlias struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Ref node.Node Modifier node.Node @@ -35,15 +35,12 @@ func (n *TraitUseAlias) GetPosition() *position.Position { return n.Position } -func (n *TraitUseAlias) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *TraitUseAlias) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *TraitUseAlias) GetComments() []*comment.Comment { - return n.Comments +func (n *TraitUseAlias) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_trait_use_precedence.go b/node/stmt/n_trait_use_precedence.go index 24f388c..c6ae475 100644 --- a/node/stmt/n_trait_use_precedence.go +++ b/node/stmt/n_trait_use_precedence.go @@ -1,7 +1,7 @@ package stmt import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // TraitUsePrecedence node type TraitUsePrecedence struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Ref node.Node Insteadof []node.Node @@ -33,15 +33,12 @@ func (n *TraitUsePrecedence) GetPosition() *position.Position { return n.Position } -func (n *TraitUsePrecedence) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *TraitUsePrecedence) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *TraitUsePrecedence) GetComments() []*comment.Comment { - return n.Comments +func (n *TraitUsePrecedence) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_try.go b/node/stmt/n_try.go index 865f6d4..6a93cb3 100644 --- a/node/stmt/n_try.go +++ b/node/stmt/n_try.go @@ -1,7 +1,7 @@ package stmt import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // Try node type Try struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Stmts []node.Node Catches []node.Node @@ -35,15 +35,12 @@ func (n *Try) GetPosition() *position.Position { return n.Position } -func (n *Try) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *Try) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *Try) GetComments() []*comment.Comment { - return n.Comments +func (n *Try) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_unset.go b/node/stmt/n_unset.go index d7480a2..d787066 100644 --- a/node/stmt/n_unset.go +++ b/node/stmt/n_unset.go @@ -1,7 +1,7 @@ package stmt import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // Unset node type Unset struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Vars []node.Node } @@ -31,15 +31,12 @@ func (n *Unset) GetPosition() *position.Position { return n.Position } -func (n *Unset) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *Unset) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *Unset) GetComments() []*comment.Comment { - return n.Comments +func (n *Unset) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_use.go b/node/stmt/n_use.go index fd46664..e5fb6f3 100644 --- a/node/stmt/n_use.go +++ b/node/stmt/n_use.go @@ -1,7 +1,7 @@ package stmt import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // Use node type Use struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position UseType node.Node Use node.Node @@ -35,15 +35,12 @@ func (n *Use) GetPosition() *position.Position { return n.Position } -func (n *Use) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *Use) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *Use) GetComments() []*comment.Comment { - return n.Comments +func (n *Use) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_use_list.go b/node/stmt/n_use_list.go index 6dbf295..09ef434 100644 --- a/node/stmt/n_use_list.go +++ b/node/stmt/n_use_list.go @@ -1,7 +1,7 @@ package stmt import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // UseList node type UseList struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position UseType node.Node Uses []node.Node @@ -33,15 +33,12 @@ func (n *UseList) GetPosition() *position.Position { return n.Position } -func (n *UseList) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *UseList) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *UseList) GetComments() []*comment.Comment { - return n.Comments +func (n *UseList) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_while.go b/node/stmt/n_while.go index 2252928..897425b 100644 --- a/node/stmt/n_while.go +++ b/node/stmt/n_while.go @@ -1,7 +1,7 @@ package stmt import ( - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,7 +9,7 @@ import ( // While node type While struct { - Comments []*comment.Comment + Meta []meta.Meta Position *position.Position Cond node.Node Stmt node.Node @@ -33,15 +33,12 @@ func (n *While) GetPosition() *position.Position { return n.Position } -func (n *While) AddComments(cc []*comment.Comment, tn comment.TokenName) { - for _, c := range cc { - c.SetTokenName(tn) - } - n.Comments = append(n.Comments, cc...) +func (n *While) AddMeta(m []meta.Meta) { + n.Meta = append(n.Meta, m...) } -func (n *While) GetComments() []*comment.Comment { - return n.Comments +func (n *While) GetMeta() []meta.Meta { + return n.Meta } // Attributes returns node attributes as map diff --git a/node/t_node_test.go b/node/t_node_test.go index 374dc6a..c58ff60 100644 --- a/node/t_node_test.go +++ b/node/t_node_test.go @@ -5,7 +5,6 @@ import ( "reflect" "testing" - "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node/name" "github.com/z7zmey/php-parser/position" @@ -730,18 +729,6 @@ func TestPhp7ArgumentNode(t *testing.T) { StartPos: 162, EndPos: 185, }, - Comments: []*comment.Comment{ - { - Position: &position.Position{ - StartLine: 8, - EndLine: 8, - StartPos: 137, - EndPos: 158, - }, - Value: "/** anonymous class */", - TokenName: 'O', - }, - }, Class: &stmt.Class{ Position: &position.Position{ StartLine: 9, diff --git a/parser/comments.go b/parser/comments.go deleted file mode 100644 index d030cd5..0000000 --- a/parser/comments.go +++ /dev/null @@ -1,30 +0,0 @@ -package parser - -import ( - "github.com/z7zmey/php-parser/comment" - "github.com/z7zmey/php-parser/node" - "github.com/z7zmey/php-parser/scanner" -) - -// Comments a collection of comment groups assigned to nodes -type Comments map[node.Node][]*comment.Comment - -// AddComments add comment group to the collection -func (c Comments) AddComments(node node.Node, comments []*comment.Comment) { - c[node] = append(c[node], comments...) -} - -func (c Comments) AddFromToken(node node.Node, token *scanner.Token, tokenName comment.TokenName) { - comments := token.Comments - - for _, cmt := range comments { - cmt.SetTokenName(tokenName) - } - - c.AddComments(node, comments) -} - -func (c Comments) AddFromChildNode(n node.Node, ch node.Node) { - c.AddComments(n, c[ch]) - delete(c, ch) -} diff --git a/parser/comments_test.go b/parser/comments_test.go deleted file mode 100644 index bdec9ef..0000000 --- a/parser/comments_test.go +++ /dev/null @@ -1,28 +0,0 @@ -package parser_test - -import ( - "testing" - - "github.com/z7zmey/php-parser/comment" - "github.com/z7zmey/php-parser/node" - "github.com/z7zmey/php-parser/parser" -) - -func TestComments(t *testing.T) { - n := node.NewIdentifier("test") - - commentGroup := []*comment.Comment{ - comment.NewComment("/** hello world */", nil), - comment.NewComment("// hello world", nil), - } - - comments := parser.Comments{} - comments.AddComments(n, commentGroup) - - if comments[n][0].String() != "/** hello world */" { - t.Errorf("expected and actual are not equal\n") - } - if comments[n][1].String() != "// hello world" { - t.Errorf("expected and actual are not equal\n") - } -} diff --git a/parser/parser.go b/parser/parser.go index 6fbb9c4..7fb233b 100644 --- a/parser/parser.go +++ b/parser/parser.go @@ -11,5 +11,5 @@ type Parser interface { GetPath() string GetRootNode() node.Node GetErrors() []*errors.Error - GetComments() Comments + WithMeta() } diff --git a/php5/parser.go b/php5/parser.go index 873112f..ee887f8 100644 --- a/php5/parser.go +++ b/php5/parser.go @@ -3,8 +3,8 @@ package php5 import ( "io" - "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/errors" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/parser" "github.com/z7zmey/php-parser/scanner" @@ -22,7 +22,6 @@ type Parser struct { positionBuilder *parser.PositionBuilder errors []*errors.Error rootNode node.Node - comments parser.Comments } // NewParser creates and returns new Parser @@ -36,7 +35,6 @@ func NewParser(src io.Reader, path string) *Parser { nil, nil, nil, - nil, } } @@ -51,12 +49,15 @@ func (l *Parser) Error(msg string) { l.errors = append(l.errors, errors.NewError(msg, l.currentToken)) } +func (l *Parser) WithMeta() { + l.Lexer.WithMeta = true +} + // Parse the php7 Parser entrypoint func (l *Parser) Parse() int { // init l.errors = nil l.rootNode = nil - l.comments = parser.Comments{} l.positionBuilder = &parser.PositionBuilder{} // parse @@ -64,14 +65,14 @@ func (l *Parser) Parse() int { return yyParse(l) } -func (l *Parser) listGetFirstNodeComments(list []node.Node) []*comment.Comment { +func (l *Parser) listGetFirstNodeMeta(list []node.Node) []meta.Meta { if len(list) == 0 { return nil } node := list[0] - return l.comments[node] + return node.GetMeta() } // GetPath return path to file @@ -89,11 +90,6 @@ func (l *Parser) GetErrors() []*errors.Error { return l.errors } -// GetComments returns comments list -func (l *Parser) GetComments() parser.Comments { - return l.comments -} - // helpers func lastNode(nn []node.Node) node.Node { @@ -111,6 +107,14 @@ func isDollar(r rune) bool { return r == '$' } +func addMeta(n node.Node, mm []meta.Meta, tn meta.TokenName) { + for _, m := range mm { + m.SetTokenName(tn) + } + + n.AddMeta(mm) +} + func (p *Parser) returnTokenToPool(yyDollar []yySymType, yyVAL *yySymType) { for i := 1; i < len(yyDollar); i++ { if yyDollar[i].token != nil { diff --git a/php5/php5.go b/php5/php5.go index d733f91..431607c 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -8,7 +8,7 @@ import ( "strconv" "strings" - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node/expr" "github.com/z7zmey/php-parser/node/expr/assign" @@ -346,7 +346,7 @@ const yyEofCode = 1 const yyErrCode = 2 const yyInitialStackSize = 16 -//line php5/php5.y:6795 +//line php5/php5.y:6789 type simpleIndirectReference struct { all []*expr.Variable @@ -2362,7 +2362,7 @@ yydefault: namePart.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - namePart.AddComments(yyDollar[1].token.Comments, comment.StringToken) + addMeta(namePart, yyDollar[1].token.Meta, meta.StringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2377,8 +2377,8 @@ yydefault: namePart.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) // save comments - lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.NsSeparatorToken) - namePart.AddComments(yyDollar[3].token.Comments, comment.StringToken) + addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.NsSeparatorToken) + addMeta(namePart, yyDollar[3].token.Meta, meta.StringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2425,10 +2425,10 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.HaltCompilerToken) - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenParenthesisToken) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.CloseParenthesisToken) - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.SemiColonToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.HaltCompilerToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenParenthesisToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.CloseParenthesisToken) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2444,8 +2444,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.NamespaceToken) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.SemiColonToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.NamespaceToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2461,9 +2461,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[5].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.NamespaceToken) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.OpenCurlyBracesToken) - yyVAL.node.AddComments(yyDollar[5].token.Comments, comment.CloseCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.NamespaceToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.OpenCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[5].token.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2477,9 +2477,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.NamespaceToken) - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenCurlyBracesToken) - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.NamespaceToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2493,8 +2493,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.UseToken) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.SemiColonToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.UseToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2510,9 +2510,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.UseToken) - useType.AddComments(yyDollar[2].token.Comments, comment.UseToken) - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.SemiColonToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.UseToken) + addMeta(useType, yyDollar[2].token.Meta, meta.UseToken) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2528,9 +2528,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.UseToken) - useType.AddComments(yyDollar[2].token.Comments, comment.UseToken) - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.SemiColonToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.UseToken) + addMeta(useType, yyDollar[2].token.Meta, meta.UseToken) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2544,7 +2544,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.SemiColonToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2555,7 +2555,7 @@ yydefault: yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) + addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2594,8 +2594,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition(yyDollar[1].list, yyDollar[3].token)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.AsToken) - alias.AddComments(yyDollar[3].token.Comments, comment.StringToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.AsToken) + addMeta(alias, yyDollar[3].token.Meta, meta.StringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2611,7 +2611,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.NsSeparatorToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.NsSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2629,9 +2629,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition(yyDollar[2].list, yyDollar[4].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.NsSeparatorToken) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.AsToken) - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.StringToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.NsSeparatorToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.AsToken) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.StringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2642,7 +2642,7 @@ yydefault: yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) + addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2681,8 +2681,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition(yyDollar[1].list, yyDollar[3].token)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.AsToken) - alias.AddComments(yyDollar[3].token.Comments, comment.StringToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.AsToken) + addMeta(alias, yyDollar[3].token.Meta, meta.StringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2698,7 +2698,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.NsSeparatorToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.NsSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2716,9 +2716,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition(yyDollar[2].list, yyDollar[4].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.NsSeparatorToken) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.AsToken) - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.StringToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.NsSeparatorToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.AsToken) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.StringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2729,7 +2729,7 @@ yydefault: yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) + addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2768,8 +2768,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition(yyDollar[1].list, yyDollar[3].token)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.AsToken) - alias.AddComments(yyDollar[3].token.Comments, comment.StringToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.AsToken) + addMeta(alias, yyDollar[3].token.Meta, meta.StringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2785,7 +2785,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.NsSeparatorToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.NsSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2803,9 +2803,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition(yyDollar[2].list, yyDollar[4].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.NsSeparatorToken) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.AsToken) - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.StringToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.NsSeparatorToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.AsToken) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.StringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2825,9 +2825,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeNodeListPosition(yyDollar[1].node, constList.Consts)) // save comments - lastNode(constList.Consts).AddComments(yyDollar[2].token.Comments, comment.CommaToken) - name.AddComments(yyDollar[3].token.Comments, comment.StringToken) - constant.AddComments(yyDollar[4].token.Comments, comment.EqualToken) + addMeta(lastNode(constList.Consts), yyDollar[2].token.Meta, meta.CommaToken) + addMeta(name, yyDollar[3].token.Meta, meta.StringToken) + addMeta(constant, yyDollar[4].token.Meta, meta.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2846,9 +2846,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, constList)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ConstToken) - name.AddComments(yyDollar[2].token.Comments, comment.StringToken) - constant.AddComments(yyDollar[3].token.Comments, comment.EqualToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ConstToken) + addMeta(name, yyDollar[2].token.Meta, meta.StringToken) + addMeta(constant, yyDollar[3].token.Meta, meta.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2913,10 +2913,10 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.HaltCompilerToken) - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenParenthesisToken) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.CloseParenthesisToken) - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.SemiColonToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.HaltCompilerToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenParenthesisToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.CloseParenthesisToken) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2940,8 +2940,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - label.AddComments(yyDollar[1].token.Comments, comment.StringToken) - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.ColonToken) + addMeta(label, yyDollar[1].token.Meta, meta.StringToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.ColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2955,8 +2955,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.OpenCurlyBracesToken) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.CloseCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.OpenCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2976,7 +2976,7 @@ yydefault: } // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.IfToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.IfToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2992,10 +2992,10 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[8].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.IfToken) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.ColonToken) - yyVAL.node.AddComments(yyDollar[7].token.Comments, comment.EndifToken) - yyVAL.node.AddComments(yyDollar[8].token.Comments, comment.SemiColonToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.IfToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.ColonToken) + addMeta(yyVAL.node, yyDollar[7].token.Meta, meta.EndifToken) + addMeta(yyVAL.node, yyDollar[8].token.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3016,7 +3016,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.WhileToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.WhileToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3030,9 +3030,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[5].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.DoToken) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.WhileToken) - yyVAL.node.AddComments(yyDollar[5].token.Comments, comment.SemiColonToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.DoToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.WhileToken) + addMeta(yyVAL.node, yyDollar[5].token.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3057,11 +3057,11 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[9].node)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ForToken) - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenParenthesisToken) - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.ForInitSemicolonToken) - yyVAL.node.AddComments(yyDollar[6].token.Comments, comment.ForCondSemicolonToken) - yyVAL.node.AddComments(yyDollar[8].token.Comments, comment.CloseParenthesisToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ForToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenParenthesisToken) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.ForInitSemicolonToken) + addMeta(yyVAL.node, yyDollar[6].token.Meta, meta.ForCondSemicolonToken) + addMeta(yyVAL.node, yyDollar[8].token.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3084,7 +3084,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.SwitchToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.SwitchToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3098,8 +3098,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.BreakToken) - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.SemiColonToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.BreakToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3113,8 +3113,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.BreakToken) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.SemiColonToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.BreakToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3128,8 +3128,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ContinueToken) - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.SemiColonToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ContinueToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3143,8 +3143,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ContinueToken) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.SemiColonToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ContinueToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3158,8 +3158,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ReturnToken) - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.SemiColonToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ReturnToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3173,8 +3173,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ReturnToken) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.SemiColonToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ReturnToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3188,8 +3188,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ReturnToken) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.SemiColonToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ReturnToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3203,7 +3203,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.SemiColonToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3217,8 +3217,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.GlobalToken) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.SemiColonToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.GlobalToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3232,8 +3232,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.StaticToken) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.SemiColonToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.StaticToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3247,8 +3247,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.EchoToken) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.SemiColonToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.EchoToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3262,7 +3262,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.InlineHTMLToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.InlineHTMLToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3276,7 +3276,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.SemiColonToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3290,10 +3290,10 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[5].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.UnsetToken) - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenParenthesisToken) - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseParenthesisToken) - yyVAL.node.AddComments(yyDollar[5].token.Comments, comment.SemiColonToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.UnsetToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenParenthesisToken) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseParenthesisToken) + addMeta(yyVAL.node, yyDollar[5].token.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3329,10 +3329,10 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[8].node)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ForeachToken) - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenParenthesisToken) - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.AsToken) - yyVAL.node.AddComments(yyDollar[7].token.Comments, comment.CloseParenthesisToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ForeachToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenParenthesisToken) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.AsToken) + addMeta(yyVAL.node, yyDollar[7].token.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3368,10 +3368,10 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[8].node)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ForeachToken) - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenParenthesisToken) - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.AsToken) - yyVAL.node.AddComments(yyDollar[7].token.Comments, comment.CloseParenthesisToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ForeachToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenParenthesisToken) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.AsToken) + addMeta(yyVAL.node, yyDollar[7].token.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3385,9 +3385,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[5].node)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.DeclareToken) - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenParenthesisToken) - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseParenthesisToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.DeclareToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenParenthesisToken) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3401,7 +3401,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.SemiColonToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3419,9 +3419,9 @@ yydefault: } // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.TryToken) - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenCurlyBracesToken) - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.TryToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3435,8 +3435,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ThrowToken) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.SemiColonToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ThrowToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3452,9 +3452,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.GotoToken) - label.AddComments(yyDollar[2].token.Comments, comment.StringToken) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.SemiColonToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.GotoToken) + addMeta(label, yyDollar[2].token.Meta, meta.StringToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3481,12 +3481,12 @@ yydefault: catch.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[8].token)) // save comments - catch.AddComments(yyDollar[1].token.Comments, comment.CatchToken) - catch.AddComments(yyDollar[2].token.Comments, comment.OpenParenthesisToken) - variable.AddComments(yyDollar[4].token.Comments, comment.StringToken) - catch.AddComments(yyDollar[5].token.Comments, comment.CloseParenthesisToken) - catch.AddComments(yyDollar[6].token.Comments, comment.OpenCurlyBracesToken) - catch.AddComments(yyDollar[8].token.Comments, comment.CloseCurlyBracesToken) + addMeta(catch, yyDollar[1].token.Meta, meta.CatchToken) + addMeta(catch, yyDollar[2].token.Meta, meta.OpenParenthesisToken) + addMeta(variable, yyDollar[4].token.Meta, meta.StringToken) + addMeta(catch, yyDollar[5].token.Meta, meta.CloseParenthesisToken) + addMeta(catch, yyDollar[6].token.Meta, meta.OpenCurlyBracesToken) + addMeta(catch, yyDollar[8].token.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3508,9 +3508,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.FinallyToken) - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenCurlyBracesToken) - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.FinallyToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3560,12 +3560,12 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[8].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.CatchToken) - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenParenthesisToken) - variable.AddComments(yyDollar[4].token.Comments, comment.StringToken) - yyVAL.node.AddComments(yyDollar[5].token.Comments, comment.CloseParenthesisToken) - yyVAL.node.AddComments(yyDollar[6].token.Comments, comment.OpenCurlyBracesToken) - yyVAL.node.AddComments(yyDollar[8].token.Comments, comment.CloseCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.CatchToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenParenthesisToken) + addMeta(variable, yyDollar[4].token.Meta, meta.StringToken) + addMeta(yyVAL.node, yyDollar[5].token.Meta, meta.CloseParenthesisToken) + addMeta(yyVAL.node, yyDollar[6].token.Meta, meta.OpenCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[8].token.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3584,7 +3584,7 @@ yydefault: yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) + addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3648,15 +3648,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[9].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.FunctionToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.FunctionToken) if yyDollar[2].token != nil { - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.AmpersandToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.AmpersandToken) } - name.AddComments(yyDollar[3].token.Comments, comment.StringToken) - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.OpenParenthesisToken) - yyVAL.node.AddComments(yyDollar[6].token.Comments, comment.CloseParenthesisToken) - yyVAL.node.AddComments(yyDollar[7].token.Comments, comment.OpenCurlyBracesToken) - yyVAL.node.AddComments(yyDollar[9].token.Comments, comment.CloseCurlyBracesToken) + addMeta(name, yyDollar[3].token.Meta, meta.StringToken) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.OpenParenthesisToken) + addMeta(yyVAL.node, yyDollar[6].token.Meta, meta.CloseParenthesisToken) + addMeta(yyVAL.node, yyDollar[7].token.Meta, meta.OpenCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[9].token.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3684,9 +3684,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[7].token)) // save comments - name.AddComments(yyDollar[2].token.Comments, comment.StringToken) - yyVAL.node.AddComments(yyDollar[5].token.Comments, comment.OpenCurlyBracesToken) - yyVAL.node.AddComments(yyDollar[7].token.Comments, comment.CloseCurlyBracesToken) + addMeta(name, yyDollar[2].token.Meta, meta.StringToken) + addMeta(yyVAL.node, yyDollar[5].token.Meta, meta.OpenCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[7].token.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3702,9 +3702,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[6].token)) // save comments - name.AddComments(yyDollar[2].token.Comments, comment.StringToken) - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.OpenCurlyBracesToken) - yyVAL.node.AddComments(yyDollar[6].token.Comments, comment.CloseCurlyBracesToken) + addMeta(name, yyDollar[2].token.Meta, meta.StringToken) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.OpenCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[6].token.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3718,7 +3718,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ClassToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ClassToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3734,8 +3734,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - classModifier.AddComments(yyDollar[1].token.Comments, comment.AbstractToken) - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.ClassToken) + addMeta(classModifier, yyDollar[1].token.Meta, meta.AbstractToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.ClassToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3749,7 +3749,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.TraitToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.TraitToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3765,8 +3765,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - classModifier.AddComments(yyDollar[1].token.Comments, comment.FinalToken) - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.ClassToken) + addMeta(classModifier, yyDollar[1].token.Meta, meta.FinalToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.ClassToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3788,7 +3788,7 @@ yydefault: yyVAL.ClassExtends.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyVAL.ClassExtends.AddComments(yyDollar[1].token.Comments, comment.ExtendsToken) + addMeta(yyVAL.ClassExtends, yyDollar[1].token.Meta, meta.ExtendsToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3816,7 +3816,7 @@ yydefault: yyVAL.InterfaceExtends.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) // save comments - yyVAL.InterfaceExtends.AddComments(yyDollar[1].token.Comments, comment.ExtendsToken) + addMeta(yyVAL.InterfaceExtends, yyDollar[1].token.Meta, meta.ExtendsToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3838,7 +3838,7 @@ yydefault: yyVAL.ClassImplements.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) // save comments - yyVAL.ClassImplements.AddComments(yyDollar[1].token.Comments, comment.ImplementsToken) + addMeta(yyVAL.ClassImplements, yyDollar[1].token.Meta, meta.ImplementsToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3857,7 +3857,7 @@ yydefault: yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) + addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3876,7 +3876,7 @@ yydefault: yyVAL.node = yyDollar[2].node // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.DoubleArrowToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.DoubleArrowToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3898,7 +3898,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.AmpersandToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.AmpersandToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3912,9 +3912,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ListToken) - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenParenthesisToken) - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseParenthesisToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ListToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenParenthesisToken) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3941,9 +3941,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ColonToken) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.EndforToken) - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.SemiColonToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ColonToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.EndforToken) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3970,9 +3970,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ColonToken) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.EndforeachToken) - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.SemiColonToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ColonToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.EndforeachToken) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3994,9 +3994,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ColonToken) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.EnddeclareToken) - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.SemiColonToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ColonToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.EnddeclareToken) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4013,8 +4013,8 @@ yydefault: constant.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) // save comments - name.AddComments(yyDollar[1].token.Comments, comment.StringToken) - constant.AddComments(yyDollar[2].token.Comments, comment.EqualToken) + addMeta(name, yyDollar[1].token.Meta, meta.StringToken) + addMeta(constant, yyDollar[2].token.Meta, meta.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4031,9 +4031,9 @@ yydefault: constant.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[3].token, yyDollar[5].node)) // save comments - lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) - name.AddComments(yyDollar[3].token.Comments, comment.StringToken) - constant.AddComments(yyDollar[4].token.Comments, comment.EqualToken) + addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) + addMeta(name, yyDollar[3].token.Meta, meta.StringToken) + addMeta(constant, yyDollar[4].token.Meta, meta.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4049,8 +4049,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - caseList.AddComments(yyDollar[1].token.Comments, comment.OpenCurlyBracesToken) - caseList.AddComments(yyDollar[3].token.Comments, comment.CloseCurlyBracesToken) + addMeta(caseList, yyDollar[1].token.Meta, meta.OpenCurlyBracesToken) + addMeta(caseList, yyDollar[3].token.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4066,9 +4066,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - caseList.AddComments(yyDollar[1].token.Comments, comment.OpenCurlyBracesToken) - caseList.AddComments(yyDollar[2].token.Comments, comment.SemiColonToken) - caseList.AddComments(yyDollar[4].token.Comments, comment.CloseCurlyBracesToken) + addMeta(caseList, yyDollar[1].token.Meta, meta.OpenCurlyBracesToken) + addMeta(caseList, yyDollar[2].token.Meta, meta.SemiColonToken) + addMeta(caseList, yyDollar[4].token.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4084,9 +4084,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - caseList.AddComments(yyDollar[1].token.Comments, comment.ColonToken) - caseList.AddComments(yyDollar[3].token.Comments, comment.EndswitchToken) - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.SemiColonToken) + addMeta(caseList, yyDollar[1].token.Meta, meta.ColonToken) + addMeta(caseList, yyDollar[3].token.Meta, meta.EndswitchToken) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4103,10 +4103,10 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[5].token)) // save comments - caseList.AddComments(yyDollar[1].token.Comments, comment.ColonToken) - caseList.AddComments(yyDollar[2].token.Comments, comment.SemiColonToken) - caseList.AddComments(yyDollar[4].token.Comments, comment.EndswitchToken) - yyVAL.node.AddComments(yyDollar[5].token.Comments, comment.SemiColonToken) + addMeta(caseList, yyDollar[1].token.Meta, meta.ColonToken) + addMeta(caseList, yyDollar[2].token.Meta, meta.SemiColonToken) + addMeta(caseList, yyDollar[4].token.Meta, meta.EndswitchToken) + addMeta(yyVAL.node, yyDollar[5].token.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4129,8 +4129,8 @@ yydefault: _case.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[5].list)) // save comments - _case.AddComments(yyDollar[2].token.Comments, comment.CaseToken) - _case.AddComments(yyDollar[4].token.Comments, comment.CaseSeparatorToken) + addMeta(_case, yyDollar[2].token.Meta, meta.CaseToken) + addMeta(_case, yyDollar[4].token.Meta, meta.CaseSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4145,8 +4145,8 @@ yydefault: _default.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[4].list)) // save comments - _default.AddComments(yyDollar[2].token.Comments, comment.DefaultToken) - _default.AddComments(yyDollar[3].token.Comments, comment.CaseSeparatorToken) + addMeta(_default, yyDollar[2].token.Meta, meta.DefaultToken) + addMeta(_default, yyDollar[3].token.Meta, meta.CaseSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4185,9 +4185,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ColonToken) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.EndwhileToken) - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.SemiColonToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ColonToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.EndwhileToken) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4210,7 +4210,7 @@ yydefault: _elseIf.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[2].token, yyDollar[4].node)) // save comments - _elseIf.AddComments(yyDollar[2].token.Comments, comment.ElseifToken) + addMeta(_elseIf, yyDollar[2].token.Meta, meta.ElseifToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4235,8 +4235,8 @@ yydefault: _elseIf.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[5].list)) // save comments - _elseIf.AddComments(yyDollar[2].token.Comments, comment.ElseifToken) - _elseIf.AddComments(yyDollar[4].token.Comments, comment.ColonToken) + addMeta(_elseIf, yyDollar[2].token.Meta, meta.ElseifToken) + addMeta(_elseIf, yyDollar[4].token.Meta, meta.ColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4258,7 +4258,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ElseToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ElseToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4282,8 +4282,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ElseToken) - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.ColonToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ElseToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.ColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4318,7 +4318,7 @@ yydefault: yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) + addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4345,12 +4345,12 @@ yydefault: // save comments if yyDollar[2].token != nil { - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.AmpersandToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.AmpersandToken) } if yyDollar[3].token != nil { - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.EllipsisToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.EllipsisToken) } - variable.AddComments(yyDollar[4].token.Comments, comment.VariableToken) + addMeta(variable, yyDollar[4].token.Meta, meta.VariableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4377,13 +4377,13 @@ yydefault: // save comments if yyDollar[2].token != nil { - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.AmpersandToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.AmpersandToken) } if yyDollar[3].token != nil { - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.EllipsisToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.EllipsisToken) } - variable.AddComments(yyDollar[4].token.Comments, comment.VariableToken) - yyVAL.node.AddComments(yyDollar[5].token.Comments, comment.EqualToken) + addMeta(variable, yyDollar[4].token.Meta, meta.VariableToken) + addMeta(yyVAL.node, yyDollar[5].token.Meta, meta.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4405,7 +4405,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ArrayToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ArrayToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4419,7 +4419,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.CallableToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.CallableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4441,8 +4441,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.OpenParenthesisToken) - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.CloseParenthesisToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.OpenParenthesisToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4456,8 +4456,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.OpenParenthesisToken) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.CloseParenthesisToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.OpenParenthesisToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4473,8 +4473,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.OpenParenthesisToken) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.CloseParenthesisToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.OpenParenthesisToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4493,7 +4493,7 @@ yydefault: yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) + addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4529,7 +4529,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[2].node)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.AmpersandToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.AmpersandToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4543,7 +4543,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.EllipsisToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.EllipsisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4554,7 +4554,7 @@ yydefault: yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) + addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4578,7 +4578,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.VariableToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.VariableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4592,7 +4592,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.DollarToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.DollarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4606,9 +4606,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.DollarToken) - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenCurlyBracesToken) - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.DollarToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4627,8 +4627,8 @@ yydefault: staticVar.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) // save comments - lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) - variable.AddComments(yyDollar[3].token.Comments, comment.VariableToken) + addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) + addMeta(variable, yyDollar[3].token.Meta, meta.VariableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4647,9 +4647,9 @@ yydefault: staticVar.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[3].token, yyDollar[5].node)) // save comments - lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) - variable.AddComments(yyDollar[3].token.Comments, comment.VariableToken) - staticVar.AddComments(yyDollar[4].token.Comments, comment.EqualToken) + addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) + addMeta(variable, yyDollar[3].token.Meta, meta.VariableToken) + addMeta(staticVar, yyDollar[4].token.Meta, meta.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4668,7 +4668,7 @@ yydefault: staticVar.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - variable.AddComments(yyDollar[1].token.Comments, comment.VariableToken) + addMeta(variable, yyDollar[1].token.Meta, meta.VariableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4687,8 +4687,8 @@ yydefault: staticVar.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) // save comments - variable.AddComments(yyDollar[1].token.Comments, comment.VariableToken) - staticVar.AddComments(yyDollar[2].token.Comments, comment.EqualToken) + addMeta(variable, yyDollar[1].token.Meta, meta.VariableToken) + addMeta(staticVar, yyDollar[2].token.Meta, meta.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4718,7 +4718,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition(yyDollar[1].list, yyDollar[3].token)) // save comments - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.SemiColonToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4732,7 +4732,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.SemiColonToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4760,13 +4760,13 @@ yydefault: } // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.FunctionToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.FunctionToken) if yyDollar[3].token != nil { - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.AmpersandToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.AmpersandToken) } - name.AddComments(yyDollar[4].token.Comments, comment.IdentifierToken) - yyVAL.node.AddComments(yyDollar[5].token.Comments, comment.OpenParenthesisToken) - yyVAL.node.AddComments(yyDollar[7].token.Comments, comment.CloseParenthesisToken) + addMeta(name, yyDollar[4].token.Meta, meta.IdentifierToken) + addMeta(yyVAL.node, yyDollar[5].token.Meta, meta.OpenParenthesisToken) + addMeta(yyVAL.node, yyDollar[7].token.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4787,7 +4787,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.UseToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.UseToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4806,7 +4806,7 @@ yydefault: yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) + addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4819,7 +4819,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.SemiColonToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4832,8 +4832,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.OpenCurlyBracesToken) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.CloseCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.OpenCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4876,7 +4876,7 @@ yydefault: yyVAL.node = yyDollar[1].node // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.SemiColonToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4887,7 +4887,7 @@ yydefault: yyVAL.node = yyDollar[1].node // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.SemiColonToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4901,7 +4901,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeNodeListPosition(yyDollar[1].node, yyDollar[3].list)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.InsteadofToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.InsteadofToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4920,7 +4920,7 @@ yydefault: yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) + addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4936,7 +4936,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - name.AddComments(yyDollar[1].token.Comments, comment.IdentifierToken) + addMeta(name, yyDollar[1].token.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4960,8 +4960,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.PaamayimNekudotayimToken) - target.AddComments(yyDollar[3].token.Comments, comment.IdentifierToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.PaamayimNekudotayimToken) + addMeta(target, yyDollar[3].token.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4977,8 +4977,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.AsToken) - alias.AddComments(yyDollar[4].token.Comments, comment.IdentifierToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.AsToken) + addMeta(alias, yyDollar[4].token.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4992,7 +4992,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.AsToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.AsToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5022,7 +5022,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.SemiColonToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5036,8 +5036,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.OpenCurlyBracesToken) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.CloseCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.OpenCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5060,7 +5060,7 @@ yydefault: modifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - modifier.AddComments(yyDollar[1].token.Comments, comment.VarToken) + addMeta(modifier, yyDollar[1].token.Meta, meta.VarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5106,7 +5106,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.PublicToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.PublicToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5120,7 +5120,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ProtectedToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ProtectedToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5134,7 +5134,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.PrivateToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.PrivateToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5148,7 +5148,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.StaticToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.StaticToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5162,7 +5162,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.AbstractToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.AbstractToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5176,7 +5176,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.FinalToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.FinalToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5195,8 +5195,8 @@ yydefault: property.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) // save comments - lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) - variable.AddComments(yyDollar[3].token.Comments, comment.VariableToken) + addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) + addMeta(variable, yyDollar[3].token.Meta, meta.VariableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5215,9 +5215,9 @@ yydefault: property.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[3].token, yyDollar[5].node)) // save comments - lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) - variable.AddComments(yyDollar[3].token.Comments, comment.VariableToken) - property.AddComments(yyDollar[4].token.Comments, comment.EqualToken) + addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) + addMeta(variable, yyDollar[3].token.Meta, meta.VariableToken) + addMeta(property, yyDollar[4].token.Meta, meta.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5236,7 +5236,7 @@ yydefault: property.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - variable.AddComments(yyDollar[1].token.Comments, comment.VariableToken) + addMeta(variable, yyDollar[1].token.Meta, meta.VariableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5255,8 +5255,8 @@ yydefault: property.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) // save comments - variable.AddComments(yyDollar[1].token.Comments, comment.VariableToken) - property.AddComments(yyDollar[2].token.Comments, comment.EqualToken) + addMeta(variable, yyDollar[1].token.Meta, meta.VariableToken) + addMeta(property, yyDollar[2].token.Meta, meta.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5276,9 +5276,9 @@ yydefault: yyDollar[1].node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[5].node)) // save comments - lastNode(constList.Consts).AddComments(yyDollar[2].token.Comments, comment.CommaToken) - name.AddComments(yyDollar[3].token.Comments, comment.IdentifierToken) - constant.AddComments(yyDollar[4].token.Comments, comment.EqualToken) + addMeta(lastNode(constList.Consts), yyDollar[2].token.Meta, meta.CommaToken) + addMeta(name, yyDollar[3].token.Meta, meta.IdentifierToken) + addMeta(constant, yyDollar[4].token.Meta, meta.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5296,9 +5296,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[4].node)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ConstToken) - name.AddComments(yyDollar[2].token.Comments, comment.IdentifierToken) - constant.AddComments(yyDollar[3].token.Comments, comment.EqualToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ConstToken) + addMeta(name, yyDollar[2].token.Meta, meta.IdentifierToken) + addMeta(constant, yyDollar[3].token.Meta, meta.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5309,7 +5309,7 @@ yydefault: yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) + addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5344,7 +5344,7 @@ yydefault: yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) + addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5383,8 +5383,8 @@ yydefault: fetch.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) // save comments - fetch.AddComments(yyDollar[2].token.Comments, comment.OpenSquareBracket) - fetch.AddComments(yyDollar[4].token.Comments, comment.CloseSquareBracket) + addMeta(fetch, yyDollar[2].token.Meta, meta.OpenSquareBracket) + addMeta(fetch, yyDollar[4].token.Meta, meta.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5399,8 +5399,8 @@ yydefault: fetch.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[2].node)) // save comments - fetch.AddComments(yyDollar[1].token.Comments, comment.OpenSquareBracket) - fetch.AddComments(yyDollar[3].token.Comments, comment.CloseSquareBracket) + addMeta(fetch, yyDollar[1].token.Meta, meta.OpenSquareBracket) + addMeta(fetch, yyDollar[3].token.Meta, meta.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5458,7 +5458,7 @@ yydefault: } // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.NewToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.NewToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5474,10 +5474,10 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[6].node)) // save comments - list.AddComments(yyDollar[1].token.Comments, comment.ListToken) - list.AddComments(yyDollar[2].token.Comments, comment.OpenParenthesisToken) - list.AddComments(yyDollar[4].token.Comments, comment.CloseParenthesisToken) - yyVAL.node.AddComments(yyDollar[5].token.Comments, comment.EqualToken) + addMeta(list, yyDollar[1].token.Meta, meta.ListToken) + addMeta(list, yyDollar[2].token.Meta, meta.OpenParenthesisToken) + addMeta(list, yyDollar[4].token.Meta, meta.CloseParenthesisToken) + addMeta(yyVAL.node, yyDollar[5].token.Meta, meta.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5491,7 +5491,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.EqualToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5505,8 +5505,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.EqualToken) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.AmpersandToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.EqualToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.AmpersandToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5532,9 +5532,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, _new)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.EqualToken) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.AmpersandToken) - _new.AddComments(yyDollar[4].token.Comments, comment.NewToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.EqualToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.AmpersandToken) + addMeta(_new, yyDollar[4].token.Meta, meta.NewToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5548,7 +5548,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.CloneToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.CloneToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5562,7 +5562,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.PlusEqualToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.PlusEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5576,7 +5576,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.MinusEqualToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.MinusEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5590,7 +5590,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.MulEqualToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.MulEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5604,7 +5604,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.PowEqualToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.PowEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5618,7 +5618,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.DivEqualToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.DivEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5632,7 +5632,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.ConcatEqualToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.ConcatEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5646,7 +5646,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.ModEqualToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.ModEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5660,7 +5660,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.AndEqualToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.AndEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5674,7 +5674,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OrEqualToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OrEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5688,7 +5688,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.XorEqualToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.XorEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5702,7 +5702,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.SlEqualToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.SlEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5716,7 +5716,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.SrEqualToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.SrEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5730,7 +5730,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.IncToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.IncToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5744,7 +5744,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.IncToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.IncToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5758,7 +5758,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.DecToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.DecToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5772,7 +5772,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.DecToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.DecToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5786,7 +5786,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.BooleanOrToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.BooleanOrToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5800,7 +5800,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.BooleanAndToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.BooleanAndToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5814,7 +5814,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.LogicalOrToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.LogicalOrToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5828,7 +5828,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.LogicalAndToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.LogicalAndToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5842,7 +5842,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.LogicalXorToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.LogicalXorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5856,7 +5856,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.VerticalBarToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.VerticalBarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5870,7 +5870,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.AmpersandToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.AmpersandToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5884,7 +5884,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.CaretToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.CaretToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5898,7 +5898,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.DotToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.DotToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5912,7 +5912,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.PlusToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.PlusToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5926,7 +5926,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.MinusToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.MinusToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5940,7 +5940,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.AsteriskToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.AsteriskToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5954,7 +5954,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.PowToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.PowToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5968,7 +5968,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.SlashToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.SlashToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5982,7 +5982,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.PercentToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.PercentToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5996,7 +5996,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.SlToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.SlToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6010,7 +6010,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.SrToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.SrToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6024,7 +6024,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.PlusToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.PlusToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6038,7 +6038,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.MinusToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.MinusToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6052,7 +6052,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ExclamationMarkToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ExclamationMarkToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6066,7 +6066,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.TildeToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.TildeToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6080,7 +6080,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.IsIdenticalToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.IsIdenticalToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6094,7 +6094,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.IsNotIdenticalToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.IsNotIdenticalToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6108,7 +6108,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.IsEqualToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.IsEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6122,7 +6122,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.IsNotEqualToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.IsNotEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6136,7 +6136,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.LessToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.LessToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6150,7 +6150,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.IsSmallerOrEqualToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.IsSmallerOrEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6164,7 +6164,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.GreaterToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.GreaterToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6178,7 +6178,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.IsGreaterOrEqualToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.IsGreaterOrEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6192,7 +6192,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.InstanceofToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.InstanceofToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6238,8 +6238,8 @@ yydefault: } // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.OpenParenthesisToken) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.CloseParenthesisToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.OpenParenthesisToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6253,8 +6253,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[5].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.QuestionMarkToken) - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.ColonToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.QuestionMarkToken) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.ColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6268,8 +6268,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.QuestionMarkToken) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.ColonToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.QuestionMarkToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.ColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6291,7 +6291,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.IntCastToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.IntCastToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6305,7 +6305,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.DoubleCastToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.DoubleCastToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6319,7 +6319,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.StringCastToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.StringCastToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6333,7 +6333,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ArrayCastToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ArrayCastToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6347,7 +6347,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ObjectCastToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ObjectCastToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6361,7 +6361,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.BoolCastToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.BoolCastToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6375,7 +6375,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.UnsetCastToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.UnsetCastToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6405,17 +6405,13 @@ yydefault: } // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ExitToken) - - if yyDollar[2].node != nil { - yylex.(*Parser).comments.AddFromChildNode(yyVAL.node, yyDollar[2].node) - } + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ExitToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 297: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4063 + //line php5/php5.y:4059 { yyVAL.node = expr.NewErrorSuppress(yyDollar[2].node) @@ -6423,13 +6419,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.AtToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.AtToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 298: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4075 + //line php5/php5.y:4071 { yyVAL.node = yyDollar[1].node @@ -6437,7 +6433,7 @@ yydefault: } case 299: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4081 + //line php5/php5.y:4077 { yyVAL.node = yyDollar[1].node @@ -6445,7 +6441,7 @@ yydefault: } case 300: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4087 + //line php5/php5.y:4083 { yyVAL.node = yyDollar[1].node @@ -6453,7 +6449,7 @@ yydefault: } case 301: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4093 + //line php5/php5.y:4089 { yyVAL.node = expr.NewShellExec(yyDollar[2].list) @@ -6461,14 +6457,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.BackquoteToken) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.BackquoteToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.BackquoteToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.BackquoteToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 302: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4106 + //line php5/php5.y:4102 { yyVAL.node = expr.NewPrint(yyDollar[2].node) @@ -6476,13 +6472,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.PrintToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.PrintToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 303: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4118 + //line php5/php5.y:4114 { yyVAL.node = expr.NewYield(nil, nil) @@ -6490,13 +6486,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.YieldToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.YieldToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 304: yyDollar = yyS[yypt-9 : yypt+1] - //line php5/php5.y:4130 + //line php5/php5.y:4126 { yyVAL.node = expr.NewClosure(yyDollar[4].list, yyDollar[6].ClosureUse, nil, yyDollar[8].list, false, yyDollar[2].token != nil, "") @@ -6504,20 +6500,20 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[9].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.FunctionToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.FunctionToken) if yyDollar[2].token != nil { - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.AmpersandToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.AmpersandToken) } - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.OpenParenthesisToken) - yyVAL.node.AddComments(yyDollar[5].token.Comments, comment.CloseParenthesisToken) - yyVAL.node.AddComments(yyDollar[7].token.Comments, comment.OpenCurlyBracesToken) - yyVAL.node.AddComments(yyDollar[9].token.Comments, comment.CloseCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.OpenParenthesisToken) + addMeta(yyVAL.node, yyDollar[5].token.Meta, meta.CloseParenthesisToken) + addMeta(yyVAL.node, yyDollar[7].token.Meta, meta.OpenCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[9].token.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 305: yyDollar = yyS[yypt-10 : yypt+1] - //line php5/php5.y:4149 + //line php5/php5.y:4145 { yyVAL.node = expr.NewClosure(yyDollar[5].list, yyDollar[7].ClosureUse, nil, yyDollar[9].list, true, yyDollar[3].token != nil, "") @@ -6525,21 +6521,21 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[10].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.StaticToken) - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.FunctionToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.StaticToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.FunctionToken) if yyDollar[3].token != nil { - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.AmpersandToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.AmpersandToken) } - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.OpenParenthesisToken) - yyVAL.node.AddComments(yyDollar[6].token.Comments, comment.CloseParenthesisToken) - yyVAL.node.AddComments(yyDollar[8].token.Comments, comment.OpenCurlyBracesToken) - yyVAL.node.AddComments(yyDollar[10].token.Comments, comment.CloseCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.OpenParenthesisToken) + addMeta(yyVAL.node, yyDollar[6].token.Meta, meta.CloseParenthesisToken) + addMeta(yyVAL.node, yyDollar[8].token.Meta, meta.OpenCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[10].token.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 306: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4172 + //line php5/php5.y:4168 { yyVAL.node = expr.NewYield(nil, yyDollar[2].node) @@ -6547,13 +6543,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.YieldToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.YieldToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 307: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4184 + //line php5/php5.y:4180 { yyVAL.node = expr.NewYield(nil, yyDollar[2].node) @@ -6561,13 +6557,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.YieldToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.YieldToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 308: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4196 + //line php5/php5.y:4192 { yyVAL.node = expr.NewYield(yyDollar[2].node, yyDollar[4].node) @@ -6575,14 +6571,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[4].node)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.YieldToken) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.DoubleArrowToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.YieldToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.DoubleArrowToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 309: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4209 + //line php5/php5.y:4205 { yyVAL.node = expr.NewYield(yyDollar[2].node, yyDollar[4].node) @@ -6590,14 +6586,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[4].node)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.YieldToken) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.DoubleArrowToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.YieldToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.DoubleArrowToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 310: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4225 + //line php5/php5.y:4221 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -6605,14 +6601,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenSquareBracket) - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseSquareBracket) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenSquareBracket) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 311: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4238 + //line php5/php5.y:4234 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -6620,14 +6616,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenSquareBracket) - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseSquareBracket) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenSquareBracket) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 312: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4251 + //line php5/php5.y:4247 { str := scalar.NewString(yyDollar[1].token.Value) yyVAL.node = expr.NewArrayDimFetch(str, yyDollar[3].node) @@ -6637,14 +6633,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(str, yyDollar[4].token)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenSquareBracket) - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseSquareBracket) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenSquareBracket) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 313: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4266 + //line php5/php5.y:4262 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -6652,14 +6648,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenSquareBracket) - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseSquareBracket) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenSquareBracket) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 314: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4282 + //line php5/php5.y:4278 { yyVAL.node = expr.NewArray(yyDollar[3].list) @@ -6667,15 +6663,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ArrayToken) - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenParenthesisToken) - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseParenthesisToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ArrayToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenParenthesisToken) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 315: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4296 + //line php5/php5.y:4292 { yyVAL.node = expr.NewShortArray(yyDollar[2].list) @@ -6683,20 +6679,20 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.OpenSquareBracket) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.CloseSquareBracket) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.OpenSquareBracket) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 316: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4312 + //line php5/php5.y:4308 { yyVAL.token = yyDollar[1].token } case 317: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:4319 + //line php5/php5.y:4315 { yyVAL.ClosureUse = nil @@ -6704,7 +6700,7 @@ yydefault: } case 318: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4325 + //line php5/php5.y:4321 { yyVAL.ClosureUse = expr.NewClosureUse(yyDollar[3].list) @@ -6714,7 +6710,7 @@ yydefault: } case 319: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4336 + //line php5/php5.y:4332 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[3].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -6725,14 +6721,14 @@ yydefault: variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) // save comments - lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) - variable.AddComments(yyDollar[3].token.Comments, comment.VariableToken) + addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) + addMeta(variable, yyDollar[3].token.Meta, meta.VariableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 320: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4352 + //line php5/php5.y:4348 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[4].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -6745,15 +6741,15 @@ yydefault: reference.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[3].token, yyDollar[4].token)) // save comments - lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) - reference.AddComments(yyDollar[3].token.Comments, comment.VariableToken) - variable.AddComments(yyDollar[4].token.Comments, comment.VariableToken) + addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) + addMeta(reference, yyDollar[3].token.Meta, meta.VariableToken) + addMeta(variable, yyDollar[4].token.Meta, meta.VariableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 321: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4371 + //line php5/php5.y:4367 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -6764,13 +6760,13 @@ yydefault: variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - variable.AddComments(yyDollar[1].token.Comments, comment.VariableToken) + addMeta(variable, yyDollar[1].token.Meta, meta.VariableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 322: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4386 + //line php5/php5.y:4382 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[2].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -6783,14 +6779,14 @@ yydefault: reference.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - reference.AddComments(yyDollar[1].token.Comments, comment.VariableToken) - variable.AddComments(yyDollar[2].token.Comments, comment.VariableToken) + addMeta(reference, yyDollar[1].token.Meta, meta.VariableToken) + addMeta(variable, yyDollar[2].token.Meta, meta.VariableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 323: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4407 + //line php5/php5.y:4403 { name := name.NewName(yyDollar[1].list) yyVAL.node = expr.NewFunctionCall(name, yyDollar[2].node.(*node.ArgumentList)) @@ -6803,7 +6799,7 @@ yydefault: } case 324: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4418 + //line php5/php5.y:4414 { funcName := name.NewRelative(yyDollar[3].list) yyVAL.node = expr.NewFunctionCall(funcName, yyDollar[4].node.(*node.ArgumentList)) @@ -6813,14 +6809,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(funcName, yyDollar[4].node)) // save comments - funcName.AddComments(yyDollar[1].token.Comments, comment.NamespaceToken) - funcName.AddComments(yyDollar[2].token.Comments, comment.NsSeparatorToken) + addMeta(funcName, yyDollar[1].token.Meta, meta.NamespaceToken) + addMeta(funcName, yyDollar[2].token.Meta, meta.NsSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 325: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4433 + //line php5/php5.y:4429 { funcName := name.NewFullyQualified(yyDollar[2].list) yyVAL.node = expr.NewFunctionCall(funcName, yyDollar[3].node.(*node.ArgumentList)) @@ -6830,13 +6826,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(funcName, yyDollar[3].node)) // save comments - funcName.AddComments(yyDollar[1].token.Comments, comment.NsSeparatorToken) + addMeta(funcName, yyDollar[1].token.Meta, meta.NsSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 326: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4447 + //line php5/php5.y:4443 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -6844,13 +6840,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.PaamayimNekudotayimToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.PaamayimNekudotayimToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 327: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4459 + //line php5/php5.y:4455 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -6858,13 +6854,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.PaamayimNekudotayimToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.PaamayimNekudotayimToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 328: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4471 + //line php5/php5.y:4467 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -6872,13 +6868,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.PaamayimNekudotayimToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.PaamayimNekudotayimToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 329: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4483 + //line php5/php5.y:4479 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -6886,13 +6882,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.PaamayimNekudotayimToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.PaamayimNekudotayimToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 330: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4495 + //line php5/php5.y:4491 { yyVAL.node = expr.NewFunctionCall(yyDollar[1].node, yyDollar[2].node.(*node.ArgumentList)) @@ -6903,7 +6899,7 @@ yydefault: } case 331: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4507 + //line php5/php5.y:4503 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -6911,13 +6907,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.StaticToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.StaticToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 332: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4519 + //line php5/php5.y:4515 { yyVAL.node = name.NewName(yyDollar[1].list) @@ -6928,7 +6924,7 @@ yydefault: } case 333: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4528 + //line php5/php5.y:4524 { yyVAL.node = name.NewRelative(yyDollar[3].list) @@ -6936,14 +6932,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.NamespaceToken) - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.NsSeparatorToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.NamespaceToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.NsSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 334: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4541 + //line php5/php5.y:4537 { yyVAL.node = name.NewFullyQualified(yyDollar[2].list) @@ -6951,13 +6947,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.NsSeparatorToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.NsSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 335: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4556 + //line php5/php5.y:4552 { yyVAL.node = name.NewName(yyDollar[1].list) @@ -6968,7 +6964,7 @@ yydefault: } case 336: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4565 + //line php5/php5.y:4561 { yyVAL.node = name.NewRelative(yyDollar[3].list) @@ -6976,14 +6972,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.NamespaceToken) - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.NsSeparatorToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.NamespaceToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.NsSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 337: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4578 + //line php5/php5.y:4574 { yyVAL.node = name.NewFullyQualified(yyDollar[2].list) @@ -6991,13 +6987,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.NsSeparatorToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.NsSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 338: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4593 + //line php5/php5.y:4589 { yyVAL.node = yyDollar[1].node @@ -7005,7 +7001,7 @@ yydefault: } case 339: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4599 + //line php5/php5.y:4595 { yyVAL.node = yyDollar[1].node @@ -7013,12 +7009,12 @@ yydefault: } case 340: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4608 + //line php5/php5.y:4604 { yyVAL.node = yyDollar[1].node // save comments - yyDollar[3].list[0].AddComments(yyDollar[2].token.Comments, comment.ObjectOperatorToken) + addMeta(yyDollar[3].list[0], yyDollar[2].token.Meta, meta.ObjectOperatorToken) for _, n := range yyDollar[3].list { switch nn := n.(type) { @@ -7052,7 +7048,7 @@ yydefault: } case 341: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4645 + //line php5/php5.y:4641 { yyVAL.node = yyDollar[1].node @@ -7060,7 +7056,7 @@ yydefault: } case 342: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4655 + //line php5/php5.y:4651 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) @@ -7068,7 +7064,7 @@ yydefault: } case 343: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:4661 + //line php5/php5.y:4657 { yyVAL.list = []node.Node{} @@ -7076,18 +7072,18 @@ yydefault: } case 344: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4671 + //line php5/php5.y:4667 { yyVAL.list = yyDollar[2].list // save comments - yyDollar[2].list[0].AddComments(yyDollar[1].token.Comments, comment.ObjectOperatorToken) + addMeta(yyDollar[2].list[0], yyDollar[1].token.Meta, meta.ObjectOperatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 345: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:4683 + //line php5/php5.y:4679 { yyVAL.node = nil @@ -7095,7 +7091,7 @@ yydefault: } case 346: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4689 + //line php5/php5.y:4685 { yyVAL.node = expr.NewExit(nil) @@ -7103,14 +7099,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.OpenParenthesisToken) - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.CloseParenthesisToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.OpenParenthesisToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 347: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4702 + //line php5/php5.y:4698 { yyVAL.node = expr.NewExit(yyDollar[1].node) @@ -7121,7 +7117,7 @@ yydefault: } case 348: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:4714 + //line php5/php5.y:4710 { yyVAL.list = []node.Node{} @@ -7129,7 +7125,7 @@ yydefault: } case 349: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4720 + //line php5/php5.y:4716 { yyVAL.list = []node.Node{scalar.NewEncapsedStringPart(yyDollar[1].token.Value)} @@ -7137,7 +7133,7 @@ yydefault: } case 350: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4726 + //line php5/php5.y:4722 { yyVAL.list = yyDollar[1].list @@ -7145,7 +7141,7 @@ yydefault: } case 351: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:4735 + //line php5/php5.y:4731 { yyVAL.node = nil @@ -7153,7 +7149,7 @@ yydefault: } case 352: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4741 + //line php5/php5.y:4737 { yyVAL.node = yyDollar[1].node @@ -7161,7 +7157,7 @@ yydefault: } case 353: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4750 + //line php5/php5.y:4746 { yyVAL.node = scalar.NewLnumber(yyDollar[1].token.Value) @@ -7169,13 +7165,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.LnumberToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.LnumberToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 354: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4762 + //line php5/php5.y:4758 { yyVAL.node = scalar.NewDnumber(yyDollar[1].token.Value) @@ -7183,13 +7179,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.DnumberToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.DnumberToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 355: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4774 + //line php5/php5.y:4770 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) @@ -7197,13 +7193,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ConstantEncapsedStringToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ConstantEncapsedStringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 356: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4786 + //line php5/php5.y:4782 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7211,13 +7207,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.LineToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.LineToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 357: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4798 + //line php5/php5.y:4794 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7225,13 +7221,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.FileToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.FileToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 358: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4810 + //line php5/php5.y:4806 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7239,13 +7235,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.DirToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.DirToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 359: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4822 + //line php5/php5.y:4818 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7253,13 +7249,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.TraitCToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.TraitCToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 360: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4834 + //line php5/php5.y:4830 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7267,13 +7263,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.MethodCToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.MethodCToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 361: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4846 + //line php5/php5.y:4842 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7281,13 +7277,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.FuncCToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.FuncCToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 362: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4858 + //line php5/php5.y:4854 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7295,13 +7291,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.NsCToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.NsCToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 363: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4870 + //line php5/php5.y:4866 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, []node.Node{encapsed}) @@ -7311,13 +7307,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.StartHeredocToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.StartHeredocToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 364: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4884 + //line php5/php5.y:4880 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, nil) @@ -7325,13 +7321,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.StartHeredocToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.StartHeredocToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 365: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4899 + //line php5/php5.y:4895 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -7341,14 +7337,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.PaamayimNekudotayimToken) - target.AddComments(yyDollar[3].token.Comments, comment.IdentifierToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.PaamayimNekudotayimToken) + addMeta(target, yyDollar[3].token.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 366: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4917 + //line php5/php5.y:4913 { yyVAL.node = yyDollar[1].node @@ -7356,7 +7352,7 @@ yydefault: } case 367: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4926 + //line php5/php5.y:4922 { yyVAL.node = yyDollar[1].node @@ -7364,7 +7360,7 @@ yydefault: } case 368: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4932 + //line php5/php5.y:4928 { yyVAL.node = yyDollar[1].node @@ -7372,7 +7368,7 @@ yydefault: } case 369: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4938 + //line php5/php5.y:4934 { name := name.NewName(yyDollar[1].list) yyVAL.node = expr.NewConstFetch(name) @@ -7385,7 +7381,7 @@ yydefault: } case 370: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4949 + //line php5/php5.y:4945 { name := name.NewRelative(yyDollar[3].list) yyVAL.node = expr.NewConstFetch(name) @@ -7395,14 +7391,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.NamespaceToken) - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.NsSeparatorToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.NamespaceToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.NsSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 371: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4964 + //line php5/php5.y:4960 { name := name.NewFullyQualified(yyDollar[2].list) yyVAL.node = expr.NewConstFetch(name) @@ -7412,13 +7408,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.NsSeparatorToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.NsSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 372: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4978 + //line php5/php5.y:4974 { yyVAL.node = expr.NewArray(yyDollar[3].list) @@ -7426,15 +7422,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ArrayToken) - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenParenthesisToken) - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseParenthesisToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ArrayToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenParenthesisToken) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 373: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4992 + //line php5/php5.y:4988 { yyVAL.node = expr.NewShortArray(yyDollar[2].list) @@ -7442,14 +7438,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.OpenSquareBracket) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.CloseSquareBracket) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.OpenSquareBracket) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 374: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5005 + //line php5/php5.y:5001 { yyVAL.node = yyDollar[1].node @@ -7457,7 +7453,7 @@ yydefault: } case 375: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5011 + //line php5/php5.y:5007 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7465,13 +7461,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ClassCToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ClassCToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 376: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5023 + //line php5/php5.y:5019 { yyVAL.node = yyDollar[1].node @@ -7479,7 +7475,7 @@ yydefault: } case 377: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:5032 + //line php5/php5.y:5028 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -7487,14 +7483,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenSquareBracket) - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseSquareBracket) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenSquareBracket) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 378: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5045 + //line php5/php5.y:5041 { yyVAL.node = binary.NewPlus(yyDollar[1].node, yyDollar[3].node) @@ -7502,13 +7498,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.PlusToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.PlusToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 379: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5057 + //line php5/php5.y:5053 { yyVAL.node = binary.NewMinus(yyDollar[1].node, yyDollar[3].node) @@ -7516,13 +7512,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.MinusToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.MinusToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 380: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5069 + //line php5/php5.y:5065 { yyVAL.node = binary.NewMul(yyDollar[1].node, yyDollar[3].node) @@ -7530,13 +7526,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.AsteriskToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.AsteriskToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 381: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5081 + //line php5/php5.y:5077 { yyVAL.node = binary.NewPow(yyDollar[1].node, yyDollar[3].node) @@ -7544,13 +7540,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.PowToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.PowToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 382: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5093 + //line php5/php5.y:5089 { yyVAL.node = binary.NewDiv(yyDollar[1].node, yyDollar[3].node) @@ -7558,13 +7554,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.SlashToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.SlashToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 383: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5105 + //line php5/php5.y:5101 { yyVAL.node = binary.NewMod(yyDollar[1].node, yyDollar[3].node) @@ -7572,13 +7568,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.PercentToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.PercentToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 384: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5117 + //line php5/php5.y:5113 { yyVAL.node = expr.NewBooleanNot(yyDollar[2].node) @@ -7586,13 +7582,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ExclamationMarkToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ExclamationMarkToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 385: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5129 + //line php5/php5.y:5125 { yyVAL.node = expr.NewBitwiseNot(yyDollar[2].node) @@ -7600,13 +7596,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.TildeToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.TildeToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 386: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5141 + //line php5/php5.y:5137 { yyVAL.node = binary.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) @@ -7614,13 +7610,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.VerticalBarToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.VerticalBarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 387: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5153 + //line php5/php5.y:5149 { yyVAL.node = binary.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) @@ -7628,13 +7624,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.AmpersandToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.AmpersandToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 388: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5165 + //line php5/php5.y:5161 { yyVAL.node = binary.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) @@ -7642,13 +7638,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.CaretToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.CaretToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 389: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5177 + //line php5/php5.y:5173 { yyVAL.node = binary.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) @@ -7656,13 +7652,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.SlToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.SlToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 390: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5189 + //line php5/php5.y:5185 { yyVAL.node = binary.NewShiftRight(yyDollar[1].node, yyDollar[3].node) @@ -7670,13 +7666,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.SrToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.SrToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 391: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5201 + //line php5/php5.y:5197 { yyVAL.node = binary.NewConcat(yyDollar[1].node, yyDollar[3].node) @@ -7684,13 +7680,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.DotToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.DotToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 392: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5213 + //line php5/php5.y:5209 { yyVAL.node = binary.NewLogicalXor(yyDollar[1].node, yyDollar[3].node) @@ -7698,13 +7694,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.LogicalXorToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.LogicalXorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 393: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5225 + //line php5/php5.y:5221 { yyVAL.node = binary.NewLogicalAnd(yyDollar[1].node, yyDollar[3].node) @@ -7712,13 +7708,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.LogicalAndToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.LogicalAndToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 394: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5237 + //line php5/php5.y:5233 { yyVAL.node = binary.NewLogicalOr(yyDollar[1].node, yyDollar[3].node) @@ -7726,13 +7722,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.LogicalOrToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.LogicalOrToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 395: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5249 + //line php5/php5.y:5245 { yyVAL.node = binary.NewBooleanAnd(yyDollar[1].node, yyDollar[3].node) @@ -7740,13 +7736,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.BooleanAndToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.BooleanAndToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 396: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5261 + //line php5/php5.y:5257 { yyVAL.node = binary.NewBooleanOr(yyDollar[1].node, yyDollar[3].node) @@ -7754,13 +7750,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.BooleanOrToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.BooleanOrToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 397: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5273 + //line php5/php5.y:5269 { yyVAL.node = binary.NewIdentical(yyDollar[1].node, yyDollar[3].node) @@ -7768,13 +7764,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.IsIdenticalToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.IsIdenticalToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 398: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5285 + //line php5/php5.y:5281 { yyVAL.node = binary.NewNotIdentical(yyDollar[1].node, yyDollar[3].node) @@ -7782,13 +7778,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.IsNotIdenticalToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.IsNotIdenticalToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 399: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5297 + //line php5/php5.y:5293 { yyVAL.node = binary.NewEqual(yyDollar[1].node, yyDollar[3].node) @@ -7796,13 +7792,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.IsEqualToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.IsEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 400: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5309 + //line php5/php5.y:5305 { yyVAL.node = binary.NewNotEqual(yyDollar[1].node, yyDollar[3].node) @@ -7810,13 +7806,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.IsNotEqualToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.IsNotEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 401: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5321 + //line php5/php5.y:5317 { yyVAL.node = binary.NewSmaller(yyDollar[1].node, yyDollar[3].node) @@ -7824,13 +7820,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.LessToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.LessToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 402: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5333 + //line php5/php5.y:5329 { yyVAL.node = binary.NewGreater(yyDollar[1].node, yyDollar[3].node) @@ -7838,13 +7834,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.GreaterToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.GreaterToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 403: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5345 + //line php5/php5.y:5341 { yyVAL.node = binary.NewSmallerOrEqual(yyDollar[1].node, yyDollar[3].node) @@ -7852,13 +7848,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.IsSmallerOrEqualToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.IsSmallerOrEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 404: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5357 + //line php5/php5.y:5353 { yyVAL.node = binary.NewGreaterOrEqual(yyDollar[1].node, yyDollar[3].node) @@ -7866,13 +7862,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.IsGreaterOrEqualToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.IsGreaterOrEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 405: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:5369 + //line php5/php5.y:5365 { yyVAL.node = expr.NewTernary(yyDollar[1].node, nil, yyDollar[4].node) @@ -7880,14 +7876,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.QuestionMarkToken) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.ColonToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.QuestionMarkToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.ColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 406: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:5382 + //line php5/php5.y:5378 { yyVAL.node = expr.NewTernary(yyDollar[1].node, yyDollar[3].node, yyDollar[5].node) @@ -7895,14 +7891,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[5].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.QuestionMarkToken) - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.ColonToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.QuestionMarkToken) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.ColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 407: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5395 + //line php5/php5.y:5391 { yyVAL.node = expr.NewUnaryPlus(yyDollar[2].node) @@ -7910,13 +7906,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.PlusToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.PlusToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 408: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5407 + //line php5/php5.y:5403 { yyVAL.node = expr.NewUnaryMinus(yyDollar[2].node) @@ -7924,25 +7920,25 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.MinusToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.MinusToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 409: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5419 + //line php5/php5.y:5415 { yyVAL.node = yyDollar[2].node // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.OpenParenthesisToken) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.CloseParenthesisToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.OpenParenthesisToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 410: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5432 + //line php5/php5.y:5428 { yyVAL.node = yyDollar[1].node @@ -7950,7 +7946,7 @@ yydefault: } case 411: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5438 + //line php5/php5.y:5434 { name := name.NewName(yyDollar[1].list) yyVAL.node = expr.NewConstFetch(name) @@ -7963,7 +7959,7 @@ yydefault: } case 412: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5449 + //line php5/php5.y:5445 { name := name.NewRelative(yyDollar[3].list) yyVAL.node = expr.NewConstFetch(name) @@ -7971,14 +7967,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(name)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.NamespaceToken) - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.NsSeparatorToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.NamespaceToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.NsSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 413: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5462 + //line php5/php5.y:5458 { name := name.NewFullyQualified(yyDollar[2].list) yyVAL.node = expr.NewConstFetch(name) @@ -7988,13 +7984,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(name)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.NsSeparatorToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.NsSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 414: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5479 + //line php5/php5.y:5475 { name := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = expr.NewVariable(name) @@ -8004,13 +8000,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - name.AddComments(yyDollar[1].token.Comments, comment.StringVarnameToken) + addMeta(name, yyDollar[1].token.Meta, meta.StringVarnameToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 415: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5493 + //line php5/php5.y:5489 { yyVAL.node = yyDollar[1].node @@ -8018,7 +8014,7 @@ yydefault: } case 416: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5499 + //line php5/php5.y:5495 { yyVAL.node = yyDollar[1].node @@ -8026,7 +8022,7 @@ yydefault: } case 417: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5505 + //line php5/php5.y:5501 { yyVAL.node = yyDollar[1].node @@ -8034,7 +8030,7 @@ yydefault: } case 418: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5511 + //line php5/php5.y:5507 { yyVAL.node = scalar.NewEncapsed(yyDollar[2].list) @@ -8042,13 +8038,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.DoubleQuoteToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.DoubleQuoteToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 419: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5523 + //line php5/php5.y:5519 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, yyDollar[2].list) @@ -8056,13 +8052,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.StartHeredocToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.StartHeredocToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 420: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5535 + //line php5/php5.y:5531 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -8070,13 +8066,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ClassCToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ClassCToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 421: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:5550 + //line php5/php5.y:5546 { yyVAL.list = nil @@ -8084,32 +8080,32 @@ yydefault: } case 422: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5556 + //line php5/php5.y:5552 { yyVAL.list = yyDollar[1].list // save comments if yyDollar[2].token != nil { - lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) + addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 423: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:5570 + //line php5/php5.y:5566 { yyVAL.token = nil } case 424: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5574 + //line php5/php5.y:5570 { yyVAL.token = yyDollar[1].token } case 425: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:5581 + //line php5/php5.y:5577 { arrayItem := expr.NewArrayItem(yyDollar[3].node, yyDollar[5].node) yyVAL.list = append(yyDollar[1].list, arrayItem) @@ -8118,14 +8114,14 @@ yydefault: arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[3].node, yyDollar[5].node)) // save comments - lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) - arrayItem.AddComments(yyDollar[4].token.Comments, comment.DoubleArrowToken) + addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) + addMeta(arrayItem, yyDollar[4].token.Meta, meta.DoubleArrowToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 426: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5595 + //line php5/php5.y:5591 { arrayItem := expr.NewArrayItem(nil, yyDollar[3].node) yyVAL.list = append(yyDollar[1].list, arrayItem) @@ -8134,13 +8130,13 @@ yydefault: arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) // save comments - lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) + addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 427: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5608 + //line php5/php5.y:5604 { arrayItem := expr.NewArrayItem(yyDollar[1].node, yyDollar[3].node) yyVAL.list = []node.Node{arrayItem} @@ -8149,13 +8145,13 @@ yydefault: arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - arrayItem.AddComments(yyDollar[2].token.Comments, comment.DoubleArrowToken) + addMeta(arrayItem, yyDollar[2].token.Meta, meta.DoubleArrowToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 428: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5621 + //line php5/php5.y:5617 { arrayItem := expr.NewArrayItem(nil, yyDollar[1].node) yyVAL.list = []node.Node{arrayItem} @@ -8167,7 +8163,7 @@ yydefault: } case 429: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5634 + //line php5/php5.y:5630 { yyVAL.node = yyDollar[1].node @@ -8175,7 +8171,7 @@ yydefault: } case 430: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5640 + //line php5/php5.y:5636 { yyVAL.node = yyDollar[1].node @@ -8183,7 +8179,7 @@ yydefault: } case 431: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5649 + //line php5/php5.y:5645 { yyVAL.node = yyDollar[2].node @@ -8191,7 +8187,7 @@ yydefault: } case 432: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5655 + //line php5/php5.y:5651 { yyVAL.node = yyDollar[2].node @@ -8199,7 +8195,7 @@ yydefault: } case 433: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5665 + //line php5/php5.y:5661 { yyVAL.node = yyDollar[1].node @@ -8207,7 +8203,7 @@ yydefault: } case 434: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5675 + //line php5/php5.y:5671 { yyVAL.node = yyDollar[1].node @@ -8215,7 +8211,7 @@ yydefault: } case 435: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5684 + //line php5/php5.y:5680 { yyVAL.node = yyDollar[1].node @@ -8223,7 +8219,7 @@ yydefault: } case 436: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:5693 + //line php5/php5.y:5689 { yyVAL.node = yyDollar[1].node @@ -8233,7 +8229,7 @@ yydefault: } // save comments - yyDollar[3].list[0].AddComments(yyDollar[2].token.Comments, comment.ObjectOperatorToken) + addMeta(yyDollar[3].list[0], yyDollar[2].token.Meta, meta.ObjectOperatorToken) for _, n := range yyDollar[3].list { switch nn := n.(type) { @@ -8277,7 +8273,7 @@ yydefault: } case 437: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5745 + //line php5/php5.y:5741 { yyVAL.node = yyDollar[1].node @@ -8285,7 +8281,7 @@ yydefault: } case 438: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5754 + //line php5/php5.y:5750 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) @@ -8293,7 +8289,7 @@ yydefault: } case 439: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:5760 + //line php5/php5.y:5756 { yyVAL.list = []node.Node{} @@ -8301,7 +8297,7 @@ yydefault: } case 440: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5770 + //line php5/php5.y:5766 { if yyDollar[3].list != nil { yyDollar[3].list[0].(*expr.MethodCall).Method = yyDollar[2].list[len(yyDollar[2].list)-1].(*expr.PropertyFetch).Property @@ -8311,13 +8307,13 @@ yydefault: yyVAL.list = yyDollar[2].list // save comments - yyDollar[2].list[0].AddComments(yyDollar[1].token.Comments, comment.ObjectOperatorToken) + addMeta(yyDollar[2].list[0], yyDollar[1].token.Meta, meta.ObjectOperatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 441: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:5787 + //line php5/php5.y:5783 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yyVAL.list = append(yyDollar[1].list, fetch) @@ -8326,14 +8322,14 @@ yydefault: fetch.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) // save comments - fetch.AddComments(yyDollar[2].token.Comments, comment.OpenSquareBracket) - fetch.AddComments(yyDollar[4].token.Comments, comment.CloseSquareBracket) + addMeta(fetch, yyDollar[2].token.Meta, meta.OpenSquareBracket) + addMeta(fetch, yyDollar[4].token.Meta, meta.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 442: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:5801 + //line php5/php5.y:5797 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yyVAL.list = []node.Node{yyDollar[1].node, fetch} @@ -8342,14 +8338,14 @@ yydefault: fetch.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) // save comments - fetch.AddComments(yyDollar[2].token.Comments, comment.OpenSquareBracket) - fetch.AddComments(yyDollar[4].token.Comments, comment.CloseSquareBracket) + addMeta(fetch, yyDollar[2].token.Meta, meta.OpenSquareBracket) + addMeta(fetch, yyDollar[4].token.Meta, meta.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 443: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5818 + //line php5/php5.y:5814 { yyVAL.node = expr.NewMethodCall(nil, nil, yyDollar[1].node.(*node.ArgumentList)) @@ -8360,7 +8356,7 @@ yydefault: } case 444: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5830 + //line php5/php5.y:5826 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -8368,7 +8364,7 @@ yydefault: } case 445: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5836 + //line php5/php5.y:5832 { yyVAL.list = yyDollar[1].list @@ -8376,7 +8372,7 @@ yydefault: } case 446: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:5842 + //line php5/php5.y:5838 { yyVAL.list = nil @@ -8384,7 +8380,7 @@ yydefault: } case 447: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5851 + //line php5/php5.y:5847 { yyVAL.node = yyDollar[1].node @@ -8392,7 +8388,7 @@ yydefault: } case 448: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5857 + //line php5/php5.y:5853 { yyDollar[1].simpleIndirectReference.last.SetVarName(yyDollar[2].node) @@ -8406,7 +8402,7 @@ yydefault: } case 449: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5872 + //line php5/php5.y:5868 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -8414,13 +8410,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.PaamayimNekudotayimToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.PaamayimNekudotayimToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 450: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5884 + //line php5/php5.y:5880 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -8428,13 +8424,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.PaamayimNekudotayimToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.PaamayimNekudotayimToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 451: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5899 + //line php5/php5.y:5895 { yyVAL.node = yyDollar[1].node @@ -8442,7 +8438,7 @@ yydefault: } case 452: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:5908 + //line php5/php5.y:5904 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -8450,14 +8446,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenSquareBracket) - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseSquareBracket) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenSquareBracket) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 453: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:5921 + //line php5/php5.y:5917 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -8465,14 +8461,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenSquareBracket) - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseSquareBracket) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenSquareBracket) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 454: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5937 + //line php5/php5.y:5933 { yyVAL.node = yyDollar[1].node @@ -8480,7 +8476,7 @@ yydefault: } case 455: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5943 + //line php5/php5.y:5939 { yyVAL.node = yyDollar[1].node @@ -8488,7 +8484,7 @@ yydefault: } case 456: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5949 + //line php5/php5.y:5945 { yyVAL.node = yyDollar[1].node @@ -8496,7 +8492,7 @@ yydefault: } case 457: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5959 + //line php5/php5.y:5955 { yyVAL.node = yyDollar[1].node @@ -8504,7 +8500,7 @@ yydefault: } case 458: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5965 + //line php5/php5.y:5961 { yyDollar[1].simpleIndirectReference.last.SetVarName(yyDollar[2].node) @@ -8518,7 +8514,7 @@ yydefault: } case 459: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5977 + //line php5/php5.y:5973 { yyVAL.node = yyDollar[1].node @@ -8526,7 +8522,7 @@ yydefault: } case 460: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:5986 + //line php5/php5.y:5982 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -8534,14 +8530,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenSquareBracket) - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseSquareBracket) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenSquareBracket) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 461: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:5999 + //line php5/php5.y:5995 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -8549,14 +8545,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenCurlyBracesToken) - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 462: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6012 + //line php5/php5.y:6008 { yyVAL.node = yyDollar[1].node @@ -8564,7 +8560,7 @@ yydefault: } case 463: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6022 + //line php5/php5.y:6018 { name := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(name) @@ -8574,13 +8570,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.VariableToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.VariableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 464: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6036 + //line php5/php5.y:6032 { yyVAL.node = expr.NewVariable(yyDollar[3].node) @@ -8588,15 +8584,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.DollarToken) - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenCurlyBracesToken) - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.DollarToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 465: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:6053 + //line php5/php5.y:6049 { yyVAL.node = nil @@ -8604,7 +8600,7 @@ yydefault: } case 466: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6059 + //line php5/php5.y:6055 { yyVAL.node = yyDollar[1].node @@ -8612,7 +8608,7 @@ yydefault: } case 467: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6069 + //line php5/php5.y:6065 { yyVAL.list = yyDollar[1].list @@ -8620,7 +8616,7 @@ yydefault: } case 468: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6075 + //line php5/php5.y:6071 { fetch := expr.NewPropertyFetch(nil, yyDollar[1].node) yyVAL.list = []node.Node{fetch} @@ -8632,7 +8628,7 @@ yydefault: } case 469: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6088 + //line php5/php5.y:6084 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yyVAL.list = append(yyDollar[1].list, fetch) @@ -8641,14 +8637,14 @@ yydefault: fetch.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) // save comments - fetch.AddComments(yyDollar[2].token.Comments, comment.OpenSquareBracket) - fetch.AddComments(yyDollar[4].token.Comments, comment.CloseSquareBracket) + addMeta(fetch, yyDollar[2].token.Meta, meta.OpenSquareBracket) + addMeta(fetch, yyDollar[4].token.Meta, meta.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 470: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6102 + //line php5/php5.y:6098 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yyVAL.list = append(yyDollar[1].list, fetch) @@ -8657,14 +8653,14 @@ yydefault: fetch.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) // save comments - fetch.AddComments(yyDollar[2].token.Comments, comment.OpenCurlyBracesToken) - fetch.AddComments(yyDollar[4].token.Comments, comment.CloseCurlyBracesToken) + addMeta(fetch, yyDollar[2].token.Meta, meta.OpenCurlyBracesToken) + addMeta(fetch, yyDollar[4].token.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 471: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6116 + //line php5/php5.y:6112 { fetch := expr.NewPropertyFetch(nil, yyDollar[1].node) yyVAL.list = []node.Node{fetch} @@ -8676,7 +8672,7 @@ yydefault: } case 472: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6129 + //line php5/php5.y:6125 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -8684,13 +8680,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.StringToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.StringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 473: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6141 + //line php5/php5.y:6137 { yyVAL.node = yyDollar[2].node @@ -8698,14 +8694,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.OpenCurlyBracesToken) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.CloseCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.OpenCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 474: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6157 + //line php5/php5.y:6153 { n := expr.NewVariable(nil) yyVAL.simpleIndirectReference = simpleIndirectReference{[]*expr.Variable{n}, n} @@ -8714,13 +8710,13 @@ yydefault: n.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - n.AddComments(yyDollar[1].token.Comments, comment.DollarToken) + addMeta(n, yyDollar[1].token.Meta, meta.DollarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 475: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6170 + //line php5/php5.y:6166 { n := expr.NewVariable(nil) @@ -8733,13 +8729,13 @@ yydefault: n.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) // save comments - n.AddComments(yyDollar[2].token.Comments, comment.DollarToken) + addMeta(n, yyDollar[2].token.Meta, meta.DollarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 476: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6190 + //line php5/php5.y:6186 { if len(yyDollar[1].list) == 0 { yyDollar[1].list = []node.Node{expr.NewArrayItem(nil, nil)} @@ -8748,15 +8744,13 @@ yydefault: yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - // if lastNode($1) != nil { - lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) - // } + addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 477: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6205 + //line php5/php5.y:6199 { if yyDollar[1].node.(*expr.ArrayItem).Key == nil && yyDollar[1].node.(*expr.ArrayItem).Val == nil { yyVAL.list = []node.Node{} @@ -8768,7 +8762,7 @@ yydefault: } case 478: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6219 + //line php5/php5.y:6213 { yyVAL.node = expr.NewArrayItem(nil, yyDollar[1].node) @@ -8779,7 +8773,7 @@ yydefault: } case 479: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6228 + //line php5/php5.y:6222 { item := expr.NewList(yyDollar[3].list) yyVAL.node = expr.NewArrayItem(nil, item) @@ -8789,15 +8783,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(item)) // save comments - item.AddComments(yyDollar[1].token.Comments, comment.ListToken) - item.AddComments(yyDollar[2].token.Comments, comment.OpenParenthesisToken) - item.AddComments(yyDollar[4].token.Comments, comment.CloseParenthesisToken) + addMeta(item, yyDollar[1].token.Meta, meta.ListToken) + addMeta(item, yyDollar[2].token.Meta, meta.OpenParenthesisToken) + addMeta(item, yyDollar[4].token.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 480: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:6244 + //line php5/php5.y:6238 { yyVAL.node = expr.NewArrayItem(nil, nil) @@ -8805,7 +8799,7 @@ yydefault: } case 481: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:6254 + //line php5/php5.y:6248 { yyVAL.list = []node.Node{} @@ -8813,7 +8807,7 @@ yydefault: } case 482: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6260 + //line php5/php5.y:6254 { yyVAL.list = yyDollar[1].list @@ -8823,14 +8817,14 @@ yydefault: // save comments if yyDollar[2].token != nil { - lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) + addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 483: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:6278 + //line php5/php5.y:6272 { arrayItem := expr.NewArrayItem(yyDollar[3].node, yyDollar[5].node) yyVAL.list = append(yyDollar[1].list, arrayItem) @@ -8839,14 +8833,14 @@ yydefault: arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[3].node, yyDollar[5].node)) // save comments - lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) - arrayItem.AddComments(yyDollar[4].token.Comments, comment.DoubleArrowToken) + addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) + addMeta(arrayItem, yyDollar[4].token.Meta, meta.DoubleArrowToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 484: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6292 + //line php5/php5.y:6286 { arrayItem := expr.NewArrayItem(nil, yyDollar[3].node) yyVAL.list = append(yyDollar[1].list, arrayItem) @@ -8855,13 +8849,13 @@ yydefault: arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) // save comments - lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) + addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 485: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6305 + //line php5/php5.y:6299 { arrayItem := expr.NewArrayItem(yyDollar[1].node, yyDollar[3].node) yyVAL.list = []node.Node{arrayItem} @@ -8870,13 +8864,13 @@ yydefault: arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - arrayItem.AddComments(yyDollar[2].token.Comments, comment.DoubleArrowToken) + addMeta(arrayItem, yyDollar[2].token.Meta, meta.DoubleArrowToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 486: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6318 + //line php5/php5.y:6312 { arrayItem := expr.NewArrayItem(nil, yyDollar[1].node) yyVAL.list = []node.Node{arrayItem} @@ -8888,7 +8882,7 @@ yydefault: } case 487: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:6328 + //line php5/php5.y:6322 { reference := expr.NewReference(yyDollar[6].node) arrayItem := expr.NewArrayItem(yyDollar[3].node, reference) @@ -8899,15 +8893,15 @@ yydefault: arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[3].node, yyDollar[6].node)) // save comments - lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) - arrayItem.AddComments(yyDollar[4].token.Comments, comment.DoubleArrowToken) - reference.AddComments(yyDollar[5].token.Comments, comment.AmpersandToken) + addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) + addMeta(arrayItem, yyDollar[4].token.Meta, meta.DoubleArrowToken) + addMeta(reference, yyDollar[5].token.Meta, meta.AmpersandToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 488: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6345 + //line php5/php5.y:6339 { reference := expr.NewReference(yyDollar[4].node) arrayItem := expr.NewArrayItem(nil, reference) @@ -8918,14 +8912,14 @@ yydefault: arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[3].token, yyDollar[4].node)) // save comments - lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) - reference.AddComments(yyDollar[3].token.Comments, comment.AmpersandToken) + addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) + addMeta(reference, yyDollar[3].token.Meta, meta.AmpersandToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 489: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6361 + //line php5/php5.y:6355 { reference := expr.NewReference(yyDollar[4].node) arrayItem := expr.NewArrayItem(yyDollar[1].node, reference) @@ -8936,14 +8930,14 @@ yydefault: arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) // save comments - arrayItem.AddComments(yyDollar[2].token.Comments, comment.DoubleArrowToken) - reference.AddComments(yyDollar[3].token.Comments, comment.AmpersandToken) + addMeta(arrayItem, yyDollar[2].token.Meta, meta.DoubleArrowToken) + addMeta(reference, yyDollar[3].token.Meta, meta.AmpersandToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 490: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6377 + //line php5/php5.y:6371 { reference := expr.NewReference(yyDollar[2].node) arrayItem := expr.NewArrayItem(nil, reference) @@ -8954,13 +8948,13 @@ yydefault: arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - reference.AddComments(yyDollar[1].token.Comments, comment.AmpersandToken) + addMeta(reference, yyDollar[1].token.Meta, meta.AmpersandToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 491: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6395 + //line php5/php5.y:6389 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -8968,7 +8962,7 @@ yydefault: } case 492: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6401 + //line php5/php5.y:6395 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yyVAL.list = append(yyDollar[1].list, encapsed) @@ -8977,13 +8971,13 @@ yydefault: encapsed.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) // save comments - encapsed.AddComments(yyDollar[2].token.Comments, comment.EncapsedAndWhitespaceToken) + addMeta(encapsed, yyDollar[2].token.Meta, meta.EncapsedAndWhitespaceToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 493: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6414 + //line php5/php5.y:6408 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -8991,7 +8985,7 @@ yydefault: } case 494: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6420 + //line php5/php5.y:6414 { encapsed := scalar.NewEncapsedStringPart(yyDollar[1].token.Value) yyVAL.list = []node.Node{encapsed, yyDollar[2].node} @@ -9000,13 +8994,13 @@ yydefault: encapsed.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - encapsed.AddComments(yyDollar[1].token.Comments, comment.EncapsedAndWhitespaceToken) + addMeta(encapsed, yyDollar[1].token.Meta, meta.EncapsedAndWhitespaceToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 495: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6436 + //line php5/php5.y:6430 { name := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(name) @@ -9016,13 +9010,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.VariableToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.VariableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 496: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6450 + //line php5/php5.y:6444 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -9034,15 +9028,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - variable.AddComments(yyDollar[1].token.Comments, comment.VariableToken) - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenSquareBracket) - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseSquareBracket) + addMeta(variable, yyDollar[1].token.Meta, meta.VariableToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenSquareBracket) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 497: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6468 + //line php5/php5.y:6462 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -9056,15 +9050,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - variable.AddComments(yyDollar[1].token.Comments, comment.VariableToken) - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.ObjectOperatorToken) - fetch.AddComments(yyDollar[3].token.Comments, comment.StringToken) + addMeta(variable, yyDollar[1].token.Meta, meta.VariableToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.ObjectOperatorToken) + addMeta(fetch, yyDollar[3].token.Meta, meta.StringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 498: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6488 + //line php5/php5.y:6482 { yyVAL.node = expr.NewVariable(yyDollar[2].node) @@ -9072,14 +9066,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.DollarOpenCurlyBracesToken) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.CloseCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.DollarOpenCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 499: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6501 + //line php5/php5.y:6495 { name := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = expr.NewVariable(name) @@ -9089,15 +9083,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.DollarOpenCurlyBracesToken) - name.AddComments(yyDollar[2].token.Comments, comment.StringVarnameToken) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.CloseCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.DollarOpenCurlyBracesToken) + addMeta(name, yyDollar[2].token.Meta, meta.StringVarnameToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 500: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:6517 + //line php5/php5.y:6511 { identifier := node.NewIdentifier(yyDollar[2].token.Value) variable := expr.NewVariable(identifier) @@ -9109,17 +9103,17 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[6].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.DollarOpenCurlyBracesToken) - variable.AddComments(yyDollar[2].token.Comments, comment.StringVarnameToken) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.OpenSquareBracket) - yyVAL.node.AddComments(yyDollar[5].token.Comments, comment.CloseSquareBracket) - yyVAL.node.AddComments(yyDollar[6].token.Comments, comment.CloseCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.DollarOpenCurlyBracesToken) + addMeta(variable, yyDollar[2].token.Meta, meta.StringVarnameToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.OpenSquareBracket) + addMeta(yyVAL.node, yyDollar[5].token.Meta, meta.CloseSquareBracket) + addMeta(yyVAL.node, yyDollar[6].token.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 501: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6537 + //line php5/php5.y:6531 { yyVAL.node = yyDollar[2].node @@ -9127,7 +9121,7 @@ yydefault: } case 502: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6546 + //line php5/php5.y:6540 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) @@ -9135,13 +9129,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.StringToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.StringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 503: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6558 + //line php5/php5.y:6552 { // TODO: add option to handle 64 bit integer if _, err := strconv.Atoi(yyDollar[1].token.Value); err == nil { @@ -9154,13 +9148,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.NumStringToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.NumStringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 504: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6575 + //line php5/php5.y:6569 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(identifier) @@ -9170,13 +9164,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.VariableToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.VariableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 505: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6592 + //line php5/php5.y:6586 { yyVAL.node = expr.NewIsset(yyDollar[3].list) @@ -9184,15 +9178,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.IssetToken) - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenParenthesisToken) - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseParenthesisToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.IssetToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenParenthesisToken) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 506: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6606 + //line php5/php5.y:6600 { yyVAL.node = expr.NewEmpty(yyDollar[3].node) @@ -9200,15 +9194,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.EmptyToken) - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenParenthesisToken) - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseParenthesisToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.EmptyToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenParenthesisToken) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 507: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6620 + //line php5/php5.y:6614 { yyVAL.node = expr.NewEmpty(yyDollar[3].node) @@ -9216,15 +9210,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.EmptyToken) - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenParenthesisToken) - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseParenthesisToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.EmptyToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenParenthesisToken) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 508: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6634 + //line php5/php5.y:6628 { yyVAL.node = expr.NewInclude(yyDollar[2].node) @@ -9232,13 +9226,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.IncludeToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.IncludeToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 509: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6646 + //line php5/php5.y:6640 { yyVAL.node = expr.NewIncludeOnce(yyDollar[2].node) @@ -9246,13 +9240,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.IncludeOnceToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.IncludeOnceToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 510: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6658 + //line php5/php5.y:6652 { yyVAL.node = expr.NewEval(yyDollar[3].node) @@ -9260,15 +9254,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.EvalToken) - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenParenthesisToken) - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseParenthesisToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.EvalToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenParenthesisToken) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 511: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6672 + //line php5/php5.y:6666 { yyVAL.node = expr.NewRequire(yyDollar[2].node) @@ -9276,13 +9270,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.RequireToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.RequireToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 512: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6684 + //line php5/php5.y:6678 { yyVAL.node = expr.NewRequireOnce(yyDollar[2].node) @@ -9290,13 +9284,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.RequireOnceToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.RequireOnceToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 513: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6699 + //line php5/php5.y:6693 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -9304,18 +9298,18 @@ yydefault: } case 514: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6705 + //line php5/php5.y:6699 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) + addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 515: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6717 + //line php5/php5.y:6711 { yyVAL.node = yyDollar[1].node @@ -9323,7 +9317,7 @@ yydefault: } case 516: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6723 + //line php5/php5.y:6717 { yyVAL.node = yyDollar[1].node @@ -9331,7 +9325,7 @@ yydefault: } case 517: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6732 + //line php5/php5.y:6726 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -9341,13 +9335,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.PaamayimNekudotayimToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.PaamayimNekudotayimToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 518: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6746 + //line php5/php5.y:6740 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -9357,13 +9351,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.PaamayimNekudotayimToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.PaamayimNekudotayimToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 519: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6763 + //line php5/php5.y:6757 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -9373,13 +9367,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.PaamayimNekudotayimToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.PaamayimNekudotayimToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 520: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6780 + //line php5/php5.y:6774 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -9389,7 +9383,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.PaamayimNekudotayimToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.PaamayimNekudotayimToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php5/php5.y b/php5/php5.y index ac1ef60..fa5bc7e 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -5,7 +5,7 @@ import ( "strings" "strconv" - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/scanner" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node/scalar" @@ -313,7 +313,7 @@ namespace_name: namePart.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - namePart.AddComments($1.Comments, comment.StringToken) + addMeta(namePart, $1.Meta, meta.StringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -326,8 +326,8 @@ namespace_name: namePart.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) // save comments - lastNode($1).AddComments($2.Comments, comment.NsSeparatorToken) - namePart.AddComments($3.Comments, comment.StringToken) + addMeta(lastNode($1), $2.Meta, meta.NsSeparatorToken) + addMeta(namePart, $3.Meta, meta.StringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -367,10 +367,10 @@ top_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $$.AddComments($1.Comments, comment.HaltCompilerToken) - $$.AddComments($2.Comments, comment.OpenParenthesisToken) - $$.AddComments($3.Comments, comment.CloseParenthesisToken) - $$.AddComments($4.Comments, comment.SemiColonToken) + addMeta($$, $1.Meta, meta.HaltCompilerToken) + addMeta($$, $2.Meta, meta.OpenParenthesisToken) + addMeta($$, $3.Meta, meta.CloseParenthesisToken) + addMeta($$, $4.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -384,8 +384,8 @@ top_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $$.AddComments($1.Comments, comment.NamespaceToken) - $$.AddComments($3.Comments, comment.SemiColonToken) + addMeta($$, $1.Meta, meta.NamespaceToken) + addMeta($$, $3.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -399,9 +399,9 @@ top_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5)) // save comments - $$.AddComments($1.Comments, comment.NamespaceToken) - $$.AddComments($3.Comments, comment.OpenCurlyBracesToken) - $$.AddComments($5.Comments, comment.CloseCurlyBracesToken) + addMeta($$, $1.Meta, meta.NamespaceToken) + addMeta($$, $3.Meta, meta.OpenCurlyBracesToken) + addMeta($$, $5.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -413,9 +413,9 @@ top_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $$.AddComments($1.Comments, comment.NamespaceToken) - $$.AddComments($2.Comments, comment.OpenCurlyBracesToken) - $$.AddComments($4.Comments, comment.CloseCurlyBracesToken) + addMeta($$, $1.Meta, meta.NamespaceToken) + addMeta($$, $2.Meta, meta.OpenCurlyBracesToken) + addMeta($$, $4.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -427,8 +427,8 @@ top_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $$.AddComments($1.Comments, comment.UseToken) - $$.AddComments($3.Comments, comment.SemiColonToken) + addMeta($$, $1.Meta, meta.UseToken) + addMeta($$, $3.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -442,9 +442,9 @@ top_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $$.AddComments($1.Comments, comment.UseToken) - useType.AddComments($2.Comments, comment.UseToken) - $$.AddComments($4.Comments, comment.SemiColonToken) + addMeta($$, $1.Meta, meta.UseToken) + addMeta(useType, $2.Meta, meta.UseToken) + addMeta($$, $4.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -458,9 +458,9 @@ top_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $$.AddComments($1.Comments, comment.UseToken) - useType.AddComments($2.Comments, comment.UseToken) - $$.AddComments($4.Comments, comment.SemiColonToken) + addMeta($$, $1.Meta, meta.UseToken) + addMeta(useType, $2.Meta, meta.UseToken) + addMeta($$, $4.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -472,7 +472,7 @@ top_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) // save comments - $$.AddComments($2.Comments, comment.SemiColonToken) + addMeta($$, $2.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -484,7 +484,7 @@ use_declarations: $$ = append($1, $3) // save comments - lastNode($1).AddComments($2.Comments, comment.CommaToken) + addMeta(lastNode($1), $2.Meta, meta.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -520,8 +520,8 @@ use_declaration: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.AsToken) - alias.AddComments($3.Comments, comment.StringToken) + addMeta($$, $2.Meta, meta.AsToken) + addMeta(alias, $3.Meta, meta.StringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -535,7 +535,7 @@ use_declaration: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) // save comments - $$.AddComments($1.Comments, comment.NsSeparatorToken) + addMeta($$, $1.Meta, meta.NsSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -551,9 +551,9 @@ use_declaration: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($2, $4)) // save comments - $$.AddComments($1.Comments, comment.NsSeparatorToken) - $$.AddComments($3.Comments, comment.AsToken) - $$.AddComments($4.Comments, comment.StringToken) + addMeta($$, $1.Meta, meta.NsSeparatorToken) + addMeta($$, $3.Meta, meta.AsToken) + addMeta($$, $4.Meta, meta.StringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -565,7 +565,7 @@ use_function_declarations: $$ = append($1, $3) // save comments - lastNode($1).AddComments($2.Comments, comment.CommaToken) + addMeta(lastNode($1), $2.Meta, meta.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -601,8 +601,8 @@ use_function_declaration: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.AsToken) - alias.AddComments($3.Comments, comment.StringToken) + addMeta($$, $2.Meta, meta.AsToken) + addMeta(alias, $3.Meta, meta.StringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -616,7 +616,7 @@ use_function_declaration: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) // save comments - $$.AddComments($1.Comments, comment.NsSeparatorToken) + addMeta($$, $1.Meta, meta.NsSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -632,9 +632,9 @@ use_function_declaration: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($2, $4)) // save comments - $$.AddComments($1.Comments, comment.NsSeparatorToken) - $$.AddComments($3.Comments, comment.AsToken) - $$.AddComments($4.Comments, comment.StringToken) + addMeta($$, $1.Meta, meta.NsSeparatorToken) + addMeta($$, $3.Meta, meta.AsToken) + addMeta($$, $4.Meta, meta.StringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -646,7 +646,7 @@ use_const_declarations: $$ = append($1, $3) // save comments - lastNode($1).AddComments($2.Comments, comment.CommaToken) + addMeta(lastNode($1), $2.Meta, meta.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -682,8 +682,8 @@ use_const_declaration: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.AsToken) - alias.AddComments($3.Comments, comment.StringToken) + addMeta($$, $2.Meta, meta.AsToken) + addMeta(alias, $3.Meta, meta.StringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -697,7 +697,7 @@ use_const_declaration: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) // save comments - $$.AddComments($1.Comments, comment.NsSeparatorToken) + addMeta($$, $1.Meta, meta.NsSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -713,9 +713,9 @@ use_const_declaration: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($2, $4)) // save comments - $$.AddComments($1.Comments, comment.NsSeparatorToken) - $$.AddComments($3.Comments, comment.AsToken) - $$.AddComments($4.Comments, comment.StringToken) + addMeta($$, $1.Meta, meta.NsSeparatorToken) + addMeta($$, $3.Meta, meta.AsToken) + addMeta($$, $4.Meta, meta.StringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -736,9 +736,9 @@ constant_declaration: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeNodeListPosition($1, constList.Consts)) // save comments - lastNode(constList.Consts).AddComments($2.Comments, comment.CommaToken) - name.AddComments($3.Comments, comment.StringToken) - constant.AddComments($4.Comments, comment.EqualToken) + addMeta(lastNode(constList.Consts), $2.Meta, meta.CommaToken) + addMeta(name, $3.Meta, meta.StringToken) + addMeta(constant, $4.Meta, meta.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -755,9 +755,9 @@ constant_declaration: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, constList)) // save comments - $$.AddComments($1.Comments, comment.ConstToken) - name.AddComments($2.Comments, comment.StringToken) - constant.AddComments($3.Comments, comment.EqualToken) + addMeta($$, $1.Meta, meta.ConstToken) + addMeta(name, $2.Meta, meta.StringToken) + addMeta(constant, $3.Meta, meta.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -815,10 +815,10 @@ inner_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $$.AddComments($1.Comments, comment.HaltCompilerToken) - $$.AddComments($2.Comments, comment.OpenParenthesisToken) - $$.AddComments($3.Comments, comment.CloseParenthesisToken) - $$.AddComments($4.Comments, comment.SemiColonToken) + addMeta($$, $1.Meta, meta.HaltCompilerToken) + addMeta($$, $2.Meta, meta.OpenParenthesisToken) + addMeta($$, $3.Meta, meta.CloseParenthesisToken) + addMeta($$, $4.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -842,8 +842,8 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - label.AddComments($1.Comments, comment.StringToken) - $$.AddComments($2.Comments, comment.ColonToken) + addMeta(label, $1.Meta, meta.StringToken) + addMeta($$, $2.Meta, meta.ColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -858,8 +858,8 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $$.AddComments($1.Comments, comment.OpenCurlyBracesToken) - $$.AddComments($3.Comments, comment.CloseCurlyBracesToken) + addMeta($$, $1.Meta, meta.OpenCurlyBracesToken) + addMeta($$, $3.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -877,7 +877,7 @@ unticked_statement: } // save comments - $$.AddComments($1.Comments, comment.IfToken) + addMeta($$, $1.Meta, meta.IfToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -891,10 +891,10 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $8)) // save comments - $$.AddComments($1.Comments, comment.IfToken) - $$.AddComments($3.Comments, comment.ColonToken) - $$.AddComments($7.Comments, comment.EndifToken) - $$.AddComments($8.Comments, comment.SemiColonToken) + addMeta($$, $1.Meta, meta.IfToken) + addMeta($$, $3.Meta, meta.ColonToken) + addMeta($$, $7.Meta, meta.EndifToken) + addMeta($$, $8.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -913,7 +913,7 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) // save comments - $$.AddComments($1.Comments, comment.WhileToken) + addMeta($$, $1.Meta, meta.WhileToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -925,9 +925,9 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5)) // save comments - $$.AddComments($1.Comments, comment.DoToken) - $$.AddComments($3.Comments, comment.WhileToken) - $$.AddComments($5.Comments, comment.SemiColonToken) + addMeta($$, $1.Meta, meta.DoToken) + addMeta($$, $3.Meta, meta.WhileToken) + addMeta($$, $5.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -950,11 +950,11 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $9)) // save comments - $$.AddComments($1.Comments, comment.ForToken) - $$.AddComments($2.Comments, comment.OpenParenthesisToken) - $$.AddComments($4.Comments, comment.ForInitSemicolonToken) - $$.AddComments($6.Comments, comment.ForCondSemicolonToken) - $$.AddComments($8.Comments, comment.CloseParenthesisToken) + addMeta($$, $1.Meta, meta.ForToken) + addMeta($$, $2.Meta, meta.OpenParenthesisToken) + addMeta($$, $4.Meta, meta.ForInitSemicolonToken) + addMeta($$, $6.Meta, meta.ForCondSemicolonToken) + addMeta($$, $8.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -975,7 +975,7 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) // save comments - $$.AddComments($1.Comments, comment.SwitchToken) + addMeta($$, $1.Meta, meta.SwitchToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -987,8 +987,8 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - $$.AddComments($1.Comments, comment.BreakToken) - $$.AddComments($2.Comments, comment.SemiColonToken) + addMeta($$, $1.Meta, meta.BreakToken) + addMeta($$, $2.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1000,8 +1000,8 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $$.AddComments($1.Comments, comment.BreakToken) - $$.AddComments($3.Comments, comment.SemiColonToken) + addMeta($$, $1.Meta, meta.BreakToken) + addMeta($$, $3.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1013,8 +1013,8 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - $$.AddComments($1.Comments, comment.ContinueToken) - $$.AddComments($2.Comments, comment.SemiColonToken) + addMeta($$, $1.Meta, meta.ContinueToken) + addMeta($$, $2.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1026,8 +1026,8 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $$.AddComments($1.Comments, comment.ContinueToken) - $$.AddComments($3.Comments, comment.SemiColonToken) + addMeta($$, $1.Meta, meta.ContinueToken) + addMeta($$, $3.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1039,8 +1039,8 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - $$.AddComments($1.Comments, comment.ReturnToken) - $$.AddComments($2.Comments, comment.SemiColonToken) + addMeta($$, $1.Meta, meta.ReturnToken) + addMeta($$, $2.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1052,8 +1052,8 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $$.AddComments($1.Comments, comment.ReturnToken) - $$.AddComments($3.Comments, comment.SemiColonToken) + addMeta($$, $1.Meta, meta.ReturnToken) + addMeta($$, $3.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1065,8 +1065,8 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $$.AddComments($1.Comments, comment.ReturnToken) - $$.AddComments($3.Comments, comment.SemiColonToken) + addMeta($$, $1.Meta, meta.ReturnToken) + addMeta($$, $3.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1078,7 +1078,7 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) // save comments - $$.AddComments($2.Comments, comment.SemiColonToken) + addMeta($$, $2.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1090,8 +1090,8 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $$.AddComments($1.Comments, comment.GlobalToken) - $$.AddComments($3.Comments, comment.SemiColonToken) + addMeta($$, $1.Meta, meta.GlobalToken) + addMeta($$, $3.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1103,8 +1103,8 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $$.AddComments($1.Comments, comment.StaticToken) - $$.AddComments($3.Comments, comment.SemiColonToken) + addMeta($$, $1.Meta, meta.StaticToken) + addMeta($$, $3.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1116,8 +1116,8 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $$.AddComments($1.Comments, comment.EchoToken) - $$.AddComments($3.Comments, comment.SemiColonToken) + addMeta($$, $1.Meta, meta.EchoToken) + addMeta($$, $3.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1129,7 +1129,7 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $$.AddComments($1.Comments, comment.InlineHTMLToken) + addMeta($$, $1.Meta, meta.InlineHTMLToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1141,7 +1141,7 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) // save comments - $$.AddComments($2.Comments, comment.SemiColonToken) + addMeta($$, $2.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1153,10 +1153,10 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5)) // save comments - $$.AddComments($1.Comments, comment.UnsetToken) - $$.AddComments($2.Comments, comment.OpenParenthesisToken) - $$.AddComments($4.Comments, comment.CloseParenthesisToken) - $$.AddComments($5.Comments, comment.SemiColonToken) + addMeta($$, $1.Meta, meta.UnsetToken) + addMeta($$, $2.Meta, meta.OpenParenthesisToken) + addMeta($$, $4.Meta, meta.CloseParenthesisToken) + addMeta($$, $5.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1190,10 +1190,10 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $8)) // save comments - $$.AddComments($1.Comments, comment.ForeachToken) - $$.AddComments($2.Comments, comment.OpenParenthesisToken) - $$.AddComments($4.Comments, comment.AsToken) - $$.AddComments($7.Comments, comment.CloseParenthesisToken) + addMeta($$, $1.Meta, meta.ForeachToken) + addMeta($$, $2.Meta, meta.OpenParenthesisToken) + addMeta($$, $4.Meta, meta.AsToken) + addMeta($$, $7.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1227,10 +1227,10 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $8)) // save comments - $$.AddComments($1.Comments, comment.ForeachToken) - $$.AddComments($2.Comments, comment.OpenParenthesisToken) - $$.AddComments($4.Comments, comment.AsToken) - $$.AddComments($7.Comments, comment.CloseParenthesisToken) + addMeta($$, $1.Meta, meta.ForeachToken) + addMeta($$, $2.Meta, meta.OpenParenthesisToken) + addMeta($$, $4.Meta, meta.AsToken) + addMeta($$, $7.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1242,9 +1242,9 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5)) // save comments - $$.AddComments($1.Comments, comment.DeclareToken) - $$.AddComments($2.Comments, comment.OpenParenthesisToken) - $$.AddComments($4.Comments, comment.CloseParenthesisToken) + addMeta($$, $1.Meta, meta.DeclareToken) + addMeta($$, $2.Meta, meta.OpenParenthesisToken) + addMeta($$, $4.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1256,7 +1256,7 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $$.AddComments($1.Comments, comment.SemiColonToken) + addMeta($$, $1.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1272,9 +1272,9 @@ unticked_statement: } // save comments - $$.AddComments($1.Comments, comment.TryToken) - $$.AddComments($2.Comments, comment.OpenCurlyBracesToken) - $$.AddComments($4.Comments, comment.CloseCurlyBracesToken) + addMeta($$, $1.Meta, meta.TryToken) + addMeta($$, $2.Meta, meta.OpenCurlyBracesToken) + addMeta($$, $4.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1286,8 +1286,8 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $$.AddComments($1.Comments, comment.ThrowToken) - $$.AddComments($3.Comments, comment.SemiColonToken) + addMeta($$, $1.Meta, meta.ThrowToken) + addMeta($$, $3.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1301,9 +1301,9 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $$.AddComments($1.Comments, comment.GotoToken) - label.AddComments($2.Comments, comment.StringToken) - $$.AddComments($3.Comments, comment.SemiColonToken) + addMeta($$, $1.Meta, meta.GotoToken) + addMeta(label, $2.Meta, meta.StringToken) + addMeta($$, $3.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1329,12 +1329,12 @@ catch_statement: catch.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $8)) // save comments - catch.AddComments($1.Comments, comment.CatchToken) - catch.AddComments($2.Comments, comment.OpenParenthesisToken) - variable.AddComments($4.Comments, comment.StringToken) - catch.AddComments($5.Comments, comment.CloseParenthesisToken) - catch.AddComments($6.Comments, comment.OpenCurlyBracesToken) - catch.AddComments($8.Comments, comment.CloseCurlyBracesToken) + addMeta(catch, $1.Meta, meta.CatchToken) + addMeta(catch, $2.Meta, meta.OpenParenthesisToken) + addMeta(variable, $4.Meta, meta.StringToken) + addMeta(catch, $5.Meta, meta.CloseParenthesisToken) + addMeta(catch, $6.Meta, meta.OpenCurlyBracesToken) + addMeta(catch, $8.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1355,9 +1355,9 @@ finally_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $$.AddComments($1.Comments, comment.FinallyToken) - $$.AddComments($2.Comments, comment.OpenCurlyBracesToken) - $$.AddComments($4.Comments, comment.CloseCurlyBracesToken) + addMeta($$, $1.Meta, meta.FinallyToken) + addMeta($$, $2.Meta, meta.OpenCurlyBracesToken) + addMeta($$, $4.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1406,12 +1406,12 @@ additional_catch: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $8)) // save comments - $$.AddComments($1.Comments, comment.CatchToken) - $$.AddComments($2.Comments, comment.OpenParenthesisToken) - variable.AddComments($4.Comments, comment.StringToken) - $$.AddComments($5.Comments, comment.CloseParenthesisToken) - $$.AddComments($6.Comments, comment.OpenCurlyBracesToken) - $$.AddComments($8.Comments, comment.CloseCurlyBracesToken) + addMeta($$, $1.Meta, meta.CatchToken) + addMeta($$, $2.Meta, meta.OpenParenthesisToken) + addMeta(variable, $4.Meta, meta.StringToken) + addMeta($$, $5.Meta, meta.CloseParenthesisToken) + addMeta($$, $6.Meta, meta.OpenCurlyBracesToken) + addMeta($$, $8.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1429,7 +1429,7 @@ unset_variables: $$ = append($1, $3) // save comments - lastNode($1).AddComments($2.Comments, comment.CommaToken) + addMeta(lastNode($1), $2.Meta, meta.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1495,15 +1495,15 @@ unticked_function_declaration_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $9)) // save comments - $$.AddComments($1.Comments, comment.FunctionToken) + addMeta($$, $1.Meta, meta.FunctionToken) if $2 != nil { - $$.AddComments($2.Comments, comment.AmpersandToken) + addMeta($$, $2.Meta, meta.AmpersandToken) } - name.AddComments($3.Comments, comment.StringToken) - $$.AddComments($4.Comments, comment.OpenParenthesisToken) - $$.AddComments($6.Comments, comment.CloseParenthesisToken) - $$.AddComments($7.Comments, comment.OpenCurlyBracesToken) - $$.AddComments($9.Comments, comment.CloseCurlyBracesToken) + addMeta(name, $3.Meta, meta.StringToken) + addMeta($$, $4.Meta, meta.OpenParenthesisToken) + addMeta($$, $6.Meta, meta.CloseParenthesisToken) + addMeta($$, $7.Meta, meta.OpenCurlyBracesToken) + addMeta($$, $9.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1532,9 +1532,9 @@ unticked_class_declaration_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $7)) // save comments - name.AddComments($2.Comments, comment.StringToken) - $$.AddComments($5.Comments, comment.OpenCurlyBracesToken) - $$.AddComments($7.Comments, comment.CloseCurlyBracesToken) + addMeta(name, $2.Meta, meta.StringToken) + addMeta($$, $5.Meta, meta.OpenCurlyBracesToken) + addMeta($$, $7.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1548,9 +1548,9 @@ unticked_class_declaration_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $6)) // save comments - name.AddComments($2.Comments, comment.StringToken) - $$.AddComments($4.Comments, comment.OpenCurlyBracesToken) - $$.AddComments($6.Comments, comment.CloseCurlyBracesToken) + addMeta(name, $2.Meta, meta.StringToken) + addMeta($$, $4.Meta, meta.OpenCurlyBracesToken) + addMeta($$, $6.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1566,7 +1566,7 @@ class_entry_type: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $$.AddComments($1.Comments, comment.ClassToken) + addMeta($$, $1.Meta, meta.ClassToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1580,8 +1580,8 @@ class_entry_type: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - classModifier.AddComments($1.Comments, comment.AbstractToken) - $$.AddComments($2.Comments, comment.ClassToken) + addMeta(classModifier, $1.Meta, meta.AbstractToken) + addMeta($$, $2.Meta, meta.ClassToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1593,7 +1593,7 @@ class_entry_type: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $$.AddComments($1.Comments, comment.TraitToken) + addMeta($$, $1.Meta, meta.TraitToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1607,8 +1607,8 @@ class_entry_type: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - classModifier.AddComments($1.Comments, comment.FinalToken) - $$.AddComments($2.Comments, comment.ClassToken) + addMeta(classModifier, $1.Meta, meta.FinalToken) + addMeta($$, $2.Meta, meta.ClassToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1629,7 +1629,7 @@ extends_from: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $$.AddComments($1.Comments, comment.ExtendsToken) + addMeta($$, $1.Meta, meta.ExtendsToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1657,7 +1657,7 @@ interface_extends_list: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) // save comments - $$.AddComments($1.Comments, comment.ExtendsToken) + addMeta($$, $1.Meta, meta.ExtendsToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1678,7 +1678,7 @@ implements_list: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) // save comments - $$.AddComments($1.Comments, comment.ImplementsToken) + addMeta($$, $1.Meta, meta.ImplementsToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1696,7 +1696,7 @@ interface_list: $$ = append($1, $3) // save comments - lastNode($1).AddComments($2.Comments, comment.CommaToken) + addMeta(lastNode($1), $2.Meta, meta.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1714,7 +1714,7 @@ foreach_optional_arg: $$ = $2 // save comments - $$.AddComments($1.Comments, comment.DoubleArrowToken) + addMeta($$, $1.Meta, meta.DoubleArrowToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1735,7 +1735,7 @@ foreach_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $$.AddComments($1.Comments, comment.AmpersandToken) + addMeta($$, $1.Meta, meta.AmpersandToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1747,9 +1747,9 @@ foreach_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $$.AddComments($1.Comments, comment.ListToken) - $$.AddComments($2.Comments, comment.OpenParenthesisToken) - $$.AddComments($4.Comments, comment.CloseParenthesisToken) + addMeta($$, $1.Meta, meta.ListToken) + addMeta($$, $2.Meta, meta.OpenParenthesisToken) + addMeta($$, $4.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1775,9 +1775,9 @@ for_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $$.AddComments($1.Comments, comment.ColonToken) - $$.AddComments($3.Comments, comment.EndforToken) - $$.AddComments($4.Comments, comment.SemiColonToken) + addMeta($$, $1.Meta, meta.ColonToken) + addMeta($$, $3.Meta, meta.EndforToken) + addMeta($$, $4.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1803,9 +1803,9 @@ foreach_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $$.AddComments($1.Comments, comment.ColonToken) - $$.AddComments($3.Comments, comment.EndforeachToken) - $$.AddComments($4.Comments, comment.SemiColonToken) + addMeta($$, $1.Meta, meta.ColonToken) + addMeta($$, $3.Meta, meta.EndforeachToken) + addMeta($$, $4.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1827,9 +1827,9 @@ declare_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $$.AddComments($1.Comments, comment.ColonToken) - $$.AddComments($3.Comments, comment.EnddeclareToken) - $$.AddComments($4.Comments, comment.SemiColonToken) + addMeta($$, $1.Meta, meta.ColonToken) + addMeta($$, $3.Meta, meta.EnddeclareToken) + addMeta($$, $4.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1848,8 +1848,8 @@ declare_list: constant.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) // save comments - name.AddComments($1.Comments, comment.StringToken) - constant.AddComments($2.Comments, comment.EqualToken) + addMeta(name, $1.Meta, meta.StringToken) + addMeta(constant, $2.Meta, meta.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1864,9 +1864,9 @@ declare_list: constant.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $5)) // save comments - lastNode($1).AddComments($2.Comments, comment.CommaToken) - name.AddComments($3.Comments, comment.StringToken) - constant.AddComments($4.Comments, comment.EqualToken) + addMeta(lastNode($1), $2.Meta, meta.CommaToken) + addMeta(name, $3.Meta, meta.StringToken) + addMeta(constant, $4.Meta, meta.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1884,8 +1884,8 @@ switch_case_list: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - caseList.AddComments($1.Comments, comment.OpenCurlyBracesToken) - caseList.AddComments($3.Comments, comment.CloseCurlyBracesToken) + addMeta(caseList, $1.Meta, meta.OpenCurlyBracesToken) + addMeta(caseList, $3.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1899,9 +1899,9 @@ switch_case_list: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - caseList.AddComments($1.Comments, comment.OpenCurlyBracesToken) - caseList.AddComments($2.Comments, comment.SemiColonToken) - caseList.AddComments($4.Comments, comment.CloseCurlyBracesToken) + addMeta(caseList, $1.Meta, meta.OpenCurlyBracesToken) + addMeta(caseList, $2.Meta, meta.SemiColonToken) + addMeta(caseList, $4.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1915,9 +1915,9 @@ switch_case_list: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - caseList.AddComments($1.Comments, comment.ColonToken) - caseList.AddComments($3.Comments, comment.EndswitchToken) - $$.AddComments($4.Comments, comment.SemiColonToken) + addMeta(caseList, $1.Meta, meta.ColonToken) + addMeta(caseList, $3.Meta, meta.EndswitchToken) + addMeta($$, $4.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1932,10 +1932,10 @@ switch_case_list: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5)) // save comments - caseList.AddComments($1.Comments, comment.ColonToken) - caseList.AddComments($2.Comments, comment.SemiColonToken) - caseList.AddComments($4.Comments, comment.EndswitchToken) - $$.AddComments($5.Comments, comment.SemiColonToken) + addMeta(caseList, $1.Meta, meta.ColonToken) + addMeta(caseList, $2.Meta, meta.SemiColonToken) + addMeta(caseList, $4.Meta, meta.EndswitchToken) + addMeta($$, $5.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1958,8 +1958,8 @@ case_list: _case.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $5)) // save comments - _case.AddComments($2.Comments, comment.CaseToken) - _case.AddComments($4.Comments, comment.CaseSeparatorToken) + addMeta(_case, $2.Meta, meta.CaseToken) + addMeta(_case, $4.Meta, meta.CaseSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1972,8 +1972,8 @@ case_list: _default.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $4)) // save comments - _default.AddComments($2.Comments, comment.DefaultToken) - _default.AddComments($3.Comments, comment.CaseSeparatorToken) + addMeta(_default, $2.Meta, meta.DefaultToken) + addMeta(_default, $3.Meta, meta.CaseSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2012,9 +2012,9 @@ while_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $$.AddComments($1.Comments, comment.ColonToken) - $$.AddComments($3.Comments, comment.EndwhileToken) - $$.AddComments($4.Comments, comment.SemiColonToken) + addMeta($$, $1.Meta, meta.ColonToken) + addMeta($$, $3.Meta, meta.EndwhileToken) + addMeta($$, $4.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2038,7 +2038,7 @@ elseif_list: _elseIf.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $4)) // save comments - _elseIf.AddComments($2.Comments, comment.ElseifToken) + addMeta(_elseIf, $2.Meta, meta.ElseifToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2063,8 +2063,8 @@ new_elseif_list: _elseIf.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $5)) // save comments - _elseIf.AddComments($2.Comments, comment.ElseifToken) - _elseIf.AddComments($4.Comments, comment.ColonToken) + addMeta(_elseIf, $2.Meta, meta.ElseifToken) + addMeta(_elseIf, $4.Meta, meta.ColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2086,7 +2086,7 @@ else_single: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $$.AddComments($1.Comments, comment.ElseToken) + addMeta($$, $1.Meta, meta.ElseToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2110,8 +2110,8 @@ new_else_single: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3)) // save comments - $$.AddComments($1.Comments, comment.ElseToken) - $$.AddComments($2.Comments, comment.ColonToken) + addMeta($$, $1.Meta, meta.ElseToken) + addMeta($$, $2.Meta, meta.ColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2145,7 +2145,7 @@ non_empty_parameter_list: $$ = append($1, $3) // save comments - lastNode($1).AddComments($2.Comments, comment.CommaToken) + addMeta(lastNode($1), $2.Meta, meta.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2173,12 +2173,12 @@ parameter: // save comments if $2 != nil { - $$.AddComments($2.Comments, comment.AmpersandToken) + addMeta($$, $2.Meta, meta.AmpersandToken) } if $3 != nil { - $$.AddComments($3.Comments, comment.EllipsisToken) + addMeta($$, $3.Meta, meta.EllipsisToken) } - variable.AddComments($4.Comments, comment.VariableToken) + addMeta(variable, $4.Meta, meta.VariableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2203,13 +2203,13 @@ parameter: // save comments if $2 != nil { - $$.AddComments($2.Comments, comment.AmpersandToken) + addMeta($$, $2.Meta, meta.AmpersandToken) } if $3 != nil { - $$.AddComments($3.Comments, comment.EllipsisToken) + addMeta($$, $3.Meta, meta.EllipsisToken) } - variable.AddComments($4.Comments, comment.VariableToken) - $$.AddComments($5.Comments, comment.EqualToken) + addMeta(variable, $4.Meta, meta.VariableToken) + addMeta($$, $5.Meta, meta.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2231,7 +2231,7 @@ optional_class_type: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $$.AddComments($1.Comments, comment.ArrayToken) + addMeta($$, $1.Meta, meta.ArrayToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2243,7 +2243,7 @@ optional_class_type: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $$.AddComments($1.Comments, comment.CallableToken) + addMeta($$, $1.Meta, meta.CallableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2265,8 +2265,8 @@ function_call_parameter_list: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - $$.AddComments($1.Comments, comment.OpenParenthesisToken) - $$.AddComments($2.Comments, comment.CloseParenthesisToken) + addMeta($$, $1.Meta, meta.OpenParenthesisToken) + addMeta($$, $2.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2278,8 +2278,8 @@ function_call_parameter_list: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $$.AddComments($1.Comments, comment.OpenParenthesisToken) - $$.AddComments($3.Comments, comment.CloseParenthesisToken) + addMeta($$, $1.Meta, meta.OpenParenthesisToken) + addMeta($$, $3.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2293,8 +2293,8 @@ function_call_parameter_list: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $$.AddComments($1.Comments, comment.OpenParenthesisToken) - $$.AddComments($3.Comments, comment.CloseParenthesisToken) + addMeta($$, $1.Meta, meta.OpenParenthesisToken) + addMeta($$, $3.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2313,7 +2313,7 @@ non_empty_function_call_parameter_list: $$ = append($1, $3) // save comments - lastNode($1).AddComments($2.Comments, comment.CommaToken) + addMeta(lastNode($1), $2.Meta, meta.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2346,7 +2346,7 @@ function_call_parameter: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($2)) // save comments - $$.AddComments($1.Comments, comment.AmpersandToken) + addMeta($$, $1.Meta, meta.AmpersandToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2358,7 +2358,7 @@ function_call_parameter: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $$.AddComments($1.Comments, comment.EllipsisToken) + addMeta($$, $1.Meta, meta.EllipsisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2370,7 +2370,7 @@ global_var_list: $$ = append($1, $3) // save comments - lastNode($1).AddComments($2.Comments, comment.CommaToken) + addMeta(lastNode($1), $2.Meta, meta.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2394,7 +2394,7 @@ global_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $$.AddComments($1.Comments, comment.VariableToken) + addMeta($$, $1.Meta, meta.VariableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2406,7 +2406,7 @@ global_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $$.AddComments($1.Comments, comment.DollarToken) + addMeta($$, $1.Meta, meta.DollarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2418,9 +2418,9 @@ global_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $$.AddComments($1.Comments, comment.DollarToken) - $$.AddComments($2.Comments, comment.OpenCurlyBracesToken) - $$.AddComments($4.Comments, comment.CloseCurlyBracesToken) + addMeta($$, $1.Meta, meta.DollarToken) + addMeta($$, $2.Meta, meta.OpenCurlyBracesToken) + addMeta($$, $4.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2441,8 +2441,8 @@ static_var_list: staticVar.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) // save comments - lastNode($1).AddComments($2.Comments, comment.CommaToken) - variable.AddComments($3.Comments, comment.VariableToken) + addMeta(lastNode($1), $2.Meta, meta.CommaToken) + addMeta(variable, $3.Meta, meta.VariableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2459,9 +2459,9 @@ static_var_list: staticVar.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $5)) // save comments - lastNode($1).AddComments($2.Comments, comment.CommaToken) - variable.AddComments($3.Comments, comment.VariableToken) - staticVar.AddComments($4.Comments, comment.EqualToken) + addMeta(lastNode($1), $2.Meta, meta.CommaToken) + addMeta(variable, $3.Meta, meta.VariableToken) + addMeta(staticVar, $4.Meta, meta.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2478,7 +2478,7 @@ static_var_list: staticVar.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - variable.AddComments($1.Comments, comment.VariableToken) + addMeta(variable, $1.Meta, meta.VariableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2495,8 +2495,8 @@ static_var_list: staticVar.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) // save comments - variable.AddComments($1.Comments, comment.VariableToken) - staticVar.AddComments($2.Comments, comment.EqualToken) + addMeta(variable, $1.Meta, meta.VariableToken) + addMeta(staticVar, $2.Meta, meta.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2528,7 +2528,7 @@ class_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $3)) // save comments - $$.AddComments($3.Comments, comment.SemiColonToken) + addMeta($$, $3.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2540,7 +2540,7 @@ class_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) // save comments - $$.AddComments($2.Comments, comment.SemiColonToken) + addMeta($$, $2.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2564,13 +2564,13 @@ class_statement: } // save comments - $$.AddComments($2.Comments, comment.FunctionToken) + addMeta($$, $2.Meta, meta.FunctionToken) if $3 != nil { - $$.AddComments($3.Comments, comment.AmpersandToken) + addMeta($$, $3.Meta, meta.AmpersandToken) } - name.AddComments($4.Comments, comment.IdentifierToken) - $$.AddComments($5.Comments, comment.OpenParenthesisToken) - $$.AddComments($7.Comments, comment.CloseParenthesisToken) + addMeta(name, $4.Meta, meta.IdentifierToken) + addMeta($$, $5.Meta, meta.OpenParenthesisToken) + addMeta($$, $7.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2592,7 +2592,7 @@ trait_use_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) // save comments - $$.AddComments($1.Comments, comment.UseToken) + addMeta($$, $1.Meta, meta.UseToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2610,7 +2610,7 @@ trait_list: $$ = append($1, $3) // save comments - lastNode($1).AddComments($2.Comments, comment.CommaToken) + addMeta(lastNode($1), $2.Meta, meta.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2624,7 +2624,7 @@ trait_adaptations: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $$.AddComments($1.Comments, comment.SemiColonToken) + addMeta($$, $1.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -2636,8 +2636,8 @@ trait_adaptations: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $$.AddComments($1.Comments, comment.OpenCurlyBracesToken) - $$.AddComments($3.Comments, comment.CloseCurlyBracesToken) + addMeta($$, $1.Meta, meta.OpenCurlyBracesToken) + addMeta($$, $3.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2679,7 +2679,7 @@ trait_adaptation_statement: $$ = $1; // save comments - $$.AddComments($2.Comments, comment.SemiColonToken) + addMeta($$, $2.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2688,7 +2688,7 @@ trait_adaptation_statement: $$ = $1; // save comments - $$.AddComments($2.Comments, comment.SemiColonToken) + addMeta($$, $2.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2703,7 +2703,7 @@ trait_precedence: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeNodeListPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.InsteadofToken) + addMeta($$, $2.Meta, meta.InsteadofToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2721,7 +2721,7 @@ trait_reference_list: $$ = append($1, $3) // save comments - lastNode($1).AddComments($2.Comments, comment.CommaToken) + addMeta(lastNode($1), $2.Meta, meta.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2738,7 +2738,7 @@ trait_method_reference: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - name.AddComments($1.Comments, comment.IdentifierToken) + addMeta(name, $1.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2761,8 +2761,8 @@ trait_method_reference_fully_qualified: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.PaamayimNekudotayimToken) - target.AddComments($3.Comments, comment.IdentifierToken) + addMeta($$, $2.Meta, meta.PaamayimNekudotayimToken) + addMeta(target, $3.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2779,8 +2779,8 @@ trait_alias: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments - $$.AddComments($2.Comments, comment.AsToken) - alias.AddComments($4.Comments, comment.IdentifierToken) + addMeta($$, $2.Meta, meta.AsToken) + addMeta(alias, $4.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2792,7 +2792,7 @@ trait_alias: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.AsToken) + addMeta($$, $2.Meta, meta.AsToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2822,7 +2822,7 @@ method_body: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $$.AddComments($1.Comments, comment.SemiColonToken) + addMeta($$, $1.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2834,8 +2834,8 @@ method_body: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $$.AddComments($1.Comments, comment.OpenCurlyBracesToken) - $$.AddComments($3.Comments, comment.CloseCurlyBracesToken) + addMeta($$, $1.Meta, meta.OpenCurlyBracesToken) + addMeta($$, $3.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2857,7 +2857,7 @@ variable_modifiers: modifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - modifier.AddComments($1.Comments, comment.VarToken) + addMeta(modifier, $1.Meta, meta.VarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2902,7 +2902,7 @@ member_modifier: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $$.AddComments($1.Comments, comment.PublicToken) + addMeta($$, $1.Meta, meta.PublicToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2914,7 +2914,7 @@ member_modifier: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $$.AddComments($1.Comments, comment.ProtectedToken) + addMeta($$, $1.Meta, meta.ProtectedToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2926,7 +2926,7 @@ member_modifier: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $$.AddComments($1.Comments, comment.PrivateToken) + addMeta($$, $1.Meta, meta.PrivateToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2938,7 +2938,7 @@ member_modifier: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $$.AddComments($1.Comments, comment.StaticToken) + addMeta($$, $1.Meta, meta.StaticToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2950,7 +2950,7 @@ member_modifier: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $$.AddComments($1.Comments, comment.AbstractToken) + addMeta($$, $1.Meta, meta.AbstractToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2962,7 +2962,7 @@ member_modifier: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $$.AddComments($1.Comments, comment.FinalToken) + addMeta($$, $1.Meta, meta.FinalToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2982,8 +2982,8 @@ class_variable_declaration: property.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) // save comments - lastNode($1).AddComments($2.Comments, comment.CommaToken) - variable.AddComments($3.Comments, comment.VariableToken) + addMeta(lastNode($1), $2.Meta, meta.CommaToken) + addMeta(variable, $3.Meta, meta.VariableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3000,9 +3000,9 @@ class_variable_declaration: property.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $5)) // save comments - lastNode($1).AddComments($2.Comments, comment.CommaToken) - variable.AddComments($3.Comments, comment.VariableToken) - property.AddComments($4.Comments, comment.EqualToken) + addMeta(lastNode($1), $2.Meta, meta.CommaToken) + addMeta(variable, $3.Meta, meta.VariableToken) + addMeta(property, $4.Meta, meta.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3019,7 +3019,7 @@ class_variable_declaration: property.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - variable.AddComments($1.Comments, comment.VariableToken) + addMeta(variable, $1.Meta, meta.VariableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3036,8 +3036,8 @@ class_variable_declaration: property.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) // save comments - variable.AddComments($1.Comments, comment.VariableToken) - property.AddComments($2.Comments, comment.EqualToken) + addMeta(variable, $1.Meta, meta.VariableToken) + addMeta(property, $2.Meta, meta.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3058,9 +3058,9 @@ class_constant_declaration: $1.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $5)) // save comments - lastNode(constList.Consts).AddComments($2.Comments, comment.CommaToken) - name.AddComments($3.Comments, comment.IdentifierToken) - constant.AddComments($4.Comments, comment.EqualToken) + addMeta(lastNode(constList.Consts), $2.Meta, meta.CommaToken) + addMeta(name, $3.Meta, meta.IdentifierToken) + addMeta(constant, $4.Meta, meta.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3076,9 +3076,9 @@ class_constant_declaration: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $4)) // save comments - $$.AddComments($1.Comments, comment.ConstToken) - name.AddComments($2.Comments, comment.IdentifierToken) - constant.AddComments($3.Comments, comment.EqualToken) + addMeta($$, $1.Meta, meta.ConstToken) + addMeta(name, $2.Meta, meta.IdentifierToken) + addMeta(constant, $3.Meta, meta.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3090,7 +3090,7 @@ echo_expr_list: $$ = append($1, $3) // save comments - lastNode($1).AddComments($2.Comments, comment.CommaToken) + addMeta(lastNode($1), $2.Meta, meta.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3124,7 +3124,7 @@ non_empty_for_expr: $$ = append($1, $3) // save comments - lastNode($1).AddComments($2.Comments, comment.CommaToken) + addMeta(lastNode($1), $2.Meta, meta.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3161,8 +3161,8 @@ chaining_dereference: fetch.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($3)) // save comments - fetch.AddComments($2.Comments, comment.OpenSquareBracket) - fetch.AddComments($4.Comments, comment.CloseSquareBracket) + addMeta(fetch, $2.Meta, meta.OpenSquareBracket) + addMeta(fetch, $4.Meta, meta.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3175,8 +3175,8 @@ chaining_dereference: fetch.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($2)) // save comments - fetch.AddComments($1.Comments, comment.OpenSquareBracket) - fetch.AddComments($3.Comments, comment.CloseSquareBracket) + addMeta(fetch, $1.Meta, meta.OpenSquareBracket) + addMeta(fetch, $3.Meta, meta.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3231,7 +3231,7 @@ new_expr: } // save comments - $$.AddComments($1.Comments, comment.NewToken) + addMeta($$, $1.Meta, meta.NewToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3248,10 +3248,10 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $6)) // save comments - list.AddComments($1.Comments, comment.ListToken) - list.AddComments($2.Comments, comment.OpenParenthesisToken) - list.AddComments($4.Comments, comment.CloseParenthesisToken) - $$.AddComments($5.Comments, comment.EqualToken) + addMeta(list, $1.Meta, meta.ListToken) + addMeta(list, $2.Meta, meta.OpenParenthesisToken) + addMeta(list, $4.Meta, meta.CloseParenthesisToken) + addMeta($$, $5.Meta, meta.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3263,7 +3263,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.EqualToken) + addMeta($$, $2.Meta, meta.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3275,8 +3275,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) // save comments - $$.AddComments($2.Comments, comment.EqualToken) - $$.AddComments($3.Comments, comment.AmpersandToken) + addMeta($$, $2.Meta, meta.EqualToken) + addMeta($$, $3.Meta, meta.AmpersandToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3300,9 +3300,9 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, _new)) // save comments - $$.AddComments($2.Comments, comment.EqualToken) - $$.AddComments($3.Comments, comment.AmpersandToken) - _new.AddComments($4.Comments, comment.NewToken) + addMeta($$, $2.Meta, meta.EqualToken) + addMeta($$, $3.Meta, meta.AmpersandToken) + addMeta(_new, $4.Meta, meta.NewToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3314,7 +3314,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $$.AddComments($1.Comments, comment.CloneToken) + addMeta($$, $1.Meta, meta.CloneToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3326,7 +3326,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.PlusEqualToken) + addMeta($$, $2.Meta, meta.PlusEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3338,7 +3338,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.MinusEqualToken) + addMeta($$, $2.Meta, meta.MinusEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3350,7 +3350,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.MulEqualToken) + addMeta($$, $2.Meta, meta.MulEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3362,7 +3362,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.PowEqualToken) + addMeta($$, $2.Meta, meta.PowEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3374,7 +3374,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.DivEqualToken) + addMeta($$, $2.Meta, meta.DivEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3386,7 +3386,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.ConcatEqualToken) + addMeta($$, $2.Meta, meta.ConcatEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3398,7 +3398,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.ModEqualToken) + addMeta($$, $2.Meta, meta.ModEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3410,7 +3410,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.AndEqualToken) + addMeta($$, $2.Meta, meta.AndEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3422,7 +3422,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.OrEqualToken) + addMeta($$, $2.Meta, meta.OrEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3434,7 +3434,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.XorEqualToken) + addMeta($$, $2.Meta, meta.XorEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3446,7 +3446,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.SlEqualToken) + addMeta($$, $2.Meta, meta.SlEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3458,7 +3458,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.SrEqualToken) + addMeta($$, $2.Meta, meta.SrEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3470,7 +3470,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) // save comments - $$.AddComments($2.Comments, comment.IncToken) + addMeta($$, $2.Meta, meta.IncToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3482,7 +3482,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $$.AddComments($1.Comments, comment.IncToken) + addMeta($$, $1.Meta, meta.IncToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3494,7 +3494,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) // save comments - $$.AddComments($2.Comments, comment.DecToken) + addMeta($$, $2.Meta, meta.DecToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3506,7 +3506,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $$.AddComments($1.Comments, comment.DecToken) + addMeta($$, $1.Meta, meta.DecToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3518,7 +3518,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.BooleanOrToken) + addMeta($$, $2.Meta, meta.BooleanOrToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3530,7 +3530,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.BooleanAndToken) + addMeta($$, $2.Meta, meta.BooleanAndToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3542,7 +3542,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.LogicalOrToken) + addMeta($$, $2.Meta, meta.LogicalOrToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3554,7 +3554,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.LogicalAndToken) + addMeta($$, $2.Meta, meta.LogicalAndToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3566,7 +3566,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.LogicalXorToken) + addMeta($$, $2.Meta, meta.LogicalXorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3578,7 +3578,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.VerticalBarToken) + addMeta($$, $2.Meta, meta.VerticalBarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3590,7 +3590,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.AmpersandToken) + addMeta($$, $2.Meta, meta.AmpersandToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3602,7 +3602,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.CaretToken) + addMeta($$, $2.Meta, meta.CaretToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3614,7 +3614,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.DotToken) + addMeta($$, $2.Meta, meta.DotToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3626,7 +3626,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.PlusToken) + addMeta($$, $2.Meta, meta.PlusToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3638,7 +3638,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.MinusToken) + addMeta($$, $2.Meta, meta.MinusToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3650,7 +3650,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.AsteriskToken) + addMeta($$, $2.Meta, meta.AsteriskToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3662,7 +3662,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.PowToken) + addMeta($$, $2.Meta, meta.PowToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3674,7 +3674,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.SlashToken) + addMeta($$, $2.Meta, meta.SlashToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3686,7 +3686,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.PercentToken) + addMeta($$, $2.Meta, meta.PercentToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3698,7 +3698,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.SlToken) + addMeta($$, $2.Meta, meta.SlToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3710,7 +3710,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.SrToken) + addMeta($$, $2.Meta, meta.SrToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3722,7 +3722,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $$.AddComments($1.Comments, comment.PlusToken) + addMeta($$, $1.Meta, meta.PlusToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3734,7 +3734,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $$.AddComments($1.Comments, comment.MinusToken) + addMeta($$, $1.Meta, meta.MinusToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3746,7 +3746,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $$.AddComments($1.Comments, comment.ExclamationMarkToken) + addMeta($$, $1.Meta, meta.ExclamationMarkToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3758,7 +3758,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $$.AddComments($1.Comments, comment.TildeToken) + addMeta($$, $1.Meta, meta.TildeToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3770,7 +3770,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.IsIdenticalToken) + addMeta($$, $2.Meta, meta.IsIdenticalToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3782,7 +3782,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.IsNotIdenticalToken) + addMeta($$, $2.Meta, meta.IsNotIdenticalToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3794,7 +3794,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.IsEqualToken) + addMeta($$, $2.Meta, meta.IsEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3806,7 +3806,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.IsNotEqualToken) + addMeta($$, $2.Meta, meta.IsNotEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3818,7 +3818,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.LessToken) + addMeta($$, $2.Meta, meta.LessToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3830,7 +3830,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.IsSmallerOrEqualToken) + addMeta($$, $2.Meta, meta.IsSmallerOrEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3842,7 +3842,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.GreaterToken) + addMeta($$, $2.Meta, meta.GreaterToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3854,7 +3854,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.IsGreaterOrEqualToken) + addMeta($$, $2.Meta, meta.IsGreaterOrEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3866,7 +3866,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.InstanceofToken) + addMeta($$, $2.Meta, meta.InstanceofToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3906,8 +3906,8 @@ expr_without_variable: } // save comments - $$.AddComments($1.Comments, comment.OpenParenthesisToken) - $$.AddComments($3.Comments, comment.CloseParenthesisToken) + addMeta($$, $1.Meta, meta.OpenParenthesisToken) + addMeta($$, $3.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3919,8 +3919,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $5)) // save comments - $$.AddComments($2.Comments, comment.QuestionMarkToken) - $$.AddComments($4.Comments, comment.ColonToken) + addMeta($$, $2.Meta, meta.QuestionMarkToken) + addMeta($$, $4.Meta, meta.ColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3932,8 +3932,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) // save comments - $$.AddComments($2.Comments, comment.QuestionMarkToken) - $$.AddComments($3.Comments, comment.ColonToken) + addMeta($$, $2.Meta, meta.QuestionMarkToken) + addMeta($$, $3.Meta, meta.ColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3951,7 +3951,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $$.AddComments($1.Comments, comment.IntCastToken) + addMeta($$, $1.Meta, meta.IntCastToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3963,7 +3963,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $$.AddComments($1.Comments, comment.DoubleCastToken) + addMeta($$, $1.Meta, meta.DoubleCastToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3975,7 +3975,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $$.AddComments($1.Comments, comment.StringCastToken) + addMeta($$, $1.Meta, meta.StringCastToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3987,7 +3987,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $$.AddComments($1.Comments, comment.ArrayCastToken) + addMeta($$, $1.Meta, meta.ArrayCastToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3999,7 +3999,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $$.AddComments($1.Comments, comment.ObjectCastToken) + addMeta($$, $1.Meta, meta.ObjectCastToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4011,7 +4011,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $$.AddComments($1.Comments, comment.BoolCastToken) + addMeta($$, $1.Meta, meta.BoolCastToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4023,7 +4023,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $$.AddComments($1.Comments, comment.UnsetCastToken) + addMeta($$, $1.Meta, meta.UnsetCastToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4051,11 +4051,7 @@ expr_without_variable: } // save comments - $$.AddComments($1.Comments, comment.ExitToken) - - if $2 != nil { - yylex.(*Parser).comments.AddFromChildNode($$, $2) - } + addMeta($$, $1.Meta, meta.ExitToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4067,7 +4063,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $$.AddComments($1.Comments, comment.AtToken) + addMeta($$, $1.Meta, meta.AtToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4097,8 +4093,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $$.AddComments($1.Comments, comment.BackquoteToken) - $$.AddComments($3.Comments, comment.BackquoteToken) + addMeta($$, $1.Meta, meta.BackquoteToken) + addMeta($$, $3.Meta, meta.BackquoteToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4110,7 +4106,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $$.AddComments($1.Comments, comment.PrintToken) + addMeta($$, $1.Meta, meta.PrintToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4122,7 +4118,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $$.AddComments($1.Comments, comment.YieldToken) + addMeta($$, $1.Meta, meta.YieldToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4134,14 +4130,14 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $9)) // save comments - $$.AddComments($1.Comments, comment.FunctionToken) + addMeta($$, $1.Meta, meta.FunctionToken) if $2 != nil { - $$.AddComments($2.Comments, comment.AmpersandToken) + addMeta($$, $2.Meta, meta.AmpersandToken) } - $$.AddComments($3.Comments, comment.OpenParenthesisToken) - $$.AddComments($5.Comments, comment.CloseParenthesisToken) - $$.AddComments($7.Comments, comment.OpenCurlyBracesToken) - $$.AddComments($9.Comments, comment.CloseCurlyBracesToken) + addMeta($$, $3.Meta, meta.OpenParenthesisToken) + addMeta($$, $5.Meta, meta.CloseParenthesisToken) + addMeta($$, $7.Meta, meta.OpenCurlyBracesToken) + addMeta($$, $9.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4153,15 +4149,15 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $10)) // save comments - $$.AddComments($1.Comments, comment.StaticToken) - $$.AddComments($2.Comments, comment.FunctionToken) + addMeta($$, $1.Meta, meta.StaticToken) + addMeta($$, $2.Meta, meta.FunctionToken) if $3 != nil { - $$.AddComments($3.Comments, comment.AmpersandToken) + addMeta($$, $3.Meta, meta.AmpersandToken) } - $$.AddComments($4.Comments, comment.OpenParenthesisToken) - $$.AddComments($6.Comments, comment.CloseParenthesisToken) - $$.AddComments($8.Comments, comment.OpenCurlyBracesToken) - $$.AddComments($10.Comments, comment.CloseCurlyBracesToken) + addMeta($$, $4.Meta, meta.OpenParenthesisToken) + addMeta($$, $6.Meta, meta.CloseParenthesisToken) + addMeta($$, $8.Meta, meta.OpenCurlyBracesToken) + addMeta($$, $10.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4176,7 +4172,7 @@ yield_expr: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $$.AddComments($1.Comments, comment.YieldToken) + addMeta($$, $1.Meta, meta.YieldToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4188,7 +4184,7 @@ yield_expr: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $$.AddComments($1.Comments, comment.YieldToken) + addMeta($$, $1.Meta, meta.YieldToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4200,8 +4196,8 @@ yield_expr: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $4)) // save comments - $$.AddComments($1.Comments, comment.YieldToken) - $$.AddComments($3.Comments, comment.DoubleArrowToken) + addMeta($$, $1.Meta, meta.YieldToken) + addMeta($$, $3.Meta, meta.DoubleArrowToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4213,8 +4209,8 @@ yield_expr: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $4)) // save comments - $$.AddComments($1.Comments, comment.YieldToken) - $$.AddComments($3.Comments, comment.DoubleArrowToken) + addMeta($$, $1.Meta, meta.YieldToken) + addMeta($$, $3.Meta, meta.DoubleArrowToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4229,8 +4225,8 @@ combined_scalar_offset: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments - $$.AddComments($2.Comments, comment.OpenSquareBracket) - $$.AddComments($4.Comments, comment.CloseSquareBracket) + addMeta($$, $2.Meta, meta.OpenSquareBracket) + addMeta($$, $4.Meta, meta.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4242,8 +4238,8 @@ combined_scalar_offset: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments - $$.AddComments($2.Comments, comment.OpenSquareBracket) - $$.AddComments($4.Comments, comment.CloseSquareBracket) + addMeta($$, $2.Meta, meta.OpenSquareBracket) + addMeta($$, $4.Meta, meta.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4257,8 +4253,8 @@ combined_scalar_offset: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(str, $4)) // save comments - $$.AddComments($2.Comments, comment.OpenSquareBracket) - $$.AddComments($4.Comments, comment.CloseSquareBracket) + addMeta($$, $2.Meta, meta.OpenSquareBracket) + addMeta($$, $4.Meta, meta.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4270,8 +4266,8 @@ combined_scalar_offset: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments - $$.AddComments($2.Comments, comment.OpenSquareBracket) - $$.AddComments($4.Comments, comment.CloseSquareBracket) + addMeta($$, $2.Meta, meta.OpenSquareBracket) + addMeta($$, $4.Meta, meta.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4286,9 +4282,9 @@ combined_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $$.AddComments($1.Comments, comment.ArrayToken) - $$.AddComments($2.Comments, comment.OpenParenthesisToken) - $$.AddComments($4.Comments, comment.CloseParenthesisToken) + addMeta($$, $1.Meta, meta.ArrayToken) + addMeta($$, $2.Meta, meta.OpenParenthesisToken) + addMeta($$, $4.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4300,8 +4296,8 @@ combined_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $$.AddComments($1.Comments, comment.OpenSquareBracket) - $$.AddComments($3.Comments, comment.CloseSquareBracket) + addMeta($$, $1.Meta, meta.OpenSquareBracket) + addMeta($$, $3.Meta, meta.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4343,8 +4339,8 @@ lexical_var_list: variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) // save comments - lastNode($1).AddComments($2.Comments, comment.CommaToken) - variable.AddComments($3.Comments, comment.VariableToken) + addMeta(lastNode($1), $2.Meta, meta.CommaToken) + addMeta(variable, $3.Meta, meta.VariableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4361,9 +4357,9 @@ lexical_var_list: reference.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($3, $4)) // save comments - lastNode($1).AddComments($2.Comments, comment.CommaToken) - reference.AddComments($3.Comments, comment.VariableToken) - variable.AddComments($4.Comments, comment.VariableToken) + addMeta(lastNode($1), $2.Meta, meta.CommaToken) + addMeta(reference, $3.Meta, meta.VariableToken) + addMeta(variable, $4.Meta, meta.VariableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4378,7 +4374,7 @@ lexical_var_list: variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - variable.AddComments($1.Comments, comment.VariableToken) + addMeta(variable, $1.Meta, meta.VariableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4395,8 +4391,8 @@ lexical_var_list: reference.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - reference.AddComments($1.Comments, comment.VariableToken) - variable.AddComments($2.Comments, comment.VariableToken) + addMeta(reference, $1.Meta, meta.VariableToken) + addMeta(variable, $2.Meta, meta.VariableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4424,8 +4420,8 @@ function_call: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(funcName, $4)) // save comments - funcName.AddComments($1.Comments, comment.NamespaceToken) - funcName.AddComments($2.Comments, comment.NsSeparatorToken) + addMeta(funcName, $1.Meta, meta.NamespaceToken) + addMeta(funcName, $2.Meta, meta.NsSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4439,7 +4435,7 @@ function_call: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(funcName, $3)) // save comments - funcName.AddComments($1.Comments, comment.NsSeparatorToken) + addMeta(funcName, $1.Meta, meta.NsSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4451,7 +4447,7 @@ function_call: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) // save comments - $$.AddComments($2.Comments, comment.PaamayimNekudotayimToken) + addMeta($$, $2.Meta, meta.PaamayimNekudotayimToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4463,7 +4459,7 @@ function_call: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) // save comments - $$.AddComments($2.Comments, comment.PaamayimNekudotayimToken) + addMeta($$, $2.Meta, meta.PaamayimNekudotayimToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4475,7 +4471,7 @@ function_call: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) // save comments - $$.AddComments($2.Comments, comment.PaamayimNekudotayimToken) + addMeta($$, $2.Meta, meta.PaamayimNekudotayimToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4487,7 +4483,7 @@ function_call: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) // save comments - $$.AddComments($2.Comments, comment.PaamayimNekudotayimToken) + addMeta($$, $2.Meta, meta.PaamayimNekudotayimToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4511,7 +4507,7 @@ class_name: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $$.AddComments($1.Comments, comment.StaticToken) + addMeta($$, $1.Meta, meta.StaticToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4532,8 +4528,8 @@ class_name: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3)) // save comments - $$.AddComments($1.Comments, comment.NamespaceToken) - $$.AddComments($2.Comments, comment.NsSeparatorToken) + addMeta($$, $1.Meta, meta.NamespaceToken) + addMeta($$, $2.Meta, meta.NsSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4545,7 +4541,7 @@ class_name: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) // save comments - $$.AddComments($1.Comments, comment.NsSeparatorToken) + addMeta($$, $1.Meta, meta.NsSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4569,8 +4565,8 @@ fully_qualified_class_name: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3)) // save comments - $$.AddComments($1.Comments, comment.NamespaceToken) - $$.AddComments($2.Comments, comment.NsSeparatorToken) + addMeta($$, $1.Meta, meta.NamespaceToken) + addMeta($$, $2.Meta, meta.NsSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4582,7 +4578,7 @@ fully_qualified_class_name: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) // save comments - $$.AddComments($1.Comments, comment.NsSeparatorToken) + addMeta($$, $1.Meta, meta.NsSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4609,7 +4605,7 @@ dynamic_class_name_reference: $$ = $1 // save comments - $3[0].AddComments($2.Comments, comment.ObjectOperatorToken) + addMeta($3[0], $2.Meta, meta.ObjectOperatorToken) for _, n := range($3) { switch nn := n.(type) { @@ -4672,7 +4668,7 @@ dynamic_class_name_variable_property: $$ = $2 // save comments - $2[0].AddComments($1.Comments, comment.ObjectOperatorToken) + addMeta($2[0], $1.Meta, meta.ObjectOperatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4693,8 +4689,8 @@ exit_expr: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - $$.AddComments($1.Comments, comment.OpenParenthesisToken) - $$.AddComments($2.Comments, comment.CloseParenthesisToken) + addMeta($$, $1.Meta, meta.OpenParenthesisToken) + addMeta($$, $2.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4754,7 +4750,7 @@ common_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $$.AddComments($1.Comments, comment.LnumberToken) + addMeta($$, $1.Meta, meta.LnumberToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4766,7 +4762,7 @@ common_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $$.AddComments($1.Comments, comment.DnumberToken) + addMeta($$, $1.Meta, meta.DnumberToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4778,7 +4774,7 @@ common_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $$.AddComments($1.Comments, comment.ConstantEncapsedStringToken) + addMeta($$, $1.Meta, meta.ConstantEncapsedStringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4790,7 +4786,7 @@ common_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $$.AddComments($1.Comments, comment.LineToken) + addMeta($$, $1.Meta, meta.LineToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4802,7 +4798,7 @@ common_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $$.AddComments($1.Comments, comment.FileToken) + addMeta($$, $1.Meta, meta.FileToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4814,7 +4810,7 @@ common_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $$.AddComments($1.Comments, comment.DirToken) + addMeta($$, $1.Meta, meta.DirToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4826,7 +4822,7 @@ common_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $$.AddComments($1.Comments, comment.TraitCToken) + addMeta($$, $1.Meta, meta.TraitCToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4838,7 +4834,7 @@ common_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $$.AddComments($1.Comments, comment.MethodCToken) + addMeta($$, $1.Meta, meta.MethodCToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4850,7 +4846,7 @@ common_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $$.AddComments($1.Comments, comment.FuncCToken) + addMeta($$, $1.Meta, meta.FuncCToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4862,7 +4858,7 @@ common_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $$.AddComments($1.Comments, comment.NsCToken) + addMeta($$, $1.Meta, meta.NsCToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4876,7 +4872,7 @@ common_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $$.AddComments($1.Comments, comment.StartHeredocToken) + addMeta($$, $1.Meta, meta.StartHeredocToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4888,7 +4884,7 @@ common_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - $$.AddComments($1.Comments, comment.StartHeredocToken) + addMeta($$, $1.Meta, meta.StartHeredocToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4905,8 +4901,8 @@ static_class_constant: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.PaamayimNekudotayimToken) - target.AddComments($3.Comments, comment.IdentifierToken) + addMeta($$, $2.Meta, meta.PaamayimNekudotayimToken) + addMeta(target, $3.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4955,8 +4951,8 @@ static_scalar_value: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3)) // save comments - $$.AddComments($1.Comments, comment.NamespaceToken) - $$.AddComments($2.Comments, comment.NsSeparatorToken) + addMeta($$, $1.Meta, meta.NamespaceToken) + addMeta($$, $2.Meta, meta.NsSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4970,7 +4966,7 @@ static_scalar_value: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) // save comments - $$.AddComments($1.Comments, comment.NsSeparatorToken) + addMeta($$, $1.Meta, meta.NsSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4982,9 +4978,9 @@ static_scalar_value: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $$.AddComments($1.Comments, comment.ArrayToken) - $$.AddComments($2.Comments, comment.OpenParenthesisToken) - $$.AddComments($4.Comments, comment.CloseParenthesisToken) + addMeta($$, $1.Meta, meta.ArrayToken) + addMeta($$, $2.Meta, meta.OpenParenthesisToken) + addMeta($$, $4.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4996,8 +4992,8 @@ static_scalar_value: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $$.AddComments($1.Comments, comment.OpenSquareBracket) - $$.AddComments($3.Comments, comment.CloseSquareBracket) + addMeta($$, $1.Meta, meta.OpenSquareBracket) + addMeta($$, $3.Meta, meta.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5015,7 +5011,7 @@ static_scalar_value: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $$.AddComments($1.Comments, comment.ClassCToken) + addMeta($$, $1.Meta, meta.ClassCToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5036,8 +5032,8 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments - $$.AddComments($2.Comments, comment.OpenSquareBracket) - $$.AddComments($4.Comments, comment.CloseSquareBracket) + addMeta($$, $2.Meta, meta.OpenSquareBracket) + addMeta($$, $4.Meta, meta.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5049,7 +5045,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.PlusToken) + addMeta($$, $2.Meta, meta.PlusToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5061,7 +5057,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.MinusToken) + addMeta($$, $2.Meta, meta.MinusToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5073,7 +5069,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.AsteriskToken) + addMeta($$, $2.Meta, meta.AsteriskToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5085,7 +5081,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.PowToken) + addMeta($$, $2.Meta, meta.PowToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5097,7 +5093,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.SlashToken) + addMeta($$, $2.Meta, meta.SlashToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5109,7 +5105,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.PercentToken) + addMeta($$, $2.Meta, meta.PercentToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5121,7 +5117,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $$.AddComments($1.Comments, comment.ExclamationMarkToken) + addMeta($$, $1.Meta, meta.ExclamationMarkToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5133,7 +5129,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $$.AddComments($1.Comments, comment.TildeToken) + addMeta($$, $1.Meta, meta.TildeToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5145,7 +5141,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.VerticalBarToken) + addMeta($$, $2.Meta, meta.VerticalBarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5157,7 +5153,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.AmpersandToken) + addMeta($$, $2.Meta, meta.AmpersandToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5169,7 +5165,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.CaretToken) + addMeta($$, $2.Meta, meta.CaretToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5181,7 +5177,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.SlToken) + addMeta($$, $2.Meta, meta.SlToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5193,7 +5189,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.SrToken) + addMeta($$, $2.Meta, meta.SrToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5205,7 +5201,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.DotToken) + addMeta($$, $2.Meta, meta.DotToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5217,7 +5213,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.LogicalXorToken) + addMeta($$, $2.Meta, meta.LogicalXorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5229,7 +5225,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.LogicalAndToken) + addMeta($$, $2.Meta, meta.LogicalAndToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5241,7 +5237,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.LogicalOrToken) + addMeta($$, $2.Meta, meta.LogicalOrToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5253,7 +5249,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.BooleanAndToken) + addMeta($$, $2.Meta, meta.BooleanAndToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5265,7 +5261,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.BooleanOrToken) + addMeta($$, $2.Meta, meta.BooleanOrToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5277,7 +5273,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.IsIdenticalToken) + addMeta($$, $2.Meta, meta.IsIdenticalToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5289,7 +5285,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.IsNotIdenticalToken) + addMeta($$, $2.Meta, meta.IsNotIdenticalToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5301,7 +5297,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.IsEqualToken) + addMeta($$, $2.Meta, meta.IsEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5313,7 +5309,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.IsNotEqualToken) + addMeta($$, $2.Meta, meta.IsNotEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5325,7 +5321,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.LessToken) + addMeta($$, $2.Meta, meta.LessToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5337,7 +5333,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.GreaterToken) + addMeta($$, $2.Meta, meta.GreaterToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5349,7 +5345,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.IsSmallerOrEqualToken) + addMeta($$, $2.Meta, meta.IsSmallerOrEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5361,7 +5357,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.IsGreaterOrEqualToken) + addMeta($$, $2.Meta, meta.IsGreaterOrEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5373,8 +5369,8 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) // save comments - $$.AddComments($2.Comments, comment.QuestionMarkToken) - $$.AddComments($3.Comments, comment.ColonToken) + addMeta($$, $2.Meta, meta.QuestionMarkToken) + addMeta($$, $3.Meta, meta.ColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5386,8 +5382,8 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $5)) // save comments - $$.AddComments($2.Comments, comment.QuestionMarkToken) - $$.AddComments($4.Comments, comment.ColonToken) + addMeta($$, $2.Meta, meta.QuestionMarkToken) + addMeta($$, $4.Meta, meta.ColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5399,7 +5395,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $$.AddComments($1.Comments, comment.PlusToken) + addMeta($$, $1.Meta, meta.PlusToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5411,7 +5407,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $$.AddComments($1.Comments, comment.MinusToken) + addMeta($$, $1.Meta, meta.MinusToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5420,8 +5416,8 @@ static_operation: $$ = $2 // save comments - $$.AddComments($1.Comments, comment.OpenParenthesisToken) - $$.AddComments($3.Comments, comment.CloseParenthesisToken) + addMeta($$, $1.Meta, meta.OpenParenthesisToken) + addMeta($$, $3.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5453,8 +5449,8 @@ general_constant: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(name)) // save comments - $$.AddComments($1.Comments, comment.NamespaceToken) - $$.AddComments($2.Comments, comment.NsSeparatorToken) + addMeta($$, $1.Meta, meta.NamespaceToken) + addMeta($$, $2.Meta, meta.NsSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5468,7 +5464,7 @@ general_constant: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(name)) // save comments - $$.AddComments($1.Comments, comment.NsSeparatorToken) + addMeta($$, $1.Meta, meta.NsSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5485,7 +5481,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - name.AddComments($1.Comments, comment.StringVarnameToken) + addMeta(name, $1.Meta, meta.StringVarnameToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5515,7 +5511,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $$.AddComments($1.Comments, comment.DoubleQuoteToken) + addMeta($$, $1.Meta, meta.DoubleQuoteToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5527,7 +5523,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $$.AddComments($1.Comments, comment.StartHeredocToken) + addMeta($$, $1.Meta, meta.StartHeredocToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5539,7 +5535,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $$.AddComments($1.Comments, comment.ClassCToken) + addMeta($$, $1.Meta, meta.ClassCToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5558,7 +5554,7 @@ static_array_pair_list: // save comments if $2 != nil { - lastNode($1).AddComments($2.Comments, comment.CommaToken) + addMeta(lastNode($1), $2.Meta, meta.CommaToken) } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -5586,8 +5582,8 @@ non_empty_static_array_pair_list: arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($3, $5)) // save comments - lastNode($1).AddComments($2.Comments, comment.CommaToken) - arrayItem.AddComments($4.Comments, comment.DoubleArrowToken) + addMeta(lastNode($1), $2.Meta, meta.CommaToken) + addMeta(arrayItem, $4.Meta, meta.DoubleArrowToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5600,7 +5596,7 @@ non_empty_static_array_pair_list: arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($3)) // save comments - lastNode($1).AddComments($2.Comments, comment.CommaToken) + addMeta(lastNode($1), $2.Meta, meta.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5613,7 +5609,7 @@ non_empty_static_array_pair_list: arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - arrayItem.AddComments($2.Comments, comment.DoubleArrowToken) + addMeta(arrayItem, $2.Meta, meta.DoubleArrowToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5699,7 +5695,7 @@ variable: } // save comments - $3[0].AddComments($2.Comments, comment.ObjectOperatorToken) + addMeta($3[0], $2.Meta, meta.ObjectOperatorToken) for _, n := range($3) { switch nn := n.(type) { @@ -5776,7 +5772,7 @@ variable_property: $$ = $2 // save comments - $2[0].AddComments($1.Comments, comment.ObjectOperatorToken) + addMeta($2[0], $1.Meta, meta.ObjectOperatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5792,8 +5788,8 @@ array_method_dereference: fetch.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($3)) // save comments - fetch.AddComments($2.Comments, comment.OpenSquareBracket) - fetch.AddComments($4.Comments, comment.CloseSquareBracket) + addMeta(fetch, $2.Meta, meta.OpenSquareBracket) + addMeta(fetch, $4.Meta, meta.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5806,8 +5802,8 @@ array_method_dereference: fetch.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($3)) // save comments - fetch.AddComments($2.Comments, comment.OpenSquareBracket) - fetch.AddComments($4.Comments, comment.CloseSquareBracket) + addMeta(fetch, $2.Meta, meta.OpenSquareBracket) + addMeta(fetch, $4.Meta, meta.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5876,7 +5872,7 @@ static_member: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.PaamayimNekudotayimToken) + addMeta($$, $2.Meta, meta.PaamayimNekudotayimToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5888,7 +5884,7 @@ static_member: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.PaamayimNekudotayimToken) + addMeta($$, $2.Meta, meta.PaamayimNekudotayimToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5912,8 +5908,8 @@ array_function_dereference: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments - $$.AddComments($2.Comments, comment.OpenSquareBracket) - $$.AddComments($4.Comments, comment.CloseSquareBracket) + addMeta($$, $2.Meta, meta.OpenSquareBracket) + addMeta($$, $4.Meta, meta.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5925,8 +5921,8 @@ array_function_dereference: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments - $$.AddComments($2.Comments, comment.OpenSquareBracket) - $$.AddComments($4.Comments, comment.CloseSquareBracket) + addMeta($$, $2.Meta, meta.OpenSquareBracket) + addMeta($$, $4.Meta, meta.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5990,8 +5986,8 @@ reference_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments - $$.AddComments($2.Comments, comment.OpenSquareBracket) - $$.AddComments($4.Comments, comment.CloseSquareBracket) + addMeta($$, $2.Meta, meta.OpenSquareBracket) + addMeta($$, $4.Meta, meta.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6003,8 +5999,8 @@ reference_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments - $$.AddComments($2.Comments, comment.OpenCurlyBracesToken) - $$.AddComments($4.Comments, comment.CloseCurlyBracesToken) + addMeta($$, $2.Meta, meta.OpenCurlyBracesToken) + addMeta($$, $4.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6028,7 +6024,7 @@ compound_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $$.AddComments($1.Comments, comment.VariableToken) + addMeta($$, $1.Meta, meta.VariableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6040,9 +6036,9 @@ compound_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $$.AddComments($1.Comments, comment.DollarToken) - $$.AddComments($2.Comments, comment.OpenCurlyBracesToken) - $$.AddComments($4.Comments, comment.CloseCurlyBracesToken) + addMeta($$, $1.Meta, meta.DollarToken) + addMeta($$, $2.Meta, meta.OpenCurlyBracesToken) + addMeta($$, $4.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6093,8 +6089,8 @@ object_dim_list: fetch.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($3)) // save comments - fetch.AddComments($2.Comments, comment.OpenSquareBracket) - fetch.AddComments($4.Comments, comment.CloseSquareBracket) + addMeta(fetch, $2.Meta, meta.OpenSquareBracket) + addMeta(fetch, $4.Meta, meta.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6107,8 +6103,8 @@ object_dim_list: fetch.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($3)) // save comments - fetch.AddComments($2.Comments, comment.OpenCurlyBracesToken) - fetch.AddComments($4.Comments, comment.CloseCurlyBracesToken) + addMeta(fetch, $2.Meta, meta.OpenCurlyBracesToken) + addMeta(fetch, $4.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6133,7 +6129,7 @@ variable_name: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $$.AddComments($1.Comments, comment.StringToken) + addMeta($$, $1.Meta, meta.StringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6145,8 +6141,8 @@ variable_name: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $$.AddComments($1.Comments, comment.OpenCurlyBracesToken) - $$.AddComments($3.Comments, comment.CloseCurlyBracesToken) + addMeta($$, $1.Meta, meta.OpenCurlyBracesToken) + addMeta($$, $3.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6162,7 +6158,7 @@ simple_indirect_reference: n.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - n.AddComments($1.Comments, comment.DollarToken) + addMeta(n, $1.Meta, meta.DollarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6179,7 +6175,7 @@ simple_indirect_reference: n.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) // save comments - n.AddComments($2.Comments, comment.DollarToken) + addMeta(n, $2.Meta, meta.DollarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6195,7 +6191,7 @@ assignment_list: $$ = append($1, $3) // save comments - lastNode($1).AddComments($2.Comments, comment.CommaToken) + addMeta(lastNode($1), $2.Meta, meta.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6232,9 +6228,9 @@ assignment_list_element: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(item)) // save comments - item.AddComments($1.Comments, comment.ListToken) - item.AddComments($2.Comments, comment.OpenParenthesisToken) - item.AddComments($4.Comments, comment.CloseParenthesisToken) + addMeta(item, $1.Meta, meta.ListToken) + addMeta(item, $2.Meta, meta.OpenParenthesisToken) + addMeta(item, $4.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6264,7 +6260,7 @@ array_pair_list: // save comments if $2 != nil { - lastNode($1).AddComments($2.Comments, comment.CommaToken) + addMeta(lastNode($1), $2.Meta, meta.CommaToken) } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -6281,8 +6277,8 @@ non_empty_array_pair_list: arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($3, $5)) // save comments - lastNode($1).AddComments($2.Comments, comment.CommaToken) - arrayItem.AddComments($4.Comments, comment.DoubleArrowToken) + addMeta(lastNode($1), $2.Meta, meta.CommaToken) + addMeta(arrayItem, $4.Meta, meta.DoubleArrowToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6295,7 +6291,7 @@ non_empty_array_pair_list: arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($3)) // save comments - lastNode($1).AddComments($2.Comments, comment.CommaToken) + addMeta(lastNode($1), $2.Meta, meta.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6308,7 +6304,7 @@ non_empty_array_pair_list: arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - arrayItem.AddComments($2.Comments, comment.DoubleArrowToken) + addMeta(arrayItem, $2.Meta, meta.DoubleArrowToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6333,9 +6329,9 @@ non_empty_array_pair_list: arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($3, $6)) // save comments - lastNode($1).AddComments($2.Comments, comment.CommaToken) - arrayItem.AddComments($4.Comments, comment.DoubleArrowToken) - reference.AddComments($5.Comments, comment.AmpersandToken) + addMeta(lastNode($1), $2.Meta, meta.CommaToken) + addMeta(arrayItem, $4.Meta, meta.DoubleArrowToken) + addMeta(reference, $5.Meta, meta.AmpersandToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6350,8 +6346,8 @@ non_empty_array_pair_list: arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $4)) // save comments - lastNode($1).AddComments($2.Comments, comment.CommaToken) - reference.AddComments($3.Comments, comment.AmpersandToken) + addMeta(lastNode($1), $2.Meta, meta.CommaToken) + addMeta(reference, $3.Meta, meta.AmpersandToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6366,8 +6362,8 @@ non_empty_array_pair_list: arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) // save comments - arrayItem.AddComments($2.Comments, comment.DoubleArrowToken) - reference.AddComments($3.Comments, comment.AmpersandToken) + addMeta(arrayItem, $2.Meta, meta.DoubleArrowToken) + addMeta(reference, $3.Meta, meta.AmpersandToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6382,7 +6378,7 @@ non_empty_array_pair_list: arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - reference.AddComments($1.Comments, comment.AmpersandToken) + addMeta(reference, $1.Meta, meta.AmpersandToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6404,7 +6400,7 @@ encaps_list: encapsed.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) // save comments - encapsed.AddComments($2.Comments, comment.EncapsedAndWhitespaceToken) + addMeta(encapsed, $2.Meta, meta.EncapsedAndWhitespaceToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6423,7 +6419,7 @@ encaps_list: encapsed.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - encapsed.AddComments($1.Comments, comment.EncapsedAndWhitespaceToken) + addMeta(encapsed, $1.Meta, meta.EncapsedAndWhitespaceToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6440,7 +6436,7 @@ encaps_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $$.AddComments($1.Comments, comment.VariableToken) + addMeta($$, $1.Meta, meta.VariableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6456,9 +6452,9 @@ encaps_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - variable.AddComments($1.Comments, comment.VariableToken) - $$.AddComments($2.Comments, comment.OpenSquareBracket) - $$.AddComments($4.Comments, comment.CloseSquareBracket) + addMeta(variable, $1.Meta, meta.VariableToken) + addMeta($$, $2.Meta, meta.OpenSquareBracket) + addMeta($$, $4.Meta, meta.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6476,9 +6472,9 @@ encaps_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - variable.AddComments($1.Comments, comment.VariableToken) - $$.AddComments($2.Comments, comment.ObjectOperatorToken) - fetch.AddComments($3.Comments, comment.StringToken) + addMeta(variable, $1.Meta, meta.VariableToken) + addMeta($$, $2.Meta, meta.ObjectOperatorToken) + addMeta(fetch, $3.Meta, meta.StringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6490,8 +6486,8 @@ encaps_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $$.AddComments($1.Comments, comment.DollarOpenCurlyBracesToken) - $$.AddComments($3.Comments, comment.CloseCurlyBracesToken) + addMeta($$, $1.Meta, meta.DollarOpenCurlyBracesToken) + addMeta($$, $3.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6505,9 +6501,9 @@ encaps_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $$.AddComments($1.Comments, comment.DollarOpenCurlyBracesToken) - name.AddComments($2.Comments, comment.StringVarnameToken) - $$.AddComments($3.Comments, comment.CloseCurlyBracesToken) + addMeta($$, $1.Meta, meta.DollarOpenCurlyBracesToken) + addMeta(name, $2.Meta, meta.StringVarnameToken) + addMeta($$, $3.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6523,11 +6519,11 @@ encaps_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $6)) // save comments - $$.AddComments($1.Comments, comment.DollarOpenCurlyBracesToken) - variable.AddComments($2.Comments, comment.StringVarnameToken) - $$.AddComments($3.Comments, comment.OpenSquareBracket) - $$.AddComments($5.Comments, comment.CloseSquareBracket) - $$.AddComments($6.Comments, comment.CloseCurlyBracesToken) + addMeta($$, $1.Meta, meta.DollarOpenCurlyBracesToken) + addMeta(variable, $2.Meta, meta.StringVarnameToken) + addMeta($$, $3.Meta, meta.OpenSquareBracket) + addMeta($$, $5.Meta, meta.CloseSquareBracket) + addMeta($$, $6.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6548,7 +6544,7 @@ encaps_var_offset: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $$.AddComments($1.Comments, comment.StringToken) + addMeta($$, $1.Meta, meta.StringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6565,7 +6561,7 @@ encaps_var_offset: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $$.AddComments($1.Comments, comment.NumStringToken) + addMeta($$, $1.Meta, meta.NumStringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6579,7 +6575,7 @@ encaps_var_offset: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $$.AddComments($1.Comments, comment.VariableToken) + addMeta($$, $1.Meta, meta.VariableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6594,9 +6590,9 @@ internal_functions_in_yacc: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $$.AddComments($1.Comments, comment.IssetToken) - $$.AddComments($2.Comments, comment.OpenParenthesisToken) - $$.AddComments($4.Comments, comment.CloseParenthesisToken) + addMeta($$, $1.Meta, meta.IssetToken) + addMeta($$, $2.Meta, meta.OpenParenthesisToken) + addMeta($$, $4.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6608,9 +6604,9 @@ internal_functions_in_yacc: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $$.AddComments($1.Comments, comment.EmptyToken) - $$.AddComments($2.Comments, comment.OpenParenthesisToken) - $$.AddComments($4.Comments, comment.CloseParenthesisToken) + addMeta($$, $1.Meta, meta.EmptyToken) + addMeta($$, $2.Meta, meta.OpenParenthesisToken) + addMeta($$, $4.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6622,9 +6618,9 @@ internal_functions_in_yacc: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $$.AddComments($1.Comments, comment.EmptyToken) - $$.AddComments($2.Comments, comment.OpenParenthesisToken) - $$.AddComments($4.Comments, comment.CloseParenthesisToken) + addMeta($$, $1.Meta, meta.EmptyToken) + addMeta($$, $2.Meta, meta.OpenParenthesisToken) + addMeta($$, $4.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6636,7 +6632,7 @@ internal_functions_in_yacc: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $$.AddComments($1.Comments, comment.IncludeToken) + addMeta($$, $1.Meta, meta.IncludeToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6648,7 +6644,7 @@ internal_functions_in_yacc: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $$.AddComments($1.Comments, comment.IncludeOnceToken) + addMeta($$, $1.Meta, meta.IncludeOnceToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6660,9 +6656,9 @@ internal_functions_in_yacc: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $$.AddComments($1.Comments, comment.EvalToken) - $$.AddComments($2.Comments, comment.OpenParenthesisToken) - $$.AddComments($4.Comments, comment.CloseParenthesisToken) + addMeta($$, $1.Meta, meta.EvalToken) + addMeta($$, $2.Meta, meta.OpenParenthesisToken) + addMeta($$, $4.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6674,7 +6670,7 @@ internal_functions_in_yacc: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $$.AddComments($1.Comments, comment.RequireToken) + addMeta($$, $1.Meta, meta.RequireToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6686,7 +6682,7 @@ internal_functions_in_yacc: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $$.AddComments($1.Comments, comment.RequireOnceToken) + addMeta($$, $1.Meta, meta.RequireOnceToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6704,7 +6700,7 @@ isset_variables: $$ = append($1, $3) // save comments - lastNode($1).AddComments($2.Comments, comment.CommaToken) + addMeta(lastNode($1), $2.Meta, meta.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6736,7 +6732,7 @@ class_constant: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.PaamayimNekudotayimToken) + addMeta($$, $2.Meta, meta.PaamayimNekudotayimToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6750,7 +6746,7 @@ class_constant: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.PaamayimNekudotayimToken) + addMeta($$, $2.Meta, meta.PaamayimNekudotayimToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6767,7 +6763,7 @@ static_class_name_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.PaamayimNekudotayimToken) + addMeta($$, $2.Meta, meta.PaamayimNekudotayimToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6784,7 +6780,7 @@ class_name_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.PaamayimNekudotayimToken) + addMeta($$, $2.Meta, meta.PaamayimNekudotayimToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php5/php5_test.go b/php5/php5_test.go index 9320288..829022a 100644 --- a/php5/php5_test.go +++ b/php5/php5_test.go @@ -417,39 +417,39 @@ func TestPhp5(t *testing.T) { expected := &node.Root{ Position: &position.Position{ StartLine: 2, - EndLine: 379, - StartPos: 6, - EndPos: 6965, + EndLine: 379, + StartPos: 6, + EndPos: 6965, }, Stmts: []node.Node{ &stmt.Expression{ Position: &position.Position{ StartLine: 2, - EndLine: 2, - StartPos: 6, - EndPos: 20, + EndLine: 2, + StartPos: 6, + EndPos: 20, }, Expr: &expr.FunctionCall{ Position: &position.Position{ StartLine: 2, - EndLine: 2, - StartPos: 6, - EndPos: 19, + EndLine: 2, + StartPos: 6, + EndPos: 19, }, Function: &name.Name{ Position: &position.Position{ StartLine: 2, - EndLine: 2, - StartPos: 6, - EndPos: 8, + EndLine: 2, + StartPos: 6, + EndPos: 8, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 2, - EndLine: 2, - StartPos: 6, - EndPos: 8, + EndLine: 2, + StartPos: 6, + EndPos: 8, }, Value: "foo", }, @@ -458,33 +458,33 @@ func TestPhp5(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 2, - EndLine: 2, - StartPos: 9, - EndPos: 19, + EndLine: 2, + StartPos: 9, + EndPos: 19, }, Arguments: []node.Node{ &node.Argument{ Position: &position.Position{ StartLine: 2, - EndLine: 2, - StartPos: 10, - EndPos: 11, + EndLine: 2, + StartPos: 10, + EndPos: 11, }, - Variadic: false, IsReference: false, + Variadic: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 2, - EndLine: 2, - StartPos: 10, - EndPos: 11, + EndLine: 2, + StartPos: 10, + EndPos: 11, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 2, - EndLine: 2, - StartPos: 10, - EndPos: 11, + EndLine: 2, + StartPos: 10, + EndPos: 11, }, Value: "a", }, @@ -493,25 +493,25 @@ func TestPhp5(t *testing.T) { &node.Argument{ Position: &position.Position{ StartLine: 2, - EndLine: 2, - StartPos: 14, - EndPos: 18, + EndLine: 2, + StartPos: 14, + EndPos: 18, }, - Variadic: true, IsReference: false, + Variadic: true, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 2, - EndLine: 2, - StartPos: 17, - EndPos: 18, + EndLine: 2, + StartPos: 17, + EndPos: 18, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 2, - EndLine: 2, - StartPos: 17, - EndPos: 18, + EndLine: 2, + StartPos: 17, + EndPos: 18, }, Value: "b", }, @@ -524,30 +524,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 3, - EndLine: 3, - StartPos: 24, - EndPos: 39, + EndLine: 3, + StartPos: 24, + EndPos: 39, }, Expr: &expr.FunctionCall{ Position: &position.Position{ StartLine: 3, - EndLine: 3, - StartPos: 24, - EndPos: 38, + EndLine: 3, + StartPos: 24, + EndPos: 38, }, Function: &expr.Variable{ Position: &position.Position{ StartLine: 3, - EndLine: 3, - StartPos: 24, - EndPos: 27, + EndLine: 3, + StartPos: 24, + EndPos: 27, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 3, - EndLine: 3, - StartPos: 24, - EndPos: 27, + EndLine: 3, + StartPos: 24, + EndPos: 27, }, Value: "foo", }, @@ -555,33 +555,33 @@ func TestPhp5(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 3, - EndLine: 3, - StartPos: 28, - EndPos: 38, + EndLine: 3, + StartPos: 28, + EndPos: 38, }, Arguments: []node.Node{ &node.Argument{ Position: &position.Position{ StartLine: 3, - EndLine: 3, - StartPos: 29, - EndPos: 30, + EndLine: 3, + StartPos: 29, + EndPos: 30, }, - Variadic: false, + Variadic: false, IsReference: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 3, - EndLine: 3, - StartPos: 29, - EndPos: 30, + EndLine: 3, + StartPos: 29, + EndPos: 30, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 3, - EndLine: 3, - StartPos: 29, - EndPos: 30, + EndLine: 3, + StartPos: 29, + EndPos: 30, }, Value: "a", }, @@ -590,25 +590,25 @@ func TestPhp5(t *testing.T) { &node.Argument{ Position: &position.Position{ StartLine: 3, - EndLine: 3, - StartPos: 33, - EndPos: 37, + EndLine: 3, + StartPos: 33, + EndPos: 37, }, + Variadic: true, IsReference: false, - Variadic: true, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 3, - EndLine: 3, - StartPos: 36, - EndPos: 37, + EndLine: 3, + StartPos: 36, + EndPos: 37, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 3, - EndLine: 3, - StartPos: 36, - EndPos: 37, + EndLine: 3, + StartPos: 36, + EndPos: 37, }, Value: "b", }, @@ -621,30 +621,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 4, - EndLine: 4, - StartPos: 43, - EndPos: 63, + EndLine: 4, + StartPos: 43, + EndPos: 63, }, Expr: &expr.MethodCall{ Position: &position.Position{ StartLine: 4, - EndLine: 4, - StartPos: 43, - EndPos: 62, + EndLine: 4, + StartPos: 43, + EndPos: 62, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 4, - EndLine: 4, - StartPos: 43, - EndPos: 46, + EndLine: 4, + StartPos: 43, + EndPos: 46, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 4, - EndLine: 4, - StartPos: 43, - EndPos: 46, + EndLine: 4, + StartPos: 43, + EndPos: 46, }, Value: "foo", }, @@ -652,42 +652,42 @@ func TestPhp5(t *testing.T) { Method: &node.Identifier{ Position: &position.Position{ StartLine: 4, - EndLine: 4, - StartPos: 49, - EndPos: 51, + EndLine: 4, + StartPos: 49, + EndPos: 51, }, Value: "bar", }, ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 4, - EndLine: 4, - StartPos: 52, - EndPos: 62, + EndLine: 4, + StartPos: 52, + EndPos: 62, }, Arguments: []node.Node{ &node.Argument{ Position: &position.Position{ StartLine: 4, - EndLine: 4, - StartPos: 53, - EndPos: 54, + EndLine: 4, + StartPos: 53, + EndPos: 54, }, - Variadic: false, + Variadic: false, IsReference: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 4, - EndLine: 4, - StartPos: 53, - EndPos: 54, + EndLine: 4, + StartPos: 53, + EndPos: 54, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 4, - EndLine: 4, - StartPos: 53, - EndPos: 54, + EndLine: 4, + StartPos: 53, + EndPos: 54, }, Value: "a", }, @@ -696,25 +696,25 @@ func TestPhp5(t *testing.T) { &node.Argument{ Position: &position.Position{ StartLine: 4, - EndLine: 4, - StartPos: 57, - EndPos: 61, + EndLine: 4, + StartPos: 57, + EndPos: 61, }, - Variadic: true, + Variadic: true, IsReference: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 4, - EndLine: 4, - StartPos: 60, - EndPos: 61, + EndLine: 4, + StartPos: 60, + EndPos: 61, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 4, - EndLine: 4, - StartPos: 60, - EndPos: 61, + EndLine: 4, + StartPos: 60, + EndPos: 61, }, Value: "b", }, @@ -727,31 +727,31 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 5, - EndLine: 5, - StartPos: 67, - EndPos: 86, + EndLine: 5, + StartPos: 67, + EndPos: 86, }, Expr: &expr.StaticCall{ Position: &position.Position{ StartLine: 5, - EndLine: 5, - StartPos: 67, - EndPos: 85, + EndLine: 5, + StartPos: 67, + EndPos: 85, }, Class: &name.Name{ Position: &position.Position{ StartLine: 5, - EndLine: 5, - StartPos: 67, - EndPos: 69, + EndLine: 5, + StartPos: 67, + EndPos: 69, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 5, - EndLine: 5, - StartPos: 67, - EndPos: 69, + EndLine: 5, + StartPos: 67, + EndPos: 69, }, Value: "foo", }, @@ -760,42 +760,42 @@ func TestPhp5(t *testing.T) { Call: &node.Identifier{ Position: &position.Position{ StartLine: 5, - EndLine: 5, - StartPos: 72, - EndPos: 74, + EndLine: 5, + StartPos: 72, + EndPos: 74, }, Value: "bar", }, ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 5, - EndLine: 5, - StartPos: 75, - EndPos: 85, + EndLine: 5, + StartPos: 75, + EndPos: 85, }, Arguments: []node.Node{ &node.Argument{ Position: &position.Position{ StartLine: 5, - EndLine: 5, - StartPos: 76, - EndPos: 77, + EndLine: 5, + StartPos: 76, + EndPos: 77, }, - Variadic: false, + Variadic: false, IsReference: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 5, - EndLine: 5, - StartPos: 76, - EndPos: 77, + EndLine: 5, + StartPos: 76, + EndPos: 77, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 5, - EndLine: 5, - StartPos: 76, - EndPos: 77, + EndLine: 5, + StartPos: 76, + EndPos: 77, }, Value: "a", }, @@ -804,25 +804,25 @@ func TestPhp5(t *testing.T) { &node.Argument{ Position: &position.Position{ StartLine: 5, - EndLine: 5, - StartPos: 80, - EndPos: 84, + EndLine: 5, + StartPos: 80, + EndPos: 84, }, - Variadic: true, + Variadic: true, IsReference: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 5, - EndLine: 5, - StartPos: 83, - EndPos: 84, + EndLine: 5, + StartPos: 83, + EndPos: 84, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 5, - EndLine: 5, - StartPos: 83, - EndPos: 84, + EndLine: 5, + StartPos: 83, + EndPos: 84, }, Value: "b", }, @@ -835,30 +835,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 6, - EndLine: 6, - StartPos: 90, - EndPos: 110, + EndLine: 6, + StartPos: 90, + EndPos: 110, }, Expr: &expr.StaticCall{ Position: &position.Position{ StartLine: 6, - EndLine: 6, - StartPos: 90, - EndPos: 109, + EndLine: 6, + StartPos: 90, + EndPos: 109, }, Class: &expr.Variable{ Position: &position.Position{ StartLine: 6, - EndLine: 6, - StartPos: 90, - EndPos: 93, + EndLine: 6, + StartPos: 90, + EndPos: 93, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 6, - EndLine: 6, - StartPos: 90, - EndPos: 93, + EndLine: 6, + StartPos: 90, + EndPos: 93, }, Value: "foo", }, @@ -866,42 +866,42 @@ func TestPhp5(t *testing.T) { Call: &node.Identifier{ Position: &position.Position{ StartLine: 6, - EndLine: 6, - StartPos: 96, - EndPos: 98, + EndLine: 6, + StartPos: 96, + EndPos: 98, }, Value: "bar", }, ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 6, - EndLine: 6, - StartPos: 99, - EndPos: 109, + EndLine: 6, + StartPos: 99, + EndPos: 109, }, Arguments: []node.Node{ &node.Argument{ Position: &position.Position{ StartLine: 6, - EndLine: 6, - StartPos: 100, - EndPos: 101, + EndLine: 6, + StartPos: 100, + EndPos: 101, }, - Variadic: false, IsReference: false, + Variadic: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 6, - EndLine: 6, - StartPos: 100, - EndPos: 101, + EndLine: 6, + StartPos: 100, + EndPos: 101, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 6, - EndLine: 6, - StartPos: 100, - EndPos: 101, + EndLine: 6, + StartPos: 100, + EndPos: 101, }, Value: "a", }, @@ -910,25 +910,25 @@ func TestPhp5(t *testing.T) { &node.Argument{ Position: &position.Position{ StartLine: 6, - EndLine: 6, - StartPos: 104, - EndPos: 108, + EndLine: 6, + StartPos: 104, + EndPos: 108, }, - Variadic: true, + Variadic: true, IsReference: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 6, - EndLine: 6, - StartPos: 107, - EndPos: 108, + EndLine: 6, + StartPos: 107, + EndPos: 108, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 6, - EndLine: 6, - StartPos: 107, - EndPos: 108, + EndLine: 6, + StartPos: 107, + EndPos: 108, }, Value: "b", }, @@ -941,31 +941,31 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 7, - EndLine: 7, - StartPos: 114, - EndPos: 132, + EndLine: 7, + StartPos: 114, + EndPos: 132, }, Expr: &expr.New{ Position: &position.Position{ StartLine: 7, - EndLine: 7, - StartPos: 114, - EndPos: 131, + EndLine: 7, + StartPos: 114, + EndPos: 131, }, Class: &name.Name{ Position: &position.Position{ StartLine: 7, - EndLine: 7, - StartPos: 118, - EndPos: 120, + EndLine: 7, + StartPos: 118, + EndPos: 120, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 7, - EndLine: 7, - StartPos: 118, - EndPos: 120, + EndLine: 7, + StartPos: 118, + EndPos: 120, }, Value: "foo", }, @@ -974,33 +974,33 @@ func TestPhp5(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 7, - EndLine: 7, - StartPos: 121, - EndPos: 131, + EndLine: 7, + StartPos: 121, + EndPos: 131, }, Arguments: []node.Node{ &node.Argument{ Position: &position.Position{ StartLine: 7, - EndLine: 7, - StartPos: 122, - EndPos: 123, + EndLine: 7, + StartPos: 122, + EndPos: 123, }, - Variadic: false, + Variadic: false, IsReference: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 7, - EndLine: 7, - StartPos: 122, - EndPos: 123, + EndLine: 7, + StartPos: 122, + EndPos: 123, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 7, - EndLine: 7, - StartPos: 122, - EndPos: 123, + EndLine: 7, + StartPos: 122, + EndPos: 123, }, Value: "a", }, @@ -1009,25 +1009,25 @@ func TestPhp5(t *testing.T) { &node.Argument{ Position: &position.Position{ StartLine: 7, - EndLine: 7, - StartPos: 126, - EndPos: 130, + EndLine: 7, + StartPos: 126, + EndPos: 130, }, - Variadic: true, + Variadic: true, IsReference: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 7, - EndLine: 7, - StartPos: 129, - EndPos: 130, + EndLine: 7, + StartPos: 129, + EndPos: 130, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 7, - EndLine: 7, - StartPos: 129, - EndPos: 130, + EndLine: 7, + StartPos: 129, + EndPos: 130, }, Value: "b", }, @@ -1040,18 +1040,18 @@ func TestPhp5(t *testing.T) { &stmt.Function{ Position: &position.Position{ StartLine: 9, - EndLine: 9, - StartPos: 137, - EndPos: 180, + EndLine: 9, + StartPos: 137, + EndPos: 180, }, - ReturnsRef: false, + ReturnsRef: false, PhpDocComment: "", FunctionName: &node.Identifier{ Position: &position.Position{ StartLine: 9, - EndLine: 9, - StartPos: 146, - EndPos: 148, + EndLine: 9, + StartPos: 146, + EndPos: 148, }, Value: "foo", }, @@ -1059,26 +1059,26 @@ func TestPhp5(t *testing.T) { &node.Parameter{ Position: &position.Position{ StartLine: 9, - EndLine: 9, - StartPos: 150, - EndPos: 162, + EndLine: 9, + StartPos: 150, + EndPos: 162, }, - ByRef: false, + ByRef: false, Variadic: false, VariableType: &name.Name{ Position: &position.Position{ StartLine: 9, - EndLine: 9, - StartPos: 150, - EndPos: 152, + EndLine: 9, + StartPos: 150, + EndPos: 152, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 9, - EndLine: 9, - StartPos: 150, - EndPos: 152, + EndLine: 9, + StartPos: 150, + EndPos: 152, }, Value: "bar", }, @@ -1087,16 +1087,16 @@ func TestPhp5(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 9, - EndLine: 9, - StartPos: 154, - EndPos: 157, + EndLine: 9, + StartPos: 154, + EndPos: 157, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 9, - EndLine: 9, - StartPos: 154, - EndPos: 157, + EndLine: 9, + StartPos: 154, + EndPos: 157, }, Value: "bar", }, @@ -1104,24 +1104,24 @@ func TestPhp5(t *testing.T) { DefaultValue: &expr.ConstFetch{ Position: &position.Position{ StartLine: 9, - EndLine: 9, - StartPos: 159, - EndPos: 162, + EndLine: 9, + StartPos: 159, + EndPos: 162, }, Constant: &name.Name{ Position: &position.Position{ StartLine: 9, - EndLine: 9, - StartPos: 159, - EndPos: 162, + EndLine: 9, + StartPos: 159, + EndPos: 162, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 9, - EndLine: 9, - StartPos: 159, - EndPos: 162, + EndLine: 9, + StartPos: 159, + EndPos: 162, }, Value: "null", }, @@ -1132,26 +1132,26 @@ func TestPhp5(t *testing.T) { &node.Parameter{ Position: &position.Position{ StartLine: 9, - EndLine: 9, - StartPos: 165, - EndPos: 176, + EndLine: 9, + StartPos: 165, + EndPos: 176, }, + ByRef: true, Variadic: true, - ByRef: true, VariableType: &name.Name{ Position: &position.Position{ StartLine: 9, - EndLine: 9, - StartPos: 165, - EndPos: 167, + EndLine: 9, + StartPos: 165, + EndPos: 167, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 9, - EndLine: 9, - StartPos: 165, - EndPos: 167, + EndLine: 9, + StartPos: 165, + EndPos: 167, }, Value: "baz", }, @@ -1160,38 +1160,39 @@ func TestPhp5(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 9, - EndLine: 9, - StartPos: 173, - EndPos: 176, + EndLine: 9, + StartPos: 173, + EndPos: 176, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 9, - EndLine: 9, - StartPos: 173, - EndPos: 176, + EndLine: 9, + StartPos: 173, + EndPos: 176, }, Value: "baz", }, }, }, }, - Stmts: []node.Node{}, + Stmts: []node.Node{ + }, }, &stmt.Class{ Position: &position.Position{ StartLine: 10, - EndLine: 10, - StartPos: 184, - EndPos: 246, + EndLine: 10, + StartPos: 184, + EndPos: 246, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 10, - EndLine: 10, - StartPos: 190, - EndPos: 192, + EndLine: 10, + StartPos: 190, + EndPos: 192, }, Value: "foo", }, @@ -1199,18 +1200,18 @@ func TestPhp5(t *testing.T) { &stmt.ClassMethod{ Position: &position.Position{ StartLine: 10, - EndLine: 10, - StartPos: 195, - EndPos: 245, + EndLine: 10, + StartPos: 195, + EndPos: 245, }, + ReturnsRef: false, PhpDocComment: "", - ReturnsRef: false, MethodName: &node.Identifier{ Position: &position.Position{ StartLine: 10, - EndLine: 10, - StartPos: 211, - EndPos: 213, + EndLine: 10, + StartPos: 211, + EndPos: 213, }, Value: "foo", }, @@ -1218,9 +1219,9 @@ func TestPhp5(t *testing.T) { &node.Identifier{ Position: &position.Position{ StartLine: 10, - EndLine: 10, - StartPos: 195, - EndPos: 200, + EndLine: 10, + StartPos: 195, + EndPos: 200, }, Value: "public", }, @@ -1229,26 +1230,26 @@ func TestPhp5(t *testing.T) { &node.Parameter{ Position: &position.Position{ StartLine: 10, - EndLine: 10, - StartPos: 215, - EndPos: 227, + EndLine: 10, + StartPos: 215, + EndPos: 227, }, - ByRef: false, + ByRef: false, Variadic: false, VariableType: &name.Name{ Position: &position.Position{ StartLine: 10, - EndLine: 10, - StartPos: 215, - EndPos: 217, + EndLine: 10, + StartPos: 215, + EndPos: 217, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 10, - EndLine: 10, - StartPos: 215, - EndPos: 217, + EndLine: 10, + StartPos: 215, + EndPos: 217, }, Value: "bar", }, @@ -1257,16 +1258,16 @@ func TestPhp5(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 10, - EndLine: 10, - StartPos: 219, - EndPos: 222, + EndLine: 10, + StartPos: 219, + EndPos: 222, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 10, - EndLine: 10, - StartPos: 219, - EndPos: 222, + EndLine: 10, + StartPos: 219, + EndPos: 222, }, Value: "bar", }, @@ -1274,24 +1275,24 @@ func TestPhp5(t *testing.T) { DefaultValue: &expr.ConstFetch{ Position: &position.Position{ StartLine: 10, - EndLine: 10, - StartPos: 224, - EndPos: 227, + EndLine: 10, + StartPos: 224, + EndPos: 227, }, Constant: &name.Name{ Position: &position.Position{ StartLine: 10, - EndLine: 10, - StartPos: 224, - EndPos: 227, + EndLine: 10, + StartPos: 224, + EndPos: 227, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 10, - EndLine: 10, - StartPos: 224, - EndPos: 227, + EndLine: 10, + StartPos: 224, + EndPos: 227, }, Value: "null", }, @@ -1302,26 +1303,26 @@ func TestPhp5(t *testing.T) { &node.Parameter{ Position: &position.Position{ StartLine: 10, - EndLine: 10, - StartPos: 230, - EndPos: 241, + EndLine: 10, + StartPos: 230, + EndPos: 241, }, - ByRef: true, + ByRef: true, Variadic: true, VariableType: &name.Name{ Position: &position.Position{ StartLine: 10, - EndLine: 10, - StartPos: 230, - EndPos: 232, + EndLine: 10, + StartPos: 230, + EndPos: 232, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 10, - EndLine: 10, - StartPos: 230, - EndPos: 232, + EndLine: 10, + StartPos: 230, + EndPos: 232, }, Value: "baz", }, @@ -1330,16 +1331,16 @@ func TestPhp5(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 10, - EndLine: 10, - StartPos: 238, - EndPos: 241, + EndLine: 10, + StartPos: 238, + EndPos: 241, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 10, - EndLine: 10, - StartPos: 238, - EndPos: 241, + EndLine: 10, + StartPos: 238, + EndPos: 241, }, Value: "baz", }, @@ -1349,11 +1350,12 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 10, - EndLine: 10, - StartPos: 244, - EndPos: 245, + EndLine: 10, + StartPos: 244, + EndPos: 245, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, }, }, @@ -1361,44 +1363,44 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 11, - EndLine: 11, - StartPos: 250, - EndPos: 290, + EndLine: 11, + StartPos: 250, + EndPos: 290, }, Expr: &expr.Closure{ Position: &position.Position{ StartLine: 11, - EndLine: 11, - StartPos: 250, - EndPos: 289, + EndLine: 11, + StartPos: 250, + EndPos: 289, }, - ReturnsRef: false, - Static: false, + ReturnsRef: false, + Static: false, PhpDocComment: "", Params: []node.Node{ &node.Parameter{ Position: &position.Position{ StartLine: 11, - EndLine: 11, - StartPos: 259, - EndPos: 271, + EndLine: 11, + StartPos: 259, + EndPos: 271, }, - ByRef: false, + ByRef: false, Variadic: false, VariableType: &name.Name{ Position: &position.Position{ StartLine: 11, - EndLine: 11, - StartPos: 259, - EndPos: 261, + EndLine: 11, + StartPos: 259, + EndPos: 261, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 11, - EndLine: 11, - StartPos: 259, - EndPos: 261, + EndLine: 11, + StartPos: 259, + EndPos: 261, }, Value: "bar", }, @@ -1407,16 +1409,16 @@ func TestPhp5(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 11, - EndLine: 11, - StartPos: 263, - EndPos: 266, + EndLine: 11, + StartPos: 263, + EndPos: 266, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 11, - EndLine: 11, - StartPos: 263, - EndPos: 266, + EndLine: 11, + StartPos: 263, + EndPos: 266, }, Value: "bar", }, @@ -1424,24 +1426,24 @@ func TestPhp5(t *testing.T) { DefaultValue: &expr.ConstFetch{ Position: &position.Position{ StartLine: 11, - EndLine: 11, - StartPos: 268, - EndPos: 271, + EndLine: 11, + StartPos: 268, + EndPos: 271, }, Constant: &name.Name{ Position: &position.Position{ StartLine: 11, - EndLine: 11, - StartPos: 268, - EndPos: 271, + EndLine: 11, + StartPos: 268, + EndPos: 271, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 11, - EndLine: 11, - StartPos: 268, - EndPos: 271, + EndLine: 11, + StartPos: 268, + EndPos: 271, }, Value: "null", }, @@ -1452,26 +1454,26 @@ func TestPhp5(t *testing.T) { &node.Parameter{ Position: &position.Position{ StartLine: 11, - EndLine: 11, - StartPos: 274, - EndPos: 285, + EndLine: 11, + StartPos: 274, + EndPos: 285, }, - ByRef: true, + ByRef: true, Variadic: true, VariableType: &name.Name{ Position: &position.Position{ StartLine: 11, - EndLine: 11, - StartPos: 274, - EndPos: 276, + EndLine: 11, + StartPos: 274, + EndPos: 276, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 11, - EndLine: 11, - StartPos: 274, - EndPos: 276, + EndLine: 11, + StartPos: 274, + EndPos: 276, }, Value: "baz", }, @@ -1480,66 +1482,67 @@ func TestPhp5(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 11, - EndLine: 11, - StartPos: 282, - EndPos: 285, + EndLine: 11, + StartPos: 282, + EndPos: 285, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 11, - EndLine: 11, - StartPos: 282, - EndPos: 285, + EndLine: 11, + StartPos: 282, + EndPos: 285, }, Value: "baz", }, }, }, }, - Stmts: []node.Node{}, + Stmts: []node.Node{ + }, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 12, - EndLine: 12, - StartPos: 294, - EndPos: 341, + EndLine: 12, + StartPos: 294, + EndPos: 341, }, Expr: &expr.Closure{ Position: &position.Position{ StartLine: 12, - EndLine: 12, - StartPos: 294, - EndPos: 340, + EndLine: 12, + StartPos: 294, + EndPos: 340, }, - ReturnsRef: false, - Static: true, + Static: true, PhpDocComment: "", + ReturnsRef: false, Params: []node.Node{ &node.Parameter{ Position: &position.Position{ StartLine: 12, - EndLine: 12, - StartPos: 310, - EndPos: 322, + EndLine: 12, + StartPos: 310, + EndPos: 322, }, - ByRef: false, + ByRef: false, Variadic: false, VariableType: &name.Name{ Position: &position.Position{ StartLine: 12, - EndLine: 12, - StartPos: 310, - EndPos: 312, + EndLine: 12, + StartPos: 310, + EndPos: 312, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 12, - EndLine: 12, - StartPos: 310, - EndPos: 312, + EndLine: 12, + StartPos: 310, + EndPos: 312, }, Value: "bar", }, @@ -1548,16 +1551,16 @@ func TestPhp5(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 12, - EndLine: 12, - StartPos: 314, - EndPos: 317, + EndLine: 12, + StartPos: 314, + EndPos: 317, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 12, - EndLine: 12, - StartPos: 314, - EndPos: 317, + EndLine: 12, + StartPos: 314, + EndPos: 317, }, Value: "bar", }, @@ -1565,24 +1568,24 @@ func TestPhp5(t *testing.T) { DefaultValue: &expr.ConstFetch{ Position: &position.Position{ StartLine: 12, - EndLine: 12, - StartPos: 319, - EndPos: 322, + EndLine: 12, + StartPos: 319, + EndPos: 322, }, Constant: &name.Name{ Position: &position.Position{ StartLine: 12, - EndLine: 12, - StartPos: 319, - EndPos: 322, + EndLine: 12, + StartPos: 319, + EndPos: 322, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 12, - EndLine: 12, - StartPos: 319, - EndPos: 322, + EndLine: 12, + StartPos: 319, + EndPos: 322, }, Value: "null", }, @@ -1593,26 +1596,26 @@ func TestPhp5(t *testing.T) { &node.Parameter{ Position: &position.Position{ StartLine: 12, - EndLine: 12, - StartPos: 325, - EndPos: 336, + EndLine: 12, + StartPos: 325, + EndPos: 336, }, - ByRef: true, + ByRef: true, Variadic: true, VariableType: &name.Name{ Position: &position.Position{ StartLine: 12, - EndLine: 12, - StartPos: 325, - EndPos: 327, + EndLine: 12, + StartPos: 325, + EndPos: 327, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 12, - EndLine: 12, - StartPos: 325, - EndPos: 327, + EndLine: 12, + StartPos: 325, + EndPos: 327, }, Value: "baz", }, @@ -1621,38 +1624,39 @@ func TestPhp5(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 12, - EndLine: 12, - StartPos: 333, - EndPos: 336, + EndLine: 12, + StartPos: 333, + EndPos: 336, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 12, - EndLine: 12, - StartPos: 333, - EndPos: 336, + EndLine: 12, + StartPos: 333, + EndPos: 336, }, Value: "baz", }, }, }, }, - Stmts: []node.Node{}, + Stmts: []node.Node{ + }, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 14, - EndLine: 14, - StartPos: 346, - EndPos: 365, + EndLine: 14, + StartPos: 346, + EndPos: 365, }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 14, - EndLine: 14, - StartPos: 346, - EndPos: 364, + EndLine: 14, + StartPos: 346, + EndPos: 364, }, Value: "1234567890123456789", }, @@ -1660,16 +1664,16 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 15, - EndLine: 15, - StartPos: 369, - EndPos: 389, + EndLine: 15, + StartPos: 369, + EndPos: 389, }, Expr: &scalar.Dnumber{ Position: &position.Position{ StartLine: 15, - EndLine: 15, - StartPos: 369, - EndPos: 388, + EndLine: 15, + StartPos: 369, + EndPos: 388, }, Value: "12345678901234567890", }, @@ -1677,16 +1681,16 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 16, - EndLine: 16, - StartPos: 393, - EndPos: 395, + EndLine: 16, + StartPos: 393, + EndPos: 395, }, Expr: &scalar.Dnumber{ Position: &position.Position{ StartLine: 16, - EndLine: 16, - StartPos: 393, - EndPos: 394, + EndLine: 16, + StartPos: 393, + EndPos: 394, }, Value: "0.", }, @@ -1694,16 +1698,16 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 17, - EndLine: 17, - StartPos: 399, - EndPos: 465, + EndLine: 17, + StartPos: 399, + EndPos: 465, }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 17, - EndLine: 17, - StartPos: 399, - EndPos: 464, + EndLine: 17, + StartPos: 399, + EndPos: 464, }, Value: "0b0111111111111111111111111111111111111111111111111111111111111111", }, @@ -1711,16 +1715,16 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 18, - EndLine: 18, - StartPos: 469, - EndPos: 535, + EndLine: 18, + StartPos: 469, + EndPos: 535, }, Expr: &scalar.Dnumber{ Position: &position.Position{ StartLine: 18, - EndLine: 18, - StartPos: 469, - EndPos: 534, + EndLine: 18, + StartPos: 469, + EndPos: 534, }, Value: "0b1111111111111111111111111111111111111111111111111111111111111111", }, @@ -1728,16 +1732,16 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 19, - EndLine: 19, - StartPos: 539, - EndPos: 559, + EndLine: 19, + StartPos: 539, + EndPos: 559, }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 19, - EndLine: 19, - StartPos: 539, - EndPos: 558, + EndLine: 19, + StartPos: 539, + EndPos: 558, }, Value: "0x007111111111111111", }, @@ -1745,16 +1749,16 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 20, - EndLine: 20, - StartPos: 563, - EndPos: 581, + EndLine: 20, + StartPos: 563, + EndPos: 581, }, Expr: &scalar.Dnumber{ Position: &position.Position{ StartLine: 20, - EndLine: 20, - StartPos: 563, - EndPos: 580, + EndLine: 20, + StartPos: 563, + EndPos: 580, }, Value: "0x8111111111111111", }, @@ -1762,16 +1766,16 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 21, - EndLine: 21, - StartPos: 585, - EndPos: 594, + EndLine: 21, + StartPos: 585, + EndPos: 594, }, Expr: &scalar.MagicConstant{ Position: &position.Position{ StartLine: 21, - EndLine: 21, - StartPos: 585, - EndPos: 593, + EndLine: 21, + StartPos: 585, + EndPos: 593, }, Value: "__CLASS__", }, @@ -1779,16 +1783,16 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 22, - EndLine: 22, - StartPos: 598, - EndPos: 605, + EndLine: 22, + StartPos: 598, + EndPos: 605, }, Expr: &scalar.MagicConstant{ Position: &position.Position{ StartLine: 22, - EndLine: 22, - StartPos: 598, - EndPos: 604, + EndLine: 22, + StartPos: 598, + EndPos: 604, }, Value: "__DIR__", }, @@ -1796,16 +1800,16 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 23, - EndLine: 23, - StartPos: 609, - EndPos: 617, + EndLine: 23, + StartPos: 609, + EndPos: 617, }, Expr: &scalar.MagicConstant{ Position: &position.Position{ StartLine: 23, - EndLine: 23, - StartPos: 609, - EndPos: 616, + EndLine: 23, + StartPos: 609, + EndPos: 616, }, Value: "__FILE__", }, @@ -1813,16 +1817,16 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 24, - EndLine: 24, - StartPos: 621, - EndPos: 633, + EndLine: 24, + StartPos: 621, + EndPos: 633, }, Expr: &scalar.MagicConstant{ Position: &position.Position{ StartLine: 24, - EndLine: 24, - StartPos: 621, - EndPos: 632, + EndLine: 24, + StartPos: 621, + EndPos: 632, }, Value: "__FUNCTION__", }, @@ -1830,16 +1834,16 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 25, - EndLine: 25, - StartPos: 637, - EndPos: 645, + EndLine: 25, + StartPos: 637, + EndPos: 645, }, Expr: &scalar.MagicConstant{ Position: &position.Position{ StartLine: 25, - EndLine: 25, - StartPos: 637, - EndPos: 644, + EndLine: 25, + StartPos: 637, + EndPos: 644, }, Value: "__LINE__", }, @@ -1847,16 +1851,16 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 26, - EndLine: 26, - StartPos: 649, - EndPos: 662, + EndLine: 26, + StartPos: 649, + EndPos: 662, }, Expr: &scalar.MagicConstant{ Position: &position.Position{ StartLine: 26, - EndLine: 26, - StartPos: 649, - EndPos: 661, + EndLine: 26, + StartPos: 649, + EndPos: 661, }, Value: "__NAMESPACE__", }, @@ -1864,16 +1868,16 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 27, - EndLine: 27, - StartPos: 666, - EndPos: 676, + EndLine: 27, + StartPos: 666, + EndPos: 676, }, Expr: &scalar.MagicConstant{ Position: &position.Position{ StartLine: 27, - EndLine: 27, - StartPos: 666, - EndPos: 675, + EndLine: 27, + StartPos: 666, + EndPos: 675, }, Value: "__METHOD__", }, @@ -1881,16 +1885,16 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 28, - EndLine: 28, - StartPos: 680, - EndPos: 689, + EndLine: 28, + StartPos: 680, + EndPos: 689, }, Expr: &scalar.MagicConstant{ Position: &position.Position{ StartLine: 28, - EndLine: 28, - StartPos: 680, - EndPos: 688, + EndLine: 28, + StartPos: 680, + EndPos: 688, }, Value: "__TRAIT__", }, @@ -1898,40 +1902,40 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 30, - EndLine: 30, - StartPos: 694, - EndPos: 705, + EndLine: 30, + StartPos: 694, + EndPos: 705, }, Expr: &scalar.Encapsed{ Position: &position.Position{ StartLine: 30, - EndLine: 30, - StartPos: 694, - EndPos: 704, + EndLine: 30, + StartPos: 694, + EndPos: 704, }, Parts: []node.Node{ &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 30, - EndLine: 30, - StartPos: 695, - EndPos: 699, + EndLine: 30, + StartPos: 695, + EndPos: 699, }, Value: "test ", }, &expr.Variable{ Position: &position.Position{ StartLine: 30, - EndLine: 30, - StartPos: 700, - EndPos: 703, + EndLine: 30, + StartPos: 700, + EndPos: 703, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 30, - EndLine: 30, - StartPos: 700, - EndPos: 703, + EndLine: 30, + StartPos: 700, + EndPos: 703, }, Value: "var", }, @@ -1942,47 +1946,47 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 31, - EndLine: 31, - StartPos: 709, - EndPos: 723, + EndLine: 31, + StartPos: 709, + EndPos: 723, }, Expr: &scalar.Encapsed{ Position: &position.Position{ StartLine: 31, - EndLine: 31, - StartPos: 709, - EndPos: 722, + EndLine: 31, + StartPos: 709, + EndPos: 722, }, Parts: []node.Node{ &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 31, - EndLine: 31, - StartPos: 710, - EndPos: 714, + EndLine: 31, + StartPos: 710, + EndPos: 714, }, Value: "test ", }, &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 31, - EndLine: 31, - StartPos: 715, - EndPos: 721, + EndLine: 31, + StartPos: 715, + EndPos: 721, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 31, - EndLine: 31, - StartPos: 715, - EndPos: 718, + EndLine: 31, + StartPos: 715, + EndPos: 718, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 31, - EndLine: 31, - StartPos: 715, - EndPos: 718, + EndLine: 31, + StartPos: 715, + EndPos: 718, }, Value: "var", }, @@ -1990,9 +1994,9 @@ func TestPhp5(t *testing.T) { Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 31, - EndLine: 31, - StartPos: 720, - EndPos: 720, + EndLine: 31, + StartPos: 720, + EndPos: 720, }, Value: "1", }, @@ -2003,47 +2007,47 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 32, - EndLine: 32, - StartPos: 727, - EndPos: 780, + EndLine: 32, + StartPos: 727, + EndPos: 780, }, Expr: &scalar.Encapsed{ Position: &position.Position{ StartLine: 32, - EndLine: 32, - StartPos: 727, - EndPos: 779, + EndLine: 32, + StartPos: 727, + EndPos: 779, }, Parts: []node.Node{ &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 32, - EndLine: 32, - StartPos: 728, - EndPos: 732, + EndLine: 32, + StartPos: 728, + EndPos: 732, }, Value: "test ", }, &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 32, - EndLine: 32, - StartPos: 733, - EndPos: 778, + EndLine: 32, + StartPos: 733, + EndPos: 778, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 32, - EndLine: 32, - StartPos: 733, - EndPos: 736, + EndLine: 32, + StartPos: 733, + EndPos: 736, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 32, - EndLine: 32, - StartPos: 733, - EndPos: 736, + EndLine: 32, + StartPos: 733, + EndPos: 736, }, Value: "var", }, @@ -2051,9 +2055,9 @@ func TestPhp5(t *testing.T) { Dim: &scalar.String{ Position: &position.Position{ StartLine: 32, - EndLine: 32, - StartPos: 738, - EndPos: 777, + EndLine: 32, + StartPos: 738, + EndPos: 777, }, Value: "1234567890123456789012345678901234567890", }, @@ -2064,47 +2068,47 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 33, - EndLine: 33, - StartPos: 784, - EndPos: 800, + EndLine: 33, + StartPos: 784, + EndPos: 800, }, Expr: &scalar.Encapsed{ Position: &position.Position{ StartLine: 33, - EndLine: 33, - StartPos: 784, - EndPos: 799, + EndLine: 33, + StartPos: 784, + EndPos: 799, }, Parts: []node.Node{ &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 33, - EndLine: 33, - StartPos: 785, - EndPos: 789, + EndLine: 33, + StartPos: 785, + EndPos: 789, }, Value: "test ", }, &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 33, - EndLine: 33, - StartPos: 790, - EndPos: 798, + EndLine: 33, + StartPos: 790, + EndPos: 798, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 33, - EndLine: 33, - StartPos: 790, - EndPos: 793, + EndLine: 33, + StartPos: 790, + EndPos: 793, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 33, - EndLine: 33, - StartPos: 790, - EndPos: 793, + EndLine: 33, + StartPos: 790, + EndPos: 793, }, Value: "var", }, @@ -2112,9 +2116,9 @@ func TestPhp5(t *testing.T) { Dim: &scalar.String{ Position: &position.Position{ StartLine: 33, - EndLine: 33, - StartPos: 795, - EndPos: 797, + EndLine: 33, + StartPos: 795, + EndPos: 797, }, Value: "bar", }, @@ -2125,47 +2129,47 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 34, - EndLine: 34, - StartPos: 804, - EndPos: 821, + EndLine: 34, + StartPos: 804, + EndPos: 821, }, Expr: &scalar.Encapsed{ Position: &position.Position{ StartLine: 34, - EndLine: 34, - StartPos: 804, - EndPos: 820, + EndLine: 34, + StartPos: 804, + EndPos: 820, }, Parts: []node.Node{ &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 34, - EndLine: 34, - StartPos: 805, - EndPos: 809, + EndLine: 34, + StartPos: 805, + EndPos: 809, }, Value: "test ", }, &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 34, - EndLine: 34, - StartPos: 810, - EndPos: 819, + EndLine: 34, + StartPos: 810, + EndPos: 819, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 34, - EndLine: 34, - StartPos: 810, - EndPos: 813, + EndLine: 34, + StartPos: 810, + EndPos: 813, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 34, - EndLine: 34, - StartPos: 810, - EndPos: 813, + EndLine: 34, + StartPos: 810, + EndPos: 813, }, Value: "var", }, @@ -2173,16 +2177,16 @@ func TestPhp5(t *testing.T) { Dim: &expr.Variable{ Position: &position.Position{ StartLine: 34, - EndLine: 34, - StartPos: 815, - EndPos: 818, + EndLine: 34, + StartPos: 815, + EndPos: 818, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 34, - EndLine: 34, - StartPos: 815, - EndPos: 818, + EndLine: 34, + StartPos: 815, + EndPos: 818, }, Value: "bar", }, @@ -2194,31 +2198,31 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 35, - EndLine: 35, - StartPos: 825, - EndPos: 836, + EndLine: 35, + StartPos: 825, + EndPos: 836, }, Expr: &scalar.Encapsed{ Position: &position.Position{ StartLine: 35, - EndLine: 35, - StartPos: 825, - EndPos: 835, + EndLine: 35, + StartPos: 825, + EndPos: 835, }, Parts: []node.Node{ &expr.Variable{ Position: &position.Position{ StartLine: 35, - EndLine: 35, - StartPos: 826, - EndPos: 829, + EndLine: 35, + StartPos: 826, + EndPos: 829, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 35, - EndLine: 35, - StartPos: 826, - EndPos: 829, + EndLine: 35, + StartPos: 826, + EndPos: 829, }, Value: "foo", }, @@ -2226,25 +2230,25 @@ func TestPhp5(t *testing.T) { &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 35, - EndLine: 35, - StartPos: 830, - EndPos: 830, + EndLine: 35, + StartPos: 830, + EndPos: 830, }, Value: " ", }, &expr.Variable{ Position: &position.Position{ StartLine: 35, - EndLine: 35, - StartPos: 831, - EndPos: 834, + EndLine: 35, + StartPos: 831, + EndPos: 834, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 35, - EndLine: 35, - StartPos: 831, - EndPos: 834, + EndLine: 35, + StartPos: 831, + EndPos: 834, }, Value: "bar", }, @@ -2255,47 +2259,47 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 36, - EndLine: 36, - StartPos: 840, - EndPos: 858, + EndLine: 36, + StartPos: 840, + EndPos: 858, }, Expr: &scalar.Encapsed{ Position: &position.Position{ StartLine: 36, - EndLine: 36, - StartPos: 840, - EndPos: 857, + EndLine: 36, + StartPos: 840, + EndPos: 857, }, Parts: []node.Node{ &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 36, - EndLine: 36, - StartPos: 841, - EndPos: 845, + EndLine: 36, + StartPos: 841, + EndPos: 845, }, Value: "test ", }, &expr.PropertyFetch{ Position: &position.Position{ StartLine: 36, - EndLine: 36, - StartPos: 846, - EndPos: 854, + EndLine: 36, + StartPos: 846, + EndPos: 854, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 36, - EndLine: 36, - StartPos: 846, - EndPos: 849, + EndLine: 36, + StartPos: 846, + EndPos: 849, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 36, - EndLine: 36, - StartPos: 846, - EndPos: 849, + EndLine: 36, + StartPos: 846, + EndPos: 849, }, Value: "foo", }, @@ -2303,9 +2307,9 @@ func TestPhp5(t *testing.T) { Property: &node.Identifier{ Position: &position.Position{ StartLine: 36, - EndLine: 36, - StartPos: 852, - EndPos: 854, + EndLine: 36, + StartPos: 852, + EndPos: 854, }, Value: "bar", }, @@ -2313,9 +2317,9 @@ func TestPhp5(t *testing.T) { &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 36, - EndLine: 36, - StartPos: 855, - EndPos: 856, + EndLine: 36, + StartPos: 855, + EndPos: 856, }, Value: "()", }, @@ -2325,40 +2329,40 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 37, - EndLine: 37, - StartPos: 862, - EndPos: 875, + EndLine: 37, + StartPos: 862, + EndPos: 875, }, Expr: &scalar.Encapsed{ Position: &position.Position{ StartLine: 37, - EndLine: 37, - StartPos: 862, - EndPos: 874, + EndLine: 37, + StartPos: 862, + EndPos: 874, }, Parts: []node.Node{ &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 37, - EndLine: 37, - StartPos: 863, - EndPos: 867, + EndLine: 37, + StartPos: 863, + EndPos: 867, }, Value: "test ", }, &expr.Variable{ Position: &position.Position{ StartLine: 37, - EndLine: 37, - StartPos: 868, - EndPos: 873, + EndLine: 37, + StartPos: 868, + EndPos: 873, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 37, - EndLine: 37, - StartPos: 870, - EndPos: 872, + EndLine: 37, + StartPos: 870, + EndPos: 872, }, Value: "foo", }, @@ -2369,47 +2373,47 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 38, - EndLine: 38, - StartPos: 879, - EndPos: 895, + EndLine: 38, + StartPos: 879, + EndPos: 895, }, Expr: &scalar.Encapsed{ Position: &position.Position{ StartLine: 38, - EndLine: 38, - StartPos: 879, - EndPos: 894, + EndLine: 38, + StartPos: 879, + EndPos: 894, }, Parts: []node.Node{ &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 38, - EndLine: 38, - StartPos: 880, - EndPos: 884, + EndLine: 38, + StartPos: 880, + EndPos: 884, }, Value: "test ", }, &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 38, - EndLine: 38, - StartPos: 885, - EndPos: 893, + EndLine: 38, + StartPos: 885, + EndPos: 893, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 38, - EndLine: 38, - StartPos: 887, - EndPos: 889, + EndLine: 38, + StartPos: 887, + EndPos: 889, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 38, - EndLine: 38, - StartPos: 887, - EndPos: 889, + EndLine: 38, + StartPos: 887, + EndPos: 889, }, Value: "foo", }, @@ -2417,9 +2421,9 @@ func TestPhp5(t *testing.T) { Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 38, - EndLine: 38, - StartPos: 891, - EndPos: 891, + EndLine: 38, + StartPos: 891, + EndPos: 891, }, Value: "0", }, @@ -2430,47 +2434,47 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 39, - EndLine: 39, - StartPos: 899, - EndPos: 919, + EndLine: 39, + StartPos: 899, + EndPos: 919, }, Expr: &scalar.Encapsed{ Position: &position.Position{ StartLine: 39, - EndLine: 39, - StartPos: 899, - EndPos: 918, + EndLine: 39, + StartPos: 899, + EndPos: 918, }, Parts: []node.Node{ &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 39, - EndLine: 39, - StartPos: 900, - EndPos: 904, + EndLine: 39, + StartPos: 900, + EndPos: 904, }, Value: "test ", }, &expr.MethodCall{ Position: &position.Position{ StartLine: 39, - EndLine: 39, - StartPos: 906, - EndPos: 916, + EndLine: 39, + StartPos: 906, + EndPos: 916, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 39, - EndLine: 39, - StartPos: 906, - EndPos: 909, + EndLine: 39, + StartPos: 906, + EndPos: 909, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 39, - EndLine: 39, - StartPos: 906, - EndPos: 909, + EndLine: 39, + StartPos: 906, + EndPos: 909, }, Value: "foo", }, @@ -2478,18 +2482,18 @@ func TestPhp5(t *testing.T) { Method: &node.Identifier{ Position: &position.Position{ StartLine: 39, - EndLine: 39, - StartPos: 912, - EndPos: 914, + EndLine: 39, + StartPos: 912, + EndPos: 914, }, Value: "bar", }, ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 39, - EndLine: 39, - StartPos: 915, - EndPos: 916, + EndLine: 39, + StartPos: 915, + EndPos: 916, }, }, }, @@ -2499,23 +2503,23 @@ func TestPhp5(t *testing.T) { &stmt.AltIf{ Position: &position.Position{ StartLine: 41, - EndLine: 42, - StartPos: 924, - EndPos: 941, + EndLine: 42, + StartPos: 924, + EndPos: 941, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 41, - EndLine: 41, - StartPos: 928, - EndPos: 929, + EndLine: 41, + StartPos: 928, + EndPos: 929, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 41, - EndLine: 41, - StartPos: 928, - EndPos: 929, + EndLine: 41, + StartPos: 928, + EndPos: 929, }, Value: "a", }, @@ -2523,33 +2527,34 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, }, &stmt.AltIf{ Position: &position.Position{ StartLine: 43, - EndLine: 45, - StartPos: 945, - EndPos: 977, + EndLine: 45, + StartPos: 945, + EndPos: 977, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 43, - EndLine: 43, - StartPos: 949, - EndPos: 950, + EndLine: 43, + StartPos: 949, + EndPos: 950, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 43, - EndLine: 43, - StartPos: 949, - EndPos: 950, + EndLine: 43, + StartPos: 949, + EndPos: 950, }, Value: "a", }, @@ -2557,33 +2562,34 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, ElseIf: []node.Node{ &stmt.AltElseIf{ Position: &position.Position{ StartLine: 44, - EndLine: -1, - StartPos: 957, - EndPos: -1, + EndLine: -1, + StartPos: 957, + EndPos: -1, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 44, - EndLine: 44, - StartPos: 965, - EndPos: 966, + EndLine: 44, + StartPos: 965, + EndPos: 966, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 44, - EndLine: 44, - StartPos: 965, - EndPos: 966, + EndLine: 44, + StartPos: 965, + EndPos: 966, }, Value: "b", }, @@ -2591,11 +2597,12 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, }, }, @@ -2603,23 +2610,23 @@ func TestPhp5(t *testing.T) { &stmt.AltIf{ Position: &position.Position{ StartLine: 46, - EndLine: 48, - StartPos: 981, - EndPos: 1006, + EndLine: 48, + StartPos: 981, + EndPos: 1006, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 46, - EndLine: 46, - StartPos: 985, - EndPos: 986, + EndLine: 46, + StartPos: 985, + EndPos: 986, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 46, - EndLine: 46, - StartPos: 985, - EndPos: 986, + EndLine: 46, + StartPos: 985, + EndPos: 986, }, Value: "a", }, @@ -2627,50 +2634,52 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, Else: &stmt.AltElse{ Position: &position.Position{ StartLine: 47, - EndLine: -1, - StartPos: 993, - EndPos: -1, + EndLine: -1, + StartPos: 993, + EndPos: -1, }, Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, }, }, &stmt.AltIf{ Position: &position.Position{ StartLine: 49, - EndLine: 53, - StartPos: 1010, - EndPos: 1065, + EndLine: 53, + StartPos: 1010, + EndPos: 1065, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 49, - EndLine: 49, - StartPos: 1014, - EndPos: 1015, + EndLine: 49, + StartPos: 1014, + EndPos: 1015, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 49, - EndLine: 49, - StartPos: 1014, - EndPos: 1015, + EndLine: 49, + StartPos: 1014, + EndPos: 1015, }, Value: "a", }, @@ -2678,33 +2687,34 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, ElseIf: []node.Node{ &stmt.AltElseIf{ Position: &position.Position{ StartLine: 50, - EndLine: -1, - StartPos: 1022, - EndPos: -1, + EndLine: -1, + StartPos: 1022, + EndPos: -1, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 50, - EndLine: 50, - StartPos: 1030, - EndPos: 1031, + EndLine: 50, + StartPos: 1030, + EndPos: 1031, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 50, - EndLine: 50, - StartPos: 1030, - EndPos: 1031, + EndLine: 50, + StartPos: 1030, + EndPos: 1031, }, Value: "b", }, @@ -2712,33 +2722,34 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, }, &stmt.AltElseIf{ Position: &position.Position{ StartLine: 51, - EndLine: -1, - StartPos: 1037, - EndPos: -1, + EndLine: -1, + StartPos: 1037, + EndPos: -1, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 51, - EndLine: 51, - StartPos: 1045, - EndPos: 1046, + EndLine: 51, + StartPos: 1045, + EndPos: 1046, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 51, - EndLine: 51, - StartPos: 1045, - EndPos: 1046, + EndLine: 51, + StartPos: 1045, + EndPos: 1046, }, Value: "c", }, @@ -2746,62 +2757,64 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, }, }, Else: &stmt.AltElse{ Position: &position.Position{ StartLine: 52, - EndLine: -1, - StartPos: 1052, - EndPos: -1, + EndLine: -1, + StartPos: 1052, + EndPos: -1, }, Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, }, }, &stmt.While{ Position: &position.Position{ StartLine: 55, - EndLine: 55, - StartPos: 1070, - EndPos: 1089, + EndLine: 55, + StartPos: 1070, + EndPos: 1089, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 55, - EndLine: 55, - StartPos: 1077, - EndPos: 1077, + EndLine: 55, + StartPos: 1077, + EndPos: 1077, }, Value: "1", }, Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 55, - EndLine: 55, - StartPos: 1080, - EndPos: 1089, + EndLine: 55, + StartPos: 1080, + EndPos: 1089, }, Stmts: []node.Node{ &stmt.Break{ Position: &position.Position{ StartLine: 55, - EndLine: 55, - StartPos: 1082, - EndPos: 1087, + EndLine: 55, + StartPos: 1082, + EndPos: 1087, }, }, }, @@ -2810,40 +2823,40 @@ func TestPhp5(t *testing.T) { &stmt.While{ Position: &position.Position{ StartLine: 56, - EndLine: 56, - StartPos: 1093, - EndPos: 1114, + EndLine: 56, + StartPos: 1093, + EndPos: 1114, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 56, - EndLine: 56, - StartPos: 1100, - EndPos: 1100, + EndLine: 56, + StartPos: 1100, + EndPos: 1100, }, Value: "1", }, Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 56, - EndLine: 56, - StartPos: 1103, - EndPos: 1114, + EndLine: 56, + StartPos: 1103, + EndPos: 1114, }, Stmts: []node.Node{ &stmt.Break{ Position: &position.Position{ StartLine: 56, - EndLine: 56, - StartPos: 1105, - EndPos: 1112, + EndLine: 56, + StartPos: 1105, + EndPos: 1112, }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 56, - EndLine: 56, - StartPos: 1111, - EndPos: 1111, + EndLine: 56, + StartPos: 1111, + EndPos: 1111, }, Value: "2", }, @@ -2854,40 +2867,40 @@ func TestPhp5(t *testing.T) { &stmt.AltWhile{ Position: &position.Position{ StartLine: 57, - EndLine: 57, - StartPos: 1118, - EndPos: 1148, + EndLine: 57, + StartPos: 1118, + EndPos: 1148, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 57, - EndLine: 57, - StartPos: 1125, - EndPos: 1125, + EndLine: 57, + StartPos: 1125, + EndPos: 1125, }, Value: "1", }, Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 57, - EndLine: 57, - StartPos: 1130, - EndPos: 1138, + EndLine: 57, + StartPos: 1130, + EndPos: 1138, }, Stmts: []node.Node{ &stmt.Break{ Position: &position.Position{ StartLine: 57, - EndLine: 57, - StartPos: 1130, - EndPos: 1138, + EndLine: 57, + StartPos: 1130, + EndPos: 1138, }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 57, - EndLine: 57, - StartPos: 1136, - EndPos: 1136, + EndLine: 57, + StartPos: 1136, + EndPos: 1136, }, Value: "3", }, @@ -2898,17 +2911,17 @@ func TestPhp5(t *testing.T) { &stmt.Class{ Position: &position.Position{ StartLine: 58, - EndLine: 58, - StartPos: 1152, - EndPos: 1187, + EndLine: 58, + StartPos: 1152, + EndPos: 1187, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 58, - EndLine: 58, - StartPos: 1158, - EndPos: 1160, + EndLine: 58, + StartPos: 1158, + EndPos: 1160, }, Value: "foo", }, @@ -2916,34 +2929,34 @@ func TestPhp5(t *testing.T) { &stmt.ClassConstList{ Position: &position.Position{ StartLine: 58, - EndLine: 58, - StartPos: 1163, - EndPos: 1185, + EndLine: 58, + StartPos: 1163, + EndPos: 1185, }, Consts: []node.Node{ &stmt.Constant{ Position: &position.Position{ StartLine: 58, - EndLine: 58, - StartPos: 1169, - EndPos: 1175, + EndLine: 58, + StartPos: 1169, + EndPos: 1175, }, PhpDocComment: "", ConstantName: &node.Identifier{ Position: &position.Position{ StartLine: 58, - EndLine: 58, - StartPos: 1169, - EndPos: 1171, + EndLine: 58, + StartPos: 1169, + EndPos: 1171, }, Value: "FOO", }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 58, - EndLine: 58, - StartPos: 1175, - EndPos: 1175, + EndLine: 58, + StartPos: 1175, + EndPos: 1175, }, Value: "1", }, @@ -2951,26 +2964,26 @@ func TestPhp5(t *testing.T) { &stmt.Constant{ Position: &position.Position{ StartLine: 58, - EndLine: 58, - StartPos: 1178, - EndPos: 1184, + EndLine: 58, + StartPos: 1178, + EndPos: 1184, }, PhpDocComment: "", ConstantName: &node.Identifier{ Position: &position.Position{ StartLine: 58, - EndLine: 58, - StartPos: 1178, - EndPos: 1180, + EndLine: 58, + StartPos: 1178, + EndPos: 1180, }, Value: "BAR", }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 58, - EndLine: 58, - StartPos: 1184, - EndPos: 1184, + EndLine: 58, + StartPos: 1184, + EndPos: 1184, }, Value: "2", }, @@ -2982,17 +2995,17 @@ func TestPhp5(t *testing.T) { &stmt.Class{ Position: &position.Position{ StartLine: 59, - EndLine: 59, - StartPos: 1191, - EndPos: 1220, + EndLine: 59, + StartPos: 1191, + EndPos: 1220, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 59, - EndLine: 59, - StartPos: 1197, - EndPos: 1199, + EndLine: 59, + StartPos: 1197, + EndPos: 1199, }, Value: "foo", }, @@ -3000,29 +3013,30 @@ func TestPhp5(t *testing.T) { &stmt.ClassMethod{ Position: &position.Position{ StartLine: 59, - EndLine: 59, - StartPos: 1202, - EndPos: 1218, + EndLine: 59, + StartPos: 1202, + EndPos: 1218, }, - ReturnsRef: false, + ReturnsRef: false, PhpDocComment: "", MethodName: &node.Identifier{ Position: &position.Position{ StartLine: 59, - EndLine: 59, - StartPos: 1211, - EndPos: 1213, + EndLine: 59, + StartPos: 1211, + EndPos: 1213, }, Value: "bar", }, Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 59, - EndLine: 59, - StartPos: 1217, - EndPos: 1218, + EndLine: 59, + StartPos: 1217, + EndPos: 1218, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, }, }, @@ -3030,17 +3044,17 @@ func TestPhp5(t *testing.T) { &stmt.Class{ Position: &position.Position{ StartLine: 60, - EndLine: 60, - StartPos: 1224, - EndPos: 1268, + EndLine: 60, + StartPos: 1224, + EndPos: 1268, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 60, - EndLine: 60, - StartPos: 1230, - EndPos: 1232, + EndLine: 60, + StartPos: 1230, + EndPos: 1232, }, Value: "foo", }, @@ -3048,18 +3062,18 @@ func TestPhp5(t *testing.T) { &stmt.ClassMethod{ Position: &position.Position{ StartLine: 60, - EndLine: 60, - StartPos: 1235, - EndPos: 1266, + EndLine: 60, + StartPos: 1235, + EndPos: 1266, }, - ReturnsRef: true, + ReturnsRef: true, PhpDocComment: "", MethodName: &node.Identifier{ Position: &position.Position{ StartLine: 60, - EndLine: 60, - StartPos: 1259, - EndPos: 1261, + EndLine: 60, + StartPos: 1259, + EndPos: 1261, }, Value: "bar", }, @@ -3067,18 +3081,18 @@ func TestPhp5(t *testing.T) { &node.Identifier{ Position: &position.Position{ StartLine: 60, - EndLine: 60, - StartPos: 1235, - EndPos: 1240, + EndLine: 60, + StartPos: 1235, + EndPos: 1240, }, Value: "public", }, &node.Identifier{ Position: &position.Position{ StartLine: 60, - EndLine: 60, - StartPos: 1242, - EndPos: 1247, + EndLine: 60, + StartPos: 1242, + EndPos: 1247, }, Value: "static", }, @@ -3086,11 +3100,12 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 60, - EndLine: 60, - StartPos: 1265, - EndPos: 1266, + EndLine: 60, + StartPos: 1265, + EndPos: 1266, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, }, }, @@ -3098,17 +3113,17 @@ func TestPhp5(t *testing.T) { &stmt.Class{ Position: &position.Position{ StartLine: 61, - EndLine: 61, - StartPos: 1272, - EndPos: 1343, + EndLine: 61, + StartPos: 1272, + EndPos: 1343, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 61, - EndLine: 61, - StartPos: 1278, - EndPos: 1280, + EndLine: 61, + StartPos: 1278, + EndPos: 1280, }, Value: "foo", }, @@ -3116,18 +3131,18 @@ func TestPhp5(t *testing.T) { &stmt.ClassMethod{ Position: &position.Position{ StartLine: 61, - EndLine: 61, - StartPos: 1283, - EndPos: 1313, + EndLine: 61, + StartPos: 1283, + EndPos: 1313, }, - ReturnsRef: false, + ReturnsRef: false, PhpDocComment: "", MethodName: &node.Identifier{ Position: &position.Position{ StartLine: 61, - EndLine: 61, - StartPos: 1306, - EndPos: 1308, + EndLine: 61, + StartPos: 1306, + EndPos: 1308, }, Value: "bar", }, @@ -3135,18 +3150,18 @@ func TestPhp5(t *testing.T) { &node.Identifier{ Position: &position.Position{ StartLine: 61, - EndLine: 61, - StartPos: 1283, - EndPos: 1287, + EndLine: 61, + StartPos: 1283, + EndPos: 1287, }, Value: "final", }, &node.Identifier{ Position: &position.Position{ StartLine: 61, - EndLine: 61, - StartPos: 1289, - EndPos: 1295, + EndLine: 61, + StartPos: 1289, + EndPos: 1295, }, Value: "private", }, @@ -3154,28 +3169,29 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 61, - EndLine: 61, - StartPos: 1312, - EndPos: 1313, + EndLine: 61, + StartPos: 1312, + EndPos: 1313, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, }, &stmt.ClassMethod{ Position: &position.Position{ StartLine: 61, - EndLine: 61, - StartPos: 1315, - EndPos: 1341, + EndLine: 61, + StartPos: 1315, + EndPos: 1341, }, - ReturnsRef: false, + ReturnsRef: false, PhpDocComment: "", MethodName: &node.Identifier{ Position: &position.Position{ StartLine: 61, - EndLine: 61, - StartPos: 1334, - EndPos: 1336, + EndLine: 61, + StartPos: 1334, + EndPos: 1336, }, Value: "baz", }, @@ -3183,9 +3199,9 @@ func TestPhp5(t *testing.T) { &node.Identifier{ Position: &position.Position{ StartLine: 61, - EndLine: 61, - StartPos: 1315, - EndPos: 1323, + EndLine: 61, + StartPos: 1315, + EndPos: 1323, }, Value: "protected", }, @@ -3193,11 +3209,12 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 61, - EndLine: 61, - StartPos: 1340, - EndPos: 1341, + EndLine: 61, + StartPos: 1340, + EndPos: 1341, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, }, }, @@ -3205,17 +3222,17 @@ func TestPhp5(t *testing.T) { &stmt.Class{ Position: &position.Position{ StartLine: 62, - EndLine: 62, - StartPos: 1347, - EndPos: 1399, + EndLine: 62, + StartPos: 1347, + EndPos: 1399, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 62, - EndLine: 62, - StartPos: 1362, - EndPos: 1364, + EndLine: 62, + StartPos: 1362, + EndPos: 1364, }, Value: "foo", }, @@ -3223,9 +3240,9 @@ func TestPhp5(t *testing.T) { &node.Identifier{ Position: &position.Position{ StartLine: 62, - EndLine: 62, - StartPos: 1347, - EndPos: 1354, + EndLine: 62, + StartPos: 1347, + EndPos: 1354, }, Value: "abstract", }, @@ -3234,18 +3251,18 @@ func TestPhp5(t *testing.T) { &stmt.ClassMethod{ Position: &position.Position{ StartLine: 62, - EndLine: 62, - StartPos: 1367, - EndPos: 1397, + EndLine: 62, + StartPos: 1367, + EndPos: 1397, }, - ReturnsRef: false, + ReturnsRef: false, PhpDocComment: "", MethodName: &node.Identifier{ Position: &position.Position{ StartLine: 62, - EndLine: 62, - StartPos: 1392, - EndPos: 1394, + EndLine: 62, + StartPos: 1392, + EndPos: 1394, }, Value: "bar", }, @@ -3253,18 +3270,18 @@ func TestPhp5(t *testing.T) { &node.Identifier{ Position: &position.Position{ StartLine: 62, - EndLine: 62, - StartPos: 1367, - EndPos: 1374, + EndLine: 62, + StartPos: 1367, + EndPos: 1374, }, Value: "abstract", }, &node.Identifier{ Position: &position.Position{ StartLine: 62, - EndLine: 62, - StartPos: 1376, - EndPos: 1381, + EndLine: 62, + StartPos: 1376, + EndPos: 1381, }, Value: "public", }, @@ -3272,9 +3289,9 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.Nop{ Position: &position.Position{ StartLine: 62, - EndLine: 62, - StartPos: 1397, - EndPos: 1397, + EndLine: 62, + StartPos: 1397, + EndPos: 1397, }, }, }, @@ -3283,17 +3300,17 @@ func TestPhp5(t *testing.T) { &stmt.Class{ Position: &position.Position{ StartLine: 63, - EndLine: 63, - StartPos: 1403, - EndPos: 1433, + EndLine: 63, + StartPos: 1403, + EndPos: 1433, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 63, - EndLine: 63, - StartPos: 1415, - EndPos: 1417, + EndLine: 63, + StartPos: 1415, + EndPos: 1417, }, Value: "foo", }, @@ -3301,9 +3318,9 @@ func TestPhp5(t *testing.T) { &node.Identifier{ Position: &position.Position{ StartLine: 63, - EndLine: 63, - StartPos: 1403, - EndPos: 1407, + EndLine: 63, + StartPos: 1403, + EndPos: 1407, }, Value: "final", }, @@ -3311,46 +3328,47 @@ func TestPhp5(t *testing.T) { Extends: &stmt.ClassExtends{ Position: &position.Position{ StartLine: 63, - EndLine: 63, - StartPos: 1419, - EndPos: 1429, + EndLine: 63, + StartPos: 1419, + EndPos: 1429, }, ClassName: &name.Name{ Position: &position.Position{ StartLine: 63, - EndLine: 63, - StartPos: 1427, - EndPos: 1429, + EndLine: 63, + StartPos: 1427, + EndPos: 1429, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 63, - EndLine: 63, - StartPos: 1427, - EndPos: 1429, + EndLine: 63, + StartPos: 1427, + EndPos: 1429, }, Value: "bar", }, }, }, }, - Stmts: []node.Node{}, + Stmts: []node.Node{ + }, }, &stmt.Class{ Position: &position.Position{ StartLine: 64, - EndLine: 64, - StartPos: 1437, - EndPos: 1470, + EndLine: 64, + StartPos: 1437, + EndPos: 1470, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 64, - EndLine: 64, - StartPos: 1449, - EndPos: 1451, + EndLine: 64, + StartPos: 1449, + EndPos: 1451, }, Value: "foo", }, @@ -3358,9 +3376,9 @@ func TestPhp5(t *testing.T) { &node.Identifier{ Position: &position.Position{ StartLine: 64, - EndLine: 64, - StartPos: 1437, - EndPos: 1441, + EndLine: 64, + StartPos: 1437, + EndPos: 1441, }, Value: "final", }, @@ -3368,25 +3386,25 @@ func TestPhp5(t *testing.T) { Implements: &stmt.ClassImplements{ Position: &position.Position{ StartLine: 64, - EndLine: 64, - StartPos: 1453, - EndPos: 1466, + EndLine: 64, + StartPos: 1453, + EndPos: 1466, }, InterfaceNames: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 64, - EndLine: 64, - StartPos: 1464, - EndPos: 1466, + EndLine: 64, + StartPos: 1464, + EndPos: 1466, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 64, - EndLine: 64, - StartPos: 1464, - EndPos: 1466, + EndLine: 64, + StartPos: 1464, + EndPos: 1466, }, Value: "bar", }, @@ -3394,22 +3412,23 @@ func TestPhp5(t *testing.T) { }, }, }, - Stmts: []node.Node{}, + Stmts: []node.Node{ + }, }, &stmt.Class{ Position: &position.Position{ StartLine: 65, - EndLine: 65, - StartPos: 1474, - EndPos: 1512, + EndLine: 65, + StartPos: 1474, + EndPos: 1512, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 65, - EndLine: 65, - StartPos: 1486, - EndPos: 1488, + EndLine: 65, + StartPos: 1486, + EndPos: 1488, }, Value: "foo", }, @@ -3417,9 +3436,9 @@ func TestPhp5(t *testing.T) { &node.Identifier{ Position: &position.Position{ StartLine: 65, - EndLine: 65, - StartPos: 1474, - EndPos: 1478, + EndLine: 65, + StartPos: 1474, + EndPos: 1478, }, Value: "final", }, @@ -3427,25 +3446,25 @@ func TestPhp5(t *testing.T) { Implements: &stmt.ClassImplements{ Position: &position.Position{ StartLine: 65, - EndLine: 65, - StartPos: 1490, - EndPos: 1508, + EndLine: 65, + StartPos: 1490, + EndPos: 1508, }, InterfaceNames: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 65, - EndLine: 65, - StartPos: 1501, - EndPos: 1503, + EndLine: 65, + StartPos: 1501, + EndPos: 1503, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 65, - EndLine: 65, - StartPos: 1501, - EndPos: 1503, + EndLine: 65, + StartPos: 1501, + EndPos: 1503, }, Value: "bar", }, @@ -3454,17 +3473,17 @@ func TestPhp5(t *testing.T) { &name.Name{ Position: &position.Position{ StartLine: 65, - EndLine: 65, - StartPos: 1506, - EndPos: 1508, + EndLine: 65, + StartPos: 1506, + EndPos: 1508, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 65, - EndLine: 65, - StartPos: 1506, - EndPos: 1508, + EndLine: 65, + StartPos: 1506, + EndPos: 1508, }, Value: "baz", }, @@ -3472,39 +3491,40 @@ func TestPhp5(t *testing.T) { }, }, }, - Stmts: []node.Node{}, + Stmts: []node.Node{ + }, }, &stmt.ConstList{ Position: &position.Position{ StartLine: 67, - EndLine: 67, - StartPos: 1517, - EndPos: 1539, + EndLine: 67, + StartPos: 1517, + EndPos: 1539, }, Consts: []node.Node{ &stmt.Constant{ Position: &position.Position{ StartLine: 67, - EndLine: 67, - StartPos: 1523, - EndPos: 1529, + EndLine: 67, + StartPos: 1523, + EndPos: 1529, }, PhpDocComment: "", ConstantName: &node.Identifier{ Position: &position.Position{ StartLine: 67, - EndLine: 67, - StartPos: 1523, - EndPos: 1525, + EndLine: 67, + StartPos: 1523, + EndPos: 1525, }, Value: "FOO", }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 67, - EndLine: 67, - StartPos: 1529, - EndPos: 1529, + EndLine: 67, + StartPos: 1529, + EndPos: 1529, }, Value: "1", }, @@ -3512,26 +3532,26 @@ func TestPhp5(t *testing.T) { &stmt.Constant{ Position: &position.Position{ StartLine: 67, - EndLine: 67, - StartPos: 1532, - EndPos: 1538, + EndLine: 67, + StartPos: 1532, + EndPos: 1538, }, PhpDocComment: "", ConstantName: &node.Identifier{ Position: &position.Position{ StartLine: 67, - EndLine: 67, - StartPos: 1532, - EndPos: 1534, + EndLine: 67, + StartPos: 1532, + EndPos: 1534, }, Value: "BAR", }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 67, - EndLine: 67, - StartPos: 1538, - EndPos: 1538, + EndLine: 67, + StartPos: 1538, + EndPos: 1538, }, Value: "2", }, @@ -3541,33 +3561,33 @@ func TestPhp5(t *testing.T) { &stmt.While{ Position: &position.Position{ StartLine: 68, - EndLine: 68, - StartPos: 1543, - EndPos: 1565, + EndLine: 68, + StartPos: 1543, + EndPos: 1565, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 68, - EndLine: 68, - StartPos: 1550, - EndPos: 1550, + EndLine: 68, + StartPos: 1550, + EndPos: 1550, }, Value: "1", }, Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 68, - EndLine: 68, - StartPos: 1553, - EndPos: 1565, + EndLine: 68, + StartPos: 1553, + EndPos: 1565, }, Stmts: []node.Node{ &stmt.Continue{ Position: &position.Position{ StartLine: 68, - EndLine: 68, - StartPos: 1555, - EndPos: 1563, + EndLine: 68, + StartPos: 1555, + EndPos: 1563, }, }, }, @@ -3576,40 +3596,40 @@ func TestPhp5(t *testing.T) { &stmt.While{ Position: &position.Position{ StartLine: 69, - EndLine: 69, - StartPos: 1569, - EndPos: 1593, + EndLine: 69, + StartPos: 1569, + EndPos: 1593, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 69, - EndLine: 69, - StartPos: 1576, - EndPos: 1576, + EndLine: 69, + StartPos: 1576, + EndPos: 1576, }, Value: "1", }, Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 69, - EndLine: 69, - StartPos: 1579, - EndPos: 1593, + EndLine: 69, + StartPos: 1579, + EndPos: 1593, }, Stmts: []node.Node{ &stmt.Continue{ Position: &position.Position{ StartLine: 69, - EndLine: 69, - StartPos: 1581, - EndPos: 1591, + EndLine: 69, + StartPos: 1581, + EndPos: 1591, }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 69, - EndLine: 69, - StartPos: 1590, - EndPos: 1590, + EndLine: 69, + StartPos: 1590, + EndPos: 1590, }, Value: "2", }, @@ -3620,40 +3640,40 @@ func TestPhp5(t *testing.T) { &stmt.While{ Position: &position.Position{ StartLine: 70, - EndLine: 70, - StartPos: 1597, - EndPos: 1622, + EndLine: 70, + StartPos: 1597, + EndPos: 1622, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 70, - EndLine: 70, - StartPos: 1604, - EndPos: 1604, + EndLine: 70, + StartPos: 1604, + EndPos: 1604, }, Value: "1", }, Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 70, - EndLine: 70, - StartPos: 1607, - EndPos: 1622, + EndLine: 70, + StartPos: 1607, + EndPos: 1622, }, Stmts: []node.Node{ &stmt.Continue{ Position: &position.Position{ StartLine: 70, - EndLine: 70, - StartPos: 1609, - EndPos: 1620, + EndLine: 70, + StartPos: 1609, + EndPos: 1620, }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 70, - EndLine: 70, - StartPos: 1618, - EndPos: 1618, + EndLine: 70, + StartPos: 1618, + EndPos: 1618, }, Value: "3", }, @@ -3664,34 +3684,34 @@ func TestPhp5(t *testing.T) { &stmt.Declare{ Position: &position.Position{ StartLine: 71, - EndLine: 71, - StartPos: 1626, - EndPos: 1642, + EndLine: 71, + StartPos: 1626, + EndPos: 1642, }, Consts: []node.Node{ &stmt.Constant{ Position: &position.Position{ StartLine: 71, - EndLine: 71, - StartPos: 1634, - EndPos: 1640, + EndLine: 71, + StartPos: 1634, + EndPos: 1640, }, PhpDocComment: "", ConstantName: &node.Identifier{ Position: &position.Position{ StartLine: 71, - EndLine: 71, - StartPos: 1634, - EndPos: 1638, + EndLine: 71, + StartPos: 1634, + EndPos: 1638, }, Value: "ticks", }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 71, - EndLine: 71, - StartPos: 1640, - EndPos: 1640, + EndLine: 71, + StartPos: 1640, + EndPos: 1640, }, Value: "1", }, @@ -3700,43 +3720,43 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.Nop{ Position: &position.Position{ StartLine: 71, - EndLine: 71, - StartPos: 1642, - EndPos: 1642, + EndLine: 71, + StartPos: 1642, + EndPos: 1642, }, }, }, &stmt.Declare{ Position: &position.Position{ StartLine: 72, - EndLine: 72, - StartPos: 1646, - EndPos: 1680, + EndLine: 72, + StartPos: 1646, + EndPos: 1680, }, Consts: []node.Node{ &stmt.Constant{ Position: &position.Position{ StartLine: 72, - EndLine: 72, - StartPos: 1654, - EndPos: 1660, + EndLine: 72, + StartPos: 1654, + EndPos: 1660, }, PhpDocComment: "", ConstantName: &node.Identifier{ Position: &position.Position{ StartLine: 72, - EndLine: 72, - StartPos: 1654, - EndPos: 1658, + EndLine: 72, + StartPos: 1654, + EndPos: 1658, }, Value: "ticks", }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 72, - EndLine: 72, - StartPos: 1660, - EndPos: 1660, + EndLine: 72, + StartPos: 1660, + EndPos: 1660, }, Value: "1", }, @@ -3744,26 +3764,26 @@ func TestPhp5(t *testing.T) { &stmt.Constant{ Position: &position.Position{ StartLine: 72, - EndLine: 72, - StartPos: 1663, - EndPos: 1676, + EndLine: 72, + StartPos: 1663, + EndPos: 1676, }, PhpDocComment: "", ConstantName: &node.Identifier{ Position: &position.Position{ StartLine: 72, - EndLine: 72, - StartPos: 1663, - EndPos: 1674, + EndLine: 72, + StartPos: 1663, + EndPos: 1674, }, Value: "strict_types", }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 72, - EndLine: 72, - StartPos: 1676, - EndPos: 1676, + EndLine: 72, + StartPos: 1676, + EndPos: 1676, }, Value: "1", }, @@ -3772,44 +3792,45 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 72, - EndLine: 72, - StartPos: 1679, - EndPos: 1680, + EndLine: 72, + StartPos: 1679, + EndPos: 1680, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, }, &stmt.Declare{ Position: &position.Position{ StartLine: 73, - EndLine: 73, - StartPos: 1684, - EndPos: 1712, + EndLine: 73, + StartPos: 1684, + EndPos: 1712, }, Consts: []node.Node{ &stmt.Constant{ Position: &position.Position{ StartLine: 73, - EndLine: 73, - StartPos: 1692, - EndPos: 1698, + EndLine: 73, + StartPos: 1692, + EndPos: 1698, }, PhpDocComment: "", ConstantName: &node.Identifier{ Position: &position.Position{ StartLine: 73, - EndLine: 73, - StartPos: 1692, - EndPos: 1696, + EndLine: 73, + StartPos: 1692, + EndPos: 1696, }, Value: "ticks", }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 73, - EndLine: 73, - StartPos: 1698, - EndPos: 1698, + EndLine: 73, + StartPos: 1698, + EndPos: 1698, }, Value: "1", }, @@ -3818,35 +3839,37 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 73, - EndLine: 73, - StartPos: 1700, - EndPos: 1712, + EndLine: 73, + StartPos: 1700, + EndPos: 1712, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, }, &stmt.Do{ Position: &position.Position{ StartLine: 74, - EndLine: 74, - StartPos: 1716, - EndPos: 1730, + EndLine: 74, + StartPos: 1716, + EndPos: 1730, }, Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 74, - EndLine: 74, - StartPos: 1719, - EndPos: 1720, + EndLine: 74, + StartPos: 1719, + EndPos: 1720, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 74, - EndLine: 74, - StartPos: 1728, - EndPos: 1728, + EndLine: 74, + StartPos: 1728, + EndPos: 1728, }, Value: "1", }, @@ -3854,24 +3877,24 @@ func TestPhp5(t *testing.T) { &stmt.Echo{ Position: &position.Position{ StartLine: 75, - EndLine: 75, - StartPos: 1734, - EndPos: 1744, + EndLine: 75, + StartPos: 1734, + EndPos: 1744, }, Exprs: []node.Node{ &expr.Variable{ Position: &position.Position{ StartLine: 75, - EndLine: 75, - StartPos: 1739, - EndPos: 1740, + EndLine: 75, + StartPos: 1739, + EndPos: 1740, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 75, - EndLine: 75, - StartPos: 1739, - EndPos: 1740, + EndLine: 75, + StartPos: 1739, + EndPos: 1740, }, Value: "a", }, @@ -3879,9 +3902,9 @@ func TestPhp5(t *testing.T) { &scalar.Lnumber{ Position: &position.Position{ StartLine: 75, - EndLine: 75, - StartPos: 1743, - EndPos: 1743, + EndLine: 75, + StartPos: 1743, + EndPos: 1743, }, Value: "1", }, @@ -3890,24 +3913,24 @@ func TestPhp5(t *testing.T) { &stmt.Echo{ Position: &position.Position{ StartLine: 76, - EndLine: 76, - StartPos: 1748, - EndPos: 1756, + EndLine: 76, + StartPos: 1748, + EndPos: 1756, }, Exprs: []node.Node{ &expr.Variable{ Position: &position.Position{ StartLine: 76, - EndLine: 76, - StartPos: 1753, - EndPos: 1754, + EndLine: 76, + StartPos: 1753, + EndPos: 1754, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 76, - EndLine: 76, - StartPos: 1753, - EndPos: 1754, + EndLine: 76, + StartPos: 1753, + EndPos: 1754, }, Value: "a", }, @@ -3917,31 +3940,31 @@ func TestPhp5(t *testing.T) { &stmt.For{ Position: &position.Position{ StartLine: 77, - EndLine: 77, - StartPos: 1760, - EndPos: 1794, + EndLine: 77, + StartPos: 1760, + EndPos: 1794, }, Init: []node.Node{ &assign.Assign{ Position: &position.Position{ StartLine: 77, - EndLine: 77, - StartPos: 1764, - EndPos: 1769, + EndLine: 77, + StartPos: 1764, + EndPos: 1769, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 77, - EndLine: 77, - StartPos: 1764, - EndPos: 1765, + EndLine: 77, + StartPos: 1764, + EndPos: 1765, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 77, - EndLine: 77, - StartPos: 1764, - EndPos: 1765, + EndLine: 77, + StartPos: 1764, + EndPos: 1765, }, Value: "i", }, @@ -3949,9 +3972,9 @@ func TestPhp5(t *testing.T) { Expression: &scalar.Lnumber{ Position: &position.Position{ StartLine: 77, - EndLine: 77, - StartPos: 1769, - EndPos: 1769, + EndLine: 77, + StartPos: 1769, + EndPos: 1769, }, Value: "0", }, @@ -3961,23 +3984,23 @@ func TestPhp5(t *testing.T) { &binary.Smaller{ Position: &position.Position{ StartLine: 77, - EndLine: 77, - StartPos: 1772, - EndPos: 1778, + EndLine: 77, + StartPos: 1772, + EndPos: 1778, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 77, - EndLine: 77, - StartPos: 1772, - EndPos: 1773, + EndLine: 77, + StartPos: 1772, + EndPos: 1773, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 77, - EndLine: 77, - StartPos: 1772, - EndPos: 1773, + EndLine: 77, + StartPos: 1772, + EndPos: 1773, }, Value: "i", }, @@ -3985,9 +4008,9 @@ func TestPhp5(t *testing.T) { Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 77, - EndLine: 77, - StartPos: 1777, - EndPos: 1778, + EndLine: 77, + StartPos: 1777, + EndPos: 1778, }, Value: "10", }, @@ -3997,23 +4020,23 @@ func TestPhp5(t *testing.T) { &expr.PostInc{ Position: &position.Position{ StartLine: 77, - EndLine: 77, - StartPos: 1781, - EndPos: 1784, + EndLine: 77, + StartPos: 1781, + EndPos: 1784, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 77, - EndLine: 77, - StartPos: 1781, - EndPos: 1782, + EndLine: 77, + StartPos: 1781, + EndPos: 1782, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 77, - EndLine: 77, - StartPos: 1781, - EndPos: 1782, + EndLine: 77, + StartPos: 1781, + EndPos: 1782, }, Value: "i", }, @@ -4022,23 +4045,23 @@ func TestPhp5(t *testing.T) { &expr.PostInc{ Position: &position.Position{ StartLine: 77, - EndLine: 77, - StartPos: 1787, - EndPos: 1790, + EndLine: 77, + StartPos: 1787, + EndPos: 1790, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 77, - EndLine: 77, - StartPos: 1787, - EndPos: 1788, + EndLine: 77, + StartPos: 1787, + EndPos: 1788, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 77, - EndLine: 77, - StartPos: 1787, - EndPos: 1788, + EndLine: 77, + StartPos: 1787, + EndPos: 1788, }, Value: "i", }, @@ -4048,41 +4071,42 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 77, - EndLine: 77, - StartPos: 1793, - EndPos: 1794, + EndLine: 77, + StartPos: 1793, + EndPos: 1794, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, }, &stmt.AltFor{ Position: &position.Position{ StartLine: 78, - EndLine: 78, - StartPos: 1798, - EndPos: 1827, + EndLine: 78, + StartPos: 1798, + EndPos: 1827, }, Cond: []node.Node{ &binary.Smaller{ Position: &position.Position{ StartLine: 78, - EndLine: 78, - StartPos: 1804, - EndPos: 1810, + EndLine: 78, + StartPos: 1804, + EndPos: 1810, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 78, - EndLine: 78, - StartPos: 1804, - EndPos: 1805, + EndLine: 78, + StartPos: 1804, + EndPos: 1805, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 78, - EndLine: 78, - StartPos: 1804, - EndPos: 1805, + EndLine: 78, + StartPos: 1804, + EndPos: 1805, }, Value: "i", }, @@ -4090,9 +4114,9 @@ func TestPhp5(t *testing.T) { Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 78, - EndLine: 78, - StartPos: 1809, - EndPos: 1810, + EndLine: 78, + StartPos: 1809, + EndPos: 1810, }, Value: "10", }, @@ -4102,23 +4126,23 @@ func TestPhp5(t *testing.T) { &expr.PostInc{ Position: &position.Position{ StartLine: 78, - EndLine: 78, - StartPos: 1813, - EndPos: 1816, + EndLine: 78, + StartPos: 1813, + EndPos: 1816, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 78, - EndLine: 78, - StartPos: 1813, - EndPos: 1814, + EndLine: 78, + StartPos: 1813, + EndPos: 1814, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 78, - EndLine: 78, - StartPos: 1813, - EndPos: 1814, + EndLine: 78, + StartPos: 1813, + EndPos: 1814, }, Value: "i", }, @@ -4128,33 +4152,34 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, }, &stmt.Foreach{ Position: &position.Position{ StartLine: 79, - EndLine: 79, - StartPos: 1831, - EndPos: 1851, + EndLine: 79, + StartPos: 1831, + EndPos: 1851, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 79, - EndLine: 79, - StartPos: 1840, - EndPos: 1841, + EndLine: 79, + StartPos: 1840, + EndPos: 1841, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 79, - EndLine: 79, - StartPos: 1840, - EndPos: 1841, + EndLine: 79, + StartPos: 1840, + EndPos: 1841, }, Value: "a", }, @@ -4162,16 +4187,16 @@ func TestPhp5(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 79, - EndLine: 79, - StartPos: 1846, - EndPos: 1847, + EndLine: 79, + StartPos: 1846, + EndPos: 1847, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 79, - EndLine: 79, - StartPos: 1846, - EndPos: 1847, + EndLine: 79, + StartPos: 1846, + EndPos: 1847, }, Value: "v", }, @@ -4179,42 +4204,44 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 79, - EndLine: 79, - StartPos: 1850, - EndPos: 1851, + EndLine: 79, + StartPos: 1850, + EndPos: 1851, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, }, &stmt.Foreach{ Position: &position.Position{ StartLine: 80, - EndLine: 80, - StartPos: 1855, - EndPos: 1875, + EndLine: 80, + StartPos: 1855, + EndPos: 1875, }, Expr: &expr.ShortArray{ Position: &position.Position{ StartLine: 80, - EndLine: 80, - StartPos: 1864, - EndPos: 1865, + EndLine: 80, + StartPos: 1864, + EndPos: 1865, + }, + Items: []node.Node{ }, - Items: []node.Node{}, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 80, - EndLine: 80, - StartPos: 1870, - EndPos: 1871, + EndLine: 80, + StartPos: 1870, + EndPos: 1871, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 80, - EndLine: 80, - StartPos: 1870, - EndPos: 1871, + EndLine: 80, + StartPos: 1870, + EndPos: 1871, }, Value: "v", }, @@ -4222,33 +4249,34 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 80, - EndLine: 80, - StartPos: 1874, - EndPos: 1875, + EndLine: 80, + StartPos: 1874, + EndPos: 1875, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, }, &stmt.AltForeach{ Position: &position.Position{ StartLine: 81, - EndLine: 81, - StartPos: 1879, - EndPos: 1910, + EndLine: 81, + StartPos: 1879, + EndPos: 1910, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 81, - EndLine: 81, - StartPos: 1888, - EndPos: 1889, + EndLine: 81, + StartPos: 1888, + EndPos: 1889, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 81, - EndLine: 81, - StartPos: 1888, - EndPos: 1889, + EndLine: 81, + StartPos: 1888, + EndPos: 1889, }, Value: "a", }, @@ -4256,16 +4284,16 @@ func TestPhp5(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 81, - EndLine: 81, - StartPos: 1894, - EndPos: 1895, + EndLine: 81, + StartPos: 1894, + EndPos: 1895, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 81, - EndLine: 81, - StartPos: 1894, - EndPos: 1895, + EndLine: 81, + StartPos: 1894, + EndPos: 1895, }, Value: "v", }, @@ -4273,33 +4301,34 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, }, &stmt.Foreach{ Position: &position.Position{ StartLine: 82, - EndLine: 82, - StartPos: 1914, - EndPos: 1940, + EndLine: 82, + StartPos: 1914, + EndPos: 1940, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 82, - EndLine: 82, - StartPos: 1923, - EndPos: 1924, + EndLine: 82, + StartPos: 1923, + EndPos: 1924, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 82, - EndLine: 82, - StartPos: 1923, - EndPos: 1924, + EndLine: 82, + StartPos: 1923, + EndPos: 1924, }, Value: "a", }, @@ -4307,16 +4336,16 @@ func TestPhp5(t *testing.T) { Key: &expr.Variable{ Position: &position.Position{ StartLine: 82, - EndLine: 82, - StartPos: 1929, - EndPos: 1930, + EndLine: 82, + StartPos: 1929, + EndPos: 1930, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 82, - EndLine: 82, - StartPos: 1929, - EndPos: 1930, + EndLine: 82, + StartPos: 1929, + EndPos: 1930, }, Value: "k", }, @@ -4324,16 +4353,16 @@ func TestPhp5(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 82, - EndLine: 82, - StartPos: 1935, - EndPos: 1936, + EndLine: 82, + StartPos: 1935, + EndPos: 1936, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 82, - EndLine: 82, - StartPos: 1935, - EndPos: 1936, + EndLine: 82, + StartPos: 1935, + EndPos: 1936, }, Value: "v", }, @@ -4341,42 +4370,44 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 82, - EndLine: 82, - StartPos: 1939, - EndPos: 1940, + EndLine: 82, + StartPos: 1939, + EndPos: 1940, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, }, &stmt.Foreach{ Position: &position.Position{ StartLine: 83, - EndLine: 83, - StartPos: 1944, - EndPos: 1970, + EndLine: 83, + StartPos: 1944, + EndPos: 1970, }, Expr: &expr.ShortArray{ Position: &position.Position{ StartLine: 83, - EndLine: 83, - StartPos: 1953, - EndPos: 1954, + EndLine: 83, + StartPos: 1953, + EndPos: 1954, + }, + Items: []node.Node{ }, - Items: []node.Node{}, }, Key: &expr.Variable{ Position: &position.Position{ StartLine: 83, - EndLine: 83, - StartPos: 1959, - EndPos: 1960, + EndLine: 83, + StartPos: 1959, + EndPos: 1960, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 83, - EndLine: 83, - StartPos: 1959, - EndPos: 1960, + EndLine: 83, + StartPos: 1959, + EndPos: 1960, }, Value: "k", }, @@ -4384,16 +4415,16 @@ func TestPhp5(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 83, - EndLine: 83, - StartPos: 1965, - EndPos: 1966, + EndLine: 83, + StartPos: 1965, + EndPos: 1966, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 83, - EndLine: 83, - StartPos: 1965, - EndPos: 1966, + EndLine: 83, + StartPos: 1965, + EndPos: 1966, }, Value: "v", }, @@ -4401,33 +4432,34 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 83, - EndLine: 83, - StartPos: 1969, - EndPos: 1970, + EndLine: 83, + StartPos: 1969, + EndPos: 1970, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, }, &stmt.Foreach{ Position: &position.Position{ StartLine: 84, - EndLine: 84, - StartPos: 1974, - EndPos: 2001, + EndLine: 84, + StartPos: 1974, + EndPos: 2001, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 84, - EndLine: 84, - StartPos: 1983, - EndPos: 1984, + EndLine: 84, + StartPos: 1983, + EndPos: 1984, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 84, - EndLine: 84, - StartPos: 1983, - EndPos: 1984, + EndLine: 84, + StartPos: 1983, + EndPos: 1984, }, Value: "a", }, @@ -4435,16 +4467,16 @@ func TestPhp5(t *testing.T) { Key: &expr.Variable{ Position: &position.Position{ StartLine: 84, - EndLine: 84, - StartPos: 1989, - EndPos: 1990, + EndLine: 84, + StartPos: 1989, + EndPos: 1990, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 84, - EndLine: 84, - StartPos: 1989, - EndPos: 1990, + EndLine: 84, + StartPos: 1989, + EndPos: 1990, }, Value: "k", }, @@ -4452,23 +4484,23 @@ func TestPhp5(t *testing.T) { Variable: &expr.Reference{ Position: &position.Position{ StartLine: 84, - EndLine: 84, - StartPos: 1995, - EndPos: 1997, + EndLine: 84, + StartPos: 1995, + EndPos: 1997, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 84, - EndLine: 84, - StartPos: 1996, - EndPos: 1997, + EndLine: 84, + StartPos: 1996, + EndPos: 1997, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 84, - EndLine: 84, - StartPos: 1996, - EndPos: 1997, + EndLine: 84, + StartPos: 1996, + EndPos: 1997, }, Value: "v", }, @@ -4477,33 +4509,34 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 84, - EndLine: 84, - StartPos: 2000, - EndPos: 2001, + EndLine: 84, + StartPos: 2000, + EndPos: 2001, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, }, &stmt.Foreach{ Position: &position.Position{ StartLine: 85, - EndLine: 85, - StartPos: 2005, - EndPos: 2037, + EndLine: 85, + StartPos: 2005, + EndPos: 2037, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 85, - EndLine: 85, - StartPos: 2014, - EndPos: 2015, + EndLine: 85, + StartPos: 2014, + EndPos: 2015, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 85, - EndLine: 85, - StartPos: 2014, - EndPos: 2015, + EndLine: 85, + StartPos: 2014, + EndPos: 2015, }, Value: "a", }, @@ -4511,16 +4544,16 @@ func TestPhp5(t *testing.T) { Key: &expr.Variable{ Position: &position.Position{ StartLine: 85, - EndLine: 85, - StartPos: 2020, - EndPos: 2021, + EndLine: 85, + StartPos: 2020, + EndPos: 2021, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 85, - EndLine: 85, - StartPos: 2020, - EndPos: 2021, + EndLine: 85, + StartPos: 2020, + EndPos: 2021, }, Value: "k", }, @@ -4528,31 +4561,31 @@ func TestPhp5(t *testing.T) { Variable: &expr.List{ Position: &position.Position{ StartLine: 85, - EndLine: 85, - StartPos: 2026, - EndPos: 2033, + EndLine: 85, + StartPos: 2026, + EndPos: 2033, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 85, - EndLine: 85, - StartPos: 2031, - EndPos: 2032, + EndLine: 85, + StartPos: 2031, + EndPos: 2032, }, Val: &expr.Variable{ Position: &position.Position{ StartLine: 85, - EndLine: 85, - StartPos: 2031, - EndPos: 2032, + EndLine: 85, + StartPos: 2031, + EndPos: 2032, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 85, - EndLine: 85, - StartPos: 2031, - EndPos: 2032, + EndLine: 85, + StartPos: 2031, + EndPos: 2032, }, Value: "v", }, @@ -4563,48 +4596,50 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 85, - EndLine: 85, - StartPos: 2036, - EndPos: 2037, + EndLine: 85, + StartPos: 2036, + EndPos: 2037, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, }, &stmt.Function{ Position: &position.Position{ StartLine: 86, - EndLine: 86, - StartPos: 2041, - EndPos: 2057, + EndLine: 86, + StartPos: 2041, + EndPos: 2057, }, - ReturnsRef: false, + ReturnsRef: false, PhpDocComment: "", FunctionName: &node.Identifier{ Position: &position.Position{ StartLine: 86, - EndLine: 86, - StartPos: 2050, - EndPos: 2052, + EndLine: 86, + StartPos: 2050, + EndPos: 2052, }, Value: "foo", }, - Stmts: []node.Node{}, + Stmts: []node.Node{ + }, }, &stmt.Function{ Position: &position.Position{ StartLine: 88, - EndLine: 93, - StartPos: 2062, - EndPos: 2154, + EndLine: 93, + StartPos: 2062, + EndPos: 2154, }, - ReturnsRef: false, + ReturnsRef: false, PhpDocComment: "", FunctionName: &node.Identifier{ Position: &position.Position{ StartLine: 88, - EndLine: 88, - StartPos: 2071, - EndPos: 2073, + EndLine: 88, + StartPos: 2071, + EndPos: 2073, }, Value: "foo", }, @@ -4612,70 +4647,72 @@ func TestPhp5(t *testing.T) { &stmt.HaltCompiler{ Position: &position.Position{ StartLine: 89, - EndLine: 89, - StartPos: 2082, - EndPos: 2099, + EndLine: 89, + StartPos: 2082, + EndPos: 2099, }, }, &stmt.Function{ Position: &position.Position{ StartLine: 90, - EndLine: 90, - StartPos: 2104, - EndPos: 2120, + EndLine: 90, + StartPos: 2104, + EndPos: 2120, }, - ReturnsRef: false, PhpDocComment: "", + ReturnsRef: false, FunctionName: &node.Identifier{ Position: &position.Position{ StartLine: 90, - EndLine: 90, - StartPos: 2113, - EndPos: 2115, + EndLine: 90, + StartPos: 2113, + EndPos: 2115, }, Value: "bar", }, - Stmts: []node.Node{}, + Stmts: []node.Node{ + }, }, &stmt.Class{ Position: &position.Position{ StartLine: 91, - EndLine: 91, - StartPos: 2125, - EndPos: 2136, + EndLine: 91, + StartPos: 2125, + EndPos: 2136, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 91, - EndLine: 91, - StartPos: 2131, - EndPos: 2133, + EndLine: 91, + StartPos: 2131, + EndPos: 2133, }, Value: "Baz", }, - Stmts: []node.Node{}, + Stmts: []node.Node{ + }, }, &stmt.Return{ Position: &position.Position{ StartLine: 92, - EndLine: 92, - StartPos: 2141, - EndPos: 2150, + EndLine: 92, + StartPos: 2141, + EndPos: 2150, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 92, - EndLine: 92, - StartPos: 2148, - EndPos: 2149, + EndLine: 92, + StartPos: 2148, + EndPos: 2149, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 92, - EndLine: 92, - StartPos: 2148, - EndPos: 2149, + EndLine: 92, + StartPos: 2148, + EndPos: 2149, }, Value: "a", }, @@ -4686,18 +4723,18 @@ func TestPhp5(t *testing.T) { &stmt.Function{ Position: &position.Position{ StartLine: 95, - EndLine: 95, - StartPos: 2161, - EndPos: 2205, + EndLine: 95, + StartPos: 2161, + EndPos: 2205, }, - ReturnsRef: false, + ReturnsRef: false, PhpDocComment: "", FunctionName: &node.Identifier{ Position: &position.Position{ StartLine: 95, - EndLine: 95, - StartPos: 2170, - EndPos: 2172, + EndLine: 95, + StartPos: 2170, + EndPos: 2172, }, Value: "foo", }, @@ -4705,34 +4742,34 @@ func TestPhp5(t *testing.T) { &node.Parameter{ Position: &position.Position{ StartLine: 95, - EndLine: 95, - StartPos: 2174, - EndPos: 2181, + EndLine: 95, + StartPos: 2174, + EndPos: 2181, }, + ByRef: false, Variadic: false, - ByRef: false, VariableType: &node.Identifier{ Position: &position.Position{ StartLine: 95, - EndLine: 95, - StartPos: 2174, - EndPos: 2178, + EndLine: 95, + StartPos: 2174, + EndPos: 2178, }, Value: "array", }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 95, - EndLine: 95, - StartPos: 2180, - EndPos: 2181, + EndLine: 95, + StartPos: 2180, + EndPos: 2181, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 95, - EndLine: 95, - StartPos: 2180, - EndPos: 2181, + EndLine: 95, + StartPos: 2180, + EndPos: 2181, }, Value: "a", }, @@ -4741,34 +4778,34 @@ func TestPhp5(t *testing.T) { &node.Parameter{ Position: &position.Position{ StartLine: 95, - EndLine: 95, - StartPos: 2184, - EndPos: 2194, + EndLine: 95, + StartPos: 2184, + EndPos: 2194, }, - ByRef: false, + ByRef: false, Variadic: false, VariableType: &node.Identifier{ Position: &position.Position{ StartLine: 95, - EndLine: 95, - StartPos: 2184, - EndPos: 2191, + EndLine: 95, + StartPos: 2184, + EndPos: 2191, }, Value: "callable", }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 95, - EndLine: 95, - StartPos: 2193, - EndPos: 2194, + EndLine: 95, + StartPos: 2193, + EndPos: 2194, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 95, - EndLine: 95, - StartPos: 2193, - EndPos: 2194, + EndLine: 95, + StartPos: 2193, + EndPos: 2194, }, Value: "b", }, @@ -4779,9 +4816,9 @@ func TestPhp5(t *testing.T) { &stmt.Return{ Position: &position.Position{ StartLine: 95, - EndLine: 95, - StartPos: 2198, - EndPos: 2204, + EndLine: 95, + StartPos: 2198, + EndPos: 2204, }, }, }, @@ -4789,18 +4826,18 @@ func TestPhp5(t *testing.T) { &stmt.Function{ Position: &position.Position{ StartLine: 96, - EndLine: 96, - StartPos: 2209, - EndPos: 2235, + EndLine: 96, + StartPos: 2209, + EndPos: 2235, }, + ReturnsRef: true, PhpDocComment: "", - ReturnsRef: true, FunctionName: &node.Identifier{ Position: &position.Position{ StartLine: 96, - EndLine: 96, - StartPos: 2219, - EndPos: 2221, + EndLine: 96, + StartPos: 2219, + EndPos: 2221, }, Value: "foo", }, @@ -4808,16 +4845,16 @@ func TestPhp5(t *testing.T) { &stmt.Return{ Position: &position.Position{ StartLine: 96, - EndLine: 96, - StartPos: 2226, - EndPos: 2234, + EndLine: 96, + StartPos: 2226, + EndPos: 2234, }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 96, - EndLine: 96, - StartPos: 2233, - EndPos: 2233, + EndLine: 96, + StartPos: 2233, + EndPos: 2233, }, Value: "1", }, @@ -4827,44 +4864,45 @@ func TestPhp5(t *testing.T) { &stmt.Function{ Position: &position.Position{ StartLine: 97, - EndLine: 97, - StartPos: 2239, - EndPos: 2256, + EndLine: 97, + StartPos: 2239, + EndPos: 2256, }, - ReturnsRef: true, + ReturnsRef: true, PhpDocComment: "", FunctionName: &node.Identifier{ Position: &position.Position{ StartLine: 97, - EndLine: 97, - StartPos: 2249, - EndPos: 2251, + EndLine: 97, + StartPos: 2249, + EndPos: 2251, }, Value: "foo", }, - Stmts: []node.Node{}, + Stmts: []node.Node{ + }, }, &stmt.Global{ Position: &position.Position{ StartLine: 98, - EndLine: 98, - StartPos: 2260, - EndPos: 2288, + EndLine: 98, + StartPos: 2260, + EndPos: 2288, }, Vars: []node.Node{ &expr.Variable{ Position: &position.Position{ StartLine: 98, - EndLine: 98, - StartPos: 2267, - EndPos: 2268, + EndLine: 98, + StartPos: 2267, + EndPos: 2268, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 98, - EndLine: 98, - StartPos: 2267, - EndPos: 2268, + EndLine: 98, + StartPos: 2267, + EndPos: 2268, }, Value: "a", }, @@ -4872,16 +4910,16 @@ func TestPhp5(t *testing.T) { &expr.Variable{ Position: &position.Position{ StartLine: 98, - EndLine: 98, - StartPos: 2271, - EndPos: 2272, + EndLine: 98, + StartPos: 2271, + EndPos: 2272, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 98, - EndLine: 98, - StartPos: 2271, - EndPos: 2272, + EndLine: 98, + StartPos: 2271, + EndPos: 2272, }, Value: "b", }, @@ -4889,23 +4927,23 @@ func TestPhp5(t *testing.T) { &expr.Variable{ Position: &position.Position{ StartLine: 98, - EndLine: 98, - StartPos: 2275, - EndPos: 2277, + EndLine: 98, + StartPos: 2275, + EndPos: 2277, }, VarName: &expr.Variable{ Position: &position.Position{ StartLine: 98, - EndLine: 98, - StartPos: 2276, - EndPos: 2277, + EndLine: 98, + StartPos: 2276, + EndPos: 2277, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 98, - EndLine: 98, - StartPos: 2276, - EndPos: 2277, + EndLine: 98, + StartPos: 2276, + EndPos: 2277, }, Value: "c", }, @@ -4914,31 +4952,31 @@ func TestPhp5(t *testing.T) { &expr.Variable{ Position: &position.Position{ StartLine: 98, - EndLine: 98, - StartPos: 2280, - EndPos: 2287, + EndLine: 98, + StartPos: 2280, + EndPos: 2287, }, VarName: &expr.FunctionCall{ Position: &position.Position{ StartLine: 98, - EndLine: 98, - StartPos: 2282, - EndPos: 2286, + EndLine: 98, + StartPos: 2282, + EndPos: 2286, }, Function: &name.Name{ Position: &position.Position{ StartLine: 98, - EndLine: 98, - StartPos: 2282, - EndPos: 2284, + EndLine: 98, + StartPos: 2282, + EndPos: 2284, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 98, - EndLine: 98, - StartPos: 2282, - EndPos: 2284, + EndLine: 98, + StartPos: 2282, + EndPos: 2284, }, Value: "foo", }, @@ -4947,9 +4985,9 @@ func TestPhp5(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 98, - EndLine: 98, - StartPos: 2285, - EndPos: 2286, + EndLine: 98, + StartPos: 2285, + EndPos: 2286, }, }, }, @@ -4959,16 +4997,16 @@ func TestPhp5(t *testing.T) { &stmt.Label{ Position: &position.Position{ StartLine: 99, - EndLine: 99, - StartPos: 2292, - EndPos: 2293, + EndLine: 99, + StartPos: 2292, + EndPos: 2293, }, LabelName: &node.Identifier{ Position: &position.Position{ StartLine: 99, - EndLine: 99, - StartPos: 2292, - EndPos: 2292, + EndLine: 99, + StartPos: 2292, + EndPos: 2292, }, Value: "a", }, @@ -4976,16 +5014,16 @@ func TestPhp5(t *testing.T) { &stmt.Goto{ Position: &position.Position{ StartLine: 100, - EndLine: 100, - StartPos: 2298, - EndPos: 2304, + EndLine: 100, + StartPos: 2298, + EndPos: 2304, }, Label: &node.Identifier{ Position: &position.Position{ StartLine: 100, - EndLine: 100, - StartPos: 2303, - EndPos: 2303, + EndLine: 100, + StartPos: 2303, + EndPos: 2303, }, Value: "a", }, @@ -4993,31 +5031,31 @@ func TestPhp5(t *testing.T) { &stmt.HaltCompiler{ Position: &position.Position{ StartLine: 101, - EndLine: 101, - StartPos: 2308, - EndPos: 2325, + EndLine: 101, + StartPos: 2308, + EndPos: 2325, }, }, &stmt.If{ Position: &position.Position{ StartLine: 102, - EndLine: 102, - StartPos: 2329, - EndPos: 2338, + EndLine: 102, + StartPos: 2329, + EndPos: 2338, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 102, - EndLine: 102, - StartPos: 2333, - EndPos: 2334, + EndLine: 102, + StartPos: 2333, + EndPos: 2334, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 102, - EndLine: 102, - StartPos: 2333, - EndPos: 2334, + EndLine: 102, + StartPos: 2333, + EndPos: 2334, }, Value: "a", }, @@ -5025,33 +5063,34 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 102, - EndLine: 102, - StartPos: 2337, - EndPos: 2338, + EndLine: 102, + StartPos: 2337, + EndPos: 2338, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, }, &stmt.If{ Position: &position.Position{ StartLine: 103, - EndLine: 103, - StartPos: 2342, - EndPos: 2366, + EndLine: 103, + StartPos: 2342, + EndPos: 2366, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 103, - EndLine: 103, - StartPos: 2346, - EndPos: 2347, + EndLine: 103, + StartPos: 2346, + EndPos: 2347, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 103, - EndLine: 103, - StartPos: 2346, - EndPos: 2347, + EndLine: 103, + StartPos: 2346, + EndPos: 2347, }, Value: "a", }, @@ -5059,33 +5098,34 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 103, - EndLine: 103, - StartPos: 2350, - EndPos: 2351, + EndLine: 103, + StartPos: 2350, + EndPos: 2351, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, ElseIf: []node.Node{ &stmt.ElseIf{ Position: &position.Position{ StartLine: 103, - EndLine: 103, - StartPos: 2353, - EndPos: 2366, + EndLine: 103, + StartPos: 2353, + EndPos: 2366, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 103, - EndLine: 103, - StartPos: 2361, - EndPos: 2362, + EndLine: 103, + StartPos: 2361, + EndPos: 2362, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 103, - EndLine: 103, - StartPos: 2361, - EndPos: 2362, + EndLine: 103, + StartPos: 2361, + EndPos: 2362, }, Value: "b", }, @@ -5093,11 +5133,12 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 103, - EndLine: 103, - StartPos: 2365, - EndPos: 2366, + EndLine: 103, + StartPos: 2365, + EndPos: 2366, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, }, }, @@ -5105,23 +5146,23 @@ func TestPhp5(t *testing.T) { &stmt.If{ Position: &position.Position{ StartLine: 104, - EndLine: 104, - StartPos: 2370, - EndPos: 2387, + EndLine: 104, + StartPos: 2370, + EndPos: 2387, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 104, - EndLine: 104, - StartPos: 2374, - EndPos: 2375, + EndLine: 104, + StartPos: 2374, + EndPos: 2375, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 104, - EndLine: 104, - StartPos: 2374, - EndPos: 2375, + EndLine: 104, + StartPos: 2374, + EndPos: 2375, }, Value: "a", }, @@ -5129,50 +5170,52 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 104, - EndLine: 104, - StartPos: 2378, - EndPos: 2379, + EndLine: 104, + StartPos: 2378, + EndPos: 2379, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, Else: &stmt.Else{ Position: &position.Position{ StartLine: 104, - EndLine: 104, - StartPos: 2381, - EndPos: 2387, + EndLine: 104, + StartPos: 2381, + EndPos: 2387, }, Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 104, - EndLine: 104, - StartPos: 2386, - EndPos: 2387, + EndLine: 104, + StartPos: 2386, + EndPos: 2387, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, }, }, &stmt.If{ Position: &position.Position{ StartLine: 105, - EndLine: 105, - StartPos: 2391, - EndPos: 2438, + EndLine: 105, + StartPos: 2391, + EndPos: 2438, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 105, - EndLine: 105, - StartPos: 2395, - EndPos: 2396, + EndLine: 105, + StartPos: 2395, + EndPos: 2396, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 105, - EndLine: 105, - StartPos: 2395, - EndPos: 2396, + EndLine: 105, + StartPos: 2395, + EndPos: 2396, }, Value: "a", }, @@ -5180,33 +5223,34 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 105, - EndLine: 105, - StartPos: 2399, - EndPos: 2400, + EndLine: 105, + StartPos: 2399, + EndPos: 2400, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, ElseIf: []node.Node{ &stmt.ElseIf{ Position: &position.Position{ StartLine: 105, - EndLine: 105, - StartPos: 2402, - EndPos: 2415, + EndLine: 105, + StartPos: 2402, + EndPos: 2415, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 105, - EndLine: 105, - StartPos: 2410, - EndPos: 2411, + EndLine: 105, + StartPos: 2410, + EndPos: 2411, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 105, - EndLine: 105, - StartPos: 2410, - EndPos: 2411, + EndLine: 105, + StartPos: 2410, + EndPos: 2411, }, Value: "b", }, @@ -5214,33 +5258,34 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 105, - EndLine: 105, - StartPos: 2414, - EndPos: 2415, + EndLine: 105, + StartPos: 2414, + EndPos: 2415, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, }, &stmt.ElseIf{ Position: &position.Position{ StartLine: 105, - EndLine: 105, - StartPos: 2417, - EndPos: 2430, + EndLine: 105, + StartPos: 2417, + EndPos: 2430, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 105, - EndLine: 105, - StartPos: 2425, - EndPos: 2426, + EndLine: 105, + StartPos: 2425, + EndPos: 2426, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 105, - EndLine: 105, - StartPos: 2425, - EndPos: 2426, + EndLine: 105, + StartPos: 2425, + EndPos: 2426, }, Value: "c", }, @@ -5248,52 +5293,54 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 105, - EndLine: 105, - StartPos: 2429, - EndPos: 2430, + EndLine: 105, + StartPos: 2429, + EndPos: 2430, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, }, }, Else: &stmt.Else{ Position: &position.Position{ StartLine: 105, - EndLine: 105, - StartPos: 2432, - EndPos: 2438, + EndLine: 105, + StartPos: 2432, + EndPos: 2438, }, Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 105, - EndLine: 105, - StartPos: 2437, - EndPos: 2438, + EndLine: 105, + StartPos: 2437, + EndPos: 2438, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, }, }, &stmt.If{ Position: &position.Position{ StartLine: 106, - EndLine: 106, - StartPos: 2442, - EndPos: 2490, + EndLine: 106, + StartPos: 2442, + EndPos: 2490, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 106, - EndLine: 106, - StartPos: 2446, - EndPos: 2447, + EndLine: 106, + StartPos: 2446, + EndPos: 2447, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 106, - EndLine: 106, - StartPos: 2446, - EndPos: 2447, + EndLine: 106, + StartPos: 2446, + EndPos: 2447, }, Value: "a", }, @@ -5301,33 +5348,34 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 106, - EndLine: 106, - StartPos: 2450, - EndPos: 2451, + EndLine: 106, + StartPos: 2450, + EndPos: 2451, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, ElseIf: []node.Node{ &stmt.ElseIf{ Position: &position.Position{ StartLine: 106, - EndLine: 106, - StartPos: 2453, - EndPos: 2466, + EndLine: 106, + StartPos: 2453, + EndPos: 2466, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 106, - EndLine: 106, - StartPos: 2461, - EndPos: 2462, + EndLine: 106, + StartPos: 2461, + EndPos: 2462, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 106, - EndLine: 106, - StartPos: 2461, - EndPos: 2462, + EndLine: 106, + StartPos: 2461, + EndPos: 2462, }, Value: "b", }, @@ -5335,41 +5383,42 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 106, - EndLine: 106, - StartPos: 2465, - EndPos: 2466, + EndLine: 106, + StartPos: 2465, + EndPos: 2466, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, }, }, Else: &stmt.Else{ Position: &position.Position{ StartLine: 106, - EndLine: 106, - StartPos: 2468, - EndPos: 2490, + EndLine: 106, + StartPos: 2468, + EndPos: 2490, }, Stmt: &stmt.If{ Position: &position.Position{ StartLine: 106, - EndLine: 106, - StartPos: 2473, - EndPos: 2490, + EndLine: 106, + StartPos: 2473, + EndPos: 2490, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 106, - EndLine: 106, - StartPos: 2477, - EndPos: 2478, + EndLine: 106, + StartPos: 2477, + EndPos: 2478, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 106, - EndLine: 106, - StartPos: 2477, - EndPos: 2478, + EndLine: 106, + StartPos: 2477, + EndPos: 2478, }, Value: "c", }, @@ -5377,27 +5426,29 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 106, - EndLine: 106, - StartPos: 2481, - EndPos: 2482, + EndLine: 106, + StartPos: 2481, + EndPos: 2482, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, Else: &stmt.Else{ Position: &position.Position{ StartLine: 106, - EndLine: 106, - StartPos: 2484, - EndPos: 2490, + EndLine: 106, + StartPos: 2484, + EndPos: 2490, }, Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 106, - EndLine: 106, - StartPos: 2489, - EndPos: 2490, + EndLine: 106, + StartPos: 2489, + EndPos: 2490, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, }, }, @@ -5406,78 +5457,79 @@ func TestPhp5(t *testing.T) { &stmt.Nop{ Position: &position.Position{ StartLine: 107, - EndLine: 107, - StartPos: 2494, - EndPos: 2495, + EndLine: 107, + StartPos: 2494, + EndPos: 2495, }, }, &stmt.InlineHtml{ Position: &position.Position{ StartLine: 107, - EndLine: 107, - StartPos: 2497, - EndPos: 2508, + EndLine: 107, + StartPos: 2497, + EndPos: 2508, }, Value: "
", }, &stmt.Interface{ Position: &position.Position{ StartLine: 108, - EndLine: 108, - StartPos: 2514, - EndPos: 2529, + EndLine: 108, + StartPos: 2514, + EndPos: 2529, }, PhpDocComment: "", InterfaceName: &node.Identifier{ Position: &position.Position{ StartLine: 108, - EndLine: 108, - StartPos: 2524, - EndPos: 2526, + EndLine: 108, + StartPos: 2524, + EndPos: 2526, }, Value: "Foo", }, - Stmts: []node.Node{}, + Stmts: []node.Node{ + }, }, &stmt.Interface{ Position: &position.Position{ StartLine: 109, - EndLine: 109, - StartPos: 2533, - EndPos: 2560, + EndLine: 109, + StartPos: 2533, + EndPos: 2560, }, PhpDocComment: "", InterfaceName: &node.Identifier{ Position: &position.Position{ StartLine: 109, - EndLine: 109, - StartPos: 2543, - EndPos: 2545, + EndLine: 109, + StartPos: 2543, + EndPos: 2545, }, Value: "Foo", }, Extends: &stmt.InterfaceExtends{ Position: &position.Position{ StartLine: 109, - EndLine: 109, - StartPos: 2547, - EndPos: 2557, + EndLine: 109, + StartPos: 2547, + EndPos: 2557, }, InterfaceNames: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 109, - EndLine: 109, - StartPos: 2555, - EndPos: 2557, + EndLine: 109, + StartPos: 2555, + EndPos: 2557, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 109, - EndLine: 109, - StartPos: 2555, - EndPos: 2557, + EndLine: 109, + StartPos: 2555, + EndPos: 2557, }, Value: "Bar", }, @@ -5485,47 +5537,48 @@ func TestPhp5(t *testing.T) { }, }, }, - Stmts: []node.Node{}, + Stmts: []node.Node{ + }, }, &stmt.Interface{ Position: &position.Position{ StartLine: 110, - EndLine: 110, - StartPos: 2564, - EndPos: 2596, + EndLine: 110, + StartPos: 2564, + EndPos: 2596, }, PhpDocComment: "", InterfaceName: &node.Identifier{ Position: &position.Position{ StartLine: 110, - EndLine: 110, - StartPos: 2574, - EndPos: 2576, + EndLine: 110, + StartPos: 2574, + EndPos: 2576, }, Value: "Foo", }, Extends: &stmt.InterfaceExtends{ Position: &position.Position{ StartLine: 110, - EndLine: 110, - StartPos: 2578, - EndPos: 2593, + EndLine: 110, + StartPos: 2578, + EndPos: 2593, }, InterfaceNames: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 110, - EndLine: 110, - StartPos: 2586, - EndPos: 2588, + EndLine: 110, + StartPos: 2586, + EndPos: 2588, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 110, - EndLine: 110, - StartPos: 2586, - EndPos: 2588, + EndLine: 110, + StartPos: 2586, + EndPos: 2588, }, Value: "Bar", }, @@ -5534,17 +5587,17 @@ func TestPhp5(t *testing.T) { &name.Name{ Position: &position.Position{ StartLine: 110, - EndLine: 110, - StartPos: 2591, - EndPos: 2593, + EndLine: 110, + StartPos: 2591, + EndPos: 2593, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 110, - EndLine: 110, - StartPos: 2591, - EndPos: 2593, + EndLine: 110, + StartPos: 2591, + EndPos: 2593, }, Value: "Baz", }, @@ -5552,29 +5605,30 @@ func TestPhp5(t *testing.T) { }, }, }, - Stmts: []node.Node{}, + Stmts: []node.Node{ + }, }, &stmt.Namespace{ Position: &position.Position{ StartLine: 111, - EndLine: 111, - StartPos: 2600, - EndPos: 2613, + EndLine: 111, + StartPos: 2600, + EndPos: 2613, }, NamespaceName: &name.Name{ Position: &position.Position{ StartLine: 111, - EndLine: 111, - StartPos: 2610, - EndPos: 2612, + EndLine: 111, + StartPos: 2610, + EndPos: 2612, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 111, - EndLine: 111, - StartPos: 2610, - EndPos: 2612, + EndLine: 111, + StartPos: 2610, + EndPos: 2612, }, Value: "Foo", }, @@ -5584,63 +5638,65 @@ func TestPhp5(t *testing.T) { &stmt.Namespace{ Position: &position.Position{ StartLine: 112, - EndLine: 112, - StartPos: 2617, - EndPos: 2636, + EndLine: 112, + StartPos: 2617, + EndPos: 2636, }, NamespaceName: &name.Name{ Position: &position.Position{ StartLine: 112, - EndLine: 112, - StartPos: 2627, - EndPos: 2633, + EndLine: 112, + StartPos: 2627, + EndPos: 2633, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 112, - EndLine: 112, - StartPos: 2627, - EndPos: 2629, + EndLine: 112, + StartPos: 2627, + EndPos: 2629, }, Value: "Foo", }, &name.NamePart{ Position: &position.Position{ StartLine: 112, - EndLine: 112, - StartPos: 2631, - EndPos: 2633, + EndLine: 112, + StartPos: 2631, + EndPos: 2633, }, Value: "Bar", }, }, }, - Stmts: []node.Node{}, + Stmts: []node.Node{ + }, }, &stmt.Namespace{ Position: &position.Position{ StartLine: 113, - EndLine: 113, - StartPos: 2640, - EndPos: 2651, + EndLine: 113, + StartPos: 2640, + EndPos: 2651, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, &stmt.Class{ Position: &position.Position{ StartLine: 114, - EndLine: 114, - StartPos: 2655, - EndPos: 2673, + EndLine: 114, + StartPos: 2655, + EndPos: 2673, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 114, - EndLine: 114, - StartPos: 2661, - EndPos: 2663, + EndLine: 114, + StartPos: 2661, + EndPos: 2663, }, Value: "foo", }, @@ -5648,17 +5704,17 @@ func TestPhp5(t *testing.T) { &stmt.PropertyList{ Position: &position.Position{ StartLine: 114, - EndLine: 114, - StartPos: 2666, - EndPos: 2672, + EndLine: 114, + StartPos: 2666, + EndPos: 2672, }, Modifiers: []node.Node{ &node.Identifier{ Position: &position.Position{ StartLine: 114, - EndLine: 114, - StartPos: 2666, - EndPos: 2668, + EndLine: 114, + StartPos: 2666, + EndPos: 2668, }, Value: "var", }, @@ -5667,24 +5723,24 @@ func TestPhp5(t *testing.T) { &stmt.Property{ Position: &position.Position{ StartLine: 114, - EndLine: 114, - StartPos: 2670, - EndPos: 2671, + EndLine: 114, + StartPos: 2670, + EndPos: 2671, }, PhpDocComment: "", Variable: &expr.Variable{ Position: &position.Position{ StartLine: 114, - EndLine: 114, - StartPos: 2670, - EndPos: 2671, + EndLine: 114, + StartPos: 2670, + EndPos: 2671, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 114, - EndLine: 114, - StartPos: 2670, - EndPos: 2671, + EndLine: 114, + StartPos: 2670, + EndPos: 2671, }, Value: "a", }, @@ -5697,17 +5753,17 @@ func TestPhp5(t *testing.T) { &stmt.Class{ Position: &position.Position{ StartLine: 115, - EndLine: 115, - StartPos: 2677, - EndPos: 2713, + EndLine: 115, + StartPos: 2677, + EndPos: 2713, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 115, - EndLine: 115, - StartPos: 2683, - EndPos: 2685, + EndLine: 115, + StartPos: 2683, + EndPos: 2685, }, Value: "foo", }, @@ -5715,26 +5771,26 @@ func TestPhp5(t *testing.T) { &stmt.PropertyList{ Position: &position.Position{ StartLine: 115, - EndLine: 115, - StartPos: 2688, - EndPos: 2712, + EndLine: 115, + StartPos: 2688, + EndPos: 2712, }, Modifiers: []node.Node{ &node.Identifier{ Position: &position.Position{ StartLine: 115, - EndLine: 115, - StartPos: 2688, - EndPos: 2693, + EndLine: 115, + StartPos: 2688, + EndPos: 2693, }, Value: "public", }, &node.Identifier{ Position: &position.Position{ StartLine: 115, - EndLine: 115, - StartPos: 2695, - EndPos: 2700, + EndLine: 115, + StartPos: 2695, + EndPos: 2700, }, Value: "static", }, @@ -5743,24 +5799,24 @@ func TestPhp5(t *testing.T) { &stmt.Property{ Position: &position.Position{ StartLine: 115, - EndLine: 115, - StartPos: 2702, - EndPos: 2703, + EndLine: 115, + StartPos: 2702, + EndPos: 2703, }, PhpDocComment: "", Variable: &expr.Variable{ Position: &position.Position{ StartLine: 115, - EndLine: 115, - StartPos: 2702, - EndPos: 2703, + EndLine: 115, + StartPos: 2702, + EndPos: 2703, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 115, - EndLine: 115, - StartPos: 2702, - EndPos: 2703, + EndLine: 115, + StartPos: 2702, + EndPos: 2703, }, Value: "a", }, @@ -5769,24 +5825,24 @@ func TestPhp5(t *testing.T) { &stmt.Property{ Position: &position.Position{ StartLine: 115, - EndLine: 115, - StartPos: 2706, - EndPos: 2711, + EndLine: 115, + StartPos: 2706, + EndPos: 2711, }, PhpDocComment: "", Variable: &expr.Variable{ Position: &position.Position{ StartLine: 115, - EndLine: 115, - StartPos: 2706, - EndPos: 2707, + EndLine: 115, + StartPos: 2706, + EndPos: 2707, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 115, - EndLine: 115, - StartPos: 2706, - EndPos: 2707, + EndLine: 115, + StartPos: 2706, + EndPos: 2707, }, Value: "b", }, @@ -5794,9 +5850,9 @@ func TestPhp5(t *testing.T) { Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 115, - EndLine: 115, - StartPos: 2711, - EndPos: 2711, + EndLine: 115, + StartPos: 2711, + EndPos: 2711, }, Value: "1", }, @@ -5808,17 +5864,17 @@ func TestPhp5(t *testing.T) { &stmt.Class{ Position: &position.Position{ StartLine: 116, - EndLine: 116, - StartPos: 2717, - EndPos: 2753, + EndLine: 116, + StartPos: 2717, + EndPos: 2753, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 116, - EndLine: 116, - StartPos: 2723, - EndPos: 2725, + EndLine: 116, + StartPos: 2723, + EndPos: 2725, }, Value: "foo", }, @@ -5826,26 +5882,26 @@ func TestPhp5(t *testing.T) { &stmt.PropertyList{ Position: &position.Position{ StartLine: 116, - EndLine: 116, - StartPos: 2728, - EndPos: 2752, + EndLine: 116, + StartPos: 2728, + EndPos: 2752, }, Modifiers: []node.Node{ &node.Identifier{ Position: &position.Position{ StartLine: 116, - EndLine: 116, - StartPos: 2728, - EndPos: 2733, + EndLine: 116, + StartPos: 2728, + EndPos: 2733, }, Value: "public", }, &node.Identifier{ Position: &position.Position{ StartLine: 116, - EndLine: 116, - StartPos: 2735, - EndPos: 2740, + EndLine: 116, + StartPos: 2735, + EndPos: 2740, }, Value: "static", }, @@ -5854,24 +5910,24 @@ func TestPhp5(t *testing.T) { &stmt.Property{ Position: &position.Position{ StartLine: 116, - EndLine: 116, - StartPos: 2742, - EndPos: 2747, + EndLine: 116, + StartPos: 2742, + EndPos: 2747, }, PhpDocComment: "", Variable: &expr.Variable{ Position: &position.Position{ StartLine: 116, - EndLine: 116, - StartPos: 2742, - EndPos: 2743, + EndLine: 116, + StartPos: 2742, + EndPos: 2743, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 116, - EndLine: 116, - StartPos: 2742, - EndPos: 2743, + EndLine: 116, + StartPos: 2742, + EndPos: 2743, }, Value: "a", }, @@ -5879,9 +5935,9 @@ func TestPhp5(t *testing.T) { Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 116, - EndLine: 116, - StartPos: 2747, - EndPos: 2747, + EndLine: 116, + StartPos: 2747, + EndPos: 2747, }, Value: "1", }, @@ -5889,24 +5945,24 @@ func TestPhp5(t *testing.T) { &stmt.Property{ Position: &position.Position{ StartLine: 116, - EndLine: 116, - StartPos: 2750, - EndPos: 2751, + EndLine: 116, + StartPos: 2750, + EndPos: 2751, }, PhpDocComment: "", Variable: &expr.Variable{ Position: &position.Position{ StartLine: 116, - EndLine: 116, - StartPos: 2750, - EndPos: 2751, + EndLine: 116, + StartPos: 2750, + EndPos: 2751, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 116, - EndLine: 116, - StartPos: 2750, - EndPos: 2751, + EndLine: 116, + StartPos: 2750, + EndPos: 2751, }, Value: "b", }, @@ -5919,31 +5975,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 117, - EndLine: 117, - StartPos: 2757, - EndPos: 2774, + EndLine: 117, + StartPos: 2757, + EndPos: 2774, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 117, - EndLine: 117, - StartPos: 2764, - EndPos: 2765, + EndLine: 117, + StartPos: 2764, + EndPos: 2765, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 117, - EndLine: 117, - StartPos: 2764, - EndPos: 2765, + EndLine: 117, + StartPos: 2764, + EndPos: 2765, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 117, - EndLine: 117, - StartPos: 2764, - EndPos: 2765, + EndLine: 117, + StartPos: 2764, + EndPos: 2765, }, Value: "a", }, @@ -5952,23 +6008,23 @@ func TestPhp5(t *testing.T) { &stmt.StaticVar{ Position: &position.Position{ StartLine: 117, - EndLine: 117, - StartPos: 2768, - EndPos: 2773, + EndLine: 117, + StartPos: 2768, + EndPos: 2773, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 117, - EndLine: 117, - StartPos: 2768, - EndPos: 2769, + EndLine: 117, + StartPos: 2768, + EndPos: 2769, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 117, - EndLine: 117, - StartPos: 2768, - EndPos: 2769, + EndLine: 117, + StartPos: 2768, + EndPos: 2769, }, Value: "b", }, @@ -5976,9 +6032,9 @@ func TestPhp5(t *testing.T) { Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 117, - EndLine: 117, - StartPos: 2773, - EndPos: 2773, + EndLine: 117, + StartPos: 2773, + EndPos: 2773, }, Value: "1", }, @@ -5988,31 +6044,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 118, - EndLine: 118, - StartPos: 2778, - EndPos: 2795, + EndLine: 118, + StartPos: 2778, + EndPos: 2795, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 118, - EndLine: 118, - StartPos: 2785, - EndPos: 2790, + EndLine: 118, + StartPos: 2785, + EndPos: 2790, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 118, - EndLine: 118, - StartPos: 2785, - EndPos: 2786, + EndLine: 118, + StartPos: 2785, + EndPos: 2786, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 118, - EndLine: 118, - StartPos: 2785, - EndPos: 2786, + EndLine: 118, + StartPos: 2785, + EndPos: 2786, }, Value: "a", }, @@ -6020,9 +6076,9 @@ func TestPhp5(t *testing.T) { Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 118, - EndLine: 118, - StartPos: 2790, - EndPos: 2790, + EndLine: 118, + StartPos: 2790, + EndPos: 2790, }, Value: "1", }, @@ -6030,23 +6086,23 @@ func TestPhp5(t *testing.T) { &stmt.StaticVar{ Position: &position.Position{ StartLine: 118, - EndLine: 118, - StartPos: 2793, - EndPos: 2794, + EndLine: 118, + StartPos: 2793, + EndPos: 2794, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 118, - EndLine: 118, - StartPos: 2793, - EndPos: 2794, + EndLine: 118, + StartPos: 2793, + EndPos: 2794, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 118, - EndLine: 118, - StartPos: 2793, - EndPos: 2794, + EndLine: 118, + StartPos: 2793, + EndPos: 2794, }, Value: "b", }, @@ -6057,71 +6113,74 @@ func TestPhp5(t *testing.T) { &stmt.AltSwitch{ Position: &position.Position{ StartLine: 120, - EndLine: 124, - StartPos: 2800, - EndPos: 2858, + EndLine: 124, + StartPos: 2800, + EndPos: 2858, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 120, - EndLine: 120, - StartPos: 2808, - EndPos: 2808, + EndLine: 120, + StartPos: 2808, + EndPos: 2808, }, Value: "1", }, CaseList: &stmt.CaseList{ Position: &position.Position{ StartLine: 121, - EndLine: -1, - StartPos: 2816, - EndPos: -1, + EndLine: -1, + StartPos: 2816, + EndPos: -1, }, Cases: []node.Node{ &stmt.Case{ Position: &position.Position{ StartLine: 121, - EndLine: -1, - StartPos: 2816, - EndPos: -1, + EndLine: -1, + StartPos: 2816, + EndPos: -1, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 121, - EndLine: 121, - StartPos: 2821, - EndPos: 2821, + EndLine: 121, + StartPos: 2821, + EndPos: 2821, }, Value: "1", }, - Stmts: []node.Node{}, + Stmts: []node.Node{ + }, }, &stmt.Default{ Position: &position.Position{ StartLine: 122, - EndLine: -1, - StartPos: 2827, - EndPos: -1, + EndLine: -1, + StartPos: 2827, + EndPos: -1, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, &stmt.Case{ Position: &position.Position{ StartLine: 123, - EndLine: -1, - StartPos: 2839, - EndPos: -1, + EndLine: -1, + StartPos: 2839, + EndPos: -1, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 123, - EndLine: 123, - StartPos: 2844, - EndPos: 2844, + EndLine: 123, + StartPos: 2844, + EndPos: 2844, }, Value: "2", }, - Stmts: []node.Node{}, + Stmts: []node.Node{ + }, }, }, }, @@ -6129,62 +6188,64 @@ func TestPhp5(t *testing.T) { &stmt.AltSwitch{ Position: &position.Position{ StartLine: 126, - EndLine: 129, - StartPos: 2863, - EndPos: 2910, + EndLine: 129, + StartPos: 2863, + EndPos: 2910, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 126, - EndLine: 126, - StartPos: 2871, - EndPos: 2871, + EndLine: 126, + StartPos: 2871, + EndPos: 2871, }, Value: "1", }, CaseList: &stmt.CaseList{ Position: &position.Position{ StartLine: 127, - EndLine: -1, - StartPos: 2880, - EndPos: -1, + EndLine: -1, + StartPos: 2880, + EndPos: -1, }, Cases: []node.Node{ &stmt.Case{ Position: &position.Position{ StartLine: 127, - EndLine: -1, - StartPos: 2880, - EndPos: -1, + EndLine: -1, + StartPos: 2880, + EndPos: -1, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 127, - EndLine: 127, - StartPos: 2885, - EndPos: 2885, + EndLine: 127, + StartPos: 2885, + EndPos: 2885, }, Value: "1", }, - Stmts: []node.Node{}, + Stmts: []node.Node{ + }, }, &stmt.Case{ Position: &position.Position{ StartLine: 128, - EndLine: -1, - StartPos: 2891, - EndPos: -1, + EndLine: -1, + StartPos: 2891, + EndPos: -1, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 128, - EndLine: 128, - StartPos: 2896, - EndPos: 2896, + EndLine: 128, + StartPos: 2896, + EndPos: 2896, }, Value: "2", }, - Stmts: []node.Node{}, + Stmts: []node.Node{ + }, }, }, }, @@ -6192,40 +6253,40 @@ func TestPhp5(t *testing.T) { &stmt.Switch{ Position: &position.Position{ StartLine: 131, - EndLine: 134, - StartPos: 2917, - EndPos: 2968, + EndLine: 134, + StartPos: 2917, + EndPos: 2968, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 131, - EndLine: 131, - StartPos: 2925, - EndPos: 2925, + EndLine: 131, + StartPos: 2925, + EndPos: 2925, }, Value: "1", }, CaseList: &stmt.CaseList{ Position: &position.Position{ StartLine: 131, - EndLine: 134, - StartPos: 2928, - EndPos: 2968, + EndLine: 134, + StartPos: 2928, + EndPos: 2968, }, Cases: []node.Node{ &stmt.Case{ Position: &position.Position{ StartLine: 132, - EndLine: 132, - StartPos: 2933, - EndPos: 2946, + EndLine: 132, + StartPos: 2933, + EndPos: 2946, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 132, - EndLine: 132, - StartPos: 2938, - EndPos: 2938, + EndLine: 132, + StartPos: 2938, + EndPos: 2938, }, Value: "1", }, @@ -6233,9 +6294,9 @@ func TestPhp5(t *testing.T) { &stmt.Break{ Position: &position.Position{ StartLine: 132, - EndLine: 132, - StartPos: 2941, - EndPos: 2946, + EndLine: 132, + StartPos: 2941, + EndPos: 2946, }, }, }, @@ -6243,16 +6304,16 @@ func TestPhp5(t *testing.T) { &stmt.Case{ Position: &position.Position{ StartLine: 133, - EndLine: 133, - StartPos: 2951, - EndPos: 2964, + EndLine: 133, + StartPos: 2951, + EndPos: 2964, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 133, - EndLine: 133, - StartPos: 2956, - EndPos: 2956, + EndLine: 133, + StartPos: 2956, + EndPos: 2956, }, Value: "2", }, @@ -6260,9 +6321,9 @@ func TestPhp5(t *testing.T) { &stmt.Break{ Position: &position.Position{ StartLine: 133, - EndLine: 133, - StartPos: 2959, - EndPos: 2964, + EndLine: 133, + StartPos: 2959, + EndPos: 2964, }, }, }, @@ -6273,40 +6334,40 @@ func TestPhp5(t *testing.T) { &stmt.Switch{ Position: &position.Position{ StartLine: 136, - EndLine: 139, - StartPos: 2975, - EndPos: 3027, + EndLine: 139, + StartPos: 2975, + EndPos: 3027, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 136, - EndLine: 136, - StartPos: 2983, - EndPos: 2983, + EndLine: 136, + StartPos: 2983, + EndPos: 2983, }, Value: "1", }, CaseList: &stmt.CaseList{ Position: &position.Position{ StartLine: 136, - EndLine: 139, - StartPos: 2986, - EndPos: 3027, + EndLine: 139, + StartPos: 2986, + EndPos: 3027, }, Cases: []node.Node{ &stmt.Case{ Position: &position.Position{ StartLine: 137, - EndLine: 137, - StartPos: 2992, - EndPos: 3005, + EndLine: 137, + StartPos: 2992, + EndPos: 3005, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 137, - EndLine: 137, - StartPos: 2997, - EndPos: 2997, + EndLine: 137, + StartPos: 2997, + EndPos: 2997, }, Value: "1", }, @@ -6314,9 +6375,9 @@ func TestPhp5(t *testing.T) { &stmt.Break{ Position: &position.Position{ StartLine: 137, - EndLine: 137, - StartPos: 3000, - EndPos: 3005, + EndLine: 137, + StartPos: 3000, + EndPos: 3005, }, }, }, @@ -6324,16 +6385,16 @@ func TestPhp5(t *testing.T) { &stmt.Case{ Position: &position.Position{ StartLine: 138, - EndLine: 138, - StartPos: 3010, - EndPos: 3023, + EndLine: 138, + StartPos: 3010, + EndPos: 3023, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 138, - EndLine: 138, - StartPos: 3015, - EndPos: 3015, + EndLine: 138, + StartPos: 3015, + EndPos: 3015, }, Value: "2", }, @@ -6341,9 +6402,9 @@ func TestPhp5(t *testing.T) { &stmt.Break{ Position: &position.Position{ StartLine: 138, - EndLine: 138, - StartPos: 3018, - EndPos: 3023, + EndLine: 138, + StartPos: 3018, + EndPos: 3023, }, }, }, @@ -6354,23 +6415,23 @@ func TestPhp5(t *testing.T) { &stmt.Throw{ Position: &position.Position{ StartLine: 140, - EndLine: 140, - StartPos: 3031, - EndPos: 3039, + EndLine: 140, + StartPos: 3031, + EndPos: 3039, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 140, - EndLine: 140, - StartPos: 3037, - EndPos: 3038, + EndLine: 140, + StartPos: 3037, + EndPos: 3038, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 140, - EndLine: 140, - StartPos: 3037, - EndPos: 3038, + EndLine: 140, + StartPos: 3037, + EndPos: 3038, }, Value: "e", }, @@ -6379,36 +6440,37 @@ func TestPhp5(t *testing.T) { &stmt.Trait{ Position: &position.Position{ StartLine: 141, - EndLine: 141, - StartPos: 3043, - EndPos: 3054, + EndLine: 141, + StartPos: 3043, + EndPos: 3054, }, PhpDocComment: "", TraitName: &node.Identifier{ Position: &position.Position{ StartLine: 141, - EndLine: 141, - StartPos: 3049, - EndPos: 3051, + EndLine: 141, + StartPos: 3049, + EndPos: 3051, }, Value: "Foo", }, - Stmts: []node.Node{}, + Stmts: []node.Node{ + }, }, &stmt.Class{ Position: &position.Position{ StartLine: 142, - EndLine: 142, - StartPos: 3058, - EndPos: 3079, + EndLine: 142, + StartPos: 3058, + EndPos: 3079, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 142, - EndLine: 142, - StartPos: 3064, - EndPos: 3066, + EndLine: 142, + StartPos: 3064, + EndPos: 3066, }, Value: "Foo", }, @@ -6416,25 +6478,25 @@ func TestPhp5(t *testing.T) { &stmt.TraitUse{ Position: &position.Position{ StartLine: 142, - EndLine: 142, - StartPos: 3070, - EndPos: 3077, + EndLine: 142, + StartPos: 3070, + EndPos: 3077, }, Traits: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 142, - EndLine: 142, - StartPos: 3074, - EndPos: 3076, + EndLine: 142, + StartPos: 3074, + EndPos: 3076, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 142, - EndLine: 142, - StartPos: 3074, - EndPos: 3076, + EndLine: 142, + StartPos: 3074, + EndPos: 3076, }, Value: "Bar", }, @@ -6447,17 +6509,17 @@ func TestPhp5(t *testing.T) { &stmt.Class{ Position: &position.Position{ StartLine: 143, - EndLine: 143, - StartPos: 3083, - EndPos: 3111, + EndLine: 143, + StartPos: 3083, + EndPos: 3111, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 143, - EndLine: 143, - StartPos: 3089, - EndPos: 3091, + EndLine: 143, + StartPos: 3089, + EndPos: 3091, }, Value: "Foo", }, @@ -6465,25 +6527,25 @@ func TestPhp5(t *testing.T) { &stmt.TraitUse{ Position: &position.Position{ StartLine: 143, - EndLine: 143, - StartPos: 3095, - EndPos: 3109, + EndLine: 143, + StartPos: 3095, + EndPos: 3109, }, Traits: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 143, - EndLine: 143, - StartPos: 3099, - EndPos: 3101, + EndLine: 143, + StartPos: 3099, + EndPos: 3101, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 143, - EndLine: 143, - StartPos: 3099, - EndPos: 3101, + EndLine: 143, + StartPos: 3099, + EndPos: 3101, }, Value: "Bar", }, @@ -6492,17 +6554,17 @@ func TestPhp5(t *testing.T) { &name.Name{ Position: &position.Position{ StartLine: 143, - EndLine: 143, - StartPos: 3104, - EndPos: 3106, + EndLine: 143, + StartPos: 3104, + EndPos: 3106, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 143, - EndLine: 143, - StartPos: 3104, - EndPos: 3106, + EndLine: 143, + StartPos: 3104, + EndPos: 3106, }, Value: "Baz", }, @@ -6512,9 +6574,9 @@ func TestPhp5(t *testing.T) { TraitAdaptationList: &stmt.TraitAdaptationList{ Position: &position.Position{ StartLine: 143, - EndLine: 143, - StartPos: 3108, - EndPos: 3109, + EndLine: 143, + StartPos: 3108, + EndPos: 3109, }, }, }, @@ -6523,17 +6585,17 @@ func TestPhp5(t *testing.T) { &stmt.Class{ Position: &position.Position{ StartLine: 144, - EndLine: 144, - StartPos: 3115, - EndPos: 3159, + EndLine: 144, + StartPos: 3115, + EndPos: 3159, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 144, - EndLine: 144, - StartPos: 3121, - EndPos: 3123, + EndLine: 144, + StartPos: 3121, + EndPos: 3123, }, Value: "Foo", }, @@ -6541,25 +6603,25 @@ func TestPhp5(t *testing.T) { &stmt.TraitUse{ Position: &position.Position{ StartLine: 144, - EndLine: 144, - StartPos: 3127, - EndPos: 3157, + EndLine: 144, + StartPos: 3127, + EndPos: 3157, }, Traits: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 144, - EndLine: 144, - StartPos: 3131, - EndPos: 3133, + EndLine: 144, + StartPos: 3131, + EndPos: 3133, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 144, - EndLine: 144, - StartPos: 3131, - EndPos: 3133, + EndLine: 144, + StartPos: 3131, + EndPos: 3133, }, Value: "Bar", }, @@ -6568,17 +6630,17 @@ func TestPhp5(t *testing.T) { &name.Name{ Position: &position.Position{ StartLine: 144, - EndLine: 144, - StartPos: 3136, - EndPos: 3138, + EndLine: 144, + StartPos: 3136, + EndPos: 3138, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 144, - EndLine: 144, - StartPos: 3136, - EndPos: 3138, + EndLine: 144, + StartPos: 3136, + EndPos: 3138, }, Value: "Baz", }, @@ -6588,31 +6650,31 @@ func TestPhp5(t *testing.T) { TraitAdaptationList: &stmt.TraitAdaptationList{ Position: &position.Position{ StartLine: 144, - EndLine: 144, - StartPos: 3140, - EndPos: 3157, + EndLine: 144, + StartPos: 3140, + EndPos: 3157, }, Adaptations: []node.Node{ &stmt.TraitUseAlias{ Position: &position.Position{ StartLine: 144, - EndLine: 144, - StartPos: 3142, - EndPos: 3154, + EndLine: 144, + StartPos: 3142, + EndPos: 3154, }, Ref: &stmt.TraitMethodRef{ Position: &position.Position{ StartLine: 144, - EndLine: 144, - StartPos: 3142, - EndPos: 3144, + EndLine: 144, + StartPos: 3142, + EndPos: 3144, }, Method: &node.Identifier{ Position: &position.Position{ StartLine: 144, - EndLine: 144, - StartPos: 3142, - EndPos: 3144, + EndLine: 144, + StartPos: 3142, + EndPos: 3144, }, Value: "one", }, @@ -6620,9 +6682,9 @@ func TestPhp5(t *testing.T) { Modifier: &node.Identifier{ Position: &position.Position{ StartLine: 144, - EndLine: 144, - StartPos: 3149, - EndPos: 3154, + EndLine: 144, + StartPos: 3149, + EndPos: 3154, }, Value: "public", }, @@ -6635,17 +6697,17 @@ func TestPhp5(t *testing.T) { &stmt.Class{ Position: &position.Position{ StartLine: 145, - EndLine: 145, - StartPos: 3163, - EndPos: 3211, + EndLine: 145, + StartPos: 3163, + EndPos: 3211, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 145, - EndLine: 145, - StartPos: 3169, - EndPos: 3171, + EndLine: 145, + StartPos: 3169, + EndPos: 3171, }, Value: "Foo", }, @@ -6653,25 +6715,25 @@ func TestPhp5(t *testing.T) { &stmt.TraitUse{ Position: &position.Position{ StartLine: 145, - EndLine: 145, - StartPos: 3175, - EndPos: 3209, + EndLine: 145, + StartPos: 3175, + EndPos: 3209, }, Traits: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 145, - EndLine: 145, - StartPos: 3179, - EndPos: 3181, + EndLine: 145, + StartPos: 3179, + EndPos: 3181, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 145, - EndLine: 145, - StartPos: 3179, - EndPos: 3181, + EndLine: 145, + StartPos: 3179, + EndPos: 3181, }, Value: "Bar", }, @@ -6680,17 +6742,17 @@ func TestPhp5(t *testing.T) { &name.Name{ Position: &position.Position{ StartLine: 145, - EndLine: 145, - StartPos: 3184, - EndPos: 3186, + EndLine: 145, + StartPos: 3184, + EndPos: 3186, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 145, - EndLine: 145, - StartPos: 3184, - EndPos: 3186, + EndLine: 145, + StartPos: 3184, + EndPos: 3186, }, Value: "Baz", }, @@ -6700,31 +6762,31 @@ func TestPhp5(t *testing.T) { TraitAdaptationList: &stmt.TraitAdaptationList{ Position: &position.Position{ StartLine: 145, - EndLine: 145, - StartPos: 3188, - EndPos: 3209, + EndLine: 145, + StartPos: 3188, + EndPos: 3209, }, Adaptations: []node.Node{ &stmt.TraitUseAlias{ Position: &position.Position{ StartLine: 145, - EndLine: 145, - StartPos: 3190, - EndPos: 3206, + EndLine: 145, + StartPos: 3190, + EndPos: 3206, }, Ref: &stmt.TraitMethodRef{ Position: &position.Position{ StartLine: 145, - EndLine: 145, - StartPos: 3190, - EndPos: 3192, + EndLine: 145, + StartPos: 3190, + EndPos: 3192, }, Method: &node.Identifier{ Position: &position.Position{ StartLine: 145, - EndLine: 145, - StartPos: 3190, - EndPos: 3192, + EndLine: 145, + StartPos: 3190, + EndPos: 3192, }, Value: "one", }, @@ -6732,18 +6794,18 @@ func TestPhp5(t *testing.T) { Modifier: &node.Identifier{ Position: &position.Position{ StartLine: 145, - EndLine: 145, - StartPos: 3197, - EndPos: 3202, + EndLine: 145, + StartPos: 3197, + EndPos: 3202, }, Value: "public", }, Alias: &node.Identifier{ Position: &position.Position{ StartLine: 145, - EndLine: 145, - StartPos: 3204, - EndPos: 3206, + EndLine: 145, + StartPos: 3204, + EndPos: 3206, }, Value: "two", }, @@ -6756,17 +6818,17 @@ func TestPhp5(t *testing.T) { &stmt.Class{ Position: &position.Position{ StartLine: 146, - EndLine: 146, - StartPos: 3215, - EndPos: 3291, + EndLine: 146, + StartPos: 3215, + EndPos: 3291, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 146, - EndLine: 146, - StartPos: 3221, - EndPos: 3223, + EndLine: 146, + StartPos: 3221, + EndPos: 3223, }, Value: "Foo", }, @@ -6774,25 +6836,25 @@ func TestPhp5(t *testing.T) { &stmt.TraitUse{ Position: &position.Position{ StartLine: 146, - EndLine: 146, - StartPos: 3227, - EndPos: 3289, + EndLine: 146, + StartPos: 3227, + EndPos: 3289, }, Traits: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 146, - EndLine: 146, - StartPos: 3231, - EndPos: 3233, + EndLine: 146, + StartPos: 3231, + EndPos: 3233, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 146, - EndLine: 146, - StartPos: 3231, - EndPos: 3233, + EndLine: 146, + StartPos: 3231, + EndPos: 3233, }, Value: "Bar", }, @@ -6801,17 +6863,17 @@ func TestPhp5(t *testing.T) { &name.Name{ Position: &position.Position{ StartLine: 146, - EndLine: 146, - StartPos: 3236, - EndPos: 3238, + EndLine: 146, + StartPos: 3236, + EndPos: 3238, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 146, - EndLine: 146, - StartPos: 3236, - EndPos: 3238, + EndLine: 146, + StartPos: 3236, + EndPos: 3238, }, Value: "Baz", }, @@ -6821,39 +6883,39 @@ func TestPhp5(t *testing.T) { TraitAdaptationList: &stmt.TraitAdaptationList{ Position: &position.Position{ StartLine: 146, - EndLine: 146, - StartPos: 3240, - EndPos: 3289, + EndLine: 146, + StartPos: 3240, + EndPos: 3289, }, Adaptations: []node.Node{ &stmt.TraitUsePrecedence{ Position: &position.Position{ StartLine: 146, - EndLine: 146, - StartPos: 3242, - EndPos: 3269, + EndLine: 146, + StartPos: 3242, + EndPos: 3269, }, Ref: &stmt.TraitMethodRef{ Position: &position.Position{ StartLine: 146, - EndLine: 146, - StartPos: 3242, - EndPos: 3249, + EndLine: 146, + StartPos: 3242, + EndPos: 3249, }, Trait: &name.Name{ Position: &position.Position{ StartLine: 146, - EndLine: 146, - StartPos: 3242, - EndPos: 3244, + EndLine: 146, + StartPos: 3242, + EndPos: 3244, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 146, - EndLine: 146, - StartPos: 3242, - EndPos: 3244, + EndLine: 146, + StartPos: 3242, + EndPos: 3244, }, Value: "Bar", }, @@ -6862,9 +6924,9 @@ func TestPhp5(t *testing.T) { Method: &node.Identifier{ Position: &position.Position{ StartLine: 146, - EndLine: 146, - StartPos: 3247, - EndPos: 3249, + EndLine: 146, + StartPos: 3247, + EndPos: 3249, }, Value: "one", }, @@ -6873,17 +6935,17 @@ func TestPhp5(t *testing.T) { &name.Name{ Position: &position.Position{ StartLine: 146, - EndLine: 146, - StartPos: 3261, - EndPos: 3263, + EndLine: 146, + StartPos: 3261, + EndPos: 3263, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 146, - EndLine: 146, - StartPos: 3261, - EndPos: 3263, + EndLine: 146, + StartPos: 3261, + EndPos: 3263, }, Value: "Baz", }, @@ -6892,17 +6954,17 @@ func TestPhp5(t *testing.T) { &name.Name{ Position: &position.Position{ StartLine: 146, - EndLine: 146, - StartPos: 3266, - EndPos: 3269, + EndLine: 146, + StartPos: 3266, + EndPos: 3269, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 146, - EndLine: 146, - StartPos: 3266, - EndPos: 3269, + EndLine: 146, + StartPos: 3266, + EndPos: 3269, }, Value: "Quux", }, @@ -6913,31 +6975,31 @@ func TestPhp5(t *testing.T) { &stmt.TraitUseAlias{ Position: &position.Position{ StartLine: 146, - EndLine: 146, - StartPos: 3272, - EndPos: 3286, + EndLine: 146, + StartPos: 3272, + EndPos: 3286, }, Ref: &stmt.TraitMethodRef{ Position: &position.Position{ StartLine: 146, - EndLine: 146, - StartPos: 3272, - EndPos: 3279, + EndLine: 146, + StartPos: 3272, + EndPos: 3279, }, Trait: &name.Name{ Position: &position.Position{ StartLine: 146, - EndLine: 146, - StartPos: 3272, - EndPos: 3274, + EndLine: 146, + StartPos: 3272, + EndPos: 3274, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 146, - EndLine: 146, - StartPos: 3272, - EndPos: 3274, + EndLine: 146, + StartPos: 3272, + EndPos: 3274, }, Value: "Baz", }, @@ -6946,9 +7008,9 @@ func TestPhp5(t *testing.T) { Method: &node.Identifier{ Position: &position.Position{ StartLine: 146, - EndLine: 146, - StartPos: 3277, - EndPos: 3279, + EndLine: 146, + StartPos: 3277, + EndPos: 3279, }, Value: "one", }, @@ -6956,9 +7018,9 @@ func TestPhp5(t *testing.T) { Alias: &node.Identifier{ Position: &position.Position{ StartLine: 146, - EndLine: 146, - StartPos: 3284, - EndPos: 3286, + EndLine: 146, + StartPos: 3284, + EndPos: 3286, }, Value: "two", }, @@ -6971,44 +7033,47 @@ func TestPhp5(t *testing.T) { &stmt.Try{ Position: &position.Position{ StartLine: 148, - EndLine: -1, - StartPos: 3296, - EndPos: -1, + EndLine: -1, + StartPos: 3296, + EndPos: -1, + }, + Stmts: []node.Node{ + }, + Catches: []node.Node{ }, - Stmts: []node.Node{}, - Catches: []node.Node{}, }, &stmt.Try{ Position: &position.Position{ StartLine: 149, - EndLine: 149, - StartPos: 3305, - EndPos: 3334, + EndLine: 149, + StartPos: 3305, + EndPos: 3334, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, Catches: []node.Node{ &stmt.Catch{ Position: &position.Position{ StartLine: 149, - EndLine: 149, - StartPos: 3312, - EndPos: 3334, + EndLine: 149, + StartPos: 3312, + EndPos: 3334, }, Types: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 149, - EndLine: 149, - StartPos: 3319, - EndPos: 3327, + EndLine: 149, + StartPos: 3319, + EndPos: 3327, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 149, - EndLine: 149, - StartPos: 3319, - EndPos: 3327, + EndLine: 149, + StartPos: 3319, + EndPos: 3327, }, Value: "Exception", }, @@ -7018,55 +7083,57 @@ func TestPhp5(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 149, - EndLine: 149, - StartPos: 3329, - EndPos: 3330, + EndLine: 149, + StartPos: 3329, + EndPos: 3330, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 149, - EndLine: 149, - StartPos: 3329, - EndPos: 3330, + EndLine: 149, + StartPos: 3329, + EndPos: 3330, }, Value: "e", }, }, - Stmts: []node.Node{}, + Stmts: []node.Node{ + }, }, }, }, &stmt.Try{ Position: &position.Position{ StartLine: 150, - EndLine: 150, - StartPos: 3338, - EndPos: 3398, + EndLine: 150, + StartPos: 3338, + EndPos: 3398, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, Catches: []node.Node{ &stmt.Catch{ Position: &position.Position{ StartLine: 150, - EndLine: 150, - StartPos: 3345, - EndPos: 3367, + EndLine: 150, + StartPos: 3345, + EndPos: 3367, }, Types: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 150, - EndLine: 150, - StartPos: 3352, - EndPos: 3360, + EndLine: 150, + StartPos: 3352, + EndPos: 3360, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 150, - EndLine: 150, - StartPos: 3352, - EndPos: 3360, + EndLine: 150, + StartPos: 3352, + EndPos: 3360, }, Value: "Exception", }, @@ -7076,44 +7143,45 @@ func TestPhp5(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 150, - EndLine: 150, - StartPos: 3362, - EndPos: 3363, + EndLine: 150, + StartPos: 3362, + EndPos: 3363, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 150, - EndLine: 150, - StartPos: 3362, - EndPos: 3363, + EndLine: 150, + StartPos: 3362, + EndPos: 3363, }, Value: "e", }, }, - Stmts: []node.Node{}, + Stmts: []node.Node{ + }, }, &stmt.Catch{ Position: &position.Position{ StartLine: 150, - EndLine: 150, - StartPos: 3369, - EndPos: 3398, + EndLine: 150, + StartPos: 3369, + EndPos: 3398, }, Types: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 150, - EndLine: 150, - StartPos: 3376, - EndPos: 3391, + EndLine: 150, + StartPos: 3376, + EndPos: 3391, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 150, - EndLine: 150, - StartPos: 3376, - EndPos: 3391, + EndLine: 150, + StartPos: 3376, + EndPos: 3391, }, Value: "RuntimeException", }, @@ -7123,55 +7191,57 @@ func TestPhp5(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 150, - EndLine: 150, - StartPos: 3393, - EndPos: 3394, + EndLine: 150, + StartPos: 3393, + EndPos: 3394, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 150, - EndLine: 150, - StartPos: 3393, - EndPos: 3394, + EndLine: 150, + StartPos: 3393, + EndPos: 3394, }, Value: "e", }, }, - Stmts: []node.Node{}, + Stmts: []node.Node{ + }, }, }, }, &stmt.Try{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3402, - EndPos: 3505, + EndLine: 151, + StartPos: 3402, + EndPos: 3505, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, Catches: []node.Node{ &stmt.Catch{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3409, - EndPos: 3431, + EndLine: 151, + StartPos: 3409, + EndPos: 3431, }, Types: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3416, - EndPos: 3424, + EndLine: 151, + StartPos: 3416, + EndPos: 3424, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3416, - EndPos: 3424, + EndLine: 151, + StartPos: 3416, + EndPos: 3424, }, Value: "Exception", }, @@ -7181,44 +7251,45 @@ func TestPhp5(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3426, - EndPos: 3427, + EndLine: 151, + StartPos: 3426, + EndPos: 3427, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3426, - EndPos: 3427, + EndLine: 151, + StartPos: 3426, + EndPos: 3427, }, Value: "e", }, }, - Stmts: []node.Node{}, + Stmts: []node.Node{ + }, }, &stmt.Catch{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3433, - EndPos: 3463, + EndLine: 151, + StartPos: 3433, + EndPos: 3463, }, Types: []node.Node{ &name.FullyQualified{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3440, - EndPos: 3456, + EndLine: 151, + StartPos: 3440, + EndPos: 3456, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3441, - EndPos: 3456, + EndLine: 151, + StartPos: 3441, + EndPos: 3456, }, Value: "RuntimeException", }, @@ -7228,44 +7299,45 @@ func TestPhp5(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3458, - EndPos: 3459, + EndLine: 151, + StartPos: 3458, + EndPos: 3459, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3458, - EndPos: 3459, + EndLine: 151, + StartPos: 3458, + EndPos: 3459, }, Value: "e", }, }, - Stmts: []node.Node{}, + Stmts: []node.Node{ + }, }, &stmt.Catch{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3465, - EndPos: 3505, + EndLine: 151, + StartPos: 3465, + EndPos: 3505, }, Types: []node.Node{ &name.Relative{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3472, - EndPos: 3498, + EndLine: 151, + StartPos: 3472, + EndPos: 3498, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3482, - EndPos: 3498, + EndLine: 151, + StartPos: 3482, + EndPos: 3498, }, Value: "AdditionException", }, @@ -7275,55 +7347,57 @@ func TestPhp5(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3500, - EndPos: 3501, + EndLine: 151, + StartPos: 3500, + EndPos: 3501, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3500, - EndPos: 3501, + EndLine: 151, + StartPos: 3500, + EndPos: 3501, }, Value: "e", }, }, - Stmts: []node.Node{}, + Stmts: []node.Node{ + }, }, }, }, &stmt.Try{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3509, - EndPos: 3549, + EndLine: 152, + StartPos: 3509, + EndPos: 3549, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, Catches: []node.Node{ &stmt.Catch{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3516, - EndPos: 3538, + EndLine: 152, + StartPos: 3516, + EndPos: 3538, }, Types: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3523, - EndPos: 3531, + EndLine: 152, + StartPos: 3523, + EndPos: 3531, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3523, - EndPos: 3531, + EndLine: 152, + StartPos: 3523, + EndPos: 3531, }, Value: "Exception", }, @@ -7333,54 +7407,56 @@ func TestPhp5(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3533, - EndPos: 3534, + EndLine: 152, + StartPos: 3533, + EndPos: 3534, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3533, - EndPos: 3534, + EndLine: 152, + StartPos: 3533, + EndPos: 3534, }, Value: "e", }, }, - Stmts: []node.Node{}, + Stmts: []node.Node{ + }, }, }, Finally: &stmt.Finally{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3540, - EndPos: 3549, + EndLine: 152, + StartPos: 3540, + EndPos: 3549, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, }, &stmt.Unset{ Position: &position.Position{ StartLine: 154, - EndLine: 154, - StartPos: 3554, - EndPos: 3567, + EndLine: 154, + StartPos: 3554, + EndPos: 3567, }, Vars: []node.Node{ &expr.Variable{ Position: &position.Position{ StartLine: 154, - EndLine: 154, - StartPos: 3560, - EndPos: 3561, + EndLine: 154, + StartPos: 3560, + EndPos: 3561, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 154, - EndLine: 154, - StartPos: 3560, - EndPos: 3561, + EndLine: 154, + StartPos: 3560, + EndPos: 3561, }, Value: "a", }, @@ -7388,16 +7464,16 @@ func TestPhp5(t *testing.T) { &expr.Variable{ Position: &position.Position{ StartLine: 154, - EndLine: 154, - StartPos: 3564, - EndPos: 3565, + EndLine: 154, + StartPos: 3564, + EndPos: 3565, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 154, - EndLine: 154, - StartPos: 3564, - EndPos: 3565, + EndLine: 154, + StartPos: 3564, + EndPos: 3565, }, Value: "b", }, @@ -7407,32 +7483,32 @@ func TestPhp5(t *testing.T) { &stmt.UseList{ Position: &position.Position{ StartLine: 156, - EndLine: 156, - StartPos: 3572, - EndPos: 3579, + EndLine: 156, + StartPos: 3572, + EndPos: 3579, }, Uses: []node.Node{ &stmt.Use{ Position: &position.Position{ StartLine: 156, - EndLine: 156, - StartPos: 3576, - EndPos: 3578, + EndLine: 156, + StartPos: 3576, + EndPos: 3578, }, Use: &name.Name{ Position: &position.Position{ StartLine: 156, - EndLine: 156, - StartPos: 3576, - EndPos: 3578, + EndLine: 156, + StartPos: 3576, + EndPos: 3578, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 156, - EndLine: 156, - StartPos: 3576, - EndPos: 3578, + EndLine: 156, + StartPos: 3576, + EndPos: 3578, }, Value: "Foo", }, @@ -7444,32 +7520,32 @@ func TestPhp5(t *testing.T) { &stmt.UseList{ Position: &position.Position{ StartLine: 157, - EndLine: 157, - StartPos: 3583, - EndPos: 3591, + EndLine: 157, + StartPos: 3583, + EndPos: 3591, }, Uses: []node.Node{ &stmt.Use{ Position: &position.Position{ StartLine: 157, - EndLine: 157, - StartPos: 3588, - EndPos: 3590, + EndLine: 157, + StartPos: 3588, + EndPos: 3590, }, Use: &name.Name{ Position: &position.Position{ StartLine: 157, - EndLine: 157, - StartPos: 3588, - EndPos: 3590, + EndLine: 157, + StartPos: 3588, + EndPos: 3590, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 157, - EndLine: 157, - StartPos: 3588, - EndPos: 3590, + EndLine: 157, + StartPos: 3588, + EndPos: 3590, }, Value: "Foo", }, @@ -7481,32 +7557,32 @@ func TestPhp5(t *testing.T) { &stmt.UseList{ Position: &position.Position{ StartLine: 158, - EndLine: 158, - StartPos: 3595, - EndPos: 3610, + EndLine: 158, + StartPos: 3595, + EndPos: 3610, }, Uses: []node.Node{ &stmt.Use{ Position: &position.Position{ StartLine: 158, - EndLine: 158, - StartPos: 3600, - EndPos: 3609, + EndLine: 158, + StartPos: 3600, + EndPos: 3609, }, Use: &name.Name{ Position: &position.Position{ StartLine: 158, - EndLine: 158, - StartPos: 3600, - EndPos: 3602, + EndLine: 158, + StartPos: 3600, + EndPos: 3602, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 158, - EndLine: 158, - StartPos: 3600, - EndPos: 3602, + EndLine: 158, + StartPos: 3600, + EndPos: 3602, }, Value: "Foo", }, @@ -7515,9 +7591,9 @@ func TestPhp5(t *testing.T) { Alias: &node.Identifier{ Position: &position.Position{ StartLine: 158, - EndLine: 158, - StartPos: 3607, - EndPos: 3609, + EndLine: 158, + StartPos: 3607, + EndPos: 3609, }, Value: "Bar", }, @@ -7527,32 +7603,32 @@ func TestPhp5(t *testing.T) { &stmt.UseList{ Position: &position.Position{ StartLine: 159, - EndLine: 159, - StartPos: 3614, - EndPos: 3626, + EndLine: 159, + StartPos: 3614, + EndPos: 3626, }, Uses: []node.Node{ &stmt.Use{ Position: &position.Position{ StartLine: 159, - EndLine: 159, - StartPos: 3618, - EndPos: 3620, + EndLine: 159, + StartPos: 3618, + EndPos: 3620, }, Use: &name.Name{ Position: &position.Position{ StartLine: 159, - EndLine: 159, - StartPos: 3618, - EndPos: 3620, + EndLine: 159, + StartPos: 3618, + EndPos: 3620, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 159, - EndLine: 159, - StartPos: 3618, - EndPos: 3620, + EndLine: 159, + StartPos: 3618, + EndPos: 3620, }, Value: "Foo", }, @@ -7562,24 +7638,24 @@ func TestPhp5(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 159, - EndLine: 159, - StartPos: 3623, - EndPos: 3625, + EndLine: 159, + StartPos: 3623, + EndPos: 3625, }, Use: &name.Name{ Position: &position.Position{ StartLine: 159, - EndLine: 159, - StartPos: 3623, - EndPos: 3625, + EndLine: 159, + StartPos: 3623, + EndPos: 3625, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 159, - EndLine: 159, - StartPos: 3623, - EndPos: 3625, + EndLine: 159, + StartPos: 3623, + EndPos: 3625, }, Value: "Bar", }, @@ -7591,32 +7667,32 @@ func TestPhp5(t *testing.T) { &stmt.UseList{ Position: &position.Position{ StartLine: 160, - EndLine: 160, - StartPos: 3630, - EndPos: 3649, + EndLine: 160, + StartPos: 3630, + EndPos: 3649, }, Uses: []node.Node{ &stmt.Use{ Position: &position.Position{ StartLine: 160, - EndLine: 160, - StartPos: 3634, - EndPos: 3636, + EndLine: 160, + StartPos: 3634, + EndPos: 3636, }, Use: &name.Name{ Position: &position.Position{ StartLine: 160, - EndLine: 160, - StartPos: 3634, - EndPos: 3636, + EndLine: 160, + StartPos: 3634, + EndPos: 3636, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 160, - EndLine: 160, - StartPos: 3634, - EndPos: 3636, + EndLine: 160, + StartPos: 3634, + EndPos: 3636, }, Value: "Foo", }, @@ -7626,24 +7702,24 @@ func TestPhp5(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 160, - EndLine: 160, - StartPos: 3639, - EndPos: 3648, + EndLine: 160, + StartPos: 3639, + EndPos: 3648, }, Use: &name.Name{ Position: &position.Position{ StartLine: 160, - EndLine: 160, - StartPos: 3639, - EndPos: 3641, + EndLine: 160, + StartPos: 3639, + EndPos: 3641, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 160, - EndLine: 160, - StartPos: 3639, - EndPos: 3641, + EndLine: 160, + StartPos: 3639, + EndPos: 3641, }, Value: "Bar", }, @@ -7652,9 +7728,9 @@ func TestPhp5(t *testing.T) { Alias: &node.Identifier{ Position: &position.Position{ StartLine: 160, - EndLine: 160, - StartPos: 3646, - EndPos: 3648, + EndLine: 160, + StartPos: 3646, + EndPos: 3648, }, Value: "Baz", }, @@ -7664,16 +7740,16 @@ func TestPhp5(t *testing.T) { &stmt.UseList{ Position: &position.Position{ StartLine: 161, - EndLine: 161, - StartPos: 3653, - EndPos: 3675, + EndLine: 161, + StartPos: 3653, + EndPos: 3675, }, UseType: &node.Identifier{ Position: &position.Position{ StartLine: 161, - EndLine: 161, - StartPos: 3657, - EndPos: 3664, + EndLine: 161, + StartPos: 3657, + EndPos: 3664, }, Value: "function", }, @@ -7681,24 +7757,24 @@ func TestPhp5(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 161, - EndLine: 161, - StartPos: 3666, - EndPos: 3668, + EndLine: 161, + StartPos: 3666, + EndPos: 3668, }, Use: &name.Name{ Position: &position.Position{ StartLine: 161, - EndLine: 161, - StartPos: 3666, - EndPos: 3668, + EndLine: 161, + StartPos: 3666, + EndPos: 3668, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 161, - EndLine: 161, - StartPos: 3666, - EndPos: 3668, + EndLine: 161, + StartPos: 3666, + EndPos: 3668, }, Value: "Foo", }, @@ -7708,24 +7784,24 @@ func TestPhp5(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 161, - EndLine: 161, - StartPos: 3672, - EndPos: 3674, + EndLine: 161, + StartPos: 3672, + EndPos: 3674, }, Use: &name.Name{ Position: &position.Position{ StartLine: 161, - EndLine: 161, - StartPos: 3672, - EndPos: 3674, + EndLine: 161, + StartPos: 3672, + EndPos: 3674, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 161, - EndLine: 161, - StartPos: 3672, - EndPos: 3674, + EndLine: 161, + StartPos: 3672, + EndPos: 3674, }, Value: "Bar", }, @@ -7737,16 +7813,16 @@ func TestPhp5(t *testing.T) { &stmt.UseList{ Position: &position.Position{ StartLine: 162, - EndLine: 162, - StartPos: 3679, - EndPos: 3715, + EndLine: 162, + StartPos: 3679, + EndPos: 3715, }, UseType: &node.Identifier{ Position: &position.Position{ StartLine: 162, - EndLine: 162, - StartPos: 3683, - EndPos: 3690, + EndLine: 162, + StartPos: 3683, + EndPos: 3690, }, Value: "function", }, @@ -7754,24 +7830,24 @@ func TestPhp5(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 162, - EndLine: 162, - StartPos: 3692, - EndPos: 3701, + EndLine: 162, + StartPos: 3692, + EndPos: 3701, }, Use: &name.Name{ Position: &position.Position{ StartLine: 162, - EndLine: 162, - StartPos: 3692, - EndPos: 3694, + EndLine: 162, + StartPos: 3692, + EndPos: 3694, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 162, - EndLine: 162, - StartPos: 3692, - EndPos: 3694, + EndLine: 162, + StartPos: 3692, + EndPos: 3694, }, Value: "Foo", }, @@ -7780,9 +7856,9 @@ func TestPhp5(t *testing.T) { Alias: &node.Identifier{ Position: &position.Position{ StartLine: 162, - EndLine: 162, - StartPos: 3699, - EndPos: 3701, + EndLine: 162, + StartPos: 3699, + EndPos: 3701, }, Value: "foo", }, @@ -7790,24 +7866,24 @@ func TestPhp5(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 162, - EndLine: 162, - StartPos: 3705, - EndPos: 3714, + EndLine: 162, + StartPos: 3705, + EndPos: 3714, }, Use: &name.Name{ Position: &position.Position{ StartLine: 162, - EndLine: 162, - StartPos: 3705, - EndPos: 3707, + EndLine: 162, + StartPos: 3705, + EndPos: 3707, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 162, - EndLine: 162, - StartPos: 3705, - EndPos: 3707, + EndLine: 162, + StartPos: 3705, + EndPos: 3707, }, Value: "Bar", }, @@ -7816,9 +7892,9 @@ func TestPhp5(t *testing.T) { Alias: &node.Identifier{ Position: &position.Position{ StartLine: 162, - EndLine: 162, - StartPos: 3712, - EndPos: 3714, + EndLine: 162, + StartPos: 3712, + EndPos: 3714, }, Value: "bar", }, @@ -7828,16 +7904,16 @@ func TestPhp5(t *testing.T) { &stmt.UseList{ Position: &position.Position{ StartLine: 163, - EndLine: 163, - StartPos: 3719, - EndPos: 3738, + EndLine: 163, + StartPos: 3719, + EndPos: 3738, }, UseType: &node.Identifier{ Position: &position.Position{ StartLine: 163, - EndLine: 163, - StartPos: 3723, - EndPos: 3727, + EndLine: 163, + StartPos: 3723, + EndPos: 3727, }, Value: "const", }, @@ -7845,24 +7921,24 @@ func TestPhp5(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 163, - EndLine: 163, - StartPos: 3729, - EndPos: 3731, + EndLine: 163, + StartPos: 3729, + EndPos: 3731, }, Use: &name.Name{ Position: &position.Position{ StartLine: 163, - EndLine: 163, - StartPos: 3729, - EndPos: 3731, + EndLine: 163, + StartPos: 3729, + EndPos: 3731, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 163, - EndLine: 163, - StartPos: 3729, - EndPos: 3731, + EndLine: 163, + StartPos: 3729, + EndPos: 3731, }, Value: "Foo", }, @@ -7872,24 +7948,24 @@ func TestPhp5(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 163, - EndLine: 163, - StartPos: 3735, - EndPos: 3737, + EndLine: 163, + StartPos: 3735, + EndPos: 3737, }, Use: &name.Name{ Position: &position.Position{ StartLine: 163, - EndLine: 163, - StartPos: 3735, - EndPos: 3737, + EndLine: 163, + StartPos: 3735, + EndPos: 3737, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 163, - EndLine: 163, - StartPos: 3735, - EndPos: 3737, + EndLine: 163, + StartPos: 3735, + EndPos: 3737, }, Value: "Bar", }, @@ -7901,16 +7977,16 @@ func TestPhp5(t *testing.T) { &stmt.UseList{ Position: &position.Position{ StartLine: 164, - EndLine: 164, - StartPos: 3742, - EndPos: 3775, + EndLine: 164, + StartPos: 3742, + EndPos: 3775, }, UseType: &node.Identifier{ Position: &position.Position{ StartLine: 164, - EndLine: 164, - StartPos: 3746, - EndPos: 3750, + EndLine: 164, + StartPos: 3746, + EndPos: 3750, }, Value: "const", }, @@ -7918,24 +7994,24 @@ func TestPhp5(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 164, - EndLine: 164, - StartPos: 3752, - EndPos: 3761, + EndLine: 164, + StartPos: 3752, + EndPos: 3761, }, Use: &name.Name{ Position: &position.Position{ StartLine: 164, - EndLine: 164, - StartPos: 3752, - EndPos: 3754, + EndLine: 164, + StartPos: 3752, + EndPos: 3754, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 164, - EndLine: 164, - StartPos: 3752, - EndPos: 3754, + EndLine: 164, + StartPos: 3752, + EndPos: 3754, }, Value: "Foo", }, @@ -7944,9 +8020,9 @@ func TestPhp5(t *testing.T) { Alias: &node.Identifier{ Position: &position.Position{ StartLine: 164, - EndLine: 164, - StartPos: 3759, - EndPos: 3761, + EndLine: 164, + StartPos: 3759, + EndPos: 3761, }, Value: "foo", }, @@ -7954,24 +8030,24 @@ func TestPhp5(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 164, - EndLine: 164, - StartPos: 3765, - EndPos: 3774, + EndLine: 164, + StartPos: 3765, + EndPos: 3774, }, Use: &name.Name{ Position: &position.Position{ StartLine: 164, - EndLine: 164, - StartPos: 3765, - EndPos: 3767, + EndLine: 164, + StartPos: 3765, + EndPos: 3767, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 164, - EndLine: 164, - StartPos: 3765, - EndPos: 3767, + EndLine: 164, + StartPos: 3765, + EndPos: 3767, }, Value: "Bar", }, @@ -7980,9 +8056,9 @@ func TestPhp5(t *testing.T) { Alias: &node.Identifier{ Position: &position.Position{ StartLine: 164, - EndLine: 164, - StartPos: 3772, - EndPos: 3774, + EndLine: 164, + StartPos: 3772, + EndPos: 3774, }, Value: "bar", }, @@ -7992,30 +8068,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 166, - EndLine: 166, - StartPos: 3780, - EndPos: 3785, + EndLine: 166, + StartPos: 3780, + EndPos: 3785, }, Expr: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 166, - EndLine: 166, - StartPos: 3780, - EndPos: 3784, + EndLine: 166, + StartPos: 3780, + EndPos: 3784, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 166, - EndLine: 166, - StartPos: 3780, - EndPos: 3781, + EndLine: 166, + StartPos: 3780, + EndPos: 3781, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 166, - EndLine: 166, - StartPos: 3780, - EndPos: 3781, + EndLine: 166, + StartPos: 3780, + EndPos: 3781, }, Value: "a", }, @@ -8023,9 +8099,9 @@ func TestPhp5(t *testing.T) { Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 166, - EndLine: 166, - StartPos: 3783, - EndPos: 3783, + EndLine: 166, + StartPos: 3783, + EndPos: 3783, }, Value: "1", }, @@ -8034,37 +8110,37 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 167, - EndLine: 167, - StartPos: 3789, - EndPos: 3797, + EndLine: 167, + StartPos: 3789, + EndPos: 3797, }, Expr: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 167, - EndLine: 167, - StartPos: 3789, - EndPos: 3796, + EndLine: 167, + StartPos: 3789, + EndPos: 3796, }, Variable: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 167, - EndLine: 167, - StartPos: 3789, - EndPos: 3793, + EndLine: 167, + StartPos: 3789, + EndPos: 3793, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 167, - EndLine: 167, - StartPos: 3789, - EndPos: 3790, + EndLine: 167, + StartPos: 3789, + EndPos: 3790, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 167, - EndLine: 167, - StartPos: 3789, - EndPos: 3790, + EndLine: 167, + StartPos: 3789, + EndPos: 3790, }, Value: "a", }, @@ -8072,9 +8148,9 @@ func TestPhp5(t *testing.T) { Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 167, - EndLine: 167, - StartPos: 3792, - EndPos: 3792, + EndLine: 167, + StartPos: 3792, + EndPos: 3792, }, Value: "1", }, @@ -8082,9 +8158,9 @@ func TestPhp5(t *testing.T) { Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 167, - EndLine: 167, - StartPos: 3795, - EndPos: 3795, + EndLine: 167, + StartPos: 3795, + EndPos: 3795, }, Value: "2", }, @@ -8093,48 +8169,49 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 168, - EndLine: 168, - StartPos: 3801, - EndPos: 3808, + EndLine: 168, + StartPos: 3801, + EndPos: 3808, }, Expr: &expr.Array{ Position: &position.Position{ StartLine: 168, - EndLine: 168, - StartPos: 3801, - EndPos: 3807, + EndLine: 168, + StartPos: 3801, + EndPos: 3807, + }, + Items: []node.Node{ }, - Items: []node.Node{}, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 169, - EndLine: 169, - StartPos: 3812, - EndPos: 3820, + EndLine: 169, + StartPos: 3812, + EndPos: 3820, }, Expr: &expr.Array{ Position: &position.Position{ StartLine: 169, - EndLine: 169, - StartPos: 3812, - EndPos: 3819, + EndLine: 169, + StartPos: 3812, + EndPos: 3819, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 169, - EndLine: 169, - StartPos: 3818, - EndPos: 3818, + EndLine: 169, + StartPos: 3818, + EndPos: 3818, }, Val: &scalar.Lnumber{ Position: &position.Position{ StartLine: 169, - EndLine: 169, - StartPos: 3818, - EndPos: 3818, + EndLine: 169, + StartPos: 3818, + EndPos: 3818, }, Value: "1", }, @@ -8145,40 +8222,40 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 170, - EndLine: 170, - StartPos: 3824, - EndPos: 3841, + EndLine: 170, + StartPos: 3824, + EndPos: 3841, }, Expr: &expr.Array{ Position: &position.Position{ StartLine: 170, - EndLine: 170, - StartPos: 3824, - EndPos: 3840, + EndLine: 170, + StartPos: 3824, + EndPos: 3840, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 170, - EndLine: 170, - StartPos: 3830, - EndPos: 3833, + EndLine: 170, + StartPos: 3830, + EndPos: 3833, }, Key: &scalar.Lnumber{ Position: &position.Position{ StartLine: 170, - EndLine: 170, - StartPos: 3830, - EndPos: 3830, + EndLine: 170, + StartPos: 3830, + EndPos: 3830, }, Value: "1", }, Val: &scalar.Lnumber{ Position: &position.Position{ StartLine: 170, - EndLine: 170, - StartPos: 3833, - EndPos: 3833, + EndLine: 170, + StartPos: 3833, + EndPos: 3833, }, Value: "1", }, @@ -8186,91 +8263,92 @@ func TestPhp5(t *testing.T) { &expr.ArrayItem{ Position: &position.Position{ StartLine: 170, - EndLine: 170, - StartPos: 3836, - EndPos: 3838, + EndLine: 170, + StartPos: 3836, + EndPos: 3838, }, Val: &expr.Reference{ Position: &position.Position{ StartLine: 170, - EndLine: 170, - StartPos: 3836, - EndPos: 3838, + EndLine: 170, + StartPos: 3836, + EndPos: 3838, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 170, - EndLine: 170, - StartPos: 3837, - EndPos: 3838, + EndLine: 170, + StartPos: 3837, + EndPos: 3838, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 170, - EndLine: 170, - StartPos: 3837, - EndPos: 3838, + EndLine: 170, + StartPos: 3837, + EndPos: 3838, }, Value: "b", }, }, }, }, - &expr.ArrayItem{}, + &expr.ArrayItem{ + }, }, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 171, - EndLine: 171, - StartPos: 3845, - EndPos: 3859, + EndLine: 171, + StartPos: 3845, + EndPos: 3859, }, Expr: &expr.Array{ Position: &position.Position{ StartLine: 171, - EndLine: 171, - StartPos: 3845, - EndPos: 3858, + EndLine: 171, + StartPos: 3845, + EndPos: 3858, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 171, - EndLine: 171, - StartPos: 3851, - EndPos: 3857, + EndLine: 171, + StartPos: 3851, + EndPos: 3857, }, Key: &scalar.Lnumber{ Position: &position.Position{ StartLine: 171, - EndLine: 171, - StartPos: 3851, - EndPos: 3851, + EndLine: 171, + StartPos: 3851, + EndPos: 3851, }, Value: "3", }, Val: &expr.Reference{ Position: &position.Position{ StartLine: 171, - EndLine: 171, - StartPos: 3855, - EndPos: 3857, + EndLine: 171, + StartPos: 3855, + EndPos: 3857, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 171, - EndLine: 171, - StartPos: 3856, - EndPos: 3857, + EndLine: 171, + StartPos: 3856, + EndPos: 3857, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 171, - EndLine: 171, - StartPos: 3856, - EndPos: 3857, + EndLine: 171, + StartPos: 3856, + EndPos: 3857, }, Value: "b", }, @@ -8283,45 +8361,45 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 172, - EndLine: 172, - StartPos: 3863, - EndPos: 3891, + EndLine: 172, + StartPos: 3863, + EndPos: 3891, }, Expr: &expr.Array{ Position: &position.Position{ StartLine: 172, - EndLine: 172, - StartPos: 3863, - EndPos: 3890, + EndLine: 172, + StartPos: 3863, + EndPos: 3890, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 172, - EndLine: 172, - StartPos: 3869, - EndPos: 3871, + EndLine: 172, + StartPos: 3869, + EndPos: 3871, }, Val: &expr.Reference{ Position: &position.Position{ StartLine: 172, - EndLine: 172, - StartPos: 3869, - EndPos: 3871, + EndLine: 172, + StartPos: 3869, + EndPos: 3871, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 172, - EndLine: 172, - StartPos: 3870, - EndPos: 3871, + EndLine: 172, + StartPos: 3870, + EndPos: 3871, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 172, - EndLine: 172, - StartPos: 3870, - EndPos: 3871, + EndLine: 172, + StartPos: 3870, + EndPos: 3871, }, Value: "b", }, @@ -8331,25 +8409,25 @@ func TestPhp5(t *testing.T) { &expr.ArrayItem{ Position: &position.Position{ StartLine: 172, - EndLine: 172, - StartPos: 3874, - EndPos: 3877, + EndLine: 172, + StartPos: 3874, + EndPos: 3877, }, Key: &scalar.Lnumber{ Position: &position.Position{ StartLine: 172, - EndLine: 172, - StartPos: 3874, - EndPos: 3874, + EndLine: 172, + StartPos: 3874, + EndPos: 3874, }, Value: "1", }, Val: &scalar.Lnumber{ Position: &position.Position{ StartLine: 172, - EndLine: 172, - StartPos: 3877, - EndPos: 3877, + EndLine: 172, + StartPos: 3877, + EndPos: 3877, }, Value: "1", }, @@ -8357,16 +8435,16 @@ func TestPhp5(t *testing.T) { &expr.ArrayItem{ Position: &position.Position{ StartLine: 172, - EndLine: 172, - StartPos: 3880, - EndPos: 3880, + EndLine: 172, + StartPos: 3880, + EndPos: 3880, }, Val: &scalar.Lnumber{ Position: &position.Position{ StartLine: 172, - EndLine: 172, - StartPos: 3880, - EndPos: 3880, + EndLine: 172, + StartPos: 3880, + EndPos: 3880, }, Value: "1", }, @@ -8374,39 +8452,39 @@ func TestPhp5(t *testing.T) { &expr.ArrayItem{ Position: &position.Position{ StartLine: 172, - EndLine: 172, - StartPos: 3883, - EndPos: 3889, + EndLine: 172, + StartPos: 3883, + EndPos: 3889, }, Key: &scalar.Lnumber{ Position: &position.Position{ StartLine: 172, - EndLine: 172, - StartPos: 3883, - EndPos: 3883, + EndLine: 172, + StartPos: 3883, + EndPos: 3883, }, Value: "3", }, Val: &expr.Reference{ Position: &position.Position{ StartLine: 172, - EndLine: 172, - StartPos: 3887, - EndPos: 3889, + EndLine: 172, + StartPos: 3887, + EndPos: 3889, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 172, - EndLine: 172, - StartPos: 3888, - EndPos: 3889, + EndLine: 172, + StartPos: 3888, + EndPos: 3889, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 172, - EndLine: 172, - StartPos: 3888, - EndPos: 3889, + EndLine: 172, + StartPos: 3888, + EndPos: 3889, }, Value: "b", }, @@ -8419,30 +8497,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 173, - EndLine: 173, - StartPos: 3895, - EndPos: 3898, + EndLine: 173, + StartPos: 3895, + EndPos: 3898, }, Expr: &expr.BitwiseNot{ Position: &position.Position{ StartLine: 173, - EndLine: 173, - StartPos: 3895, - EndPos: 3897, + EndLine: 173, + StartPos: 3895, + EndPos: 3897, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 173, - EndLine: 173, - StartPos: 3896, - EndPos: 3897, + EndLine: 173, + StartPos: 3896, + EndPos: 3897, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 173, - EndLine: 173, - StartPos: 3896, - EndPos: 3897, + EndLine: 173, + StartPos: 3896, + EndPos: 3897, }, Value: "a", }, @@ -8452,30 +8530,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 174, - EndLine: 174, - StartPos: 3902, - EndPos: 3905, + EndLine: 174, + StartPos: 3902, + EndPos: 3905, }, Expr: &expr.BooleanNot{ Position: &position.Position{ StartLine: 174, - EndLine: 174, - StartPos: 3902, - EndPos: 3904, + EndLine: 174, + StartPos: 3902, + EndPos: 3904, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 174, - EndLine: 174, - StartPos: 3903, - EndPos: 3904, + EndLine: 174, + StartPos: 3903, + EndPos: 3904, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 174, - EndLine: 174, - StartPos: 3903, - EndPos: 3904, + EndLine: 174, + StartPos: 3903, + EndPos: 3904, }, Value: "a", }, @@ -8485,31 +8563,31 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 176, - EndLine: 176, - StartPos: 3910, - EndPos: 3918, + EndLine: 176, + StartPos: 3910, + EndPos: 3918, }, Expr: &expr.ClassConstFetch{ Position: &position.Position{ StartLine: 176, - EndLine: 176, - StartPos: 3910, - EndPos: 3917, + EndLine: 176, + StartPos: 3910, + EndPos: 3917, }, Class: &name.Name{ Position: &position.Position{ StartLine: 176, - EndLine: 176, - StartPos: 3910, - EndPos: 3912, + EndLine: 176, + StartPos: 3910, + EndPos: 3912, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 176, - EndLine: 176, - StartPos: 3910, - EndPos: 3912, + EndLine: 176, + StartPos: 3910, + EndPos: 3912, }, Value: "Foo", }, @@ -8518,9 +8596,9 @@ func TestPhp5(t *testing.T) { ConstantName: &node.Identifier{ Position: &position.Position{ StartLine: 176, - EndLine: 176, - StartPos: 3915, - EndPos: 3917, + EndLine: 176, + StartPos: 3915, + EndPos: 3917, }, Value: "Bar", }, @@ -8529,30 +8607,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 177, - EndLine: 177, - StartPos: 3922, - EndPos: 3931, + EndLine: 177, + StartPos: 3922, + EndPos: 3931, }, Expr: &expr.Clone{ Position: &position.Position{ StartLine: 177, - EndLine: 177, - StartPos: 3922, - EndPos: 3929, + EndLine: 177, + StartPos: 3922, + EndPos: 3929, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 177, - EndLine: 177, - StartPos: 3928, - EndPos: 3929, + EndLine: 177, + StartPos: 3928, + EndPos: 3929, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 177, - EndLine: 177, - StartPos: 3928, - EndPos: 3929, + EndLine: 177, + StartPos: 3928, + EndPos: 3929, }, Value: "a", }, @@ -8562,30 +8640,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 178, - EndLine: 178, - StartPos: 3935, - EndPos: 3943, + EndLine: 178, + StartPos: 3935, + EndPos: 3943, }, Expr: &expr.Clone{ Position: &position.Position{ StartLine: 178, - EndLine: 178, - StartPos: 3935, - EndPos: 3942, + EndLine: 178, + StartPos: 3935, + EndPos: 3942, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 178, - EndLine: 178, - StartPos: 3941, - EndPos: 3942, + EndLine: 178, + StartPos: 3941, + EndPos: 3942, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 178, - EndLine: 178, - StartPos: 3941, - EndPos: 3942, + EndLine: 178, + StartPos: 3941, + EndPos: 3942, }, Value: "a", }, @@ -8595,63 +8673,64 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 179, - EndLine: 179, - StartPos: 3947, - EndPos: 3959, + EndLine: 179, + StartPos: 3947, + EndPos: 3959, }, Expr: &expr.Closure{ Position: &position.Position{ StartLine: 179, - EndLine: 179, - StartPos: 3947, - EndPos: 3958, + EndLine: 179, + StartPos: 3947, + EndPos: 3958, }, - ReturnsRef: false, - Static: false, + ReturnsRef: false, + Static: false, PhpDocComment: "", - Stmts: []node.Node{}, + Stmts: []node.Node{ + }, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 180, - EndLine: 180, - StartPos: 3963, - EndPos: 3996, + EndLine: 180, + StartPos: 3963, + EndPos: 3996, }, Expr: &expr.Closure{ Position: &position.Position{ StartLine: 180, - EndLine: 180, - StartPos: 3963, - EndPos: 3995, + EndLine: 180, + StartPos: 3963, + EndPos: 3995, }, - ReturnsRef: false, - Static: false, + ReturnsRef: false, + Static: false, PhpDocComment: "", Params: []node.Node{ &node.Parameter{ Position: &position.Position{ StartLine: 180, - EndLine: 180, - StartPos: 3972, - EndPos: 3973, + EndLine: 180, + StartPos: 3972, + EndPos: 3973, }, - ByRef: false, + ByRef: false, Variadic: false, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 180, - EndLine: 180, - StartPos: 3972, - EndPos: 3973, + EndLine: 180, + StartPos: 3972, + EndPos: 3973, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 180, - EndLine: 180, - StartPos: 3972, - EndPos: 3973, + EndLine: 180, + StartPos: 3972, + EndPos: 3973, }, Value: "a", }, @@ -8660,25 +8739,25 @@ func TestPhp5(t *testing.T) { &node.Parameter{ Position: &position.Position{ StartLine: 180, - EndLine: 180, - StartPos: 3976, - EndPos: 3977, + EndLine: 180, + StartPos: 3976, + EndPos: 3977, }, - ByRef: false, + ByRef: false, Variadic: false, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 180, - EndLine: 180, - StartPos: 3976, - EndPos: 3977, + EndLine: 180, + StartPos: 3976, + EndPos: 3977, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 180, - EndLine: 180, - StartPos: 3976, - EndPos: 3977, + EndLine: 180, + StartPos: 3976, + EndPos: 3977, }, Value: "b", }, @@ -8688,24 +8767,24 @@ func TestPhp5(t *testing.T) { ClosureUse: &expr.ClosureUse{ Position: &position.Position{ StartLine: 180, - EndLine: 180, - StartPos: 3980, - EndPos: 3992, + EndLine: 180, + StartPos: 3980, + EndPos: 3992, }, Uses: []node.Node{ &expr.Variable{ Position: &position.Position{ StartLine: 180, - EndLine: 180, - StartPos: 3985, - EndPos: 3986, + EndLine: 180, + StartPos: 3985, + EndPos: 3986, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 180, - EndLine: 180, - StartPos: 3985, - EndPos: 3986, + EndLine: 180, + StartPos: 3985, + EndPos: 3986, }, Value: "c", }, @@ -8713,23 +8792,23 @@ func TestPhp5(t *testing.T) { &expr.Reference{ Position: &position.Position{ StartLine: 180, - EndLine: 180, - StartPos: 3989, - EndPos: 3991, + EndLine: 180, + StartPos: 3989, + EndPos: 3991, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 180, - EndLine: 180, - StartPos: 3990, - EndPos: 3991, + EndLine: 180, + StartPos: 3990, + EndPos: 3991, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 180, - EndLine: 180, - StartPos: 3990, - EndPos: 3991, + EndLine: 180, + StartPos: 3990, + EndPos: 3991, }, Value: "d", }, @@ -8737,49 +8816,50 @@ func TestPhp5(t *testing.T) { }, }, }, - Stmts: []node.Node{}, + Stmts: []node.Node{ + }, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 181, - EndLine: 181, - StartPos: 4000, - EndPos: 4033, + EndLine: 181, + StartPos: 4000, + EndPos: 4033, }, Expr: &expr.Closure{ Position: &position.Position{ StartLine: 181, - EndLine: 181, - StartPos: 4000, - EndPos: 4032, + EndLine: 181, + StartPos: 4000, + EndPos: 4032, }, - ReturnsRef: false, - Static: false, + ReturnsRef: false, + Static: false, PhpDocComment: "", Params: []node.Node{ &node.Parameter{ Position: &position.Position{ StartLine: 181, - EndLine: 181, - StartPos: 4009, - EndPos: 4010, + EndLine: 181, + StartPos: 4009, + EndPos: 4010, }, - ByRef: false, + ByRef: false, Variadic: false, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 181, - EndLine: 181, - StartPos: 4009, - EndPos: 4010, + EndLine: 181, + StartPos: 4009, + EndPos: 4010, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 181, - EndLine: 181, - StartPos: 4009, - EndPos: 4010, + EndLine: 181, + StartPos: 4009, + EndPos: 4010, }, Value: "a", }, @@ -8788,25 +8868,25 @@ func TestPhp5(t *testing.T) { &node.Parameter{ Position: &position.Position{ StartLine: 181, - EndLine: 181, - StartPos: 4013, - EndPos: 4014, + EndLine: 181, + StartPos: 4013, + EndPos: 4014, }, - ByRef: false, + ByRef: false, Variadic: false, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 181, - EndLine: 181, - StartPos: 4013, - EndPos: 4014, + EndLine: 181, + StartPos: 4013, + EndPos: 4014, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 181, - EndLine: 181, - StartPos: 4013, - EndPos: 4014, + EndLine: 181, + StartPos: 4013, + EndPos: 4014, }, Value: "b", }, @@ -8816,31 +8896,31 @@ func TestPhp5(t *testing.T) { ClosureUse: &expr.ClosureUse{ Position: &position.Position{ StartLine: 181, - EndLine: 181, - StartPos: 4017, - EndPos: 4029, + EndLine: 181, + StartPos: 4017, + EndPos: 4029, }, Uses: []node.Node{ &expr.Reference{ Position: &position.Position{ StartLine: 181, - EndLine: 181, - StartPos: 4022, - EndPos: 4024, + EndLine: 181, + StartPos: 4022, + EndPos: 4024, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 181, - EndLine: 181, - StartPos: 4023, - EndPos: 4024, + EndLine: 181, + StartPos: 4023, + EndPos: 4024, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 181, - EndLine: 181, - StartPos: 4023, - EndPos: 4024, + EndLine: 181, + StartPos: 4023, + EndPos: 4024, }, Value: "c", }, @@ -8849,73 +8929,75 @@ func TestPhp5(t *testing.T) { &expr.Variable{ Position: &position.Position{ StartLine: 181, - EndLine: 181, - StartPos: 4027, - EndPos: 4028, + EndLine: 181, + StartPos: 4027, + EndPos: 4028, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 181, - EndLine: 181, - StartPos: 4027, - EndPos: 4028, + EndLine: 181, + StartPos: 4027, + EndPos: 4028, }, Value: "d", }, }, }, }, - Stmts: []node.Node{}, + Stmts: []node.Node{ + }, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 182, - EndLine: 182, - StartPos: 4037, - EndPos: 4050, + EndLine: 182, + StartPos: 4037, + EndPos: 4050, }, Expr: &expr.Closure{ Position: &position.Position{ StartLine: 182, - EndLine: 182, - StartPos: 4037, - EndPos: 4049, + EndLine: 182, + StartPos: 4037, + EndPos: 4049, }, - ReturnsRef: false, - Static: false, + ReturnsRef: false, + Static: false, PhpDocComment: "", - Stmts: []node.Node{}, + Stmts: []node.Node{ + }, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 183, - EndLine: 183, - StartPos: 4054, - EndPos: 4057, + EndLine: 183, + StartPos: 4054, + EndPos: 4057, }, Expr: &expr.ConstFetch{ Position: &position.Position{ StartLine: 183, - EndLine: 183, - StartPos: 4054, - EndPos: 4056, + EndLine: 183, + StartPos: 4054, + EndPos: 4056, }, Constant: &name.Name{ Position: &position.Position{ StartLine: 183, - EndLine: 183, - StartPos: 4054, - EndPos: 4056, + EndLine: 183, + StartPos: 4054, + EndPos: 4056, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 183, - EndLine: 183, - StartPos: 4054, - EndPos: 4056, + EndLine: 183, + StartPos: 4054, + EndPos: 4056, }, Value: "foo", }, @@ -8926,31 +9008,31 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 184, - EndLine: 184, - StartPos: 4061, - EndPos: 4074, + EndLine: 184, + StartPos: 4061, + EndPos: 4074, }, Expr: &expr.ConstFetch{ Position: &position.Position{ StartLine: 184, - EndLine: 184, - StartPos: 4061, - EndPos: 4073, + EndLine: 184, + StartPos: 4061, + EndPos: 4073, }, Constant: &name.Relative{ Position: &position.Position{ StartLine: 184, - EndLine: 184, - StartPos: 4061, - EndPos: 4073, + EndLine: 184, + StartPos: 4061, + EndPos: 4073, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 184, - EndLine: 184, - StartPos: 4071, - EndPos: 4073, + EndLine: 184, + StartPos: 4071, + EndPos: 4073, }, Value: "foo", }, @@ -8961,31 +9043,31 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 185, - EndLine: 185, - StartPos: 4078, - EndPos: 4082, + EndLine: 185, + StartPos: 4078, + EndPos: 4082, }, Expr: &expr.ConstFetch{ Position: &position.Position{ StartLine: 185, - EndLine: 185, - StartPos: 4078, - EndPos: 4081, + EndLine: 185, + StartPos: 4078, + EndPos: 4081, }, Constant: &name.FullyQualified{ Position: &position.Position{ StartLine: 185, - EndLine: 185, - StartPos: 4078, - EndPos: 4081, + EndLine: 185, + StartPos: 4078, + EndPos: 4081, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 185, - EndLine: 185, - StartPos: 4079, - EndPos: 4081, + EndLine: 185, + StartPos: 4079, + EndPos: 4081, }, Value: "foo", }, @@ -8996,30 +9078,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 187, - EndLine: 187, - StartPos: 4087, - EndPos: 4096, + EndLine: 187, + StartPos: 4087, + EndPos: 4096, }, Expr: &expr.Empty{ Position: &position.Position{ StartLine: 187, - EndLine: 187, - StartPos: 4087, - EndPos: 4095, + EndLine: 187, + StartPos: 4087, + EndPos: 4095, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 187, - EndLine: 187, - StartPos: 4093, - EndPos: 4094, + EndLine: 187, + StartPos: 4093, + EndPos: 4094, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 187, - EndLine: 187, - StartPos: 4093, - EndPos: 4094, + EndLine: 187, + StartPos: 4093, + EndPos: 4094, }, Value: "a", }, @@ -9029,38 +9111,38 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 188, - EndLine: 188, - StartPos: 4100, - EndPos: 4110, + EndLine: 188, + StartPos: 4100, + EndPos: 4110, }, Expr: &expr.Empty{ Position: &position.Position{ StartLine: 188, - EndLine: 188, - StartPos: 4100, - EndPos: 4109, + EndLine: 188, + StartPos: 4100, + EndPos: 4109, }, Expr: &expr.ConstFetch{ Position: &position.Position{ StartLine: 188, - EndLine: 188, - StartPos: 4106, - EndPos: 4108, + EndLine: 188, + StartPos: 4106, + EndPos: 4108, }, Constant: &name.Name{ Position: &position.Position{ StartLine: 188, - EndLine: 188, - StartPos: 4106, - EndPos: 4108, + EndLine: 188, + StartPos: 4106, + EndPos: 4108, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 188, - EndLine: 188, - StartPos: 4106, - EndPos: 4108, + EndLine: 188, + StartPos: 4106, + EndPos: 4108, }, Value: "Foo", }, @@ -9072,30 +9154,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 189, - EndLine: 189, - StartPos: 4114, - EndPos: 4117, + EndLine: 189, + StartPos: 4114, + EndPos: 4117, }, Expr: &expr.ErrorSuppress{ Position: &position.Position{ StartLine: 189, - EndLine: 189, - StartPos: 4114, - EndPos: 4116, + EndLine: 189, + StartPos: 4114, + EndPos: 4116, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 189, - EndLine: 189, - StartPos: 4115, - EndPos: 4116, + EndLine: 189, + StartPos: 4115, + EndPos: 4116, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 189, - EndLine: 189, - StartPos: 4115, - EndPos: 4116, + EndLine: 189, + StartPos: 4115, + EndPos: 4116, }, Value: "a", }, @@ -9105,30 +9187,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 190, - EndLine: 190, - StartPos: 4121, - EndPos: 4129, + EndLine: 190, + StartPos: 4121, + EndPos: 4129, }, Expr: &expr.Eval{ Position: &position.Position{ StartLine: 190, - EndLine: 190, - StartPos: 4121, - EndPos: 4128, + EndLine: 190, + StartPos: 4121, + EndPos: 4128, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 190, - EndLine: 190, - StartPos: 4126, - EndPos: 4127, + EndLine: 190, + StartPos: 4126, + EndPos: 4127, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 190, - EndLine: 190, - StartPos: 4126, - EndPos: 4127, + EndLine: 190, + StartPos: 4126, + EndPos: 4127, }, Value: "a", }, @@ -9138,46 +9220,46 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 191, - EndLine: 191, - StartPos: 4133, - EndPos: 4137, + EndLine: 191, + StartPos: 4133, + EndPos: 4137, }, Expr: &expr.Exit{ Position: &position.Position{ StartLine: 191, - EndLine: 191, - StartPos: 4133, - EndPos: 4136, + EndLine: 191, + StartPos: 4133, + EndPos: 4136, }, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 192, - EndLine: 192, - StartPos: 4141, - EndPos: 4149, + EndLine: 192, + StartPos: 4141, + EndPos: 4149, }, Expr: &expr.Exit{ Position: &position.Position{ StartLine: 192, - EndLine: 192, - StartPos: 4141, - EndPos: 4148, + EndLine: 192, + StartPos: 4141, + EndPos: 4148, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 192, - EndLine: 192, - StartPos: 4146, - EndPos: 4147, + EndLine: 192, + StartPos: 4146, + EndPos: 4147, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 192, - EndLine: 192, - StartPos: 4146, - EndPos: 4147, + EndLine: 192, + StartPos: 4146, + EndPos: 4147, }, Value: "a", }, @@ -9187,46 +9269,46 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 193, - EndLine: 193, - StartPos: 4153, - EndPos: 4158, + EndLine: 193, + StartPos: 4153, + EndPos: 4158, }, Expr: &expr.Die{ Position: &position.Position{ StartLine: 193, - EndLine: 193, - StartPos: 4153, - EndPos: 4157, + EndLine: 193, + StartPos: 4153, + EndPos: 4157, }, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 194, - EndLine: 194, - StartPos: 4162, - EndPos: 4169, + EndLine: 194, + StartPos: 4162, + EndPos: 4169, }, Expr: &expr.Die{ Position: &position.Position{ StartLine: 194, - EndLine: 194, - StartPos: 4162, - EndPos: 4168, + EndLine: 194, + StartPos: 4162, + EndPos: 4168, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 194, - EndLine: 194, - StartPos: 4166, - EndPos: 4167, + EndLine: 194, + StartPos: 4166, + EndPos: 4167, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 194, - EndLine: 194, - StartPos: 4166, - EndPos: 4167, + EndLine: 194, + StartPos: 4166, + EndPos: 4167, }, Value: "a", }, @@ -9236,31 +9318,31 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 195, - EndLine: 195, - StartPos: 4173, - EndPos: 4178, + EndLine: 195, + StartPos: 4173, + EndPos: 4178, }, Expr: &expr.FunctionCall{ Position: &position.Position{ StartLine: 195, - EndLine: 195, - StartPos: 4173, - EndPos: 4177, + EndLine: 195, + StartPos: 4173, + EndPos: 4177, }, Function: &name.Name{ Position: &position.Position{ StartLine: 195, - EndLine: 195, - StartPos: 4173, - EndPos: 4175, + EndLine: 195, + StartPos: 4173, + EndPos: 4175, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 195, - EndLine: 195, - StartPos: 4173, - EndPos: 4175, + EndLine: 195, + StartPos: 4173, + EndPos: 4175, }, Value: "foo", }, @@ -9269,9 +9351,9 @@ func TestPhp5(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 195, - EndLine: 195, - StartPos: 4176, - EndPos: 4177, + EndLine: 195, + StartPos: 4176, + EndPos: 4177, }, }, }, @@ -9279,31 +9361,31 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 196, - EndLine: 196, - StartPos: 4182, - EndPos: 4200, + EndLine: 196, + StartPos: 4182, + EndPos: 4200, }, Expr: &expr.FunctionCall{ Position: &position.Position{ StartLine: 196, - EndLine: 196, - StartPos: 4182, - EndPos: 4199, + EndLine: 196, + StartPos: 4182, + EndPos: 4199, }, Function: &name.Relative{ Position: &position.Position{ StartLine: 196, - EndLine: 196, - StartPos: 4182, - EndPos: 4194, + EndLine: 196, + StartPos: 4182, + EndPos: 4194, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 196, - EndLine: 196, - StartPos: 4192, - EndPos: 4194, + EndLine: 196, + StartPos: 4192, + EndPos: 4194, }, Value: "foo", }, @@ -9312,33 +9394,33 @@ func TestPhp5(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 196, - EndLine: 196, - StartPos: 4195, - EndPos: 4199, + EndLine: 196, + StartPos: 4195, + EndPos: 4199, }, Arguments: []node.Node{ &node.Argument{ Position: &position.Position{ StartLine: 196, - EndLine: 196, - StartPos: 4197, - EndPos: 4198, + EndLine: 196, + StartPos: 4197, + EndPos: 4198, }, - Variadic: false, + Variadic: false, IsReference: true, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 196, - EndLine: 196, - StartPos: 4197, - EndPos: 4198, + EndLine: 196, + StartPos: 4197, + EndPos: 4198, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 196, - EndLine: 196, - StartPos: 4197, - EndPos: 4198, + EndLine: 196, + StartPos: 4197, + EndPos: 4198, }, Value: "a", }, @@ -9351,31 +9433,31 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 197, - EndLine: 197, - StartPos: 4204, - EndPos: 4212, + EndLine: 197, + StartPos: 4204, + EndPos: 4212, }, Expr: &expr.FunctionCall{ Position: &position.Position{ StartLine: 197, - EndLine: 197, - StartPos: 4204, - EndPos: 4211, + EndLine: 197, + StartPos: 4204, + EndPos: 4211, }, Function: &name.FullyQualified{ Position: &position.Position{ StartLine: 197, - EndLine: 197, - StartPos: 4204, - EndPos: 4207, + EndLine: 197, + StartPos: 4204, + EndPos: 4207, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 197, - EndLine: 197, - StartPos: 4205, - EndPos: 4207, + EndLine: 197, + StartPos: 4205, + EndPos: 4207, }, Value: "foo", }, @@ -9384,28 +9466,29 @@ func TestPhp5(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 197, - EndLine: 197, - StartPos: 4208, - EndPos: 4211, + EndLine: 197, + StartPos: 4208, + EndPos: 4211, }, Arguments: []node.Node{ &node.Argument{ Position: &position.Position{ StartLine: 197, - EndLine: 197, - StartPos: 4209, - EndPos: 4210, + EndLine: 197, + StartPos: 4209, + EndPos: 4210, }, - Variadic: false, + Variadic: false, IsReference: false, Expr: &expr.ShortArray{ Position: &position.Position{ StartLine: 197, - EndLine: 197, - StartPos: 4209, - EndPos: 4210, + EndLine: 197, + StartPos: 4209, + EndPos: 4210, + }, + Items: []node.Node{ }, - Items: []node.Node{}, }, }, }, @@ -9415,30 +9498,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 198, - EndLine: 198, - StartPos: 4216, - EndPos: 4230, + EndLine: 198, + StartPos: 4216, + EndPos: 4230, }, Expr: &expr.FunctionCall{ Position: &position.Position{ StartLine: 198, - EndLine: 198, - StartPos: 4216, - EndPos: 4229, + EndLine: 198, + StartPos: 4216, + EndPos: 4229, }, Function: &expr.Variable{ Position: &position.Position{ StartLine: 198, - EndLine: 198, - StartPos: 4216, - EndPos: 4219, + EndLine: 198, + StartPos: 4216, + EndPos: 4219, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 198, - EndLine: 198, - StartPos: 4216, - EndPos: 4219, + EndLine: 198, + StartPos: 4216, + EndPos: 4219, }, Value: "foo", }, @@ -9446,40 +9529,40 @@ func TestPhp5(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 198, - EndLine: 198, - StartPos: 4220, - EndPos: 4229, + EndLine: 198, + StartPos: 4220, + EndPos: 4229, }, Arguments: []node.Node{ &node.Argument{ Position: &position.Position{ StartLine: 198, - EndLine: 198, - StartPos: 4221, - EndPos: 4228, + EndLine: 198, + StartPos: 4221, + EndPos: 4228, }, - Variadic: false, + Variadic: false, IsReference: false, Expr: &expr.Yield{ Position: &position.Position{ StartLine: 198, - EndLine: 198, - StartPos: 4221, - EndPos: 4228, + EndLine: 198, + StartPos: 4221, + EndPos: 4228, }, Value: &expr.Variable{ Position: &position.Position{ StartLine: 198, - EndLine: 198, - StartPos: 4227, - EndPos: 4228, + EndLine: 198, + StartPos: 4227, + EndPos: 4228, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 198, - EndLine: 198, - StartPos: 4227, - EndPos: 4228, + EndLine: 198, + StartPos: 4227, + EndPos: 4228, }, Value: "a", }, @@ -9493,30 +9576,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 200, - EndLine: 200, - StartPos: 4235, - EndPos: 4239, + EndLine: 200, + StartPos: 4235, + EndPos: 4239, }, Expr: &expr.PostDec{ Position: &position.Position{ StartLine: 200, - EndLine: 200, - StartPos: 4235, - EndPos: 4238, + EndLine: 200, + StartPos: 4235, + EndPos: 4238, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 200, - EndLine: 200, - StartPos: 4235, - EndPos: 4236, + EndLine: 200, + StartPos: 4235, + EndPos: 4236, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 200, - EndLine: 200, - StartPos: 4235, - EndPos: 4236, + EndLine: 200, + StartPos: 4235, + EndPos: 4236, }, Value: "a", }, @@ -9526,30 +9609,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 201, - EndLine: 201, - StartPos: 4243, - EndPos: 4247, + EndLine: 201, + StartPos: 4243, + EndPos: 4247, }, Expr: &expr.PostInc{ Position: &position.Position{ StartLine: 201, - EndLine: 201, - StartPos: 4243, - EndPos: 4246, + EndLine: 201, + StartPos: 4243, + EndPos: 4246, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 201, - EndLine: 201, - StartPos: 4243, - EndPos: 4244, + EndLine: 201, + StartPos: 4243, + EndPos: 4244, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 201, - EndLine: 201, - StartPos: 4243, - EndPos: 4244, + EndLine: 201, + StartPos: 4243, + EndPos: 4244, }, Value: "a", }, @@ -9559,30 +9642,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 202, - EndLine: 202, - StartPos: 4251, - EndPos: 4255, + EndLine: 202, + StartPos: 4251, + EndPos: 4255, }, Expr: &expr.PreDec{ Position: &position.Position{ StartLine: 202, - EndLine: 202, - StartPos: 4251, - EndPos: 4254, + EndLine: 202, + StartPos: 4251, + EndPos: 4254, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 202, - EndLine: 202, - StartPos: 4253, - EndPos: 4254, + EndLine: 202, + StartPos: 4253, + EndPos: 4254, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 202, - EndLine: 202, - StartPos: 4253, - EndPos: 4254, + EndLine: 202, + StartPos: 4253, + EndPos: 4254, }, Value: "a", }, @@ -9592,30 +9675,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 203, - EndLine: 203, - StartPos: 4259, - EndPos: 4263, + EndLine: 203, + StartPos: 4259, + EndPos: 4263, }, Expr: &expr.PreInc{ Position: &position.Position{ StartLine: 203, - EndLine: 203, - StartPos: 4259, - EndPos: 4262, + EndLine: 203, + StartPos: 4259, + EndPos: 4262, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 203, - EndLine: 203, - StartPos: 4261, - EndPos: 4262, + EndLine: 203, + StartPos: 4261, + EndPos: 4262, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 203, - EndLine: 203, - StartPos: 4261, - EndPos: 4262, + EndLine: 203, + StartPos: 4261, + EndPos: 4262, }, Value: "a", }, @@ -9625,30 +9708,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 205, - EndLine: 205, - StartPos: 4268, - EndPos: 4278, + EndLine: 205, + StartPos: 4268, + EndPos: 4278, }, Expr: &expr.Include{ Position: &position.Position{ StartLine: 205, - EndLine: 205, - StartPos: 4268, - EndPos: 4277, + EndLine: 205, + StartPos: 4268, + EndPos: 4277, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 205, - EndLine: 205, - StartPos: 4276, - EndPos: 4277, + EndLine: 205, + StartPos: 4276, + EndPos: 4277, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 205, - EndLine: 205, - StartPos: 4276, - EndPos: 4277, + EndLine: 205, + StartPos: 4276, + EndPos: 4277, }, Value: "a", }, @@ -9658,30 +9741,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 206, - EndLine: 206, - StartPos: 4282, - EndPos: 4297, + EndLine: 206, + StartPos: 4282, + EndPos: 4297, }, Expr: &expr.IncludeOnce{ Position: &position.Position{ StartLine: 206, - EndLine: 206, - StartPos: 4282, - EndPos: 4296, + EndLine: 206, + StartPos: 4282, + EndPos: 4296, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 206, - EndLine: 206, - StartPos: 4295, - EndPos: 4296, + EndLine: 206, + StartPos: 4295, + EndPos: 4296, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 206, - EndLine: 206, - StartPos: 4295, - EndPos: 4296, + EndLine: 206, + StartPos: 4295, + EndPos: 4296, }, Value: "a", }, @@ -9691,30 +9774,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 207, - EndLine: 207, - StartPos: 4301, - EndPos: 4311, + EndLine: 207, + StartPos: 4301, + EndPos: 4311, }, Expr: &expr.Require{ Position: &position.Position{ StartLine: 207, - EndLine: 207, - StartPos: 4301, - EndPos: 4310, + EndLine: 207, + StartPos: 4301, + EndPos: 4310, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 207, - EndLine: 207, - StartPos: 4309, - EndPos: 4310, + EndLine: 207, + StartPos: 4309, + EndPos: 4310, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 207, - EndLine: 207, - StartPos: 4309, - EndPos: 4310, + EndLine: 207, + StartPos: 4309, + EndPos: 4310, }, Value: "a", }, @@ -9724,30 +9807,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 208, - EndLine: 208, - StartPos: 4315, - EndPos: 4330, + EndLine: 208, + StartPos: 4315, + EndPos: 4330, }, Expr: &expr.RequireOnce{ Position: &position.Position{ StartLine: 208, - EndLine: 208, - StartPos: 4315, - EndPos: 4329, + EndLine: 208, + StartPos: 4315, + EndPos: 4329, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 208, - EndLine: 208, - StartPos: 4328, - EndPos: 4329, + EndLine: 208, + StartPos: 4328, + EndPos: 4329, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 208, - EndLine: 208, - StartPos: 4328, - EndPos: 4329, + EndLine: 208, + StartPos: 4328, + EndPos: 4329, }, Value: "a", }, @@ -9757,30 +9840,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 210, - EndLine: 210, - StartPos: 4335, - EndPos: 4352, + EndLine: 210, + StartPos: 4335, + EndPos: 4352, }, Expr: &expr.InstanceOf{ Position: &position.Position{ StartLine: 210, - EndLine: 210, - StartPos: 4335, - EndPos: 4351, + EndLine: 210, + StartPos: 4335, + EndPos: 4351, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 210, - EndLine: 210, - StartPos: 4335, - EndPos: 4336, + EndLine: 210, + StartPos: 4335, + EndPos: 4336, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 210, - EndLine: 210, - StartPos: 4335, - EndPos: 4336, + EndLine: 210, + StartPos: 4335, + EndPos: 4336, }, Value: "a", }, @@ -9788,17 +9871,17 @@ func TestPhp5(t *testing.T) { Class: &name.Name{ Position: &position.Position{ StartLine: 210, - EndLine: 210, - StartPos: 4349, - EndPos: 4351, + EndLine: 210, + StartPos: 4349, + EndPos: 4351, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 210, - EndLine: 210, - StartPos: 4349, - EndPos: 4351, + EndLine: 210, + StartPos: 4349, + EndPos: 4351, }, Value: "Foo", }, @@ -9809,30 +9892,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 211, - EndLine: 211, - StartPos: 4356, - EndPos: 4383, + EndLine: 211, + StartPos: 4356, + EndPos: 4383, }, Expr: &expr.InstanceOf{ Position: &position.Position{ StartLine: 211, - EndLine: 211, - StartPos: 4356, - EndPos: 4382, + EndLine: 211, + StartPos: 4356, + EndPos: 4382, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 211, - EndLine: 211, - StartPos: 4356, - EndPos: 4357, + EndLine: 211, + StartPos: 4356, + EndPos: 4357, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 211, - EndLine: 211, - StartPos: 4356, - EndPos: 4357, + EndLine: 211, + StartPos: 4356, + EndPos: 4357, }, Value: "a", }, @@ -9840,17 +9923,17 @@ func TestPhp5(t *testing.T) { Class: &name.Relative{ Position: &position.Position{ StartLine: 211, - EndLine: 211, - StartPos: 4370, - EndPos: 4382, + EndLine: 211, + StartPos: 4370, + EndPos: 4382, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 211, - EndLine: 211, - StartPos: 4380, - EndPos: 4382, + EndLine: 211, + StartPos: 4380, + EndPos: 4382, }, Value: "Foo", }, @@ -9861,30 +9944,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 212, - EndLine: 212, - StartPos: 4387, - EndPos: 4405, + EndLine: 212, + StartPos: 4387, + EndPos: 4405, }, Expr: &expr.InstanceOf{ Position: &position.Position{ StartLine: 212, - EndLine: 212, - StartPos: 4387, - EndPos: 4404, + EndLine: 212, + StartPos: 4387, + EndPos: 4404, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 212, - EndLine: 212, - StartPos: 4387, - EndPos: 4388, + EndLine: 212, + StartPos: 4387, + EndPos: 4388, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 212, - EndLine: 212, - StartPos: 4387, - EndPos: 4388, + EndLine: 212, + StartPos: 4387, + EndPos: 4388, }, Value: "a", }, @@ -9892,17 +9975,17 @@ func TestPhp5(t *testing.T) { Class: &name.FullyQualified{ Position: &position.Position{ StartLine: 212, - EndLine: 212, - StartPos: 4401, - EndPos: 4404, + EndLine: 212, + StartPos: 4401, + EndPos: 4404, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 212, - EndLine: 212, - StartPos: 4402, - EndPos: 4404, + EndLine: 212, + StartPos: 4402, + EndPos: 4404, }, Value: "Foo", }, @@ -9913,31 +9996,31 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 214, - EndLine: 214, - StartPos: 4410, - EndPos: 4423, + EndLine: 214, + StartPos: 4410, + EndPos: 4423, }, Expr: &expr.Isset{ Position: &position.Position{ StartLine: 214, - EndLine: 214, - StartPos: 4410, - EndPos: 4422, + EndLine: 214, + StartPos: 4410, + EndPos: 4422, }, Variables: []node.Node{ &expr.Variable{ Position: &position.Position{ StartLine: 214, - EndLine: 214, - StartPos: 4416, - EndPos: 4417, + EndLine: 214, + StartPos: 4416, + EndPos: 4417, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 214, - EndLine: 214, - StartPos: 4416, - EndPos: 4417, + EndLine: 214, + StartPos: 4416, + EndPos: 4417, }, Value: "a", }, @@ -9945,16 +10028,16 @@ func TestPhp5(t *testing.T) { &expr.Variable{ Position: &position.Position{ StartLine: 214, - EndLine: 214, - StartPos: 4420, - EndPos: 4421, + EndLine: 214, + StartPos: 4420, + EndPos: 4421, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 214, - EndLine: 214, - StartPos: 4420, - EndPos: 4421, + EndLine: 214, + StartPos: 4420, + EndPos: 4421, }, Value: "b", }, @@ -9965,39 +10048,39 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 215, - EndLine: 215, - StartPos: 4427, - EndPos: 4437, + EndLine: 215, + StartPos: 4427, + EndPos: 4437, }, Expr: &expr.Isset{ Position: &position.Position{ StartLine: 215, - EndLine: 215, - StartPos: 4427, - EndPos: 4436, + EndLine: 215, + StartPos: 4427, + EndPos: 4436, }, Variables: []node.Node{ &expr.ConstFetch{ Position: &position.Position{ StartLine: 215, - EndLine: 215, - StartPos: 4433, - EndPos: 4435, + EndLine: 215, + StartPos: 4433, + EndPos: 4435, }, Constant: &name.Name{ Position: &position.Position{ StartLine: 215, - EndLine: 215, - StartPos: 4433, - EndPos: 4435, + EndLine: 215, + StartPos: 4433, + EndPos: 4435, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 215, - EndLine: 215, - StartPos: 4433, - EndPos: 4435, + EndLine: 215, + StartPos: 4433, + EndPos: 4435, }, Value: "Foo", }, @@ -10010,39 +10093,40 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 216, - EndLine: 216, - StartPos: 4441, - EndPos: 4452, + EndLine: 216, + StartPos: 4441, + EndPos: 4452, }, Expr: &assign.Assign{ Position: &position.Position{ StartLine: 216, - EndLine: 216, - StartPos: 4441, - EndPos: 4451, + EndLine: 216, + StartPos: 4441, + EndPos: 4451, }, Variable: &expr.List{ Position: &position.Position{ StartLine: 216, - EndLine: 216, - StartPos: 4441, - EndPos: 4446, + EndLine: 216, + StartPos: 4441, + EndPos: 4446, + }, + Items: []node.Node{ }, - Items: []node.Node{}, }, Expression: &expr.Variable{ Position: &position.Position{ StartLine: 216, - EndLine: 216, - StartPos: 4450, - EndPos: 4451, + EndLine: 216, + StartPos: 4450, + EndPos: 4451, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 216, - EndLine: 216, - StartPos: 4450, - EndPos: 4451, + EndLine: 216, + StartPos: 4450, + EndPos: 4451, }, Value: "b", }, @@ -10052,45 +10136,45 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 217, - EndLine: 217, - StartPos: 4456, - EndPos: 4473, + EndLine: 217, + StartPos: 4456, + EndPos: 4473, }, Expr: &assign.Assign{ Position: &position.Position{ StartLine: 217, - EndLine: 217, - StartPos: 4456, - EndPos: 4472, + EndLine: 217, + StartPos: 4456, + EndPos: 4472, }, Variable: &expr.List{ Position: &position.Position{ StartLine: 217, - EndLine: 217, - StartPos: 4456, - EndPos: 4467, + EndLine: 217, + StartPos: 4456, + EndPos: 4467, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 217, - EndLine: 217, - StartPos: 4461, - EndPos: 4462, + EndLine: 217, + StartPos: 4461, + EndPos: 4462, }, Val: &expr.Variable{ Position: &position.Position{ StartLine: 217, - EndLine: 217, - StartPos: 4461, - EndPos: 4462, + EndLine: 217, + StartPos: 4461, + EndPos: 4462, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 217, - EndLine: 217, - StartPos: 4461, - EndPos: 4462, + EndLine: 217, + StartPos: 4461, + EndPos: 4462, }, Value: "a", }, @@ -10099,23 +10183,23 @@ func TestPhp5(t *testing.T) { &expr.ArrayItem{ Position: &position.Position{ StartLine: 217, - EndLine: 217, - StartPos: 4465, - EndPos: 4466, + EndLine: 217, + StartPos: 4465, + EndPos: 4466, }, Val: &expr.Variable{ Position: &position.Position{ StartLine: 217, - EndLine: 217, - StartPos: 4465, - EndPos: 4466, + EndLine: 217, + StartPos: 4465, + EndPos: 4466, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 217, - EndLine: 217, - StartPos: 4465, - EndPos: 4466, + EndLine: 217, + StartPos: 4465, + EndPos: 4466, }, Value: "b", }, @@ -10126,16 +10210,16 @@ func TestPhp5(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 217, - EndLine: 217, - StartPos: 4471, - EndPos: 4472, + EndLine: 217, + StartPos: 4471, + EndPos: 4472, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 217, - EndLine: 217, - StartPos: 4471, - EndPos: 4472, + EndLine: 217, + StartPos: 4471, + EndPos: 4472, }, Value: "b", }, @@ -10145,52 +10229,52 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 218, - EndLine: 218, - StartPos: 4477, - EndPos: 4492, + EndLine: 218, + StartPos: 4477, + EndPos: 4492, }, Expr: &assign.Assign{ Position: &position.Position{ StartLine: 218, - EndLine: 218, - StartPos: 4477, - EndPos: 4491, + EndLine: 218, + StartPos: 4477, + EndPos: 4491, }, Variable: &expr.List{ Position: &position.Position{ StartLine: 218, - EndLine: 218, - StartPos: 4477, - EndPos: 4486, + EndLine: 218, + StartPos: 4477, + EndPos: 4486, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 218, - EndLine: 218, - StartPos: 4482, - EndPos: 4485, + EndLine: 218, + StartPos: 4482, + EndPos: 4485, }, Val: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 218, - EndLine: 218, - StartPos: 4482, - EndPos: 4485, + EndLine: 218, + StartPos: 4482, + EndPos: 4485, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 218, - EndLine: 218, - StartPos: 4482, - EndPos: 4483, + EndLine: 218, + StartPos: 4482, + EndPos: 4483, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 218, - EndLine: 218, - StartPos: 4482, - EndPos: 4483, + EndLine: 218, + StartPos: 4482, + EndPos: 4483, }, Value: "a", }, @@ -10202,16 +10286,16 @@ func TestPhp5(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 218, - EndLine: 218, - StartPos: 4490, - EndPos: 4491, + EndLine: 218, + StartPos: 4490, + EndPos: 4491, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 218, - EndLine: 218, - StartPos: 4490, - EndPos: 4491, + EndLine: 218, + StartPos: 4490, + EndPos: 4491, }, Value: "b", }, @@ -10221,60 +10305,60 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 219, - EndLine: 219, - StartPos: 4496, - EndPos: 4515, + EndLine: 219, + StartPos: 4496, + EndPos: 4515, }, Expr: &assign.Assign{ Position: &position.Position{ StartLine: 219, - EndLine: 219, - StartPos: 4496, - EndPos: 4514, + EndLine: 219, + StartPos: 4496, + EndPos: 4514, }, Variable: &expr.List{ Position: &position.Position{ StartLine: 219, - EndLine: 219, - StartPos: 4496, - EndPos: 4509, + EndLine: 219, + StartPos: 4496, + EndPos: 4509, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 219, - EndLine: 219, - StartPos: 4501, - EndPos: 4508, + EndLine: 219, + StartPos: 4501, + EndPos: 4508, }, Val: &expr.List{ Position: &position.Position{ StartLine: 219, - EndLine: 219, - StartPos: 4501, - EndPos: 4508, + EndLine: 219, + StartPos: 4501, + EndPos: 4508, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 219, - EndLine: 219, - StartPos: 4506, - EndPos: 4507, + EndLine: 219, + StartPos: 4506, + EndPos: 4507, }, Val: &expr.Variable{ Position: &position.Position{ StartLine: 219, - EndLine: 219, - StartPos: 4506, - EndPos: 4507, + EndLine: 219, + StartPos: 4506, + EndPos: 4507, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 219, - EndLine: 219, - StartPos: 4506, - EndPos: 4507, + EndLine: 219, + StartPos: 4506, + EndPos: 4507, }, Value: "a", }, @@ -10288,16 +10372,16 @@ func TestPhp5(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 219, - EndLine: 219, - StartPos: 4513, - EndPos: 4514, + EndLine: 219, + StartPos: 4513, + EndPos: 4514, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 219, - EndLine: 219, - StartPos: 4513, - EndPos: 4514, + EndLine: 219, + StartPos: 4513, + EndPos: 4514, }, Value: "b", }, @@ -10307,30 +10391,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 221, - EndLine: 221, - StartPos: 4520, - EndPos: 4529, + EndLine: 221, + StartPos: 4520, + EndPos: 4529, }, Expr: &expr.MethodCall{ Position: &position.Position{ StartLine: 221, - EndLine: 221, - StartPos: 4520, - EndPos: 4528, + EndLine: 221, + StartPos: 4520, + EndPos: 4528, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 221, - EndLine: 221, - StartPos: 4520, - EndPos: 4521, + EndLine: 221, + StartPos: 4520, + EndPos: 4521, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 221, - EndLine: 221, - StartPos: 4520, - EndPos: 4521, + EndLine: 221, + StartPos: 4520, + EndPos: 4521, }, Value: "a", }, @@ -10338,18 +10422,18 @@ func TestPhp5(t *testing.T) { Method: &node.Identifier{ Position: &position.Position{ StartLine: 221, - EndLine: 221, - StartPos: 4524, - EndPos: 4526, + EndLine: 221, + StartPos: 4524, + EndPos: 4526, }, Value: "foo", }, ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 221, - EndLine: 221, - StartPos: 4527, - EndPos: 4528, + EndLine: 221, + StartPos: 4527, + EndPos: 4528, }, }, }, @@ -10357,31 +10441,31 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 222, - EndLine: 222, - StartPos: 4533, - EndPos: 4540, + EndLine: 222, + StartPos: 4533, + EndPos: 4540, }, Expr: &expr.New{ Position: &position.Position{ StartLine: 222, - EndLine: 222, - StartPos: 4533, - EndPos: 4539, + EndLine: 222, + StartPos: 4533, + EndPos: 4539, }, Class: &name.Name{ Position: &position.Position{ StartLine: 222, - EndLine: 222, - StartPos: 4537, - EndPos: 4539, + EndLine: 222, + StartPos: 4537, + EndPos: 4539, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 222, - EndLine: 222, - StartPos: 4537, - EndPos: 4539, + EndLine: 222, + StartPos: 4537, + EndPos: 4539, }, Value: "Foo", }, @@ -10392,31 +10476,31 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 223, - EndLine: 223, - StartPos: 4544, - EndPos: 4563, + EndLine: 223, + StartPos: 4544, + EndPos: 4563, }, Expr: &expr.New{ Position: &position.Position{ StartLine: 223, - EndLine: 223, - StartPos: 4544, - EndPos: 4562, + EndLine: 223, + StartPos: 4544, + EndPos: 4562, }, Class: &name.Relative{ Position: &position.Position{ StartLine: 223, - EndLine: 223, - StartPos: 4548, - EndPos: 4560, + EndLine: 223, + StartPos: 4548, + EndPos: 4560, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 223, - EndLine: 223, - StartPos: 4558, - EndPos: 4560, + EndLine: 223, + StartPos: 4558, + EndPos: 4560, }, Value: "Foo", }, @@ -10425,9 +10509,9 @@ func TestPhp5(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 223, - EndLine: 223, - StartPos: 4561, - EndPos: 4562, + EndLine: 223, + StartPos: 4561, + EndPos: 4562, }, }, }, @@ -10435,31 +10519,31 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 224, - EndLine: 224, - StartPos: 4567, - EndPos: 4577, + EndLine: 224, + StartPos: 4567, + EndPos: 4577, }, Expr: &expr.New{ Position: &position.Position{ StartLine: 224, - EndLine: 224, - StartPos: 4567, - EndPos: 4576, + EndLine: 224, + StartPos: 4567, + EndPos: 4576, }, Class: &name.FullyQualified{ Position: &position.Position{ StartLine: 224, - EndLine: 224, - StartPos: 4571, - EndPos: 4574, + EndLine: 224, + StartPos: 4571, + EndPos: 4574, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 224, - EndLine: 224, - StartPos: 4572, - EndPos: 4574, + EndLine: 224, + StartPos: 4572, + EndPos: 4574, }, Value: "Foo", }, @@ -10468,9 +10552,9 @@ func TestPhp5(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 224, - EndLine: 224, - StartPos: 4575, - EndPos: 4576, + EndLine: 224, + StartPos: 4575, + EndPos: 4576, }, }, }, @@ -10478,30 +10562,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 225, - EndLine: 225, - StartPos: 4581, - EndPos: 4590, + EndLine: 225, + StartPos: 4581, + EndPos: 4590, }, Expr: &expr.Print{ Position: &position.Position{ StartLine: 225, - EndLine: 225, - StartPos: 4581, - EndPos: 4588, + EndLine: 225, + StartPos: 4581, + EndPos: 4588, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 225, - EndLine: 225, - StartPos: 4587, - EndPos: 4588, + EndLine: 225, + StartPos: 4587, + EndPos: 4588, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 225, - EndLine: 225, - StartPos: 4587, - EndPos: 4588, + EndLine: 225, + StartPos: 4587, + EndPos: 4588, }, Value: "a", }, @@ -10511,30 +10595,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 226, - EndLine: 226, - StartPos: 4594, - EndPos: 4601, + EndLine: 226, + StartPos: 4594, + EndPos: 4601, }, Expr: &expr.PropertyFetch{ Position: &position.Position{ StartLine: 226, - EndLine: 226, - StartPos: 4594, - EndPos: 4600, + EndLine: 226, + StartPos: 4594, + EndPos: 4600, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 226, - EndLine: 226, - StartPos: 4594, - EndPos: 4595, + EndLine: 226, + StartPos: 4594, + EndPos: 4595, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 226, - EndLine: 226, - StartPos: 4594, - EndPos: 4595, + EndLine: 226, + StartPos: 4594, + EndPos: 4595, }, Value: "a", }, @@ -10542,9 +10626,9 @@ func TestPhp5(t *testing.T) { Property: &node.Identifier{ Position: &position.Position{ StartLine: 226, - EndLine: 226, - StartPos: 4598, - EndPos: 4600, + EndLine: 226, + StartPos: 4598, + EndPos: 4600, }, Value: "foo", }, @@ -10553,37 +10637,37 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 227, - EndLine: 227, - StartPos: 4605, - EndPos: 4615, + EndLine: 227, + StartPos: 4605, + EndPos: 4615, }, Expr: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 227, - EndLine: 227, - StartPos: 4605, - EndPos: 4613, + EndLine: 227, + StartPos: 4605, + EndPos: 4613, }, Variable: &expr.PropertyFetch{ Position: &position.Position{ StartLine: 227, - EndLine: 227, - StartPos: 4605, - EndPos: 4611, + EndLine: 227, + StartPos: 4605, + EndPos: 4611, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 227, - EndLine: 227, - StartPos: 4605, - EndPos: 4606, + EndLine: 227, + StartPos: 4605, + EndPos: 4606, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 227, - EndLine: 227, - StartPos: 4605, - EndPos: 4606, + EndLine: 227, + StartPos: 4605, + EndPos: 4606, }, Value: "a", }, @@ -10591,9 +10675,9 @@ func TestPhp5(t *testing.T) { Property: &node.Identifier{ Position: &position.Position{ StartLine: 227, - EndLine: 227, - StartPos: 4609, - EndPos: 4611, + EndLine: 227, + StartPos: 4609, + EndPos: 4611, }, Value: "foo", }, @@ -10601,9 +10685,9 @@ func TestPhp5(t *testing.T) { Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 227, - EndLine: 227, - StartPos: 4613, - EndPos: 4613, + EndLine: 227, + StartPos: 4613, + EndPos: 4613, }, Value: "1", }, @@ -10612,58 +10696,58 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 228, - EndLine: 228, - StartPos: 4619, - EndPos: 4647, + EndLine: 228, + StartPos: 4619, + EndPos: 4647, }, Expr: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 228, - EndLine: 228, - StartPos: 4619, - EndPos: 4645, + EndLine: 228, + StartPos: 4619, + EndPos: 4645, }, Variable: &expr.PropertyFetch{ Position: &position.Position{ StartLine: 228, - EndLine: 228, - StartPos: 4619, - EndPos: 4643, + EndLine: 228, + StartPos: 4619, + EndPos: 4643, }, Variable: &expr.MethodCall{ Position: &position.Position{ StartLine: 228, - EndLine: 228, - StartPos: 4619, - EndPos: 4637, + EndLine: 228, + StartPos: 4619, + EndPos: 4637, }, Variable: &expr.PropertyFetch{ Position: &position.Position{ StartLine: 228, - EndLine: 228, - StartPos: 4619, - EndPos: 4630, + EndLine: 228, + StartPos: 4619, + EndPos: 4630, }, Variable: &expr.PropertyFetch{ Position: &position.Position{ StartLine: 228, - EndLine: 228, - StartPos: 4619, - EndPos: 4625, + EndLine: 228, + StartPos: 4619, + EndPos: 4625, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 228, - EndLine: 228, - StartPos: 4619, - EndPos: 4620, + EndLine: 228, + StartPos: 4619, + EndPos: 4620, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 228, - EndLine: 228, - StartPos: 4619, - EndPos: 4620, + EndLine: 228, + StartPos: 4619, + EndPos: 4620, }, Value: "a", }, @@ -10671,9 +10755,9 @@ func TestPhp5(t *testing.T) { Property: &node.Identifier{ Position: &position.Position{ StartLine: 228, - EndLine: 228, - StartPos: 4623, - EndPos: 4625, + EndLine: 228, + StartPos: 4623, + EndPos: 4625, }, Value: "foo", }, @@ -10681,9 +10765,9 @@ func TestPhp5(t *testing.T) { Property: &node.Identifier{ Position: &position.Position{ StartLine: 228, - EndLine: 228, - StartPos: 4628, - EndPos: 4630, + EndLine: 228, + StartPos: 4628, + EndPos: 4630, }, Value: "bar", }, @@ -10691,27 +10775,27 @@ func TestPhp5(t *testing.T) { Method: &node.Identifier{ Position: &position.Position{ StartLine: 228, - EndLine: 228, - StartPos: 4633, - EndPos: 4635, + EndLine: 228, + StartPos: 4633, + EndPos: 4635, }, Value: "baz", }, ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 228, - EndLine: 228, - StartPos: 4636, - EndPos: 4637, + EndLine: 228, + StartPos: 4636, + EndPos: 4637, }, }, }, Property: &node.Identifier{ Position: &position.Position{ StartLine: 228, - EndLine: 228, - StartPos: 4640, - EndPos: 4643, + EndLine: 228, + StartPos: 4640, + EndPos: 4643, }, Value: "quux", }, @@ -10719,9 +10803,9 @@ func TestPhp5(t *testing.T) { Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 228, - EndLine: 228, - StartPos: 4645, - EndPos: 4645, + EndLine: 228, + StartPos: 4645, + EndPos: 4645, }, Value: "0", }, @@ -10730,44 +10814,44 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 229, - EndLine: 229, - StartPos: 4651, - EndPos: 4666, + EndLine: 229, + StartPos: 4651, + EndPos: 4666, }, Expr: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 229, - EndLine: 229, - StartPos: 4651, - EndPos: 4664, + EndLine: 229, + StartPos: 4651, + EndPos: 4664, }, Variable: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 229, - EndLine: 229, - StartPos: 4651, - EndPos: 4661, + EndLine: 229, + StartPos: 4651, + EndPos: 4661, }, Variable: &expr.MethodCall{ Position: &position.Position{ StartLine: 229, - EndLine: 229, - StartPos: 4651, - EndPos: 4659, + EndLine: 229, + StartPos: 4651, + EndPos: 4659, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 229, - EndLine: 229, - StartPos: 4651, - EndPos: 4652, + EndLine: 229, + StartPos: 4651, + EndPos: 4652, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 229, - EndLine: 229, - StartPos: 4651, - EndPos: 4652, + EndLine: 229, + StartPos: 4651, + EndPos: 4652, }, Value: "a", }, @@ -10775,27 +10859,27 @@ func TestPhp5(t *testing.T) { Method: &node.Identifier{ Position: &position.Position{ StartLine: 229, - EndLine: 229, - StartPos: 4655, - EndPos: 4657, + EndLine: 229, + StartPos: 4655, + EndPos: 4657, }, Value: "foo", }, ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 229, - EndLine: 229, - StartPos: 4658, - EndPos: 4659, + EndLine: 229, + StartPos: 4658, + EndPos: 4659, }, }, }, Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 229, - EndLine: 229, - StartPos: 4661, - EndPos: 4661, + EndLine: 229, + StartPos: 4661, + EndPos: 4661, }, Value: "1", }, @@ -10803,9 +10887,9 @@ func TestPhp5(t *testing.T) { Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 229, - EndLine: 229, - StartPos: 4664, - EndPos: 4664, + EndLine: 229, + StartPos: 4664, + EndPos: 4664, }, Value: "1", }, @@ -10814,40 +10898,40 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 230, - EndLine: 230, - StartPos: 4670, - EndPos: 4678, + EndLine: 230, + StartPos: 4670, + EndPos: 4678, }, Expr: &expr.ShellExec{ Position: &position.Position{ StartLine: 230, - EndLine: 230, - StartPos: 4670, - EndPos: 4677, + EndLine: 230, + StartPos: 4670, + EndPos: 4677, }, Parts: []node.Node{ &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 230, - EndLine: 230, - StartPos: 4671, - EndPos: 4674, + EndLine: 230, + StartPos: 4671, + EndPos: 4674, }, Value: "cmd ", }, &expr.Variable{ Position: &position.Position{ StartLine: 230, - EndLine: 230, - StartPos: 4675, - EndPos: 4676, + EndLine: 230, + StartPos: 4675, + EndPos: 4676, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 230, - EndLine: 230, - StartPos: 4675, - EndPos: 4676, + EndLine: 230, + StartPos: 4675, + EndPos: 4676, }, Value: "a", }, @@ -10858,16 +10942,16 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 231, - EndLine: 231, - StartPos: 4682, - EndPos: 4687, + EndLine: 231, + StartPos: 4682, + EndPos: 4687, }, Expr: &expr.ShellExec{ Position: &position.Position{ StartLine: 231, - EndLine: 231, - StartPos: 4682, - EndPos: 4686, + EndLine: 231, + StartPos: 4682, + EndPos: 4686, }, Parts: []node.Node{ &scalar.EncapsedStringPart{ @@ -10879,65 +10963,67 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 232, - EndLine: 232, - StartPos: 4691, - EndPos: 4693, + EndLine: 232, + StartPos: 4691, + EndPos: 4693, }, Expr: &expr.ShellExec{ Position: &position.Position{ StartLine: 232, - EndLine: 232, - StartPos: 4691, - EndPos: 4692, + EndLine: 232, + StartPos: 4691, + EndPos: 4692, + }, + Parts: []node.Node{ }, - Parts: []node.Node{}, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 233, - EndLine: 233, - StartPos: 4697, - EndPos: 4699, + EndLine: 233, + StartPos: 4697, + EndPos: 4699, }, Expr: &expr.ShortArray{ Position: &position.Position{ StartLine: 233, - EndLine: 233, - StartPos: 4697, - EndPos: 4698, + EndLine: 233, + StartPos: 4697, + EndPos: 4698, + }, + Items: []node.Node{ }, - Items: []node.Node{}, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 234, - EndLine: 234, - StartPos: 4703, - EndPos: 4706, + EndLine: 234, + StartPos: 4703, + EndPos: 4706, }, Expr: &expr.ShortArray{ Position: &position.Position{ StartLine: 234, - EndLine: 234, - StartPos: 4703, - EndPos: 4705, + EndLine: 234, + StartPos: 4703, + EndPos: 4705, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 234, - EndLine: 234, - StartPos: 4704, - EndPos: 4704, + EndLine: 234, + StartPos: 4704, + EndPos: 4704, }, Val: &scalar.Lnumber{ Position: &position.Position{ StartLine: 234, - EndLine: 234, - StartPos: 4704, - EndPos: 4704, + EndLine: 234, + StartPos: 4704, + EndPos: 4704, }, Value: "1", }, @@ -10948,40 +11034,40 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 235, - EndLine: 235, - StartPos: 4710, - EndPos: 4722, + EndLine: 235, + StartPos: 4710, + EndPos: 4722, }, Expr: &expr.ShortArray{ Position: &position.Position{ StartLine: 235, - EndLine: 235, - StartPos: 4710, - EndPos: 4721, + EndLine: 235, + StartPos: 4710, + EndPos: 4721, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 235, - EndLine: 235, - StartPos: 4711, - EndPos: 4714, + EndLine: 235, + StartPos: 4711, + EndPos: 4714, }, Key: &scalar.Lnumber{ Position: &position.Position{ StartLine: 235, - EndLine: 235, - StartPos: 4711, - EndPos: 4711, + EndLine: 235, + StartPos: 4711, + EndPos: 4711, }, Value: "1", }, Val: &scalar.Lnumber{ Position: &position.Position{ StartLine: 235, - EndLine: 235, - StartPos: 4714, - EndPos: 4714, + EndLine: 235, + StartPos: 4714, + EndPos: 4714, }, Value: "1", }, @@ -10989,68 +11075,69 @@ func TestPhp5(t *testing.T) { &expr.ArrayItem{ Position: &position.Position{ StartLine: 235, - EndLine: 235, - StartPos: 4717, - EndPos: 4719, + EndLine: 235, + StartPos: 4717, + EndPos: 4719, }, Val: &expr.Reference{ Position: &position.Position{ StartLine: 235, - EndLine: 235, - StartPos: 4717, - EndPos: 4719, + EndLine: 235, + StartPos: 4717, + EndPos: 4719, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 235, - EndLine: 235, - StartPos: 4718, - EndPos: 4719, + EndLine: 235, + StartPos: 4718, + EndPos: 4719, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 235, - EndLine: 235, - StartPos: 4718, - EndPos: 4719, + EndLine: 235, + StartPos: 4718, + EndPos: 4719, }, Value: "b", }, }, }, }, - &expr.ArrayItem{}, + &expr.ArrayItem{ + }, }, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 237, - EndLine: 237, - StartPos: 4727, - EndPos: 4737, + EndLine: 237, + StartPos: 4727, + EndPos: 4737, }, Expr: &expr.StaticCall{ Position: &position.Position{ StartLine: 237, - EndLine: 237, - StartPos: 4727, - EndPos: 4736, + EndLine: 237, + StartPos: 4727, + EndPos: 4736, }, Class: &name.Name{ Position: &position.Position{ StartLine: 237, - EndLine: 237, - StartPos: 4727, - EndPos: 4729, + EndLine: 237, + StartPos: 4727, + EndPos: 4729, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 237, - EndLine: 237, - StartPos: 4727, - EndPos: 4729, + EndLine: 237, + StartPos: 4727, + EndPos: 4729, }, Value: "Foo", }, @@ -11059,18 +11146,18 @@ func TestPhp5(t *testing.T) { Call: &node.Identifier{ Position: &position.Position{ StartLine: 237, - EndLine: 237, - StartPos: 4732, - EndPos: 4734, + EndLine: 237, + StartPos: 4732, + EndPos: 4734, }, Value: "bar", }, ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 237, - EndLine: 237, - StartPos: 4735, - EndPos: 4736, + EndLine: 237, + StartPos: 4735, + EndPos: 4736, }, }, }, @@ -11078,31 +11165,31 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 238, - EndLine: 238, - StartPos: 4741, - EndPos: 4761, + EndLine: 238, + StartPos: 4741, + EndPos: 4761, }, Expr: &expr.StaticCall{ Position: &position.Position{ StartLine: 238, - EndLine: 238, - StartPos: 4741, - EndPos: 4760, + EndLine: 238, + StartPos: 4741, + EndPos: 4760, }, Class: &name.Relative{ Position: &position.Position{ StartLine: 238, - EndLine: 238, - StartPos: 4741, - EndPos: 4753, + EndLine: 238, + StartPos: 4741, + EndPos: 4753, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 238, - EndLine: 238, - StartPos: 4751, - EndPos: 4753, + EndLine: 238, + StartPos: 4751, + EndPos: 4753, }, Value: "Foo", }, @@ -11111,18 +11198,18 @@ func TestPhp5(t *testing.T) { Call: &node.Identifier{ Position: &position.Position{ StartLine: 238, - EndLine: 238, - StartPos: 4756, - EndPos: 4758, + EndLine: 238, + StartPos: 4756, + EndPos: 4758, }, Value: "bar", }, ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 238, - EndLine: 238, - StartPos: 4759, - EndPos: 4760, + EndLine: 238, + StartPos: 4759, + EndPos: 4760, }, }, }, @@ -11130,31 +11217,31 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 239, - EndLine: 239, - StartPos: 4765, - EndPos: 4776, + EndLine: 239, + StartPos: 4765, + EndPos: 4776, }, Expr: &expr.StaticCall{ Position: &position.Position{ StartLine: 239, - EndLine: 239, - StartPos: 4765, - EndPos: 4775, + EndLine: 239, + StartPos: 4765, + EndPos: 4775, }, Class: &name.FullyQualified{ Position: &position.Position{ StartLine: 239, - EndLine: 239, - StartPos: 4765, - EndPos: 4768, + EndLine: 239, + StartPos: 4765, + EndPos: 4768, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 239, - EndLine: 239, - StartPos: 4766, - EndPos: 4768, + EndLine: 239, + StartPos: 4766, + EndPos: 4768, }, Value: "Foo", }, @@ -11163,18 +11250,18 @@ func TestPhp5(t *testing.T) { Call: &node.Identifier{ Position: &position.Position{ StartLine: 239, - EndLine: 239, - StartPos: 4771, - EndPos: 4773, + EndLine: 239, + StartPos: 4771, + EndPos: 4773, }, Value: "bar", }, ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 239, - EndLine: 239, - StartPos: 4774, - EndPos: 4775, + EndLine: 239, + StartPos: 4774, + EndPos: 4775, }, }, }, @@ -11182,31 +11269,31 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 240, - EndLine: 240, - StartPos: 4780, - EndPos: 4791, + EndLine: 240, + StartPos: 4780, + EndPos: 4791, }, Expr: &expr.StaticCall{ Position: &position.Position{ StartLine: 240, - EndLine: 240, - StartPos: 4780, - EndPos: 4790, + EndLine: 240, + StartPos: 4780, + EndPos: 4790, }, Class: &name.Name{ Position: &position.Position{ StartLine: 240, - EndLine: 240, - StartPos: 4780, - EndPos: 4782, + EndLine: 240, + StartPos: 4780, + EndPos: 4782, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 240, - EndLine: 240, - StartPos: 4780, - EndPos: 4782, + EndLine: 240, + StartPos: 4780, + EndPos: 4782, }, Value: "Foo", }, @@ -11215,16 +11302,16 @@ func TestPhp5(t *testing.T) { Call: &expr.Variable{ Position: &position.Position{ StartLine: 240, - EndLine: 240, - StartPos: 4785, - EndPos: 4788, + EndLine: 240, + StartPos: 4785, + EndPos: 4788, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 240, - EndLine: 240, - StartPos: 4785, - EndPos: 4788, + EndLine: 240, + StartPos: 4785, + EndPos: 4788, }, Value: "bar", }, @@ -11232,9 +11319,9 @@ func TestPhp5(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 240, - EndLine: 240, - StartPos: 4789, - EndPos: 4790, + EndLine: 240, + StartPos: 4789, + EndPos: 4790, }, }, }, @@ -11242,30 +11329,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 241, - EndLine: 241, - StartPos: 4795, - EndPos: 4807, + EndLine: 241, + StartPos: 4795, + EndPos: 4807, }, Expr: &expr.StaticCall{ Position: &position.Position{ StartLine: 241, - EndLine: 241, - StartPos: 4795, - EndPos: 4806, + EndLine: 241, + StartPos: 4795, + EndPos: 4806, }, Class: &expr.Variable{ Position: &position.Position{ StartLine: 241, - EndLine: 241, - StartPos: 4795, - EndPos: 4798, + EndLine: 241, + StartPos: 4795, + EndPos: 4798, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 241, - EndLine: 241, - StartPos: 4795, - EndPos: 4798, + EndLine: 241, + StartPos: 4795, + EndPos: 4798, }, Value: "foo", }, @@ -11273,16 +11360,16 @@ func TestPhp5(t *testing.T) { Call: &expr.Variable{ Position: &position.Position{ StartLine: 241, - EndLine: 241, - StartPos: 4801, - EndPos: 4804, + EndLine: 241, + StartPos: 4801, + EndPos: 4804, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 241, - EndLine: 241, - StartPos: 4801, - EndPos: 4804, + EndLine: 241, + StartPos: 4801, + EndPos: 4804, }, Value: "bar", }, @@ -11290,9 +11377,9 @@ func TestPhp5(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 241, - EndLine: 241, - StartPos: 4805, - EndPos: 4806, + EndLine: 241, + StartPos: 4805, + EndPos: 4806, }, }, }, @@ -11300,31 +11387,31 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 242, - EndLine: 242, - StartPos: 4811, - EndPos: 4820, + EndLine: 242, + StartPos: 4811, + EndPos: 4820, }, Expr: &expr.StaticPropertyFetch{ Position: &position.Position{ StartLine: 242, - EndLine: 242, - StartPos: 4811, - EndPos: 4819, + EndLine: 242, + StartPos: 4811, + EndPos: 4819, }, Class: &name.Name{ Position: &position.Position{ StartLine: 242, - EndLine: 242, - StartPos: 4811, - EndPos: 4813, + EndLine: 242, + StartPos: 4811, + EndPos: 4813, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 242, - EndLine: 242, - StartPos: 4811, - EndPos: 4813, + EndLine: 242, + StartPos: 4811, + EndPos: 4813, }, Value: "Foo", }, @@ -11333,16 +11420,16 @@ func TestPhp5(t *testing.T) { Property: &expr.Variable{ Position: &position.Position{ StartLine: 242, - EndLine: 242, - StartPos: 4816, - EndPos: 4819, + EndLine: 242, + StartPos: 4816, + EndPos: 4819, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 242, - EndLine: 242, - StartPos: 4816, - EndPos: 4819, + EndLine: 242, + StartPos: 4816, + EndPos: 4819, }, Value: "bar", }, @@ -11352,31 +11439,31 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 243, - EndLine: 243, - StartPos: 4824, - EndPos: 4843, + EndLine: 243, + StartPos: 4824, + EndPos: 4843, }, Expr: &expr.StaticPropertyFetch{ Position: &position.Position{ StartLine: 243, - EndLine: 243, - StartPos: 4824, - EndPos: 4842, + EndLine: 243, + StartPos: 4824, + EndPos: 4842, }, Class: &name.Relative{ Position: &position.Position{ StartLine: 243, - EndLine: 243, - StartPos: 4824, - EndPos: 4836, + EndLine: 243, + StartPos: 4824, + EndPos: 4836, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 243, - EndLine: 243, - StartPos: 4834, - EndPos: 4836, + EndLine: 243, + StartPos: 4834, + EndPos: 4836, }, Value: "Foo", }, @@ -11385,16 +11472,16 @@ func TestPhp5(t *testing.T) { Property: &expr.Variable{ Position: &position.Position{ StartLine: 243, - EndLine: 243, - StartPos: 4839, - EndPos: 4842, + EndLine: 243, + StartPos: 4839, + EndPos: 4842, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 243, - EndLine: 243, - StartPos: 4839, - EndPos: 4842, + EndLine: 243, + StartPos: 4839, + EndPos: 4842, }, Value: "bar", }, @@ -11404,31 +11491,31 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 244, - EndLine: 244, - StartPos: 4847, - EndPos: 4857, + EndLine: 244, + StartPos: 4847, + EndPos: 4857, }, Expr: &expr.StaticPropertyFetch{ Position: &position.Position{ StartLine: 244, - EndLine: 244, - StartPos: 4847, - EndPos: 4856, + EndLine: 244, + StartPos: 4847, + EndPos: 4856, }, Class: &name.FullyQualified{ Position: &position.Position{ StartLine: 244, - EndLine: 244, - StartPos: 4847, - EndPos: 4850, + EndLine: 244, + StartPos: 4847, + EndPos: 4850, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 244, - EndLine: 244, - StartPos: 4848, - EndPos: 4850, + EndLine: 244, + StartPos: 4848, + EndPos: 4850, }, Value: "Foo", }, @@ -11437,16 +11524,16 @@ func TestPhp5(t *testing.T) { Property: &expr.Variable{ Position: &position.Position{ StartLine: 244, - EndLine: 244, - StartPos: 4853, - EndPos: 4856, + EndLine: 244, + StartPos: 4853, + EndPos: 4856, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 244, - EndLine: 244, - StartPos: 4853, - EndPos: 4856, + EndLine: 244, + StartPos: 4853, + EndPos: 4856, }, Value: "bar", }, @@ -11456,30 +11543,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 245, - EndLine: 245, - StartPos: 4861, - EndPos: 4873, + EndLine: 245, + StartPos: 4861, + EndPos: 4873, }, Expr: &expr.Ternary{ Position: &position.Position{ StartLine: 245, - EndLine: 245, - StartPos: 4861, - EndPos: 4872, + EndLine: 245, + StartPos: 4861, + EndPos: 4872, }, Condition: &expr.Variable{ Position: &position.Position{ StartLine: 245, - EndLine: 245, - StartPos: 4861, - EndPos: 4862, + EndLine: 245, + StartPos: 4861, + EndPos: 4862, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 245, - EndLine: 245, - StartPos: 4861, - EndPos: 4862, + EndLine: 245, + StartPos: 4861, + EndPos: 4862, }, Value: "a", }, @@ -11487,16 +11574,16 @@ func TestPhp5(t *testing.T) { IfTrue: &expr.Variable{ Position: &position.Position{ StartLine: 245, - EndLine: 245, - StartPos: 4866, - EndPos: 4867, + EndLine: 245, + StartPos: 4866, + EndPos: 4867, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 245, - EndLine: 245, - StartPos: 4866, - EndPos: 4867, + EndLine: 245, + StartPos: 4866, + EndPos: 4867, }, Value: "b", }, @@ -11504,16 +11591,16 @@ func TestPhp5(t *testing.T) { IfFalse: &expr.Variable{ Position: &position.Position{ StartLine: 245, - EndLine: 245, - StartPos: 4871, - EndPos: 4872, + EndLine: 245, + StartPos: 4871, + EndPos: 4872, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 245, - EndLine: 245, - StartPos: 4871, - EndPos: 4872, + EndLine: 245, + StartPos: 4871, + EndPos: 4872, }, Value: "c", }, @@ -11523,30 +11610,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 246, - EndLine: 246, - StartPos: 4877, - EndPos: 4886, + EndLine: 246, + StartPos: 4877, + EndPos: 4886, }, Expr: &expr.Ternary{ Position: &position.Position{ StartLine: 246, - EndLine: 246, - StartPos: 4877, - EndPos: 4885, + EndLine: 246, + StartPos: 4877, + EndPos: 4885, }, Condition: &expr.Variable{ Position: &position.Position{ StartLine: 246, - EndLine: 246, - StartPos: 4877, - EndPos: 4878, + EndLine: 246, + StartPos: 4877, + EndPos: 4878, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 246, - EndLine: 246, - StartPos: 4877, - EndPos: 4878, + EndLine: 246, + StartPos: 4877, + EndPos: 4878, }, Value: "a", }, @@ -11554,16 +11641,16 @@ func TestPhp5(t *testing.T) { IfFalse: &expr.Variable{ Position: &position.Position{ StartLine: 246, - EndLine: 246, - StartPos: 4884, - EndPos: 4885, + EndLine: 246, + StartPos: 4884, + EndPos: 4885, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 246, - EndLine: 246, - StartPos: 4884, - EndPos: 4885, + EndLine: 246, + StartPos: 4884, + EndPos: 4885, }, Value: "c", }, @@ -11573,30 +11660,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 247, - EndLine: 247, - StartPos: 4890, - EndPos: 4912, + EndLine: 247, + StartPos: 4890, + EndPos: 4912, }, Expr: &expr.Ternary{ Position: &position.Position{ StartLine: 247, - EndLine: 247, - StartPos: 4890, - EndPos: 4911, + EndLine: 247, + StartPos: 4890, + EndPos: 4911, }, Condition: &expr.Variable{ Position: &position.Position{ StartLine: 247, - EndLine: 247, - StartPos: 4890, - EndPos: 4891, + EndLine: 247, + StartPos: 4890, + EndPos: 4891, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 247, - EndLine: 247, - StartPos: 4890, - EndPos: 4891, + EndLine: 247, + StartPos: 4890, + EndPos: 4891, }, Value: "a", }, @@ -11604,23 +11691,23 @@ func TestPhp5(t *testing.T) { IfTrue: &expr.Ternary{ Position: &position.Position{ StartLine: 247, - EndLine: 247, - StartPos: 4895, - EndPos: 4906, + EndLine: 247, + StartPos: 4895, + EndPos: 4906, }, Condition: &expr.Variable{ Position: &position.Position{ StartLine: 247, - EndLine: 247, - StartPos: 4895, - EndPos: 4896, + EndLine: 247, + StartPos: 4895, + EndPos: 4896, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 247, - EndLine: 247, - StartPos: 4895, - EndPos: 4896, + EndLine: 247, + StartPos: 4895, + EndPos: 4896, }, Value: "b", }, @@ -11628,16 +11715,16 @@ func TestPhp5(t *testing.T) { IfTrue: &expr.Variable{ Position: &position.Position{ StartLine: 247, - EndLine: 247, - StartPos: 4900, - EndPos: 4901, + EndLine: 247, + StartPos: 4900, + EndPos: 4901, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 247, - EndLine: 247, - StartPos: 4900, - EndPos: 4901, + EndLine: 247, + StartPos: 4900, + EndPos: 4901, }, Value: "c", }, @@ -11645,16 +11732,16 @@ func TestPhp5(t *testing.T) { IfFalse: &expr.Variable{ Position: &position.Position{ StartLine: 247, - EndLine: 247, - StartPos: 4905, - EndPos: 4906, + EndLine: 247, + StartPos: 4905, + EndPos: 4906, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 247, - EndLine: 247, - StartPos: 4905, - EndPos: 4906, + EndLine: 247, + StartPos: 4905, + EndPos: 4906, }, Value: "d", }, @@ -11663,16 +11750,16 @@ func TestPhp5(t *testing.T) { IfFalse: &expr.Variable{ Position: &position.Position{ StartLine: 247, - EndLine: 247, - StartPos: 4910, - EndPos: 4911, + EndLine: 247, + StartPos: 4910, + EndPos: 4911, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 247, - EndLine: 247, - StartPos: 4910, - EndPos: 4911, + EndLine: 247, + StartPos: 4910, + EndPos: 4911, }, Value: "e", }, @@ -11682,37 +11769,37 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 248, - EndLine: 248, - StartPos: 4916, - EndPos: 4938, + EndLine: 248, + StartPos: 4916, + EndPos: 4938, }, Expr: &expr.Ternary{ Position: &position.Position{ StartLine: 248, - EndLine: 248, - StartPos: 4916, - EndPos: 4937, + EndLine: 248, + StartPos: 4916, + EndPos: 4937, }, Condition: &expr.Ternary{ Position: &position.Position{ StartLine: 248, - EndLine: 248, - StartPos: 4916, - EndPos: 4927, + EndLine: 248, + StartPos: 4916, + EndPos: 4927, }, Condition: &expr.Variable{ Position: &position.Position{ StartLine: 248, - EndLine: 248, - StartPos: 4916, - EndPos: 4917, + EndLine: 248, + StartPos: 4916, + EndPos: 4917, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 248, - EndLine: 248, - StartPos: 4916, - EndPos: 4917, + EndLine: 248, + StartPos: 4916, + EndPos: 4917, }, Value: "a", }, @@ -11720,16 +11807,16 @@ func TestPhp5(t *testing.T) { IfTrue: &expr.Variable{ Position: &position.Position{ StartLine: 248, - EndLine: 248, - StartPos: 4921, - EndPos: 4922, + EndLine: 248, + StartPos: 4921, + EndPos: 4922, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 248, - EndLine: 248, - StartPos: 4921, - EndPos: 4922, + EndLine: 248, + StartPos: 4921, + EndPos: 4922, }, Value: "b", }, @@ -11737,16 +11824,16 @@ func TestPhp5(t *testing.T) { IfFalse: &expr.Variable{ Position: &position.Position{ StartLine: 248, - EndLine: 248, - StartPos: 4926, - EndPos: 4927, + EndLine: 248, + StartPos: 4926, + EndPos: 4927, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 248, - EndLine: 248, - StartPos: 4926, - EndPos: 4927, + EndLine: 248, + StartPos: 4926, + EndPos: 4927, }, Value: "c", }, @@ -11755,16 +11842,16 @@ func TestPhp5(t *testing.T) { IfTrue: &expr.Variable{ Position: &position.Position{ StartLine: 248, - EndLine: 248, - StartPos: 4931, - EndPos: 4932, + EndLine: 248, + StartPos: 4931, + EndPos: 4932, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 248, - EndLine: 248, - StartPos: 4931, - EndPos: 4932, + EndLine: 248, + StartPos: 4931, + EndPos: 4932, }, Value: "d", }, @@ -11772,16 +11859,16 @@ func TestPhp5(t *testing.T) { IfFalse: &expr.Variable{ Position: &position.Position{ StartLine: 248, - EndLine: 248, - StartPos: 4936, - EndPos: 4937, + EndLine: 248, + StartPos: 4936, + EndPos: 4937, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 248, - EndLine: 248, - StartPos: 4936, - EndPos: 4937, + EndLine: 248, + StartPos: 4936, + EndPos: 4937, }, Value: "e", }, @@ -11791,30 +11878,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 249, - EndLine: 249, - StartPos: 4942, - EndPos: 4945, + EndLine: 249, + StartPos: 4942, + EndPos: 4945, }, Expr: &expr.UnaryMinus{ Position: &position.Position{ StartLine: 249, - EndLine: 249, - StartPos: 4942, - EndPos: 4944, + EndLine: 249, + StartPos: 4942, + EndPos: 4944, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 249, - EndLine: 249, - StartPos: 4943, - EndPos: 4944, + EndLine: 249, + StartPos: 4943, + EndPos: 4944, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 249, - EndLine: 249, - StartPos: 4943, - EndPos: 4944, + EndLine: 249, + StartPos: 4943, + EndPos: 4944, }, Value: "a", }, @@ -11824,30 +11911,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 250, - EndLine: 250, - StartPos: 4949, - EndPos: 4952, + EndLine: 250, + StartPos: 4949, + EndPos: 4952, }, Expr: &expr.UnaryPlus{ Position: &position.Position{ StartLine: 250, - EndLine: 250, - StartPos: 4949, - EndPos: 4951, + EndLine: 250, + StartPos: 4949, + EndPos: 4951, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 250, - EndLine: 250, - StartPos: 4950, - EndPos: 4951, + EndLine: 250, + StartPos: 4950, + EndPos: 4951, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 250, - EndLine: 250, - StartPos: 4950, - EndPos: 4951, + EndLine: 250, + StartPos: 4950, + EndPos: 4951, }, Value: "a", }, @@ -11857,30 +11944,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 251, - EndLine: 251, - StartPos: 4956, - EndPos: 4959, + EndLine: 251, + StartPos: 4956, + EndPos: 4959, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 251, - EndLine: 251, - StartPos: 4956, - EndPos: 4958, + EndLine: 251, + StartPos: 4956, + EndPos: 4958, }, VarName: &expr.Variable{ Position: &position.Position{ StartLine: 251, - EndLine: 251, - StartPos: 4957, - EndPos: 4958, + EndLine: 251, + StartPos: 4957, + EndPos: 4958, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 251, - EndLine: 251, - StartPos: 4957, - EndPos: 4958, + EndLine: 251, + StartPos: 4957, + EndPos: 4958, }, Value: "a", }, @@ -11890,37 +11977,37 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 252, - EndLine: 252, - StartPos: 4963, - EndPos: 4967, + EndLine: 252, + StartPos: 4963, + EndPos: 4967, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 252, - EndLine: 252, - StartPos: 4963, - EndPos: 4966, + EndLine: 252, + StartPos: 4963, + EndPos: 4966, }, VarName: &expr.Variable{ Position: &position.Position{ StartLine: 252, - EndLine: 252, - StartPos: 4964, - EndPos: 4966, + EndLine: 252, + StartPos: 4964, + EndPos: 4966, }, VarName: &expr.Variable{ Position: &position.Position{ StartLine: 252, - EndLine: 252, - StartPos: 4965, - EndPos: 4966, + EndLine: 252, + StartPos: 4965, + EndPos: 4966, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 252, - EndLine: 252, - StartPos: 4965, - EndPos: 4966, + EndLine: 252, + StartPos: 4965, + EndPos: 4966, }, Value: "a", }, @@ -11931,46 +12018,46 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 253, - EndLine: 253, - StartPos: 4971, - EndPos: 4976, + EndLine: 253, + StartPos: 4971, + EndPos: 4976, }, Expr: &expr.Yield{ Position: &position.Position{ StartLine: 253, - EndLine: 253, - StartPos: 4971, - EndPos: 4975, + EndLine: 253, + StartPos: 4971, + EndPos: 4975, }, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 254, - EndLine: 254, - StartPos: 4980, - EndPos: 4988, + EndLine: 254, + StartPos: 4980, + EndPos: 4988, }, Expr: &expr.Yield{ Position: &position.Position{ StartLine: 254, - EndLine: 254, - StartPos: 4980, - EndPos: 4987, + EndLine: 254, + StartPos: 4980, + EndPos: 4987, }, Value: &expr.Variable{ Position: &position.Position{ StartLine: 254, - EndLine: 254, - StartPos: 4986, - EndPos: 4987, + EndLine: 254, + StartPos: 4986, + EndPos: 4987, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 254, - EndLine: 254, - StartPos: 4986, - EndPos: 4987, + EndLine: 254, + StartPos: 4986, + EndPos: 4987, }, Value: "a", }, @@ -11980,30 +12067,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 255, - EndLine: 255, - StartPos: 4992, - EndPos: 5006, + EndLine: 255, + StartPos: 4992, + EndPos: 5006, }, Expr: &expr.Yield{ Position: &position.Position{ StartLine: 255, - EndLine: 255, - StartPos: 4992, - EndPos: 5005, + EndLine: 255, + StartPos: 4992, + EndPos: 5005, }, Key: &expr.Variable{ Position: &position.Position{ StartLine: 255, - EndLine: 255, - StartPos: 4998, - EndPos: 4999, + EndLine: 255, + StartPos: 4998, + EndPos: 4999, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 255, - EndLine: 255, - StartPos: 4998, - EndPos: 4999, + EndLine: 255, + StartPos: 4998, + EndPos: 4999, }, Value: "a", }, @@ -12011,16 +12098,16 @@ func TestPhp5(t *testing.T) { Value: &expr.Variable{ Position: &position.Position{ StartLine: 255, - EndLine: 255, - StartPos: 5004, - EndPos: 5005, + EndLine: 255, + StartPos: 5004, + EndPos: 5005, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 255, - EndLine: 255, - StartPos: 5004, - EndPos: 5005, + EndLine: 255, + StartPos: 5004, + EndPos: 5005, }, Value: "b", }, @@ -12030,38 +12117,38 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 256, - EndLine: 256, - StartPos: 5010, - EndPos: 5026, + EndLine: 256, + StartPos: 5010, + EndPos: 5026, }, Expr: &expr.Yield{ Position: &position.Position{ StartLine: 256, - EndLine: 256, - StartPos: 5010, - EndPos: 5025, + EndLine: 256, + StartPos: 5010, + EndPos: 5025, }, Value: &expr.ClassConstFetch{ Position: &position.Position{ StartLine: 256, - EndLine: 256, - StartPos: 5016, - EndPos: 5025, + EndLine: 256, + StartPos: 5016, + EndPos: 5025, }, Class: &name.Name{ Position: &position.Position{ StartLine: 256, - EndLine: 256, - StartPos: 5016, - EndPos: 5018, + EndLine: 256, + StartPos: 5016, + EndPos: 5018, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 256, - EndLine: 256, - StartPos: 5016, - EndPos: 5018, + EndLine: 256, + StartPos: 5016, + EndPos: 5018, }, Value: "Foo", }, @@ -12070,9 +12157,9 @@ func TestPhp5(t *testing.T) { ConstantName: &node.Identifier{ Position: &position.Position{ StartLine: 256, - EndLine: 256, - StartPos: 5021, - EndPos: 5025, + EndLine: 256, + StartPos: 5021, + EndPos: 5025, }, Value: "class", }, @@ -12082,30 +12169,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 257, - EndLine: 257, - StartPos: 5030, - EndPos: 5052, + EndLine: 257, + StartPos: 5030, + EndPos: 5052, }, Expr: &expr.Yield{ Position: &position.Position{ StartLine: 257, - EndLine: 257, - StartPos: 5030, - EndPos: 5051, + EndLine: 257, + StartPos: 5030, + EndPos: 5051, }, Key: &expr.Variable{ Position: &position.Position{ StartLine: 257, - EndLine: 257, - StartPos: 5036, - EndPos: 5037, + EndLine: 257, + StartPos: 5036, + EndPos: 5037, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 257, - EndLine: 257, - StartPos: 5036, - EndPos: 5037, + EndLine: 257, + StartPos: 5036, + EndPos: 5037, }, Value: "a", }, @@ -12113,24 +12200,24 @@ func TestPhp5(t *testing.T) { Value: &expr.ClassConstFetch{ Position: &position.Position{ StartLine: 257, - EndLine: 257, - StartPos: 5042, - EndPos: 5051, + EndLine: 257, + StartPos: 5042, + EndPos: 5051, }, Class: &name.Name{ Position: &position.Position{ StartLine: 257, - EndLine: 257, - StartPos: 5042, - EndPos: 5044, + EndLine: 257, + StartPos: 5042, + EndPos: 5044, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 257, - EndLine: 257, - StartPos: 5042, - EndPos: 5044, + EndLine: 257, + StartPos: 5042, + EndPos: 5044, }, Value: "Foo", }, @@ -12139,9 +12226,9 @@ func TestPhp5(t *testing.T) { ConstantName: &node.Identifier{ Position: &position.Position{ StartLine: 257, - EndLine: 257, - StartPos: 5047, - EndPos: 5051, + EndLine: 257, + StartPos: 5047, + EndPos: 5051, }, Value: "class", }, @@ -12151,30 +12238,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 259, - EndLine: 259, - StartPos: 5059, - EndPos: 5068, + EndLine: 259, + StartPos: 5059, + EndPos: 5068, }, Expr: &cast.Array{ Position: &position.Position{ StartLine: 259, - EndLine: 259, - StartPos: 5059, - EndPos: 5067, + EndLine: 259, + StartPos: 5059, + EndPos: 5067, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 259, - EndLine: 259, - StartPos: 5066, - EndPos: 5067, + EndLine: 259, + StartPos: 5066, + EndPos: 5067, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 259, - EndLine: 259, - StartPos: 5066, - EndPos: 5067, + EndLine: 259, + StartPos: 5066, + EndPos: 5067, }, Value: "a", }, @@ -12184,30 +12271,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 260, - EndLine: 260, - StartPos: 5072, - EndPos: 5083, + EndLine: 260, + StartPos: 5072, + EndPos: 5083, }, Expr: &cast.Bool{ Position: &position.Position{ StartLine: 260, - EndLine: 260, - StartPos: 5072, - EndPos: 5082, + EndLine: 260, + StartPos: 5072, + EndPos: 5082, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 260, - EndLine: 260, - StartPos: 5081, - EndPos: 5082, + EndLine: 260, + StartPos: 5081, + EndPos: 5082, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 260, - EndLine: 260, - StartPos: 5081, - EndPos: 5082, + EndLine: 260, + StartPos: 5081, + EndPos: 5082, }, Value: "a", }, @@ -12217,30 +12304,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 261, - EndLine: 261, - StartPos: 5087, - EndPos: 5095, + EndLine: 261, + StartPos: 5087, + EndPos: 5095, }, Expr: &cast.Bool{ Position: &position.Position{ StartLine: 261, - EndLine: 261, - StartPos: 5087, - EndPos: 5094, + EndLine: 261, + StartPos: 5087, + EndPos: 5094, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 261, - EndLine: 261, - StartPos: 5093, - EndPos: 5094, + EndLine: 261, + StartPos: 5093, + EndPos: 5094, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 261, - EndLine: 261, - StartPos: 5093, - EndPos: 5094, + EndLine: 261, + StartPos: 5093, + EndPos: 5094, }, Value: "a", }, @@ -12250,30 +12337,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 262, - EndLine: 262, - StartPos: 5099, - EndPos: 5109, + EndLine: 262, + StartPos: 5099, + EndPos: 5109, }, Expr: &cast.Double{ Position: &position.Position{ StartLine: 262, - EndLine: 262, - StartPos: 5099, - EndPos: 5108, + EndLine: 262, + StartPos: 5099, + EndPos: 5108, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 262, - EndLine: 262, - StartPos: 5107, - EndPos: 5108, + EndLine: 262, + StartPos: 5107, + EndPos: 5108, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 262, - EndLine: 262, - StartPos: 5107, - EndPos: 5108, + EndLine: 262, + StartPos: 5107, + EndPos: 5108, }, Value: "a", }, @@ -12283,30 +12370,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 263, - EndLine: 263, - StartPos: 5113, - EndPos: 5122, + EndLine: 263, + StartPos: 5113, + EndPos: 5122, }, Expr: &cast.Double{ Position: &position.Position{ StartLine: 263, - EndLine: 263, - StartPos: 5113, - EndPos: 5121, + EndLine: 263, + StartPos: 5113, + EndPos: 5121, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 263, - EndLine: 263, - StartPos: 5120, - EndPos: 5121, + EndLine: 263, + StartPos: 5120, + EndPos: 5121, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 263, - EndLine: 263, - StartPos: 5120, - EndPos: 5121, + EndLine: 263, + StartPos: 5120, + EndPos: 5121, }, Value: "a", }, @@ -12316,30 +12403,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 264, - EndLine: 264, - StartPos: 5126, - EndPos: 5137, + EndLine: 264, + StartPos: 5126, + EndPos: 5137, }, Expr: &cast.Int{ Position: &position.Position{ StartLine: 264, - EndLine: 264, - StartPos: 5126, - EndPos: 5136, + EndLine: 264, + StartPos: 5126, + EndPos: 5136, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 264, - EndLine: 264, - StartPos: 5135, - EndPos: 5136, + EndLine: 264, + StartPos: 5135, + EndPos: 5136, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 264, - EndLine: 264, - StartPos: 5135, - EndPos: 5136, + EndLine: 264, + StartPos: 5135, + EndPos: 5136, }, Value: "a", }, @@ -12349,30 +12436,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 265, - EndLine: 265, - StartPos: 5141, - EndPos: 5148, + EndLine: 265, + StartPos: 5141, + EndPos: 5148, }, Expr: &cast.Int{ Position: &position.Position{ StartLine: 265, - EndLine: 265, - StartPos: 5141, - EndPos: 5147, + EndLine: 265, + StartPos: 5141, + EndPos: 5147, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 265, - EndLine: 265, - StartPos: 5146, - EndPos: 5147, + EndLine: 265, + StartPos: 5146, + EndPos: 5147, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 265, - EndLine: 265, - StartPos: 5146, - EndPos: 5147, + EndLine: 265, + StartPos: 5146, + EndPos: 5147, }, Value: "a", }, @@ -12382,30 +12469,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 266, - EndLine: 266, - StartPos: 5152, - EndPos: 5162, + EndLine: 266, + StartPos: 5152, + EndPos: 5162, }, Expr: &cast.Object{ Position: &position.Position{ StartLine: 266, - EndLine: 266, - StartPos: 5152, - EndPos: 5161, + EndLine: 266, + StartPos: 5152, + EndPos: 5161, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 266, - EndLine: 266, - StartPos: 5160, - EndPos: 5161, + EndLine: 266, + StartPos: 5160, + EndPos: 5161, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 266, - EndLine: 266, - StartPos: 5160, - EndPos: 5161, + EndLine: 266, + StartPos: 5160, + EndPos: 5161, }, Value: "a", }, @@ -12415,30 +12502,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 267, - EndLine: 267, - StartPos: 5166, - EndPos: 5176, + EndLine: 267, + StartPos: 5166, + EndPos: 5176, }, Expr: &cast.String{ Position: &position.Position{ StartLine: 267, - EndLine: 267, - StartPos: 5166, - EndPos: 5175, + EndLine: 267, + StartPos: 5166, + EndPos: 5175, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 267, - EndLine: 267, - StartPos: 5174, - EndPos: 5175, + EndLine: 267, + StartPos: 5174, + EndPos: 5175, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 267, - EndLine: 267, - StartPos: 5174, - EndPos: 5175, + EndLine: 267, + StartPos: 5174, + EndPos: 5175, }, Value: "a", }, @@ -12448,30 +12535,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 268, - EndLine: 268, - StartPos: 5180, - EndPos: 5189, + EndLine: 268, + StartPos: 5180, + EndPos: 5189, }, Expr: &cast.Unset{ Position: &position.Position{ StartLine: 268, - EndLine: 268, - StartPos: 5180, - EndPos: 5188, + EndLine: 268, + StartPos: 5180, + EndPos: 5188, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 268, - EndLine: 268, - StartPos: 5187, - EndPos: 5188, + EndLine: 268, + StartPos: 5187, + EndPos: 5188, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 268, - EndLine: 268, - StartPos: 5187, - EndPos: 5188, + EndLine: 268, + StartPos: 5187, + EndPos: 5188, }, Value: "a", }, @@ -12481,30 +12568,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 270, - EndLine: 270, - StartPos: 5194, - EndPos: 5201, + EndLine: 270, + StartPos: 5194, + EndPos: 5201, }, Expr: &binary.BitwiseAnd{ Position: &position.Position{ StartLine: 270, - EndLine: 270, - StartPos: 5194, - EndPos: 5200, + EndLine: 270, + StartPos: 5194, + EndPos: 5200, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 270, - EndLine: 270, - StartPos: 5194, - EndPos: 5195, + EndLine: 270, + StartPos: 5194, + EndPos: 5195, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 270, - EndLine: 270, - StartPos: 5194, - EndPos: 5195, + EndLine: 270, + StartPos: 5194, + EndPos: 5195, }, Value: "a", }, @@ -12512,16 +12599,16 @@ func TestPhp5(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 270, - EndLine: 270, - StartPos: 5199, - EndPos: 5200, + EndLine: 270, + StartPos: 5199, + EndPos: 5200, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 270, - EndLine: 270, - StartPos: 5199, - EndPos: 5200, + EndLine: 270, + StartPos: 5199, + EndPos: 5200, }, Value: "b", }, @@ -12531,30 +12618,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 271, - EndLine: 271, - StartPos: 5205, - EndPos: 5212, + EndLine: 271, + StartPos: 5205, + EndPos: 5212, }, Expr: &binary.BitwiseOr{ Position: &position.Position{ StartLine: 271, - EndLine: 271, - StartPos: 5205, - EndPos: 5211, + EndLine: 271, + StartPos: 5205, + EndPos: 5211, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 271, - EndLine: 271, - StartPos: 5205, - EndPos: 5206, + EndLine: 271, + StartPos: 5205, + EndPos: 5206, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 271, - EndLine: 271, - StartPos: 5205, - EndPos: 5206, + EndLine: 271, + StartPos: 5205, + EndPos: 5206, }, Value: "a", }, @@ -12562,16 +12649,16 @@ func TestPhp5(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 271, - EndLine: 271, - StartPos: 5210, - EndPos: 5211, + EndLine: 271, + StartPos: 5210, + EndPos: 5211, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 271, - EndLine: 271, - StartPos: 5210, - EndPos: 5211, + EndLine: 271, + StartPos: 5210, + EndPos: 5211, }, Value: "b", }, @@ -12581,30 +12668,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 272, - EndLine: 272, - StartPos: 5216, - EndPos: 5223, + EndLine: 272, + StartPos: 5216, + EndPos: 5223, }, Expr: &binary.BitwiseXor{ Position: &position.Position{ StartLine: 272, - EndLine: 272, - StartPos: 5216, - EndPos: 5222, + EndLine: 272, + StartPos: 5216, + EndPos: 5222, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 272, - EndLine: 272, - StartPos: 5216, - EndPos: 5217, + EndLine: 272, + StartPos: 5216, + EndPos: 5217, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 272, - EndLine: 272, - StartPos: 5216, - EndPos: 5217, + EndLine: 272, + StartPos: 5216, + EndPos: 5217, }, Value: "a", }, @@ -12612,16 +12699,16 @@ func TestPhp5(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 272, - EndLine: 272, - StartPos: 5221, - EndPos: 5222, + EndLine: 272, + StartPos: 5221, + EndPos: 5222, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 272, - EndLine: 272, - StartPos: 5221, - EndPos: 5222, + EndLine: 272, + StartPos: 5221, + EndPos: 5222, }, Value: "b", }, @@ -12631,30 +12718,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 273, - EndLine: 273, - StartPos: 5227, - EndPos: 5235, + EndLine: 273, + StartPos: 5227, + EndPos: 5235, }, Expr: &binary.BooleanAnd{ Position: &position.Position{ StartLine: 273, - EndLine: 273, - StartPos: 5227, - EndPos: 5234, + EndLine: 273, + StartPos: 5227, + EndPos: 5234, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 273, - EndLine: 273, - StartPos: 5227, - EndPos: 5228, + EndLine: 273, + StartPos: 5227, + EndPos: 5228, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 273, - EndLine: 273, - StartPos: 5227, - EndPos: 5228, + EndLine: 273, + StartPos: 5227, + EndPos: 5228, }, Value: "a", }, @@ -12662,16 +12749,16 @@ func TestPhp5(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 273, - EndLine: 273, - StartPos: 5233, - EndPos: 5234, + EndLine: 273, + StartPos: 5233, + EndPos: 5234, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 273, - EndLine: 273, - StartPos: 5233, - EndPos: 5234, + EndLine: 273, + StartPos: 5233, + EndPos: 5234, }, Value: "b", }, @@ -12681,30 +12768,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 274, - EndLine: 274, - StartPos: 5239, - EndPos: 5247, + EndLine: 274, + StartPos: 5239, + EndPos: 5247, }, Expr: &binary.BooleanOr{ Position: &position.Position{ StartLine: 274, - EndLine: 274, - StartPos: 5239, - EndPos: 5246, + EndLine: 274, + StartPos: 5239, + EndPos: 5246, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 274, - EndLine: 274, - StartPos: 5239, - EndPos: 5240, + EndLine: 274, + StartPos: 5239, + EndPos: 5240, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 274, - EndLine: 274, - StartPos: 5239, - EndPos: 5240, + EndLine: 274, + StartPos: 5239, + EndPos: 5240, }, Value: "a", }, @@ -12712,16 +12799,16 @@ func TestPhp5(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 274, - EndLine: 274, - StartPos: 5245, - EndPos: 5246, + EndLine: 274, + StartPos: 5245, + EndPos: 5246, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 274, - EndLine: 274, - StartPos: 5245, - EndPos: 5246, + EndLine: 274, + StartPos: 5245, + EndPos: 5246, }, Value: "b", }, @@ -12731,30 +12818,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 275, - EndLine: 275, - StartPos: 5251, - EndPos: 5258, + EndLine: 275, + StartPos: 5251, + EndPos: 5258, }, Expr: &binary.Concat{ Position: &position.Position{ StartLine: 275, - EndLine: 275, - StartPos: 5251, - EndPos: 5257, + EndLine: 275, + StartPos: 5251, + EndPos: 5257, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 275, - EndLine: 275, - StartPos: 5251, - EndPos: 5252, + EndLine: 275, + StartPos: 5251, + EndPos: 5252, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 275, - EndLine: 275, - StartPos: 5251, - EndPos: 5252, + EndLine: 275, + StartPos: 5251, + EndPos: 5252, }, Value: "a", }, @@ -12762,16 +12849,16 @@ func TestPhp5(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 275, - EndLine: 275, - StartPos: 5256, - EndPos: 5257, + EndLine: 275, + StartPos: 5256, + EndPos: 5257, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 275, - EndLine: 275, - StartPos: 5256, - EndPos: 5257, + EndLine: 275, + StartPos: 5256, + EndPos: 5257, }, Value: "b", }, @@ -12781,30 +12868,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 276, - EndLine: 276, - StartPos: 5262, - EndPos: 5269, + EndLine: 276, + StartPos: 5262, + EndPos: 5269, }, Expr: &binary.Div{ Position: &position.Position{ StartLine: 276, - EndLine: 276, - StartPos: 5262, - EndPos: 5268, + EndLine: 276, + StartPos: 5262, + EndPos: 5268, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 276, - EndLine: 276, - StartPos: 5262, - EndPos: 5263, + EndLine: 276, + StartPos: 5262, + EndPos: 5263, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 276, - EndLine: 276, - StartPos: 5262, - EndPos: 5263, + EndLine: 276, + StartPos: 5262, + EndPos: 5263, }, Value: "a", }, @@ -12812,16 +12899,16 @@ func TestPhp5(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 276, - EndLine: 276, - StartPos: 5267, - EndPos: 5268, + EndLine: 276, + StartPos: 5267, + EndPos: 5268, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 276, - EndLine: 276, - StartPos: 5267, - EndPos: 5268, + EndLine: 276, + StartPos: 5267, + EndPos: 5268, }, Value: "b", }, @@ -12831,30 +12918,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 277, - EndLine: 277, - StartPos: 5273, - EndPos: 5281, + EndLine: 277, + StartPos: 5273, + EndPos: 5281, }, Expr: &binary.Equal{ Position: &position.Position{ StartLine: 277, - EndLine: 277, - StartPos: 5273, - EndPos: 5280, + EndLine: 277, + StartPos: 5273, + EndPos: 5280, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 277, - EndLine: 277, - StartPos: 5273, - EndPos: 5274, + EndLine: 277, + StartPos: 5273, + EndPos: 5274, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 277, - EndLine: 277, - StartPos: 5273, - EndPos: 5274, + EndLine: 277, + StartPos: 5273, + EndPos: 5274, }, Value: "a", }, @@ -12862,16 +12949,16 @@ func TestPhp5(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 277, - EndLine: 277, - StartPos: 5279, - EndPos: 5280, + EndLine: 277, + StartPos: 5279, + EndPos: 5280, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 277, - EndLine: 277, - StartPos: 5279, - EndPos: 5280, + EndLine: 277, + StartPos: 5279, + EndPos: 5280, }, Value: "b", }, @@ -12881,30 +12968,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 278, - EndLine: 278, - StartPos: 5285, - EndPos: 5293, + EndLine: 278, + StartPos: 5285, + EndPos: 5293, }, Expr: &binary.GreaterOrEqual{ Position: &position.Position{ StartLine: 278, - EndLine: 278, - StartPos: 5285, - EndPos: 5292, + EndLine: 278, + StartPos: 5285, + EndPos: 5292, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 278, - EndLine: 278, - StartPos: 5285, - EndPos: 5286, + EndLine: 278, + StartPos: 5285, + EndPos: 5286, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 278, - EndLine: 278, - StartPos: 5285, - EndPos: 5286, + EndLine: 278, + StartPos: 5285, + EndPos: 5286, }, Value: "a", }, @@ -12912,16 +12999,16 @@ func TestPhp5(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 278, - EndLine: 278, - StartPos: 5291, - EndPos: 5292, + EndLine: 278, + StartPos: 5291, + EndPos: 5292, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 278, - EndLine: 278, - StartPos: 5291, - EndPos: 5292, + EndLine: 278, + StartPos: 5291, + EndPos: 5292, }, Value: "b", }, @@ -12931,30 +13018,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 279, - EndLine: 279, - StartPos: 5297, - EndPos: 5304, + EndLine: 279, + StartPos: 5297, + EndPos: 5304, }, Expr: &binary.Greater{ Position: &position.Position{ StartLine: 279, - EndLine: 279, - StartPos: 5297, - EndPos: 5303, + EndLine: 279, + StartPos: 5297, + EndPos: 5303, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 279, - EndLine: 279, - StartPos: 5297, - EndPos: 5298, + EndLine: 279, + StartPos: 5297, + EndPos: 5298, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 279, - EndLine: 279, - StartPos: 5297, - EndPos: 5298, + EndLine: 279, + StartPos: 5297, + EndPos: 5298, }, Value: "a", }, @@ -12962,16 +13049,16 @@ func TestPhp5(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 279, - EndLine: 279, - StartPos: 5302, - EndPos: 5303, + EndLine: 279, + StartPos: 5302, + EndPos: 5303, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 279, - EndLine: 279, - StartPos: 5302, - EndPos: 5303, + EndLine: 279, + StartPos: 5302, + EndPos: 5303, }, Value: "b", }, @@ -12981,30 +13068,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 280, - EndLine: 280, - StartPos: 5308, - EndPos: 5317, + EndLine: 280, + StartPos: 5308, + EndPos: 5317, }, Expr: &binary.Identical{ Position: &position.Position{ StartLine: 280, - EndLine: 280, - StartPos: 5308, - EndPos: 5316, + EndLine: 280, + StartPos: 5308, + EndPos: 5316, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 280, - EndLine: 280, - StartPos: 5308, - EndPos: 5309, + EndLine: 280, + StartPos: 5308, + EndPos: 5309, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 280, - EndLine: 280, - StartPos: 5308, - EndPos: 5309, + EndLine: 280, + StartPos: 5308, + EndPos: 5309, }, Value: "a", }, @@ -13012,16 +13099,16 @@ func TestPhp5(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 280, - EndLine: 280, - StartPos: 5315, - EndPos: 5316, + EndLine: 280, + StartPos: 5315, + EndPos: 5316, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 280, - EndLine: 280, - StartPos: 5315, - EndPos: 5316, + EndLine: 280, + StartPos: 5315, + EndPos: 5316, }, Value: "b", }, @@ -13031,30 +13118,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 281, - EndLine: 281, - StartPos: 5321, - EndPos: 5330, + EndLine: 281, + StartPos: 5321, + EndPos: 5330, }, Expr: &binary.LogicalAnd{ Position: &position.Position{ StartLine: 281, - EndLine: 281, - StartPos: 5321, - EndPos: 5329, + EndLine: 281, + StartPos: 5321, + EndPos: 5329, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 281, - EndLine: 281, - StartPos: 5321, - EndPos: 5322, + EndLine: 281, + StartPos: 5321, + EndPos: 5322, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 281, - EndLine: 281, - StartPos: 5321, - EndPos: 5322, + EndLine: 281, + StartPos: 5321, + EndPos: 5322, }, Value: "a", }, @@ -13062,16 +13149,16 @@ func TestPhp5(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 281, - EndLine: 281, - StartPos: 5328, - EndPos: 5329, + EndLine: 281, + StartPos: 5328, + EndPos: 5329, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 281, - EndLine: 281, - StartPos: 5328, - EndPos: 5329, + EndLine: 281, + StartPos: 5328, + EndPos: 5329, }, Value: "b", }, @@ -13081,30 +13168,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 282, - EndLine: 282, - StartPos: 5334, - EndPos: 5342, + EndLine: 282, + StartPos: 5334, + EndPos: 5342, }, Expr: &binary.LogicalOr{ Position: &position.Position{ StartLine: 282, - EndLine: 282, - StartPos: 5334, - EndPos: 5341, + EndLine: 282, + StartPos: 5334, + EndPos: 5341, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 282, - EndLine: 282, - StartPos: 5334, - EndPos: 5335, + EndLine: 282, + StartPos: 5334, + EndPos: 5335, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 282, - EndLine: 282, - StartPos: 5334, - EndPos: 5335, + EndLine: 282, + StartPos: 5334, + EndPos: 5335, }, Value: "a", }, @@ -13112,16 +13199,16 @@ func TestPhp5(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 282, - EndLine: 282, - StartPos: 5340, - EndPos: 5341, + EndLine: 282, + StartPos: 5340, + EndPos: 5341, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 282, - EndLine: 282, - StartPos: 5340, - EndPos: 5341, + EndLine: 282, + StartPos: 5340, + EndPos: 5341, }, Value: "b", }, @@ -13131,30 +13218,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 283, - EndLine: 283, - StartPos: 5346, - EndPos: 5355, + EndLine: 283, + StartPos: 5346, + EndPos: 5355, }, Expr: &binary.LogicalXor{ Position: &position.Position{ StartLine: 283, - EndLine: 283, - StartPos: 5346, - EndPos: 5354, + EndLine: 283, + StartPos: 5346, + EndPos: 5354, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 283, - EndLine: 283, - StartPos: 5346, - EndPos: 5347, + EndLine: 283, + StartPos: 5346, + EndPos: 5347, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 283, - EndLine: 283, - StartPos: 5346, - EndPos: 5347, + EndLine: 283, + StartPos: 5346, + EndPos: 5347, }, Value: "a", }, @@ -13162,16 +13249,16 @@ func TestPhp5(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 283, - EndLine: 283, - StartPos: 5353, - EndPos: 5354, + EndLine: 283, + StartPos: 5353, + EndPos: 5354, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 283, - EndLine: 283, - StartPos: 5353, - EndPos: 5354, + EndLine: 283, + StartPos: 5353, + EndPos: 5354, }, Value: "b", }, @@ -13181,30 +13268,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 284, - EndLine: 284, - StartPos: 5359, - EndPos: 5366, + EndLine: 284, + StartPos: 5359, + EndPos: 5366, }, Expr: &binary.Minus{ Position: &position.Position{ StartLine: 284, - EndLine: 284, - StartPos: 5359, - EndPos: 5365, + EndLine: 284, + StartPos: 5359, + EndPos: 5365, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 284, - EndLine: 284, - StartPos: 5359, - EndPos: 5360, + EndLine: 284, + StartPos: 5359, + EndPos: 5360, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 284, - EndLine: 284, - StartPos: 5359, - EndPos: 5360, + EndLine: 284, + StartPos: 5359, + EndPos: 5360, }, Value: "a", }, @@ -13212,16 +13299,16 @@ func TestPhp5(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 284, - EndLine: 284, - StartPos: 5364, - EndPos: 5365, + EndLine: 284, + StartPos: 5364, + EndPos: 5365, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 284, - EndLine: 284, - StartPos: 5364, - EndPos: 5365, + EndLine: 284, + StartPos: 5364, + EndPos: 5365, }, Value: "b", }, @@ -13231,30 +13318,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 285, - EndLine: 285, - StartPos: 5370, - EndPos: 5377, + EndLine: 285, + StartPos: 5370, + EndPos: 5377, }, Expr: &binary.Mod{ Position: &position.Position{ StartLine: 285, - EndLine: 285, - StartPos: 5370, - EndPos: 5376, + EndLine: 285, + StartPos: 5370, + EndPos: 5376, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 285, - EndLine: 285, - StartPos: 5370, - EndPos: 5371, + EndLine: 285, + StartPos: 5370, + EndPos: 5371, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 285, - EndLine: 285, - StartPos: 5370, - EndPos: 5371, + EndLine: 285, + StartPos: 5370, + EndPos: 5371, }, Value: "a", }, @@ -13262,16 +13349,16 @@ func TestPhp5(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 285, - EndLine: 285, - StartPos: 5375, - EndPos: 5376, + EndLine: 285, + StartPos: 5375, + EndPos: 5376, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 285, - EndLine: 285, - StartPos: 5375, - EndPos: 5376, + EndLine: 285, + StartPos: 5375, + EndPos: 5376, }, Value: "b", }, @@ -13281,30 +13368,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 286, - EndLine: 286, - StartPos: 5381, - EndPos: 5388, + EndLine: 286, + StartPos: 5381, + EndPos: 5388, }, Expr: &binary.Mul{ Position: &position.Position{ StartLine: 286, - EndLine: 286, - StartPos: 5381, - EndPos: 5387, + EndLine: 286, + StartPos: 5381, + EndPos: 5387, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 286, - EndLine: 286, - StartPos: 5381, - EndPos: 5382, + EndLine: 286, + StartPos: 5381, + EndPos: 5382, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 286, - EndLine: 286, - StartPos: 5381, - EndPos: 5382, + EndLine: 286, + StartPos: 5381, + EndPos: 5382, }, Value: "a", }, @@ -13312,16 +13399,16 @@ func TestPhp5(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 286, - EndLine: 286, - StartPos: 5386, - EndPos: 5387, + EndLine: 286, + StartPos: 5386, + EndPos: 5387, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 286, - EndLine: 286, - StartPos: 5386, - EndPos: 5387, + EndLine: 286, + StartPos: 5386, + EndPos: 5387, }, Value: "b", }, @@ -13331,30 +13418,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 287, - EndLine: 287, - StartPos: 5392, - EndPos: 5400, + EndLine: 287, + StartPos: 5392, + EndPos: 5400, }, Expr: &binary.NotEqual{ Position: &position.Position{ StartLine: 287, - EndLine: 287, - StartPos: 5392, - EndPos: 5399, + EndLine: 287, + StartPos: 5392, + EndPos: 5399, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 287, - EndLine: 287, - StartPos: 5392, - EndPos: 5393, + EndLine: 287, + StartPos: 5392, + EndPos: 5393, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 287, - EndLine: 287, - StartPos: 5392, - EndPos: 5393, + EndLine: 287, + StartPos: 5392, + EndPos: 5393, }, Value: "a", }, @@ -13362,16 +13449,16 @@ func TestPhp5(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 287, - EndLine: 287, - StartPos: 5398, - EndPos: 5399, + EndLine: 287, + StartPos: 5398, + EndPos: 5399, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 287, - EndLine: 287, - StartPos: 5398, - EndPos: 5399, + EndLine: 287, + StartPos: 5398, + EndPos: 5399, }, Value: "b", }, @@ -13381,30 +13468,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 288, - EndLine: 288, - StartPos: 5404, - EndPos: 5413, + EndLine: 288, + StartPos: 5404, + EndPos: 5413, }, Expr: &binary.NotIdentical{ Position: &position.Position{ StartLine: 288, - EndLine: 288, - StartPos: 5404, - EndPos: 5412, + EndLine: 288, + StartPos: 5404, + EndPos: 5412, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 288, - EndLine: 288, - StartPos: 5404, - EndPos: 5405, + EndLine: 288, + StartPos: 5404, + EndPos: 5405, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 288, - EndLine: 288, - StartPos: 5404, - EndPos: 5405, + EndLine: 288, + StartPos: 5404, + EndPos: 5405, }, Value: "a", }, @@ -13412,16 +13499,16 @@ func TestPhp5(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 288, - EndLine: 288, - StartPos: 5411, - EndPos: 5412, + EndLine: 288, + StartPos: 5411, + EndPos: 5412, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 288, - EndLine: 288, - StartPos: 5411, - EndPos: 5412, + EndLine: 288, + StartPos: 5411, + EndPos: 5412, }, Value: "b", }, @@ -13431,30 +13518,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 289, - EndLine: 289, - StartPos: 5417, - EndPos: 5424, + EndLine: 289, + StartPos: 5417, + EndPos: 5424, }, Expr: &binary.Plus{ Position: &position.Position{ StartLine: 289, - EndLine: 289, - StartPos: 5417, - EndPos: 5423, + EndLine: 289, + StartPos: 5417, + EndPos: 5423, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 289, - EndLine: 289, - StartPos: 5417, - EndPos: 5418, + EndLine: 289, + StartPos: 5417, + EndPos: 5418, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 289, - EndLine: 289, - StartPos: 5417, - EndPos: 5418, + EndLine: 289, + StartPos: 5417, + EndPos: 5418, }, Value: "a", }, @@ -13462,16 +13549,16 @@ func TestPhp5(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 289, - EndLine: 289, - StartPos: 5422, - EndPos: 5423, + EndLine: 289, + StartPos: 5422, + EndPos: 5423, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 289, - EndLine: 289, - StartPos: 5422, - EndPos: 5423, + EndLine: 289, + StartPos: 5422, + EndPos: 5423, }, Value: "b", }, @@ -13481,30 +13568,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 290, - EndLine: 290, - StartPos: 5428, - EndPos: 5436, + EndLine: 290, + StartPos: 5428, + EndPos: 5436, }, Expr: &binary.Pow{ Position: &position.Position{ StartLine: 290, - EndLine: 290, - StartPos: 5428, - EndPos: 5435, + EndLine: 290, + StartPos: 5428, + EndPos: 5435, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 290, - EndLine: 290, - StartPos: 5428, - EndPos: 5429, + EndLine: 290, + StartPos: 5428, + EndPos: 5429, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 290, - EndLine: 290, - StartPos: 5428, - EndPos: 5429, + EndLine: 290, + StartPos: 5428, + EndPos: 5429, }, Value: "a", }, @@ -13512,16 +13599,16 @@ func TestPhp5(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 290, - EndLine: 290, - StartPos: 5434, - EndPos: 5435, + EndLine: 290, + StartPos: 5434, + EndPos: 5435, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 290, - EndLine: 290, - StartPos: 5434, - EndPos: 5435, + EndLine: 290, + StartPos: 5434, + EndPos: 5435, }, Value: "b", }, @@ -13531,30 +13618,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 291, - EndLine: 291, - StartPos: 5440, - EndPos: 5448, + EndLine: 291, + StartPos: 5440, + EndPos: 5448, }, Expr: &binary.ShiftLeft{ Position: &position.Position{ StartLine: 291, - EndLine: 291, - StartPos: 5440, - EndPos: 5447, + EndLine: 291, + StartPos: 5440, + EndPos: 5447, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 291, - EndLine: 291, - StartPos: 5440, - EndPos: 5441, + EndLine: 291, + StartPos: 5440, + EndPos: 5441, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 291, - EndLine: 291, - StartPos: 5440, - EndPos: 5441, + EndLine: 291, + StartPos: 5440, + EndPos: 5441, }, Value: "a", }, @@ -13562,16 +13649,16 @@ func TestPhp5(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 291, - EndLine: 291, - StartPos: 5446, - EndPos: 5447, + EndLine: 291, + StartPos: 5446, + EndPos: 5447, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 291, - EndLine: 291, - StartPos: 5446, - EndPos: 5447, + EndLine: 291, + StartPos: 5446, + EndPos: 5447, }, Value: "b", }, @@ -13581,30 +13668,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 292, - EndLine: 292, - StartPos: 5452, - EndPos: 5460, + EndLine: 292, + StartPos: 5452, + EndPos: 5460, }, Expr: &binary.ShiftRight{ Position: &position.Position{ StartLine: 292, - EndLine: 292, - StartPos: 5452, - EndPos: 5459, + EndLine: 292, + StartPos: 5452, + EndPos: 5459, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 292, - EndLine: 292, - StartPos: 5452, - EndPos: 5453, + EndLine: 292, + StartPos: 5452, + EndPos: 5453, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 292, - EndLine: 292, - StartPos: 5452, - EndPos: 5453, + EndLine: 292, + StartPos: 5452, + EndPos: 5453, }, Value: "a", }, @@ -13612,16 +13699,16 @@ func TestPhp5(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 292, - EndLine: 292, - StartPos: 5458, - EndPos: 5459, + EndLine: 292, + StartPos: 5458, + EndPos: 5459, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 292, - EndLine: 292, - StartPos: 5458, - EndPos: 5459, + EndLine: 292, + StartPos: 5458, + EndPos: 5459, }, Value: "b", }, @@ -13631,30 +13718,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 293, - EndLine: 293, - StartPos: 5464, - EndPos: 5472, + EndLine: 293, + StartPos: 5464, + EndPos: 5472, }, Expr: &binary.SmallerOrEqual{ Position: &position.Position{ StartLine: 293, - EndLine: 293, - StartPos: 5464, - EndPos: 5471, + EndLine: 293, + StartPos: 5464, + EndPos: 5471, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 293, - EndLine: 293, - StartPos: 5464, - EndPos: 5465, + EndLine: 293, + StartPos: 5464, + EndPos: 5465, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 293, - EndLine: 293, - StartPos: 5464, - EndPos: 5465, + EndLine: 293, + StartPos: 5464, + EndPos: 5465, }, Value: "a", }, @@ -13662,16 +13749,16 @@ func TestPhp5(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 293, - EndLine: 293, - StartPos: 5470, - EndPos: 5471, + EndLine: 293, + StartPos: 5470, + EndPos: 5471, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 293, - EndLine: 293, - StartPos: 5470, - EndPos: 5471, + EndLine: 293, + StartPos: 5470, + EndPos: 5471, }, Value: "b", }, @@ -13681,30 +13768,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 294, - EndLine: 294, - StartPos: 5476, - EndPos: 5483, + EndLine: 294, + StartPos: 5476, + EndPos: 5483, }, Expr: &binary.Smaller{ Position: &position.Position{ StartLine: 294, - EndLine: 294, - StartPos: 5476, - EndPos: 5482, + EndLine: 294, + StartPos: 5476, + EndPos: 5482, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 294, - EndLine: 294, - StartPos: 5476, - EndPos: 5477, + EndLine: 294, + StartPos: 5476, + EndPos: 5477, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 294, - EndLine: 294, - StartPos: 5476, - EndPos: 5477, + EndLine: 294, + StartPos: 5476, + EndPos: 5477, }, Value: "a", }, @@ -13712,16 +13799,16 @@ func TestPhp5(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 294, - EndLine: 294, - StartPos: 5481, - EndPos: 5482, + EndLine: 294, + StartPos: 5481, + EndPos: 5482, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 294, - EndLine: 294, - StartPos: 5481, - EndPos: 5482, + EndLine: 294, + StartPos: 5481, + EndPos: 5482, }, Value: "b", }, @@ -13731,30 +13818,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 296, - EndLine: 296, - StartPos: 5488, - EndPos: 5496, + EndLine: 296, + StartPos: 5488, + EndPos: 5496, }, Expr: &assign.Reference{ Position: &position.Position{ StartLine: 296, - EndLine: 296, - StartPos: 5488, - EndPos: 5495, + EndLine: 296, + StartPos: 5488, + EndPos: 5495, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 296, - EndLine: 296, - StartPos: 5488, - EndPos: 5489, + EndLine: 296, + StartPos: 5488, + EndPos: 5489, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 296, - EndLine: 296, - StartPos: 5488, - EndPos: 5489, + EndLine: 296, + StartPos: 5488, + EndPos: 5489, }, Value: "a", }, @@ -13762,16 +13849,16 @@ func TestPhp5(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 296, - EndLine: 296, - StartPos: 5494, - EndPos: 5495, + EndLine: 296, + StartPos: 5494, + EndPos: 5495, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 296, - EndLine: 296, - StartPos: 5494, - EndPos: 5495, + EndLine: 296, + StartPos: 5494, + EndPos: 5495, }, Value: "b", }, @@ -13781,30 +13868,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 297, - EndLine: 297, - StartPos: 5500, - EndPos: 5513, + EndLine: 297, + StartPos: 5500, + EndPos: 5513, }, Expr: &assign.Reference{ Position: &position.Position{ StartLine: 297, - EndLine: 297, - StartPos: 5500, - EndPos: 5512, + EndLine: 297, + StartPos: 5500, + EndPos: 5512, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 297, - EndLine: 297, - StartPos: 5500, - EndPos: 5501, + EndLine: 297, + StartPos: 5500, + EndPos: 5501, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 297, - EndLine: 297, - StartPos: 5500, - EndPos: 5501, + EndLine: 297, + StartPos: 5500, + EndPos: 5501, }, Value: "a", }, @@ -13812,24 +13899,24 @@ func TestPhp5(t *testing.T) { Expression: &expr.New{ Position: &position.Position{ StartLine: 297, - EndLine: 297, - StartPos: 5506, - EndPos: 5512, + EndLine: 297, + StartPos: 5506, + EndPos: 5512, }, Class: &name.Name{ Position: &position.Position{ StartLine: 297, - EndLine: 297, - StartPos: 5510, - EndPos: 5512, + EndLine: 297, + StartPos: 5510, + EndPos: 5512, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 297, - EndLine: 297, - StartPos: 5510, - EndPos: 5512, + EndLine: 297, + StartPos: 5510, + EndPos: 5512, }, Value: "Foo", }, @@ -13841,30 +13928,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 298, - EndLine: 298, - StartPos: 5517, - EndPos: 5534, + EndLine: 298, + StartPos: 5517, + EndPos: 5534, }, Expr: &assign.Reference{ Position: &position.Position{ StartLine: 298, - EndLine: 298, - StartPos: 5517, - EndPos: 5533, + EndLine: 298, + StartPos: 5517, + EndPos: 5533, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 298, - EndLine: 298, - StartPos: 5517, - EndPos: 5518, + EndLine: 298, + StartPos: 5517, + EndPos: 5518, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 298, - EndLine: 298, - StartPos: 5517, - EndPos: 5518, + EndLine: 298, + StartPos: 5517, + EndPos: 5518, }, Value: "a", }, @@ -13872,24 +13959,24 @@ func TestPhp5(t *testing.T) { Expression: &expr.New{ Position: &position.Position{ StartLine: 298, - EndLine: 298, - StartPos: 5523, - EndPos: 5533, + EndLine: 298, + StartPos: 5523, + EndPos: 5533, }, Class: &name.Name{ Position: &position.Position{ StartLine: 298, - EndLine: 298, - StartPos: 5527, - EndPos: 5529, + EndLine: 298, + StartPos: 5527, + EndPos: 5529, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 298, - EndLine: 298, - StartPos: 5527, - EndPos: 5529, + EndLine: 298, + StartPos: 5527, + EndPos: 5529, }, Value: "Foo", }, @@ -13898,33 +13985,33 @@ func TestPhp5(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 298, - EndLine: 298, - StartPos: 5530, - EndPos: 5533, + EndLine: 298, + StartPos: 5530, + EndPos: 5533, }, Arguments: []node.Node{ &node.Argument{ Position: &position.Position{ StartLine: 298, - EndLine: 298, - StartPos: 5531, - EndPos: 5532, + EndLine: 298, + StartPos: 5531, + EndPos: 5532, }, - Variadic: false, + Variadic: false, IsReference: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 298, - EndLine: 298, - StartPos: 5531, - EndPos: 5532, + EndLine: 298, + StartPos: 5531, + EndPos: 5532, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 298, - EndLine: 298, - StartPos: 5531, - EndPos: 5532, + EndLine: 298, + StartPos: 5531, + EndPos: 5532, }, Value: "b", }, @@ -13938,30 +14025,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 299, - EndLine: 299, - StartPos: 5538, - EndPos: 5545, + EndLine: 299, + StartPos: 5538, + EndPos: 5545, }, Expr: &assign.Assign{ Position: &position.Position{ StartLine: 299, - EndLine: 299, - StartPos: 5538, - EndPos: 5544, + EndLine: 299, + StartPos: 5538, + EndPos: 5544, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 299, - EndLine: 299, - StartPos: 5538, - EndPos: 5539, + EndLine: 299, + StartPos: 5538, + EndPos: 5539, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 299, - EndLine: 299, - StartPos: 5538, - EndPos: 5539, + EndLine: 299, + StartPos: 5538, + EndPos: 5539, }, Value: "a", }, @@ -13969,16 +14056,16 @@ func TestPhp5(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 299, - EndLine: 299, - StartPos: 5543, - EndPos: 5544, + EndLine: 299, + StartPos: 5543, + EndPos: 5544, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 299, - EndLine: 299, - StartPos: 5543, - EndPos: 5544, + EndLine: 299, + StartPos: 5543, + EndPos: 5544, }, Value: "b", }, @@ -13988,30 +14075,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 300, - EndLine: 300, - StartPos: 5549, - EndPos: 5557, + EndLine: 300, + StartPos: 5549, + EndPos: 5557, }, Expr: &assign.BitwiseAnd{ Position: &position.Position{ StartLine: 300, - EndLine: 300, - StartPos: 5549, - EndPos: 5556, + EndLine: 300, + StartPos: 5549, + EndPos: 5556, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 300, - EndLine: 300, - StartPos: 5549, - EndPos: 5550, + EndLine: 300, + StartPos: 5549, + EndPos: 5550, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 300, - EndLine: 300, - StartPos: 5549, - EndPos: 5550, + EndLine: 300, + StartPos: 5549, + EndPos: 5550, }, Value: "a", }, @@ -14019,16 +14106,16 @@ func TestPhp5(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 300, - EndLine: 300, - StartPos: 5555, - EndPos: 5556, + EndLine: 300, + StartPos: 5555, + EndPos: 5556, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 300, - EndLine: 300, - StartPos: 5555, - EndPos: 5556, + EndLine: 300, + StartPos: 5555, + EndPos: 5556, }, Value: "b", }, @@ -14038,30 +14125,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 301, - EndLine: 301, - StartPos: 5561, - EndPos: 5569, + EndLine: 301, + StartPos: 5561, + EndPos: 5569, }, Expr: &assign.BitwiseOr{ Position: &position.Position{ StartLine: 301, - EndLine: 301, - StartPos: 5561, - EndPos: 5568, + EndLine: 301, + StartPos: 5561, + EndPos: 5568, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 301, - EndLine: 301, - StartPos: 5561, - EndPos: 5562, + EndLine: 301, + StartPos: 5561, + EndPos: 5562, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 301, - EndLine: 301, - StartPos: 5561, - EndPos: 5562, + EndLine: 301, + StartPos: 5561, + EndPos: 5562, }, Value: "a", }, @@ -14069,16 +14156,16 @@ func TestPhp5(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 301, - EndLine: 301, - StartPos: 5567, - EndPos: 5568, + EndLine: 301, + StartPos: 5567, + EndPos: 5568, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 301, - EndLine: 301, - StartPos: 5567, - EndPos: 5568, + EndLine: 301, + StartPos: 5567, + EndPos: 5568, }, Value: "b", }, @@ -14088,30 +14175,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 302, - EndLine: 302, - StartPos: 5573, - EndPos: 5581, + EndLine: 302, + StartPos: 5573, + EndPos: 5581, }, Expr: &assign.BitwiseXor{ Position: &position.Position{ StartLine: 302, - EndLine: 302, - StartPos: 5573, - EndPos: 5580, + EndLine: 302, + StartPos: 5573, + EndPos: 5580, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 302, - EndLine: 302, - StartPos: 5573, - EndPos: 5574, + EndLine: 302, + StartPos: 5573, + EndPos: 5574, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 302, - EndLine: 302, - StartPos: 5573, - EndPos: 5574, + EndLine: 302, + StartPos: 5573, + EndPos: 5574, }, Value: "a", }, @@ -14119,16 +14206,16 @@ func TestPhp5(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 302, - EndLine: 302, - StartPos: 5579, - EndPos: 5580, + EndLine: 302, + StartPos: 5579, + EndPos: 5580, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 302, - EndLine: 302, - StartPos: 5579, - EndPos: 5580, + EndLine: 302, + StartPos: 5579, + EndPos: 5580, }, Value: "b", }, @@ -14138,30 +14225,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 303, - EndLine: 303, - StartPos: 5585, - EndPos: 5593, + EndLine: 303, + StartPos: 5585, + EndPos: 5593, }, Expr: &assign.Concat{ Position: &position.Position{ StartLine: 303, - EndLine: 303, - StartPos: 5585, - EndPos: 5592, + EndLine: 303, + StartPos: 5585, + EndPos: 5592, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 303, - EndLine: 303, - StartPos: 5585, - EndPos: 5586, + EndLine: 303, + StartPos: 5585, + EndPos: 5586, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 303, - EndLine: 303, - StartPos: 5585, - EndPos: 5586, + EndLine: 303, + StartPos: 5585, + EndPos: 5586, }, Value: "a", }, @@ -14169,16 +14256,16 @@ func TestPhp5(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 303, - EndLine: 303, - StartPos: 5591, - EndPos: 5592, + EndLine: 303, + StartPos: 5591, + EndPos: 5592, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 303, - EndLine: 303, - StartPos: 5591, - EndPos: 5592, + EndLine: 303, + StartPos: 5591, + EndPos: 5592, }, Value: "b", }, @@ -14188,30 +14275,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 304, - EndLine: 304, - StartPos: 5597, - EndPos: 5605, + EndLine: 304, + StartPos: 5597, + EndPos: 5605, }, Expr: &assign.Div{ Position: &position.Position{ StartLine: 304, - EndLine: 304, - StartPos: 5597, - EndPos: 5604, + EndLine: 304, + StartPos: 5597, + EndPos: 5604, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 304, - EndLine: 304, - StartPos: 5597, - EndPos: 5598, + EndLine: 304, + StartPos: 5597, + EndPos: 5598, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 304, - EndLine: 304, - StartPos: 5597, - EndPos: 5598, + EndLine: 304, + StartPos: 5597, + EndPos: 5598, }, Value: "a", }, @@ -14219,16 +14306,16 @@ func TestPhp5(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 304, - EndLine: 304, - StartPos: 5603, - EndPos: 5604, + EndLine: 304, + StartPos: 5603, + EndPos: 5604, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 304, - EndLine: 304, - StartPos: 5603, - EndPos: 5604, + EndLine: 304, + StartPos: 5603, + EndPos: 5604, }, Value: "b", }, @@ -14238,30 +14325,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 305, - EndLine: 305, - StartPos: 5609, - EndPos: 5617, + EndLine: 305, + StartPos: 5609, + EndPos: 5617, }, Expr: &assign.Minus{ Position: &position.Position{ StartLine: 305, - EndLine: 305, - StartPos: 5609, - EndPos: 5616, + EndLine: 305, + StartPos: 5609, + EndPos: 5616, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 305, - EndLine: 305, - StartPos: 5609, - EndPos: 5610, + EndLine: 305, + StartPos: 5609, + EndPos: 5610, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 305, - EndLine: 305, - StartPos: 5609, - EndPos: 5610, + EndLine: 305, + StartPos: 5609, + EndPos: 5610, }, Value: "a", }, @@ -14269,16 +14356,16 @@ func TestPhp5(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 305, - EndLine: 305, - StartPos: 5615, - EndPos: 5616, + EndLine: 305, + StartPos: 5615, + EndPos: 5616, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 305, - EndLine: 305, - StartPos: 5615, - EndPos: 5616, + EndLine: 305, + StartPos: 5615, + EndPos: 5616, }, Value: "b", }, @@ -14288,30 +14375,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 306, - EndLine: 306, - StartPos: 5621, - EndPos: 5629, + EndLine: 306, + StartPos: 5621, + EndPos: 5629, }, Expr: &assign.Mod{ Position: &position.Position{ StartLine: 306, - EndLine: 306, - StartPos: 5621, - EndPos: 5628, + EndLine: 306, + StartPos: 5621, + EndPos: 5628, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 306, - EndLine: 306, - StartPos: 5621, - EndPos: 5622, + EndLine: 306, + StartPos: 5621, + EndPos: 5622, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 306, - EndLine: 306, - StartPos: 5621, - EndPos: 5622, + EndLine: 306, + StartPos: 5621, + EndPos: 5622, }, Value: "a", }, @@ -14319,16 +14406,16 @@ func TestPhp5(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 306, - EndLine: 306, - StartPos: 5627, - EndPos: 5628, + EndLine: 306, + StartPos: 5627, + EndPos: 5628, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 306, - EndLine: 306, - StartPos: 5627, - EndPos: 5628, + EndLine: 306, + StartPos: 5627, + EndPos: 5628, }, Value: "b", }, @@ -14338,30 +14425,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 307, - EndLine: 307, - StartPos: 5633, - EndPos: 5641, + EndLine: 307, + StartPos: 5633, + EndPos: 5641, }, Expr: &assign.Mul{ Position: &position.Position{ StartLine: 307, - EndLine: 307, - StartPos: 5633, - EndPos: 5640, + EndLine: 307, + StartPos: 5633, + EndPos: 5640, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 307, - EndLine: 307, - StartPos: 5633, - EndPos: 5634, + EndLine: 307, + StartPos: 5633, + EndPos: 5634, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 307, - EndLine: 307, - StartPos: 5633, - EndPos: 5634, + EndLine: 307, + StartPos: 5633, + EndPos: 5634, }, Value: "a", }, @@ -14369,16 +14456,16 @@ func TestPhp5(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 307, - EndLine: 307, - StartPos: 5639, - EndPos: 5640, + EndLine: 307, + StartPos: 5639, + EndPos: 5640, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 307, - EndLine: 307, - StartPos: 5639, - EndPos: 5640, + EndLine: 307, + StartPos: 5639, + EndPos: 5640, }, Value: "b", }, @@ -14388,30 +14475,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 308, - EndLine: 308, - StartPos: 5645, - EndPos: 5653, + EndLine: 308, + StartPos: 5645, + EndPos: 5653, }, Expr: &assign.Plus{ Position: &position.Position{ StartLine: 308, - EndLine: 308, - StartPos: 5645, - EndPos: 5652, + EndLine: 308, + StartPos: 5645, + EndPos: 5652, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 308, - EndLine: 308, - StartPos: 5645, - EndPos: 5646, + EndLine: 308, + StartPos: 5645, + EndPos: 5646, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 308, - EndLine: 308, - StartPos: 5645, - EndPos: 5646, + EndLine: 308, + StartPos: 5645, + EndPos: 5646, }, Value: "a", }, @@ -14419,16 +14506,16 @@ func TestPhp5(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 308, - EndLine: 308, - StartPos: 5651, - EndPos: 5652, + EndLine: 308, + StartPos: 5651, + EndPos: 5652, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 308, - EndLine: 308, - StartPos: 5651, - EndPos: 5652, + EndLine: 308, + StartPos: 5651, + EndPos: 5652, }, Value: "b", }, @@ -14438,30 +14525,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 309, - EndLine: 309, - StartPos: 5657, - EndPos: 5666, + EndLine: 309, + StartPos: 5657, + EndPos: 5666, }, Expr: &assign.Pow{ Position: &position.Position{ StartLine: 309, - EndLine: 309, - StartPos: 5657, - EndPos: 5665, + EndLine: 309, + StartPos: 5657, + EndPos: 5665, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 309, - EndLine: 309, - StartPos: 5657, - EndPos: 5658, + EndLine: 309, + StartPos: 5657, + EndPos: 5658, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 309, - EndLine: 309, - StartPos: 5657, - EndPos: 5658, + EndLine: 309, + StartPos: 5657, + EndPos: 5658, }, Value: "a", }, @@ -14469,16 +14556,16 @@ func TestPhp5(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 309, - EndLine: 309, - StartPos: 5664, - EndPos: 5665, + EndLine: 309, + StartPos: 5664, + EndPos: 5665, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 309, - EndLine: 309, - StartPos: 5664, - EndPos: 5665, + EndLine: 309, + StartPos: 5664, + EndPos: 5665, }, Value: "b", }, @@ -14488,30 +14575,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 310, - EndLine: 310, - StartPos: 5670, - EndPos: 5679, + EndLine: 310, + StartPos: 5670, + EndPos: 5679, }, Expr: &assign.ShiftLeft{ Position: &position.Position{ StartLine: 310, - EndLine: 310, - StartPos: 5670, - EndPos: 5678, + EndLine: 310, + StartPos: 5670, + EndPos: 5678, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 310, - EndLine: 310, - StartPos: 5670, - EndPos: 5671, + EndLine: 310, + StartPos: 5670, + EndPos: 5671, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 310, - EndLine: 310, - StartPos: 5670, - EndPos: 5671, + EndLine: 310, + StartPos: 5670, + EndPos: 5671, }, Value: "a", }, @@ -14519,16 +14606,16 @@ func TestPhp5(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 310, - EndLine: 310, - StartPos: 5677, - EndPos: 5678, + EndLine: 310, + StartPos: 5677, + EndPos: 5678, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 310, - EndLine: 310, - StartPos: 5677, - EndPos: 5678, + EndLine: 310, + StartPos: 5677, + EndPos: 5678, }, Value: "b", }, @@ -14538,30 +14625,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 311, - EndLine: 311, - StartPos: 5683, - EndPos: 5692, + EndLine: 311, + StartPos: 5683, + EndPos: 5692, }, Expr: &assign.ShiftRight{ Position: &position.Position{ StartLine: 311, - EndLine: 311, - StartPos: 5683, - EndPos: 5691, + EndLine: 311, + StartPos: 5683, + EndPos: 5691, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 311, - EndLine: 311, - StartPos: 5683, - EndPos: 5684, + EndLine: 311, + StartPos: 5683, + EndPos: 5684, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 311, - EndLine: 311, - StartPos: 5683, - EndPos: 5684, + EndLine: 311, + StartPos: 5683, + EndPos: 5684, }, Value: "a", }, @@ -14569,16 +14656,16 @@ func TestPhp5(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 311, - EndLine: 311, - StartPos: 5690, - EndPos: 5691, + EndLine: 311, + StartPos: 5690, + EndPos: 5691, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 311, - EndLine: 311, - StartPos: 5690, - EndPos: 5691, + EndLine: 311, + StartPos: 5690, + EndPos: 5691, }, Value: "b", }, @@ -14588,31 +14675,31 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 314, - EndLine: 314, - StartPos: 5699, - EndPos: 5710, + EndLine: 314, + StartPos: 5699, + EndPos: 5710, }, Expr: &expr.New{ Position: &position.Position{ StartLine: 314, - EndLine: 314, - StartPos: 5699, - EndPos: 5708, + EndLine: 314, + StartPos: 5699, + EndPos: 5708, }, Class: &name.FullyQualified{ Position: &position.Position{ StartLine: 314, - EndLine: 314, - StartPos: 5703, - EndPos: 5706, + EndLine: 314, + StartPos: 5703, + EndPos: 5706, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 314, - EndLine: 314, - StartPos: 5704, - EndPos: 5706, + EndLine: 314, + StartPos: 5704, + EndPos: 5706, }, Value: "Foo", }, @@ -14621,9 +14708,9 @@ func TestPhp5(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 314, - EndLine: 314, - StartPos: 5707, - EndPos: 5708, + EndLine: 314, + StartPos: 5707, + EndPos: 5708, }, }, }, @@ -14631,45 +14718,45 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 315, - EndLine: 315, - StartPos: 5735, - EndPos: 5738, + EndLine: 315, + StartPos: 5735, + EndPos: 5738, }, Expr: &expr.PropertyFetch{ Position: &position.Position{ StartLine: 315, - EndLine: 315, - StartPos: 5735, - EndPos: 5737, + EndLine: 315, + StartPos: 5735, + EndPos: 5737, }, Variable: &expr.MethodCall{ Position: &position.Position{ StartLine: 315, - EndLine: 315, - StartPos: 5731, - EndPos: 5732, + EndLine: 315, + StartPos: 5731, + EndPos: 5732, }, Variable: &expr.New{ Position: &position.Position{ StartLine: 315, - EndLine: 315, - StartPos: 5715, - EndPos: 5724, + EndLine: 315, + StartPos: 5715, + EndPos: 5724, }, Class: &name.FullyQualified{ Position: &position.Position{ StartLine: 315, - EndLine: 315, - StartPos: 5719, - EndPos: 5722, + EndLine: 315, + StartPos: 5719, + EndPos: 5722, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 315, - EndLine: 315, - StartPos: 5720, - EndPos: 5722, + EndLine: 315, + StartPos: 5720, + EndPos: 5722, }, Value: "Foo", }, @@ -14678,36 +14765,36 @@ func TestPhp5(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 315, - EndLine: 315, - StartPos: 5723, - EndPos: 5724, + EndLine: 315, + StartPos: 5723, + EndPos: 5724, }, }, }, Method: &node.Identifier{ Position: &position.Position{ StartLine: 315, - EndLine: 315, - StartPos: 5728, - EndPos: 5730, + EndLine: 315, + StartPos: 5728, + EndPos: 5730, }, Value: "bar", }, ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 315, - EndLine: 315, - StartPos: 5731, - EndPos: 5732, + EndLine: 315, + StartPos: 5731, + EndPos: 5732, }, }, }, Property: &node.Identifier{ Position: &position.Position{ StartLine: 315, - EndLine: 315, - StartPos: 5735, - EndPos: 5737, + EndLine: 315, + StartPos: 5735, + EndPos: 5737, }, Value: "baz", }, @@ -14716,45 +14803,45 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 316, - EndLine: 316, - StartPos: 5758, - EndPos: 5760, + EndLine: 316, + StartPos: 5758, + EndPos: 5760, }, Expr: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 316, - EndLine: 316, - StartPos: 5758, - EndPos: 5758, + EndLine: 316, + StartPos: 5758, + EndPos: 5758, }, Variable: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 316, - EndLine: 316, - StartPos: 5755, - EndPos: 5755, + EndLine: 316, + StartPos: 5755, + EndPos: 5755, }, Variable: &expr.New{ Position: &position.Position{ StartLine: 316, - EndLine: 316, - StartPos: 5743, - EndPos: 5752, + EndLine: 316, + StartPos: 5743, + EndPos: 5752, }, Class: &name.FullyQualified{ Position: &position.Position{ StartLine: 316, - EndLine: 316, - StartPos: 5747, - EndPos: 5750, + EndLine: 316, + StartPos: 5747, + EndPos: 5750, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 316, - EndLine: 316, - StartPos: 5748, - EndPos: 5750, + EndLine: 316, + StartPos: 5748, + EndPos: 5750, }, Value: "Foo", }, @@ -14763,18 +14850,18 @@ func TestPhp5(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 316, - EndLine: 316, - StartPos: 5751, - EndPos: 5752, + EndLine: 316, + StartPos: 5751, + EndPos: 5752, }, }, }, Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 316, - EndLine: 316, - StartPos: 5755, - EndPos: 5755, + EndLine: 316, + StartPos: 5755, + EndPos: 5755, }, Value: "0", }, @@ -14782,9 +14869,9 @@ func TestPhp5(t *testing.T) { Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 316, - EndLine: 316, - StartPos: 5758, - EndPos: 5758, + EndLine: 316, + StartPos: 5758, + EndPos: 5758, }, Value: "0", }, @@ -14793,45 +14880,45 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 317, - EndLine: 317, - StartPos: 5784, - EndPos: 5786, + EndLine: 317, + StartPos: 5784, + EndPos: 5786, }, Expr: &expr.MethodCall{ Position: &position.Position{ StartLine: 317, - EndLine: 317, - StartPos: 5784, - EndPos: 5785, + EndLine: 317, + StartPos: 5784, + EndPos: 5785, }, Variable: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 317, - EndLine: 317, - StartPos: 5777, - EndPos: 5777, + EndLine: 317, + StartPos: 5777, + EndPos: 5777, }, Variable: &expr.New{ Position: &position.Position{ StartLine: 317, - EndLine: 317, - StartPos: 5765, - EndPos: 5774, + EndLine: 317, + StartPos: 5765, + EndPos: 5774, }, Class: &name.FullyQualified{ Position: &position.Position{ StartLine: 317, - EndLine: 317, - StartPos: 5769, - EndPos: 5772, + EndLine: 317, + StartPos: 5769, + EndPos: 5772, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 317, - EndLine: 317, - StartPos: 5770, - EndPos: 5772, + EndLine: 317, + StartPos: 5770, + EndPos: 5772, }, Value: "Foo", }, @@ -14840,18 +14927,18 @@ func TestPhp5(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 317, - EndLine: 317, - StartPos: 5773, - EndPos: 5774, + EndLine: 317, + StartPos: 5773, + EndPos: 5774, }, }, }, Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 317, - EndLine: 317, - StartPos: 5777, - EndPos: 5777, + EndLine: 317, + StartPos: 5777, + EndPos: 5777, }, Value: "0", }, @@ -14859,18 +14946,18 @@ func TestPhp5(t *testing.T) { Method: &node.Identifier{ Position: &position.Position{ StartLine: 317, - EndLine: 317, - StartPos: 5781, - EndPos: 5783, + EndLine: 317, + StartPos: 5781, + EndPos: 5783, }, Value: "bar", }, ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 317, - EndLine: 317, - StartPos: 5784, - EndPos: 5785, + EndLine: 317, + StartPos: 5784, + EndPos: 5785, }, }, }, @@ -14878,60 +14965,60 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 319, - EndLine: 319, - StartPos: 5791, - EndPos: 5807, + EndLine: 319, + StartPos: 5791, + EndPos: 5807, }, Expr: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 319, - EndLine: 319, - StartPos: 5791, - EndPos: 5806, + EndLine: 319, + StartPos: 5791, + EndPos: 5806, }, Variable: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 319, - EndLine: 319, - StartPos: 5791, - EndPos: 5803, + EndLine: 319, + StartPos: 5791, + EndPos: 5803, }, Variable: &expr.Array{ Position: &position.Position{ StartLine: 319, - EndLine: 319, - StartPos: 5791, - EndPos: 5800, + EndLine: 319, + StartPos: 5791, + EndPos: 5800, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 319, - EndLine: 319, - StartPos: 5797, - EndPos: 5799, + EndLine: 319, + StartPos: 5797, + EndPos: 5799, }, Val: &expr.ShortArray{ Position: &position.Position{ StartLine: 319, - EndLine: 319, - StartPos: 5797, - EndPos: 5799, + EndLine: 319, + StartPos: 5797, + EndPos: 5799, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 319, - EndLine: 319, - StartPos: 5798, - EndPos: 5798, + EndLine: 319, + StartPos: 5798, + EndPos: 5798, }, Val: &scalar.Lnumber{ Position: &position.Position{ StartLine: 319, - EndLine: 319, - StartPos: 5798, - EndPos: 5798, + EndLine: 319, + StartPos: 5798, + EndPos: 5798, }, Value: "0", }, @@ -14944,9 +15031,9 @@ func TestPhp5(t *testing.T) { Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 319, - EndLine: 319, - StartPos: 5802, - EndPos: 5802, + EndLine: 319, + StartPos: 5802, + EndPos: 5802, }, Value: "0", }, @@ -14954,9 +15041,9 @@ func TestPhp5(t *testing.T) { Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 319, - EndLine: 319, - StartPos: 5805, - EndPos: 5805, + EndLine: 319, + StartPos: 5805, + EndPos: 5805, }, Value: "0", }, @@ -14965,32 +15052,32 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 320, - EndLine: 320, - StartPos: 5811, - EndPos: 5819, + EndLine: 320, + StartPos: 5811, + EndPos: 5819, }, Expr: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 320, - EndLine: 320, - StartPos: 5811, - EndPos: 5818, + EndLine: 320, + StartPos: 5811, + EndPos: 5818, }, Variable: &scalar.String{ Position: &position.Position{ StartLine: 320, - EndLine: 320, - StartPos: 5811, - EndPos: 5815, + EndLine: 320, + StartPos: 5811, + EndPos: 5815, }, Value: "\"foo\"", }, Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 320, - EndLine: 320, - StartPos: 5817, - EndPos: 5817, + EndLine: 320, + StartPos: 5817, + EndPos: 5817, }, Value: "0", }, @@ -14999,38 +15086,38 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 321, - EndLine: 321, - StartPos: 5823, - EndPos: 5829, + EndLine: 321, + StartPos: 5823, + EndPos: 5829, }, Expr: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 321, - EndLine: 321, - StartPos: 5823, - EndPos: 5828, + EndLine: 321, + StartPos: 5823, + EndPos: 5828, }, Variable: &expr.ConstFetch{ Position: &position.Position{ StartLine: 321, - EndLine: 321, - StartPos: 5823, - EndPos: 5825, + EndLine: 321, + StartPos: 5823, + EndPos: 5825, }, Constant: &name.Name{ Position: &position.Position{ StartLine: 321, - EndLine: 321, - StartPos: 5823, - EndPos: 5825, + EndLine: 321, + StartPos: 5823, + EndPos: 5825, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 321, - EndLine: 321, - StartPos: 5823, - EndPos: 5825, + EndLine: 321, + StartPos: 5823, + EndPos: 5825, }, Value: "foo", }, @@ -15040,9 +15127,9 @@ func TestPhp5(t *testing.T) { Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 321, - EndLine: 321, - StartPos: 5827, - EndPos: 5827, + EndLine: 321, + StartPos: 5827, + EndPos: 5827, }, Value: "0", }, @@ -15051,32 +15138,32 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 322, - EndLine: 322, - StartPos: 5833, - EndPos: 5844, + EndLine: 322, + StartPos: 5833, + EndPos: 5844, }, Expr: &expr.ClassConstFetch{ Position: &position.Position{ StartLine: 322, - EndLine: 322, - StartPos: 5833, - EndPos: 5843, + EndLine: 322, + StartPos: 5833, + EndPos: 5843, }, Class: &node.Identifier{ Position: &position.Position{ StartLine: 322, - EndLine: 322, - StartPos: 5833, - EndPos: 5838, + EndLine: 322, + StartPos: 5833, + EndPos: 5838, }, Value: "static", }, ConstantName: &node.Identifier{ Position: &position.Position{ StartLine: 322, - EndLine: 322, - StartPos: 5841, - EndPos: 5843, + EndLine: 322, + StartPos: 5841, + EndPos: 5843, }, Value: "foo", }, @@ -15085,30 +15172,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 324, - EndLine: 324, - StartPos: 5849, - EndPos: 5857, + EndLine: 324, + StartPos: 5849, + EndPos: 5857, }, Expr: &expr.New{ Position: &position.Position{ StartLine: 324, - EndLine: 324, - StartPos: 5849, - EndPos: 5856, + EndLine: 324, + StartPos: 5849, + EndPos: 5856, }, Class: &expr.Variable{ Position: &position.Position{ StartLine: 324, - EndLine: 324, - StartPos: 5853, - EndPos: 5856, + EndLine: 324, + StartPos: 5853, + EndPos: 5856, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 324, - EndLine: 324, - StartPos: 5853, - EndPos: 5856, + EndLine: 324, + StartPos: 5853, + EndPos: 5856, }, Value: "foo", }, @@ -15118,37 +15205,37 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 325, - EndLine: 325, - StartPos: 5861, - EndPos: 5875, + EndLine: 325, + StartPos: 5861, + EndPos: 5875, }, Expr: &expr.New{ Position: &position.Position{ StartLine: 325, - EndLine: 325, - StartPos: 5861, - EndPos: 5874, + EndLine: 325, + StartPos: 5861, + EndPos: 5874, }, Class: &expr.StaticPropertyFetch{ Position: &position.Position{ StartLine: 325, - EndLine: 325, - StartPos: 5865, - EndPos: 5874, + EndLine: 325, + StartPos: 5865, + EndPos: 5874, }, Class: &expr.Variable{ Position: &position.Position{ StartLine: 325, - EndLine: 325, - StartPos: 5865, - EndPos: 5868, + EndLine: 325, + StartPos: 5865, + EndPos: 5868, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 325, - EndLine: 325, - StartPos: 5865, - EndPos: 5868, + EndLine: 325, + StartPos: 5865, + EndPos: 5868, }, Value: "foo", }, @@ -15156,16 +15243,16 @@ func TestPhp5(t *testing.T) { Property: &expr.Variable{ Position: &position.Position{ StartLine: 325, - EndLine: 325, - StartPos: 5871, - EndPos: 5874, + EndLine: 325, + StartPos: 5871, + EndPos: 5874, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 325, - EndLine: 325, - StartPos: 5871, - EndPos: 5874, + EndLine: 325, + StartPos: 5871, + EndPos: 5874, }, Value: "bar", }, @@ -15176,44 +15263,44 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 326, - EndLine: 326, - StartPos: 5879, - EndPos: 5891, + EndLine: 326, + StartPos: 5879, + EndPos: 5891, }, Expr: &expr.New{ Position: &position.Position{ StartLine: 326, - EndLine: 326, - StartPos: 5879, - EndPos: 5889, + EndLine: 326, + StartPos: 5879, + EndPos: 5889, }, Class: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 326, - EndLine: 326, - StartPos: 5889, - EndPos: 5889, + EndLine: 326, + StartPos: 5889, + EndPos: 5889, }, Variable: &expr.PropertyFetch{ Position: &position.Position{ StartLine: 326, - EndLine: 326, - StartPos: 5887, - EndPos: 5889, + EndLine: 326, + StartPos: 5887, + EndPos: 5889, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 326, - EndLine: 326, - StartPos: 5883, - EndPos: 5887, + EndLine: 326, + StartPos: 5883, + EndPos: 5887, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 326, - EndLine: 326, - StartPos: 5883, - EndPos: 5884, + EndLine: 326, + StartPos: 5883, + EndPos: 5884, }, Value: "a", }, @@ -15221,9 +15308,9 @@ func TestPhp5(t *testing.T) { Property: &node.Identifier{ Position: &position.Position{ StartLine: 326, - EndLine: 326, - StartPos: 5887, - EndPos: 5887, + EndLine: 326, + StartPos: 5887, + EndPos: 5887, }, Value: "b", }, @@ -15231,9 +15318,9 @@ func TestPhp5(t *testing.T) { Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 326, - EndLine: 326, - StartPos: 5889, - EndPos: 5889, + EndLine: 326, + StartPos: 5889, + EndPos: 5889, }, Value: "0", }, @@ -15243,65 +15330,65 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5895, - EndPos: 5926, + EndLine: 327, + StartPos: 5895, + EndPos: 5926, }, Expr: &expr.New{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5895, - EndPos: 5924, + EndLine: 327, + StartPos: 5895, + EndPos: 5924, }, Class: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5924, - EndPos: 5924, + EndLine: 327, + StartPos: 5924, + EndPos: 5924, }, Variable: &expr.PropertyFetch{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5922, - EndPos: 5924, + EndLine: 327, + StartPos: 5922, + EndPos: 5924, }, Variable: &expr.PropertyFetch{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5918, - EndPos: 5922, + EndLine: 327, + StartPos: 5918, + EndPos: 5922, }, Variable: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5905, - EndPos: 5919, + EndLine: 327, + StartPos: 5905, + EndPos: 5919, }, Variable: &expr.PropertyFetch{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5903, - EndPos: 5914, + EndLine: 327, + StartPos: 5903, + EndPos: 5914, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5899, - EndPos: 5903, + EndLine: 327, + StartPos: 5899, + EndPos: 5903, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5899, - EndPos: 5900, + EndLine: 327, + StartPos: 5899, + EndPos: 5900, }, Value: "a", }, @@ -15309,9 +15396,9 @@ func TestPhp5(t *testing.T) { Property: &node.Identifier{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5903, - EndPos: 5903, + EndLine: 327, + StartPos: 5903, + EndPos: 5903, }, Value: "b", }, @@ -15319,23 +15406,23 @@ func TestPhp5(t *testing.T) { Dim: &expr.Ternary{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5905, - EndPos: 5914, + EndLine: 327, + StartPos: 5905, + EndPos: 5914, }, Condition: &expr.Variable{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5905, - EndPos: 5906, + EndLine: 327, + StartPos: 5905, + EndPos: 5906, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5905, - EndPos: 5906, + EndLine: 327, + StartPos: 5905, + EndPos: 5906, }, Value: "b", }, @@ -15343,24 +15430,24 @@ func TestPhp5(t *testing.T) { IfFalse: &expr.ConstFetch{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5911, - EndPos: 5914, + EndLine: 327, + StartPos: 5911, + EndPos: 5914, }, Constant: &name.Name{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5911, - EndPos: 5914, + EndLine: 327, + StartPos: 5911, + EndPos: 5914, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5911, - EndPos: 5914, + EndLine: 327, + StartPos: 5911, + EndPos: 5914, }, Value: "null", }, @@ -15372,16 +15459,16 @@ func TestPhp5(t *testing.T) { Property: &expr.Variable{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5918, - EndPos: 5919, + EndLine: 327, + StartPos: 5918, + EndPos: 5919, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5918, - EndPos: 5919, + EndLine: 327, + StartPos: 5918, + EndPos: 5919, }, Value: "c", }, @@ -15390,9 +15477,9 @@ func TestPhp5(t *testing.T) { Property: &node.Identifier{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5922, - EndPos: 5922, + EndLine: 327, + StartPos: 5922, + EndPos: 5922, }, Value: "d", }, @@ -15400,9 +15487,9 @@ func TestPhp5(t *testing.T) { Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5924, - EndPos: 5924, + EndLine: 327, + StartPos: 5924, + EndPos: 5924, }, Value: "0", }, @@ -15412,31 +15499,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5927, - EndPos: 5945, + EndLine: 327, + StartPos: 5927, + EndPos: 5945, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5934, - EndPos: 5944, + EndLine: 327, + StartPos: 5934, + EndPos: 5944, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5934, - EndPos: 5935, + EndLine: 327, + StartPos: 5934, + EndPos: 5935, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5934, - EndPos: 5935, + EndLine: 327, + StartPos: 5934, + EndPos: 5935, }, Value: "a", }, @@ -15444,31 +15531,31 @@ func TestPhp5(t *testing.T) { Expr: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5939, - EndPos: 5944, + EndLine: 327, + StartPos: 5939, + EndPos: 5944, }, Variable: &expr.ShortArray{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5939, - EndPos: 5941, + EndLine: 327, + StartPos: 5939, + EndPos: 5941, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5940, - EndPos: 5940, + EndLine: 327, + StartPos: 5940, + EndPos: 5940, }, Val: &scalar.Lnumber{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5940, - EndPos: 5940, + EndLine: 327, + StartPos: 5940, + EndPos: 5940, }, Value: "1", }, @@ -15478,9 +15565,9 @@ func TestPhp5(t *testing.T) { Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5943, - EndPos: 5943, + EndLine: 327, + StartPos: 5943, + EndPos: 5943, }, Value: "0", }, @@ -15491,31 +15578,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 329, - EndLine: 329, - StartPos: 5950, - EndPos: 5964, + EndLine: 329, + StartPos: 5950, + EndPos: 5964, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 329, - EndLine: 329, - StartPos: 5957, - EndPos: 5963, + EndLine: 329, + StartPos: 5957, + EndPos: 5963, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 329, - EndLine: 329, - StartPos: 5957, - EndPos: 5958, + EndLine: 329, + StartPos: 5957, + EndPos: 5958, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 329, - EndLine: 329, - StartPos: 5957, - EndPos: 5958, + EndLine: 329, + StartPos: 5957, + EndPos: 5958, }, Value: "a", }, @@ -15523,16 +15610,16 @@ func TestPhp5(t *testing.T) { Expr: &expr.BooleanNot{ Position: &position.Position{ StartLine: 329, - EndLine: 329, - StartPos: 5962, - EndPos: 5963, + EndLine: 329, + StartPos: 5962, + EndPos: 5963, }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 329, - EndLine: 329, - StartPos: 5963, - EndPos: 5963, + EndLine: 329, + StartPos: 5963, + EndPos: 5963, }, Value: "1", }, @@ -15543,31 +15630,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 330, - EndLine: 330, - StartPos: 5968, - EndPos: 5982, + EndLine: 330, + StartPos: 5968, + EndPos: 5982, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 330, - EndLine: 330, - StartPos: 5975, - EndPos: 5981, + EndLine: 330, + StartPos: 5975, + EndPos: 5981, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 330, - EndLine: 330, - StartPos: 5975, - EndPos: 5976, + EndLine: 330, + StartPos: 5975, + EndPos: 5976, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 330, - EndLine: 330, - StartPos: 5975, - EndPos: 5976, + EndLine: 330, + StartPos: 5975, + EndPos: 5976, }, Value: "a", }, @@ -15575,16 +15662,16 @@ func TestPhp5(t *testing.T) { Expr: &expr.BitwiseNot{ Position: &position.Position{ StartLine: 330, - EndLine: 330, - StartPos: 5980, - EndPos: 5981, + EndLine: 330, + StartPos: 5980, + EndPos: 5981, }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 330, - EndLine: 330, - StartPos: 5981, - EndPos: 5981, + EndLine: 330, + StartPos: 5981, + EndPos: 5981, }, Value: "1", }, @@ -15595,31 +15682,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 331, - EndLine: 331, - StartPos: 5986, - EndPos: 6000, + EndLine: 331, + StartPos: 5986, + EndPos: 6000, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 331, - EndLine: 331, - StartPos: 5993, - EndPos: 5999, + EndLine: 331, + StartPos: 5993, + EndPos: 5999, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 331, - EndLine: 331, - StartPos: 5993, - EndPos: 5994, + EndLine: 331, + StartPos: 5993, + EndPos: 5994, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 331, - EndLine: 331, - StartPos: 5993, - EndPos: 5994, + EndLine: 331, + StartPos: 5993, + EndPos: 5994, }, Value: "a", }, @@ -15627,16 +15714,16 @@ func TestPhp5(t *testing.T) { Expr: &expr.UnaryPlus{ Position: &position.Position{ StartLine: 331, - EndLine: 331, - StartPos: 5998, - EndPos: 5999, + EndLine: 331, + StartPos: 5998, + EndPos: 5999, }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 331, - EndLine: 331, - StartPos: 5999, - EndPos: 5999, + EndLine: 331, + StartPos: 5999, + EndPos: 5999, }, Value: "1", }, @@ -15647,31 +15734,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 332, - EndLine: 332, - StartPos: 6004, - EndPos: 6018, + EndLine: 332, + StartPos: 6004, + EndPos: 6018, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 332, - EndLine: 332, - StartPos: 6011, - EndPos: 6017, + EndLine: 332, + StartPos: 6011, + EndPos: 6017, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 332, - EndLine: 332, - StartPos: 6011, - EndPos: 6012, + EndLine: 332, + StartPos: 6011, + EndPos: 6012, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 332, - EndLine: 332, - StartPos: 6011, - EndPos: 6012, + EndLine: 332, + StartPos: 6011, + EndPos: 6012, }, Value: "a", }, @@ -15679,16 +15766,16 @@ func TestPhp5(t *testing.T) { Expr: &expr.UnaryMinus{ Position: &position.Position{ StartLine: 332, - EndLine: 332, - StartPos: 6016, - EndPos: 6017, + EndLine: 332, + StartPos: 6016, + EndPos: 6017, }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 332, - EndLine: 332, - StartPos: 6017, - EndPos: 6017, + EndLine: 332, + StartPos: 6017, + EndPos: 6017, }, Value: "1", }, @@ -15699,31 +15786,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 333, - EndLine: 333, - StartPos: 6022, - EndPos: 6037, + EndLine: 333, + StartPos: 6022, + EndPos: 6037, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 333, - EndLine: 333, - StartPos: 6029, - EndPos: 6035, + EndLine: 333, + StartPos: 6029, + EndPos: 6035, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 333, - EndLine: 333, - StartPos: 6029, - EndPos: 6030, + EndLine: 333, + StartPos: 6029, + EndPos: 6030, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 333, - EndLine: 333, - StartPos: 6029, - EndPos: 6030, + EndLine: 333, + StartPos: 6029, + EndPos: 6030, }, Value: "a", }, @@ -15731,9 +15818,9 @@ func TestPhp5(t *testing.T) { Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 333, - EndLine: 333, - StartPos: 6035, - EndPos: 6035, + EndLine: 333, + StartPos: 6035, + EndPos: 6035, }, Value: "1", }, @@ -15743,31 +15830,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 334, - EndLine: 334, - StartPos: 6041, - EndPos: 6059, + EndLine: 334, + StartPos: 6041, + EndPos: 6059, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 334, - EndLine: 334, - StartPos: 6048, - EndPos: 6058, + EndLine: 334, + StartPos: 6048, + EndPos: 6058, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 334, - EndLine: 334, - StartPos: 6048, - EndPos: 6049, + EndLine: 334, + StartPos: 6048, + EndPos: 6049, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 334, - EndLine: 334, - StartPos: 6048, - EndPos: 6049, + EndLine: 334, + StartPos: 6048, + EndPos: 6049, }, Value: "a", }, @@ -15775,25 +15862,25 @@ func TestPhp5(t *testing.T) { Expr: &expr.Ternary{ Position: &position.Position{ StartLine: 334, - EndLine: 334, - StartPos: 6053, - EndPos: 6058, + EndLine: 334, + StartPos: 6053, + EndPos: 6058, }, Condition: &scalar.Lnumber{ Position: &position.Position{ StartLine: 334, - EndLine: 334, - StartPos: 6053, - EndPos: 6053, + EndLine: 334, + StartPos: 6053, + EndPos: 6053, }, Value: "1", }, IfFalse: &scalar.Lnumber{ Position: &position.Position{ StartLine: 334, - EndLine: 334, - StartPos: 6058, - EndPos: 6058, + EndLine: 334, + StartPos: 6058, + EndPos: 6058, }, Value: "2", }, @@ -15804,31 +15891,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 335, - EndLine: 335, - StartPos: 6063, - EndPos: 6084, + EndLine: 335, + StartPos: 6063, + EndPos: 6084, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 335, - EndLine: 335, - StartPos: 6070, - EndPos: 6083, + EndLine: 335, + StartPos: 6070, + EndPos: 6083, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 335, - EndLine: 335, - StartPos: 6070, - EndPos: 6071, + EndLine: 335, + StartPos: 6070, + EndPos: 6071, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 335, - EndLine: 335, - StartPos: 6070, - EndPos: 6071, + EndLine: 335, + StartPos: 6070, + EndPos: 6071, }, Value: "a", }, @@ -15836,34 +15923,34 @@ func TestPhp5(t *testing.T) { Expr: &expr.Ternary{ Position: &position.Position{ StartLine: 335, - EndLine: 335, - StartPos: 6075, - EndPos: 6083, + EndLine: 335, + StartPos: 6075, + EndPos: 6083, }, Condition: &scalar.Lnumber{ Position: &position.Position{ StartLine: 335, - EndLine: 335, - StartPos: 6075, - EndPos: 6075, + EndLine: 335, + StartPos: 6075, + EndPos: 6075, }, Value: "1", }, IfTrue: &scalar.Lnumber{ Position: &position.Position{ StartLine: 335, - EndLine: 335, - StartPos: 6079, - EndPos: 6079, + EndLine: 335, + StartPos: 6079, + EndPos: 6079, }, Value: "2", }, IfFalse: &scalar.Lnumber{ Position: &position.Position{ StartLine: 335, - EndLine: 335, - StartPos: 6083, - EndPos: 6083, + EndLine: 335, + StartPos: 6083, + EndPos: 6083, }, Value: "3", }, @@ -15874,31 +15961,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 336, - EndLine: 336, - StartPos: 6088, - EndPos: 6105, + EndLine: 336, + StartPos: 6088, + EndPos: 6105, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 336, - EndLine: 336, - StartPos: 6095, - EndPos: 6104, + EndLine: 336, + StartPos: 6095, + EndPos: 6104, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 336, - EndLine: 336, - StartPos: 6095, - EndPos: 6096, + EndLine: 336, + StartPos: 6095, + EndPos: 6096, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 336, - EndLine: 336, - StartPos: 6095, - EndPos: 6096, + EndLine: 336, + StartPos: 6095, + EndPos: 6096, }, Value: "a", }, @@ -15906,25 +15993,25 @@ func TestPhp5(t *testing.T) { Expr: &binary.BitwiseAnd{ Position: &position.Position{ StartLine: 336, - EndLine: 336, - StartPos: 6100, - EndPos: 6104, + EndLine: 336, + StartPos: 6100, + EndPos: 6104, }, Left: &scalar.Lnumber{ Position: &position.Position{ StartLine: 336, - EndLine: 336, - StartPos: 6100, - EndPos: 6100, + EndLine: 336, + StartPos: 6100, + EndPos: 6100, }, Value: "1", }, Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 336, - EndLine: 336, - StartPos: 6104, - EndPos: 6104, + EndLine: 336, + StartPos: 6104, + EndPos: 6104, }, Value: "2", }, @@ -15935,31 +16022,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 337, - EndLine: 337, - StartPos: 6109, - EndPos: 6126, + EndLine: 337, + StartPos: 6109, + EndPos: 6126, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 337, - EndLine: 337, - StartPos: 6116, - EndPos: 6125, + EndLine: 337, + StartPos: 6116, + EndPos: 6125, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 337, - EndLine: 337, - StartPos: 6116, - EndPos: 6117, + EndLine: 337, + StartPos: 6116, + EndPos: 6117, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 337, - EndLine: 337, - StartPos: 6116, - EndPos: 6117, + EndLine: 337, + StartPos: 6116, + EndPos: 6117, }, Value: "a", }, @@ -15967,25 +16054,25 @@ func TestPhp5(t *testing.T) { Expr: &binary.BitwiseOr{ Position: &position.Position{ StartLine: 337, - EndLine: 337, - StartPos: 6121, - EndPos: 6125, + EndLine: 337, + StartPos: 6121, + EndPos: 6125, }, Left: &scalar.Lnumber{ Position: &position.Position{ StartLine: 337, - EndLine: 337, - StartPos: 6121, - EndPos: 6121, + EndLine: 337, + StartPos: 6121, + EndPos: 6121, }, Value: "1", }, Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 337, - EndLine: 337, - StartPos: 6125, - EndPos: 6125, + EndLine: 337, + StartPos: 6125, + EndPos: 6125, }, Value: "2", }, @@ -15996,31 +16083,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 338, - EndLine: 338, - StartPos: 6130, - EndPos: 6147, + EndLine: 338, + StartPos: 6130, + EndPos: 6147, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 338, - EndLine: 338, - StartPos: 6137, - EndPos: 6146, + EndLine: 338, + StartPos: 6137, + EndPos: 6146, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 338, - EndLine: 338, - StartPos: 6137, - EndPos: 6138, + EndLine: 338, + StartPos: 6137, + EndPos: 6138, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 338, - EndLine: 338, - StartPos: 6137, - EndPos: 6138, + EndLine: 338, + StartPos: 6137, + EndPos: 6138, }, Value: "a", }, @@ -16028,25 +16115,25 @@ func TestPhp5(t *testing.T) { Expr: &binary.BitwiseXor{ Position: &position.Position{ StartLine: 338, - EndLine: 338, - StartPos: 6142, - EndPos: 6146, + EndLine: 338, + StartPos: 6142, + EndPos: 6146, }, Left: &scalar.Lnumber{ Position: &position.Position{ StartLine: 338, - EndLine: 338, - StartPos: 6142, - EndPos: 6142, + EndLine: 338, + StartPos: 6142, + EndPos: 6142, }, Value: "1", }, Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 338, - EndLine: 338, - StartPos: 6146, - EndPos: 6146, + EndLine: 338, + StartPos: 6146, + EndPos: 6146, }, Value: "2", }, @@ -16057,31 +16144,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 339, - EndLine: 339, - StartPos: 6151, - EndPos: 6169, + EndLine: 339, + StartPos: 6151, + EndPos: 6169, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 339, - EndLine: 339, - StartPos: 6158, - EndPos: 6168, + EndLine: 339, + StartPos: 6158, + EndPos: 6168, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 339, - EndLine: 339, - StartPos: 6158, - EndPos: 6159, + EndLine: 339, + StartPos: 6158, + EndPos: 6159, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 339, - EndLine: 339, - StartPos: 6158, - EndPos: 6159, + EndLine: 339, + StartPos: 6158, + EndPos: 6159, }, Value: "a", }, @@ -16089,25 +16176,25 @@ func TestPhp5(t *testing.T) { Expr: &binary.BooleanAnd{ Position: &position.Position{ StartLine: 339, - EndLine: 339, - StartPos: 6163, - EndPos: 6168, + EndLine: 339, + StartPos: 6163, + EndPos: 6168, }, Left: &scalar.Lnumber{ Position: &position.Position{ StartLine: 339, - EndLine: 339, - StartPos: 6163, - EndPos: 6163, + EndLine: 339, + StartPos: 6163, + EndPos: 6163, }, Value: "1", }, Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 339, - EndLine: 339, - StartPos: 6168, - EndPos: 6168, + EndLine: 339, + StartPos: 6168, + EndPos: 6168, }, Value: "2", }, @@ -16118,31 +16205,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 340, - EndLine: 340, - StartPos: 6173, - EndPos: 6191, + EndLine: 340, + StartPos: 6173, + EndPos: 6191, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 340, - EndLine: 340, - StartPos: 6180, - EndPos: 6190, + EndLine: 340, + StartPos: 6180, + EndPos: 6190, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 340, - EndLine: 340, - StartPos: 6180, - EndPos: 6181, + EndLine: 340, + StartPos: 6180, + EndPos: 6181, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 340, - EndLine: 340, - StartPos: 6180, - EndPos: 6181, + EndLine: 340, + StartPos: 6180, + EndPos: 6181, }, Value: "a", }, @@ -16150,25 +16237,25 @@ func TestPhp5(t *testing.T) { Expr: &binary.BooleanOr{ Position: &position.Position{ StartLine: 340, - EndLine: 340, - StartPos: 6185, - EndPos: 6190, + EndLine: 340, + StartPos: 6185, + EndPos: 6190, }, Left: &scalar.Lnumber{ Position: &position.Position{ StartLine: 340, - EndLine: 340, - StartPos: 6185, - EndPos: 6185, + EndLine: 340, + StartPos: 6185, + EndPos: 6185, }, Value: "1", }, Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 340, - EndLine: 340, - StartPos: 6190, - EndPos: 6190, + EndLine: 340, + StartPos: 6190, + EndPos: 6190, }, Value: "2", }, @@ -16179,31 +16266,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 341, - EndLine: 341, - StartPos: 6195, - EndPos: 6212, + EndLine: 341, + StartPos: 6195, + EndPos: 6212, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 341, - EndLine: 341, - StartPos: 6202, - EndPos: 6211, + EndLine: 341, + StartPos: 6202, + EndPos: 6211, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 341, - EndLine: 341, - StartPos: 6202, - EndPos: 6203, + EndLine: 341, + StartPos: 6202, + EndPos: 6203, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 341, - EndLine: 341, - StartPos: 6202, - EndPos: 6203, + EndLine: 341, + StartPos: 6202, + EndPos: 6203, }, Value: "a", }, @@ -16211,25 +16298,25 @@ func TestPhp5(t *testing.T) { Expr: &binary.Concat{ Position: &position.Position{ StartLine: 341, - EndLine: 341, - StartPos: 6207, - EndPos: 6211, + EndLine: 341, + StartPos: 6207, + EndPos: 6211, }, Left: &scalar.Lnumber{ Position: &position.Position{ StartLine: 341, - EndLine: 341, - StartPos: 6207, - EndPos: 6207, + EndLine: 341, + StartPos: 6207, + EndPos: 6207, }, Value: "1", }, Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 341, - EndLine: 341, - StartPos: 6211, - EndPos: 6211, + EndLine: 341, + StartPos: 6211, + EndPos: 6211, }, Value: "2", }, @@ -16240,31 +16327,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 342, - EndLine: 342, - StartPos: 6216, - EndPos: 6233, + EndLine: 342, + StartPos: 6216, + EndPos: 6233, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 342, - EndLine: 342, - StartPos: 6223, - EndPos: 6232, + EndLine: 342, + StartPos: 6223, + EndPos: 6232, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 342, - EndLine: 342, - StartPos: 6223, - EndPos: 6224, + EndLine: 342, + StartPos: 6223, + EndPos: 6224, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 342, - EndLine: 342, - StartPos: 6223, - EndPos: 6224, + EndLine: 342, + StartPos: 6223, + EndPos: 6224, }, Value: "a", }, @@ -16272,25 +16359,25 @@ func TestPhp5(t *testing.T) { Expr: &binary.Div{ Position: &position.Position{ StartLine: 342, - EndLine: 342, - StartPos: 6228, - EndPos: 6232, + EndLine: 342, + StartPos: 6228, + EndPos: 6232, }, Left: &scalar.Lnumber{ Position: &position.Position{ StartLine: 342, - EndLine: 342, - StartPos: 6228, - EndPos: 6228, + EndLine: 342, + StartPos: 6228, + EndPos: 6228, }, Value: "1", }, Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 342, - EndLine: 342, - StartPos: 6232, - EndPos: 6232, + EndLine: 342, + StartPos: 6232, + EndPos: 6232, }, Value: "2", }, @@ -16301,31 +16388,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 343, - EndLine: 343, - StartPos: 6237, - EndPos: 6255, + EndLine: 343, + StartPos: 6237, + EndPos: 6255, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 343, - EndLine: 343, - StartPos: 6244, - EndPos: 6254, + EndLine: 343, + StartPos: 6244, + EndPos: 6254, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 343, - EndLine: 343, - StartPos: 6244, - EndPos: 6245, + EndLine: 343, + StartPos: 6244, + EndPos: 6245, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 343, - EndLine: 343, - StartPos: 6244, - EndPos: 6245, + EndLine: 343, + StartPos: 6244, + EndPos: 6245, }, Value: "a", }, @@ -16333,25 +16420,25 @@ func TestPhp5(t *testing.T) { Expr: &binary.Equal{ Position: &position.Position{ StartLine: 343, - EndLine: 343, - StartPos: 6249, - EndPos: 6254, + EndLine: 343, + StartPos: 6249, + EndPos: 6254, }, Left: &scalar.Lnumber{ Position: &position.Position{ StartLine: 343, - EndLine: 343, - StartPos: 6249, - EndPos: 6249, + EndLine: 343, + StartPos: 6249, + EndPos: 6249, }, Value: "1", }, Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 343, - EndLine: 343, - StartPos: 6254, - EndPos: 6254, + EndLine: 343, + StartPos: 6254, + EndPos: 6254, }, Value: "2", }, @@ -16362,31 +16449,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 344, - EndLine: 344, - StartPos: 6259, - EndPos: 6277, + EndLine: 344, + StartPos: 6259, + EndPos: 6277, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 344, - EndLine: 344, - StartPos: 6266, - EndPos: 6276, + EndLine: 344, + StartPos: 6266, + EndPos: 6276, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 344, - EndLine: 344, - StartPos: 6266, - EndPos: 6267, + EndLine: 344, + StartPos: 6266, + EndPos: 6267, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 344, - EndLine: 344, - StartPos: 6266, - EndPos: 6267, + EndLine: 344, + StartPos: 6266, + EndPos: 6267, }, Value: "a", }, @@ -16394,25 +16481,25 @@ func TestPhp5(t *testing.T) { Expr: &binary.GreaterOrEqual{ Position: &position.Position{ StartLine: 344, - EndLine: 344, - StartPos: 6271, - EndPos: 6276, + EndLine: 344, + StartPos: 6271, + EndPos: 6276, }, Left: &scalar.Lnumber{ Position: &position.Position{ StartLine: 344, - EndLine: 344, - StartPos: 6271, - EndPos: 6271, + EndLine: 344, + StartPos: 6271, + EndPos: 6271, }, Value: "1", }, Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 344, - EndLine: 344, - StartPos: 6276, - EndPos: 6276, + EndLine: 344, + StartPos: 6276, + EndPos: 6276, }, Value: "2", }, @@ -16423,31 +16510,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 345, - EndLine: 345, - StartPos: 6281, - EndPos: 6298, + EndLine: 345, + StartPos: 6281, + EndPos: 6298, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 345, - EndLine: 345, - StartPos: 6288, - EndPos: 6297, + EndLine: 345, + StartPos: 6288, + EndPos: 6297, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 345, - EndLine: 345, - StartPos: 6288, - EndPos: 6289, + EndLine: 345, + StartPos: 6288, + EndPos: 6289, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 345, - EndLine: 345, - StartPos: 6288, - EndPos: 6289, + EndLine: 345, + StartPos: 6288, + EndPos: 6289, }, Value: "a", }, @@ -16455,25 +16542,25 @@ func TestPhp5(t *testing.T) { Expr: &binary.Greater{ Position: &position.Position{ StartLine: 345, - EndLine: 345, - StartPos: 6293, - EndPos: 6297, + EndLine: 345, + StartPos: 6293, + EndPos: 6297, }, Left: &scalar.Lnumber{ Position: &position.Position{ StartLine: 345, - EndLine: 345, - StartPos: 6293, - EndPos: 6293, + EndLine: 345, + StartPos: 6293, + EndPos: 6293, }, Value: "1", }, Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 345, - EndLine: 345, - StartPos: 6297, - EndPos: 6297, + EndLine: 345, + StartPos: 6297, + EndPos: 6297, }, Value: "2", }, @@ -16484,31 +16571,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 346, - EndLine: 346, - StartPos: 6302, - EndPos: 6321, + EndLine: 346, + StartPos: 6302, + EndPos: 6321, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 346, - EndLine: 346, - StartPos: 6309, - EndPos: 6320, + EndLine: 346, + StartPos: 6309, + EndPos: 6320, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 346, - EndLine: 346, - StartPos: 6309, - EndPos: 6310, + EndLine: 346, + StartPos: 6309, + EndPos: 6310, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 346, - EndLine: 346, - StartPos: 6309, - EndPos: 6310, + EndLine: 346, + StartPos: 6309, + EndPos: 6310, }, Value: "a", }, @@ -16516,25 +16603,25 @@ func TestPhp5(t *testing.T) { Expr: &binary.Identical{ Position: &position.Position{ StartLine: 346, - EndLine: 346, - StartPos: 6314, - EndPos: 6320, + EndLine: 346, + StartPos: 6314, + EndPos: 6320, }, Left: &scalar.Lnumber{ Position: &position.Position{ StartLine: 346, - EndLine: 346, - StartPos: 6314, - EndPos: 6314, + EndLine: 346, + StartPos: 6314, + EndPos: 6314, }, Value: "1", }, Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 346, - EndLine: 346, - StartPos: 6320, - EndPos: 6320, + EndLine: 346, + StartPos: 6320, + EndPos: 6320, }, Value: "2", }, @@ -16545,31 +16632,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 347, - EndLine: 347, - StartPos: 6325, - EndPos: 6344, + EndLine: 347, + StartPos: 6325, + EndPos: 6344, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 347, - EndLine: 347, - StartPos: 6332, - EndPos: 6343, + EndLine: 347, + StartPos: 6332, + EndPos: 6343, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 347, - EndLine: 347, - StartPos: 6332, - EndPos: 6333, + EndLine: 347, + StartPos: 6332, + EndPos: 6333, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 347, - EndLine: 347, - StartPos: 6332, - EndPos: 6333, + EndLine: 347, + StartPos: 6332, + EndPos: 6333, }, Value: "a", }, @@ -16577,25 +16664,25 @@ func TestPhp5(t *testing.T) { Expr: &binary.LogicalAnd{ Position: &position.Position{ StartLine: 347, - EndLine: 347, - StartPos: 6337, - EndPos: 6343, + EndLine: 347, + StartPos: 6337, + EndPos: 6343, }, Left: &scalar.Lnumber{ Position: &position.Position{ StartLine: 347, - EndLine: 347, - StartPos: 6337, - EndPos: 6337, + EndLine: 347, + StartPos: 6337, + EndPos: 6337, }, Value: "1", }, Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 347, - EndLine: 347, - StartPos: 6343, - EndPos: 6343, + EndLine: 347, + StartPos: 6343, + EndPos: 6343, }, Value: "2", }, @@ -16606,31 +16693,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 348, - EndLine: 348, - StartPos: 6348, - EndPos: 6366, + EndLine: 348, + StartPos: 6348, + EndPos: 6366, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 348, - EndLine: 348, - StartPos: 6355, - EndPos: 6365, + EndLine: 348, + StartPos: 6355, + EndPos: 6365, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 348, - EndLine: 348, - StartPos: 6355, - EndPos: 6356, + EndLine: 348, + StartPos: 6355, + EndPos: 6356, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 348, - EndLine: 348, - StartPos: 6355, - EndPos: 6356, + EndLine: 348, + StartPos: 6355, + EndPos: 6356, }, Value: "a", }, @@ -16638,25 +16725,25 @@ func TestPhp5(t *testing.T) { Expr: &binary.LogicalOr{ Position: &position.Position{ StartLine: 348, - EndLine: 348, - StartPos: 6360, - EndPos: 6365, + EndLine: 348, + StartPos: 6360, + EndPos: 6365, }, Left: &scalar.Lnumber{ Position: &position.Position{ StartLine: 348, - EndLine: 348, - StartPos: 6360, - EndPos: 6360, + EndLine: 348, + StartPos: 6360, + EndPos: 6360, }, Value: "1", }, Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 348, - EndLine: 348, - StartPos: 6365, - EndPos: 6365, + EndLine: 348, + StartPos: 6365, + EndPos: 6365, }, Value: "2", }, @@ -16667,31 +16754,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 349, - EndLine: 349, - StartPos: 6370, - EndPos: 6389, + EndLine: 349, + StartPos: 6370, + EndPos: 6389, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 349, - EndLine: 349, - StartPos: 6377, - EndPos: 6388, + EndLine: 349, + StartPos: 6377, + EndPos: 6388, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 349, - EndLine: 349, - StartPos: 6377, - EndPos: 6378, + EndLine: 349, + StartPos: 6377, + EndPos: 6378, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 349, - EndLine: 349, - StartPos: 6377, - EndPos: 6378, + EndLine: 349, + StartPos: 6377, + EndPos: 6378, }, Value: "a", }, @@ -16699,25 +16786,25 @@ func TestPhp5(t *testing.T) { Expr: &binary.LogicalXor{ Position: &position.Position{ StartLine: 349, - EndLine: 349, - StartPos: 6382, - EndPos: 6388, + EndLine: 349, + StartPos: 6382, + EndPos: 6388, }, Left: &scalar.Lnumber{ Position: &position.Position{ StartLine: 349, - EndLine: 349, - StartPos: 6382, - EndPos: 6382, + EndLine: 349, + StartPos: 6382, + EndPos: 6382, }, Value: "1", }, Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 349, - EndLine: 349, - StartPos: 6388, - EndPos: 6388, + EndLine: 349, + StartPos: 6388, + EndPos: 6388, }, Value: "2", }, @@ -16728,31 +16815,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 350, - EndLine: 350, - StartPos: 6393, - EndPos: 6410, + EndLine: 350, + StartPos: 6393, + EndPos: 6410, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 350, - EndLine: 350, - StartPos: 6400, - EndPos: 6409, + EndLine: 350, + StartPos: 6400, + EndPos: 6409, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 350, - EndLine: 350, - StartPos: 6400, - EndPos: 6401, + EndLine: 350, + StartPos: 6400, + EndPos: 6401, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 350, - EndLine: 350, - StartPos: 6400, - EndPos: 6401, + EndLine: 350, + StartPos: 6400, + EndPos: 6401, }, Value: "a", }, @@ -16760,25 +16847,25 @@ func TestPhp5(t *testing.T) { Expr: &binary.Minus{ Position: &position.Position{ StartLine: 350, - EndLine: 350, - StartPos: 6405, - EndPos: 6409, + EndLine: 350, + StartPos: 6405, + EndPos: 6409, }, Left: &scalar.Lnumber{ Position: &position.Position{ StartLine: 350, - EndLine: 350, - StartPos: 6405, - EndPos: 6405, + EndLine: 350, + StartPos: 6405, + EndPos: 6405, }, Value: "1", }, Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 350, - EndLine: 350, - StartPos: 6409, - EndPos: 6409, + EndLine: 350, + StartPos: 6409, + EndPos: 6409, }, Value: "2", }, @@ -16789,31 +16876,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 351, - EndLine: 351, - StartPos: 6414, - EndPos: 6431, + EndLine: 351, + StartPos: 6414, + EndPos: 6431, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 351, - EndLine: 351, - StartPos: 6421, - EndPos: 6430, + EndLine: 351, + StartPos: 6421, + EndPos: 6430, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 351, - EndLine: 351, - StartPos: 6421, - EndPos: 6422, + EndLine: 351, + StartPos: 6421, + EndPos: 6422, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 351, - EndLine: 351, - StartPos: 6421, - EndPos: 6422, + EndLine: 351, + StartPos: 6421, + EndPos: 6422, }, Value: "a", }, @@ -16821,25 +16908,25 @@ func TestPhp5(t *testing.T) { Expr: &binary.Mod{ Position: &position.Position{ StartLine: 351, - EndLine: 351, - StartPos: 6426, - EndPos: 6430, + EndLine: 351, + StartPos: 6426, + EndPos: 6430, }, Left: &scalar.Lnumber{ Position: &position.Position{ StartLine: 351, - EndLine: 351, - StartPos: 6426, - EndPos: 6426, + EndLine: 351, + StartPos: 6426, + EndPos: 6426, }, Value: "1", }, Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 351, - EndLine: 351, - StartPos: 6430, - EndPos: 6430, + EndLine: 351, + StartPos: 6430, + EndPos: 6430, }, Value: "2", }, @@ -16850,31 +16937,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 352, - EndLine: 352, - StartPos: 6435, - EndPos: 6452, + EndLine: 352, + StartPos: 6435, + EndPos: 6452, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 352, - EndLine: 352, - StartPos: 6442, - EndPos: 6451, + EndLine: 352, + StartPos: 6442, + EndPos: 6451, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 352, - EndLine: 352, - StartPos: 6442, - EndPos: 6443, + EndLine: 352, + StartPos: 6442, + EndPos: 6443, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 352, - EndLine: 352, - StartPos: 6442, - EndPos: 6443, + EndLine: 352, + StartPos: 6442, + EndPos: 6443, }, Value: "a", }, @@ -16882,25 +16969,25 @@ func TestPhp5(t *testing.T) { Expr: &binary.Mul{ Position: &position.Position{ StartLine: 352, - EndLine: 352, - StartPos: 6447, - EndPos: 6451, + EndLine: 352, + StartPos: 6447, + EndPos: 6451, }, Left: &scalar.Lnumber{ Position: &position.Position{ StartLine: 352, - EndLine: 352, - StartPos: 6447, - EndPos: 6447, + EndLine: 352, + StartPos: 6447, + EndPos: 6447, }, Value: "1", }, Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 352, - EndLine: 352, - StartPos: 6451, - EndPos: 6451, + EndLine: 352, + StartPos: 6451, + EndPos: 6451, }, Value: "2", }, @@ -16911,31 +16998,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 353, - EndLine: 353, - StartPos: 6456, - EndPos: 6474, + EndLine: 353, + StartPos: 6456, + EndPos: 6474, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 353, - EndLine: 353, - StartPos: 6463, - EndPos: 6473, + EndLine: 353, + StartPos: 6463, + EndPos: 6473, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 353, - EndLine: 353, - StartPos: 6463, - EndPos: 6464, + EndLine: 353, + StartPos: 6463, + EndPos: 6464, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 353, - EndLine: 353, - StartPos: 6463, - EndPos: 6464, + EndLine: 353, + StartPos: 6463, + EndPos: 6464, }, Value: "a", }, @@ -16943,25 +17030,25 @@ func TestPhp5(t *testing.T) { Expr: &binary.NotEqual{ Position: &position.Position{ StartLine: 353, - EndLine: 353, - StartPos: 6468, - EndPos: 6473, + EndLine: 353, + StartPos: 6468, + EndPos: 6473, }, Left: &scalar.Lnumber{ Position: &position.Position{ StartLine: 353, - EndLine: 353, - StartPos: 6468, - EndPos: 6468, + EndLine: 353, + StartPos: 6468, + EndPos: 6468, }, Value: "1", }, Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 353, - EndLine: 353, - StartPos: 6473, - EndPos: 6473, + EndLine: 353, + StartPos: 6473, + EndPos: 6473, }, Value: "2", }, @@ -16972,31 +17059,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 354, - EndLine: 354, - StartPos: 6478, - EndPos: 6497, + EndLine: 354, + StartPos: 6478, + EndPos: 6497, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 354, - EndLine: 354, - StartPos: 6485, - EndPos: 6496, + EndLine: 354, + StartPos: 6485, + EndPos: 6496, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 354, - EndLine: 354, - StartPos: 6485, - EndPos: 6486, + EndLine: 354, + StartPos: 6485, + EndPos: 6486, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 354, - EndLine: 354, - StartPos: 6485, - EndPos: 6486, + EndLine: 354, + StartPos: 6485, + EndPos: 6486, }, Value: "a", }, @@ -17004,25 +17091,25 @@ func TestPhp5(t *testing.T) { Expr: &binary.NotIdentical{ Position: &position.Position{ StartLine: 354, - EndLine: 354, - StartPos: 6490, - EndPos: 6496, + EndLine: 354, + StartPos: 6490, + EndPos: 6496, }, Left: &scalar.Lnumber{ Position: &position.Position{ StartLine: 354, - EndLine: 354, - StartPos: 6490, - EndPos: 6490, + EndLine: 354, + StartPos: 6490, + EndPos: 6490, }, Value: "1", }, Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 354, - EndLine: 354, - StartPos: 6496, - EndPos: 6496, + EndLine: 354, + StartPos: 6496, + EndPos: 6496, }, Value: "2", }, @@ -17033,31 +17120,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 355, - EndLine: 355, - StartPos: 6501, - EndPos: 6518, + EndLine: 355, + StartPos: 6501, + EndPos: 6518, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 355, - EndLine: 355, - StartPos: 6508, - EndPos: 6517, + EndLine: 355, + StartPos: 6508, + EndPos: 6517, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 355, - EndLine: 355, - StartPos: 6508, - EndPos: 6509, + EndLine: 355, + StartPos: 6508, + EndPos: 6509, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 355, - EndLine: 355, - StartPos: 6508, - EndPos: 6509, + EndLine: 355, + StartPos: 6508, + EndPos: 6509, }, Value: "a", }, @@ -17065,25 +17152,25 @@ func TestPhp5(t *testing.T) { Expr: &binary.Plus{ Position: &position.Position{ StartLine: 355, - EndLine: 355, - StartPos: 6513, - EndPos: 6517, + EndLine: 355, + StartPos: 6513, + EndPos: 6517, }, Left: &scalar.Lnumber{ Position: &position.Position{ StartLine: 355, - EndLine: 355, - StartPos: 6513, - EndPos: 6513, + EndLine: 355, + StartPos: 6513, + EndPos: 6513, }, Value: "1", }, Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 355, - EndLine: 355, - StartPos: 6517, - EndPos: 6517, + EndLine: 355, + StartPos: 6517, + EndPos: 6517, }, Value: "2", }, @@ -17094,31 +17181,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 356, - EndLine: 356, - StartPos: 6522, - EndPos: 6540, + EndLine: 356, + StartPos: 6522, + EndPos: 6540, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 356, - EndLine: 356, - StartPos: 6529, - EndPos: 6539, + EndLine: 356, + StartPos: 6529, + EndPos: 6539, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 356, - EndLine: 356, - StartPos: 6529, - EndPos: 6530, + EndLine: 356, + StartPos: 6529, + EndPos: 6530, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 356, - EndLine: 356, - StartPos: 6529, - EndPos: 6530, + EndLine: 356, + StartPos: 6529, + EndPos: 6530, }, Value: "a", }, @@ -17126,25 +17213,25 @@ func TestPhp5(t *testing.T) { Expr: &binary.Pow{ Position: &position.Position{ StartLine: 356, - EndLine: 356, - StartPos: 6534, - EndPos: 6539, + EndLine: 356, + StartPos: 6534, + EndPos: 6539, }, Left: &scalar.Lnumber{ Position: &position.Position{ StartLine: 356, - EndLine: 356, - StartPos: 6534, - EndPos: 6534, + EndLine: 356, + StartPos: 6534, + EndPos: 6534, }, Value: "1", }, Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 356, - EndLine: 356, - StartPos: 6539, - EndPos: 6539, + EndLine: 356, + StartPos: 6539, + EndPos: 6539, }, Value: "2", }, @@ -17155,31 +17242,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 357, - EndLine: 357, - StartPos: 6544, - EndPos: 6562, + EndLine: 357, + StartPos: 6544, + EndPos: 6562, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 357, - EndLine: 357, - StartPos: 6551, - EndPos: 6561, + EndLine: 357, + StartPos: 6551, + EndPos: 6561, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 357, - EndLine: 357, - StartPos: 6551, - EndPos: 6552, + EndLine: 357, + StartPos: 6551, + EndPos: 6552, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 357, - EndLine: 357, - StartPos: 6551, - EndPos: 6552, + EndLine: 357, + StartPos: 6551, + EndPos: 6552, }, Value: "a", }, @@ -17187,25 +17274,25 @@ func TestPhp5(t *testing.T) { Expr: &binary.ShiftLeft{ Position: &position.Position{ StartLine: 357, - EndLine: 357, - StartPos: 6556, - EndPos: 6561, + EndLine: 357, + StartPos: 6556, + EndPos: 6561, }, Left: &scalar.Lnumber{ Position: &position.Position{ StartLine: 357, - EndLine: 357, - StartPos: 6556, - EndPos: 6556, + EndLine: 357, + StartPos: 6556, + EndPos: 6556, }, Value: "1", }, Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 357, - EndLine: 357, - StartPos: 6561, - EndPos: 6561, + EndLine: 357, + StartPos: 6561, + EndPos: 6561, }, Value: "2", }, @@ -17216,31 +17303,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 358, - EndLine: 358, - StartPos: 6566, - EndPos: 6584, + EndLine: 358, + StartPos: 6566, + EndPos: 6584, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 358, - EndLine: 358, - StartPos: 6573, - EndPos: 6583, + EndLine: 358, + StartPos: 6573, + EndPos: 6583, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 358, - EndLine: 358, - StartPos: 6573, - EndPos: 6574, + EndLine: 358, + StartPos: 6573, + EndPos: 6574, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 358, - EndLine: 358, - StartPos: 6573, - EndPos: 6574, + EndLine: 358, + StartPos: 6573, + EndPos: 6574, }, Value: "a", }, @@ -17248,25 +17335,25 @@ func TestPhp5(t *testing.T) { Expr: &binary.ShiftRight{ Position: &position.Position{ StartLine: 358, - EndLine: 358, - StartPos: 6578, - EndPos: 6583, + EndLine: 358, + StartPos: 6578, + EndPos: 6583, }, Left: &scalar.Lnumber{ Position: &position.Position{ StartLine: 358, - EndLine: 358, - StartPos: 6578, - EndPos: 6578, + EndLine: 358, + StartPos: 6578, + EndPos: 6578, }, Value: "1", }, Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 358, - EndLine: 358, - StartPos: 6583, - EndPos: 6583, + EndLine: 358, + StartPos: 6583, + EndPos: 6583, }, Value: "2", }, @@ -17277,31 +17364,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 359, - EndLine: 359, - StartPos: 6588, - EndPos: 6606, + EndLine: 359, + StartPos: 6588, + EndPos: 6606, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 359, - EndLine: 359, - StartPos: 6595, - EndPos: 6605, + EndLine: 359, + StartPos: 6595, + EndPos: 6605, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 359, - EndLine: 359, - StartPos: 6595, - EndPos: 6596, + EndLine: 359, + StartPos: 6595, + EndPos: 6596, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 359, - EndLine: 359, - StartPos: 6595, - EndPos: 6596, + EndLine: 359, + StartPos: 6595, + EndPos: 6596, }, Value: "a", }, @@ -17309,25 +17396,25 @@ func TestPhp5(t *testing.T) { Expr: &binary.SmallerOrEqual{ Position: &position.Position{ StartLine: 359, - EndLine: 359, - StartPos: 6600, - EndPos: 6605, + EndLine: 359, + StartPos: 6600, + EndPos: 6605, }, Left: &scalar.Lnumber{ Position: &position.Position{ StartLine: 359, - EndLine: 359, - StartPos: 6600, - EndPos: 6600, + EndLine: 359, + StartPos: 6600, + EndPos: 6600, }, Value: "1", }, Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 359, - EndLine: 359, - StartPos: 6605, - EndPos: 6605, + EndLine: 359, + StartPos: 6605, + EndPos: 6605, }, Value: "2", }, @@ -17338,31 +17425,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 360, - EndLine: 360, - StartPos: 6610, - EndPos: 6627, + EndLine: 360, + StartPos: 6610, + EndPos: 6627, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 360, - EndLine: 360, - StartPos: 6617, - EndPos: 6626, + EndLine: 360, + StartPos: 6617, + EndPos: 6626, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 360, - EndLine: 360, - StartPos: 6617, - EndPos: 6618, + EndLine: 360, + StartPos: 6617, + EndPos: 6618, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 360, - EndLine: 360, - StartPos: 6617, - EndPos: 6618, + EndLine: 360, + StartPos: 6617, + EndPos: 6618, }, Value: "a", }, @@ -17370,25 +17457,25 @@ func TestPhp5(t *testing.T) { Expr: &binary.Smaller{ Position: &position.Position{ StartLine: 360, - EndLine: 360, - StartPos: 6622, - EndPos: 6626, + EndLine: 360, + StartPos: 6622, + EndPos: 6626, }, Left: &scalar.Lnumber{ Position: &position.Position{ StartLine: 360, - EndLine: 360, - StartPos: 6622, - EndPos: 6622, + EndLine: 360, + StartPos: 6622, + EndPos: 6622, }, Value: "1", }, Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 360, - EndLine: 360, - StartPos: 6626, - EndPos: 6626, + EndLine: 360, + StartPos: 6626, + EndPos: 6626, }, Value: "2", }, @@ -17399,31 +17486,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 361, - EndLine: 361, - StartPos: 6631, - EndPos: 6651, + EndLine: 361, + StartPos: 6631, + EndPos: 6651, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 361, - EndLine: 361, - StartPos: 6638, - EndPos: 6650, + EndLine: 361, + StartPos: 6638, + EndPos: 6650, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 361, - EndLine: 361, - StartPos: 6638, - EndPos: 6639, + EndLine: 361, + StartPos: 6638, + EndPos: 6639, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 361, - EndLine: 361, - StartPos: 6638, - EndPos: 6639, + EndLine: 361, + StartPos: 6638, + EndPos: 6639, }, Value: "a", }, @@ -17431,24 +17518,24 @@ func TestPhp5(t *testing.T) { Expr: &expr.ClassConstFetch{ Position: &position.Position{ StartLine: 361, - EndLine: 361, - StartPos: 6643, - EndPos: 6650, + EndLine: 361, + StartPos: 6643, + EndPos: 6650, }, Class: &name.Name{ Position: &position.Position{ StartLine: 361, - EndLine: 361, - StartPos: 6643, - EndPos: 6645, + EndLine: 361, + StartPos: 6643, + EndPos: 6645, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 361, - EndLine: 361, - StartPos: 6643, - EndPos: 6645, + EndLine: 361, + StartPos: 6643, + EndPos: 6645, }, Value: "Foo", }, @@ -17457,9 +17544,9 @@ func TestPhp5(t *testing.T) { ConstantName: &node.Identifier{ Position: &position.Position{ StartLine: 361, - EndLine: 361, - StartPos: 6648, - EndPos: 6650, + EndLine: 361, + StartPos: 6648, + EndPos: 6650, }, Value: "bar", }, @@ -17470,31 +17557,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 362, - EndLine: 362, - StartPos: 6655, - EndPos: 6677, + EndLine: 362, + StartPos: 6655, + EndPos: 6677, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 362, - EndLine: 362, - StartPos: 6662, - EndPos: 6676, + EndLine: 362, + StartPos: 6662, + EndPos: 6676, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 362, - EndLine: 362, - StartPos: 6662, - EndPos: 6663, + EndLine: 362, + StartPos: 6662, + EndPos: 6663, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 362, - EndLine: 362, - StartPos: 6662, - EndPos: 6663, + EndLine: 362, + StartPos: 6662, + EndPos: 6663, }, Value: "a", }, @@ -17502,24 +17589,24 @@ func TestPhp5(t *testing.T) { Expr: &expr.ClassConstFetch{ Position: &position.Position{ StartLine: 362, - EndLine: 362, - StartPos: 6667, - EndPos: 6676, + EndLine: 362, + StartPos: 6667, + EndPos: 6676, }, Class: &name.Name{ Position: &position.Position{ StartLine: 362, - EndLine: 362, - StartPos: 6667, - EndPos: 6669, + EndLine: 362, + StartPos: 6667, + EndPos: 6669, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 362, - EndLine: 362, - StartPos: 6667, - EndPos: 6669, + EndLine: 362, + StartPos: 6667, + EndPos: 6669, }, Value: "Foo", }, @@ -17528,9 +17615,9 @@ func TestPhp5(t *testing.T) { ConstantName: &node.Identifier{ Position: &position.Position{ StartLine: 362, - EndLine: 362, - StartPos: 6672, - EndPos: 6676, + EndLine: 362, + StartPos: 6672, + EndPos: 6676, }, Value: "class", }, @@ -17541,31 +17628,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 363, - EndLine: 363, - StartPos: 6681, - EndPos: 6702, + EndLine: 363, + StartPos: 6681, + EndPos: 6702, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 363, - EndLine: 363, - StartPos: 6688, - EndPos: 6701, + EndLine: 363, + StartPos: 6688, + EndPos: 6701, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 363, - EndLine: 363, - StartPos: 6688, - EndPos: 6689, + EndLine: 363, + StartPos: 6688, + EndPos: 6689, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 363, - EndLine: 363, - StartPos: 6688, - EndPos: 6689, + EndLine: 363, + StartPos: 6688, + EndPos: 6689, }, Value: "a", }, @@ -17573,9 +17660,9 @@ func TestPhp5(t *testing.T) { Expr: &scalar.MagicConstant{ Position: &position.Position{ StartLine: 363, - EndLine: 363, - StartPos: 6693, - EndPos: 6701, + EndLine: 363, + StartPos: 6693, + EndPos: 6701, }, Value: "__CLASS__", }, @@ -17585,31 +17672,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 364, - EndLine: 364, - StartPos: 6706, - EndPos: 6721, + EndLine: 364, + StartPos: 6706, + EndPos: 6721, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 364, - EndLine: 364, - StartPos: 6713, - EndPos: 6720, + EndLine: 364, + StartPos: 6713, + EndPos: 6720, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 364, - EndLine: 364, - StartPos: 6713, - EndPos: 6714, + EndLine: 364, + StartPos: 6713, + EndPos: 6714, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 364, - EndLine: 364, - StartPos: 6713, - EndPos: 6714, + EndLine: 364, + StartPos: 6713, + EndPos: 6714, }, Value: "a", }, @@ -17617,24 +17704,24 @@ func TestPhp5(t *testing.T) { Expr: &expr.ConstFetch{ Position: &position.Position{ StartLine: 364, - EndLine: 364, - StartPos: 6718, - EndPos: 6720, + EndLine: 364, + StartPos: 6718, + EndPos: 6720, }, Constant: &name.Name{ Position: &position.Position{ StartLine: 364, - EndLine: 364, - StartPos: 6718, - EndPos: 6720, + EndLine: 364, + StartPos: 6718, + EndPos: 6720, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 364, - EndLine: 364, - StartPos: 6718, - EndPos: 6720, + EndLine: 364, + StartPos: 6718, + EndPos: 6720, }, Value: "Foo", }, @@ -17647,31 +17734,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 365, - EndLine: 365, - StartPos: 6725, - EndPos: 6750, + EndLine: 365, + StartPos: 6725, + EndPos: 6750, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 365, - EndLine: 365, - StartPos: 6732, - EndPos: 6749, + EndLine: 365, + StartPos: 6732, + EndPos: 6749, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 365, - EndLine: 365, - StartPos: 6732, - EndPos: 6733, + EndLine: 365, + StartPos: 6732, + EndPos: 6733, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 365, - EndLine: 365, - StartPos: 6732, - EndPos: 6733, + EndLine: 365, + StartPos: 6732, + EndPos: 6733, }, Value: "a", }, @@ -17679,24 +17766,24 @@ func TestPhp5(t *testing.T) { Expr: &expr.ConstFetch{ Position: &position.Position{ StartLine: 365, - EndLine: 365, - StartPos: 6737, - EndPos: 6749, + EndLine: 365, + StartPos: 6737, + EndPos: 6749, }, Constant: &name.Relative{ Position: &position.Position{ StartLine: 365, - EndLine: 365, - StartPos: 6737, - EndPos: 6749, + EndLine: 365, + StartPos: 6737, + EndPos: 6749, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 365, - EndLine: 365, - StartPos: 6747, - EndPos: 6749, + EndLine: 365, + StartPos: 6747, + EndPos: 6749, }, Value: "Foo", }, @@ -17709,31 +17796,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 366, - EndLine: 366, - StartPos: 6754, - EndPos: 6770, + EndLine: 366, + StartPos: 6754, + EndPos: 6770, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 366, - EndLine: 366, - StartPos: 6761, - EndPos: 6769, + EndLine: 366, + StartPos: 6761, + EndPos: 6769, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 366, - EndLine: 366, - StartPos: 6761, - EndPos: 6762, + EndLine: 366, + StartPos: 6761, + EndPos: 6762, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 366, - EndLine: 366, - StartPos: 6761, - EndPos: 6762, + EndLine: 366, + StartPos: 6761, + EndPos: 6762, }, Value: "a", }, @@ -17741,24 +17828,24 @@ func TestPhp5(t *testing.T) { Expr: &expr.ConstFetch{ Position: &position.Position{ StartLine: 366, - EndLine: 366, - StartPos: 6766, - EndPos: 6769, + EndLine: 366, + StartPos: 6766, + EndPos: 6769, }, Constant: &name.FullyQualified{ Position: &position.Position{ StartLine: 366, - EndLine: 366, - StartPos: 6766, - EndPos: 6769, + EndLine: 366, + StartPos: 6766, + EndPos: 6769, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 366, - EndLine: 366, - StartPos: 6767, - EndPos: 6769, + EndLine: 366, + StartPos: 6767, + EndPos: 6769, }, Value: "Foo", }, @@ -17771,31 +17858,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 367, - EndLine: 367, - StartPos: 6774, - EndPos: 6793, + EndLine: 367, + StartPos: 6774, + EndPos: 6793, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 367, - EndLine: 367, - StartPos: 6781, - EndPos: 6792, + EndLine: 367, + StartPos: 6781, + EndPos: 6792, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 367, - EndLine: 367, - StartPos: 6781, - EndPos: 6782, + EndLine: 367, + StartPos: 6781, + EndPos: 6782, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 367, - EndLine: 367, - StartPos: 6781, - EndPos: 6782, + EndLine: 367, + StartPos: 6781, + EndPos: 6782, }, Value: "a", }, @@ -17803,9 +17890,9 @@ func TestPhp5(t *testing.T) { Expr: &expr.Array{ Position: &position.Position{ StartLine: 367, - EndLine: 367, - StartPos: 6786, - EndPos: 6792, + EndLine: 367, + StartPos: 6786, + EndPos: 6792, }, }, }, @@ -17814,31 +17901,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 368, - EndLine: 368, - StartPos: 6797, - EndPos: 6825, + EndLine: 368, + StartPos: 6797, + EndPos: 6825, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 368, - EndLine: 368, - StartPos: 6804, - EndPos: 6824, + EndLine: 368, + StartPos: 6804, + EndPos: 6824, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 368, - EndLine: 368, - StartPos: 6804, - EndPos: 6805, + EndLine: 368, + StartPos: 6804, + EndPos: 6805, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 368, - EndLine: 368, - StartPos: 6804, - EndPos: 6805, + EndLine: 368, + StartPos: 6804, + EndPos: 6805, }, Value: "a", }, @@ -17846,33 +17933,33 @@ func TestPhp5(t *testing.T) { Expr: &expr.Array{ Position: &position.Position{ StartLine: 368, - EndLine: 368, - StartPos: 6809, - EndPos: 6824, + EndLine: 368, + StartPos: 6809, + EndPos: 6824, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 368, - EndLine: 368, - StartPos: 6815, - EndPos: 6820, + EndLine: 368, + StartPos: 6815, + EndPos: 6820, }, Key: &scalar.Lnumber{ Position: &position.Position{ StartLine: 368, - EndLine: 368, - StartPos: 6815, - EndPos: 6815, + EndLine: 368, + StartPos: 6815, + EndPos: 6815, }, Value: "1", }, Val: &scalar.Lnumber{ Position: &position.Position{ StartLine: 368, - EndLine: 368, - StartPos: 6820, - EndPos: 6820, + EndLine: 368, + StartPos: 6820, + EndPos: 6820, }, Value: "1", }, @@ -17880,16 +17967,16 @@ func TestPhp5(t *testing.T) { &expr.ArrayItem{ Position: &position.Position{ StartLine: 368, - EndLine: 368, - StartPos: 6823, - EndPos: 6823, + EndLine: 368, + StartPos: 6823, + EndPos: 6823, }, Val: &scalar.Lnumber{ Position: &position.Position{ StartLine: 368, - EndLine: 368, - StartPos: 6823, - EndPos: 6823, + EndLine: 368, + StartPos: 6823, + EndPos: 6823, }, Value: "2", }, @@ -17902,31 +17989,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 369, - EndLine: 369, - StartPos: 6829, - EndPos: 6855, + EndLine: 369, + StartPos: 6829, + EndPos: 6855, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 369, - EndLine: 369, - StartPos: 6836, - EndPos: 6854, + EndLine: 369, + StartPos: 6836, + EndPos: 6854, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 369, - EndLine: 369, - StartPos: 6836, - EndPos: 6837, + EndLine: 369, + StartPos: 6836, + EndPos: 6837, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 369, - EndLine: 369, - StartPos: 6836, - EndPos: 6837, + EndLine: 369, + StartPos: 6836, + EndPos: 6837, }, Value: "a", }, @@ -17934,31 +18021,31 @@ func TestPhp5(t *testing.T) { Expr: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 369, - EndLine: 369, - StartPos: 6841, - EndPos: 6854, + EndLine: 369, + StartPos: 6841, + EndPos: 6854, }, Variable: &expr.ShortArray{ Position: &position.Position{ StartLine: 369, - EndLine: 369, - StartPos: 6841, - EndPos: 6851, + EndLine: 369, + StartPos: 6841, + EndPos: 6851, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 369, - EndLine: 369, - StartPos: 6842, - EndPos: 6842, + EndLine: 369, + StartPos: 6842, + EndPos: 6842, }, Val: &scalar.Lnumber{ Position: &position.Position{ StartLine: 369, - EndLine: 369, - StartPos: 6842, - EndPos: 6842, + EndLine: 369, + StartPos: 6842, + EndPos: 6842, }, Value: "1", }, @@ -17966,25 +18053,25 @@ func TestPhp5(t *testing.T) { &expr.ArrayItem{ Position: &position.Position{ StartLine: 369, - EndLine: 369, - StartPos: 6845, - EndPos: 6850, + EndLine: 369, + StartPos: 6845, + EndPos: 6850, }, Key: &scalar.Lnumber{ Position: &position.Position{ StartLine: 369, - EndLine: 369, - StartPos: 6845, - EndPos: 6845, + EndLine: 369, + StartPos: 6845, + EndPos: 6845, }, Value: "2", }, Val: &scalar.Lnumber{ Position: &position.Position{ StartLine: 369, - EndLine: 369, - StartPos: 6850, - EndPos: 6850, + EndLine: 369, + StartPos: 6850, + EndPos: 6850, }, Value: "2", }, @@ -17994,9 +18081,9 @@ func TestPhp5(t *testing.T) { Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 369, - EndLine: 369, - StartPos: 6853, - EndPos: 6853, + EndLine: 369, + StartPos: 6853, + EndPos: 6853, }, Value: "0", }, @@ -18007,23 +18094,23 @@ func TestPhp5(t *testing.T) { &stmt.If{ Position: &position.Position{ StartLine: 371, - EndLine: 371, - StartPos: 6860, - EndPos: 6874, + EndLine: 371, + StartPos: 6860, + EndPos: 6874, }, Cond: &expr.Yield{ Position: &position.Position{ StartLine: 371, - EndLine: 371, - StartPos: 6864, - EndPos: 6870, + EndLine: 371, + StartPos: 6864, + EndPos: 6870, }, Value: &scalar.Lnumber{ Position: &position.Position{ StartLine: 371, - EndLine: 371, - StartPos: 6870, - EndPos: 6870, + EndLine: 371, + StartPos: 6870, + EndPos: 6870, }, Value: "1", }, @@ -18031,41 +18118,42 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 371, - EndLine: 371, - StartPos: 6873, - EndPos: 6874, + EndLine: 371, + StartPos: 6873, + EndPos: 6874, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 372, - EndLine: 372, - StartPos: 6878, - EndPos: 6888, + EndLine: 372, + StartPos: 6878, + EndPos: 6888, }, Expr: &expr.StaticPropertyFetch{ Position: &position.Position{ StartLine: 372, - EndLine: 372, - StartPos: 6878, - EndPos: 6887, + EndLine: 372, + StartPos: 6878, + EndPos: 6887, }, Class: &name.Name{ Position: &position.Position{ StartLine: 372, - EndLine: 372, - StartPos: 6878, - EndPos: 6880, + EndLine: 372, + StartPos: 6878, + EndPos: 6880, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 372, - EndLine: 372, - StartPos: 6878, - EndPos: 6880, + EndLine: 372, + StartPos: 6878, + EndPos: 6880, }, Value: "Foo", }, @@ -18074,23 +18162,23 @@ func TestPhp5(t *testing.T) { Property: &expr.Variable{ Position: &position.Position{ StartLine: 372, - EndLine: 372, - StartPos: 6883, - EndPos: 6887, + EndLine: 372, + StartPos: 6883, + EndPos: 6887, }, VarName: &expr.Variable{ Position: &position.Position{ StartLine: 372, - EndLine: 372, - StartPos: 6884, - EndPos: 6887, + EndLine: 372, + StartPos: 6884, + EndPos: 6887, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 372, - EndLine: 372, - StartPos: 6884, - EndPos: 6887, + EndLine: 372, + StartPos: 6884, + EndPos: 6887, }, Value: "bar", }, @@ -18101,30 +18189,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 374, - EndLine: 374, - StartPos: 6893, - EndPos: 6899, + EndLine: 374, + StartPos: 6893, + EndPos: 6899, }, Expr: &expr.FunctionCall{ Position: &position.Position{ StartLine: 374, - EndLine: 374, - StartPos: 6893, - EndPos: 6898, + EndLine: 374, + StartPos: 6893, + EndPos: 6898, }, Function: &expr.Variable{ Position: &position.Position{ StartLine: 374, - EndLine: 374, - StartPos: 6893, - EndPos: 6896, + EndLine: 374, + StartPos: 6893, + EndPos: 6896, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 374, - EndLine: 374, - StartPos: 6893, - EndPos: 6896, + EndLine: 374, + StartPos: 6893, + EndPos: 6896, }, Value: "foo", }, @@ -18132,9 +18220,9 @@ func TestPhp5(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 374, - EndLine: 374, - StartPos: 6897, - EndPos: 6898, + EndLine: 374, + StartPos: 6897, + EndPos: 6898, }, }, }, @@ -18142,44 +18230,44 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 375, - EndLine: 375, - StartPos: 6903, - EndPos: 6915, + EndLine: 375, + StartPos: 6903, + EndPos: 6915, }, Expr: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 375, - EndLine: 375, - StartPos: 6903, - EndPos: 6914, + EndLine: 375, + StartPos: 6903, + EndPos: 6914, }, Variable: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 375, - EndLine: 375, - StartPos: 6903, - EndPos: 6911, + EndLine: 375, + StartPos: 6903, + EndPos: 6911, }, Variable: &expr.FunctionCall{ Position: &position.Position{ StartLine: 375, - EndLine: 375, - StartPos: 6903, - EndPos: 6908, + EndLine: 375, + StartPos: 6903, + EndPos: 6908, }, Function: &expr.Variable{ Position: &position.Position{ StartLine: 375, - EndLine: 375, - StartPos: 6903, - EndPos: 6906, + EndLine: 375, + StartPos: 6903, + EndPos: 6906, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 375, - EndLine: 375, - StartPos: 6903, - EndPos: 6906, + EndLine: 375, + StartPos: 6903, + EndPos: 6906, }, Value: "foo", }, @@ -18187,18 +18275,18 @@ func TestPhp5(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 375, - EndLine: 375, - StartPos: 6907, - EndPos: 6908, + EndLine: 375, + StartPos: 6907, + EndPos: 6908, }, }, }, Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 375, - EndLine: 375, - StartPos: 6910, - EndPos: 6910, + EndLine: 375, + StartPos: 6910, + EndPos: 6910, }, Value: "0", }, @@ -18206,9 +18294,9 @@ func TestPhp5(t *testing.T) { Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 375, - EndLine: 375, - StartPos: 6913, - EndPos: 6913, + EndLine: 375, + StartPos: 6913, + EndPos: 6913, }, Value: "0", }, @@ -18217,30 +18305,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 376, - EndLine: 376, - StartPos: 6919, - EndPos: 6925, + EndLine: 376, + StartPos: 6919, + EndPos: 6925, }, Expr: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 376, - EndLine: 376, - StartPos: 6919, - EndPos: 6924, + EndLine: 376, + StartPos: 6919, + EndPos: 6924, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 376, - EndLine: 376, - StartPos: 6919, - EndPos: 6920, + EndLine: 376, + StartPos: 6919, + EndPos: 6920, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 376, - EndLine: 376, - StartPos: 6919, - EndPos: 6920, + EndLine: 376, + StartPos: 6919, + EndPos: 6920, }, Value: "a", }, @@ -18248,16 +18336,16 @@ func TestPhp5(t *testing.T) { Dim: &expr.Variable{ Position: &position.Position{ StartLine: 376, - EndLine: 376, - StartPos: 6922, - EndPos: 6923, + EndLine: 376, + StartPos: 6922, + EndPos: 6923, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 376, - EndLine: 376, - StartPos: 6922, - EndPos: 6923, + EndLine: 376, + StartPos: 6922, + EndPos: 6923, }, Value: "b", }, @@ -18267,30 +18355,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 377, - EndLine: 377, - StartPos: 6929, - EndPos: 6934, + EndLine: 377, + StartPos: 6929, + EndPos: 6934, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 377, - EndLine: 377, - StartPos: 6929, - EndPos: 6933, + EndLine: 377, + StartPos: 6929, + EndPos: 6933, }, VarName: &expr.Variable{ Position: &position.Position{ StartLine: 377, - EndLine: 377, - StartPos: 6931, - EndPos: 6932, + EndLine: 377, + StartPos: 6931, + EndPos: 6932, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 377, - EndLine: 377, - StartPos: 6931, - EndPos: 6932, + EndLine: 377, + StartPos: 6931, + EndPos: 6932, }, Value: "a", }, @@ -18300,30 +18388,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 378, - EndLine: 378, - StartPos: 6938, - EndPos: 6952, + EndLine: 378, + StartPos: 6938, + EndPos: 6952, }, Expr: &expr.StaticCall{ Position: &position.Position{ StartLine: 378, - EndLine: 378, - StartPos: 6938, - EndPos: 6951, + EndLine: 378, + StartPos: 6938, + EndPos: 6951, }, Class: &expr.Variable{ Position: &position.Position{ StartLine: 378, - EndLine: 378, - StartPos: 6938, - EndPos: 6941, + EndLine: 378, + StartPos: 6938, + EndPos: 6941, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 378, - EndLine: 378, - StartPos: 6938, - EndPos: 6941, + EndLine: 378, + StartPos: 6938, + EndPos: 6941, }, Value: "foo", }, @@ -18331,16 +18419,16 @@ func TestPhp5(t *testing.T) { Call: &expr.Variable{ Position: &position.Position{ StartLine: 378, - EndLine: 378, - StartPos: 6944, - EndPos: 6949, + EndLine: 378, + StartPos: 6944, + EndPos: 6949, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 378, - EndLine: 378, - StartPos: 6945, - EndPos: 6948, + EndLine: 378, + StartPos: 6945, + EndPos: 6948, }, Value: "bar", }, @@ -18348,9 +18436,9 @@ func TestPhp5(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 378, - EndLine: 378, - StartPos: 6950, - EndPos: 6951, + EndLine: 378, + StartPos: 6950, + EndPos: 6951, }, }, }, @@ -18358,30 +18446,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 379, - EndLine: 379, - StartPos: 6956, - EndPos: 6965, + EndLine: 379, + StartPos: 6956, + EndPos: 6965, }, Expr: &expr.ClassConstFetch{ Position: &position.Position{ StartLine: 379, - EndLine: 379, - StartPos: 6956, - EndPos: 6964, + EndLine: 379, + StartPos: 6956, + EndPos: 6964, }, Class: &expr.Variable{ Position: &position.Position{ StartLine: 379, - EndLine: 379, - StartPos: 6956, - EndPos: 6959, + EndLine: 379, + StartPos: 6956, + EndPos: 6959, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 379, - EndLine: 379, - StartPos: 6956, - EndPos: 6959, + EndLine: 379, + StartPos: 6956, + EndPos: 6959, }, Value: "foo", }, @@ -18389,9 +18477,9 @@ func TestPhp5(t *testing.T) { ConstantName: &node.Identifier{ Position: &position.Position{ StartLine: 379, - EndLine: 379, - StartPos: 6962, - EndPos: 6964, + EndLine: 379, + StartPos: 6962, + EndPos: 6964, }, Value: "bar", }, diff --git a/php7/parser.go b/php7/parser.go index 61cabea..0e24b0f 100644 --- a/php7/parser.go +++ b/php7/parser.go @@ -3,6 +3,8 @@ package php7 import ( "io" + "github.com/z7zmey/php-parser/meta" + "github.com/z7zmey/php-parser/errors" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/parser" @@ -21,7 +23,6 @@ type Parser struct { positionBuilder *parser.PositionBuilder errors []*errors.Error rootNode node.Node - comments parser.Comments } // NewParser creates and returns new Parser @@ -35,7 +36,6 @@ func NewParser(src io.Reader, path string) *Parser { nil, nil, nil, - nil, } } @@ -50,12 +50,15 @@ func (l *Parser) Error(msg string) { l.errors = append(l.errors, errors.NewError(msg, l.currentToken)) } +func (l *Parser) WithMeta() { + l.Lexer.WithMeta = true +} + // Parse the php7 Parser entrypoint func (l *Parser) Parse() int { // init l.errors = nil l.rootNode = nil - l.comments = parser.Comments{} l.positionBuilder = &parser.PositionBuilder{} // parse @@ -78,11 +81,6 @@ func (l *Parser) GetErrors() []*errors.Error { return l.errors } -// GetComments returns comments list -func (l *Parser) GetComments() parser.Comments { - return l.comments -} - // helpers func lastNode(nn []node.Node) node.Node { @@ -100,6 +98,14 @@ func isDollar(r rune) bool { return r == '$' } +func addMeta(n node.Node, mm []meta.Meta, tn meta.TokenName) { + for _, m := range mm { + m.SetTokenName(tn) + } + + n.AddMeta(mm) +} + func (p *Parser) returnTokenToPool(yyDollar []yySymType, yyVAL *yySymType) { for i := 1; i < len(yyDollar); i++ { if yyDollar[i].token != nil { diff --git a/php7/php7.go b/php7/php7.go index 149e7de..5109b8c 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -8,7 +8,7 @@ import ( "strconv" "strings" - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node/expr" "github.com/z7zmey/php-parser/node/expr/assign" @@ -346,7 +346,7 @@ const yyEofCode = 1 const yyErrCode = 2 const yyInitialStackSize = 16 -//line php7/php7.y:5350 +//line php7/php7.y:5345 //line yacctab:1 var yyExca = [...]int{ @@ -2608,7 +2608,7 @@ yydefault: namePart.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - namePart.AddComments(yyDollar[1].token.Comments, comment.StringToken) + addMeta(namePart, yyDollar[1].token.Meta, meta.StringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2623,8 +2623,8 @@ yydefault: namePart.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) // save comments - lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.NsSeparatorToken) - namePart.AddComments(yyDollar[3].token.Comments, comment.StringToken) + addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.NsSeparatorToken) + addMeta(namePart, yyDollar[3].token.Meta, meta.StringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2649,8 +2649,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.NamespaceToken) - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.NsSeparatorToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.NamespaceToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.NsSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2664,7 +2664,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.NsSeparatorToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.NsSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2727,10 +2727,10 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.HaltCompilerToken) - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenParenthesisToken) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.CloseParenthesisToken) - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.SemiColonToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.HaltCompilerToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenParenthesisToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.CloseParenthesisToken) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2746,8 +2746,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.NamespaceToken) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.SemiColonToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.NamespaceToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2763,9 +2763,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[5].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.NamespaceToken) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.OpenCurlyBracesToken) - yyVAL.node.AddComments(yyDollar[5].token.Comments, comment.CloseCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.NamespaceToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.OpenCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[5].token.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2779,9 +2779,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.NamespaceToken) - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenCurlyBracesToken) - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.NamespaceToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2795,8 +2795,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.UseToken) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.SemiColonToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.UseToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2810,8 +2810,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.UseToken) - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.SemiColonToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.UseToken) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2825,8 +2825,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.UseToken) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.SemiColonToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.UseToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2840,8 +2840,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.UseToken) - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.SemiColonToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.UseToken) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2855,8 +2855,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ConstToken) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.SemiColonToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ConstToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2870,7 +2870,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.FunctionToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.FunctionToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2884,7 +2884,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ConstToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ConstToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2900,12 +2900,12 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition(yyDollar[1].list, yyDollar[6].token)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.NsSeparatorToken) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.OpenCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.NsSeparatorToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.OpenCurlyBracesToken) if yyDollar[5].token != nil { - yyVAL.node.AddComments(yyDollar[5].token.Comments, comment.CommaToken) + addMeta(yyVAL.node, yyDollar[5].token.Meta, meta.CommaToken) } - yyVAL.node.AddComments(yyDollar[6].token.Comments, comment.CloseCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[6].token.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2921,13 +2921,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[7].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.NsSeparatorToken) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.NsSeparatorToken) - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.OpenCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.NsSeparatorToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.NsSeparatorToken) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.OpenCurlyBracesToken) if yyDollar[6].token != nil { - yyVAL.node.AddComments(yyDollar[6].token.Comments, comment.CommaToken) + addMeta(yyVAL.node, yyDollar[6].token.Meta, meta.CommaToken) } - yyVAL.node.AddComments(yyDollar[7].token.Comments, comment.CloseCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[7].token.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2943,12 +2943,12 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition(yyDollar[1].list, yyDollar[6].token)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.NsSeparatorToken) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.OpenCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.NsSeparatorToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.OpenCurlyBracesToken) if yyDollar[5].token != nil { - yyVAL.node.AddComments(yyDollar[5].token.Comments, comment.CommaToken) + addMeta(yyVAL.node, yyDollar[5].token.Meta, meta.CommaToken) } - yyVAL.node.AddComments(yyDollar[6].token.Comments, comment.CloseCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[6].token.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2964,13 +2964,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[7].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.NsSeparatorToken) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.NsSeparatorToken) - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.OpenCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.NsSeparatorToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.NsSeparatorToken) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.OpenCurlyBracesToken) if yyDollar[6].token != nil { - yyVAL.node.AddComments(yyDollar[6].token.Comments, comment.CommaToken) + addMeta(yyVAL.node, yyDollar[6].token.Meta, meta.CommaToken) } - yyVAL.node.AddComments(yyDollar[7].token.Comments, comment.CloseCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[7].token.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2993,7 +2993,7 @@ yydefault: yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) + addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3012,7 +3012,7 @@ yydefault: yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) + addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3031,7 +3031,7 @@ yydefault: yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) + addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3086,8 +3086,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition(yyDollar[1].list, yyDollar[3].token)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.AsToken) - alias.AddComments(yyDollar[3].token.Comments, comment.StringToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.AsToken) + addMeta(alias, yyDollar[3].token.Meta, meta.StringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3106,7 +3106,7 @@ yydefault: yyVAL.node = yyDollar[2].node // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.NsSeparatorToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.NsSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3117,7 +3117,7 @@ yydefault: yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) + addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3206,10 +3206,10 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.HaltCompilerToken) - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenParenthesisToken) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.CloseParenthesisToken) - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.SemiColonToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.HaltCompilerToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenParenthesisToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.CloseParenthesisToken) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3223,8 +3223,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.OpenCurlyBracesToken) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.CloseCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.OpenCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3261,9 +3261,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[5].node)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.WhileToken) - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenParenthesisToken) - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseParenthesisToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.WhileToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenParenthesisToken) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3277,11 +3277,11 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[7].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.DoToken) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.WhileToken) - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.OpenParenthesisToken) - yyVAL.node.AddComments(yyDollar[6].token.Comments, comment.CloseParenthesisToken) - yyVAL.node.AddComments(yyDollar[7].token.Comments, comment.SemiColonToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.DoToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.WhileToken) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.OpenParenthesisToken) + addMeta(yyVAL.node, yyDollar[6].token.Meta, meta.CloseParenthesisToken) + addMeta(yyVAL.node, yyDollar[7].token.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3306,11 +3306,11 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[9].node)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ForToken) - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenParenthesisToken) - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.ForInitSemicolonToken) - yyVAL.node.AddComments(yyDollar[6].token.Comments, comment.ForCondSemicolonToken) - yyVAL.node.AddComments(yyDollar[8].token.Comments, comment.CloseParenthesisToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ForToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenParenthesisToken) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.ForInitSemicolonToken) + addMeta(yyVAL.node, yyDollar[6].token.Meta, meta.ForCondSemicolonToken) + addMeta(yyVAL.node, yyDollar[8].token.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3333,9 +3333,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[5].node)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.SwitchToken) - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenParenthesisToken) - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseParenthesisToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.SwitchToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenParenthesisToken) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3349,8 +3349,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.BreakToken) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.SemiColonToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.BreakToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3364,8 +3364,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ContinueToken) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.SemiColonToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ContinueToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3379,8 +3379,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ReturnToken) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.SemiColonToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ReturnToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3394,8 +3394,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.GlobalToken) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.SemiColonToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.GlobalToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3409,8 +3409,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.StaticToken) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.SemiColonToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.StaticToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3424,8 +3424,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.EchoToken) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.SemiColonToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.EchoToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3439,7 +3439,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.InlineHTMLToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.InlineHTMLToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3453,7 +3453,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.SemiColonToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3467,13 +3467,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[6].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.UnsetToken) - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenParenthesisToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.UnsetToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenParenthesisToken) if yyDollar[4].token != nil { - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CommaToken) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CommaToken) } - yyVAL.node.AddComments(yyDollar[5].token.Comments, comment.CloseParenthesisToken) - yyVAL.node.AddComments(yyDollar[6].token.Comments, comment.SemiColonToken) + addMeta(yyVAL.node, yyDollar[5].token.Meta, meta.CloseParenthesisToken) + addMeta(yyVAL.node, yyDollar[6].token.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3496,10 +3496,10 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[7].node)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ForeachToken) - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenParenthesisToken) - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.AsToken) - yyVAL.node.AddComments(yyDollar[6].token.Comments, comment.CloseParenthesisToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ForeachToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenParenthesisToken) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.AsToken) + addMeta(yyVAL.node, yyDollar[6].token.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3524,11 +3524,11 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[9].node)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ForeachToken) - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenParenthesisToken) - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.AsToken) - yyVAL.node.AddComments(yyDollar[6].token.Comments, comment.DoubleArrowToken) - yyVAL.node.AddComments(yyDollar[8].token.Comments, comment.CloseParenthesisToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ForeachToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenParenthesisToken) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.AsToken) + addMeta(yyVAL.node, yyDollar[6].token.Meta, meta.DoubleArrowToken) + addMeta(yyVAL.node, yyDollar[8].token.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3542,9 +3542,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[5].node)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.DeclareToken) - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenParenthesisToken) - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseParenthesisToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.DeclareToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenParenthesisToken) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3558,7 +3558,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.SemiColonToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3575,9 +3575,9 @@ yydefault: } // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.TryToken) - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenCurlyBracesToken) - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.TryToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3591,8 +3591,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ThrowToken) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.SemiColonToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ThrowToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3608,9 +3608,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.GotoToken) - label.AddComments(yyDollar[2].token.Comments, comment.StringToken) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.SemiColonToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.GotoToken) + addMeta(label, yyDollar[2].token.Meta, meta.StringToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3626,8 +3626,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - label.AddComments(yyDollar[1].token.Comments, comment.StringToken) - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.ColonToken) + addMeta(label, yyDollar[1].token.Meta, meta.StringToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.ColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3654,12 +3654,12 @@ yydefault: catch.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[2].token, yyDollar[9].token)) // save comments - catch.AddComments(yyDollar[2].token.Comments, comment.CatchToken) - catch.AddComments(yyDollar[3].token.Comments, comment.OpenParenthesisToken) - variable.AddComments(yyDollar[5].token.Comments, comment.StringToken) - catch.AddComments(yyDollar[6].token.Comments, comment.CloseParenthesisToken) - catch.AddComments(yyDollar[7].token.Comments, comment.OpenCurlyBracesToken) - catch.AddComments(yyDollar[9].token.Comments, comment.CloseCurlyBracesToken) + addMeta(catch, yyDollar[2].token.Meta, meta.CatchToken) + addMeta(catch, yyDollar[3].token.Meta, meta.OpenParenthesisToken) + addMeta(variable, yyDollar[5].token.Meta, meta.StringToken) + addMeta(catch, yyDollar[6].token.Meta, meta.CloseParenthesisToken) + addMeta(catch, yyDollar[7].token.Meta, meta.OpenCurlyBracesToken) + addMeta(catch, yyDollar[9].token.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3678,7 +3678,7 @@ yydefault: yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.VerticalBarToken) + addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.VerticalBarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3700,9 +3700,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.FinallyToken) - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenCurlyBracesToken) - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.FinallyToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3721,7 +3721,7 @@ yydefault: yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) + addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3745,15 +3745,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[11].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.FunctionToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.FunctionToken) if yyDollar[2].token != nil { - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.AmpersandToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.AmpersandToken) } - name.AddComments(yyDollar[3].token.Comments, comment.StringToken) - yyVAL.node.AddComments(yyDollar[5].token.Comments, comment.OpenParenthesisToken) - yyVAL.node.AddComments(yyDollar[7].token.Comments, comment.CloseParenthesisToken) - yyVAL.node.AddComments(yyDollar[9].token.Comments, comment.OpenCurlyBracesToken) - yyVAL.node.AddComments(yyDollar[11].token.Comments, comment.CloseCurlyBracesToken) + addMeta(name, yyDollar[3].token.Meta, meta.StringToken) + addMeta(yyVAL.node, yyDollar[5].token.Meta, meta.OpenParenthesisToken) + addMeta(yyVAL.node, yyDollar[7].token.Meta, meta.CloseParenthesisToken) + addMeta(yyVAL.node, yyDollar[9].token.Meta, meta.OpenCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[11].token.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3793,10 +3793,10 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewOptionalListTokensPosition(yyDollar[1].list, yyDollar[2].token, yyDollar[9].token)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.ClassToken) - name.AddComments(yyDollar[3].token.Comments, comment.StringToken) - yyVAL.node.AddComments(yyDollar[7].token.Comments, comment.OpenCurlyBracesToken) - yyVAL.node.AddComments(yyDollar[9].token.Comments, comment.CloseCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.ClassToken) + addMeta(name, yyDollar[3].token.Meta, meta.StringToken) + addMeta(yyVAL.node, yyDollar[7].token.Meta, meta.OpenCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[9].token.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3812,10 +3812,10 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[8].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ClassToken) - name.AddComments(yyDollar[2].token.Comments, comment.StringToken) - yyVAL.node.AddComments(yyDollar[6].token.Comments, comment.OpenCurlyBracesToken) - yyVAL.node.AddComments(yyDollar[8].token.Comments, comment.CloseCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ClassToken) + addMeta(name, yyDollar[2].token.Meta, meta.StringToken) + addMeta(yyVAL.node, yyDollar[6].token.Meta, meta.OpenCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[8].token.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3845,7 +3845,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.AbstractToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.AbstractToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3859,7 +3859,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.FinalToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.FinalToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3875,10 +3875,10 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[6].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.TraitToken) - name.AddComments(yyDollar[2].token.Comments, comment.StringToken) - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.OpenCurlyBracesToken) - yyVAL.node.AddComments(yyDollar[6].token.Comments, comment.CloseCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.TraitToken) + addMeta(name, yyDollar[2].token.Meta, meta.StringToken) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.OpenCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[6].token.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3894,10 +3894,10 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[7].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.InterfaceToken) - name.AddComments(yyDollar[2].token.Comments, comment.StringToken) - yyVAL.node.AddComments(yyDollar[5].token.Comments, comment.OpenCurlyBracesToken) - yyVAL.node.AddComments(yyDollar[7].token.Comments, comment.CloseCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.InterfaceToken) + addMeta(name, yyDollar[2].token.Meta, meta.StringToken) + addMeta(yyVAL.node, yyDollar[5].token.Meta, meta.OpenCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[7].token.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3919,7 +3919,7 @@ yydefault: yyVAL.ClassExtends.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyVAL.ClassExtends.AddComments(yyDollar[1].token.Comments, comment.ExtendsToken) + addMeta(yyVAL.ClassExtends, yyDollar[1].token.Meta, meta.ExtendsToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3941,7 +3941,7 @@ yydefault: yyVAL.InterfaceExtends.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) // save comments - yyVAL.InterfaceExtends.AddComments(yyDollar[1].token.Comments, comment.ExtendsToken) + addMeta(yyVAL.InterfaceExtends, yyDollar[1].token.Meta, meta.ExtendsToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3963,7 +3963,7 @@ yydefault: yyVAL.ClassImplements.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) // save comments - yyVAL.ClassImplements.AddComments(yyDollar[1].token.Comments, comment.ImplementsToken) + addMeta(yyVAL.ClassImplements, yyDollar[1].token.Meta, meta.ImplementsToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3985,7 +3985,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.AmpersandToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.AmpersandToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3999,9 +3999,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ListToken) - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenParenthesisToken) - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseParenthesisToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ListToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenParenthesisToken) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4015,8 +4015,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.OpenSquareBracket) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.CloseSquareBracket) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.OpenSquareBracket) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4043,9 +4043,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ColonToken) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.EndforToken) - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.SemiColonToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ColonToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.EndforToken) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4072,9 +4072,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ColonToken) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.EndforeachToken) - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.SemiColonToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ColonToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.EndforeachToken) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4096,9 +4096,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ColonToken) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.EnddeclareToken) - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.SemiColonToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ColonToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.EnddeclareToken) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4114,8 +4114,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - caseList.AddComments(yyDollar[1].token.Comments, comment.OpenCurlyBracesToken) - caseList.AddComments(yyDollar[3].token.Comments, comment.CloseCurlyBracesToken) + addMeta(caseList, yyDollar[1].token.Meta, meta.OpenCurlyBracesToken) + addMeta(caseList, yyDollar[3].token.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4131,9 +4131,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - caseList.AddComments(yyDollar[1].token.Comments, comment.OpenCurlyBracesToken) - caseList.AddComments(yyDollar[2].token.Comments, comment.SemiColonToken) - caseList.AddComments(yyDollar[4].token.Comments, comment.CloseCurlyBracesToken) + addMeta(caseList, yyDollar[1].token.Meta, meta.OpenCurlyBracesToken) + addMeta(caseList, yyDollar[2].token.Meta, meta.SemiColonToken) + addMeta(caseList, yyDollar[4].token.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4149,9 +4149,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - caseList.AddComments(yyDollar[1].token.Comments, comment.ColonToken) - caseList.AddComments(yyDollar[3].token.Comments, comment.EndswitchToken) - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.SemiColonToken) + addMeta(caseList, yyDollar[1].token.Meta, meta.ColonToken) + addMeta(caseList, yyDollar[3].token.Meta, meta.EndswitchToken) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4168,10 +4168,10 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[5].token)) // save comments - caseList.AddComments(yyDollar[1].token.Comments, comment.ColonToken) - caseList.AddComments(yyDollar[2].token.Comments, comment.SemiColonToken) - caseList.AddComments(yyDollar[4].token.Comments, comment.EndswitchToken) - yyVAL.node.AddComments(yyDollar[5].token.Comments, comment.SemiColonToken) + addMeta(caseList, yyDollar[1].token.Meta, meta.ColonToken) + addMeta(caseList, yyDollar[2].token.Meta, meta.SemiColonToken) + addMeta(caseList, yyDollar[4].token.Meta, meta.EndswitchToken) + addMeta(yyVAL.node, yyDollar[5].token.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4194,8 +4194,8 @@ yydefault: _case.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[5].list)) // save comments - _case.AddComments(yyDollar[2].token.Comments, comment.CaseToken) - _case.AddComments(yyDollar[4].token.Comments, comment.CaseSeparatorToken) + addMeta(_case, yyDollar[2].token.Meta, meta.CaseToken) + addMeta(_case, yyDollar[4].token.Meta, meta.CaseSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4210,8 +4210,8 @@ yydefault: _default.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[4].list)) // save comments - _default.AddComments(yyDollar[2].token.Comments, comment.DefaultToken) - _default.AddComments(yyDollar[3].token.Comments, comment.CaseSeparatorToken) + addMeta(_default, yyDollar[2].token.Meta, meta.DefaultToken) + addMeta(_default, yyDollar[3].token.Meta, meta.CaseSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4250,9 +4250,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ColonToken) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.EndwhileToken) - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.SemiColonToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ColonToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.EndwhileToken) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4266,9 +4266,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[5].node)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.IfToken) - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenParenthesisToken) - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseParenthesisToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.IfToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenParenthesisToken) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4284,9 +4284,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[6].node)) // save comments - _elseIf.AddComments(yyDollar[2].token.Comments, comment.ElseifToken) - _elseIf.AddComments(yyDollar[3].token.Comments, comment.OpenParenthesisToken) - _elseIf.AddComments(yyDollar[5].token.Comments, comment.CloseParenthesisToken) + addMeta(_elseIf, yyDollar[2].token.Meta, meta.ElseifToken) + addMeta(_elseIf, yyDollar[3].token.Meta, meta.OpenParenthesisToken) + addMeta(_elseIf, yyDollar[5].token.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4310,7 +4310,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.ElseToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.ElseToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4326,10 +4326,10 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[6].list)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.IfToken) - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenParenthesisToken) - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseParenthesisToken) - yyVAL.node.AddComments(yyDollar[5].token.Comments, comment.ColonToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.IfToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenParenthesisToken) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseParenthesisToken) + addMeta(yyVAL.node, yyDollar[5].token.Meta, meta.ColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4346,10 +4346,10 @@ yydefault: _elseIf.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[7].list)) // save comments - _elseIf.AddComments(yyDollar[2].token.Comments, comment.ElseifToken) - _elseIf.AddComments(yyDollar[3].token.Comments, comment.OpenParenthesisToken) - _elseIf.AddComments(yyDollar[5].token.Comments, comment.CloseParenthesisToken) - _elseIf.AddComments(yyDollar[6].token.Comments, comment.ColonToken) + addMeta(_elseIf, yyDollar[2].token.Meta, meta.ElseifToken) + addMeta(_elseIf, yyDollar[3].token.Meta, meta.OpenParenthesisToken) + addMeta(_elseIf, yyDollar[5].token.Meta, meta.CloseParenthesisToken) + addMeta(_elseIf, yyDollar[6].token.Meta, meta.ColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4363,8 +4363,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.EndifToken) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.SemiColonToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.EndifToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4382,10 +4382,10 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[6].token)) // save comments - _else.AddComments(yyDollar[2].token.Comments, comment.ElseToken) - _else.AddComments(yyDollar[3].token.Comments, comment.ColonToken) - yyVAL.node.AddComments(yyDollar[5].token.Comments, comment.EndifToken) - yyVAL.node.AddComments(yyDollar[6].token.Comments, comment.SemiColonToken) + addMeta(_else, yyDollar[2].token.Meta, meta.ElseToken) + addMeta(_else, yyDollar[3].token.Meta, meta.ColonToken) + addMeta(yyVAL.node, yyDollar[5].token.Meta, meta.EndifToken) + addMeta(yyVAL.node, yyDollar[6].token.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4420,7 +4420,7 @@ yydefault: yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) + addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4447,12 +4447,12 @@ yydefault: // save comments if yyDollar[2].token != nil { - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.AmpersandToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.AmpersandToken) } if yyDollar[3].token != nil { - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.EllipsisToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.EllipsisToken) } - variable.AddComments(yyDollar[4].token.Comments, comment.VariableToken) + addMeta(variable, yyDollar[4].token.Meta, meta.VariableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4479,13 +4479,13 @@ yydefault: // save comments if yyDollar[2].token != nil { - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.AmpersandToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.AmpersandToken) } if yyDollar[3].token != nil { - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.EllipsisToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.EllipsisToken) } - variable.AddComments(yyDollar[4].token.Comments, comment.VariableToken) - yyVAL.node.AddComments(yyDollar[5].token.Comments, comment.EqualToken) + addMeta(variable, yyDollar[4].token.Meta, meta.VariableToken) + addMeta(yyVAL.node, yyDollar[5].token.Meta, meta.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4523,7 +4523,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.QuestionMarkToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.QuestionMarkToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4537,7 +4537,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ArrayToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ArrayToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4551,7 +4551,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.CallableToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.CallableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4578,7 +4578,7 @@ yydefault: yyVAL.node = yyDollar[2].node // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ColonToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4592,8 +4592,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.OpenParenthesisToken) - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.CloseParenthesisToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.OpenParenthesisToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4607,11 +4607,11 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.OpenParenthesisToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.OpenParenthesisToken) if yyDollar[3].token != nil { - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.CommaToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.CommaToken) } - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseParenthesisToken) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4630,7 +4630,7 @@ yydefault: yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) + addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4655,7 +4655,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.EllipsisToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.EllipsisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4666,7 +4666,7 @@ yydefault: yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) + addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4693,7 +4693,7 @@ yydefault: yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) + addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4719,7 +4719,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - variable.AddComments(yyDollar[1].token.Comments, comment.VariableToken) + addMeta(variable, yyDollar[1].token.Meta, meta.VariableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4737,8 +4737,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) // save comments - variable.AddComments(yyDollar[1].token.Comments, comment.VariableToken) - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.EqualToken) + addMeta(variable, yyDollar[1].token.Meta, meta.VariableToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4768,7 +4768,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition(yyDollar[1].list, yyDollar[3].token)) // save comments - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.SemiColonToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4782,8 +4782,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewOptionalListTokensPosition(yyDollar[1].list, yyDollar[2].token, yyDollar[4].token)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.ConstToken) - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.SemiColonToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.ConstToken) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4798,7 +4798,6 @@ yydefault: adaptationList = n default: adaptationList = nil - yylex.(*Parser).comments.AddFromChildNode(yyVAL.node, yyDollar[3].node) } yyVAL.node = stmt.NewTraitUse(yyDollar[2].list, adaptationList) @@ -4807,13 +4806,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.UseToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.UseToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 245: yyDollar = yyS[yypt-10 : yypt+1] - //line php7/php7.y:2420 + //line php7/php7.y:2419 { name := node.NewIdentifier(yyDollar[4].token.Value) yyVAL.node = stmt.NewClassMethod(name, yyDollar[1].list, yyDollar[3].token != nil, yyDollar[7].list, yyDollar[9].node, yyDollar[10].node, yyDollar[5].str) @@ -4827,19 +4826,19 @@ yydefault: } // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.FunctionToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.FunctionToken) if yyDollar[3].token != nil { - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.AmpersandToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.AmpersandToken) } - name.AddComments(yyDollar[4].token.Comments, comment.IdentifierToken) - yyVAL.node.AddComments(yyDollar[6].token.Comments, comment.OpenParenthesisToken) - yyVAL.node.AddComments(yyDollar[8].token.Comments, comment.CloseParenthesisToken) + addMeta(name, yyDollar[4].token.Meta, meta.IdentifierToken) + addMeta(yyVAL.node, yyDollar[6].token.Meta, meta.OpenParenthesisToken) + addMeta(yyVAL.node, yyDollar[8].token.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 246: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2447 + //line php7/php7.y:2446 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4847,59 +4846,59 @@ yydefault: } case 247: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2453 + //line php7/php7.y:2452 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) + addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 248: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2465 + //line php7/php7.y:2464 { yyVAL.node = stmt.NewNop() yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.SemiColonToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 249: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2477 + //line php7/php7.y:2476 { yyVAL.node = stmt.NewTraitAdaptationList(nil) yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.OpenCurlyBracesToken) - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.CloseCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.OpenCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 250: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2489 + //line php7/php7.y:2488 { yyVAL.node = stmt.NewTraitAdaptationList(yyDollar[2].list) yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.OpenCurlyBracesToken) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.CloseCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.OpenCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 251: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2504 + //line php7/php7.y:2503 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4907,7 +4906,7 @@ yydefault: } case 252: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2510 + //line php7/php7.y:2509 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -4915,29 +4914,29 @@ yydefault: } case 253: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2519 + //line php7/php7.y:2518 { yyVAL.node = yyDollar[1].node // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.SemiColonToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 254: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2528 + //line php7/php7.y:2527 { yyVAL.node = yyDollar[1].node // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.SemiColonToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 255: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2540 + //line php7/php7.y:2539 { yyVAL.node = stmt.NewTraitUsePrecedence(yyDollar[1].node, yyDollar[3].list) @@ -4945,13 +4944,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeNodeListPosition(yyDollar[1].node, yyDollar[3].list)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.InsteadofToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.InsteadofToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 256: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2555 + //line php7/php7.y:2554 { alias := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, nil, alias) @@ -4961,14 +4960,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.AsToken) - alias.AddComments(yyDollar[3].token.Comments, comment.StringToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.AsToken) + addMeta(alias, yyDollar[3].token.Meta, meta.StringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 257: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2570 + //line php7/php7.y:2569 { alias := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, nil, alias) @@ -4978,14 +4977,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.AsToken) - alias.AddComments(yyDollar[3].token.Comments, comment.StringToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.AsToken) + addMeta(alias, yyDollar[3].token.Meta, meta.StringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 258: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2585 + //line php7/php7.y:2584 { alias := node.NewIdentifier(yyDollar[4].token.Value) yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, yyDollar[3].node, alias) @@ -4995,14 +4994,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.AsToken) - alias.AddComments(yyDollar[4].token.Comments, comment.IdentifierToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.AsToken) + addMeta(alias, yyDollar[4].token.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 259: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2600 + //line php7/php7.y:2599 { yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, yyDollar[3].node, nil) @@ -5010,13 +5009,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.AsToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.AsToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 260: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2615 + //line php7/php7.y:2614 { name := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewTraitMethodRef(nil, name) @@ -5026,13 +5025,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - name.AddComments(yyDollar[1].token.Comments, comment.IdentifierToken) + addMeta(name, yyDollar[1].token.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 261: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2629 + //line php7/php7.y:2628 { yyVAL.node = yyDollar[1].node @@ -5040,7 +5039,7 @@ yydefault: } case 262: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2638 + //line php7/php7.y:2637 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewTraitMethodRef(yyDollar[1].node, target) @@ -5050,14 +5049,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.PaamayimNekudotayimToken) - target.AddComments(yyDollar[3].token.Comments, comment.IdentifierToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.PaamayimNekudotayimToken) + addMeta(target, yyDollar[3].token.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 263: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2656 + //line php7/php7.y:2655 { yyVAL.node = stmt.NewNop() @@ -5065,13 +5064,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.SemiColonToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 264: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2668 + //line php7/php7.y:2667 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) @@ -5079,14 +5078,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.OpenCurlyBracesToken) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.CloseCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.OpenCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 265: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2684 + //line php7/php7.y:2683 { yyVAL.list = yyDollar[1].list @@ -5094,7 +5093,7 @@ yydefault: } case 266: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2690 + //line php7/php7.y:2689 { modifier := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.list = []node.Node{modifier} @@ -5103,13 +5102,13 @@ yydefault: modifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - modifier.AddComments(yyDollar[1].token.Comments, comment.VarToken) + addMeta(modifier, yyDollar[1].token.Meta, meta.VarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 267: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:2706 + //line php7/php7.y:2705 { yyVAL.list = nil @@ -5117,7 +5116,7 @@ yydefault: } case 268: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2712 + //line php7/php7.y:2711 { yyVAL.list = yyDollar[1].list @@ -5125,7 +5124,7 @@ yydefault: } case 269: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2721 + //line php7/php7.y:2720 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -5133,7 +5132,7 @@ yydefault: } case 270: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2727 + //line php7/php7.y:2726 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -5141,7 +5140,7 @@ yydefault: } case 271: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2736 + //line php7/php7.y:2735 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5149,13 +5148,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.PublicToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.PublicToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 272: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2748 + //line php7/php7.y:2747 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5163,13 +5162,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ProtectedToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ProtectedToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 273: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2760 + //line php7/php7.y:2759 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5177,13 +5176,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.PrivateToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.PrivateToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 274: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2772 + //line php7/php7.y:2771 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5191,13 +5190,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.StaticToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.StaticToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 275: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2784 + //line php7/php7.y:2783 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5205,13 +5204,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.AbstractToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.AbstractToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 276: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2796 + //line php7/php7.y:2795 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5219,24 +5218,24 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.FinalToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.FinalToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 277: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2811 + //line php7/php7.y:2810 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) + addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 278: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2820 + //line php7/php7.y:2819 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -5244,7 +5243,7 @@ yydefault: } case 279: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2829 + //line php7/php7.y:2828 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -5256,13 +5255,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - variable.AddComments(yyDollar[1].token.Comments, comment.VariableToken) + addMeta(variable, yyDollar[1].token.Meta, meta.VariableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 280: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2845 + //line php7/php7.y:2844 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -5274,25 +5273,25 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) // save comments - variable.AddComments(yyDollar[1].token.Comments, comment.VariableToken) - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.EqualToken) + addMeta(variable, yyDollar[1].token.Meta, meta.VariableToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 281: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2865 + //line php7/php7.y:2864 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) + addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 282: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2874 + //line php7/php7.y:2873 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -5300,7 +5299,7 @@ yydefault: } case 283: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2883 + //line php7/php7.y:2882 { name := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewConstant(name, yyDollar[3].node, yyDollar[4].str) @@ -5310,14 +5309,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) // save comments - name.AddComments(yyDollar[1].token.Comments, comment.IdentifierToken) - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.EqualToken) + addMeta(name, yyDollar[1].token.Meta, meta.IdentifierToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 284: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2901 + //line php7/php7.y:2900 { name := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewConstant(name, yyDollar[3].node, yyDollar[4].str) @@ -5327,25 +5326,25 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) // save comments - name.AddComments(yyDollar[1].token.Comments, comment.StringToken) - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.EqualToken) + addMeta(name, yyDollar[1].token.Meta, meta.StringToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 285: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2919 + //line php7/php7.y:2918 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) + addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 286: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2928 + //line php7/php7.y:2927 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -5353,7 +5352,7 @@ yydefault: } case 287: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2937 + //line php7/php7.y:2936 { yyVAL.node = yyDollar[1].node @@ -5361,7 +5360,7 @@ yydefault: } case 288: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:2946 + //line php7/php7.y:2945 { yyVAL.list = nil @@ -5369,7 +5368,7 @@ yydefault: } case 289: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2952 + //line php7/php7.y:2951 { yyVAL.list = yyDollar[1].list @@ -5377,18 +5376,18 @@ yydefault: } case 290: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2961 + //line php7/php7.y:2960 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) + addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 291: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2970 + //line php7/php7.y:2969 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -5396,7 +5395,7 @@ yydefault: } case 292: yyDollar = yyS[yypt-8 : yypt+1] - //line php7/php7.y:2979 + //line php7/php7.y:2978 { if yyDollar[2].node != nil { yyVAL.node = stmt.NewClass(nil, nil, yyDollar[2].node.(*node.ArgumentList), yyDollar[3].ClassExtends, yyDollar[4].ClassImplements, yyDollar[7].list, yyDollar[5].str) @@ -5408,15 +5407,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[8].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ClassToken) - yyVAL.node.AddComments(yyDollar[6].token.Comments, comment.OpenCurlyBracesToken) - yyVAL.node.AddComments(yyDollar[8].token.Comments, comment.CloseCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ClassToken) + addMeta(yyVAL.node, yyDollar[6].token.Meta, meta.OpenCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[8].token.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 293: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3000 + //line php7/php7.y:2999 { if yyDollar[3].node != nil { yyVAL.node = expr.NewNew(yyDollar[2].node, yyDollar[3].node.(*node.ArgumentList)) @@ -5427,13 +5426,13 @@ yydefault: } // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.NewToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.NewToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 294: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3015 + //line php7/php7.y:3014 { yyVAL.node = expr.NewNew(yyDollar[2].node, nil) @@ -5441,13 +5440,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.NewToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.NewToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 295: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:3030 + //line php7/php7.y:3029 { list := expr.NewList(yyDollar[3].list) yyVAL.node = assign.NewAssign(list, yyDollar[6].node) @@ -5457,16 +5456,16 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[6].node)) // save comments - list.AddComments(yyDollar[1].token.Comments, comment.ListToken) - list.AddComments(yyDollar[2].token.Comments, comment.OpenParenthesisToken) - list.AddComments(yyDollar[4].token.Comments, comment.CloseParenthesisToken) - yyVAL.node.AddComments(yyDollar[5].token.Comments, comment.EqualToken) + addMeta(list, yyDollar[1].token.Meta, meta.ListToken) + addMeta(list, yyDollar[2].token.Meta, meta.OpenParenthesisToken) + addMeta(list, yyDollar[4].token.Meta, meta.CloseParenthesisToken) + addMeta(yyVAL.node, yyDollar[5].token.Meta, meta.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 296: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:3047 + //line php7/php7.y:3046 { shortList := expr.NewShortList(yyDollar[2].list) yyVAL.node = assign.NewAssign(shortList, yyDollar[5].node) @@ -5476,15 +5475,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[5].node)) // save comments - shortList.AddComments(yyDollar[1].token.Comments, comment.OpenSquareBracket) - shortList.AddComments(yyDollar[3].token.Comments, comment.CloseSquareBracket) - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.EqualToken) + addMeta(shortList, yyDollar[1].token.Meta, meta.OpenSquareBracket) + addMeta(shortList, yyDollar[3].token.Meta, meta.CloseSquareBracket) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 297: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3063 + //line php7/php7.y:3062 { yyVAL.node = assign.NewAssign(yyDollar[1].node, yyDollar[3].node) @@ -5492,13 +5491,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.EqualToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 298: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3075 + //line php7/php7.y:3074 { yyVAL.node = assign.NewReference(yyDollar[1].node, yyDollar[4].node) @@ -5506,14 +5505,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.EqualToken) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.AmpersandToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.EqualToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.AmpersandToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 299: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3088 + //line php7/php7.y:3087 { yyVAL.node = expr.NewClone(yyDollar[2].node) @@ -5521,13 +5520,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.CloneToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.CloneToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 300: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3100 + //line php7/php7.y:3099 { yyVAL.node = assign.NewPlus(yyDollar[1].node, yyDollar[3].node) @@ -5535,13 +5534,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.PlusEqualToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.PlusEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 301: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3112 + //line php7/php7.y:3111 { yyVAL.node = assign.NewMinus(yyDollar[1].node, yyDollar[3].node) @@ -5549,13 +5548,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.MinusEqualToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.MinusEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 302: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3124 + //line php7/php7.y:3123 { yyVAL.node = assign.NewMul(yyDollar[1].node, yyDollar[3].node) @@ -5563,13 +5562,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.MulEqualToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.MulEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 303: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3136 + //line php7/php7.y:3135 { yyVAL.node = assign.NewPow(yyDollar[1].node, yyDollar[3].node) @@ -5577,13 +5576,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.PowEqualToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.PowEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 304: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3148 + //line php7/php7.y:3147 { yyVAL.node = assign.NewDiv(yyDollar[1].node, yyDollar[3].node) @@ -5591,13 +5590,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.DivEqualToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.DivEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 305: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3160 + //line php7/php7.y:3159 { yyVAL.node = assign.NewConcat(yyDollar[1].node, yyDollar[3].node) @@ -5605,13 +5604,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.ConcatEqualToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.ConcatEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 306: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3172 + //line php7/php7.y:3171 { yyVAL.node = assign.NewMod(yyDollar[1].node, yyDollar[3].node) @@ -5619,13 +5618,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.ModEqualToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.ModEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 307: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3184 + //line php7/php7.y:3183 { yyVAL.node = assign.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) @@ -5633,13 +5632,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.AndEqualToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.AndEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 308: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3196 + //line php7/php7.y:3195 { yyVAL.node = assign.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) @@ -5647,13 +5646,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OrEqualToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OrEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 309: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3208 + //line php7/php7.y:3207 { yyVAL.node = assign.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) @@ -5661,13 +5660,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.XorEqualToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.XorEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 310: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3220 + //line php7/php7.y:3219 { yyVAL.node = assign.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) @@ -5675,13 +5674,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.SlEqualToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.SlEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 311: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3232 + //line php7/php7.y:3231 { yyVAL.node = assign.NewShiftRight(yyDollar[1].node, yyDollar[3].node) @@ -5689,13 +5688,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.SrEqualToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.SrEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 312: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3244 + //line php7/php7.y:3243 { yyVAL.node = expr.NewPostInc(yyDollar[1].node) @@ -5703,13 +5702,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.IncToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.IncToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 313: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3256 + //line php7/php7.y:3255 { yyVAL.node = expr.NewPreInc(yyDollar[2].node) @@ -5717,13 +5716,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.IncToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.IncToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 314: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3268 + //line php7/php7.y:3267 { yyVAL.node = expr.NewPostDec(yyDollar[1].node) @@ -5731,13 +5730,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.DecToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.DecToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 315: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3280 + //line php7/php7.y:3279 { yyVAL.node = expr.NewPreDec(yyDollar[2].node) @@ -5745,13 +5744,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.DecToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.DecToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 316: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3292 + //line php7/php7.y:3291 { yyVAL.node = binary.NewBooleanOr(yyDollar[1].node, yyDollar[3].node) @@ -5759,13 +5758,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.BooleanOrToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.BooleanOrToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 317: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3304 + //line php7/php7.y:3303 { yyVAL.node = binary.NewBooleanAnd(yyDollar[1].node, yyDollar[3].node) @@ -5773,13 +5772,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.BooleanAndToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.BooleanAndToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 318: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3316 + //line php7/php7.y:3315 { yyVAL.node = binary.NewLogicalOr(yyDollar[1].node, yyDollar[3].node) @@ -5787,13 +5786,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.LogicalOrToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.LogicalOrToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 319: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3328 + //line php7/php7.y:3327 { yyVAL.node = binary.NewLogicalAnd(yyDollar[1].node, yyDollar[3].node) @@ -5801,13 +5800,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.LogicalAndToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.LogicalAndToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 320: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3340 + //line php7/php7.y:3339 { yyVAL.node = binary.NewLogicalXor(yyDollar[1].node, yyDollar[3].node) @@ -5815,13 +5814,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.LogicalXorToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.LogicalXorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 321: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3352 + //line php7/php7.y:3351 { yyVAL.node = binary.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) @@ -5829,13 +5828,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.VerticalBarToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.VerticalBarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 322: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3364 + //line php7/php7.y:3363 { yyVAL.node = binary.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) @@ -5843,13 +5842,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.AmpersandToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.AmpersandToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 323: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3376 + //line php7/php7.y:3375 { yyVAL.node = binary.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) @@ -5857,13 +5856,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.CaretToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.CaretToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 324: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3388 + //line php7/php7.y:3387 { yyVAL.node = binary.NewConcat(yyDollar[1].node, yyDollar[3].node) @@ -5871,13 +5870,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.DotToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.DotToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 325: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3400 + //line php7/php7.y:3399 { yyVAL.node = binary.NewPlus(yyDollar[1].node, yyDollar[3].node) @@ -5885,13 +5884,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.PlusToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.PlusToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 326: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3412 + //line php7/php7.y:3411 { yyVAL.node = binary.NewMinus(yyDollar[1].node, yyDollar[3].node) @@ -5899,13 +5898,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.MinusToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.MinusToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 327: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3424 + //line php7/php7.y:3423 { yyVAL.node = binary.NewMul(yyDollar[1].node, yyDollar[3].node) @@ -5913,13 +5912,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.AsteriskToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.AsteriskToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 328: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3436 + //line php7/php7.y:3435 { yyVAL.node = binary.NewPow(yyDollar[1].node, yyDollar[3].node) @@ -5927,13 +5926,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.PowToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.PowToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 329: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3448 + //line php7/php7.y:3447 { yyVAL.node = binary.NewDiv(yyDollar[1].node, yyDollar[3].node) @@ -5941,13 +5940,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.SlashToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.SlashToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 330: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3460 + //line php7/php7.y:3459 { yyVAL.node = binary.NewMod(yyDollar[1].node, yyDollar[3].node) @@ -5955,13 +5954,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.PercentToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.PercentToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 331: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3472 + //line php7/php7.y:3471 { yyVAL.node = binary.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) @@ -5969,13 +5968,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.SlToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.SlToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 332: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3484 + //line php7/php7.y:3483 { yyVAL.node = binary.NewShiftRight(yyDollar[1].node, yyDollar[3].node) @@ -5983,13 +5982,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.SrToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.SrToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 333: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3496 + //line php7/php7.y:3495 { yyVAL.node = expr.NewUnaryPlus(yyDollar[2].node) @@ -5997,13 +5996,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.PlusToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.PlusToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 334: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3508 + //line php7/php7.y:3507 { yyVAL.node = expr.NewUnaryMinus(yyDollar[2].node) @@ -6011,13 +6010,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.MinusToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.MinusToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 335: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3520 + //line php7/php7.y:3519 { yyVAL.node = expr.NewBooleanNot(yyDollar[2].node) @@ -6025,13 +6024,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ExclamationMarkToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ExclamationMarkToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 336: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3532 + //line php7/php7.y:3531 { yyVAL.node = expr.NewBitwiseNot(yyDollar[2].node) @@ -6039,13 +6038,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.TildeToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.TildeToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 337: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3544 + //line php7/php7.y:3543 { yyVAL.node = binary.NewIdentical(yyDollar[1].node, yyDollar[3].node) @@ -6053,13 +6052,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.IsIdenticalToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.IsIdenticalToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 338: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3556 + //line php7/php7.y:3555 { yyVAL.node = binary.NewNotIdentical(yyDollar[1].node, yyDollar[3].node) @@ -6067,13 +6066,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.IsNotIdenticalToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.IsNotIdenticalToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 339: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3568 + //line php7/php7.y:3567 { yyVAL.node = binary.NewEqual(yyDollar[1].node, yyDollar[3].node) @@ -6081,13 +6080,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.IsEqualToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.IsEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 340: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3580 + //line php7/php7.y:3579 { yyVAL.node = binary.NewNotEqual(yyDollar[1].node, yyDollar[3].node) @@ -6095,13 +6094,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.IsNotEqualToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.IsNotEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 341: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3592 + //line php7/php7.y:3591 { yyVAL.node = binary.NewSmaller(yyDollar[1].node, yyDollar[3].node) @@ -6109,13 +6108,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.LessToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.LessToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 342: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3604 + //line php7/php7.y:3603 { yyVAL.node = binary.NewSmallerOrEqual(yyDollar[1].node, yyDollar[3].node) @@ -6123,13 +6122,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.IsSmallerOrEqualToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.IsSmallerOrEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 343: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3616 + //line php7/php7.y:3615 { yyVAL.node = binary.NewGreater(yyDollar[1].node, yyDollar[3].node) @@ -6137,13 +6136,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.GreaterToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.GreaterToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 344: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3628 + //line php7/php7.y:3627 { yyVAL.node = binary.NewGreaterOrEqual(yyDollar[1].node, yyDollar[3].node) @@ -6151,13 +6150,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.IsGreaterOrEqualToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.IsGreaterOrEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 345: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3640 + //line php7/php7.y:3639 { yyVAL.node = binary.NewSpaceship(yyDollar[1].node, yyDollar[3].node) @@ -6165,13 +6164,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.SpaceshipToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.SpaceshipToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 346: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3652 + //line php7/php7.y:3651 { yyVAL.node = expr.NewInstanceOf(yyDollar[1].node, yyDollar[3].node) @@ -6179,25 +6178,25 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.InstanceofToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.InstanceofToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 347: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3664 + //line php7/php7.y:3663 { yyVAL.node = yyDollar[2].node // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.OpenParenthesisToken) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.CloseParenthesisToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.OpenParenthesisToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 348: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3674 + //line php7/php7.y:3673 { yyVAL.node = yyDollar[1].node @@ -6205,7 +6204,7 @@ yydefault: } case 349: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:3680 + //line php7/php7.y:3679 { yyVAL.node = expr.NewTernary(yyDollar[1].node, yyDollar[3].node, yyDollar[5].node) @@ -6213,14 +6212,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[5].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.QuestionMarkToken) - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.ColonToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.QuestionMarkToken) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.ColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 350: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3693 + //line php7/php7.y:3692 { yyVAL.node = expr.NewTernary(yyDollar[1].node, nil, yyDollar[4].node) @@ -6228,14 +6227,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.QuestionMarkToken) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.ColonToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.QuestionMarkToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.ColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 351: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3706 + //line php7/php7.y:3705 { yyVAL.node = binary.NewCoalesce(yyDollar[1].node, yyDollar[3].node) @@ -6243,13 +6242,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.CoalesceToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.CoalesceToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 352: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3718 + //line php7/php7.y:3717 { yyVAL.node = yyDollar[1].node @@ -6257,7 +6256,7 @@ yydefault: } case 353: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3724 + //line php7/php7.y:3723 { yyVAL.node = cast.NewInt(yyDollar[2].node) @@ -6265,13 +6264,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.IntCastToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.IntCastToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 354: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3736 + //line php7/php7.y:3735 { yyVAL.node = cast.NewDouble(yyDollar[2].node) @@ -6279,13 +6278,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.DoubleCastToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.DoubleCastToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 355: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3748 + //line php7/php7.y:3747 { yyVAL.node = cast.NewString(yyDollar[2].node) @@ -6293,13 +6292,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.StringCastToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.StringCastToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 356: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3760 + //line php7/php7.y:3759 { yyVAL.node = cast.NewArray(yyDollar[2].node) @@ -6307,13 +6306,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ArrayCastToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ArrayCastToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 357: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3772 + //line php7/php7.y:3771 { yyVAL.node = cast.NewObject(yyDollar[2].node) @@ -6321,13 +6320,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ObjectCastToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ObjectCastToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 358: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3784 + //line php7/php7.y:3783 { yyVAL.node = cast.NewBool(yyDollar[2].node) @@ -6335,13 +6334,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.BoolCastToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.BoolCastToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 359: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3796 + //line php7/php7.y:3795 { yyVAL.node = cast.NewUnset(yyDollar[2].node) @@ -6349,13 +6348,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.UnsetCastToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.UnsetCastToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 360: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3808 + //line php7/php7.y:3807 { if strings.EqualFold(yyDollar[1].token.Value, "die") { yyVAL.node = expr.NewDie(nil) @@ -6377,17 +6376,13 @@ yydefault: } // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ExitToken) - - if yyDollar[2].node != nil { - yylex.(*Parser).comments.AddFromChildNode(yyVAL.node, yyDollar[2].node) - } + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ExitToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 361: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3838 + //line php7/php7.y:3833 { yyVAL.node = expr.NewErrorSuppress(yyDollar[2].node) @@ -6395,13 +6390,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.AtToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.AtToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 362: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3850 + //line php7/php7.y:3845 { yyVAL.node = yyDollar[1].node @@ -6409,7 +6404,7 @@ yydefault: } case 363: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3856 + //line php7/php7.y:3851 { yyVAL.node = expr.NewShellExec(yyDollar[2].list) @@ -6417,14 +6412,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.BackquoteToken) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.BackquoteToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.BackquoteToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.BackquoteToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 364: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3869 + //line php7/php7.y:3864 { yyVAL.node = expr.NewPrint(yyDollar[2].node) @@ -6432,13 +6427,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.PrintToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.PrintToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 365: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3881 + //line php7/php7.y:3876 { yyVAL.node = expr.NewYield(nil, nil) @@ -6446,13 +6441,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.YieldToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.YieldToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 366: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3893 + //line php7/php7.y:3888 { yyVAL.node = expr.NewYield(nil, yyDollar[2].node) @@ -6460,13 +6455,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.YieldToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.YieldToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 367: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3905 + //line php7/php7.y:3900 { yyVAL.node = expr.NewYield(yyDollar[2].node, yyDollar[4].node) @@ -6474,14 +6469,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[4].node)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.YieldToken) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.DoubleArrowToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.YieldToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.DoubleArrowToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 368: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3918 + //line php7/php7.y:3913 { yyVAL.node = expr.NewYieldFrom(yyDollar[2].node) @@ -6489,13 +6484,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.YieldFromToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.YieldFromToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 369: yyDollar = yyS[yypt-11 : yypt+1] - //line php7/php7.y:3930 + //line php7/php7.y:3925 { yyVAL.node = expr.NewClosure(yyDollar[5].list, yyDollar[7].ClosureUse, yyDollar[8].node, yyDollar[10].list, false, yyDollar[2].token != nil, yyDollar[3].str) @@ -6503,20 +6498,20 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[11].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.FunctionToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.FunctionToken) if yyDollar[2].token != nil { - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.AmpersandToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.AmpersandToken) } - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.OpenParenthesisToken) - yyVAL.node.AddComments(yyDollar[6].token.Comments, comment.CloseParenthesisToken) - yyVAL.node.AddComments(yyDollar[9].token.Comments, comment.OpenCurlyBracesToken) - yyVAL.node.AddComments(yyDollar[11].token.Comments, comment.CloseCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.OpenParenthesisToken) + addMeta(yyVAL.node, yyDollar[6].token.Meta, meta.CloseParenthesisToken) + addMeta(yyVAL.node, yyDollar[9].token.Meta, meta.OpenCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[11].token.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 370: yyDollar = yyS[yypt-12 : yypt+1] - //line php7/php7.y:3949 + //line php7/php7.y:3944 { yyVAL.node = expr.NewClosure(yyDollar[6].list, yyDollar[8].ClosureUse, yyDollar[9].node, yyDollar[11].list, true, yyDollar[3].token != nil, yyDollar[4].str) @@ -6524,21 +6519,21 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[12].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.StaticToken) - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.FunctionToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.StaticToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.FunctionToken) if yyDollar[3].token != nil { - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.AmpersandToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.AmpersandToken) } - yyVAL.node.AddComments(yyDollar[5].token.Comments, comment.OpenParenthesisToken) - yyVAL.node.AddComments(yyDollar[7].token.Comments, comment.CloseParenthesisToken) - yyVAL.node.AddComments(yyDollar[10].token.Comments, comment.OpenCurlyBracesToken) - yyVAL.node.AddComments(yyDollar[12].token.Comments, comment.CloseCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[5].token.Meta, meta.OpenParenthesisToken) + addMeta(yyVAL.node, yyDollar[7].token.Meta, meta.CloseParenthesisToken) + addMeta(yyVAL.node, yyDollar[10].token.Meta, meta.OpenCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[12].token.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 371: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3972 + //line php7/php7.y:3967 { yyVAL.str = yylex.(*Parser).PhpDocComment yylex.(*Parser).PhpDocComment = "" @@ -6547,19 +6542,19 @@ yydefault: } case 372: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3982 + //line php7/php7.y:3977 { yyVAL.token = nil } case 373: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3986 + //line php7/php7.y:3981 { yyVAL.token = yyDollar[1].token } case 374: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3993 + //line php7/php7.y:3988 { yyVAL.ClosureUse = nil @@ -6567,7 +6562,7 @@ yydefault: } case 375: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3999 + //line php7/php7.y:3994 { yyVAL.ClosureUse = expr.NewClosureUse(yyDollar[3].list) @@ -6575,26 +6570,26 @@ yydefault: yyVAL.ClosureUse.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyVAL.ClosureUse.AddComments(yyDollar[1].token.Comments, comment.UseToken) - yyVAL.ClosureUse.AddComments(yyDollar[2].token.Comments, comment.OpenParenthesisToken) - yyVAL.ClosureUse.AddComments(yyDollar[4].token.Comments, comment.CloseParenthesisToken) + addMeta(yyVAL.ClosureUse, yyDollar[1].token.Meta, meta.UseToken) + addMeta(yyVAL.ClosureUse, yyDollar[2].token.Meta, meta.OpenParenthesisToken) + addMeta(yyVAL.ClosureUse, yyDollar[4].token.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 376: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4016 + //line php7/php7.y:4011 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) + addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 377: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4025 + //line php7/php7.y:4020 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -6602,7 +6597,7 @@ yydefault: } case 378: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4034 + //line php7/php7.y:4029 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(identifier) @@ -6612,13 +6607,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.VariableToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.VariableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 379: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4048 + //line php7/php7.y:4043 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[2].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -6630,14 +6625,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.AmpersandToken) - variable.AddComments(yyDollar[2].token.Comments, comment.VariableToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.AmpersandToken) + addMeta(variable, yyDollar[2].token.Meta, meta.VariableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 380: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4068 + //line php7/php7.y:4063 { yyVAL.node = expr.NewFunctionCall(yyDollar[1].node, yyDollar[2].node.(*node.ArgumentList)) @@ -6648,7 +6643,7 @@ yydefault: } case 381: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4077 + //line php7/php7.y:4072 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -6656,13 +6651,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.PaamayimNekudotayimToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.PaamayimNekudotayimToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 382: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4089 + //line php7/php7.y:4084 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -6670,13 +6665,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.PaamayimNekudotayimToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.PaamayimNekudotayimToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 383: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4101 + //line php7/php7.y:4096 { yyVAL.node = expr.NewFunctionCall(yyDollar[1].node, yyDollar[2].node.(*node.ArgumentList)) @@ -6687,7 +6682,7 @@ yydefault: } case 384: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4113 + //line php7/php7.y:4108 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -6695,13 +6690,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.StaticToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.StaticToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 385: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4125 + //line php7/php7.y:4120 { yyVAL.node = yyDollar[1].node @@ -6709,7 +6704,7 @@ yydefault: } case 386: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4134 + //line php7/php7.y:4129 { yyVAL.node = yyDollar[1].node @@ -6717,7 +6712,7 @@ yydefault: } case 387: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4140 + //line php7/php7.y:4135 { yyVAL.node = yyDollar[1].node @@ -6725,7 +6720,7 @@ yydefault: } case 388: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4149 + //line php7/php7.y:4144 { yyVAL.node = nil @@ -6733,7 +6728,7 @@ yydefault: } case 389: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4155 + //line php7/php7.y:4150 { yyVAL.node = expr.NewExit(yyDollar[2].node) @@ -6741,14 +6736,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.OpenParenthesisToken) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.CloseParenthesisToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.OpenParenthesisToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 390: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4171 + //line php7/php7.y:4166 { yyVAL.list = []node.Node{} @@ -6756,7 +6751,7 @@ yydefault: } case 391: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4177 + //line php7/php7.y:4172 { yyVAL.list = []node.Node{scalar.NewEncapsedStringPart(yyDollar[1].token.Value)} @@ -6764,7 +6759,7 @@ yydefault: } case 392: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4183 + //line php7/php7.y:4178 { yyVAL.list = yyDollar[1].list @@ -6772,7 +6767,7 @@ yydefault: } case 393: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4192 + //line php7/php7.y:4187 { yyVAL.node = nil @@ -6780,7 +6775,7 @@ yydefault: } case 394: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4198 + //line php7/php7.y:4193 { yyVAL.node = yyDollar[1].node @@ -6788,7 +6783,7 @@ yydefault: } case 395: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4207 + //line php7/php7.y:4202 { yyVAL.node = expr.NewArray(yyDollar[3].list) @@ -6796,15 +6791,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ArrayToken) - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenParenthesisToken) - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseParenthesisToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ArrayToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenParenthesisToken) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 396: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4221 + //line php7/php7.y:4216 { yyVAL.node = expr.NewShortArray(yyDollar[2].list) @@ -6812,14 +6807,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.OpenSquareBracket) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.CloseSquareBracket) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.OpenSquareBracket) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 397: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4234 + //line php7/php7.y:4229 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) @@ -6827,13 +6822,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ConstantEncapsedStringToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ConstantEncapsedStringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 398: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4249 + //line php7/php7.y:4244 { yyVAL.node = scalar.NewLnumber(yyDollar[1].token.Value) @@ -6841,13 +6836,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.LnumberToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.LnumberToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 399: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4261 + //line php7/php7.y:4256 { yyVAL.node = scalar.NewDnumber(yyDollar[1].token.Value) @@ -6855,13 +6850,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.DnumberToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.DnumberToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 400: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4273 + //line php7/php7.y:4268 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6869,13 +6864,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.LineToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.LineToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 401: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4285 + //line php7/php7.y:4280 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6883,13 +6878,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.FileToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.FileToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 402: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4297 + //line php7/php7.y:4292 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6897,13 +6892,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.DirToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.DirToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 403: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4309 + //line php7/php7.y:4304 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6911,13 +6906,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.TraitCToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.TraitCToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 404: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4321 + //line php7/php7.y:4316 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6925,13 +6920,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.MethodCToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.MethodCToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 405: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4333 + //line php7/php7.y:4328 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6939,13 +6934,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.FuncCToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.FuncCToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 406: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4345 + //line php7/php7.y:4340 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6953,13 +6948,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.NsCToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.NsCToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 407: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4357 + //line php7/php7.y:4352 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6967,13 +6962,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.ClassCToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ClassCToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 408: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4369 + //line php7/php7.y:4364 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, []node.Node{encapsed}) @@ -6983,13 +6978,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.StartHeredocToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.StartHeredocToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 409: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4383 + //line php7/php7.y:4378 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, nil) @@ -6997,13 +6992,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.StartHeredocToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.StartHeredocToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 410: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4395 + //line php7/php7.y:4390 { yyVAL.node = scalar.NewEncapsed(yyDollar[2].list) @@ -7011,13 +7006,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.DoubleQuoteToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.DoubleQuoteToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 411: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4407 + //line php7/php7.y:4402 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, yyDollar[2].list) @@ -7025,13 +7020,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.StartHeredocToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.StartHeredocToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 412: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4419 + //line php7/php7.y:4414 { yyVAL.node = yyDollar[1].node @@ -7039,7 +7034,7 @@ yydefault: } case 413: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4425 + //line php7/php7.y:4420 { yyVAL.node = yyDollar[1].node @@ -7047,7 +7042,7 @@ yydefault: } case 414: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4434 + //line php7/php7.y:4429 { yyVAL.node = expr.NewConstFetch(yyDollar[1].node) @@ -7058,7 +7053,7 @@ yydefault: } case 415: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4443 + //line php7/php7.y:4438 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -7068,14 +7063,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.PaamayimNekudotayimToken) - target.AddComments(yyDollar[3].token.Comments, comment.IdentifierToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.PaamayimNekudotayimToken) + addMeta(target, yyDollar[3].token.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 416: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4458 + //line php7/php7.y:4453 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -7085,14 +7080,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.PaamayimNekudotayimToken) - target.AddComments(yyDollar[3].token.Comments, comment.IdentifierToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.PaamayimNekudotayimToken) + addMeta(target, yyDollar[3].token.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 417: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4476 + //line php7/php7.y:4471 { yyVAL.node = yyDollar[1].node @@ -7100,7 +7095,7 @@ yydefault: } case 418: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4482 + //line php7/php7.y:4477 { yyVAL.node = yyDollar[1].node @@ -7108,7 +7103,7 @@ yydefault: } case 419: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4491 + //line php7/php7.y:4486 { yyVAL.node = nil @@ -7116,7 +7111,7 @@ yydefault: } case 420: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4497 + //line php7/php7.y:4492 { yyVAL.node = yyDollar[1].node @@ -7124,7 +7119,7 @@ yydefault: } case 421: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4506 + //line php7/php7.y:4501 { yyVAL.node = yyDollar[1].node @@ -7132,7 +7127,7 @@ yydefault: } case 422: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4515 + //line php7/php7.y:4510 { yyVAL.node = yyDollar[1].node @@ -7140,19 +7135,19 @@ yydefault: } case 423: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4521 + //line php7/php7.y:4516 { yyVAL.node = yyDollar[2].node // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.OpenParenthesisToken) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.CloseParenthesisToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.OpenParenthesisToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 424: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4531 + //line php7/php7.y:4526 { yyVAL.node = yyDollar[1].node @@ -7160,7 +7155,7 @@ yydefault: } case 425: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4540 + //line php7/php7.y:4535 { yyVAL.node = yyDollar[1].node @@ -7168,19 +7163,19 @@ yydefault: } case 426: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4546 + //line php7/php7.y:4541 { yyVAL.node = yyDollar[2].node // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.OpenParenthesisToken) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.CloseParenthesisToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.OpenParenthesisToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 427: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4556 + //line php7/php7.y:4551 { yyVAL.node = yyDollar[1].node @@ -7188,7 +7183,7 @@ yydefault: } case 428: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4565 + //line php7/php7.y:4560 { yyVAL.node = yyDollar[1].node @@ -7196,7 +7191,7 @@ yydefault: } case 429: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4571 + //line php7/php7.y:4566 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -7204,14 +7199,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenSquareBracket) - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseSquareBracket) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenSquareBracket) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 430: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4584 + //line php7/php7.y:4579 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -7219,14 +7214,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenSquareBracket) - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseSquareBracket) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenSquareBracket) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 431: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4597 + //line php7/php7.y:4592 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -7234,14 +7229,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenCurlyBracesToken) - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 432: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4610 + //line php7/php7.y:4605 { yyVAL.node = expr.NewMethodCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -7249,13 +7244,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.ObjectOperatorToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.ObjectOperatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 433: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4622 + //line php7/php7.y:4617 { yyVAL.node = yyDollar[1].node @@ -7263,7 +7258,7 @@ yydefault: } case 434: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4631 + //line php7/php7.y:4626 { yyVAL.node = yyDollar[1].node @@ -7271,7 +7266,7 @@ yydefault: } case 435: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4637 + //line php7/php7.y:4632 { yyVAL.node = yyDollar[1].node @@ -7279,7 +7274,7 @@ yydefault: } case 436: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4643 + //line php7/php7.y:4638 { yyVAL.node = expr.NewPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -7287,13 +7282,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.ObjectOperatorToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.ObjectOperatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 437: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4658 + //line php7/php7.y:4653 { name := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(name) @@ -7303,13 +7298,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.VariableToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.VariableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 438: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4672 + //line php7/php7.y:4667 { yyVAL.node = expr.NewVariable(yyDollar[3].node) @@ -7317,15 +7312,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.DollarToken) - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenCurlyBracesToken) - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.DollarToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 439: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4686 + //line php7/php7.y:4681 { yyVAL.node = expr.NewVariable(yyDollar[2].node) @@ -7333,13 +7328,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.DollarToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.DollarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 440: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4701 + //line php7/php7.y:4696 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -7347,13 +7342,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.PaamayimNekudotayimToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.PaamayimNekudotayimToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 441: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4713 + //line php7/php7.y:4708 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -7361,13 +7356,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.PaamayimNekudotayimToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.PaamayimNekudotayimToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 442: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4728 + //line php7/php7.y:4723 { yyVAL.node = yyDollar[1].node @@ -7375,7 +7370,7 @@ yydefault: } case 443: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4734 + //line php7/php7.y:4729 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -7383,14 +7378,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenSquareBracket) - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseSquareBracket) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenSquareBracket) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 444: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4747 + //line php7/php7.y:4742 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -7398,14 +7393,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenCurlyBracesToken) - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 445: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4760 + //line php7/php7.y:4755 { yyVAL.node = expr.NewPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -7413,13 +7408,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.ObjectOperatorToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.ObjectOperatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 446: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4772 + //line php7/php7.y:4767 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -7427,13 +7422,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.PaamayimNekudotayimToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.PaamayimNekudotayimToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 447: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4784 + //line php7/php7.y:4779 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -7441,13 +7436,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.PaamayimNekudotayimToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.PaamayimNekudotayimToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 448: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4799 + //line php7/php7.y:4794 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -7455,25 +7450,25 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.IdentifierToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 449: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4811 + //line php7/php7.y:4806 { yyVAL.node = yyDollar[2].node // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.OpenCurlyBracesToken) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.CloseCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.OpenCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 450: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4821 + //line php7/php7.y:4816 { yyVAL.node = yyDollar[1].node @@ -7481,7 +7476,7 @@ yydefault: } case 451: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4830 + //line php7/php7.y:4825 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -7489,25 +7484,25 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.StringToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.StringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 452: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4842 + //line php7/php7.y:4837 { yyVAL.node = yyDollar[2].node // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.OpenCurlyBracesToken) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.CloseCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.OpenCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 453: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4852 + //line php7/php7.y:4847 { yyVAL.node = yyDollar[1].node @@ -7515,7 +7510,7 @@ yydefault: } case 454: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4861 + //line php7/php7.y:4856 { yyVAL.list = yyDollar[1].list @@ -7523,7 +7518,7 @@ yydefault: } case 455: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4870 + //line php7/php7.y:4865 { yyVAL.node = expr.NewArrayItem(nil, nil) @@ -7531,7 +7526,7 @@ yydefault: } case 456: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4876 + //line php7/php7.y:4871 { yyVAL.node = yyDollar[1].node @@ -7539,7 +7534,7 @@ yydefault: } case 457: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4885 + //line php7/php7.y:4880 { if len(yyDollar[1].list) == 0 { yyDollar[1].list = []node.Node{expr.NewArrayItem(nil, nil)} @@ -7548,13 +7543,13 @@ yydefault: yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) + addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 458: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4898 + //line php7/php7.y:4893 { if yyDollar[1].node.(*expr.ArrayItem).Key == nil && yyDollar[1].node.(*expr.ArrayItem).Val == nil { yyVAL.list = []node.Node{} @@ -7566,7 +7561,7 @@ yydefault: } case 459: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4911 + //line php7/php7.y:4906 { yyVAL.node = expr.NewArrayItem(yyDollar[1].node, yyDollar[3].node) @@ -7574,13 +7569,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.DoubleArrowToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.DoubleArrowToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 460: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4923 + //line php7/php7.y:4918 { yyVAL.node = expr.NewArrayItem(nil, yyDollar[1].node) @@ -7591,7 +7586,7 @@ yydefault: } case 461: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4932 + //line php7/php7.y:4927 { reference := expr.NewReference(yyDollar[4].node) yyVAL.node = expr.NewArrayItem(yyDollar[1].node, reference) @@ -7601,14 +7596,14 @@ yydefault: reference.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[3].token, yyDollar[4].node)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.DoubleArrowToken) - reference.AddComments(yyDollar[3].token.Comments, comment.AmpersandToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.DoubleArrowToken) + addMeta(reference, yyDollar[3].token.Meta, meta.AmpersandToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 462: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4947 + //line php7/php7.y:4942 { reference := expr.NewReference(yyDollar[2].node) yyVAL.node = expr.NewArrayItem(nil, reference) @@ -7618,13 +7613,13 @@ yydefault: reference.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - reference.AddComments(yyDollar[1].token.Comments, comment.AmpersandToken) + addMeta(reference, yyDollar[1].token.Meta, meta.AmpersandToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 463: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:4961 + //line php7/php7.y:4956 { // TODO: Cannot use list() as standalone expression list := expr.NewList(yyDollar[5].list) @@ -7635,16 +7630,16 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[6].token)) // save comments - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.DoubleArrowToken) - list.AddComments(yyDollar[3].token.Comments, comment.ListToken) - list.AddComments(yyDollar[4].token.Comments, comment.OpenParenthesisToken) - list.AddComments(yyDollar[6].token.Comments, comment.CloseParenthesisToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.DoubleArrowToken) + addMeta(list, yyDollar[3].token.Meta, meta.ListToken) + addMeta(list, yyDollar[4].token.Meta, meta.OpenParenthesisToken) + addMeta(list, yyDollar[6].token.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 464: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4979 + //line php7/php7.y:4974 { // TODO: Cannot use list() as standalone expression list := expr.NewList(yyDollar[3].list) @@ -7655,15 +7650,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - list.AddComments(yyDollar[1].token.Comments, comment.ListToken) - list.AddComments(yyDollar[2].token.Comments, comment.OpenParenthesisToken) - list.AddComments(yyDollar[4].token.Comments, comment.CloseParenthesisToken) + addMeta(list, yyDollar[1].token.Meta, meta.ListToken) + addMeta(list, yyDollar[2].token.Meta, meta.OpenParenthesisToken) + addMeta(list, yyDollar[4].token.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 465: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4999 + //line php7/php7.y:4994 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -7671,7 +7666,7 @@ yydefault: } case 466: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5005 + //line php7/php7.y:5000 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yyVAL.list = append(yyDollar[1].list, encapsed) @@ -7680,13 +7675,13 @@ yydefault: encapsed.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) // save comments - encapsed.AddComments(yyDollar[2].token.Comments, comment.EncapsedAndWhitespaceToken) + addMeta(encapsed, yyDollar[2].token.Meta, meta.EncapsedAndWhitespaceToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 467: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5018 + //line php7/php7.y:5013 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -7694,7 +7689,7 @@ yydefault: } case 468: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5024 + //line php7/php7.y:5019 { encapsed := scalar.NewEncapsedStringPart(yyDollar[1].token.Value) yyVAL.list = []node.Node{encapsed, yyDollar[2].node} @@ -7703,13 +7698,13 @@ yydefault: encapsed.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - encapsed.AddComments(yyDollar[1].token.Comments, comment.EncapsedAndWhitespaceToken) + addMeta(encapsed, yyDollar[1].token.Meta, meta.EncapsedAndWhitespaceToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 469: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5040 + //line php7/php7.y:5035 { name := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(name) @@ -7719,13 +7714,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.VariableToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.VariableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 470: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:5054 + //line php7/php7.y:5049 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -7737,15 +7732,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - variable.AddComments(yyDollar[1].token.Comments, comment.VariableToken) - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenSquareBracket) - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseSquareBracket) + addMeta(variable, yyDollar[1].token.Meta, meta.VariableToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenSquareBracket) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 471: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5072 + //line php7/php7.y:5067 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -7759,15 +7754,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - variable.AddComments(yyDollar[1].token.Comments, comment.VariableToken) - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.ObjectOperatorToken) - fetch.AddComments(yyDollar[3].token.Comments, comment.StringToken) + addMeta(variable, yyDollar[1].token.Meta, meta.VariableToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.ObjectOperatorToken) + addMeta(fetch, yyDollar[3].token.Meta, meta.StringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 472: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5092 + //line php7/php7.y:5087 { yyVAL.node = expr.NewVariable(yyDollar[2].node) @@ -7775,14 +7770,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.DollarOpenCurlyBracesToken) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.CloseCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.DollarOpenCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 473: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5105 + //line php7/php7.y:5100 { name := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = expr.NewVariable(name) @@ -7792,15 +7787,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.DollarOpenCurlyBracesToken) - name.AddComments(yyDollar[2].token.Comments, comment.StringVarnameToken) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.CloseCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.DollarOpenCurlyBracesToken) + addMeta(name, yyDollar[2].token.Meta, meta.StringVarnameToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 474: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:5121 + //line php7/php7.y:5116 { identifier := node.NewIdentifier(yyDollar[2].token.Value) variable := expr.NewVariable(identifier) @@ -7812,17 +7807,17 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[6].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.DollarOpenCurlyBracesToken) - variable.AddComments(yyDollar[2].token.Comments, comment.StringVarnameToken) - yyVAL.node.AddComments(yyDollar[3].token.Comments, comment.OpenSquareBracket) - yyVAL.node.AddComments(yyDollar[5].token.Comments, comment.CloseSquareBracket) - yyVAL.node.AddComments(yyDollar[6].token.Comments, comment.CloseCurlyBracesToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.DollarOpenCurlyBracesToken) + addMeta(variable, yyDollar[2].token.Meta, meta.StringVarnameToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.OpenSquareBracket) + addMeta(yyVAL.node, yyDollar[5].token.Meta, meta.CloseSquareBracket) + addMeta(yyVAL.node, yyDollar[6].token.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 475: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5141 + //line php7/php7.y:5136 { yyVAL.node = yyDollar[2].node @@ -7830,7 +7825,7 @@ yydefault: } case 476: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5150 + //line php7/php7.y:5145 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) @@ -7838,13 +7833,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.StringToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.StringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 477: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5162 + //line php7/php7.y:5157 { // TODO: add option to handle 64 bit integer if _, err := strconv.Atoi(yyDollar[1].token.Value); err == nil { @@ -7857,13 +7852,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.NumStringToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.NumStringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 478: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5179 + //line php7/php7.y:5174 { var lnumber *scalar.Lnumber // TODO: add option to handle 64 bit integer @@ -7885,18 +7880,18 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.MinusToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.MinusToken) if isInt { - lnumber.AddComments(yyDollar[2].token.Comments, comment.NumStringToken) + addMeta(lnumber, yyDollar[2].token.Meta, meta.NumStringToken) } else { - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.NumStringToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.NumStringToken) } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 479: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5210 + //line php7/php7.y:5205 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(identifier) @@ -7906,13 +7901,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.VariableToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.VariableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 480: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:5227 + //line php7/php7.y:5222 { yyVAL.node = expr.NewIsset(yyDollar[3].list) @@ -7920,18 +7915,18 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[5].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.IssetToken) - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenParenthesisToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.IssetToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenParenthesisToken) if yyDollar[4].token != nil { - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CommaToken) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CommaToken) } - yyVAL.node.AddComments(yyDollar[5].token.Comments, comment.CloseParenthesisToken) + addMeta(yyVAL.node, yyDollar[5].token.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 481: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:5244 + //line php7/php7.y:5239 { yyVAL.node = expr.NewEmpty(yyDollar[3].node) @@ -7939,15 +7934,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.EmptyToken) - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenParenthesisToken) - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseParenthesisToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.EmptyToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenParenthesisToken) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 482: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5258 + //line php7/php7.y:5253 { yyVAL.node = expr.NewInclude(yyDollar[2].node) @@ -7955,13 +7950,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.IncludeToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.IncludeToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 483: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5270 + //line php7/php7.y:5265 { yyVAL.node = expr.NewIncludeOnce(yyDollar[2].node) @@ -7969,13 +7964,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.IncludeOnceToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.IncludeOnceToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 484: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:5282 + //line php7/php7.y:5277 { yyVAL.node = expr.NewEval(yyDollar[3].node) @@ -7983,15 +7978,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.EvalToken) - yyVAL.node.AddComments(yyDollar[2].token.Comments, comment.OpenParenthesisToken) - yyVAL.node.AddComments(yyDollar[4].token.Comments, comment.CloseParenthesisToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.EvalToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenParenthesisToken) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 485: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5296 + //line php7/php7.y:5291 { yyVAL.node = expr.NewRequire(yyDollar[2].node) @@ -7999,13 +7994,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.RequireToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.RequireToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 486: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5308 + //line php7/php7.y:5303 { yyVAL.node = expr.NewRequireOnce(yyDollar[2].node) @@ -8013,13 +8008,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyVAL.node.AddComments(yyDollar[1].token.Comments, comment.RequireOnceToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.RequireOnceToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 487: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5323 + //line php7/php7.y:5318 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -8027,18 +8022,18 @@ yydefault: } case 488: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5329 + //line php7/php7.y:5324 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - lastNode(yyDollar[1].list).AddComments(yyDollar[2].token.Comments, comment.CommaToken) + addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 489: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5341 + //line php7/php7.y:5336 { yyVAL.node = yyDollar[1].node diff --git a/php7/php7.y b/php7/php7.y index 3d50c00..bc6c4bd 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -5,7 +5,7 @@ import ( "strings" "strconv" - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/scanner" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node/scalar" @@ -363,7 +363,7 @@ namespace_name: namePart.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - namePart.AddComments($1.Comments, comment.StringToken) + addMeta(namePart, $1.Meta, meta.StringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -376,8 +376,8 @@ namespace_name: namePart.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) // save comments - lastNode($1).AddComments($2.Comments, comment.NsSeparatorToken) - namePart.AddComments($3.Comments, comment.StringToken) + addMeta(lastNode($1), $2.Meta, meta.NsSeparatorToken) + addMeta(namePart, $3.Meta, meta.StringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -401,8 +401,8 @@ name: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3)) // save comments - $$.AddComments($1.Comments, comment.NamespaceToken) - $$.AddComments($2.Comments, comment.NsSeparatorToken) + addMeta($$, $1.Meta, meta.NamespaceToken) + addMeta($$, $2.Meta, meta.NsSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -414,7 +414,7 @@ name: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) // save comments - $$.AddComments($1.Comments, comment.NsSeparatorToken) + addMeta($$, $1.Meta, meta.NsSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -466,10 +466,10 @@ top_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $$.AddComments($1.Comments, comment.HaltCompilerToken) - $$.AddComments($2.Comments, comment.OpenParenthesisToken) - $$.AddComments($3.Comments, comment.CloseParenthesisToken) - $$.AddComments($4.Comments, comment.SemiColonToken) + addMeta($$, $1.Meta, meta.HaltCompilerToken) + addMeta($$, $2.Meta, meta.OpenParenthesisToken) + addMeta($$, $3.Meta, meta.CloseParenthesisToken) + addMeta($$, $4.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -483,8 +483,8 @@ top_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $$.AddComments($1.Comments, comment.NamespaceToken) - $$.AddComments($3.Comments, comment.SemiColonToken) + addMeta($$, $1.Meta, meta.NamespaceToken) + addMeta($$, $3.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -498,9 +498,9 @@ top_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5)) // save comments - $$.AddComments($1.Comments, comment.NamespaceToken) - $$.AddComments($3.Comments, comment.OpenCurlyBracesToken) - $$.AddComments($5.Comments, comment.CloseCurlyBracesToken) + addMeta($$, $1.Meta, meta.NamespaceToken) + addMeta($$, $3.Meta, meta.OpenCurlyBracesToken) + addMeta($$, $5.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -512,9 +512,9 @@ top_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $$.AddComments($1.Comments, comment.NamespaceToken) - $$.AddComments($2.Comments, comment.OpenCurlyBracesToken) - $$.AddComments($4.Comments, comment.CloseCurlyBracesToken) + addMeta($$, $1.Meta, meta.NamespaceToken) + addMeta($$, $2.Meta, meta.OpenCurlyBracesToken) + addMeta($$, $4.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -526,8 +526,8 @@ top_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $$.AddComments($1.Comments, comment.UseToken) - $$.AddComments($3.Comments, comment.SemiColonToken) + addMeta($$, $1.Meta, meta.UseToken) + addMeta($$, $3.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -539,8 +539,8 @@ top_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $$.AddComments($1.Comments, comment.UseToken) - $$.AddComments($4.Comments, comment.SemiColonToken) + addMeta($$, $1.Meta, meta.UseToken) + addMeta($$, $4.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -552,8 +552,8 @@ top_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $$.AddComments($1.Comments, comment.UseToken) - $$.AddComments($3.Comments, comment.SemiColonToken) + addMeta($$, $1.Meta, meta.UseToken) + addMeta($$, $3.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -565,8 +565,8 @@ top_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $$.AddComments($1.Comments, comment.UseToken) - $$.AddComments($4.Comments, comment.SemiColonToken) + addMeta($$, $1.Meta, meta.UseToken) + addMeta($$, $4.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -578,8 +578,8 @@ top_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $$.AddComments($1.Comments, comment.ConstToken) - $$.AddComments($3.Comments, comment.SemiColonToken) + addMeta($$, $1.Meta, meta.ConstToken) + addMeta($$, $3.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -594,7 +594,7 @@ use_type: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $$.AddComments($1.Comments, comment.FunctionToken) + addMeta($$, $1.Meta, meta.FunctionToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -606,7 +606,7 @@ use_type: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $$.AddComments($1.Comments, comment.ConstToken) + addMeta($$, $1.Meta, meta.ConstToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -623,12 +623,12 @@ group_use_declaration: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $6)) // save comments - $$.AddComments($2.Comments, comment.NsSeparatorToken) - $$.AddComments($3.Comments, comment.OpenCurlyBracesToken) + addMeta($$, $2.Meta, meta.NsSeparatorToken) + addMeta($$, $3.Meta, meta.OpenCurlyBracesToken) if $5 != nil { - $$.AddComments($5.Comments, comment.CommaToken) + addMeta($$, $5.Meta, meta.CommaToken) } - $$.AddComments($6.Comments, comment.CloseCurlyBracesToken) + addMeta($$, $6.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -642,13 +642,13 @@ group_use_declaration: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $7)) // save comments - $$.AddComments($1.Comments, comment.NsSeparatorToken) - $$.AddComments($3.Comments, comment.NsSeparatorToken) - $$.AddComments($4.Comments, comment.OpenCurlyBracesToken) + addMeta($$, $1.Meta, meta.NsSeparatorToken) + addMeta($$, $3.Meta, meta.NsSeparatorToken) + addMeta($$, $4.Meta, meta.OpenCurlyBracesToken) if $6 != nil { - $$.AddComments($6.Comments, comment.CommaToken) + addMeta($$, $6.Meta, meta.CommaToken) } - $$.AddComments($7.Comments, comment.CloseCurlyBracesToken) + addMeta($$, $7.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -665,12 +665,12 @@ mixed_group_use_declaration: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $6)) // save comments - $$.AddComments($2.Comments, comment.NsSeparatorToken) - $$.AddComments($3.Comments, comment.OpenCurlyBracesToken) + addMeta($$, $2.Meta, meta.NsSeparatorToken) + addMeta($$, $3.Meta, meta.OpenCurlyBracesToken) if $5 != nil { - $$.AddComments($5.Comments, comment.CommaToken) + addMeta($$, $5.Meta, meta.CommaToken) } - $$.AddComments($6.Comments, comment.CloseCurlyBracesToken) + addMeta($$, $6.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -684,13 +684,13 @@ mixed_group_use_declaration: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $7)) // save comments - $$.AddComments($1.Comments, comment.NsSeparatorToken) - $$.AddComments($3.Comments, comment.NsSeparatorToken) - $$.AddComments($4.Comments, comment.OpenCurlyBracesToken) + addMeta($$, $1.Meta, meta.NsSeparatorToken) + addMeta($$, $3.Meta, meta.NsSeparatorToken) + addMeta($$, $4.Meta, meta.OpenCurlyBracesToken) if $6 != nil { - $$.AddComments($6.Comments, comment.CommaToken) + addMeta($$, $6.Meta, meta.CommaToken) } - $$.AddComments($7.Comments, comment.CloseCurlyBracesToken) + addMeta($$, $7.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -713,7 +713,7 @@ inline_use_declarations: $$ = append($1, $3) // save comments - lastNode($1).AddComments($2.Comments, comment.CommaToken) + addMeta(lastNode($1), $2.Meta, meta.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -731,7 +731,7 @@ unprefixed_use_declarations: $$ = append($1, $3) // save comments - lastNode($1).AddComments($2.Comments, comment.CommaToken) + addMeta(lastNode($1), $2.Meta, meta.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -749,7 +749,7 @@ use_declarations: $$ = append($1, $3) // save comments - lastNode($1).AddComments($2.Comments, comment.CommaToken) + addMeta(lastNode($1), $2.Meta, meta.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -800,8 +800,8 @@ unprefixed_use_declaration: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.AsToken) - alias.AddComments($3.Comments, comment.StringToken) + addMeta($$, $2.Meta, meta.AsToken) + addMeta(alias, $3.Meta, meta.StringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -819,7 +819,7 @@ use_declaration: $$ = $2; // save comments - $$.AddComments($1.Comments, comment.NsSeparatorToken) + addMeta($$, $1.Meta, meta.NsSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -831,7 +831,7 @@ const_list: $$ = append($1, $3) // save comments - lastNode($1).AddComments($2.Comments, comment.CommaToken) + addMeta(lastNode($1), $2.Meta, meta.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -906,10 +906,10 @@ inner_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $$.AddComments($1.Comments, comment.HaltCompilerToken) - $$.AddComments($2.Comments, comment.OpenParenthesisToken) - $$.AddComments($3.Comments, comment.CloseParenthesisToken) - $$.AddComments($4.Comments, comment.SemiColonToken) + addMeta($$, $1.Meta, meta.HaltCompilerToken) + addMeta($$, $2.Meta, meta.OpenParenthesisToken) + addMeta($$, $3.Meta, meta.CloseParenthesisToken) + addMeta($$, $4.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -923,8 +923,8 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $$.AddComments($1.Comments, comment.OpenCurlyBracesToken) - $$.AddComments($3.Comments, comment.CloseCurlyBracesToken) + addMeta($$, $1.Meta, meta.OpenCurlyBracesToken) + addMeta($$, $3.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -955,9 +955,9 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5)) // save comments - $$.AddComments($1.Comments, comment.WhileToken) - $$.AddComments($2.Comments, comment.OpenParenthesisToken) - $$.AddComments($4.Comments, comment.CloseParenthesisToken) + addMeta($$, $1.Meta, meta.WhileToken) + addMeta($$, $2.Meta, meta.OpenParenthesisToken) + addMeta($$, $4.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -969,11 +969,11 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $7)) // save comments - $$.AddComments($1.Comments, comment.DoToken) - $$.AddComments($3.Comments, comment.WhileToken) - $$.AddComments($4.Comments, comment.OpenParenthesisToken) - $$.AddComments($6.Comments, comment.CloseParenthesisToken) - $$.AddComments($7.Comments, comment.SemiColonToken) + addMeta($$, $1.Meta, meta.DoToken) + addMeta($$, $3.Meta, meta.WhileToken) + addMeta($$, $4.Meta, meta.OpenParenthesisToken) + addMeta($$, $6.Meta, meta.CloseParenthesisToken) + addMeta($$, $7.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -996,11 +996,11 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $9)) // save comments - $$.AddComments($1.Comments, comment.ForToken) - $$.AddComments($2.Comments, comment.OpenParenthesisToken) - $$.AddComments($4.Comments, comment.ForInitSemicolonToken) - $$.AddComments($6.Comments, comment.ForCondSemicolonToken) - $$.AddComments($8.Comments, comment.CloseParenthesisToken) + addMeta($$, $1.Meta, meta.ForToken) + addMeta($$, $2.Meta, meta.OpenParenthesisToken) + addMeta($$, $4.Meta, meta.ForInitSemicolonToken) + addMeta($$, $6.Meta, meta.ForCondSemicolonToken) + addMeta($$, $8.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1021,9 +1021,9 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5)) // save comments - $$.AddComments($1.Comments, comment.SwitchToken) - $$.AddComments($2.Comments, comment.OpenParenthesisToken) - $$.AddComments($4.Comments, comment.CloseParenthesisToken) + addMeta($$, $1.Meta, meta.SwitchToken) + addMeta($$, $2.Meta, meta.OpenParenthesisToken) + addMeta($$, $4.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1035,8 +1035,8 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $$.AddComments($1.Comments, comment.BreakToken) - $$.AddComments($3.Comments, comment.SemiColonToken) + addMeta($$, $1.Meta, meta.BreakToken) + addMeta($$, $3.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1048,8 +1048,8 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $$.AddComments($1.Comments, comment.ContinueToken) - $$.AddComments($3.Comments, comment.SemiColonToken) + addMeta($$, $1.Meta, meta.ContinueToken) + addMeta($$, $3.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1061,8 +1061,8 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $$.AddComments($1.Comments, comment.ReturnToken) - $$.AddComments($3.Comments, comment.SemiColonToken) + addMeta($$, $1.Meta, meta.ReturnToken) + addMeta($$, $3.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1074,8 +1074,8 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $$.AddComments($1.Comments, comment.GlobalToken) - $$.AddComments($3.Comments, comment.SemiColonToken) + addMeta($$, $1.Meta, meta.GlobalToken) + addMeta($$, $3.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1087,8 +1087,8 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $$.AddComments($1.Comments, comment.StaticToken) - $$.AddComments($3.Comments, comment.SemiColonToken) + addMeta($$, $1.Meta, meta.StaticToken) + addMeta($$, $3.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1100,8 +1100,8 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $$.AddComments($1.Comments, comment.EchoToken) - $$.AddComments($3.Comments, comment.SemiColonToken) + addMeta($$, $1.Meta, meta.EchoToken) + addMeta($$, $3.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1113,7 +1113,7 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $$.AddComments($1.Comments, comment.InlineHTMLToken) + addMeta($$, $1.Meta, meta.InlineHTMLToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1125,7 +1125,7 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) // save comments - $$.AddComments($2.Comments, comment.SemiColonToken) + addMeta($$, $2.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1137,13 +1137,13 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $6)) // save comments - $$.AddComments($1.Comments, comment.UnsetToken) - $$.AddComments($2.Comments, comment.OpenParenthesisToken) + addMeta($$, $1.Meta, meta.UnsetToken) + addMeta($$, $2.Meta, meta.OpenParenthesisToken) if $4 != nil { - $$.AddComments($4.Comments, comment.CommaToken) + addMeta($$, $4.Meta, meta.CommaToken) } - $$.AddComments($5.Comments, comment.CloseParenthesisToken) - $$.AddComments($6.Comments, comment.SemiColonToken) + addMeta($$, $5.Meta, meta.CloseParenthesisToken) + addMeta($$, $6.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1164,10 +1164,10 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $7)) // save comments - $$.AddComments($1.Comments, comment.ForeachToken) - $$.AddComments($2.Comments, comment.OpenParenthesisToken) - $$.AddComments($4.Comments, comment.AsToken) - $$.AddComments($6.Comments, comment.CloseParenthesisToken) + addMeta($$, $1.Meta, meta.ForeachToken) + addMeta($$, $2.Meta, meta.OpenParenthesisToken) + addMeta($$, $4.Meta, meta.AsToken) + addMeta($$, $6.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1190,11 +1190,11 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $9)) // save comments - $$.AddComments($1.Comments, comment.ForeachToken) - $$.AddComments($2.Comments, comment.OpenParenthesisToken) - $$.AddComments($4.Comments, comment.AsToken) - $$.AddComments($6.Comments, comment.DoubleArrowToken) - $$.AddComments($8.Comments, comment.CloseParenthesisToken) + addMeta($$, $1.Meta, meta.ForeachToken) + addMeta($$, $2.Meta, meta.OpenParenthesisToken) + addMeta($$, $4.Meta, meta.AsToken) + addMeta($$, $6.Meta, meta.DoubleArrowToken) + addMeta($$, $8.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1206,9 +1206,9 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5)) // save comments - $$.AddComments($1.Comments, comment.DeclareToken) - $$.AddComments($2.Comments, comment.OpenParenthesisToken) - $$.AddComments($4.Comments, comment.CloseParenthesisToken) + addMeta($$, $1.Meta, meta.DeclareToken) + addMeta($$, $2.Meta, meta.OpenParenthesisToken) + addMeta($$, $4.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1220,7 +1220,7 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $$.AddComments($1.Comments, comment.SemiColonToken) + addMeta($$, $1.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1235,9 +1235,9 @@ statement: } // save comments - $$.AddComments($1.Comments, comment.TryToken) - $$.AddComments($2.Comments, comment.OpenCurlyBracesToken) - $$.AddComments($4.Comments, comment.CloseCurlyBracesToken) + addMeta($$, $1.Meta, meta.TryToken) + addMeta($$, $2.Meta, meta.OpenCurlyBracesToken) + addMeta($$, $4.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1249,8 +1249,8 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $$.AddComments($1.Comments, comment.ThrowToken) - $$.AddComments($3.Comments, comment.SemiColonToken) + addMeta($$, $1.Meta, meta.ThrowToken) + addMeta($$, $3.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1264,9 +1264,9 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $$.AddComments($1.Comments, comment.GotoToken) - label.AddComments($2.Comments, comment.StringToken) - $$.AddComments($3.Comments, comment.SemiColonToken) + addMeta($$, $1.Meta, meta.GotoToken) + addMeta(label, $2.Meta, meta.StringToken) + addMeta($$, $3.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1280,8 +1280,8 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - label.AddComments($1.Comments, comment.StringToken) - $$.AddComments($2.Comments, comment.ColonToken) + addMeta(label, $1.Meta, meta.StringToken) + addMeta($$, $2.Meta, meta.ColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1306,12 +1306,12 @@ catch_list: catch.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($2, $9)) // save comments - catch.AddComments($2.Comments, comment.CatchToken) - catch.AddComments($3.Comments, comment.OpenParenthesisToken) - variable.AddComments($5.Comments, comment.StringToken) - catch.AddComments($6.Comments, comment.CloseParenthesisToken) - catch.AddComments($7.Comments, comment.OpenCurlyBracesToken) - catch.AddComments($9.Comments, comment.CloseCurlyBracesToken) + addMeta(catch, $2.Meta, meta.CatchToken) + addMeta(catch, $3.Meta, meta.OpenParenthesisToken) + addMeta(variable, $5.Meta, meta.StringToken) + addMeta(catch, $6.Meta, meta.CloseParenthesisToken) + addMeta(catch, $7.Meta, meta.OpenCurlyBracesToken) + addMeta(catch, $9.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1328,7 +1328,7 @@ catch_name_list: $$ = append($1, $3) // save comments - lastNode($1).AddComments($2.Comments, comment.VerticalBarToken) + addMeta(lastNode($1), $2.Meta, meta.VerticalBarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1349,9 +1349,9 @@ finally_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $$.AddComments($1.Comments, comment.FinallyToken) - $$.AddComments($2.Comments, comment.OpenCurlyBracesToken) - $$.AddComments($4.Comments, comment.CloseCurlyBracesToken) + addMeta($$, $1.Meta, meta.FinallyToken) + addMeta($$, $2.Meta, meta.OpenCurlyBracesToken) + addMeta($$, $4.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1369,7 +1369,7 @@ unset_variables: $$ = append($1, $3) // save comments - lastNode($1).AddComments($2.Comments, comment.CommaToken) + addMeta(lastNode($1), $2.Meta, meta.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1396,15 +1396,15 @@ function_declaration_statement: // save comments - $$.AddComments($1.Comments, comment.FunctionToken) + addMeta($$, $1.Meta, meta.FunctionToken) if $2 != nil { - $$.AddComments($2.Comments, comment.AmpersandToken) + addMeta($$, $2.Meta, meta.AmpersandToken) } - name.AddComments($3.Comments, comment.StringToken) - $$.AddComments($5.Comments, comment.OpenParenthesisToken) - $$.AddComments($7.Comments, comment.CloseParenthesisToken) - $$.AddComments($9.Comments, comment.OpenCurlyBracesToken) - $$.AddComments($11.Comments, comment.CloseCurlyBracesToken) + addMeta(name, $3.Meta, meta.StringToken) + addMeta($$, $5.Meta, meta.OpenParenthesisToken) + addMeta($$, $7.Meta, meta.CloseParenthesisToken) + addMeta($$, $9.Meta, meta.OpenCurlyBracesToken) + addMeta($$, $11.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1443,10 +1443,10 @@ class_declaration_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewOptionalListTokensPosition($1, $2, $9)) // save comments - $$.AddComments($2.Comments, comment.ClassToken) - name.AddComments($3.Comments, comment.StringToken) - $$.AddComments($7.Comments, comment.OpenCurlyBracesToken) - $$.AddComments($9.Comments, comment.CloseCurlyBracesToken) + addMeta($$, $2.Meta, meta.ClassToken) + addMeta(name, $3.Meta, meta.StringToken) + addMeta($$, $7.Meta, meta.OpenCurlyBracesToken) + addMeta($$, $9.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1460,10 +1460,10 @@ class_declaration_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $8)) // save comments - $$.AddComments($1.Comments, comment.ClassToken) - name.AddComments($2.Comments, comment.StringToken) - $$.AddComments($6.Comments, comment.OpenCurlyBracesToken) - $$.AddComments($8.Comments, comment.CloseCurlyBracesToken) + addMeta($$, $1.Meta, meta.ClassToken) + addMeta(name, $2.Meta, meta.StringToken) + addMeta($$, $6.Meta, meta.OpenCurlyBracesToken) + addMeta($$, $8.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1493,7 +1493,7 @@ class_modifier: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $$.AddComments($1.Comments, comment.AbstractToken) + addMeta($$, $1.Meta, meta.AbstractToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1505,7 +1505,7 @@ class_modifier: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $$.AddComments($1.Comments, comment.FinalToken) + addMeta($$, $1.Meta, meta.FinalToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1522,10 +1522,10 @@ trait_declaration_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $6)) // save comments - $$.AddComments($1.Comments, comment.TraitToken) - name.AddComments($2.Comments, comment.StringToken) - $$.AddComments($4.Comments, comment.OpenCurlyBracesToken) - $$.AddComments($6.Comments, comment.CloseCurlyBracesToken) + addMeta($$, $1.Meta, meta.TraitToken) + addMeta(name, $2.Meta, meta.StringToken) + addMeta($$, $4.Meta, meta.OpenCurlyBracesToken) + addMeta($$, $6.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1542,10 +1542,10 @@ interface_declaration_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $7)) // save comments - $$.AddComments($1.Comments, comment.InterfaceToken) - name.AddComments($2.Comments, comment.StringToken) - $$.AddComments($5.Comments, comment.OpenCurlyBracesToken) - $$.AddComments($7.Comments, comment.CloseCurlyBracesToken) + addMeta($$, $1.Meta, meta.InterfaceToken) + addMeta(name, $2.Meta, meta.StringToken) + addMeta($$, $5.Meta, meta.OpenCurlyBracesToken) + addMeta($$, $7.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1566,7 +1566,7 @@ extends_from: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $$.AddComments($1.Comments, comment.ExtendsToken) + addMeta($$, $1.Meta, meta.ExtendsToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1587,7 +1587,7 @@ interface_extends_list: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) // save comments - $$.AddComments($1.Comments, comment.ExtendsToken) + addMeta($$, $1.Meta, meta.ExtendsToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1608,7 +1608,7 @@ implements_list: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) // save comments - $$.AddComments($1.Comments, comment.ImplementsToken) + addMeta($$, $1.Meta, meta.ImplementsToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1629,7 +1629,7 @@ foreach_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $$.AddComments($1.Comments, comment.AmpersandToken) + addMeta($$, $1.Meta, meta.AmpersandToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1641,9 +1641,9 @@ foreach_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $$.AddComments($1.Comments, comment.ListToken) - $$.AddComments($2.Comments, comment.OpenParenthesisToken) - $$.AddComments($4.Comments, comment.CloseParenthesisToken) + addMeta($$, $1.Meta, meta.ListToken) + addMeta($$, $2.Meta, meta.OpenParenthesisToken) + addMeta($$, $4.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1655,8 +1655,8 @@ foreach_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $$.AddComments($1.Comments, comment.OpenSquareBracket) - $$.AddComments($3.Comments, comment.CloseSquareBracket) + addMeta($$, $1.Meta, meta.OpenSquareBracket) + addMeta($$, $3.Meta, meta.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1682,9 +1682,9 @@ for_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $$.AddComments($1.Comments, comment.ColonToken) - $$.AddComments($3.Comments, comment.EndforToken) - $$.AddComments($4.Comments, comment.SemiColonToken) + addMeta($$, $1.Meta, meta.ColonToken) + addMeta($$, $3.Meta, meta.EndforToken) + addMeta($$, $4.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1710,9 +1710,9 @@ foreach_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $$.AddComments($1.Comments, comment.ColonToken) - $$.AddComments($3.Comments, comment.EndforeachToken) - $$.AddComments($4.Comments, comment.SemiColonToken) + addMeta($$, $1.Meta, meta.ColonToken) + addMeta($$, $3.Meta, meta.EndforeachToken) + addMeta($$, $4.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1733,9 +1733,9 @@ declare_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $$.AddComments($1.Comments, comment.ColonToken) - $$.AddComments($3.Comments, comment.EnddeclareToken) - $$.AddComments($4.Comments, comment.SemiColonToken) + addMeta($$, $1.Meta, meta.ColonToken) + addMeta($$, $3.Meta, meta.EnddeclareToken) + addMeta($$, $4.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1752,8 +1752,8 @@ switch_case_list: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - caseList.AddComments($1.Comments, comment.OpenCurlyBracesToken) - caseList.AddComments($3.Comments, comment.CloseCurlyBracesToken) + addMeta(caseList, $1.Meta, meta.OpenCurlyBracesToken) + addMeta(caseList, $3.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1767,9 +1767,9 @@ switch_case_list: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - caseList.AddComments($1.Comments, comment.OpenCurlyBracesToken) - caseList.AddComments($2.Comments, comment.SemiColonToken) - caseList.AddComments($4.Comments, comment.CloseCurlyBracesToken) + addMeta(caseList, $1.Meta, meta.OpenCurlyBracesToken) + addMeta(caseList, $2.Meta, meta.SemiColonToken) + addMeta(caseList, $4.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1783,9 +1783,9 @@ switch_case_list: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - caseList.AddComments($1.Comments, comment.ColonToken) - caseList.AddComments($3.Comments, comment.EndswitchToken) - $$.AddComments($4.Comments, comment.SemiColonToken) + addMeta(caseList, $1.Meta, meta.ColonToken) + addMeta(caseList, $3.Meta, meta.EndswitchToken) + addMeta($$, $4.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1800,10 +1800,10 @@ switch_case_list: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5)) // save comments - caseList.AddComments($1.Comments, comment.ColonToken) - caseList.AddComments($2.Comments, comment.SemiColonToken) - caseList.AddComments($4.Comments, comment.EndswitchToken) - $$.AddComments($5.Comments, comment.SemiColonToken) + addMeta(caseList, $1.Meta, meta.ColonToken) + addMeta(caseList, $2.Meta, meta.SemiColonToken) + addMeta(caseList, $4.Meta, meta.EndswitchToken) + addMeta($$, $5.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1825,8 +1825,8 @@ case_list: _case.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $5)) // save comments - _case.AddComments($2.Comments, comment.CaseToken) - _case.AddComments($4.Comments, comment.CaseSeparatorToken) + addMeta(_case, $2.Meta, meta.CaseToken) + addMeta(_case, $4.Meta, meta.CaseSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1839,8 +1839,8 @@ case_list: _default.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $4)) // save comments - _default.AddComments($2.Comments, comment.DefaultToken) - _default.AddComments($3.Comments, comment.CaseSeparatorToken) + addMeta(_default, $2.Meta, meta.DefaultToken) + addMeta(_default, $3.Meta, meta.CaseSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1877,9 +1877,9 @@ while_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $$.AddComments($1.Comments, comment.ColonToken) - $$.AddComments($3.Comments, comment.EndwhileToken) - $$.AddComments($4.Comments, comment.SemiColonToken) + addMeta($$, $1.Meta, meta.ColonToken) + addMeta($$, $3.Meta, meta.EndwhileToken) + addMeta($$, $4.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1894,9 +1894,9 @@ if_stmt_without_else: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5)) // save comments - $$.AddComments($1.Comments, comment.IfToken) - $$.AddComments($2.Comments, comment.OpenParenthesisToken) - $$.AddComments($4.Comments, comment.CloseParenthesisToken) + addMeta($$, $1.Meta, meta.IfToken) + addMeta($$, $2.Meta, meta.OpenParenthesisToken) + addMeta($$, $4.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1910,9 +1910,9 @@ if_stmt_without_else: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $6)) // save comments - _elseIf.AddComments($2.Comments, comment.ElseifToken) - _elseIf.AddComments($3.Comments, comment.OpenParenthesisToken) - _elseIf.AddComments($5.Comments, comment.CloseParenthesisToken) + addMeta(_elseIf, $2.Meta, meta.ElseifToken) + addMeta(_elseIf, $3.Meta, meta.OpenParenthesisToken) + addMeta(_elseIf, $5.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1935,7 +1935,7 @@ if_stmt: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.ElseToken) + addMeta($$, $2.Meta, meta.ElseToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1952,10 +1952,10 @@ alt_if_stmt_without_else: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $6)) // save comments - $$.AddComments($1.Comments, comment.IfToken) - $$.AddComments($2.Comments, comment.OpenParenthesisToken) - $$.AddComments($4.Comments, comment.CloseParenthesisToken) - $$.AddComments($5.Comments, comment.ColonToken) + addMeta($$, $1.Meta, meta.IfToken) + addMeta($$, $2.Meta, meta.OpenParenthesisToken) + addMeta($$, $4.Meta, meta.CloseParenthesisToken) + addMeta($$, $5.Meta, meta.ColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1970,10 +1970,10 @@ alt_if_stmt_without_else: _elseIf.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $7)) // save comments - _elseIf.AddComments($2.Comments, comment.ElseifToken) - _elseIf.AddComments($3.Comments, comment.OpenParenthesisToken) - _elseIf.AddComments($5.Comments, comment.CloseParenthesisToken) - _elseIf.AddComments($6.Comments, comment.ColonToken) + addMeta(_elseIf, $2.Meta, meta.ElseifToken) + addMeta(_elseIf, $3.Meta, meta.OpenParenthesisToken) + addMeta(_elseIf, $5.Meta, meta.CloseParenthesisToken) + addMeta(_elseIf, $6.Meta, meta.ColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1988,8 +1988,8 @@ alt_if_stmt: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.EndifToken) - $$.AddComments($3.Comments, comment.SemiColonToken) + addMeta($$, $2.Meta, meta.EndifToken) + addMeta($$, $3.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2005,10 +2005,10 @@ alt_if_stmt: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $6)) // save comments - _else.AddComments($2.Comments, comment.ElseToken) - _else.AddComments($3.Comments, comment.ColonToken) - $$.AddComments($5.Comments, comment.EndifToken) - $$.AddComments($6.Comments, comment.SemiColonToken) + addMeta(_else, $2.Meta, meta.ElseToken) + addMeta(_else, $3.Meta, meta.ColonToken) + addMeta($$, $5.Meta, meta.EndifToken) + addMeta($$, $6.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2041,7 +2041,7 @@ non_empty_parameter_list: $$ = append($1, $3) // save comments - lastNode($1).AddComments($2.Comments, comment.CommaToken) + addMeta(lastNode($1), $2.Meta, meta.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2069,12 +2069,12 @@ parameter: // save comments if $2 != nil { - $$.AddComments($2.Comments, comment.AmpersandToken) + addMeta($$, $2.Meta, meta.AmpersandToken) } if $3 != nil { - $$.AddComments($3.Comments, comment.EllipsisToken) + addMeta($$, $3.Meta, meta.EllipsisToken) } - variable.AddComments($4.Comments, comment.VariableToken) + addMeta(variable, $4.Meta, meta.VariableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2099,13 +2099,13 @@ parameter: // save comments if $2 != nil { - $$.AddComments($2.Comments, comment.AmpersandToken) + addMeta($$, $2.Meta, meta.AmpersandToken) } if $3 != nil { - $$.AddComments($3.Comments, comment.EllipsisToken) + addMeta($$, $3.Meta, meta.EllipsisToken) } - variable.AddComments($4.Comments, comment.VariableToken) - $$.AddComments($5.Comments, comment.EqualToken) + addMeta(variable, $4.Meta, meta.VariableToken) + addMeta($$, $5.Meta, meta.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2141,7 +2141,7 @@ type_expr: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $$.AddComments($1.Comments, comment.QuestionMarkToken) + addMeta($$, $1.Meta, meta.QuestionMarkToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2156,7 +2156,7 @@ type: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $$.AddComments($1.Comments, comment.ArrayToken) + addMeta($$, $1.Meta, meta.ArrayToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2168,7 +2168,7 @@ type: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $$.AddComments($1.Comments, comment.CallableToken) + addMeta($$, $1.Meta, meta.CallableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2192,7 +2192,7 @@ return_type: $$ = $2; // save comments - $$.AddComments($1.Comments, comment.ColonToken) + addMeta($$, $1.Meta, meta.ColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2207,8 +2207,8 @@ argument_list: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - $$.AddComments($1.Comments, comment.OpenParenthesisToken) - $$.AddComments($2.Comments, comment.CloseParenthesisToken) + addMeta($$, $1.Meta, meta.OpenParenthesisToken) + addMeta($$, $2.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2220,11 +2220,11 @@ argument_list: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $$.AddComments($1.Comments, comment.OpenParenthesisToken) + addMeta($$, $1.Meta, meta.OpenParenthesisToken) if $3 != nil { - $$.AddComments($3.Comments, comment.CommaToken) + addMeta($$, $3.Meta, meta.CommaToken) } - $$.AddComments($4.Comments, comment.CloseParenthesisToken) + addMeta($$, $4.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2242,7 +2242,7 @@ non_empty_argument_list: $$ = append($1, $3) // save comments - lastNode($1).AddComments($2.Comments, comment.CommaToken) + addMeta(lastNode($1), $2.Meta, meta.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2266,7 +2266,7 @@ argument: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $$.AddComments($1.Comments, comment.EllipsisToken) + addMeta($$, $1.Meta, meta.EllipsisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2278,7 +2278,7 @@ global_var_list: $$ = append($1, $3) // save comments - lastNode($1).AddComments($2.Comments, comment.CommaToken) + addMeta(lastNode($1), $2.Meta, meta.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2305,7 +2305,7 @@ static_var_list: $$ = append($1, $3) // save comments - lastNode($1).AddComments($2.Comments, comment.CommaToken) + addMeta(lastNode($1), $2.Meta, meta.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2330,7 +2330,7 @@ static_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - variable.AddComments($1.Comments, comment.VariableToken) + addMeta(variable, $1.Meta, meta.VariableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2346,8 +2346,8 @@ static_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) // save comments - variable.AddComments($1.Comments, comment.VariableToken) - $$.AddComments($2.Comments, comment.EqualToken) + addMeta(variable, $1.Meta, meta.VariableToken) + addMeta($$, $2.Meta, meta.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2377,7 +2377,7 @@ class_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $3)) // save comments - $$.AddComments($3.Comments, comment.SemiColonToken) + addMeta($$, $3.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2389,8 +2389,8 @@ class_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewOptionalListTokensPosition($1, $2, $4)) // save comments - $$.AddComments($2.Comments, comment.ConstToken) - $$.AddComments($4.Comments, comment.SemiColonToken) + addMeta($$, $2.Meta, meta.ConstToken) + addMeta($$, $4.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2403,7 +2403,6 @@ class_statement: adaptationList = n default: adaptationList = nil - yylex.(*Parser).comments.AddFromChildNode($$, $3) } $$ = stmt.NewTraitUse($2, adaptationList) @@ -2412,7 +2411,7 @@ class_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) // save comments - $$.AddComments($1.Comments, comment.UseToken) + addMeta($$, $1.Meta, meta.UseToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2430,13 +2429,13 @@ class_statement: } // save comments - $$.AddComments($2.Comments, comment.FunctionToken) + addMeta($$, $2.Meta, meta.FunctionToken) if $3 != nil { - $$.AddComments($3.Comments, comment.AmpersandToken) + addMeta($$, $3.Meta, meta.AmpersandToken) } - name.AddComments($4.Comments, comment.IdentifierToken) - $$.AddComments($6.Comments, comment.OpenParenthesisToken) - $$.AddComments($8.Comments, comment.CloseParenthesisToken) + addMeta(name, $4.Meta, meta.IdentifierToken) + addMeta($$, $6.Meta, meta.OpenParenthesisToken) + addMeta($$, $8.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2454,7 +2453,7 @@ name_list: $$ = append($1, $3) // save comments - lastNode($1).AddComments($2.Comments, comment.CommaToken) + addMeta(lastNode($1), $2.Meta, meta.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2468,7 +2467,7 @@ trait_adaptations: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $$.AddComments($1.Comments, comment.SemiColonToken) + addMeta($$, $1.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -2480,8 +2479,8 @@ trait_adaptations: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - $$.AddComments($1.Comments, comment.OpenCurlyBracesToken) - $$.AddComments($2.Comments, comment.CloseCurlyBracesToken) + addMeta($$, $1.Meta, meta.OpenCurlyBracesToken) + addMeta($$, $2.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2492,8 +2491,8 @@ trait_adaptations: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $$.AddComments($1.Comments, comment.OpenCurlyBracesToken) - $$.AddComments($3.Comments, comment.CloseCurlyBracesToken) + addMeta($$, $1.Meta, meta.OpenCurlyBracesToken) + addMeta($$, $3.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2520,7 +2519,7 @@ trait_adaptation: $$ = $1; // save comments - $$.AddComments($2.Comments, comment.SemiColonToken) + addMeta($$, $2.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2529,7 +2528,7 @@ trait_adaptation: $$ = $1; // save comments - $$.AddComments($2.Comments, comment.SemiColonToken) + addMeta($$, $2.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2544,7 +2543,7 @@ trait_precedence: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeNodeListPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.InsteadofToken) + addMeta($$, $2.Meta, meta.InsteadofToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2561,8 +2560,8 @@ trait_alias: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.AsToken) - alias.AddComments($3.Comments, comment.StringToken) + addMeta($$, $2.Meta, meta.AsToken) + addMeta(alias, $3.Meta, meta.StringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2576,8 +2575,8 @@ trait_alias: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.AsToken) - alias.AddComments($3.Comments, comment.StringToken) + addMeta($$, $2.Meta, meta.AsToken) + addMeta(alias, $3.Meta, meta.StringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2591,8 +2590,8 @@ trait_alias: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments - $$.AddComments($2.Comments, comment.AsToken) - alias.AddComments($4.Comments, comment.IdentifierToken) + addMeta($$, $2.Meta, meta.AsToken) + addMeta(alias, $4.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2604,7 +2603,7 @@ trait_alias: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.AsToken) + addMeta($$, $2.Meta, meta.AsToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2621,7 +2620,7 @@ trait_method_reference: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - name.AddComments($1.Comments, comment.IdentifierToken) + addMeta(name, $1.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2644,8 +2643,8 @@ absolute_trait_method_reference: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.PaamayimNekudotayimToken) - target.AddComments($3.Comments, comment.IdentifierToken) + addMeta($$, $2.Meta, meta.PaamayimNekudotayimToken) + addMeta(target, $3.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2660,7 +2659,7 @@ method_body: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $$.AddComments($1.Comments, comment.SemiColonToken) + addMeta($$, $1.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2672,8 +2671,8 @@ method_body: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $$.AddComments($1.Comments, comment.OpenCurlyBracesToken) - $$.AddComments($3.Comments, comment.CloseCurlyBracesToken) + addMeta($$, $1.Meta, meta.OpenCurlyBracesToken) + addMeta($$, $3.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2695,7 +2694,7 @@ variable_modifiers: modifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - modifier.AddComments($1.Comments, comment.VarToken) + addMeta(modifier, $1.Meta, meta.VarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2740,7 +2739,7 @@ member_modifier: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $$.AddComments($1.Comments, comment.PublicToken) + addMeta($$, $1.Meta, meta.PublicToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2752,7 +2751,7 @@ member_modifier: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $$.AddComments($1.Comments, comment.ProtectedToken) + addMeta($$, $1.Meta, meta.ProtectedToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2764,7 +2763,7 @@ member_modifier: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $$.AddComments($1.Comments, comment.PrivateToken) + addMeta($$, $1.Meta, meta.PrivateToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2776,7 +2775,7 @@ member_modifier: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $$.AddComments($1.Comments, comment.StaticToken) + addMeta($$, $1.Meta, meta.StaticToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2788,7 +2787,7 @@ member_modifier: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $$.AddComments($1.Comments, comment.AbstractToken) + addMeta($$, $1.Meta, meta.AbstractToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2800,7 +2799,7 @@ member_modifier: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $$.AddComments($1.Comments, comment.FinalToken) + addMeta($$, $1.Meta, meta.FinalToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2812,7 +2811,7 @@ property_list: $$ = append($1, $3) // save comments - lastNode($1).AddComments($2.Comments, comment.CommaToken) + addMeta(lastNode($1), $2.Meta, meta.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2837,7 +2836,7 @@ property: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - variable.AddComments($1.Comments, comment.VariableToken) + addMeta(variable, $1.Meta, meta.VariableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2853,8 +2852,8 @@ property: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) // save comments - variable.AddComments($1.Comments, comment.VariableToken) - $$.AddComments($2.Comments, comment.EqualToken) + addMeta(variable, $1.Meta, meta.VariableToken) + addMeta($$, $2.Meta, meta.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2866,7 +2865,7 @@ class_const_list: $$ = append($1, $3) // save comments - lastNode($1).AddComments($2.Comments, comment.CommaToken) + addMeta(lastNode($1), $2.Meta, meta.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2889,8 +2888,8 @@ class_const_decl: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) // save comments - name.AddComments($1.Comments, comment.IdentifierToken) - $$.AddComments($2.Comments, comment.EqualToken) + addMeta(name, $1.Meta, meta.IdentifierToken) + addMeta($$, $2.Meta, meta.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2907,8 +2906,8 @@ const_decl: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) // save comments - name.AddComments($1.Comments, comment.StringToken) - $$.AddComments($2.Comments, comment.EqualToken) + addMeta(name, $1.Meta, meta.StringToken) + addMeta($$, $2.Meta, meta.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2920,7 +2919,7 @@ echo_expr_list: $$ = append($1, $3) // save comments - lastNode($1).AddComments($2.Comments, comment.CommaToken) + addMeta(lastNode($1), $2.Meta, meta.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2962,7 +2961,7 @@ non_empty_for_exprs: $$ = append($1, $3) // save comments - lastNode($1).AddComments($2.Comments, comment.CommaToken) + addMeta(lastNode($1), $2.Meta, meta.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2987,9 +2986,9 @@ anonymous_class: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $8)) // save comments - $$.AddComments($1.Comments, comment.ClassToken) - $$.AddComments($6.Comments, comment.OpenCurlyBracesToken) - $$.AddComments($8.Comments, comment.CloseCurlyBracesToken) + addMeta($$, $1.Meta, meta.ClassToken) + addMeta($$, $6.Meta, meta.OpenCurlyBracesToken) + addMeta($$, $8.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3007,7 +3006,7 @@ new_expr: } // save comments - $$.AddComments($1.Comments, comment.NewToken) + addMeta($$, $1.Meta, meta.NewToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3019,7 +3018,7 @@ new_expr: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $$.AddComments($1.Comments, comment.NewToken) + addMeta($$, $1.Meta, meta.NewToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3036,10 +3035,10 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $6)) // save comments - list.AddComments($1.Comments, comment.ListToken) - list.AddComments($2.Comments, comment.OpenParenthesisToken) - list.AddComments($4.Comments, comment.CloseParenthesisToken) - $$.AddComments($5.Comments, comment.EqualToken) + addMeta(list, $1.Meta, meta.ListToken) + addMeta(list, $2.Meta, meta.OpenParenthesisToken) + addMeta(list, $4.Meta, meta.CloseParenthesisToken) + addMeta($$, $5.Meta, meta.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3053,9 +3052,9 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5)) // save comments - shortList.AddComments($1.Comments, comment.OpenSquareBracket) - shortList.AddComments($3.Comments, comment.CloseSquareBracket) - $$.AddComments($4.Comments, comment.EqualToken) + addMeta(shortList, $1.Meta, meta.OpenSquareBracket) + addMeta(shortList, $3.Meta, meta.CloseSquareBracket) + addMeta($$, $4.Meta, meta.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3067,7 +3066,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.EqualToken) + addMeta($$, $2.Meta, meta.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3079,8 +3078,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) // save comments - $$.AddComments($2.Comments, comment.EqualToken) - $$.AddComments($3.Comments, comment.AmpersandToken) + addMeta($$, $2.Meta, meta.EqualToken) + addMeta($$, $3.Meta, meta.AmpersandToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3092,7 +3091,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $$.AddComments($1.Comments, comment.CloneToken) + addMeta($$, $1.Meta, meta.CloneToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3104,7 +3103,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.PlusEqualToken) + addMeta($$, $2.Meta, meta.PlusEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3116,7 +3115,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.MinusEqualToken) + addMeta($$, $2.Meta, meta.MinusEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3128,7 +3127,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.MulEqualToken) + addMeta($$, $2.Meta, meta.MulEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3140,7 +3139,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.PowEqualToken) + addMeta($$, $2.Meta, meta.PowEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3152,7 +3151,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.DivEqualToken) + addMeta($$, $2.Meta, meta.DivEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3164,7 +3163,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.ConcatEqualToken) + addMeta($$, $2.Meta, meta.ConcatEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3176,7 +3175,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.ModEqualToken) + addMeta($$, $2.Meta, meta.ModEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3188,7 +3187,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.AndEqualToken) + addMeta($$, $2.Meta, meta.AndEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3200,7 +3199,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.OrEqualToken) + addMeta($$, $2.Meta, meta.OrEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3212,7 +3211,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.XorEqualToken) + addMeta($$, $2.Meta, meta.XorEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3224,7 +3223,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.SlEqualToken) + addMeta($$, $2.Meta, meta.SlEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3236,7 +3235,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.SrEqualToken) + addMeta($$, $2.Meta, meta.SrEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3248,7 +3247,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) // save comments - $$.AddComments($2.Comments, comment.IncToken) + addMeta($$, $2.Meta, meta.IncToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3260,7 +3259,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $$.AddComments($1.Comments, comment.IncToken) + addMeta($$, $1.Meta, meta.IncToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3272,7 +3271,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) // save comments - $$.AddComments($2.Comments, comment.DecToken) + addMeta($$, $2.Meta, meta.DecToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3284,7 +3283,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $$.AddComments($1.Comments, comment.DecToken) + addMeta($$, $1.Meta, meta.DecToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3296,7 +3295,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.BooleanOrToken) + addMeta($$, $2.Meta, meta.BooleanOrToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3308,7 +3307,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.BooleanAndToken) + addMeta($$, $2.Meta, meta.BooleanAndToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3320,7 +3319,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.LogicalOrToken) + addMeta($$, $2.Meta, meta.LogicalOrToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3332,7 +3331,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.LogicalAndToken) + addMeta($$, $2.Meta, meta.LogicalAndToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3344,7 +3343,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.LogicalXorToken) + addMeta($$, $2.Meta, meta.LogicalXorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3356,7 +3355,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.VerticalBarToken) + addMeta($$, $2.Meta, meta.VerticalBarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3368,7 +3367,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.AmpersandToken) + addMeta($$, $2.Meta, meta.AmpersandToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3380,7 +3379,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.CaretToken) + addMeta($$, $2.Meta, meta.CaretToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3392,7 +3391,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.DotToken) + addMeta($$, $2.Meta, meta.DotToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3404,7 +3403,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.PlusToken) + addMeta($$, $2.Meta, meta.PlusToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3416,7 +3415,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.MinusToken) + addMeta($$, $2.Meta, meta.MinusToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3428,7 +3427,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.AsteriskToken) + addMeta($$, $2.Meta, meta.AsteriskToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3440,7 +3439,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.PowToken) + addMeta($$, $2.Meta, meta.PowToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3452,7 +3451,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.SlashToken) + addMeta($$, $2.Meta, meta.SlashToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3464,7 +3463,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.PercentToken) + addMeta($$, $2.Meta, meta.PercentToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3476,7 +3475,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.SlToken) + addMeta($$, $2.Meta, meta.SlToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3488,7 +3487,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.SrToken) + addMeta($$, $2.Meta, meta.SrToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3500,7 +3499,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $$.AddComments($1.Comments, comment.PlusToken) + addMeta($$, $1.Meta, meta.PlusToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3512,7 +3511,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $$.AddComments($1.Comments, comment.MinusToken) + addMeta($$, $1.Meta, meta.MinusToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3524,7 +3523,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $$.AddComments($1.Comments, comment.ExclamationMarkToken) + addMeta($$, $1.Meta, meta.ExclamationMarkToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3536,7 +3535,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $$.AddComments($1.Comments, comment.TildeToken) + addMeta($$, $1.Meta, meta.TildeToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3548,7 +3547,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.IsIdenticalToken) + addMeta($$, $2.Meta, meta.IsIdenticalToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3560,7 +3559,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.IsNotIdenticalToken) + addMeta($$, $2.Meta, meta.IsNotIdenticalToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3572,7 +3571,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.IsEqualToken) + addMeta($$, $2.Meta, meta.IsEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3584,7 +3583,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.IsNotEqualToken) + addMeta($$, $2.Meta, meta.IsNotEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3596,7 +3595,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.LessToken) + addMeta($$, $2.Meta, meta.LessToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3608,7 +3607,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.IsSmallerOrEqualToken) + addMeta($$, $2.Meta, meta.IsSmallerOrEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3620,7 +3619,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.GreaterToken) + addMeta($$, $2.Meta, meta.GreaterToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3632,7 +3631,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.IsGreaterOrEqualToken) + addMeta($$, $2.Meta, meta.IsGreaterOrEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3644,7 +3643,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.SpaceshipToken) + addMeta($$, $2.Meta, meta.SpaceshipToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3656,7 +3655,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.InstanceofToken) + addMeta($$, $2.Meta, meta.InstanceofToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3665,8 +3664,8 @@ expr_without_variable: $$ = $2; // save comments - $$.AddComments($1.Comments, comment.OpenParenthesisToken) - $$.AddComments($3.Comments, comment.CloseParenthesisToken) + addMeta($$, $1.Meta, meta.OpenParenthesisToken) + addMeta($$, $3.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3684,8 +3683,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $5)) // save comments - $$.AddComments($2.Comments, comment.QuestionMarkToken) - $$.AddComments($4.Comments, comment.ColonToken) + addMeta($$, $2.Meta, meta.QuestionMarkToken) + addMeta($$, $4.Meta, meta.ColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3697,8 +3696,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) // save comments - $$.AddComments($2.Comments, comment.QuestionMarkToken) - $$.AddComments($3.Comments, comment.ColonToken) + addMeta($$, $2.Meta, meta.QuestionMarkToken) + addMeta($$, $3.Meta, meta.ColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3710,7 +3709,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.CoalesceToken) + addMeta($$, $2.Meta, meta.CoalesceToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3728,7 +3727,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $$.AddComments($1.Comments, comment.IntCastToken) + addMeta($$, $1.Meta, meta.IntCastToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3740,7 +3739,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $$.AddComments($1.Comments, comment.DoubleCastToken) + addMeta($$, $1.Meta, meta.DoubleCastToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3752,7 +3751,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $$.AddComments($1.Comments, comment.StringCastToken) + addMeta($$, $1.Meta, meta.StringCastToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3764,7 +3763,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $$.AddComments($1.Comments, comment.ArrayCastToken) + addMeta($$, $1.Meta, meta.ArrayCastToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3776,7 +3775,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $$.AddComments($1.Comments, comment.ObjectCastToken) + addMeta($$, $1.Meta, meta.ObjectCastToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3788,7 +3787,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $$.AddComments($1.Comments, comment.BoolCastToken) + addMeta($$, $1.Meta, meta.BoolCastToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3800,7 +3799,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $$.AddComments($1.Comments, comment.UnsetCastToken) + addMeta($$, $1.Meta, meta.UnsetCastToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3826,11 +3825,7 @@ expr_without_variable: } // save comments - $$.AddComments($1.Comments, comment.ExitToken) - - if $2 != nil { - yylex.(*Parser).comments.AddFromChildNode($$, $2) - } + addMeta($$, $1.Meta, meta.ExitToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3842,7 +3837,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $$.AddComments($1.Comments, comment.AtToken) + addMeta($$, $1.Meta, meta.AtToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3860,8 +3855,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $$.AddComments($1.Comments, comment.BackquoteToken) - $$.AddComments($3.Comments, comment.BackquoteToken) + addMeta($$, $1.Meta, meta.BackquoteToken) + addMeta($$, $3.Meta, meta.BackquoteToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3873,7 +3868,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $$.AddComments($1.Comments, comment.PrintToken) + addMeta($$, $1.Meta, meta.PrintToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3885,7 +3880,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $$.AddComments($1.Comments, comment.YieldToken) + addMeta($$, $1.Meta, meta.YieldToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3897,7 +3892,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $$.AddComments($1.Comments, comment.YieldToken) + addMeta($$, $1.Meta, meta.YieldToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3909,8 +3904,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $4)) // save comments - $$.AddComments($1.Comments, comment.YieldToken) - $$.AddComments($3.Comments, comment.DoubleArrowToken) + addMeta($$, $1.Meta, meta.YieldToken) + addMeta($$, $3.Meta, meta.DoubleArrowToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3922,7 +3917,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $$.AddComments($1.Comments, comment.YieldFromToken) + addMeta($$, $1.Meta, meta.YieldFromToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3934,14 +3929,14 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $11)) // save comments - $$.AddComments($1.Comments, comment.FunctionToken) + addMeta($$, $1.Meta, meta.FunctionToken) if $2 != nil { - $$.AddComments($2.Comments, comment.AmpersandToken) + addMeta($$, $2.Meta, meta.AmpersandToken) } - $$.AddComments($4.Comments, comment.OpenParenthesisToken) - $$.AddComments($6.Comments, comment.CloseParenthesisToken) - $$.AddComments($9.Comments, comment.OpenCurlyBracesToken) - $$.AddComments($11.Comments, comment.CloseCurlyBracesToken) + addMeta($$, $4.Meta, meta.OpenParenthesisToken) + addMeta($$, $6.Meta, meta.CloseParenthesisToken) + addMeta($$, $9.Meta, meta.OpenCurlyBracesToken) + addMeta($$, $11.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3953,15 +3948,15 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $12)) // save comments - $$.AddComments($1.Comments, comment.StaticToken) - $$.AddComments($2.Comments, comment.FunctionToken) + addMeta($$, $1.Meta, meta.StaticToken) + addMeta($$, $2.Meta, meta.FunctionToken) if $3 != nil { - $$.AddComments($3.Comments, comment.AmpersandToken) + addMeta($$, $3.Meta, meta.AmpersandToken) } - $$.AddComments($5.Comments, comment.OpenParenthesisToken) - $$.AddComments($7.Comments, comment.CloseParenthesisToken) - $$.AddComments($10.Comments, comment.OpenCurlyBracesToken) - $$.AddComments($12.Comments, comment.CloseCurlyBracesToken) + addMeta($$, $5.Meta, meta.OpenParenthesisToken) + addMeta($$, $7.Meta, meta.CloseParenthesisToken) + addMeta($$, $10.Meta, meta.OpenCurlyBracesToken) + addMeta($$, $12.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4003,9 +3998,9 @@ lexical_vars: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $$.AddComments($1.Comments, comment.UseToken) - $$.AddComments($2.Comments, comment.OpenParenthesisToken) - $$.AddComments($4.Comments, comment.CloseParenthesisToken) + addMeta($$, $1.Meta, meta.UseToken) + addMeta($$, $2.Meta, meta.OpenParenthesisToken) + addMeta($$, $4.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4017,7 +4012,7 @@ lexical_var_list: $$ = append($1, $3) // save comments - lastNode($1).AddComments($2.Comments, comment.CommaToken) + addMeta(lastNode($1), $2.Meta, meta.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4040,7 +4035,7 @@ lexical_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $$.AddComments($1.Comments, comment.VariableToken) + addMeta($$, $1.Meta, meta.VariableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4056,8 +4051,8 @@ lexical_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - $$.AddComments($1.Comments, comment.AmpersandToken) - variable.AddComments($2.Comments, comment.VariableToken) + addMeta($$, $1.Meta, meta.AmpersandToken) + addMeta(variable, $2.Meta, meta.VariableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4081,7 +4076,7 @@ function_call: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) // save comments - $$.AddComments($2.Comments, comment.PaamayimNekudotayimToken) + addMeta($$, $2.Meta, meta.PaamayimNekudotayimToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4093,7 +4088,7 @@ function_call: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) // save comments - $$.AddComments($2.Comments, comment.PaamayimNekudotayimToken) + addMeta($$, $2.Meta, meta.PaamayimNekudotayimToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4117,7 +4112,7 @@ class_name: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $$.AddComments($1.Comments, comment.StaticToken) + addMeta($$, $1.Meta, meta.StaticToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4159,8 +4154,8 @@ exit_expr: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $$.AddComments($1.Comments, comment.OpenParenthesisToken) - $$.AddComments($3.Comments, comment.CloseParenthesisToken) + addMeta($$, $1.Meta, meta.OpenParenthesisToken) + addMeta($$, $3.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4211,9 +4206,9 @@ dereferencable_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $$.AddComments($1.Comments, comment.ArrayToken) - $$.AddComments($2.Comments, comment.OpenParenthesisToken) - $$.AddComments($4.Comments, comment.CloseParenthesisToken) + addMeta($$, $1.Meta, meta.ArrayToken) + addMeta($$, $2.Meta, meta.OpenParenthesisToken) + addMeta($$, $4.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4225,8 +4220,8 @@ dereferencable_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $$.AddComments($1.Comments, comment.OpenSquareBracket) - $$.AddComments($3.Comments, comment.CloseSquareBracket) + addMeta($$, $1.Meta, meta.OpenSquareBracket) + addMeta($$, $3.Meta, meta.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4238,7 +4233,7 @@ dereferencable_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $$.AddComments($1.Comments, comment.ConstantEncapsedStringToken) + addMeta($$, $1.Meta, meta.ConstantEncapsedStringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4253,7 +4248,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $$.AddComments($1.Comments, comment.LnumberToken) + addMeta($$, $1.Meta, meta.LnumberToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4265,7 +4260,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $$.AddComments($1.Comments, comment.DnumberToken) + addMeta($$, $1.Meta, meta.DnumberToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4277,7 +4272,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $$.AddComments($1.Comments, comment.LineToken) + addMeta($$, $1.Meta, meta.LineToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4289,7 +4284,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $$.AddComments($1.Comments, comment.FileToken) + addMeta($$, $1.Meta, meta.FileToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4301,7 +4296,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $$.AddComments($1.Comments, comment.DirToken) + addMeta($$, $1.Meta, meta.DirToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4313,7 +4308,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $$.AddComments($1.Comments, comment.TraitCToken) + addMeta($$, $1.Meta, meta.TraitCToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4325,7 +4320,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $$.AddComments($1.Comments, comment.MethodCToken) + addMeta($$, $1.Meta, meta.MethodCToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4337,7 +4332,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $$.AddComments($1.Comments, comment.FuncCToken) + addMeta($$, $1.Meta, meta.FuncCToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4349,7 +4344,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $$.AddComments($1.Comments, comment.NsCToken) + addMeta($$, $1.Meta, meta.NsCToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4361,7 +4356,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $$.AddComments($1.Comments, comment.ClassCToken) + addMeta($$, $1.Meta, meta.ClassCToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4375,7 +4370,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $$.AddComments($1.Comments, comment.StartHeredocToken) + addMeta($$, $1.Meta, meta.StartHeredocToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4387,7 +4382,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - $$.AddComments($1.Comments, comment.StartHeredocToken) + addMeta($$, $1.Meta, meta.StartHeredocToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4399,7 +4394,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $$.AddComments($1.Comments, comment.DoubleQuoteToken) + addMeta($$, $1.Meta, meta.DoubleQuoteToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4411,7 +4406,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $$.AddComments($1.Comments, comment.StartHeredocToken) + addMeta($$, $1.Meta, meta.StartHeredocToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4449,8 +4444,8 @@ constant: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.PaamayimNekudotayimToken) - target.AddComments($3.Comments, comment.IdentifierToken) + addMeta($$, $2.Meta, meta.PaamayimNekudotayimToken) + addMeta(target, $3.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4464,8 +4459,8 @@ constant: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.PaamayimNekudotayimToken) - target.AddComments($3.Comments, comment.IdentifierToken) + addMeta($$, $2.Meta, meta.PaamayimNekudotayimToken) + addMeta(target, $3.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4522,8 +4517,8 @@ dereferencable: $$ = $2; // save comments - $$.AddComments($1.Comments, comment.OpenParenthesisToken) - $$.AddComments($3.Comments, comment.CloseParenthesisToken) + addMeta($$, $1.Meta, meta.OpenParenthesisToken) + addMeta($$, $3.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4547,8 +4542,8 @@ callable_expr: $$ = $2; // save comments - $$.AddComments($1.Comments, comment.OpenParenthesisToken) - $$.AddComments($3.Comments, comment.CloseParenthesisToken) + addMeta($$, $1.Meta, meta.OpenParenthesisToken) + addMeta($$, $3.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4575,8 +4570,8 @@ callable_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments - $$.AddComments($2.Comments, comment.OpenSquareBracket) - $$.AddComments($4.Comments, comment.CloseSquareBracket) + addMeta($$, $2.Meta, meta.OpenSquareBracket) + addMeta($$, $4.Meta, meta.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4588,8 +4583,8 @@ callable_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments - $$.AddComments($2.Comments, comment.OpenSquareBracket) - $$.AddComments($4.Comments, comment.CloseSquareBracket) + addMeta($$, $2.Meta, meta.OpenSquareBracket) + addMeta($$, $4.Meta, meta.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4601,8 +4596,8 @@ callable_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments - $$.AddComments($2.Comments, comment.OpenCurlyBracesToken) - $$.AddComments($4.Comments, comment.CloseCurlyBracesToken) + addMeta($$, $2.Meta, meta.OpenCurlyBracesToken) + addMeta($$, $4.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4614,7 +4609,7 @@ callable_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) // save comments - $$.AddComments($2.Comments, comment.ObjectOperatorToken) + addMeta($$, $2.Meta, meta.ObjectOperatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4647,7 +4642,7 @@ variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.ObjectOperatorToken) + addMeta($$, $2.Meta, meta.ObjectOperatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4664,7 +4659,7 @@ simple_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $$.AddComments($1.Comments, comment.VariableToken) + addMeta($$, $1.Meta, meta.VariableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4676,9 +4671,9 @@ simple_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $$.AddComments($1.Comments, comment.DollarToken) - $$.AddComments($2.Comments, comment.OpenCurlyBracesToken) - $$.AddComments($4.Comments, comment.CloseCurlyBracesToken) + addMeta($$, $1.Meta, meta.DollarToken) + addMeta($$, $2.Meta, meta.OpenCurlyBracesToken) + addMeta($$, $4.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4690,7 +4685,7 @@ simple_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $$.AddComments($1.Comments, comment.DollarToken) + addMeta($$, $1.Meta, meta.DollarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4705,7 +4700,7 @@ static_member: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.PaamayimNekudotayimToken) + addMeta($$, $2.Meta, meta.PaamayimNekudotayimToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4717,7 +4712,7 @@ static_member: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.PaamayimNekudotayimToken) + addMeta($$, $2.Meta, meta.PaamayimNekudotayimToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4738,8 +4733,8 @@ new_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments - $$.AddComments($2.Comments, comment.OpenSquareBracket) - $$.AddComments($4.Comments, comment.CloseSquareBracket) + addMeta($$, $2.Meta, meta.OpenSquareBracket) + addMeta($$, $4.Meta, meta.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4751,8 +4746,8 @@ new_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments - $$.AddComments($2.Comments, comment.OpenCurlyBracesToken) - $$.AddComments($4.Comments, comment.CloseCurlyBracesToken) + addMeta($$, $2.Meta, meta.OpenCurlyBracesToken) + addMeta($$, $4.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4764,7 +4759,7 @@ new_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.ObjectOperatorToken) + addMeta($$, $2.Meta, meta.ObjectOperatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4776,7 +4771,7 @@ new_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.PaamayimNekudotayimToken) + addMeta($$, $2.Meta, meta.PaamayimNekudotayimToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4788,7 +4783,7 @@ new_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.PaamayimNekudotayimToken) + addMeta($$, $2.Meta, meta.PaamayimNekudotayimToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4803,7 +4798,7 @@ member_name: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $$.AddComments($1.Comments, comment.IdentifierToken) + addMeta($$, $1.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4812,8 +4807,8 @@ member_name: $$ = $2; // save comments - $$.AddComments($1.Comments, comment.OpenCurlyBracesToken) - $$.AddComments($3.Comments, comment.CloseCurlyBracesToken) + addMeta($$, $1.Meta, meta.OpenCurlyBracesToken) + addMeta($$, $3.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4834,7 +4829,7 @@ property_name: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $$.AddComments($1.Comments, comment.StringToken) + addMeta($$, $1.Meta, meta.StringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4843,8 +4838,8 @@ property_name: $$ = $2; // save comments - $$.AddComments($1.Comments, comment.OpenCurlyBracesToken) - $$.AddComments($3.Comments, comment.CloseCurlyBracesToken) + addMeta($$, $1.Meta, meta.OpenCurlyBracesToken) + addMeta($$, $3.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4890,7 +4885,7 @@ non_empty_array_pair_list: $$ = append($1, $3) // save comments - lastNode($1).AddComments($2.Comments, comment.CommaToken) + addMeta(lastNode($1), $2.Meta, meta.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4915,7 +4910,7 @@ array_pair: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $$.AddComments($2.Comments, comment.DoubleArrowToken) + addMeta($$, $2.Meta, meta.DoubleArrowToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4938,8 +4933,8 @@ array_pair: reference.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $4)) // save comments - $$.AddComments($2.Comments, comment.DoubleArrowToken) - reference.AddComments($3.Comments, comment.AmpersandToken) + addMeta($$, $2.Meta, meta.DoubleArrowToken) + addMeta(reference, $3.Meta, meta.AmpersandToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4953,7 +4948,7 @@ array_pair: reference.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - reference.AddComments($1.Comments, comment.AmpersandToken) + addMeta(reference, $1.Meta, meta.AmpersandToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4968,10 +4963,10 @@ array_pair: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $6)) // save comments - $$.AddComments($2.Comments, comment.DoubleArrowToken) - list.AddComments($3.Comments, comment.ListToken) - list.AddComments($4.Comments, comment.OpenParenthesisToken) - list.AddComments($6.Comments, comment.CloseParenthesisToken) + addMeta($$, $2.Meta, meta.DoubleArrowToken) + addMeta(list, $3.Meta, meta.ListToken) + addMeta(list, $4.Meta, meta.OpenParenthesisToken) + addMeta(list, $6.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4986,9 +4981,9 @@ array_pair: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - list.AddComments($1.Comments, comment.ListToken) - list.AddComments($2.Comments, comment.OpenParenthesisToken) - list.AddComments($4.Comments, comment.CloseParenthesisToken) + addMeta(list, $1.Meta, meta.ListToken) + addMeta(list, $2.Meta, meta.OpenParenthesisToken) + addMeta(list, $4.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5010,7 +5005,7 @@ encaps_list: encapsed.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) // save comments - encapsed.AddComments($2.Comments, comment.EncapsedAndWhitespaceToken) + addMeta(encapsed, $2.Meta, meta.EncapsedAndWhitespaceToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5029,7 +5024,7 @@ encaps_list: encapsed.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - encapsed.AddComments($1.Comments, comment.EncapsedAndWhitespaceToken) + addMeta(encapsed, $1.Meta, meta.EncapsedAndWhitespaceToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5046,7 +5041,7 @@ encaps_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $$.AddComments($1.Comments, comment.VariableToken) + addMeta($$, $1.Meta, meta.VariableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5062,9 +5057,9 @@ encaps_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - variable.AddComments($1.Comments, comment.VariableToken) - $$.AddComments($2.Comments, comment.OpenSquareBracket) - $$.AddComments($4.Comments, comment.CloseSquareBracket) + addMeta(variable, $1.Meta, meta.VariableToken) + addMeta($$, $2.Meta, meta.OpenSquareBracket) + addMeta($$, $4.Meta, meta.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5082,9 +5077,9 @@ encaps_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - variable.AddComments($1.Comments, comment.VariableToken) - $$.AddComments($2.Comments, comment.ObjectOperatorToken) - fetch.AddComments($3.Comments, comment.StringToken) + addMeta(variable, $1.Meta, meta.VariableToken) + addMeta($$, $2.Meta, meta.ObjectOperatorToken) + addMeta(fetch, $3.Meta, meta.StringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5096,8 +5091,8 @@ encaps_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $$.AddComments($1.Comments, comment.DollarOpenCurlyBracesToken) - $$.AddComments($3.Comments, comment.CloseCurlyBracesToken) + addMeta($$, $1.Meta, meta.DollarOpenCurlyBracesToken) + addMeta($$, $3.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5111,9 +5106,9 @@ encaps_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $$.AddComments($1.Comments, comment.DollarOpenCurlyBracesToken) - name.AddComments($2.Comments, comment.StringVarnameToken) - $$.AddComments($3.Comments, comment.CloseCurlyBracesToken) + addMeta($$, $1.Meta, meta.DollarOpenCurlyBracesToken) + addMeta(name, $2.Meta, meta.StringVarnameToken) + addMeta($$, $3.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5129,11 +5124,11 @@ encaps_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $6)) // save comments - $$.AddComments($1.Comments, comment.DollarOpenCurlyBracesToken) - variable.AddComments($2.Comments, comment.StringVarnameToken) - $$.AddComments($3.Comments, comment.OpenSquareBracket) - $$.AddComments($5.Comments, comment.CloseSquareBracket) - $$.AddComments($6.Comments, comment.CloseCurlyBracesToken) + addMeta($$, $1.Meta, meta.DollarOpenCurlyBracesToken) + addMeta(variable, $2.Meta, meta.StringVarnameToken) + addMeta($$, $3.Meta, meta.OpenSquareBracket) + addMeta($$, $5.Meta, meta.CloseSquareBracket) + addMeta($$, $6.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5154,7 +5149,7 @@ encaps_var_offset: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $$.AddComments($1.Comments, comment.StringToken) + addMeta($$, $1.Meta, meta.StringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5171,7 +5166,7 @@ encaps_var_offset: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $$.AddComments($1.Comments, comment.NumStringToken) + addMeta($$, $1.Meta, meta.NumStringToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5197,11 +5192,11 @@ encaps_var_offset: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - $$.AddComments($1.Comments, comment.MinusToken) + addMeta($$, $1.Meta, meta.MinusToken) if isInt { - lnumber.AddComments($2.Comments, comment.NumStringToken) + addMeta(lnumber, $2.Meta, meta.NumStringToken) } else { - $$.AddComments($2.Comments, comment.NumStringToken) + addMeta($$, $2.Meta, meta.NumStringToken) } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -5216,7 +5211,7 @@ encaps_var_offset: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $$.AddComments($1.Comments, comment.VariableToken) + addMeta($$, $1.Meta, meta.VariableToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5231,12 +5226,12 @@ internal_functions_in_yacc: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5)) // save comments - $$.AddComments($1.Comments, comment.IssetToken) - $$.AddComments($2.Comments, comment.OpenParenthesisToken) + addMeta($$, $1.Meta, meta.IssetToken) + addMeta($$, $2.Meta, meta.OpenParenthesisToken) if $4 != nil { - $$.AddComments($4.Comments, comment.CommaToken) + addMeta($$, $4.Meta, meta.CommaToken) } - $$.AddComments($5.Comments, comment.CloseParenthesisToken) + addMeta($$, $5.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5248,9 +5243,9 @@ internal_functions_in_yacc: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $$.AddComments($1.Comments, comment.EmptyToken) - $$.AddComments($2.Comments, comment.OpenParenthesisToken) - $$.AddComments($4.Comments, comment.CloseParenthesisToken) + addMeta($$, $1.Meta, meta.EmptyToken) + addMeta($$, $2.Meta, meta.OpenParenthesisToken) + addMeta($$, $4.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5262,7 +5257,7 @@ internal_functions_in_yacc: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $$.AddComments($1.Comments, comment.IncludeToken) + addMeta($$, $1.Meta, meta.IncludeToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5274,7 +5269,7 @@ internal_functions_in_yacc: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $$.AddComments($1.Comments, comment.IncludeOnceToken) + addMeta($$, $1.Meta, meta.IncludeOnceToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5286,9 +5281,9 @@ internal_functions_in_yacc: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $$.AddComments($1.Comments, comment.EvalToken) - $$.AddComments($2.Comments, comment.OpenParenthesisToken) - $$.AddComments($4.Comments, comment.CloseParenthesisToken) + addMeta($$, $1.Meta, meta.EvalToken) + addMeta($$, $2.Meta, meta.OpenParenthesisToken) + addMeta($$, $4.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5300,7 +5295,7 @@ internal_functions_in_yacc: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $$.AddComments($1.Comments, comment.RequireToken) + addMeta($$, $1.Meta, meta.RequireToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5312,7 +5307,7 @@ internal_functions_in_yacc: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $$.AddComments($1.Comments, comment.RequireOnceToken) + addMeta($$, $1.Meta, meta.RequireOnceToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5330,7 +5325,7 @@ isset_variables: $$ = append($1, $3) // save comments - lastNode($1).AddComments($2.Comments, comment.CommaToken) + addMeta(lastNode($1), $2.Meta, meta.CommaToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php7/php7_test.go b/php7/php7_test.go index 8028ec9..a5ab734 100644 --- a/php7/php7_test.go +++ b/php7/php7_test.go @@ -6,7 +6,6 @@ import ( "testing" "github.com/kylelemons/godebug/pretty" - "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node/expr" "github.com/z7zmey/php-parser/node/expr/assign" @@ -385,39 +384,39 @@ func TestPhp7(t *testing.T) { expected := &node.Root{ Position: &position.Position{ StartLine: 2, - EndLine: 347, - StartPos: 6, - EndPos: 6318, + EndLine: 347, + StartPos: 6, + EndPos: 6318, }, Stmts: []node.Node{ &stmt.Expression{ Position: &position.Position{ StartLine: 2, - EndLine: 2, - StartPos: 6, - EndPos: 20, + EndLine: 2, + StartPos: 6, + EndPos: 20, }, Expr: &expr.FunctionCall{ Position: &position.Position{ StartLine: 2, - EndLine: 2, - StartPos: 6, - EndPos: 19, + EndLine: 2, + StartPos: 6, + EndPos: 19, }, Function: &name.Name{ Position: &position.Position{ StartLine: 2, - EndLine: 2, - StartPos: 6, - EndPos: 8, + EndLine: 2, + StartPos: 6, + EndPos: 8, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 2, - EndLine: 2, - StartPos: 6, - EndPos: 8, + EndLine: 2, + StartPos: 6, + EndPos: 8, }, Value: "foo", }, @@ -426,33 +425,33 @@ func TestPhp7(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 2, - EndLine: 2, - StartPos: 9, - EndPos: 19, + EndLine: 2, + StartPos: 9, + EndPos: 19, }, Arguments: []node.Node{ &node.Argument{ Position: &position.Position{ StartLine: 2, - EndLine: 2, - StartPos: 10, - EndPos: 11, + EndLine: 2, + StartPos: 10, + EndPos: 11, }, - Variadic: false, + Variadic: false, IsReference: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 2, - EndLine: 2, - StartPos: 10, - EndPos: 11, + EndLine: 2, + StartPos: 10, + EndPos: 11, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 2, - EndLine: 2, - StartPos: 10, - EndPos: 11, + EndLine: 2, + StartPos: 10, + EndPos: 11, }, Value: "a", }, @@ -461,25 +460,25 @@ func TestPhp7(t *testing.T) { &node.Argument{ Position: &position.Position{ StartLine: 2, - EndLine: 2, - StartPos: 14, - EndPos: 18, + EndLine: 2, + StartPos: 14, + EndPos: 18, }, - Variadic: true, IsReference: false, + Variadic: true, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 2, - EndLine: 2, - StartPos: 17, - EndPos: 18, + EndLine: 2, + StartPos: 17, + EndPos: 18, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 2, - EndLine: 2, - StartPos: 17, - EndPos: 18, + EndLine: 2, + StartPos: 17, + EndPos: 18, }, Value: "b", }, @@ -492,30 +491,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 3, - EndLine: 3, - StartPos: 24, - EndPos: 39, + EndLine: 3, + StartPos: 24, + EndPos: 39, }, Expr: &expr.FunctionCall{ Position: &position.Position{ StartLine: 3, - EndLine: 3, - StartPos: 24, - EndPos: 38, + EndLine: 3, + StartPos: 24, + EndPos: 38, }, Function: &expr.Variable{ Position: &position.Position{ StartLine: 3, - EndLine: 3, - StartPos: 24, - EndPos: 27, + EndLine: 3, + StartPos: 24, + EndPos: 27, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 3, - EndLine: 3, - StartPos: 24, - EndPos: 27, + EndLine: 3, + StartPos: 24, + EndPos: 27, }, Value: "foo", }, @@ -523,33 +522,33 @@ func TestPhp7(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 3, - EndLine: 3, - StartPos: 28, - EndPos: 38, + EndLine: 3, + StartPos: 28, + EndPos: 38, }, Arguments: []node.Node{ &node.Argument{ Position: &position.Position{ StartLine: 3, - EndLine: 3, - StartPos: 29, - EndPos: 30, + EndLine: 3, + StartPos: 29, + EndPos: 30, }, - Variadic: false, + Variadic: false, IsReference: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 3, - EndLine: 3, - StartPos: 29, - EndPos: 30, + EndLine: 3, + StartPos: 29, + EndPos: 30, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 3, - EndLine: 3, - StartPos: 29, - EndPos: 30, + EndLine: 3, + StartPos: 29, + EndPos: 30, }, Value: "a", }, @@ -558,25 +557,25 @@ func TestPhp7(t *testing.T) { &node.Argument{ Position: &position.Position{ StartLine: 3, - EndLine: 3, - StartPos: 33, - EndPos: 37, + EndLine: 3, + StartPos: 33, + EndPos: 37, }, - Variadic: true, + Variadic: true, IsReference: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 3, - EndLine: 3, - StartPos: 36, - EndPos: 37, + EndLine: 3, + StartPos: 36, + EndPos: 37, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 3, - EndLine: 3, - StartPos: 36, - EndPos: 37, + EndLine: 3, + StartPos: 36, + EndPos: 37, }, Value: "b", }, @@ -589,30 +588,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 4, - EndLine: 4, - StartPos: 43, - EndPos: 63, + EndLine: 4, + StartPos: 43, + EndPos: 63, }, Expr: &expr.MethodCall{ Position: &position.Position{ StartLine: 4, - EndLine: 4, - StartPos: 43, - EndPos: 62, + EndLine: 4, + StartPos: 43, + EndPos: 62, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 4, - EndLine: 4, - StartPos: 43, - EndPos: 46, + EndLine: 4, + StartPos: 43, + EndPos: 46, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 4, - EndLine: 4, - StartPos: 43, - EndPos: 46, + EndLine: 4, + StartPos: 43, + EndPos: 46, }, Value: "foo", }, @@ -620,42 +619,42 @@ func TestPhp7(t *testing.T) { Method: &node.Identifier{ Position: &position.Position{ StartLine: 4, - EndLine: 4, - StartPos: 49, - EndPos: 51, + EndLine: 4, + StartPos: 49, + EndPos: 51, }, Value: "bar", }, ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 4, - EndLine: 4, - StartPos: 52, - EndPos: 62, + EndLine: 4, + StartPos: 52, + EndPos: 62, }, Arguments: []node.Node{ &node.Argument{ Position: &position.Position{ StartLine: 4, - EndLine: 4, - StartPos: 53, - EndPos: 54, + EndLine: 4, + StartPos: 53, + EndPos: 54, }, - Variadic: false, IsReference: false, + Variadic: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 4, - EndLine: 4, - StartPos: 53, - EndPos: 54, + EndLine: 4, + StartPos: 53, + EndPos: 54, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 4, - EndLine: 4, - StartPos: 53, - EndPos: 54, + EndLine: 4, + StartPos: 53, + EndPos: 54, }, Value: "a", }, @@ -664,25 +663,25 @@ func TestPhp7(t *testing.T) { &node.Argument{ Position: &position.Position{ StartLine: 4, - EndLine: 4, - StartPos: 57, - EndPos: 61, + EndLine: 4, + StartPos: 57, + EndPos: 61, }, - Variadic: true, + Variadic: true, IsReference: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 4, - EndLine: 4, - StartPos: 60, - EndPos: 61, + EndLine: 4, + StartPos: 60, + EndPos: 61, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 4, - EndLine: 4, - StartPos: 60, - EndPos: 61, + EndLine: 4, + StartPos: 60, + EndPos: 61, }, Value: "b", }, @@ -695,31 +694,31 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 5, - EndLine: 5, - StartPos: 67, - EndPos: 86, + EndLine: 5, + StartPos: 67, + EndPos: 86, }, Expr: &expr.StaticCall{ Position: &position.Position{ StartLine: 5, - EndLine: 5, - StartPos: 67, - EndPos: 85, + EndLine: 5, + StartPos: 67, + EndPos: 85, }, Class: &name.Name{ Position: &position.Position{ StartLine: 5, - EndLine: 5, - StartPos: 67, - EndPos: 69, + EndLine: 5, + StartPos: 67, + EndPos: 69, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 5, - EndLine: 5, - StartPos: 67, - EndPos: 69, + EndLine: 5, + StartPos: 67, + EndPos: 69, }, Value: "foo", }, @@ -728,42 +727,42 @@ func TestPhp7(t *testing.T) { Call: &node.Identifier{ Position: &position.Position{ StartLine: 5, - EndLine: 5, - StartPos: 72, - EndPos: 74, + EndLine: 5, + StartPos: 72, + EndPos: 74, }, Value: "bar", }, ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 5, - EndLine: 5, - StartPos: 75, - EndPos: 85, + EndLine: 5, + StartPos: 75, + EndPos: 85, }, Arguments: []node.Node{ &node.Argument{ Position: &position.Position{ StartLine: 5, - EndLine: 5, - StartPos: 76, - EndPos: 77, + EndLine: 5, + StartPos: 76, + EndPos: 77, }, - Variadic: false, + Variadic: false, IsReference: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 5, - EndLine: 5, - StartPos: 76, - EndPos: 77, + EndLine: 5, + StartPos: 76, + EndPos: 77, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 5, - EndLine: 5, - StartPos: 76, - EndPos: 77, + EndLine: 5, + StartPos: 76, + EndPos: 77, }, Value: "a", }, @@ -772,25 +771,25 @@ func TestPhp7(t *testing.T) { &node.Argument{ Position: &position.Position{ StartLine: 5, - EndLine: 5, - StartPos: 80, - EndPos: 84, + EndLine: 5, + StartPos: 80, + EndPos: 84, }, - Variadic: true, + Variadic: true, IsReference: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 5, - EndLine: 5, - StartPos: 83, - EndPos: 84, + EndLine: 5, + StartPos: 83, + EndPos: 84, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 5, - EndLine: 5, - StartPos: 83, - EndPos: 84, + EndLine: 5, + StartPos: 83, + EndPos: 84, }, Value: "b", }, @@ -803,30 +802,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 6, - EndLine: 6, - StartPos: 90, - EndPos: 110, + EndLine: 6, + StartPos: 90, + EndPos: 110, }, Expr: &expr.StaticCall{ Position: &position.Position{ StartLine: 6, - EndLine: 6, - StartPos: 90, - EndPos: 109, + EndLine: 6, + StartPos: 90, + EndPos: 109, }, Class: &expr.Variable{ Position: &position.Position{ StartLine: 6, - EndLine: 6, - StartPos: 90, - EndPos: 93, + EndLine: 6, + StartPos: 90, + EndPos: 93, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 6, - EndLine: 6, - StartPos: 90, - EndPos: 93, + EndLine: 6, + StartPos: 90, + EndPos: 93, }, Value: "foo", }, @@ -834,42 +833,42 @@ func TestPhp7(t *testing.T) { Call: &node.Identifier{ Position: &position.Position{ StartLine: 6, - EndLine: 6, - StartPos: 96, - EndPos: 98, + EndLine: 6, + StartPos: 96, + EndPos: 98, }, Value: "bar", }, ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 6, - EndLine: 6, - StartPos: 99, - EndPos: 109, + EndLine: 6, + StartPos: 99, + EndPos: 109, }, Arguments: []node.Node{ &node.Argument{ Position: &position.Position{ StartLine: 6, - EndLine: 6, - StartPos: 100, - EndPos: 101, + EndLine: 6, + StartPos: 100, + EndPos: 101, }, - Variadic: false, + Variadic: false, IsReference: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 6, - EndLine: 6, - StartPos: 100, - EndPos: 101, + EndLine: 6, + StartPos: 100, + EndPos: 101, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 6, - EndLine: 6, - StartPos: 100, - EndPos: 101, + EndLine: 6, + StartPos: 100, + EndPos: 101, }, Value: "a", }, @@ -878,25 +877,25 @@ func TestPhp7(t *testing.T) { &node.Argument{ Position: &position.Position{ StartLine: 6, - EndLine: 6, - StartPos: 104, - EndPos: 108, + EndLine: 6, + StartPos: 104, + EndPos: 108, }, + Variadic: true, IsReference: false, - Variadic: true, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 6, - EndLine: 6, - StartPos: 107, - EndPos: 108, + EndLine: 6, + StartPos: 107, + EndPos: 108, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 6, - EndLine: 6, - StartPos: 107, - EndPos: 108, + EndLine: 6, + StartPos: 107, + EndPos: 108, }, Value: "b", }, @@ -909,31 +908,31 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 7, - EndLine: 7, - StartPos: 114, - EndPos: 132, + EndLine: 7, + StartPos: 114, + EndPos: 132, }, Expr: &expr.New{ Position: &position.Position{ StartLine: 7, - EndLine: 7, - StartPos: 114, - EndPos: 131, + EndLine: 7, + StartPos: 114, + EndPos: 131, }, Class: &name.Name{ Position: &position.Position{ StartLine: 7, - EndLine: 7, - StartPos: 118, - EndPos: 120, + EndLine: 7, + StartPos: 118, + EndPos: 120, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 7, - EndLine: 7, - StartPos: 118, - EndPos: 120, + EndLine: 7, + StartPos: 118, + EndPos: 120, }, Value: "foo", }, @@ -942,33 +941,33 @@ func TestPhp7(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 7, - EndLine: 7, - StartPos: 121, - EndPos: 131, + EndLine: 7, + StartPos: 121, + EndPos: 131, }, Arguments: []node.Node{ &node.Argument{ Position: &position.Position{ StartLine: 7, - EndLine: 7, - StartPos: 122, - EndPos: 123, + EndLine: 7, + StartPos: 122, + EndPos: 123, }, - Variadic: false, + Variadic: false, IsReference: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 7, - EndLine: 7, - StartPos: 122, - EndPos: 123, + EndLine: 7, + StartPos: 122, + EndPos: 123, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 7, - EndLine: 7, - StartPos: 122, - EndPos: 123, + EndLine: 7, + StartPos: 122, + EndPos: 123, }, Value: "a", }, @@ -977,25 +976,25 @@ func TestPhp7(t *testing.T) { &node.Argument{ Position: &position.Position{ StartLine: 7, - EndLine: 7, - StartPos: 126, - EndPos: 130, + EndLine: 7, + StartPos: 126, + EndPos: 130, }, - Variadic: true, + Variadic: true, IsReference: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 7, - EndLine: 7, - StartPos: 129, - EndPos: 130, + EndLine: 7, + StartPos: 129, + EndPos: 130, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 7, - EndLine: 7, - StartPos: 129, - EndPos: 130, + EndLine: 7, + StartPos: 129, + EndPos: 130, }, Value: "b", }, @@ -1008,67 +1007,55 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 9, - EndLine: 9, - StartPos: 161, - EndPos: 185, + EndLine: 9, + StartPos: 161, + EndPos: 185, }, Expr: &expr.New{ Position: &position.Position{ StartLine: 9, - EndLine: 9, - StartPos: 161, - EndPos: 184, - }, - Comments: []*comment.Comment{ - { - Position: &position.Position{ - StartLine: 8, - EndLine: 8, - StartPos: 136, - EndPos: 157, - }, - Value: "/** anonymous class */", - TokenName: 'O', - }, + EndLine: 9, + StartPos: 161, + EndPos: 184, }, Class: &stmt.Class{ Position: &position.Position{ StartLine: 9, - EndLine: 9, - StartPos: 165, - EndPos: 184, + EndLine: 9, + StartPos: 165, + EndPos: 184, }, PhpDocComment: "/** anonymous class */", ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 9, - EndLine: 9, - StartPos: 171, - EndPos: 181, + EndLine: 9, + StartPos: 171, + EndPos: 181, }, Arguments: []node.Node{ &node.Argument{ Position: &position.Position{ StartLine: 9, - EndLine: 9, - StartPos: 172, - EndPos: 173, + EndLine: 9, + StartPos: 172, + EndPos: 173, }, - Variadic: false, + Variadic: false, IsReference: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 9, - EndLine: 9, - StartPos: 172, - EndPos: 173, + EndLine: 9, + StartPos: 172, + EndPos: 173, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 9, - EndLine: 9, - StartPos: 172, - EndPos: 173, + EndLine: 9, + StartPos: 172, + EndPos: 173, }, Value: "a", }, @@ -1077,25 +1064,25 @@ func TestPhp7(t *testing.T) { &node.Argument{ Position: &position.Position{ StartLine: 9, - EndLine: 9, - StartPos: 176, - EndPos: 180, + EndLine: 9, + StartPos: 176, + EndPos: 180, }, - Variadic: true, + Variadic: true, IsReference: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 9, - EndLine: 9, - StartPos: 179, - EndPos: 180, + EndLine: 9, + StartPos: 179, + EndPos: 180, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 9, - EndLine: 9, - StartPos: 179, - EndPos: 180, + EndLine: 9, + StartPos: 179, + EndPos: 180, }, Value: "b", }, @@ -1103,63 +1090,65 @@ func TestPhp7(t *testing.T) { }, }, }, - Stmts: []node.Node{}, + Stmts: []node.Node{ + }, }, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 10, - EndLine: 10, - StartPos: 189, - EndPos: 201, + EndLine: 10, + StartPos: 189, + EndPos: 201, }, Expr: &expr.New{ Position: &position.Position{ StartLine: 10, - EndLine: 10, - StartPos: 189, - EndPos: 200, + EndLine: 10, + StartPos: 189, + EndPos: 200, }, Class: &stmt.Class{ Position: &position.Position{ StartLine: 10, - EndLine: 10, - StartPos: 193, - EndPos: 200, + EndLine: 10, + StartPos: 193, + EndPos: 200, }, PhpDocComment: "", - Stmts: []node.Node{}, + Stmts: []node.Node{ + }, }, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 11, - EndLine: 11, - StartPos: 205, - EndPos: 213, + EndLine: 11, + StartPos: 205, + EndPos: 213, }, Expr: &expr.New{ Position: &position.Position{ StartLine: 11, - EndLine: 11, - StartPos: 205, - EndPos: 212, + EndLine: 11, + StartPos: 205, + EndPos: 212, }, Class: &expr.Variable{ Position: &position.Position{ StartLine: 11, - EndLine: 11, - StartPos: 209, - EndPos: 212, + EndLine: 11, + StartPos: 209, + EndPos: 212, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 11, - EndLine: 11, - StartPos: 209, - EndPos: 212, + EndLine: 11, + StartPos: 209, + EndPos: 212, }, Value: "foo", }, @@ -1169,37 +1158,37 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 12, - EndLine: 12, - StartPos: 217, - EndPos: 228, + EndLine: 12, + StartPos: 217, + EndPos: 228, }, Expr: &expr.New{ Position: &position.Position{ StartLine: 12, - EndLine: 12, - StartPos: 217, - EndPos: 227, + EndLine: 12, + StartPos: 217, + EndPos: 227, }, Class: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 12, - EndLine: 12, - StartPos: 221, - EndPos: 227, + EndLine: 12, + StartPos: 221, + EndPos: 227, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 12, - EndLine: 12, - StartPos: 221, - EndPos: 224, + EndLine: 12, + StartPos: 221, + EndPos: 224, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 12, - EndLine: 12, - StartPos: 221, - EndPos: 224, + EndLine: 12, + StartPos: 221, + EndPos: 224, }, Value: "foo", }, @@ -1207,9 +1196,9 @@ func TestPhp7(t *testing.T) { Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 12, - EndLine: 12, - StartPos: 226, - EndPos: 226, + EndLine: 12, + StartPos: 226, + EndPos: 226, }, Value: "1", }, @@ -1219,37 +1208,37 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 13, - EndLine: 13, - StartPos: 232, - EndPos: 246, + EndLine: 13, + StartPos: 232, + EndPos: 246, }, Expr: &expr.New{ Position: &position.Position{ StartLine: 13, - EndLine: 13, - StartPos: 232, - EndPos: 245, + EndLine: 13, + StartPos: 232, + EndPos: 245, }, Class: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 13, - EndLine: 13, - StartPos: 236, - EndPos: 245, + EndLine: 13, + StartPos: 236, + EndPos: 245, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 13, - EndLine: 13, - StartPos: 236, - EndPos: 239, + EndLine: 13, + StartPos: 236, + EndPos: 239, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 13, - EndLine: 13, - StartPos: 236, - EndPos: 239, + EndLine: 13, + StartPos: 236, + EndPos: 239, }, Value: "foo", }, @@ -1257,16 +1246,16 @@ func TestPhp7(t *testing.T) { Dim: &expr.Variable{ Position: &position.Position{ StartLine: 13, - EndLine: 13, - StartPos: 241, - EndPos: 244, + EndLine: 13, + StartPos: 241, + EndPos: 244, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 13, - EndLine: 13, - StartPos: 241, - EndPos: 244, + EndLine: 13, + StartPos: 241, + EndPos: 244, }, Value: "bar", }, @@ -1277,37 +1266,37 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 14, - EndLine: 14, - StartPos: 250, - EndPos: 263, + EndLine: 14, + StartPos: 250, + EndPos: 263, }, Expr: &expr.New{ Position: &position.Position{ StartLine: 14, - EndLine: 14, - StartPos: 250, - EndPos: 262, + EndLine: 14, + StartPos: 250, + EndPos: 262, }, Class: &expr.PropertyFetch{ Position: &position.Position{ StartLine: 14, - EndLine: 14, - StartPos: 254, - EndPos: 262, + EndLine: 14, + StartPos: 254, + EndPos: 262, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 14, - EndLine: 14, - StartPos: 254, - EndPos: 257, + EndLine: 14, + StartPos: 254, + EndPos: 257, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 14, - EndLine: 14, - StartPos: 254, - EndPos: 257, + EndLine: 14, + StartPos: 254, + EndPos: 257, }, Value: "foo", }, @@ -1315,9 +1304,9 @@ func TestPhp7(t *testing.T) { Property: &node.Identifier{ Position: &position.Position{ StartLine: 14, - EndLine: 14, - StartPos: 260, - EndPos: 262, + EndLine: 14, + StartPos: 260, + EndPos: 262, }, Value: "bar", }, @@ -1327,37 +1316,37 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 15, - EndLine: 15, - StartPos: 267, - EndPos: 281, + EndLine: 15, + StartPos: 267, + EndPos: 281, }, Expr: &expr.New{ Position: &position.Position{ StartLine: 15, - EndLine: 15, - StartPos: 267, - EndPos: 280, + EndLine: 15, + StartPos: 267, + EndPos: 280, }, Class: &expr.StaticPropertyFetch{ Position: &position.Position{ StartLine: 15, - EndLine: 15, - StartPos: 271, - EndPos: 280, + EndLine: 15, + StartPos: 271, + EndPos: 280, }, Class: &expr.Variable{ Position: &position.Position{ StartLine: 15, - EndLine: 15, - StartPos: 271, - EndPos: 274, + EndLine: 15, + StartPos: 271, + EndPos: 274, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 15, - EndLine: 15, - StartPos: 271, - EndPos: 274, + EndLine: 15, + StartPos: 271, + EndPos: 274, }, Value: "foo", }, @@ -1365,16 +1354,16 @@ func TestPhp7(t *testing.T) { Property: &expr.Variable{ Position: &position.Position{ StartLine: 15, - EndLine: 15, - StartPos: 277, - EndPos: 280, + EndLine: 15, + StartPos: 277, + EndPos: 280, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 15, - EndLine: 15, - StartPos: 277, - EndPos: 280, + EndLine: 15, + StartPos: 277, + EndPos: 280, }, Value: "bar", }, @@ -1385,46 +1374,46 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 16, - EndLine: 16, - StartPos: 285, - EndPos: 301, + EndLine: 16, + StartPos: 285, + EndPos: 301, }, Expr: &expr.New{ Position: &position.Position{ StartLine: 16, - EndLine: 16, - StartPos: 285, - EndPos: 300, + EndLine: 16, + StartPos: 285, + EndPos: 300, }, Class: &expr.StaticPropertyFetch{ Position: &position.Position{ StartLine: 16, - EndLine: 16, - StartPos: 289, - EndPos: 300, + EndLine: 16, + StartPos: 289, + EndPos: 300, }, Class: &node.Identifier{ Position: &position.Position{ StartLine: 16, - EndLine: 16, - StartPos: 289, - EndPos: 294, + EndLine: 16, + StartPos: 289, + EndPos: 294, }, Value: "static", }, Property: &expr.Variable{ Position: &position.Position{ StartLine: 16, - EndLine: 16, - StartPos: 297, - EndPos: 300, + EndLine: 16, + StartPos: 297, + EndPos: 300, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 16, - EndLine: 16, - StartPos: 297, - EndPos: 300, + EndLine: 16, + StartPos: 297, + EndPos: 300, }, Value: "bar", }, @@ -1435,18 +1424,18 @@ func TestPhp7(t *testing.T) { &stmt.Function{ Position: &position.Position{ StartLine: 18, - EndLine: 18, - StartPos: 306, - EndPos: 350, + EndLine: 18, + StartPos: 306, + EndPos: 350, }, - ReturnsRef: false, + ReturnsRef: false, PhpDocComment: "", FunctionName: &node.Identifier{ Position: &position.Position{ StartLine: 18, - EndLine: 18, - StartPos: 315, - EndPos: 317, + EndLine: 18, + StartPos: 315, + EndPos: 317, }, Value: "foo", }, @@ -1454,33 +1443,33 @@ func TestPhp7(t *testing.T) { &node.Parameter{ Position: &position.Position{ StartLine: 18, - EndLine: 18, - StartPos: 319, - EndPos: 332, + EndLine: 18, + StartPos: 319, + EndPos: 332, }, - ByRef: false, + ByRef: false, Variadic: false, VariableType: &node.Nullable{ Position: &position.Position{ StartLine: 18, - EndLine: 18, - StartPos: 319, - EndPos: 322, + EndLine: 18, + StartPos: 319, + EndPos: 322, }, Expr: &name.Name{ Position: &position.Position{ StartLine: 18, - EndLine: 18, - StartPos: 320, - EndPos: 322, + EndLine: 18, + StartPos: 320, + EndPos: 322, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 18, - EndLine: 18, - StartPos: 320, - EndPos: 322, + EndLine: 18, + StartPos: 320, + EndPos: 322, }, Value: "bar", }, @@ -1490,16 +1479,16 @@ func TestPhp7(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 18, - EndLine: 18, - StartPos: 324, - EndPos: 327, + EndLine: 18, + StartPos: 324, + EndPos: 327, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 18, - EndLine: 18, - StartPos: 324, - EndPos: 327, + EndLine: 18, + StartPos: 324, + EndPos: 327, }, Value: "bar", }, @@ -1507,24 +1496,24 @@ func TestPhp7(t *testing.T) { DefaultValue: &expr.ConstFetch{ Position: &position.Position{ StartLine: 18, - EndLine: 18, - StartPos: 329, - EndPos: 332, + EndLine: 18, + StartPos: 329, + EndPos: 332, }, Constant: &name.Name{ Position: &position.Position{ StartLine: 18, - EndLine: 18, - StartPos: 329, - EndPos: 332, + EndLine: 18, + StartPos: 329, + EndPos: 332, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 18, - EndLine: 18, - StartPos: 329, - EndPos: 332, + EndLine: 18, + StartPos: 329, + EndPos: 332, }, Value: "null", }, @@ -1535,26 +1524,26 @@ func TestPhp7(t *testing.T) { &node.Parameter{ Position: &position.Position{ StartLine: 18, - EndLine: 18, - StartPos: 335, - EndPos: 346, + EndLine: 18, + StartPos: 335, + EndPos: 346, }, - ByRef: true, + ByRef: true, Variadic: true, VariableType: &name.Name{ Position: &position.Position{ StartLine: 18, - EndLine: 18, - StartPos: 335, - EndPos: 337, + EndLine: 18, + StartPos: 335, + EndPos: 337, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 18, - EndLine: 18, - StartPos: 335, - EndPos: 337, + EndLine: 18, + StartPos: 335, + EndPos: 337, }, Value: "baz", }, @@ -1563,38 +1552,39 @@ func TestPhp7(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 18, - EndLine: 18, - StartPos: 343, - EndPos: 346, + EndLine: 18, + StartPos: 343, + EndPos: 346, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 18, - EndLine: 18, - StartPos: 343, - EndPos: 346, + EndLine: 18, + StartPos: 343, + EndPos: 346, }, Value: "baz", }, }, }, }, - Stmts: []node.Node{}, + Stmts: []node.Node{ + }, }, &stmt.Class{ Position: &position.Position{ StartLine: 19, - EndLine: 19, - StartPos: 354, - EndPos: 417, + EndLine: 19, + StartPos: 354, + EndPos: 417, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 19, - EndLine: 19, - StartPos: 360, - EndPos: 362, + EndLine: 19, + StartPos: 360, + EndPos: 362, }, Value: "foo", }, @@ -1602,18 +1592,18 @@ func TestPhp7(t *testing.T) { &stmt.ClassMethod{ Position: &position.Position{ StartLine: 19, - EndLine: 19, - StartPos: 365, - EndPos: 416, + EndLine: 19, + StartPos: 365, + EndPos: 416, }, - ReturnsRef: false, + ReturnsRef: false, PhpDocComment: "", MethodName: &node.Identifier{ Position: &position.Position{ StartLine: 19, - EndLine: 19, - StartPos: 381, - EndPos: 383, + EndLine: 19, + StartPos: 381, + EndPos: 383, }, Value: "foo", }, @@ -1621,9 +1611,9 @@ func TestPhp7(t *testing.T) { &node.Identifier{ Position: &position.Position{ StartLine: 19, - EndLine: 19, - StartPos: 365, - EndPos: 370, + EndLine: 19, + StartPos: 365, + EndPos: 370, }, Value: "public", }, @@ -1632,33 +1622,33 @@ func TestPhp7(t *testing.T) { &node.Parameter{ Position: &position.Position{ StartLine: 19, - EndLine: 19, - StartPos: 385, - EndPos: 398, + EndLine: 19, + StartPos: 385, + EndPos: 398, }, - ByRef: false, + ByRef: false, Variadic: false, VariableType: &node.Nullable{ Position: &position.Position{ StartLine: 19, - EndLine: 19, - StartPos: 385, - EndPos: 388, + EndLine: 19, + StartPos: 385, + EndPos: 388, }, Expr: &name.Name{ Position: &position.Position{ StartLine: 19, - EndLine: 19, - StartPos: 386, - EndPos: 388, + EndLine: 19, + StartPos: 386, + EndPos: 388, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 19, - EndLine: 19, - StartPos: 386, - EndPos: 388, + EndLine: 19, + StartPos: 386, + EndPos: 388, }, Value: "bar", }, @@ -1668,16 +1658,16 @@ func TestPhp7(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 19, - EndLine: 19, - StartPos: 390, - EndPos: 393, + EndLine: 19, + StartPos: 390, + EndPos: 393, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 19, - EndLine: 19, - StartPos: 390, - EndPos: 393, + EndLine: 19, + StartPos: 390, + EndPos: 393, }, Value: "bar", }, @@ -1685,24 +1675,24 @@ func TestPhp7(t *testing.T) { DefaultValue: &expr.ConstFetch{ Position: &position.Position{ StartLine: 19, - EndLine: 19, - StartPos: 395, - EndPos: 398, + EndLine: 19, + StartPos: 395, + EndPos: 398, }, Constant: &name.Name{ Position: &position.Position{ StartLine: 19, - EndLine: 19, - StartPos: 395, - EndPos: 398, + EndLine: 19, + StartPos: 395, + EndPos: 398, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 19, - EndLine: 19, - StartPos: 395, - EndPos: 398, + EndLine: 19, + StartPos: 395, + EndPos: 398, }, Value: "null", }, @@ -1713,26 +1703,26 @@ func TestPhp7(t *testing.T) { &node.Parameter{ Position: &position.Position{ StartLine: 19, - EndLine: 19, - StartPos: 401, - EndPos: 412, + EndLine: 19, + StartPos: 401, + EndPos: 412, }, - ByRef: true, + ByRef: true, Variadic: true, VariableType: &name.Name{ Position: &position.Position{ StartLine: 19, - EndLine: 19, - StartPos: 401, - EndPos: 403, + EndLine: 19, + StartPos: 401, + EndPos: 403, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 19, - EndLine: 19, - StartPos: 401, - EndPos: 403, + EndLine: 19, + StartPos: 401, + EndPos: 403, }, Value: "baz", }, @@ -1741,16 +1731,16 @@ func TestPhp7(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 19, - EndLine: 19, - StartPos: 409, - EndPos: 412, + EndLine: 19, + StartPos: 409, + EndPos: 412, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 19, - EndLine: 19, - StartPos: 409, - EndPos: 412, + EndLine: 19, + StartPos: 409, + EndPos: 412, }, Value: "baz", }, @@ -1760,11 +1750,12 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 19, - EndLine: 19, - StartPos: 415, - EndPos: 416, + EndLine: 19, + StartPos: 415, + EndPos: 416, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, }, }, @@ -1772,51 +1763,51 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 20, - EndLine: 20, - StartPos: 421, - EndPos: 462, + EndLine: 20, + StartPos: 421, + EndPos: 462, }, Expr: &expr.Closure{ Position: &position.Position{ StartLine: 20, - EndLine: 20, - StartPos: 421, - EndPos: 461, + EndLine: 20, + StartPos: 421, + EndPos: 461, }, - Static: false, + ReturnsRef: false, + Static: false, PhpDocComment: "", - ReturnsRef: false, Params: []node.Node{ &node.Parameter{ Position: &position.Position{ StartLine: 20, - EndLine: 20, - StartPos: 430, - EndPos: 443, + EndLine: 20, + StartPos: 430, + EndPos: 443, }, - ByRef: false, + ByRef: false, Variadic: false, VariableType: &node.Nullable{ Position: &position.Position{ StartLine: 20, - EndLine: 20, - StartPos: 430, - EndPos: 433, + EndLine: 20, + StartPos: 430, + EndPos: 433, }, Expr: &name.Name{ Position: &position.Position{ StartLine: 20, - EndLine: 20, - StartPos: 431, - EndPos: 433, + EndLine: 20, + StartPos: 431, + EndPos: 433, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 20, - EndLine: 20, - StartPos: 431, - EndPos: 433, + EndLine: 20, + StartPos: 431, + EndPos: 433, }, Value: "bar", }, @@ -1826,16 +1817,16 @@ func TestPhp7(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 20, - EndLine: 20, - StartPos: 435, - EndPos: 438, + EndLine: 20, + StartPos: 435, + EndPos: 438, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 20, - EndLine: 20, - StartPos: 435, - EndPos: 438, + EndLine: 20, + StartPos: 435, + EndPos: 438, }, Value: "bar", }, @@ -1843,24 +1834,24 @@ func TestPhp7(t *testing.T) { DefaultValue: &expr.ConstFetch{ Position: &position.Position{ StartLine: 20, - EndLine: 20, - StartPos: 440, - EndPos: 443, + EndLine: 20, + StartPos: 440, + EndPos: 443, }, Constant: &name.Name{ Position: &position.Position{ StartLine: 20, - EndLine: 20, - StartPos: 440, - EndPos: 443, + EndLine: 20, + StartPos: 440, + EndPos: 443, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 20, - EndLine: 20, - StartPos: 440, - EndPos: 443, + EndLine: 20, + StartPos: 440, + EndPos: 443, }, Value: "null", }, @@ -1871,26 +1862,26 @@ func TestPhp7(t *testing.T) { &node.Parameter{ Position: &position.Position{ StartLine: 20, - EndLine: 20, - StartPos: 446, - EndPos: 457, + EndLine: 20, + StartPos: 446, + EndPos: 457, }, - ByRef: true, + ByRef: true, Variadic: true, VariableType: &name.Name{ Position: &position.Position{ StartLine: 20, - EndLine: 20, - StartPos: 446, - EndPos: 448, + EndLine: 20, + StartPos: 446, + EndPos: 448, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 20, - EndLine: 20, - StartPos: 446, - EndPos: 448, + EndLine: 20, + StartPos: 446, + EndPos: 448, }, Value: "baz", }, @@ -1899,73 +1890,74 @@ func TestPhp7(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 20, - EndLine: 20, - StartPos: 454, - EndPos: 457, + EndLine: 20, + StartPos: 454, + EndPos: 457, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 20, - EndLine: 20, - StartPos: 454, - EndPos: 457, + EndLine: 20, + StartPos: 454, + EndPos: 457, }, Value: "baz", }, }, }, }, - Stmts: []node.Node{}, + Stmts: []node.Node{ + }, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 21, - EndLine: 21, - StartPos: 466, - EndPos: 514, + EndLine: 21, + StartPos: 466, + EndPos: 514, }, Expr: &expr.Closure{ Position: &position.Position{ StartLine: 21, - EndLine: 21, - StartPos: 466, - EndPos: 513, + EndLine: 21, + StartPos: 466, + EndPos: 513, }, - Static: true, + ReturnsRef: false, + Static: true, PhpDocComment: "", - ReturnsRef: false, Params: []node.Node{ &node.Parameter{ Position: &position.Position{ StartLine: 21, - EndLine: 21, - StartPos: 482, - EndPos: 495, + EndLine: 21, + StartPos: 482, + EndPos: 495, }, - ByRef: false, + ByRef: false, Variadic: false, VariableType: &node.Nullable{ Position: &position.Position{ StartLine: 21, - EndLine: 21, - StartPos: 482, - EndPos: 485, + EndLine: 21, + StartPos: 482, + EndPos: 485, }, Expr: &name.Name{ Position: &position.Position{ StartLine: 21, - EndLine: 21, - StartPos: 483, - EndPos: 485, + EndLine: 21, + StartPos: 483, + EndPos: 485, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 21, - EndLine: 21, - StartPos: 483, - EndPos: 485, + EndLine: 21, + StartPos: 483, + EndPos: 485, }, Value: "bar", }, @@ -1975,16 +1967,16 @@ func TestPhp7(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 21, - EndLine: 21, - StartPos: 487, - EndPos: 490, + EndLine: 21, + StartPos: 487, + EndPos: 490, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 21, - EndLine: 21, - StartPos: 487, - EndPos: 490, + EndLine: 21, + StartPos: 487, + EndPos: 490, }, Value: "bar", }, @@ -1992,24 +1984,24 @@ func TestPhp7(t *testing.T) { DefaultValue: &expr.ConstFetch{ Position: &position.Position{ StartLine: 21, - EndLine: 21, - StartPos: 492, - EndPos: 495, + EndLine: 21, + StartPos: 492, + EndPos: 495, }, Constant: &name.Name{ Position: &position.Position{ StartLine: 21, - EndLine: 21, - StartPos: 492, - EndPos: 495, + EndLine: 21, + StartPos: 492, + EndPos: 495, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 21, - EndLine: 21, - StartPos: 492, - EndPos: 495, + EndLine: 21, + StartPos: 492, + EndPos: 495, }, Value: "null", }, @@ -2020,26 +2012,26 @@ func TestPhp7(t *testing.T) { &node.Parameter{ Position: &position.Position{ StartLine: 21, - EndLine: 21, - StartPos: 498, - EndPos: 509, + EndLine: 21, + StartPos: 498, + EndPos: 509, }, - ByRef: true, Variadic: true, + ByRef: true, VariableType: &name.Name{ Position: &position.Position{ StartLine: 21, - EndLine: 21, - StartPos: 498, - EndPos: 500, + EndLine: 21, + StartPos: 498, + EndPos: 500, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 21, - EndLine: 21, - StartPos: 498, - EndPos: 500, + EndLine: 21, + StartPos: 498, + EndPos: 500, }, Value: "baz", }, @@ -2048,38 +2040,39 @@ func TestPhp7(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 21, - EndLine: 21, - StartPos: 506, - EndPos: 509, + EndLine: 21, + StartPos: 506, + EndPos: 509, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 21, - EndLine: 21, - StartPos: 506, - EndPos: 509, + EndLine: 21, + StartPos: 506, + EndPos: 509, }, Value: "baz", }, }, }, }, - Stmts: []node.Node{}, + Stmts: []node.Node{ + }, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 23, - EndLine: 23, - StartPos: 519, - EndPos: 538, + EndLine: 23, + StartPos: 519, + EndPos: 538, }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 23, - EndLine: 23, - StartPos: 519, - EndPos: 537, + EndLine: 23, + StartPos: 519, + EndPos: 537, }, Value: "1234567890123456789", }, @@ -2087,16 +2080,16 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 24, - EndLine: 24, - StartPos: 542, - EndPos: 562, + EndLine: 24, + StartPos: 542, + EndPos: 562, }, Expr: &scalar.Dnumber{ Position: &position.Position{ StartLine: 24, - EndLine: 24, - StartPos: 542, - EndPos: 561, + EndLine: 24, + StartPos: 542, + EndPos: 561, }, Value: "12345678901234567890", }, @@ -2104,16 +2097,16 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 25, - EndLine: 25, - StartPos: 566, - EndPos: 568, + EndLine: 25, + StartPos: 566, + EndPos: 568, }, Expr: &scalar.Dnumber{ Position: &position.Position{ StartLine: 25, - EndLine: 25, - StartPos: 566, - EndPos: 567, + EndLine: 25, + StartPos: 566, + EndPos: 567, }, Value: "0.", }, @@ -2121,16 +2114,16 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 26, - EndLine: 26, - StartPos: 572, - EndPos: 638, + EndLine: 26, + StartPos: 572, + EndPos: 638, }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 26, - EndLine: 26, - StartPos: 572, - EndPos: 637, + EndLine: 26, + StartPos: 572, + EndPos: 637, }, Value: "0b0111111111111111111111111111111111111111111111111111111111111111", }, @@ -2138,16 +2131,16 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 27, - EndLine: 27, - StartPos: 642, - EndPos: 708, + EndLine: 27, + StartPos: 642, + EndPos: 708, }, Expr: &scalar.Dnumber{ Position: &position.Position{ StartLine: 27, - EndLine: 27, - StartPos: 642, - EndPos: 707, + EndLine: 27, + StartPos: 642, + EndPos: 707, }, Value: "0b1111111111111111111111111111111111111111111111111111111111111111", }, @@ -2155,16 +2148,16 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 28, - EndLine: 28, - StartPos: 712, - EndPos: 732, + EndLine: 28, + StartPos: 712, + EndPos: 732, }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 28, - EndLine: 28, - StartPos: 712, - EndPos: 731, + EndLine: 28, + StartPos: 712, + EndPos: 731, }, Value: "0x007111111111111111", }, @@ -2172,16 +2165,16 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 29, - EndLine: 29, - StartPos: 736, - EndPos: 754, + EndLine: 29, + StartPos: 736, + EndPos: 754, }, Expr: &scalar.Dnumber{ Position: &position.Position{ StartLine: 29, - EndLine: 29, - StartPos: 736, - EndPos: 753, + EndLine: 29, + StartPos: 736, + EndPos: 753, }, Value: "0x8111111111111111", }, @@ -2189,16 +2182,16 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 30, - EndLine: 30, - StartPos: 758, - EndPos: 767, + EndLine: 30, + StartPos: 758, + EndPos: 767, }, Expr: &scalar.MagicConstant{ Position: &position.Position{ StartLine: 30, - EndLine: 30, - StartPos: 758, - EndPos: 766, + EndLine: 30, + StartPos: 758, + EndPos: 766, }, Value: "__CLASS__", }, @@ -2206,16 +2199,16 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 31, - EndLine: 31, - StartPos: 771, - EndPos: 778, + EndLine: 31, + StartPos: 771, + EndPos: 778, }, Expr: &scalar.MagicConstant{ Position: &position.Position{ StartLine: 31, - EndLine: 31, - StartPos: 771, - EndPos: 777, + EndLine: 31, + StartPos: 771, + EndPos: 777, }, Value: "__DIR__", }, @@ -2223,16 +2216,16 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 32, - EndLine: 32, - StartPos: 782, - EndPos: 790, + EndLine: 32, + StartPos: 782, + EndPos: 790, }, Expr: &scalar.MagicConstant{ Position: &position.Position{ StartLine: 32, - EndLine: 32, - StartPos: 782, - EndPos: 789, + EndLine: 32, + StartPos: 782, + EndPos: 789, }, Value: "__FILE__", }, @@ -2240,16 +2233,16 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 33, - EndLine: 33, - StartPos: 794, - EndPos: 806, + EndLine: 33, + StartPos: 794, + EndPos: 806, }, Expr: &scalar.MagicConstant{ Position: &position.Position{ StartLine: 33, - EndLine: 33, - StartPos: 794, - EndPos: 805, + EndLine: 33, + StartPos: 794, + EndPos: 805, }, Value: "__FUNCTION__", }, @@ -2257,16 +2250,16 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 34, - EndLine: 34, - StartPos: 810, - EndPos: 818, + EndLine: 34, + StartPos: 810, + EndPos: 818, }, Expr: &scalar.MagicConstant{ Position: &position.Position{ StartLine: 34, - EndLine: 34, - StartPos: 810, - EndPos: 817, + EndLine: 34, + StartPos: 810, + EndPos: 817, }, Value: "__LINE__", }, @@ -2274,16 +2267,16 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 35, - EndLine: 35, - StartPos: 822, - EndPos: 835, + EndLine: 35, + StartPos: 822, + EndPos: 835, }, Expr: &scalar.MagicConstant{ Position: &position.Position{ StartLine: 35, - EndLine: 35, - StartPos: 822, - EndPos: 834, + EndLine: 35, + StartPos: 822, + EndPos: 834, }, Value: "__NAMESPACE__", }, @@ -2291,16 +2284,16 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 36, - EndLine: 36, - StartPos: 839, - EndPos: 849, + EndLine: 36, + StartPos: 839, + EndPos: 849, }, Expr: &scalar.MagicConstant{ Position: &position.Position{ StartLine: 36, - EndLine: 36, - StartPos: 839, - EndPos: 848, + EndLine: 36, + StartPos: 839, + EndPos: 848, }, Value: "__METHOD__", }, @@ -2308,16 +2301,16 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 37, - EndLine: 37, - StartPos: 853, - EndPos: 862, + EndLine: 37, + StartPos: 853, + EndPos: 862, }, Expr: &scalar.MagicConstant{ Position: &position.Position{ StartLine: 37, - EndLine: 37, - StartPos: 853, - EndPos: 861, + EndLine: 37, + StartPos: 853, + EndPos: 861, }, Value: "__TRAIT__", }, @@ -2325,40 +2318,40 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 39, - EndLine: 39, - StartPos: 867, - EndPos: 878, + EndLine: 39, + StartPos: 867, + EndPos: 878, }, Expr: &scalar.Encapsed{ Position: &position.Position{ StartLine: 39, - EndLine: 39, - StartPos: 867, - EndPos: 877, + EndLine: 39, + StartPos: 867, + EndPos: 877, }, Parts: []node.Node{ &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 39, - EndLine: 39, - StartPos: 868, - EndPos: 872, + EndLine: 39, + StartPos: 868, + EndPos: 872, }, Value: "test ", }, &expr.Variable{ Position: &position.Position{ StartLine: 39, - EndLine: 39, - StartPos: 873, - EndPos: 876, + EndLine: 39, + StartPos: 873, + EndPos: 876, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 39, - EndLine: 39, - StartPos: 873, - EndPos: 876, + EndLine: 39, + StartPos: 873, + EndPos: 876, }, Value: "var", }, @@ -2369,47 +2362,47 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 40, - EndLine: 40, - StartPos: 882, - EndPos: 896, + EndLine: 40, + StartPos: 882, + EndPos: 896, }, Expr: &scalar.Encapsed{ Position: &position.Position{ StartLine: 40, - EndLine: 40, - StartPos: 882, - EndPos: 895, + EndLine: 40, + StartPos: 882, + EndPos: 895, }, Parts: []node.Node{ &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 40, - EndLine: 40, - StartPos: 883, - EndPos: 887, + EndLine: 40, + StartPos: 883, + EndPos: 887, }, Value: "test ", }, &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 40, - EndLine: 40, - StartPos: 888, - EndPos: 894, + EndLine: 40, + StartPos: 888, + EndPos: 894, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 40, - EndLine: 40, - StartPos: 888, - EndPos: 891, + EndLine: 40, + StartPos: 888, + EndPos: 891, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 40, - EndLine: 40, - StartPos: 888, - EndPos: 891, + EndLine: 40, + StartPos: 888, + EndPos: 891, }, Value: "var", }, @@ -2417,9 +2410,9 @@ func TestPhp7(t *testing.T) { Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 40, - EndLine: 40, - StartPos: 893, - EndPos: 893, + EndLine: 40, + StartPos: 893, + EndPos: 893, }, Value: "1", }, @@ -2430,47 +2423,47 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 41, - EndLine: 41, - StartPos: 900, - EndPos: 915, + EndLine: 41, + StartPos: 900, + EndPos: 915, }, Expr: &scalar.Encapsed{ Position: &position.Position{ StartLine: 41, - EndLine: 41, - StartPos: 900, - EndPos: 914, + EndLine: 41, + StartPos: 900, + EndPos: 914, }, Parts: []node.Node{ &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 41, - EndLine: 41, - StartPos: 901, - EndPos: 905, + EndLine: 41, + StartPos: 901, + EndPos: 905, }, Value: "test ", }, &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 41, - EndLine: 41, - StartPos: 906, - EndPos: 913, + EndLine: 41, + StartPos: 906, + EndPos: 913, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 41, - EndLine: 41, - StartPos: 906, - EndPos: 909, + EndLine: 41, + StartPos: 906, + EndPos: 909, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 41, - EndLine: 41, - StartPos: 906, - EndPos: 909, + EndLine: 41, + StartPos: 906, + EndPos: 909, }, Value: "var", }, @@ -2478,16 +2471,16 @@ func TestPhp7(t *testing.T) { Dim: &expr.UnaryMinus{ Position: &position.Position{ StartLine: 41, - EndLine: 41, - StartPos: 911, - EndPos: 912, + EndLine: 41, + StartPos: 911, + EndPos: 912, }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 41, - EndLine: 41, - StartPos: 911, - EndPos: 912, + EndLine: 41, + StartPos: 911, + EndPos: 912, }, Value: "1", }, @@ -2499,47 +2492,47 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 42, - EndLine: 42, - StartPos: 919, - EndPos: 972, + EndLine: 42, + StartPos: 919, + EndPos: 972, }, Expr: &scalar.Encapsed{ Position: &position.Position{ StartLine: 42, - EndLine: 42, - StartPos: 919, - EndPos: 971, + EndLine: 42, + StartPos: 919, + EndPos: 971, }, Parts: []node.Node{ &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 42, - EndLine: 42, - StartPos: 920, - EndPos: 924, + EndLine: 42, + StartPos: 920, + EndPos: 924, }, Value: "test ", }, &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 42, - EndLine: 42, - StartPos: 925, - EndPos: 970, + EndLine: 42, + StartPos: 925, + EndPos: 970, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 42, - EndLine: 42, - StartPos: 925, - EndPos: 928, + EndLine: 42, + StartPos: 925, + EndPos: 928, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 42, - EndLine: 42, - StartPos: 925, - EndPos: 928, + EndLine: 42, + StartPos: 925, + EndPos: 928, }, Value: "var", }, @@ -2547,9 +2540,9 @@ func TestPhp7(t *testing.T) { Dim: &scalar.String{ Position: &position.Position{ StartLine: 42, - EndLine: 42, - StartPos: 930, - EndPos: 969, + EndLine: 42, + StartPos: 930, + EndPos: 969, }, Value: "1234567890123456789012345678901234567890", }, @@ -2560,47 +2553,47 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 43, - EndLine: 43, - StartPos: 976, - EndPos: 1030, + EndLine: 43, + StartPos: 976, + EndPos: 1030, }, Expr: &scalar.Encapsed{ Position: &position.Position{ StartLine: 43, - EndLine: 43, - StartPos: 976, - EndPos: 1029, + EndLine: 43, + StartPos: 976, + EndPos: 1029, }, Parts: []node.Node{ &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 43, - EndLine: 43, - StartPos: 977, - EndPos: 981, + EndLine: 43, + StartPos: 977, + EndPos: 981, }, Value: "test ", }, &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 43, - EndLine: 43, - StartPos: 982, - EndPos: 1028, + EndLine: 43, + StartPos: 982, + EndPos: 1028, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 43, - EndLine: 43, - StartPos: 982, - EndPos: 985, + EndLine: 43, + StartPos: 982, + EndPos: 985, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 43, - EndLine: 43, - StartPos: 982, - EndPos: 985, + EndLine: 43, + StartPos: 982, + EndPos: 985, }, Value: "var", }, @@ -2608,9 +2601,9 @@ func TestPhp7(t *testing.T) { Dim: &scalar.String{ Position: &position.Position{ StartLine: 43, - EndLine: 43, - StartPos: 987, - EndPos: 1027, + EndLine: 43, + StartPos: 987, + EndPos: 1027, }, Value: "-1234567890123456789012345678901234567890", }, @@ -2621,47 +2614,47 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 44, - EndLine: 44, - StartPos: 1034, - EndPos: 1050, + EndLine: 44, + StartPos: 1034, + EndPos: 1050, }, Expr: &scalar.Encapsed{ Position: &position.Position{ StartLine: 44, - EndLine: 44, - StartPos: 1034, - EndPos: 1049, + EndLine: 44, + StartPos: 1034, + EndPos: 1049, }, Parts: []node.Node{ &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 44, - EndLine: 44, - StartPos: 1035, - EndPos: 1039, + EndLine: 44, + StartPos: 1035, + EndPos: 1039, }, Value: "test ", }, &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 44, - EndLine: 44, - StartPos: 1040, - EndPos: 1048, + EndLine: 44, + StartPos: 1040, + EndPos: 1048, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 44, - EndLine: 44, - StartPos: 1040, - EndPos: 1043, + EndLine: 44, + StartPos: 1040, + EndPos: 1043, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 44, - EndLine: 44, - StartPos: 1040, - EndPos: 1043, + EndLine: 44, + StartPos: 1040, + EndPos: 1043, }, Value: "var", }, @@ -2669,9 +2662,9 @@ func TestPhp7(t *testing.T) { Dim: &scalar.String{ Position: &position.Position{ StartLine: 44, - EndLine: 44, - StartPos: 1045, - EndPos: 1047, + EndLine: 44, + StartPos: 1045, + EndPos: 1047, }, Value: "bar", }, @@ -2682,47 +2675,47 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 45, - EndLine: 45, - StartPos: 1054, - EndPos: 1071, + EndLine: 45, + StartPos: 1054, + EndPos: 1071, }, Expr: &scalar.Encapsed{ Position: &position.Position{ StartLine: 45, - EndLine: 45, - StartPos: 1054, - EndPos: 1070, + EndLine: 45, + StartPos: 1054, + EndPos: 1070, }, Parts: []node.Node{ &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 45, - EndLine: 45, - StartPos: 1055, - EndPos: 1059, + EndLine: 45, + StartPos: 1055, + EndPos: 1059, }, Value: "test ", }, &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 45, - EndLine: 45, - StartPos: 1060, - EndPos: 1069, + EndLine: 45, + StartPos: 1060, + EndPos: 1069, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 45, - EndLine: 45, - StartPos: 1060, - EndPos: 1063, + EndLine: 45, + StartPos: 1060, + EndPos: 1063, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 45, - EndLine: 45, - StartPos: 1060, - EndPos: 1063, + EndLine: 45, + StartPos: 1060, + EndPos: 1063, }, Value: "var", }, @@ -2730,16 +2723,16 @@ func TestPhp7(t *testing.T) { Dim: &expr.Variable{ Position: &position.Position{ StartLine: 45, - EndLine: 45, - StartPos: 1065, - EndPos: 1068, + EndLine: 45, + StartPos: 1065, + EndPos: 1068, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 45, - EndLine: 45, - StartPos: 1065, - EndPos: 1068, + EndLine: 45, + StartPos: 1065, + EndPos: 1068, }, Value: "bar", }, @@ -2751,31 +2744,31 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 46, - EndLine: 46, - StartPos: 1075, - EndPos: 1086, + EndLine: 46, + StartPos: 1075, + EndPos: 1086, }, Expr: &scalar.Encapsed{ Position: &position.Position{ StartLine: 46, - EndLine: 46, - StartPos: 1075, - EndPos: 1085, + EndLine: 46, + StartPos: 1075, + EndPos: 1085, }, Parts: []node.Node{ &expr.Variable{ Position: &position.Position{ StartLine: 46, - EndLine: 46, - StartPos: 1076, - EndPos: 1079, + EndLine: 46, + StartPos: 1076, + EndPos: 1079, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 46, - EndLine: 46, - StartPos: 1076, - EndPos: 1079, + EndLine: 46, + StartPos: 1076, + EndPos: 1079, }, Value: "foo", }, @@ -2783,25 +2776,25 @@ func TestPhp7(t *testing.T) { &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 46, - EndLine: 46, - StartPos: 1080, - EndPos: 1080, + EndLine: 46, + StartPos: 1080, + EndPos: 1080, }, Value: " ", }, &expr.Variable{ Position: &position.Position{ StartLine: 46, - EndLine: 46, - StartPos: 1081, - EndPos: 1084, + EndLine: 46, + StartPos: 1081, + EndPos: 1084, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 46, - EndLine: 46, - StartPos: 1081, - EndPos: 1084, + EndLine: 46, + StartPos: 1081, + EndPos: 1084, }, Value: "bar", }, @@ -2812,47 +2805,47 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 47, - EndLine: 47, - StartPos: 1090, - EndPos: 1108, + EndLine: 47, + StartPos: 1090, + EndPos: 1108, }, Expr: &scalar.Encapsed{ Position: &position.Position{ StartLine: 47, - EndLine: 47, - StartPos: 1090, - EndPos: 1107, + EndLine: 47, + StartPos: 1090, + EndPos: 1107, }, Parts: []node.Node{ &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 47, - EndLine: 47, - StartPos: 1091, - EndPos: 1095, + EndLine: 47, + StartPos: 1091, + EndPos: 1095, }, Value: "test ", }, &expr.PropertyFetch{ Position: &position.Position{ StartLine: 47, - EndLine: 47, - StartPos: 1096, - EndPos: 1104, + EndLine: 47, + StartPos: 1096, + EndPos: 1104, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 47, - EndLine: 47, - StartPos: 1096, - EndPos: 1099, + EndLine: 47, + StartPos: 1096, + EndPos: 1099, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 47, - EndLine: 47, - StartPos: 1096, - EndPos: 1099, + EndLine: 47, + StartPos: 1096, + EndPos: 1099, }, Value: "foo", }, @@ -2860,9 +2853,9 @@ func TestPhp7(t *testing.T) { Property: &node.Identifier{ Position: &position.Position{ StartLine: 47, - EndLine: 47, - StartPos: 1102, - EndPos: 1104, + EndLine: 47, + StartPos: 1102, + EndPos: 1104, }, Value: "bar", }, @@ -2870,9 +2863,9 @@ func TestPhp7(t *testing.T) { &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 47, - EndLine: 47, - StartPos: 1105, - EndPos: 1106, + EndLine: 47, + StartPos: 1105, + EndPos: 1106, }, Value: "()", }, @@ -2882,40 +2875,40 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 48, - EndLine: 48, - StartPos: 1112, - EndPos: 1125, + EndLine: 48, + StartPos: 1112, + EndPos: 1125, }, Expr: &scalar.Encapsed{ Position: &position.Position{ StartLine: 48, - EndLine: 48, - StartPos: 1112, - EndPos: 1124, + EndLine: 48, + StartPos: 1112, + EndPos: 1124, }, Parts: []node.Node{ &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 48, - EndLine: 48, - StartPos: 1113, - EndPos: 1117, + EndLine: 48, + StartPos: 1113, + EndPos: 1117, }, Value: "test ", }, &expr.Variable{ Position: &position.Position{ StartLine: 48, - EndLine: 48, - StartPos: 1118, - EndPos: 1123, + EndLine: 48, + StartPos: 1118, + EndPos: 1123, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 48, - EndLine: 48, - StartPos: 1120, - EndPos: 1122, + EndLine: 48, + StartPos: 1120, + EndPos: 1122, }, Value: "foo", }, @@ -2926,47 +2919,47 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 49, - EndLine: 49, - StartPos: 1129, - EndPos: 1145, + EndLine: 49, + StartPos: 1129, + EndPos: 1145, }, Expr: &scalar.Encapsed{ Position: &position.Position{ StartLine: 49, - EndLine: 49, - StartPos: 1129, - EndPos: 1144, + EndLine: 49, + StartPos: 1129, + EndPos: 1144, }, Parts: []node.Node{ &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 49, - EndLine: 49, - StartPos: 1130, - EndPos: 1134, + EndLine: 49, + StartPos: 1130, + EndPos: 1134, }, Value: "test ", }, &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 49, - EndLine: 49, - StartPos: 1135, - EndPos: 1143, + EndLine: 49, + StartPos: 1135, + EndPos: 1143, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 49, - EndLine: 49, - StartPos: 1137, - EndPos: 1139, + EndLine: 49, + StartPos: 1137, + EndPos: 1139, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 49, - EndLine: 49, - StartPos: 1137, - EndPos: 1139, + EndLine: 49, + StartPos: 1137, + EndPos: 1139, }, Value: "foo", }, @@ -2974,9 +2967,9 @@ func TestPhp7(t *testing.T) { Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 49, - EndLine: 49, - StartPos: 1141, - EndPos: 1141, + EndLine: 49, + StartPos: 1141, + EndPos: 1141, }, Value: "0", }, @@ -2987,47 +2980,47 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 50, - EndLine: 50, - StartPos: 1149, - EndPos: 1163, + EndLine: 50, + StartPos: 1149, + EndPos: 1163, }, Expr: &scalar.Encapsed{ Position: &position.Position{ StartLine: 50, - EndLine: 50, - StartPos: 1149, - EndPos: 1162, + EndLine: 50, + StartPos: 1149, + EndPos: 1162, }, Parts: []node.Node{ &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 50, - EndLine: 50, - StartPos: 1150, - EndPos: 1154, + EndLine: 50, + StartPos: 1150, + EndPos: 1154, }, Value: "test ", }, &expr.Variable{ Position: &position.Position{ StartLine: 50, - EndLine: 50, - StartPos: 1155, - EndPos: 1161, + EndLine: 50, + StartPos: 1155, + EndPos: 1161, }, VarName: &expr.Variable{ Position: &position.Position{ StartLine: 50, - EndLine: 50, - StartPos: 1157, - EndPos: 1160, + EndLine: 50, + StartPos: 1157, + EndPos: 1160, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 50, - EndLine: 50, - StartPos: 1157, - EndPos: 1160, + EndLine: 50, + StartPos: 1157, + EndPos: 1160, }, Value: "foo", }, @@ -3039,47 +3032,47 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 51, - EndLine: 51, - StartPos: 1167, - EndPos: 1187, + EndLine: 51, + StartPos: 1167, + EndPos: 1187, }, Expr: &scalar.Encapsed{ Position: &position.Position{ StartLine: 51, - EndLine: 51, - StartPos: 1167, - EndPos: 1186, + EndLine: 51, + StartPos: 1167, + EndPos: 1186, }, Parts: []node.Node{ &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 51, - EndLine: 51, - StartPos: 1168, - EndPos: 1172, + EndLine: 51, + StartPos: 1168, + EndPos: 1172, }, Value: "test ", }, &expr.MethodCall{ Position: &position.Position{ StartLine: 51, - EndLine: 51, - StartPos: 1174, - EndPos: 1184, + EndLine: 51, + StartPos: 1174, + EndPos: 1184, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 51, - EndLine: 51, - StartPos: 1174, - EndPos: 1177, + EndLine: 51, + StartPos: 1174, + EndPos: 1177, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 51, - EndLine: 51, - StartPos: 1174, - EndPos: 1177, + EndLine: 51, + StartPos: 1174, + EndPos: 1177, }, Value: "foo", }, @@ -3087,18 +3080,18 @@ func TestPhp7(t *testing.T) { Method: &node.Identifier{ Position: &position.Position{ StartLine: 51, - EndLine: 51, - StartPos: 1180, - EndPos: 1182, + EndLine: 51, + StartPos: 1180, + EndPos: 1182, }, Value: "bar", }, ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 51, - EndLine: 51, - StartPos: 1183, - EndPos: 1184, + EndLine: 51, + StartPos: 1183, + EndPos: 1184, }, }, }, @@ -3108,23 +3101,23 @@ func TestPhp7(t *testing.T) { &stmt.AltIf{ Position: &position.Position{ StartLine: 53, - EndLine: 54, - StartPos: 1192, - EndPos: 1209, + EndLine: 54, + StartPos: 1192, + EndPos: 1209, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 53, - EndLine: 53, - StartPos: 1196, - EndPos: 1197, + EndLine: 53, + StartPos: 1196, + EndPos: 1197, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 53, - EndLine: 53, - StartPos: 1196, - EndPos: 1197, + EndLine: 53, + StartPos: 1196, + EndPos: 1197, }, Value: "a", }, @@ -3132,33 +3125,34 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, }, &stmt.AltIf{ Position: &position.Position{ StartLine: 55, - EndLine: 57, - StartPos: 1213, - EndPos: 1245, + EndLine: 57, + StartPos: 1213, + EndPos: 1245, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 55, - EndLine: 55, - StartPos: 1217, - EndPos: 1218, + EndLine: 55, + StartPos: 1217, + EndPos: 1218, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 55, - EndLine: 55, - StartPos: 1217, - EndPos: 1218, + EndLine: 55, + StartPos: 1217, + EndPos: 1218, }, Value: "a", }, @@ -3166,33 +3160,34 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, ElseIf: []node.Node{ &stmt.AltElseIf{ Position: &position.Position{ StartLine: 56, - EndLine: -1, - StartPos: 1225, - EndPos: -1, + EndLine: -1, + StartPos: 1225, + EndPos: -1, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 56, - EndLine: 56, - StartPos: 1233, - EndPos: 1234, + EndLine: 56, + StartPos: 1233, + EndPos: 1234, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 56, - EndLine: 56, - StartPos: 1233, - EndPos: 1234, + EndLine: 56, + StartPos: 1233, + EndPos: 1234, }, Value: "b", }, @@ -3200,11 +3195,12 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, }, }, @@ -3212,23 +3208,23 @@ func TestPhp7(t *testing.T) { &stmt.AltIf{ Position: &position.Position{ StartLine: 58, - EndLine: 60, - StartPos: 1249, - EndPos: 1274, + EndLine: 60, + StartPos: 1249, + EndPos: 1274, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 58, - EndLine: 58, - StartPos: 1253, - EndPos: 1254, + EndLine: 58, + StartPos: 1253, + EndPos: 1254, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 58, - EndLine: 58, - StartPos: 1253, - EndPos: 1254, + EndLine: 58, + StartPos: 1253, + EndPos: 1254, }, Value: "a", }, @@ -3236,50 +3232,52 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, Else: &stmt.AltElse{ Position: &position.Position{ StartLine: 59, - EndLine: -1, - StartPos: 1261, - EndPos: -1, + EndLine: -1, + StartPos: 1261, + EndPos: -1, }, Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, }, }, &stmt.AltIf{ Position: &position.Position{ StartLine: 61, - EndLine: 65, - StartPos: 1278, - EndPos: 1333, + EndLine: 65, + StartPos: 1278, + EndPos: 1333, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 61, - EndLine: 61, - StartPos: 1282, - EndPos: 1283, + EndLine: 61, + StartPos: 1282, + EndPos: 1283, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 61, - EndLine: 61, - StartPos: 1282, - EndPos: 1283, + EndLine: 61, + StartPos: 1282, + EndPos: 1283, }, Value: "a", }, @@ -3287,33 +3285,34 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, ElseIf: []node.Node{ &stmt.AltElseIf{ Position: &position.Position{ StartLine: 62, - EndLine: -1, - StartPos: 1290, - EndPos: -1, + EndLine: -1, + StartPos: 1290, + EndPos: -1, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 62, - EndLine: 62, - StartPos: 1298, - EndPos: 1299, + EndLine: 62, + StartPos: 1298, + EndPos: 1299, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 62, - EndLine: 62, - StartPos: 1298, - EndPos: 1299, + EndLine: 62, + StartPos: 1298, + EndPos: 1299, }, Value: "b", }, @@ -3321,33 +3320,34 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, }, &stmt.AltElseIf{ Position: &position.Position{ StartLine: 63, - EndLine: -1, - StartPos: 1305, - EndPos: -1, + EndLine: -1, + StartPos: 1305, + EndPos: -1, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 63, - EndLine: 63, - StartPos: 1313, - EndPos: 1314, + EndLine: 63, + StartPos: 1313, + EndPos: 1314, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 63, - EndLine: 63, - StartPos: 1313, - EndPos: 1314, + EndLine: 63, + StartPos: 1313, + EndPos: 1314, }, Value: "c", }, @@ -3355,62 +3355,64 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, }, }, Else: &stmt.AltElse{ Position: &position.Position{ StartLine: 64, - EndLine: -1, - StartPos: 1320, - EndPos: -1, + EndLine: -1, + StartPos: 1320, + EndPos: -1, }, Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, }, }, &stmt.While{ Position: &position.Position{ StartLine: 67, - EndLine: 67, - StartPos: 1338, - EndPos: 1357, + EndLine: 67, + StartPos: 1338, + EndPos: 1357, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 67, - EndLine: 67, - StartPos: 1345, - EndPos: 1345, + EndLine: 67, + StartPos: 1345, + EndPos: 1345, }, Value: "1", }, Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 67, - EndLine: 67, - StartPos: 1348, - EndPos: 1357, + EndLine: 67, + StartPos: 1348, + EndPos: 1357, }, Stmts: []node.Node{ &stmt.Break{ Position: &position.Position{ StartLine: 67, - EndLine: 67, - StartPos: 1350, - EndPos: 1355, + EndLine: 67, + StartPos: 1350, + EndPos: 1355, }, }, }, @@ -3419,40 +3421,40 @@ func TestPhp7(t *testing.T) { &stmt.While{ Position: &position.Position{ StartLine: 68, - EndLine: 68, - StartPos: 1361, - EndPos: 1382, + EndLine: 68, + StartPos: 1361, + EndPos: 1382, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 68, - EndLine: 68, - StartPos: 1368, - EndPos: 1368, + EndLine: 68, + StartPos: 1368, + EndPos: 1368, }, Value: "1", }, Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 68, - EndLine: 68, - StartPos: 1371, - EndPos: 1382, + EndLine: 68, + StartPos: 1371, + EndPos: 1382, }, Stmts: []node.Node{ &stmt.Break{ Position: &position.Position{ StartLine: 68, - EndLine: 68, - StartPos: 1373, - EndPos: 1380, + EndLine: 68, + StartPos: 1373, + EndPos: 1380, }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 68, - EndLine: 68, - StartPos: 1379, - EndPos: 1379, + EndLine: 68, + StartPos: 1379, + EndPos: 1379, }, Value: "2", }, @@ -3463,40 +3465,40 @@ func TestPhp7(t *testing.T) { &stmt.AltWhile{ Position: &position.Position{ StartLine: 69, - EndLine: 69, - StartPos: 1386, - EndPos: 1416, + EndLine: 69, + StartPos: 1386, + EndPos: 1416, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 69, - EndLine: 69, - StartPos: 1393, - EndPos: 1393, + EndLine: 69, + StartPos: 1393, + EndPos: 1393, }, Value: "1", }, Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 69, - EndLine: 69, - StartPos: 1398, - EndPos: 1406, + EndLine: 69, + StartPos: 1398, + EndPos: 1406, }, Stmts: []node.Node{ &stmt.Break{ Position: &position.Position{ StartLine: 69, - EndLine: 69, - StartPos: 1398, - EndPos: 1406, + EndLine: 69, + StartPos: 1398, + EndPos: 1406, }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 69, - EndLine: 69, - StartPos: 1404, - EndPos: 1404, + EndLine: 69, + StartPos: 1404, + EndPos: 1404, }, Value: "3", }, @@ -3507,17 +3509,17 @@ func TestPhp7(t *testing.T) { &stmt.Class{ Position: &position.Position{ StartLine: 70, - EndLine: 70, - StartPos: 1420, - EndPos: 1462, + EndLine: 70, + StartPos: 1420, + EndPos: 1462, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 70, - EndLine: 70, - StartPos: 1426, - EndPos: 1428, + EndLine: 70, + StartPos: 1426, + EndPos: 1428, }, Value: "foo", }, @@ -3525,17 +3527,17 @@ func TestPhp7(t *testing.T) { &stmt.ClassConstList{ Position: &position.Position{ StartLine: 70, - EndLine: 70, - StartPos: 1431, - EndPos: 1460, + EndLine: 70, + StartPos: 1431, + EndPos: 1460, }, Modifiers: []node.Node{ &node.Identifier{ Position: &position.Position{ StartLine: 70, - EndLine: 70, - StartPos: 1431, - EndPos: 1436, + EndLine: 70, + StartPos: 1431, + EndPos: 1436, }, Value: "public", }, @@ -3544,26 +3546,26 @@ func TestPhp7(t *testing.T) { &stmt.Constant{ Position: &position.Position{ StartLine: 70, - EndLine: 70, - StartPos: 1444, - EndPos: 1450, + EndLine: 70, + StartPos: 1444, + EndPos: 1450, }, PhpDocComment: "", ConstantName: &node.Identifier{ Position: &position.Position{ StartLine: 70, - EndLine: 70, - StartPos: 1444, - EndPos: 1446, + EndLine: 70, + StartPos: 1444, + EndPos: 1446, }, Value: "FOO", }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 70, - EndLine: 70, - StartPos: 1450, - EndPos: 1450, + EndLine: 70, + StartPos: 1450, + EndPos: 1450, }, Value: "1", }, @@ -3571,26 +3573,26 @@ func TestPhp7(t *testing.T) { &stmt.Constant{ Position: &position.Position{ StartLine: 70, - EndLine: 70, - StartPos: 1453, - EndPos: 1459, + EndLine: 70, + StartPos: 1453, + EndPos: 1459, }, PhpDocComment: "", ConstantName: &node.Identifier{ Position: &position.Position{ StartLine: 70, - EndLine: 70, - StartPos: 1453, - EndPos: 1455, + EndLine: 70, + StartPos: 1453, + EndPos: 1455, }, Value: "BAR", }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 70, - EndLine: 70, - StartPos: 1459, - EndPos: 1459, + EndLine: 70, + StartPos: 1459, + EndPos: 1459, }, Value: "2", }, @@ -3602,17 +3604,17 @@ func TestPhp7(t *testing.T) { &stmt.Class{ Position: &position.Position{ StartLine: 71, - EndLine: 71, - StartPos: 1466, - EndPos: 1501, + EndLine: 71, + StartPos: 1466, + EndPos: 1501, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 71, - EndLine: 71, - StartPos: 1472, - EndPos: 1474, + EndLine: 71, + StartPos: 1472, + EndPos: 1474, }, Value: "foo", }, @@ -3620,34 +3622,34 @@ func TestPhp7(t *testing.T) { &stmt.ClassConstList{ Position: &position.Position{ StartLine: 71, - EndLine: 71, - StartPos: 1477, - EndPos: 1499, + EndLine: 71, + StartPos: 1477, + EndPos: 1499, }, Consts: []node.Node{ &stmt.Constant{ Position: &position.Position{ StartLine: 71, - EndLine: 71, - StartPos: 1483, - EndPos: 1489, + EndLine: 71, + StartPos: 1483, + EndPos: 1489, }, PhpDocComment: "", ConstantName: &node.Identifier{ Position: &position.Position{ StartLine: 71, - EndLine: 71, - StartPos: 1483, - EndPos: 1485, + EndLine: 71, + StartPos: 1483, + EndPos: 1485, }, Value: "FOO", }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 71, - EndLine: 71, - StartPos: 1489, - EndPos: 1489, + EndLine: 71, + StartPos: 1489, + EndPos: 1489, }, Value: "1", }, @@ -3655,26 +3657,26 @@ func TestPhp7(t *testing.T) { &stmt.Constant{ Position: &position.Position{ StartLine: 71, - EndLine: 71, - StartPos: 1492, - EndPos: 1498, + EndLine: 71, + StartPos: 1492, + EndPos: 1498, }, PhpDocComment: "", ConstantName: &node.Identifier{ Position: &position.Position{ StartLine: 71, - EndLine: 71, - StartPos: 1492, - EndPos: 1494, + EndLine: 71, + StartPos: 1492, + EndPos: 1494, }, Value: "BAR", }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 71, - EndLine: 71, - StartPos: 1498, - EndPos: 1498, + EndLine: 71, + StartPos: 1498, + EndPos: 1498, }, Value: "2", }, @@ -3686,17 +3688,17 @@ func TestPhp7(t *testing.T) { &stmt.Class{ Position: &position.Position{ StartLine: 72, - EndLine: 72, - StartPos: 1505, - EndPos: 1534, + EndLine: 72, + StartPos: 1505, + EndPos: 1534, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 72, - EndLine: 72, - StartPos: 1511, - EndPos: 1513, + EndLine: 72, + StartPos: 1511, + EndPos: 1513, }, Value: "foo", }, @@ -3704,29 +3706,30 @@ func TestPhp7(t *testing.T) { &stmt.ClassMethod{ Position: &position.Position{ StartLine: 72, - EndLine: 72, - StartPos: 1516, - EndPos: 1532, + EndLine: 72, + StartPos: 1516, + EndPos: 1532, }, - ReturnsRef: false, + ReturnsRef: false, PhpDocComment: "", MethodName: &node.Identifier{ Position: &position.Position{ StartLine: 72, - EndLine: 72, - StartPos: 1525, - EndPos: 1527, + EndLine: 72, + StartPos: 1525, + EndPos: 1527, }, Value: "bar", }, Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 72, - EndLine: 72, - StartPos: 1531, - EndPos: 1532, + EndLine: 72, + StartPos: 1531, + EndPos: 1532, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, }, }, @@ -3734,17 +3737,17 @@ func TestPhp7(t *testing.T) { &stmt.Class{ Position: &position.Position{ StartLine: 73, - EndLine: 73, - StartPos: 1538, - EndPos: 1582, + EndLine: 73, + StartPos: 1538, + EndPos: 1582, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 73, - EndLine: 73, - StartPos: 1544, - EndPos: 1546, + EndLine: 73, + StartPos: 1544, + EndPos: 1546, }, Value: "foo", }, @@ -3752,18 +3755,18 @@ func TestPhp7(t *testing.T) { &stmt.ClassMethod{ Position: &position.Position{ StartLine: 73, - EndLine: 73, - StartPos: 1549, - EndPos: 1580, + EndLine: 73, + StartPos: 1549, + EndPos: 1580, }, PhpDocComment: "", - ReturnsRef: true, + ReturnsRef: true, MethodName: &node.Identifier{ Position: &position.Position{ StartLine: 73, - EndLine: 73, - StartPos: 1573, - EndPos: 1575, + EndLine: 73, + StartPos: 1573, + EndPos: 1575, }, Value: "bar", }, @@ -3771,18 +3774,18 @@ func TestPhp7(t *testing.T) { &node.Identifier{ Position: &position.Position{ StartLine: 73, - EndLine: 73, - StartPos: 1549, - EndPos: 1554, + EndLine: 73, + StartPos: 1549, + EndPos: 1554, }, Value: "public", }, &node.Identifier{ Position: &position.Position{ StartLine: 73, - EndLine: 73, - StartPos: 1556, - EndPos: 1561, + EndLine: 73, + StartPos: 1556, + EndPos: 1561, }, Value: "static", }, @@ -3790,11 +3793,12 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 73, - EndLine: 73, - StartPos: 1579, - EndPos: 1580, + EndLine: 73, + StartPos: 1579, + EndPos: 1580, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, }, }, @@ -3802,17 +3806,17 @@ func TestPhp7(t *testing.T) { &stmt.Class{ Position: &position.Position{ StartLine: 74, - EndLine: 74, - StartPos: 1586, - EndPos: 1636, + EndLine: 74, + StartPos: 1586, + EndPos: 1636, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 74, - EndLine: 74, - StartPos: 1592, - EndPos: 1594, + EndLine: 74, + StartPos: 1592, + EndPos: 1594, }, Value: "foo", }, @@ -3820,18 +3824,18 @@ func TestPhp7(t *testing.T) { &stmt.ClassMethod{ Position: &position.Position{ StartLine: 74, - EndLine: 74, - StartPos: 1597, - EndPos: 1634, + EndLine: 74, + StartPos: 1597, + EndPos: 1634, }, - ReturnsRef: true, + ReturnsRef: true, PhpDocComment: "", MethodName: &node.Identifier{ Position: &position.Position{ StartLine: 74, - EndLine: 74, - StartPos: 1621, - EndPos: 1623, + EndLine: 74, + StartPos: 1621, + EndPos: 1623, }, Value: "bar", }, @@ -3839,18 +3843,18 @@ func TestPhp7(t *testing.T) { &node.Identifier{ Position: &position.Position{ StartLine: 74, - EndLine: 74, - StartPos: 1597, - EndPos: 1602, + EndLine: 74, + StartPos: 1597, + EndPos: 1602, }, Value: "public", }, &node.Identifier{ Position: &position.Position{ StartLine: 74, - EndLine: 74, - StartPos: 1604, - EndPos: 1609, + EndLine: 74, + StartPos: 1604, + EndPos: 1609, }, Value: "static", }, @@ -3858,17 +3862,17 @@ func TestPhp7(t *testing.T) { ReturnType: &name.Name{ Position: &position.Position{ StartLine: 74, - EndLine: 74, - StartPos: 1628, - EndPos: 1631, + EndLine: 74, + StartPos: 1628, + EndPos: 1631, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 74, - EndLine: 74, - StartPos: 1628, - EndPos: 1631, + EndLine: 74, + StartPos: 1628, + EndPos: 1631, }, Value: "void", }, @@ -3877,11 +3881,12 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 74, - EndLine: 74, - StartPos: 1633, - EndPos: 1634, + EndLine: 74, + StartPos: 1633, + EndPos: 1634, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, }, }, @@ -3889,17 +3894,17 @@ func TestPhp7(t *testing.T) { &stmt.Class{ Position: &position.Position{ StartLine: 75, - EndLine: 75, - StartPos: 1640, - EndPos: 1660, + EndLine: 75, + StartPos: 1640, + EndPos: 1660, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 75, - EndLine: 75, - StartPos: 1655, - EndPos: 1657, + EndLine: 75, + StartPos: 1655, + EndPos: 1657, }, Value: "foo", }, @@ -3907,29 +3912,30 @@ func TestPhp7(t *testing.T) { &node.Identifier{ Position: &position.Position{ StartLine: 75, - EndLine: 75, - StartPos: 1640, - EndPos: 1647, + EndLine: 75, + StartPos: 1640, + EndPos: 1647, }, Value: "abstract", }, }, - Stmts: []node.Node{}, + Stmts: []node.Node{ + }, }, &stmt.Class{ Position: &position.Position{ StartLine: 76, - EndLine: 76, - StartPos: 1664, - EndPos: 1694, + EndLine: 76, + StartPos: 1664, + EndPos: 1694, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 76, - EndLine: 76, - StartPos: 1676, - EndPos: 1678, + EndLine: 76, + StartPos: 1676, + EndPos: 1678, }, Value: "foo", }, @@ -3937,9 +3943,9 @@ func TestPhp7(t *testing.T) { &node.Identifier{ Position: &position.Position{ StartLine: 76, - EndLine: 76, - StartPos: 1664, - EndPos: 1668, + EndLine: 76, + StartPos: 1664, + EndPos: 1668, }, Value: "final", }, @@ -3947,46 +3953,47 @@ func TestPhp7(t *testing.T) { Extends: &stmt.ClassExtends{ Position: &position.Position{ StartLine: 76, - EndLine: 76, - StartPos: 1680, - EndPos: 1690, + EndLine: 76, + StartPos: 1680, + EndPos: 1690, }, ClassName: &name.Name{ Position: &position.Position{ StartLine: 76, - EndLine: 76, - StartPos: 1688, - EndPos: 1690, + EndLine: 76, + StartPos: 1688, + EndPos: 1690, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 76, - EndLine: 76, - StartPos: 1688, - EndPos: 1690, + EndLine: 76, + StartPos: 1688, + EndPos: 1690, }, Value: "bar", }, }, }, }, - Stmts: []node.Node{}, + Stmts: []node.Node{ + }, }, &stmt.Class{ Position: &position.Position{ StartLine: 77, - EndLine: 77, - StartPos: 1698, - EndPos: 1731, + EndLine: 77, + StartPos: 1698, + EndPos: 1731, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 77, - EndLine: 77, - StartPos: 1710, - EndPos: 1712, + EndLine: 77, + StartPos: 1710, + EndPos: 1712, }, Value: "foo", }, @@ -3994,9 +4001,9 @@ func TestPhp7(t *testing.T) { &node.Identifier{ Position: &position.Position{ StartLine: 77, - EndLine: 77, - StartPos: 1698, - EndPos: 1702, + EndLine: 77, + StartPos: 1698, + EndPos: 1702, }, Value: "final", }, @@ -4004,25 +4011,25 @@ func TestPhp7(t *testing.T) { Implements: &stmt.ClassImplements{ Position: &position.Position{ StartLine: 77, - EndLine: 77, - StartPos: 1714, - EndPos: 1727, + EndLine: 77, + StartPos: 1714, + EndPos: 1727, }, InterfaceNames: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 77, - EndLine: 77, - StartPos: 1725, - EndPos: 1727, + EndLine: 77, + StartPos: 1725, + EndPos: 1727, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 77, - EndLine: 77, - StartPos: 1725, - EndPos: 1727, + EndLine: 77, + StartPos: 1725, + EndPos: 1727, }, Value: "bar", }, @@ -4030,22 +4037,23 @@ func TestPhp7(t *testing.T) { }, }, }, - Stmts: []node.Node{}, + Stmts: []node.Node{ + }, }, &stmt.Class{ Position: &position.Position{ StartLine: 78, - EndLine: 78, - StartPos: 1735, - EndPos: 1773, + EndLine: 78, + StartPos: 1735, + EndPos: 1773, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 78, - EndLine: 78, - StartPos: 1747, - EndPos: 1749, + EndLine: 78, + StartPos: 1747, + EndPos: 1749, }, Value: "foo", }, @@ -4053,9 +4061,9 @@ func TestPhp7(t *testing.T) { &node.Identifier{ Position: &position.Position{ StartLine: 78, - EndLine: 78, - StartPos: 1735, - EndPos: 1739, + EndLine: 78, + StartPos: 1735, + EndPos: 1739, }, Value: "final", }, @@ -4063,25 +4071,25 @@ func TestPhp7(t *testing.T) { Implements: &stmt.ClassImplements{ Position: &position.Position{ StartLine: 78, - EndLine: 78, - StartPos: 1751, - EndPos: 1769, + EndLine: 78, + StartPos: 1751, + EndPos: 1769, }, InterfaceNames: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 78, - EndLine: 78, - StartPos: 1762, - EndPos: 1764, + EndLine: 78, + StartPos: 1762, + EndPos: 1764, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 78, - EndLine: 78, - StartPos: 1762, - EndPos: 1764, + EndLine: 78, + StartPos: 1762, + EndPos: 1764, }, Value: "bar", }, @@ -4090,17 +4098,17 @@ func TestPhp7(t *testing.T) { &name.Name{ Position: &position.Position{ StartLine: 78, - EndLine: 78, - StartPos: 1767, - EndPos: 1769, + EndLine: 78, + StartPos: 1767, + EndPos: 1769, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 78, - EndLine: 78, - StartPos: 1767, - EndPos: 1769, + EndLine: 78, + StartPos: 1767, + EndPos: 1769, }, Value: "baz", }, @@ -4108,59 +4116,60 @@ func TestPhp7(t *testing.T) { }, }, }, - Stmts: []node.Node{}, + Stmts: []node.Node{ + }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 79, - EndLine: 79, - StartPos: 1777, - EndPos: 1824, + EndLine: 79, + StartPos: 1777, + EndPos: 1824, }, Expr: &expr.New{ Position: &position.Position{ StartLine: 79, - EndLine: 79, - StartPos: 1777, - EndPos: 1823, + EndLine: 79, + StartPos: 1777, + EndPos: 1823, }, Class: &stmt.Class{ Position: &position.Position{ StartLine: 79, - EndLine: 79, - StartPos: 1781, - EndPos: 1823, + EndLine: 79, + StartPos: 1781, + EndPos: 1823, }, PhpDocComment: "", ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 79, - EndLine: 79, - StartPos: 1786, - EndPos: 1787, + EndLine: 79, + StartPos: 1786, + EndPos: 1787, }, }, Extends: &stmt.ClassExtends{ Position: &position.Position{ StartLine: 79, - EndLine: 79, - StartPos: 1789, - EndPos: 1799, + EndLine: 79, + StartPos: 1789, + EndPos: 1799, }, ClassName: &name.Name{ Position: &position.Position{ StartLine: 79, - EndLine: 79, - StartPos: 1797, - EndPos: 1799, + EndLine: 79, + StartPos: 1797, + EndPos: 1799, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 79, - EndLine: 79, - StartPos: 1797, - EndPos: 1799, + EndLine: 79, + StartPos: 1797, + EndPos: 1799, }, Value: "foo", }, @@ -4170,25 +4179,25 @@ func TestPhp7(t *testing.T) { Implements: &stmt.ClassImplements{ Position: &position.Position{ StartLine: 79, - EndLine: 79, - StartPos: 1801, - EndPos: 1819, + EndLine: 79, + StartPos: 1801, + EndPos: 1819, }, InterfaceNames: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 79, - EndLine: 79, - StartPos: 1812, - EndPos: 1814, + EndLine: 79, + StartPos: 1812, + EndPos: 1814, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 79, - EndLine: 79, - StartPos: 1812, - EndPos: 1814, + EndLine: 79, + StartPos: 1812, + EndPos: 1814, }, Value: "bar", }, @@ -4197,17 +4206,17 @@ func TestPhp7(t *testing.T) { &name.Name{ Position: &position.Position{ StartLine: 79, - EndLine: 79, - StartPos: 1817, - EndPos: 1819, + EndLine: 79, + StartPos: 1817, + EndPos: 1819, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 79, - EndLine: 79, - StartPos: 1817, - EndPos: 1819, + EndLine: 79, + StartPos: 1817, + EndPos: 1819, }, Value: "baz", }, @@ -4215,41 +4224,42 @@ func TestPhp7(t *testing.T) { }, }, }, - Stmts: []node.Node{}, + Stmts: []node.Node{ + }, }, }, }, &stmt.ConstList{ Position: &position.Position{ StartLine: 81, - EndLine: 81, - StartPos: 1829, - EndPos: 1851, + EndLine: 81, + StartPos: 1829, + EndPos: 1851, }, Consts: []node.Node{ &stmt.Constant{ Position: &position.Position{ StartLine: 81, - EndLine: 81, - StartPos: 1835, - EndPos: 1841, + EndLine: 81, + StartPos: 1835, + EndPos: 1841, }, PhpDocComment: "", ConstantName: &node.Identifier{ Position: &position.Position{ StartLine: 81, - EndLine: 81, - StartPos: 1835, - EndPos: 1837, + EndLine: 81, + StartPos: 1835, + EndPos: 1837, }, Value: "FOO", }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 81, - EndLine: 81, - StartPos: 1841, - EndPos: 1841, + EndLine: 81, + StartPos: 1841, + EndPos: 1841, }, Value: "1", }, @@ -4257,26 +4267,26 @@ func TestPhp7(t *testing.T) { &stmt.Constant{ Position: &position.Position{ StartLine: 81, - EndLine: 81, - StartPos: 1844, - EndPos: 1850, + EndLine: 81, + StartPos: 1844, + EndPos: 1850, }, PhpDocComment: "", ConstantName: &node.Identifier{ Position: &position.Position{ StartLine: 81, - EndLine: 81, - StartPos: 1844, - EndPos: 1846, + EndLine: 81, + StartPos: 1844, + EndPos: 1846, }, Value: "BAR", }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 81, - EndLine: 81, - StartPos: 1850, - EndPos: 1850, + EndLine: 81, + StartPos: 1850, + EndPos: 1850, }, Value: "2", }, @@ -4286,33 +4296,33 @@ func TestPhp7(t *testing.T) { &stmt.While{ Position: &position.Position{ StartLine: 82, - EndLine: 82, - StartPos: 1855, - EndPos: 1877, + EndLine: 82, + StartPos: 1855, + EndPos: 1877, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 82, - EndLine: 82, - StartPos: 1862, - EndPos: 1862, + EndLine: 82, + StartPos: 1862, + EndPos: 1862, }, Value: "1", }, Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 82, - EndLine: 82, - StartPos: 1865, - EndPos: 1877, + EndLine: 82, + StartPos: 1865, + EndPos: 1877, }, Stmts: []node.Node{ &stmt.Continue{ Position: &position.Position{ StartLine: 82, - EndLine: 82, - StartPos: 1867, - EndPos: 1875, + EndLine: 82, + StartPos: 1867, + EndPos: 1875, }, }, }, @@ -4321,40 +4331,40 @@ func TestPhp7(t *testing.T) { &stmt.While{ Position: &position.Position{ StartLine: 83, - EndLine: 83, - StartPos: 1881, - EndPos: 1905, + EndLine: 83, + StartPos: 1881, + EndPos: 1905, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 83, - EndLine: 83, - StartPos: 1888, - EndPos: 1888, + EndLine: 83, + StartPos: 1888, + EndPos: 1888, }, Value: "1", }, Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 83, - EndLine: 83, - StartPos: 1891, - EndPos: 1905, + EndLine: 83, + StartPos: 1891, + EndPos: 1905, }, Stmts: []node.Node{ &stmt.Continue{ Position: &position.Position{ StartLine: 83, - EndLine: 83, - StartPos: 1893, - EndPos: 1903, + EndLine: 83, + StartPos: 1893, + EndPos: 1903, }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 83, - EndLine: 83, - StartPos: 1902, - EndPos: 1902, + EndLine: 83, + StartPos: 1902, + EndPos: 1902, }, Value: "2", }, @@ -4365,40 +4375,40 @@ func TestPhp7(t *testing.T) { &stmt.While{ Position: &position.Position{ StartLine: 84, - EndLine: 84, - StartPos: 1909, - EndPos: 1934, + EndLine: 84, + StartPos: 1909, + EndPos: 1934, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 84, - EndLine: 84, - StartPos: 1916, - EndPos: 1916, + EndLine: 84, + StartPos: 1916, + EndPos: 1916, }, Value: "1", }, Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 84, - EndLine: 84, - StartPos: 1919, - EndPos: 1934, + EndLine: 84, + StartPos: 1919, + EndPos: 1934, }, Stmts: []node.Node{ &stmt.Continue{ Position: &position.Position{ StartLine: 84, - EndLine: 84, - StartPos: 1921, - EndPos: 1932, + EndLine: 84, + StartPos: 1921, + EndPos: 1932, }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 84, - EndLine: 84, - StartPos: 1930, - EndPos: 1930, + EndLine: 84, + StartPos: 1930, + EndPos: 1930, }, Value: "3", }, @@ -4409,34 +4419,34 @@ func TestPhp7(t *testing.T) { &stmt.Declare{ Position: &position.Position{ StartLine: 85, - EndLine: 85, - StartPos: 1938, - EndPos: 1954, + EndLine: 85, + StartPos: 1938, + EndPos: 1954, }, Consts: []node.Node{ &stmt.Constant{ Position: &position.Position{ StartLine: 85, - EndLine: 85, - StartPos: 1946, - EndPos: 1952, + EndLine: 85, + StartPos: 1946, + EndPos: 1952, }, PhpDocComment: "", ConstantName: &node.Identifier{ Position: &position.Position{ StartLine: 85, - EndLine: 85, - StartPos: 1946, - EndPos: 1950, + EndLine: 85, + StartPos: 1946, + EndPos: 1950, }, Value: "ticks", }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 85, - EndLine: 85, - StartPos: 1952, - EndPos: 1952, + EndLine: 85, + StartPos: 1952, + EndPos: 1952, }, Value: "1", }, @@ -4445,43 +4455,43 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.Nop{ Position: &position.Position{ StartLine: 85, - EndLine: 85, - StartPos: 1954, - EndPos: 1954, + EndLine: 85, + StartPos: 1954, + EndPos: 1954, }, }, }, &stmt.Declare{ Position: &position.Position{ StartLine: 86, - EndLine: 86, - StartPos: 1958, - EndPos: 1976, + EndLine: 86, + StartPos: 1958, + EndPos: 1976, }, Consts: []node.Node{ &stmt.Constant{ Position: &position.Position{ StartLine: 86, - EndLine: 86, - StartPos: 1966, - EndPos: 1972, + EndLine: 86, + StartPos: 1966, + EndPos: 1972, }, PhpDocComment: "", ConstantName: &node.Identifier{ Position: &position.Position{ StartLine: 86, - EndLine: 86, - StartPos: 1966, - EndPos: 1970, + EndLine: 86, + StartPos: 1966, + EndPos: 1970, }, Value: "ticks", }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 86, - EndLine: 86, - StartPos: 1972, - EndPos: 1972, + EndLine: 86, + StartPos: 1972, + EndPos: 1972, }, Value: "1", }, @@ -4490,44 +4500,45 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 86, - EndLine: 86, - StartPos: 1975, - EndPos: 1976, + EndLine: 86, + StartPos: 1975, + EndPos: 1976, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, }, &stmt.Declare{ Position: &position.Position{ StartLine: 87, - EndLine: 87, - StartPos: 1980, - EndPos: 2008, + EndLine: 87, + StartPos: 1980, + EndPos: 2008, }, Consts: []node.Node{ &stmt.Constant{ Position: &position.Position{ StartLine: 87, - EndLine: 87, - StartPos: 1988, - EndPos: 1994, + EndLine: 87, + StartPos: 1988, + EndPos: 1994, }, PhpDocComment: "", ConstantName: &node.Identifier{ Position: &position.Position{ StartLine: 87, - EndLine: 87, - StartPos: 1988, - EndPos: 1992, + EndLine: 87, + StartPos: 1988, + EndPos: 1992, }, Value: "ticks", }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 87, - EndLine: 87, - StartPos: 1994, - EndPos: 1994, + EndLine: 87, + StartPos: 1994, + EndPos: 1994, }, Value: "1", }, @@ -4536,35 +4547,37 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 87, - EndLine: 87, - StartPos: 1996, - EndPos: 2008, + EndLine: 87, + StartPos: 1996, + EndPos: 2008, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, }, &stmt.Do{ Position: &position.Position{ StartLine: 88, - EndLine: 88, - StartPos: 2012, - EndPos: 2026, + EndLine: 88, + StartPos: 2012, + EndPos: 2026, }, Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 88, - EndLine: 88, - StartPos: 2015, - EndPos: 2016, + EndLine: 88, + StartPos: 2015, + EndPos: 2016, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 88, - EndLine: 88, - StartPos: 2024, - EndPos: 2024, + EndLine: 88, + StartPos: 2024, + EndPos: 2024, }, Value: "1", }, @@ -4572,24 +4585,24 @@ func TestPhp7(t *testing.T) { &stmt.Echo{ Position: &position.Position{ StartLine: 89, - EndLine: 89, - StartPos: 2030, - EndPos: 2040, + EndLine: 89, + StartPos: 2030, + EndPos: 2040, }, Exprs: []node.Node{ &expr.Variable{ Position: &position.Position{ StartLine: 89, - EndLine: 89, - StartPos: 2035, - EndPos: 2036, + EndLine: 89, + StartPos: 2035, + EndPos: 2036, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 89, - EndLine: 89, - StartPos: 2035, - EndPos: 2036, + EndLine: 89, + StartPos: 2035, + EndPos: 2036, }, Value: "a", }, @@ -4597,9 +4610,9 @@ func TestPhp7(t *testing.T) { &scalar.Lnumber{ Position: &position.Position{ StartLine: 89, - EndLine: 89, - StartPos: 2039, - EndPos: 2039, + EndLine: 89, + StartPos: 2039, + EndPos: 2039, }, Value: "1", }, @@ -4608,24 +4621,24 @@ func TestPhp7(t *testing.T) { &stmt.Echo{ Position: &position.Position{ StartLine: 90, - EndLine: 90, - StartPos: 2044, - EndPos: 2052, + EndLine: 90, + StartPos: 2044, + EndPos: 2052, }, Exprs: []node.Node{ &expr.Variable{ Position: &position.Position{ StartLine: 90, - EndLine: 90, - StartPos: 2049, - EndPos: 2050, + EndLine: 90, + StartPos: 2049, + EndPos: 2050, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 90, - EndLine: 90, - StartPos: 2049, - EndPos: 2050, + EndLine: 90, + StartPos: 2049, + EndPos: 2050, }, Value: "a", }, @@ -4635,31 +4648,31 @@ func TestPhp7(t *testing.T) { &stmt.For{ Position: &position.Position{ StartLine: 91, - EndLine: 91, - StartPos: 2056, - EndPos: 2090, + EndLine: 91, + StartPos: 2056, + EndPos: 2090, }, Init: []node.Node{ &assign.Assign{ Position: &position.Position{ StartLine: 91, - EndLine: 91, - StartPos: 2060, - EndPos: 2065, + EndLine: 91, + StartPos: 2060, + EndPos: 2065, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 91, - EndLine: 91, - StartPos: 2060, - EndPos: 2061, + EndLine: 91, + StartPos: 2060, + EndPos: 2061, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 91, - EndLine: 91, - StartPos: 2060, - EndPos: 2061, + EndLine: 91, + StartPos: 2060, + EndPos: 2061, }, Value: "i", }, @@ -4667,9 +4680,9 @@ func TestPhp7(t *testing.T) { Expression: &scalar.Lnumber{ Position: &position.Position{ StartLine: 91, - EndLine: 91, - StartPos: 2065, - EndPos: 2065, + EndLine: 91, + StartPos: 2065, + EndPos: 2065, }, Value: "0", }, @@ -4679,23 +4692,23 @@ func TestPhp7(t *testing.T) { &binary.Smaller{ Position: &position.Position{ StartLine: 91, - EndLine: 91, - StartPos: 2068, - EndPos: 2074, + EndLine: 91, + StartPos: 2068, + EndPos: 2074, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 91, - EndLine: 91, - StartPos: 2068, - EndPos: 2069, + EndLine: 91, + StartPos: 2068, + EndPos: 2069, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 91, - EndLine: 91, - StartPos: 2068, - EndPos: 2069, + EndLine: 91, + StartPos: 2068, + EndPos: 2069, }, Value: "i", }, @@ -4703,9 +4716,9 @@ func TestPhp7(t *testing.T) { Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 91, - EndLine: 91, - StartPos: 2073, - EndPos: 2074, + EndLine: 91, + StartPos: 2073, + EndPos: 2074, }, Value: "10", }, @@ -4715,23 +4728,23 @@ func TestPhp7(t *testing.T) { &expr.PostInc{ Position: &position.Position{ StartLine: 91, - EndLine: 91, - StartPos: 2077, - EndPos: 2080, + EndLine: 91, + StartPos: 2077, + EndPos: 2080, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 91, - EndLine: 91, - StartPos: 2077, - EndPos: 2078, + EndLine: 91, + StartPos: 2077, + EndPos: 2078, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 91, - EndLine: 91, - StartPos: 2077, - EndPos: 2078, + EndLine: 91, + StartPos: 2077, + EndPos: 2078, }, Value: "i", }, @@ -4740,23 +4753,23 @@ func TestPhp7(t *testing.T) { &expr.PostInc{ Position: &position.Position{ StartLine: 91, - EndLine: 91, - StartPos: 2083, - EndPos: 2086, + EndLine: 91, + StartPos: 2083, + EndPos: 2086, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 91, - EndLine: 91, - StartPos: 2083, - EndPos: 2084, + EndLine: 91, + StartPos: 2083, + EndPos: 2084, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 91, - EndLine: 91, - StartPos: 2083, - EndPos: 2084, + EndLine: 91, + StartPos: 2083, + EndPos: 2084, }, Value: "i", }, @@ -4766,41 +4779,42 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 91, - EndLine: 91, - StartPos: 2089, - EndPos: 2090, + EndLine: 91, + StartPos: 2089, + EndPos: 2090, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, }, &stmt.AltFor{ Position: &position.Position{ StartLine: 92, - EndLine: 92, - StartPos: 2094, - EndPos: 2129, + EndLine: 92, + StartPos: 2094, + EndPos: 2129, }, Cond: []node.Node{ &binary.Smaller{ Position: &position.Position{ StartLine: 92, - EndLine: 92, - StartPos: 2100, - EndPos: 2106, + EndLine: 92, + StartPos: 2100, + EndPos: 2106, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 92, - EndLine: 92, - StartPos: 2100, - EndPos: 2101, + EndLine: 92, + StartPos: 2100, + EndPos: 2101, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 92, - EndLine: 92, - StartPos: 2100, - EndPos: 2101, + EndLine: 92, + StartPos: 2100, + EndPos: 2101, }, Value: "i", }, @@ -4808,9 +4822,9 @@ func TestPhp7(t *testing.T) { Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 92, - EndLine: 92, - StartPos: 2105, - EndPos: 2106, + EndLine: 92, + StartPos: 2105, + EndPos: 2106, }, Value: "10", }, @@ -4820,23 +4834,23 @@ func TestPhp7(t *testing.T) { &expr.PostInc{ Position: &position.Position{ StartLine: 92, - EndLine: 92, - StartPos: 2109, - EndPos: 2112, + EndLine: 92, + StartPos: 2109, + EndPos: 2112, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 92, - EndLine: 92, - StartPos: 2109, - EndPos: 2110, + EndLine: 92, + StartPos: 2109, + EndPos: 2110, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 92, - EndLine: 92, - StartPos: 2109, - EndPos: 2110, + EndLine: 92, + StartPos: 2109, + EndPos: 2110, }, Value: "i", }, @@ -4845,23 +4859,23 @@ func TestPhp7(t *testing.T) { &expr.PostInc{ Position: &position.Position{ StartLine: 92, - EndLine: 92, - StartPos: 2115, - EndPos: 2118, + EndLine: 92, + StartPos: 2115, + EndPos: 2118, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 92, - EndLine: 92, - StartPos: 2115, - EndPos: 2116, + EndLine: 92, + StartPos: 2115, + EndPos: 2116, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 92, - EndLine: 92, - StartPos: 2115, - EndPos: 2116, + EndLine: 92, + StartPos: 2115, + EndPos: 2116, }, Value: "i", }, @@ -4871,33 +4885,34 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, }, &stmt.Foreach{ Position: &position.Position{ StartLine: 93, - EndLine: 93, - StartPos: 2133, - EndPos: 2153, + EndLine: 93, + StartPos: 2133, + EndPos: 2153, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 93, - EndLine: 93, - StartPos: 2142, - EndPos: 2143, + EndLine: 93, + StartPos: 2142, + EndPos: 2143, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 93, - EndLine: 93, - StartPos: 2142, - EndPos: 2143, + EndLine: 93, + StartPos: 2142, + EndPos: 2143, }, Value: "a", }, @@ -4905,16 +4920,16 @@ func TestPhp7(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 93, - EndLine: 93, - StartPos: 2148, - EndPos: 2149, + EndLine: 93, + StartPos: 2148, + EndPos: 2149, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 93, - EndLine: 93, - StartPos: 2148, - EndPos: 2149, + EndLine: 93, + StartPos: 2148, + EndPos: 2149, }, Value: "v", }, @@ -4922,33 +4937,34 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 93, - EndLine: 93, - StartPos: 2152, - EndPos: 2153, + EndLine: 93, + StartPos: 2152, + EndPos: 2153, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, }, &stmt.AltForeach{ Position: &position.Position{ StartLine: 94, - EndLine: 94, - StartPos: 2157, - EndPos: 2188, + EndLine: 94, + StartPos: 2157, + EndPos: 2188, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 94, - EndLine: 94, - StartPos: 2166, - EndPos: 2167, + EndLine: 94, + StartPos: 2166, + EndPos: 2167, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 94, - EndLine: 94, - StartPos: 2166, - EndPos: 2167, + EndLine: 94, + StartPos: 2166, + EndPos: 2167, }, Value: "a", }, @@ -4956,16 +4972,16 @@ func TestPhp7(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 94, - EndLine: 94, - StartPos: 2172, - EndPos: 2173, + EndLine: 94, + StartPos: 2172, + EndPos: 2173, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 94, - EndLine: 94, - StartPos: 2172, - EndPos: 2173, + EndLine: 94, + StartPos: 2172, + EndPos: 2173, }, Value: "v", }, @@ -4973,33 +4989,34 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, }, &stmt.Foreach{ Position: &position.Position{ StartLine: 95, - EndLine: 95, - StartPos: 2192, - EndPos: 2218, + EndLine: 95, + StartPos: 2192, + EndPos: 2218, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 95, - EndLine: 95, - StartPos: 2201, - EndPos: 2202, + EndLine: 95, + StartPos: 2201, + EndPos: 2202, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 95, - EndLine: 95, - StartPos: 2201, - EndPos: 2202, + EndLine: 95, + StartPos: 2201, + EndPos: 2202, }, Value: "a", }, @@ -5007,16 +5024,16 @@ func TestPhp7(t *testing.T) { Key: &expr.Variable{ Position: &position.Position{ StartLine: 95, - EndLine: 95, - StartPos: 2207, - EndPos: 2208, + EndLine: 95, + StartPos: 2207, + EndPos: 2208, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 95, - EndLine: 95, - StartPos: 2207, - EndPos: 2208, + EndLine: 95, + StartPos: 2207, + EndPos: 2208, }, Value: "k", }, @@ -5024,16 +5041,16 @@ func TestPhp7(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 95, - EndLine: 95, - StartPos: 2213, - EndPos: 2214, + EndLine: 95, + StartPos: 2213, + EndPos: 2214, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 95, - EndLine: 95, - StartPos: 2213, - EndPos: 2214, + EndLine: 95, + StartPos: 2213, + EndPos: 2214, }, Value: "v", }, @@ -5041,33 +5058,34 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 95, - EndLine: 95, - StartPos: 2217, - EndPos: 2218, + EndLine: 95, + StartPos: 2217, + EndPos: 2218, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, }, &stmt.Foreach{ Position: &position.Position{ StartLine: 96, - EndLine: 96, - StartPos: 2222, - EndPos: 2249, + EndLine: 96, + StartPos: 2222, + EndPos: 2249, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 96, - EndLine: 96, - StartPos: 2231, - EndPos: 2232, + EndLine: 96, + StartPos: 2231, + EndPos: 2232, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 96, - EndLine: 96, - StartPos: 2231, - EndPos: 2232, + EndLine: 96, + StartPos: 2231, + EndPos: 2232, }, Value: "a", }, @@ -5075,16 +5093,16 @@ func TestPhp7(t *testing.T) { Key: &expr.Variable{ Position: &position.Position{ StartLine: 96, - EndLine: 96, - StartPos: 2237, - EndPos: 2238, + EndLine: 96, + StartPos: 2237, + EndPos: 2238, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 96, - EndLine: 96, - StartPos: 2237, - EndPos: 2238, + EndLine: 96, + StartPos: 2237, + EndPos: 2238, }, Value: "k", }, @@ -5092,23 +5110,23 @@ func TestPhp7(t *testing.T) { Variable: &expr.Reference{ Position: &position.Position{ StartLine: 96, - EndLine: 96, - StartPos: 2243, - EndPos: 2245, + EndLine: 96, + StartPos: 2243, + EndPos: 2245, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 96, - EndLine: 96, - StartPos: 2244, - EndPos: 2245, + EndLine: 96, + StartPos: 2244, + EndPos: 2245, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 96, - EndLine: 96, - StartPos: 2244, - EndPos: 2245, + EndLine: 96, + StartPos: 2244, + EndPos: 2245, }, Value: "v", }, @@ -5117,33 +5135,34 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 96, - EndLine: 96, - StartPos: 2248, - EndPos: 2249, + EndLine: 96, + StartPos: 2248, + EndPos: 2249, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, }, &stmt.Foreach{ Position: &position.Position{ StartLine: 97, - EndLine: 97, - StartPos: 2253, - EndPos: 2285, + EndLine: 97, + StartPos: 2253, + EndPos: 2285, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 97, - EndLine: 97, - StartPos: 2262, - EndPos: 2263, + EndLine: 97, + StartPos: 2262, + EndPos: 2263, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 97, - EndLine: 97, - StartPos: 2262, - EndPos: 2263, + EndLine: 97, + StartPos: 2262, + EndPos: 2263, }, Value: "a", }, @@ -5151,16 +5170,16 @@ func TestPhp7(t *testing.T) { Key: &expr.Variable{ Position: &position.Position{ StartLine: 97, - EndLine: 97, - StartPos: 2268, - EndPos: 2269, + EndLine: 97, + StartPos: 2268, + EndPos: 2269, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 97, - EndLine: 97, - StartPos: 2268, - EndPos: 2269, + EndLine: 97, + StartPos: 2268, + EndPos: 2269, }, Value: "k", }, @@ -5168,31 +5187,31 @@ func TestPhp7(t *testing.T) { Variable: &expr.List{ Position: &position.Position{ StartLine: 97, - EndLine: 97, - StartPos: 2274, - EndPos: 2281, + EndLine: 97, + StartPos: 2274, + EndPos: 2281, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 97, - EndLine: 97, - StartPos: 2279, - EndPos: 2280, + EndLine: 97, + StartPos: 2279, + EndPos: 2280, }, Val: &expr.Variable{ Position: &position.Position{ StartLine: 97, - EndLine: 97, - StartPos: 2279, - EndPos: 2280, + EndLine: 97, + StartPos: 2279, + EndPos: 2280, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 97, - EndLine: 97, - StartPos: 2279, - EndPos: 2280, + EndLine: 97, + StartPos: 2279, + EndPos: 2280, }, Value: "v", }, @@ -5203,33 +5222,34 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 97, - EndLine: 97, - StartPos: 2284, - EndPos: 2285, + EndLine: 97, + StartPos: 2284, + EndPos: 2285, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, }, &stmt.Foreach{ Position: &position.Position{ StartLine: 98, - EndLine: 98, - StartPos: 2289, - EndPos: 2317, + EndLine: 98, + StartPos: 2289, + EndPos: 2317, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 98, - EndLine: 98, - StartPos: 2298, - EndPos: 2299, + EndLine: 98, + StartPos: 2298, + EndPos: 2299, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 98, - EndLine: 98, - StartPos: 2298, - EndPos: 2299, + EndLine: 98, + StartPos: 2298, + EndPos: 2299, }, Value: "a", }, @@ -5237,16 +5257,16 @@ func TestPhp7(t *testing.T) { Key: &expr.Variable{ Position: &position.Position{ StartLine: 98, - EndLine: 98, - StartPos: 2304, - EndPos: 2305, + EndLine: 98, + StartPos: 2304, + EndPos: 2305, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 98, - EndLine: 98, - StartPos: 2304, - EndPos: 2305, + EndLine: 98, + StartPos: 2304, + EndPos: 2305, }, Value: "k", }, @@ -5254,31 +5274,31 @@ func TestPhp7(t *testing.T) { Variable: &expr.ShortList{ Position: &position.Position{ StartLine: 98, - EndLine: 98, - StartPos: 2310, - EndPos: 2313, + EndLine: 98, + StartPos: 2310, + EndPos: 2313, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 98, - EndLine: 98, - StartPos: 2311, - EndPos: 2312, + EndLine: 98, + StartPos: 2311, + EndPos: 2312, }, Val: &expr.Variable{ Position: &position.Position{ StartLine: 98, - EndLine: 98, - StartPos: 2311, - EndPos: 2312, + EndLine: 98, + StartPos: 2311, + EndPos: 2312, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 98, - EndLine: 98, - StartPos: 2311, - EndPos: 2312, + EndLine: 98, + StartPos: 2311, + EndPos: 2312, }, Value: "v", }, @@ -5289,48 +5309,50 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 98, - EndLine: 98, - StartPos: 2316, - EndPos: 2317, + EndLine: 98, + StartPos: 2316, + EndPos: 2317, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, }, &stmt.Function{ Position: &position.Position{ StartLine: 99, - EndLine: 99, - StartPos: 2321, - EndPos: 2337, + EndLine: 99, + StartPos: 2321, + EndPos: 2337, }, - ReturnsRef: false, + ReturnsRef: false, PhpDocComment: "", FunctionName: &node.Identifier{ Position: &position.Position{ StartLine: 99, - EndLine: 99, - StartPos: 2330, - EndPos: 2332, + EndLine: 99, + StartPos: 2330, + EndPos: 2332, }, Value: "foo", }, - Stmts: []node.Node{}, + Stmts: []node.Node{ + }, }, &stmt.Function{ Position: &position.Position{ StartLine: 100, - EndLine: 100, - StartPos: 2341, - EndPos: 2364, + EndLine: 100, + StartPos: 2341, + EndPos: 2364, }, - ReturnsRef: false, + ReturnsRef: false, PhpDocComment: "", FunctionName: &node.Identifier{ Position: &position.Position{ StartLine: 100, - EndLine: 100, - StartPos: 2350, - EndPos: 2352, + EndLine: 100, + StartPos: 2350, + EndPos: 2352, }, Value: "foo", }, @@ -5338,9 +5360,9 @@ func TestPhp7(t *testing.T) { &stmt.Return{ Position: &position.Position{ StartLine: 100, - EndLine: 100, - StartPos: 2357, - EndPos: 2363, + EndLine: 100, + StartPos: 2357, + EndPos: 2363, }, }, }, @@ -5348,18 +5370,18 @@ func TestPhp7(t *testing.T) { &stmt.Function{ Position: &position.Position{ StartLine: 101, - EndLine: 101, - StartPos: 2368, - EndPos: 2394, + EndLine: 101, + StartPos: 2368, + EndPos: 2394, }, - ReturnsRef: true, + ReturnsRef: true, PhpDocComment: "", FunctionName: &node.Identifier{ Position: &position.Position{ StartLine: 101, - EndLine: 101, - StartPos: 2378, - EndPos: 2380, + EndLine: 101, + StartPos: 2378, + EndPos: 2380, }, Value: "foo", }, @@ -5367,16 +5389,16 @@ func TestPhp7(t *testing.T) { &stmt.Return{ Position: &position.Position{ StartLine: 101, - EndLine: 101, - StartPos: 2385, - EndPos: 2393, + EndLine: 101, + StartPos: 2385, + EndPos: 2393, }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 101, - EndLine: 101, - StartPos: 2392, - EndPos: 2392, + EndLine: 101, + StartPos: 2392, + EndPos: 2392, }, Value: "1", }, @@ -5386,63 +5408,64 @@ func TestPhp7(t *testing.T) { &stmt.Function{ Position: &position.Position{ StartLine: 102, - EndLine: 102, - StartPos: 2398, - EndPos: 2421, + EndLine: 102, + StartPos: 2398, + EndPos: 2421, }, - ReturnsRef: true, + ReturnsRef: true, PhpDocComment: "", FunctionName: &node.Identifier{ Position: &position.Position{ StartLine: 102, - EndLine: 102, - StartPos: 2408, - EndPos: 2410, + EndLine: 102, + StartPos: 2408, + EndPos: 2410, }, Value: "foo", }, ReturnType: &name.Name{ Position: &position.Position{ StartLine: 102, - EndLine: 102, - StartPos: 2415, - EndPos: 2418, + EndLine: 102, + StartPos: 2415, + EndPos: 2418, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 102, - EndLine: 102, - StartPos: 2415, - EndPos: 2418, + EndLine: 102, + StartPos: 2415, + EndPos: 2418, }, Value: "void", }, }, }, - Stmts: []node.Node{}, + Stmts: []node.Node{ + }, }, &stmt.Global{ Position: &position.Position{ StartLine: 103, - EndLine: 103, - StartPos: 2425, - EndPos: 2438, + EndLine: 103, + StartPos: 2425, + EndPos: 2438, }, Vars: []node.Node{ &expr.Variable{ Position: &position.Position{ StartLine: 103, - EndLine: 103, - StartPos: 2432, - EndPos: 2433, + EndLine: 103, + StartPos: 2432, + EndPos: 2433, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 103, - EndLine: 103, - StartPos: 2432, - EndPos: 2433, + EndLine: 103, + StartPos: 2432, + EndPos: 2433, }, Value: "a", }, @@ -5450,16 +5473,16 @@ func TestPhp7(t *testing.T) { &expr.Variable{ Position: &position.Position{ StartLine: 103, - EndLine: 103, - StartPos: 2436, - EndPos: 2437, + EndLine: 103, + StartPos: 2436, + EndPos: 2437, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 103, - EndLine: 103, - StartPos: 2436, - EndPos: 2437, + EndLine: 103, + StartPos: 2436, + EndPos: 2437, }, Value: "b", }, @@ -5469,16 +5492,16 @@ func TestPhp7(t *testing.T) { &stmt.Label{ Position: &position.Position{ StartLine: 104, - EndLine: 104, - StartPos: 2442, - EndPos: 2443, + EndLine: 104, + StartPos: 2442, + EndPos: 2443, }, LabelName: &node.Identifier{ Position: &position.Position{ StartLine: 104, - EndLine: 104, - StartPos: 2442, - EndPos: 2442, + EndLine: 104, + StartPos: 2442, + EndPos: 2442, }, Value: "a", }, @@ -5486,16 +5509,16 @@ func TestPhp7(t *testing.T) { &stmt.Goto{ Position: &position.Position{ StartLine: 105, - EndLine: 105, - StartPos: 2448, - EndPos: 2454, + EndLine: 105, + StartPos: 2448, + EndPos: 2454, }, Label: &node.Identifier{ Position: &position.Position{ StartLine: 105, - EndLine: 105, - StartPos: 2453, - EndPos: 2453, + EndLine: 105, + StartPos: 2453, + EndPos: 2453, }, Value: "a", }, @@ -5503,31 +5526,31 @@ func TestPhp7(t *testing.T) { &stmt.HaltCompiler{ Position: &position.Position{ StartLine: 106, - EndLine: 106, - StartPos: 2458, - EndPos: 2475, + EndLine: 106, + StartPos: 2458, + EndPos: 2475, }, }, &stmt.If{ Position: &position.Position{ StartLine: 107, - EndLine: 107, - StartPos: 2479, - EndPos: 2488, + EndLine: 107, + StartPos: 2479, + EndPos: 2488, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 107, - EndLine: 107, - StartPos: 2483, - EndPos: 2484, + EndLine: 107, + StartPos: 2483, + EndPos: 2484, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 107, - EndLine: 107, - StartPos: 2483, - EndPos: 2484, + EndLine: 107, + StartPos: 2483, + EndPos: 2484, }, Value: "a", }, @@ -5535,33 +5558,34 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 107, - EndLine: 107, - StartPos: 2487, - EndPos: 2488, + EndLine: 107, + StartPos: 2487, + EndPos: 2488, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, }, &stmt.If{ Position: &position.Position{ StartLine: 108, - EndLine: 108, - StartPos: 2492, - EndPos: 2516, + EndLine: 108, + StartPos: 2492, + EndPos: 2516, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 108, - EndLine: 108, - StartPos: 2496, - EndPos: 2497, + EndLine: 108, + StartPos: 2496, + EndPos: 2497, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 108, - EndLine: 108, - StartPos: 2496, - EndPos: 2497, + EndLine: 108, + StartPos: 2496, + EndPos: 2497, }, Value: "a", }, @@ -5569,33 +5593,34 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 108, - EndLine: 108, - StartPos: 2500, - EndPos: 2501, + EndLine: 108, + StartPos: 2500, + EndPos: 2501, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, ElseIf: []node.Node{ &stmt.ElseIf{ Position: &position.Position{ StartLine: 108, - EndLine: 108, - StartPos: 2503, - EndPos: 2516, + EndLine: 108, + StartPos: 2503, + EndPos: 2516, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 108, - EndLine: 108, - StartPos: 2511, - EndPos: 2512, + EndLine: 108, + StartPos: 2511, + EndPos: 2512, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 108, - EndLine: 108, - StartPos: 2511, - EndPos: 2512, + EndLine: 108, + StartPos: 2511, + EndPos: 2512, }, Value: "b", }, @@ -5603,11 +5628,12 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 108, - EndLine: 108, - StartPos: 2515, - EndPos: 2516, + EndLine: 108, + StartPos: 2515, + EndPos: 2516, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, }, }, @@ -5615,23 +5641,23 @@ func TestPhp7(t *testing.T) { &stmt.If{ Position: &position.Position{ StartLine: 109, - EndLine: 109, - StartPos: 2520, - EndPos: 2537, + EndLine: 109, + StartPos: 2520, + EndPos: 2537, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 109, - EndLine: 109, - StartPos: 2524, - EndPos: 2525, + EndLine: 109, + StartPos: 2524, + EndPos: 2525, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 109, - EndLine: 109, - StartPos: 2524, - EndPos: 2525, + EndLine: 109, + StartPos: 2524, + EndPos: 2525, }, Value: "a", }, @@ -5639,50 +5665,52 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 109, - EndLine: 109, - StartPos: 2528, - EndPos: 2529, + EndLine: 109, + StartPos: 2528, + EndPos: 2529, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, Else: &stmt.Else{ Position: &position.Position{ StartLine: 109, - EndLine: 109, - StartPos: 2531, - EndPos: 2537, + EndLine: 109, + StartPos: 2531, + EndPos: 2537, }, Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 109, - EndLine: 109, - StartPos: 2536, - EndPos: 2537, + EndLine: 109, + StartPos: 2536, + EndPos: 2537, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, }, }, &stmt.If{ Position: &position.Position{ StartLine: 110, - EndLine: 110, - StartPos: 2541, - EndPos: 2588, + EndLine: 110, + StartPos: 2541, + EndPos: 2588, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 110, - EndLine: 110, - StartPos: 2545, - EndPos: 2546, + EndLine: 110, + StartPos: 2545, + EndPos: 2546, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 110, - EndLine: 110, - StartPos: 2545, - EndPos: 2546, + EndLine: 110, + StartPos: 2545, + EndPos: 2546, }, Value: "a", }, @@ -5690,33 +5718,34 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 110, - EndLine: 110, - StartPos: 2549, - EndPos: 2550, + EndLine: 110, + StartPos: 2549, + EndPos: 2550, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, ElseIf: []node.Node{ &stmt.ElseIf{ Position: &position.Position{ StartLine: 110, - EndLine: 110, - StartPos: 2552, - EndPos: 2565, + EndLine: 110, + StartPos: 2552, + EndPos: 2565, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 110, - EndLine: 110, - StartPos: 2560, - EndPos: 2561, + EndLine: 110, + StartPos: 2560, + EndPos: 2561, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 110, - EndLine: 110, - StartPos: 2560, - EndPos: 2561, + EndLine: 110, + StartPos: 2560, + EndPos: 2561, }, Value: "b", }, @@ -5724,33 +5753,34 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 110, - EndLine: 110, - StartPos: 2564, - EndPos: 2565, + EndLine: 110, + StartPos: 2564, + EndPos: 2565, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, }, &stmt.ElseIf{ Position: &position.Position{ StartLine: 110, - EndLine: 110, - StartPos: 2567, - EndPos: 2580, + EndLine: 110, + StartPos: 2567, + EndPos: 2580, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 110, - EndLine: 110, - StartPos: 2575, - EndPos: 2576, + EndLine: 110, + StartPos: 2575, + EndPos: 2576, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 110, - EndLine: 110, - StartPos: 2575, - EndPos: 2576, + EndLine: 110, + StartPos: 2575, + EndPos: 2576, }, Value: "c", }, @@ -5758,52 +5788,54 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 110, - EndLine: 110, - StartPos: 2579, - EndPos: 2580, + EndLine: 110, + StartPos: 2579, + EndPos: 2580, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, }, }, Else: &stmt.Else{ Position: &position.Position{ StartLine: 110, - EndLine: 110, - StartPos: 2582, - EndPos: 2588, + EndLine: 110, + StartPos: 2582, + EndPos: 2588, }, Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 110, - EndLine: 110, - StartPos: 2587, - EndPos: 2588, + EndLine: 110, + StartPos: 2587, + EndPos: 2588, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, }, }, &stmt.If{ Position: &position.Position{ StartLine: 111, - EndLine: 111, - StartPos: 2592, - EndPos: 2640, + EndLine: 111, + StartPos: 2592, + EndPos: 2640, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 111, - EndLine: 111, - StartPos: 2596, - EndPos: 2597, + EndLine: 111, + StartPos: 2596, + EndPos: 2597, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 111, - EndLine: 111, - StartPos: 2596, - EndPos: 2597, + EndLine: 111, + StartPos: 2596, + EndPos: 2597, }, Value: "a", }, @@ -5811,33 +5843,34 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 111, - EndLine: 111, - StartPos: 2600, - EndPos: 2601, + EndLine: 111, + StartPos: 2600, + EndPos: 2601, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, ElseIf: []node.Node{ &stmt.ElseIf{ Position: &position.Position{ StartLine: 111, - EndLine: 111, - StartPos: 2603, - EndPos: 2616, + EndLine: 111, + StartPos: 2603, + EndPos: 2616, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 111, - EndLine: 111, - StartPos: 2611, - EndPos: 2612, + EndLine: 111, + StartPos: 2611, + EndPos: 2612, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 111, - EndLine: 111, - StartPos: 2611, - EndPos: 2612, + EndLine: 111, + StartPos: 2611, + EndPos: 2612, }, Value: "b", }, @@ -5845,41 +5878,42 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 111, - EndLine: 111, - StartPos: 2615, - EndPos: 2616, + EndLine: 111, + StartPos: 2615, + EndPos: 2616, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, }, }, Else: &stmt.Else{ Position: &position.Position{ StartLine: 111, - EndLine: 111, - StartPos: 2618, - EndPos: 2640, + EndLine: 111, + StartPos: 2618, + EndPos: 2640, }, Stmt: &stmt.If{ Position: &position.Position{ StartLine: 111, - EndLine: 111, - StartPos: 2623, - EndPos: 2640, + EndLine: 111, + StartPos: 2623, + EndPos: 2640, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 111, - EndLine: 111, - StartPos: 2627, - EndPos: 2628, + EndLine: 111, + StartPos: 2627, + EndPos: 2628, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 111, - EndLine: 111, - StartPos: 2627, - EndPos: 2628, + EndLine: 111, + StartPos: 2627, + EndPos: 2628, }, Value: "c", }, @@ -5887,27 +5921,29 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 111, - EndLine: 111, - StartPos: 2631, - EndPos: 2632, + EndLine: 111, + StartPos: 2631, + EndPos: 2632, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, Else: &stmt.Else{ Position: &position.Position{ StartLine: 111, - EndLine: 111, - StartPos: 2634, - EndPos: 2640, + EndLine: 111, + StartPos: 2634, + EndPos: 2640, }, Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 111, - EndLine: 111, - StartPos: 2639, - EndPos: 2640, + EndLine: 111, + StartPos: 2639, + EndPos: 2640, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, }, }, @@ -5916,78 +5952,79 @@ func TestPhp7(t *testing.T) { &stmt.Nop{ Position: &position.Position{ StartLine: 112, - EndLine: 112, - StartPos: 2644, - EndPos: 2645, + EndLine: 112, + StartPos: 2644, + EndPos: 2645, }, }, &stmt.InlineHtml{ Position: &position.Position{ StartLine: 112, - EndLine: 112, - StartPos: 2647, - EndPos: 2658, + EndLine: 112, + StartPos: 2647, + EndPos: 2658, }, Value: "
", }, &stmt.Interface{ Position: &position.Position{ StartLine: 113, - EndLine: 113, - StartPos: 2664, - EndPos: 2679, + EndLine: 113, + StartPos: 2664, + EndPos: 2679, }, PhpDocComment: "", InterfaceName: &node.Identifier{ Position: &position.Position{ StartLine: 113, - EndLine: 113, - StartPos: 2674, - EndPos: 2676, + EndLine: 113, + StartPos: 2674, + EndPos: 2676, }, Value: "Foo", }, - Stmts: []node.Node{}, + Stmts: []node.Node{ + }, }, &stmt.Interface{ Position: &position.Position{ StartLine: 114, - EndLine: 114, - StartPos: 2683, - EndPos: 2710, + EndLine: 114, + StartPos: 2683, + EndPos: 2710, }, PhpDocComment: "", InterfaceName: &node.Identifier{ Position: &position.Position{ StartLine: 114, - EndLine: 114, - StartPos: 2693, - EndPos: 2695, + EndLine: 114, + StartPos: 2693, + EndPos: 2695, }, Value: "Foo", }, Extends: &stmt.InterfaceExtends{ Position: &position.Position{ StartLine: 114, - EndLine: 114, - StartPos: 2697, - EndPos: 2707, + EndLine: 114, + StartPos: 2697, + EndPos: 2707, }, InterfaceNames: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 114, - EndLine: 114, - StartPos: 2705, - EndPos: 2707, + EndLine: 114, + StartPos: 2705, + EndPos: 2707, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 114, - EndLine: 114, - StartPos: 2705, - EndPos: 2707, + EndLine: 114, + StartPos: 2705, + EndPos: 2707, }, Value: "Bar", }, @@ -5995,47 +6032,48 @@ func TestPhp7(t *testing.T) { }, }, }, - Stmts: []node.Node{}, + Stmts: []node.Node{ + }, }, &stmt.Interface{ Position: &position.Position{ StartLine: 115, - EndLine: 115, - StartPos: 2714, - EndPos: 2746, + EndLine: 115, + StartPos: 2714, + EndPos: 2746, }, PhpDocComment: "", InterfaceName: &node.Identifier{ Position: &position.Position{ StartLine: 115, - EndLine: 115, - StartPos: 2724, - EndPos: 2726, + EndLine: 115, + StartPos: 2724, + EndPos: 2726, }, Value: "Foo", }, Extends: &stmt.InterfaceExtends{ Position: &position.Position{ StartLine: 115, - EndLine: 115, - StartPos: 2728, - EndPos: 2743, + EndLine: 115, + StartPos: 2728, + EndPos: 2743, }, InterfaceNames: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 115, - EndLine: 115, - StartPos: 2736, - EndPos: 2738, + EndLine: 115, + StartPos: 2736, + EndPos: 2738, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 115, - EndLine: 115, - StartPos: 2736, - EndPos: 2738, + EndLine: 115, + StartPos: 2736, + EndPos: 2738, }, Value: "Bar", }, @@ -6044,17 +6082,17 @@ func TestPhp7(t *testing.T) { &name.Name{ Position: &position.Position{ StartLine: 115, - EndLine: 115, - StartPos: 2741, - EndPos: 2743, + EndLine: 115, + StartPos: 2741, + EndPos: 2743, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 115, - EndLine: 115, - StartPos: 2741, - EndPos: 2743, + EndLine: 115, + StartPos: 2741, + EndPos: 2743, }, Value: "Baz", }, @@ -6062,29 +6100,30 @@ func TestPhp7(t *testing.T) { }, }, }, - Stmts: []node.Node{}, + Stmts: []node.Node{ + }, }, &stmt.Namespace{ Position: &position.Position{ StartLine: 116, - EndLine: 116, - StartPos: 2750, - EndPos: 2763, + EndLine: 116, + StartPos: 2750, + EndPos: 2763, }, NamespaceName: &name.Name{ Position: &position.Position{ StartLine: 116, - EndLine: 116, - StartPos: 2760, - EndPos: 2762, + EndLine: 116, + StartPos: 2760, + EndPos: 2762, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 116, - EndLine: 116, - StartPos: 2760, - EndPos: 2762, + EndLine: 116, + StartPos: 2760, + EndPos: 2762, }, Value: "Foo", }, @@ -6094,54 +6133,56 @@ func TestPhp7(t *testing.T) { &stmt.Namespace{ Position: &position.Position{ StartLine: 117, - EndLine: 117, - StartPos: 2767, - EndPos: 2782, + EndLine: 117, + StartPos: 2767, + EndPos: 2782, }, NamespaceName: &name.Name{ Position: &position.Position{ StartLine: 117, - EndLine: 117, - StartPos: 2777, - EndPos: 2779, + EndLine: 117, + StartPos: 2777, + EndPos: 2779, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 117, - EndLine: 117, - StartPos: 2777, - EndPos: 2779, + EndLine: 117, + StartPos: 2777, + EndPos: 2779, }, Value: "Foo", }, }, }, - Stmts: []node.Node{}, + Stmts: []node.Node{ + }, }, &stmt.Namespace{ Position: &position.Position{ StartLine: 118, - EndLine: 118, - StartPos: 2786, - EndPos: 2797, + EndLine: 118, + StartPos: 2786, + EndPos: 2797, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, &stmt.Class{ Position: &position.Position{ StartLine: 119, - EndLine: 119, - StartPos: 2801, - EndPos: 2819, + EndLine: 119, + StartPos: 2801, + EndPos: 2819, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 119, - EndLine: 119, - StartPos: 2807, - EndPos: 2809, + EndLine: 119, + StartPos: 2807, + EndPos: 2809, }, Value: "foo", }, @@ -6149,17 +6190,17 @@ func TestPhp7(t *testing.T) { &stmt.PropertyList{ Position: &position.Position{ StartLine: 119, - EndLine: 119, - StartPos: 2812, - EndPos: 2818, + EndLine: 119, + StartPos: 2812, + EndPos: 2818, }, Modifiers: []node.Node{ &node.Identifier{ Position: &position.Position{ StartLine: 119, - EndLine: 119, - StartPos: 2812, - EndPos: 2814, + EndLine: 119, + StartPos: 2812, + EndPos: 2814, }, Value: "var", }, @@ -6168,24 +6209,24 @@ func TestPhp7(t *testing.T) { &stmt.Property{ Position: &position.Position{ StartLine: 119, - EndLine: 119, - StartPos: 2816, - EndPos: 2817, + EndLine: 119, + StartPos: 2816, + EndPos: 2817, }, PhpDocComment: "", Variable: &expr.Variable{ Position: &position.Position{ StartLine: 119, - EndLine: 119, - StartPos: 2816, - EndPos: 2817, + EndLine: 119, + StartPos: 2816, + EndPos: 2817, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 119, - EndLine: 119, - StartPos: 2816, - EndPos: 2817, + EndLine: 119, + StartPos: 2816, + EndPos: 2817, }, Value: "a", }, @@ -6198,17 +6239,17 @@ func TestPhp7(t *testing.T) { &stmt.Class{ Position: &position.Position{ StartLine: 120, - EndLine: 120, - StartPos: 2823, - EndPos: 2859, + EndLine: 120, + StartPos: 2823, + EndPos: 2859, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 120, - EndLine: 120, - StartPos: 2829, - EndPos: 2831, + EndLine: 120, + StartPos: 2829, + EndPos: 2831, }, Value: "foo", }, @@ -6216,26 +6257,26 @@ func TestPhp7(t *testing.T) { &stmt.PropertyList{ Position: &position.Position{ StartLine: 120, - EndLine: 120, - StartPos: 2834, - EndPos: 2858, + EndLine: 120, + StartPos: 2834, + EndPos: 2858, }, Modifiers: []node.Node{ &node.Identifier{ Position: &position.Position{ StartLine: 120, - EndLine: 120, - StartPos: 2834, - EndPos: 2839, + EndLine: 120, + StartPos: 2834, + EndPos: 2839, }, Value: "public", }, &node.Identifier{ Position: &position.Position{ StartLine: 120, - EndLine: 120, - StartPos: 2841, - EndPos: 2846, + EndLine: 120, + StartPos: 2841, + EndPos: 2846, }, Value: "static", }, @@ -6244,24 +6285,24 @@ func TestPhp7(t *testing.T) { &stmt.Property{ Position: &position.Position{ StartLine: 120, - EndLine: 120, - StartPos: 2848, - EndPos: 2849, + EndLine: 120, + StartPos: 2848, + EndPos: 2849, }, PhpDocComment: "", Variable: &expr.Variable{ Position: &position.Position{ StartLine: 120, - EndLine: 120, - StartPos: 2848, - EndPos: 2849, + EndLine: 120, + StartPos: 2848, + EndPos: 2849, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 120, - EndLine: 120, - StartPos: 2848, - EndPos: 2849, + EndLine: 120, + StartPos: 2848, + EndPos: 2849, }, Value: "a", }, @@ -6270,24 +6311,24 @@ func TestPhp7(t *testing.T) { &stmt.Property{ Position: &position.Position{ StartLine: 120, - EndLine: 120, - StartPos: 2852, - EndPos: 2857, + EndLine: 120, + StartPos: 2852, + EndPos: 2857, }, PhpDocComment: "", Variable: &expr.Variable{ Position: &position.Position{ StartLine: 120, - EndLine: 120, - StartPos: 2852, - EndPos: 2853, + EndLine: 120, + StartPos: 2852, + EndPos: 2853, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 120, - EndLine: 120, - StartPos: 2852, - EndPos: 2853, + EndLine: 120, + StartPos: 2852, + EndPos: 2853, }, Value: "b", }, @@ -6295,9 +6336,9 @@ func TestPhp7(t *testing.T) { Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 120, - EndLine: 120, - StartPos: 2857, - EndPos: 2857, + EndLine: 120, + StartPos: 2857, + EndPos: 2857, }, Value: "1", }, @@ -6309,31 +6350,31 @@ func TestPhp7(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 121, - EndLine: 121, - StartPos: 2863, - EndPos: 2880, + EndLine: 121, + StartPos: 2863, + EndPos: 2880, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 121, - EndLine: 121, - StartPos: 2870, - EndPos: 2871, + EndLine: 121, + StartPos: 2870, + EndPos: 2871, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 121, - EndLine: 121, - StartPos: 2870, - EndPos: 2871, + EndLine: 121, + StartPos: 2870, + EndPos: 2871, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 121, - EndLine: 121, - StartPos: 2870, - EndPos: 2871, + EndLine: 121, + StartPos: 2870, + EndPos: 2871, }, Value: "a", }, @@ -6342,23 +6383,23 @@ func TestPhp7(t *testing.T) { &stmt.StaticVar{ Position: &position.Position{ StartLine: 121, - EndLine: 121, - StartPos: 2874, - EndPos: 2879, + EndLine: 121, + StartPos: 2874, + EndPos: 2879, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 121, - EndLine: 121, - StartPos: 2874, - EndPos: 2875, + EndLine: 121, + StartPos: 2874, + EndPos: 2875, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 121, - EndLine: 121, - StartPos: 2874, - EndPos: 2875, + EndLine: 121, + StartPos: 2874, + EndPos: 2875, }, Value: "b", }, @@ -6366,9 +6407,9 @@ func TestPhp7(t *testing.T) { Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 121, - EndLine: 121, - StartPos: 2879, - EndPos: 2879, + EndLine: 121, + StartPos: 2879, + EndPos: 2879, }, Value: "1", }, @@ -6378,71 +6419,74 @@ func TestPhp7(t *testing.T) { &stmt.AltSwitch{ Position: &position.Position{ StartLine: 123, - EndLine: 127, - StartPos: 2885, - EndPos: 2943, + EndLine: 127, + StartPos: 2885, + EndPos: 2943, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 123, - EndLine: 123, - StartPos: 2893, - EndPos: 2893, + EndLine: 123, + StartPos: 2893, + EndPos: 2893, }, Value: "1", }, CaseList: &stmt.CaseList{ Position: &position.Position{ StartLine: 124, - EndLine: -1, - StartPos: 2901, - EndPos: -1, + EndLine: -1, + StartPos: 2901, + EndPos: -1, }, Cases: []node.Node{ &stmt.Case{ Position: &position.Position{ StartLine: 124, - EndLine: -1, - StartPos: 2901, - EndPos: -1, + EndLine: -1, + StartPos: 2901, + EndPos: -1, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 124, - EndLine: 124, - StartPos: 2906, - EndPos: 2906, + EndLine: 124, + StartPos: 2906, + EndPos: 2906, }, Value: "1", }, - Stmts: []node.Node{}, + Stmts: []node.Node{ + }, }, &stmt.Default{ Position: &position.Position{ StartLine: 125, - EndLine: -1, - StartPos: 2912, - EndPos: -1, + EndLine: -1, + StartPos: 2912, + EndPos: -1, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, &stmt.Case{ Position: &position.Position{ StartLine: 126, - EndLine: -1, - StartPos: 2924, - EndPos: -1, + EndLine: -1, + StartPos: 2924, + EndPos: -1, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 126, - EndLine: 126, - StartPos: 2929, - EndPos: 2929, + EndLine: 126, + StartPos: 2929, + EndPos: 2929, }, Value: "2", }, - Stmts: []node.Node{}, + Stmts: []node.Node{ + }, }, }, }, @@ -6450,62 +6494,64 @@ func TestPhp7(t *testing.T) { &stmt.AltSwitch{ Position: &position.Position{ StartLine: 129, - EndLine: 132, - StartPos: 2948, - EndPos: 2995, + EndLine: 132, + StartPos: 2948, + EndPos: 2995, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 129, - EndLine: 129, - StartPos: 2956, - EndPos: 2956, + EndLine: 129, + StartPos: 2956, + EndPos: 2956, }, Value: "1", }, CaseList: &stmt.CaseList{ Position: &position.Position{ StartLine: 130, - EndLine: -1, - StartPos: 2965, - EndPos: -1, + EndLine: -1, + StartPos: 2965, + EndPos: -1, }, Cases: []node.Node{ &stmt.Case{ Position: &position.Position{ StartLine: 130, - EndLine: -1, - StartPos: 2965, - EndPos: -1, + EndLine: -1, + StartPos: 2965, + EndPos: -1, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 130, - EndLine: 130, - StartPos: 2970, - EndPos: 2970, + EndLine: 130, + StartPos: 2970, + EndPos: 2970, }, Value: "1", }, - Stmts: []node.Node{}, + Stmts: []node.Node{ + }, }, &stmt.Case{ Position: &position.Position{ StartLine: 131, - EndLine: -1, - StartPos: 2976, - EndPos: -1, + EndLine: -1, + StartPos: 2976, + EndPos: -1, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 131, - EndLine: 131, - StartPos: 2981, - EndPos: 2981, + EndLine: 131, + StartPos: 2981, + EndPos: 2981, }, Value: "2", }, - Stmts: []node.Node{}, + Stmts: []node.Node{ + }, }, }, }, @@ -6513,40 +6559,40 @@ func TestPhp7(t *testing.T) { &stmt.Switch{ Position: &position.Position{ StartLine: 134, - EndLine: 137, - StartPos: 3002, - EndPos: 3053, + EndLine: 137, + StartPos: 3002, + EndPos: 3053, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 134, - EndLine: 134, - StartPos: 3010, - EndPos: 3010, + EndLine: 134, + StartPos: 3010, + EndPos: 3010, }, Value: "1", }, CaseList: &stmt.CaseList{ Position: &position.Position{ StartLine: 134, - EndLine: 137, - StartPos: 3013, - EndPos: 3053, + EndLine: 137, + StartPos: 3013, + EndPos: 3053, }, Cases: []node.Node{ &stmt.Case{ Position: &position.Position{ StartLine: 135, - EndLine: 135, - StartPos: 3018, - EndPos: 3031, + EndLine: 135, + StartPos: 3018, + EndPos: 3031, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 135, - EndLine: 135, - StartPos: 3023, - EndPos: 3023, + EndLine: 135, + StartPos: 3023, + EndPos: 3023, }, Value: "1", }, @@ -6554,9 +6600,9 @@ func TestPhp7(t *testing.T) { &stmt.Break{ Position: &position.Position{ StartLine: 135, - EndLine: 135, - StartPos: 3026, - EndPos: 3031, + EndLine: 135, + StartPos: 3026, + EndPos: 3031, }, }, }, @@ -6564,16 +6610,16 @@ func TestPhp7(t *testing.T) { &stmt.Case{ Position: &position.Position{ StartLine: 136, - EndLine: 136, - StartPos: 3036, - EndPos: 3049, + EndLine: 136, + StartPos: 3036, + EndPos: 3049, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 136, - EndLine: 136, - StartPos: 3041, - EndPos: 3041, + EndLine: 136, + StartPos: 3041, + EndPos: 3041, }, Value: "2", }, @@ -6581,9 +6627,9 @@ func TestPhp7(t *testing.T) { &stmt.Break{ Position: &position.Position{ StartLine: 136, - EndLine: 136, - StartPos: 3044, - EndPos: 3049, + EndLine: 136, + StartPos: 3044, + EndPos: 3049, }, }, }, @@ -6594,40 +6640,40 @@ func TestPhp7(t *testing.T) { &stmt.Switch{ Position: &position.Position{ StartLine: 139, - EndLine: 142, - StartPos: 3060, - EndPos: 3112, + EndLine: 142, + StartPos: 3060, + EndPos: 3112, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 139, - EndLine: 139, - StartPos: 3068, - EndPos: 3068, + EndLine: 139, + StartPos: 3068, + EndPos: 3068, }, Value: "1", }, CaseList: &stmt.CaseList{ Position: &position.Position{ StartLine: 139, - EndLine: 142, - StartPos: 3071, - EndPos: 3112, + EndLine: 142, + StartPos: 3071, + EndPos: 3112, }, Cases: []node.Node{ &stmt.Case{ Position: &position.Position{ StartLine: 140, - EndLine: 140, - StartPos: 3077, - EndPos: 3090, + EndLine: 140, + StartPos: 3077, + EndPos: 3090, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 140, - EndLine: 140, - StartPos: 3082, - EndPos: 3082, + EndLine: 140, + StartPos: 3082, + EndPos: 3082, }, Value: "1", }, @@ -6635,9 +6681,9 @@ func TestPhp7(t *testing.T) { &stmt.Break{ Position: &position.Position{ StartLine: 140, - EndLine: 140, - StartPos: 3085, - EndPos: 3090, + EndLine: 140, + StartPos: 3085, + EndPos: 3090, }, }, }, @@ -6645,16 +6691,16 @@ func TestPhp7(t *testing.T) { &stmt.Case{ Position: &position.Position{ StartLine: 141, - EndLine: 141, - StartPos: 3095, - EndPos: 3108, + EndLine: 141, + StartPos: 3095, + EndPos: 3108, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 141, - EndLine: 141, - StartPos: 3100, - EndPos: 3100, + EndLine: 141, + StartPos: 3100, + EndPos: 3100, }, Value: "2", }, @@ -6662,9 +6708,9 @@ func TestPhp7(t *testing.T) { &stmt.Break{ Position: &position.Position{ StartLine: 141, - EndLine: 141, - StartPos: 3103, - EndPos: 3108, + EndLine: 141, + StartPos: 3103, + EndPos: 3108, }, }, }, @@ -6675,23 +6721,23 @@ func TestPhp7(t *testing.T) { &stmt.Throw{ Position: &position.Position{ StartLine: 144, - EndLine: 144, - StartPos: 3117, - EndPos: 3125, + EndLine: 144, + StartPos: 3117, + EndPos: 3125, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 144, - EndLine: 144, - StartPos: 3123, - EndPos: 3124, + EndLine: 144, + StartPos: 3123, + EndPos: 3124, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 144, - EndLine: 144, - StartPos: 3123, - EndPos: 3124, + EndLine: 144, + StartPos: 3123, + EndPos: 3124, }, Value: "e", }, @@ -6700,36 +6746,37 @@ func TestPhp7(t *testing.T) { &stmt.Trait{ Position: &position.Position{ StartLine: 146, - EndLine: 146, - StartPos: 3130, - EndPos: 3141, + EndLine: 146, + StartPos: 3130, + EndPos: 3141, }, PhpDocComment: "", TraitName: &node.Identifier{ Position: &position.Position{ StartLine: 146, - EndLine: 146, - StartPos: 3136, - EndPos: 3138, + EndLine: 146, + StartPos: 3136, + EndPos: 3138, }, Value: "Foo", }, - Stmts: []node.Node{}, + Stmts: []node.Node{ + }, }, &stmt.Class{ Position: &position.Position{ StartLine: 147, - EndLine: 147, - StartPos: 3145, - EndPos: 3166, + EndLine: 147, + StartPos: 3145, + EndPos: 3166, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 147, - EndLine: 147, - StartPos: 3151, - EndPos: 3153, + EndLine: 147, + StartPos: 3151, + EndPos: 3153, }, Value: "Foo", }, @@ -6737,25 +6784,25 @@ func TestPhp7(t *testing.T) { &stmt.TraitUse{ Position: &position.Position{ StartLine: 147, - EndLine: 147, - StartPos: 3157, - EndPos: 3164, + EndLine: 147, + StartPos: 3157, + EndPos: 3164, }, Traits: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 147, - EndLine: 147, - StartPos: 3161, - EndPos: 3163, + EndLine: 147, + StartPos: 3161, + EndPos: 3163, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 147, - EndLine: 147, - StartPos: 3161, - EndPos: 3163, + EndLine: 147, + StartPos: 3161, + EndPos: 3163, }, Value: "Bar", }, @@ -6768,17 +6815,17 @@ func TestPhp7(t *testing.T) { &stmt.Class{ Position: &position.Position{ StartLine: 148, - EndLine: 148, - StartPos: 3170, - EndPos: 3198, + EndLine: 148, + StartPos: 3170, + EndPos: 3198, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 148, - EndLine: 148, - StartPos: 3176, - EndPos: 3178, + EndLine: 148, + StartPos: 3176, + EndPos: 3178, }, Value: "Foo", }, @@ -6786,25 +6833,25 @@ func TestPhp7(t *testing.T) { &stmt.TraitUse{ Position: &position.Position{ StartLine: 148, - EndLine: 148, - StartPos: 3182, - EndPos: 3196, + EndLine: 148, + StartPos: 3182, + EndPos: 3196, }, Traits: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 148, - EndLine: 148, - StartPos: 3186, - EndPos: 3188, + EndLine: 148, + StartPos: 3186, + EndPos: 3188, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 148, - EndLine: 148, - StartPos: 3186, - EndPos: 3188, + EndLine: 148, + StartPos: 3186, + EndPos: 3188, }, Value: "Bar", }, @@ -6813,17 +6860,17 @@ func TestPhp7(t *testing.T) { &name.Name{ Position: &position.Position{ StartLine: 148, - EndLine: 148, - StartPos: 3191, - EndPos: 3193, + EndLine: 148, + StartPos: 3191, + EndPos: 3193, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 148, - EndLine: 148, - StartPos: 3191, - EndPos: 3193, + EndLine: 148, + StartPos: 3191, + EndPos: 3193, }, Value: "Baz", }, @@ -6833,9 +6880,9 @@ func TestPhp7(t *testing.T) { TraitAdaptationList: &stmt.TraitAdaptationList{ Position: &position.Position{ StartLine: 148, - EndLine: 148, - StartPos: 3195, - EndPos: 3196, + EndLine: 148, + StartPos: 3195, + EndPos: 3196, }, }, }, @@ -6844,17 +6891,17 @@ func TestPhp7(t *testing.T) { &stmt.Class{ Position: &position.Position{ StartLine: 149, - EndLine: 149, - StartPos: 3202, - EndPos: 3247, + EndLine: 149, + StartPos: 3202, + EndPos: 3247, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 149, - EndLine: 149, - StartPos: 3208, - EndPos: 3210, + EndLine: 149, + StartPos: 3208, + EndPos: 3210, }, Value: "Foo", }, @@ -6862,25 +6909,25 @@ func TestPhp7(t *testing.T) { &stmt.TraitUse{ Position: &position.Position{ StartLine: 149, - EndLine: 149, - StartPos: 3214, - EndPos: 3245, + EndLine: 149, + StartPos: 3214, + EndPos: 3245, }, Traits: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 149, - EndLine: 149, - StartPos: 3218, - EndPos: 3220, + EndLine: 149, + StartPos: 3218, + EndPos: 3220, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 149, - EndLine: 149, - StartPos: 3218, - EndPos: 3220, + EndLine: 149, + StartPos: 3218, + EndPos: 3220, }, Value: "Bar", }, @@ -6889,17 +6936,17 @@ func TestPhp7(t *testing.T) { &name.Name{ Position: &position.Position{ StartLine: 149, - EndLine: 149, - StartPos: 3223, - EndPos: 3225, + EndLine: 149, + StartPos: 3223, + EndPos: 3225, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 149, - EndLine: 149, - StartPos: 3223, - EndPos: 3225, + EndLine: 149, + StartPos: 3223, + EndPos: 3225, }, Value: "Baz", }, @@ -6909,31 +6956,31 @@ func TestPhp7(t *testing.T) { TraitAdaptationList: &stmt.TraitAdaptationList{ Position: &position.Position{ StartLine: 149, - EndLine: 149, - StartPos: 3227, - EndPos: 3245, + EndLine: 149, + StartPos: 3227, + EndPos: 3245, }, Adaptations: []node.Node{ &stmt.TraitUseAlias{ Position: &position.Position{ StartLine: 149, - EndLine: 149, - StartPos: 3229, - EndPos: 3242, + EndLine: 149, + StartPos: 3229, + EndPos: 3242, }, Ref: &stmt.TraitMethodRef{ Position: &position.Position{ StartLine: 149, - EndLine: 149, - StartPos: 3229, - EndPos: 3231, + EndLine: 149, + StartPos: 3229, + EndPos: 3231, }, Method: &node.Identifier{ Position: &position.Position{ StartLine: 149, - EndLine: 149, - StartPos: 3229, - EndPos: 3231, + EndLine: 149, + StartPos: 3229, + EndPos: 3231, }, Value: "one", }, @@ -6941,9 +6988,9 @@ func TestPhp7(t *testing.T) { Alias: &node.Identifier{ Position: &position.Position{ StartLine: 149, - EndLine: 149, - StartPos: 3236, - EndPos: 3242, + EndLine: 149, + StartPos: 3236, + EndPos: 3242, }, Value: "include", }, @@ -6956,17 +7003,17 @@ func TestPhp7(t *testing.T) { &stmt.Class{ Position: &position.Position{ StartLine: 150, - EndLine: 150, - StartPos: 3251, - EndPos: 3295, + EndLine: 150, + StartPos: 3251, + EndPos: 3295, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 150, - EndLine: 150, - StartPos: 3257, - EndPos: 3259, + EndLine: 150, + StartPos: 3257, + EndPos: 3259, }, Value: "Foo", }, @@ -6974,25 +7021,25 @@ func TestPhp7(t *testing.T) { &stmt.TraitUse{ Position: &position.Position{ StartLine: 150, - EndLine: 150, - StartPos: 3263, - EndPos: 3293, + EndLine: 150, + StartPos: 3263, + EndPos: 3293, }, Traits: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 150, - EndLine: 150, - StartPos: 3267, - EndPos: 3269, + EndLine: 150, + StartPos: 3267, + EndPos: 3269, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 150, - EndLine: 150, - StartPos: 3267, - EndPos: 3269, + EndLine: 150, + StartPos: 3267, + EndPos: 3269, }, Value: "Bar", }, @@ -7001,17 +7048,17 @@ func TestPhp7(t *testing.T) { &name.Name{ Position: &position.Position{ StartLine: 150, - EndLine: 150, - StartPos: 3272, - EndPos: 3274, + EndLine: 150, + StartPos: 3272, + EndPos: 3274, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 150, - EndLine: 150, - StartPos: 3272, - EndPos: 3274, + EndLine: 150, + StartPos: 3272, + EndPos: 3274, }, Value: "Baz", }, @@ -7021,31 +7068,31 @@ func TestPhp7(t *testing.T) { TraitAdaptationList: &stmt.TraitAdaptationList{ Position: &position.Position{ StartLine: 150, - EndLine: 150, - StartPos: 3276, - EndPos: 3293, + EndLine: 150, + StartPos: 3276, + EndPos: 3293, }, Adaptations: []node.Node{ &stmt.TraitUseAlias{ Position: &position.Position{ StartLine: 150, - EndLine: 150, - StartPos: 3278, - EndPos: 3290, + EndLine: 150, + StartPos: 3278, + EndPos: 3290, }, Ref: &stmt.TraitMethodRef{ Position: &position.Position{ StartLine: 150, - EndLine: 150, - StartPos: 3278, - EndPos: 3280, + EndLine: 150, + StartPos: 3278, + EndPos: 3280, }, Method: &node.Identifier{ Position: &position.Position{ StartLine: 150, - EndLine: 150, - StartPos: 3278, - EndPos: 3280, + EndLine: 150, + StartPos: 3278, + EndPos: 3280, }, Value: "one", }, @@ -7053,9 +7100,9 @@ func TestPhp7(t *testing.T) { Modifier: &node.Identifier{ Position: &position.Position{ StartLine: 150, - EndLine: 150, - StartPos: 3285, - EndPos: 3290, + EndLine: 150, + StartPos: 3285, + EndPos: 3290, }, Value: "public", }, @@ -7068,17 +7115,17 @@ func TestPhp7(t *testing.T) { &stmt.Class{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3299, - EndPos: 3347, + EndLine: 151, + StartPos: 3299, + EndPos: 3347, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3305, - EndPos: 3307, + EndLine: 151, + StartPos: 3305, + EndPos: 3307, }, Value: "Foo", }, @@ -7086,25 +7133,25 @@ func TestPhp7(t *testing.T) { &stmt.TraitUse{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3311, - EndPos: 3345, + EndLine: 151, + StartPos: 3311, + EndPos: 3345, }, Traits: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3315, - EndPos: 3317, + EndLine: 151, + StartPos: 3315, + EndPos: 3317, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3315, - EndPos: 3317, + EndLine: 151, + StartPos: 3315, + EndPos: 3317, }, Value: "Bar", }, @@ -7113,17 +7160,17 @@ func TestPhp7(t *testing.T) { &name.Name{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3320, - EndPos: 3322, + EndLine: 151, + StartPos: 3320, + EndPos: 3322, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3320, - EndPos: 3322, + EndLine: 151, + StartPos: 3320, + EndPos: 3322, }, Value: "Baz", }, @@ -7133,31 +7180,31 @@ func TestPhp7(t *testing.T) { TraitAdaptationList: &stmt.TraitAdaptationList{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3324, - EndPos: 3345, + EndLine: 151, + StartPos: 3324, + EndPos: 3345, }, Adaptations: []node.Node{ &stmt.TraitUseAlias{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3326, - EndPos: 3342, + EndLine: 151, + StartPos: 3326, + EndPos: 3342, }, Ref: &stmt.TraitMethodRef{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3326, - EndPos: 3328, + EndLine: 151, + StartPos: 3326, + EndPos: 3328, }, Method: &node.Identifier{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3326, - EndPos: 3328, + EndLine: 151, + StartPos: 3326, + EndPos: 3328, }, Value: "one", }, @@ -7165,18 +7212,18 @@ func TestPhp7(t *testing.T) { Modifier: &node.Identifier{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3333, - EndPos: 3338, + EndLine: 151, + StartPos: 3333, + EndPos: 3338, }, Value: "public", }, Alias: &node.Identifier{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3340, - EndPos: 3342, + EndLine: 151, + StartPos: 3340, + EndPos: 3342, }, Value: "two", }, @@ -7189,17 +7236,17 @@ func TestPhp7(t *testing.T) { &stmt.Class{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3351, - EndPos: 3427, + EndLine: 152, + StartPos: 3351, + EndPos: 3427, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3357, - EndPos: 3359, + EndLine: 152, + StartPos: 3357, + EndPos: 3359, }, Value: "Foo", }, @@ -7207,25 +7254,25 @@ func TestPhp7(t *testing.T) { &stmt.TraitUse{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3363, - EndPos: 3425, + EndLine: 152, + StartPos: 3363, + EndPos: 3425, }, Traits: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3367, - EndPos: 3369, + EndLine: 152, + StartPos: 3367, + EndPos: 3369, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3367, - EndPos: 3369, + EndLine: 152, + StartPos: 3367, + EndPos: 3369, }, Value: "Bar", }, @@ -7234,17 +7281,17 @@ func TestPhp7(t *testing.T) { &name.Name{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3372, - EndPos: 3374, + EndLine: 152, + StartPos: 3372, + EndPos: 3374, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3372, - EndPos: 3374, + EndLine: 152, + StartPos: 3372, + EndPos: 3374, }, Value: "Baz", }, @@ -7254,39 +7301,39 @@ func TestPhp7(t *testing.T) { TraitAdaptationList: &stmt.TraitAdaptationList{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3376, - EndPos: 3425, + EndLine: 152, + StartPos: 3376, + EndPos: 3425, }, Adaptations: []node.Node{ &stmt.TraitUsePrecedence{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3378, - EndPos: 3405, + EndLine: 152, + StartPos: 3378, + EndPos: 3405, }, Ref: &stmt.TraitMethodRef{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3378, - EndPos: 3385, + EndLine: 152, + StartPos: 3378, + EndPos: 3385, }, Trait: &name.Name{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3378, - EndPos: 3380, + EndLine: 152, + StartPos: 3378, + EndPos: 3380, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3378, - EndPos: 3380, + EndLine: 152, + StartPos: 3378, + EndPos: 3380, }, Value: "Bar", }, @@ -7295,9 +7342,9 @@ func TestPhp7(t *testing.T) { Method: &node.Identifier{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3383, - EndPos: 3385, + EndLine: 152, + StartPos: 3383, + EndPos: 3385, }, Value: "one", }, @@ -7306,17 +7353,17 @@ func TestPhp7(t *testing.T) { &name.Name{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3397, - EndPos: 3399, + EndLine: 152, + StartPos: 3397, + EndPos: 3399, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3397, - EndPos: 3399, + EndLine: 152, + StartPos: 3397, + EndPos: 3399, }, Value: "Baz", }, @@ -7325,17 +7372,17 @@ func TestPhp7(t *testing.T) { &name.Name{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3402, - EndPos: 3405, + EndLine: 152, + StartPos: 3402, + EndPos: 3405, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3402, - EndPos: 3405, + EndLine: 152, + StartPos: 3402, + EndPos: 3405, }, Value: "Quux", }, @@ -7346,31 +7393,31 @@ func TestPhp7(t *testing.T) { &stmt.TraitUseAlias{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3408, - EndPos: 3422, + EndLine: 152, + StartPos: 3408, + EndPos: 3422, }, Ref: &stmt.TraitMethodRef{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3408, - EndPos: 3415, + EndLine: 152, + StartPos: 3408, + EndPos: 3415, }, Trait: &name.Name{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3408, - EndPos: 3410, + EndLine: 152, + StartPos: 3408, + EndPos: 3410, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3408, - EndPos: 3410, + EndLine: 152, + StartPos: 3408, + EndPos: 3410, }, Value: "Baz", }, @@ -7379,9 +7426,9 @@ func TestPhp7(t *testing.T) { Method: &node.Identifier{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3413, - EndPos: 3415, + EndLine: 152, + StartPos: 3413, + EndPos: 3415, }, Value: "one", }, @@ -7389,9 +7436,9 @@ func TestPhp7(t *testing.T) { Alias: &node.Identifier{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3420, - EndPos: 3422, + EndLine: 152, + StartPos: 3420, + EndPos: 3422, }, Value: "two", }, @@ -7404,44 +7451,47 @@ func TestPhp7(t *testing.T) { &stmt.Try{ Position: &position.Position{ StartLine: 154, - EndLine: -1, - StartPos: 3432, - EndPos: -1, + EndLine: -1, + StartPos: 3432, + EndPos: -1, + }, + Stmts: []node.Node{ + }, + Catches: []node.Node{ }, - Stmts: []node.Node{}, - Catches: []node.Node{}, }, &stmt.Try{ Position: &position.Position{ StartLine: 155, - EndLine: 155, - StartPos: 3441, - EndPos: 3470, + EndLine: 155, + StartPos: 3441, + EndPos: 3470, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, Catches: []node.Node{ &stmt.Catch{ Position: &position.Position{ StartLine: 155, - EndLine: 155, - StartPos: 3448, - EndPos: 3470, + EndLine: 155, + StartPos: 3448, + EndPos: 3470, }, Types: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 155, - EndLine: 155, - StartPos: 3455, - EndPos: 3463, + EndLine: 155, + StartPos: 3455, + EndPos: 3463, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 155, - EndLine: 155, - StartPos: 3455, - EndPos: 3463, + EndLine: 155, + StartPos: 3455, + EndPos: 3463, }, Value: "Exception", }, @@ -7451,55 +7501,57 @@ func TestPhp7(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 155, - EndLine: 155, - StartPos: 3465, - EndPos: 3466, + EndLine: 155, + StartPos: 3465, + EndPos: 3466, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 155, - EndLine: 155, - StartPos: 3465, - EndPos: 3466, + EndLine: 155, + StartPos: 3465, + EndPos: 3466, }, Value: "e", }, }, - Stmts: []node.Node{}, + Stmts: []node.Node{ + }, }, }, }, &stmt.Try{ Position: &position.Position{ StartLine: 156, - EndLine: 156, - StartPos: 3474, - EndPos: 3520, + EndLine: 156, + StartPos: 3474, + EndPos: 3520, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, Catches: []node.Node{ &stmt.Catch{ Position: &position.Position{ StartLine: 156, - EndLine: 156, - StartPos: 3481, - EndPos: 3520, + EndLine: 156, + StartPos: 3481, + EndPos: 3520, }, Types: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 156, - EndLine: 156, - StartPos: 3488, - EndPos: 3496, + EndLine: 156, + StartPos: 3488, + EndPos: 3496, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 156, - EndLine: 156, - StartPos: 3488, - EndPos: 3496, + EndLine: 156, + StartPos: 3488, + EndPos: 3496, }, Value: "Exception", }, @@ -7508,17 +7560,17 @@ func TestPhp7(t *testing.T) { &name.Name{ Position: &position.Position{ StartLine: 156, - EndLine: 156, - StartPos: 3498, - EndPos: 3513, + EndLine: 156, + StartPos: 3498, + EndPos: 3513, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 156, - EndLine: 156, - StartPos: 3498, - EndPos: 3513, + EndLine: 156, + StartPos: 3498, + EndPos: 3513, }, Value: "RuntimeException", }, @@ -7528,55 +7580,57 @@ func TestPhp7(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 156, - EndLine: 156, - StartPos: 3515, - EndPos: 3516, + EndLine: 156, + StartPos: 3515, + EndPos: 3516, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 156, - EndLine: 156, - StartPos: 3515, - EndPos: 3516, + EndLine: 156, + StartPos: 3515, + EndPos: 3516, }, Value: "e", }, }, - Stmts: []node.Node{}, + Stmts: []node.Node{ + }, }, }, }, &stmt.Try{ Position: &position.Position{ StartLine: 157, - EndLine: 157, - StartPos: 3524, - EndPos: 3584, + EndLine: 157, + StartPos: 3524, + EndPos: 3584, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, Catches: []node.Node{ &stmt.Catch{ Position: &position.Position{ StartLine: 157, - EndLine: 157, - StartPos: 3531, - EndPos: 3553, + EndLine: 157, + StartPos: 3531, + EndPos: 3553, }, Types: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 157, - EndLine: 157, - StartPos: 3538, - EndPos: 3546, + EndLine: 157, + StartPos: 3538, + EndPos: 3546, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 157, - EndLine: 157, - StartPos: 3538, - EndPos: 3546, + EndLine: 157, + StartPos: 3538, + EndPos: 3546, }, Value: "Exception", }, @@ -7586,44 +7640,45 @@ func TestPhp7(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 157, - EndLine: 157, - StartPos: 3548, - EndPos: 3549, + EndLine: 157, + StartPos: 3548, + EndPos: 3549, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 157, - EndLine: 157, - StartPos: 3548, - EndPos: 3549, + EndLine: 157, + StartPos: 3548, + EndPos: 3549, }, Value: "e", }, }, - Stmts: []node.Node{}, + Stmts: []node.Node{ + }, }, &stmt.Catch{ Position: &position.Position{ StartLine: 157, - EndLine: 157, - StartPos: 3555, - EndPos: 3584, + EndLine: 157, + StartPos: 3555, + EndPos: 3584, }, Types: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 157, - EndLine: 157, - StartPos: 3562, - EndPos: 3577, + EndLine: 157, + StartPos: 3562, + EndPos: 3577, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 157, - EndLine: 157, - StartPos: 3562, - EndPos: 3577, + EndLine: 157, + StartPos: 3562, + EndPos: 3577, }, Value: "RuntimeException", }, @@ -7633,55 +7688,57 @@ func TestPhp7(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 157, - EndLine: 157, - StartPos: 3579, - EndPos: 3580, + EndLine: 157, + StartPos: 3579, + EndPos: 3580, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 157, - EndLine: 157, - StartPos: 3579, - EndPos: 3580, + EndLine: 157, + StartPos: 3579, + EndPos: 3580, }, Value: "e", }, }, - Stmts: []node.Node{}, + Stmts: []node.Node{ + }, }, }, }, &stmt.Try{ Position: &position.Position{ StartLine: 158, - EndLine: 158, - StartPos: 3588, - EndPos: 3628, + EndLine: 158, + StartPos: 3588, + EndPos: 3628, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, Catches: []node.Node{ &stmt.Catch{ Position: &position.Position{ StartLine: 158, - EndLine: 158, - StartPos: 3595, - EndPos: 3617, + EndLine: 158, + StartPos: 3595, + EndPos: 3617, }, Types: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 158, - EndLine: 158, - StartPos: 3602, - EndPos: 3610, + EndLine: 158, + StartPos: 3602, + EndPos: 3610, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 158, - EndLine: 158, - StartPos: 3602, - EndPos: 3610, + EndLine: 158, + StartPos: 3602, + EndPos: 3610, }, Value: "Exception", }, @@ -7691,54 +7748,56 @@ func TestPhp7(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 158, - EndLine: 158, - StartPos: 3612, - EndPos: 3613, + EndLine: 158, + StartPos: 3612, + EndPos: 3613, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 158, - EndLine: 158, - StartPos: 3612, - EndPos: 3613, + EndLine: 158, + StartPos: 3612, + EndPos: 3613, }, Value: "e", }, }, - Stmts: []node.Node{}, + Stmts: []node.Node{ + }, }, }, Finally: &stmt.Finally{ Position: &position.Position{ StartLine: 158, - EndLine: 158, - StartPos: 3619, - EndPos: 3628, + EndLine: 158, + StartPos: 3619, + EndPos: 3628, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, }, &stmt.Unset{ Position: &position.Position{ StartLine: 160, - EndLine: 160, - StartPos: 3633, - EndPos: 3647, + EndLine: 160, + StartPos: 3633, + EndPos: 3647, }, Vars: []node.Node{ &expr.Variable{ Position: &position.Position{ StartLine: 160, - EndLine: 160, - StartPos: 3639, - EndPos: 3640, + EndLine: 160, + StartPos: 3639, + EndPos: 3640, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 160, - EndLine: 160, - StartPos: 3639, - EndPos: 3640, + EndLine: 160, + StartPos: 3639, + EndPos: 3640, }, Value: "a", }, @@ -7746,16 +7805,16 @@ func TestPhp7(t *testing.T) { &expr.Variable{ Position: &position.Position{ StartLine: 160, - EndLine: 160, - StartPos: 3643, - EndPos: 3644, + EndLine: 160, + StartPos: 3643, + EndPos: 3644, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 160, - EndLine: 160, - StartPos: 3643, - EndPos: 3644, + EndLine: 160, + StartPos: 3643, + EndPos: 3644, }, Value: "b", }, @@ -7765,32 +7824,32 @@ func TestPhp7(t *testing.T) { &stmt.UseList{ Position: &position.Position{ StartLine: 162, - EndLine: 162, - StartPos: 3652, - EndPos: 3659, + EndLine: 162, + StartPos: 3652, + EndPos: 3659, }, Uses: []node.Node{ &stmt.Use{ Position: &position.Position{ StartLine: 162, - EndLine: 162, - StartPos: 3656, - EndPos: 3658, + EndLine: 162, + StartPos: 3656, + EndPos: 3658, }, Use: &name.Name{ Position: &position.Position{ StartLine: 162, - EndLine: 162, - StartPos: 3656, - EndPos: 3658, + EndLine: 162, + StartPos: 3656, + EndPos: 3658, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 162, - EndLine: 162, - StartPos: 3656, - EndPos: 3658, + EndLine: 162, + StartPos: 3656, + EndPos: 3658, }, Value: "Foo", }, @@ -7802,32 +7861,32 @@ func TestPhp7(t *testing.T) { &stmt.UseList{ Position: &position.Position{ StartLine: 163, - EndLine: 163, - StartPos: 3663, - EndPos: 3671, + EndLine: 163, + StartPos: 3663, + EndPos: 3671, }, Uses: []node.Node{ &stmt.Use{ Position: &position.Position{ StartLine: 163, - EndLine: 163, - StartPos: 3668, - EndPos: 3670, + EndLine: 163, + StartPos: 3668, + EndPos: 3670, }, Use: &name.Name{ Position: &position.Position{ StartLine: 163, - EndLine: 163, - StartPos: 3668, - EndPos: 3670, + EndLine: 163, + StartPos: 3668, + EndPos: 3670, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 163, - EndLine: 163, - StartPos: 3668, - EndPos: 3670, + EndLine: 163, + StartPos: 3668, + EndPos: 3670, }, Value: "Foo", }, @@ -7839,32 +7898,32 @@ func TestPhp7(t *testing.T) { &stmt.UseList{ Position: &position.Position{ StartLine: 164, - EndLine: 164, - StartPos: 3675, - EndPos: 3690, + EndLine: 164, + StartPos: 3675, + EndPos: 3690, }, Uses: []node.Node{ &stmt.Use{ Position: &position.Position{ StartLine: 164, - EndLine: 164, - StartPos: 3680, - EndPos: 3689, + EndLine: 164, + StartPos: 3680, + EndPos: 3689, }, Use: &name.Name{ Position: &position.Position{ StartLine: 164, - EndLine: 164, - StartPos: 3680, - EndPos: 3682, + EndLine: 164, + StartPos: 3680, + EndPos: 3682, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 164, - EndLine: 164, - StartPos: 3680, - EndPos: 3682, + EndLine: 164, + StartPos: 3680, + EndPos: 3682, }, Value: "Foo", }, @@ -7873,9 +7932,9 @@ func TestPhp7(t *testing.T) { Alias: &node.Identifier{ Position: &position.Position{ StartLine: 164, - EndLine: 164, - StartPos: 3687, - EndPos: 3689, + EndLine: 164, + StartPos: 3687, + EndPos: 3689, }, Value: "Bar", }, @@ -7885,32 +7944,32 @@ func TestPhp7(t *testing.T) { &stmt.UseList{ Position: &position.Position{ StartLine: 165, - EndLine: 165, - StartPos: 3694, - EndPos: 3706, + EndLine: 165, + StartPos: 3694, + EndPos: 3706, }, Uses: []node.Node{ &stmt.Use{ Position: &position.Position{ StartLine: 165, - EndLine: 165, - StartPos: 3698, - EndPos: 3700, + EndLine: 165, + StartPos: 3698, + EndPos: 3700, }, Use: &name.Name{ Position: &position.Position{ StartLine: 165, - EndLine: 165, - StartPos: 3698, - EndPos: 3700, + EndLine: 165, + StartPos: 3698, + EndPos: 3700, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 165, - EndLine: 165, - StartPos: 3698, - EndPos: 3700, + EndLine: 165, + StartPos: 3698, + EndPos: 3700, }, Value: "Foo", }, @@ -7920,24 +7979,24 @@ func TestPhp7(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 165, - EndLine: 165, - StartPos: 3703, - EndPos: 3705, + EndLine: 165, + StartPos: 3703, + EndPos: 3705, }, Use: &name.Name{ Position: &position.Position{ StartLine: 165, - EndLine: 165, - StartPos: 3703, - EndPos: 3705, + EndLine: 165, + StartPos: 3703, + EndPos: 3705, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 165, - EndLine: 165, - StartPos: 3703, - EndPos: 3705, + EndLine: 165, + StartPos: 3703, + EndPos: 3705, }, Value: "Bar", }, @@ -7949,32 +8008,32 @@ func TestPhp7(t *testing.T) { &stmt.UseList{ Position: &position.Position{ StartLine: 166, - EndLine: 166, - StartPos: 3710, - EndPos: 3729, + EndLine: 166, + StartPos: 3710, + EndPos: 3729, }, Uses: []node.Node{ &stmt.Use{ Position: &position.Position{ StartLine: 166, - EndLine: 166, - StartPos: 3714, - EndPos: 3716, + EndLine: 166, + StartPos: 3714, + EndPos: 3716, }, Use: &name.Name{ Position: &position.Position{ StartLine: 166, - EndLine: 166, - StartPos: 3714, - EndPos: 3716, + EndLine: 166, + StartPos: 3714, + EndPos: 3716, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 166, - EndLine: 166, - StartPos: 3714, - EndPos: 3716, + EndLine: 166, + StartPos: 3714, + EndPos: 3716, }, Value: "Foo", }, @@ -7984,24 +8043,24 @@ func TestPhp7(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 166, - EndLine: 166, - StartPos: 3719, - EndPos: 3728, + EndLine: 166, + StartPos: 3719, + EndPos: 3728, }, Use: &name.Name{ Position: &position.Position{ StartLine: 166, - EndLine: 166, - StartPos: 3719, - EndPos: 3721, + EndLine: 166, + StartPos: 3719, + EndPos: 3721, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 166, - EndLine: 166, - StartPos: 3719, - EndPos: 3721, + EndLine: 166, + StartPos: 3719, + EndPos: 3721, }, Value: "Bar", }, @@ -8010,9 +8069,9 @@ func TestPhp7(t *testing.T) { Alias: &node.Identifier{ Position: &position.Position{ StartLine: 166, - EndLine: 166, - StartPos: 3726, - EndPos: 3728, + EndLine: 166, + StartPos: 3726, + EndPos: 3728, }, Value: "Baz", }, @@ -8022,16 +8081,16 @@ func TestPhp7(t *testing.T) { &stmt.UseList{ Position: &position.Position{ StartLine: 167, - EndLine: 167, - StartPos: 3733, - EndPos: 3755, + EndLine: 167, + StartPos: 3733, + EndPos: 3755, }, UseType: &node.Identifier{ Position: &position.Position{ StartLine: 167, - EndLine: 167, - StartPos: 3737, - EndPos: 3744, + EndLine: 167, + StartPos: 3737, + EndPos: 3744, }, Value: "function", }, @@ -8039,24 +8098,24 @@ func TestPhp7(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 167, - EndLine: 167, - StartPos: 3746, - EndPos: 3748, + EndLine: 167, + StartPos: 3746, + EndPos: 3748, }, Use: &name.Name{ Position: &position.Position{ StartLine: 167, - EndLine: 167, - StartPos: 3746, - EndPos: 3748, + EndLine: 167, + StartPos: 3746, + EndPos: 3748, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 167, - EndLine: 167, - StartPos: 3746, - EndPos: 3748, + EndLine: 167, + StartPos: 3746, + EndPos: 3748, }, Value: "Foo", }, @@ -8066,24 +8125,24 @@ func TestPhp7(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 167, - EndLine: 167, - StartPos: 3752, - EndPos: 3754, + EndLine: 167, + StartPos: 3752, + EndPos: 3754, }, Use: &name.Name{ Position: &position.Position{ StartLine: 167, - EndLine: 167, - StartPos: 3752, - EndPos: 3754, + EndLine: 167, + StartPos: 3752, + EndPos: 3754, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 167, - EndLine: 167, - StartPos: 3752, - EndPos: 3754, + EndLine: 167, + StartPos: 3752, + EndPos: 3754, }, Value: "Bar", }, @@ -8095,16 +8154,16 @@ func TestPhp7(t *testing.T) { &stmt.UseList{ Position: &position.Position{ StartLine: 168, - EndLine: 168, - StartPos: 3759, - EndPos: 3795, + EndLine: 168, + StartPos: 3759, + EndPos: 3795, }, UseType: &node.Identifier{ Position: &position.Position{ StartLine: 168, - EndLine: 168, - StartPos: 3763, - EndPos: 3770, + EndLine: 168, + StartPos: 3763, + EndPos: 3770, }, Value: "function", }, @@ -8112,24 +8171,24 @@ func TestPhp7(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 168, - EndLine: 168, - StartPos: 3772, - EndPos: 3781, + EndLine: 168, + StartPos: 3772, + EndPos: 3781, }, Use: &name.Name{ Position: &position.Position{ StartLine: 168, - EndLine: 168, - StartPos: 3772, - EndPos: 3774, + EndLine: 168, + StartPos: 3772, + EndPos: 3774, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 168, - EndLine: 168, - StartPos: 3772, - EndPos: 3774, + EndLine: 168, + StartPos: 3772, + EndPos: 3774, }, Value: "Foo", }, @@ -8138,9 +8197,9 @@ func TestPhp7(t *testing.T) { Alias: &node.Identifier{ Position: &position.Position{ StartLine: 168, - EndLine: 168, - StartPos: 3779, - EndPos: 3781, + EndLine: 168, + StartPos: 3779, + EndPos: 3781, }, Value: "foo", }, @@ -8148,24 +8207,24 @@ func TestPhp7(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 168, - EndLine: 168, - StartPos: 3785, - EndPos: 3794, + EndLine: 168, + StartPos: 3785, + EndPos: 3794, }, Use: &name.Name{ Position: &position.Position{ StartLine: 168, - EndLine: 168, - StartPos: 3785, - EndPos: 3787, + EndLine: 168, + StartPos: 3785, + EndPos: 3787, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 168, - EndLine: 168, - StartPos: 3785, - EndPos: 3787, + EndLine: 168, + StartPos: 3785, + EndPos: 3787, }, Value: "Bar", }, @@ -8174,9 +8233,9 @@ func TestPhp7(t *testing.T) { Alias: &node.Identifier{ Position: &position.Position{ StartLine: 168, - EndLine: 168, - StartPos: 3792, - EndPos: 3794, + EndLine: 168, + StartPos: 3792, + EndPos: 3794, }, Value: "bar", }, @@ -8186,16 +8245,16 @@ func TestPhp7(t *testing.T) { &stmt.UseList{ Position: &position.Position{ StartLine: 169, - EndLine: 169, - StartPos: 3799, - EndPos: 3818, + EndLine: 169, + StartPos: 3799, + EndPos: 3818, }, UseType: &node.Identifier{ Position: &position.Position{ StartLine: 169, - EndLine: 169, - StartPos: 3803, - EndPos: 3807, + EndLine: 169, + StartPos: 3803, + EndPos: 3807, }, Value: "const", }, @@ -8203,24 +8262,24 @@ func TestPhp7(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 169, - EndLine: 169, - StartPos: 3809, - EndPos: 3811, + EndLine: 169, + StartPos: 3809, + EndPos: 3811, }, Use: &name.Name{ Position: &position.Position{ StartLine: 169, - EndLine: 169, - StartPos: 3809, - EndPos: 3811, + EndLine: 169, + StartPos: 3809, + EndPos: 3811, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 169, - EndLine: 169, - StartPos: 3809, - EndPos: 3811, + EndLine: 169, + StartPos: 3809, + EndPos: 3811, }, Value: "Foo", }, @@ -8230,24 +8289,24 @@ func TestPhp7(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 169, - EndLine: 169, - StartPos: 3815, - EndPos: 3817, + EndLine: 169, + StartPos: 3815, + EndPos: 3817, }, Use: &name.Name{ Position: &position.Position{ StartLine: 169, - EndLine: 169, - StartPos: 3815, - EndPos: 3817, + EndLine: 169, + StartPos: 3815, + EndPos: 3817, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 169, - EndLine: 169, - StartPos: 3815, - EndPos: 3817, + EndLine: 169, + StartPos: 3815, + EndPos: 3817, }, Value: "Bar", }, @@ -8259,16 +8318,16 @@ func TestPhp7(t *testing.T) { &stmt.UseList{ Position: &position.Position{ StartLine: 170, - EndLine: 170, - StartPos: 3822, - EndPos: 3855, + EndLine: 170, + StartPos: 3822, + EndPos: 3855, }, UseType: &node.Identifier{ Position: &position.Position{ StartLine: 170, - EndLine: 170, - StartPos: 3826, - EndPos: 3830, + EndLine: 170, + StartPos: 3826, + EndPos: 3830, }, Value: "const", }, @@ -8276,24 +8335,24 @@ func TestPhp7(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 170, - EndLine: 170, - StartPos: 3832, - EndPos: 3841, + EndLine: 170, + StartPos: 3832, + EndPos: 3841, }, Use: &name.Name{ Position: &position.Position{ StartLine: 170, - EndLine: 170, - StartPos: 3832, - EndPos: 3834, + EndLine: 170, + StartPos: 3832, + EndPos: 3834, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 170, - EndLine: 170, - StartPos: 3832, - EndPos: 3834, + EndLine: 170, + StartPos: 3832, + EndPos: 3834, }, Value: "Foo", }, @@ -8302,9 +8361,9 @@ func TestPhp7(t *testing.T) { Alias: &node.Identifier{ Position: &position.Position{ StartLine: 170, - EndLine: 170, - StartPos: 3839, - EndPos: 3841, + EndLine: 170, + StartPos: 3839, + EndPos: 3841, }, Value: "foo", }, @@ -8312,24 +8371,24 @@ func TestPhp7(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 170, - EndLine: 170, - StartPos: 3845, - EndPos: 3854, + EndLine: 170, + StartPos: 3845, + EndPos: 3854, }, Use: &name.Name{ Position: &position.Position{ StartLine: 170, - EndLine: 170, - StartPos: 3845, - EndPos: 3847, + EndLine: 170, + StartPos: 3845, + EndPos: 3847, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 170, - EndLine: 170, - StartPos: 3845, - EndPos: 3847, + EndLine: 170, + StartPos: 3845, + EndPos: 3847, }, Value: "Bar", }, @@ -8338,9 +8397,9 @@ func TestPhp7(t *testing.T) { Alias: &node.Identifier{ Position: &position.Position{ StartLine: 170, - EndLine: 170, - StartPos: 3852, - EndPos: 3854, + EndLine: 170, + StartPos: 3852, + EndPos: 3854, }, Value: "bar", }, @@ -8350,24 +8409,24 @@ func TestPhp7(t *testing.T) { &stmt.GroupUse{ Position: &position.Position{ StartLine: 172, - EndLine: 172, - StartPos: 3860, - EndPos: 3879, + EndLine: 172, + StartPos: 3860, + EndPos: 3879, }, Prefix: &name.Name{ Position: &position.Position{ StartLine: 172, - EndLine: 172, - StartPos: 3865, - EndPos: 3867, + EndLine: 172, + StartPos: 3865, + EndPos: 3867, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 172, - EndLine: 172, - StartPos: 3865, - EndPos: 3867, + EndLine: 172, + StartPos: 3865, + EndPos: 3867, }, Value: "Foo", }, @@ -8377,24 +8436,24 @@ func TestPhp7(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 172, - EndLine: 172, - StartPos: 3870, - EndPos: 3872, + EndLine: 172, + StartPos: 3870, + EndPos: 3872, }, Use: &name.Name{ Position: &position.Position{ StartLine: 172, - EndLine: 172, - StartPos: 3870, - EndPos: 3872, + EndLine: 172, + StartPos: 3870, + EndPos: 3872, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 172, - EndLine: 172, - StartPos: 3870, - EndPos: 3872, + EndLine: 172, + StartPos: 3870, + EndPos: 3872, }, Value: "Bar", }, @@ -8404,24 +8463,24 @@ func TestPhp7(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 172, - EndLine: 172, - StartPos: 3875, - EndPos: 3877, + EndLine: 172, + StartPos: 3875, + EndPos: 3877, }, Use: &name.Name{ Position: &position.Position{ StartLine: 172, - EndLine: 172, - StartPos: 3875, - EndPos: 3877, + EndLine: 172, + StartPos: 3875, + EndPos: 3877, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 172, - EndLine: 172, - StartPos: 3875, - EndPos: 3877, + EndLine: 172, + StartPos: 3875, + EndPos: 3877, }, Value: "Baz", }, @@ -8433,24 +8492,24 @@ func TestPhp7(t *testing.T) { &stmt.GroupUse{ Position: &position.Position{ StartLine: 173, - EndLine: 173, - StartPos: 3883, - EndPos: 3909, + EndLine: 173, + StartPos: 3883, + EndPos: 3909, }, Prefix: &name.Name{ Position: &position.Position{ StartLine: 173, - EndLine: 173, - StartPos: 3887, - EndPos: 3889, + EndLine: 173, + StartPos: 3887, + EndPos: 3889, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 173, - EndLine: 173, - StartPos: 3887, - EndPos: 3889, + EndLine: 173, + StartPos: 3887, + EndPos: 3889, }, Value: "Foo", }, @@ -8460,24 +8519,24 @@ func TestPhp7(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 173, - EndLine: 173, - StartPos: 3892, - EndPos: 3894, + EndLine: 173, + StartPos: 3892, + EndPos: 3894, }, Use: &name.Name{ Position: &position.Position{ StartLine: 173, - EndLine: 173, - StartPos: 3892, - EndPos: 3894, + EndLine: 173, + StartPos: 3892, + EndPos: 3894, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 173, - EndLine: 173, - StartPos: 3892, - EndPos: 3894, + EndLine: 173, + StartPos: 3892, + EndPos: 3894, }, Value: "Bar", }, @@ -8487,24 +8546,24 @@ func TestPhp7(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 173, - EndLine: 173, - StartPos: 3897, - EndPos: 3907, + EndLine: 173, + StartPos: 3897, + EndPos: 3907, }, Use: &name.Name{ Position: &position.Position{ StartLine: 173, - EndLine: 173, - StartPos: 3897, - EndPos: 3899, + EndLine: 173, + StartPos: 3897, + EndPos: 3899, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 173, - EndLine: 173, - StartPos: 3897, - EndPos: 3899, + EndLine: 173, + StartPos: 3897, + EndPos: 3899, }, Value: "Baz", }, @@ -8513,9 +8572,9 @@ func TestPhp7(t *testing.T) { Alias: &node.Identifier{ Position: &position.Position{ StartLine: 173, - EndLine: 173, - StartPos: 3904, - EndPos: 3907, + EndLine: 173, + StartPos: 3904, + EndPos: 3907, }, Value: "quux", }, @@ -8525,33 +8584,33 @@ func TestPhp7(t *testing.T) { &stmt.GroupUse{ Position: &position.Position{ StartLine: 174, - EndLine: 174, - StartPos: 3913, - EndPos: 3940, + EndLine: 174, + StartPos: 3913, + EndPos: 3940, }, UseType: &node.Identifier{ Position: &position.Position{ StartLine: 174, - EndLine: 174, - StartPos: 3917, - EndPos: 3924, + EndLine: 174, + StartPos: 3917, + EndPos: 3924, }, Value: "function", }, Prefix: &name.Name{ Position: &position.Position{ StartLine: 174, - EndLine: 174, - StartPos: 3926, - EndPos: 3928, + EndLine: 174, + StartPos: 3926, + EndPos: 3928, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 174, - EndLine: 174, - StartPos: 3926, - EndPos: 3928, + EndLine: 174, + StartPos: 3926, + EndPos: 3928, }, Value: "Foo", }, @@ -8561,24 +8620,24 @@ func TestPhp7(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 174, - EndLine: 174, - StartPos: 3931, - EndPos: 3933, + EndLine: 174, + StartPos: 3931, + EndPos: 3933, }, Use: &name.Name{ Position: &position.Position{ StartLine: 174, - EndLine: 174, - StartPos: 3931, - EndPos: 3933, + EndLine: 174, + StartPos: 3931, + EndPos: 3933, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 174, - EndLine: 174, - StartPos: 3931, - EndPos: 3933, + EndLine: 174, + StartPos: 3931, + EndPos: 3933, }, Value: "Bar", }, @@ -8588,24 +8647,24 @@ func TestPhp7(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 174, - EndLine: 174, - StartPos: 3936, - EndPos: 3938, + EndLine: 174, + StartPos: 3936, + EndPos: 3938, }, Use: &name.Name{ Position: &position.Position{ StartLine: 174, - EndLine: 174, - StartPos: 3936, - EndPos: 3938, + EndLine: 174, + StartPos: 3936, + EndPos: 3938, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 174, - EndLine: 174, - StartPos: 3936, - EndPos: 3938, + EndLine: 174, + StartPos: 3936, + EndPos: 3938, }, Value: "Baz", }, @@ -8617,33 +8676,33 @@ func TestPhp7(t *testing.T) { &stmt.GroupUse{ Position: &position.Position{ StartLine: 175, - EndLine: 175, - StartPos: 3944, - EndPos: 3969, + EndLine: 175, + StartPos: 3944, + EndPos: 3969, }, UseType: &node.Identifier{ Position: &position.Position{ StartLine: 175, - EndLine: 175, - StartPos: 3948, - EndPos: 3952, + EndLine: 175, + StartPos: 3948, + EndPos: 3952, }, Value: "const", }, Prefix: &name.Name{ Position: &position.Position{ StartLine: 175, - EndLine: 175, - StartPos: 3955, - EndPos: 3957, + EndLine: 175, + StartPos: 3955, + EndPos: 3957, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 175, - EndLine: 175, - StartPos: 3955, - EndPos: 3957, + EndLine: 175, + StartPos: 3955, + EndPos: 3957, }, Value: "Foo", }, @@ -8653,24 +8712,24 @@ func TestPhp7(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 175, - EndLine: 175, - StartPos: 3960, - EndPos: 3962, + EndLine: 175, + StartPos: 3960, + EndPos: 3962, }, Use: &name.Name{ Position: &position.Position{ StartLine: 175, - EndLine: 175, - StartPos: 3960, - EndPos: 3962, + EndLine: 175, + StartPos: 3960, + EndPos: 3962, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 175, - EndLine: 175, - StartPos: 3960, - EndPos: 3962, + EndLine: 175, + StartPos: 3960, + EndPos: 3962, }, Value: "Bar", }, @@ -8680,24 +8739,24 @@ func TestPhp7(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 175, - EndLine: 175, - StartPos: 3965, - EndPos: 3967, + EndLine: 175, + StartPos: 3965, + EndPos: 3967, }, Use: &name.Name{ Position: &position.Position{ StartLine: 175, - EndLine: 175, - StartPos: 3965, - EndPos: 3967, + EndLine: 175, + StartPos: 3965, + EndPos: 3967, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 175, - EndLine: 175, - StartPos: 3965, - EndPos: 3967, + EndLine: 175, + StartPos: 3965, + EndPos: 3967, }, Value: "Baz", }, @@ -8709,24 +8768,24 @@ func TestPhp7(t *testing.T) { &stmt.GroupUse{ Position: &position.Position{ StartLine: 176, - EndLine: 176, - StartPos: 3973, - EndPos: 4006, + EndLine: 176, + StartPos: 3973, + EndPos: 4006, }, Prefix: &name.Name{ Position: &position.Position{ StartLine: 176, - EndLine: 176, - StartPos: 3977, - EndPos: 3979, + EndLine: 176, + StartPos: 3977, + EndPos: 3979, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 176, - EndLine: 176, - StartPos: 3977, - EndPos: 3979, + EndLine: 176, + StartPos: 3977, + EndPos: 3979, }, Value: "Foo", }, @@ -8736,33 +8795,33 @@ func TestPhp7(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 176, - EndLine: 176, - StartPos: 3988, - EndPos: 3990, + EndLine: 176, + StartPos: 3988, + EndPos: 3990, }, UseType: &node.Identifier{ Position: &position.Position{ StartLine: 176, - EndLine: 176, - StartPos: 3982, - EndPos: 3986, + EndLine: 176, + StartPos: 3982, + EndPos: 3986, }, Value: "const", }, Use: &name.Name{ Position: &position.Position{ StartLine: 176, - EndLine: 176, - StartPos: 3988, - EndPos: 3990, + EndLine: 176, + StartPos: 3988, + EndPos: 3990, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 176, - EndLine: 176, - StartPos: 3988, - EndPos: 3990, + EndLine: 176, + StartPos: 3988, + EndPos: 3990, }, Value: "Bar", }, @@ -8772,33 +8831,33 @@ func TestPhp7(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 176, - EndLine: 176, - StartPos: 4002, - EndPos: 4004, + EndLine: 176, + StartPos: 4002, + EndPos: 4004, }, UseType: &node.Identifier{ Position: &position.Position{ StartLine: 176, - EndLine: 176, - StartPos: 3993, - EndPos: 4000, + EndLine: 176, + StartPos: 3993, + EndPos: 4000, }, Value: "function", }, Use: &name.Name{ Position: &position.Position{ StartLine: 176, - EndLine: 176, - StartPos: 4002, - EndPos: 4004, + EndLine: 176, + StartPos: 4002, + EndPos: 4004, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 176, - EndLine: 176, - StartPos: 4002, - EndPos: 4004, + EndLine: 176, + StartPos: 4002, + EndPos: 4004, }, Value: "Baz", }, @@ -8810,30 +8869,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 178, - EndLine: 178, - StartPos: 4011, - EndPos: 4016, + EndLine: 178, + StartPos: 4011, + EndPos: 4016, }, Expr: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 178, - EndLine: 178, - StartPos: 4011, - EndPos: 4015, + EndLine: 178, + StartPos: 4011, + EndPos: 4015, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 178, - EndLine: 178, - StartPos: 4011, - EndPos: 4012, + EndLine: 178, + StartPos: 4011, + EndPos: 4012, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 178, - EndLine: 178, - StartPos: 4011, - EndPos: 4012, + EndLine: 178, + StartPos: 4011, + EndPos: 4012, }, Value: "a", }, @@ -8841,9 +8900,9 @@ func TestPhp7(t *testing.T) { Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 178, - EndLine: 178, - StartPos: 4014, - EndPos: 4014, + EndLine: 178, + StartPos: 4014, + EndPos: 4014, }, Value: "1", }, @@ -8852,37 +8911,37 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 179, - EndLine: 179, - StartPos: 4020, - EndPos: 4028, + EndLine: 179, + StartPos: 4020, + EndPos: 4028, }, Expr: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 179, - EndLine: 179, - StartPos: 4020, - EndPos: 4027, + EndLine: 179, + StartPos: 4020, + EndPos: 4027, }, Variable: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 179, - EndLine: 179, - StartPos: 4020, - EndPos: 4024, + EndLine: 179, + StartPos: 4020, + EndPos: 4024, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 179, - EndLine: 179, - StartPos: 4020, - EndPos: 4021, + EndLine: 179, + StartPos: 4020, + EndPos: 4021, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 179, - EndLine: 179, - StartPos: 4020, - EndPos: 4021, + EndLine: 179, + StartPos: 4020, + EndPos: 4021, }, Value: "a", }, @@ -8890,9 +8949,9 @@ func TestPhp7(t *testing.T) { Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 179, - EndLine: 179, - StartPos: 4023, - EndPos: 4023, + EndLine: 179, + StartPos: 4023, + EndPos: 4023, }, Value: "1", }, @@ -8900,9 +8959,9 @@ func TestPhp7(t *testing.T) { Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 179, - EndLine: 179, - StartPos: 4026, - EndPos: 4026, + EndLine: 179, + StartPos: 4026, + EndPos: 4026, }, Value: "2", }, @@ -8911,48 +8970,49 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 180, - EndLine: 180, - StartPos: 4032, - EndPos: 4039, + EndLine: 180, + StartPos: 4032, + EndPos: 4039, }, Expr: &expr.Array{ Position: &position.Position{ StartLine: 180, - EndLine: 180, - StartPos: 4032, - EndPos: 4038, + EndLine: 180, + StartPos: 4032, + EndPos: 4038, + }, + Items: []node.Node{ }, - Items: []node.Node{}, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 181, - EndLine: 181, - StartPos: 4043, - EndPos: 4051, + EndLine: 181, + StartPos: 4043, + EndPos: 4051, }, Expr: &expr.Array{ Position: &position.Position{ StartLine: 181, - EndLine: 181, - StartPos: 4043, - EndPos: 4050, + EndLine: 181, + StartPos: 4043, + EndPos: 4050, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 181, - EndLine: 181, - StartPos: 4049, - EndPos: 4049, + EndLine: 181, + StartPos: 4049, + EndPos: 4049, }, Val: &scalar.Lnumber{ Position: &position.Position{ StartLine: 181, - EndLine: 181, - StartPos: 4049, - EndPos: 4049, + EndLine: 181, + StartPos: 4049, + EndPos: 4049, }, Value: "1", }, @@ -8963,40 +9023,40 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 182, - EndLine: 182, - StartPos: 4055, - EndPos: 4072, + EndLine: 182, + StartPos: 4055, + EndPos: 4072, }, Expr: &expr.Array{ Position: &position.Position{ StartLine: 182, - EndLine: 182, - StartPos: 4055, - EndPos: 4071, + EndLine: 182, + StartPos: 4055, + EndPos: 4071, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 182, - EndLine: 182, - StartPos: 4061, - EndPos: 4064, + EndLine: 182, + StartPos: 4061, + EndPos: 4064, }, Key: &scalar.Lnumber{ Position: &position.Position{ StartLine: 182, - EndLine: 182, - StartPos: 4061, - EndPos: 4061, + EndLine: 182, + StartPos: 4061, + EndPos: 4061, }, Value: "1", }, Val: &scalar.Lnumber{ Position: &position.Position{ StartLine: 182, - EndLine: 182, - StartPos: 4064, - EndPos: 4064, + EndLine: 182, + StartPos: 4064, + EndPos: 4064, }, Value: "1", }, @@ -9004,67 +9064,68 @@ func TestPhp7(t *testing.T) { &expr.ArrayItem{ Position: &position.Position{ StartLine: 182, - EndLine: 182, - StartPos: 4067, - EndPos: 4069, + EndLine: 182, + StartPos: 4067, + EndPos: 4069, }, Val: &expr.Reference{ Position: &position.Position{ StartLine: 182, - EndLine: 182, - StartPos: 4067, - EndPos: 4069, + EndLine: 182, + StartPos: 4067, + EndPos: 4069, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 182, - EndLine: 182, - StartPos: 4068, - EndPos: 4069, + EndLine: 182, + StartPos: 4068, + EndPos: 4069, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 182, - EndLine: 182, - StartPos: 4068, - EndPos: 4069, + EndLine: 182, + StartPos: 4068, + EndPos: 4069, }, Value: "b", }, }, }, }, - &expr.ArrayItem{}, + &expr.ArrayItem{ + }, }, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 183, - EndLine: 183, - StartPos: 4076, - EndPos: 4079, + EndLine: 183, + StartPos: 4076, + EndPos: 4079, }, Expr: &expr.BitwiseNot{ Position: &position.Position{ StartLine: 183, - EndLine: 183, - StartPos: 4076, - EndPos: 4078, + EndLine: 183, + StartPos: 4076, + EndPos: 4078, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 183, - EndLine: 183, - StartPos: 4077, - EndPos: 4078, + EndLine: 183, + StartPos: 4077, + EndPos: 4078, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 183, - EndLine: 183, - StartPos: 4077, - EndPos: 4078, + EndLine: 183, + StartPos: 4077, + EndPos: 4078, }, Value: "a", }, @@ -9074,30 +9135,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 184, - EndLine: 184, - StartPos: 4083, - EndPos: 4086, + EndLine: 184, + StartPos: 4083, + EndPos: 4086, }, Expr: &expr.BooleanNot{ Position: &position.Position{ StartLine: 184, - EndLine: 184, - StartPos: 4083, - EndPos: 4085, + EndLine: 184, + StartPos: 4083, + EndPos: 4085, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 184, - EndLine: 184, - StartPos: 4084, - EndPos: 4085, + EndLine: 184, + StartPos: 4084, + EndPos: 4085, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 184, - EndLine: 184, - StartPos: 4084, - EndPos: 4085, + EndLine: 184, + StartPos: 4084, + EndPos: 4085, }, Value: "a", }, @@ -9107,31 +9168,31 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 186, - EndLine: 186, - StartPos: 4091, - EndPos: 4099, + EndLine: 186, + StartPos: 4091, + EndPos: 4099, }, Expr: &expr.ClassConstFetch{ Position: &position.Position{ StartLine: 186, - EndLine: 186, - StartPos: 4091, - EndPos: 4098, + EndLine: 186, + StartPos: 4091, + EndPos: 4098, }, Class: &name.Name{ Position: &position.Position{ StartLine: 186, - EndLine: 186, - StartPos: 4091, - EndPos: 4093, + EndLine: 186, + StartPos: 4091, + EndPos: 4093, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 186, - EndLine: 186, - StartPos: 4091, - EndPos: 4093, + EndLine: 186, + StartPos: 4091, + EndPos: 4093, }, Value: "Foo", }, @@ -9140,9 +9201,9 @@ func TestPhp7(t *testing.T) { ConstantName: &node.Identifier{ Position: &position.Position{ StartLine: 186, - EndLine: 186, - StartPos: 4096, - EndPos: 4098, + EndLine: 186, + StartPos: 4096, + EndPos: 4098, }, Value: "Bar", }, @@ -9151,30 +9212,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 187, - EndLine: 187, - StartPos: 4103, - EndPos: 4112, + EndLine: 187, + StartPos: 4103, + EndPos: 4112, }, Expr: &expr.ClassConstFetch{ Position: &position.Position{ StartLine: 187, - EndLine: 187, - StartPos: 4103, - EndPos: 4111, + EndLine: 187, + StartPos: 4103, + EndPos: 4111, }, Class: &expr.Variable{ Position: &position.Position{ StartLine: 187, - EndLine: 187, - StartPos: 4103, - EndPos: 4106, + EndLine: 187, + StartPos: 4103, + EndPos: 4106, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 187, - EndLine: 187, - StartPos: 4103, - EndPos: 4106, + EndLine: 187, + StartPos: 4103, + EndPos: 4106, }, Value: "foo", }, @@ -9182,9 +9243,9 @@ func TestPhp7(t *testing.T) { ConstantName: &node.Identifier{ Position: &position.Position{ StartLine: 187, - EndLine: 187, - StartPos: 4109, - EndPos: 4111, + EndLine: 187, + StartPos: 4109, + EndPos: 4111, }, Value: "Bar", }, @@ -9193,30 +9254,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 188, - EndLine: 188, - StartPos: 4116, - EndPos: 4125, + EndLine: 188, + StartPos: 4116, + EndPos: 4125, }, Expr: &expr.Clone{ Position: &position.Position{ StartLine: 188, - EndLine: 188, - StartPos: 4116, - EndPos: 4123, + EndLine: 188, + StartPos: 4116, + EndPos: 4123, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 188, - EndLine: 188, - StartPos: 4122, - EndPos: 4123, + EndLine: 188, + StartPos: 4122, + EndPos: 4123, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 188, - EndLine: 188, - StartPos: 4122, - EndPos: 4123, + EndLine: 188, + StartPos: 4122, + EndPos: 4123, }, Value: "a", }, @@ -9226,30 +9287,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 189, - EndLine: 189, - StartPos: 4129, - EndPos: 4137, + EndLine: 189, + StartPos: 4129, + EndPos: 4137, }, Expr: &expr.Clone{ Position: &position.Position{ StartLine: 189, - EndLine: 189, - StartPos: 4129, - EndPos: 4136, + EndLine: 189, + StartPos: 4129, + EndPos: 4136, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 189, - EndLine: 189, - StartPos: 4135, - EndPos: 4136, + EndLine: 189, + StartPos: 4135, + EndPos: 4136, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 189, - EndLine: 189, - StartPos: 4135, - EndPos: 4136, + EndLine: 189, + StartPos: 4135, + EndPos: 4136, }, Value: "a", }, @@ -9259,63 +9320,64 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 190, - EndLine: 190, - StartPos: 4141, - EndPos: 4153, + EndLine: 190, + StartPos: 4141, + EndPos: 4153, }, Expr: &expr.Closure{ Position: &position.Position{ StartLine: 190, - EndLine: 190, - StartPos: 4141, - EndPos: 4152, + EndLine: 190, + StartPos: 4141, + EndPos: 4152, }, - ReturnsRef: false, - Static: false, + ReturnsRef: false, + Static: false, PhpDocComment: "", - Stmts: []node.Node{}, + Stmts: []node.Node{ + }, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 191, - EndLine: 191, - StartPos: 4157, - EndPos: 4190, + EndLine: 191, + StartPos: 4157, + EndPos: 4190, }, Expr: &expr.Closure{ Position: &position.Position{ StartLine: 191, - EndLine: 191, - StartPos: 4157, - EndPos: 4189, + EndLine: 191, + StartPos: 4157, + EndPos: 4189, }, - Static: false, PhpDocComment: "", - ReturnsRef: false, + ReturnsRef: false, + Static: false, Params: []node.Node{ &node.Parameter{ Position: &position.Position{ StartLine: 191, - EndLine: 191, - StartPos: 4166, - EndPos: 4167, + EndLine: 191, + StartPos: 4166, + EndPos: 4167, }, - ByRef: false, + ByRef: false, Variadic: false, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 191, - EndLine: 191, - StartPos: 4166, - EndPos: 4167, + EndLine: 191, + StartPos: 4166, + EndPos: 4167, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 191, - EndLine: 191, - StartPos: 4166, - EndPos: 4167, + EndLine: 191, + StartPos: 4166, + EndPos: 4167, }, Value: "a", }, @@ -9324,25 +9386,25 @@ func TestPhp7(t *testing.T) { &node.Parameter{ Position: &position.Position{ StartLine: 191, - EndLine: 191, - StartPos: 4170, - EndPos: 4171, + EndLine: 191, + StartPos: 4170, + EndPos: 4171, }, - ByRef: false, + ByRef: false, Variadic: false, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 191, - EndLine: 191, - StartPos: 4170, - EndPos: 4171, + EndLine: 191, + StartPos: 4170, + EndPos: 4171, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 191, - EndLine: 191, - StartPos: 4170, - EndPos: 4171, + EndLine: 191, + StartPos: 4170, + EndPos: 4171, }, Value: "b", }, @@ -9352,24 +9414,24 @@ func TestPhp7(t *testing.T) { ClosureUse: &expr.ClosureUse{ Position: &position.Position{ StartLine: 191, - EndLine: 191, - StartPos: 4174, - EndPos: 4186, + EndLine: 191, + StartPos: 4174, + EndPos: 4186, }, Uses: []node.Node{ &expr.Variable{ Position: &position.Position{ StartLine: 191, - EndLine: 191, - StartPos: 4179, - EndPos: 4180, + EndLine: 191, + StartPos: 4179, + EndPos: 4180, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 191, - EndLine: 191, - StartPos: 4179, - EndPos: 4180, + EndLine: 191, + StartPos: 4179, + EndPos: 4180, }, Value: "c", }, @@ -9377,23 +9439,23 @@ func TestPhp7(t *testing.T) { &expr.Reference{ Position: &position.Position{ StartLine: 191, - EndLine: 191, - StartPos: 4183, - EndPos: 4185, + EndLine: 191, + StartPos: 4183, + EndPos: 4185, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 191, - EndLine: 191, - StartPos: 4184, - EndPos: 4185, + EndLine: 191, + StartPos: 4184, + EndPos: 4185, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 191, - EndLine: 191, - StartPos: 4184, - EndPos: 4185, + EndLine: 191, + StartPos: 4184, + EndPos: 4185, }, Value: "d", }, @@ -9401,76 +9463,78 @@ func TestPhp7(t *testing.T) { }, }, }, - Stmts: []node.Node{}, + Stmts: []node.Node{ + }, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 192, - EndLine: 192, - StartPos: 4194, - EndPos: 4213, + EndLine: 192, + StartPos: 4194, + EndPos: 4213, }, Expr: &expr.Closure{ Position: &position.Position{ StartLine: 192, - EndLine: 192, - StartPos: 4194, - EndPos: 4212, + EndLine: 192, + StartPos: 4194, + EndPos: 4212, }, - Static: false, + ReturnsRef: false, + Static: false, PhpDocComment: "", - ReturnsRef: false, ReturnType: &name.Name{ Position: &position.Position{ StartLine: 192, - EndLine: 192, - StartPos: 4206, - EndPos: 4209, + EndLine: 192, + StartPos: 4206, + EndPos: 4209, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 192, - EndLine: 192, - StartPos: 4206, - EndPos: 4209, + EndLine: 192, + StartPos: 4206, + EndPos: 4209, }, Value: "void", }, }, }, - Stmts: []node.Node{}, + Stmts: []node.Node{ + }, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 193, - EndLine: 193, - StartPos: 4217, - EndPos: 4220, + EndLine: 193, + StartPos: 4217, + EndPos: 4220, }, Expr: &expr.ConstFetch{ Position: &position.Position{ StartLine: 193, - EndLine: 193, - StartPos: 4217, - EndPos: 4219, + EndLine: 193, + StartPos: 4217, + EndPos: 4219, }, Constant: &name.Name{ Position: &position.Position{ StartLine: 193, - EndLine: 193, - StartPos: 4217, - EndPos: 4219, + EndLine: 193, + StartPos: 4217, + EndPos: 4219, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 193, - EndLine: 193, - StartPos: 4217, - EndPos: 4219, + EndLine: 193, + StartPos: 4217, + EndPos: 4219, }, Value: "foo", }, @@ -9481,31 +9545,31 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 194, - EndLine: 194, - StartPos: 4224, - EndPos: 4237, + EndLine: 194, + StartPos: 4224, + EndPos: 4237, }, Expr: &expr.ConstFetch{ Position: &position.Position{ StartLine: 194, - EndLine: 194, - StartPos: 4224, - EndPos: 4236, + EndLine: 194, + StartPos: 4224, + EndPos: 4236, }, Constant: &name.Relative{ Position: &position.Position{ StartLine: 194, - EndLine: 194, - StartPos: 4224, - EndPos: 4236, + EndLine: 194, + StartPos: 4224, + EndPos: 4236, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 194, - EndLine: 194, - StartPos: 4234, - EndPos: 4236, + EndLine: 194, + StartPos: 4234, + EndPos: 4236, }, Value: "foo", }, @@ -9516,31 +9580,31 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 195, - EndLine: 195, - StartPos: 4241, - EndPos: 4245, + EndLine: 195, + StartPos: 4241, + EndPos: 4245, }, Expr: &expr.ConstFetch{ Position: &position.Position{ StartLine: 195, - EndLine: 195, - StartPos: 4241, - EndPos: 4244, + EndLine: 195, + StartPos: 4241, + EndPos: 4244, }, Constant: &name.FullyQualified{ Position: &position.Position{ StartLine: 195, - EndLine: 195, - StartPos: 4241, - EndPos: 4244, + EndLine: 195, + StartPos: 4241, + EndPos: 4244, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 195, - EndLine: 195, - StartPos: 4242, - EndPos: 4244, + EndLine: 195, + StartPos: 4242, + EndPos: 4244, }, Value: "foo", }, @@ -9551,30 +9615,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 197, - EndLine: 197, - StartPos: 4250, - EndPos: 4259, + EndLine: 197, + StartPos: 4250, + EndPos: 4259, }, Expr: &expr.Empty{ Position: &position.Position{ StartLine: 197, - EndLine: 197, - StartPos: 4250, - EndPos: 4258, + EndLine: 197, + StartPos: 4250, + EndPos: 4258, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 197, - EndLine: 197, - StartPos: 4256, - EndPos: 4257, + EndLine: 197, + StartPos: 4256, + EndPos: 4257, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 197, - EndLine: 197, - StartPos: 4256, - EndPos: 4257, + EndLine: 197, + StartPos: 4256, + EndPos: 4257, }, Value: "a", }, @@ -9584,30 +9648,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 198, - EndLine: 198, - StartPos: 4263, - EndPos: 4266, + EndLine: 198, + StartPos: 4263, + EndPos: 4266, }, Expr: &expr.ErrorSuppress{ Position: &position.Position{ StartLine: 198, - EndLine: 198, - StartPos: 4263, - EndPos: 4265, + EndLine: 198, + StartPos: 4263, + EndPos: 4265, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 198, - EndLine: 198, - StartPos: 4264, - EndPos: 4265, + EndLine: 198, + StartPos: 4264, + EndPos: 4265, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 198, - EndLine: 198, - StartPos: 4264, - EndPos: 4265, + EndLine: 198, + StartPos: 4264, + EndPos: 4265, }, Value: "a", }, @@ -9617,30 +9681,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 199, - EndLine: 199, - StartPos: 4270, - EndPos: 4278, + EndLine: 199, + StartPos: 4270, + EndPos: 4278, }, Expr: &expr.Eval{ Position: &position.Position{ StartLine: 199, - EndLine: 199, - StartPos: 4270, - EndPos: 4277, + EndLine: 199, + StartPos: 4270, + EndPos: 4277, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 199, - EndLine: 199, - StartPos: 4275, - EndPos: 4276, + EndLine: 199, + StartPos: 4275, + EndPos: 4276, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 199, - EndLine: 199, - StartPos: 4275, - EndPos: 4276, + EndLine: 199, + StartPos: 4275, + EndPos: 4276, }, Value: "a", }, @@ -9650,46 +9714,46 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 200, - EndLine: 200, - StartPos: 4282, - EndPos: 4286, + EndLine: 200, + StartPos: 4282, + EndPos: 4286, }, Expr: &expr.Exit{ Position: &position.Position{ StartLine: 200, - EndLine: 200, - StartPos: 4282, - EndPos: 4285, + EndLine: 200, + StartPos: 4282, + EndPos: 4285, }, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 201, - EndLine: 201, - StartPos: 4290, - EndPos: 4298, + EndLine: 201, + StartPos: 4290, + EndPos: 4298, }, Expr: &expr.Exit{ Position: &position.Position{ StartLine: 201, - EndLine: 201, - StartPos: 4290, - EndPos: 4297, + EndLine: 201, + StartPos: 4290, + EndPos: 4297, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 201, - EndLine: 201, - StartPos: 4295, - EndPos: 4296, + EndLine: 201, + StartPos: 4295, + EndPos: 4296, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 201, - EndLine: 201, - StartPos: 4295, - EndPos: 4296, + EndLine: 201, + StartPos: 4295, + EndPos: 4296, }, Value: "a", }, @@ -9699,46 +9763,46 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 202, - EndLine: 202, - StartPos: 4302, - EndPos: 4305, + EndLine: 202, + StartPos: 4302, + EndPos: 4305, }, Expr: &expr.Die{ Position: &position.Position{ StartLine: 202, - EndLine: 202, - StartPos: 4302, - EndPos: 4304, + EndLine: 202, + StartPos: 4302, + EndPos: 4304, }, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 203, - EndLine: 203, - StartPos: 4309, - EndPos: 4316, + EndLine: 203, + StartPos: 4309, + EndPos: 4316, }, Expr: &expr.Die{ Position: &position.Position{ StartLine: 203, - EndLine: 203, - StartPos: 4309, - EndPos: 4315, + EndLine: 203, + StartPos: 4309, + EndPos: 4315, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 203, - EndLine: 203, - StartPos: 4313, - EndPos: 4314, + EndLine: 203, + StartPos: 4313, + EndPos: 4314, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 203, - EndLine: 203, - StartPos: 4313, - EndPos: 4314, + EndLine: 203, + StartPos: 4313, + EndPos: 4314, }, Value: "a", }, @@ -9748,31 +9812,31 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 204, - EndLine: 204, - StartPos: 4320, - EndPos: 4325, + EndLine: 204, + StartPos: 4320, + EndPos: 4325, }, Expr: &expr.FunctionCall{ Position: &position.Position{ StartLine: 204, - EndLine: 204, - StartPos: 4320, - EndPos: 4324, + EndLine: 204, + StartPos: 4320, + EndPos: 4324, }, Function: &name.Name{ Position: &position.Position{ StartLine: 204, - EndLine: 204, - StartPos: 4320, - EndPos: 4322, + EndLine: 204, + StartPos: 4320, + EndPos: 4322, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 204, - EndLine: 204, - StartPos: 4320, - EndPos: 4322, + EndLine: 204, + StartPos: 4320, + EndPos: 4322, }, Value: "foo", }, @@ -9781,9 +9845,9 @@ func TestPhp7(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 204, - EndLine: 204, - StartPos: 4323, - EndPos: 4324, + EndLine: 204, + StartPos: 4323, + EndPos: 4324, }, }, }, @@ -9791,31 +9855,31 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 205, - EndLine: 205, - StartPos: 4329, - EndPos: 4344, + EndLine: 205, + StartPos: 4329, + EndPos: 4344, }, Expr: &expr.FunctionCall{ Position: &position.Position{ StartLine: 205, - EndLine: 205, - StartPos: 4329, - EndPos: 4343, + EndLine: 205, + StartPos: 4329, + EndPos: 4343, }, Function: &name.Relative{ Position: &position.Position{ StartLine: 205, - EndLine: 205, - StartPos: 4329, - EndPos: 4341, + EndLine: 205, + StartPos: 4329, + EndPos: 4341, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 205, - EndLine: 205, - StartPos: 4339, - EndPos: 4341, + EndLine: 205, + StartPos: 4339, + EndPos: 4341, }, Value: "foo", }, @@ -9824,9 +9888,9 @@ func TestPhp7(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 205, - EndLine: 205, - StartPos: 4342, - EndPos: 4343, + EndLine: 205, + StartPos: 4342, + EndPos: 4343, }, }, }, @@ -9834,31 +9898,31 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 206, - EndLine: 206, - StartPos: 4348, - EndPos: 4354, + EndLine: 206, + StartPos: 4348, + EndPos: 4354, }, Expr: &expr.FunctionCall{ Position: &position.Position{ StartLine: 206, - EndLine: 206, - StartPos: 4348, - EndPos: 4353, + EndLine: 206, + StartPos: 4348, + EndPos: 4353, }, Function: &name.FullyQualified{ Position: &position.Position{ StartLine: 206, - EndLine: 206, - StartPos: 4348, - EndPos: 4351, + EndLine: 206, + StartPos: 4348, + EndPos: 4351, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 206, - EndLine: 206, - StartPos: 4349, - EndPos: 4351, + EndLine: 206, + StartPos: 4349, + EndPos: 4351, }, Value: "foo", }, @@ -9867,9 +9931,9 @@ func TestPhp7(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 206, - EndLine: 206, - StartPos: 4352, - EndPos: 4353, + EndLine: 206, + StartPos: 4352, + EndPos: 4353, }, }, }, @@ -9877,30 +9941,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 207, - EndLine: 207, - StartPos: 4358, - EndPos: 4364, + EndLine: 207, + StartPos: 4358, + EndPos: 4364, }, Expr: &expr.FunctionCall{ Position: &position.Position{ StartLine: 207, - EndLine: 207, - StartPos: 4358, - EndPos: 4363, + EndLine: 207, + StartPos: 4358, + EndPos: 4363, }, Function: &expr.Variable{ Position: &position.Position{ StartLine: 207, - EndLine: 207, - StartPos: 4358, - EndPos: 4361, + EndLine: 207, + StartPos: 4358, + EndPos: 4361, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 207, - EndLine: 207, - StartPos: 4358, - EndPos: 4361, + EndLine: 207, + StartPos: 4358, + EndPos: 4361, }, Value: "foo", }, @@ -9908,9 +9972,9 @@ func TestPhp7(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 207, - EndLine: 207, - StartPos: 4362, - EndPos: 4363, + EndLine: 207, + StartPos: 4362, + EndPos: 4363, }, }, }, @@ -9918,30 +9982,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 209, - EndLine: 209, - StartPos: 4369, - EndPos: 4373, + EndLine: 209, + StartPos: 4369, + EndPos: 4373, }, Expr: &expr.PostDec{ Position: &position.Position{ StartLine: 209, - EndLine: 209, - StartPos: 4369, - EndPos: 4372, + EndLine: 209, + StartPos: 4369, + EndPos: 4372, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 209, - EndLine: 209, - StartPos: 4369, - EndPos: 4370, + EndLine: 209, + StartPos: 4369, + EndPos: 4370, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 209, - EndLine: 209, - StartPos: 4369, - EndPos: 4370, + EndLine: 209, + StartPos: 4369, + EndPos: 4370, }, Value: "a", }, @@ -9951,30 +10015,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 210, - EndLine: 210, - StartPos: 4377, - EndPos: 4381, + EndLine: 210, + StartPos: 4377, + EndPos: 4381, }, Expr: &expr.PostInc{ Position: &position.Position{ StartLine: 210, - EndLine: 210, - StartPos: 4377, - EndPos: 4380, + EndLine: 210, + StartPos: 4377, + EndPos: 4380, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 210, - EndLine: 210, - StartPos: 4377, - EndPos: 4378, + EndLine: 210, + StartPos: 4377, + EndPos: 4378, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 210, - EndLine: 210, - StartPos: 4377, - EndPos: 4378, + EndLine: 210, + StartPos: 4377, + EndPos: 4378, }, Value: "a", }, @@ -9984,30 +10048,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 211, - EndLine: 211, - StartPos: 4385, - EndPos: 4389, + EndLine: 211, + StartPos: 4385, + EndPos: 4389, }, Expr: &expr.PreDec{ Position: &position.Position{ StartLine: 211, - EndLine: 211, - StartPos: 4385, - EndPos: 4388, + EndLine: 211, + StartPos: 4385, + EndPos: 4388, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 211, - EndLine: 211, - StartPos: 4387, - EndPos: 4388, + EndLine: 211, + StartPos: 4387, + EndPos: 4388, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 211, - EndLine: 211, - StartPos: 4387, - EndPos: 4388, + EndLine: 211, + StartPos: 4387, + EndPos: 4388, }, Value: "a", }, @@ -10017,30 +10081,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 212, - EndLine: 212, - StartPos: 4393, - EndPos: 4397, + EndLine: 212, + StartPos: 4393, + EndPos: 4397, }, Expr: &expr.PreInc{ Position: &position.Position{ StartLine: 212, - EndLine: 212, - StartPos: 4393, - EndPos: 4396, + EndLine: 212, + StartPos: 4393, + EndPos: 4396, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 212, - EndLine: 212, - StartPos: 4395, - EndPos: 4396, + EndLine: 212, + StartPos: 4395, + EndPos: 4396, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 212, - EndLine: 212, - StartPos: 4395, - EndPos: 4396, + EndLine: 212, + StartPos: 4395, + EndPos: 4396, }, Value: "a", }, @@ -10050,30 +10114,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 214, - EndLine: 214, - StartPos: 4402, - EndPos: 4412, + EndLine: 214, + StartPos: 4402, + EndPos: 4412, }, Expr: &expr.Include{ Position: &position.Position{ StartLine: 214, - EndLine: 214, - StartPos: 4402, - EndPos: 4411, + EndLine: 214, + StartPos: 4402, + EndPos: 4411, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 214, - EndLine: 214, - StartPos: 4410, - EndPos: 4411, + EndLine: 214, + StartPos: 4410, + EndPos: 4411, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 214, - EndLine: 214, - StartPos: 4410, - EndPos: 4411, + EndLine: 214, + StartPos: 4410, + EndPos: 4411, }, Value: "a", }, @@ -10083,30 +10147,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 215, - EndLine: 215, - StartPos: 4416, - EndPos: 4431, + EndLine: 215, + StartPos: 4416, + EndPos: 4431, }, Expr: &expr.IncludeOnce{ Position: &position.Position{ StartLine: 215, - EndLine: 215, - StartPos: 4416, - EndPos: 4430, + EndLine: 215, + StartPos: 4416, + EndPos: 4430, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 215, - EndLine: 215, - StartPos: 4429, - EndPos: 4430, + EndLine: 215, + StartPos: 4429, + EndPos: 4430, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 215, - EndLine: 215, - StartPos: 4429, - EndPos: 4430, + EndLine: 215, + StartPos: 4429, + EndPos: 4430, }, Value: "a", }, @@ -10116,30 +10180,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 216, - EndLine: 216, - StartPos: 4435, - EndPos: 4445, + EndLine: 216, + StartPos: 4435, + EndPos: 4445, }, Expr: &expr.Require{ Position: &position.Position{ StartLine: 216, - EndLine: 216, - StartPos: 4435, - EndPos: 4444, + EndLine: 216, + StartPos: 4435, + EndPos: 4444, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 216, - EndLine: 216, - StartPos: 4443, - EndPos: 4444, + EndLine: 216, + StartPos: 4443, + EndPos: 4444, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 216, - EndLine: 216, - StartPos: 4443, - EndPos: 4444, + EndLine: 216, + StartPos: 4443, + EndPos: 4444, }, Value: "a", }, @@ -10149,30 +10213,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 217, - EndLine: 217, - StartPos: 4449, - EndPos: 4464, + EndLine: 217, + StartPos: 4449, + EndPos: 4464, }, Expr: &expr.RequireOnce{ Position: &position.Position{ StartLine: 217, - EndLine: 217, - StartPos: 4449, - EndPos: 4463, + EndLine: 217, + StartPos: 4449, + EndPos: 4463, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 217, - EndLine: 217, - StartPos: 4462, - EndPos: 4463, + EndLine: 217, + StartPos: 4462, + EndPos: 4463, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 217, - EndLine: 217, - StartPos: 4462, - EndPos: 4463, + EndLine: 217, + StartPos: 4462, + EndPos: 4463, }, Value: "a", }, @@ -10182,30 +10246,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 219, - EndLine: 219, - StartPos: 4469, - EndPos: 4486, + EndLine: 219, + StartPos: 4469, + EndPos: 4486, }, Expr: &expr.InstanceOf{ Position: &position.Position{ StartLine: 219, - EndLine: 219, - StartPos: 4469, - EndPos: 4485, + EndLine: 219, + StartPos: 4469, + EndPos: 4485, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 219, - EndLine: 219, - StartPos: 4469, - EndPos: 4470, + EndLine: 219, + StartPos: 4469, + EndPos: 4470, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 219, - EndLine: 219, - StartPos: 4469, - EndPos: 4470, + EndLine: 219, + StartPos: 4469, + EndPos: 4470, }, Value: "a", }, @@ -10213,17 +10277,17 @@ func TestPhp7(t *testing.T) { Class: &name.Name{ Position: &position.Position{ StartLine: 219, - EndLine: 219, - StartPos: 4483, - EndPos: 4485, + EndLine: 219, + StartPos: 4483, + EndPos: 4485, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 219, - EndLine: 219, - StartPos: 4483, - EndPos: 4485, + EndLine: 219, + StartPos: 4483, + EndPos: 4485, }, Value: "Foo", }, @@ -10234,30 +10298,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 220, - EndLine: 220, - StartPos: 4490, - EndPos: 4517, + EndLine: 220, + StartPos: 4490, + EndPos: 4517, }, Expr: &expr.InstanceOf{ Position: &position.Position{ StartLine: 220, - EndLine: 220, - StartPos: 4490, - EndPos: 4516, + EndLine: 220, + StartPos: 4490, + EndPos: 4516, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 220, - EndLine: 220, - StartPos: 4490, - EndPos: 4491, + EndLine: 220, + StartPos: 4490, + EndPos: 4491, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 220, - EndLine: 220, - StartPos: 4490, - EndPos: 4491, + EndLine: 220, + StartPos: 4490, + EndPos: 4491, }, Value: "a", }, @@ -10265,17 +10329,17 @@ func TestPhp7(t *testing.T) { Class: &name.Relative{ Position: &position.Position{ StartLine: 220, - EndLine: 220, - StartPos: 4504, - EndPos: 4516, + EndLine: 220, + StartPos: 4504, + EndPos: 4516, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 220, - EndLine: 220, - StartPos: 4514, - EndPos: 4516, + EndLine: 220, + StartPos: 4514, + EndPos: 4516, }, Value: "Foo", }, @@ -10286,30 +10350,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 221, - EndLine: 221, - StartPos: 4521, - EndPos: 4539, + EndLine: 221, + StartPos: 4521, + EndPos: 4539, }, Expr: &expr.InstanceOf{ Position: &position.Position{ StartLine: 221, - EndLine: 221, - StartPos: 4521, - EndPos: 4538, + EndLine: 221, + StartPos: 4521, + EndPos: 4538, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 221, - EndLine: 221, - StartPos: 4521, - EndPos: 4522, + EndLine: 221, + StartPos: 4521, + EndPos: 4522, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 221, - EndLine: 221, - StartPos: 4521, - EndPos: 4522, + EndLine: 221, + StartPos: 4521, + EndPos: 4522, }, Value: "a", }, @@ -10317,17 +10381,17 @@ func TestPhp7(t *testing.T) { Class: &name.FullyQualified{ Position: &position.Position{ StartLine: 221, - EndLine: 221, - StartPos: 4535, - EndPos: 4538, + EndLine: 221, + StartPos: 4535, + EndPos: 4538, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 221, - EndLine: 221, - StartPos: 4536, - EndPos: 4538, + EndLine: 221, + StartPos: 4536, + EndPos: 4538, }, Value: "Foo", }, @@ -10338,31 +10402,31 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 223, - EndLine: 223, - StartPos: 4544, - EndPos: 4557, + EndLine: 223, + StartPos: 4544, + EndPos: 4557, }, Expr: &expr.Isset{ Position: &position.Position{ StartLine: 223, - EndLine: 223, - StartPos: 4544, - EndPos: 4556, + EndLine: 223, + StartPos: 4544, + EndPos: 4556, }, Variables: []node.Node{ &expr.Variable{ Position: &position.Position{ StartLine: 223, - EndLine: 223, - StartPos: 4550, - EndPos: 4551, + EndLine: 223, + StartPos: 4550, + EndPos: 4551, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 223, - EndLine: 223, - StartPos: 4550, - EndPos: 4551, + EndLine: 223, + StartPos: 4550, + EndPos: 4551, }, Value: "a", }, @@ -10370,16 +10434,16 @@ func TestPhp7(t *testing.T) { &expr.Variable{ Position: &position.Position{ StartLine: 223, - EndLine: 223, - StartPos: 4554, - EndPos: 4555, + EndLine: 223, + StartPos: 4554, + EndPos: 4555, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 223, - EndLine: 223, - StartPos: 4554, - EndPos: 4555, + EndLine: 223, + StartPos: 4554, + EndPos: 4555, }, Value: "b", }, @@ -10390,45 +10454,45 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 224, - EndLine: 224, - StartPos: 4561, - EndPos: 4574, + EndLine: 224, + StartPos: 4561, + EndPos: 4574, }, Expr: &assign.Assign{ Position: &position.Position{ StartLine: 224, - EndLine: 224, - StartPos: 4561, - EndPos: 4573, + EndLine: 224, + StartPos: 4561, + EndPos: 4573, }, Variable: &expr.List{ Position: &position.Position{ StartLine: 224, - EndLine: 224, - StartPos: 4561, - EndPos: 4568, + EndLine: 224, + StartPos: 4561, + EndPos: 4568, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 224, - EndLine: 224, - StartPos: 4566, - EndPos: 4567, + EndLine: 224, + StartPos: 4566, + EndPos: 4567, }, Val: &expr.Variable{ Position: &position.Position{ StartLine: 224, - EndLine: 224, - StartPos: 4566, - EndPos: 4567, + EndLine: 224, + StartPos: 4566, + EndPos: 4567, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 224, - EndLine: 224, - StartPos: 4566, - EndPos: 4567, + EndLine: 224, + StartPos: 4566, + EndPos: 4567, }, Value: "a", }, @@ -10439,16 +10503,16 @@ func TestPhp7(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 224, - EndLine: 224, - StartPos: 4572, - EndPos: 4573, + EndLine: 224, + StartPos: 4572, + EndPos: 4573, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 224, - EndLine: 224, - StartPos: 4572, - EndPos: 4573, + EndLine: 224, + StartPos: 4572, + EndPos: 4573, }, Value: "b", }, @@ -10458,52 +10522,52 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 225, - EndLine: 225, - StartPos: 4578, - EndPos: 4593, + EndLine: 225, + StartPos: 4578, + EndPos: 4593, }, Expr: &assign.Assign{ Position: &position.Position{ StartLine: 225, - EndLine: 225, - StartPos: 4578, - EndPos: 4592, + EndLine: 225, + StartPos: 4578, + EndPos: 4592, }, Variable: &expr.List{ Position: &position.Position{ StartLine: 225, - EndLine: 225, - StartPos: 4578, - EndPos: 4587, + EndLine: 225, + StartPos: 4578, + EndPos: 4587, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 225, - EndLine: 225, - StartPos: 4583, - EndPos: 4586, + EndLine: 225, + StartPos: 4583, + EndPos: 4586, }, Val: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 225, - EndLine: 225, - StartPos: 4583, - EndPos: 4586, + EndLine: 225, + StartPos: 4583, + EndPos: 4586, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 225, - EndLine: 225, - StartPos: 4583, - EndPos: 4584, + EndLine: 225, + StartPos: 4583, + EndPos: 4584, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 225, - EndLine: 225, - StartPos: 4583, - EndPos: 4584, + EndLine: 225, + StartPos: 4583, + EndPos: 4584, }, Value: "a", }, @@ -10515,16 +10579,16 @@ func TestPhp7(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 225, - EndLine: 225, - StartPos: 4591, - EndPos: 4592, + EndLine: 225, + StartPos: 4591, + EndPos: 4592, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 225, - EndLine: 225, - StartPos: 4591, - EndPos: 4592, + EndLine: 225, + StartPos: 4591, + EndPos: 4592, }, Value: "b", }, @@ -10534,60 +10598,60 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 226, - EndLine: 226, - StartPos: 4597, - EndPos: 4616, + EndLine: 226, + StartPos: 4597, + EndPos: 4616, }, Expr: &assign.Assign{ Position: &position.Position{ StartLine: 226, - EndLine: 226, - StartPos: 4597, - EndPos: 4615, + EndLine: 226, + StartPos: 4597, + EndPos: 4615, }, Variable: &expr.List{ Position: &position.Position{ StartLine: 226, - EndLine: 226, - StartPos: 4597, - EndPos: 4610, + EndLine: 226, + StartPos: 4597, + EndPos: 4610, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 226, - EndLine: 226, - StartPos: 4602, - EndPos: 4609, + EndLine: 226, + StartPos: 4602, + EndPos: 4609, }, Val: &expr.List{ Position: &position.Position{ StartLine: 226, - EndLine: 226, - StartPos: 4602, - EndPos: 4609, + EndLine: 226, + StartPos: 4602, + EndPos: 4609, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 226, - EndLine: 226, - StartPos: 4607, - EndPos: 4608, + EndLine: 226, + StartPos: 4607, + EndPos: 4608, }, Val: &expr.Variable{ Position: &position.Position{ StartLine: 226, - EndLine: 226, - StartPos: 4607, - EndPos: 4608, + EndLine: 226, + StartPos: 4607, + EndPos: 4608, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 226, - EndLine: 226, - StartPos: 4607, - EndPos: 4608, + EndLine: 226, + StartPos: 4607, + EndPos: 4608, }, Value: "a", }, @@ -10601,16 +10665,16 @@ func TestPhp7(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 226, - EndLine: 226, - StartPos: 4614, - EndPos: 4615, + EndLine: 226, + StartPos: 4614, + EndPos: 4615, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 226, - EndLine: 226, - StartPos: 4614, - EndPos: 4615, + EndLine: 226, + StartPos: 4614, + EndPos: 4615, }, Value: "b", }, @@ -10620,30 +10684,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 228, - EndLine: 228, - StartPos: 4621, - EndPos: 4630, + EndLine: 228, + StartPos: 4621, + EndPos: 4630, }, Expr: &expr.MethodCall{ Position: &position.Position{ StartLine: 228, - EndLine: 228, - StartPos: 4621, - EndPos: 4629, + EndLine: 228, + StartPos: 4621, + EndPos: 4629, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 228, - EndLine: 228, - StartPos: 4621, - EndPos: 4622, + EndLine: 228, + StartPos: 4621, + EndPos: 4622, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 228, - EndLine: 228, - StartPos: 4621, - EndPos: 4622, + EndLine: 228, + StartPos: 4621, + EndPos: 4622, }, Value: "a", }, @@ -10651,18 +10715,18 @@ func TestPhp7(t *testing.T) { Method: &node.Identifier{ Position: &position.Position{ StartLine: 228, - EndLine: 228, - StartPos: 4625, - EndPos: 4627, + EndLine: 228, + StartPos: 4625, + EndPos: 4627, }, Value: "foo", }, ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 228, - EndLine: 228, - StartPos: 4628, - EndPos: 4629, + EndLine: 228, + StartPos: 4628, + EndPos: 4629, }, }, }, @@ -10670,31 +10734,31 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 229, - EndLine: 229, - StartPos: 4634, - EndPos: 4643, + EndLine: 229, + StartPos: 4634, + EndPos: 4643, }, Expr: &expr.New{ Position: &position.Position{ StartLine: 229, - EndLine: 229, - StartPos: 4634, - EndPos: 4642, + EndLine: 229, + StartPos: 4634, + EndPos: 4642, }, Class: &name.Name{ Position: &position.Position{ StartLine: 229, - EndLine: 229, - StartPos: 4638, - EndPos: 4640, + EndLine: 229, + StartPos: 4638, + EndPos: 4640, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 229, - EndLine: 229, - StartPos: 4638, - EndPos: 4640, + EndLine: 229, + StartPos: 4638, + EndPos: 4640, }, Value: "Foo", }, @@ -10703,9 +10767,9 @@ func TestPhp7(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 229, - EndLine: 229, - StartPos: 4641, - EndPos: 4642, + EndLine: 229, + StartPos: 4641, + EndPos: 4642, }, }, }, @@ -10713,31 +10777,31 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 230, - EndLine: 230, - StartPos: 4647, - EndPos: 4666, + EndLine: 230, + StartPos: 4647, + EndPos: 4666, }, Expr: &expr.New{ Position: &position.Position{ StartLine: 230, - EndLine: 230, - StartPos: 4647, - EndPos: 4665, + EndLine: 230, + StartPos: 4647, + EndPos: 4665, }, Class: &name.Relative{ Position: &position.Position{ StartLine: 230, - EndLine: 230, - StartPos: 4651, - EndPos: 4663, + EndLine: 230, + StartPos: 4651, + EndPos: 4663, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 230, - EndLine: 230, - StartPos: 4661, - EndPos: 4663, + EndLine: 230, + StartPos: 4661, + EndPos: 4663, }, Value: "Foo", }, @@ -10746,9 +10810,9 @@ func TestPhp7(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 230, - EndLine: 230, - StartPos: 4664, - EndPos: 4665, + EndLine: 230, + StartPos: 4664, + EndPos: 4665, }, }, }, @@ -10756,31 +10820,31 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 231, - EndLine: 231, - StartPos: 4670, - EndPos: 4680, + EndLine: 231, + StartPos: 4670, + EndPos: 4680, }, Expr: &expr.New{ Position: &position.Position{ StartLine: 231, - EndLine: 231, - StartPos: 4670, - EndPos: 4679, + EndLine: 231, + StartPos: 4670, + EndPos: 4679, }, Class: &name.FullyQualified{ Position: &position.Position{ StartLine: 231, - EndLine: 231, - StartPos: 4674, - EndPos: 4677, + EndLine: 231, + StartPos: 4674, + EndPos: 4677, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 231, - EndLine: 231, - StartPos: 4675, - EndPos: 4677, + EndLine: 231, + StartPos: 4675, + EndPos: 4677, }, Value: "Foo", }, @@ -10789,9 +10853,9 @@ func TestPhp7(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 231, - EndLine: 231, - StartPos: 4678, - EndPos: 4679, + EndLine: 231, + StartPos: 4678, + EndPos: 4679, }, }, }, @@ -10799,55 +10863,55 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 232, - EndLine: 232, - StartPos: 4684, - EndPos: 4708, + EndLine: 232, + StartPos: 4684, + EndPos: 4708, }, Expr: &expr.New{ Position: &position.Position{ StartLine: 232, - EndLine: 232, - StartPos: 4684, - EndPos: 4707, + EndLine: 232, + StartPos: 4684, + EndPos: 4707, }, Class: &stmt.Class{ Position: &position.Position{ StartLine: 232, - EndLine: 232, - StartPos: 4688, - EndPos: 4707, + EndLine: 232, + StartPos: 4688, + EndPos: 4707, }, PhpDocComment: "", ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 232, - EndLine: 232, - StartPos: 4694, - EndPos: 4704, + EndLine: 232, + StartPos: 4694, + EndPos: 4704, }, Arguments: []node.Node{ &node.Argument{ Position: &position.Position{ StartLine: 232, - EndLine: 232, - StartPos: 4695, - EndPos: 4696, + EndLine: 232, + StartPos: 4695, + EndPos: 4696, }, + Variadic: false, IsReference: false, - Variadic: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 232, - EndLine: 232, - StartPos: 4695, - EndPos: 4696, + EndLine: 232, + StartPos: 4695, + EndPos: 4696, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 232, - EndLine: 232, - StartPos: 4695, - EndPos: 4696, + EndLine: 232, + StartPos: 4695, + EndPos: 4696, }, Value: "a", }, @@ -10856,25 +10920,25 @@ func TestPhp7(t *testing.T) { &node.Argument{ Position: &position.Position{ StartLine: 232, - EndLine: 232, - StartPos: 4699, - EndPos: 4703, + EndLine: 232, + StartPos: 4699, + EndPos: 4703, }, - Variadic: true, + Variadic: true, IsReference: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 232, - EndLine: 232, - StartPos: 4702, - EndPos: 4703, + EndLine: 232, + StartPos: 4702, + EndPos: 4703, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 232, - EndLine: 232, - StartPos: 4702, - EndPos: 4703, + EndLine: 232, + StartPos: 4702, + EndPos: 4703, }, Value: "b", }, @@ -10882,37 +10946,38 @@ func TestPhp7(t *testing.T) { }, }, }, - Stmts: []node.Node{}, + Stmts: []node.Node{ + }, }, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 233, - EndLine: 233, - StartPos: 4712, - EndPos: 4721, + EndLine: 233, + StartPos: 4712, + EndPos: 4721, }, Expr: &expr.Print{ Position: &position.Position{ StartLine: 233, - EndLine: 233, - StartPos: 4712, - EndPos: 4719, + EndLine: 233, + StartPos: 4712, + EndPos: 4719, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 233, - EndLine: 233, - StartPos: 4718, - EndPos: 4719, + EndLine: 233, + StartPos: 4718, + EndPos: 4719, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 233, - EndLine: 233, - StartPos: 4718, - EndPos: 4719, + EndLine: 233, + StartPos: 4718, + EndPos: 4719, }, Value: "a", }, @@ -10922,30 +10987,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 234, - EndLine: 234, - StartPos: 4725, - EndPos: 4732, + EndLine: 234, + StartPos: 4725, + EndPos: 4732, }, Expr: &expr.PropertyFetch{ Position: &position.Position{ StartLine: 234, - EndLine: 234, - StartPos: 4725, - EndPos: 4731, + EndLine: 234, + StartPos: 4725, + EndPos: 4731, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 234, - EndLine: 234, - StartPos: 4725, - EndPos: 4726, + EndLine: 234, + StartPos: 4725, + EndPos: 4726, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 234, - EndLine: 234, - StartPos: 4725, - EndPos: 4726, + EndLine: 234, + StartPos: 4725, + EndPos: 4726, }, Value: "a", }, @@ -10953,9 +11018,9 @@ func TestPhp7(t *testing.T) { Property: &node.Identifier{ Position: &position.Position{ StartLine: 234, - EndLine: 234, - StartPos: 4729, - EndPos: 4731, + EndLine: 234, + StartPos: 4729, + EndPos: 4731, }, Value: "foo", }, @@ -10964,40 +11029,40 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 235, - EndLine: 235, - StartPos: 4736, - EndPos: 4744, + EndLine: 235, + StartPos: 4736, + EndPos: 4744, }, Expr: &expr.ShellExec{ Position: &position.Position{ StartLine: 235, - EndLine: 235, - StartPos: 4736, - EndPos: 4743, + EndLine: 235, + StartPos: 4736, + EndPos: 4743, }, Parts: []node.Node{ &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 235, - EndLine: 235, - StartPos: 4737, - EndPos: 4740, + EndLine: 235, + StartPos: 4737, + EndPos: 4740, }, Value: "cmd ", }, &expr.Variable{ Position: &position.Position{ StartLine: 235, - EndLine: 235, - StartPos: 4741, - EndPos: 4742, + EndLine: 235, + StartPos: 4741, + EndPos: 4742, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 235, - EndLine: 235, - StartPos: 4741, - EndPos: 4742, + EndLine: 235, + StartPos: 4741, + EndPos: 4742, }, Value: "a", }, @@ -11008,16 +11073,16 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 236, - EndLine: 236, - StartPos: 4748, - EndPos: 4753, + EndLine: 236, + StartPos: 4748, + EndPos: 4753, }, Expr: &expr.ShellExec{ Position: &position.Position{ StartLine: 236, - EndLine: 236, - StartPos: 4748, - EndPos: 4752, + EndLine: 236, + StartPos: 4748, + EndPos: 4752, }, Parts: []node.Node{ &scalar.EncapsedStringPart{ @@ -11029,65 +11094,67 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 237, - EndLine: 237, - StartPos: 4757, - EndPos: 4759, + EndLine: 237, + StartPos: 4757, + EndPos: 4759, }, Expr: &expr.ShellExec{ Position: &position.Position{ StartLine: 237, - EndLine: 237, - StartPos: 4757, - EndPos: 4758, + EndLine: 237, + StartPos: 4757, + EndPos: 4758, + }, + Parts: []node.Node{ }, - Parts: []node.Node{}, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 238, - EndLine: 238, - StartPos: 4763, - EndPos: 4765, + EndLine: 238, + StartPos: 4763, + EndPos: 4765, }, Expr: &expr.ShortArray{ Position: &position.Position{ StartLine: 238, - EndLine: 238, - StartPos: 4763, - EndPos: 4764, + EndLine: 238, + StartPos: 4763, + EndPos: 4764, + }, + Items: []node.Node{ }, - Items: []node.Node{}, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 239, - EndLine: 239, - StartPos: 4769, - EndPos: 4772, + EndLine: 239, + StartPos: 4769, + EndPos: 4772, }, Expr: &expr.ShortArray{ Position: &position.Position{ StartLine: 239, - EndLine: 239, - StartPos: 4769, - EndPos: 4771, + EndLine: 239, + StartPos: 4769, + EndPos: 4771, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 239, - EndLine: 239, - StartPos: 4770, - EndPos: 4770, + EndLine: 239, + StartPos: 4770, + EndPos: 4770, }, Val: &scalar.Lnumber{ Position: &position.Position{ StartLine: 239, - EndLine: 239, - StartPos: 4770, - EndPos: 4770, + EndLine: 239, + StartPos: 4770, + EndPos: 4770, }, Value: "1", }, @@ -11098,40 +11165,40 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 240, - EndLine: 240, - StartPos: 4776, - EndPos: 4788, + EndLine: 240, + StartPos: 4776, + EndPos: 4788, }, Expr: &expr.ShortArray{ Position: &position.Position{ StartLine: 240, - EndLine: 240, - StartPos: 4776, - EndPos: 4787, + EndLine: 240, + StartPos: 4776, + EndPos: 4787, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 240, - EndLine: 240, - StartPos: 4777, - EndPos: 4780, + EndLine: 240, + StartPos: 4777, + EndPos: 4780, }, Key: &scalar.Lnumber{ Position: &position.Position{ StartLine: 240, - EndLine: 240, - StartPos: 4777, - EndPos: 4777, + EndLine: 240, + StartPos: 4777, + EndPos: 4777, }, Value: "1", }, Val: &scalar.Lnumber{ Position: &position.Position{ StartLine: 240, - EndLine: 240, - StartPos: 4780, - EndPos: 4780, + EndLine: 240, + StartPos: 4780, + EndPos: 4780, }, Value: "1", }, @@ -11139,82 +11206,83 @@ func TestPhp7(t *testing.T) { &expr.ArrayItem{ Position: &position.Position{ StartLine: 240, - EndLine: 240, - StartPos: 4783, - EndPos: 4785, + EndLine: 240, + StartPos: 4783, + EndPos: 4785, }, Val: &expr.Reference{ Position: &position.Position{ StartLine: 240, - EndLine: 240, - StartPos: 4783, - EndPos: 4785, + EndLine: 240, + StartPos: 4783, + EndPos: 4785, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 240, - EndLine: 240, - StartPos: 4784, - EndPos: 4785, + EndLine: 240, + StartPos: 4784, + EndPos: 4785, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 240, - EndLine: 240, - StartPos: 4784, - EndPos: 4785, + EndLine: 240, + StartPos: 4784, + EndPos: 4785, }, Value: "b", }, }, }, }, - &expr.ArrayItem{}, + &expr.ArrayItem{ + }, }, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 242, - EndLine: 242, - StartPos: 4793, - EndPos: 4802, + EndLine: 242, + StartPos: 4793, + EndPos: 4802, }, Expr: &assign.Assign{ Position: &position.Position{ StartLine: 242, - EndLine: 242, - StartPos: 4793, - EndPos: 4801, + EndLine: 242, + StartPos: 4793, + EndPos: 4801, }, Variable: &expr.ShortList{ Position: &position.Position{ StartLine: 242, - EndLine: 242, - StartPos: 4793, - EndPos: 4796, + EndLine: 242, + StartPos: 4793, + EndPos: 4796, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 242, - EndLine: 242, - StartPos: 4794, - EndPos: 4795, + EndLine: 242, + StartPos: 4794, + EndPos: 4795, }, Val: &expr.Variable{ Position: &position.Position{ StartLine: 242, - EndLine: 242, - StartPos: 4794, - EndPos: 4795, + EndLine: 242, + StartPos: 4794, + EndPos: 4795, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 242, - EndLine: 242, - StartPos: 4794, - EndPos: 4795, + EndLine: 242, + StartPos: 4794, + EndPos: 4795, }, Value: "a", }, @@ -11225,16 +11293,16 @@ func TestPhp7(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 242, - EndLine: 242, - StartPos: 4800, - EndPos: 4801, + EndLine: 242, + StartPos: 4800, + EndPos: 4801, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 242, - EndLine: 242, - StartPos: 4800, - EndPos: 4801, + EndLine: 242, + StartPos: 4800, + EndPos: 4801, }, Value: "b", }, @@ -11244,52 +11312,52 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 243, - EndLine: 243, - StartPos: 4806, - EndPos: 4817, + EndLine: 243, + StartPos: 4806, + EndPos: 4817, }, Expr: &assign.Assign{ Position: &position.Position{ StartLine: 243, - EndLine: 243, - StartPos: 4806, - EndPos: 4816, + EndLine: 243, + StartPos: 4806, + EndPos: 4816, }, Variable: &expr.ShortList{ Position: &position.Position{ StartLine: 243, - EndLine: 243, - StartPos: 4806, - EndPos: 4811, + EndLine: 243, + StartPos: 4806, + EndPos: 4811, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 243, - EndLine: 243, - StartPos: 4807, - EndPos: 4810, + EndLine: 243, + StartPos: 4807, + EndPos: 4810, }, Val: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 243, - EndLine: 243, - StartPos: 4807, - EndPos: 4810, + EndLine: 243, + StartPos: 4807, + EndPos: 4810, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 243, - EndLine: 243, - StartPos: 4807, - EndPos: 4808, + EndLine: 243, + StartPos: 4807, + EndPos: 4808, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 243, - EndLine: 243, - StartPos: 4807, - EndPos: 4808, + EndLine: 243, + StartPos: 4807, + EndPos: 4808, }, Value: "a", }, @@ -11301,16 +11369,16 @@ func TestPhp7(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 243, - EndLine: 243, - StartPos: 4815, - EndPos: 4816, + EndLine: 243, + StartPos: 4815, + EndPos: 4816, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 243, - EndLine: 243, - StartPos: 4815, - EndPos: 4816, + EndLine: 243, + StartPos: 4815, + EndPos: 4816, }, Value: "b", }, @@ -11320,60 +11388,60 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 244, - EndLine: 244, - StartPos: 4821, - EndPos: 4836, + EndLine: 244, + StartPos: 4821, + EndPos: 4836, }, Expr: &assign.Assign{ Position: &position.Position{ StartLine: 244, - EndLine: 244, - StartPos: 4821, - EndPos: 4835, + EndLine: 244, + StartPos: 4821, + EndPos: 4835, }, Variable: &expr.ShortList{ Position: &position.Position{ StartLine: 244, - EndLine: 244, - StartPos: 4821, - EndPos: 4830, + EndLine: 244, + StartPos: 4821, + EndPos: 4830, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 244, - EndLine: 244, - StartPos: 4822, - EndPos: 4829, + EndLine: 244, + StartPos: 4822, + EndPos: 4829, }, Val: &expr.List{ Position: &position.Position{ StartLine: 244, - EndLine: 244, - StartPos: 4822, - EndPos: 4829, + EndLine: 244, + StartPos: 4822, + EndPos: 4829, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 244, - EndLine: 244, - StartPos: 4827, - EndPos: 4828, + EndLine: 244, + StartPos: 4827, + EndPos: 4828, }, Val: &expr.Variable{ Position: &position.Position{ StartLine: 244, - EndLine: 244, - StartPos: 4827, - EndPos: 4828, + EndLine: 244, + StartPos: 4827, + EndPos: 4828, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 244, - EndLine: 244, - StartPos: 4827, - EndPos: 4828, + EndLine: 244, + StartPos: 4827, + EndPos: 4828, }, Value: "a", }, @@ -11387,16 +11455,16 @@ func TestPhp7(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 244, - EndLine: 244, - StartPos: 4834, - EndPos: 4835, + EndLine: 244, + StartPos: 4834, + EndPos: 4835, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 244, - EndLine: 244, - StartPos: 4834, - EndPos: 4835, + EndLine: 244, + StartPos: 4834, + EndPos: 4835, }, Value: "b", }, @@ -11406,31 +11474,31 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 245, - EndLine: 245, - StartPos: 4840, - EndPos: 4850, + EndLine: 245, + StartPos: 4840, + EndPos: 4850, }, Expr: &expr.StaticCall{ Position: &position.Position{ StartLine: 245, - EndLine: 245, - StartPos: 4840, - EndPos: 4849, + EndLine: 245, + StartPos: 4840, + EndPos: 4849, }, Class: &name.Name{ Position: &position.Position{ StartLine: 245, - EndLine: 245, - StartPos: 4840, - EndPos: 4842, + EndLine: 245, + StartPos: 4840, + EndPos: 4842, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 245, - EndLine: 245, - StartPos: 4840, - EndPos: 4842, + EndLine: 245, + StartPos: 4840, + EndPos: 4842, }, Value: "Foo", }, @@ -11439,18 +11507,18 @@ func TestPhp7(t *testing.T) { Call: &node.Identifier{ Position: &position.Position{ StartLine: 245, - EndLine: 245, - StartPos: 4845, - EndPos: 4847, + EndLine: 245, + StartPos: 4845, + EndPos: 4847, }, Value: "bar", }, ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 245, - EndLine: 245, - StartPos: 4848, - EndPos: 4849, + EndLine: 245, + StartPos: 4848, + EndPos: 4849, }, }, }, @@ -11458,31 +11526,31 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 246, - EndLine: 246, - StartPos: 4854, - EndPos: 4874, + EndLine: 246, + StartPos: 4854, + EndPos: 4874, }, Expr: &expr.StaticCall{ Position: &position.Position{ StartLine: 246, - EndLine: 246, - StartPos: 4854, - EndPos: 4873, + EndLine: 246, + StartPos: 4854, + EndPos: 4873, }, Class: &name.Relative{ Position: &position.Position{ StartLine: 246, - EndLine: 246, - StartPos: 4854, - EndPos: 4866, + EndLine: 246, + StartPos: 4854, + EndPos: 4866, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 246, - EndLine: 246, - StartPos: 4864, - EndPos: 4866, + EndLine: 246, + StartPos: 4864, + EndPos: 4866, }, Value: "Foo", }, @@ -11491,18 +11559,18 @@ func TestPhp7(t *testing.T) { Call: &node.Identifier{ Position: &position.Position{ StartLine: 246, - EndLine: 246, - StartPos: 4869, - EndPos: 4871, + EndLine: 246, + StartPos: 4869, + EndPos: 4871, }, Value: "bar", }, ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 246, - EndLine: 246, - StartPos: 4872, - EndPos: 4873, + EndLine: 246, + StartPos: 4872, + EndPos: 4873, }, }, }, @@ -11510,31 +11578,31 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 247, - EndLine: 247, - StartPos: 4878, - EndPos: 4889, + EndLine: 247, + StartPos: 4878, + EndPos: 4889, }, Expr: &expr.StaticCall{ Position: &position.Position{ StartLine: 247, - EndLine: 247, - StartPos: 4878, - EndPos: 4888, + EndLine: 247, + StartPos: 4878, + EndPos: 4888, }, Class: &name.FullyQualified{ Position: &position.Position{ StartLine: 247, - EndLine: 247, - StartPos: 4878, - EndPos: 4881, + EndLine: 247, + StartPos: 4878, + EndPos: 4881, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 247, - EndLine: 247, - StartPos: 4879, - EndPos: 4881, + EndLine: 247, + StartPos: 4879, + EndPos: 4881, }, Value: "Foo", }, @@ -11543,18 +11611,18 @@ func TestPhp7(t *testing.T) { Call: &node.Identifier{ Position: &position.Position{ StartLine: 247, - EndLine: 247, - StartPos: 4884, - EndPos: 4886, + EndLine: 247, + StartPos: 4884, + EndPos: 4886, }, Value: "bar", }, ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 247, - EndLine: 247, - StartPos: 4887, - EndPos: 4888, + EndLine: 247, + StartPos: 4887, + EndPos: 4888, }, }, }, @@ -11562,31 +11630,31 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 248, - EndLine: 248, - StartPos: 4893, - EndPos: 4902, + EndLine: 248, + StartPos: 4893, + EndPos: 4902, }, Expr: &expr.StaticPropertyFetch{ Position: &position.Position{ StartLine: 248, - EndLine: 248, - StartPos: 4893, - EndPos: 4901, + EndLine: 248, + StartPos: 4893, + EndPos: 4901, }, Class: &name.Name{ Position: &position.Position{ StartLine: 248, - EndLine: 248, - StartPos: 4893, - EndPos: 4895, + EndLine: 248, + StartPos: 4893, + EndPos: 4895, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 248, - EndLine: 248, - StartPos: 4893, - EndPos: 4895, + EndLine: 248, + StartPos: 4893, + EndPos: 4895, }, Value: "Foo", }, @@ -11595,16 +11663,16 @@ func TestPhp7(t *testing.T) { Property: &expr.Variable{ Position: &position.Position{ StartLine: 248, - EndLine: 248, - StartPos: 4898, - EndPos: 4901, + EndLine: 248, + StartPos: 4898, + EndPos: 4901, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 248, - EndLine: 248, - StartPos: 4898, - EndPos: 4901, + EndLine: 248, + StartPos: 4898, + EndPos: 4901, }, Value: "bar", }, @@ -11614,30 +11682,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 249, - EndLine: 249, - StartPos: 4906, - EndPos: 4916, + EndLine: 249, + StartPos: 4906, + EndPos: 4916, }, Expr: &expr.StaticPropertyFetch{ Position: &position.Position{ StartLine: 249, - EndLine: 249, - StartPos: 4906, - EndPos: 4915, + EndLine: 249, + StartPos: 4906, + EndPos: 4915, }, Class: &expr.Variable{ Position: &position.Position{ StartLine: 249, - EndLine: 249, - StartPos: 4906, - EndPos: 4909, + EndLine: 249, + StartPos: 4906, + EndPos: 4909, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 249, - EndLine: 249, - StartPos: 4906, - EndPos: 4909, + EndLine: 249, + StartPos: 4906, + EndPos: 4909, }, Value: "foo", }, @@ -11645,16 +11713,16 @@ func TestPhp7(t *testing.T) { Property: &expr.Variable{ Position: &position.Position{ StartLine: 249, - EndLine: 249, - StartPos: 4912, - EndPos: 4915, + EndLine: 249, + StartPos: 4912, + EndPos: 4915, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 249, - EndLine: 249, - StartPos: 4912, - EndPos: 4915, + EndLine: 249, + StartPos: 4912, + EndPos: 4915, }, Value: "bar", }, @@ -11664,31 +11732,31 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 250, - EndLine: 250, - StartPos: 4920, - EndPos: 4939, + EndLine: 250, + StartPos: 4920, + EndPos: 4939, }, Expr: &expr.StaticPropertyFetch{ Position: &position.Position{ StartLine: 250, - EndLine: 250, - StartPos: 4920, - EndPos: 4938, + EndLine: 250, + StartPos: 4920, + EndPos: 4938, }, Class: &name.Relative{ Position: &position.Position{ StartLine: 250, - EndLine: 250, - StartPos: 4920, - EndPos: 4932, + EndLine: 250, + StartPos: 4920, + EndPos: 4932, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 250, - EndLine: 250, - StartPos: 4930, - EndPos: 4932, + EndLine: 250, + StartPos: 4930, + EndPos: 4932, }, Value: "Foo", }, @@ -11697,16 +11765,16 @@ func TestPhp7(t *testing.T) { Property: &expr.Variable{ Position: &position.Position{ StartLine: 250, - EndLine: 250, - StartPos: 4935, - EndPos: 4938, + EndLine: 250, + StartPos: 4935, + EndPos: 4938, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 250, - EndLine: 250, - StartPos: 4935, - EndPos: 4938, + EndLine: 250, + StartPos: 4935, + EndPos: 4938, }, Value: "bar", }, @@ -11716,31 +11784,31 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 251, - EndLine: 251, - StartPos: 4943, - EndPos: 4953, + EndLine: 251, + StartPos: 4943, + EndPos: 4953, }, Expr: &expr.StaticPropertyFetch{ Position: &position.Position{ StartLine: 251, - EndLine: 251, - StartPos: 4943, - EndPos: 4952, + EndLine: 251, + StartPos: 4943, + EndPos: 4952, }, Class: &name.FullyQualified{ Position: &position.Position{ StartLine: 251, - EndLine: 251, - StartPos: 4943, - EndPos: 4946, + EndLine: 251, + StartPos: 4943, + EndPos: 4946, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 251, - EndLine: 251, - StartPos: 4944, - EndPos: 4946, + EndLine: 251, + StartPos: 4944, + EndPos: 4946, }, Value: "Foo", }, @@ -11749,16 +11817,16 @@ func TestPhp7(t *testing.T) { Property: &expr.Variable{ Position: &position.Position{ StartLine: 251, - EndLine: 251, - StartPos: 4949, - EndPos: 4952, + EndLine: 251, + StartPos: 4949, + EndPos: 4952, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 251, - EndLine: 251, - StartPos: 4949, - EndPos: 4952, + EndLine: 251, + StartPos: 4949, + EndPos: 4952, }, Value: "bar", }, @@ -11768,30 +11836,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 252, - EndLine: 252, - StartPos: 4957, - EndPos: 4969, + EndLine: 252, + StartPos: 4957, + EndPos: 4969, }, Expr: &expr.Ternary{ Position: &position.Position{ StartLine: 252, - EndLine: 252, - StartPos: 4957, - EndPos: 4968, + EndLine: 252, + StartPos: 4957, + EndPos: 4968, }, Condition: &expr.Variable{ Position: &position.Position{ StartLine: 252, - EndLine: 252, - StartPos: 4957, - EndPos: 4958, + EndLine: 252, + StartPos: 4957, + EndPos: 4958, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 252, - EndLine: 252, - StartPos: 4957, - EndPos: 4958, + EndLine: 252, + StartPos: 4957, + EndPos: 4958, }, Value: "a", }, @@ -11799,16 +11867,16 @@ func TestPhp7(t *testing.T) { IfTrue: &expr.Variable{ Position: &position.Position{ StartLine: 252, - EndLine: 252, - StartPos: 4962, - EndPos: 4963, + EndLine: 252, + StartPos: 4962, + EndPos: 4963, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 252, - EndLine: 252, - StartPos: 4962, - EndPos: 4963, + EndLine: 252, + StartPos: 4962, + EndPos: 4963, }, Value: "b", }, @@ -11816,16 +11884,16 @@ func TestPhp7(t *testing.T) { IfFalse: &expr.Variable{ Position: &position.Position{ StartLine: 252, - EndLine: 252, - StartPos: 4967, - EndPos: 4968, + EndLine: 252, + StartPos: 4967, + EndPos: 4968, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 252, - EndLine: 252, - StartPos: 4967, - EndPos: 4968, + EndLine: 252, + StartPos: 4967, + EndPos: 4968, }, Value: "c", }, @@ -11835,30 +11903,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 253, - EndLine: 253, - StartPos: 4973, - EndPos: 4982, + EndLine: 253, + StartPos: 4973, + EndPos: 4982, }, Expr: &expr.Ternary{ Position: &position.Position{ StartLine: 253, - EndLine: 253, - StartPos: 4973, - EndPos: 4981, + EndLine: 253, + StartPos: 4973, + EndPos: 4981, }, Condition: &expr.Variable{ Position: &position.Position{ StartLine: 253, - EndLine: 253, - StartPos: 4973, - EndPos: 4974, + EndLine: 253, + StartPos: 4973, + EndPos: 4974, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 253, - EndLine: 253, - StartPos: 4973, - EndPos: 4974, + EndLine: 253, + StartPos: 4973, + EndPos: 4974, }, Value: "a", }, @@ -11866,16 +11934,16 @@ func TestPhp7(t *testing.T) { IfFalse: &expr.Variable{ Position: &position.Position{ StartLine: 253, - EndLine: 253, - StartPos: 4980, - EndPos: 4981, + EndLine: 253, + StartPos: 4980, + EndPos: 4981, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 253, - EndLine: 253, - StartPos: 4980, - EndPos: 4981, + EndLine: 253, + StartPos: 4980, + EndPos: 4981, }, Value: "c", }, @@ -11885,30 +11953,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 254, - EndLine: 254, - StartPos: 4986, - EndPos: 5008, + EndLine: 254, + StartPos: 4986, + EndPos: 5008, }, Expr: &expr.Ternary{ Position: &position.Position{ StartLine: 254, - EndLine: 254, - StartPos: 4986, - EndPos: 5007, + EndLine: 254, + StartPos: 4986, + EndPos: 5007, }, Condition: &expr.Variable{ Position: &position.Position{ StartLine: 254, - EndLine: 254, - StartPos: 4986, - EndPos: 4987, + EndLine: 254, + StartPos: 4986, + EndPos: 4987, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 254, - EndLine: 254, - StartPos: 4986, - EndPos: 4987, + EndLine: 254, + StartPos: 4986, + EndPos: 4987, }, Value: "a", }, @@ -11916,23 +11984,23 @@ func TestPhp7(t *testing.T) { IfTrue: &expr.Ternary{ Position: &position.Position{ StartLine: 254, - EndLine: 254, - StartPos: 4991, - EndPos: 5002, + EndLine: 254, + StartPos: 4991, + EndPos: 5002, }, Condition: &expr.Variable{ Position: &position.Position{ StartLine: 254, - EndLine: 254, - StartPos: 4991, - EndPos: 4992, + EndLine: 254, + StartPos: 4991, + EndPos: 4992, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 254, - EndLine: 254, - StartPos: 4991, - EndPos: 4992, + EndLine: 254, + StartPos: 4991, + EndPos: 4992, }, Value: "b", }, @@ -11940,16 +12008,16 @@ func TestPhp7(t *testing.T) { IfTrue: &expr.Variable{ Position: &position.Position{ StartLine: 254, - EndLine: 254, - StartPos: 4996, - EndPos: 4997, + EndLine: 254, + StartPos: 4996, + EndPos: 4997, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 254, - EndLine: 254, - StartPos: 4996, - EndPos: 4997, + EndLine: 254, + StartPos: 4996, + EndPos: 4997, }, Value: "c", }, @@ -11957,16 +12025,16 @@ func TestPhp7(t *testing.T) { IfFalse: &expr.Variable{ Position: &position.Position{ StartLine: 254, - EndLine: 254, - StartPos: 5001, - EndPos: 5002, + EndLine: 254, + StartPos: 5001, + EndPos: 5002, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 254, - EndLine: 254, - StartPos: 5001, - EndPos: 5002, + EndLine: 254, + StartPos: 5001, + EndPos: 5002, }, Value: "d", }, @@ -11975,16 +12043,16 @@ func TestPhp7(t *testing.T) { IfFalse: &expr.Variable{ Position: &position.Position{ StartLine: 254, - EndLine: 254, - StartPos: 5006, - EndPos: 5007, + EndLine: 254, + StartPos: 5006, + EndPos: 5007, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 254, - EndLine: 254, - StartPos: 5006, - EndPos: 5007, + EndLine: 254, + StartPos: 5006, + EndPos: 5007, }, Value: "e", }, @@ -11994,37 +12062,37 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 255, - EndLine: 255, - StartPos: 5012, - EndPos: 5034, + EndLine: 255, + StartPos: 5012, + EndPos: 5034, }, Expr: &expr.Ternary{ Position: &position.Position{ StartLine: 255, - EndLine: 255, - StartPos: 5012, - EndPos: 5033, + EndLine: 255, + StartPos: 5012, + EndPos: 5033, }, Condition: &expr.Ternary{ Position: &position.Position{ StartLine: 255, - EndLine: 255, - StartPos: 5012, - EndPos: 5023, + EndLine: 255, + StartPos: 5012, + EndPos: 5023, }, Condition: &expr.Variable{ Position: &position.Position{ StartLine: 255, - EndLine: 255, - StartPos: 5012, - EndPos: 5013, + EndLine: 255, + StartPos: 5012, + EndPos: 5013, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 255, - EndLine: 255, - StartPos: 5012, - EndPos: 5013, + EndLine: 255, + StartPos: 5012, + EndPos: 5013, }, Value: "a", }, @@ -12032,16 +12100,16 @@ func TestPhp7(t *testing.T) { IfTrue: &expr.Variable{ Position: &position.Position{ StartLine: 255, - EndLine: 255, - StartPos: 5017, - EndPos: 5018, + EndLine: 255, + StartPos: 5017, + EndPos: 5018, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 255, - EndLine: 255, - StartPos: 5017, - EndPos: 5018, + EndLine: 255, + StartPos: 5017, + EndPos: 5018, }, Value: "b", }, @@ -12049,16 +12117,16 @@ func TestPhp7(t *testing.T) { IfFalse: &expr.Variable{ Position: &position.Position{ StartLine: 255, - EndLine: 255, - StartPos: 5022, - EndPos: 5023, + EndLine: 255, + StartPos: 5022, + EndPos: 5023, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 255, - EndLine: 255, - StartPos: 5022, - EndPos: 5023, + EndLine: 255, + StartPos: 5022, + EndPos: 5023, }, Value: "c", }, @@ -12067,16 +12135,16 @@ func TestPhp7(t *testing.T) { IfTrue: &expr.Variable{ Position: &position.Position{ StartLine: 255, - EndLine: 255, - StartPos: 5027, - EndPos: 5028, + EndLine: 255, + StartPos: 5027, + EndPos: 5028, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 255, - EndLine: 255, - StartPos: 5027, - EndPos: 5028, + EndLine: 255, + StartPos: 5027, + EndPos: 5028, }, Value: "d", }, @@ -12084,16 +12152,16 @@ func TestPhp7(t *testing.T) { IfFalse: &expr.Variable{ Position: &position.Position{ StartLine: 255, - EndLine: 255, - StartPos: 5032, - EndPos: 5033, + EndLine: 255, + StartPos: 5032, + EndPos: 5033, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 255, - EndLine: 255, - StartPos: 5032, - EndPos: 5033, + EndLine: 255, + StartPos: 5032, + EndPos: 5033, }, Value: "e", }, @@ -12103,30 +12171,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 256, - EndLine: 256, - StartPos: 5038, - EndPos: 5041, + EndLine: 256, + StartPos: 5038, + EndPos: 5041, }, Expr: &expr.UnaryMinus{ Position: &position.Position{ StartLine: 256, - EndLine: 256, - StartPos: 5038, - EndPos: 5040, + EndLine: 256, + StartPos: 5038, + EndPos: 5040, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 256, - EndLine: 256, - StartPos: 5039, - EndPos: 5040, + EndLine: 256, + StartPos: 5039, + EndPos: 5040, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 256, - EndLine: 256, - StartPos: 5039, - EndPos: 5040, + EndLine: 256, + StartPos: 5039, + EndPos: 5040, }, Value: "a", }, @@ -12136,30 +12204,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 257, - EndLine: 257, - StartPos: 5045, - EndPos: 5048, + EndLine: 257, + StartPos: 5045, + EndPos: 5048, }, Expr: &expr.UnaryPlus{ Position: &position.Position{ StartLine: 257, - EndLine: 257, - StartPos: 5045, - EndPos: 5047, + EndLine: 257, + StartPos: 5045, + EndPos: 5047, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 257, - EndLine: 257, - StartPos: 5046, - EndPos: 5047, + EndLine: 257, + StartPos: 5046, + EndPos: 5047, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 257, - EndLine: 257, - StartPos: 5046, - EndPos: 5047, + EndLine: 257, + StartPos: 5046, + EndPos: 5047, }, Value: "a", }, @@ -12169,30 +12237,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 258, - EndLine: 258, - StartPos: 5052, - EndPos: 5055, + EndLine: 258, + StartPos: 5052, + EndPos: 5055, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 258, - EndLine: 258, - StartPos: 5052, - EndPos: 5054, + EndLine: 258, + StartPos: 5052, + EndPos: 5054, }, VarName: &expr.Variable{ Position: &position.Position{ StartLine: 258, - EndLine: 258, - StartPos: 5053, - EndPos: 5054, + EndLine: 258, + StartPos: 5053, + EndPos: 5054, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 258, - EndLine: 258, - StartPos: 5053, - EndPos: 5054, + EndLine: 258, + StartPos: 5053, + EndPos: 5054, }, Value: "a", }, @@ -12202,46 +12270,46 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 259, - EndLine: 259, - StartPos: 5059, - EndPos: 5064, + EndLine: 259, + StartPos: 5059, + EndPos: 5064, }, Expr: &expr.Yield{ Position: &position.Position{ StartLine: 259, - EndLine: 259, - StartPos: 5059, - EndPos: 5063, + EndLine: 259, + StartPos: 5059, + EndPos: 5063, }, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 260, - EndLine: 260, - StartPos: 5068, - EndPos: 5076, + EndLine: 260, + StartPos: 5068, + EndPos: 5076, }, Expr: &expr.Yield{ Position: &position.Position{ StartLine: 260, - EndLine: 260, - StartPos: 5068, - EndPos: 5075, + EndLine: 260, + StartPos: 5068, + EndPos: 5075, }, Value: &expr.Variable{ Position: &position.Position{ StartLine: 260, - EndLine: 260, - StartPos: 5074, - EndPos: 5075, + EndLine: 260, + StartPos: 5074, + EndPos: 5075, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 260, - EndLine: 260, - StartPos: 5074, - EndPos: 5075, + EndLine: 260, + StartPos: 5074, + EndPos: 5075, }, Value: "a", }, @@ -12251,30 +12319,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 261, - EndLine: 261, - StartPos: 5080, - EndPos: 5094, + EndLine: 261, + StartPos: 5080, + EndPos: 5094, }, Expr: &expr.Yield{ Position: &position.Position{ StartLine: 261, - EndLine: 261, - StartPos: 5080, - EndPos: 5093, + EndLine: 261, + StartPos: 5080, + EndPos: 5093, }, Key: &expr.Variable{ Position: &position.Position{ StartLine: 261, - EndLine: 261, - StartPos: 5086, - EndPos: 5087, + EndLine: 261, + StartPos: 5086, + EndPos: 5087, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 261, - EndLine: 261, - StartPos: 5086, - EndPos: 5087, + EndLine: 261, + StartPos: 5086, + EndPos: 5087, }, Value: "a", }, @@ -12282,16 +12350,16 @@ func TestPhp7(t *testing.T) { Value: &expr.Variable{ Position: &position.Position{ StartLine: 261, - EndLine: 261, - StartPos: 5092, - EndPos: 5093, + EndLine: 261, + StartPos: 5092, + EndPos: 5093, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 261, - EndLine: 261, - StartPos: 5092, - EndPos: 5093, + EndLine: 261, + StartPos: 5092, + EndPos: 5093, }, Value: "b", }, @@ -12301,30 +12369,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 262, - EndLine: 262, - StartPos: 5098, - EndPos: 5111, + EndLine: 262, + StartPos: 5098, + EndPos: 5111, }, Expr: &expr.YieldFrom{ Position: &position.Position{ StartLine: 262, - EndLine: 262, - StartPos: 5098, - EndPos: 5110, + EndLine: 262, + StartPos: 5098, + EndPos: 5110, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 262, - EndLine: 262, - StartPos: 5109, - EndPos: 5110, + EndLine: 262, + StartPos: 5109, + EndPos: 5110, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 262, - EndLine: 262, - StartPos: 5109, - EndPos: 5110, + EndLine: 262, + StartPos: 5109, + EndPos: 5110, }, Value: "a", }, @@ -12334,30 +12402,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 264, - EndLine: 264, - StartPos: 5118, - EndPos: 5127, + EndLine: 264, + StartPos: 5118, + EndPos: 5127, }, Expr: &cast.Array{ Position: &position.Position{ StartLine: 264, - EndLine: 264, - StartPos: 5118, - EndPos: 5126, + EndLine: 264, + StartPos: 5118, + EndPos: 5126, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 264, - EndLine: 264, - StartPos: 5125, - EndPos: 5126, + EndLine: 264, + StartPos: 5125, + EndPos: 5126, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 264, - EndLine: 264, - StartPos: 5125, - EndPos: 5126, + EndLine: 264, + StartPos: 5125, + EndPos: 5126, }, Value: "a", }, @@ -12367,30 +12435,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 265, - EndLine: 265, - StartPos: 5131, - EndPos: 5142, + EndLine: 265, + StartPos: 5131, + EndPos: 5142, }, Expr: &cast.Bool{ Position: &position.Position{ StartLine: 265, - EndLine: 265, - StartPos: 5131, - EndPos: 5141, + EndLine: 265, + StartPos: 5131, + EndPos: 5141, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 265, - EndLine: 265, - StartPos: 5140, - EndPos: 5141, + EndLine: 265, + StartPos: 5140, + EndPos: 5141, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 265, - EndLine: 265, - StartPos: 5140, - EndPos: 5141, + EndLine: 265, + StartPos: 5140, + EndPos: 5141, }, Value: "a", }, @@ -12400,30 +12468,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 266, - EndLine: 266, - StartPos: 5146, - EndPos: 5154, + EndLine: 266, + StartPos: 5146, + EndPos: 5154, }, Expr: &cast.Bool{ Position: &position.Position{ StartLine: 266, - EndLine: 266, - StartPos: 5146, - EndPos: 5153, + EndLine: 266, + StartPos: 5146, + EndPos: 5153, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 266, - EndLine: 266, - StartPos: 5152, - EndPos: 5153, + EndLine: 266, + StartPos: 5152, + EndPos: 5153, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 266, - EndLine: 266, - StartPos: 5152, - EndPos: 5153, + EndLine: 266, + StartPos: 5152, + EndPos: 5153, }, Value: "a", }, @@ -12433,30 +12501,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 267, - EndLine: 267, - StartPos: 5158, - EndPos: 5168, + EndLine: 267, + StartPos: 5158, + EndPos: 5168, }, Expr: &cast.Double{ Position: &position.Position{ StartLine: 267, - EndLine: 267, - StartPos: 5158, - EndPos: 5167, + EndLine: 267, + StartPos: 5158, + EndPos: 5167, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 267, - EndLine: 267, - StartPos: 5166, - EndPos: 5167, + EndLine: 267, + StartPos: 5166, + EndPos: 5167, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 267, - EndLine: 267, - StartPos: 5166, - EndPos: 5167, + EndLine: 267, + StartPos: 5166, + EndPos: 5167, }, Value: "a", }, @@ -12466,30 +12534,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 268, - EndLine: 268, - StartPos: 5172, - EndPos: 5181, + EndLine: 268, + StartPos: 5172, + EndPos: 5181, }, Expr: &cast.Double{ Position: &position.Position{ StartLine: 268, - EndLine: 268, - StartPos: 5172, - EndPos: 5180, + EndLine: 268, + StartPos: 5172, + EndPos: 5180, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 268, - EndLine: 268, - StartPos: 5179, - EndPos: 5180, + EndLine: 268, + StartPos: 5179, + EndPos: 5180, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 268, - EndLine: 268, - StartPos: 5179, - EndPos: 5180, + EndLine: 268, + StartPos: 5179, + EndPos: 5180, }, Value: "a", }, @@ -12499,30 +12567,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 269, - EndLine: 269, - StartPos: 5185, - EndPos: 5196, + EndLine: 269, + StartPos: 5185, + EndPos: 5196, }, Expr: &cast.Int{ Position: &position.Position{ StartLine: 269, - EndLine: 269, - StartPos: 5185, - EndPos: 5195, + EndLine: 269, + StartPos: 5185, + EndPos: 5195, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 269, - EndLine: 269, - StartPos: 5194, - EndPos: 5195, + EndLine: 269, + StartPos: 5194, + EndPos: 5195, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 269, - EndLine: 269, - StartPos: 5194, - EndPos: 5195, + EndLine: 269, + StartPos: 5194, + EndPos: 5195, }, Value: "a", }, @@ -12532,30 +12600,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 270, - EndLine: 270, - StartPos: 5200, - EndPos: 5207, + EndLine: 270, + StartPos: 5200, + EndPos: 5207, }, Expr: &cast.Int{ Position: &position.Position{ StartLine: 270, - EndLine: 270, - StartPos: 5200, - EndPos: 5206, + EndLine: 270, + StartPos: 5200, + EndPos: 5206, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 270, - EndLine: 270, - StartPos: 5205, - EndPos: 5206, + EndLine: 270, + StartPos: 5205, + EndPos: 5206, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 270, - EndLine: 270, - StartPos: 5205, - EndPos: 5206, + EndLine: 270, + StartPos: 5205, + EndPos: 5206, }, Value: "a", }, @@ -12565,30 +12633,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 271, - EndLine: 271, - StartPos: 5211, - EndPos: 5221, + EndLine: 271, + StartPos: 5211, + EndPos: 5221, }, Expr: &cast.Object{ Position: &position.Position{ StartLine: 271, - EndLine: 271, - StartPos: 5211, - EndPos: 5220, + EndLine: 271, + StartPos: 5211, + EndPos: 5220, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 271, - EndLine: 271, - StartPos: 5219, - EndPos: 5220, + EndLine: 271, + StartPos: 5219, + EndPos: 5220, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 271, - EndLine: 271, - StartPos: 5219, - EndPos: 5220, + EndLine: 271, + StartPos: 5219, + EndPos: 5220, }, Value: "a", }, @@ -12598,30 +12666,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 272, - EndLine: 272, - StartPos: 5225, - EndPos: 5235, + EndLine: 272, + StartPos: 5225, + EndPos: 5235, }, Expr: &cast.String{ Position: &position.Position{ StartLine: 272, - EndLine: 272, - StartPos: 5225, - EndPos: 5234, + EndLine: 272, + StartPos: 5225, + EndPos: 5234, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 272, - EndLine: 272, - StartPos: 5233, - EndPos: 5234, + EndLine: 272, + StartPos: 5233, + EndPos: 5234, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 272, - EndLine: 272, - StartPos: 5233, - EndPos: 5234, + EndLine: 272, + StartPos: 5233, + EndPos: 5234, }, Value: "a", }, @@ -12631,30 +12699,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 273, - EndLine: 273, - StartPos: 5239, - EndPos: 5248, + EndLine: 273, + StartPos: 5239, + EndPos: 5248, }, Expr: &cast.Unset{ Position: &position.Position{ StartLine: 273, - EndLine: 273, - StartPos: 5239, - EndPos: 5247, + EndLine: 273, + StartPos: 5239, + EndPos: 5247, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 273, - EndLine: 273, - StartPos: 5246, - EndPos: 5247, + EndLine: 273, + StartPos: 5246, + EndPos: 5247, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 273, - EndLine: 273, - StartPos: 5246, - EndPos: 5247, + EndLine: 273, + StartPos: 5246, + EndPos: 5247, }, Value: "a", }, @@ -12664,30 +12732,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 275, - EndLine: 275, - StartPos: 5253, - EndPos: 5260, + EndLine: 275, + StartPos: 5253, + EndPos: 5260, }, Expr: &binary.BitwiseAnd{ Position: &position.Position{ StartLine: 275, - EndLine: 275, - StartPos: 5253, - EndPos: 5259, + EndLine: 275, + StartPos: 5253, + EndPos: 5259, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 275, - EndLine: 275, - StartPos: 5253, - EndPos: 5254, + EndLine: 275, + StartPos: 5253, + EndPos: 5254, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 275, - EndLine: 275, - StartPos: 5253, - EndPos: 5254, + EndLine: 275, + StartPos: 5253, + EndPos: 5254, }, Value: "a", }, @@ -12695,16 +12763,16 @@ func TestPhp7(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 275, - EndLine: 275, - StartPos: 5258, - EndPos: 5259, + EndLine: 275, + StartPos: 5258, + EndPos: 5259, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 275, - EndLine: 275, - StartPos: 5258, - EndPos: 5259, + EndLine: 275, + StartPos: 5258, + EndPos: 5259, }, Value: "b", }, @@ -12714,30 +12782,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 276, - EndLine: 276, - StartPos: 5264, - EndPos: 5271, + EndLine: 276, + StartPos: 5264, + EndPos: 5271, }, Expr: &binary.BitwiseOr{ Position: &position.Position{ StartLine: 276, - EndLine: 276, - StartPos: 5264, - EndPos: 5270, + EndLine: 276, + StartPos: 5264, + EndPos: 5270, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 276, - EndLine: 276, - StartPos: 5264, - EndPos: 5265, + EndLine: 276, + StartPos: 5264, + EndPos: 5265, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 276, - EndLine: 276, - StartPos: 5264, - EndPos: 5265, + EndLine: 276, + StartPos: 5264, + EndPos: 5265, }, Value: "a", }, @@ -12745,16 +12813,16 @@ func TestPhp7(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 276, - EndLine: 276, - StartPos: 5269, - EndPos: 5270, + EndLine: 276, + StartPos: 5269, + EndPos: 5270, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 276, - EndLine: 276, - StartPos: 5269, - EndPos: 5270, + EndLine: 276, + StartPos: 5269, + EndPos: 5270, }, Value: "b", }, @@ -12764,30 +12832,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 277, - EndLine: 277, - StartPos: 5275, - EndPos: 5282, + EndLine: 277, + StartPos: 5275, + EndPos: 5282, }, Expr: &binary.BitwiseXor{ Position: &position.Position{ StartLine: 277, - EndLine: 277, - StartPos: 5275, - EndPos: 5281, + EndLine: 277, + StartPos: 5275, + EndPos: 5281, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 277, - EndLine: 277, - StartPos: 5275, - EndPos: 5276, + EndLine: 277, + StartPos: 5275, + EndPos: 5276, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 277, - EndLine: 277, - StartPos: 5275, - EndPos: 5276, + EndLine: 277, + StartPos: 5275, + EndPos: 5276, }, Value: "a", }, @@ -12795,16 +12863,16 @@ func TestPhp7(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 277, - EndLine: 277, - StartPos: 5280, - EndPos: 5281, + EndLine: 277, + StartPos: 5280, + EndPos: 5281, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 277, - EndLine: 277, - StartPos: 5280, - EndPos: 5281, + EndLine: 277, + StartPos: 5280, + EndPos: 5281, }, Value: "b", }, @@ -12814,30 +12882,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 278, - EndLine: 278, - StartPos: 5286, - EndPos: 5294, + EndLine: 278, + StartPos: 5286, + EndPos: 5294, }, Expr: &binary.BooleanAnd{ Position: &position.Position{ StartLine: 278, - EndLine: 278, - StartPos: 5286, - EndPos: 5293, + EndLine: 278, + StartPos: 5286, + EndPos: 5293, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 278, - EndLine: 278, - StartPos: 5286, - EndPos: 5287, + EndLine: 278, + StartPos: 5286, + EndPos: 5287, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 278, - EndLine: 278, - StartPos: 5286, - EndPos: 5287, + EndLine: 278, + StartPos: 5286, + EndPos: 5287, }, Value: "a", }, @@ -12845,16 +12913,16 @@ func TestPhp7(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 278, - EndLine: 278, - StartPos: 5292, - EndPos: 5293, + EndLine: 278, + StartPos: 5292, + EndPos: 5293, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 278, - EndLine: 278, - StartPos: 5292, - EndPos: 5293, + EndLine: 278, + StartPos: 5292, + EndPos: 5293, }, Value: "b", }, @@ -12864,30 +12932,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 279, - EndLine: 279, - StartPos: 5298, - EndPos: 5306, + EndLine: 279, + StartPos: 5298, + EndPos: 5306, }, Expr: &binary.BooleanOr{ Position: &position.Position{ StartLine: 279, - EndLine: 279, - StartPos: 5298, - EndPos: 5305, + EndLine: 279, + StartPos: 5298, + EndPos: 5305, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 279, - EndLine: 279, - StartPos: 5298, - EndPos: 5299, + EndLine: 279, + StartPos: 5298, + EndPos: 5299, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 279, - EndLine: 279, - StartPos: 5298, - EndPos: 5299, + EndLine: 279, + StartPos: 5298, + EndPos: 5299, }, Value: "a", }, @@ -12895,16 +12963,16 @@ func TestPhp7(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 279, - EndLine: 279, - StartPos: 5304, - EndPos: 5305, + EndLine: 279, + StartPos: 5304, + EndPos: 5305, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 279, - EndLine: 279, - StartPos: 5304, - EndPos: 5305, + EndLine: 279, + StartPos: 5304, + EndPos: 5305, }, Value: "b", }, @@ -12914,30 +12982,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 280, - EndLine: 280, - StartPos: 5310, - EndPos: 5318, + EndLine: 280, + StartPos: 5310, + EndPos: 5318, }, Expr: &binary.Coalesce{ Position: &position.Position{ StartLine: 280, - EndLine: 280, - StartPos: 5310, - EndPos: 5317, + EndLine: 280, + StartPos: 5310, + EndPos: 5317, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 280, - EndLine: 280, - StartPos: 5310, - EndPos: 5311, + EndLine: 280, + StartPos: 5310, + EndPos: 5311, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 280, - EndLine: 280, - StartPos: 5310, - EndPos: 5311, + EndLine: 280, + StartPos: 5310, + EndPos: 5311, }, Value: "a", }, @@ -12945,16 +13013,16 @@ func TestPhp7(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 280, - EndLine: 280, - StartPos: 5316, - EndPos: 5317, + EndLine: 280, + StartPos: 5316, + EndPos: 5317, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 280, - EndLine: 280, - StartPos: 5316, - EndPos: 5317, + EndLine: 280, + StartPos: 5316, + EndPos: 5317, }, Value: "b", }, @@ -12964,30 +13032,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 281, - EndLine: 281, - StartPos: 5322, - EndPos: 5329, + EndLine: 281, + StartPos: 5322, + EndPos: 5329, }, Expr: &binary.Concat{ Position: &position.Position{ StartLine: 281, - EndLine: 281, - StartPos: 5322, - EndPos: 5328, + EndLine: 281, + StartPos: 5322, + EndPos: 5328, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 281, - EndLine: 281, - StartPos: 5322, - EndPos: 5323, + EndLine: 281, + StartPos: 5322, + EndPos: 5323, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 281, - EndLine: 281, - StartPos: 5322, - EndPos: 5323, + EndLine: 281, + StartPos: 5322, + EndPos: 5323, }, Value: "a", }, @@ -12995,16 +13063,16 @@ func TestPhp7(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 281, - EndLine: 281, - StartPos: 5327, - EndPos: 5328, + EndLine: 281, + StartPos: 5327, + EndPos: 5328, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 281, - EndLine: 281, - StartPos: 5327, - EndPos: 5328, + EndLine: 281, + StartPos: 5327, + EndPos: 5328, }, Value: "b", }, @@ -13014,30 +13082,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 282, - EndLine: 282, - StartPos: 5333, - EndPos: 5340, + EndLine: 282, + StartPos: 5333, + EndPos: 5340, }, Expr: &binary.Div{ Position: &position.Position{ StartLine: 282, - EndLine: 282, - StartPos: 5333, - EndPos: 5339, + EndLine: 282, + StartPos: 5333, + EndPos: 5339, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 282, - EndLine: 282, - StartPos: 5333, - EndPos: 5334, + EndLine: 282, + StartPos: 5333, + EndPos: 5334, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 282, - EndLine: 282, - StartPos: 5333, - EndPos: 5334, + EndLine: 282, + StartPos: 5333, + EndPos: 5334, }, Value: "a", }, @@ -13045,16 +13113,16 @@ func TestPhp7(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 282, - EndLine: 282, - StartPos: 5338, - EndPos: 5339, + EndLine: 282, + StartPos: 5338, + EndPos: 5339, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 282, - EndLine: 282, - StartPos: 5338, - EndPos: 5339, + EndLine: 282, + StartPos: 5338, + EndPos: 5339, }, Value: "b", }, @@ -13064,30 +13132,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 283, - EndLine: 283, - StartPos: 5344, - EndPos: 5352, + EndLine: 283, + StartPos: 5344, + EndPos: 5352, }, Expr: &binary.Equal{ Position: &position.Position{ StartLine: 283, - EndLine: 283, - StartPos: 5344, - EndPos: 5351, + EndLine: 283, + StartPos: 5344, + EndPos: 5351, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 283, - EndLine: 283, - StartPos: 5344, - EndPos: 5345, + EndLine: 283, + StartPos: 5344, + EndPos: 5345, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 283, - EndLine: 283, - StartPos: 5344, - EndPos: 5345, + EndLine: 283, + StartPos: 5344, + EndPos: 5345, }, Value: "a", }, @@ -13095,16 +13163,16 @@ func TestPhp7(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 283, - EndLine: 283, - StartPos: 5350, - EndPos: 5351, + EndLine: 283, + StartPos: 5350, + EndPos: 5351, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 283, - EndLine: 283, - StartPos: 5350, - EndPos: 5351, + EndLine: 283, + StartPos: 5350, + EndPos: 5351, }, Value: "b", }, @@ -13114,30 +13182,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 284, - EndLine: 284, - StartPos: 5356, - EndPos: 5364, + EndLine: 284, + StartPos: 5356, + EndPos: 5364, }, Expr: &binary.GreaterOrEqual{ Position: &position.Position{ StartLine: 284, - EndLine: 284, - StartPos: 5356, - EndPos: 5363, + EndLine: 284, + StartPos: 5356, + EndPos: 5363, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 284, - EndLine: 284, - StartPos: 5356, - EndPos: 5357, + EndLine: 284, + StartPos: 5356, + EndPos: 5357, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 284, - EndLine: 284, - StartPos: 5356, - EndPos: 5357, + EndLine: 284, + StartPos: 5356, + EndPos: 5357, }, Value: "a", }, @@ -13145,16 +13213,16 @@ func TestPhp7(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 284, - EndLine: 284, - StartPos: 5362, - EndPos: 5363, + EndLine: 284, + StartPos: 5362, + EndPos: 5363, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 284, - EndLine: 284, - StartPos: 5362, - EndPos: 5363, + EndLine: 284, + StartPos: 5362, + EndPos: 5363, }, Value: "b", }, @@ -13164,30 +13232,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 285, - EndLine: 285, - StartPos: 5368, - EndPos: 5375, + EndLine: 285, + StartPos: 5368, + EndPos: 5375, }, Expr: &binary.Greater{ Position: &position.Position{ StartLine: 285, - EndLine: 285, - StartPos: 5368, - EndPos: 5374, + EndLine: 285, + StartPos: 5368, + EndPos: 5374, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 285, - EndLine: 285, - StartPos: 5368, - EndPos: 5369, + EndLine: 285, + StartPos: 5368, + EndPos: 5369, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 285, - EndLine: 285, - StartPos: 5368, - EndPos: 5369, + EndLine: 285, + StartPos: 5368, + EndPos: 5369, }, Value: "a", }, @@ -13195,16 +13263,16 @@ func TestPhp7(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 285, - EndLine: 285, - StartPos: 5373, - EndPos: 5374, + EndLine: 285, + StartPos: 5373, + EndPos: 5374, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 285, - EndLine: 285, - StartPos: 5373, - EndPos: 5374, + EndLine: 285, + StartPos: 5373, + EndPos: 5374, }, Value: "b", }, @@ -13214,30 +13282,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 286, - EndLine: 286, - StartPos: 5379, - EndPos: 5388, + EndLine: 286, + StartPos: 5379, + EndPos: 5388, }, Expr: &binary.Identical{ Position: &position.Position{ StartLine: 286, - EndLine: 286, - StartPos: 5379, - EndPos: 5387, + EndLine: 286, + StartPos: 5379, + EndPos: 5387, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 286, - EndLine: 286, - StartPos: 5379, - EndPos: 5380, + EndLine: 286, + StartPos: 5379, + EndPos: 5380, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 286, - EndLine: 286, - StartPos: 5379, - EndPos: 5380, + EndLine: 286, + StartPos: 5379, + EndPos: 5380, }, Value: "a", }, @@ -13245,16 +13313,16 @@ func TestPhp7(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 286, - EndLine: 286, - StartPos: 5386, - EndPos: 5387, + EndLine: 286, + StartPos: 5386, + EndPos: 5387, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 286, - EndLine: 286, - StartPos: 5386, - EndPos: 5387, + EndLine: 286, + StartPos: 5386, + EndPos: 5387, }, Value: "b", }, @@ -13264,30 +13332,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 287, - EndLine: 287, - StartPos: 5392, - EndPos: 5401, + EndLine: 287, + StartPos: 5392, + EndPos: 5401, }, Expr: &binary.LogicalAnd{ Position: &position.Position{ StartLine: 287, - EndLine: 287, - StartPos: 5392, - EndPos: 5400, + EndLine: 287, + StartPos: 5392, + EndPos: 5400, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 287, - EndLine: 287, - StartPos: 5392, - EndPos: 5393, + EndLine: 287, + StartPos: 5392, + EndPos: 5393, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 287, - EndLine: 287, - StartPos: 5392, - EndPos: 5393, + EndLine: 287, + StartPos: 5392, + EndPos: 5393, }, Value: "a", }, @@ -13295,16 +13363,16 @@ func TestPhp7(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 287, - EndLine: 287, - StartPos: 5399, - EndPos: 5400, + EndLine: 287, + StartPos: 5399, + EndPos: 5400, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 287, - EndLine: 287, - StartPos: 5399, - EndPos: 5400, + EndLine: 287, + StartPos: 5399, + EndPos: 5400, }, Value: "b", }, @@ -13314,30 +13382,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 288, - EndLine: 288, - StartPos: 5405, - EndPos: 5413, + EndLine: 288, + StartPos: 5405, + EndPos: 5413, }, Expr: &binary.LogicalOr{ Position: &position.Position{ StartLine: 288, - EndLine: 288, - StartPos: 5405, - EndPos: 5412, + EndLine: 288, + StartPos: 5405, + EndPos: 5412, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 288, - EndLine: 288, - StartPos: 5405, - EndPos: 5406, + EndLine: 288, + StartPos: 5405, + EndPos: 5406, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 288, - EndLine: 288, - StartPos: 5405, - EndPos: 5406, + EndLine: 288, + StartPos: 5405, + EndPos: 5406, }, Value: "a", }, @@ -13345,16 +13413,16 @@ func TestPhp7(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 288, - EndLine: 288, - StartPos: 5411, - EndPos: 5412, + EndLine: 288, + StartPos: 5411, + EndPos: 5412, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 288, - EndLine: 288, - StartPos: 5411, - EndPos: 5412, + EndLine: 288, + StartPos: 5411, + EndPos: 5412, }, Value: "b", }, @@ -13364,30 +13432,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 289, - EndLine: 289, - StartPos: 5417, - EndPos: 5426, + EndLine: 289, + StartPos: 5417, + EndPos: 5426, }, Expr: &binary.LogicalXor{ Position: &position.Position{ StartLine: 289, - EndLine: 289, - StartPos: 5417, - EndPos: 5425, + EndLine: 289, + StartPos: 5417, + EndPos: 5425, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 289, - EndLine: 289, - StartPos: 5417, - EndPos: 5418, + EndLine: 289, + StartPos: 5417, + EndPos: 5418, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 289, - EndLine: 289, - StartPos: 5417, - EndPos: 5418, + EndLine: 289, + StartPos: 5417, + EndPos: 5418, }, Value: "a", }, @@ -13395,16 +13463,16 @@ func TestPhp7(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 289, - EndLine: 289, - StartPos: 5424, - EndPos: 5425, + EndLine: 289, + StartPos: 5424, + EndPos: 5425, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 289, - EndLine: 289, - StartPos: 5424, - EndPos: 5425, + EndLine: 289, + StartPos: 5424, + EndPos: 5425, }, Value: "b", }, @@ -13414,30 +13482,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 290, - EndLine: 290, - StartPos: 5430, - EndPos: 5437, + EndLine: 290, + StartPos: 5430, + EndPos: 5437, }, Expr: &binary.Minus{ Position: &position.Position{ StartLine: 290, - EndLine: 290, - StartPos: 5430, - EndPos: 5436, + EndLine: 290, + StartPos: 5430, + EndPos: 5436, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 290, - EndLine: 290, - StartPos: 5430, - EndPos: 5431, + EndLine: 290, + StartPos: 5430, + EndPos: 5431, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 290, - EndLine: 290, - StartPos: 5430, - EndPos: 5431, + EndLine: 290, + StartPos: 5430, + EndPos: 5431, }, Value: "a", }, @@ -13445,16 +13513,16 @@ func TestPhp7(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 290, - EndLine: 290, - StartPos: 5435, - EndPos: 5436, + EndLine: 290, + StartPos: 5435, + EndPos: 5436, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 290, - EndLine: 290, - StartPos: 5435, - EndPos: 5436, + EndLine: 290, + StartPos: 5435, + EndPos: 5436, }, Value: "b", }, @@ -13464,30 +13532,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 291, - EndLine: 291, - StartPos: 5441, - EndPos: 5448, + EndLine: 291, + StartPos: 5441, + EndPos: 5448, }, Expr: &binary.Mod{ Position: &position.Position{ StartLine: 291, - EndLine: 291, - StartPos: 5441, - EndPos: 5447, + EndLine: 291, + StartPos: 5441, + EndPos: 5447, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 291, - EndLine: 291, - StartPos: 5441, - EndPos: 5442, + EndLine: 291, + StartPos: 5441, + EndPos: 5442, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 291, - EndLine: 291, - StartPos: 5441, - EndPos: 5442, + EndLine: 291, + StartPos: 5441, + EndPos: 5442, }, Value: "a", }, @@ -13495,16 +13563,16 @@ func TestPhp7(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 291, - EndLine: 291, - StartPos: 5446, - EndPos: 5447, + EndLine: 291, + StartPos: 5446, + EndPos: 5447, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 291, - EndLine: 291, - StartPos: 5446, - EndPos: 5447, + EndLine: 291, + StartPos: 5446, + EndPos: 5447, }, Value: "b", }, @@ -13514,30 +13582,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 292, - EndLine: 292, - StartPos: 5452, - EndPos: 5459, + EndLine: 292, + StartPos: 5452, + EndPos: 5459, }, Expr: &binary.Mul{ Position: &position.Position{ StartLine: 292, - EndLine: 292, - StartPos: 5452, - EndPos: 5458, + EndLine: 292, + StartPos: 5452, + EndPos: 5458, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 292, - EndLine: 292, - StartPos: 5452, - EndPos: 5453, + EndLine: 292, + StartPos: 5452, + EndPos: 5453, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 292, - EndLine: 292, - StartPos: 5452, - EndPos: 5453, + EndLine: 292, + StartPos: 5452, + EndPos: 5453, }, Value: "a", }, @@ -13545,16 +13613,16 @@ func TestPhp7(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 292, - EndLine: 292, - StartPos: 5457, - EndPos: 5458, + EndLine: 292, + StartPos: 5457, + EndPos: 5458, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 292, - EndLine: 292, - StartPos: 5457, - EndPos: 5458, + EndLine: 292, + StartPos: 5457, + EndPos: 5458, }, Value: "b", }, @@ -13564,30 +13632,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 293, - EndLine: 293, - StartPos: 5463, - EndPos: 5471, + EndLine: 293, + StartPos: 5463, + EndPos: 5471, }, Expr: &binary.NotEqual{ Position: &position.Position{ StartLine: 293, - EndLine: 293, - StartPos: 5463, - EndPos: 5470, + EndLine: 293, + StartPos: 5463, + EndPos: 5470, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 293, - EndLine: 293, - StartPos: 5463, - EndPos: 5464, + EndLine: 293, + StartPos: 5463, + EndPos: 5464, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 293, - EndLine: 293, - StartPos: 5463, - EndPos: 5464, + EndLine: 293, + StartPos: 5463, + EndPos: 5464, }, Value: "a", }, @@ -13595,16 +13663,16 @@ func TestPhp7(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 293, - EndLine: 293, - StartPos: 5469, - EndPos: 5470, + EndLine: 293, + StartPos: 5469, + EndPos: 5470, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 293, - EndLine: 293, - StartPos: 5469, - EndPos: 5470, + EndLine: 293, + StartPos: 5469, + EndPos: 5470, }, Value: "b", }, @@ -13614,30 +13682,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 294, - EndLine: 294, - StartPos: 5475, - EndPos: 5484, + EndLine: 294, + StartPos: 5475, + EndPos: 5484, }, Expr: &binary.NotIdentical{ Position: &position.Position{ StartLine: 294, - EndLine: 294, - StartPos: 5475, - EndPos: 5483, + EndLine: 294, + StartPos: 5475, + EndPos: 5483, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 294, - EndLine: 294, - StartPos: 5475, - EndPos: 5476, + EndLine: 294, + StartPos: 5475, + EndPos: 5476, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 294, - EndLine: 294, - StartPos: 5475, - EndPos: 5476, + EndLine: 294, + StartPos: 5475, + EndPos: 5476, }, Value: "a", }, @@ -13645,16 +13713,16 @@ func TestPhp7(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 294, - EndLine: 294, - StartPos: 5482, - EndPos: 5483, + EndLine: 294, + StartPos: 5482, + EndPos: 5483, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 294, - EndLine: 294, - StartPos: 5482, - EndPos: 5483, + EndLine: 294, + StartPos: 5482, + EndPos: 5483, }, Value: "b", }, @@ -13664,30 +13732,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 295, - EndLine: 295, - StartPos: 5488, - EndPos: 5495, + EndLine: 295, + StartPos: 5488, + EndPos: 5495, }, Expr: &binary.Plus{ Position: &position.Position{ StartLine: 295, - EndLine: 295, - StartPos: 5488, - EndPos: 5494, + EndLine: 295, + StartPos: 5488, + EndPos: 5494, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 295, - EndLine: 295, - StartPos: 5488, - EndPos: 5489, + EndLine: 295, + StartPos: 5488, + EndPos: 5489, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 295, - EndLine: 295, - StartPos: 5488, - EndPos: 5489, + EndLine: 295, + StartPos: 5488, + EndPos: 5489, }, Value: "a", }, @@ -13695,16 +13763,16 @@ func TestPhp7(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 295, - EndLine: 295, - StartPos: 5493, - EndPos: 5494, + EndLine: 295, + StartPos: 5493, + EndPos: 5494, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 295, - EndLine: 295, - StartPos: 5493, - EndPos: 5494, + EndLine: 295, + StartPos: 5493, + EndPos: 5494, }, Value: "b", }, @@ -13714,30 +13782,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 296, - EndLine: 296, - StartPos: 5499, - EndPos: 5507, + EndLine: 296, + StartPos: 5499, + EndPos: 5507, }, Expr: &binary.Pow{ Position: &position.Position{ StartLine: 296, - EndLine: 296, - StartPos: 5499, - EndPos: 5506, + EndLine: 296, + StartPos: 5499, + EndPos: 5506, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 296, - EndLine: 296, - StartPos: 5499, - EndPos: 5500, + EndLine: 296, + StartPos: 5499, + EndPos: 5500, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 296, - EndLine: 296, - StartPos: 5499, - EndPos: 5500, + EndLine: 296, + StartPos: 5499, + EndPos: 5500, }, Value: "a", }, @@ -13745,16 +13813,16 @@ func TestPhp7(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 296, - EndLine: 296, - StartPos: 5505, - EndPos: 5506, + EndLine: 296, + StartPos: 5505, + EndPos: 5506, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 296, - EndLine: 296, - StartPos: 5505, - EndPos: 5506, + EndLine: 296, + StartPos: 5505, + EndPos: 5506, }, Value: "b", }, @@ -13764,30 +13832,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 297, - EndLine: 297, - StartPos: 5511, - EndPos: 5519, + EndLine: 297, + StartPos: 5511, + EndPos: 5519, }, Expr: &binary.ShiftLeft{ Position: &position.Position{ StartLine: 297, - EndLine: 297, - StartPos: 5511, - EndPos: 5518, + EndLine: 297, + StartPos: 5511, + EndPos: 5518, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 297, - EndLine: 297, - StartPos: 5511, - EndPos: 5512, + EndLine: 297, + StartPos: 5511, + EndPos: 5512, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 297, - EndLine: 297, - StartPos: 5511, - EndPos: 5512, + EndLine: 297, + StartPos: 5511, + EndPos: 5512, }, Value: "a", }, @@ -13795,16 +13863,16 @@ func TestPhp7(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 297, - EndLine: 297, - StartPos: 5517, - EndPos: 5518, + EndLine: 297, + StartPos: 5517, + EndPos: 5518, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 297, - EndLine: 297, - StartPos: 5517, - EndPos: 5518, + EndLine: 297, + StartPos: 5517, + EndPos: 5518, }, Value: "b", }, @@ -13814,30 +13882,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 298, - EndLine: 298, - StartPos: 5523, - EndPos: 5531, + EndLine: 298, + StartPos: 5523, + EndPos: 5531, }, Expr: &binary.ShiftRight{ Position: &position.Position{ StartLine: 298, - EndLine: 298, - StartPos: 5523, - EndPos: 5530, + EndLine: 298, + StartPos: 5523, + EndPos: 5530, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 298, - EndLine: 298, - StartPos: 5523, - EndPos: 5524, + EndLine: 298, + StartPos: 5523, + EndPos: 5524, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 298, - EndLine: 298, - StartPos: 5523, - EndPos: 5524, + EndLine: 298, + StartPos: 5523, + EndPos: 5524, }, Value: "a", }, @@ -13845,16 +13913,16 @@ func TestPhp7(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 298, - EndLine: 298, - StartPos: 5529, - EndPos: 5530, + EndLine: 298, + StartPos: 5529, + EndPos: 5530, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 298, - EndLine: 298, - StartPos: 5529, - EndPos: 5530, + EndLine: 298, + StartPos: 5529, + EndPos: 5530, }, Value: "b", }, @@ -13864,30 +13932,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 299, - EndLine: 299, - StartPos: 5535, - EndPos: 5543, + EndLine: 299, + StartPos: 5535, + EndPos: 5543, }, Expr: &binary.SmallerOrEqual{ Position: &position.Position{ StartLine: 299, - EndLine: 299, - StartPos: 5535, - EndPos: 5542, + EndLine: 299, + StartPos: 5535, + EndPos: 5542, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 299, - EndLine: 299, - StartPos: 5535, - EndPos: 5536, + EndLine: 299, + StartPos: 5535, + EndPos: 5536, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 299, - EndLine: 299, - StartPos: 5535, - EndPos: 5536, + EndLine: 299, + StartPos: 5535, + EndPos: 5536, }, Value: "a", }, @@ -13895,16 +13963,16 @@ func TestPhp7(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 299, - EndLine: 299, - StartPos: 5541, - EndPos: 5542, + EndLine: 299, + StartPos: 5541, + EndPos: 5542, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 299, - EndLine: 299, - StartPos: 5541, - EndPos: 5542, + EndLine: 299, + StartPos: 5541, + EndPos: 5542, }, Value: "b", }, @@ -13914,30 +13982,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 300, - EndLine: 300, - StartPos: 5547, - EndPos: 5554, + EndLine: 300, + StartPos: 5547, + EndPos: 5554, }, Expr: &binary.Smaller{ Position: &position.Position{ StartLine: 300, - EndLine: 300, - StartPos: 5547, - EndPos: 5553, + EndLine: 300, + StartPos: 5547, + EndPos: 5553, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 300, - EndLine: 300, - StartPos: 5547, - EndPos: 5548, + EndLine: 300, + StartPos: 5547, + EndPos: 5548, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 300, - EndLine: 300, - StartPos: 5547, - EndPos: 5548, + EndLine: 300, + StartPos: 5547, + EndPos: 5548, }, Value: "a", }, @@ -13945,16 +14013,16 @@ func TestPhp7(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 300, - EndLine: 300, - StartPos: 5552, - EndPos: 5553, + EndLine: 300, + StartPos: 5552, + EndPos: 5553, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 300, - EndLine: 300, - StartPos: 5552, - EndPos: 5553, + EndLine: 300, + StartPos: 5552, + EndPos: 5553, }, Value: "b", }, @@ -13964,30 +14032,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 301, - EndLine: 301, - StartPos: 5558, - EndPos: 5567, + EndLine: 301, + StartPos: 5558, + EndPos: 5567, }, Expr: &binary.Spaceship{ Position: &position.Position{ StartLine: 301, - EndLine: 301, - StartPos: 5558, - EndPos: 5566, + EndLine: 301, + StartPos: 5558, + EndPos: 5566, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 301, - EndLine: 301, - StartPos: 5558, - EndPos: 5559, + EndLine: 301, + StartPos: 5558, + EndPos: 5559, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 301, - EndLine: 301, - StartPos: 5558, - EndPos: 5559, + EndLine: 301, + StartPos: 5558, + EndPos: 5559, }, Value: "a", }, @@ -13995,16 +14063,16 @@ func TestPhp7(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 301, - EndLine: 301, - StartPos: 5565, - EndPos: 5566, + EndLine: 301, + StartPos: 5565, + EndPos: 5566, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 301, - EndLine: 301, - StartPos: 5565, - EndPos: 5566, + EndLine: 301, + StartPos: 5565, + EndPos: 5566, }, Value: "b", }, @@ -14014,30 +14082,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 303, - EndLine: 303, - StartPos: 5572, - EndPos: 5580, + EndLine: 303, + StartPos: 5572, + EndPos: 5580, }, Expr: &assign.Reference{ Position: &position.Position{ StartLine: 303, - EndLine: 303, - StartPos: 5572, - EndPos: 5579, + EndLine: 303, + StartPos: 5572, + EndPos: 5579, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 303, - EndLine: 303, - StartPos: 5572, - EndPos: 5573, + EndLine: 303, + StartPos: 5572, + EndPos: 5573, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 303, - EndLine: 303, - StartPos: 5572, - EndPos: 5573, + EndLine: 303, + StartPos: 5572, + EndPos: 5573, }, Value: "a", }, @@ -14045,16 +14113,16 @@ func TestPhp7(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 303, - EndLine: 303, - StartPos: 5578, - EndPos: 5579, + EndLine: 303, + StartPos: 5578, + EndPos: 5579, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 303, - EndLine: 303, - StartPos: 5578, - EndPos: 5579, + EndLine: 303, + StartPos: 5578, + EndPos: 5579, }, Value: "b", }, @@ -14064,30 +14132,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 304, - EndLine: 304, - StartPos: 5584, - EndPos: 5591, + EndLine: 304, + StartPos: 5584, + EndPos: 5591, }, Expr: &assign.Assign{ Position: &position.Position{ StartLine: 304, - EndLine: 304, - StartPos: 5584, - EndPos: 5590, + EndLine: 304, + StartPos: 5584, + EndPos: 5590, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 304, - EndLine: 304, - StartPos: 5584, - EndPos: 5585, + EndLine: 304, + StartPos: 5584, + EndPos: 5585, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 304, - EndLine: 304, - StartPos: 5584, - EndPos: 5585, + EndLine: 304, + StartPos: 5584, + EndPos: 5585, }, Value: "a", }, @@ -14095,16 +14163,16 @@ func TestPhp7(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 304, - EndLine: 304, - StartPos: 5589, - EndPos: 5590, + EndLine: 304, + StartPos: 5589, + EndPos: 5590, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 304, - EndLine: 304, - StartPos: 5589, - EndPos: 5590, + EndLine: 304, + StartPos: 5589, + EndPos: 5590, }, Value: "b", }, @@ -14114,30 +14182,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 305, - EndLine: 305, - StartPos: 5595, - EndPos: 5603, + EndLine: 305, + StartPos: 5595, + EndPos: 5603, }, Expr: &assign.BitwiseAnd{ Position: &position.Position{ StartLine: 305, - EndLine: 305, - StartPos: 5595, - EndPos: 5602, + EndLine: 305, + StartPos: 5595, + EndPos: 5602, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 305, - EndLine: 305, - StartPos: 5595, - EndPos: 5596, + EndLine: 305, + StartPos: 5595, + EndPos: 5596, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 305, - EndLine: 305, - StartPos: 5595, - EndPos: 5596, + EndLine: 305, + StartPos: 5595, + EndPos: 5596, }, Value: "a", }, @@ -14145,16 +14213,16 @@ func TestPhp7(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 305, - EndLine: 305, - StartPos: 5601, - EndPos: 5602, + EndLine: 305, + StartPos: 5601, + EndPos: 5602, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 305, - EndLine: 305, - StartPos: 5601, - EndPos: 5602, + EndLine: 305, + StartPos: 5601, + EndPos: 5602, }, Value: "b", }, @@ -14164,30 +14232,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 306, - EndLine: 306, - StartPos: 5607, - EndPos: 5615, + EndLine: 306, + StartPos: 5607, + EndPos: 5615, }, Expr: &assign.BitwiseOr{ Position: &position.Position{ StartLine: 306, - EndLine: 306, - StartPos: 5607, - EndPos: 5614, + EndLine: 306, + StartPos: 5607, + EndPos: 5614, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 306, - EndLine: 306, - StartPos: 5607, - EndPos: 5608, + EndLine: 306, + StartPos: 5607, + EndPos: 5608, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 306, - EndLine: 306, - StartPos: 5607, - EndPos: 5608, + EndLine: 306, + StartPos: 5607, + EndPos: 5608, }, Value: "a", }, @@ -14195,16 +14263,16 @@ func TestPhp7(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 306, - EndLine: 306, - StartPos: 5613, - EndPos: 5614, + EndLine: 306, + StartPos: 5613, + EndPos: 5614, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 306, - EndLine: 306, - StartPos: 5613, - EndPos: 5614, + EndLine: 306, + StartPos: 5613, + EndPos: 5614, }, Value: "b", }, @@ -14214,30 +14282,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 307, - EndLine: 307, - StartPos: 5619, - EndPos: 5627, + EndLine: 307, + StartPos: 5619, + EndPos: 5627, }, Expr: &assign.BitwiseXor{ Position: &position.Position{ StartLine: 307, - EndLine: 307, - StartPos: 5619, - EndPos: 5626, + EndLine: 307, + StartPos: 5619, + EndPos: 5626, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 307, - EndLine: 307, - StartPos: 5619, - EndPos: 5620, + EndLine: 307, + StartPos: 5619, + EndPos: 5620, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 307, - EndLine: 307, - StartPos: 5619, - EndPos: 5620, + EndLine: 307, + StartPos: 5619, + EndPos: 5620, }, Value: "a", }, @@ -14245,16 +14313,16 @@ func TestPhp7(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 307, - EndLine: 307, - StartPos: 5625, - EndPos: 5626, + EndLine: 307, + StartPos: 5625, + EndPos: 5626, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 307, - EndLine: 307, - StartPos: 5625, - EndPos: 5626, + EndLine: 307, + StartPos: 5625, + EndPos: 5626, }, Value: "b", }, @@ -14264,30 +14332,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 308, - EndLine: 308, - StartPos: 5631, - EndPos: 5639, + EndLine: 308, + StartPos: 5631, + EndPos: 5639, }, Expr: &assign.Concat{ Position: &position.Position{ StartLine: 308, - EndLine: 308, - StartPos: 5631, - EndPos: 5638, + EndLine: 308, + StartPos: 5631, + EndPos: 5638, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 308, - EndLine: 308, - StartPos: 5631, - EndPos: 5632, + EndLine: 308, + StartPos: 5631, + EndPos: 5632, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 308, - EndLine: 308, - StartPos: 5631, - EndPos: 5632, + EndLine: 308, + StartPos: 5631, + EndPos: 5632, }, Value: "a", }, @@ -14295,16 +14363,16 @@ func TestPhp7(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 308, - EndLine: 308, - StartPos: 5637, - EndPos: 5638, + EndLine: 308, + StartPos: 5637, + EndPos: 5638, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 308, - EndLine: 308, - StartPos: 5637, - EndPos: 5638, + EndLine: 308, + StartPos: 5637, + EndPos: 5638, }, Value: "b", }, @@ -14314,30 +14382,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 309, - EndLine: 309, - StartPos: 5643, - EndPos: 5651, + EndLine: 309, + StartPos: 5643, + EndPos: 5651, }, Expr: &assign.Div{ Position: &position.Position{ StartLine: 309, - EndLine: 309, - StartPos: 5643, - EndPos: 5650, + EndLine: 309, + StartPos: 5643, + EndPos: 5650, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 309, - EndLine: 309, - StartPos: 5643, - EndPos: 5644, + EndLine: 309, + StartPos: 5643, + EndPos: 5644, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 309, - EndLine: 309, - StartPos: 5643, - EndPos: 5644, + EndLine: 309, + StartPos: 5643, + EndPos: 5644, }, Value: "a", }, @@ -14345,16 +14413,16 @@ func TestPhp7(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 309, - EndLine: 309, - StartPos: 5649, - EndPos: 5650, + EndLine: 309, + StartPos: 5649, + EndPos: 5650, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 309, - EndLine: 309, - StartPos: 5649, - EndPos: 5650, + EndLine: 309, + StartPos: 5649, + EndPos: 5650, }, Value: "b", }, @@ -14364,30 +14432,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 310, - EndLine: 310, - StartPos: 5655, - EndPos: 5663, + EndLine: 310, + StartPos: 5655, + EndPos: 5663, }, Expr: &assign.Minus{ Position: &position.Position{ StartLine: 310, - EndLine: 310, - StartPos: 5655, - EndPos: 5662, + EndLine: 310, + StartPos: 5655, + EndPos: 5662, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 310, - EndLine: 310, - StartPos: 5655, - EndPos: 5656, + EndLine: 310, + StartPos: 5655, + EndPos: 5656, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 310, - EndLine: 310, - StartPos: 5655, - EndPos: 5656, + EndLine: 310, + StartPos: 5655, + EndPos: 5656, }, Value: "a", }, @@ -14395,16 +14463,16 @@ func TestPhp7(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 310, - EndLine: 310, - StartPos: 5661, - EndPos: 5662, + EndLine: 310, + StartPos: 5661, + EndPos: 5662, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 310, - EndLine: 310, - StartPos: 5661, - EndPos: 5662, + EndLine: 310, + StartPos: 5661, + EndPos: 5662, }, Value: "b", }, @@ -14414,30 +14482,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 311, - EndLine: 311, - StartPos: 5667, - EndPos: 5675, + EndLine: 311, + StartPos: 5667, + EndPos: 5675, }, Expr: &assign.Mod{ Position: &position.Position{ StartLine: 311, - EndLine: 311, - StartPos: 5667, - EndPos: 5674, + EndLine: 311, + StartPos: 5667, + EndPos: 5674, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 311, - EndLine: 311, - StartPos: 5667, - EndPos: 5668, + EndLine: 311, + StartPos: 5667, + EndPos: 5668, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 311, - EndLine: 311, - StartPos: 5667, - EndPos: 5668, + EndLine: 311, + StartPos: 5667, + EndPos: 5668, }, Value: "a", }, @@ -14445,16 +14513,16 @@ func TestPhp7(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 311, - EndLine: 311, - StartPos: 5673, - EndPos: 5674, + EndLine: 311, + StartPos: 5673, + EndPos: 5674, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 311, - EndLine: 311, - StartPos: 5673, - EndPos: 5674, + EndLine: 311, + StartPos: 5673, + EndPos: 5674, }, Value: "b", }, @@ -14464,30 +14532,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 312, - EndLine: 312, - StartPos: 5679, - EndPos: 5687, + EndLine: 312, + StartPos: 5679, + EndPos: 5687, }, Expr: &assign.Mul{ Position: &position.Position{ StartLine: 312, - EndLine: 312, - StartPos: 5679, - EndPos: 5686, + EndLine: 312, + StartPos: 5679, + EndPos: 5686, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 312, - EndLine: 312, - StartPos: 5679, - EndPos: 5680, + EndLine: 312, + StartPos: 5679, + EndPos: 5680, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 312, - EndLine: 312, - StartPos: 5679, - EndPos: 5680, + EndLine: 312, + StartPos: 5679, + EndPos: 5680, }, Value: "a", }, @@ -14495,16 +14563,16 @@ func TestPhp7(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 312, - EndLine: 312, - StartPos: 5685, - EndPos: 5686, + EndLine: 312, + StartPos: 5685, + EndPos: 5686, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 312, - EndLine: 312, - StartPos: 5685, - EndPos: 5686, + EndLine: 312, + StartPos: 5685, + EndPos: 5686, }, Value: "b", }, @@ -14514,30 +14582,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 313, - EndLine: 313, - StartPos: 5691, - EndPos: 5699, + EndLine: 313, + StartPos: 5691, + EndPos: 5699, }, Expr: &assign.Plus{ Position: &position.Position{ StartLine: 313, - EndLine: 313, - StartPos: 5691, - EndPos: 5698, + EndLine: 313, + StartPos: 5691, + EndPos: 5698, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 313, - EndLine: 313, - StartPos: 5691, - EndPos: 5692, + EndLine: 313, + StartPos: 5691, + EndPos: 5692, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 313, - EndLine: 313, - StartPos: 5691, - EndPos: 5692, + EndLine: 313, + StartPos: 5691, + EndPos: 5692, }, Value: "a", }, @@ -14545,16 +14613,16 @@ func TestPhp7(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 313, - EndLine: 313, - StartPos: 5697, - EndPos: 5698, + EndLine: 313, + StartPos: 5697, + EndPos: 5698, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 313, - EndLine: 313, - StartPos: 5697, - EndPos: 5698, + EndLine: 313, + StartPos: 5697, + EndPos: 5698, }, Value: "b", }, @@ -14564,30 +14632,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 314, - EndLine: 314, - StartPos: 5703, - EndPos: 5712, + EndLine: 314, + StartPos: 5703, + EndPos: 5712, }, Expr: &assign.Pow{ Position: &position.Position{ StartLine: 314, - EndLine: 314, - StartPos: 5703, - EndPos: 5711, + EndLine: 314, + StartPos: 5703, + EndPos: 5711, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 314, - EndLine: 314, - StartPos: 5703, - EndPos: 5704, + EndLine: 314, + StartPos: 5703, + EndPos: 5704, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 314, - EndLine: 314, - StartPos: 5703, - EndPos: 5704, + EndLine: 314, + StartPos: 5703, + EndPos: 5704, }, Value: "a", }, @@ -14595,16 +14663,16 @@ func TestPhp7(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 314, - EndLine: 314, - StartPos: 5710, - EndPos: 5711, + EndLine: 314, + StartPos: 5710, + EndPos: 5711, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 314, - EndLine: 314, - StartPos: 5710, - EndPos: 5711, + EndLine: 314, + StartPos: 5710, + EndPos: 5711, }, Value: "b", }, @@ -14614,30 +14682,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 315, - EndLine: 315, - StartPos: 5716, - EndPos: 5725, + EndLine: 315, + StartPos: 5716, + EndPos: 5725, }, Expr: &assign.ShiftLeft{ Position: &position.Position{ StartLine: 315, - EndLine: 315, - StartPos: 5716, - EndPos: 5724, + EndLine: 315, + StartPos: 5716, + EndPos: 5724, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 315, - EndLine: 315, - StartPos: 5716, - EndPos: 5717, + EndLine: 315, + StartPos: 5716, + EndPos: 5717, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 315, - EndLine: 315, - StartPos: 5716, - EndPos: 5717, + EndLine: 315, + StartPos: 5716, + EndPos: 5717, }, Value: "a", }, @@ -14645,16 +14713,16 @@ func TestPhp7(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 315, - EndLine: 315, - StartPos: 5723, - EndPos: 5724, + EndLine: 315, + StartPos: 5723, + EndPos: 5724, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 315, - EndLine: 315, - StartPos: 5723, - EndPos: 5724, + EndLine: 315, + StartPos: 5723, + EndPos: 5724, }, Value: "b", }, @@ -14664,30 +14732,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 316, - EndLine: 316, - StartPos: 5729, - EndPos: 5738, + EndLine: 316, + StartPos: 5729, + EndPos: 5738, }, Expr: &assign.ShiftRight{ Position: &position.Position{ StartLine: 316, - EndLine: 316, - StartPos: 5729, - EndPos: 5737, + EndLine: 316, + StartPos: 5729, + EndPos: 5737, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 316, - EndLine: 316, - StartPos: 5729, - EndPos: 5730, + EndLine: 316, + StartPos: 5729, + EndPos: 5730, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 316, - EndLine: 316, - StartPos: 5729, - EndPos: 5730, + EndLine: 316, + StartPos: 5729, + EndPos: 5730, }, Value: "a", }, @@ -14695,16 +14763,16 @@ func TestPhp7(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 316, - EndLine: 316, - StartPos: 5736, - EndPos: 5737, + EndLine: 316, + StartPos: 5736, + EndPos: 5737, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 316, - EndLine: 316, - StartPos: 5736, - EndPos: 5737, + EndLine: 316, + StartPos: 5736, + EndPos: 5737, }, Value: "b", }, @@ -14714,17 +14782,17 @@ func TestPhp7(t *testing.T) { &stmt.Class{ Position: &position.Position{ StartLine: 318, - EndLine: 318, - StartPos: 5743, - EndPos: 5781, + EndLine: 318, + StartPos: 5743, + EndPos: 5781, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 318, - EndLine: 318, - StartPos: 5749, - EndPos: 5751, + EndLine: 318, + StartPos: 5749, + EndPos: 5751, }, Value: "foo", }, @@ -14732,18 +14800,18 @@ func TestPhp7(t *testing.T) { &stmt.ClassMethod{ Position: &position.Position{ StartLine: 318, - EndLine: 318, - StartPos: 5754, - EndPos: 5779, + EndLine: 318, + StartPos: 5754, + EndPos: 5779, }, - ReturnsRef: false, PhpDocComment: "", + ReturnsRef: false, MethodName: &node.Identifier{ Position: &position.Position{ StartLine: 318, - EndLine: 318, - StartPos: 5770, - EndPos: 5774, + EndLine: 318, + StartPos: 5770, + EndPos: 5774, }, Value: "class", }, @@ -14751,9 +14819,9 @@ func TestPhp7(t *testing.T) { &node.Identifier{ Position: &position.Position{ StartLine: 318, - EndLine: 318, - StartPos: 5754, - EndPos: 5759, + EndLine: 318, + StartPos: 5754, + EndPos: 5759, }, Value: "public", }, @@ -14761,11 +14829,12 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 318, - EndLine: 318, - StartPos: 5778, - EndPos: 5779, + EndLine: 318, + StartPos: 5778, + EndPos: 5779, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, }, }, @@ -14773,40 +14842,40 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 319, - EndLine: 319, - StartPos: 5785, - EndPos: 5795, + EndLine: 319, + StartPos: 5785, + EndPos: 5795, }, Expr: &expr.FunctionCall{ Position: &position.Position{ StartLine: 319, - EndLine: 319, - StartPos: 5785, - EndPos: 5794, + EndLine: 319, + StartPos: 5785, + EndPos: 5794, }, Function: &name.FullyQualified{ Position: &position.Position{ StartLine: 319, - EndLine: 319, - StartPos: 5785, - EndPos: 5792, + EndLine: 319, + StartPos: 5785, + EndPos: 5792, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 319, - EndLine: 319, - StartPos: 5786, - EndPos: 5788, + EndLine: 319, + StartPos: 5786, + EndPos: 5788, }, Value: "foo", }, &name.NamePart{ Position: &position.Position{ StartLine: 319, - EndLine: 319, - StartPos: 5790, - EndPos: 5792, + EndLine: 319, + StartPos: 5790, + EndPos: 5792, }, Value: "bar", }, @@ -14815,9 +14884,9 @@ func TestPhp7(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 319, - EndLine: 319, - StartPos: 5793, - EndPos: 5794, + EndLine: 319, + StartPos: 5793, + EndPos: 5794, }, }, }, @@ -14825,18 +14894,18 @@ func TestPhp7(t *testing.T) { &stmt.Function{ Position: &position.Position{ StartLine: 321, - EndLine: 327, - StartPos: 5800, - EndPos: 5926, + EndLine: 327, + StartPos: 5800, + EndPos: 5926, }, - ReturnsRef: false, + ReturnsRef: false, PhpDocComment: "", FunctionName: &node.Identifier{ Position: &position.Position{ StartLine: 321, - EndLine: 321, - StartPos: 5809, - EndPos: 5811, + EndLine: 321, + StartPos: 5809, + EndPos: 5811, }, Value: "foo", }, @@ -14844,25 +14913,25 @@ func TestPhp7(t *testing.T) { &node.Parameter{ Position: &position.Position{ StartLine: 321, - EndLine: 321, - StartPos: 5813, - EndPos: 5815, + EndLine: 321, + StartPos: 5813, + EndPos: 5815, }, - ByRef: true, + ByRef: true, Variadic: false, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 321, - EndLine: 321, - StartPos: 5814, - EndPos: 5815, + EndLine: 321, + StartPos: 5814, + EndPos: 5815, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 321, - EndLine: 321, - StartPos: 5814, - EndPos: 5815, + EndLine: 321, + StartPos: 5814, + EndPos: 5815, }, Value: "a", }, @@ -14871,25 +14940,25 @@ func TestPhp7(t *testing.T) { &node.Parameter{ Position: &position.Position{ StartLine: 321, - EndLine: 321, - StartPos: 5818, - EndPos: 5822, + EndLine: 321, + StartPos: 5818, + EndPos: 5822, }, - ByRef: false, + ByRef: false, Variadic: true, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 321, - EndLine: 321, - StartPos: 5821, - EndPos: 5822, + EndLine: 321, + StartPos: 5821, + EndPos: 5822, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 321, - EndLine: 321, - StartPos: 5821, - EndPos: 5822, + EndLine: 321, + StartPos: 5821, + EndPos: 5822, }, Value: "b", }, @@ -14900,105 +14969,109 @@ func TestPhp7(t *testing.T) { &stmt.HaltCompiler{ Position: &position.Position{ StartLine: 322, - EndLine: 322, - StartPos: 5830, - EndPos: 5847, + EndLine: 322, + StartPos: 5830, + EndPos: 5847, }, }, &stmt.Function{ Position: &position.Position{ StartLine: 323, - EndLine: 323, - StartPos: 5852, - EndPos: 5868, + EndLine: 323, + StartPos: 5852, + EndPos: 5868, }, - ReturnsRef: false, + ReturnsRef: false, PhpDocComment: "", FunctionName: &node.Identifier{ Position: &position.Position{ StartLine: 323, - EndLine: 323, - StartPos: 5861, - EndPos: 5863, + EndLine: 323, + StartPos: 5861, + EndPos: 5863, }, Value: "bar", }, - Stmts: []node.Node{}, + Stmts: []node.Node{ + }, }, &stmt.Class{ Position: &position.Position{ StartLine: 324, - EndLine: 324, - StartPos: 5873, - EndPos: 5884, + EndLine: 324, + StartPos: 5873, + EndPos: 5884, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 324, - EndLine: 324, - StartPos: 5879, - EndPos: 5881, + EndLine: 324, + StartPos: 5879, + EndPos: 5881, }, Value: "Baz", }, - Stmts: []node.Node{}, + Stmts: []node.Node{ + }, }, &stmt.Trait{ Position: &position.Position{ StartLine: 325, - EndLine: 325, - StartPos: 5889, - EndPos: 5900, + EndLine: 325, + StartPos: 5889, + EndPos: 5900, }, PhpDocComment: "", TraitName: &node.Identifier{ Position: &position.Position{ StartLine: 325, - EndLine: 325, - StartPos: 5895, - EndPos: 5898, + EndLine: 325, + StartPos: 5895, + EndPos: 5898, }, Value: "Quux", }, - Stmts: []node.Node{}, + Stmts: []node.Node{ + }, }, &stmt.Interface{ Position: &position.Position{ StartLine: 326, - EndLine: 326, - StartPos: 5905, - EndPos: 5922, + EndLine: 326, + StartPos: 5905, + EndPos: 5922, }, PhpDocComment: "", InterfaceName: &node.Identifier{ Position: &position.Position{ StartLine: 326, - EndLine: 326, - StartPos: 5915, - EndPos: 5919, + EndLine: 326, + StartPos: 5915, + EndPos: 5919, }, Value: "Quuux", }, - Stmts: []node.Node{}, + Stmts: []node.Node{ + }, }, }, }, &stmt.Function{ Position: &position.Position{ StartLine: 329, - EndLine: 329, - StartPos: 5933, - EndPos: 5975, + EndLine: 329, + StartPos: 5933, + EndPos: 5975, }, - ReturnsRef: false, PhpDocComment: "", + ReturnsRef: false, FunctionName: &node.Identifier{ Position: &position.Position{ StartLine: 329, - EndLine: 329, - StartPos: 5942, - EndPos: 5944, + EndLine: 329, + StartPos: 5942, + EndPos: 5944, }, Value: "foo", }, @@ -15006,25 +15079,25 @@ func TestPhp7(t *testing.T) { &node.Parameter{ Position: &position.Position{ StartLine: 329, - EndLine: 329, - StartPos: 5946, - EndPos: 5952, + EndLine: 329, + StartPos: 5946, + EndPos: 5952, }, - ByRef: true, + ByRef: true, Variadic: false, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 329, - EndLine: 329, - StartPos: 5947, - EndPos: 5948, + EndLine: 329, + StartPos: 5947, + EndPos: 5948, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 329, - EndLine: 329, - StartPos: 5947, - EndPos: 5948, + EndLine: 329, + StartPos: 5947, + EndPos: 5948, }, Value: "a", }, @@ -15032,9 +15105,9 @@ func TestPhp7(t *testing.T) { DefaultValue: &scalar.Lnumber{ Position: &position.Position{ StartLine: 329, - EndLine: 329, - StartPos: 5952, - EndPos: 5952, + EndLine: 329, + StartPos: 5952, + EndPos: 5952, }, Value: "1", }, @@ -15042,25 +15115,25 @@ func TestPhp7(t *testing.T) { &node.Parameter{ Position: &position.Position{ StartLine: 329, - EndLine: 329, - StartPos: 5955, - EndPos: 5963, + EndLine: 329, + StartPos: 5955, + EndPos: 5963, }, - ByRef: false, Variadic: true, + ByRef: false, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 329, - EndLine: 329, - StartPos: 5958, - EndPos: 5959, + EndLine: 329, + StartPos: 5958, + EndPos: 5959, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 329, - EndLine: 329, - StartPos: 5958, - EndPos: 5959, + EndLine: 329, + StartPos: 5958, + EndPos: 5959, }, Value: "b", }, @@ -15068,9 +15141,9 @@ func TestPhp7(t *testing.T) { DefaultValue: &scalar.Lnumber{ Position: &position.Position{ StartLine: 329, - EndLine: 329, - StartPos: 5963, - EndPos: 5963, + EndLine: 329, + StartPos: 5963, + EndPos: 5963, }, Value: "1", }, @@ -15078,25 +15151,25 @@ func TestPhp7(t *testing.T) { &node.Parameter{ Position: &position.Position{ StartLine: 329, - EndLine: 329, - StartPos: 5966, - EndPos: 5971, + EndLine: 329, + StartPos: 5966, + EndPos: 5971, }, - ByRef: false, + ByRef: false, Variadic: false, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 329, - EndLine: 329, - StartPos: 5966, - EndPos: 5967, + EndLine: 329, + StartPos: 5966, + EndPos: 5967, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 329, - EndLine: 329, - StartPos: 5966, - EndPos: 5967, + EndLine: 329, + StartPos: 5966, + EndPos: 5967, }, Value: "c", }, @@ -15104,31 +15177,32 @@ func TestPhp7(t *testing.T) { DefaultValue: &scalar.Lnumber{ Position: &position.Position{ StartLine: 329, - EndLine: 329, - StartPos: 5971, - EndPos: 5971, + EndLine: 329, + StartPos: 5971, + EndPos: 5971, }, Value: "1", }, }, }, - Stmts: []node.Node{}, + Stmts: []node.Node{ + }, }, &stmt.Function{ Position: &position.Position{ StartLine: 330, - EndLine: 330, - StartPos: 5979, - EndPos: 6016, + EndLine: 330, + StartPos: 5979, + EndPos: 6016, }, - ReturnsRef: false, + ReturnsRef: false, PhpDocComment: "", FunctionName: &node.Identifier{ Position: &position.Position{ StartLine: 330, - EndLine: 330, - StartPos: 5988, - EndPos: 5990, + EndLine: 330, + StartPos: 5988, + EndPos: 5990, }, Value: "foo", }, @@ -15136,34 +15210,34 @@ func TestPhp7(t *testing.T) { &node.Parameter{ Position: &position.Position{ StartLine: 330, - EndLine: 330, - StartPos: 5992, - EndPos: 5999, + EndLine: 330, + StartPos: 5992, + EndPos: 5999, }, - ByRef: false, + ByRef: false, Variadic: false, VariableType: &node.Identifier{ Position: &position.Position{ StartLine: 330, - EndLine: 330, - StartPos: 5992, - EndPos: 5996, + EndLine: 330, + StartPos: 5992, + EndPos: 5996, }, Value: "array", }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 330, - EndLine: 330, - StartPos: 5998, - EndPos: 5999, + EndLine: 330, + StartPos: 5998, + EndPos: 5999, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 330, - EndLine: 330, - StartPos: 5998, - EndPos: 5999, + EndLine: 330, + StartPos: 5998, + EndPos: 5999, }, Value: "a", }, @@ -15172,56 +15246,57 @@ func TestPhp7(t *testing.T) { &node.Parameter{ Position: &position.Position{ StartLine: 330, - EndLine: 330, - StartPos: 6002, - EndPos: 6012, + EndLine: 330, + StartPos: 6002, + EndPos: 6012, }, + ByRef: false, Variadic: false, - ByRef: false, VariableType: &node.Identifier{ Position: &position.Position{ StartLine: 330, - EndLine: 330, - StartPos: 6002, - EndPos: 6009, + EndLine: 330, + StartPos: 6002, + EndPos: 6009, }, Value: "callable", }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 330, - EndLine: 330, - StartPos: 6011, - EndPos: 6012, + EndLine: 330, + StartPos: 6011, + EndPos: 6012, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 330, - EndLine: 330, - StartPos: 6011, - EndPos: 6012, + EndLine: 330, + StartPos: 6011, + EndPos: 6012, }, Value: "b", }, }, }, }, - Stmts: []node.Node{}, + Stmts: []node.Node{ + }, }, &stmt.Class{ Position: &position.Position{ StartLine: 331, - EndLine: 331, - StartPos: 6020, - EndPos: 6121, + EndLine: 331, + StartPos: 6020, + EndPos: 6121, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 331, - EndLine: 331, - StartPos: 6041, - EndPos: 6043, + EndLine: 331, + StartPos: 6041, + EndPos: 6043, }, Value: "foo", }, @@ -15229,18 +15304,18 @@ func TestPhp7(t *testing.T) { &node.Identifier{ Position: &position.Position{ StartLine: 331, - EndLine: 331, - StartPos: 6020, - EndPos: 6027, + EndLine: 331, + StartPos: 6020, + EndPos: 6027, }, Value: "abstract", }, &node.Identifier{ Position: &position.Position{ StartLine: 331, - EndLine: 331, - StartPos: 6029, - EndPos: 6033, + EndLine: 331, + StartPos: 6029, + EndPos: 6033, }, Value: "final", }, @@ -15249,18 +15324,18 @@ func TestPhp7(t *testing.T) { &stmt.ClassMethod{ Position: &position.Position{ StartLine: 331, - EndLine: 331, - StartPos: 6047, - EndPos: 6087, + EndLine: 331, + StartPos: 6047, + EndPos: 6087, }, - ReturnsRef: false, + ReturnsRef: false, PhpDocComment: "", MethodName: &node.Identifier{ Position: &position.Position{ StartLine: 331, - EndLine: 331, - StartPos: 6082, - EndPos: 6084, + EndLine: 331, + StartPos: 6082, + EndPos: 6084, }, Value: "bar", }, @@ -15268,27 +15343,27 @@ func TestPhp7(t *testing.T) { &node.Identifier{ Position: &position.Position{ StartLine: 331, - EndLine: 331, - StartPos: 6047, - EndPos: 6054, + EndLine: 331, + StartPos: 6047, + EndPos: 6054, }, Value: "abstract", }, &node.Identifier{ Position: &position.Position{ StartLine: 331, - EndLine: 331, - StartPos: 6056, - EndPos: 6064, + EndLine: 331, + StartPos: 6056, + EndPos: 6064, }, Value: "protected", }, &node.Identifier{ Position: &position.Position{ StartLine: 331, - EndLine: 331, - StartPos: 6066, - EndPos: 6071, + EndLine: 331, + StartPos: 6066, + EndPos: 6071, }, Value: "static", }, @@ -15296,27 +15371,27 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.Nop{ Position: &position.Position{ StartLine: 331, - EndLine: 331, - StartPos: 6087, - EndPos: 6087, + EndLine: 331, + StartPos: 6087, + EndPos: 6087, }, }, }, &stmt.ClassMethod{ Position: &position.Position{ StartLine: 331, - EndLine: 331, - StartPos: 6089, - EndPos: 6119, + EndLine: 331, + StartPos: 6089, + EndPos: 6119, }, - ReturnsRef: false, + ReturnsRef: false, PhpDocComment: "", MethodName: &node.Identifier{ Position: &position.Position{ StartLine: 331, - EndLine: 331, - StartPos: 6112, - EndPos: 6114, + EndLine: 331, + StartPos: 6112, + EndPos: 6114, }, Value: "baz", }, @@ -15324,18 +15399,18 @@ func TestPhp7(t *testing.T) { &node.Identifier{ Position: &position.Position{ StartLine: 331, - EndLine: 331, - StartPos: 6089, - EndPos: 6093, + EndLine: 331, + StartPos: 6089, + EndPos: 6093, }, Value: "final", }, &node.Identifier{ Position: &position.Position{ StartLine: 331, - EndLine: 331, - StartPos: 6095, - EndPos: 6101, + EndLine: 331, + StartPos: 6095, + EndPos: 6101, }, Value: "private", }, @@ -15343,11 +15418,12 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 331, - EndLine: 331, - StartPos: 6118, - EndPos: 6119, + EndLine: 331, + StartPos: 6118, + EndPos: 6119, + }, + Stmts: []node.Node{ }, - Stmts: []node.Node{}, }, }, }, @@ -15355,38 +15431,38 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 333, - EndLine: 333, - StartPos: 6127, - EndPos: 6140, + EndLine: 333, + StartPos: 6127, + EndPos: 6140, }, Expr: &expr.PropertyFetch{ Position: &position.Position{ StartLine: 333, - EndLine: 333, - StartPos: 6127, - EndPos: 6139, + EndLine: 333, + StartPos: 6127, + EndPos: 6139, }, Variable: &expr.New{ Position: &position.Position{ StartLine: 333, - EndLine: 333, - StartPos: 6127, - EndPos: 6133, + EndLine: 333, + StartPos: 6127, + EndPos: 6133, }, Class: &name.Name{ Position: &position.Position{ StartLine: 333, - EndLine: 333, - StartPos: 6131, - EndPos: 6133, + EndLine: 333, + StartPos: 6131, + EndPos: 6133, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 333, - EndLine: 333, - StartPos: 6131, - EndPos: 6133, + EndLine: 333, + StartPos: 6131, + EndPos: 6133, }, Value: "Foo", }, @@ -15396,9 +15472,9 @@ func TestPhp7(t *testing.T) { Property: &node.Identifier{ Position: &position.Position{ StartLine: 333, - EndLine: 333, - StartPos: 6137, - EndPos: 6139, + EndLine: 333, + StartPos: 6137, + EndPos: 6139, }, Value: "bar", }, @@ -15407,38 +15483,38 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 334, - EndLine: 334, - StartPos: 6145, - EndPos: 6155, + EndLine: 334, + StartPos: 6145, + EndPos: 6155, }, Expr: &expr.FunctionCall{ Position: &position.Position{ StartLine: 334, - EndLine: 334, - StartPos: 6145, - EndPos: 6154, + EndLine: 334, + StartPos: 6145, + EndPos: 6154, }, Function: &expr.New{ Position: &position.Position{ StartLine: 334, - EndLine: 334, - StartPos: 6145, - EndPos: 6151, + EndLine: 334, + StartPos: 6145, + EndPos: 6151, }, Class: &name.Name{ Position: &position.Position{ StartLine: 334, - EndLine: 334, - StartPos: 6149, - EndPos: 6151, + EndLine: 334, + StartPos: 6149, + EndPos: 6151, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 334, - EndLine: 334, - StartPos: 6149, - EndPos: 6151, + EndLine: 334, + StartPos: 6149, + EndPos: 6151, }, Value: "Foo", }, @@ -15448,9 +15524,9 @@ func TestPhp7(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 334, - EndLine: 334, - StartPos: 6153, - EndPos: 6154, + EndLine: 334, + StartPos: 6153, + EndPos: 6154, }, }, }, @@ -15458,52 +15534,52 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 335, - EndLine: 335, - StartPos: 6159, - EndPos: 6170, + EndLine: 335, + StartPos: 6159, + EndPos: 6170, }, Expr: &expr.FunctionCall{ Position: &position.Position{ StartLine: 335, - EndLine: 335, - StartPos: 6159, - EndPos: 6169, + EndLine: 335, + StartPos: 6159, + EndPos: 6169, }, Function: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 335, - EndLine: 335, - StartPos: 6159, - EndPos: 6167, + EndLine: 335, + StartPos: 6159, + EndPos: 6167, }, Variable: &expr.ShortArray{ Position: &position.Position{ StartLine: 335, - EndLine: 335, - StartPos: 6159, - EndPos: 6164, + EndLine: 335, + StartPos: 6159, + EndPos: 6164, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 335, - EndLine: 335, - StartPos: 6160, - EndPos: 6163, + EndLine: 335, + StartPos: 6160, + EndPos: 6163, }, Val: &expr.Variable{ Position: &position.Position{ StartLine: 335, - EndLine: 335, - StartPos: 6160, - EndPos: 6163, + EndLine: 335, + StartPos: 6160, + EndPos: 6163, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 335, - EndLine: 335, - StartPos: 6160, - EndPos: 6163, + EndLine: 335, + StartPos: 6160, + EndPos: 6163, }, Value: "foo", }, @@ -15514,9 +15590,9 @@ func TestPhp7(t *testing.T) { Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 335, - EndLine: 335, - StartPos: 6166, - EndPos: 6166, + EndLine: 335, + StartPos: 6166, + EndPos: 6166, }, Value: "0", }, @@ -15524,9 +15600,9 @@ func TestPhp7(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 335, - EndLine: 335, - StartPos: 6168, - EndPos: 6169, + EndLine: 335, + StartPos: 6168, + EndPos: 6169, }, }, }, @@ -15534,45 +15610,45 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 336, - EndLine: 336, - StartPos: 6174, - EndPos: 6182, + EndLine: 336, + StartPos: 6174, + EndPos: 6182, }, Expr: &expr.FunctionCall{ Position: &position.Position{ StartLine: 336, - EndLine: 336, - StartPos: 6174, - EndPos: 6181, + EndLine: 336, + StartPos: 6174, + EndPos: 6181, }, Function: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 336, - EndLine: 336, - StartPos: 6174, - EndPos: 6179, + EndLine: 336, + StartPos: 6174, + EndPos: 6179, }, Variable: &expr.ConstFetch{ Position: &position.Position{ StartLine: 336, - EndLine: 336, - StartPos: 6174, - EndPos: 6176, + EndLine: 336, + StartPos: 6174, + EndPos: 6176, }, Constant: &name.Name{ Position: &position.Position{ StartLine: 336, - EndLine: 336, - StartPos: 6174, - EndPos: 6176, + EndLine: 336, + StartPos: 6174, + EndPos: 6176, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 336, - EndLine: 336, - StartPos: 6174, - EndPos: 6176, + EndLine: 336, + StartPos: 6174, + EndPos: 6176, }, Value: "foo", }, @@ -15582,9 +15658,9 @@ func TestPhp7(t *testing.T) { Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 336, - EndLine: 336, - StartPos: 6178, - EndPos: 6178, + EndLine: 336, + StartPos: 6178, + EndPos: 6178, }, Value: "1", }, @@ -15592,9 +15668,9 @@ func TestPhp7(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 336, - EndLine: 336, - StartPos: 6180, - EndPos: 6181, + EndLine: 336, + StartPos: 6180, + EndPos: 6181, }, }, }, @@ -15602,32 +15678,32 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 337, - EndLine: 337, - StartPos: 6186, - EndPos: 6193, + EndLine: 337, + StartPos: 6186, + EndPos: 6193, }, Expr: &expr.FunctionCall{ Position: &position.Position{ StartLine: 337, - EndLine: 337, - StartPos: 6186, - EndPos: 6192, + EndLine: 337, + StartPos: 6186, + EndPos: 6192, }, Function: &scalar.String{ Position: &position.Position{ StartLine: 337, - EndLine: 337, - StartPos: 6186, - EndPos: 6190, + EndLine: 337, + StartPos: 6186, + EndPos: 6190, }, Value: "\"foo\"", }, ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 337, - EndLine: 337, - StartPos: 6191, - EndPos: 6192, + EndLine: 337, + StartPos: 6191, + EndPos: 6192, }, }, }, @@ -15635,45 +15711,45 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 338, - EndLine: 338, - StartPos: 6197, - EndPos: 6208, + EndLine: 338, + StartPos: 6197, + EndPos: 6208, }, Expr: &expr.FunctionCall{ Position: &position.Position{ StartLine: 338, - EndLine: 338, - StartPos: 6197, - EndPos: 6207, + EndLine: 338, + StartPos: 6197, + EndPos: 6207, }, Function: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 338, - EndLine: 338, - StartPos: 6197, - EndPos: 6205, + EndLine: 338, + StartPos: 6197, + EndPos: 6205, }, Variable: &expr.ShortArray{ Position: &position.Position{ StartLine: 338, - EndLine: 338, - StartPos: 6197, - EndPos: 6199, + EndLine: 338, + StartPos: 6197, + EndPos: 6199, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 338, - EndLine: 338, - StartPos: 6198, - EndPos: 6198, + EndLine: 338, + StartPos: 6198, + EndPos: 6198, }, Val: &scalar.Lnumber{ Position: &position.Position{ StartLine: 338, - EndLine: 338, - StartPos: 6198, - EndPos: 6198, + EndLine: 338, + StartPos: 6198, + EndPos: 6198, }, Value: "1", }, @@ -15683,16 +15759,16 @@ func TestPhp7(t *testing.T) { Dim: &expr.Variable{ Position: &position.Position{ StartLine: 338, - EndLine: 338, - StartPos: 6201, - EndPos: 6204, + EndLine: 338, + StartPos: 6201, + EndPos: 6204, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 338, - EndLine: 338, - StartPos: 6201, - EndPos: 6204, + EndLine: 338, + StartPos: 6201, + EndPos: 6204, }, Value: "foo", }, @@ -15701,9 +15777,9 @@ func TestPhp7(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 338, - EndLine: 338, - StartPos: 6206, - EndPos: 6207, + EndLine: 338, + StartPos: 6206, + EndPos: 6207, }, }, }, @@ -15711,38 +15787,38 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 339, - EndLine: 339, - StartPos: 6212, - EndPos: 6220, + EndLine: 339, + StartPos: 6212, + EndPos: 6220, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 339, - EndLine: 339, - StartPos: 6212, - EndPos: 6219, + EndLine: 339, + StartPos: 6212, + EndPos: 6219, }, VarName: &expr.FunctionCall{ Position: &position.Position{ StartLine: 339, - EndLine: 339, - StartPos: 6214, - EndPos: 6218, + EndLine: 339, + StartPos: 6214, + EndPos: 6218, }, Function: &name.Name{ Position: &position.Position{ StartLine: 339, - EndLine: 339, - StartPos: 6214, - EndPos: 6216, + EndLine: 339, + StartPos: 6214, + EndPos: 6216, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 339, - EndLine: 339, - StartPos: 6214, - EndPos: 6216, + EndLine: 339, + StartPos: 6214, + EndPos: 6216, }, Value: "foo", }, @@ -15751,9 +15827,9 @@ func TestPhp7(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 339, - EndLine: 339, - StartPos: 6217, - EndPos: 6218, + EndLine: 339, + StartPos: 6217, + EndPos: 6218, }, }, }, @@ -15762,31 +15838,31 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 341, - EndLine: 341, - StartPos: 6225, - EndPos: 6236, + EndLine: 341, + StartPos: 6225, + EndPos: 6236, }, Expr: &expr.StaticCall{ Position: &position.Position{ StartLine: 341, - EndLine: 341, - StartPos: 6225, - EndPos: 6235, + EndLine: 341, + StartPos: 6225, + EndPos: 6235, }, Class: &name.Name{ Position: &position.Position{ StartLine: 341, - EndLine: 341, - StartPos: 6225, - EndPos: 6227, + EndLine: 341, + StartPos: 6225, + EndPos: 6227, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 341, - EndLine: 341, - StartPos: 6225, - EndPos: 6227, + EndLine: 341, + StartPos: 6225, + EndPos: 6227, }, Value: "Foo", }, @@ -15795,16 +15871,16 @@ func TestPhp7(t *testing.T) { Call: &expr.Variable{ Position: &position.Position{ StartLine: 341, - EndLine: 341, - StartPos: 6230, - EndPos: 6233, + EndLine: 341, + StartPos: 6230, + EndPos: 6233, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 341, - EndLine: 341, - StartPos: 6230, - EndPos: 6233, + EndLine: 341, + StartPos: 6230, + EndPos: 6233, }, Value: "bar", }, @@ -15812,9 +15888,9 @@ func TestPhp7(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 341, - EndLine: 341, - StartPos: 6234, - EndPos: 6235, + EndLine: 341, + StartPos: 6234, + EndPos: 6235, }, }, }, @@ -15822,31 +15898,31 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 342, - EndLine: 342, - StartPos: 6240, - EndPos: 6256, + EndLine: 342, + StartPos: 6240, + EndPos: 6256, }, Expr: &expr.StaticCall{ Position: &position.Position{ StartLine: 342, - EndLine: 342, - StartPos: 6240, - EndPos: 6255, + EndLine: 342, + StartPos: 6240, + EndPos: 6255, }, Class: &name.Name{ Position: &position.Position{ StartLine: 342, - EndLine: 342, - StartPos: 6240, - EndPos: 6242, + EndLine: 342, + StartPos: 6240, + EndPos: 6242, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 342, - EndLine: 342, - StartPos: 6240, - EndPos: 6242, + EndLine: 342, + StartPos: 6240, + EndPos: 6242, }, Value: "Foo", }, @@ -15855,23 +15931,23 @@ func TestPhp7(t *testing.T) { Call: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 342, - EndLine: 342, - StartPos: 6246, - EndPos: 6252, + EndLine: 342, + StartPos: 6246, + EndPos: 6252, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 342, - EndLine: 342, - StartPos: 6246, - EndPos: 6249, + EndLine: 342, + StartPos: 6246, + EndPos: 6249, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 342, - EndLine: 342, - StartPos: 6246, - EndPos: 6249, + EndLine: 342, + StartPos: 6246, + EndPos: 6249, }, Value: "bar", }, @@ -15879,9 +15955,9 @@ func TestPhp7(t *testing.T) { Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 342, - EndLine: 342, - StartPos: 6251, - EndPos: 6251, + EndLine: 342, + StartPos: 6251, + EndPos: 6251, }, Value: "0", }, @@ -15889,9 +15965,9 @@ func TestPhp7(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 342, - EndLine: 342, - StartPos: 6254, - EndPos: 6255, + EndLine: 342, + StartPos: 6254, + EndPos: 6255, }, }, }, @@ -15899,30 +15975,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 344, - EndLine: 344, - StartPos: 6263, - EndPos: 6273, + EndLine: 344, + StartPos: 6263, + EndPos: 6273, }, Expr: &expr.PropertyFetch{ Position: &position.Position{ StartLine: 344, - EndLine: 344, - StartPos: 6263, - EndPos: 6272, + EndLine: 344, + StartPos: 6263, + EndPos: 6272, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 344, - EndLine: 344, - StartPos: 6263, - EndPos: 6266, + EndLine: 344, + StartPos: 6263, + EndPos: 6266, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 344, - EndLine: 344, - StartPos: 6263, - EndPos: 6266, + EndLine: 344, + StartPos: 6263, + EndPos: 6266, }, Value: "foo", }, @@ -15930,16 +16006,16 @@ func TestPhp7(t *testing.T) { Property: &expr.Variable{ Position: &position.Position{ StartLine: 344, - EndLine: 344, - StartPos: 6269, - EndPos: 6272, + EndLine: 344, + StartPos: 6269, + EndPos: 6272, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 344, - EndLine: 344, - StartPos: 6269, - EndPos: 6272, + EndLine: 344, + StartPos: 6269, + EndPos: 6272, }, Value: "bar", }, @@ -15949,30 +16025,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 345, - EndLine: 345, - StartPos: 6277, - EndPos: 6292, + EndLine: 345, + StartPos: 6277, + EndPos: 6292, }, Expr: &expr.PropertyFetch{ Position: &position.Position{ StartLine: 345, - EndLine: 345, - StartPos: 6277, - EndPos: 6290, + EndLine: 345, + StartPos: 6277, + EndPos: 6290, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 345, - EndLine: 345, - StartPos: 6277, - EndPos: 6280, + EndLine: 345, + StartPos: 6277, + EndPos: 6280, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 345, - EndLine: 345, - StartPos: 6277, - EndPos: 6280, + EndLine: 345, + StartPos: 6277, + EndPos: 6280, }, Value: "foo", }, @@ -15980,23 +16056,23 @@ func TestPhp7(t *testing.T) { Property: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 345, - EndLine: 345, - StartPos: 6284, - EndPos: 6290, + EndLine: 345, + StartPos: 6284, + EndPos: 6290, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 345, - EndLine: 345, - StartPos: 6284, - EndPos: 6287, + EndLine: 345, + StartPos: 6284, + EndPos: 6287, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 345, - EndLine: 345, - StartPos: 6284, - EndPos: 6287, + EndLine: 345, + StartPos: 6284, + EndPos: 6287, }, Value: "bar", }, @@ -16004,9 +16080,9 @@ func TestPhp7(t *testing.T) { Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 345, - EndLine: 345, - StartPos: 6289, - EndPos: 6289, + EndLine: 345, + StartPos: 6289, + EndPos: 6289, }, Value: "0", }, @@ -16016,54 +16092,54 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 347, - EndLine: 347, - StartPos: 6297, - EndPos: 6318, + EndLine: 347, + StartPos: 6297, + EndPos: 6318, }, Expr: &expr.ShortArray{ Position: &position.Position{ StartLine: 347, - EndLine: 347, - StartPos: 6297, - EndPos: 6317, + EndLine: 347, + StartPos: 6297, + EndPos: 6317, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 347, - EndLine: 347, - StartPos: 6298, - EndPos: 6303, + EndLine: 347, + StartPos: 6298, + EndPos: 6303, }, Key: &scalar.Lnumber{ Position: &position.Position{ StartLine: 347, - EndLine: 347, - StartPos: 6298, - EndPos: 6298, + EndLine: 347, + StartPos: 6298, + EndPos: 6298, }, Value: "1", }, Val: &expr.Reference{ Position: &position.Position{ StartLine: 347, - EndLine: 347, - StartPos: 6301, - EndPos: 6303, + EndLine: 347, + StartPos: 6301, + EndPos: 6303, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 347, - EndLine: 347, - StartPos: 6302, - EndPos: 6303, + EndLine: 347, + StartPos: 6302, + EndPos: 6303, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 347, - EndLine: 347, - StartPos: 6302, - EndPos: 6303, + EndLine: 347, + StartPos: 6302, + EndPos: 6303, }, Value: "a", }, @@ -16073,47 +16149,47 @@ func TestPhp7(t *testing.T) { &expr.ArrayItem{ Position: &position.Position{ StartLine: 347, - EndLine: 347, - StartPos: 6306, - EndPos: 6316, + EndLine: 347, + StartPos: 6306, + EndPos: 6316, }, Key: &scalar.Lnumber{ Position: &position.Position{ StartLine: 347, - EndLine: 347, - StartPos: 6306, - EndPos: 6306, + EndLine: 347, + StartPos: 6306, + EndPos: 6306, }, Value: "2", }, Val: &expr.List{ Position: &position.Position{ StartLine: 347, - EndLine: 347, - StartPos: 6309, - EndPos: 6316, + EndLine: 347, + StartPos: 6309, + EndPos: 6316, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 347, - EndLine: 347, - StartPos: 6314, - EndPos: 6315, + EndLine: 347, + StartPos: 6314, + EndPos: 6315, }, Val: &expr.Variable{ Position: &position.Position{ StartLine: 347, - EndLine: 347, - StartPos: 6314, - EndPos: 6315, + EndLine: 347, + StartPos: 6314, + EndPos: 6315, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 347, - EndLine: 347, - StartPos: 6314, - EndPos: 6315, + EndLine: 347, + StartPos: 6314, + EndPos: 6315, }, Value: "b", }, diff --git a/scanner/lexer.go b/scanner/lexer.go index 49a052f..d16103c 100644 --- a/scanner/lexer.go +++ b/scanner/lexer.go @@ -12,7 +12,7 @@ import ( "github.com/z7zmey/php-parser/position" "github.com/cznic/golex/lex" - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" ) // Allocate Character classes anywhere in [0x80, 0xFF]. @@ -441,10 +441,11 @@ type Lexer struct { *lex.Lexer StateStack []int PhpDocComment string - Comments []*comment.Comment + Meta []meta.Meta heredocLabel string tokenBytesBuf *bytes.Buffer TokenPool sync.Pool + WithMeta bool } // Rune2Class returns the rune integer id @@ -477,7 +478,7 @@ func NewLexer(src io.Reader, fName string) *Lexer { Lexer: lx, StateStack: []int{0}, PhpDocComment: "", - Comments: nil, + Meta: nil, heredocLabel: "", tokenBytesBuf: &bytes.Buffer{}, TokenPool: sync.Pool{ @@ -530,7 +531,7 @@ func (l *Lexer) createToken(chars []lex.Char) *Token { lastChar := chars[len(chars)-1] token := l.TokenPool.Get().(*Token) - token.Comments = l.Comments + token.Meta = l.Meta token.Value = l.tokenString(chars) token.StartLine = l.File.Line(firstChar.Pos()) @@ -541,7 +542,11 @@ func (l *Lexer) createToken(chars []lex.Char) *Token { return token } -func (l *Lexer) addComment(chars []lex.Char) { +func (l *Lexer) addComments(chars []lex.Char) { + if !l.WithMeta { + return + } + firstChar := chars[0] lastChar := chars[len(chars)-1] @@ -552,8 +557,27 @@ func (l *Lexer) addComment(chars []lex.Char) { int(lastChar.Pos()), ) - c := comment.NewComment(l.tokenString(chars), pos) - l.Comments = append(l.Comments, c) + c := meta.NewComment(l.tokenString(chars), pos) + l.Meta = append(l.Meta, c) +} + +func (l *Lexer) addWhiteSpace(chars []lex.Char) { + if !l.WithMeta { + return + } + + firstChar := chars[0] + lastChar := chars[len(chars)-1] + + pos := position.NewPosition( + l.File.Line(firstChar.Pos()), + l.File.Line(lastChar.Pos()), + int(firstChar.Pos()), + int(lastChar.Pos()), + ) + + c := meta.NewWhiteSpace(l.tokenString(chars), pos) + l.Meta = append(l.Meta, c) } func (l *Lexer) tokenString(chars []lex.Char) string { diff --git a/scanner/scanner.go b/scanner/scanner.go index 96b28aa..ba58094 100644 --- a/scanner/scanner.go +++ b/scanner/scanner.go @@ -32,7 +32,7 @@ func isValidFirstVarNameRune(r rune) bool { } func (l *Lexer) Lex(lval Lval) int { - l.Comments = nil + l.Meta = nil c := l.Enter() yystate0: @@ -7556,6 +7556,7 @@ yyrule2: // . yyrule3: // \<\?php([ \t]|{NEW_LINE}) { l.begin(PHP) + l.ungetChars(len(l.Token()) - 5) goto yystate0 } yyrule4: // \<\? @@ -7571,8 +7572,10 @@ yyrule5: // \<\?= goto yystate0 } yyrule6: // [ \t\n\r]+ - - goto yystate0 + { + l.addWhiteSpace(l.Token()) + goto yystate0 + } yyrule7: // [;][ \t\n\r]*\?\>{NEW_LINE}? { l.begin(INITIAL) @@ -8367,7 +8370,7 @@ yyrule126: // (#|[/][/]) } break } - l.addComment(tb) + l.addComments(tb) goto yystate0 } yyrule127: // ([/][*])|([/][*][*]) @@ -8391,9 +8394,9 @@ yyrule127: // ([/][*])|([/][*][*]) } if is_doc_comment { l.PhpDocComment = string(l.TokenBytes(nil)) - l.addComment(l.Token()) + l.addComments(l.Token()) } else { - l.addComment(l.Token()) + l.addComments(l.Token()) } goto yystate0 } diff --git a/scanner/scanner.l b/scanner/scanner.l index 6e4f95f..cfa3dda 100644 --- a/scanner/scanner.l +++ b/scanner/scanner.l @@ -31,7 +31,7 @@ func isValidFirstVarNameRune(r rune) bool { } func (l *Lexer) Lex(lval Lval) int { - l.Comments = nil + l.Meta = nil c := l.Enter() %} @@ -84,11 +84,11 @@ NEW_LINE (\r|\n|\r\n) lval.Token(l.createToken(tb)) return T_INLINE_HTML -\<\?php([ \t]|{NEW_LINE}) l.begin(PHP); +\<\?php([ \t]|{NEW_LINE}) l.begin(PHP);l.ungetChars(len(l.Token())-5) \<\? l.begin(PHP); \<\?= l.begin(PHP);lval.Token(l.createToken(l.Token())); return T_ECHO; -[ \t\n\r]+ +[ \t\n\r]+ l.addWhiteSpace(l.Token()) [;][ \t\n\r]*\?\>{NEW_LINE}? l.begin(INITIAL);lval.Token(l.createToken(l.Token())); return Rune2Class(';'); \?\>{NEW_LINE}? l.begin(INITIAL);lval.Token(l.createToken(l.Token())); return Rune2Class(';'); @@ -284,7 +284,7 @@ NEW_LINE (\r|\n|\r\n) break; } - l.addComment(tb) + l.addComments(tb) ([/][*])|([/][*][*]) tb := l.Token() @@ -309,9 +309,9 @@ NEW_LINE (\r|\n|\r\n) if is_doc_comment { l.PhpDocComment = string(l.TokenBytes(nil)) - l.addComment(l.Token()) + l.addComments(l.Token()) } else { - l.addComment(l.Token()) + l.addComments(l.Token()) } {OPERATORS} lval.Token(l.createToken(l.Token())); return Rune2Class(rune(l.TokenBytes(nil)[0])) diff --git a/scanner/scanner_test.go b/scanner/scanner_test.go index 5d8129b..9f52559 100644 --- a/scanner/scanner_test.go +++ b/scanner/scanner_test.go @@ -7,7 +7,7 @@ import ( "github.com/z7zmey/php-parser/position" - "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/scanner" @@ -415,6 +415,7 @@ func TestTokens(t *testing.T) { } lexer := scanner.NewLexer(bytes.NewBufferString(src), "test.php") + lexer.WithMeta = true lv := &lval{} actual := []int{} @@ -503,6 +504,7 @@ func TestTeplateStringTokens(t *testing.T) { } lexer := scanner.NewLexer(bytes.NewBufferString(src), "test.php") + lexer.WithMeta = true lv := &lval{} actual := []int{} @@ -588,6 +590,7 @@ func TestBackquoteStringTokens(t *testing.T) { } lexer := scanner.NewLexer(bytes.NewBufferString(src), "test.php") + lexer.WithMeta = true lv := &lval{} actual := []int{} @@ -681,6 +684,7 @@ CAT; } lexer := scanner.NewLexer(bytes.NewBufferString(src), "test.php") + lexer.WithMeta = true lv := &lval{} actual := []int{} @@ -754,6 +758,7 @@ CAT } lexer := scanner.NewLexer(bytes.NewBufferString(src), "test.php") + lexer.WithMeta = true lv := &lval{} actual := []int{} @@ -786,6 +791,7 @@ func TestInlineHtmlNopTokens(t *testing.T) { } lexer := scanner.NewLexer(bytes.NewBufferString(src), "test.php") + lexer.WithMeta = true lv := &lval{} actual := []int{} @@ -876,16 +882,18 @@ func TestSlashAfterVariable(t *testing.T) { func TestCommentEnd(t *testing.T) { src := ` test` - expected := []*comment.Comment{ - comment.NewComment("//test", position.NewPosition(2, 2, 8, 13)), + expected := []meta.Meta{ + meta.NewWhiteSpace("\n\t", position.NewPosition(1, 2, 6, 7)), + meta.NewComment("//test", position.NewPosition(2, 2, 8, 13)), } lexer := scanner.NewLexer(bytes.NewBufferString(src), "test.php") + lexer.WithMeta = true lv := &lval{} lexer.Lex(lv) - actual := lexer.Comments + actual := lexer.Meta assertEqual(t, expected, actual) } @@ -963,16 +981,18 @@ func TestInlineComment(t *testing.T) { src := ` 0 { - fmt.Fprintf(d.Writer, "%v\"Comments\":\n", d.Indent+" ") - for _, cc := range c { - fmt.Fprintf(d.Writer, "%v%q before %q\n", d.Indent+" ", cc, comment.TokenNames[cc.TokenName]) + if mm := n.GetMeta(); len(mm) > 0 { + fmt.Fprintf(d.Writer, "%v\"Meta\":\n", d.Indent+" ") + for _, m := range mm { + fmt.Fprintf(d.Writer, "%v%q before %q\n", d.Indent+" ", m, meta.TokenNames[m.GetTokenName()]) } } diff --git a/visitor/dumper_test.go b/visitor/dumper_test.go index f319dce..1c2d9e0 100644 --- a/visitor/dumper_test.go +++ b/visitor/dumper_test.go @@ -1,4 +1,3 @@ -// Package visitor contains walker.visitor implementations package visitor_test import ( @@ -23,6 +22,7 @@ func ExampleDumper() { }` php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php") + php7parser.WithMeta() php7parser.Parse() nodes := php7parser.GetRootNode() @@ -32,7 +32,6 @@ func ExampleDumper() { dumper := &visitor.Dumper{ Writer: os.Stdout, Indent: "| ", - Comments: php7parser.GetComments(), NsResolver: nsResolver, } nodes.Walk(dumper) @@ -43,38 +42,58 @@ func ExampleDumper() { // | "Stmts": // | [*stmt.Namespace] // | "Position": Pos{Line: 3-11 Pos: 10-143} + // | "Meta": + // | "\n\n\t\t" before "NamespaceToken" + // | " " before "OpenCurlyBracesToken" + // | "\n\t\t" before "CloseCurlyBracesToken" // | "NamespaceName": // | [*name.Name] // | "Position": Pos{Line: 3-3 Pos: 20-22} // | "Parts": // | [*name.NamePart] // | "Position": Pos{Line: 3-3 Pos: 20-22} + // | "Meta": + // | " " before "StringToken" // | "Value": "Foo" // | "Stmts": // | [*stmt.Class] // | "Position": Pos{Line: 4-10 Pos: 29-139} // | "NamespacedName": "Foo\\Bar" + // | "Meta": + // | "\n\t\t\t" before "ClassToken" + // | " " before "OpenCurlyBracesToken" + // | "\n\t\t\t" before "CloseCurlyBracesToken" // | "PhpDocComment": "" // | "ClassName": // | [*node.Identifier] // | "Position": Pos{Line: 4-4 Pos: 35-37} + // | "Meta": + // | " " before "StringToken" // | "Value": "Bar" // | "Stmts": // | [*stmt.ClassMethod] // | "Position": Pos{Line: 5-9 Pos: 45-134} + // | "Meta": + // | " " before "FunctionToken" // | "ReturnsRef": false // | "PhpDocComment": "" // | "MethodName": // | [*node.Identifier] // | "Position": Pos{Line: 5-5 Pos: 61-72} + // | "Meta": + // | " " before "IdentifierToken" // | "Value": "FunctionName" // | "Modifiers": // | [*node.Identifier] // | "Position": Pos{Line: 5-5 Pos: 45-50} + // | "Meta": + // | "\n\t\t\t\t" before "PublicToken" // | "Value": "public" // | "Params": // | [*node.Parameter] // | "Position": Pos{Line: 5-5 Pos: 74-89} + // | "Meta": + // | " " before "EqualToken" // | "Variadic": false // | "ByRef": false // | "VariableType": @@ -88,6 +107,8 @@ func ExampleDumper() { // | "Variable": // | [*expr.Variable] // | "Position": Pos{Line: 5-5 Pos: 79-82} + // | "Meta": + // | " " before "VariableToken" // | "VarName": // | [*node.Identifier] // | "Position": Pos{Line: 5-5 Pos: 79-82} @@ -102,18 +123,25 @@ func ExampleDumper() { // | "Parts": // | [*name.NamePart] // | "Position": Pos{Line: 5-5 Pos: 86-89} + // | "Meta": + // | " " before "StringToken" // | "Value": "null" // | "Stmt": // | [*stmt.StmtList] // | "Position": Pos{Line: 6-9 Pos: 96-134} + // | "Meta": + // | "\n\t\t\t\t" before "OpenCurlyBracesToken" + // | "\n\t\t\t\t" before "CloseCurlyBracesToken" // | "Stmts": // | [*stmt.Expression] // | "Position": Pos{Line: 8-8 Pos: 124-128} // | "Expr": // | [*expr.Variable] // | "Position": Pos{Line: 8-8 Pos: 124-127} - // | "Comments": + // | "Meta": + // | "\n\t\t\t\t\t" before "VariableToken" // | "// some comment\n" before "VariableToken" + // | "\n\t\t\t\t\t" before "VariableToken" // | "VarName": // | [*node.Identifier] // | "Position": Pos{Line: 8-8 Pos: 124-127} diff --git a/visitor/go_dumper.go b/visitor/go_dumper.go index 97ba85a..9aa39f0 100644 --- a/visitor/go_dumper.go +++ b/visitor/go_dumper.go @@ -7,6 +7,8 @@ import ( "reflect" "strings" + "github.com/z7zmey/php-parser/meta" + "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/walker" @@ -59,34 +61,39 @@ func (d *GoDumper) EnterNode(w walker.Walkable) bool { fmt.Fprint(d.Writer, "},\n") } - if cc := n.GetComments(); len(cc) > 0 { + if mm := n.GetMeta(); len(mm) > 0 { printIndent(d.Writer, d.depth) - fmt.Fprint(d.Writer, "Comments: []*comment.Comment{\n") + fmt.Fprint(d.Writer, "Meta: []meta.Meta{\n") d.depth++ - for _, c := range cc { + for _, m := range mm { printIndent(d.Writer, d.depth) - fmt.Fprint(d.Writer, "&comment.Comment{\n") + switch m.(type) { + case *meta.Comment: + fmt.Fprint(d.Writer, "&meta.Comment{\n") + case *meta.WhiteSpace: + fmt.Fprint(d.Writer, "&meta.WhiteSpace{\n") + } d.depth++ printIndent(d.Writer, d.depth) fmt.Fprint(d.Writer, "Position: &position.Position{\n") d.depth++ printIndent(d.Writer, d.depth) - fmt.Fprintf(d.Writer, "StartLine: %d,\n", c.Position.StartLine) + fmt.Fprintf(d.Writer, "StartLine: %d,\n", m.GetPosition().StartLine) printIndent(d.Writer, d.depth) - fmt.Fprintf(d.Writer, "EndLine: %d,\n", c.Position.EndLine) + fmt.Fprintf(d.Writer, "EndLine: %d,\n", m.GetPosition().EndLine) printIndent(d.Writer, d.depth) - fmt.Fprintf(d.Writer, "StartPos: %d,\n", c.Position.StartPos) + fmt.Fprintf(d.Writer, "StartPos: %d,\n", m.GetPosition().StartPos) printIndent(d.Writer, d.depth) - fmt.Fprintf(d.Writer, "EndPos: %d,\n", c.Position.EndPos) + fmt.Fprintf(d.Writer, "EndPos: %d,\n", m.GetPosition().EndPos) d.depth-- printIndent(d.Writer, d.depth) fmt.Fprint(d.Writer, "},\n") printIndent(d.Writer, d.depth) - fmt.Fprintf(d.Writer, "Value: %q,\n", c.Value) + fmt.Fprintf(d.Writer, "Value: %q,\n", m.String()) printIndent(d.Writer, d.depth) - fmt.Fprintf(d.Writer, "TokenName: %q,\n", c.TokenName) + fmt.Fprintf(d.Writer, "TokenName: %d,\n", m.GetTokenName()) d.depth-- printIndent(d.Writer, d.depth) diff --git a/visitor/go_dumper_test.go b/visitor/go_dumper_test.go index 154ca73..ef0fb63 100644 --- a/visitor/go_dumper_test.go +++ b/visitor/go_dumper_test.go @@ -1,4 +1,3 @@ -//Package visitor contains walker.visitor implementations package visitor_test import ( @@ -23,6 +22,7 @@ func ExampleGoDumper() { }` php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php") + php7parser.WithMeta() php7parser.Parse() nodes := php7parser.GetRootNode() @@ -50,6 +50,38 @@ func ExampleGoDumper() { // StartPos: 10, // EndPos: 142, // }, + // Meta: []meta.Meta{ + // &meta.WhiteSpace{ + // Position: &position.Position{ + // StartLine: 1, + // EndLine: 3, + // StartPos: 6, + // EndPos: 9, + // }, + // Value: "\n\n\t\t", + // TokenName: 67, + // }, + // &meta.WhiteSpace{ + // Position: &position.Position{ + // StartLine: 3, + // EndLine: 3, + // StartPos: 23, + // EndPos: 23, + // }, + // Value: " ", + // TokenName: 133, + // }, + // &meta.WhiteSpace{ + // Position: &position.Position{ + // StartLine: 10, + // EndLine: 11, + // StartPos: 139, + // EndPos: 141, + // }, + // Value: "\n\t\t", + // TokenName: 134, + // }, + // }, // NamespaceName: &name.Name{ // Position: &position.Position{ // StartLine: 3, @@ -65,6 +97,18 @@ func ExampleGoDumper() { // StartPos: 20, // EndPos: 22, // }, + // Meta: []meta.Meta{ + // &meta.WhiteSpace{ + // Position: &position.Position{ + // StartLine: 3, + // EndLine: 3, + // StartPos: 19, + // EndPos: 19, + // }, + // Value: " ", + // TokenName: 7, + // }, + // }, // Value: "Foo", // }, // }, @@ -77,6 +121,38 @@ func ExampleGoDumper() { // StartPos: 29, // EndPos: 138, // }, + // Meta: []meta.Meta{ + // &meta.WhiteSpace{ + // Position: &position.Position{ + // StartLine: 3, + // EndLine: 4, + // StartPos: 25, + // EndPos: 28, + // }, + // Value: "\n\t\t\t", + // TokenName: 48, + // }, + // &meta.WhiteSpace{ + // Position: &position.Position{ + // StartLine: 4, + // EndLine: 4, + // StartPos: 38, + // EndPos: 38, + // }, + // Value: " ", + // TokenName: 133, + // }, + // &meta.WhiteSpace{ + // Position: &position.Position{ + // StartLine: 9, + // EndLine: 10, + // StartPos: 134, + // EndPos: 137, + // }, + // Value: "\n\t\t\t", + // TokenName: 134, + // }, + // }, // PhpDocComment: "", // ClassName: &node.Identifier{ // Position: &position.Position{ @@ -85,6 +161,18 @@ func ExampleGoDumper() { // StartPos: 35, // EndPos: 37, // }, + // Meta: []meta.Meta{ + // &meta.WhiteSpace{ + // Position: &position.Position{ + // StartLine: 4, + // EndLine: 4, + // StartPos: 34, + // EndPos: 34, + // }, + // Value: " ", + // TokenName: 7, + // }, + // }, // Value: "Bar", // }, // Stmts: []node.Node{ @@ -95,6 +183,18 @@ func ExampleGoDumper() { // StartPos: 45, // EndPos: 133, // }, + // Meta: []meta.Meta{ + // &meta.WhiteSpace{ + // Position: &position.Position{ + // StartLine: 5, + // EndLine: 5, + // StartPos: 51, + // EndPos: 51, + // }, + // Value: " ", + // TokenName: 34, + // }, + // }, // ReturnsRef: false, // PhpDocComment: "", // MethodName: &node.Identifier{ @@ -104,6 +204,18 @@ func ExampleGoDumper() { // StartPos: 61, // EndPos: 72, // }, + // Meta: []meta.Meta{ + // &meta.WhiteSpace{ + // Position: &position.Position{ + // StartLine: 5, + // EndLine: 5, + // StartPos: 60, + // EndPos: 60, + // }, + // Value: " ", + // TokenName: 129, + // }, + // }, // Value: "FunctionName", // }, // Modifiers: []node.Node{ @@ -114,6 +226,18 @@ func ExampleGoDumper() { // StartPos: 45, // EndPos: 50, // }, + // Meta: []meta.Meta{ + // &meta.WhiteSpace{ + // Position: &position.Position{ + // StartLine: 4, + // EndLine: 5, + // StartPos: 40, + // EndPos: 44, + // }, + // Value: "\n\t\t\t\t", + // TokenName: 91, + // }, + // }, // Value: "public", // }, // }, @@ -125,6 +249,18 @@ func ExampleGoDumper() { // StartPos: 74, // EndPos: 89, // }, + // Meta: []meta.Meta{ + // &meta.WhiteSpace{ + // Position: &position.Position{ + // StartLine: 5, + // EndLine: 5, + // StartPos: 83, + // EndPos: 83, + // }, + // Value: " ", + // TokenName: 151, + // }, + // }, // Variadic: false, // ByRef: false, // VariableType: &name.Name{ @@ -153,6 +289,18 @@ func ExampleGoDumper() { // StartPos: 79, // EndPos: 82, // }, + // Meta: []meta.Meta{ + // &meta.WhiteSpace{ + // Position: &position.Position{ + // StartLine: 5, + // EndLine: 5, + // StartPos: 78, + // EndPos: 78, + // }, + // Value: " ", + // TokenName: 9, + // }, + // }, // VarName: &node.Identifier{ // Position: &position.Position{ // StartLine: 5, @@ -185,6 +333,18 @@ func ExampleGoDumper() { // StartPos: 86, // EndPos: 89, // }, + // Meta: []meta.Meta{ + // &meta.WhiteSpace{ + // Position: &position.Position{ + // StartLine: 5, + // EndLine: 5, + // StartPos: 85, + // EndPos: 85, + // }, + // Value: " ", + // TokenName: 7, + // }, + // }, // Value: "null", // }, // }, @@ -199,6 +359,28 @@ func ExampleGoDumper() { // StartPos: 96, // EndPos: 133, // }, + // Meta: []meta.Meta{ + // &meta.WhiteSpace{ + // Position: &position.Position{ + // StartLine: 5, + // EndLine: 6, + // StartPos: 91, + // EndPos: 95, + // }, + // Value: "\n\t\t\t\t", + // TokenName: 133, + // }, + // &meta.WhiteSpace{ + // Position: &position.Position{ + // StartLine: 8, + // EndLine: 9, + // StartPos: 128, + // EndPos: 132, + // }, + // Value: "\n\t\t\t\t", + // TokenName: 134, + // }, + // }, // Stmts: []node.Node{ // &stmt.Expression{ // Position: &position.Position{ @@ -214,8 +396,18 @@ func ExampleGoDumper() { // StartPos: 123, // EndPos: 126, // }, - // Comments: []*comment.Comment{ - // &comment.Comment{ + // Meta: []meta.Meta{ + // &meta.WhiteSpace{ + // Position: &position.Position{ + // StartLine: 6, + // EndLine: 7, + // StartPos: 97, + // EndPos: 102, + // }, + // Value: "\n\t\t\t\t\t", + // TokenName: 9, + // }, + // &meta.Comment{ // Position: &position.Position{ // StartLine: 7, // EndLine: 7, @@ -223,7 +415,17 @@ func ExampleGoDumper() { // EndPos: 117, // }, // Value: "//some comment\n", - // TokenName: '\t', + // TokenName: 9, + // }, + // &meta.WhiteSpace{ + // Position: &position.Position{ + // StartLine: 7, + // EndLine: 8, + // StartPos: 117, + // EndPos: 122, + // }, + // Value: "\n\t\t\t\t\t", + // TokenName: 9, // }, // }, // VarName: &node.Identifier{ diff --git a/visitor/json_dumper.go b/visitor/json_dumper.go index dfc2c0f..f0e1934 100644 --- a/visitor/json_dumper.go +++ b/visitor/json_dumper.go @@ -5,16 +5,17 @@ import ( "fmt" "io" "reflect" + "sort" + + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" - "github.com/z7zmey/php-parser/parser" "github.com/z7zmey/php-parser/walker" ) type JsonDumper struct { Writer io.Writer - Comments parser.Comments NsResolver *NamespaceResolver } @@ -42,14 +43,19 @@ func (d *JsonDumper) EnterNode(w walker.Walkable) bool { } } - if c := n.GetComments(); len(c) > 0 { - fmt.Fprintf(d.Writer, ",%q:[", "comments") + if mm := n.GetMeta(); len(mm) > 0 { + fmt.Fprintf(d.Writer, ",%q:[", "meta") - for k, cc := range c { - if k == 0 { - fmt.Fprintf(d.Writer, "%q", cc) - } else { - fmt.Fprintf(d.Writer, ",%q", cc) + for k, m := range mm { + if k != 0 { + fmt.Fprint(d.Writer, ",") + } + + switch m.(type) { + case *meta.Comment: + fmt.Fprintf(d.Writer, "{%q:%q,%q:%q,%q:%q}", "type", "*meta.Comment", "value", m.String(), "tokenName", meta.TokenNames[m.GetTokenName()]) + case *meta.WhiteSpace: + fmt.Fprintf(d.Writer, "{%q:%q,%q:%q,%q:%q}", "type", "*meta.WhiteSpace", "value", m.String(), "tokenName", meta.TokenNames[m.GetTokenName()]) } } @@ -57,12 +63,20 @@ func (d *JsonDumper) EnterNode(w walker.Walkable) bool { } if a := n.Attributes(); len(a) > 0 { - for key, attr := range a { + var attributes []string + for key := range n.Attributes() { + attributes = append(attributes, key) + } + + sort.Strings(attributes) + + for _, attributeName := range attributes { + attr := a[attributeName] switch attr.(type) { case string: - fmt.Fprintf(d.Writer, ",\"%s\":%q", key, attr) + fmt.Fprintf(d.Writer, ",\"%s\":%q", attributeName, attr) default: - fmt.Fprintf(d.Writer, ",\"%s\":%v", key, attr) + fmt.Fprintf(d.Writer, ",\"%s\":%v", attributeName, attr) } } } diff --git a/visitor/json_dumper_test.go b/visitor/json_dumper_test.go index 5539668..b99f8ac 100644 --- a/visitor/json_dumper_test.go +++ b/visitor/json_dumper_test.go @@ -1,4 +1,3 @@ -//Package visitor contains walker.visitor implementations package visitor_test import ( @@ -24,6 +23,7 @@ func ExampleJsonDumper() { }` php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php") + php7parser.WithMeta() php7parser.Parse() nodes := php7parser.GetRootNode() @@ -32,11 +32,10 @@ func ExampleJsonDumper() { dumper := &visitor.JsonDumper{ Writer: os.Stdout, - Comments: php7parser.GetComments(), NsResolver: nsResolver, } nodes.Walk(dumper) - // Unordered output: - // {"type":"*node.Root","position":{"startPos":10,"endPos":166,"startLine":3,"endLine":12},"Stmts":[{"type":"*stmt.Namespace","position":{"startPos":10,"endPos":166,"startLine":3,"endLine":12},"NamespaceName":{"type":"*name.Name","position":{"startPos":20,"endPos":22,"startLine":3,"endLine":3},"Parts":[{"type":"*name.NamePart","position":{"startPos":20,"endPos":22,"startLine":3,"endLine":3},"Value":"Foo"}]},"Stmts":[{"type":"*stmt.Class","position":{"startPos":29,"endPos":162,"startLine":4,"endLine":11},"namespacedName":"Foo\\Bar","PhpDocComment":"","ClassName":{"type":"*node.Identifier","position":{"startPos":35,"endPos":37,"startLine":4,"endLine":4},"Value":"Bar"},"Stmts":[{"type":"*stmt.ClassMethod","position":{"startPos":45,"endPos":157,"startLine":5,"endLine":10},"ReturnsRef":false,"PhpDocComment":"","MethodName":{"type":"*node.Identifier","position":{"startPos":61,"endPos":72,"startLine":5,"endLine":5},"Value":"FunctionName"},"Modifiers":[{"type":"*node.Identifier","position":{"startPos":45,"endPos":50,"startLine":5,"endLine":5},"Value":"public"}],"Params":[{"type":"*node.Parameter","position":{"startPos":74,"endPos":89,"startLine":5,"endLine":5},"ByRef":false,"Variadic":false,"VariableType":{"type":"*name.Name","position":{"startPos":74,"endPos":77,"startLine":5,"endLine":5},"namespacedName":"Foo\\Type","Parts":[{"type":"*name.NamePart","position":{"startPos":74,"endPos":77,"startLine":5,"endLine":5},"Value":"Type"}]},"Variable":{"type":"*expr.Variable","position":{"startPos":79,"endPos":82,"startLine":5,"endLine":5},"VarName":{"type":"*node.Identifier","position":{"startPos":79,"endPos":82,"startLine":5,"endLine":5},"Value":"var"}},"DefaultValue":{"type":"*expr.ConstFetch","position":{"startPos":86,"endPos":89,"startLine":5,"endLine":5},"Constant":{"type":"*name.Name","position":{"startPos":86,"endPos":89,"startLine":5,"endLine":5},"namespacedName":"null","Parts":[{"type":"*name.NamePart","position":{"startPos":86,"endPos":89,"startLine":5,"endLine":5},"Value":"null"}]}}}],"Stmt":{"type":"*stmt.StmtList","position":{"startPos":96,"endPos":157,"startLine":6,"endLine":10},"Stmts":[{"type":"*stmt.Expression","position":{"startPos":147,"endPos":151,"startLine":9,"endLine":9},"Expr":{"type":"*expr.Variable","position":{"startPos":147,"endPos":150,"startLine":9,"endLine":9},"comments":["// some comment\n","// second comment\n"],"VarName":{"type":"*node.Identifier","position":{"startPos":147,"endPos":150,"startLine":9,"endLine":9},"Value":"var"}}}]}}]}]}]} + // Output: + // {"type":"*node.Root","position":{"startPos":10,"endPos":166,"startLine":3,"endLine":12},"Stmts":[{"type":"*stmt.Namespace","position":{"startPos":10,"endPos":166,"startLine":3,"endLine":12},"meta":[{"type":"*meta.WhiteSpace","value":"\n\n\t\t","tokenName":"NamespaceToken"},{"type":"*meta.WhiteSpace","value":" ","tokenName":"OpenCurlyBracesToken"},{"type":"*meta.WhiteSpace","value":"\n\t\t","tokenName":"CloseCurlyBracesToken"}],"NamespaceName":{"type":"*name.Name","position":{"startPos":20,"endPos":22,"startLine":3,"endLine":3},"Parts":[{"type":"*name.NamePart","position":{"startPos":20,"endPos":22,"startLine":3,"endLine":3},"meta":[{"type":"*meta.WhiteSpace","value":" ","tokenName":"StringToken"}],"Value":"Foo"}]},"Stmts":[{"type":"*stmt.Class","position":{"startPos":29,"endPos":162,"startLine":4,"endLine":11},"namespacedName":"Foo\\Bar","meta":[{"type":"*meta.WhiteSpace","value":"\n\t\t\t","tokenName":"ClassToken"},{"type":"*meta.WhiteSpace","value":" ","tokenName":"OpenCurlyBracesToken"},{"type":"*meta.WhiteSpace","value":"\n\t\t\t","tokenName":"CloseCurlyBracesToken"}],"PhpDocComment":"","ClassName":{"type":"*node.Identifier","position":{"startPos":35,"endPos":37,"startLine":4,"endLine":4},"meta":[{"type":"*meta.WhiteSpace","value":" ","tokenName":"StringToken"}],"Value":"Bar"},"Stmts":[{"type":"*stmt.ClassMethod","position":{"startPos":45,"endPos":157,"startLine":5,"endLine":10},"meta":[{"type":"*meta.WhiteSpace","value":" ","tokenName":"FunctionToken"}],"PhpDocComment":"","ReturnsRef":false,"MethodName":{"type":"*node.Identifier","position":{"startPos":61,"endPos":72,"startLine":5,"endLine":5},"meta":[{"type":"*meta.WhiteSpace","value":" ","tokenName":"IdentifierToken"}],"Value":"FunctionName"},"Modifiers":[{"type":"*node.Identifier","position":{"startPos":45,"endPos":50,"startLine":5,"endLine":5},"meta":[{"type":"*meta.WhiteSpace","value":"\n\t\t\t\t","tokenName":"PublicToken"}],"Value":"public"}],"Params":[{"type":"*node.Parameter","position":{"startPos":74,"endPos":89,"startLine":5,"endLine":5},"meta":[{"type":"*meta.WhiteSpace","value":" ","tokenName":"EqualToken"}],"ByRef":false,"Variadic":false,"VariableType":{"type":"*name.Name","position":{"startPos":74,"endPos":77,"startLine":5,"endLine":5},"namespacedName":"Foo\\Type","Parts":[{"type":"*name.NamePart","position":{"startPos":74,"endPos":77,"startLine":5,"endLine":5},"Value":"Type"}]},"Variable":{"type":"*expr.Variable","position":{"startPos":79,"endPos":82,"startLine":5,"endLine":5},"meta":[{"type":"*meta.WhiteSpace","value":" ","tokenName":"VariableToken"}],"VarName":{"type":"*node.Identifier","position":{"startPos":79,"endPos":82,"startLine":5,"endLine":5},"Value":"var"}},"DefaultValue":{"type":"*expr.ConstFetch","position":{"startPos":86,"endPos":89,"startLine":5,"endLine":5},"Constant":{"type":"*name.Name","position":{"startPos":86,"endPos":89,"startLine":5,"endLine":5},"namespacedName":"null","Parts":[{"type":"*name.NamePart","position":{"startPos":86,"endPos":89,"startLine":5,"endLine":5},"meta":[{"type":"*meta.WhiteSpace","value":" ","tokenName":"StringToken"}],"Value":"null"}]}}}],"Stmt":{"type":"*stmt.StmtList","position":{"startPos":96,"endPos":157,"startLine":6,"endLine":10},"meta":[{"type":"*meta.WhiteSpace","value":"\n\t\t\t\t","tokenName":"OpenCurlyBracesToken"},{"type":"*meta.WhiteSpace","value":"\n\t\t\t\t","tokenName":"CloseCurlyBracesToken"}],"Stmts":[{"type":"*stmt.Expression","position":{"startPos":147,"endPos":151,"startLine":9,"endLine":9},"Expr":{"type":"*expr.Variable","position":{"startPos":147,"endPos":150,"startLine":9,"endLine":9},"meta":[{"type":"*meta.WhiteSpace","value":"\n\t\t\t\t\t","tokenName":"VariableToken"},{"type":"*meta.Comment","value":"// some comment\n","tokenName":"VariableToken"},{"type":"*meta.WhiteSpace","value":"\n\t\t\t\t\t","tokenName":"VariableToken"},{"type":"*meta.Comment","value":"// second comment\n","tokenName":"VariableToken"},{"type":"*meta.WhiteSpace","value":"\n\t\t\t\t\t","tokenName":"VariableToken"}],"VarName":{"type":"*node.Identifier","position":{"startPos":147,"endPos":150,"startLine":9,"endLine":9},"Value":"var"}}}]}}]}]}]} } diff --git a/visitor/namespace_resolver_test.go b/visitor/namespace_resolver_test.go index a407c18..6a17b98 100644 --- a/visitor/namespace_resolver_test.go +++ b/visitor/namespace_resolver_test.go @@ -1,4 +1,3 @@ -// Package visitor contains walker.visitor implementations package visitor_test import ( diff --git a/visitor/pretty_json_dumper.go b/visitor/pretty_json_dumper.go index 6a34e16..9b5b04b 100644 --- a/visitor/pretty_json_dumper.go +++ b/visitor/pretty_json_dumper.go @@ -6,18 +6,27 @@ import ( "io" "reflect" + "github.com/z7zmey/php-parser/meta" "github.com/z7zmey/php-parser/node" - "github.com/z7zmey/php-parser/parser" - "github.com/z7zmey/php-parser/walker" ) type PrettyJsonDumper struct { - Writer io.Writer - Comments parser.Comments - NsResolver *NamespaceResolver - depth int - isChildNode bool + Writer io.Writer + NsResolver *NamespaceResolver + depth int + isChildNode bool + isNotFirstNode bool +} + +func NewPrettyJsonDumper(Writer io.Writer, NsResolver *NamespaceResolver) *PrettyJsonDumper { + return &PrettyJsonDumper{ + Writer: Writer, + NsResolver: NsResolver, + depth: 0, + isChildNode: false, + isNotFirstNode: false, + } } func (d *PrettyJsonDumper) printIndent(w io.Writer) { @@ -34,8 +43,12 @@ func (d *PrettyJsonDumper) EnterNode(w walker.Walkable) bool { if d.isChildNode { d.isChildNode = false + } else if d.isNotFirstNode { + fmt.Fprint(d.Writer, ",\n") + d.printIndent(d.Writer) } else { d.printIndent(d.Writer) + d.isNotFirstNode = true } fmt.Fprint(d.Writer, "{\n") @@ -69,20 +82,33 @@ func (d *PrettyJsonDumper) EnterNode(w walker.Walkable) bool { } } - if c := n.GetComments(); len(c) > 0 { + if mm := n.GetMeta(); len(mm) > 0 { fmt.Fprint(d.Writer, ",\n") d.printIndent(d.Writer) - fmt.Fprint(d.Writer, "\"comments\": [\n") + fmt.Fprint(d.Writer, "\"meta\": [\n") d.depth++ - for k, cc := range c { - if k == 0 { - d.printIndent(d.Writer) - fmt.Fprintf(d.Writer, "%q", cc) - } else { + for k, m := range mm { + if k != 0 { fmt.Fprint(d.Writer, ",\n") - d.printIndent(d.Writer) - fmt.Fprintf(d.Writer, "%q", cc) } + + d.printIndent(d.Writer) + fmt.Fprint(d.Writer, "{\n") + d.depth++ + d.printIndent(d.Writer) + switch m.(type) { + case *meta.Comment: + fmt.Fprintf(d.Writer, "%q: %q,\n", "type", "*meta.Comment") + case *meta.WhiteSpace: + fmt.Fprintf(d.Writer, "%q: %q,\n", "type", "*meta.WhiteSpace") + } + d.printIndent(d.Writer) + fmt.Fprintf(d.Writer, "%q: %q,\n", "value", m.String()) + d.printIndent(d.Writer) + fmt.Fprintf(d.Writer, "%q: %q\n", "tokenName", meta.TokenNames[m.GetTokenName()]) + d.depth-- + d.printIndent(d.Writer) + fmt.Fprint(d.Writer, "}") } d.depth-- fmt.Fprint(d.Writer, "\n") @@ -130,6 +156,8 @@ func (d *PrettyJsonDumper) EnterChildList(key string, w walker.Walkable) { d.printIndent(d.Writer) fmt.Fprintf(d.Writer, "%q: [\n", key) d.depth++ + + d.isNotFirstNode = false } func (d *PrettyJsonDumper) LeaveChildList(key string, w walker.Walkable) { diff --git a/visitor/pretty_json_dumper_test.go b/visitor/pretty_json_dumper_test.go index e0d263d..92d753d 100644 --- a/visitor/pretty_json_dumper_test.go +++ b/visitor/pretty_json_dumper_test.go @@ -1,4 +1,3 @@ -//Package visitor contains walker.visitor implementations package visitor_test import ( @@ -21,20 +20,20 @@ func ExamplePrettyJsonDumper() { $var; } } - }` + + function foo() {} + } + ` php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php") + php7parser.WithMeta() php7parser.Parse() nodes := php7parser.GetRootNode() nsResolver := visitor.NewNamespaceResolver() nodes.Walk(nsResolver) - dumper := &visitor.PrettyJsonDumper{ - Writer: os.Stdout, - Comments: php7parser.GetComments(), - NsResolver: nsResolver, - } + dumper := visitor.NewPrettyJsonDumper(os.Stdout, nsResolver) nodes.Walk(dumper) // Unordered output: @@ -42,19 +41,36 @@ func ExamplePrettyJsonDumper() { // "type": "*node.Root", // "position": { // "startPos": 10, - // "endPos": 166, + // "endPos": 188, // "startLine": 3, - // "endLine": 12 + // "endLine": 14 // }, // "Stmts": [ // { // "type": "*stmt.Namespace", // "position": { // "startPos": 10, - // "endPos": 166, + // "endPos": 188, // "startLine": 3, - // "endLine": 12 + // "endLine": 14 // }, + // "meta": [ + // { + // "type": "*meta.WhiteSpace", + // "value": "\n\n\t\t", + // "tokenName": "NamespaceToken" + // }, + // { + // "type": "*meta.WhiteSpace", + // "value": " ", + // "tokenName": "OpenCurlyBracesToken" + // }, + // { + // "type": "*meta.WhiteSpace", + // "value": "\n\t\t", + // "tokenName": "CloseCurlyBracesToken" + // } + // ], // "NamespaceName": { // "type": "*name.Name", // "position": { @@ -72,6 +88,13 @@ func ExamplePrettyJsonDumper() { // "startLine": 3, // "endLine": 3 // }, + // "meta": [ + // { + // "type": "*meta.WhiteSpace", + // "value": " ", + // "tokenName": "StringToken" + // } + // ], // "Value": "Foo" // } // ] @@ -86,6 +109,23 @@ func ExamplePrettyJsonDumper() { // "endLine": 11 // }, // "namespacedName": "Foo\\Bar", + // "meta": [ + // { + // "type": "*meta.WhiteSpace", + // "value": "\n\t\t\t", + // "tokenName": "ClassToken" + // }, + // { + // "type": "*meta.WhiteSpace", + // "value": " ", + // "tokenName": "OpenCurlyBracesToken" + // }, + // { + // "type": "*meta.WhiteSpace", + // "value": "\n\t\t\t", + // "tokenName": "CloseCurlyBracesToken" + // } + // ], // "PhpDocComment": "", // "ClassName": { // "type": "*node.Identifier", @@ -95,6 +135,13 @@ func ExamplePrettyJsonDumper() { // "startLine": 4, // "endLine": 4 // }, + // "meta": [ + // { + // "type": "*meta.WhiteSpace", + // "value": " ", + // "tokenName": "StringToken" + // } + // ], // "Value": "Bar" // }, // "Stmts": [ @@ -106,6 +153,13 @@ func ExamplePrettyJsonDumper() { // "startLine": 5, // "endLine": 10 // }, + // "meta": [ + // { + // "type": "*meta.WhiteSpace", + // "value": " ", + // "tokenName": "FunctionToken" + // } + // ], // "ReturnsRef": false, // "PhpDocComment": "", // "MethodName": { @@ -116,6 +170,13 @@ func ExamplePrettyJsonDumper() { // "startLine": 5, // "endLine": 5 // }, + // "meta": [ + // { + // "type": "*meta.WhiteSpace", + // "value": " ", + // "tokenName": "IdentifierToken" + // } + // ], // "Value": "FunctionName" // }, // "Modifiers": [ @@ -127,6 +188,13 @@ func ExamplePrettyJsonDumper() { // "startLine": 5, // "endLine": 5 // }, + // "meta": [ + // { + // "type": "*meta.WhiteSpace", + // "value": "\n\t\t\t\t", + // "tokenName": "PublicToken" + // } + // ], // "Value": "public" // } // ], @@ -139,6 +207,13 @@ func ExamplePrettyJsonDumper() { // "startLine": 5, // "endLine": 5 // }, + // "meta": [ + // { + // "type": "*meta.WhiteSpace", + // "value": " ", + // "tokenName": "EqualToken" + // } + // ], // "ByRef": false, // "Variadic": false, // "VariableType": { @@ -171,6 +246,13 @@ func ExamplePrettyJsonDumper() { // "startLine": 5, // "endLine": 5 // }, + // "meta": [ + // { + // "type": "*meta.WhiteSpace", + // "value": " ", + // "tokenName": "VariableToken" + // } + // ], // "VarName": { // "type": "*node.Identifier", // "position": { @@ -208,6 +290,13 @@ func ExamplePrettyJsonDumper() { // "startLine": 5, // "endLine": 5 // }, + // "meta": [ + // { + // "type": "*meta.WhiteSpace", + // "value": " ", + // "tokenName": "StringToken" + // } + // ], // "Value": "null" // } // ] @@ -223,6 +312,18 @@ func ExamplePrettyJsonDumper() { // "startLine": 6, // "endLine": 10 // }, + // "meta": [ + // { + // "type": "*meta.WhiteSpace", + // "value": "\n\t\t\t\t", + // "tokenName": "OpenCurlyBracesToken" + // }, + // { + // "type": "*meta.WhiteSpace", + // "value": "\n\t\t\t\t", + // "tokenName": "CloseCurlyBracesToken" + // } + // ], // "Stmts": [ // { // "type": "*stmt.Expression", @@ -240,9 +341,32 @@ func ExamplePrettyJsonDumper() { // "startLine": 9, // "endLine": 9 // }, - // "comments": [ - // "// some comment\n", - // "// second comment\n" + // "meta": [ + // { + // "type": "*meta.WhiteSpace", + // "value": "\n\t\t\t\t\t", + // "tokenName": "VariableToken" + // }, + // { + // "type": "*meta.Comment", + // "value": "// some comment\n", + // "tokenName": "VariableToken" + // }, + // { + // "type": "*meta.WhiteSpace", + // "value": "\n\t\t\t\t\t", + // "tokenName": "VariableToken" + // }, + // { + // "type": "*meta.Comment", + // "value": "// second comment\n", + // "tokenName": "VariableToken" + // }, + // { + // "type": "*meta.WhiteSpace", + // "value": "\n\t\t\t\t\t", + // "tokenName": "VariableToken" + // } // ], // "VarName": { // "type": "*node.Identifier", @@ -260,6 +384,50 @@ func ExamplePrettyJsonDumper() { // } // } // ] + // }, + // { + // "type": "*stmt.Function", + // "position": { + // "startPos": 168, + // "endPos": 184, + // "startLine": 13, + // "endLine": 13 + // }, + // "namespacedName": "Foo\\foo", + // "meta": [ + // { + // "type": "*meta.WhiteSpace", + // "value": "\n\n\t\t\t", + // "tokenName": "FunctionToken" + // }, + // { + // "type": "*meta.WhiteSpace", + // "value": " ", + // "tokenName": "OpenCurlyBracesToken" + // } + // ], + // "ReturnsRef": false, + // "PhpDocComment": "", + // "FunctionName": { + // "type": "*node.Identifier", + // "position": { + // "startPos": 177, + // "endPos": 179, + // "startLine": 13, + // "endLine": 13 + // }, + // "meta": [ + // { + // "type": "*meta.WhiteSpace", + // "value": " ", + // "tokenName": "StringToken" + // } + // ], + // "Value": "foo" + // }, + // "Stmts": [ + // + // ] // } // ] // } From 9f0e7667572b738f46d8189d4676de8a18899bec Mon Sep 17 00:00:00 2001 From: z7zmey Date: Sun, 1 Jul 2018 00:05:59 +0300 Subject: [PATCH 011/117] update tests --- node/expr/assign/t_meta_test.go | 41 ++++++++++++++ node/expr/assign/t_position_test.go | 16 ++++++ node/expr/binary/t_meta_test.go | 53 ++++++++++++++++++ node/expr/binary/t_position_test.go | 16 ++++++ node/expr/cast/t_meta_test.go | 33 +++++++++++ node/expr/cast/t_position_test.go | 16 ++++++ node/expr/t_meta_test.go | 69 +++++++++++++++++++++++ node/expr/t_position_test.go | 16 ++++++ node/name/t_meta_test.go | 30 ++++++++++ node/name/t_position_test.go | 16 ++++++ node/scalar/t_meta_test.go | 33 +++++++++++ node/scalar/t_position_test.go | 16 ++++++ node/stmt/t_meta_test.go | 86 +++++++++++++++++++++++++++++ node/stmt/t_position_test.go | 16 ++++++ node/t_meta_test.go | 30 ++++++++++ node/t_position_test.go | 16 ++++++ printer/printer_test.go | 31 +++++++++++ 17 files changed, 534 insertions(+) create mode 100644 node/expr/assign/t_meta_test.go create mode 100644 node/expr/assign/t_position_test.go create mode 100644 node/expr/binary/t_meta_test.go create mode 100644 node/expr/binary/t_position_test.go create mode 100644 node/expr/cast/t_meta_test.go create mode 100644 node/expr/cast/t_position_test.go create mode 100644 node/expr/t_meta_test.go create mode 100644 node/expr/t_position_test.go create mode 100644 node/name/t_meta_test.go create mode 100644 node/name/t_position_test.go create mode 100644 node/scalar/t_meta_test.go create mode 100644 node/scalar/t_position_test.go create mode 100644 node/stmt/t_meta_test.go create mode 100644 node/stmt/t_position_test.go create mode 100644 node/t_meta_test.go create mode 100644 node/t_position_test.go diff --git a/node/expr/assign/t_meta_test.go b/node/expr/assign/t_meta_test.go new file mode 100644 index 0000000..0de3e2f --- /dev/null +++ b/node/expr/assign/t_meta_test.go @@ -0,0 +1,41 @@ +package assign_test + +import ( + "testing" + + "github.com/z7zmey/php-parser/node/expr/assign" + + "github.com/z7zmey/php-parser/meta" + + "github.com/z7zmey/php-parser/node" +) + +var nodes = []node.Node{ + &assign.Reference{}, + &assign.Assign{}, + &assign.BitwiseAnd{}, + &assign.BitwiseOr{}, + &assign.BitwiseXor{}, + &assign.Concat{}, + &assign.Div{}, + &assign.Minus{}, + &assign.Mod{}, + &assign.Mul{}, + &assign.Plus{}, + &assign.Pow{}, + &assign.ShiftLeft{}, + &assign.ShiftRight{}, + &assign.ShiftRight{}, +} + +func TestMeta(t *testing.T) { + expected := []meta.Meta{ + meta.NewComment("//comment\n", nil), + meta.NewWhiteSpace(" ", nil), + } + for _, n := range nodes { + n.AddMeta(expected) + actual := n.GetMeta() + assertEqual(t, expected, actual) + } +} diff --git a/node/expr/assign/t_position_test.go b/node/expr/assign/t_position_test.go new file mode 100644 index 0000000..6813437 --- /dev/null +++ b/node/expr/assign/t_position_test.go @@ -0,0 +1,16 @@ +package assign_test + +import ( + "testing" + + "github.com/z7zmey/php-parser/position" +) + +func TestPosition(t *testing.T) { + expected := position.NewPosition(1, 1, 1, 1) + for _, n := range nodes { + n.SetPosition(expected) + actual := n.GetPosition() + assertEqual(t, expected, actual) + } +} diff --git a/node/expr/binary/t_meta_test.go b/node/expr/binary/t_meta_test.go new file mode 100644 index 0000000..5c29048 --- /dev/null +++ b/node/expr/binary/t_meta_test.go @@ -0,0 +1,53 @@ +package binary_test + +import ( + "testing" + + "github.com/z7zmey/php-parser/node/expr/binary" + + "github.com/z7zmey/php-parser/meta" + + "github.com/z7zmey/php-parser/node" +) + +var nodes = []node.Node{ + &binary.BitwiseAnd{}, + &binary.BitwiseOr{}, + &binary.BitwiseXor{}, + &binary.BooleanAnd{}, + &binary.BooleanOr{}, + &binary.Coalesce{}, + &binary.Concat{}, + &binary.Div{}, + &binary.Equal{}, + &binary.GreaterOrEqual{}, + &binary.Greater{}, + &binary.Identical{}, + &binary.LogicalAnd{}, + &binary.LogicalOr{}, + &binary.LogicalXor{}, + &binary.Minus{}, + &binary.Mod{}, + &binary.Mul{}, + &binary.NotEqual{}, + &binary.NotIdentical{}, + &binary.Plus{}, + &binary.Pow{}, + &binary.ShiftLeft{}, + &binary.ShiftRight{}, + &binary.SmallerOrEqual{}, + &binary.Smaller{}, + &binary.Spaceship{}, +} + +func TestMeta(t *testing.T) { + expected := []meta.Meta{ + meta.NewComment("//comment\n", nil), + meta.NewWhiteSpace(" ", nil), + } + for _, n := range nodes { + n.AddMeta(expected) + actual := n.GetMeta() + assertEqual(t, expected, actual) + } +} diff --git a/node/expr/binary/t_position_test.go b/node/expr/binary/t_position_test.go new file mode 100644 index 0000000..6c1fe07 --- /dev/null +++ b/node/expr/binary/t_position_test.go @@ -0,0 +1,16 @@ +package binary_test + +import ( + "testing" + + "github.com/z7zmey/php-parser/position" +) + +func TestPosition(t *testing.T) { + expected := position.NewPosition(1, 1, 1, 1) + for _, n := range nodes { + n.SetPosition(expected) + actual := n.GetPosition() + assertEqual(t, expected, actual) + } +} diff --git a/node/expr/cast/t_meta_test.go b/node/expr/cast/t_meta_test.go new file mode 100644 index 0000000..e2e4dbb --- /dev/null +++ b/node/expr/cast/t_meta_test.go @@ -0,0 +1,33 @@ +package cast_test + +import ( + "testing" + + "github.com/z7zmey/php-parser/node/expr/cast" + + "github.com/z7zmey/php-parser/meta" + + "github.com/z7zmey/php-parser/node" +) + +var nodes = []node.Node{ + &cast.Array{}, + &cast.Bool{}, + &cast.Double{}, + &cast.Int{}, + &cast.Object{}, + &cast.String{}, + &cast.Unset{}, +} + +func TestMeta(t *testing.T) { + expected := []meta.Meta{ + meta.NewComment("//comment\n", nil), + meta.NewWhiteSpace(" ", nil), + } + for _, n := range nodes { + n.AddMeta(expected) + actual := n.GetMeta() + assertEqual(t, expected, actual) + } +} diff --git a/node/expr/cast/t_position_test.go b/node/expr/cast/t_position_test.go new file mode 100644 index 0000000..ef29ac6 --- /dev/null +++ b/node/expr/cast/t_position_test.go @@ -0,0 +1,16 @@ +package cast_test + +import ( + "testing" + + "github.com/z7zmey/php-parser/position" +) + +func TestPosition(t *testing.T) { + expected := position.NewPosition(1, 1, 1, 1) + for _, n := range nodes { + n.SetPosition(expected) + actual := n.GetPosition() + assertEqual(t, expected, actual) + } +} diff --git a/node/expr/t_meta_test.go b/node/expr/t_meta_test.go new file mode 100644 index 0000000..a5f13ad --- /dev/null +++ b/node/expr/t_meta_test.go @@ -0,0 +1,69 @@ +package expr_test + +import ( + "testing" + + "github.com/z7zmey/php-parser/node/expr" + + "github.com/z7zmey/php-parser/meta" + + "github.com/z7zmey/php-parser/node" +) + +var nodes = []node.Node{ + &expr.ArrayDimFetch{}, + &expr.ArrayItem{}, + &expr.Array{}, + &expr.BitwiseNot{}, + &expr.BooleanNot{}, + &expr.ClassConstFetch{}, + &expr.Clone{}, + &expr.ClosureUse{}, + &expr.Closure{}, + &expr.ConstFetch{}, + &expr.Die{}, + &expr.Empty{}, + &expr.ErrorSuppress{}, + &expr.Eval{}, + &expr.Exit{}, + &expr.FunctionCall{}, + &expr.IncludeOnce{}, + &expr.Include{}, + &expr.InstanceOf{}, + &expr.Isset{}, + &expr.List{}, + &expr.MethodCall{}, + &expr.New{}, + &expr.PostDec{}, + &expr.PostInc{}, + &expr.PreDec{}, + &expr.PreInc{}, + &expr.Print{}, + &expr.PropertyFetch{}, + &expr.Reference{}, + &expr.RequireOnce{}, + &expr.Require{}, + &expr.ShellExec{}, + &expr.ShortArray{}, + &expr.ShortList{}, + &expr.StaticCall{}, + &expr.StaticPropertyFetch{}, + &expr.Ternary{}, + &expr.UnaryMinus{}, + &expr.UnaryPlus{}, + &expr.Variable{}, + &expr.YieldFrom{}, + &expr.Yield{}, +} + +func TestMeta(t *testing.T) { + expected := []meta.Meta{ + meta.NewComment("//comment\n", nil), + meta.NewWhiteSpace(" ", nil), + } + for _, n := range nodes { + n.AddMeta(expected) + actual := n.GetMeta() + assertEqual(t, expected, actual) + } +} diff --git a/node/expr/t_position_test.go b/node/expr/t_position_test.go new file mode 100644 index 0000000..2d673ce --- /dev/null +++ b/node/expr/t_position_test.go @@ -0,0 +1,16 @@ +package expr_test + +import ( + "testing" + + "github.com/z7zmey/php-parser/position" +) + +func TestPosition(t *testing.T) { + expected := position.NewPosition(1, 1, 1, 1) + for _, n := range nodes { + n.SetPosition(expected) + actual := n.GetPosition() + assertEqual(t, expected, actual) + } +} diff --git a/node/name/t_meta_test.go b/node/name/t_meta_test.go new file mode 100644 index 0000000..4b35fe2 --- /dev/null +++ b/node/name/t_meta_test.go @@ -0,0 +1,30 @@ +package name_test + +import ( + "testing" + + "github.com/z7zmey/php-parser/node/name" + + "github.com/z7zmey/php-parser/meta" + + "github.com/z7zmey/php-parser/node" +) + +var nodes = []node.Node{ + &name.FullyQualified{}, + &name.NamePart{}, + &name.Name{}, + &name.Relative{}, +} + +func TestMeta(t *testing.T) { + expected := []meta.Meta{ + meta.NewComment("//comment\n", nil), + meta.NewWhiteSpace(" ", nil), + } + for _, n := range nodes { + n.AddMeta(expected) + actual := n.GetMeta() + assertEqual(t, expected, actual) + } +} diff --git a/node/name/t_position_test.go b/node/name/t_position_test.go new file mode 100644 index 0000000..c5422e8 --- /dev/null +++ b/node/name/t_position_test.go @@ -0,0 +1,16 @@ +package name_test + +import ( + "testing" + + "github.com/z7zmey/php-parser/position" +) + +func TestPosition(t *testing.T) { + expected := position.NewPosition(1, 1, 1, 1) + for _, n := range nodes { + n.SetPosition(expected) + actual := n.GetPosition() + assertEqual(t, expected, actual) + } +} diff --git a/node/scalar/t_meta_test.go b/node/scalar/t_meta_test.go new file mode 100644 index 0000000..449db8b --- /dev/null +++ b/node/scalar/t_meta_test.go @@ -0,0 +1,33 @@ +package scalar_test + +import ( + "testing" + + "github.com/z7zmey/php-parser/node/scalar" + + "github.com/z7zmey/php-parser/meta" + + "github.com/z7zmey/php-parser/node" +) + +var nodes = []node.Node{ + &scalar.Dnumber{}, + &scalar.EncapsedStringPart{}, + &scalar.Encapsed{}, + &scalar.Heredoc{}, + &scalar.Lnumber{}, + &scalar.MagicConstant{}, + &scalar.String{}, +} + +func TestMeta(t *testing.T) { + expected := []meta.Meta{ + meta.NewComment("//comment\n", nil), + meta.NewWhiteSpace(" ", nil), + } + for _, n := range nodes { + n.AddMeta(expected) + actual := n.GetMeta() + assertEqual(t, expected, actual) + } +} diff --git a/node/scalar/t_position_test.go b/node/scalar/t_position_test.go new file mode 100644 index 0000000..47545b8 --- /dev/null +++ b/node/scalar/t_position_test.go @@ -0,0 +1,16 @@ +package scalar_test + +import ( + "testing" + + "github.com/z7zmey/php-parser/position" +) + +func TestPosition(t *testing.T) { + expected := position.NewPosition(1, 1, 1, 1) + for _, n := range nodes { + n.SetPosition(expected) + actual := n.GetPosition() + assertEqual(t, expected, actual) + } +} diff --git a/node/stmt/t_meta_test.go b/node/stmt/t_meta_test.go new file mode 100644 index 0000000..6c0562d --- /dev/null +++ b/node/stmt/t_meta_test.go @@ -0,0 +1,86 @@ +package stmt_test + +import ( + "testing" + + "github.com/z7zmey/php-parser/node/stmt" + + "github.com/z7zmey/php-parser/meta" + + "github.com/z7zmey/php-parser/node" +) + +var nodes = []node.Node{ + &stmt.AltElseIf{}, + &stmt.AltElse{}, + &stmt.AltFor{}, + &stmt.AltForeach{}, + &stmt.AltIf{}, + &stmt.AltSwitch{}, + &stmt.AltWhile{}, + &stmt.Break{}, + &stmt.CaseList{}, + &stmt.Case{}, + &stmt.Catch{}, + &stmt.ClassConstList{}, + &stmt.ClassExtends{}, + &stmt.ClassImplements{}, + &stmt.ClassMethod{}, + &stmt.Class{}, + &stmt.ConstList{}, + &stmt.Constant{}, + &stmt.Continue{}, + &stmt.Declare{}, + &stmt.Default{}, + &stmt.Do{}, + &stmt.Echo{}, + &stmt.ElseIf{}, + &stmt.Else{}, + &stmt.Expression{}, + &stmt.Finally{}, + &stmt.For{}, + &stmt.Foreach{}, + &stmt.Function{}, + &stmt.Global{}, + &stmt.Goto{}, + &stmt.GroupUse{}, + &stmt.HaltCompiler{}, + &stmt.If{}, + &stmt.InlineHtml{}, + &stmt.InterfaceExtends{}, + &stmt.Interface{}, + &stmt.Label{}, + &stmt.Namespace{}, + &stmt.Nop{}, + &stmt.PropertyList{}, + &stmt.Property{}, + &stmt.Return{}, + &stmt.StaticVar{}, + &stmt.Static{}, + &stmt.StmtList{}, + &stmt.Switch{}, + &stmt.Throw{}, + &stmt.TraitAdaptationList{}, + &stmt.TraitMethodRef{}, + &stmt.TraitUseAlias{}, + &stmt.TraitUsePrecedence{}, + &stmt.TraitUse{}, + &stmt.Trait{}, + &stmt.Try{}, + &stmt.Unset{}, + &stmt.UseList{}, + &stmt.Use{}, + &stmt.While{}, +} + +func TestMeta(t *testing.T) { + expected := []meta.Meta{ + meta.NewComment("//comment\n", nil), + meta.NewWhiteSpace(" ", nil), + } + for _, n := range nodes { + n.AddMeta(expected) + actual := n.GetMeta() + assertEqual(t, expected, actual) + } +} diff --git a/node/stmt/t_position_test.go b/node/stmt/t_position_test.go new file mode 100644 index 0000000..f9416ab --- /dev/null +++ b/node/stmt/t_position_test.go @@ -0,0 +1,16 @@ +package stmt_test + +import ( + "testing" + + "github.com/z7zmey/php-parser/position" +) + +func TestPosition(t *testing.T) { + expected := position.NewPosition(1, 1, 1, 1) + for _, n := range nodes { + n.SetPosition(expected) + actual := n.GetPosition() + assertEqual(t, expected, actual) + } +} diff --git a/node/t_meta_test.go b/node/t_meta_test.go new file mode 100644 index 0000000..819693f --- /dev/null +++ b/node/t_meta_test.go @@ -0,0 +1,30 @@ +package node_test + +import ( + "testing" + + "github.com/z7zmey/php-parser/meta" + + "github.com/z7zmey/php-parser/node" +) + +var nodes = []node.Node{ + &node.ArgumentList{}, + &node.Argument{}, + &node.Identifier{}, + &node.Nullable{}, + &node.Parameter{}, + &node.Root{}, +} + +func TestMeta(t *testing.T) { + expected := []meta.Meta{ + meta.NewComment("//comment\n", nil), + meta.NewWhiteSpace(" ", nil), + } + for _, n := range nodes { + n.AddMeta(expected) + actual := n.GetMeta() + assertEqual(t, expected, actual) + } +} diff --git a/node/t_position_test.go b/node/t_position_test.go new file mode 100644 index 0000000..2f17790 --- /dev/null +++ b/node/t_position_test.go @@ -0,0 +1,16 @@ +package node_test + +import ( + "testing" + + "github.com/z7zmey/php-parser/position" +) + +func TestPosition(t *testing.T) { + expected := position.NewPosition(1, 1, 1, 1) + for _, n := range nodes { + n.SetPosition(expected) + actual := n.GetPosition() + assertEqual(t, expected, actual) + } +} diff --git a/printer/printer_test.go b/printer/printer_test.go index e99f2bc..cedbe61 100644 --- a/printer/printer_test.go +++ b/printer/printer_test.go @@ -2481,6 +2481,37 @@ func TestPrintStmtClassMethod(t *testing.T) { t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) } } +func TestPrintStmtAbstractClassMethod(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrinter(o, " ") + p.Print(&stmt.ClassMethod{ + Modifiers: []node.Node{&node.Identifier{Value: "public"}}, + ReturnsRef: true, + MethodName: &node.Identifier{Value: "foo"}, + Params: []node.Node{ + &node.Parameter{ + ByRef: true, + VariableType: &node.Nullable{Expr: &name.Name{Parts: []node.Node{&name.NamePart{Value: "int"}}}}, + Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + DefaultValue: &expr.ConstFetch{Constant: &name.Name{Parts: []node.Node{&name.NamePart{Value: "null"}}}}, + }, + &node.Parameter{ + Variadic: true, + Variable: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + }, + }, + ReturnType: &name.Name{Parts: []node.Node{&name.NamePart{Value: "void"}}}, + Stmt: &stmt.Nop{}, + }) + + expected := `public function &foo(?int &$a = null, ...$b): void;` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} func TestPrintStmtClass(t *testing.T) { o := bytes.NewBufferString("") From 8de55d266c8bff9ebe04beaf340debdbd3af9782 Mon Sep 17 00:00:00 2001 From: z7zmey Date: Sun, 1 Jul 2018 00:35:32 +0300 Subject: [PATCH 012/117] Makefile is updated --- Makefile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 14e7188..fe35000 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,7 @@ build: go build run: - ./php-parser $(PHPFILE) + ./php-parser -d go $(PHPFILE) test: go test ./... @@ -36,17 +36,17 @@ compile: ./php5/php5.go ./php7/php7.go ./scanner/scanner.go goyacc -o $@ $< cpu_pprof: - GOGC=off go test -cpuprofile cpu.pprof -bench=. -benchtime=20s ./php7 + go test -cpuprofile cpu.pprof -bench=. -benchtime=20s ./php7 go tool pprof ./php7.test cpu.pprof mem_pprof: - GOGC=off go test -memprofile mem.pprof -bench=. -benchtime=20s -benchmem ./php7 + go test -memprofile mem.pprof -bench=. -benchtime=20s -benchmem ./php7 go tool pprof -alloc_objects ./php7.test mem.pprof cpu_pprof_php5: - GOGC=off go test -cpuprofile cpu.prof -bench=. -benchtime=20s ./php5 + go test -cpuprofile cpu.prof -bench=. -benchtime=20s ./php5 go tool pprof ./php5.test cpu.prof mem_pprof_php5: - GOGC=off go test -memprofile mem.prof -bench=. -benchtime=20s -benchmem ./php5 + go test -memprofile mem.prof -bench=. -benchtime=20s -benchmem ./php5 go tool pprof -alloc_objects ./php5.test mem.prof From 978e609f2907ed795f7666ed2c8a6bf2288ae040 Mon Sep 17 00:00:00 2001 From: z7zmey Date: Sun, 1 Jul 2018 00:38:31 +0300 Subject: [PATCH 013/117] fmt --- Makefile | 2 +- php5/php5.go | 1 - php5/php5_test.go | 12716 ++++++++++++++++++++++---------------------- php7/php7_test.go | 11137 +++++++++++++++++++------------------- 4 files changed, 11839 insertions(+), 12017 deletions(-) diff --git a/Makefile b/Makefile index fe35000..568b883 100644 --- a/Makefile +++ b/Makefile @@ -21,7 +21,7 @@ bench: go test -benchmem -bench=. ./php5 go test -benchmem -bench=. ./php7 -compile: ./php5/php5.go ./php7/php7.go ./scanner/scanner.go +compile: ./php5/php5.go ./php7/php7.go ./scanner/scanner.go fmt sed -i '' -e 's/yyErrorVerbose = false/yyErrorVerbose = true/g' ./php7/php7.go sed -i '' -e 's/yyErrorVerbose = false/yyErrorVerbose = true/g' ./php5/php5.go rm -f y.output diff --git a/php5/php5.go b/php5/php5.go index 431607c..7b87967 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -347,7 +347,6 @@ const yyErrCode = 2 const yyInitialStackSize = 16 //line php5/php5.y:6789 - type simpleIndirectReference struct { all []*expr.Variable last *expr.Variable diff --git a/php5/php5_test.go b/php5/php5_test.go index 829022a..4a6d106 100644 --- a/php5/php5_test.go +++ b/php5/php5_test.go @@ -417,39 +417,39 @@ func TestPhp5(t *testing.T) { expected := &node.Root{ Position: &position.Position{ StartLine: 2, - EndLine: 379, - StartPos: 6, - EndPos: 6965, + EndLine: 379, + StartPos: 6, + EndPos: 6965, }, Stmts: []node.Node{ &stmt.Expression{ Position: &position.Position{ StartLine: 2, - EndLine: 2, - StartPos: 6, - EndPos: 20, + EndLine: 2, + StartPos: 6, + EndPos: 20, }, Expr: &expr.FunctionCall{ Position: &position.Position{ StartLine: 2, - EndLine: 2, - StartPos: 6, - EndPos: 19, + EndLine: 2, + StartPos: 6, + EndPos: 19, }, Function: &name.Name{ Position: &position.Position{ StartLine: 2, - EndLine: 2, - StartPos: 6, - EndPos: 8, + EndLine: 2, + StartPos: 6, + EndPos: 8, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 2, - EndLine: 2, - StartPos: 6, - EndPos: 8, + EndLine: 2, + StartPos: 6, + EndPos: 8, }, Value: "foo", }, @@ -458,33 +458,33 @@ func TestPhp5(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 2, - EndLine: 2, - StartPos: 9, - EndPos: 19, + EndLine: 2, + StartPos: 9, + EndPos: 19, }, Arguments: []node.Node{ &node.Argument{ Position: &position.Position{ StartLine: 2, - EndLine: 2, - StartPos: 10, - EndPos: 11, + EndLine: 2, + StartPos: 10, + EndPos: 11, }, IsReference: false, - Variadic: false, + Variadic: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 2, - EndLine: 2, - StartPos: 10, - EndPos: 11, + EndLine: 2, + StartPos: 10, + EndPos: 11, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 2, - EndLine: 2, - StartPos: 10, - EndPos: 11, + EndLine: 2, + StartPos: 10, + EndPos: 11, }, Value: "a", }, @@ -493,25 +493,25 @@ func TestPhp5(t *testing.T) { &node.Argument{ Position: &position.Position{ StartLine: 2, - EndLine: 2, - StartPos: 14, - EndPos: 18, + EndLine: 2, + StartPos: 14, + EndPos: 18, }, IsReference: false, - Variadic: true, + Variadic: true, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 2, - EndLine: 2, - StartPos: 17, - EndPos: 18, + EndLine: 2, + StartPos: 17, + EndPos: 18, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 2, - EndLine: 2, - StartPos: 17, - EndPos: 18, + EndLine: 2, + StartPos: 17, + EndPos: 18, }, Value: "b", }, @@ -524,30 +524,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 3, - EndLine: 3, - StartPos: 24, - EndPos: 39, + EndLine: 3, + StartPos: 24, + EndPos: 39, }, Expr: &expr.FunctionCall{ Position: &position.Position{ StartLine: 3, - EndLine: 3, - StartPos: 24, - EndPos: 38, + EndLine: 3, + StartPos: 24, + EndPos: 38, }, Function: &expr.Variable{ Position: &position.Position{ StartLine: 3, - EndLine: 3, - StartPos: 24, - EndPos: 27, + EndLine: 3, + StartPos: 24, + EndPos: 27, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 3, - EndLine: 3, - StartPos: 24, - EndPos: 27, + EndLine: 3, + StartPos: 24, + EndPos: 27, }, Value: "foo", }, @@ -555,33 +555,33 @@ func TestPhp5(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 3, - EndLine: 3, - StartPos: 28, - EndPos: 38, + EndLine: 3, + StartPos: 28, + EndPos: 38, }, Arguments: []node.Node{ &node.Argument{ Position: &position.Position{ StartLine: 3, - EndLine: 3, - StartPos: 29, - EndPos: 30, + EndLine: 3, + StartPos: 29, + EndPos: 30, }, - Variadic: false, + Variadic: false, IsReference: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 3, - EndLine: 3, - StartPos: 29, - EndPos: 30, + EndLine: 3, + StartPos: 29, + EndPos: 30, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 3, - EndLine: 3, - StartPos: 29, - EndPos: 30, + EndLine: 3, + StartPos: 29, + EndPos: 30, }, Value: "a", }, @@ -590,25 +590,25 @@ func TestPhp5(t *testing.T) { &node.Argument{ Position: &position.Position{ StartLine: 3, - EndLine: 3, - StartPos: 33, - EndPos: 37, + EndLine: 3, + StartPos: 33, + EndPos: 37, }, - Variadic: true, + Variadic: true, IsReference: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 3, - EndLine: 3, - StartPos: 36, - EndPos: 37, + EndLine: 3, + StartPos: 36, + EndPos: 37, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 3, - EndLine: 3, - StartPos: 36, - EndPos: 37, + EndLine: 3, + StartPos: 36, + EndPos: 37, }, Value: "b", }, @@ -621,30 +621,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 4, - EndLine: 4, - StartPos: 43, - EndPos: 63, + EndLine: 4, + StartPos: 43, + EndPos: 63, }, Expr: &expr.MethodCall{ Position: &position.Position{ StartLine: 4, - EndLine: 4, - StartPos: 43, - EndPos: 62, + EndLine: 4, + StartPos: 43, + EndPos: 62, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 4, - EndLine: 4, - StartPos: 43, - EndPos: 46, + EndLine: 4, + StartPos: 43, + EndPos: 46, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 4, - EndLine: 4, - StartPos: 43, - EndPos: 46, + EndLine: 4, + StartPos: 43, + EndPos: 46, }, Value: "foo", }, @@ -652,42 +652,42 @@ func TestPhp5(t *testing.T) { Method: &node.Identifier{ Position: &position.Position{ StartLine: 4, - EndLine: 4, - StartPos: 49, - EndPos: 51, + EndLine: 4, + StartPos: 49, + EndPos: 51, }, Value: "bar", }, ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 4, - EndLine: 4, - StartPos: 52, - EndPos: 62, + EndLine: 4, + StartPos: 52, + EndPos: 62, }, Arguments: []node.Node{ &node.Argument{ Position: &position.Position{ StartLine: 4, - EndLine: 4, - StartPos: 53, - EndPos: 54, + EndLine: 4, + StartPos: 53, + EndPos: 54, }, - Variadic: false, + Variadic: false, IsReference: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 4, - EndLine: 4, - StartPos: 53, - EndPos: 54, + EndLine: 4, + StartPos: 53, + EndPos: 54, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 4, - EndLine: 4, - StartPos: 53, - EndPos: 54, + EndLine: 4, + StartPos: 53, + EndPos: 54, }, Value: "a", }, @@ -696,25 +696,25 @@ func TestPhp5(t *testing.T) { &node.Argument{ Position: &position.Position{ StartLine: 4, - EndLine: 4, - StartPos: 57, - EndPos: 61, + EndLine: 4, + StartPos: 57, + EndPos: 61, }, - Variadic: true, + Variadic: true, IsReference: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 4, - EndLine: 4, - StartPos: 60, - EndPos: 61, + EndLine: 4, + StartPos: 60, + EndPos: 61, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 4, - EndLine: 4, - StartPos: 60, - EndPos: 61, + EndLine: 4, + StartPos: 60, + EndPos: 61, }, Value: "b", }, @@ -727,31 +727,31 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 5, - EndLine: 5, - StartPos: 67, - EndPos: 86, + EndLine: 5, + StartPos: 67, + EndPos: 86, }, Expr: &expr.StaticCall{ Position: &position.Position{ StartLine: 5, - EndLine: 5, - StartPos: 67, - EndPos: 85, + EndLine: 5, + StartPos: 67, + EndPos: 85, }, Class: &name.Name{ Position: &position.Position{ StartLine: 5, - EndLine: 5, - StartPos: 67, - EndPos: 69, + EndLine: 5, + StartPos: 67, + EndPos: 69, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 5, - EndLine: 5, - StartPos: 67, - EndPos: 69, + EndLine: 5, + StartPos: 67, + EndPos: 69, }, Value: "foo", }, @@ -760,42 +760,42 @@ func TestPhp5(t *testing.T) { Call: &node.Identifier{ Position: &position.Position{ StartLine: 5, - EndLine: 5, - StartPos: 72, - EndPos: 74, + EndLine: 5, + StartPos: 72, + EndPos: 74, }, Value: "bar", }, ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 5, - EndLine: 5, - StartPos: 75, - EndPos: 85, + EndLine: 5, + StartPos: 75, + EndPos: 85, }, Arguments: []node.Node{ &node.Argument{ Position: &position.Position{ StartLine: 5, - EndLine: 5, - StartPos: 76, - EndPos: 77, + EndLine: 5, + StartPos: 76, + EndPos: 77, }, - Variadic: false, + Variadic: false, IsReference: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 5, - EndLine: 5, - StartPos: 76, - EndPos: 77, + EndLine: 5, + StartPos: 76, + EndPos: 77, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 5, - EndLine: 5, - StartPos: 76, - EndPos: 77, + EndLine: 5, + StartPos: 76, + EndPos: 77, }, Value: "a", }, @@ -804,25 +804,25 @@ func TestPhp5(t *testing.T) { &node.Argument{ Position: &position.Position{ StartLine: 5, - EndLine: 5, - StartPos: 80, - EndPos: 84, + EndLine: 5, + StartPos: 80, + EndPos: 84, }, - Variadic: true, + Variadic: true, IsReference: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 5, - EndLine: 5, - StartPos: 83, - EndPos: 84, + EndLine: 5, + StartPos: 83, + EndPos: 84, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 5, - EndLine: 5, - StartPos: 83, - EndPos: 84, + EndLine: 5, + StartPos: 83, + EndPos: 84, }, Value: "b", }, @@ -835,30 +835,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 6, - EndLine: 6, - StartPos: 90, - EndPos: 110, + EndLine: 6, + StartPos: 90, + EndPos: 110, }, Expr: &expr.StaticCall{ Position: &position.Position{ StartLine: 6, - EndLine: 6, - StartPos: 90, - EndPos: 109, + EndLine: 6, + StartPos: 90, + EndPos: 109, }, Class: &expr.Variable{ Position: &position.Position{ StartLine: 6, - EndLine: 6, - StartPos: 90, - EndPos: 93, + EndLine: 6, + StartPos: 90, + EndPos: 93, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 6, - EndLine: 6, - StartPos: 90, - EndPos: 93, + EndLine: 6, + StartPos: 90, + EndPos: 93, }, Value: "foo", }, @@ -866,42 +866,42 @@ func TestPhp5(t *testing.T) { Call: &node.Identifier{ Position: &position.Position{ StartLine: 6, - EndLine: 6, - StartPos: 96, - EndPos: 98, + EndLine: 6, + StartPos: 96, + EndPos: 98, }, Value: "bar", }, ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 6, - EndLine: 6, - StartPos: 99, - EndPos: 109, + EndLine: 6, + StartPos: 99, + EndPos: 109, }, Arguments: []node.Node{ &node.Argument{ Position: &position.Position{ StartLine: 6, - EndLine: 6, - StartPos: 100, - EndPos: 101, + EndLine: 6, + StartPos: 100, + EndPos: 101, }, IsReference: false, - Variadic: false, + Variadic: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 6, - EndLine: 6, - StartPos: 100, - EndPos: 101, + EndLine: 6, + StartPos: 100, + EndPos: 101, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 6, - EndLine: 6, - StartPos: 100, - EndPos: 101, + EndLine: 6, + StartPos: 100, + EndPos: 101, }, Value: "a", }, @@ -910,25 +910,25 @@ func TestPhp5(t *testing.T) { &node.Argument{ Position: &position.Position{ StartLine: 6, - EndLine: 6, - StartPos: 104, - EndPos: 108, + EndLine: 6, + StartPos: 104, + EndPos: 108, }, - Variadic: true, + Variadic: true, IsReference: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 6, - EndLine: 6, - StartPos: 107, - EndPos: 108, + EndLine: 6, + StartPos: 107, + EndPos: 108, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 6, - EndLine: 6, - StartPos: 107, - EndPos: 108, + EndLine: 6, + StartPos: 107, + EndPos: 108, }, Value: "b", }, @@ -941,31 +941,31 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 7, - EndLine: 7, - StartPos: 114, - EndPos: 132, + EndLine: 7, + StartPos: 114, + EndPos: 132, }, Expr: &expr.New{ Position: &position.Position{ StartLine: 7, - EndLine: 7, - StartPos: 114, - EndPos: 131, + EndLine: 7, + StartPos: 114, + EndPos: 131, }, Class: &name.Name{ Position: &position.Position{ StartLine: 7, - EndLine: 7, - StartPos: 118, - EndPos: 120, + EndLine: 7, + StartPos: 118, + EndPos: 120, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 7, - EndLine: 7, - StartPos: 118, - EndPos: 120, + EndLine: 7, + StartPos: 118, + EndPos: 120, }, Value: "foo", }, @@ -974,33 +974,33 @@ func TestPhp5(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 7, - EndLine: 7, - StartPos: 121, - EndPos: 131, + EndLine: 7, + StartPos: 121, + EndPos: 131, }, Arguments: []node.Node{ &node.Argument{ Position: &position.Position{ StartLine: 7, - EndLine: 7, - StartPos: 122, - EndPos: 123, + EndLine: 7, + StartPos: 122, + EndPos: 123, }, - Variadic: false, + Variadic: false, IsReference: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 7, - EndLine: 7, - StartPos: 122, - EndPos: 123, + EndLine: 7, + StartPos: 122, + EndPos: 123, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 7, - EndLine: 7, - StartPos: 122, - EndPos: 123, + EndLine: 7, + StartPos: 122, + EndPos: 123, }, Value: "a", }, @@ -1009,25 +1009,25 @@ func TestPhp5(t *testing.T) { &node.Argument{ Position: &position.Position{ StartLine: 7, - EndLine: 7, - StartPos: 126, - EndPos: 130, + EndLine: 7, + StartPos: 126, + EndPos: 130, }, - Variadic: true, + Variadic: true, IsReference: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 7, - EndLine: 7, - StartPos: 129, - EndPos: 130, + EndLine: 7, + StartPos: 129, + EndPos: 130, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 7, - EndLine: 7, - StartPos: 129, - EndPos: 130, + EndLine: 7, + StartPos: 129, + EndPos: 130, }, Value: "b", }, @@ -1040,18 +1040,18 @@ func TestPhp5(t *testing.T) { &stmt.Function{ Position: &position.Position{ StartLine: 9, - EndLine: 9, - StartPos: 137, - EndPos: 180, + EndLine: 9, + StartPos: 137, + EndPos: 180, }, - ReturnsRef: false, + ReturnsRef: false, PhpDocComment: "", FunctionName: &node.Identifier{ Position: &position.Position{ StartLine: 9, - EndLine: 9, - StartPos: 146, - EndPos: 148, + EndLine: 9, + StartPos: 146, + EndPos: 148, }, Value: "foo", }, @@ -1059,26 +1059,26 @@ func TestPhp5(t *testing.T) { &node.Parameter{ Position: &position.Position{ StartLine: 9, - EndLine: 9, - StartPos: 150, - EndPos: 162, + EndLine: 9, + StartPos: 150, + EndPos: 162, }, - ByRef: false, + ByRef: false, Variadic: false, VariableType: &name.Name{ Position: &position.Position{ StartLine: 9, - EndLine: 9, - StartPos: 150, - EndPos: 152, + EndLine: 9, + StartPos: 150, + EndPos: 152, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 9, - EndLine: 9, - StartPos: 150, - EndPos: 152, + EndLine: 9, + StartPos: 150, + EndPos: 152, }, Value: "bar", }, @@ -1087,16 +1087,16 @@ func TestPhp5(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 9, - EndLine: 9, - StartPos: 154, - EndPos: 157, + EndLine: 9, + StartPos: 154, + EndPos: 157, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 9, - EndLine: 9, - StartPos: 154, - EndPos: 157, + EndLine: 9, + StartPos: 154, + EndPos: 157, }, Value: "bar", }, @@ -1104,24 +1104,24 @@ func TestPhp5(t *testing.T) { DefaultValue: &expr.ConstFetch{ Position: &position.Position{ StartLine: 9, - EndLine: 9, - StartPos: 159, - EndPos: 162, + EndLine: 9, + StartPos: 159, + EndPos: 162, }, Constant: &name.Name{ Position: &position.Position{ StartLine: 9, - EndLine: 9, - StartPos: 159, - EndPos: 162, + EndLine: 9, + StartPos: 159, + EndPos: 162, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 9, - EndLine: 9, - StartPos: 159, - EndPos: 162, + EndLine: 9, + StartPos: 159, + EndPos: 162, }, Value: "null", }, @@ -1132,26 +1132,26 @@ func TestPhp5(t *testing.T) { &node.Parameter{ Position: &position.Position{ StartLine: 9, - EndLine: 9, - StartPos: 165, - EndPos: 176, + EndLine: 9, + StartPos: 165, + EndPos: 176, }, - ByRef: true, + ByRef: true, Variadic: true, VariableType: &name.Name{ Position: &position.Position{ StartLine: 9, - EndLine: 9, - StartPos: 165, - EndPos: 167, + EndLine: 9, + StartPos: 165, + EndPos: 167, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 9, - EndLine: 9, - StartPos: 165, - EndPos: 167, + EndLine: 9, + StartPos: 165, + EndPos: 167, }, Value: "baz", }, @@ -1160,39 +1160,38 @@ func TestPhp5(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 9, - EndLine: 9, - StartPos: 173, - EndPos: 176, + EndLine: 9, + StartPos: 173, + EndPos: 176, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 9, - EndLine: 9, - StartPos: 173, - EndPos: 176, + EndLine: 9, + StartPos: 173, + EndPos: 176, }, Value: "baz", }, }, }, }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, &stmt.Class{ Position: &position.Position{ StartLine: 10, - EndLine: 10, - StartPos: 184, - EndPos: 246, + EndLine: 10, + StartPos: 184, + EndPos: 246, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 10, - EndLine: 10, - StartPos: 190, - EndPos: 192, + EndLine: 10, + StartPos: 190, + EndPos: 192, }, Value: "foo", }, @@ -1200,18 +1199,18 @@ func TestPhp5(t *testing.T) { &stmt.ClassMethod{ Position: &position.Position{ StartLine: 10, - EndLine: 10, - StartPos: 195, - EndPos: 245, + EndLine: 10, + StartPos: 195, + EndPos: 245, }, - ReturnsRef: false, + ReturnsRef: false, PhpDocComment: "", MethodName: &node.Identifier{ Position: &position.Position{ StartLine: 10, - EndLine: 10, - StartPos: 211, - EndPos: 213, + EndLine: 10, + StartPos: 211, + EndPos: 213, }, Value: "foo", }, @@ -1219,9 +1218,9 @@ func TestPhp5(t *testing.T) { &node.Identifier{ Position: &position.Position{ StartLine: 10, - EndLine: 10, - StartPos: 195, - EndPos: 200, + EndLine: 10, + StartPos: 195, + EndPos: 200, }, Value: "public", }, @@ -1230,26 +1229,26 @@ func TestPhp5(t *testing.T) { &node.Parameter{ Position: &position.Position{ StartLine: 10, - EndLine: 10, - StartPos: 215, - EndPos: 227, + EndLine: 10, + StartPos: 215, + EndPos: 227, }, - ByRef: false, + ByRef: false, Variadic: false, VariableType: &name.Name{ Position: &position.Position{ StartLine: 10, - EndLine: 10, - StartPos: 215, - EndPos: 217, + EndLine: 10, + StartPos: 215, + EndPos: 217, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 10, - EndLine: 10, - StartPos: 215, - EndPos: 217, + EndLine: 10, + StartPos: 215, + EndPos: 217, }, Value: "bar", }, @@ -1258,16 +1257,16 @@ func TestPhp5(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 10, - EndLine: 10, - StartPos: 219, - EndPos: 222, + EndLine: 10, + StartPos: 219, + EndPos: 222, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 10, - EndLine: 10, - StartPos: 219, - EndPos: 222, + EndLine: 10, + StartPos: 219, + EndPos: 222, }, Value: "bar", }, @@ -1275,24 +1274,24 @@ func TestPhp5(t *testing.T) { DefaultValue: &expr.ConstFetch{ Position: &position.Position{ StartLine: 10, - EndLine: 10, - StartPos: 224, - EndPos: 227, + EndLine: 10, + StartPos: 224, + EndPos: 227, }, Constant: &name.Name{ Position: &position.Position{ StartLine: 10, - EndLine: 10, - StartPos: 224, - EndPos: 227, + EndLine: 10, + StartPos: 224, + EndPos: 227, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 10, - EndLine: 10, - StartPos: 224, - EndPos: 227, + EndLine: 10, + StartPos: 224, + EndPos: 227, }, Value: "null", }, @@ -1303,26 +1302,26 @@ func TestPhp5(t *testing.T) { &node.Parameter{ Position: &position.Position{ StartLine: 10, - EndLine: 10, - StartPos: 230, - EndPos: 241, + EndLine: 10, + StartPos: 230, + EndPos: 241, }, - ByRef: true, + ByRef: true, Variadic: true, VariableType: &name.Name{ Position: &position.Position{ StartLine: 10, - EndLine: 10, - StartPos: 230, - EndPos: 232, + EndLine: 10, + StartPos: 230, + EndPos: 232, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 10, - EndLine: 10, - StartPos: 230, - EndPos: 232, + EndLine: 10, + StartPos: 230, + EndPos: 232, }, Value: "baz", }, @@ -1331,16 +1330,16 @@ func TestPhp5(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 10, - EndLine: 10, - StartPos: 238, - EndPos: 241, + EndLine: 10, + StartPos: 238, + EndPos: 241, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 10, - EndLine: 10, - StartPos: 238, - EndPos: 241, + EndLine: 10, + StartPos: 238, + EndPos: 241, }, Value: "baz", }, @@ -1350,12 +1349,11 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 10, - EndLine: 10, - StartPos: 244, - EndPos: 245, - }, - Stmts: []node.Node{ + EndLine: 10, + StartPos: 244, + EndPos: 245, }, + Stmts: []node.Node{}, }, }, }, @@ -1363,44 +1361,44 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 11, - EndLine: 11, - StartPos: 250, - EndPos: 290, + EndLine: 11, + StartPos: 250, + EndPos: 290, }, Expr: &expr.Closure{ Position: &position.Position{ StartLine: 11, - EndLine: 11, - StartPos: 250, - EndPos: 289, + EndLine: 11, + StartPos: 250, + EndPos: 289, }, - ReturnsRef: false, - Static: false, + ReturnsRef: false, + Static: false, PhpDocComment: "", Params: []node.Node{ &node.Parameter{ Position: &position.Position{ StartLine: 11, - EndLine: 11, - StartPos: 259, - EndPos: 271, + EndLine: 11, + StartPos: 259, + EndPos: 271, }, - ByRef: false, + ByRef: false, Variadic: false, VariableType: &name.Name{ Position: &position.Position{ StartLine: 11, - EndLine: 11, - StartPos: 259, - EndPos: 261, + EndLine: 11, + StartPos: 259, + EndPos: 261, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 11, - EndLine: 11, - StartPos: 259, - EndPos: 261, + EndLine: 11, + StartPos: 259, + EndPos: 261, }, Value: "bar", }, @@ -1409,16 +1407,16 @@ func TestPhp5(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 11, - EndLine: 11, - StartPos: 263, - EndPos: 266, + EndLine: 11, + StartPos: 263, + EndPos: 266, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 11, - EndLine: 11, - StartPos: 263, - EndPos: 266, + EndLine: 11, + StartPos: 263, + EndPos: 266, }, Value: "bar", }, @@ -1426,24 +1424,24 @@ func TestPhp5(t *testing.T) { DefaultValue: &expr.ConstFetch{ Position: &position.Position{ StartLine: 11, - EndLine: 11, - StartPos: 268, - EndPos: 271, + EndLine: 11, + StartPos: 268, + EndPos: 271, }, Constant: &name.Name{ Position: &position.Position{ StartLine: 11, - EndLine: 11, - StartPos: 268, - EndPos: 271, + EndLine: 11, + StartPos: 268, + EndPos: 271, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 11, - EndLine: 11, - StartPos: 268, - EndPos: 271, + EndLine: 11, + StartPos: 268, + EndPos: 271, }, Value: "null", }, @@ -1454,26 +1452,26 @@ func TestPhp5(t *testing.T) { &node.Parameter{ Position: &position.Position{ StartLine: 11, - EndLine: 11, - StartPos: 274, - EndPos: 285, + EndLine: 11, + StartPos: 274, + EndPos: 285, }, - ByRef: true, + ByRef: true, Variadic: true, VariableType: &name.Name{ Position: &position.Position{ StartLine: 11, - EndLine: 11, - StartPos: 274, - EndPos: 276, + EndLine: 11, + StartPos: 274, + EndPos: 276, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 11, - EndLine: 11, - StartPos: 274, - EndPos: 276, + EndLine: 11, + StartPos: 274, + EndPos: 276, }, Value: "baz", }, @@ -1482,67 +1480,66 @@ func TestPhp5(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 11, - EndLine: 11, - StartPos: 282, - EndPos: 285, + EndLine: 11, + StartPos: 282, + EndPos: 285, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 11, - EndLine: 11, - StartPos: 282, - EndPos: 285, + EndLine: 11, + StartPos: 282, + EndPos: 285, }, Value: "baz", }, }, }, }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 12, - EndLine: 12, - StartPos: 294, - EndPos: 341, + EndLine: 12, + StartPos: 294, + EndPos: 341, }, Expr: &expr.Closure{ Position: &position.Position{ StartLine: 12, - EndLine: 12, - StartPos: 294, - EndPos: 340, + EndLine: 12, + StartPos: 294, + EndPos: 340, }, - Static: true, + Static: true, PhpDocComment: "", - ReturnsRef: false, + ReturnsRef: false, Params: []node.Node{ &node.Parameter{ Position: &position.Position{ StartLine: 12, - EndLine: 12, - StartPos: 310, - EndPos: 322, + EndLine: 12, + StartPos: 310, + EndPos: 322, }, - ByRef: false, + ByRef: false, Variadic: false, VariableType: &name.Name{ Position: &position.Position{ StartLine: 12, - EndLine: 12, - StartPos: 310, - EndPos: 312, + EndLine: 12, + StartPos: 310, + EndPos: 312, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 12, - EndLine: 12, - StartPos: 310, - EndPos: 312, + EndLine: 12, + StartPos: 310, + EndPos: 312, }, Value: "bar", }, @@ -1551,16 +1548,16 @@ func TestPhp5(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 12, - EndLine: 12, - StartPos: 314, - EndPos: 317, + EndLine: 12, + StartPos: 314, + EndPos: 317, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 12, - EndLine: 12, - StartPos: 314, - EndPos: 317, + EndLine: 12, + StartPos: 314, + EndPos: 317, }, Value: "bar", }, @@ -1568,24 +1565,24 @@ func TestPhp5(t *testing.T) { DefaultValue: &expr.ConstFetch{ Position: &position.Position{ StartLine: 12, - EndLine: 12, - StartPos: 319, - EndPos: 322, + EndLine: 12, + StartPos: 319, + EndPos: 322, }, Constant: &name.Name{ Position: &position.Position{ StartLine: 12, - EndLine: 12, - StartPos: 319, - EndPos: 322, + EndLine: 12, + StartPos: 319, + EndPos: 322, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 12, - EndLine: 12, - StartPos: 319, - EndPos: 322, + EndLine: 12, + StartPos: 319, + EndPos: 322, }, Value: "null", }, @@ -1596,26 +1593,26 @@ func TestPhp5(t *testing.T) { &node.Parameter{ Position: &position.Position{ StartLine: 12, - EndLine: 12, - StartPos: 325, - EndPos: 336, + EndLine: 12, + StartPos: 325, + EndPos: 336, }, - ByRef: true, + ByRef: true, Variadic: true, VariableType: &name.Name{ Position: &position.Position{ StartLine: 12, - EndLine: 12, - StartPos: 325, - EndPos: 327, + EndLine: 12, + StartPos: 325, + EndPos: 327, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 12, - EndLine: 12, - StartPos: 325, - EndPos: 327, + EndLine: 12, + StartPos: 325, + EndPos: 327, }, Value: "baz", }, @@ -1624,39 +1621,38 @@ func TestPhp5(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 12, - EndLine: 12, - StartPos: 333, - EndPos: 336, + EndLine: 12, + StartPos: 333, + EndPos: 336, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 12, - EndLine: 12, - StartPos: 333, - EndPos: 336, + EndLine: 12, + StartPos: 333, + EndPos: 336, }, Value: "baz", }, }, }, }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 14, - EndLine: 14, - StartPos: 346, - EndPos: 365, + EndLine: 14, + StartPos: 346, + EndPos: 365, }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 14, - EndLine: 14, - StartPos: 346, - EndPos: 364, + EndLine: 14, + StartPos: 346, + EndPos: 364, }, Value: "1234567890123456789", }, @@ -1664,16 +1660,16 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 15, - EndLine: 15, - StartPos: 369, - EndPos: 389, + EndLine: 15, + StartPos: 369, + EndPos: 389, }, Expr: &scalar.Dnumber{ Position: &position.Position{ StartLine: 15, - EndLine: 15, - StartPos: 369, - EndPos: 388, + EndLine: 15, + StartPos: 369, + EndPos: 388, }, Value: "12345678901234567890", }, @@ -1681,16 +1677,16 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 16, - EndLine: 16, - StartPos: 393, - EndPos: 395, + EndLine: 16, + StartPos: 393, + EndPos: 395, }, Expr: &scalar.Dnumber{ Position: &position.Position{ StartLine: 16, - EndLine: 16, - StartPos: 393, - EndPos: 394, + EndLine: 16, + StartPos: 393, + EndPos: 394, }, Value: "0.", }, @@ -1698,16 +1694,16 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 17, - EndLine: 17, - StartPos: 399, - EndPos: 465, + EndLine: 17, + StartPos: 399, + EndPos: 465, }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 17, - EndLine: 17, - StartPos: 399, - EndPos: 464, + EndLine: 17, + StartPos: 399, + EndPos: 464, }, Value: "0b0111111111111111111111111111111111111111111111111111111111111111", }, @@ -1715,16 +1711,16 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 18, - EndLine: 18, - StartPos: 469, - EndPos: 535, + EndLine: 18, + StartPos: 469, + EndPos: 535, }, Expr: &scalar.Dnumber{ Position: &position.Position{ StartLine: 18, - EndLine: 18, - StartPos: 469, - EndPos: 534, + EndLine: 18, + StartPos: 469, + EndPos: 534, }, Value: "0b1111111111111111111111111111111111111111111111111111111111111111", }, @@ -1732,16 +1728,16 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 19, - EndLine: 19, - StartPos: 539, - EndPos: 559, + EndLine: 19, + StartPos: 539, + EndPos: 559, }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 19, - EndLine: 19, - StartPos: 539, - EndPos: 558, + EndLine: 19, + StartPos: 539, + EndPos: 558, }, Value: "0x007111111111111111", }, @@ -1749,16 +1745,16 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 20, - EndLine: 20, - StartPos: 563, - EndPos: 581, + EndLine: 20, + StartPos: 563, + EndPos: 581, }, Expr: &scalar.Dnumber{ Position: &position.Position{ StartLine: 20, - EndLine: 20, - StartPos: 563, - EndPos: 580, + EndLine: 20, + StartPos: 563, + EndPos: 580, }, Value: "0x8111111111111111", }, @@ -1766,16 +1762,16 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 21, - EndLine: 21, - StartPos: 585, - EndPos: 594, + EndLine: 21, + StartPos: 585, + EndPos: 594, }, Expr: &scalar.MagicConstant{ Position: &position.Position{ StartLine: 21, - EndLine: 21, - StartPos: 585, - EndPos: 593, + EndLine: 21, + StartPos: 585, + EndPos: 593, }, Value: "__CLASS__", }, @@ -1783,16 +1779,16 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 22, - EndLine: 22, - StartPos: 598, - EndPos: 605, + EndLine: 22, + StartPos: 598, + EndPos: 605, }, Expr: &scalar.MagicConstant{ Position: &position.Position{ StartLine: 22, - EndLine: 22, - StartPos: 598, - EndPos: 604, + EndLine: 22, + StartPos: 598, + EndPos: 604, }, Value: "__DIR__", }, @@ -1800,16 +1796,16 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 23, - EndLine: 23, - StartPos: 609, - EndPos: 617, + EndLine: 23, + StartPos: 609, + EndPos: 617, }, Expr: &scalar.MagicConstant{ Position: &position.Position{ StartLine: 23, - EndLine: 23, - StartPos: 609, - EndPos: 616, + EndLine: 23, + StartPos: 609, + EndPos: 616, }, Value: "__FILE__", }, @@ -1817,16 +1813,16 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 24, - EndLine: 24, - StartPos: 621, - EndPos: 633, + EndLine: 24, + StartPos: 621, + EndPos: 633, }, Expr: &scalar.MagicConstant{ Position: &position.Position{ StartLine: 24, - EndLine: 24, - StartPos: 621, - EndPos: 632, + EndLine: 24, + StartPos: 621, + EndPos: 632, }, Value: "__FUNCTION__", }, @@ -1834,16 +1830,16 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 25, - EndLine: 25, - StartPos: 637, - EndPos: 645, + EndLine: 25, + StartPos: 637, + EndPos: 645, }, Expr: &scalar.MagicConstant{ Position: &position.Position{ StartLine: 25, - EndLine: 25, - StartPos: 637, - EndPos: 644, + EndLine: 25, + StartPos: 637, + EndPos: 644, }, Value: "__LINE__", }, @@ -1851,16 +1847,16 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 26, - EndLine: 26, - StartPos: 649, - EndPos: 662, + EndLine: 26, + StartPos: 649, + EndPos: 662, }, Expr: &scalar.MagicConstant{ Position: &position.Position{ StartLine: 26, - EndLine: 26, - StartPos: 649, - EndPos: 661, + EndLine: 26, + StartPos: 649, + EndPos: 661, }, Value: "__NAMESPACE__", }, @@ -1868,16 +1864,16 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 27, - EndLine: 27, - StartPos: 666, - EndPos: 676, + EndLine: 27, + StartPos: 666, + EndPos: 676, }, Expr: &scalar.MagicConstant{ Position: &position.Position{ StartLine: 27, - EndLine: 27, - StartPos: 666, - EndPos: 675, + EndLine: 27, + StartPos: 666, + EndPos: 675, }, Value: "__METHOD__", }, @@ -1885,16 +1881,16 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 28, - EndLine: 28, - StartPos: 680, - EndPos: 689, + EndLine: 28, + StartPos: 680, + EndPos: 689, }, Expr: &scalar.MagicConstant{ Position: &position.Position{ StartLine: 28, - EndLine: 28, - StartPos: 680, - EndPos: 688, + EndLine: 28, + StartPos: 680, + EndPos: 688, }, Value: "__TRAIT__", }, @@ -1902,40 +1898,40 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 30, - EndLine: 30, - StartPos: 694, - EndPos: 705, + EndLine: 30, + StartPos: 694, + EndPos: 705, }, Expr: &scalar.Encapsed{ Position: &position.Position{ StartLine: 30, - EndLine: 30, - StartPos: 694, - EndPos: 704, + EndLine: 30, + StartPos: 694, + EndPos: 704, }, Parts: []node.Node{ &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 30, - EndLine: 30, - StartPos: 695, - EndPos: 699, + EndLine: 30, + StartPos: 695, + EndPos: 699, }, Value: "test ", }, &expr.Variable{ Position: &position.Position{ StartLine: 30, - EndLine: 30, - StartPos: 700, - EndPos: 703, + EndLine: 30, + StartPos: 700, + EndPos: 703, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 30, - EndLine: 30, - StartPos: 700, - EndPos: 703, + EndLine: 30, + StartPos: 700, + EndPos: 703, }, Value: "var", }, @@ -1946,47 +1942,47 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 31, - EndLine: 31, - StartPos: 709, - EndPos: 723, + EndLine: 31, + StartPos: 709, + EndPos: 723, }, Expr: &scalar.Encapsed{ Position: &position.Position{ StartLine: 31, - EndLine: 31, - StartPos: 709, - EndPos: 722, + EndLine: 31, + StartPos: 709, + EndPos: 722, }, Parts: []node.Node{ &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 31, - EndLine: 31, - StartPos: 710, - EndPos: 714, + EndLine: 31, + StartPos: 710, + EndPos: 714, }, Value: "test ", }, &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 31, - EndLine: 31, - StartPos: 715, - EndPos: 721, + EndLine: 31, + StartPos: 715, + EndPos: 721, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 31, - EndLine: 31, - StartPos: 715, - EndPos: 718, + EndLine: 31, + StartPos: 715, + EndPos: 718, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 31, - EndLine: 31, - StartPos: 715, - EndPos: 718, + EndLine: 31, + StartPos: 715, + EndPos: 718, }, Value: "var", }, @@ -1994,9 +1990,9 @@ func TestPhp5(t *testing.T) { Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 31, - EndLine: 31, - StartPos: 720, - EndPos: 720, + EndLine: 31, + StartPos: 720, + EndPos: 720, }, Value: "1", }, @@ -2007,47 +2003,47 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 32, - EndLine: 32, - StartPos: 727, - EndPos: 780, + EndLine: 32, + StartPos: 727, + EndPos: 780, }, Expr: &scalar.Encapsed{ Position: &position.Position{ StartLine: 32, - EndLine: 32, - StartPos: 727, - EndPos: 779, + EndLine: 32, + StartPos: 727, + EndPos: 779, }, Parts: []node.Node{ &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 32, - EndLine: 32, - StartPos: 728, - EndPos: 732, + EndLine: 32, + StartPos: 728, + EndPos: 732, }, Value: "test ", }, &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 32, - EndLine: 32, - StartPos: 733, - EndPos: 778, + EndLine: 32, + StartPos: 733, + EndPos: 778, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 32, - EndLine: 32, - StartPos: 733, - EndPos: 736, + EndLine: 32, + StartPos: 733, + EndPos: 736, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 32, - EndLine: 32, - StartPos: 733, - EndPos: 736, + EndLine: 32, + StartPos: 733, + EndPos: 736, }, Value: "var", }, @@ -2055,9 +2051,9 @@ func TestPhp5(t *testing.T) { Dim: &scalar.String{ Position: &position.Position{ StartLine: 32, - EndLine: 32, - StartPos: 738, - EndPos: 777, + EndLine: 32, + StartPos: 738, + EndPos: 777, }, Value: "1234567890123456789012345678901234567890", }, @@ -2068,47 +2064,47 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 33, - EndLine: 33, - StartPos: 784, - EndPos: 800, + EndLine: 33, + StartPos: 784, + EndPos: 800, }, Expr: &scalar.Encapsed{ Position: &position.Position{ StartLine: 33, - EndLine: 33, - StartPos: 784, - EndPos: 799, + EndLine: 33, + StartPos: 784, + EndPos: 799, }, Parts: []node.Node{ &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 33, - EndLine: 33, - StartPos: 785, - EndPos: 789, + EndLine: 33, + StartPos: 785, + EndPos: 789, }, Value: "test ", }, &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 33, - EndLine: 33, - StartPos: 790, - EndPos: 798, + EndLine: 33, + StartPos: 790, + EndPos: 798, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 33, - EndLine: 33, - StartPos: 790, - EndPos: 793, + EndLine: 33, + StartPos: 790, + EndPos: 793, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 33, - EndLine: 33, - StartPos: 790, - EndPos: 793, + EndLine: 33, + StartPos: 790, + EndPos: 793, }, Value: "var", }, @@ -2116,9 +2112,9 @@ func TestPhp5(t *testing.T) { Dim: &scalar.String{ Position: &position.Position{ StartLine: 33, - EndLine: 33, - StartPos: 795, - EndPos: 797, + EndLine: 33, + StartPos: 795, + EndPos: 797, }, Value: "bar", }, @@ -2129,47 +2125,47 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 34, - EndLine: 34, - StartPos: 804, - EndPos: 821, + EndLine: 34, + StartPos: 804, + EndPos: 821, }, Expr: &scalar.Encapsed{ Position: &position.Position{ StartLine: 34, - EndLine: 34, - StartPos: 804, - EndPos: 820, + EndLine: 34, + StartPos: 804, + EndPos: 820, }, Parts: []node.Node{ &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 34, - EndLine: 34, - StartPos: 805, - EndPos: 809, + EndLine: 34, + StartPos: 805, + EndPos: 809, }, Value: "test ", }, &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 34, - EndLine: 34, - StartPos: 810, - EndPos: 819, + EndLine: 34, + StartPos: 810, + EndPos: 819, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 34, - EndLine: 34, - StartPos: 810, - EndPos: 813, + EndLine: 34, + StartPos: 810, + EndPos: 813, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 34, - EndLine: 34, - StartPos: 810, - EndPos: 813, + EndLine: 34, + StartPos: 810, + EndPos: 813, }, Value: "var", }, @@ -2177,16 +2173,16 @@ func TestPhp5(t *testing.T) { Dim: &expr.Variable{ Position: &position.Position{ StartLine: 34, - EndLine: 34, - StartPos: 815, - EndPos: 818, + EndLine: 34, + StartPos: 815, + EndPos: 818, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 34, - EndLine: 34, - StartPos: 815, - EndPos: 818, + EndLine: 34, + StartPos: 815, + EndPos: 818, }, Value: "bar", }, @@ -2198,31 +2194,31 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 35, - EndLine: 35, - StartPos: 825, - EndPos: 836, + EndLine: 35, + StartPos: 825, + EndPos: 836, }, Expr: &scalar.Encapsed{ Position: &position.Position{ StartLine: 35, - EndLine: 35, - StartPos: 825, - EndPos: 835, + EndLine: 35, + StartPos: 825, + EndPos: 835, }, Parts: []node.Node{ &expr.Variable{ Position: &position.Position{ StartLine: 35, - EndLine: 35, - StartPos: 826, - EndPos: 829, + EndLine: 35, + StartPos: 826, + EndPos: 829, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 35, - EndLine: 35, - StartPos: 826, - EndPos: 829, + EndLine: 35, + StartPos: 826, + EndPos: 829, }, Value: "foo", }, @@ -2230,25 +2226,25 @@ func TestPhp5(t *testing.T) { &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 35, - EndLine: 35, - StartPos: 830, - EndPos: 830, + EndLine: 35, + StartPos: 830, + EndPos: 830, }, Value: " ", }, &expr.Variable{ Position: &position.Position{ StartLine: 35, - EndLine: 35, - StartPos: 831, - EndPos: 834, + EndLine: 35, + StartPos: 831, + EndPos: 834, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 35, - EndLine: 35, - StartPos: 831, - EndPos: 834, + EndLine: 35, + StartPos: 831, + EndPos: 834, }, Value: "bar", }, @@ -2259,47 +2255,47 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 36, - EndLine: 36, - StartPos: 840, - EndPos: 858, + EndLine: 36, + StartPos: 840, + EndPos: 858, }, Expr: &scalar.Encapsed{ Position: &position.Position{ StartLine: 36, - EndLine: 36, - StartPos: 840, - EndPos: 857, + EndLine: 36, + StartPos: 840, + EndPos: 857, }, Parts: []node.Node{ &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 36, - EndLine: 36, - StartPos: 841, - EndPos: 845, + EndLine: 36, + StartPos: 841, + EndPos: 845, }, Value: "test ", }, &expr.PropertyFetch{ Position: &position.Position{ StartLine: 36, - EndLine: 36, - StartPos: 846, - EndPos: 854, + EndLine: 36, + StartPos: 846, + EndPos: 854, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 36, - EndLine: 36, - StartPos: 846, - EndPos: 849, + EndLine: 36, + StartPos: 846, + EndPos: 849, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 36, - EndLine: 36, - StartPos: 846, - EndPos: 849, + EndLine: 36, + StartPos: 846, + EndPos: 849, }, Value: "foo", }, @@ -2307,9 +2303,9 @@ func TestPhp5(t *testing.T) { Property: &node.Identifier{ Position: &position.Position{ StartLine: 36, - EndLine: 36, - StartPos: 852, - EndPos: 854, + EndLine: 36, + StartPos: 852, + EndPos: 854, }, Value: "bar", }, @@ -2317,9 +2313,9 @@ func TestPhp5(t *testing.T) { &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 36, - EndLine: 36, - StartPos: 855, - EndPos: 856, + EndLine: 36, + StartPos: 855, + EndPos: 856, }, Value: "()", }, @@ -2329,40 +2325,40 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 37, - EndLine: 37, - StartPos: 862, - EndPos: 875, + EndLine: 37, + StartPos: 862, + EndPos: 875, }, Expr: &scalar.Encapsed{ Position: &position.Position{ StartLine: 37, - EndLine: 37, - StartPos: 862, - EndPos: 874, + EndLine: 37, + StartPos: 862, + EndPos: 874, }, Parts: []node.Node{ &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 37, - EndLine: 37, - StartPos: 863, - EndPos: 867, + EndLine: 37, + StartPos: 863, + EndPos: 867, }, Value: "test ", }, &expr.Variable{ Position: &position.Position{ StartLine: 37, - EndLine: 37, - StartPos: 868, - EndPos: 873, + EndLine: 37, + StartPos: 868, + EndPos: 873, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 37, - EndLine: 37, - StartPos: 870, - EndPos: 872, + EndLine: 37, + StartPos: 870, + EndPos: 872, }, Value: "foo", }, @@ -2373,47 +2369,47 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 38, - EndLine: 38, - StartPos: 879, - EndPos: 895, + EndLine: 38, + StartPos: 879, + EndPos: 895, }, Expr: &scalar.Encapsed{ Position: &position.Position{ StartLine: 38, - EndLine: 38, - StartPos: 879, - EndPos: 894, + EndLine: 38, + StartPos: 879, + EndPos: 894, }, Parts: []node.Node{ &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 38, - EndLine: 38, - StartPos: 880, - EndPos: 884, + EndLine: 38, + StartPos: 880, + EndPos: 884, }, Value: "test ", }, &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 38, - EndLine: 38, - StartPos: 885, - EndPos: 893, + EndLine: 38, + StartPos: 885, + EndPos: 893, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 38, - EndLine: 38, - StartPos: 887, - EndPos: 889, + EndLine: 38, + StartPos: 887, + EndPos: 889, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 38, - EndLine: 38, - StartPos: 887, - EndPos: 889, + EndLine: 38, + StartPos: 887, + EndPos: 889, }, Value: "foo", }, @@ -2421,9 +2417,9 @@ func TestPhp5(t *testing.T) { Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 38, - EndLine: 38, - StartPos: 891, - EndPos: 891, + EndLine: 38, + StartPos: 891, + EndPos: 891, }, Value: "0", }, @@ -2434,47 +2430,47 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 39, - EndLine: 39, - StartPos: 899, - EndPos: 919, + EndLine: 39, + StartPos: 899, + EndPos: 919, }, Expr: &scalar.Encapsed{ Position: &position.Position{ StartLine: 39, - EndLine: 39, - StartPos: 899, - EndPos: 918, + EndLine: 39, + StartPos: 899, + EndPos: 918, }, Parts: []node.Node{ &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 39, - EndLine: 39, - StartPos: 900, - EndPos: 904, + EndLine: 39, + StartPos: 900, + EndPos: 904, }, Value: "test ", }, &expr.MethodCall{ Position: &position.Position{ StartLine: 39, - EndLine: 39, - StartPos: 906, - EndPos: 916, + EndLine: 39, + StartPos: 906, + EndPos: 916, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 39, - EndLine: 39, - StartPos: 906, - EndPos: 909, + EndLine: 39, + StartPos: 906, + EndPos: 909, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 39, - EndLine: 39, - StartPos: 906, - EndPos: 909, + EndLine: 39, + StartPos: 906, + EndPos: 909, }, Value: "foo", }, @@ -2482,18 +2478,18 @@ func TestPhp5(t *testing.T) { Method: &node.Identifier{ Position: &position.Position{ StartLine: 39, - EndLine: 39, - StartPos: 912, - EndPos: 914, + EndLine: 39, + StartPos: 912, + EndPos: 914, }, Value: "bar", }, ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 39, - EndLine: 39, - StartPos: 915, - EndPos: 916, + EndLine: 39, + StartPos: 915, + EndPos: 916, }, }, }, @@ -2503,23 +2499,23 @@ func TestPhp5(t *testing.T) { &stmt.AltIf{ Position: &position.Position{ StartLine: 41, - EndLine: 42, - StartPos: 924, - EndPos: 941, + EndLine: 42, + StartPos: 924, + EndPos: 941, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 41, - EndLine: 41, - StartPos: 928, - EndPos: 929, + EndLine: 41, + StartPos: 928, + EndPos: 929, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 41, - EndLine: 41, - StartPos: 928, - EndPos: 929, + EndLine: 41, + StartPos: 928, + EndPos: 929, }, Value: "a", }, @@ -2527,34 +2523,33 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - Stmts: []node.Node{ + EndLine: -1, + StartPos: -1, + EndPos: -1, }, + Stmts: []node.Node{}, }, }, &stmt.AltIf{ Position: &position.Position{ StartLine: 43, - EndLine: 45, - StartPos: 945, - EndPos: 977, + EndLine: 45, + StartPos: 945, + EndPos: 977, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 43, - EndLine: 43, - StartPos: 949, - EndPos: 950, + EndLine: 43, + StartPos: 949, + EndPos: 950, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 43, - EndLine: 43, - StartPos: 949, - EndPos: 950, + EndLine: 43, + StartPos: 949, + EndPos: 950, }, Value: "a", }, @@ -2562,34 +2557,33 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - Stmts: []node.Node{ + EndLine: -1, + StartPos: -1, + EndPos: -1, }, + Stmts: []node.Node{}, }, ElseIf: []node.Node{ &stmt.AltElseIf{ Position: &position.Position{ StartLine: 44, - EndLine: -1, - StartPos: 957, - EndPos: -1, + EndLine: -1, + StartPos: 957, + EndPos: -1, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 44, - EndLine: 44, - StartPos: 965, - EndPos: 966, + EndLine: 44, + StartPos: 965, + EndPos: 966, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 44, - EndLine: 44, - StartPos: 965, - EndPos: 966, + EndLine: 44, + StartPos: 965, + EndPos: 966, }, Value: "b", }, @@ -2597,12 +2591,11 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - Stmts: []node.Node{ + EndLine: -1, + StartPos: -1, + EndPos: -1, }, + Stmts: []node.Node{}, }, }, }, @@ -2610,23 +2603,23 @@ func TestPhp5(t *testing.T) { &stmt.AltIf{ Position: &position.Position{ StartLine: 46, - EndLine: 48, - StartPos: 981, - EndPos: 1006, + EndLine: 48, + StartPos: 981, + EndPos: 1006, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 46, - EndLine: 46, - StartPos: 985, - EndPos: 986, + EndLine: 46, + StartPos: 985, + EndPos: 986, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 46, - EndLine: 46, - StartPos: 985, - EndPos: 986, + EndLine: 46, + StartPos: 985, + EndPos: 986, }, Value: "a", }, @@ -2634,52 +2627,50 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - Stmts: []node.Node{ + EndLine: -1, + StartPos: -1, + EndPos: -1, }, + Stmts: []node.Node{}, }, Else: &stmt.AltElse{ Position: &position.Position{ StartLine: 47, - EndLine: -1, - StartPos: 993, - EndPos: -1, + EndLine: -1, + StartPos: 993, + EndPos: -1, }, Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - Stmts: []node.Node{ + EndLine: -1, + StartPos: -1, + EndPos: -1, }, + Stmts: []node.Node{}, }, }, }, &stmt.AltIf{ Position: &position.Position{ StartLine: 49, - EndLine: 53, - StartPos: 1010, - EndPos: 1065, + EndLine: 53, + StartPos: 1010, + EndPos: 1065, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 49, - EndLine: 49, - StartPos: 1014, - EndPos: 1015, + EndLine: 49, + StartPos: 1014, + EndPos: 1015, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 49, - EndLine: 49, - StartPos: 1014, - EndPos: 1015, + EndLine: 49, + StartPos: 1014, + EndPos: 1015, }, Value: "a", }, @@ -2687,34 +2678,33 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - Stmts: []node.Node{ + EndLine: -1, + StartPos: -1, + EndPos: -1, }, + Stmts: []node.Node{}, }, ElseIf: []node.Node{ &stmt.AltElseIf{ Position: &position.Position{ StartLine: 50, - EndLine: -1, - StartPos: 1022, - EndPos: -1, + EndLine: -1, + StartPos: 1022, + EndPos: -1, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 50, - EndLine: 50, - StartPos: 1030, - EndPos: 1031, + EndLine: 50, + StartPos: 1030, + EndPos: 1031, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 50, - EndLine: 50, - StartPos: 1030, - EndPos: 1031, + EndLine: 50, + StartPos: 1030, + EndPos: 1031, }, Value: "b", }, @@ -2722,34 +2712,33 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - Stmts: []node.Node{ + EndLine: -1, + StartPos: -1, + EndPos: -1, }, + Stmts: []node.Node{}, }, }, &stmt.AltElseIf{ Position: &position.Position{ StartLine: 51, - EndLine: -1, - StartPos: 1037, - EndPos: -1, + EndLine: -1, + StartPos: 1037, + EndPos: -1, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 51, - EndLine: 51, - StartPos: 1045, - EndPos: 1046, + EndLine: 51, + StartPos: 1045, + EndPos: 1046, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 51, - EndLine: 51, - StartPos: 1045, - EndPos: 1046, + EndLine: 51, + StartPos: 1045, + EndPos: 1046, }, Value: "c", }, @@ -2757,64 +2746,62 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - Stmts: []node.Node{ + EndLine: -1, + StartPos: -1, + EndPos: -1, }, + Stmts: []node.Node{}, }, }, }, Else: &stmt.AltElse{ Position: &position.Position{ StartLine: 52, - EndLine: -1, - StartPos: 1052, - EndPos: -1, + EndLine: -1, + StartPos: 1052, + EndPos: -1, }, Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - Stmts: []node.Node{ + EndLine: -1, + StartPos: -1, + EndPos: -1, }, + Stmts: []node.Node{}, }, }, }, &stmt.While{ Position: &position.Position{ StartLine: 55, - EndLine: 55, - StartPos: 1070, - EndPos: 1089, + EndLine: 55, + StartPos: 1070, + EndPos: 1089, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 55, - EndLine: 55, - StartPos: 1077, - EndPos: 1077, + EndLine: 55, + StartPos: 1077, + EndPos: 1077, }, Value: "1", }, Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 55, - EndLine: 55, - StartPos: 1080, - EndPos: 1089, + EndLine: 55, + StartPos: 1080, + EndPos: 1089, }, Stmts: []node.Node{ &stmt.Break{ Position: &position.Position{ StartLine: 55, - EndLine: 55, - StartPos: 1082, - EndPos: 1087, + EndLine: 55, + StartPos: 1082, + EndPos: 1087, }, }, }, @@ -2823,40 +2810,40 @@ func TestPhp5(t *testing.T) { &stmt.While{ Position: &position.Position{ StartLine: 56, - EndLine: 56, - StartPos: 1093, - EndPos: 1114, + EndLine: 56, + StartPos: 1093, + EndPos: 1114, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 56, - EndLine: 56, - StartPos: 1100, - EndPos: 1100, + EndLine: 56, + StartPos: 1100, + EndPos: 1100, }, Value: "1", }, Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 56, - EndLine: 56, - StartPos: 1103, - EndPos: 1114, + EndLine: 56, + StartPos: 1103, + EndPos: 1114, }, Stmts: []node.Node{ &stmt.Break{ Position: &position.Position{ StartLine: 56, - EndLine: 56, - StartPos: 1105, - EndPos: 1112, + EndLine: 56, + StartPos: 1105, + EndPos: 1112, }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 56, - EndLine: 56, - StartPos: 1111, - EndPos: 1111, + EndLine: 56, + StartPos: 1111, + EndPos: 1111, }, Value: "2", }, @@ -2867,40 +2854,40 @@ func TestPhp5(t *testing.T) { &stmt.AltWhile{ Position: &position.Position{ StartLine: 57, - EndLine: 57, - StartPos: 1118, - EndPos: 1148, + EndLine: 57, + StartPos: 1118, + EndPos: 1148, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 57, - EndLine: 57, - StartPos: 1125, - EndPos: 1125, + EndLine: 57, + StartPos: 1125, + EndPos: 1125, }, Value: "1", }, Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 57, - EndLine: 57, - StartPos: 1130, - EndPos: 1138, + EndLine: 57, + StartPos: 1130, + EndPos: 1138, }, Stmts: []node.Node{ &stmt.Break{ Position: &position.Position{ StartLine: 57, - EndLine: 57, - StartPos: 1130, - EndPos: 1138, + EndLine: 57, + StartPos: 1130, + EndPos: 1138, }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 57, - EndLine: 57, - StartPos: 1136, - EndPos: 1136, + EndLine: 57, + StartPos: 1136, + EndPos: 1136, }, Value: "3", }, @@ -2911,17 +2898,17 @@ func TestPhp5(t *testing.T) { &stmt.Class{ Position: &position.Position{ StartLine: 58, - EndLine: 58, - StartPos: 1152, - EndPos: 1187, + EndLine: 58, + StartPos: 1152, + EndPos: 1187, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 58, - EndLine: 58, - StartPos: 1158, - EndPos: 1160, + EndLine: 58, + StartPos: 1158, + EndPos: 1160, }, Value: "foo", }, @@ -2929,34 +2916,34 @@ func TestPhp5(t *testing.T) { &stmt.ClassConstList{ Position: &position.Position{ StartLine: 58, - EndLine: 58, - StartPos: 1163, - EndPos: 1185, + EndLine: 58, + StartPos: 1163, + EndPos: 1185, }, Consts: []node.Node{ &stmt.Constant{ Position: &position.Position{ StartLine: 58, - EndLine: 58, - StartPos: 1169, - EndPos: 1175, + EndLine: 58, + StartPos: 1169, + EndPos: 1175, }, PhpDocComment: "", ConstantName: &node.Identifier{ Position: &position.Position{ StartLine: 58, - EndLine: 58, - StartPos: 1169, - EndPos: 1171, + EndLine: 58, + StartPos: 1169, + EndPos: 1171, }, Value: "FOO", }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 58, - EndLine: 58, - StartPos: 1175, - EndPos: 1175, + EndLine: 58, + StartPos: 1175, + EndPos: 1175, }, Value: "1", }, @@ -2964,26 +2951,26 @@ func TestPhp5(t *testing.T) { &stmt.Constant{ Position: &position.Position{ StartLine: 58, - EndLine: 58, - StartPos: 1178, - EndPos: 1184, + EndLine: 58, + StartPos: 1178, + EndPos: 1184, }, PhpDocComment: "", ConstantName: &node.Identifier{ Position: &position.Position{ StartLine: 58, - EndLine: 58, - StartPos: 1178, - EndPos: 1180, + EndLine: 58, + StartPos: 1178, + EndPos: 1180, }, Value: "BAR", }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 58, - EndLine: 58, - StartPos: 1184, - EndPos: 1184, + EndLine: 58, + StartPos: 1184, + EndPos: 1184, }, Value: "2", }, @@ -2995,17 +2982,17 @@ func TestPhp5(t *testing.T) { &stmt.Class{ Position: &position.Position{ StartLine: 59, - EndLine: 59, - StartPos: 1191, - EndPos: 1220, + EndLine: 59, + StartPos: 1191, + EndPos: 1220, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 59, - EndLine: 59, - StartPos: 1197, - EndPos: 1199, + EndLine: 59, + StartPos: 1197, + EndPos: 1199, }, Value: "foo", }, @@ -3013,30 +3000,29 @@ func TestPhp5(t *testing.T) { &stmt.ClassMethod{ Position: &position.Position{ StartLine: 59, - EndLine: 59, - StartPos: 1202, - EndPos: 1218, + EndLine: 59, + StartPos: 1202, + EndPos: 1218, }, - ReturnsRef: false, + ReturnsRef: false, PhpDocComment: "", MethodName: &node.Identifier{ Position: &position.Position{ StartLine: 59, - EndLine: 59, - StartPos: 1211, - EndPos: 1213, + EndLine: 59, + StartPos: 1211, + EndPos: 1213, }, Value: "bar", }, Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 59, - EndLine: 59, - StartPos: 1217, - EndPos: 1218, - }, - Stmts: []node.Node{ + EndLine: 59, + StartPos: 1217, + EndPos: 1218, }, + Stmts: []node.Node{}, }, }, }, @@ -3044,17 +3030,17 @@ func TestPhp5(t *testing.T) { &stmt.Class{ Position: &position.Position{ StartLine: 60, - EndLine: 60, - StartPos: 1224, - EndPos: 1268, + EndLine: 60, + StartPos: 1224, + EndPos: 1268, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 60, - EndLine: 60, - StartPos: 1230, - EndPos: 1232, + EndLine: 60, + StartPos: 1230, + EndPos: 1232, }, Value: "foo", }, @@ -3062,18 +3048,18 @@ func TestPhp5(t *testing.T) { &stmt.ClassMethod{ Position: &position.Position{ StartLine: 60, - EndLine: 60, - StartPos: 1235, - EndPos: 1266, + EndLine: 60, + StartPos: 1235, + EndPos: 1266, }, - ReturnsRef: true, + ReturnsRef: true, PhpDocComment: "", MethodName: &node.Identifier{ Position: &position.Position{ StartLine: 60, - EndLine: 60, - StartPos: 1259, - EndPos: 1261, + EndLine: 60, + StartPos: 1259, + EndPos: 1261, }, Value: "bar", }, @@ -3081,18 +3067,18 @@ func TestPhp5(t *testing.T) { &node.Identifier{ Position: &position.Position{ StartLine: 60, - EndLine: 60, - StartPos: 1235, - EndPos: 1240, + EndLine: 60, + StartPos: 1235, + EndPos: 1240, }, Value: "public", }, &node.Identifier{ Position: &position.Position{ StartLine: 60, - EndLine: 60, - StartPos: 1242, - EndPos: 1247, + EndLine: 60, + StartPos: 1242, + EndPos: 1247, }, Value: "static", }, @@ -3100,12 +3086,11 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 60, - EndLine: 60, - StartPos: 1265, - EndPos: 1266, - }, - Stmts: []node.Node{ + EndLine: 60, + StartPos: 1265, + EndPos: 1266, }, + Stmts: []node.Node{}, }, }, }, @@ -3113,17 +3098,17 @@ func TestPhp5(t *testing.T) { &stmt.Class{ Position: &position.Position{ StartLine: 61, - EndLine: 61, - StartPos: 1272, - EndPos: 1343, + EndLine: 61, + StartPos: 1272, + EndPos: 1343, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 61, - EndLine: 61, - StartPos: 1278, - EndPos: 1280, + EndLine: 61, + StartPos: 1278, + EndPos: 1280, }, Value: "foo", }, @@ -3131,18 +3116,18 @@ func TestPhp5(t *testing.T) { &stmt.ClassMethod{ Position: &position.Position{ StartLine: 61, - EndLine: 61, - StartPos: 1283, - EndPos: 1313, + EndLine: 61, + StartPos: 1283, + EndPos: 1313, }, - ReturnsRef: false, + ReturnsRef: false, PhpDocComment: "", MethodName: &node.Identifier{ Position: &position.Position{ StartLine: 61, - EndLine: 61, - StartPos: 1306, - EndPos: 1308, + EndLine: 61, + StartPos: 1306, + EndPos: 1308, }, Value: "bar", }, @@ -3150,18 +3135,18 @@ func TestPhp5(t *testing.T) { &node.Identifier{ Position: &position.Position{ StartLine: 61, - EndLine: 61, - StartPos: 1283, - EndPos: 1287, + EndLine: 61, + StartPos: 1283, + EndPos: 1287, }, Value: "final", }, &node.Identifier{ Position: &position.Position{ StartLine: 61, - EndLine: 61, - StartPos: 1289, - EndPos: 1295, + EndLine: 61, + StartPos: 1289, + EndPos: 1295, }, Value: "private", }, @@ -3169,29 +3154,28 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 61, - EndLine: 61, - StartPos: 1312, - EndPos: 1313, - }, - Stmts: []node.Node{ + EndLine: 61, + StartPos: 1312, + EndPos: 1313, }, + Stmts: []node.Node{}, }, }, &stmt.ClassMethod{ Position: &position.Position{ StartLine: 61, - EndLine: 61, - StartPos: 1315, - EndPos: 1341, + EndLine: 61, + StartPos: 1315, + EndPos: 1341, }, - ReturnsRef: false, + ReturnsRef: false, PhpDocComment: "", MethodName: &node.Identifier{ Position: &position.Position{ StartLine: 61, - EndLine: 61, - StartPos: 1334, - EndPos: 1336, + EndLine: 61, + StartPos: 1334, + EndPos: 1336, }, Value: "baz", }, @@ -3199,9 +3183,9 @@ func TestPhp5(t *testing.T) { &node.Identifier{ Position: &position.Position{ StartLine: 61, - EndLine: 61, - StartPos: 1315, - EndPos: 1323, + EndLine: 61, + StartPos: 1315, + EndPos: 1323, }, Value: "protected", }, @@ -3209,12 +3193,11 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 61, - EndLine: 61, - StartPos: 1340, - EndPos: 1341, - }, - Stmts: []node.Node{ + EndLine: 61, + StartPos: 1340, + EndPos: 1341, }, + Stmts: []node.Node{}, }, }, }, @@ -3222,17 +3205,17 @@ func TestPhp5(t *testing.T) { &stmt.Class{ Position: &position.Position{ StartLine: 62, - EndLine: 62, - StartPos: 1347, - EndPos: 1399, + EndLine: 62, + StartPos: 1347, + EndPos: 1399, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 62, - EndLine: 62, - StartPos: 1362, - EndPos: 1364, + EndLine: 62, + StartPos: 1362, + EndPos: 1364, }, Value: "foo", }, @@ -3240,9 +3223,9 @@ func TestPhp5(t *testing.T) { &node.Identifier{ Position: &position.Position{ StartLine: 62, - EndLine: 62, - StartPos: 1347, - EndPos: 1354, + EndLine: 62, + StartPos: 1347, + EndPos: 1354, }, Value: "abstract", }, @@ -3251,18 +3234,18 @@ func TestPhp5(t *testing.T) { &stmt.ClassMethod{ Position: &position.Position{ StartLine: 62, - EndLine: 62, - StartPos: 1367, - EndPos: 1397, + EndLine: 62, + StartPos: 1367, + EndPos: 1397, }, - ReturnsRef: false, + ReturnsRef: false, PhpDocComment: "", MethodName: &node.Identifier{ Position: &position.Position{ StartLine: 62, - EndLine: 62, - StartPos: 1392, - EndPos: 1394, + EndLine: 62, + StartPos: 1392, + EndPos: 1394, }, Value: "bar", }, @@ -3270,18 +3253,18 @@ func TestPhp5(t *testing.T) { &node.Identifier{ Position: &position.Position{ StartLine: 62, - EndLine: 62, - StartPos: 1367, - EndPos: 1374, + EndLine: 62, + StartPos: 1367, + EndPos: 1374, }, Value: "abstract", }, &node.Identifier{ Position: &position.Position{ StartLine: 62, - EndLine: 62, - StartPos: 1376, - EndPos: 1381, + EndLine: 62, + StartPos: 1376, + EndPos: 1381, }, Value: "public", }, @@ -3289,9 +3272,9 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.Nop{ Position: &position.Position{ StartLine: 62, - EndLine: 62, - StartPos: 1397, - EndPos: 1397, + EndLine: 62, + StartPos: 1397, + EndPos: 1397, }, }, }, @@ -3300,17 +3283,17 @@ func TestPhp5(t *testing.T) { &stmt.Class{ Position: &position.Position{ StartLine: 63, - EndLine: 63, - StartPos: 1403, - EndPos: 1433, + EndLine: 63, + StartPos: 1403, + EndPos: 1433, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 63, - EndLine: 63, - StartPos: 1415, - EndPos: 1417, + EndLine: 63, + StartPos: 1415, + EndPos: 1417, }, Value: "foo", }, @@ -3318,9 +3301,9 @@ func TestPhp5(t *testing.T) { &node.Identifier{ Position: &position.Position{ StartLine: 63, - EndLine: 63, - StartPos: 1403, - EndPos: 1407, + EndLine: 63, + StartPos: 1403, + EndPos: 1407, }, Value: "final", }, @@ -3328,47 +3311,46 @@ func TestPhp5(t *testing.T) { Extends: &stmt.ClassExtends{ Position: &position.Position{ StartLine: 63, - EndLine: 63, - StartPos: 1419, - EndPos: 1429, + EndLine: 63, + StartPos: 1419, + EndPos: 1429, }, ClassName: &name.Name{ Position: &position.Position{ StartLine: 63, - EndLine: 63, - StartPos: 1427, - EndPos: 1429, + EndLine: 63, + StartPos: 1427, + EndPos: 1429, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 63, - EndLine: 63, - StartPos: 1427, - EndPos: 1429, + EndLine: 63, + StartPos: 1427, + EndPos: 1429, }, Value: "bar", }, }, }, }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, &stmt.Class{ Position: &position.Position{ StartLine: 64, - EndLine: 64, - StartPos: 1437, - EndPos: 1470, + EndLine: 64, + StartPos: 1437, + EndPos: 1470, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 64, - EndLine: 64, - StartPos: 1449, - EndPos: 1451, + EndLine: 64, + StartPos: 1449, + EndPos: 1451, }, Value: "foo", }, @@ -3376,9 +3358,9 @@ func TestPhp5(t *testing.T) { &node.Identifier{ Position: &position.Position{ StartLine: 64, - EndLine: 64, - StartPos: 1437, - EndPos: 1441, + EndLine: 64, + StartPos: 1437, + EndPos: 1441, }, Value: "final", }, @@ -3386,25 +3368,25 @@ func TestPhp5(t *testing.T) { Implements: &stmt.ClassImplements{ Position: &position.Position{ StartLine: 64, - EndLine: 64, - StartPos: 1453, - EndPos: 1466, + EndLine: 64, + StartPos: 1453, + EndPos: 1466, }, InterfaceNames: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 64, - EndLine: 64, - StartPos: 1464, - EndPos: 1466, + EndLine: 64, + StartPos: 1464, + EndPos: 1466, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 64, - EndLine: 64, - StartPos: 1464, - EndPos: 1466, + EndLine: 64, + StartPos: 1464, + EndPos: 1466, }, Value: "bar", }, @@ -3412,23 +3394,22 @@ func TestPhp5(t *testing.T) { }, }, }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, &stmt.Class{ Position: &position.Position{ StartLine: 65, - EndLine: 65, - StartPos: 1474, - EndPos: 1512, + EndLine: 65, + StartPos: 1474, + EndPos: 1512, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 65, - EndLine: 65, - StartPos: 1486, - EndPos: 1488, + EndLine: 65, + StartPos: 1486, + EndPos: 1488, }, Value: "foo", }, @@ -3436,9 +3417,9 @@ func TestPhp5(t *testing.T) { &node.Identifier{ Position: &position.Position{ StartLine: 65, - EndLine: 65, - StartPos: 1474, - EndPos: 1478, + EndLine: 65, + StartPos: 1474, + EndPos: 1478, }, Value: "final", }, @@ -3446,25 +3427,25 @@ func TestPhp5(t *testing.T) { Implements: &stmt.ClassImplements{ Position: &position.Position{ StartLine: 65, - EndLine: 65, - StartPos: 1490, - EndPos: 1508, + EndLine: 65, + StartPos: 1490, + EndPos: 1508, }, InterfaceNames: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 65, - EndLine: 65, - StartPos: 1501, - EndPos: 1503, + EndLine: 65, + StartPos: 1501, + EndPos: 1503, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 65, - EndLine: 65, - StartPos: 1501, - EndPos: 1503, + EndLine: 65, + StartPos: 1501, + EndPos: 1503, }, Value: "bar", }, @@ -3473,17 +3454,17 @@ func TestPhp5(t *testing.T) { &name.Name{ Position: &position.Position{ StartLine: 65, - EndLine: 65, - StartPos: 1506, - EndPos: 1508, + EndLine: 65, + StartPos: 1506, + EndPos: 1508, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 65, - EndLine: 65, - StartPos: 1506, - EndPos: 1508, + EndLine: 65, + StartPos: 1506, + EndPos: 1508, }, Value: "baz", }, @@ -3491,40 +3472,39 @@ func TestPhp5(t *testing.T) { }, }, }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, &stmt.ConstList{ Position: &position.Position{ StartLine: 67, - EndLine: 67, - StartPos: 1517, - EndPos: 1539, + EndLine: 67, + StartPos: 1517, + EndPos: 1539, }, Consts: []node.Node{ &stmt.Constant{ Position: &position.Position{ StartLine: 67, - EndLine: 67, - StartPos: 1523, - EndPos: 1529, + EndLine: 67, + StartPos: 1523, + EndPos: 1529, }, PhpDocComment: "", ConstantName: &node.Identifier{ Position: &position.Position{ StartLine: 67, - EndLine: 67, - StartPos: 1523, - EndPos: 1525, + EndLine: 67, + StartPos: 1523, + EndPos: 1525, }, Value: "FOO", }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 67, - EndLine: 67, - StartPos: 1529, - EndPos: 1529, + EndLine: 67, + StartPos: 1529, + EndPos: 1529, }, Value: "1", }, @@ -3532,26 +3512,26 @@ func TestPhp5(t *testing.T) { &stmt.Constant{ Position: &position.Position{ StartLine: 67, - EndLine: 67, - StartPos: 1532, - EndPos: 1538, + EndLine: 67, + StartPos: 1532, + EndPos: 1538, }, PhpDocComment: "", ConstantName: &node.Identifier{ Position: &position.Position{ StartLine: 67, - EndLine: 67, - StartPos: 1532, - EndPos: 1534, + EndLine: 67, + StartPos: 1532, + EndPos: 1534, }, Value: "BAR", }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 67, - EndLine: 67, - StartPos: 1538, - EndPos: 1538, + EndLine: 67, + StartPos: 1538, + EndPos: 1538, }, Value: "2", }, @@ -3561,33 +3541,33 @@ func TestPhp5(t *testing.T) { &stmt.While{ Position: &position.Position{ StartLine: 68, - EndLine: 68, - StartPos: 1543, - EndPos: 1565, + EndLine: 68, + StartPos: 1543, + EndPos: 1565, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 68, - EndLine: 68, - StartPos: 1550, - EndPos: 1550, + EndLine: 68, + StartPos: 1550, + EndPos: 1550, }, Value: "1", }, Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 68, - EndLine: 68, - StartPos: 1553, - EndPos: 1565, + EndLine: 68, + StartPos: 1553, + EndPos: 1565, }, Stmts: []node.Node{ &stmt.Continue{ Position: &position.Position{ StartLine: 68, - EndLine: 68, - StartPos: 1555, - EndPos: 1563, + EndLine: 68, + StartPos: 1555, + EndPos: 1563, }, }, }, @@ -3596,40 +3576,40 @@ func TestPhp5(t *testing.T) { &stmt.While{ Position: &position.Position{ StartLine: 69, - EndLine: 69, - StartPos: 1569, - EndPos: 1593, + EndLine: 69, + StartPos: 1569, + EndPos: 1593, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 69, - EndLine: 69, - StartPos: 1576, - EndPos: 1576, + EndLine: 69, + StartPos: 1576, + EndPos: 1576, }, Value: "1", }, Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 69, - EndLine: 69, - StartPos: 1579, - EndPos: 1593, + EndLine: 69, + StartPos: 1579, + EndPos: 1593, }, Stmts: []node.Node{ &stmt.Continue{ Position: &position.Position{ StartLine: 69, - EndLine: 69, - StartPos: 1581, - EndPos: 1591, + EndLine: 69, + StartPos: 1581, + EndPos: 1591, }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 69, - EndLine: 69, - StartPos: 1590, - EndPos: 1590, + EndLine: 69, + StartPos: 1590, + EndPos: 1590, }, Value: "2", }, @@ -3640,40 +3620,40 @@ func TestPhp5(t *testing.T) { &stmt.While{ Position: &position.Position{ StartLine: 70, - EndLine: 70, - StartPos: 1597, - EndPos: 1622, + EndLine: 70, + StartPos: 1597, + EndPos: 1622, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 70, - EndLine: 70, - StartPos: 1604, - EndPos: 1604, + EndLine: 70, + StartPos: 1604, + EndPos: 1604, }, Value: "1", }, Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 70, - EndLine: 70, - StartPos: 1607, - EndPos: 1622, + EndLine: 70, + StartPos: 1607, + EndPos: 1622, }, Stmts: []node.Node{ &stmt.Continue{ Position: &position.Position{ StartLine: 70, - EndLine: 70, - StartPos: 1609, - EndPos: 1620, + EndLine: 70, + StartPos: 1609, + EndPos: 1620, }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 70, - EndLine: 70, - StartPos: 1618, - EndPos: 1618, + EndLine: 70, + StartPos: 1618, + EndPos: 1618, }, Value: "3", }, @@ -3684,34 +3664,34 @@ func TestPhp5(t *testing.T) { &stmt.Declare{ Position: &position.Position{ StartLine: 71, - EndLine: 71, - StartPos: 1626, - EndPos: 1642, + EndLine: 71, + StartPos: 1626, + EndPos: 1642, }, Consts: []node.Node{ &stmt.Constant{ Position: &position.Position{ StartLine: 71, - EndLine: 71, - StartPos: 1634, - EndPos: 1640, + EndLine: 71, + StartPos: 1634, + EndPos: 1640, }, PhpDocComment: "", ConstantName: &node.Identifier{ Position: &position.Position{ StartLine: 71, - EndLine: 71, - StartPos: 1634, - EndPos: 1638, + EndLine: 71, + StartPos: 1634, + EndPos: 1638, }, Value: "ticks", }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 71, - EndLine: 71, - StartPos: 1640, - EndPos: 1640, + EndLine: 71, + StartPos: 1640, + EndPos: 1640, }, Value: "1", }, @@ -3720,43 +3700,43 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.Nop{ Position: &position.Position{ StartLine: 71, - EndLine: 71, - StartPos: 1642, - EndPos: 1642, + EndLine: 71, + StartPos: 1642, + EndPos: 1642, }, }, }, &stmt.Declare{ Position: &position.Position{ StartLine: 72, - EndLine: 72, - StartPos: 1646, - EndPos: 1680, + EndLine: 72, + StartPos: 1646, + EndPos: 1680, }, Consts: []node.Node{ &stmt.Constant{ Position: &position.Position{ StartLine: 72, - EndLine: 72, - StartPos: 1654, - EndPos: 1660, + EndLine: 72, + StartPos: 1654, + EndPos: 1660, }, PhpDocComment: "", ConstantName: &node.Identifier{ Position: &position.Position{ StartLine: 72, - EndLine: 72, - StartPos: 1654, - EndPos: 1658, + EndLine: 72, + StartPos: 1654, + EndPos: 1658, }, Value: "ticks", }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 72, - EndLine: 72, - StartPos: 1660, - EndPos: 1660, + EndLine: 72, + StartPos: 1660, + EndPos: 1660, }, Value: "1", }, @@ -3764,26 +3744,26 @@ func TestPhp5(t *testing.T) { &stmt.Constant{ Position: &position.Position{ StartLine: 72, - EndLine: 72, - StartPos: 1663, - EndPos: 1676, + EndLine: 72, + StartPos: 1663, + EndPos: 1676, }, PhpDocComment: "", ConstantName: &node.Identifier{ Position: &position.Position{ StartLine: 72, - EndLine: 72, - StartPos: 1663, - EndPos: 1674, + EndLine: 72, + StartPos: 1663, + EndPos: 1674, }, Value: "strict_types", }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 72, - EndLine: 72, - StartPos: 1676, - EndPos: 1676, + EndLine: 72, + StartPos: 1676, + EndPos: 1676, }, Value: "1", }, @@ -3792,45 +3772,44 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 72, - EndLine: 72, - StartPos: 1679, - EndPos: 1680, - }, - Stmts: []node.Node{ + EndLine: 72, + StartPos: 1679, + EndPos: 1680, }, + Stmts: []node.Node{}, }, }, &stmt.Declare{ Position: &position.Position{ StartLine: 73, - EndLine: 73, - StartPos: 1684, - EndPos: 1712, + EndLine: 73, + StartPos: 1684, + EndPos: 1712, }, Consts: []node.Node{ &stmt.Constant{ Position: &position.Position{ StartLine: 73, - EndLine: 73, - StartPos: 1692, - EndPos: 1698, + EndLine: 73, + StartPos: 1692, + EndPos: 1698, }, PhpDocComment: "", ConstantName: &node.Identifier{ Position: &position.Position{ StartLine: 73, - EndLine: 73, - StartPos: 1692, - EndPos: 1696, + EndLine: 73, + StartPos: 1692, + EndPos: 1696, }, Value: "ticks", }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 73, - EndLine: 73, - StartPos: 1698, - EndPos: 1698, + EndLine: 73, + StartPos: 1698, + EndPos: 1698, }, Value: "1", }, @@ -3839,37 +3818,35 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 73, - EndLine: 73, - StartPos: 1700, - EndPos: 1712, - }, - Stmts: []node.Node{ + EndLine: 73, + StartPos: 1700, + EndPos: 1712, }, + Stmts: []node.Node{}, }, }, &stmt.Do{ Position: &position.Position{ StartLine: 74, - EndLine: 74, - StartPos: 1716, - EndPos: 1730, + EndLine: 74, + StartPos: 1716, + EndPos: 1730, }, Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 74, - EndLine: 74, - StartPos: 1719, - EndPos: 1720, - }, - Stmts: []node.Node{ + EndLine: 74, + StartPos: 1719, + EndPos: 1720, }, + Stmts: []node.Node{}, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 74, - EndLine: 74, - StartPos: 1728, - EndPos: 1728, + EndLine: 74, + StartPos: 1728, + EndPos: 1728, }, Value: "1", }, @@ -3877,24 +3854,24 @@ func TestPhp5(t *testing.T) { &stmt.Echo{ Position: &position.Position{ StartLine: 75, - EndLine: 75, - StartPos: 1734, - EndPos: 1744, + EndLine: 75, + StartPos: 1734, + EndPos: 1744, }, Exprs: []node.Node{ &expr.Variable{ Position: &position.Position{ StartLine: 75, - EndLine: 75, - StartPos: 1739, - EndPos: 1740, + EndLine: 75, + StartPos: 1739, + EndPos: 1740, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 75, - EndLine: 75, - StartPos: 1739, - EndPos: 1740, + EndLine: 75, + StartPos: 1739, + EndPos: 1740, }, Value: "a", }, @@ -3902,9 +3879,9 @@ func TestPhp5(t *testing.T) { &scalar.Lnumber{ Position: &position.Position{ StartLine: 75, - EndLine: 75, - StartPos: 1743, - EndPos: 1743, + EndLine: 75, + StartPos: 1743, + EndPos: 1743, }, Value: "1", }, @@ -3913,24 +3890,24 @@ func TestPhp5(t *testing.T) { &stmt.Echo{ Position: &position.Position{ StartLine: 76, - EndLine: 76, - StartPos: 1748, - EndPos: 1756, + EndLine: 76, + StartPos: 1748, + EndPos: 1756, }, Exprs: []node.Node{ &expr.Variable{ Position: &position.Position{ StartLine: 76, - EndLine: 76, - StartPos: 1753, - EndPos: 1754, + EndLine: 76, + StartPos: 1753, + EndPos: 1754, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 76, - EndLine: 76, - StartPos: 1753, - EndPos: 1754, + EndLine: 76, + StartPos: 1753, + EndPos: 1754, }, Value: "a", }, @@ -3940,31 +3917,31 @@ func TestPhp5(t *testing.T) { &stmt.For{ Position: &position.Position{ StartLine: 77, - EndLine: 77, - StartPos: 1760, - EndPos: 1794, + EndLine: 77, + StartPos: 1760, + EndPos: 1794, }, Init: []node.Node{ &assign.Assign{ Position: &position.Position{ StartLine: 77, - EndLine: 77, - StartPos: 1764, - EndPos: 1769, + EndLine: 77, + StartPos: 1764, + EndPos: 1769, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 77, - EndLine: 77, - StartPos: 1764, - EndPos: 1765, + EndLine: 77, + StartPos: 1764, + EndPos: 1765, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 77, - EndLine: 77, - StartPos: 1764, - EndPos: 1765, + EndLine: 77, + StartPos: 1764, + EndPos: 1765, }, Value: "i", }, @@ -3972,9 +3949,9 @@ func TestPhp5(t *testing.T) { Expression: &scalar.Lnumber{ Position: &position.Position{ StartLine: 77, - EndLine: 77, - StartPos: 1769, - EndPos: 1769, + EndLine: 77, + StartPos: 1769, + EndPos: 1769, }, Value: "0", }, @@ -3984,23 +3961,23 @@ func TestPhp5(t *testing.T) { &binary.Smaller{ Position: &position.Position{ StartLine: 77, - EndLine: 77, - StartPos: 1772, - EndPos: 1778, + EndLine: 77, + StartPos: 1772, + EndPos: 1778, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 77, - EndLine: 77, - StartPos: 1772, - EndPos: 1773, + EndLine: 77, + StartPos: 1772, + EndPos: 1773, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 77, - EndLine: 77, - StartPos: 1772, - EndPos: 1773, + EndLine: 77, + StartPos: 1772, + EndPos: 1773, }, Value: "i", }, @@ -4008,9 +3985,9 @@ func TestPhp5(t *testing.T) { Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 77, - EndLine: 77, - StartPos: 1777, - EndPos: 1778, + EndLine: 77, + StartPos: 1777, + EndPos: 1778, }, Value: "10", }, @@ -4020,23 +3997,23 @@ func TestPhp5(t *testing.T) { &expr.PostInc{ Position: &position.Position{ StartLine: 77, - EndLine: 77, - StartPos: 1781, - EndPos: 1784, + EndLine: 77, + StartPos: 1781, + EndPos: 1784, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 77, - EndLine: 77, - StartPos: 1781, - EndPos: 1782, + EndLine: 77, + StartPos: 1781, + EndPos: 1782, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 77, - EndLine: 77, - StartPos: 1781, - EndPos: 1782, + EndLine: 77, + StartPos: 1781, + EndPos: 1782, }, Value: "i", }, @@ -4045,23 +4022,23 @@ func TestPhp5(t *testing.T) { &expr.PostInc{ Position: &position.Position{ StartLine: 77, - EndLine: 77, - StartPos: 1787, - EndPos: 1790, + EndLine: 77, + StartPos: 1787, + EndPos: 1790, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 77, - EndLine: 77, - StartPos: 1787, - EndPos: 1788, + EndLine: 77, + StartPos: 1787, + EndPos: 1788, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 77, - EndLine: 77, - StartPos: 1787, - EndPos: 1788, + EndLine: 77, + StartPos: 1787, + EndPos: 1788, }, Value: "i", }, @@ -4071,42 +4048,41 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 77, - EndLine: 77, - StartPos: 1793, - EndPos: 1794, - }, - Stmts: []node.Node{ + EndLine: 77, + StartPos: 1793, + EndPos: 1794, }, + Stmts: []node.Node{}, }, }, &stmt.AltFor{ Position: &position.Position{ StartLine: 78, - EndLine: 78, - StartPos: 1798, - EndPos: 1827, + EndLine: 78, + StartPos: 1798, + EndPos: 1827, }, Cond: []node.Node{ &binary.Smaller{ Position: &position.Position{ StartLine: 78, - EndLine: 78, - StartPos: 1804, - EndPos: 1810, + EndLine: 78, + StartPos: 1804, + EndPos: 1810, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 78, - EndLine: 78, - StartPos: 1804, - EndPos: 1805, + EndLine: 78, + StartPos: 1804, + EndPos: 1805, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 78, - EndLine: 78, - StartPos: 1804, - EndPos: 1805, + EndLine: 78, + StartPos: 1804, + EndPos: 1805, }, Value: "i", }, @@ -4114,9 +4090,9 @@ func TestPhp5(t *testing.T) { Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 78, - EndLine: 78, - StartPos: 1809, - EndPos: 1810, + EndLine: 78, + StartPos: 1809, + EndPos: 1810, }, Value: "10", }, @@ -4126,23 +4102,23 @@ func TestPhp5(t *testing.T) { &expr.PostInc{ Position: &position.Position{ StartLine: 78, - EndLine: 78, - StartPos: 1813, - EndPos: 1816, + EndLine: 78, + StartPos: 1813, + EndPos: 1816, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 78, - EndLine: 78, - StartPos: 1813, - EndPos: 1814, + EndLine: 78, + StartPos: 1813, + EndPos: 1814, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 78, - EndLine: 78, - StartPos: 1813, - EndPos: 1814, + EndLine: 78, + StartPos: 1813, + EndPos: 1814, }, Value: "i", }, @@ -4152,34 +4128,33 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - Stmts: []node.Node{ + EndLine: -1, + StartPos: -1, + EndPos: -1, }, + Stmts: []node.Node{}, }, }, &stmt.Foreach{ Position: &position.Position{ StartLine: 79, - EndLine: 79, - StartPos: 1831, - EndPos: 1851, + EndLine: 79, + StartPos: 1831, + EndPos: 1851, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 79, - EndLine: 79, - StartPos: 1840, - EndPos: 1841, + EndLine: 79, + StartPos: 1840, + EndPos: 1841, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 79, - EndLine: 79, - StartPos: 1840, - EndPos: 1841, + EndLine: 79, + StartPos: 1840, + EndPos: 1841, }, Value: "a", }, @@ -4187,16 +4162,16 @@ func TestPhp5(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 79, - EndLine: 79, - StartPos: 1846, - EndPos: 1847, + EndLine: 79, + StartPos: 1846, + EndPos: 1847, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 79, - EndLine: 79, - StartPos: 1846, - EndPos: 1847, + EndLine: 79, + StartPos: 1846, + EndPos: 1847, }, Value: "v", }, @@ -4204,44 +4179,42 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 79, - EndLine: 79, - StartPos: 1850, - EndPos: 1851, - }, - Stmts: []node.Node{ + EndLine: 79, + StartPos: 1850, + EndPos: 1851, }, + Stmts: []node.Node{}, }, }, &stmt.Foreach{ Position: &position.Position{ StartLine: 80, - EndLine: 80, - StartPos: 1855, - EndPos: 1875, + EndLine: 80, + StartPos: 1855, + EndPos: 1875, }, Expr: &expr.ShortArray{ Position: &position.Position{ StartLine: 80, - EndLine: 80, - StartPos: 1864, - EndPos: 1865, - }, - Items: []node.Node{ + EndLine: 80, + StartPos: 1864, + EndPos: 1865, }, + Items: []node.Node{}, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 80, - EndLine: 80, - StartPos: 1870, - EndPos: 1871, + EndLine: 80, + StartPos: 1870, + EndPos: 1871, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 80, - EndLine: 80, - StartPos: 1870, - EndPos: 1871, + EndLine: 80, + StartPos: 1870, + EndPos: 1871, }, Value: "v", }, @@ -4249,34 +4222,33 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 80, - EndLine: 80, - StartPos: 1874, - EndPos: 1875, - }, - Stmts: []node.Node{ + EndLine: 80, + StartPos: 1874, + EndPos: 1875, }, + Stmts: []node.Node{}, }, }, &stmt.AltForeach{ Position: &position.Position{ StartLine: 81, - EndLine: 81, - StartPos: 1879, - EndPos: 1910, + EndLine: 81, + StartPos: 1879, + EndPos: 1910, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 81, - EndLine: 81, - StartPos: 1888, - EndPos: 1889, + EndLine: 81, + StartPos: 1888, + EndPos: 1889, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 81, - EndLine: 81, - StartPos: 1888, - EndPos: 1889, + EndLine: 81, + StartPos: 1888, + EndPos: 1889, }, Value: "a", }, @@ -4284,16 +4256,16 @@ func TestPhp5(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 81, - EndLine: 81, - StartPos: 1894, - EndPos: 1895, + EndLine: 81, + StartPos: 1894, + EndPos: 1895, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 81, - EndLine: 81, - StartPos: 1894, - EndPos: 1895, + EndLine: 81, + StartPos: 1894, + EndPos: 1895, }, Value: "v", }, @@ -4301,34 +4273,33 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - Stmts: []node.Node{ + EndLine: -1, + StartPos: -1, + EndPos: -1, }, + Stmts: []node.Node{}, }, }, &stmt.Foreach{ Position: &position.Position{ StartLine: 82, - EndLine: 82, - StartPos: 1914, - EndPos: 1940, + EndLine: 82, + StartPos: 1914, + EndPos: 1940, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 82, - EndLine: 82, - StartPos: 1923, - EndPos: 1924, + EndLine: 82, + StartPos: 1923, + EndPos: 1924, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 82, - EndLine: 82, - StartPos: 1923, - EndPos: 1924, + EndLine: 82, + StartPos: 1923, + EndPos: 1924, }, Value: "a", }, @@ -4336,16 +4307,16 @@ func TestPhp5(t *testing.T) { Key: &expr.Variable{ Position: &position.Position{ StartLine: 82, - EndLine: 82, - StartPos: 1929, - EndPos: 1930, + EndLine: 82, + StartPos: 1929, + EndPos: 1930, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 82, - EndLine: 82, - StartPos: 1929, - EndPos: 1930, + EndLine: 82, + StartPos: 1929, + EndPos: 1930, }, Value: "k", }, @@ -4353,16 +4324,16 @@ func TestPhp5(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 82, - EndLine: 82, - StartPos: 1935, - EndPos: 1936, + EndLine: 82, + StartPos: 1935, + EndPos: 1936, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 82, - EndLine: 82, - StartPos: 1935, - EndPos: 1936, + EndLine: 82, + StartPos: 1935, + EndPos: 1936, }, Value: "v", }, @@ -4370,44 +4341,42 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 82, - EndLine: 82, - StartPos: 1939, - EndPos: 1940, - }, - Stmts: []node.Node{ + EndLine: 82, + StartPos: 1939, + EndPos: 1940, }, + Stmts: []node.Node{}, }, }, &stmt.Foreach{ Position: &position.Position{ StartLine: 83, - EndLine: 83, - StartPos: 1944, - EndPos: 1970, + EndLine: 83, + StartPos: 1944, + EndPos: 1970, }, Expr: &expr.ShortArray{ Position: &position.Position{ StartLine: 83, - EndLine: 83, - StartPos: 1953, - EndPos: 1954, - }, - Items: []node.Node{ + EndLine: 83, + StartPos: 1953, + EndPos: 1954, }, + Items: []node.Node{}, }, Key: &expr.Variable{ Position: &position.Position{ StartLine: 83, - EndLine: 83, - StartPos: 1959, - EndPos: 1960, + EndLine: 83, + StartPos: 1959, + EndPos: 1960, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 83, - EndLine: 83, - StartPos: 1959, - EndPos: 1960, + EndLine: 83, + StartPos: 1959, + EndPos: 1960, }, Value: "k", }, @@ -4415,16 +4384,16 @@ func TestPhp5(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 83, - EndLine: 83, - StartPos: 1965, - EndPos: 1966, + EndLine: 83, + StartPos: 1965, + EndPos: 1966, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 83, - EndLine: 83, - StartPos: 1965, - EndPos: 1966, + EndLine: 83, + StartPos: 1965, + EndPos: 1966, }, Value: "v", }, @@ -4432,34 +4401,33 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 83, - EndLine: 83, - StartPos: 1969, - EndPos: 1970, - }, - Stmts: []node.Node{ + EndLine: 83, + StartPos: 1969, + EndPos: 1970, }, + Stmts: []node.Node{}, }, }, &stmt.Foreach{ Position: &position.Position{ StartLine: 84, - EndLine: 84, - StartPos: 1974, - EndPos: 2001, + EndLine: 84, + StartPos: 1974, + EndPos: 2001, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 84, - EndLine: 84, - StartPos: 1983, - EndPos: 1984, + EndLine: 84, + StartPos: 1983, + EndPos: 1984, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 84, - EndLine: 84, - StartPos: 1983, - EndPos: 1984, + EndLine: 84, + StartPos: 1983, + EndPos: 1984, }, Value: "a", }, @@ -4467,16 +4435,16 @@ func TestPhp5(t *testing.T) { Key: &expr.Variable{ Position: &position.Position{ StartLine: 84, - EndLine: 84, - StartPos: 1989, - EndPos: 1990, + EndLine: 84, + StartPos: 1989, + EndPos: 1990, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 84, - EndLine: 84, - StartPos: 1989, - EndPos: 1990, + EndLine: 84, + StartPos: 1989, + EndPos: 1990, }, Value: "k", }, @@ -4484,23 +4452,23 @@ func TestPhp5(t *testing.T) { Variable: &expr.Reference{ Position: &position.Position{ StartLine: 84, - EndLine: 84, - StartPos: 1995, - EndPos: 1997, + EndLine: 84, + StartPos: 1995, + EndPos: 1997, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 84, - EndLine: 84, - StartPos: 1996, - EndPos: 1997, + EndLine: 84, + StartPos: 1996, + EndPos: 1997, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 84, - EndLine: 84, - StartPos: 1996, - EndPos: 1997, + EndLine: 84, + StartPos: 1996, + EndPos: 1997, }, Value: "v", }, @@ -4509,34 +4477,33 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 84, - EndLine: 84, - StartPos: 2000, - EndPos: 2001, - }, - Stmts: []node.Node{ + EndLine: 84, + StartPos: 2000, + EndPos: 2001, }, + Stmts: []node.Node{}, }, }, &stmt.Foreach{ Position: &position.Position{ StartLine: 85, - EndLine: 85, - StartPos: 2005, - EndPos: 2037, + EndLine: 85, + StartPos: 2005, + EndPos: 2037, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 85, - EndLine: 85, - StartPos: 2014, - EndPos: 2015, + EndLine: 85, + StartPos: 2014, + EndPos: 2015, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 85, - EndLine: 85, - StartPos: 2014, - EndPos: 2015, + EndLine: 85, + StartPos: 2014, + EndPos: 2015, }, Value: "a", }, @@ -4544,16 +4511,16 @@ func TestPhp5(t *testing.T) { Key: &expr.Variable{ Position: &position.Position{ StartLine: 85, - EndLine: 85, - StartPos: 2020, - EndPos: 2021, + EndLine: 85, + StartPos: 2020, + EndPos: 2021, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 85, - EndLine: 85, - StartPos: 2020, - EndPos: 2021, + EndLine: 85, + StartPos: 2020, + EndPos: 2021, }, Value: "k", }, @@ -4561,31 +4528,31 @@ func TestPhp5(t *testing.T) { Variable: &expr.List{ Position: &position.Position{ StartLine: 85, - EndLine: 85, - StartPos: 2026, - EndPos: 2033, + EndLine: 85, + StartPos: 2026, + EndPos: 2033, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 85, - EndLine: 85, - StartPos: 2031, - EndPos: 2032, + EndLine: 85, + StartPos: 2031, + EndPos: 2032, }, Val: &expr.Variable{ Position: &position.Position{ StartLine: 85, - EndLine: 85, - StartPos: 2031, - EndPos: 2032, + EndLine: 85, + StartPos: 2031, + EndPos: 2032, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 85, - EndLine: 85, - StartPos: 2031, - EndPos: 2032, + EndLine: 85, + StartPos: 2031, + EndPos: 2032, }, Value: "v", }, @@ -4596,50 +4563,48 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 85, - EndLine: 85, - StartPos: 2036, - EndPos: 2037, - }, - Stmts: []node.Node{ + EndLine: 85, + StartPos: 2036, + EndPos: 2037, }, + Stmts: []node.Node{}, }, }, &stmt.Function{ Position: &position.Position{ StartLine: 86, - EndLine: 86, - StartPos: 2041, - EndPos: 2057, + EndLine: 86, + StartPos: 2041, + EndPos: 2057, }, - ReturnsRef: false, + ReturnsRef: false, PhpDocComment: "", FunctionName: &node.Identifier{ Position: &position.Position{ StartLine: 86, - EndLine: 86, - StartPos: 2050, - EndPos: 2052, + EndLine: 86, + StartPos: 2050, + EndPos: 2052, }, Value: "foo", }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, &stmt.Function{ Position: &position.Position{ StartLine: 88, - EndLine: 93, - StartPos: 2062, - EndPos: 2154, + EndLine: 93, + StartPos: 2062, + EndPos: 2154, }, - ReturnsRef: false, + ReturnsRef: false, PhpDocComment: "", FunctionName: &node.Identifier{ Position: &position.Position{ StartLine: 88, - EndLine: 88, - StartPos: 2071, - EndPos: 2073, + EndLine: 88, + StartPos: 2071, + EndPos: 2073, }, Value: "foo", }, @@ -4647,72 +4612,70 @@ func TestPhp5(t *testing.T) { &stmt.HaltCompiler{ Position: &position.Position{ StartLine: 89, - EndLine: 89, - StartPos: 2082, - EndPos: 2099, + EndLine: 89, + StartPos: 2082, + EndPos: 2099, }, }, &stmt.Function{ Position: &position.Position{ StartLine: 90, - EndLine: 90, - StartPos: 2104, - EndPos: 2120, + EndLine: 90, + StartPos: 2104, + EndPos: 2120, }, PhpDocComment: "", - ReturnsRef: false, + ReturnsRef: false, FunctionName: &node.Identifier{ Position: &position.Position{ StartLine: 90, - EndLine: 90, - StartPos: 2113, - EndPos: 2115, + EndLine: 90, + StartPos: 2113, + EndPos: 2115, }, Value: "bar", }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, &stmt.Class{ Position: &position.Position{ StartLine: 91, - EndLine: 91, - StartPos: 2125, - EndPos: 2136, + EndLine: 91, + StartPos: 2125, + EndPos: 2136, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 91, - EndLine: 91, - StartPos: 2131, - EndPos: 2133, + EndLine: 91, + StartPos: 2131, + EndPos: 2133, }, Value: "Baz", }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, &stmt.Return{ Position: &position.Position{ StartLine: 92, - EndLine: 92, - StartPos: 2141, - EndPos: 2150, + EndLine: 92, + StartPos: 2141, + EndPos: 2150, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 92, - EndLine: 92, - StartPos: 2148, - EndPos: 2149, + EndLine: 92, + StartPos: 2148, + EndPos: 2149, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 92, - EndLine: 92, - StartPos: 2148, - EndPos: 2149, + EndLine: 92, + StartPos: 2148, + EndPos: 2149, }, Value: "a", }, @@ -4723,18 +4686,18 @@ func TestPhp5(t *testing.T) { &stmt.Function{ Position: &position.Position{ StartLine: 95, - EndLine: 95, - StartPos: 2161, - EndPos: 2205, + EndLine: 95, + StartPos: 2161, + EndPos: 2205, }, - ReturnsRef: false, + ReturnsRef: false, PhpDocComment: "", FunctionName: &node.Identifier{ Position: &position.Position{ StartLine: 95, - EndLine: 95, - StartPos: 2170, - EndPos: 2172, + EndLine: 95, + StartPos: 2170, + EndPos: 2172, }, Value: "foo", }, @@ -4742,34 +4705,34 @@ func TestPhp5(t *testing.T) { &node.Parameter{ Position: &position.Position{ StartLine: 95, - EndLine: 95, - StartPos: 2174, - EndPos: 2181, + EndLine: 95, + StartPos: 2174, + EndPos: 2181, }, - ByRef: false, + ByRef: false, Variadic: false, VariableType: &node.Identifier{ Position: &position.Position{ StartLine: 95, - EndLine: 95, - StartPos: 2174, - EndPos: 2178, + EndLine: 95, + StartPos: 2174, + EndPos: 2178, }, Value: "array", }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 95, - EndLine: 95, - StartPos: 2180, - EndPos: 2181, + EndLine: 95, + StartPos: 2180, + EndPos: 2181, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 95, - EndLine: 95, - StartPos: 2180, - EndPos: 2181, + EndLine: 95, + StartPos: 2180, + EndPos: 2181, }, Value: "a", }, @@ -4778,34 +4741,34 @@ func TestPhp5(t *testing.T) { &node.Parameter{ Position: &position.Position{ StartLine: 95, - EndLine: 95, - StartPos: 2184, - EndPos: 2194, + EndLine: 95, + StartPos: 2184, + EndPos: 2194, }, - ByRef: false, + ByRef: false, Variadic: false, VariableType: &node.Identifier{ Position: &position.Position{ StartLine: 95, - EndLine: 95, - StartPos: 2184, - EndPos: 2191, + EndLine: 95, + StartPos: 2184, + EndPos: 2191, }, Value: "callable", }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 95, - EndLine: 95, - StartPos: 2193, - EndPos: 2194, + EndLine: 95, + StartPos: 2193, + EndPos: 2194, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 95, - EndLine: 95, - StartPos: 2193, - EndPos: 2194, + EndLine: 95, + StartPos: 2193, + EndPos: 2194, }, Value: "b", }, @@ -4816,9 +4779,9 @@ func TestPhp5(t *testing.T) { &stmt.Return{ Position: &position.Position{ StartLine: 95, - EndLine: 95, - StartPos: 2198, - EndPos: 2204, + EndLine: 95, + StartPos: 2198, + EndPos: 2204, }, }, }, @@ -4826,18 +4789,18 @@ func TestPhp5(t *testing.T) { &stmt.Function{ Position: &position.Position{ StartLine: 96, - EndLine: 96, - StartPos: 2209, - EndPos: 2235, + EndLine: 96, + StartPos: 2209, + EndPos: 2235, }, - ReturnsRef: true, + ReturnsRef: true, PhpDocComment: "", FunctionName: &node.Identifier{ Position: &position.Position{ StartLine: 96, - EndLine: 96, - StartPos: 2219, - EndPos: 2221, + EndLine: 96, + StartPos: 2219, + EndPos: 2221, }, Value: "foo", }, @@ -4845,16 +4808,16 @@ func TestPhp5(t *testing.T) { &stmt.Return{ Position: &position.Position{ StartLine: 96, - EndLine: 96, - StartPos: 2226, - EndPos: 2234, + EndLine: 96, + StartPos: 2226, + EndPos: 2234, }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 96, - EndLine: 96, - StartPos: 2233, - EndPos: 2233, + EndLine: 96, + StartPos: 2233, + EndPos: 2233, }, Value: "1", }, @@ -4864,45 +4827,44 @@ func TestPhp5(t *testing.T) { &stmt.Function{ Position: &position.Position{ StartLine: 97, - EndLine: 97, - StartPos: 2239, - EndPos: 2256, + EndLine: 97, + StartPos: 2239, + EndPos: 2256, }, - ReturnsRef: true, + ReturnsRef: true, PhpDocComment: "", FunctionName: &node.Identifier{ Position: &position.Position{ StartLine: 97, - EndLine: 97, - StartPos: 2249, - EndPos: 2251, + EndLine: 97, + StartPos: 2249, + EndPos: 2251, }, Value: "foo", }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, &stmt.Global{ Position: &position.Position{ StartLine: 98, - EndLine: 98, - StartPos: 2260, - EndPos: 2288, + EndLine: 98, + StartPos: 2260, + EndPos: 2288, }, Vars: []node.Node{ &expr.Variable{ Position: &position.Position{ StartLine: 98, - EndLine: 98, - StartPos: 2267, - EndPos: 2268, + EndLine: 98, + StartPos: 2267, + EndPos: 2268, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 98, - EndLine: 98, - StartPos: 2267, - EndPos: 2268, + EndLine: 98, + StartPos: 2267, + EndPos: 2268, }, Value: "a", }, @@ -4910,16 +4872,16 @@ func TestPhp5(t *testing.T) { &expr.Variable{ Position: &position.Position{ StartLine: 98, - EndLine: 98, - StartPos: 2271, - EndPos: 2272, + EndLine: 98, + StartPos: 2271, + EndPos: 2272, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 98, - EndLine: 98, - StartPos: 2271, - EndPos: 2272, + EndLine: 98, + StartPos: 2271, + EndPos: 2272, }, Value: "b", }, @@ -4927,23 +4889,23 @@ func TestPhp5(t *testing.T) { &expr.Variable{ Position: &position.Position{ StartLine: 98, - EndLine: 98, - StartPos: 2275, - EndPos: 2277, + EndLine: 98, + StartPos: 2275, + EndPos: 2277, }, VarName: &expr.Variable{ Position: &position.Position{ StartLine: 98, - EndLine: 98, - StartPos: 2276, - EndPos: 2277, + EndLine: 98, + StartPos: 2276, + EndPos: 2277, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 98, - EndLine: 98, - StartPos: 2276, - EndPos: 2277, + EndLine: 98, + StartPos: 2276, + EndPos: 2277, }, Value: "c", }, @@ -4952,31 +4914,31 @@ func TestPhp5(t *testing.T) { &expr.Variable{ Position: &position.Position{ StartLine: 98, - EndLine: 98, - StartPos: 2280, - EndPos: 2287, + EndLine: 98, + StartPos: 2280, + EndPos: 2287, }, VarName: &expr.FunctionCall{ Position: &position.Position{ StartLine: 98, - EndLine: 98, - StartPos: 2282, - EndPos: 2286, + EndLine: 98, + StartPos: 2282, + EndPos: 2286, }, Function: &name.Name{ Position: &position.Position{ StartLine: 98, - EndLine: 98, - StartPos: 2282, - EndPos: 2284, + EndLine: 98, + StartPos: 2282, + EndPos: 2284, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 98, - EndLine: 98, - StartPos: 2282, - EndPos: 2284, + EndLine: 98, + StartPos: 2282, + EndPos: 2284, }, Value: "foo", }, @@ -4985,9 +4947,9 @@ func TestPhp5(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 98, - EndLine: 98, - StartPos: 2285, - EndPos: 2286, + EndLine: 98, + StartPos: 2285, + EndPos: 2286, }, }, }, @@ -4997,16 +4959,16 @@ func TestPhp5(t *testing.T) { &stmt.Label{ Position: &position.Position{ StartLine: 99, - EndLine: 99, - StartPos: 2292, - EndPos: 2293, + EndLine: 99, + StartPos: 2292, + EndPos: 2293, }, LabelName: &node.Identifier{ Position: &position.Position{ StartLine: 99, - EndLine: 99, - StartPos: 2292, - EndPos: 2292, + EndLine: 99, + StartPos: 2292, + EndPos: 2292, }, Value: "a", }, @@ -5014,16 +4976,16 @@ func TestPhp5(t *testing.T) { &stmt.Goto{ Position: &position.Position{ StartLine: 100, - EndLine: 100, - StartPos: 2298, - EndPos: 2304, + EndLine: 100, + StartPos: 2298, + EndPos: 2304, }, Label: &node.Identifier{ Position: &position.Position{ StartLine: 100, - EndLine: 100, - StartPos: 2303, - EndPos: 2303, + EndLine: 100, + StartPos: 2303, + EndPos: 2303, }, Value: "a", }, @@ -5031,31 +4993,31 @@ func TestPhp5(t *testing.T) { &stmt.HaltCompiler{ Position: &position.Position{ StartLine: 101, - EndLine: 101, - StartPos: 2308, - EndPos: 2325, + EndLine: 101, + StartPos: 2308, + EndPos: 2325, }, }, &stmt.If{ Position: &position.Position{ StartLine: 102, - EndLine: 102, - StartPos: 2329, - EndPos: 2338, + EndLine: 102, + StartPos: 2329, + EndPos: 2338, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 102, - EndLine: 102, - StartPos: 2333, - EndPos: 2334, + EndLine: 102, + StartPos: 2333, + EndPos: 2334, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 102, - EndLine: 102, - StartPos: 2333, - EndPos: 2334, + EndLine: 102, + StartPos: 2333, + EndPos: 2334, }, Value: "a", }, @@ -5063,34 +5025,33 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 102, - EndLine: 102, - StartPos: 2337, - EndPos: 2338, - }, - Stmts: []node.Node{ + EndLine: 102, + StartPos: 2337, + EndPos: 2338, }, + Stmts: []node.Node{}, }, }, &stmt.If{ Position: &position.Position{ StartLine: 103, - EndLine: 103, - StartPos: 2342, - EndPos: 2366, + EndLine: 103, + StartPos: 2342, + EndPos: 2366, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 103, - EndLine: 103, - StartPos: 2346, - EndPos: 2347, + EndLine: 103, + StartPos: 2346, + EndPos: 2347, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 103, - EndLine: 103, - StartPos: 2346, - EndPos: 2347, + EndLine: 103, + StartPos: 2346, + EndPos: 2347, }, Value: "a", }, @@ -5098,34 +5059,33 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 103, - EndLine: 103, - StartPos: 2350, - EndPos: 2351, - }, - Stmts: []node.Node{ + EndLine: 103, + StartPos: 2350, + EndPos: 2351, }, + Stmts: []node.Node{}, }, ElseIf: []node.Node{ &stmt.ElseIf{ Position: &position.Position{ StartLine: 103, - EndLine: 103, - StartPos: 2353, - EndPos: 2366, + EndLine: 103, + StartPos: 2353, + EndPos: 2366, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 103, - EndLine: 103, - StartPos: 2361, - EndPos: 2362, + EndLine: 103, + StartPos: 2361, + EndPos: 2362, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 103, - EndLine: 103, - StartPos: 2361, - EndPos: 2362, + EndLine: 103, + StartPos: 2361, + EndPos: 2362, }, Value: "b", }, @@ -5133,12 +5093,11 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 103, - EndLine: 103, - StartPos: 2365, - EndPos: 2366, - }, - Stmts: []node.Node{ + EndLine: 103, + StartPos: 2365, + EndPos: 2366, }, + Stmts: []node.Node{}, }, }, }, @@ -5146,23 +5105,23 @@ func TestPhp5(t *testing.T) { &stmt.If{ Position: &position.Position{ StartLine: 104, - EndLine: 104, - StartPos: 2370, - EndPos: 2387, + EndLine: 104, + StartPos: 2370, + EndPos: 2387, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 104, - EndLine: 104, - StartPos: 2374, - EndPos: 2375, + EndLine: 104, + StartPos: 2374, + EndPos: 2375, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 104, - EndLine: 104, - StartPos: 2374, - EndPos: 2375, + EndLine: 104, + StartPos: 2374, + EndPos: 2375, }, Value: "a", }, @@ -5170,52 +5129,50 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 104, - EndLine: 104, - StartPos: 2378, - EndPos: 2379, - }, - Stmts: []node.Node{ + EndLine: 104, + StartPos: 2378, + EndPos: 2379, }, + Stmts: []node.Node{}, }, Else: &stmt.Else{ Position: &position.Position{ StartLine: 104, - EndLine: 104, - StartPos: 2381, - EndPos: 2387, + EndLine: 104, + StartPos: 2381, + EndPos: 2387, }, Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 104, - EndLine: 104, - StartPos: 2386, - EndPos: 2387, - }, - Stmts: []node.Node{ + EndLine: 104, + StartPos: 2386, + EndPos: 2387, }, + Stmts: []node.Node{}, }, }, }, &stmt.If{ Position: &position.Position{ StartLine: 105, - EndLine: 105, - StartPos: 2391, - EndPos: 2438, + EndLine: 105, + StartPos: 2391, + EndPos: 2438, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 105, - EndLine: 105, - StartPos: 2395, - EndPos: 2396, + EndLine: 105, + StartPos: 2395, + EndPos: 2396, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 105, - EndLine: 105, - StartPos: 2395, - EndPos: 2396, + EndLine: 105, + StartPos: 2395, + EndPos: 2396, }, Value: "a", }, @@ -5223,34 +5180,33 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 105, - EndLine: 105, - StartPos: 2399, - EndPos: 2400, - }, - Stmts: []node.Node{ + EndLine: 105, + StartPos: 2399, + EndPos: 2400, }, + Stmts: []node.Node{}, }, ElseIf: []node.Node{ &stmt.ElseIf{ Position: &position.Position{ StartLine: 105, - EndLine: 105, - StartPos: 2402, - EndPos: 2415, + EndLine: 105, + StartPos: 2402, + EndPos: 2415, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 105, - EndLine: 105, - StartPos: 2410, - EndPos: 2411, + EndLine: 105, + StartPos: 2410, + EndPos: 2411, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 105, - EndLine: 105, - StartPos: 2410, - EndPos: 2411, + EndLine: 105, + StartPos: 2410, + EndPos: 2411, }, Value: "b", }, @@ -5258,34 +5214,33 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 105, - EndLine: 105, - StartPos: 2414, - EndPos: 2415, - }, - Stmts: []node.Node{ + EndLine: 105, + StartPos: 2414, + EndPos: 2415, }, + Stmts: []node.Node{}, }, }, &stmt.ElseIf{ Position: &position.Position{ StartLine: 105, - EndLine: 105, - StartPos: 2417, - EndPos: 2430, + EndLine: 105, + StartPos: 2417, + EndPos: 2430, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 105, - EndLine: 105, - StartPos: 2425, - EndPos: 2426, + EndLine: 105, + StartPos: 2425, + EndPos: 2426, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 105, - EndLine: 105, - StartPos: 2425, - EndPos: 2426, + EndLine: 105, + StartPos: 2425, + EndPos: 2426, }, Value: "c", }, @@ -5293,54 +5248,52 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 105, - EndLine: 105, - StartPos: 2429, - EndPos: 2430, - }, - Stmts: []node.Node{ + EndLine: 105, + StartPos: 2429, + EndPos: 2430, }, + Stmts: []node.Node{}, }, }, }, Else: &stmt.Else{ Position: &position.Position{ StartLine: 105, - EndLine: 105, - StartPos: 2432, - EndPos: 2438, + EndLine: 105, + StartPos: 2432, + EndPos: 2438, }, Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 105, - EndLine: 105, - StartPos: 2437, - EndPos: 2438, - }, - Stmts: []node.Node{ + EndLine: 105, + StartPos: 2437, + EndPos: 2438, }, + Stmts: []node.Node{}, }, }, }, &stmt.If{ Position: &position.Position{ StartLine: 106, - EndLine: 106, - StartPos: 2442, - EndPos: 2490, + EndLine: 106, + StartPos: 2442, + EndPos: 2490, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 106, - EndLine: 106, - StartPos: 2446, - EndPos: 2447, + EndLine: 106, + StartPos: 2446, + EndPos: 2447, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 106, - EndLine: 106, - StartPos: 2446, - EndPos: 2447, + EndLine: 106, + StartPos: 2446, + EndPos: 2447, }, Value: "a", }, @@ -5348,34 +5301,33 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 106, - EndLine: 106, - StartPos: 2450, - EndPos: 2451, - }, - Stmts: []node.Node{ + EndLine: 106, + StartPos: 2450, + EndPos: 2451, }, + Stmts: []node.Node{}, }, ElseIf: []node.Node{ &stmt.ElseIf{ Position: &position.Position{ StartLine: 106, - EndLine: 106, - StartPos: 2453, - EndPos: 2466, + EndLine: 106, + StartPos: 2453, + EndPos: 2466, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 106, - EndLine: 106, - StartPos: 2461, - EndPos: 2462, + EndLine: 106, + StartPos: 2461, + EndPos: 2462, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 106, - EndLine: 106, - StartPos: 2461, - EndPos: 2462, + EndLine: 106, + StartPos: 2461, + EndPos: 2462, }, Value: "b", }, @@ -5383,42 +5335,41 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 106, - EndLine: 106, - StartPos: 2465, - EndPos: 2466, - }, - Stmts: []node.Node{ + EndLine: 106, + StartPos: 2465, + EndPos: 2466, }, + Stmts: []node.Node{}, }, }, }, Else: &stmt.Else{ Position: &position.Position{ StartLine: 106, - EndLine: 106, - StartPos: 2468, - EndPos: 2490, + EndLine: 106, + StartPos: 2468, + EndPos: 2490, }, Stmt: &stmt.If{ Position: &position.Position{ StartLine: 106, - EndLine: 106, - StartPos: 2473, - EndPos: 2490, + EndLine: 106, + StartPos: 2473, + EndPos: 2490, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 106, - EndLine: 106, - StartPos: 2477, - EndPos: 2478, + EndLine: 106, + StartPos: 2477, + EndPos: 2478, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 106, - EndLine: 106, - StartPos: 2477, - EndPos: 2478, + EndLine: 106, + StartPos: 2477, + EndPos: 2478, }, Value: "c", }, @@ -5426,29 +5377,27 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 106, - EndLine: 106, - StartPos: 2481, - EndPos: 2482, - }, - Stmts: []node.Node{ + EndLine: 106, + StartPos: 2481, + EndPos: 2482, }, + Stmts: []node.Node{}, }, Else: &stmt.Else{ Position: &position.Position{ StartLine: 106, - EndLine: 106, - StartPos: 2484, - EndPos: 2490, + EndLine: 106, + StartPos: 2484, + EndPos: 2490, }, Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 106, - EndLine: 106, - StartPos: 2489, - EndPos: 2490, - }, - Stmts: []node.Node{ + EndLine: 106, + StartPos: 2489, + EndPos: 2490, }, + Stmts: []node.Node{}, }, }, }, @@ -5457,79 +5406,78 @@ func TestPhp5(t *testing.T) { &stmt.Nop{ Position: &position.Position{ StartLine: 107, - EndLine: 107, - StartPos: 2494, - EndPos: 2495, + EndLine: 107, + StartPos: 2494, + EndPos: 2495, }, }, &stmt.InlineHtml{ Position: &position.Position{ StartLine: 107, - EndLine: 107, - StartPos: 2497, - EndPos: 2508, + EndLine: 107, + StartPos: 2497, + EndPos: 2508, }, Value: "
", }, &stmt.Interface{ Position: &position.Position{ StartLine: 108, - EndLine: 108, - StartPos: 2514, - EndPos: 2529, + EndLine: 108, + StartPos: 2514, + EndPos: 2529, }, PhpDocComment: "", InterfaceName: &node.Identifier{ Position: &position.Position{ StartLine: 108, - EndLine: 108, - StartPos: 2524, - EndPos: 2526, + EndLine: 108, + StartPos: 2524, + EndPos: 2526, }, Value: "Foo", }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, &stmt.Interface{ Position: &position.Position{ StartLine: 109, - EndLine: 109, - StartPos: 2533, - EndPos: 2560, + EndLine: 109, + StartPos: 2533, + EndPos: 2560, }, PhpDocComment: "", InterfaceName: &node.Identifier{ Position: &position.Position{ StartLine: 109, - EndLine: 109, - StartPos: 2543, - EndPos: 2545, + EndLine: 109, + StartPos: 2543, + EndPos: 2545, }, Value: "Foo", }, Extends: &stmt.InterfaceExtends{ Position: &position.Position{ StartLine: 109, - EndLine: 109, - StartPos: 2547, - EndPos: 2557, + EndLine: 109, + StartPos: 2547, + EndPos: 2557, }, InterfaceNames: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 109, - EndLine: 109, - StartPos: 2555, - EndPos: 2557, + EndLine: 109, + StartPos: 2555, + EndPos: 2557, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 109, - EndLine: 109, - StartPos: 2555, - EndPos: 2557, + EndLine: 109, + StartPos: 2555, + EndPos: 2557, }, Value: "Bar", }, @@ -5537,48 +5485,47 @@ func TestPhp5(t *testing.T) { }, }, }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, &stmt.Interface{ Position: &position.Position{ StartLine: 110, - EndLine: 110, - StartPos: 2564, - EndPos: 2596, + EndLine: 110, + StartPos: 2564, + EndPos: 2596, }, PhpDocComment: "", InterfaceName: &node.Identifier{ Position: &position.Position{ StartLine: 110, - EndLine: 110, - StartPos: 2574, - EndPos: 2576, + EndLine: 110, + StartPos: 2574, + EndPos: 2576, }, Value: "Foo", }, Extends: &stmt.InterfaceExtends{ Position: &position.Position{ StartLine: 110, - EndLine: 110, - StartPos: 2578, - EndPos: 2593, + EndLine: 110, + StartPos: 2578, + EndPos: 2593, }, InterfaceNames: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 110, - EndLine: 110, - StartPos: 2586, - EndPos: 2588, + EndLine: 110, + StartPos: 2586, + EndPos: 2588, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 110, - EndLine: 110, - StartPos: 2586, - EndPos: 2588, + EndLine: 110, + StartPos: 2586, + EndPos: 2588, }, Value: "Bar", }, @@ -5587,17 +5534,17 @@ func TestPhp5(t *testing.T) { &name.Name{ Position: &position.Position{ StartLine: 110, - EndLine: 110, - StartPos: 2591, - EndPos: 2593, + EndLine: 110, + StartPos: 2591, + EndPos: 2593, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 110, - EndLine: 110, - StartPos: 2591, - EndPos: 2593, + EndLine: 110, + StartPos: 2591, + EndPos: 2593, }, Value: "Baz", }, @@ -5605,30 +5552,29 @@ func TestPhp5(t *testing.T) { }, }, }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, &stmt.Namespace{ Position: &position.Position{ StartLine: 111, - EndLine: 111, - StartPos: 2600, - EndPos: 2613, + EndLine: 111, + StartPos: 2600, + EndPos: 2613, }, NamespaceName: &name.Name{ Position: &position.Position{ StartLine: 111, - EndLine: 111, - StartPos: 2610, - EndPos: 2612, + EndLine: 111, + StartPos: 2610, + EndPos: 2612, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 111, - EndLine: 111, - StartPos: 2610, - EndPos: 2612, + EndLine: 111, + StartPos: 2610, + EndPos: 2612, }, Value: "Foo", }, @@ -5638,65 +5584,63 @@ func TestPhp5(t *testing.T) { &stmt.Namespace{ Position: &position.Position{ StartLine: 112, - EndLine: 112, - StartPos: 2617, - EndPos: 2636, + EndLine: 112, + StartPos: 2617, + EndPos: 2636, }, NamespaceName: &name.Name{ Position: &position.Position{ StartLine: 112, - EndLine: 112, - StartPos: 2627, - EndPos: 2633, + EndLine: 112, + StartPos: 2627, + EndPos: 2633, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 112, - EndLine: 112, - StartPos: 2627, - EndPos: 2629, + EndLine: 112, + StartPos: 2627, + EndPos: 2629, }, Value: "Foo", }, &name.NamePart{ Position: &position.Position{ StartLine: 112, - EndLine: 112, - StartPos: 2631, - EndPos: 2633, + EndLine: 112, + StartPos: 2631, + EndPos: 2633, }, Value: "Bar", }, }, }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, &stmt.Namespace{ Position: &position.Position{ StartLine: 113, - EndLine: 113, - StartPos: 2640, - EndPos: 2651, - }, - Stmts: []node.Node{ + EndLine: 113, + StartPos: 2640, + EndPos: 2651, }, + Stmts: []node.Node{}, }, &stmt.Class{ Position: &position.Position{ StartLine: 114, - EndLine: 114, - StartPos: 2655, - EndPos: 2673, + EndLine: 114, + StartPos: 2655, + EndPos: 2673, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 114, - EndLine: 114, - StartPos: 2661, - EndPos: 2663, + EndLine: 114, + StartPos: 2661, + EndPos: 2663, }, Value: "foo", }, @@ -5704,17 +5648,17 @@ func TestPhp5(t *testing.T) { &stmt.PropertyList{ Position: &position.Position{ StartLine: 114, - EndLine: 114, - StartPos: 2666, - EndPos: 2672, + EndLine: 114, + StartPos: 2666, + EndPos: 2672, }, Modifiers: []node.Node{ &node.Identifier{ Position: &position.Position{ StartLine: 114, - EndLine: 114, - StartPos: 2666, - EndPos: 2668, + EndLine: 114, + StartPos: 2666, + EndPos: 2668, }, Value: "var", }, @@ -5723,24 +5667,24 @@ func TestPhp5(t *testing.T) { &stmt.Property{ Position: &position.Position{ StartLine: 114, - EndLine: 114, - StartPos: 2670, - EndPos: 2671, + EndLine: 114, + StartPos: 2670, + EndPos: 2671, }, PhpDocComment: "", Variable: &expr.Variable{ Position: &position.Position{ StartLine: 114, - EndLine: 114, - StartPos: 2670, - EndPos: 2671, + EndLine: 114, + StartPos: 2670, + EndPos: 2671, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 114, - EndLine: 114, - StartPos: 2670, - EndPos: 2671, + EndLine: 114, + StartPos: 2670, + EndPos: 2671, }, Value: "a", }, @@ -5753,17 +5697,17 @@ func TestPhp5(t *testing.T) { &stmt.Class{ Position: &position.Position{ StartLine: 115, - EndLine: 115, - StartPos: 2677, - EndPos: 2713, + EndLine: 115, + StartPos: 2677, + EndPos: 2713, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 115, - EndLine: 115, - StartPos: 2683, - EndPos: 2685, + EndLine: 115, + StartPos: 2683, + EndPos: 2685, }, Value: "foo", }, @@ -5771,26 +5715,26 @@ func TestPhp5(t *testing.T) { &stmt.PropertyList{ Position: &position.Position{ StartLine: 115, - EndLine: 115, - StartPos: 2688, - EndPos: 2712, + EndLine: 115, + StartPos: 2688, + EndPos: 2712, }, Modifiers: []node.Node{ &node.Identifier{ Position: &position.Position{ StartLine: 115, - EndLine: 115, - StartPos: 2688, - EndPos: 2693, + EndLine: 115, + StartPos: 2688, + EndPos: 2693, }, Value: "public", }, &node.Identifier{ Position: &position.Position{ StartLine: 115, - EndLine: 115, - StartPos: 2695, - EndPos: 2700, + EndLine: 115, + StartPos: 2695, + EndPos: 2700, }, Value: "static", }, @@ -5799,24 +5743,24 @@ func TestPhp5(t *testing.T) { &stmt.Property{ Position: &position.Position{ StartLine: 115, - EndLine: 115, - StartPos: 2702, - EndPos: 2703, + EndLine: 115, + StartPos: 2702, + EndPos: 2703, }, PhpDocComment: "", Variable: &expr.Variable{ Position: &position.Position{ StartLine: 115, - EndLine: 115, - StartPos: 2702, - EndPos: 2703, + EndLine: 115, + StartPos: 2702, + EndPos: 2703, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 115, - EndLine: 115, - StartPos: 2702, - EndPos: 2703, + EndLine: 115, + StartPos: 2702, + EndPos: 2703, }, Value: "a", }, @@ -5825,24 +5769,24 @@ func TestPhp5(t *testing.T) { &stmt.Property{ Position: &position.Position{ StartLine: 115, - EndLine: 115, - StartPos: 2706, - EndPos: 2711, + EndLine: 115, + StartPos: 2706, + EndPos: 2711, }, PhpDocComment: "", Variable: &expr.Variable{ Position: &position.Position{ StartLine: 115, - EndLine: 115, - StartPos: 2706, - EndPos: 2707, + EndLine: 115, + StartPos: 2706, + EndPos: 2707, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 115, - EndLine: 115, - StartPos: 2706, - EndPos: 2707, + EndLine: 115, + StartPos: 2706, + EndPos: 2707, }, Value: "b", }, @@ -5850,9 +5794,9 @@ func TestPhp5(t *testing.T) { Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 115, - EndLine: 115, - StartPos: 2711, - EndPos: 2711, + EndLine: 115, + StartPos: 2711, + EndPos: 2711, }, Value: "1", }, @@ -5864,17 +5808,17 @@ func TestPhp5(t *testing.T) { &stmt.Class{ Position: &position.Position{ StartLine: 116, - EndLine: 116, - StartPos: 2717, - EndPos: 2753, + EndLine: 116, + StartPos: 2717, + EndPos: 2753, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 116, - EndLine: 116, - StartPos: 2723, - EndPos: 2725, + EndLine: 116, + StartPos: 2723, + EndPos: 2725, }, Value: "foo", }, @@ -5882,26 +5826,26 @@ func TestPhp5(t *testing.T) { &stmt.PropertyList{ Position: &position.Position{ StartLine: 116, - EndLine: 116, - StartPos: 2728, - EndPos: 2752, + EndLine: 116, + StartPos: 2728, + EndPos: 2752, }, Modifiers: []node.Node{ &node.Identifier{ Position: &position.Position{ StartLine: 116, - EndLine: 116, - StartPos: 2728, - EndPos: 2733, + EndLine: 116, + StartPos: 2728, + EndPos: 2733, }, Value: "public", }, &node.Identifier{ Position: &position.Position{ StartLine: 116, - EndLine: 116, - StartPos: 2735, - EndPos: 2740, + EndLine: 116, + StartPos: 2735, + EndPos: 2740, }, Value: "static", }, @@ -5910,24 +5854,24 @@ func TestPhp5(t *testing.T) { &stmt.Property{ Position: &position.Position{ StartLine: 116, - EndLine: 116, - StartPos: 2742, - EndPos: 2747, + EndLine: 116, + StartPos: 2742, + EndPos: 2747, }, PhpDocComment: "", Variable: &expr.Variable{ Position: &position.Position{ StartLine: 116, - EndLine: 116, - StartPos: 2742, - EndPos: 2743, + EndLine: 116, + StartPos: 2742, + EndPos: 2743, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 116, - EndLine: 116, - StartPos: 2742, - EndPos: 2743, + EndLine: 116, + StartPos: 2742, + EndPos: 2743, }, Value: "a", }, @@ -5935,9 +5879,9 @@ func TestPhp5(t *testing.T) { Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 116, - EndLine: 116, - StartPos: 2747, - EndPos: 2747, + EndLine: 116, + StartPos: 2747, + EndPos: 2747, }, Value: "1", }, @@ -5945,24 +5889,24 @@ func TestPhp5(t *testing.T) { &stmt.Property{ Position: &position.Position{ StartLine: 116, - EndLine: 116, - StartPos: 2750, - EndPos: 2751, + EndLine: 116, + StartPos: 2750, + EndPos: 2751, }, PhpDocComment: "", Variable: &expr.Variable{ Position: &position.Position{ StartLine: 116, - EndLine: 116, - StartPos: 2750, - EndPos: 2751, + EndLine: 116, + StartPos: 2750, + EndPos: 2751, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 116, - EndLine: 116, - StartPos: 2750, - EndPos: 2751, + EndLine: 116, + StartPos: 2750, + EndPos: 2751, }, Value: "b", }, @@ -5975,31 +5919,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 117, - EndLine: 117, - StartPos: 2757, - EndPos: 2774, + EndLine: 117, + StartPos: 2757, + EndPos: 2774, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 117, - EndLine: 117, - StartPos: 2764, - EndPos: 2765, + EndLine: 117, + StartPos: 2764, + EndPos: 2765, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 117, - EndLine: 117, - StartPos: 2764, - EndPos: 2765, + EndLine: 117, + StartPos: 2764, + EndPos: 2765, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 117, - EndLine: 117, - StartPos: 2764, - EndPos: 2765, + EndLine: 117, + StartPos: 2764, + EndPos: 2765, }, Value: "a", }, @@ -6008,23 +5952,23 @@ func TestPhp5(t *testing.T) { &stmt.StaticVar{ Position: &position.Position{ StartLine: 117, - EndLine: 117, - StartPos: 2768, - EndPos: 2773, + EndLine: 117, + StartPos: 2768, + EndPos: 2773, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 117, - EndLine: 117, - StartPos: 2768, - EndPos: 2769, + EndLine: 117, + StartPos: 2768, + EndPos: 2769, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 117, - EndLine: 117, - StartPos: 2768, - EndPos: 2769, + EndLine: 117, + StartPos: 2768, + EndPos: 2769, }, Value: "b", }, @@ -6032,9 +5976,9 @@ func TestPhp5(t *testing.T) { Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 117, - EndLine: 117, - StartPos: 2773, - EndPos: 2773, + EndLine: 117, + StartPos: 2773, + EndPos: 2773, }, Value: "1", }, @@ -6044,31 +5988,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 118, - EndLine: 118, - StartPos: 2778, - EndPos: 2795, + EndLine: 118, + StartPos: 2778, + EndPos: 2795, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 118, - EndLine: 118, - StartPos: 2785, - EndPos: 2790, + EndLine: 118, + StartPos: 2785, + EndPos: 2790, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 118, - EndLine: 118, - StartPos: 2785, - EndPos: 2786, + EndLine: 118, + StartPos: 2785, + EndPos: 2786, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 118, - EndLine: 118, - StartPos: 2785, - EndPos: 2786, + EndLine: 118, + StartPos: 2785, + EndPos: 2786, }, Value: "a", }, @@ -6076,9 +6020,9 @@ func TestPhp5(t *testing.T) { Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 118, - EndLine: 118, - StartPos: 2790, - EndPos: 2790, + EndLine: 118, + StartPos: 2790, + EndPos: 2790, }, Value: "1", }, @@ -6086,23 +6030,23 @@ func TestPhp5(t *testing.T) { &stmt.StaticVar{ Position: &position.Position{ StartLine: 118, - EndLine: 118, - StartPos: 2793, - EndPos: 2794, + EndLine: 118, + StartPos: 2793, + EndPos: 2794, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 118, - EndLine: 118, - StartPos: 2793, - EndPos: 2794, + EndLine: 118, + StartPos: 2793, + EndPos: 2794, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 118, - EndLine: 118, - StartPos: 2793, - EndPos: 2794, + EndLine: 118, + StartPos: 2793, + EndPos: 2794, }, Value: "b", }, @@ -6113,74 +6057,71 @@ func TestPhp5(t *testing.T) { &stmt.AltSwitch{ Position: &position.Position{ StartLine: 120, - EndLine: 124, - StartPos: 2800, - EndPos: 2858, + EndLine: 124, + StartPos: 2800, + EndPos: 2858, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 120, - EndLine: 120, - StartPos: 2808, - EndPos: 2808, + EndLine: 120, + StartPos: 2808, + EndPos: 2808, }, Value: "1", }, CaseList: &stmt.CaseList{ Position: &position.Position{ StartLine: 121, - EndLine: -1, - StartPos: 2816, - EndPos: -1, + EndLine: -1, + StartPos: 2816, + EndPos: -1, }, Cases: []node.Node{ &stmt.Case{ Position: &position.Position{ StartLine: 121, - EndLine: -1, - StartPos: 2816, - EndPos: -1, + EndLine: -1, + StartPos: 2816, + EndPos: -1, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 121, - EndLine: 121, - StartPos: 2821, - EndPos: 2821, + EndLine: 121, + StartPos: 2821, + EndPos: 2821, }, Value: "1", }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, &stmt.Default{ Position: &position.Position{ StartLine: 122, - EndLine: -1, - StartPos: 2827, - EndPos: -1, - }, - Stmts: []node.Node{ + EndLine: -1, + StartPos: 2827, + EndPos: -1, }, + Stmts: []node.Node{}, }, &stmt.Case{ Position: &position.Position{ StartLine: 123, - EndLine: -1, - StartPos: 2839, - EndPos: -1, + EndLine: -1, + StartPos: 2839, + EndPos: -1, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 123, - EndLine: 123, - StartPos: 2844, - EndPos: 2844, + EndLine: 123, + StartPos: 2844, + EndPos: 2844, }, Value: "2", }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, }, }, @@ -6188,64 +6129,62 @@ func TestPhp5(t *testing.T) { &stmt.AltSwitch{ Position: &position.Position{ StartLine: 126, - EndLine: 129, - StartPos: 2863, - EndPos: 2910, + EndLine: 129, + StartPos: 2863, + EndPos: 2910, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 126, - EndLine: 126, - StartPos: 2871, - EndPos: 2871, + EndLine: 126, + StartPos: 2871, + EndPos: 2871, }, Value: "1", }, CaseList: &stmt.CaseList{ Position: &position.Position{ StartLine: 127, - EndLine: -1, - StartPos: 2880, - EndPos: -1, + EndLine: -1, + StartPos: 2880, + EndPos: -1, }, Cases: []node.Node{ &stmt.Case{ Position: &position.Position{ StartLine: 127, - EndLine: -1, - StartPos: 2880, - EndPos: -1, + EndLine: -1, + StartPos: 2880, + EndPos: -1, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 127, - EndLine: 127, - StartPos: 2885, - EndPos: 2885, + EndLine: 127, + StartPos: 2885, + EndPos: 2885, }, Value: "1", }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, &stmt.Case{ Position: &position.Position{ StartLine: 128, - EndLine: -1, - StartPos: 2891, - EndPos: -1, + EndLine: -1, + StartPos: 2891, + EndPos: -1, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 128, - EndLine: 128, - StartPos: 2896, - EndPos: 2896, + EndLine: 128, + StartPos: 2896, + EndPos: 2896, }, Value: "2", }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, }, }, @@ -6253,40 +6192,40 @@ func TestPhp5(t *testing.T) { &stmt.Switch{ Position: &position.Position{ StartLine: 131, - EndLine: 134, - StartPos: 2917, - EndPos: 2968, + EndLine: 134, + StartPos: 2917, + EndPos: 2968, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 131, - EndLine: 131, - StartPos: 2925, - EndPos: 2925, + EndLine: 131, + StartPos: 2925, + EndPos: 2925, }, Value: "1", }, CaseList: &stmt.CaseList{ Position: &position.Position{ StartLine: 131, - EndLine: 134, - StartPos: 2928, - EndPos: 2968, + EndLine: 134, + StartPos: 2928, + EndPos: 2968, }, Cases: []node.Node{ &stmt.Case{ Position: &position.Position{ StartLine: 132, - EndLine: 132, - StartPos: 2933, - EndPos: 2946, + EndLine: 132, + StartPos: 2933, + EndPos: 2946, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 132, - EndLine: 132, - StartPos: 2938, - EndPos: 2938, + EndLine: 132, + StartPos: 2938, + EndPos: 2938, }, Value: "1", }, @@ -6294,9 +6233,9 @@ func TestPhp5(t *testing.T) { &stmt.Break{ Position: &position.Position{ StartLine: 132, - EndLine: 132, - StartPos: 2941, - EndPos: 2946, + EndLine: 132, + StartPos: 2941, + EndPos: 2946, }, }, }, @@ -6304,16 +6243,16 @@ func TestPhp5(t *testing.T) { &stmt.Case{ Position: &position.Position{ StartLine: 133, - EndLine: 133, - StartPos: 2951, - EndPos: 2964, + EndLine: 133, + StartPos: 2951, + EndPos: 2964, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 133, - EndLine: 133, - StartPos: 2956, - EndPos: 2956, + EndLine: 133, + StartPos: 2956, + EndPos: 2956, }, Value: "2", }, @@ -6321,9 +6260,9 @@ func TestPhp5(t *testing.T) { &stmt.Break{ Position: &position.Position{ StartLine: 133, - EndLine: 133, - StartPos: 2959, - EndPos: 2964, + EndLine: 133, + StartPos: 2959, + EndPos: 2964, }, }, }, @@ -6334,40 +6273,40 @@ func TestPhp5(t *testing.T) { &stmt.Switch{ Position: &position.Position{ StartLine: 136, - EndLine: 139, - StartPos: 2975, - EndPos: 3027, + EndLine: 139, + StartPos: 2975, + EndPos: 3027, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 136, - EndLine: 136, - StartPos: 2983, - EndPos: 2983, + EndLine: 136, + StartPos: 2983, + EndPos: 2983, }, Value: "1", }, CaseList: &stmt.CaseList{ Position: &position.Position{ StartLine: 136, - EndLine: 139, - StartPos: 2986, - EndPos: 3027, + EndLine: 139, + StartPos: 2986, + EndPos: 3027, }, Cases: []node.Node{ &stmt.Case{ Position: &position.Position{ StartLine: 137, - EndLine: 137, - StartPos: 2992, - EndPos: 3005, + EndLine: 137, + StartPos: 2992, + EndPos: 3005, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 137, - EndLine: 137, - StartPos: 2997, - EndPos: 2997, + EndLine: 137, + StartPos: 2997, + EndPos: 2997, }, Value: "1", }, @@ -6375,9 +6314,9 @@ func TestPhp5(t *testing.T) { &stmt.Break{ Position: &position.Position{ StartLine: 137, - EndLine: 137, - StartPos: 3000, - EndPos: 3005, + EndLine: 137, + StartPos: 3000, + EndPos: 3005, }, }, }, @@ -6385,16 +6324,16 @@ func TestPhp5(t *testing.T) { &stmt.Case{ Position: &position.Position{ StartLine: 138, - EndLine: 138, - StartPos: 3010, - EndPos: 3023, + EndLine: 138, + StartPos: 3010, + EndPos: 3023, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 138, - EndLine: 138, - StartPos: 3015, - EndPos: 3015, + EndLine: 138, + StartPos: 3015, + EndPos: 3015, }, Value: "2", }, @@ -6402,9 +6341,9 @@ func TestPhp5(t *testing.T) { &stmt.Break{ Position: &position.Position{ StartLine: 138, - EndLine: 138, - StartPos: 3018, - EndPos: 3023, + EndLine: 138, + StartPos: 3018, + EndPos: 3023, }, }, }, @@ -6415,23 +6354,23 @@ func TestPhp5(t *testing.T) { &stmt.Throw{ Position: &position.Position{ StartLine: 140, - EndLine: 140, - StartPos: 3031, - EndPos: 3039, + EndLine: 140, + StartPos: 3031, + EndPos: 3039, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 140, - EndLine: 140, - StartPos: 3037, - EndPos: 3038, + EndLine: 140, + StartPos: 3037, + EndPos: 3038, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 140, - EndLine: 140, - StartPos: 3037, - EndPos: 3038, + EndLine: 140, + StartPos: 3037, + EndPos: 3038, }, Value: "e", }, @@ -6440,37 +6379,36 @@ func TestPhp5(t *testing.T) { &stmt.Trait{ Position: &position.Position{ StartLine: 141, - EndLine: 141, - StartPos: 3043, - EndPos: 3054, + EndLine: 141, + StartPos: 3043, + EndPos: 3054, }, PhpDocComment: "", TraitName: &node.Identifier{ Position: &position.Position{ StartLine: 141, - EndLine: 141, - StartPos: 3049, - EndPos: 3051, + EndLine: 141, + StartPos: 3049, + EndPos: 3051, }, Value: "Foo", }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, &stmt.Class{ Position: &position.Position{ StartLine: 142, - EndLine: 142, - StartPos: 3058, - EndPos: 3079, + EndLine: 142, + StartPos: 3058, + EndPos: 3079, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 142, - EndLine: 142, - StartPos: 3064, - EndPos: 3066, + EndLine: 142, + StartPos: 3064, + EndPos: 3066, }, Value: "Foo", }, @@ -6478,25 +6416,25 @@ func TestPhp5(t *testing.T) { &stmt.TraitUse{ Position: &position.Position{ StartLine: 142, - EndLine: 142, - StartPos: 3070, - EndPos: 3077, + EndLine: 142, + StartPos: 3070, + EndPos: 3077, }, Traits: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 142, - EndLine: 142, - StartPos: 3074, - EndPos: 3076, + EndLine: 142, + StartPos: 3074, + EndPos: 3076, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 142, - EndLine: 142, - StartPos: 3074, - EndPos: 3076, + EndLine: 142, + StartPos: 3074, + EndPos: 3076, }, Value: "Bar", }, @@ -6509,17 +6447,17 @@ func TestPhp5(t *testing.T) { &stmt.Class{ Position: &position.Position{ StartLine: 143, - EndLine: 143, - StartPos: 3083, - EndPos: 3111, + EndLine: 143, + StartPos: 3083, + EndPos: 3111, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 143, - EndLine: 143, - StartPos: 3089, - EndPos: 3091, + EndLine: 143, + StartPos: 3089, + EndPos: 3091, }, Value: "Foo", }, @@ -6527,25 +6465,25 @@ func TestPhp5(t *testing.T) { &stmt.TraitUse{ Position: &position.Position{ StartLine: 143, - EndLine: 143, - StartPos: 3095, - EndPos: 3109, + EndLine: 143, + StartPos: 3095, + EndPos: 3109, }, Traits: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 143, - EndLine: 143, - StartPos: 3099, - EndPos: 3101, + EndLine: 143, + StartPos: 3099, + EndPos: 3101, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 143, - EndLine: 143, - StartPos: 3099, - EndPos: 3101, + EndLine: 143, + StartPos: 3099, + EndPos: 3101, }, Value: "Bar", }, @@ -6554,17 +6492,17 @@ func TestPhp5(t *testing.T) { &name.Name{ Position: &position.Position{ StartLine: 143, - EndLine: 143, - StartPos: 3104, - EndPos: 3106, + EndLine: 143, + StartPos: 3104, + EndPos: 3106, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 143, - EndLine: 143, - StartPos: 3104, - EndPos: 3106, + EndLine: 143, + StartPos: 3104, + EndPos: 3106, }, Value: "Baz", }, @@ -6574,9 +6512,9 @@ func TestPhp5(t *testing.T) { TraitAdaptationList: &stmt.TraitAdaptationList{ Position: &position.Position{ StartLine: 143, - EndLine: 143, - StartPos: 3108, - EndPos: 3109, + EndLine: 143, + StartPos: 3108, + EndPos: 3109, }, }, }, @@ -6585,17 +6523,17 @@ func TestPhp5(t *testing.T) { &stmt.Class{ Position: &position.Position{ StartLine: 144, - EndLine: 144, - StartPos: 3115, - EndPos: 3159, + EndLine: 144, + StartPos: 3115, + EndPos: 3159, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 144, - EndLine: 144, - StartPos: 3121, - EndPos: 3123, + EndLine: 144, + StartPos: 3121, + EndPos: 3123, }, Value: "Foo", }, @@ -6603,25 +6541,25 @@ func TestPhp5(t *testing.T) { &stmt.TraitUse{ Position: &position.Position{ StartLine: 144, - EndLine: 144, - StartPos: 3127, - EndPos: 3157, + EndLine: 144, + StartPos: 3127, + EndPos: 3157, }, Traits: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 144, - EndLine: 144, - StartPos: 3131, - EndPos: 3133, + EndLine: 144, + StartPos: 3131, + EndPos: 3133, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 144, - EndLine: 144, - StartPos: 3131, - EndPos: 3133, + EndLine: 144, + StartPos: 3131, + EndPos: 3133, }, Value: "Bar", }, @@ -6630,17 +6568,17 @@ func TestPhp5(t *testing.T) { &name.Name{ Position: &position.Position{ StartLine: 144, - EndLine: 144, - StartPos: 3136, - EndPos: 3138, + EndLine: 144, + StartPos: 3136, + EndPos: 3138, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 144, - EndLine: 144, - StartPos: 3136, - EndPos: 3138, + EndLine: 144, + StartPos: 3136, + EndPos: 3138, }, Value: "Baz", }, @@ -6650,31 +6588,31 @@ func TestPhp5(t *testing.T) { TraitAdaptationList: &stmt.TraitAdaptationList{ Position: &position.Position{ StartLine: 144, - EndLine: 144, - StartPos: 3140, - EndPos: 3157, + EndLine: 144, + StartPos: 3140, + EndPos: 3157, }, Adaptations: []node.Node{ &stmt.TraitUseAlias{ Position: &position.Position{ StartLine: 144, - EndLine: 144, - StartPos: 3142, - EndPos: 3154, + EndLine: 144, + StartPos: 3142, + EndPos: 3154, }, Ref: &stmt.TraitMethodRef{ Position: &position.Position{ StartLine: 144, - EndLine: 144, - StartPos: 3142, - EndPos: 3144, + EndLine: 144, + StartPos: 3142, + EndPos: 3144, }, Method: &node.Identifier{ Position: &position.Position{ StartLine: 144, - EndLine: 144, - StartPos: 3142, - EndPos: 3144, + EndLine: 144, + StartPos: 3142, + EndPos: 3144, }, Value: "one", }, @@ -6682,9 +6620,9 @@ func TestPhp5(t *testing.T) { Modifier: &node.Identifier{ Position: &position.Position{ StartLine: 144, - EndLine: 144, - StartPos: 3149, - EndPos: 3154, + EndLine: 144, + StartPos: 3149, + EndPos: 3154, }, Value: "public", }, @@ -6697,17 +6635,17 @@ func TestPhp5(t *testing.T) { &stmt.Class{ Position: &position.Position{ StartLine: 145, - EndLine: 145, - StartPos: 3163, - EndPos: 3211, + EndLine: 145, + StartPos: 3163, + EndPos: 3211, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 145, - EndLine: 145, - StartPos: 3169, - EndPos: 3171, + EndLine: 145, + StartPos: 3169, + EndPos: 3171, }, Value: "Foo", }, @@ -6715,25 +6653,25 @@ func TestPhp5(t *testing.T) { &stmt.TraitUse{ Position: &position.Position{ StartLine: 145, - EndLine: 145, - StartPos: 3175, - EndPos: 3209, + EndLine: 145, + StartPos: 3175, + EndPos: 3209, }, Traits: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 145, - EndLine: 145, - StartPos: 3179, - EndPos: 3181, + EndLine: 145, + StartPos: 3179, + EndPos: 3181, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 145, - EndLine: 145, - StartPos: 3179, - EndPos: 3181, + EndLine: 145, + StartPos: 3179, + EndPos: 3181, }, Value: "Bar", }, @@ -6742,17 +6680,17 @@ func TestPhp5(t *testing.T) { &name.Name{ Position: &position.Position{ StartLine: 145, - EndLine: 145, - StartPos: 3184, - EndPos: 3186, + EndLine: 145, + StartPos: 3184, + EndPos: 3186, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 145, - EndLine: 145, - StartPos: 3184, - EndPos: 3186, + EndLine: 145, + StartPos: 3184, + EndPos: 3186, }, Value: "Baz", }, @@ -6762,31 +6700,31 @@ func TestPhp5(t *testing.T) { TraitAdaptationList: &stmt.TraitAdaptationList{ Position: &position.Position{ StartLine: 145, - EndLine: 145, - StartPos: 3188, - EndPos: 3209, + EndLine: 145, + StartPos: 3188, + EndPos: 3209, }, Adaptations: []node.Node{ &stmt.TraitUseAlias{ Position: &position.Position{ StartLine: 145, - EndLine: 145, - StartPos: 3190, - EndPos: 3206, + EndLine: 145, + StartPos: 3190, + EndPos: 3206, }, Ref: &stmt.TraitMethodRef{ Position: &position.Position{ StartLine: 145, - EndLine: 145, - StartPos: 3190, - EndPos: 3192, + EndLine: 145, + StartPos: 3190, + EndPos: 3192, }, Method: &node.Identifier{ Position: &position.Position{ StartLine: 145, - EndLine: 145, - StartPos: 3190, - EndPos: 3192, + EndLine: 145, + StartPos: 3190, + EndPos: 3192, }, Value: "one", }, @@ -6794,18 +6732,18 @@ func TestPhp5(t *testing.T) { Modifier: &node.Identifier{ Position: &position.Position{ StartLine: 145, - EndLine: 145, - StartPos: 3197, - EndPos: 3202, + EndLine: 145, + StartPos: 3197, + EndPos: 3202, }, Value: "public", }, Alias: &node.Identifier{ Position: &position.Position{ StartLine: 145, - EndLine: 145, - StartPos: 3204, - EndPos: 3206, + EndLine: 145, + StartPos: 3204, + EndPos: 3206, }, Value: "two", }, @@ -6818,17 +6756,17 @@ func TestPhp5(t *testing.T) { &stmt.Class{ Position: &position.Position{ StartLine: 146, - EndLine: 146, - StartPos: 3215, - EndPos: 3291, + EndLine: 146, + StartPos: 3215, + EndPos: 3291, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 146, - EndLine: 146, - StartPos: 3221, - EndPos: 3223, + EndLine: 146, + StartPos: 3221, + EndPos: 3223, }, Value: "Foo", }, @@ -6836,25 +6774,25 @@ func TestPhp5(t *testing.T) { &stmt.TraitUse{ Position: &position.Position{ StartLine: 146, - EndLine: 146, - StartPos: 3227, - EndPos: 3289, + EndLine: 146, + StartPos: 3227, + EndPos: 3289, }, Traits: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 146, - EndLine: 146, - StartPos: 3231, - EndPos: 3233, + EndLine: 146, + StartPos: 3231, + EndPos: 3233, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 146, - EndLine: 146, - StartPos: 3231, - EndPos: 3233, + EndLine: 146, + StartPos: 3231, + EndPos: 3233, }, Value: "Bar", }, @@ -6863,17 +6801,17 @@ func TestPhp5(t *testing.T) { &name.Name{ Position: &position.Position{ StartLine: 146, - EndLine: 146, - StartPos: 3236, - EndPos: 3238, + EndLine: 146, + StartPos: 3236, + EndPos: 3238, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 146, - EndLine: 146, - StartPos: 3236, - EndPos: 3238, + EndLine: 146, + StartPos: 3236, + EndPos: 3238, }, Value: "Baz", }, @@ -6883,39 +6821,39 @@ func TestPhp5(t *testing.T) { TraitAdaptationList: &stmt.TraitAdaptationList{ Position: &position.Position{ StartLine: 146, - EndLine: 146, - StartPos: 3240, - EndPos: 3289, + EndLine: 146, + StartPos: 3240, + EndPos: 3289, }, Adaptations: []node.Node{ &stmt.TraitUsePrecedence{ Position: &position.Position{ StartLine: 146, - EndLine: 146, - StartPos: 3242, - EndPos: 3269, + EndLine: 146, + StartPos: 3242, + EndPos: 3269, }, Ref: &stmt.TraitMethodRef{ Position: &position.Position{ StartLine: 146, - EndLine: 146, - StartPos: 3242, - EndPos: 3249, + EndLine: 146, + StartPos: 3242, + EndPos: 3249, }, Trait: &name.Name{ Position: &position.Position{ StartLine: 146, - EndLine: 146, - StartPos: 3242, - EndPos: 3244, + EndLine: 146, + StartPos: 3242, + EndPos: 3244, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 146, - EndLine: 146, - StartPos: 3242, - EndPos: 3244, + EndLine: 146, + StartPos: 3242, + EndPos: 3244, }, Value: "Bar", }, @@ -6924,9 +6862,9 @@ func TestPhp5(t *testing.T) { Method: &node.Identifier{ Position: &position.Position{ StartLine: 146, - EndLine: 146, - StartPos: 3247, - EndPos: 3249, + EndLine: 146, + StartPos: 3247, + EndPos: 3249, }, Value: "one", }, @@ -6935,17 +6873,17 @@ func TestPhp5(t *testing.T) { &name.Name{ Position: &position.Position{ StartLine: 146, - EndLine: 146, - StartPos: 3261, - EndPos: 3263, + EndLine: 146, + StartPos: 3261, + EndPos: 3263, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 146, - EndLine: 146, - StartPos: 3261, - EndPos: 3263, + EndLine: 146, + StartPos: 3261, + EndPos: 3263, }, Value: "Baz", }, @@ -6954,17 +6892,17 @@ func TestPhp5(t *testing.T) { &name.Name{ Position: &position.Position{ StartLine: 146, - EndLine: 146, - StartPos: 3266, - EndPos: 3269, + EndLine: 146, + StartPos: 3266, + EndPos: 3269, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 146, - EndLine: 146, - StartPos: 3266, - EndPos: 3269, + EndLine: 146, + StartPos: 3266, + EndPos: 3269, }, Value: "Quux", }, @@ -6975,31 +6913,31 @@ func TestPhp5(t *testing.T) { &stmt.TraitUseAlias{ Position: &position.Position{ StartLine: 146, - EndLine: 146, - StartPos: 3272, - EndPos: 3286, + EndLine: 146, + StartPos: 3272, + EndPos: 3286, }, Ref: &stmt.TraitMethodRef{ Position: &position.Position{ StartLine: 146, - EndLine: 146, - StartPos: 3272, - EndPos: 3279, + EndLine: 146, + StartPos: 3272, + EndPos: 3279, }, Trait: &name.Name{ Position: &position.Position{ StartLine: 146, - EndLine: 146, - StartPos: 3272, - EndPos: 3274, + EndLine: 146, + StartPos: 3272, + EndPos: 3274, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 146, - EndLine: 146, - StartPos: 3272, - EndPos: 3274, + EndLine: 146, + StartPos: 3272, + EndPos: 3274, }, Value: "Baz", }, @@ -7008,9 +6946,9 @@ func TestPhp5(t *testing.T) { Method: &node.Identifier{ Position: &position.Position{ StartLine: 146, - EndLine: 146, - StartPos: 3277, - EndPos: 3279, + EndLine: 146, + StartPos: 3277, + EndPos: 3279, }, Value: "one", }, @@ -7018,9 +6956,9 @@ func TestPhp5(t *testing.T) { Alias: &node.Identifier{ Position: &position.Position{ StartLine: 146, - EndLine: 146, - StartPos: 3284, - EndPos: 3286, + EndLine: 146, + StartPos: 3284, + EndPos: 3286, }, Value: "two", }, @@ -7033,47 +6971,44 @@ func TestPhp5(t *testing.T) { &stmt.Try{ Position: &position.Position{ StartLine: 148, - EndLine: -1, - StartPos: 3296, - EndPos: -1, - }, - Stmts: []node.Node{ - }, - Catches: []node.Node{ + EndLine: -1, + StartPos: 3296, + EndPos: -1, }, + Stmts: []node.Node{}, + Catches: []node.Node{}, }, &stmt.Try{ Position: &position.Position{ StartLine: 149, - EndLine: 149, - StartPos: 3305, - EndPos: 3334, - }, - Stmts: []node.Node{ + EndLine: 149, + StartPos: 3305, + EndPos: 3334, }, + Stmts: []node.Node{}, Catches: []node.Node{ &stmt.Catch{ Position: &position.Position{ StartLine: 149, - EndLine: 149, - StartPos: 3312, - EndPos: 3334, + EndLine: 149, + StartPos: 3312, + EndPos: 3334, }, Types: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 149, - EndLine: 149, - StartPos: 3319, - EndPos: 3327, + EndLine: 149, + StartPos: 3319, + EndPos: 3327, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 149, - EndLine: 149, - StartPos: 3319, - EndPos: 3327, + EndLine: 149, + StartPos: 3319, + EndPos: 3327, }, Value: "Exception", }, @@ -7083,57 +7018,55 @@ func TestPhp5(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 149, - EndLine: 149, - StartPos: 3329, - EndPos: 3330, + EndLine: 149, + StartPos: 3329, + EndPos: 3330, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 149, - EndLine: 149, - StartPos: 3329, - EndPos: 3330, + EndLine: 149, + StartPos: 3329, + EndPos: 3330, }, Value: "e", }, }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, }, }, &stmt.Try{ Position: &position.Position{ StartLine: 150, - EndLine: 150, - StartPos: 3338, - EndPos: 3398, - }, - Stmts: []node.Node{ + EndLine: 150, + StartPos: 3338, + EndPos: 3398, }, + Stmts: []node.Node{}, Catches: []node.Node{ &stmt.Catch{ Position: &position.Position{ StartLine: 150, - EndLine: 150, - StartPos: 3345, - EndPos: 3367, + EndLine: 150, + StartPos: 3345, + EndPos: 3367, }, Types: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 150, - EndLine: 150, - StartPos: 3352, - EndPos: 3360, + EndLine: 150, + StartPos: 3352, + EndPos: 3360, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 150, - EndLine: 150, - StartPos: 3352, - EndPos: 3360, + EndLine: 150, + StartPos: 3352, + EndPos: 3360, }, Value: "Exception", }, @@ -7143,45 +7076,44 @@ func TestPhp5(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 150, - EndLine: 150, - StartPos: 3362, - EndPos: 3363, + EndLine: 150, + StartPos: 3362, + EndPos: 3363, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 150, - EndLine: 150, - StartPos: 3362, - EndPos: 3363, + EndLine: 150, + StartPos: 3362, + EndPos: 3363, }, Value: "e", }, }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, &stmt.Catch{ Position: &position.Position{ StartLine: 150, - EndLine: 150, - StartPos: 3369, - EndPos: 3398, + EndLine: 150, + StartPos: 3369, + EndPos: 3398, }, Types: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 150, - EndLine: 150, - StartPos: 3376, - EndPos: 3391, + EndLine: 150, + StartPos: 3376, + EndPos: 3391, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 150, - EndLine: 150, - StartPos: 3376, - EndPos: 3391, + EndLine: 150, + StartPos: 3376, + EndPos: 3391, }, Value: "RuntimeException", }, @@ -7191,57 +7123,55 @@ func TestPhp5(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 150, - EndLine: 150, - StartPos: 3393, - EndPos: 3394, + EndLine: 150, + StartPos: 3393, + EndPos: 3394, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 150, - EndLine: 150, - StartPos: 3393, - EndPos: 3394, + EndLine: 150, + StartPos: 3393, + EndPos: 3394, }, Value: "e", }, }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, }, }, &stmt.Try{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3402, - EndPos: 3505, - }, - Stmts: []node.Node{ + EndLine: 151, + StartPos: 3402, + EndPos: 3505, }, + Stmts: []node.Node{}, Catches: []node.Node{ &stmt.Catch{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3409, - EndPos: 3431, + EndLine: 151, + StartPos: 3409, + EndPos: 3431, }, Types: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3416, - EndPos: 3424, + EndLine: 151, + StartPos: 3416, + EndPos: 3424, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3416, - EndPos: 3424, + EndLine: 151, + StartPos: 3416, + EndPos: 3424, }, Value: "Exception", }, @@ -7251,45 +7181,44 @@ func TestPhp5(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3426, - EndPos: 3427, + EndLine: 151, + StartPos: 3426, + EndPos: 3427, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3426, - EndPos: 3427, + EndLine: 151, + StartPos: 3426, + EndPos: 3427, }, Value: "e", }, }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, &stmt.Catch{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3433, - EndPos: 3463, + EndLine: 151, + StartPos: 3433, + EndPos: 3463, }, Types: []node.Node{ &name.FullyQualified{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3440, - EndPos: 3456, + EndLine: 151, + StartPos: 3440, + EndPos: 3456, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3441, - EndPos: 3456, + EndLine: 151, + StartPos: 3441, + EndPos: 3456, }, Value: "RuntimeException", }, @@ -7299,45 +7228,44 @@ func TestPhp5(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3458, - EndPos: 3459, + EndLine: 151, + StartPos: 3458, + EndPos: 3459, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3458, - EndPos: 3459, + EndLine: 151, + StartPos: 3458, + EndPos: 3459, }, Value: "e", }, }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, &stmt.Catch{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3465, - EndPos: 3505, + EndLine: 151, + StartPos: 3465, + EndPos: 3505, }, Types: []node.Node{ &name.Relative{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3472, - EndPos: 3498, + EndLine: 151, + StartPos: 3472, + EndPos: 3498, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3482, - EndPos: 3498, + EndLine: 151, + StartPos: 3482, + EndPos: 3498, }, Value: "AdditionException", }, @@ -7347,57 +7275,55 @@ func TestPhp5(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3500, - EndPos: 3501, + EndLine: 151, + StartPos: 3500, + EndPos: 3501, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3500, - EndPos: 3501, + EndLine: 151, + StartPos: 3500, + EndPos: 3501, }, Value: "e", }, }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, }, }, &stmt.Try{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3509, - EndPos: 3549, - }, - Stmts: []node.Node{ + EndLine: 152, + StartPos: 3509, + EndPos: 3549, }, + Stmts: []node.Node{}, Catches: []node.Node{ &stmt.Catch{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3516, - EndPos: 3538, + EndLine: 152, + StartPos: 3516, + EndPos: 3538, }, Types: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3523, - EndPos: 3531, + EndLine: 152, + StartPos: 3523, + EndPos: 3531, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3523, - EndPos: 3531, + EndLine: 152, + StartPos: 3523, + EndPos: 3531, }, Value: "Exception", }, @@ -7407,56 +7333,54 @@ func TestPhp5(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3533, - EndPos: 3534, + EndLine: 152, + StartPos: 3533, + EndPos: 3534, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3533, - EndPos: 3534, + EndLine: 152, + StartPos: 3533, + EndPos: 3534, }, Value: "e", }, }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, }, Finally: &stmt.Finally{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3540, - EndPos: 3549, - }, - Stmts: []node.Node{ + EndLine: 152, + StartPos: 3540, + EndPos: 3549, }, + Stmts: []node.Node{}, }, }, &stmt.Unset{ Position: &position.Position{ StartLine: 154, - EndLine: 154, - StartPos: 3554, - EndPos: 3567, + EndLine: 154, + StartPos: 3554, + EndPos: 3567, }, Vars: []node.Node{ &expr.Variable{ Position: &position.Position{ StartLine: 154, - EndLine: 154, - StartPos: 3560, - EndPos: 3561, + EndLine: 154, + StartPos: 3560, + EndPos: 3561, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 154, - EndLine: 154, - StartPos: 3560, - EndPos: 3561, + EndLine: 154, + StartPos: 3560, + EndPos: 3561, }, Value: "a", }, @@ -7464,16 +7388,16 @@ func TestPhp5(t *testing.T) { &expr.Variable{ Position: &position.Position{ StartLine: 154, - EndLine: 154, - StartPos: 3564, - EndPos: 3565, + EndLine: 154, + StartPos: 3564, + EndPos: 3565, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 154, - EndLine: 154, - StartPos: 3564, - EndPos: 3565, + EndLine: 154, + StartPos: 3564, + EndPos: 3565, }, Value: "b", }, @@ -7483,32 +7407,32 @@ func TestPhp5(t *testing.T) { &stmt.UseList{ Position: &position.Position{ StartLine: 156, - EndLine: 156, - StartPos: 3572, - EndPos: 3579, + EndLine: 156, + StartPos: 3572, + EndPos: 3579, }, Uses: []node.Node{ &stmt.Use{ Position: &position.Position{ StartLine: 156, - EndLine: 156, - StartPos: 3576, - EndPos: 3578, + EndLine: 156, + StartPos: 3576, + EndPos: 3578, }, Use: &name.Name{ Position: &position.Position{ StartLine: 156, - EndLine: 156, - StartPos: 3576, - EndPos: 3578, + EndLine: 156, + StartPos: 3576, + EndPos: 3578, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 156, - EndLine: 156, - StartPos: 3576, - EndPos: 3578, + EndLine: 156, + StartPos: 3576, + EndPos: 3578, }, Value: "Foo", }, @@ -7520,32 +7444,32 @@ func TestPhp5(t *testing.T) { &stmt.UseList{ Position: &position.Position{ StartLine: 157, - EndLine: 157, - StartPos: 3583, - EndPos: 3591, + EndLine: 157, + StartPos: 3583, + EndPos: 3591, }, Uses: []node.Node{ &stmt.Use{ Position: &position.Position{ StartLine: 157, - EndLine: 157, - StartPos: 3588, - EndPos: 3590, + EndLine: 157, + StartPos: 3588, + EndPos: 3590, }, Use: &name.Name{ Position: &position.Position{ StartLine: 157, - EndLine: 157, - StartPos: 3588, - EndPos: 3590, + EndLine: 157, + StartPos: 3588, + EndPos: 3590, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 157, - EndLine: 157, - StartPos: 3588, - EndPos: 3590, + EndLine: 157, + StartPos: 3588, + EndPos: 3590, }, Value: "Foo", }, @@ -7557,32 +7481,32 @@ func TestPhp5(t *testing.T) { &stmt.UseList{ Position: &position.Position{ StartLine: 158, - EndLine: 158, - StartPos: 3595, - EndPos: 3610, + EndLine: 158, + StartPos: 3595, + EndPos: 3610, }, Uses: []node.Node{ &stmt.Use{ Position: &position.Position{ StartLine: 158, - EndLine: 158, - StartPos: 3600, - EndPos: 3609, + EndLine: 158, + StartPos: 3600, + EndPos: 3609, }, Use: &name.Name{ Position: &position.Position{ StartLine: 158, - EndLine: 158, - StartPos: 3600, - EndPos: 3602, + EndLine: 158, + StartPos: 3600, + EndPos: 3602, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 158, - EndLine: 158, - StartPos: 3600, - EndPos: 3602, + EndLine: 158, + StartPos: 3600, + EndPos: 3602, }, Value: "Foo", }, @@ -7591,9 +7515,9 @@ func TestPhp5(t *testing.T) { Alias: &node.Identifier{ Position: &position.Position{ StartLine: 158, - EndLine: 158, - StartPos: 3607, - EndPos: 3609, + EndLine: 158, + StartPos: 3607, + EndPos: 3609, }, Value: "Bar", }, @@ -7603,32 +7527,32 @@ func TestPhp5(t *testing.T) { &stmt.UseList{ Position: &position.Position{ StartLine: 159, - EndLine: 159, - StartPos: 3614, - EndPos: 3626, + EndLine: 159, + StartPos: 3614, + EndPos: 3626, }, Uses: []node.Node{ &stmt.Use{ Position: &position.Position{ StartLine: 159, - EndLine: 159, - StartPos: 3618, - EndPos: 3620, + EndLine: 159, + StartPos: 3618, + EndPos: 3620, }, Use: &name.Name{ Position: &position.Position{ StartLine: 159, - EndLine: 159, - StartPos: 3618, - EndPos: 3620, + EndLine: 159, + StartPos: 3618, + EndPos: 3620, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 159, - EndLine: 159, - StartPos: 3618, - EndPos: 3620, + EndLine: 159, + StartPos: 3618, + EndPos: 3620, }, Value: "Foo", }, @@ -7638,24 +7562,24 @@ func TestPhp5(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 159, - EndLine: 159, - StartPos: 3623, - EndPos: 3625, + EndLine: 159, + StartPos: 3623, + EndPos: 3625, }, Use: &name.Name{ Position: &position.Position{ StartLine: 159, - EndLine: 159, - StartPos: 3623, - EndPos: 3625, + EndLine: 159, + StartPos: 3623, + EndPos: 3625, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 159, - EndLine: 159, - StartPos: 3623, - EndPos: 3625, + EndLine: 159, + StartPos: 3623, + EndPos: 3625, }, Value: "Bar", }, @@ -7667,32 +7591,32 @@ func TestPhp5(t *testing.T) { &stmt.UseList{ Position: &position.Position{ StartLine: 160, - EndLine: 160, - StartPos: 3630, - EndPos: 3649, + EndLine: 160, + StartPos: 3630, + EndPos: 3649, }, Uses: []node.Node{ &stmt.Use{ Position: &position.Position{ StartLine: 160, - EndLine: 160, - StartPos: 3634, - EndPos: 3636, + EndLine: 160, + StartPos: 3634, + EndPos: 3636, }, Use: &name.Name{ Position: &position.Position{ StartLine: 160, - EndLine: 160, - StartPos: 3634, - EndPos: 3636, + EndLine: 160, + StartPos: 3634, + EndPos: 3636, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 160, - EndLine: 160, - StartPos: 3634, - EndPos: 3636, + EndLine: 160, + StartPos: 3634, + EndPos: 3636, }, Value: "Foo", }, @@ -7702,24 +7626,24 @@ func TestPhp5(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 160, - EndLine: 160, - StartPos: 3639, - EndPos: 3648, + EndLine: 160, + StartPos: 3639, + EndPos: 3648, }, Use: &name.Name{ Position: &position.Position{ StartLine: 160, - EndLine: 160, - StartPos: 3639, - EndPos: 3641, + EndLine: 160, + StartPos: 3639, + EndPos: 3641, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 160, - EndLine: 160, - StartPos: 3639, - EndPos: 3641, + EndLine: 160, + StartPos: 3639, + EndPos: 3641, }, Value: "Bar", }, @@ -7728,9 +7652,9 @@ func TestPhp5(t *testing.T) { Alias: &node.Identifier{ Position: &position.Position{ StartLine: 160, - EndLine: 160, - StartPos: 3646, - EndPos: 3648, + EndLine: 160, + StartPos: 3646, + EndPos: 3648, }, Value: "Baz", }, @@ -7740,16 +7664,16 @@ func TestPhp5(t *testing.T) { &stmt.UseList{ Position: &position.Position{ StartLine: 161, - EndLine: 161, - StartPos: 3653, - EndPos: 3675, + EndLine: 161, + StartPos: 3653, + EndPos: 3675, }, UseType: &node.Identifier{ Position: &position.Position{ StartLine: 161, - EndLine: 161, - StartPos: 3657, - EndPos: 3664, + EndLine: 161, + StartPos: 3657, + EndPos: 3664, }, Value: "function", }, @@ -7757,24 +7681,24 @@ func TestPhp5(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 161, - EndLine: 161, - StartPos: 3666, - EndPos: 3668, + EndLine: 161, + StartPos: 3666, + EndPos: 3668, }, Use: &name.Name{ Position: &position.Position{ StartLine: 161, - EndLine: 161, - StartPos: 3666, - EndPos: 3668, + EndLine: 161, + StartPos: 3666, + EndPos: 3668, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 161, - EndLine: 161, - StartPos: 3666, - EndPos: 3668, + EndLine: 161, + StartPos: 3666, + EndPos: 3668, }, Value: "Foo", }, @@ -7784,24 +7708,24 @@ func TestPhp5(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 161, - EndLine: 161, - StartPos: 3672, - EndPos: 3674, + EndLine: 161, + StartPos: 3672, + EndPos: 3674, }, Use: &name.Name{ Position: &position.Position{ StartLine: 161, - EndLine: 161, - StartPos: 3672, - EndPos: 3674, + EndLine: 161, + StartPos: 3672, + EndPos: 3674, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 161, - EndLine: 161, - StartPos: 3672, - EndPos: 3674, + EndLine: 161, + StartPos: 3672, + EndPos: 3674, }, Value: "Bar", }, @@ -7813,16 +7737,16 @@ func TestPhp5(t *testing.T) { &stmt.UseList{ Position: &position.Position{ StartLine: 162, - EndLine: 162, - StartPos: 3679, - EndPos: 3715, + EndLine: 162, + StartPos: 3679, + EndPos: 3715, }, UseType: &node.Identifier{ Position: &position.Position{ StartLine: 162, - EndLine: 162, - StartPos: 3683, - EndPos: 3690, + EndLine: 162, + StartPos: 3683, + EndPos: 3690, }, Value: "function", }, @@ -7830,24 +7754,24 @@ func TestPhp5(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 162, - EndLine: 162, - StartPos: 3692, - EndPos: 3701, + EndLine: 162, + StartPos: 3692, + EndPos: 3701, }, Use: &name.Name{ Position: &position.Position{ StartLine: 162, - EndLine: 162, - StartPos: 3692, - EndPos: 3694, + EndLine: 162, + StartPos: 3692, + EndPos: 3694, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 162, - EndLine: 162, - StartPos: 3692, - EndPos: 3694, + EndLine: 162, + StartPos: 3692, + EndPos: 3694, }, Value: "Foo", }, @@ -7856,9 +7780,9 @@ func TestPhp5(t *testing.T) { Alias: &node.Identifier{ Position: &position.Position{ StartLine: 162, - EndLine: 162, - StartPos: 3699, - EndPos: 3701, + EndLine: 162, + StartPos: 3699, + EndPos: 3701, }, Value: "foo", }, @@ -7866,24 +7790,24 @@ func TestPhp5(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 162, - EndLine: 162, - StartPos: 3705, - EndPos: 3714, + EndLine: 162, + StartPos: 3705, + EndPos: 3714, }, Use: &name.Name{ Position: &position.Position{ StartLine: 162, - EndLine: 162, - StartPos: 3705, - EndPos: 3707, + EndLine: 162, + StartPos: 3705, + EndPos: 3707, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 162, - EndLine: 162, - StartPos: 3705, - EndPos: 3707, + EndLine: 162, + StartPos: 3705, + EndPos: 3707, }, Value: "Bar", }, @@ -7892,9 +7816,9 @@ func TestPhp5(t *testing.T) { Alias: &node.Identifier{ Position: &position.Position{ StartLine: 162, - EndLine: 162, - StartPos: 3712, - EndPos: 3714, + EndLine: 162, + StartPos: 3712, + EndPos: 3714, }, Value: "bar", }, @@ -7904,16 +7828,16 @@ func TestPhp5(t *testing.T) { &stmt.UseList{ Position: &position.Position{ StartLine: 163, - EndLine: 163, - StartPos: 3719, - EndPos: 3738, + EndLine: 163, + StartPos: 3719, + EndPos: 3738, }, UseType: &node.Identifier{ Position: &position.Position{ StartLine: 163, - EndLine: 163, - StartPos: 3723, - EndPos: 3727, + EndLine: 163, + StartPos: 3723, + EndPos: 3727, }, Value: "const", }, @@ -7921,24 +7845,24 @@ func TestPhp5(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 163, - EndLine: 163, - StartPos: 3729, - EndPos: 3731, + EndLine: 163, + StartPos: 3729, + EndPos: 3731, }, Use: &name.Name{ Position: &position.Position{ StartLine: 163, - EndLine: 163, - StartPos: 3729, - EndPos: 3731, + EndLine: 163, + StartPos: 3729, + EndPos: 3731, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 163, - EndLine: 163, - StartPos: 3729, - EndPos: 3731, + EndLine: 163, + StartPos: 3729, + EndPos: 3731, }, Value: "Foo", }, @@ -7948,24 +7872,24 @@ func TestPhp5(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 163, - EndLine: 163, - StartPos: 3735, - EndPos: 3737, + EndLine: 163, + StartPos: 3735, + EndPos: 3737, }, Use: &name.Name{ Position: &position.Position{ StartLine: 163, - EndLine: 163, - StartPos: 3735, - EndPos: 3737, + EndLine: 163, + StartPos: 3735, + EndPos: 3737, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 163, - EndLine: 163, - StartPos: 3735, - EndPos: 3737, + EndLine: 163, + StartPos: 3735, + EndPos: 3737, }, Value: "Bar", }, @@ -7977,16 +7901,16 @@ func TestPhp5(t *testing.T) { &stmt.UseList{ Position: &position.Position{ StartLine: 164, - EndLine: 164, - StartPos: 3742, - EndPos: 3775, + EndLine: 164, + StartPos: 3742, + EndPos: 3775, }, UseType: &node.Identifier{ Position: &position.Position{ StartLine: 164, - EndLine: 164, - StartPos: 3746, - EndPos: 3750, + EndLine: 164, + StartPos: 3746, + EndPos: 3750, }, Value: "const", }, @@ -7994,24 +7918,24 @@ func TestPhp5(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 164, - EndLine: 164, - StartPos: 3752, - EndPos: 3761, + EndLine: 164, + StartPos: 3752, + EndPos: 3761, }, Use: &name.Name{ Position: &position.Position{ StartLine: 164, - EndLine: 164, - StartPos: 3752, - EndPos: 3754, + EndLine: 164, + StartPos: 3752, + EndPos: 3754, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 164, - EndLine: 164, - StartPos: 3752, - EndPos: 3754, + EndLine: 164, + StartPos: 3752, + EndPos: 3754, }, Value: "Foo", }, @@ -8020,9 +7944,9 @@ func TestPhp5(t *testing.T) { Alias: &node.Identifier{ Position: &position.Position{ StartLine: 164, - EndLine: 164, - StartPos: 3759, - EndPos: 3761, + EndLine: 164, + StartPos: 3759, + EndPos: 3761, }, Value: "foo", }, @@ -8030,24 +7954,24 @@ func TestPhp5(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 164, - EndLine: 164, - StartPos: 3765, - EndPos: 3774, + EndLine: 164, + StartPos: 3765, + EndPos: 3774, }, Use: &name.Name{ Position: &position.Position{ StartLine: 164, - EndLine: 164, - StartPos: 3765, - EndPos: 3767, + EndLine: 164, + StartPos: 3765, + EndPos: 3767, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 164, - EndLine: 164, - StartPos: 3765, - EndPos: 3767, + EndLine: 164, + StartPos: 3765, + EndPos: 3767, }, Value: "Bar", }, @@ -8056,9 +7980,9 @@ func TestPhp5(t *testing.T) { Alias: &node.Identifier{ Position: &position.Position{ StartLine: 164, - EndLine: 164, - StartPos: 3772, - EndPos: 3774, + EndLine: 164, + StartPos: 3772, + EndPos: 3774, }, Value: "bar", }, @@ -8068,30 +7992,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 166, - EndLine: 166, - StartPos: 3780, - EndPos: 3785, + EndLine: 166, + StartPos: 3780, + EndPos: 3785, }, Expr: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 166, - EndLine: 166, - StartPos: 3780, - EndPos: 3784, + EndLine: 166, + StartPos: 3780, + EndPos: 3784, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 166, - EndLine: 166, - StartPos: 3780, - EndPos: 3781, + EndLine: 166, + StartPos: 3780, + EndPos: 3781, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 166, - EndLine: 166, - StartPos: 3780, - EndPos: 3781, + EndLine: 166, + StartPos: 3780, + EndPos: 3781, }, Value: "a", }, @@ -8099,9 +8023,9 @@ func TestPhp5(t *testing.T) { Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 166, - EndLine: 166, - StartPos: 3783, - EndPos: 3783, + EndLine: 166, + StartPos: 3783, + EndPos: 3783, }, Value: "1", }, @@ -8110,37 +8034,37 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 167, - EndLine: 167, - StartPos: 3789, - EndPos: 3797, + EndLine: 167, + StartPos: 3789, + EndPos: 3797, }, Expr: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 167, - EndLine: 167, - StartPos: 3789, - EndPos: 3796, + EndLine: 167, + StartPos: 3789, + EndPos: 3796, }, Variable: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 167, - EndLine: 167, - StartPos: 3789, - EndPos: 3793, + EndLine: 167, + StartPos: 3789, + EndPos: 3793, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 167, - EndLine: 167, - StartPos: 3789, - EndPos: 3790, + EndLine: 167, + StartPos: 3789, + EndPos: 3790, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 167, - EndLine: 167, - StartPos: 3789, - EndPos: 3790, + EndLine: 167, + StartPos: 3789, + EndPos: 3790, }, Value: "a", }, @@ -8148,9 +8072,9 @@ func TestPhp5(t *testing.T) { Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 167, - EndLine: 167, - StartPos: 3792, - EndPos: 3792, + EndLine: 167, + StartPos: 3792, + EndPos: 3792, }, Value: "1", }, @@ -8158,9 +8082,9 @@ func TestPhp5(t *testing.T) { Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 167, - EndLine: 167, - StartPos: 3795, - EndPos: 3795, + EndLine: 167, + StartPos: 3795, + EndPos: 3795, }, Value: "2", }, @@ -8169,49 +8093,48 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 168, - EndLine: 168, - StartPos: 3801, - EndPos: 3808, + EndLine: 168, + StartPos: 3801, + EndPos: 3808, }, Expr: &expr.Array{ Position: &position.Position{ StartLine: 168, - EndLine: 168, - StartPos: 3801, - EndPos: 3807, - }, - Items: []node.Node{ + EndLine: 168, + StartPos: 3801, + EndPos: 3807, }, + Items: []node.Node{}, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 169, - EndLine: 169, - StartPos: 3812, - EndPos: 3820, + EndLine: 169, + StartPos: 3812, + EndPos: 3820, }, Expr: &expr.Array{ Position: &position.Position{ StartLine: 169, - EndLine: 169, - StartPos: 3812, - EndPos: 3819, + EndLine: 169, + StartPos: 3812, + EndPos: 3819, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 169, - EndLine: 169, - StartPos: 3818, - EndPos: 3818, + EndLine: 169, + StartPos: 3818, + EndPos: 3818, }, Val: &scalar.Lnumber{ Position: &position.Position{ StartLine: 169, - EndLine: 169, - StartPos: 3818, - EndPos: 3818, + EndLine: 169, + StartPos: 3818, + EndPos: 3818, }, Value: "1", }, @@ -8222,40 +8145,40 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 170, - EndLine: 170, - StartPos: 3824, - EndPos: 3841, + EndLine: 170, + StartPos: 3824, + EndPos: 3841, }, Expr: &expr.Array{ Position: &position.Position{ StartLine: 170, - EndLine: 170, - StartPos: 3824, - EndPos: 3840, + EndLine: 170, + StartPos: 3824, + EndPos: 3840, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 170, - EndLine: 170, - StartPos: 3830, - EndPos: 3833, + EndLine: 170, + StartPos: 3830, + EndPos: 3833, }, Key: &scalar.Lnumber{ Position: &position.Position{ StartLine: 170, - EndLine: 170, - StartPos: 3830, - EndPos: 3830, + EndLine: 170, + StartPos: 3830, + EndPos: 3830, }, Value: "1", }, Val: &scalar.Lnumber{ Position: &position.Position{ StartLine: 170, - EndLine: 170, - StartPos: 3833, - EndPos: 3833, + EndLine: 170, + StartPos: 3833, + EndPos: 3833, }, Value: "1", }, @@ -8263,92 +8186,91 @@ func TestPhp5(t *testing.T) { &expr.ArrayItem{ Position: &position.Position{ StartLine: 170, - EndLine: 170, - StartPos: 3836, - EndPos: 3838, + EndLine: 170, + StartPos: 3836, + EndPos: 3838, }, Val: &expr.Reference{ Position: &position.Position{ StartLine: 170, - EndLine: 170, - StartPos: 3836, - EndPos: 3838, + EndLine: 170, + StartPos: 3836, + EndPos: 3838, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 170, - EndLine: 170, - StartPos: 3837, - EndPos: 3838, + EndLine: 170, + StartPos: 3837, + EndPos: 3838, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 170, - EndLine: 170, - StartPos: 3837, - EndPos: 3838, + EndLine: 170, + StartPos: 3837, + EndPos: 3838, }, Value: "b", }, }, }, }, - &expr.ArrayItem{ - }, + &expr.ArrayItem{}, }, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 171, - EndLine: 171, - StartPos: 3845, - EndPos: 3859, + EndLine: 171, + StartPos: 3845, + EndPos: 3859, }, Expr: &expr.Array{ Position: &position.Position{ StartLine: 171, - EndLine: 171, - StartPos: 3845, - EndPos: 3858, + EndLine: 171, + StartPos: 3845, + EndPos: 3858, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 171, - EndLine: 171, - StartPos: 3851, - EndPos: 3857, + EndLine: 171, + StartPos: 3851, + EndPos: 3857, }, Key: &scalar.Lnumber{ Position: &position.Position{ StartLine: 171, - EndLine: 171, - StartPos: 3851, - EndPos: 3851, + EndLine: 171, + StartPos: 3851, + EndPos: 3851, }, Value: "3", }, Val: &expr.Reference{ Position: &position.Position{ StartLine: 171, - EndLine: 171, - StartPos: 3855, - EndPos: 3857, + EndLine: 171, + StartPos: 3855, + EndPos: 3857, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 171, - EndLine: 171, - StartPos: 3856, - EndPos: 3857, + EndLine: 171, + StartPos: 3856, + EndPos: 3857, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 171, - EndLine: 171, - StartPos: 3856, - EndPos: 3857, + EndLine: 171, + StartPos: 3856, + EndPos: 3857, }, Value: "b", }, @@ -8361,45 +8283,45 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 172, - EndLine: 172, - StartPos: 3863, - EndPos: 3891, + EndLine: 172, + StartPos: 3863, + EndPos: 3891, }, Expr: &expr.Array{ Position: &position.Position{ StartLine: 172, - EndLine: 172, - StartPos: 3863, - EndPos: 3890, + EndLine: 172, + StartPos: 3863, + EndPos: 3890, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 172, - EndLine: 172, - StartPos: 3869, - EndPos: 3871, + EndLine: 172, + StartPos: 3869, + EndPos: 3871, }, Val: &expr.Reference{ Position: &position.Position{ StartLine: 172, - EndLine: 172, - StartPos: 3869, - EndPos: 3871, + EndLine: 172, + StartPos: 3869, + EndPos: 3871, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 172, - EndLine: 172, - StartPos: 3870, - EndPos: 3871, + EndLine: 172, + StartPos: 3870, + EndPos: 3871, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 172, - EndLine: 172, - StartPos: 3870, - EndPos: 3871, + EndLine: 172, + StartPos: 3870, + EndPos: 3871, }, Value: "b", }, @@ -8409,25 +8331,25 @@ func TestPhp5(t *testing.T) { &expr.ArrayItem{ Position: &position.Position{ StartLine: 172, - EndLine: 172, - StartPos: 3874, - EndPos: 3877, + EndLine: 172, + StartPos: 3874, + EndPos: 3877, }, Key: &scalar.Lnumber{ Position: &position.Position{ StartLine: 172, - EndLine: 172, - StartPos: 3874, - EndPos: 3874, + EndLine: 172, + StartPos: 3874, + EndPos: 3874, }, Value: "1", }, Val: &scalar.Lnumber{ Position: &position.Position{ StartLine: 172, - EndLine: 172, - StartPos: 3877, - EndPos: 3877, + EndLine: 172, + StartPos: 3877, + EndPos: 3877, }, Value: "1", }, @@ -8435,16 +8357,16 @@ func TestPhp5(t *testing.T) { &expr.ArrayItem{ Position: &position.Position{ StartLine: 172, - EndLine: 172, - StartPos: 3880, - EndPos: 3880, + EndLine: 172, + StartPos: 3880, + EndPos: 3880, }, Val: &scalar.Lnumber{ Position: &position.Position{ StartLine: 172, - EndLine: 172, - StartPos: 3880, - EndPos: 3880, + EndLine: 172, + StartPos: 3880, + EndPos: 3880, }, Value: "1", }, @@ -8452,39 +8374,39 @@ func TestPhp5(t *testing.T) { &expr.ArrayItem{ Position: &position.Position{ StartLine: 172, - EndLine: 172, - StartPos: 3883, - EndPos: 3889, + EndLine: 172, + StartPos: 3883, + EndPos: 3889, }, Key: &scalar.Lnumber{ Position: &position.Position{ StartLine: 172, - EndLine: 172, - StartPos: 3883, - EndPos: 3883, + EndLine: 172, + StartPos: 3883, + EndPos: 3883, }, Value: "3", }, Val: &expr.Reference{ Position: &position.Position{ StartLine: 172, - EndLine: 172, - StartPos: 3887, - EndPos: 3889, + EndLine: 172, + StartPos: 3887, + EndPos: 3889, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 172, - EndLine: 172, - StartPos: 3888, - EndPos: 3889, + EndLine: 172, + StartPos: 3888, + EndPos: 3889, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 172, - EndLine: 172, - StartPos: 3888, - EndPos: 3889, + EndLine: 172, + StartPos: 3888, + EndPos: 3889, }, Value: "b", }, @@ -8497,30 +8419,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 173, - EndLine: 173, - StartPos: 3895, - EndPos: 3898, + EndLine: 173, + StartPos: 3895, + EndPos: 3898, }, Expr: &expr.BitwiseNot{ Position: &position.Position{ StartLine: 173, - EndLine: 173, - StartPos: 3895, - EndPos: 3897, + EndLine: 173, + StartPos: 3895, + EndPos: 3897, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 173, - EndLine: 173, - StartPos: 3896, - EndPos: 3897, + EndLine: 173, + StartPos: 3896, + EndPos: 3897, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 173, - EndLine: 173, - StartPos: 3896, - EndPos: 3897, + EndLine: 173, + StartPos: 3896, + EndPos: 3897, }, Value: "a", }, @@ -8530,30 +8452,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 174, - EndLine: 174, - StartPos: 3902, - EndPos: 3905, + EndLine: 174, + StartPos: 3902, + EndPos: 3905, }, Expr: &expr.BooleanNot{ Position: &position.Position{ StartLine: 174, - EndLine: 174, - StartPos: 3902, - EndPos: 3904, + EndLine: 174, + StartPos: 3902, + EndPos: 3904, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 174, - EndLine: 174, - StartPos: 3903, - EndPos: 3904, + EndLine: 174, + StartPos: 3903, + EndPos: 3904, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 174, - EndLine: 174, - StartPos: 3903, - EndPos: 3904, + EndLine: 174, + StartPos: 3903, + EndPos: 3904, }, Value: "a", }, @@ -8563,31 +8485,31 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 176, - EndLine: 176, - StartPos: 3910, - EndPos: 3918, + EndLine: 176, + StartPos: 3910, + EndPos: 3918, }, Expr: &expr.ClassConstFetch{ Position: &position.Position{ StartLine: 176, - EndLine: 176, - StartPos: 3910, - EndPos: 3917, + EndLine: 176, + StartPos: 3910, + EndPos: 3917, }, Class: &name.Name{ Position: &position.Position{ StartLine: 176, - EndLine: 176, - StartPos: 3910, - EndPos: 3912, + EndLine: 176, + StartPos: 3910, + EndPos: 3912, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 176, - EndLine: 176, - StartPos: 3910, - EndPos: 3912, + EndLine: 176, + StartPos: 3910, + EndPos: 3912, }, Value: "Foo", }, @@ -8596,9 +8518,9 @@ func TestPhp5(t *testing.T) { ConstantName: &node.Identifier{ Position: &position.Position{ StartLine: 176, - EndLine: 176, - StartPos: 3915, - EndPos: 3917, + EndLine: 176, + StartPos: 3915, + EndPos: 3917, }, Value: "Bar", }, @@ -8607,30 +8529,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 177, - EndLine: 177, - StartPos: 3922, - EndPos: 3931, + EndLine: 177, + StartPos: 3922, + EndPos: 3931, }, Expr: &expr.Clone{ Position: &position.Position{ StartLine: 177, - EndLine: 177, - StartPos: 3922, - EndPos: 3929, + EndLine: 177, + StartPos: 3922, + EndPos: 3929, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 177, - EndLine: 177, - StartPos: 3928, - EndPos: 3929, + EndLine: 177, + StartPos: 3928, + EndPos: 3929, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 177, - EndLine: 177, - StartPos: 3928, - EndPos: 3929, + EndLine: 177, + StartPos: 3928, + EndPos: 3929, }, Value: "a", }, @@ -8640,30 +8562,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 178, - EndLine: 178, - StartPos: 3935, - EndPos: 3943, + EndLine: 178, + StartPos: 3935, + EndPos: 3943, }, Expr: &expr.Clone{ Position: &position.Position{ StartLine: 178, - EndLine: 178, - StartPos: 3935, - EndPos: 3942, + EndLine: 178, + StartPos: 3935, + EndPos: 3942, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 178, - EndLine: 178, - StartPos: 3941, - EndPos: 3942, + EndLine: 178, + StartPos: 3941, + EndPos: 3942, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 178, - EndLine: 178, - StartPos: 3941, - EndPos: 3942, + EndLine: 178, + StartPos: 3941, + EndPos: 3942, }, Value: "a", }, @@ -8673,64 +8595,63 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 179, - EndLine: 179, - StartPos: 3947, - EndPos: 3959, + EndLine: 179, + StartPos: 3947, + EndPos: 3959, }, Expr: &expr.Closure{ Position: &position.Position{ StartLine: 179, - EndLine: 179, - StartPos: 3947, - EndPos: 3958, + EndLine: 179, + StartPos: 3947, + EndPos: 3958, }, - ReturnsRef: false, - Static: false, + ReturnsRef: false, + Static: false, PhpDocComment: "", - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 180, - EndLine: 180, - StartPos: 3963, - EndPos: 3996, + EndLine: 180, + StartPos: 3963, + EndPos: 3996, }, Expr: &expr.Closure{ Position: &position.Position{ StartLine: 180, - EndLine: 180, - StartPos: 3963, - EndPos: 3995, + EndLine: 180, + StartPos: 3963, + EndPos: 3995, }, - ReturnsRef: false, - Static: false, + ReturnsRef: false, + Static: false, PhpDocComment: "", Params: []node.Node{ &node.Parameter{ Position: &position.Position{ StartLine: 180, - EndLine: 180, - StartPos: 3972, - EndPos: 3973, + EndLine: 180, + StartPos: 3972, + EndPos: 3973, }, - ByRef: false, + ByRef: false, Variadic: false, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 180, - EndLine: 180, - StartPos: 3972, - EndPos: 3973, + EndLine: 180, + StartPos: 3972, + EndPos: 3973, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 180, - EndLine: 180, - StartPos: 3972, - EndPos: 3973, + EndLine: 180, + StartPos: 3972, + EndPos: 3973, }, Value: "a", }, @@ -8739,25 +8660,25 @@ func TestPhp5(t *testing.T) { &node.Parameter{ Position: &position.Position{ StartLine: 180, - EndLine: 180, - StartPos: 3976, - EndPos: 3977, + EndLine: 180, + StartPos: 3976, + EndPos: 3977, }, - ByRef: false, + ByRef: false, Variadic: false, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 180, - EndLine: 180, - StartPos: 3976, - EndPos: 3977, + EndLine: 180, + StartPos: 3976, + EndPos: 3977, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 180, - EndLine: 180, - StartPos: 3976, - EndPos: 3977, + EndLine: 180, + StartPos: 3976, + EndPos: 3977, }, Value: "b", }, @@ -8767,24 +8688,24 @@ func TestPhp5(t *testing.T) { ClosureUse: &expr.ClosureUse{ Position: &position.Position{ StartLine: 180, - EndLine: 180, - StartPos: 3980, - EndPos: 3992, + EndLine: 180, + StartPos: 3980, + EndPos: 3992, }, Uses: []node.Node{ &expr.Variable{ Position: &position.Position{ StartLine: 180, - EndLine: 180, - StartPos: 3985, - EndPos: 3986, + EndLine: 180, + StartPos: 3985, + EndPos: 3986, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 180, - EndLine: 180, - StartPos: 3985, - EndPos: 3986, + EndLine: 180, + StartPos: 3985, + EndPos: 3986, }, Value: "c", }, @@ -8792,23 +8713,23 @@ func TestPhp5(t *testing.T) { &expr.Reference{ Position: &position.Position{ StartLine: 180, - EndLine: 180, - StartPos: 3989, - EndPos: 3991, + EndLine: 180, + StartPos: 3989, + EndPos: 3991, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 180, - EndLine: 180, - StartPos: 3990, - EndPos: 3991, + EndLine: 180, + StartPos: 3990, + EndPos: 3991, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 180, - EndLine: 180, - StartPos: 3990, - EndPos: 3991, + EndLine: 180, + StartPos: 3990, + EndPos: 3991, }, Value: "d", }, @@ -8816,50 +8737,49 @@ func TestPhp5(t *testing.T) { }, }, }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 181, - EndLine: 181, - StartPos: 4000, - EndPos: 4033, + EndLine: 181, + StartPos: 4000, + EndPos: 4033, }, Expr: &expr.Closure{ Position: &position.Position{ StartLine: 181, - EndLine: 181, - StartPos: 4000, - EndPos: 4032, + EndLine: 181, + StartPos: 4000, + EndPos: 4032, }, - ReturnsRef: false, - Static: false, + ReturnsRef: false, + Static: false, PhpDocComment: "", Params: []node.Node{ &node.Parameter{ Position: &position.Position{ StartLine: 181, - EndLine: 181, - StartPos: 4009, - EndPos: 4010, + EndLine: 181, + StartPos: 4009, + EndPos: 4010, }, - ByRef: false, + ByRef: false, Variadic: false, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 181, - EndLine: 181, - StartPos: 4009, - EndPos: 4010, + EndLine: 181, + StartPos: 4009, + EndPos: 4010, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 181, - EndLine: 181, - StartPos: 4009, - EndPos: 4010, + EndLine: 181, + StartPos: 4009, + EndPos: 4010, }, Value: "a", }, @@ -8868,25 +8788,25 @@ func TestPhp5(t *testing.T) { &node.Parameter{ Position: &position.Position{ StartLine: 181, - EndLine: 181, - StartPos: 4013, - EndPos: 4014, + EndLine: 181, + StartPos: 4013, + EndPos: 4014, }, - ByRef: false, + ByRef: false, Variadic: false, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 181, - EndLine: 181, - StartPos: 4013, - EndPos: 4014, + EndLine: 181, + StartPos: 4013, + EndPos: 4014, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 181, - EndLine: 181, - StartPos: 4013, - EndPos: 4014, + EndLine: 181, + StartPos: 4013, + EndPos: 4014, }, Value: "b", }, @@ -8896,31 +8816,31 @@ func TestPhp5(t *testing.T) { ClosureUse: &expr.ClosureUse{ Position: &position.Position{ StartLine: 181, - EndLine: 181, - StartPos: 4017, - EndPos: 4029, + EndLine: 181, + StartPos: 4017, + EndPos: 4029, }, Uses: []node.Node{ &expr.Reference{ Position: &position.Position{ StartLine: 181, - EndLine: 181, - StartPos: 4022, - EndPos: 4024, + EndLine: 181, + StartPos: 4022, + EndPos: 4024, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 181, - EndLine: 181, - StartPos: 4023, - EndPos: 4024, + EndLine: 181, + StartPos: 4023, + EndPos: 4024, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 181, - EndLine: 181, - StartPos: 4023, - EndPos: 4024, + EndLine: 181, + StartPos: 4023, + EndPos: 4024, }, Value: "c", }, @@ -8929,75 +8849,73 @@ func TestPhp5(t *testing.T) { &expr.Variable{ Position: &position.Position{ StartLine: 181, - EndLine: 181, - StartPos: 4027, - EndPos: 4028, + EndLine: 181, + StartPos: 4027, + EndPos: 4028, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 181, - EndLine: 181, - StartPos: 4027, - EndPos: 4028, + EndLine: 181, + StartPos: 4027, + EndPos: 4028, }, Value: "d", }, }, }, }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 182, - EndLine: 182, - StartPos: 4037, - EndPos: 4050, + EndLine: 182, + StartPos: 4037, + EndPos: 4050, }, Expr: &expr.Closure{ Position: &position.Position{ StartLine: 182, - EndLine: 182, - StartPos: 4037, - EndPos: 4049, + EndLine: 182, + StartPos: 4037, + EndPos: 4049, }, - ReturnsRef: false, - Static: false, + ReturnsRef: false, + Static: false, PhpDocComment: "", - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 183, - EndLine: 183, - StartPos: 4054, - EndPos: 4057, + EndLine: 183, + StartPos: 4054, + EndPos: 4057, }, Expr: &expr.ConstFetch{ Position: &position.Position{ StartLine: 183, - EndLine: 183, - StartPos: 4054, - EndPos: 4056, + EndLine: 183, + StartPos: 4054, + EndPos: 4056, }, Constant: &name.Name{ Position: &position.Position{ StartLine: 183, - EndLine: 183, - StartPos: 4054, - EndPos: 4056, + EndLine: 183, + StartPos: 4054, + EndPos: 4056, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 183, - EndLine: 183, - StartPos: 4054, - EndPos: 4056, + EndLine: 183, + StartPos: 4054, + EndPos: 4056, }, Value: "foo", }, @@ -9008,31 +8926,31 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 184, - EndLine: 184, - StartPos: 4061, - EndPos: 4074, + EndLine: 184, + StartPos: 4061, + EndPos: 4074, }, Expr: &expr.ConstFetch{ Position: &position.Position{ StartLine: 184, - EndLine: 184, - StartPos: 4061, - EndPos: 4073, + EndLine: 184, + StartPos: 4061, + EndPos: 4073, }, Constant: &name.Relative{ Position: &position.Position{ StartLine: 184, - EndLine: 184, - StartPos: 4061, - EndPos: 4073, + EndLine: 184, + StartPos: 4061, + EndPos: 4073, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 184, - EndLine: 184, - StartPos: 4071, - EndPos: 4073, + EndLine: 184, + StartPos: 4071, + EndPos: 4073, }, Value: "foo", }, @@ -9043,31 +8961,31 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 185, - EndLine: 185, - StartPos: 4078, - EndPos: 4082, + EndLine: 185, + StartPos: 4078, + EndPos: 4082, }, Expr: &expr.ConstFetch{ Position: &position.Position{ StartLine: 185, - EndLine: 185, - StartPos: 4078, - EndPos: 4081, + EndLine: 185, + StartPos: 4078, + EndPos: 4081, }, Constant: &name.FullyQualified{ Position: &position.Position{ StartLine: 185, - EndLine: 185, - StartPos: 4078, - EndPos: 4081, + EndLine: 185, + StartPos: 4078, + EndPos: 4081, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 185, - EndLine: 185, - StartPos: 4079, - EndPos: 4081, + EndLine: 185, + StartPos: 4079, + EndPos: 4081, }, Value: "foo", }, @@ -9078,30 +8996,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 187, - EndLine: 187, - StartPos: 4087, - EndPos: 4096, + EndLine: 187, + StartPos: 4087, + EndPos: 4096, }, Expr: &expr.Empty{ Position: &position.Position{ StartLine: 187, - EndLine: 187, - StartPos: 4087, - EndPos: 4095, + EndLine: 187, + StartPos: 4087, + EndPos: 4095, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 187, - EndLine: 187, - StartPos: 4093, - EndPos: 4094, + EndLine: 187, + StartPos: 4093, + EndPos: 4094, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 187, - EndLine: 187, - StartPos: 4093, - EndPos: 4094, + EndLine: 187, + StartPos: 4093, + EndPos: 4094, }, Value: "a", }, @@ -9111,38 +9029,38 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 188, - EndLine: 188, - StartPos: 4100, - EndPos: 4110, + EndLine: 188, + StartPos: 4100, + EndPos: 4110, }, Expr: &expr.Empty{ Position: &position.Position{ StartLine: 188, - EndLine: 188, - StartPos: 4100, - EndPos: 4109, + EndLine: 188, + StartPos: 4100, + EndPos: 4109, }, Expr: &expr.ConstFetch{ Position: &position.Position{ StartLine: 188, - EndLine: 188, - StartPos: 4106, - EndPos: 4108, + EndLine: 188, + StartPos: 4106, + EndPos: 4108, }, Constant: &name.Name{ Position: &position.Position{ StartLine: 188, - EndLine: 188, - StartPos: 4106, - EndPos: 4108, + EndLine: 188, + StartPos: 4106, + EndPos: 4108, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 188, - EndLine: 188, - StartPos: 4106, - EndPos: 4108, + EndLine: 188, + StartPos: 4106, + EndPos: 4108, }, Value: "Foo", }, @@ -9154,30 +9072,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 189, - EndLine: 189, - StartPos: 4114, - EndPos: 4117, + EndLine: 189, + StartPos: 4114, + EndPos: 4117, }, Expr: &expr.ErrorSuppress{ Position: &position.Position{ StartLine: 189, - EndLine: 189, - StartPos: 4114, - EndPos: 4116, + EndLine: 189, + StartPos: 4114, + EndPos: 4116, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 189, - EndLine: 189, - StartPos: 4115, - EndPos: 4116, + EndLine: 189, + StartPos: 4115, + EndPos: 4116, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 189, - EndLine: 189, - StartPos: 4115, - EndPos: 4116, + EndLine: 189, + StartPos: 4115, + EndPos: 4116, }, Value: "a", }, @@ -9187,30 +9105,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 190, - EndLine: 190, - StartPos: 4121, - EndPos: 4129, + EndLine: 190, + StartPos: 4121, + EndPos: 4129, }, Expr: &expr.Eval{ Position: &position.Position{ StartLine: 190, - EndLine: 190, - StartPos: 4121, - EndPos: 4128, + EndLine: 190, + StartPos: 4121, + EndPos: 4128, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 190, - EndLine: 190, - StartPos: 4126, - EndPos: 4127, + EndLine: 190, + StartPos: 4126, + EndPos: 4127, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 190, - EndLine: 190, - StartPos: 4126, - EndPos: 4127, + EndLine: 190, + StartPos: 4126, + EndPos: 4127, }, Value: "a", }, @@ -9220,46 +9138,46 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 191, - EndLine: 191, - StartPos: 4133, - EndPos: 4137, + EndLine: 191, + StartPos: 4133, + EndPos: 4137, }, Expr: &expr.Exit{ Position: &position.Position{ StartLine: 191, - EndLine: 191, - StartPos: 4133, - EndPos: 4136, + EndLine: 191, + StartPos: 4133, + EndPos: 4136, }, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 192, - EndLine: 192, - StartPos: 4141, - EndPos: 4149, + EndLine: 192, + StartPos: 4141, + EndPos: 4149, }, Expr: &expr.Exit{ Position: &position.Position{ StartLine: 192, - EndLine: 192, - StartPos: 4141, - EndPos: 4148, + EndLine: 192, + StartPos: 4141, + EndPos: 4148, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 192, - EndLine: 192, - StartPos: 4146, - EndPos: 4147, + EndLine: 192, + StartPos: 4146, + EndPos: 4147, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 192, - EndLine: 192, - StartPos: 4146, - EndPos: 4147, + EndLine: 192, + StartPos: 4146, + EndPos: 4147, }, Value: "a", }, @@ -9269,46 +9187,46 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 193, - EndLine: 193, - StartPos: 4153, - EndPos: 4158, + EndLine: 193, + StartPos: 4153, + EndPos: 4158, }, Expr: &expr.Die{ Position: &position.Position{ StartLine: 193, - EndLine: 193, - StartPos: 4153, - EndPos: 4157, + EndLine: 193, + StartPos: 4153, + EndPos: 4157, }, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 194, - EndLine: 194, - StartPos: 4162, - EndPos: 4169, + EndLine: 194, + StartPos: 4162, + EndPos: 4169, }, Expr: &expr.Die{ Position: &position.Position{ StartLine: 194, - EndLine: 194, - StartPos: 4162, - EndPos: 4168, + EndLine: 194, + StartPos: 4162, + EndPos: 4168, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 194, - EndLine: 194, - StartPos: 4166, - EndPos: 4167, + EndLine: 194, + StartPos: 4166, + EndPos: 4167, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 194, - EndLine: 194, - StartPos: 4166, - EndPos: 4167, + EndLine: 194, + StartPos: 4166, + EndPos: 4167, }, Value: "a", }, @@ -9318,31 +9236,31 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 195, - EndLine: 195, - StartPos: 4173, - EndPos: 4178, + EndLine: 195, + StartPos: 4173, + EndPos: 4178, }, Expr: &expr.FunctionCall{ Position: &position.Position{ StartLine: 195, - EndLine: 195, - StartPos: 4173, - EndPos: 4177, + EndLine: 195, + StartPos: 4173, + EndPos: 4177, }, Function: &name.Name{ Position: &position.Position{ StartLine: 195, - EndLine: 195, - StartPos: 4173, - EndPos: 4175, + EndLine: 195, + StartPos: 4173, + EndPos: 4175, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 195, - EndLine: 195, - StartPos: 4173, - EndPos: 4175, + EndLine: 195, + StartPos: 4173, + EndPos: 4175, }, Value: "foo", }, @@ -9351,9 +9269,9 @@ func TestPhp5(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 195, - EndLine: 195, - StartPos: 4176, - EndPos: 4177, + EndLine: 195, + StartPos: 4176, + EndPos: 4177, }, }, }, @@ -9361,31 +9279,31 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 196, - EndLine: 196, - StartPos: 4182, - EndPos: 4200, + EndLine: 196, + StartPos: 4182, + EndPos: 4200, }, Expr: &expr.FunctionCall{ Position: &position.Position{ StartLine: 196, - EndLine: 196, - StartPos: 4182, - EndPos: 4199, + EndLine: 196, + StartPos: 4182, + EndPos: 4199, }, Function: &name.Relative{ Position: &position.Position{ StartLine: 196, - EndLine: 196, - StartPos: 4182, - EndPos: 4194, + EndLine: 196, + StartPos: 4182, + EndPos: 4194, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 196, - EndLine: 196, - StartPos: 4192, - EndPos: 4194, + EndLine: 196, + StartPos: 4192, + EndPos: 4194, }, Value: "foo", }, @@ -9394,33 +9312,33 @@ func TestPhp5(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 196, - EndLine: 196, - StartPos: 4195, - EndPos: 4199, + EndLine: 196, + StartPos: 4195, + EndPos: 4199, }, Arguments: []node.Node{ &node.Argument{ Position: &position.Position{ StartLine: 196, - EndLine: 196, - StartPos: 4197, - EndPos: 4198, + EndLine: 196, + StartPos: 4197, + EndPos: 4198, }, - Variadic: false, + Variadic: false, IsReference: true, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 196, - EndLine: 196, - StartPos: 4197, - EndPos: 4198, + EndLine: 196, + StartPos: 4197, + EndPos: 4198, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 196, - EndLine: 196, - StartPos: 4197, - EndPos: 4198, + EndLine: 196, + StartPos: 4197, + EndPos: 4198, }, Value: "a", }, @@ -9433,31 +9351,31 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 197, - EndLine: 197, - StartPos: 4204, - EndPos: 4212, + EndLine: 197, + StartPos: 4204, + EndPos: 4212, }, Expr: &expr.FunctionCall{ Position: &position.Position{ StartLine: 197, - EndLine: 197, - StartPos: 4204, - EndPos: 4211, + EndLine: 197, + StartPos: 4204, + EndPos: 4211, }, Function: &name.FullyQualified{ Position: &position.Position{ StartLine: 197, - EndLine: 197, - StartPos: 4204, - EndPos: 4207, + EndLine: 197, + StartPos: 4204, + EndPos: 4207, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 197, - EndLine: 197, - StartPos: 4205, - EndPos: 4207, + EndLine: 197, + StartPos: 4205, + EndPos: 4207, }, Value: "foo", }, @@ -9466,29 +9384,28 @@ func TestPhp5(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 197, - EndLine: 197, - StartPos: 4208, - EndPos: 4211, + EndLine: 197, + StartPos: 4208, + EndPos: 4211, }, Arguments: []node.Node{ &node.Argument{ Position: &position.Position{ StartLine: 197, - EndLine: 197, - StartPos: 4209, - EndPos: 4210, + EndLine: 197, + StartPos: 4209, + EndPos: 4210, }, - Variadic: false, + Variadic: false, IsReference: false, Expr: &expr.ShortArray{ Position: &position.Position{ StartLine: 197, - EndLine: 197, - StartPos: 4209, - EndPos: 4210, - }, - Items: []node.Node{ + EndLine: 197, + StartPos: 4209, + EndPos: 4210, }, + Items: []node.Node{}, }, }, }, @@ -9498,30 +9415,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 198, - EndLine: 198, - StartPos: 4216, - EndPos: 4230, + EndLine: 198, + StartPos: 4216, + EndPos: 4230, }, Expr: &expr.FunctionCall{ Position: &position.Position{ StartLine: 198, - EndLine: 198, - StartPos: 4216, - EndPos: 4229, + EndLine: 198, + StartPos: 4216, + EndPos: 4229, }, Function: &expr.Variable{ Position: &position.Position{ StartLine: 198, - EndLine: 198, - StartPos: 4216, - EndPos: 4219, + EndLine: 198, + StartPos: 4216, + EndPos: 4219, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 198, - EndLine: 198, - StartPos: 4216, - EndPos: 4219, + EndLine: 198, + StartPos: 4216, + EndPos: 4219, }, Value: "foo", }, @@ -9529,40 +9446,40 @@ func TestPhp5(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 198, - EndLine: 198, - StartPos: 4220, - EndPos: 4229, + EndLine: 198, + StartPos: 4220, + EndPos: 4229, }, Arguments: []node.Node{ &node.Argument{ Position: &position.Position{ StartLine: 198, - EndLine: 198, - StartPos: 4221, - EndPos: 4228, + EndLine: 198, + StartPos: 4221, + EndPos: 4228, }, - Variadic: false, + Variadic: false, IsReference: false, Expr: &expr.Yield{ Position: &position.Position{ StartLine: 198, - EndLine: 198, - StartPos: 4221, - EndPos: 4228, + EndLine: 198, + StartPos: 4221, + EndPos: 4228, }, Value: &expr.Variable{ Position: &position.Position{ StartLine: 198, - EndLine: 198, - StartPos: 4227, - EndPos: 4228, + EndLine: 198, + StartPos: 4227, + EndPos: 4228, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 198, - EndLine: 198, - StartPos: 4227, - EndPos: 4228, + EndLine: 198, + StartPos: 4227, + EndPos: 4228, }, Value: "a", }, @@ -9576,30 +9493,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 200, - EndLine: 200, - StartPos: 4235, - EndPos: 4239, + EndLine: 200, + StartPos: 4235, + EndPos: 4239, }, Expr: &expr.PostDec{ Position: &position.Position{ StartLine: 200, - EndLine: 200, - StartPos: 4235, - EndPos: 4238, + EndLine: 200, + StartPos: 4235, + EndPos: 4238, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 200, - EndLine: 200, - StartPos: 4235, - EndPos: 4236, + EndLine: 200, + StartPos: 4235, + EndPos: 4236, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 200, - EndLine: 200, - StartPos: 4235, - EndPos: 4236, + EndLine: 200, + StartPos: 4235, + EndPos: 4236, }, Value: "a", }, @@ -9609,30 +9526,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 201, - EndLine: 201, - StartPos: 4243, - EndPos: 4247, + EndLine: 201, + StartPos: 4243, + EndPos: 4247, }, Expr: &expr.PostInc{ Position: &position.Position{ StartLine: 201, - EndLine: 201, - StartPos: 4243, - EndPos: 4246, + EndLine: 201, + StartPos: 4243, + EndPos: 4246, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 201, - EndLine: 201, - StartPos: 4243, - EndPos: 4244, + EndLine: 201, + StartPos: 4243, + EndPos: 4244, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 201, - EndLine: 201, - StartPos: 4243, - EndPos: 4244, + EndLine: 201, + StartPos: 4243, + EndPos: 4244, }, Value: "a", }, @@ -9642,30 +9559,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 202, - EndLine: 202, - StartPos: 4251, - EndPos: 4255, + EndLine: 202, + StartPos: 4251, + EndPos: 4255, }, Expr: &expr.PreDec{ Position: &position.Position{ StartLine: 202, - EndLine: 202, - StartPos: 4251, - EndPos: 4254, + EndLine: 202, + StartPos: 4251, + EndPos: 4254, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 202, - EndLine: 202, - StartPos: 4253, - EndPos: 4254, + EndLine: 202, + StartPos: 4253, + EndPos: 4254, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 202, - EndLine: 202, - StartPos: 4253, - EndPos: 4254, + EndLine: 202, + StartPos: 4253, + EndPos: 4254, }, Value: "a", }, @@ -9675,30 +9592,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 203, - EndLine: 203, - StartPos: 4259, - EndPos: 4263, + EndLine: 203, + StartPos: 4259, + EndPos: 4263, }, Expr: &expr.PreInc{ Position: &position.Position{ StartLine: 203, - EndLine: 203, - StartPos: 4259, - EndPos: 4262, + EndLine: 203, + StartPos: 4259, + EndPos: 4262, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 203, - EndLine: 203, - StartPos: 4261, - EndPos: 4262, + EndLine: 203, + StartPos: 4261, + EndPos: 4262, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 203, - EndLine: 203, - StartPos: 4261, - EndPos: 4262, + EndLine: 203, + StartPos: 4261, + EndPos: 4262, }, Value: "a", }, @@ -9708,30 +9625,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 205, - EndLine: 205, - StartPos: 4268, - EndPos: 4278, + EndLine: 205, + StartPos: 4268, + EndPos: 4278, }, Expr: &expr.Include{ Position: &position.Position{ StartLine: 205, - EndLine: 205, - StartPos: 4268, - EndPos: 4277, + EndLine: 205, + StartPos: 4268, + EndPos: 4277, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 205, - EndLine: 205, - StartPos: 4276, - EndPos: 4277, + EndLine: 205, + StartPos: 4276, + EndPos: 4277, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 205, - EndLine: 205, - StartPos: 4276, - EndPos: 4277, + EndLine: 205, + StartPos: 4276, + EndPos: 4277, }, Value: "a", }, @@ -9741,30 +9658,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 206, - EndLine: 206, - StartPos: 4282, - EndPos: 4297, + EndLine: 206, + StartPos: 4282, + EndPos: 4297, }, Expr: &expr.IncludeOnce{ Position: &position.Position{ StartLine: 206, - EndLine: 206, - StartPos: 4282, - EndPos: 4296, + EndLine: 206, + StartPos: 4282, + EndPos: 4296, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 206, - EndLine: 206, - StartPos: 4295, - EndPos: 4296, + EndLine: 206, + StartPos: 4295, + EndPos: 4296, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 206, - EndLine: 206, - StartPos: 4295, - EndPos: 4296, + EndLine: 206, + StartPos: 4295, + EndPos: 4296, }, Value: "a", }, @@ -9774,30 +9691,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 207, - EndLine: 207, - StartPos: 4301, - EndPos: 4311, + EndLine: 207, + StartPos: 4301, + EndPos: 4311, }, Expr: &expr.Require{ Position: &position.Position{ StartLine: 207, - EndLine: 207, - StartPos: 4301, - EndPos: 4310, + EndLine: 207, + StartPos: 4301, + EndPos: 4310, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 207, - EndLine: 207, - StartPos: 4309, - EndPos: 4310, + EndLine: 207, + StartPos: 4309, + EndPos: 4310, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 207, - EndLine: 207, - StartPos: 4309, - EndPos: 4310, + EndLine: 207, + StartPos: 4309, + EndPos: 4310, }, Value: "a", }, @@ -9807,30 +9724,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 208, - EndLine: 208, - StartPos: 4315, - EndPos: 4330, + EndLine: 208, + StartPos: 4315, + EndPos: 4330, }, Expr: &expr.RequireOnce{ Position: &position.Position{ StartLine: 208, - EndLine: 208, - StartPos: 4315, - EndPos: 4329, + EndLine: 208, + StartPos: 4315, + EndPos: 4329, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 208, - EndLine: 208, - StartPos: 4328, - EndPos: 4329, + EndLine: 208, + StartPos: 4328, + EndPos: 4329, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 208, - EndLine: 208, - StartPos: 4328, - EndPos: 4329, + EndLine: 208, + StartPos: 4328, + EndPos: 4329, }, Value: "a", }, @@ -9840,30 +9757,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 210, - EndLine: 210, - StartPos: 4335, - EndPos: 4352, + EndLine: 210, + StartPos: 4335, + EndPos: 4352, }, Expr: &expr.InstanceOf{ Position: &position.Position{ StartLine: 210, - EndLine: 210, - StartPos: 4335, - EndPos: 4351, + EndLine: 210, + StartPos: 4335, + EndPos: 4351, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 210, - EndLine: 210, - StartPos: 4335, - EndPos: 4336, + EndLine: 210, + StartPos: 4335, + EndPos: 4336, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 210, - EndLine: 210, - StartPos: 4335, - EndPos: 4336, + EndLine: 210, + StartPos: 4335, + EndPos: 4336, }, Value: "a", }, @@ -9871,17 +9788,17 @@ func TestPhp5(t *testing.T) { Class: &name.Name{ Position: &position.Position{ StartLine: 210, - EndLine: 210, - StartPos: 4349, - EndPos: 4351, + EndLine: 210, + StartPos: 4349, + EndPos: 4351, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 210, - EndLine: 210, - StartPos: 4349, - EndPos: 4351, + EndLine: 210, + StartPos: 4349, + EndPos: 4351, }, Value: "Foo", }, @@ -9892,30 +9809,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 211, - EndLine: 211, - StartPos: 4356, - EndPos: 4383, + EndLine: 211, + StartPos: 4356, + EndPos: 4383, }, Expr: &expr.InstanceOf{ Position: &position.Position{ StartLine: 211, - EndLine: 211, - StartPos: 4356, - EndPos: 4382, + EndLine: 211, + StartPos: 4356, + EndPos: 4382, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 211, - EndLine: 211, - StartPos: 4356, - EndPos: 4357, + EndLine: 211, + StartPos: 4356, + EndPos: 4357, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 211, - EndLine: 211, - StartPos: 4356, - EndPos: 4357, + EndLine: 211, + StartPos: 4356, + EndPos: 4357, }, Value: "a", }, @@ -9923,17 +9840,17 @@ func TestPhp5(t *testing.T) { Class: &name.Relative{ Position: &position.Position{ StartLine: 211, - EndLine: 211, - StartPos: 4370, - EndPos: 4382, + EndLine: 211, + StartPos: 4370, + EndPos: 4382, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 211, - EndLine: 211, - StartPos: 4380, - EndPos: 4382, + EndLine: 211, + StartPos: 4380, + EndPos: 4382, }, Value: "Foo", }, @@ -9944,30 +9861,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 212, - EndLine: 212, - StartPos: 4387, - EndPos: 4405, + EndLine: 212, + StartPos: 4387, + EndPos: 4405, }, Expr: &expr.InstanceOf{ Position: &position.Position{ StartLine: 212, - EndLine: 212, - StartPos: 4387, - EndPos: 4404, + EndLine: 212, + StartPos: 4387, + EndPos: 4404, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 212, - EndLine: 212, - StartPos: 4387, - EndPos: 4388, + EndLine: 212, + StartPos: 4387, + EndPos: 4388, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 212, - EndLine: 212, - StartPos: 4387, - EndPos: 4388, + EndLine: 212, + StartPos: 4387, + EndPos: 4388, }, Value: "a", }, @@ -9975,17 +9892,17 @@ func TestPhp5(t *testing.T) { Class: &name.FullyQualified{ Position: &position.Position{ StartLine: 212, - EndLine: 212, - StartPos: 4401, - EndPos: 4404, + EndLine: 212, + StartPos: 4401, + EndPos: 4404, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 212, - EndLine: 212, - StartPos: 4402, - EndPos: 4404, + EndLine: 212, + StartPos: 4402, + EndPos: 4404, }, Value: "Foo", }, @@ -9996,31 +9913,31 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 214, - EndLine: 214, - StartPos: 4410, - EndPos: 4423, + EndLine: 214, + StartPos: 4410, + EndPos: 4423, }, Expr: &expr.Isset{ Position: &position.Position{ StartLine: 214, - EndLine: 214, - StartPos: 4410, - EndPos: 4422, + EndLine: 214, + StartPos: 4410, + EndPos: 4422, }, Variables: []node.Node{ &expr.Variable{ Position: &position.Position{ StartLine: 214, - EndLine: 214, - StartPos: 4416, - EndPos: 4417, + EndLine: 214, + StartPos: 4416, + EndPos: 4417, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 214, - EndLine: 214, - StartPos: 4416, - EndPos: 4417, + EndLine: 214, + StartPos: 4416, + EndPos: 4417, }, Value: "a", }, @@ -10028,16 +9945,16 @@ func TestPhp5(t *testing.T) { &expr.Variable{ Position: &position.Position{ StartLine: 214, - EndLine: 214, - StartPos: 4420, - EndPos: 4421, + EndLine: 214, + StartPos: 4420, + EndPos: 4421, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 214, - EndLine: 214, - StartPos: 4420, - EndPos: 4421, + EndLine: 214, + StartPos: 4420, + EndPos: 4421, }, Value: "b", }, @@ -10048,39 +9965,39 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 215, - EndLine: 215, - StartPos: 4427, - EndPos: 4437, + EndLine: 215, + StartPos: 4427, + EndPos: 4437, }, Expr: &expr.Isset{ Position: &position.Position{ StartLine: 215, - EndLine: 215, - StartPos: 4427, - EndPos: 4436, + EndLine: 215, + StartPos: 4427, + EndPos: 4436, }, Variables: []node.Node{ &expr.ConstFetch{ Position: &position.Position{ StartLine: 215, - EndLine: 215, - StartPos: 4433, - EndPos: 4435, + EndLine: 215, + StartPos: 4433, + EndPos: 4435, }, Constant: &name.Name{ Position: &position.Position{ StartLine: 215, - EndLine: 215, - StartPos: 4433, - EndPos: 4435, + EndLine: 215, + StartPos: 4433, + EndPos: 4435, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 215, - EndLine: 215, - StartPos: 4433, - EndPos: 4435, + EndLine: 215, + StartPos: 4433, + EndPos: 4435, }, Value: "Foo", }, @@ -10093,40 +10010,39 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 216, - EndLine: 216, - StartPos: 4441, - EndPos: 4452, + EndLine: 216, + StartPos: 4441, + EndPos: 4452, }, Expr: &assign.Assign{ Position: &position.Position{ StartLine: 216, - EndLine: 216, - StartPos: 4441, - EndPos: 4451, + EndLine: 216, + StartPos: 4441, + EndPos: 4451, }, Variable: &expr.List{ Position: &position.Position{ StartLine: 216, - EndLine: 216, - StartPos: 4441, - EndPos: 4446, - }, - Items: []node.Node{ + EndLine: 216, + StartPos: 4441, + EndPos: 4446, }, + Items: []node.Node{}, }, Expression: &expr.Variable{ Position: &position.Position{ StartLine: 216, - EndLine: 216, - StartPos: 4450, - EndPos: 4451, + EndLine: 216, + StartPos: 4450, + EndPos: 4451, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 216, - EndLine: 216, - StartPos: 4450, - EndPos: 4451, + EndLine: 216, + StartPos: 4450, + EndPos: 4451, }, Value: "b", }, @@ -10136,45 +10052,45 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 217, - EndLine: 217, - StartPos: 4456, - EndPos: 4473, + EndLine: 217, + StartPos: 4456, + EndPos: 4473, }, Expr: &assign.Assign{ Position: &position.Position{ StartLine: 217, - EndLine: 217, - StartPos: 4456, - EndPos: 4472, + EndLine: 217, + StartPos: 4456, + EndPos: 4472, }, Variable: &expr.List{ Position: &position.Position{ StartLine: 217, - EndLine: 217, - StartPos: 4456, - EndPos: 4467, + EndLine: 217, + StartPos: 4456, + EndPos: 4467, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 217, - EndLine: 217, - StartPos: 4461, - EndPos: 4462, + EndLine: 217, + StartPos: 4461, + EndPos: 4462, }, Val: &expr.Variable{ Position: &position.Position{ StartLine: 217, - EndLine: 217, - StartPos: 4461, - EndPos: 4462, + EndLine: 217, + StartPos: 4461, + EndPos: 4462, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 217, - EndLine: 217, - StartPos: 4461, - EndPos: 4462, + EndLine: 217, + StartPos: 4461, + EndPos: 4462, }, Value: "a", }, @@ -10183,23 +10099,23 @@ func TestPhp5(t *testing.T) { &expr.ArrayItem{ Position: &position.Position{ StartLine: 217, - EndLine: 217, - StartPos: 4465, - EndPos: 4466, + EndLine: 217, + StartPos: 4465, + EndPos: 4466, }, Val: &expr.Variable{ Position: &position.Position{ StartLine: 217, - EndLine: 217, - StartPos: 4465, - EndPos: 4466, + EndLine: 217, + StartPos: 4465, + EndPos: 4466, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 217, - EndLine: 217, - StartPos: 4465, - EndPos: 4466, + EndLine: 217, + StartPos: 4465, + EndPos: 4466, }, Value: "b", }, @@ -10210,16 +10126,16 @@ func TestPhp5(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 217, - EndLine: 217, - StartPos: 4471, - EndPos: 4472, + EndLine: 217, + StartPos: 4471, + EndPos: 4472, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 217, - EndLine: 217, - StartPos: 4471, - EndPos: 4472, + EndLine: 217, + StartPos: 4471, + EndPos: 4472, }, Value: "b", }, @@ -10229,52 +10145,52 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 218, - EndLine: 218, - StartPos: 4477, - EndPos: 4492, + EndLine: 218, + StartPos: 4477, + EndPos: 4492, }, Expr: &assign.Assign{ Position: &position.Position{ StartLine: 218, - EndLine: 218, - StartPos: 4477, - EndPos: 4491, + EndLine: 218, + StartPos: 4477, + EndPos: 4491, }, Variable: &expr.List{ Position: &position.Position{ StartLine: 218, - EndLine: 218, - StartPos: 4477, - EndPos: 4486, + EndLine: 218, + StartPos: 4477, + EndPos: 4486, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 218, - EndLine: 218, - StartPos: 4482, - EndPos: 4485, + EndLine: 218, + StartPos: 4482, + EndPos: 4485, }, Val: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 218, - EndLine: 218, - StartPos: 4482, - EndPos: 4485, + EndLine: 218, + StartPos: 4482, + EndPos: 4485, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 218, - EndLine: 218, - StartPos: 4482, - EndPos: 4483, + EndLine: 218, + StartPos: 4482, + EndPos: 4483, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 218, - EndLine: 218, - StartPos: 4482, - EndPos: 4483, + EndLine: 218, + StartPos: 4482, + EndPos: 4483, }, Value: "a", }, @@ -10286,16 +10202,16 @@ func TestPhp5(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 218, - EndLine: 218, - StartPos: 4490, - EndPos: 4491, + EndLine: 218, + StartPos: 4490, + EndPos: 4491, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 218, - EndLine: 218, - StartPos: 4490, - EndPos: 4491, + EndLine: 218, + StartPos: 4490, + EndPos: 4491, }, Value: "b", }, @@ -10305,60 +10221,60 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 219, - EndLine: 219, - StartPos: 4496, - EndPos: 4515, + EndLine: 219, + StartPos: 4496, + EndPos: 4515, }, Expr: &assign.Assign{ Position: &position.Position{ StartLine: 219, - EndLine: 219, - StartPos: 4496, - EndPos: 4514, + EndLine: 219, + StartPos: 4496, + EndPos: 4514, }, Variable: &expr.List{ Position: &position.Position{ StartLine: 219, - EndLine: 219, - StartPos: 4496, - EndPos: 4509, + EndLine: 219, + StartPos: 4496, + EndPos: 4509, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 219, - EndLine: 219, - StartPos: 4501, - EndPos: 4508, + EndLine: 219, + StartPos: 4501, + EndPos: 4508, }, Val: &expr.List{ Position: &position.Position{ StartLine: 219, - EndLine: 219, - StartPos: 4501, - EndPos: 4508, + EndLine: 219, + StartPos: 4501, + EndPos: 4508, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 219, - EndLine: 219, - StartPos: 4506, - EndPos: 4507, + EndLine: 219, + StartPos: 4506, + EndPos: 4507, }, Val: &expr.Variable{ Position: &position.Position{ StartLine: 219, - EndLine: 219, - StartPos: 4506, - EndPos: 4507, + EndLine: 219, + StartPos: 4506, + EndPos: 4507, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 219, - EndLine: 219, - StartPos: 4506, - EndPos: 4507, + EndLine: 219, + StartPos: 4506, + EndPos: 4507, }, Value: "a", }, @@ -10372,16 +10288,16 @@ func TestPhp5(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 219, - EndLine: 219, - StartPos: 4513, - EndPos: 4514, + EndLine: 219, + StartPos: 4513, + EndPos: 4514, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 219, - EndLine: 219, - StartPos: 4513, - EndPos: 4514, + EndLine: 219, + StartPos: 4513, + EndPos: 4514, }, Value: "b", }, @@ -10391,30 +10307,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 221, - EndLine: 221, - StartPos: 4520, - EndPos: 4529, + EndLine: 221, + StartPos: 4520, + EndPos: 4529, }, Expr: &expr.MethodCall{ Position: &position.Position{ StartLine: 221, - EndLine: 221, - StartPos: 4520, - EndPos: 4528, + EndLine: 221, + StartPos: 4520, + EndPos: 4528, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 221, - EndLine: 221, - StartPos: 4520, - EndPos: 4521, + EndLine: 221, + StartPos: 4520, + EndPos: 4521, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 221, - EndLine: 221, - StartPos: 4520, - EndPos: 4521, + EndLine: 221, + StartPos: 4520, + EndPos: 4521, }, Value: "a", }, @@ -10422,18 +10338,18 @@ func TestPhp5(t *testing.T) { Method: &node.Identifier{ Position: &position.Position{ StartLine: 221, - EndLine: 221, - StartPos: 4524, - EndPos: 4526, + EndLine: 221, + StartPos: 4524, + EndPos: 4526, }, Value: "foo", }, ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 221, - EndLine: 221, - StartPos: 4527, - EndPos: 4528, + EndLine: 221, + StartPos: 4527, + EndPos: 4528, }, }, }, @@ -10441,31 +10357,31 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 222, - EndLine: 222, - StartPos: 4533, - EndPos: 4540, + EndLine: 222, + StartPos: 4533, + EndPos: 4540, }, Expr: &expr.New{ Position: &position.Position{ StartLine: 222, - EndLine: 222, - StartPos: 4533, - EndPos: 4539, + EndLine: 222, + StartPos: 4533, + EndPos: 4539, }, Class: &name.Name{ Position: &position.Position{ StartLine: 222, - EndLine: 222, - StartPos: 4537, - EndPos: 4539, + EndLine: 222, + StartPos: 4537, + EndPos: 4539, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 222, - EndLine: 222, - StartPos: 4537, - EndPos: 4539, + EndLine: 222, + StartPos: 4537, + EndPos: 4539, }, Value: "Foo", }, @@ -10476,31 +10392,31 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 223, - EndLine: 223, - StartPos: 4544, - EndPos: 4563, + EndLine: 223, + StartPos: 4544, + EndPos: 4563, }, Expr: &expr.New{ Position: &position.Position{ StartLine: 223, - EndLine: 223, - StartPos: 4544, - EndPos: 4562, + EndLine: 223, + StartPos: 4544, + EndPos: 4562, }, Class: &name.Relative{ Position: &position.Position{ StartLine: 223, - EndLine: 223, - StartPos: 4548, - EndPos: 4560, + EndLine: 223, + StartPos: 4548, + EndPos: 4560, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 223, - EndLine: 223, - StartPos: 4558, - EndPos: 4560, + EndLine: 223, + StartPos: 4558, + EndPos: 4560, }, Value: "Foo", }, @@ -10509,9 +10425,9 @@ func TestPhp5(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 223, - EndLine: 223, - StartPos: 4561, - EndPos: 4562, + EndLine: 223, + StartPos: 4561, + EndPos: 4562, }, }, }, @@ -10519,31 +10435,31 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 224, - EndLine: 224, - StartPos: 4567, - EndPos: 4577, + EndLine: 224, + StartPos: 4567, + EndPos: 4577, }, Expr: &expr.New{ Position: &position.Position{ StartLine: 224, - EndLine: 224, - StartPos: 4567, - EndPos: 4576, + EndLine: 224, + StartPos: 4567, + EndPos: 4576, }, Class: &name.FullyQualified{ Position: &position.Position{ StartLine: 224, - EndLine: 224, - StartPos: 4571, - EndPos: 4574, + EndLine: 224, + StartPos: 4571, + EndPos: 4574, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 224, - EndLine: 224, - StartPos: 4572, - EndPos: 4574, + EndLine: 224, + StartPos: 4572, + EndPos: 4574, }, Value: "Foo", }, @@ -10552,9 +10468,9 @@ func TestPhp5(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 224, - EndLine: 224, - StartPos: 4575, - EndPos: 4576, + EndLine: 224, + StartPos: 4575, + EndPos: 4576, }, }, }, @@ -10562,30 +10478,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 225, - EndLine: 225, - StartPos: 4581, - EndPos: 4590, + EndLine: 225, + StartPos: 4581, + EndPos: 4590, }, Expr: &expr.Print{ Position: &position.Position{ StartLine: 225, - EndLine: 225, - StartPos: 4581, - EndPos: 4588, + EndLine: 225, + StartPos: 4581, + EndPos: 4588, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 225, - EndLine: 225, - StartPos: 4587, - EndPos: 4588, + EndLine: 225, + StartPos: 4587, + EndPos: 4588, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 225, - EndLine: 225, - StartPos: 4587, - EndPos: 4588, + EndLine: 225, + StartPos: 4587, + EndPos: 4588, }, Value: "a", }, @@ -10595,30 +10511,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 226, - EndLine: 226, - StartPos: 4594, - EndPos: 4601, + EndLine: 226, + StartPos: 4594, + EndPos: 4601, }, Expr: &expr.PropertyFetch{ Position: &position.Position{ StartLine: 226, - EndLine: 226, - StartPos: 4594, - EndPos: 4600, + EndLine: 226, + StartPos: 4594, + EndPos: 4600, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 226, - EndLine: 226, - StartPos: 4594, - EndPos: 4595, + EndLine: 226, + StartPos: 4594, + EndPos: 4595, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 226, - EndLine: 226, - StartPos: 4594, - EndPos: 4595, + EndLine: 226, + StartPos: 4594, + EndPos: 4595, }, Value: "a", }, @@ -10626,9 +10542,9 @@ func TestPhp5(t *testing.T) { Property: &node.Identifier{ Position: &position.Position{ StartLine: 226, - EndLine: 226, - StartPos: 4598, - EndPos: 4600, + EndLine: 226, + StartPos: 4598, + EndPos: 4600, }, Value: "foo", }, @@ -10637,37 +10553,37 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 227, - EndLine: 227, - StartPos: 4605, - EndPos: 4615, + EndLine: 227, + StartPos: 4605, + EndPos: 4615, }, Expr: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 227, - EndLine: 227, - StartPos: 4605, - EndPos: 4613, + EndLine: 227, + StartPos: 4605, + EndPos: 4613, }, Variable: &expr.PropertyFetch{ Position: &position.Position{ StartLine: 227, - EndLine: 227, - StartPos: 4605, - EndPos: 4611, + EndLine: 227, + StartPos: 4605, + EndPos: 4611, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 227, - EndLine: 227, - StartPos: 4605, - EndPos: 4606, + EndLine: 227, + StartPos: 4605, + EndPos: 4606, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 227, - EndLine: 227, - StartPos: 4605, - EndPos: 4606, + EndLine: 227, + StartPos: 4605, + EndPos: 4606, }, Value: "a", }, @@ -10675,9 +10591,9 @@ func TestPhp5(t *testing.T) { Property: &node.Identifier{ Position: &position.Position{ StartLine: 227, - EndLine: 227, - StartPos: 4609, - EndPos: 4611, + EndLine: 227, + StartPos: 4609, + EndPos: 4611, }, Value: "foo", }, @@ -10685,9 +10601,9 @@ func TestPhp5(t *testing.T) { Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 227, - EndLine: 227, - StartPos: 4613, - EndPos: 4613, + EndLine: 227, + StartPos: 4613, + EndPos: 4613, }, Value: "1", }, @@ -10696,58 +10612,58 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 228, - EndLine: 228, - StartPos: 4619, - EndPos: 4647, + EndLine: 228, + StartPos: 4619, + EndPos: 4647, }, Expr: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 228, - EndLine: 228, - StartPos: 4619, - EndPos: 4645, + EndLine: 228, + StartPos: 4619, + EndPos: 4645, }, Variable: &expr.PropertyFetch{ Position: &position.Position{ StartLine: 228, - EndLine: 228, - StartPos: 4619, - EndPos: 4643, + EndLine: 228, + StartPos: 4619, + EndPos: 4643, }, Variable: &expr.MethodCall{ Position: &position.Position{ StartLine: 228, - EndLine: 228, - StartPos: 4619, - EndPos: 4637, + EndLine: 228, + StartPos: 4619, + EndPos: 4637, }, Variable: &expr.PropertyFetch{ Position: &position.Position{ StartLine: 228, - EndLine: 228, - StartPos: 4619, - EndPos: 4630, + EndLine: 228, + StartPos: 4619, + EndPos: 4630, }, Variable: &expr.PropertyFetch{ Position: &position.Position{ StartLine: 228, - EndLine: 228, - StartPos: 4619, - EndPos: 4625, + EndLine: 228, + StartPos: 4619, + EndPos: 4625, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 228, - EndLine: 228, - StartPos: 4619, - EndPos: 4620, + EndLine: 228, + StartPos: 4619, + EndPos: 4620, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 228, - EndLine: 228, - StartPos: 4619, - EndPos: 4620, + EndLine: 228, + StartPos: 4619, + EndPos: 4620, }, Value: "a", }, @@ -10755,9 +10671,9 @@ func TestPhp5(t *testing.T) { Property: &node.Identifier{ Position: &position.Position{ StartLine: 228, - EndLine: 228, - StartPos: 4623, - EndPos: 4625, + EndLine: 228, + StartPos: 4623, + EndPos: 4625, }, Value: "foo", }, @@ -10765,9 +10681,9 @@ func TestPhp5(t *testing.T) { Property: &node.Identifier{ Position: &position.Position{ StartLine: 228, - EndLine: 228, - StartPos: 4628, - EndPos: 4630, + EndLine: 228, + StartPos: 4628, + EndPos: 4630, }, Value: "bar", }, @@ -10775,27 +10691,27 @@ func TestPhp5(t *testing.T) { Method: &node.Identifier{ Position: &position.Position{ StartLine: 228, - EndLine: 228, - StartPos: 4633, - EndPos: 4635, + EndLine: 228, + StartPos: 4633, + EndPos: 4635, }, Value: "baz", }, ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 228, - EndLine: 228, - StartPos: 4636, - EndPos: 4637, + EndLine: 228, + StartPos: 4636, + EndPos: 4637, }, }, }, Property: &node.Identifier{ Position: &position.Position{ StartLine: 228, - EndLine: 228, - StartPos: 4640, - EndPos: 4643, + EndLine: 228, + StartPos: 4640, + EndPos: 4643, }, Value: "quux", }, @@ -10803,9 +10719,9 @@ func TestPhp5(t *testing.T) { Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 228, - EndLine: 228, - StartPos: 4645, - EndPos: 4645, + EndLine: 228, + StartPos: 4645, + EndPos: 4645, }, Value: "0", }, @@ -10814,44 +10730,44 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 229, - EndLine: 229, - StartPos: 4651, - EndPos: 4666, + EndLine: 229, + StartPos: 4651, + EndPos: 4666, }, Expr: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 229, - EndLine: 229, - StartPos: 4651, - EndPos: 4664, + EndLine: 229, + StartPos: 4651, + EndPos: 4664, }, Variable: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 229, - EndLine: 229, - StartPos: 4651, - EndPos: 4661, + EndLine: 229, + StartPos: 4651, + EndPos: 4661, }, Variable: &expr.MethodCall{ Position: &position.Position{ StartLine: 229, - EndLine: 229, - StartPos: 4651, - EndPos: 4659, + EndLine: 229, + StartPos: 4651, + EndPos: 4659, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 229, - EndLine: 229, - StartPos: 4651, - EndPos: 4652, + EndLine: 229, + StartPos: 4651, + EndPos: 4652, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 229, - EndLine: 229, - StartPos: 4651, - EndPos: 4652, + EndLine: 229, + StartPos: 4651, + EndPos: 4652, }, Value: "a", }, @@ -10859,27 +10775,27 @@ func TestPhp5(t *testing.T) { Method: &node.Identifier{ Position: &position.Position{ StartLine: 229, - EndLine: 229, - StartPos: 4655, - EndPos: 4657, + EndLine: 229, + StartPos: 4655, + EndPos: 4657, }, Value: "foo", }, ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 229, - EndLine: 229, - StartPos: 4658, - EndPos: 4659, + EndLine: 229, + StartPos: 4658, + EndPos: 4659, }, }, }, Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 229, - EndLine: 229, - StartPos: 4661, - EndPos: 4661, + EndLine: 229, + StartPos: 4661, + EndPos: 4661, }, Value: "1", }, @@ -10887,9 +10803,9 @@ func TestPhp5(t *testing.T) { Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 229, - EndLine: 229, - StartPos: 4664, - EndPos: 4664, + EndLine: 229, + StartPos: 4664, + EndPos: 4664, }, Value: "1", }, @@ -10898,40 +10814,40 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 230, - EndLine: 230, - StartPos: 4670, - EndPos: 4678, + EndLine: 230, + StartPos: 4670, + EndPos: 4678, }, Expr: &expr.ShellExec{ Position: &position.Position{ StartLine: 230, - EndLine: 230, - StartPos: 4670, - EndPos: 4677, + EndLine: 230, + StartPos: 4670, + EndPos: 4677, }, Parts: []node.Node{ &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 230, - EndLine: 230, - StartPos: 4671, - EndPos: 4674, + EndLine: 230, + StartPos: 4671, + EndPos: 4674, }, Value: "cmd ", }, &expr.Variable{ Position: &position.Position{ StartLine: 230, - EndLine: 230, - StartPos: 4675, - EndPos: 4676, + EndLine: 230, + StartPos: 4675, + EndPos: 4676, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 230, - EndLine: 230, - StartPos: 4675, - EndPos: 4676, + EndLine: 230, + StartPos: 4675, + EndPos: 4676, }, Value: "a", }, @@ -10942,16 +10858,16 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 231, - EndLine: 231, - StartPos: 4682, - EndPos: 4687, + EndLine: 231, + StartPos: 4682, + EndPos: 4687, }, Expr: &expr.ShellExec{ Position: &position.Position{ StartLine: 231, - EndLine: 231, - StartPos: 4682, - EndPos: 4686, + EndLine: 231, + StartPos: 4682, + EndPos: 4686, }, Parts: []node.Node{ &scalar.EncapsedStringPart{ @@ -10963,67 +10879,65 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 232, - EndLine: 232, - StartPos: 4691, - EndPos: 4693, + EndLine: 232, + StartPos: 4691, + EndPos: 4693, }, Expr: &expr.ShellExec{ Position: &position.Position{ StartLine: 232, - EndLine: 232, - StartPos: 4691, - EndPos: 4692, - }, - Parts: []node.Node{ + EndLine: 232, + StartPos: 4691, + EndPos: 4692, }, + Parts: []node.Node{}, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 233, - EndLine: 233, - StartPos: 4697, - EndPos: 4699, + EndLine: 233, + StartPos: 4697, + EndPos: 4699, }, Expr: &expr.ShortArray{ Position: &position.Position{ StartLine: 233, - EndLine: 233, - StartPos: 4697, - EndPos: 4698, - }, - Items: []node.Node{ + EndLine: 233, + StartPos: 4697, + EndPos: 4698, }, + Items: []node.Node{}, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 234, - EndLine: 234, - StartPos: 4703, - EndPos: 4706, + EndLine: 234, + StartPos: 4703, + EndPos: 4706, }, Expr: &expr.ShortArray{ Position: &position.Position{ StartLine: 234, - EndLine: 234, - StartPos: 4703, - EndPos: 4705, + EndLine: 234, + StartPos: 4703, + EndPos: 4705, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 234, - EndLine: 234, - StartPos: 4704, - EndPos: 4704, + EndLine: 234, + StartPos: 4704, + EndPos: 4704, }, Val: &scalar.Lnumber{ Position: &position.Position{ StartLine: 234, - EndLine: 234, - StartPos: 4704, - EndPos: 4704, + EndLine: 234, + StartPos: 4704, + EndPos: 4704, }, Value: "1", }, @@ -11034,40 +10948,40 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 235, - EndLine: 235, - StartPos: 4710, - EndPos: 4722, + EndLine: 235, + StartPos: 4710, + EndPos: 4722, }, Expr: &expr.ShortArray{ Position: &position.Position{ StartLine: 235, - EndLine: 235, - StartPos: 4710, - EndPos: 4721, + EndLine: 235, + StartPos: 4710, + EndPos: 4721, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 235, - EndLine: 235, - StartPos: 4711, - EndPos: 4714, + EndLine: 235, + StartPos: 4711, + EndPos: 4714, }, Key: &scalar.Lnumber{ Position: &position.Position{ StartLine: 235, - EndLine: 235, - StartPos: 4711, - EndPos: 4711, + EndLine: 235, + StartPos: 4711, + EndPos: 4711, }, Value: "1", }, Val: &scalar.Lnumber{ Position: &position.Position{ StartLine: 235, - EndLine: 235, - StartPos: 4714, - EndPos: 4714, + EndLine: 235, + StartPos: 4714, + EndPos: 4714, }, Value: "1", }, @@ -11075,69 +10989,68 @@ func TestPhp5(t *testing.T) { &expr.ArrayItem{ Position: &position.Position{ StartLine: 235, - EndLine: 235, - StartPos: 4717, - EndPos: 4719, + EndLine: 235, + StartPos: 4717, + EndPos: 4719, }, Val: &expr.Reference{ Position: &position.Position{ StartLine: 235, - EndLine: 235, - StartPos: 4717, - EndPos: 4719, + EndLine: 235, + StartPos: 4717, + EndPos: 4719, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 235, - EndLine: 235, - StartPos: 4718, - EndPos: 4719, + EndLine: 235, + StartPos: 4718, + EndPos: 4719, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 235, - EndLine: 235, - StartPos: 4718, - EndPos: 4719, + EndLine: 235, + StartPos: 4718, + EndPos: 4719, }, Value: "b", }, }, }, }, - &expr.ArrayItem{ - }, + &expr.ArrayItem{}, }, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 237, - EndLine: 237, - StartPos: 4727, - EndPos: 4737, + EndLine: 237, + StartPos: 4727, + EndPos: 4737, }, Expr: &expr.StaticCall{ Position: &position.Position{ StartLine: 237, - EndLine: 237, - StartPos: 4727, - EndPos: 4736, + EndLine: 237, + StartPos: 4727, + EndPos: 4736, }, Class: &name.Name{ Position: &position.Position{ StartLine: 237, - EndLine: 237, - StartPos: 4727, - EndPos: 4729, + EndLine: 237, + StartPos: 4727, + EndPos: 4729, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 237, - EndLine: 237, - StartPos: 4727, - EndPos: 4729, + EndLine: 237, + StartPos: 4727, + EndPos: 4729, }, Value: "Foo", }, @@ -11146,18 +11059,18 @@ func TestPhp5(t *testing.T) { Call: &node.Identifier{ Position: &position.Position{ StartLine: 237, - EndLine: 237, - StartPos: 4732, - EndPos: 4734, + EndLine: 237, + StartPos: 4732, + EndPos: 4734, }, Value: "bar", }, ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 237, - EndLine: 237, - StartPos: 4735, - EndPos: 4736, + EndLine: 237, + StartPos: 4735, + EndPos: 4736, }, }, }, @@ -11165,31 +11078,31 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 238, - EndLine: 238, - StartPos: 4741, - EndPos: 4761, + EndLine: 238, + StartPos: 4741, + EndPos: 4761, }, Expr: &expr.StaticCall{ Position: &position.Position{ StartLine: 238, - EndLine: 238, - StartPos: 4741, - EndPos: 4760, + EndLine: 238, + StartPos: 4741, + EndPos: 4760, }, Class: &name.Relative{ Position: &position.Position{ StartLine: 238, - EndLine: 238, - StartPos: 4741, - EndPos: 4753, + EndLine: 238, + StartPos: 4741, + EndPos: 4753, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 238, - EndLine: 238, - StartPos: 4751, - EndPos: 4753, + EndLine: 238, + StartPos: 4751, + EndPos: 4753, }, Value: "Foo", }, @@ -11198,18 +11111,18 @@ func TestPhp5(t *testing.T) { Call: &node.Identifier{ Position: &position.Position{ StartLine: 238, - EndLine: 238, - StartPos: 4756, - EndPos: 4758, + EndLine: 238, + StartPos: 4756, + EndPos: 4758, }, Value: "bar", }, ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 238, - EndLine: 238, - StartPos: 4759, - EndPos: 4760, + EndLine: 238, + StartPos: 4759, + EndPos: 4760, }, }, }, @@ -11217,31 +11130,31 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 239, - EndLine: 239, - StartPos: 4765, - EndPos: 4776, + EndLine: 239, + StartPos: 4765, + EndPos: 4776, }, Expr: &expr.StaticCall{ Position: &position.Position{ StartLine: 239, - EndLine: 239, - StartPos: 4765, - EndPos: 4775, + EndLine: 239, + StartPos: 4765, + EndPos: 4775, }, Class: &name.FullyQualified{ Position: &position.Position{ StartLine: 239, - EndLine: 239, - StartPos: 4765, - EndPos: 4768, + EndLine: 239, + StartPos: 4765, + EndPos: 4768, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 239, - EndLine: 239, - StartPos: 4766, - EndPos: 4768, + EndLine: 239, + StartPos: 4766, + EndPos: 4768, }, Value: "Foo", }, @@ -11250,18 +11163,18 @@ func TestPhp5(t *testing.T) { Call: &node.Identifier{ Position: &position.Position{ StartLine: 239, - EndLine: 239, - StartPos: 4771, - EndPos: 4773, + EndLine: 239, + StartPos: 4771, + EndPos: 4773, }, Value: "bar", }, ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 239, - EndLine: 239, - StartPos: 4774, - EndPos: 4775, + EndLine: 239, + StartPos: 4774, + EndPos: 4775, }, }, }, @@ -11269,31 +11182,31 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 240, - EndLine: 240, - StartPos: 4780, - EndPos: 4791, + EndLine: 240, + StartPos: 4780, + EndPos: 4791, }, Expr: &expr.StaticCall{ Position: &position.Position{ StartLine: 240, - EndLine: 240, - StartPos: 4780, - EndPos: 4790, + EndLine: 240, + StartPos: 4780, + EndPos: 4790, }, Class: &name.Name{ Position: &position.Position{ StartLine: 240, - EndLine: 240, - StartPos: 4780, - EndPos: 4782, + EndLine: 240, + StartPos: 4780, + EndPos: 4782, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 240, - EndLine: 240, - StartPos: 4780, - EndPos: 4782, + EndLine: 240, + StartPos: 4780, + EndPos: 4782, }, Value: "Foo", }, @@ -11302,16 +11215,16 @@ func TestPhp5(t *testing.T) { Call: &expr.Variable{ Position: &position.Position{ StartLine: 240, - EndLine: 240, - StartPos: 4785, - EndPos: 4788, + EndLine: 240, + StartPos: 4785, + EndPos: 4788, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 240, - EndLine: 240, - StartPos: 4785, - EndPos: 4788, + EndLine: 240, + StartPos: 4785, + EndPos: 4788, }, Value: "bar", }, @@ -11319,9 +11232,9 @@ func TestPhp5(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 240, - EndLine: 240, - StartPos: 4789, - EndPos: 4790, + EndLine: 240, + StartPos: 4789, + EndPos: 4790, }, }, }, @@ -11329,30 +11242,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 241, - EndLine: 241, - StartPos: 4795, - EndPos: 4807, + EndLine: 241, + StartPos: 4795, + EndPos: 4807, }, Expr: &expr.StaticCall{ Position: &position.Position{ StartLine: 241, - EndLine: 241, - StartPos: 4795, - EndPos: 4806, + EndLine: 241, + StartPos: 4795, + EndPos: 4806, }, Class: &expr.Variable{ Position: &position.Position{ StartLine: 241, - EndLine: 241, - StartPos: 4795, - EndPos: 4798, + EndLine: 241, + StartPos: 4795, + EndPos: 4798, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 241, - EndLine: 241, - StartPos: 4795, - EndPos: 4798, + EndLine: 241, + StartPos: 4795, + EndPos: 4798, }, Value: "foo", }, @@ -11360,16 +11273,16 @@ func TestPhp5(t *testing.T) { Call: &expr.Variable{ Position: &position.Position{ StartLine: 241, - EndLine: 241, - StartPos: 4801, - EndPos: 4804, + EndLine: 241, + StartPos: 4801, + EndPos: 4804, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 241, - EndLine: 241, - StartPos: 4801, - EndPos: 4804, + EndLine: 241, + StartPos: 4801, + EndPos: 4804, }, Value: "bar", }, @@ -11377,9 +11290,9 @@ func TestPhp5(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 241, - EndLine: 241, - StartPos: 4805, - EndPos: 4806, + EndLine: 241, + StartPos: 4805, + EndPos: 4806, }, }, }, @@ -11387,31 +11300,31 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 242, - EndLine: 242, - StartPos: 4811, - EndPos: 4820, + EndLine: 242, + StartPos: 4811, + EndPos: 4820, }, Expr: &expr.StaticPropertyFetch{ Position: &position.Position{ StartLine: 242, - EndLine: 242, - StartPos: 4811, - EndPos: 4819, + EndLine: 242, + StartPos: 4811, + EndPos: 4819, }, Class: &name.Name{ Position: &position.Position{ StartLine: 242, - EndLine: 242, - StartPos: 4811, - EndPos: 4813, + EndLine: 242, + StartPos: 4811, + EndPos: 4813, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 242, - EndLine: 242, - StartPos: 4811, - EndPos: 4813, + EndLine: 242, + StartPos: 4811, + EndPos: 4813, }, Value: "Foo", }, @@ -11420,16 +11333,16 @@ func TestPhp5(t *testing.T) { Property: &expr.Variable{ Position: &position.Position{ StartLine: 242, - EndLine: 242, - StartPos: 4816, - EndPos: 4819, + EndLine: 242, + StartPos: 4816, + EndPos: 4819, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 242, - EndLine: 242, - StartPos: 4816, - EndPos: 4819, + EndLine: 242, + StartPos: 4816, + EndPos: 4819, }, Value: "bar", }, @@ -11439,31 +11352,31 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 243, - EndLine: 243, - StartPos: 4824, - EndPos: 4843, + EndLine: 243, + StartPos: 4824, + EndPos: 4843, }, Expr: &expr.StaticPropertyFetch{ Position: &position.Position{ StartLine: 243, - EndLine: 243, - StartPos: 4824, - EndPos: 4842, + EndLine: 243, + StartPos: 4824, + EndPos: 4842, }, Class: &name.Relative{ Position: &position.Position{ StartLine: 243, - EndLine: 243, - StartPos: 4824, - EndPos: 4836, + EndLine: 243, + StartPos: 4824, + EndPos: 4836, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 243, - EndLine: 243, - StartPos: 4834, - EndPos: 4836, + EndLine: 243, + StartPos: 4834, + EndPos: 4836, }, Value: "Foo", }, @@ -11472,16 +11385,16 @@ func TestPhp5(t *testing.T) { Property: &expr.Variable{ Position: &position.Position{ StartLine: 243, - EndLine: 243, - StartPos: 4839, - EndPos: 4842, + EndLine: 243, + StartPos: 4839, + EndPos: 4842, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 243, - EndLine: 243, - StartPos: 4839, - EndPos: 4842, + EndLine: 243, + StartPos: 4839, + EndPos: 4842, }, Value: "bar", }, @@ -11491,31 +11404,31 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 244, - EndLine: 244, - StartPos: 4847, - EndPos: 4857, + EndLine: 244, + StartPos: 4847, + EndPos: 4857, }, Expr: &expr.StaticPropertyFetch{ Position: &position.Position{ StartLine: 244, - EndLine: 244, - StartPos: 4847, - EndPos: 4856, + EndLine: 244, + StartPos: 4847, + EndPos: 4856, }, Class: &name.FullyQualified{ Position: &position.Position{ StartLine: 244, - EndLine: 244, - StartPos: 4847, - EndPos: 4850, + EndLine: 244, + StartPos: 4847, + EndPos: 4850, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 244, - EndLine: 244, - StartPos: 4848, - EndPos: 4850, + EndLine: 244, + StartPos: 4848, + EndPos: 4850, }, Value: "Foo", }, @@ -11524,16 +11437,16 @@ func TestPhp5(t *testing.T) { Property: &expr.Variable{ Position: &position.Position{ StartLine: 244, - EndLine: 244, - StartPos: 4853, - EndPos: 4856, + EndLine: 244, + StartPos: 4853, + EndPos: 4856, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 244, - EndLine: 244, - StartPos: 4853, - EndPos: 4856, + EndLine: 244, + StartPos: 4853, + EndPos: 4856, }, Value: "bar", }, @@ -11543,30 +11456,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 245, - EndLine: 245, - StartPos: 4861, - EndPos: 4873, + EndLine: 245, + StartPos: 4861, + EndPos: 4873, }, Expr: &expr.Ternary{ Position: &position.Position{ StartLine: 245, - EndLine: 245, - StartPos: 4861, - EndPos: 4872, + EndLine: 245, + StartPos: 4861, + EndPos: 4872, }, Condition: &expr.Variable{ Position: &position.Position{ StartLine: 245, - EndLine: 245, - StartPos: 4861, - EndPos: 4862, + EndLine: 245, + StartPos: 4861, + EndPos: 4862, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 245, - EndLine: 245, - StartPos: 4861, - EndPos: 4862, + EndLine: 245, + StartPos: 4861, + EndPos: 4862, }, Value: "a", }, @@ -11574,16 +11487,16 @@ func TestPhp5(t *testing.T) { IfTrue: &expr.Variable{ Position: &position.Position{ StartLine: 245, - EndLine: 245, - StartPos: 4866, - EndPos: 4867, + EndLine: 245, + StartPos: 4866, + EndPos: 4867, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 245, - EndLine: 245, - StartPos: 4866, - EndPos: 4867, + EndLine: 245, + StartPos: 4866, + EndPos: 4867, }, Value: "b", }, @@ -11591,16 +11504,16 @@ func TestPhp5(t *testing.T) { IfFalse: &expr.Variable{ Position: &position.Position{ StartLine: 245, - EndLine: 245, - StartPos: 4871, - EndPos: 4872, + EndLine: 245, + StartPos: 4871, + EndPos: 4872, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 245, - EndLine: 245, - StartPos: 4871, - EndPos: 4872, + EndLine: 245, + StartPos: 4871, + EndPos: 4872, }, Value: "c", }, @@ -11610,30 +11523,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 246, - EndLine: 246, - StartPos: 4877, - EndPos: 4886, + EndLine: 246, + StartPos: 4877, + EndPos: 4886, }, Expr: &expr.Ternary{ Position: &position.Position{ StartLine: 246, - EndLine: 246, - StartPos: 4877, - EndPos: 4885, + EndLine: 246, + StartPos: 4877, + EndPos: 4885, }, Condition: &expr.Variable{ Position: &position.Position{ StartLine: 246, - EndLine: 246, - StartPos: 4877, - EndPos: 4878, + EndLine: 246, + StartPos: 4877, + EndPos: 4878, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 246, - EndLine: 246, - StartPos: 4877, - EndPos: 4878, + EndLine: 246, + StartPos: 4877, + EndPos: 4878, }, Value: "a", }, @@ -11641,16 +11554,16 @@ func TestPhp5(t *testing.T) { IfFalse: &expr.Variable{ Position: &position.Position{ StartLine: 246, - EndLine: 246, - StartPos: 4884, - EndPos: 4885, + EndLine: 246, + StartPos: 4884, + EndPos: 4885, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 246, - EndLine: 246, - StartPos: 4884, - EndPos: 4885, + EndLine: 246, + StartPos: 4884, + EndPos: 4885, }, Value: "c", }, @@ -11660,30 +11573,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 247, - EndLine: 247, - StartPos: 4890, - EndPos: 4912, + EndLine: 247, + StartPos: 4890, + EndPos: 4912, }, Expr: &expr.Ternary{ Position: &position.Position{ StartLine: 247, - EndLine: 247, - StartPos: 4890, - EndPos: 4911, + EndLine: 247, + StartPos: 4890, + EndPos: 4911, }, Condition: &expr.Variable{ Position: &position.Position{ StartLine: 247, - EndLine: 247, - StartPos: 4890, - EndPos: 4891, + EndLine: 247, + StartPos: 4890, + EndPos: 4891, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 247, - EndLine: 247, - StartPos: 4890, - EndPos: 4891, + EndLine: 247, + StartPos: 4890, + EndPos: 4891, }, Value: "a", }, @@ -11691,23 +11604,23 @@ func TestPhp5(t *testing.T) { IfTrue: &expr.Ternary{ Position: &position.Position{ StartLine: 247, - EndLine: 247, - StartPos: 4895, - EndPos: 4906, + EndLine: 247, + StartPos: 4895, + EndPos: 4906, }, Condition: &expr.Variable{ Position: &position.Position{ StartLine: 247, - EndLine: 247, - StartPos: 4895, - EndPos: 4896, + EndLine: 247, + StartPos: 4895, + EndPos: 4896, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 247, - EndLine: 247, - StartPos: 4895, - EndPos: 4896, + EndLine: 247, + StartPos: 4895, + EndPos: 4896, }, Value: "b", }, @@ -11715,16 +11628,16 @@ func TestPhp5(t *testing.T) { IfTrue: &expr.Variable{ Position: &position.Position{ StartLine: 247, - EndLine: 247, - StartPos: 4900, - EndPos: 4901, + EndLine: 247, + StartPos: 4900, + EndPos: 4901, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 247, - EndLine: 247, - StartPos: 4900, - EndPos: 4901, + EndLine: 247, + StartPos: 4900, + EndPos: 4901, }, Value: "c", }, @@ -11732,16 +11645,16 @@ func TestPhp5(t *testing.T) { IfFalse: &expr.Variable{ Position: &position.Position{ StartLine: 247, - EndLine: 247, - StartPos: 4905, - EndPos: 4906, + EndLine: 247, + StartPos: 4905, + EndPos: 4906, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 247, - EndLine: 247, - StartPos: 4905, - EndPos: 4906, + EndLine: 247, + StartPos: 4905, + EndPos: 4906, }, Value: "d", }, @@ -11750,16 +11663,16 @@ func TestPhp5(t *testing.T) { IfFalse: &expr.Variable{ Position: &position.Position{ StartLine: 247, - EndLine: 247, - StartPos: 4910, - EndPos: 4911, + EndLine: 247, + StartPos: 4910, + EndPos: 4911, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 247, - EndLine: 247, - StartPos: 4910, - EndPos: 4911, + EndLine: 247, + StartPos: 4910, + EndPos: 4911, }, Value: "e", }, @@ -11769,37 +11682,37 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 248, - EndLine: 248, - StartPos: 4916, - EndPos: 4938, + EndLine: 248, + StartPos: 4916, + EndPos: 4938, }, Expr: &expr.Ternary{ Position: &position.Position{ StartLine: 248, - EndLine: 248, - StartPos: 4916, - EndPos: 4937, + EndLine: 248, + StartPos: 4916, + EndPos: 4937, }, Condition: &expr.Ternary{ Position: &position.Position{ StartLine: 248, - EndLine: 248, - StartPos: 4916, - EndPos: 4927, + EndLine: 248, + StartPos: 4916, + EndPos: 4927, }, Condition: &expr.Variable{ Position: &position.Position{ StartLine: 248, - EndLine: 248, - StartPos: 4916, - EndPos: 4917, + EndLine: 248, + StartPos: 4916, + EndPos: 4917, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 248, - EndLine: 248, - StartPos: 4916, - EndPos: 4917, + EndLine: 248, + StartPos: 4916, + EndPos: 4917, }, Value: "a", }, @@ -11807,16 +11720,16 @@ func TestPhp5(t *testing.T) { IfTrue: &expr.Variable{ Position: &position.Position{ StartLine: 248, - EndLine: 248, - StartPos: 4921, - EndPos: 4922, + EndLine: 248, + StartPos: 4921, + EndPos: 4922, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 248, - EndLine: 248, - StartPos: 4921, - EndPos: 4922, + EndLine: 248, + StartPos: 4921, + EndPos: 4922, }, Value: "b", }, @@ -11824,16 +11737,16 @@ func TestPhp5(t *testing.T) { IfFalse: &expr.Variable{ Position: &position.Position{ StartLine: 248, - EndLine: 248, - StartPos: 4926, - EndPos: 4927, + EndLine: 248, + StartPos: 4926, + EndPos: 4927, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 248, - EndLine: 248, - StartPos: 4926, - EndPos: 4927, + EndLine: 248, + StartPos: 4926, + EndPos: 4927, }, Value: "c", }, @@ -11842,16 +11755,16 @@ func TestPhp5(t *testing.T) { IfTrue: &expr.Variable{ Position: &position.Position{ StartLine: 248, - EndLine: 248, - StartPos: 4931, - EndPos: 4932, + EndLine: 248, + StartPos: 4931, + EndPos: 4932, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 248, - EndLine: 248, - StartPos: 4931, - EndPos: 4932, + EndLine: 248, + StartPos: 4931, + EndPos: 4932, }, Value: "d", }, @@ -11859,16 +11772,16 @@ func TestPhp5(t *testing.T) { IfFalse: &expr.Variable{ Position: &position.Position{ StartLine: 248, - EndLine: 248, - StartPos: 4936, - EndPos: 4937, + EndLine: 248, + StartPos: 4936, + EndPos: 4937, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 248, - EndLine: 248, - StartPos: 4936, - EndPos: 4937, + EndLine: 248, + StartPos: 4936, + EndPos: 4937, }, Value: "e", }, @@ -11878,30 +11791,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 249, - EndLine: 249, - StartPos: 4942, - EndPos: 4945, + EndLine: 249, + StartPos: 4942, + EndPos: 4945, }, Expr: &expr.UnaryMinus{ Position: &position.Position{ StartLine: 249, - EndLine: 249, - StartPos: 4942, - EndPos: 4944, + EndLine: 249, + StartPos: 4942, + EndPos: 4944, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 249, - EndLine: 249, - StartPos: 4943, - EndPos: 4944, + EndLine: 249, + StartPos: 4943, + EndPos: 4944, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 249, - EndLine: 249, - StartPos: 4943, - EndPos: 4944, + EndLine: 249, + StartPos: 4943, + EndPos: 4944, }, Value: "a", }, @@ -11911,30 +11824,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 250, - EndLine: 250, - StartPos: 4949, - EndPos: 4952, + EndLine: 250, + StartPos: 4949, + EndPos: 4952, }, Expr: &expr.UnaryPlus{ Position: &position.Position{ StartLine: 250, - EndLine: 250, - StartPos: 4949, - EndPos: 4951, + EndLine: 250, + StartPos: 4949, + EndPos: 4951, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 250, - EndLine: 250, - StartPos: 4950, - EndPos: 4951, + EndLine: 250, + StartPos: 4950, + EndPos: 4951, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 250, - EndLine: 250, - StartPos: 4950, - EndPos: 4951, + EndLine: 250, + StartPos: 4950, + EndPos: 4951, }, Value: "a", }, @@ -11944,30 +11857,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 251, - EndLine: 251, - StartPos: 4956, - EndPos: 4959, + EndLine: 251, + StartPos: 4956, + EndPos: 4959, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 251, - EndLine: 251, - StartPos: 4956, - EndPos: 4958, + EndLine: 251, + StartPos: 4956, + EndPos: 4958, }, VarName: &expr.Variable{ Position: &position.Position{ StartLine: 251, - EndLine: 251, - StartPos: 4957, - EndPos: 4958, + EndLine: 251, + StartPos: 4957, + EndPos: 4958, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 251, - EndLine: 251, - StartPos: 4957, - EndPos: 4958, + EndLine: 251, + StartPos: 4957, + EndPos: 4958, }, Value: "a", }, @@ -11977,37 +11890,37 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 252, - EndLine: 252, - StartPos: 4963, - EndPos: 4967, + EndLine: 252, + StartPos: 4963, + EndPos: 4967, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 252, - EndLine: 252, - StartPos: 4963, - EndPos: 4966, + EndLine: 252, + StartPos: 4963, + EndPos: 4966, }, VarName: &expr.Variable{ Position: &position.Position{ StartLine: 252, - EndLine: 252, - StartPos: 4964, - EndPos: 4966, + EndLine: 252, + StartPos: 4964, + EndPos: 4966, }, VarName: &expr.Variable{ Position: &position.Position{ StartLine: 252, - EndLine: 252, - StartPos: 4965, - EndPos: 4966, + EndLine: 252, + StartPos: 4965, + EndPos: 4966, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 252, - EndLine: 252, - StartPos: 4965, - EndPos: 4966, + EndLine: 252, + StartPos: 4965, + EndPos: 4966, }, Value: "a", }, @@ -12018,46 +11931,46 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 253, - EndLine: 253, - StartPos: 4971, - EndPos: 4976, + EndLine: 253, + StartPos: 4971, + EndPos: 4976, }, Expr: &expr.Yield{ Position: &position.Position{ StartLine: 253, - EndLine: 253, - StartPos: 4971, - EndPos: 4975, + EndLine: 253, + StartPos: 4971, + EndPos: 4975, }, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 254, - EndLine: 254, - StartPos: 4980, - EndPos: 4988, + EndLine: 254, + StartPos: 4980, + EndPos: 4988, }, Expr: &expr.Yield{ Position: &position.Position{ StartLine: 254, - EndLine: 254, - StartPos: 4980, - EndPos: 4987, + EndLine: 254, + StartPos: 4980, + EndPos: 4987, }, Value: &expr.Variable{ Position: &position.Position{ StartLine: 254, - EndLine: 254, - StartPos: 4986, - EndPos: 4987, + EndLine: 254, + StartPos: 4986, + EndPos: 4987, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 254, - EndLine: 254, - StartPos: 4986, - EndPos: 4987, + EndLine: 254, + StartPos: 4986, + EndPos: 4987, }, Value: "a", }, @@ -12067,30 +11980,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 255, - EndLine: 255, - StartPos: 4992, - EndPos: 5006, + EndLine: 255, + StartPos: 4992, + EndPos: 5006, }, Expr: &expr.Yield{ Position: &position.Position{ StartLine: 255, - EndLine: 255, - StartPos: 4992, - EndPos: 5005, + EndLine: 255, + StartPos: 4992, + EndPos: 5005, }, Key: &expr.Variable{ Position: &position.Position{ StartLine: 255, - EndLine: 255, - StartPos: 4998, - EndPos: 4999, + EndLine: 255, + StartPos: 4998, + EndPos: 4999, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 255, - EndLine: 255, - StartPos: 4998, - EndPos: 4999, + EndLine: 255, + StartPos: 4998, + EndPos: 4999, }, Value: "a", }, @@ -12098,16 +12011,16 @@ func TestPhp5(t *testing.T) { Value: &expr.Variable{ Position: &position.Position{ StartLine: 255, - EndLine: 255, - StartPos: 5004, - EndPos: 5005, + EndLine: 255, + StartPos: 5004, + EndPos: 5005, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 255, - EndLine: 255, - StartPos: 5004, - EndPos: 5005, + EndLine: 255, + StartPos: 5004, + EndPos: 5005, }, Value: "b", }, @@ -12117,38 +12030,38 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 256, - EndLine: 256, - StartPos: 5010, - EndPos: 5026, + EndLine: 256, + StartPos: 5010, + EndPos: 5026, }, Expr: &expr.Yield{ Position: &position.Position{ StartLine: 256, - EndLine: 256, - StartPos: 5010, - EndPos: 5025, + EndLine: 256, + StartPos: 5010, + EndPos: 5025, }, Value: &expr.ClassConstFetch{ Position: &position.Position{ StartLine: 256, - EndLine: 256, - StartPos: 5016, - EndPos: 5025, + EndLine: 256, + StartPos: 5016, + EndPos: 5025, }, Class: &name.Name{ Position: &position.Position{ StartLine: 256, - EndLine: 256, - StartPos: 5016, - EndPos: 5018, + EndLine: 256, + StartPos: 5016, + EndPos: 5018, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 256, - EndLine: 256, - StartPos: 5016, - EndPos: 5018, + EndLine: 256, + StartPos: 5016, + EndPos: 5018, }, Value: "Foo", }, @@ -12157,9 +12070,9 @@ func TestPhp5(t *testing.T) { ConstantName: &node.Identifier{ Position: &position.Position{ StartLine: 256, - EndLine: 256, - StartPos: 5021, - EndPos: 5025, + EndLine: 256, + StartPos: 5021, + EndPos: 5025, }, Value: "class", }, @@ -12169,30 +12082,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 257, - EndLine: 257, - StartPos: 5030, - EndPos: 5052, + EndLine: 257, + StartPos: 5030, + EndPos: 5052, }, Expr: &expr.Yield{ Position: &position.Position{ StartLine: 257, - EndLine: 257, - StartPos: 5030, - EndPos: 5051, + EndLine: 257, + StartPos: 5030, + EndPos: 5051, }, Key: &expr.Variable{ Position: &position.Position{ StartLine: 257, - EndLine: 257, - StartPos: 5036, - EndPos: 5037, + EndLine: 257, + StartPos: 5036, + EndPos: 5037, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 257, - EndLine: 257, - StartPos: 5036, - EndPos: 5037, + EndLine: 257, + StartPos: 5036, + EndPos: 5037, }, Value: "a", }, @@ -12200,24 +12113,24 @@ func TestPhp5(t *testing.T) { Value: &expr.ClassConstFetch{ Position: &position.Position{ StartLine: 257, - EndLine: 257, - StartPos: 5042, - EndPos: 5051, + EndLine: 257, + StartPos: 5042, + EndPos: 5051, }, Class: &name.Name{ Position: &position.Position{ StartLine: 257, - EndLine: 257, - StartPos: 5042, - EndPos: 5044, + EndLine: 257, + StartPos: 5042, + EndPos: 5044, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 257, - EndLine: 257, - StartPos: 5042, - EndPos: 5044, + EndLine: 257, + StartPos: 5042, + EndPos: 5044, }, Value: "Foo", }, @@ -12226,9 +12139,9 @@ func TestPhp5(t *testing.T) { ConstantName: &node.Identifier{ Position: &position.Position{ StartLine: 257, - EndLine: 257, - StartPos: 5047, - EndPos: 5051, + EndLine: 257, + StartPos: 5047, + EndPos: 5051, }, Value: "class", }, @@ -12238,30 +12151,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 259, - EndLine: 259, - StartPos: 5059, - EndPos: 5068, + EndLine: 259, + StartPos: 5059, + EndPos: 5068, }, Expr: &cast.Array{ Position: &position.Position{ StartLine: 259, - EndLine: 259, - StartPos: 5059, - EndPos: 5067, + EndLine: 259, + StartPos: 5059, + EndPos: 5067, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 259, - EndLine: 259, - StartPos: 5066, - EndPos: 5067, + EndLine: 259, + StartPos: 5066, + EndPos: 5067, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 259, - EndLine: 259, - StartPos: 5066, - EndPos: 5067, + EndLine: 259, + StartPos: 5066, + EndPos: 5067, }, Value: "a", }, @@ -12271,30 +12184,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 260, - EndLine: 260, - StartPos: 5072, - EndPos: 5083, + EndLine: 260, + StartPos: 5072, + EndPos: 5083, }, Expr: &cast.Bool{ Position: &position.Position{ StartLine: 260, - EndLine: 260, - StartPos: 5072, - EndPos: 5082, + EndLine: 260, + StartPos: 5072, + EndPos: 5082, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 260, - EndLine: 260, - StartPos: 5081, - EndPos: 5082, + EndLine: 260, + StartPos: 5081, + EndPos: 5082, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 260, - EndLine: 260, - StartPos: 5081, - EndPos: 5082, + EndLine: 260, + StartPos: 5081, + EndPos: 5082, }, Value: "a", }, @@ -12304,30 +12217,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 261, - EndLine: 261, - StartPos: 5087, - EndPos: 5095, + EndLine: 261, + StartPos: 5087, + EndPos: 5095, }, Expr: &cast.Bool{ Position: &position.Position{ StartLine: 261, - EndLine: 261, - StartPos: 5087, - EndPos: 5094, + EndLine: 261, + StartPos: 5087, + EndPos: 5094, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 261, - EndLine: 261, - StartPos: 5093, - EndPos: 5094, + EndLine: 261, + StartPos: 5093, + EndPos: 5094, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 261, - EndLine: 261, - StartPos: 5093, - EndPos: 5094, + EndLine: 261, + StartPos: 5093, + EndPos: 5094, }, Value: "a", }, @@ -12337,30 +12250,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 262, - EndLine: 262, - StartPos: 5099, - EndPos: 5109, + EndLine: 262, + StartPos: 5099, + EndPos: 5109, }, Expr: &cast.Double{ Position: &position.Position{ StartLine: 262, - EndLine: 262, - StartPos: 5099, - EndPos: 5108, + EndLine: 262, + StartPos: 5099, + EndPos: 5108, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 262, - EndLine: 262, - StartPos: 5107, - EndPos: 5108, + EndLine: 262, + StartPos: 5107, + EndPos: 5108, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 262, - EndLine: 262, - StartPos: 5107, - EndPos: 5108, + EndLine: 262, + StartPos: 5107, + EndPos: 5108, }, Value: "a", }, @@ -12370,30 +12283,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 263, - EndLine: 263, - StartPos: 5113, - EndPos: 5122, + EndLine: 263, + StartPos: 5113, + EndPos: 5122, }, Expr: &cast.Double{ Position: &position.Position{ StartLine: 263, - EndLine: 263, - StartPos: 5113, - EndPos: 5121, + EndLine: 263, + StartPos: 5113, + EndPos: 5121, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 263, - EndLine: 263, - StartPos: 5120, - EndPos: 5121, + EndLine: 263, + StartPos: 5120, + EndPos: 5121, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 263, - EndLine: 263, - StartPos: 5120, - EndPos: 5121, + EndLine: 263, + StartPos: 5120, + EndPos: 5121, }, Value: "a", }, @@ -12403,30 +12316,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 264, - EndLine: 264, - StartPos: 5126, - EndPos: 5137, + EndLine: 264, + StartPos: 5126, + EndPos: 5137, }, Expr: &cast.Int{ Position: &position.Position{ StartLine: 264, - EndLine: 264, - StartPos: 5126, - EndPos: 5136, + EndLine: 264, + StartPos: 5126, + EndPos: 5136, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 264, - EndLine: 264, - StartPos: 5135, - EndPos: 5136, + EndLine: 264, + StartPos: 5135, + EndPos: 5136, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 264, - EndLine: 264, - StartPos: 5135, - EndPos: 5136, + EndLine: 264, + StartPos: 5135, + EndPos: 5136, }, Value: "a", }, @@ -12436,30 +12349,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 265, - EndLine: 265, - StartPos: 5141, - EndPos: 5148, + EndLine: 265, + StartPos: 5141, + EndPos: 5148, }, Expr: &cast.Int{ Position: &position.Position{ StartLine: 265, - EndLine: 265, - StartPos: 5141, - EndPos: 5147, + EndLine: 265, + StartPos: 5141, + EndPos: 5147, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 265, - EndLine: 265, - StartPos: 5146, - EndPos: 5147, + EndLine: 265, + StartPos: 5146, + EndPos: 5147, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 265, - EndLine: 265, - StartPos: 5146, - EndPos: 5147, + EndLine: 265, + StartPos: 5146, + EndPos: 5147, }, Value: "a", }, @@ -12469,30 +12382,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 266, - EndLine: 266, - StartPos: 5152, - EndPos: 5162, + EndLine: 266, + StartPos: 5152, + EndPos: 5162, }, Expr: &cast.Object{ Position: &position.Position{ StartLine: 266, - EndLine: 266, - StartPos: 5152, - EndPos: 5161, + EndLine: 266, + StartPos: 5152, + EndPos: 5161, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 266, - EndLine: 266, - StartPos: 5160, - EndPos: 5161, + EndLine: 266, + StartPos: 5160, + EndPos: 5161, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 266, - EndLine: 266, - StartPos: 5160, - EndPos: 5161, + EndLine: 266, + StartPos: 5160, + EndPos: 5161, }, Value: "a", }, @@ -12502,30 +12415,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 267, - EndLine: 267, - StartPos: 5166, - EndPos: 5176, + EndLine: 267, + StartPos: 5166, + EndPos: 5176, }, Expr: &cast.String{ Position: &position.Position{ StartLine: 267, - EndLine: 267, - StartPos: 5166, - EndPos: 5175, + EndLine: 267, + StartPos: 5166, + EndPos: 5175, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 267, - EndLine: 267, - StartPos: 5174, - EndPos: 5175, + EndLine: 267, + StartPos: 5174, + EndPos: 5175, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 267, - EndLine: 267, - StartPos: 5174, - EndPos: 5175, + EndLine: 267, + StartPos: 5174, + EndPos: 5175, }, Value: "a", }, @@ -12535,30 +12448,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 268, - EndLine: 268, - StartPos: 5180, - EndPos: 5189, + EndLine: 268, + StartPos: 5180, + EndPos: 5189, }, Expr: &cast.Unset{ Position: &position.Position{ StartLine: 268, - EndLine: 268, - StartPos: 5180, - EndPos: 5188, + EndLine: 268, + StartPos: 5180, + EndPos: 5188, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 268, - EndLine: 268, - StartPos: 5187, - EndPos: 5188, + EndLine: 268, + StartPos: 5187, + EndPos: 5188, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 268, - EndLine: 268, - StartPos: 5187, - EndPos: 5188, + EndLine: 268, + StartPos: 5187, + EndPos: 5188, }, Value: "a", }, @@ -12568,30 +12481,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 270, - EndLine: 270, - StartPos: 5194, - EndPos: 5201, + EndLine: 270, + StartPos: 5194, + EndPos: 5201, }, Expr: &binary.BitwiseAnd{ Position: &position.Position{ StartLine: 270, - EndLine: 270, - StartPos: 5194, - EndPos: 5200, + EndLine: 270, + StartPos: 5194, + EndPos: 5200, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 270, - EndLine: 270, - StartPos: 5194, - EndPos: 5195, + EndLine: 270, + StartPos: 5194, + EndPos: 5195, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 270, - EndLine: 270, - StartPos: 5194, - EndPos: 5195, + EndLine: 270, + StartPos: 5194, + EndPos: 5195, }, Value: "a", }, @@ -12599,16 +12512,16 @@ func TestPhp5(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 270, - EndLine: 270, - StartPos: 5199, - EndPos: 5200, + EndLine: 270, + StartPos: 5199, + EndPos: 5200, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 270, - EndLine: 270, - StartPos: 5199, - EndPos: 5200, + EndLine: 270, + StartPos: 5199, + EndPos: 5200, }, Value: "b", }, @@ -12618,30 +12531,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 271, - EndLine: 271, - StartPos: 5205, - EndPos: 5212, + EndLine: 271, + StartPos: 5205, + EndPos: 5212, }, Expr: &binary.BitwiseOr{ Position: &position.Position{ StartLine: 271, - EndLine: 271, - StartPos: 5205, - EndPos: 5211, + EndLine: 271, + StartPos: 5205, + EndPos: 5211, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 271, - EndLine: 271, - StartPos: 5205, - EndPos: 5206, + EndLine: 271, + StartPos: 5205, + EndPos: 5206, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 271, - EndLine: 271, - StartPos: 5205, - EndPos: 5206, + EndLine: 271, + StartPos: 5205, + EndPos: 5206, }, Value: "a", }, @@ -12649,16 +12562,16 @@ func TestPhp5(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 271, - EndLine: 271, - StartPos: 5210, - EndPos: 5211, + EndLine: 271, + StartPos: 5210, + EndPos: 5211, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 271, - EndLine: 271, - StartPos: 5210, - EndPos: 5211, + EndLine: 271, + StartPos: 5210, + EndPos: 5211, }, Value: "b", }, @@ -12668,30 +12581,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 272, - EndLine: 272, - StartPos: 5216, - EndPos: 5223, + EndLine: 272, + StartPos: 5216, + EndPos: 5223, }, Expr: &binary.BitwiseXor{ Position: &position.Position{ StartLine: 272, - EndLine: 272, - StartPos: 5216, - EndPos: 5222, + EndLine: 272, + StartPos: 5216, + EndPos: 5222, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 272, - EndLine: 272, - StartPos: 5216, - EndPos: 5217, + EndLine: 272, + StartPos: 5216, + EndPos: 5217, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 272, - EndLine: 272, - StartPos: 5216, - EndPos: 5217, + EndLine: 272, + StartPos: 5216, + EndPos: 5217, }, Value: "a", }, @@ -12699,16 +12612,16 @@ func TestPhp5(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 272, - EndLine: 272, - StartPos: 5221, - EndPos: 5222, + EndLine: 272, + StartPos: 5221, + EndPos: 5222, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 272, - EndLine: 272, - StartPos: 5221, - EndPos: 5222, + EndLine: 272, + StartPos: 5221, + EndPos: 5222, }, Value: "b", }, @@ -12718,30 +12631,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 273, - EndLine: 273, - StartPos: 5227, - EndPos: 5235, + EndLine: 273, + StartPos: 5227, + EndPos: 5235, }, Expr: &binary.BooleanAnd{ Position: &position.Position{ StartLine: 273, - EndLine: 273, - StartPos: 5227, - EndPos: 5234, + EndLine: 273, + StartPos: 5227, + EndPos: 5234, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 273, - EndLine: 273, - StartPos: 5227, - EndPos: 5228, + EndLine: 273, + StartPos: 5227, + EndPos: 5228, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 273, - EndLine: 273, - StartPos: 5227, - EndPos: 5228, + EndLine: 273, + StartPos: 5227, + EndPos: 5228, }, Value: "a", }, @@ -12749,16 +12662,16 @@ func TestPhp5(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 273, - EndLine: 273, - StartPos: 5233, - EndPos: 5234, + EndLine: 273, + StartPos: 5233, + EndPos: 5234, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 273, - EndLine: 273, - StartPos: 5233, - EndPos: 5234, + EndLine: 273, + StartPos: 5233, + EndPos: 5234, }, Value: "b", }, @@ -12768,30 +12681,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 274, - EndLine: 274, - StartPos: 5239, - EndPos: 5247, + EndLine: 274, + StartPos: 5239, + EndPos: 5247, }, Expr: &binary.BooleanOr{ Position: &position.Position{ StartLine: 274, - EndLine: 274, - StartPos: 5239, - EndPos: 5246, + EndLine: 274, + StartPos: 5239, + EndPos: 5246, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 274, - EndLine: 274, - StartPos: 5239, - EndPos: 5240, + EndLine: 274, + StartPos: 5239, + EndPos: 5240, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 274, - EndLine: 274, - StartPos: 5239, - EndPos: 5240, + EndLine: 274, + StartPos: 5239, + EndPos: 5240, }, Value: "a", }, @@ -12799,16 +12712,16 @@ func TestPhp5(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 274, - EndLine: 274, - StartPos: 5245, - EndPos: 5246, + EndLine: 274, + StartPos: 5245, + EndPos: 5246, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 274, - EndLine: 274, - StartPos: 5245, - EndPos: 5246, + EndLine: 274, + StartPos: 5245, + EndPos: 5246, }, Value: "b", }, @@ -12818,30 +12731,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 275, - EndLine: 275, - StartPos: 5251, - EndPos: 5258, + EndLine: 275, + StartPos: 5251, + EndPos: 5258, }, Expr: &binary.Concat{ Position: &position.Position{ StartLine: 275, - EndLine: 275, - StartPos: 5251, - EndPos: 5257, + EndLine: 275, + StartPos: 5251, + EndPos: 5257, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 275, - EndLine: 275, - StartPos: 5251, - EndPos: 5252, + EndLine: 275, + StartPos: 5251, + EndPos: 5252, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 275, - EndLine: 275, - StartPos: 5251, - EndPos: 5252, + EndLine: 275, + StartPos: 5251, + EndPos: 5252, }, Value: "a", }, @@ -12849,16 +12762,16 @@ func TestPhp5(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 275, - EndLine: 275, - StartPos: 5256, - EndPos: 5257, + EndLine: 275, + StartPos: 5256, + EndPos: 5257, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 275, - EndLine: 275, - StartPos: 5256, - EndPos: 5257, + EndLine: 275, + StartPos: 5256, + EndPos: 5257, }, Value: "b", }, @@ -12868,30 +12781,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 276, - EndLine: 276, - StartPos: 5262, - EndPos: 5269, + EndLine: 276, + StartPos: 5262, + EndPos: 5269, }, Expr: &binary.Div{ Position: &position.Position{ StartLine: 276, - EndLine: 276, - StartPos: 5262, - EndPos: 5268, + EndLine: 276, + StartPos: 5262, + EndPos: 5268, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 276, - EndLine: 276, - StartPos: 5262, - EndPos: 5263, + EndLine: 276, + StartPos: 5262, + EndPos: 5263, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 276, - EndLine: 276, - StartPos: 5262, - EndPos: 5263, + EndLine: 276, + StartPos: 5262, + EndPos: 5263, }, Value: "a", }, @@ -12899,16 +12812,16 @@ func TestPhp5(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 276, - EndLine: 276, - StartPos: 5267, - EndPos: 5268, + EndLine: 276, + StartPos: 5267, + EndPos: 5268, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 276, - EndLine: 276, - StartPos: 5267, - EndPos: 5268, + EndLine: 276, + StartPos: 5267, + EndPos: 5268, }, Value: "b", }, @@ -12918,30 +12831,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 277, - EndLine: 277, - StartPos: 5273, - EndPos: 5281, + EndLine: 277, + StartPos: 5273, + EndPos: 5281, }, Expr: &binary.Equal{ Position: &position.Position{ StartLine: 277, - EndLine: 277, - StartPos: 5273, - EndPos: 5280, + EndLine: 277, + StartPos: 5273, + EndPos: 5280, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 277, - EndLine: 277, - StartPos: 5273, - EndPos: 5274, + EndLine: 277, + StartPos: 5273, + EndPos: 5274, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 277, - EndLine: 277, - StartPos: 5273, - EndPos: 5274, + EndLine: 277, + StartPos: 5273, + EndPos: 5274, }, Value: "a", }, @@ -12949,16 +12862,16 @@ func TestPhp5(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 277, - EndLine: 277, - StartPos: 5279, - EndPos: 5280, + EndLine: 277, + StartPos: 5279, + EndPos: 5280, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 277, - EndLine: 277, - StartPos: 5279, - EndPos: 5280, + EndLine: 277, + StartPos: 5279, + EndPos: 5280, }, Value: "b", }, @@ -12968,30 +12881,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 278, - EndLine: 278, - StartPos: 5285, - EndPos: 5293, + EndLine: 278, + StartPos: 5285, + EndPos: 5293, }, Expr: &binary.GreaterOrEqual{ Position: &position.Position{ StartLine: 278, - EndLine: 278, - StartPos: 5285, - EndPos: 5292, + EndLine: 278, + StartPos: 5285, + EndPos: 5292, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 278, - EndLine: 278, - StartPos: 5285, - EndPos: 5286, + EndLine: 278, + StartPos: 5285, + EndPos: 5286, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 278, - EndLine: 278, - StartPos: 5285, - EndPos: 5286, + EndLine: 278, + StartPos: 5285, + EndPos: 5286, }, Value: "a", }, @@ -12999,16 +12912,16 @@ func TestPhp5(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 278, - EndLine: 278, - StartPos: 5291, - EndPos: 5292, + EndLine: 278, + StartPos: 5291, + EndPos: 5292, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 278, - EndLine: 278, - StartPos: 5291, - EndPos: 5292, + EndLine: 278, + StartPos: 5291, + EndPos: 5292, }, Value: "b", }, @@ -13018,30 +12931,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 279, - EndLine: 279, - StartPos: 5297, - EndPos: 5304, + EndLine: 279, + StartPos: 5297, + EndPos: 5304, }, Expr: &binary.Greater{ Position: &position.Position{ StartLine: 279, - EndLine: 279, - StartPos: 5297, - EndPos: 5303, + EndLine: 279, + StartPos: 5297, + EndPos: 5303, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 279, - EndLine: 279, - StartPos: 5297, - EndPos: 5298, + EndLine: 279, + StartPos: 5297, + EndPos: 5298, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 279, - EndLine: 279, - StartPos: 5297, - EndPos: 5298, + EndLine: 279, + StartPos: 5297, + EndPos: 5298, }, Value: "a", }, @@ -13049,16 +12962,16 @@ func TestPhp5(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 279, - EndLine: 279, - StartPos: 5302, - EndPos: 5303, + EndLine: 279, + StartPos: 5302, + EndPos: 5303, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 279, - EndLine: 279, - StartPos: 5302, - EndPos: 5303, + EndLine: 279, + StartPos: 5302, + EndPos: 5303, }, Value: "b", }, @@ -13068,30 +12981,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 280, - EndLine: 280, - StartPos: 5308, - EndPos: 5317, + EndLine: 280, + StartPos: 5308, + EndPos: 5317, }, Expr: &binary.Identical{ Position: &position.Position{ StartLine: 280, - EndLine: 280, - StartPos: 5308, - EndPos: 5316, + EndLine: 280, + StartPos: 5308, + EndPos: 5316, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 280, - EndLine: 280, - StartPos: 5308, - EndPos: 5309, + EndLine: 280, + StartPos: 5308, + EndPos: 5309, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 280, - EndLine: 280, - StartPos: 5308, - EndPos: 5309, + EndLine: 280, + StartPos: 5308, + EndPos: 5309, }, Value: "a", }, @@ -13099,16 +13012,16 @@ func TestPhp5(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 280, - EndLine: 280, - StartPos: 5315, - EndPos: 5316, + EndLine: 280, + StartPos: 5315, + EndPos: 5316, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 280, - EndLine: 280, - StartPos: 5315, - EndPos: 5316, + EndLine: 280, + StartPos: 5315, + EndPos: 5316, }, Value: "b", }, @@ -13118,30 +13031,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 281, - EndLine: 281, - StartPos: 5321, - EndPos: 5330, + EndLine: 281, + StartPos: 5321, + EndPos: 5330, }, Expr: &binary.LogicalAnd{ Position: &position.Position{ StartLine: 281, - EndLine: 281, - StartPos: 5321, - EndPos: 5329, + EndLine: 281, + StartPos: 5321, + EndPos: 5329, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 281, - EndLine: 281, - StartPos: 5321, - EndPos: 5322, + EndLine: 281, + StartPos: 5321, + EndPos: 5322, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 281, - EndLine: 281, - StartPos: 5321, - EndPos: 5322, + EndLine: 281, + StartPos: 5321, + EndPos: 5322, }, Value: "a", }, @@ -13149,16 +13062,16 @@ func TestPhp5(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 281, - EndLine: 281, - StartPos: 5328, - EndPos: 5329, + EndLine: 281, + StartPos: 5328, + EndPos: 5329, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 281, - EndLine: 281, - StartPos: 5328, - EndPos: 5329, + EndLine: 281, + StartPos: 5328, + EndPos: 5329, }, Value: "b", }, @@ -13168,30 +13081,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 282, - EndLine: 282, - StartPos: 5334, - EndPos: 5342, + EndLine: 282, + StartPos: 5334, + EndPos: 5342, }, Expr: &binary.LogicalOr{ Position: &position.Position{ StartLine: 282, - EndLine: 282, - StartPos: 5334, - EndPos: 5341, + EndLine: 282, + StartPos: 5334, + EndPos: 5341, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 282, - EndLine: 282, - StartPos: 5334, - EndPos: 5335, + EndLine: 282, + StartPos: 5334, + EndPos: 5335, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 282, - EndLine: 282, - StartPos: 5334, - EndPos: 5335, + EndLine: 282, + StartPos: 5334, + EndPos: 5335, }, Value: "a", }, @@ -13199,16 +13112,16 @@ func TestPhp5(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 282, - EndLine: 282, - StartPos: 5340, - EndPos: 5341, + EndLine: 282, + StartPos: 5340, + EndPos: 5341, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 282, - EndLine: 282, - StartPos: 5340, - EndPos: 5341, + EndLine: 282, + StartPos: 5340, + EndPos: 5341, }, Value: "b", }, @@ -13218,30 +13131,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 283, - EndLine: 283, - StartPos: 5346, - EndPos: 5355, + EndLine: 283, + StartPos: 5346, + EndPos: 5355, }, Expr: &binary.LogicalXor{ Position: &position.Position{ StartLine: 283, - EndLine: 283, - StartPos: 5346, - EndPos: 5354, + EndLine: 283, + StartPos: 5346, + EndPos: 5354, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 283, - EndLine: 283, - StartPos: 5346, - EndPos: 5347, + EndLine: 283, + StartPos: 5346, + EndPos: 5347, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 283, - EndLine: 283, - StartPos: 5346, - EndPos: 5347, + EndLine: 283, + StartPos: 5346, + EndPos: 5347, }, Value: "a", }, @@ -13249,16 +13162,16 @@ func TestPhp5(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 283, - EndLine: 283, - StartPos: 5353, - EndPos: 5354, + EndLine: 283, + StartPos: 5353, + EndPos: 5354, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 283, - EndLine: 283, - StartPos: 5353, - EndPos: 5354, + EndLine: 283, + StartPos: 5353, + EndPos: 5354, }, Value: "b", }, @@ -13268,30 +13181,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 284, - EndLine: 284, - StartPos: 5359, - EndPos: 5366, + EndLine: 284, + StartPos: 5359, + EndPos: 5366, }, Expr: &binary.Minus{ Position: &position.Position{ StartLine: 284, - EndLine: 284, - StartPos: 5359, - EndPos: 5365, + EndLine: 284, + StartPos: 5359, + EndPos: 5365, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 284, - EndLine: 284, - StartPos: 5359, - EndPos: 5360, + EndLine: 284, + StartPos: 5359, + EndPos: 5360, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 284, - EndLine: 284, - StartPos: 5359, - EndPos: 5360, + EndLine: 284, + StartPos: 5359, + EndPos: 5360, }, Value: "a", }, @@ -13299,16 +13212,16 @@ func TestPhp5(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 284, - EndLine: 284, - StartPos: 5364, - EndPos: 5365, + EndLine: 284, + StartPos: 5364, + EndPos: 5365, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 284, - EndLine: 284, - StartPos: 5364, - EndPos: 5365, + EndLine: 284, + StartPos: 5364, + EndPos: 5365, }, Value: "b", }, @@ -13318,30 +13231,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 285, - EndLine: 285, - StartPos: 5370, - EndPos: 5377, + EndLine: 285, + StartPos: 5370, + EndPos: 5377, }, Expr: &binary.Mod{ Position: &position.Position{ StartLine: 285, - EndLine: 285, - StartPos: 5370, - EndPos: 5376, + EndLine: 285, + StartPos: 5370, + EndPos: 5376, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 285, - EndLine: 285, - StartPos: 5370, - EndPos: 5371, + EndLine: 285, + StartPos: 5370, + EndPos: 5371, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 285, - EndLine: 285, - StartPos: 5370, - EndPos: 5371, + EndLine: 285, + StartPos: 5370, + EndPos: 5371, }, Value: "a", }, @@ -13349,16 +13262,16 @@ func TestPhp5(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 285, - EndLine: 285, - StartPos: 5375, - EndPos: 5376, + EndLine: 285, + StartPos: 5375, + EndPos: 5376, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 285, - EndLine: 285, - StartPos: 5375, - EndPos: 5376, + EndLine: 285, + StartPos: 5375, + EndPos: 5376, }, Value: "b", }, @@ -13368,30 +13281,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 286, - EndLine: 286, - StartPos: 5381, - EndPos: 5388, + EndLine: 286, + StartPos: 5381, + EndPos: 5388, }, Expr: &binary.Mul{ Position: &position.Position{ StartLine: 286, - EndLine: 286, - StartPos: 5381, - EndPos: 5387, + EndLine: 286, + StartPos: 5381, + EndPos: 5387, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 286, - EndLine: 286, - StartPos: 5381, - EndPos: 5382, + EndLine: 286, + StartPos: 5381, + EndPos: 5382, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 286, - EndLine: 286, - StartPos: 5381, - EndPos: 5382, + EndLine: 286, + StartPos: 5381, + EndPos: 5382, }, Value: "a", }, @@ -13399,16 +13312,16 @@ func TestPhp5(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 286, - EndLine: 286, - StartPos: 5386, - EndPos: 5387, + EndLine: 286, + StartPos: 5386, + EndPos: 5387, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 286, - EndLine: 286, - StartPos: 5386, - EndPos: 5387, + EndLine: 286, + StartPos: 5386, + EndPos: 5387, }, Value: "b", }, @@ -13418,30 +13331,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 287, - EndLine: 287, - StartPos: 5392, - EndPos: 5400, + EndLine: 287, + StartPos: 5392, + EndPos: 5400, }, Expr: &binary.NotEqual{ Position: &position.Position{ StartLine: 287, - EndLine: 287, - StartPos: 5392, - EndPos: 5399, + EndLine: 287, + StartPos: 5392, + EndPos: 5399, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 287, - EndLine: 287, - StartPos: 5392, - EndPos: 5393, + EndLine: 287, + StartPos: 5392, + EndPos: 5393, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 287, - EndLine: 287, - StartPos: 5392, - EndPos: 5393, + EndLine: 287, + StartPos: 5392, + EndPos: 5393, }, Value: "a", }, @@ -13449,16 +13362,16 @@ func TestPhp5(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 287, - EndLine: 287, - StartPos: 5398, - EndPos: 5399, + EndLine: 287, + StartPos: 5398, + EndPos: 5399, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 287, - EndLine: 287, - StartPos: 5398, - EndPos: 5399, + EndLine: 287, + StartPos: 5398, + EndPos: 5399, }, Value: "b", }, @@ -13468,30 +13381,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 288, - EndLine: 288, - StartPos: 5404, - EndPos: 5413, + EndLine: 288, + StartPos: 5404, + EndPos: 5413, }, Expr: &binary.NotIdentical{ Position: &position.Position{ StartLine: 288, - EndLine: 288, - StartPos: 5404, - EndPos: 5412, + EndLine: 288, + StartPos: 5404, + EndPos: 5412, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 288, - EndLine: 288, - StartPos: 5404, - EndPos: 5405, + EndLine: 288, + StartPos: 5404, + EndPos: 5405, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 288, - EndLine: 288, - StartPos: 5404, - EndPos: 5405, + EndLine: 288, + StartPos: 5404, + EndPos: 5405, }, Value: "a", }, @@ -13499,16 +13412,16 @@ func TestPhp5(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 288, - EndLine: 288, - StartPos: 5411, - EndPos: 5412, + EndLine: 288, + StartPos: 5411, + EndPos: 5412, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 288, - EndLine: 288, - StartPos: 5411, - EndPos: 5412, + EndLine: 288, + StartPos: 5411, + EndPos: 5412, }, Value: "b", }, @@ -13518,30 +13431,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 289, - EndLine: 289, - StartPos: 5417, - EndPos: 5424, + EndLine: 289, + StartPos: 5417, + EndPos: 5424, }, Expr: &binary.Plus{ Position: &position.Position{ StartLine: 289, - EndLine: 289, - StartPos: 5417, - EndPos: 5423, + EndLine: 289, + StartPos: 5417, + EndPos: 5423, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 289, - EndLine: 289, - StartPos: 5417, - EndPos: 5418, + EndLine: 289, + StartPos: 5417, + EndPos: 5418, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 289, - EndLine: 289, - StartPos: 5417, - EndPos: 5418, + EndLine: 289, + StartPos: 5417, + EndPos: 5418, }, Value: "a", }, @@ -13549,16 +13462,16 @@ func TestPhp5(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 289, - EndLine: 289, - StartPos: 5422, - EndPos: 5423, + EndLine: 289, + StartPos: 5422, + EndPos: 5423, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 289, - EndLine: 289, - StartPos: 5422, - EndPos: 5423, + EndLine: 289, + StartPos: 5422, + EndPos: 5423, }, Value: "b", }, @@ -13568,30 +13481,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 290, - EndLine: 290, - StartPos: 5428, - EndPos: 5436, + EndLine: 290, + StartPos: 5428, + EndPos: 5436, }, Expr: &binary.Pow{ Position: &position.Position{ StartLine: 290, - EndLine: 290, - StartPos: 5428, - EndPos: 5435, + EndLine: 290, + StartPos: 5428, + EndPos: 5435, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 290, - EndLine: 290, - StartPos: 5428, - EndPos: 5429, + EndLine: 290, + StartPos: 5428, + EndPos: 5429, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 290, - EndLine: 290, - StartPos: 5428, - EndPos: 5429, + EndLine: 290, + StartPos: 5428, + EndPos: 5429, }, Value: "a", }, @@ -13599,16 +13512,16 @@ func TestPhp5(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 290, - EndLine: 290, - StartPos: 5434, - EndPos: 5435, + EndLine: 290, + StartPos: 5434, + EndPos: 5435, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 290, - EndLine: 290, - StartPos: 5434, - EndPos: 5435, + EndLine: 290, + StartPos: 5434, + EndPos: 5435, }, Value: "b", }, @@ -13618,30 +13531,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 291, - EndLine: 291, - StartPos: 5440, - EndPos: 5448, + EndLine: 291, + StartPos: 5440, + EndPos: 5448, }, Expr: &binary.ShiftLeft{ Position: &position.Position{ StartLine: 291, - EndLine: 291, - StartPos: 5440, - EndPos: 5447, + EndLine: 291, + StartPos: 5440, + EndPos: 5447, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 291, - EndLine: 291, - StartPos: 5440, - EndPos: 5441, + EndLine: 291, + StartPos: 5440, + EndPos: 5441, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 291, - EndLine: 291, - StartPos: 5440, - EndPos: 5441, + EndLine: 291, + StartPos: 5440, + EndPos: 5441, }, Value: "a", }, @@ -13649,16 +13562,16 @@ func TestPhp5(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 291, - EndLine: 291, - StartPos: 5446, - EndPos: 5447, + EndLine: 291, + StartPos: 5446, + EndPos: 5447, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 291, - EndLine: 291, - StartPos: 5446, - EndPos: 5447, + EndLine: 291, + StartPos: 5446, + EndPos: 5447, }, Value: "b", }, @@ -13668,30 +13581,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 292, - EndLine: 292, - StartPos: 5452, - EndPos: 5460, + EndLine: 292, + StartPos: 5452, + EndPos: 5460, }, Expr: &binary.ShiftRight{ Position: &position.Position{ StartLine: 292, - EndLine: 292, - StartPos: 5452, - EndPos: 5459, + EndLine: 292, + StartPos: 5452, + EndPos: 5459, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 292, - EndLine: 292, - StartPos: 5452, - EndPos: 5453, + EndLine: 292, + StartPos: 5452, + EndPos: 5453, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 292, - EndLine: 292, - StartPos: 5452, - EndPos: 5453, + EndLine: 292, + StartPos: 5452, + EndPos: 5453, }, Value: "a", }, @@ -13699,16 +13612,16 @@ func TestPhp5(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 292, - EndLine: 292, - StartPos: 5458, - EndPos: 5459, + EndLine: 292, + StartPos: 5458, + EndPos: 5459, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 292, - EndLine: 292, - StartPos: 5458, - EndPos: 5459, + EndLine: 292, + StartPos: 5458, + EndPos: 5459, }, Value: "b", }, @@ -13718,30 +13631,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 293, - EndLine: 293, - StartPos: 5464, - EndPos: 5472, + EndLine: 293, + StartPos: 5464, + EndPos: 5472, }, Expr: &binary.SmallerOrEqual{ Position: &position.Position{ StartLine: 293, - EndLine: 293, - StartPos: 5464, - EndPos: 5471, + EndLine: 293, + StartPos: 5464, + EndPos: 5471, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 293, - EndLine: 293, - StartPos: 5464, - EndPos: 5465, + EndLine: 293, + StartPos: 5464, + EndPos: 5465, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 293, - EndLine: 293, - StartPos: 5464, - EndPos: 5465, + EndLine: 293, + StartPos: 5464, + EndPos: 5465, }, Value: "a", }, @@ -13749,16 +13662,16 @@ func TestPhp5(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 293, - EndLine: 293, - StartPos: 5470, - EndPos: 5471, + EndLine: 293, + StartPos: 5470, + EndPos: 5471, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 293, - EndLine: 293, - StartPos: 5470, - EndPos: 5471, + EndLine: 293, + StartPos: 5470, + EndPos: 5471, }, Value: "b", }, @@ -13768,30 +13681,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 294, - EndLine: 294, - StartPos: 5476, - EndPos: 5483, + EndLine: 294, + StartPos: 5476, + EndPos: 5483, }, Expr: &binary.Smaller{ Position: &position.Position{ StartLine: 294, - EndLine: 294, - StartPos: 5476, - EndPos: 5482, + EndLine: 294, + StartPos: 5476, + EndPos: 5482, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 294, - EndLine: 294, - StartPos: 5476, - EndPos: 5477, + EndLine: 294, + StartPos: 5476, + EndPos: 5477, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 294, - EndLine: 294, - StartPos: 5476, - EndPos: 5477, + EndLine: 294, + StartPos: 5476, + EndPos: 5477, }, Value: "a", }, @@ -13799,16 +13712,16 @@ func TestPhp5(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 294, - EndLine: 294, - StartPos: 5481, - EndPos: 5482, + EndLine: 294, + StartPos: 5481, + EndPos: 5482, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 294, - EndLine: 294, - StartPos: 5481, - EndPos: 5482, + EndLine: 294, + StartPos: 5481, + EndPos: 5482, }, Value: "b", }, @@ -13818,30 +13731,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 296, - EndLine: 296, - StartPos: 5488, - EndPos: 5496, + EndLine: 296, + StartPos: 5488, + EndPos: 5496, }, Expr: &assign.Reference{ Position: &position.Position{ StartLine: 296, - EndLine: 296, - StartPos: 5488, - EndPos: 5495, + EndLine: 296, + StartPos: 5488, + EndPos: 5495, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 296, - EndLine: 296, - StartPos: 5488, - EndPos: 5489, + EndLine: 296, + StartPos: 5488, + EndPos: 5489, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 296, - EndLine: 296, - StartPos: 5488, - EndPos: 5489, + EndLine: 296, + StartPos: 5488, + EndPos: 5489, }, Value: "a", }, @@ -13849,16 +13762,16 @@ func TestPhp5(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 296, - EndLine: 296, - StartPos: 5494, - EndPos: 5495, + EndLine: 296, + StartPos: 5494, + EndPos: 5495, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 296, - EndLine: 296, - StartPos: 5494, - EndPos: 5495, + EndLine: 296, + StartPos: 5494, + EndPos: 5495, }, Value: "b", }, @@ -13868,30 +13781,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 297, - EndLine: 297, - StartPos: 5500, - EndPos: 5513, + EndLine: 297, + StartPos: 5500, + EndPos: 5513, }, Expr: &assign.Reference{ Position: &position.Position{ StartLine: 297, - EndLine: 297, - StartPos: 5500, - EndPos: 5512, + EndLine: 297, + StartPos: 5500, + EndPos: 5512, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 297, - EndLine: 297, - StartPos: 5500, - EndPos: 5501, + EndLine: 297, + StartPos: 5500, + EndPos: 5501, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 297, - EndLine: 297, - StartPos: 5500, - EndPos: 5501, + EndLine: 297, + StartPos: 5500, + EndPos: 5501, }, Value: "a", }, @@ -13899,24 +13812,24 @@ func TestPhp5(t *testing.T) { Expression: &expr.New{ Position: &position.Position{ StartLine: 297, - EndLine: 297, - StartPos: 5506, - EndPos: 5512, + EndLine: 297, + StartPos: 5506, + EndPos: 5512, }, Class: &name.Name{ Position: &position.Position{ StartLine: 297, - EndLine: 297, - StartPos: 5510, - EndPos: 5512, + EndLine: 297, + StartPos: 5510, + EndPos: 5512, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 297, - EndLine: 297, - StartPos: 5510, - EndPos: 5512, + EndLine: 297, + StartPos: 5510, + EndPos: 5512, }, Value: "Foo", }, @@ -13928,30 +13841,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 298, - EndLine: 298, - StartPos: 5517, - EndPos: 5534, + EndLine: 298, + StartPos: 5517, + EndPos: 5534, }, Expr: &assign.Reference{ Position: &position.Position{ StartLine: 298, - EndLine: 298, - StartPos: 5517, - EndPos: 5533, + EndLine: 298, + StartPos: 5517, + EndPos: 5533, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 298, - EndLine: 298, - StartPos: 5517, - EndPos: 5518, + EndLine: 298, + StartPos: 5517, + EndPos: 5518, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 298, - EndLine: 298, - StartPos: 5517, - EndPos: 5518, + EndLine: 298, + StartPos: 5517, + EndPos: 5518, }, Value: "a", }, @@ -13959,24 +13872,24 @@ func TestPhp5(t *testing.T) { Expression: &expr.New{ Position: &position.Position{ StartLine: 298, - EndLine: 298, - StartPos: 5523, - EndPos: 5533, + EndLine: 298, + StartPos: 5523, + EndPos: 5533, }, Class: &name.Name{ Position: &position.Position{ StartLine: 298, - EndLine: 298, - StartPos: 5527, - EndPos: 5529, + EndLine: 298, + StartPos: 5527, + EndPos: 5529, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 298, - EndLine: 298, - StartPos: 5527, - EndPos: 5529, + EndLine: 298, + StartPos: 5527, + EndPos: 5529, }, Value: "Foo", }, @@ -13985,33 +13898,33 @@ func TestPhp5(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 298, - EndLine: 298, - StartPos: 5530, - EndPos: 5533, + EndLine: 298, + StartPos: 5530, + EndPos: 5533, }, Arguments: []node.Node{ &node.Argument{ Position: &position.Position{ StartLine: 298, - EndLine: 298, - StartPos: 5531, - EndPos: 5532, + EndLine: 298, + StartPos: 5531, + EndPos: 5532, }, - Variadic: false, + Variadic: false, IsReference: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 298, - EndLine: 298, - StartPos: 5531, - EndPos: 5532, + EndLine: 298, + StartPos: 5531, + EndPos: 5532, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 298, - EndLine: 298, - StartPos: 5531, - EndPos: 5532, + EndLine: 298, + StartPos: 5531, + EndPos: 5532, }, Value: "b", }, @@ -14025,30 +13938,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 299, - EndLine: 299, - StartPos: 5538, - EndPos: 5545, + EndLine: 299, + StartPos: 5538, + EndPos: 5545, }, Expr: &assign.Assign{ Position: &position.Position{ StartLine: 299, - EndLine: 299, - StartPos: 5538, - EndPos: 5544, + EndLine: 299, + StartPos: 5538, + EndPos: 5544, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 299, - EndLine: 299, - StartPos: 5538, - EndPos: 5539, + EndLine: 299, + StartPos: 5538, + EndPos: 5539, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 299, - EndLine: 299, - StartPos: 5538, - EndPos: 5539, + EndLine: 299, + StartPos: 5538, + EndPos: 5539, }, Value: "a", }, @@ -14056,16 +13969,16 @@ func TestPhp5(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 299, - EndLine: 299, - StartPos: 5543, - EndPos: 5544, + EndLine: 299, + StartPos: 5543, + EndPos: 5544, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 299, - EndLine: 299, - StartPos: 5543, - EndPos: 5544, + EndLine: 299, + StartPos: 5543, + EndPos: 5544, }, Value: "b", }, @@ -14075,30 +13988,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 300, - EndLine: 300, - StartPos: 5549, - EndPos: 5557, + EndLine: 300, + StartPos: 5549, + EndPos: 5557, }, Expr: &assign.BitwiseAnd{ Position: &position.Position{ StartLine: 300, - EndLine: 300, - StartPos: 5549, - EndPos: 5556, + EndLine: 300, + StartPos: 5549, + EndPos: 5556, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 300, - EndLine: 300, - StartPos: 5549, - EndPos: 5550, + EndLine: 300, + StartPos: 5549, + EndPos: 5550, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 300, - EndLine: 300, - StartPos: 5549, - EndPos: 5550, + EndLine: 300, + StartPos: 5549, + EndPos: 5550, }, Value: "a", }, @@ -14106,16 +14019,16 @@ func TestPhp5(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 300, - EndLine: 300, - StartPos: 5555, - EndPos: 5556, + EndLine: 300, + StartPos: 5555, + EndPos: 5556, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 300, - EndLine: 300, - StartPos: 5555, - EndPos: 5556, + EndLine: 300, + StartPos: 5555, + EndPos: 5556, }, Value: "b", }, @@ -14125,30 +14038,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 301, - EndLine: 301, - StartPos: 5561, - EndPos: 5569, + EndLine: 301, + StartPos: 5561, + EndPos: 5569, }, Expr: &assign.BitwiseOr{ Position: &position.Position{ StartLine: 301, - EndLine: 301, - StartPos: 5561, - EndPos: 5568, + EndLine: 301, + StartPos: 5561, + EndPos: 5568, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 301, - EndLine: 301, - StartPos: 5561, - EndPos: 5562, + EndLine: 301, + StartPos: 5561, + EndPos: 5562, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 301, - EndLine: 301, - StartPos: 5561, - EndPos: 5562, + EndLine: 301, + StartPos: 5561, + EndPos: 5562, }, Value: "a", }, @@ -14156,16 +14069,16 @@ func TestPhp5(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 301, - EndLine: 301, - StartPos: 5567, - EndPos: 5568, + EndLine: 301, + StartPos: 5567, + EndPos: 5568, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 301, - EndLine: 301, - StartPos: 5567, - EndPos: 5568, + EndLine: 301, + StartPos: 5567, + EndPos: 5568, }, Value: "b", }, @@ -14175,30 +14088,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 302, - EndLine: 302, - StartPos: 5573, - EndPos: 5581, + EndLine: 302, + StartPos: 5573, + EndPos: 5581, }, Expr: &assign.BitwiseXor{ Position: &position.Position{ StartLine: 302, - EndLine: 302, - StartPos: 5573, - EndPos: 5580, + EndLine: 302, + StartPos: 5573, + EndPos: 5580, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 302, - EndLine: 302, - StartPos: 5573, - EndPos: 5574, + EndLine: 302, + StartPos: 5573, + EndPos: 5574, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 302, - EndLine: 302, - StartPos: 5573, - EndPos: 5574, + EndLine: 302, + StartPos: 5573, + EndPos: 5574, }, Value: "a", }, @@ -14206,16 +14119,16 @@ func TestPhp5(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 302, - EndLine: 302, - StartPos: 5579, - EndPos: 5580, + EndLine: 302, + StartPos: 5579, + EndPos: 5580, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 302, - EndLine: 302, - StartPos: 5579, - EndPos: 5580, + EndLine: 302, + StartPos: 5579, + EndPos: 5580, }, Value: "b", }, @@ -14225,30 +14138,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 303, - EndLine: 303, - StartPos: 5585, - EndPos: 5593, + EndLine: 303, + StartPos: 5585, + EndPos: 5593, }, Expr: &assign.Concat{ Position: &position.Position{ StartLine: 303, - EndLine: 303, - StartPos: 5585, - EndPos: 5592, + EndLine: 303, + StartPos: 5585, + EndPos: 5592, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 303, - EndLine: 303, - StartPos: 5585, - EndPos: 5586, + EndLine: 303, + StartPos: 5585, + EndPos: 5586, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 303, - EndLine: 303, - StartPos: 5585, - EndPos: 5586, + EndLine: 303, + StartPos: 5585, + EndPos: 5586, }, Value: "a", }, @@ -14256,16 +14169,16 @@ func TestPhp5(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 303, - EndLine: 303, - StartPos: 5591, - EndPos: 5592, + EndLine: 303, + StartPos: 5591, + EndPos: 5592, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 303, - EndLine: 303, - StartPos: 5591, - EndPos: 5592, + EndLine: 303, + StartPos: 5591, + EndPos: 5592, }, Value: "b", }, @@ -14275,30 +14188,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 304, - EndLine: 304, - StartPos: 5597, - EndPos: 5605, + EndLine: 304, + StartPos: 5597, + EndPos: 5605, }, Expr: &assign.Div{ Position: &position.Position{ StartLine: 304, - EndLine: 304, - StartPos: 5597, - EndPos: 5604, + EndLine: 304, + StartPos: 5597, + EndPos: 5604, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 304, - EndLine: 304, - StartPos: 5597, - EndPos: 5598, + EndLine: 304, + StartPos: 5597, + EndPos: 5598, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 304, - EndLine: 304, - StartPos: 5597, - EndPos: 5598, + EndLine: 304, + StartPos: 5597, + EndPos: 5598, }, Value: "a", }, @@ -14306,16 +14219,16 @@ func TestPhp5(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 304, - EndLine: 304, - StartPos: 5603, - EndPos: 5604, + EndLine: 304, + StartPos: 5603, + EndPos: 5604, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 304, - EndLine: 304, - StartPos: 5603, - EndPos: 5604, + EndLine: 304, + StartPos: 5603, + EndPos: 5604, }, Value: "b", }, @@ -14325,30 +14238,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 305, - EndLine: 305, - StartPos: 5609, - EndPos: 5617, + EndLine: 305, + StartPos: 5609, + EndPos: 5617, }, Expr: &assign.Minus{ Position: &position.Position{ StartLine: 305, - EndLine: 305, - StartPos: 5609, - EndPos: 5616, + EndLine: 305, + StartPos: 5609, + EndPos: 5616, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 305, - EndLine: 305, - StartPos: 5609, - EndPos: 5610, + EndLine: 305, + StartPos: 5609, + EndPos: 5610, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 305, - EndLine: 305, - StartPos: 5609, - EndPos: 5610, + EndLine: 305, + StartPos: 5609, + EndPos: 5610, }, Value: "a", }, @@ -14356,16 +14269,16 @@ func TestPhp5(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 305, - EndLine: 305, - StartPos: 5615, - EndPos: 5616, + EndLine: 305, + StartPos: 5615, + EndPos: 5616, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 305, - EndLine: 305, - StartPos: 5615, - EndPos: 5616, + EndLine: 305, + StartPos: 5615, + EndPos: 5616, }, Value: "b", }, @@ -14375,30 +14288,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 306, - EndLine: 306, - StartPos: 5621, - EndPos: 5629, + EndLine: 306, + StartPos: 5621, + EndPos: 5629, }, Expr: &assign.Mod{ Position: &position.Position{ StartLine: 306, - EndLine: 306, - StartPos: 5621, - EndPos: 5628, + EndLine: 306, + StartPos: 5621, + EndPos: 5628, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 306, - EndLine: 306, - StartPos: 5621, - EndPos: 5622, + EndLine: 306, + StartPos: 5621, + EndPos: 5622, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 306, - EndLine: 306, - StartPos: 5621, - EndPos: 5622, + EndLine: 306, + StartPos: 5621, + EndPos: 5622, }, Value: "a", }, @@ -14406,16 +14319,16 @@ func TestPhp5(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 306, - EndLine: 306, - StartPos: 5627, - EndPos: 5628, + EndLine: 306, + StartPos: 5627, + EndPos: 5628, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 306, - EndLine: 306, - StartPos: 5627, - EndPos: 5628, + EndLine: 306, + StartPos: 5627, + EndPos: 5628, }, Value: "b", }, @@ -14425,30 +14338,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 307, - EndLine: 307, - StartPos: 5633, - EndPos: 5641, + EndLine: 307, + StartPos: 5633, + EndPos: 5641, }, Expr: &assign.Mul{ Position: &position.Position{ StartLine: 307, - EndLine: 307, - StartPos: 5633, - EndPos: 5640, + EndLine: 307, + StartPos: 5633, + EndPos: 5640, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 307, - EndLine: 307, - StartPos: 5633, - EndPos: 5634, + EndLine: 307, + StartPos: 5633, + EndPos: 5634, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 307, - EndLine: 307, - StartPos: 5633, - EndPos: 5634, + EndLine: 307, + StartPos: 5633, + EndPos: 5634, }, Value: "a", }, @@ -14456,16 +14369,16 @@ func TestPhp5(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 307, - EndLine: 307, - StartPos: 5639, - EndPos: 5640, + EndLine: 307, + StartPos: 5639, + EndPos: 5640, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 307, - EndLine: 307, - StartPos: 5639, - EndPos: 5640, + EndLine: 307, + StartPos: 5639, + EndPos: 5640, }, Value: "b", }, @@ -14475,30 +14388,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 308, - EndLine: 308, - StartPos: 5645, - EndPos: 5653, + EndLine: 308, + StartPos: 5645, + EndPos: 5653, }, Expr: &assign.Plus{ Position: &position.Position{ StartLine: 308, - EndLine: 308, - StartPos: 5645, - EndPos: 5652, + EndLine: 308, + StartPos: 5645, + EndPos: 5652, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 308, - EndLine: 308, - StartPos: 5645, - EndPos: 5646, + EndLine: 308, + StartPos: 5645, + EndPos: 5646, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 308, - EndLine: 308, - StartPos: 5645, - EndPos: 5646, + EndLine: 308, + StartPos: 5645, + EndPos: 5646, }, Value: "a", }, @@ -14506,16 +14419,16 @@ func TestPhp5(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 308, - EndLine: 308, - StartPos: 5651, - EndPos: 5652, + EndLine: 308, + StartPos: 5651, + EndPos: 5652, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 308, - EndLine: 308, - StartPos: 5651, - EndPos: 5652, + EndLine: 308, + StartPos: 5651, + EndPos: 5652, }, Value: "b", }, @@ -14525,30 +14438,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 309, - EndLine: 309, - StartPos: 5657, - EndPos: 5666, + EndLine: 309, + StartPos: 5657, + EndPos: 5666, }, Expr: &assign.Pow{ Position: &position.Position{ StartLine: 309, - EndLine: 309, - StartPos: 5657, - EndPos: 5665, + EndLine: 309, + StartPos: 5657, + EndPos: 5665, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 309, - EndLine: 309, - StartPos: 5657, - EndPos: 5658, + EndLine: 309, + StartPos: 5657, + EndPos: 5658, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 309, - EndLine: 309, - StartPos: 5657, - EndPos: 5658, + EndLine: 309, + StartPos: 5657, + EndPos: 5658, }, Value: "a", }, @@ -14556,16 +14469,16 @@ func TestPhp5(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 309, - EndLine: 309, - StartPos: 5664, - EndPos: 5665, + EndLine: 309, + StartPos: 5664, + EndPos: 5665, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 309, - EndLine: 309, - StartPos: 5664, - EndPos: 5665, + EndLine: 309, + StartPos: 5664, + EndPos: 5665, }, Value: "b", }, @@ -14575,30 +14488,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 310, - EndLine: 310, - StartPos: 5670, - EndPos: 5679, + EndLine: 310, + StartPos: 5670, + EndPos: 5679, }, Expr: &assign.ShiftLeft{ Position: &position.Position{ StartLine: 310, - EndLine: 310, - StartPos: 5670, - EndPos: 5678, + EndLine: 310, + StartPos: 5670, + EndPos: 5678, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 310, - EndLine: 310, - StartPos: 5670, - EndPos: 5671, + EndLine: 310, + StartPos: 5670, + EndPos: 5671, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 310, - EndLine: 310, - StartPos: 5670, - EndPos: 5671, + EndLine: 310, + StartPos: 5670, + EndPos: 5671, }, Value: "a", }, @@ -14606,16 +14519,16 @@ func TestPhp5(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 310, - EndLine: 310, - StartPos: 5677, - EndPos: 5678, + EndLine: 310, + StartPos: 5677, + EndPos: 5678, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 310, - EndLine: 310, - StartPos: 5677, - EndPos: 5678, + EndLine: 310, + StartPos: 5677, + EndPos: 5678, }, Value: "b", }, @@ -14625,30 +14538,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 311, - EndLine: 311, - StartPos: 5683, - EndPos: 5692, + EndLine: 311, + StartPos: 5683, + EndPos: 5692, }, Expr: &assign.ShiftRight{ Position: &position.Position{ StartLine: 311, - EndLine: 311, - StartPos: 5683, - EndPos: 5691, + EndLine: 311, + StartPos: 5683, + EndPos: 5691, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 311, - EndLine: 311, - StartPos: 5683, - EndPos: 5684, + EndLine: 311, + StartPos: 5683, + EndPos: 5684, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 311, - EndLine: 311, - StartPos: 5683, - EndPos: 5684, + EndLine: 311, + StartPos: 5683, + EndPos: 5684, }, Value: "a", }, @@ -14656,16 +14569,16 @@ func TestPhp5(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 311, - EndLine: 311, - StartPos: 5690, - EndPos: 5691, + EndLine: 311, + StartPos: 5690, + EndPos: 5691, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 311, - EndLine: 311, - StartPos: 5690, - EndPos: 5691, + EndLine: 311, + StartPos: 5690, + EndPos: 5691, }, Value: "b", }, @@ -14675,31 +14588,31 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 314, - EndLine: 314, - StartPos: 5699, - EndPos: 5710, + EndLine: 314, + StartPos: 5699, + EndPos: 5710, }, Expr: &expr.New{ Position: &position.Position{ StartLine: 314, - EndLine: 314, - StartPos: 5699, - EndPos: 5708, + EndLine: 314, + StartPos: 5699, + EndPos: 5708, }, Class: &name.FullyQualified{ Position: &position.Position{ StartLine: 314, - EndLine: 314, - StartPos: 5703, - EndPos: 5706, + EndLine: 314, + StartPos: 5703, + EndPos: 5706, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 314, - EndLine: 314, - StartPos: 5704, - EndPos: 5706, + EndLine: 314, + StartPos: 5704, + EndPos: 5706, }, Value: "Foo", }, @@ -14708,9 +14621,9 @@ func TestPhp5(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 314, - EndLine: 314, - StartPos: 5707, - EndPos: 5708, + EndLine: 314, + StartPos: 5707, + EndPos: 5708, }, }, }, @@ -14718,45 +14631,45 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 315, - EndLine: 315, - StartPos: 5735, - EndPos: 5738, + EndLine: 315, + StartPos: 5735, + EndPos: 5738, }, Expr: &expr.PropertyFetch{ Position: &position.Position{ StartLine: 315, - EndLine: 315, - StartPos: 5735, - EndPos: 5737, + EndLine: 315, + StartPos: 5735, + EndPos: 5737, }, Variable: &expr.MethodCall{ Position: &position.Position{ StartLine: 315, - EndLine: 315, - StartPos: 5731, - EndPos: 5732, + EndLine: 315, + StartPos: 5731, + EndPos: 5732, }, Variable: &expr.New{ Position: &position.Position{ StartLine: 315, - EndLine: 315, - StartPos: 5715, - EndPos: 5724, + EndLine: 315, + StartPos: 5715, + EndPos: 5724, }, Class: &name.FullyQualified{ Position: &position.Position{ StartLine: 315, - EndLine: 315, - StartPos: 5719, - EndPos: 5722, + EndLine: 315, + StartPos: 5719, + EndPos: 5722, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 315, - EndLine: 315, - StartPos: 5720, - EndPos: 5722, + EndLine: 315, + StartPos: 5720, + EndPos: 5722, }, Value: "Foo", }, @@ -14765,36 +14678,36 @@ func TestPhp5(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 315, - EndLine: 315, - StartPos: 5723, - EndPos: 5724, + EndLine: 315, + StartPos: 5723, + EndPos: 5724, }, }, }, Method: &node.Identifier{ Position: &position.Position{ StartLine: 315, - EndLine: 315, - StartPos: 5728, - EndPos: 5730, + EndLine: 315, + StartPos: 5728, + EndPos: 5730, }, Value: "bar", }, ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 315, - EndLine: 315, - StartPos: 5731, - EndPos: 5732, + EndLine: 315, + StartPos: 5731, + EndPos: 5732, }, }, }, Property: &node.Identifier{ Position: &position.Position{ StartLine: 315, - EndLine: 315, - StartPos: 5735, - EndPos: 5737, + EndLine: 315, + StartPos: 5735, + EndPos: 5737, }, Value: "baz", }, @@ -14803,45 +14716,45 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 316, - EndLine: 316, - StartPos: 5758, - EndPos: 5760, + EndLine: 316, + StartPos: 5758, + EndPos: 5760, }, Expr: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 316, - EndLine: 316, - StartPos: 5758, - EndPos: 5758, + EndLine: 316, + StartPos: 5758, + EndPos: 5758, }, Variable: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 316, - EndLine: 316, - StartPos: 5755, - EndPos: 5755, + EndLine: 316, + StartPos: 5755, + EndPos: 5755, }, Variable: &expr.New{ Position: &position.Position{ StartLine: 316, - EndLine: 316, - StartPos: 5743, - EndPos: 5752, + EndLine: 316, + StartPos: 5743, + EndPos: 5752, }, Class: &name.FullyQualified{ Position: &position.Position{ StartLine: 316, - EndLine: 316, - StartPos: 5747, - EndPos: 5750, + EndLine: 316, + StartPos: 5747, + EndPos: 5750, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 316, - EndLine: 316, - StartPos: 5748, - EndPos: 5750, + EndLine: 316, + StartPos: 5748, + EndPos: 5750, }, Value: "Foo", }, @@ -14850,18 +14763,18 @@ func TestPhp5(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 316, - EndLine: 316, - StartPos: 5751, - EndPos: 5752, + EndLine: 316, + StartPos: 5751, + EndPos: 5752, }, }, }, Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 316, - EndLine: 316, - StartPos: 5755, - EndPos: 5755, + EndLine: 316, + StartPos: 5755, + EndPos: 5755, }, Value: "0", }, @@ -14869,9 +14782,9 @@ func TestPhp5(t *testing.T) { Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 316, - EndLine: 316, - StartPos: 5758, - EndPos: 5758, + EndLine: 316, + StartPos: 5758, + EndPos: 5758, }, Value: "0", }, @@ -14880,45 +14793,45 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 317, - EndLine: 317, - StartPos: 5784, - EndPos: 5786, + EndLine: 317, + StartPos: 5784, + EndPos: 5786, }, Expr: &expr.MethodCall{ Position: &position.Position{ StartLine: 317, - EndLine: 317, - StartPos: 5784, - EndPos: 5785, + EndLine: 317, + StartPos: 5784, + EndPos: 5785, }, Variable: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 317, - EndLine: 317, - StartPos: 5777, - EndPos: 5777, + EndLine: 317, + StartPos: 5777, + EndPos: 5777, }, Variable: &expr.New{ Position: &position.Position{ StartLine: 317, - EndLine: 317, - StartPos: 5765, - EndPos: 5774, + EndLine: 317, + StartPos: 5765, + EndPos: 5774, }, Class: &name.FullyQualified{ Position: &position.Position{ StartLine: 317, - EndLine: 317, - StartPos: 5769, - EndPos: 5772, + EndLine: 317, + StartPos: 5769, + EndPos: 5772, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 317, - EndLine: 317, - StartPos: 5770, - EndPos: 5772, + EndLine: 317, + StartPos: 5770, + EndPos: 5772, }, Value: "Foo", }, @@ -14927,18 +14840,18 @@ func TestPhp5(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 317, - EndLine: 317, - StartPos: 5773, - EndPos: 5774, + EndLine: 317, + StartPos: 5773, + EndPos: 5774, }, }, }, Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 317, - EndLine: 317, - StartPos: 5777, - EndPos: 5777, + EndLine: 317, + StartPos: 5777, + EndPos: 5777, }, Value: "0", }, @@ -14946,18 +14859,18 @@ func TestPhp5(t *testing.T) { Method: &node.Identifier{ Position: &position.Position{ StartLine: 317, - EndLine: 317, - StartPos: 5781, - EndPos: 5783, + EndLine: 317, + StartPos: 5781, + EndPos: 5783, }, Value: "bar", }, ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 317, - EndLine: 317, - StartPos: 5784, - EndPos: 5785, + EndLine: 317, + StartPos: 5784, + EndPos: 5785, }, }, }, @@ -14965,60 +14878,60 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 319, - EndLine: 319, - StartPos: 5791, - EndPos: 5807, + EndLine: 319, + StartPos: 5791, + EndPos: 5807, }, Expr: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 319, - EndLine: 319, - StartPos: 5791, - EndPos: 5806, + EndLine: 319, + StartPos: 5791, + EndPos: 5806, }, Variable: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 319, - EndLine: 319, - StartPos: 5791, - EndPos: 5803, + EndLine: 319, + StartPos: 5791, + EndPos: 5803, }, Variable: &expr.Array{ Position: &position.Position{ StartLine: 319, - EndLine: 319, - StartPos: 5791, - EndPos: 5800, + EndLine: 319, + StartPos: 5791, + EndPos: 5800, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 319, - EndLine: 319, - StartPos: 5797, - EndPos: 5799, + EndLine: 319, + StartPos: 5797, + EndPos: 5799, }, Val: &expr.ShortArray{ Position: &position.Position{ StartLine: 319, - EndLine: 319, - StartPos: 5797, - EndPos: 5799, + EndLine: 319, + StartPos: 5797, + EndPos: 5799, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 319, - EndLine: 319, - StartPos: 5798, - EndPos: 5798, + EndLine: 319, + StartPos: 5798, + EndPos: 5798, }, Val: &scalar.Lnumber{ Position: &position.Position{ StartLine: 319, - EndLine: 319, - StartPos: 5798, - EndPos: 5798, + EndLine: 319, + StartPos: 5798, + EndPos: 5798, }, Value: "0", }, @@ -15031,9 +14944,9 @@ func TestPhp5(t *testing.T) { Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 319, - EndLine: 319, - StartPos: 5802, - EndPos: 5802, + EndLine: 319, + StartPos: 5802, + EndPos: 5802, }, Value: "0", }, @@ -15041,9 +14954,9 @@ func TestPhp5(t *testing.T) { Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 319, - EndLine: 319, - StartPos: 5805, - EndPos: 5805, + EndLine: 319, + StartPos: 5805, + EndPos: 5805, }, Value: "0", }, @@ -15052,32 +14965,32 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 320, - EndLine: 320, - StartPos: 5811, - EndPos: 5819, + EndLine: 320, + StartPos: 5811, + EndPos: 5819, }, Expr: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 320, - EndLine: 320, - StartPos: 5811, - EndPos: 5818, + EndLine: 320, + StartPos: 5811, + EndPos: 5818, }, Variable: &scalar.String{ Position: &position.Position{ StartLine: 320, - EndLine: 320, - StartPos: 5811, - EndPos: 5815, + EndLine: 320, + StartPos: 5811, + EndPos: 5815, }, Value: "\"foo\"", }, Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 320, - EndLine: 320, - StartPos: 5817, - EndPos: 5817, + EndLine: 320, + StartPos: 5817, + EndPos: 5817, }, Value: "0", }, @@ -15086,38 +14999,38 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 321, - EndLine: 321, - StartPos: 5823, - EndPos: 5829, + EndLine: 321, + StartPos: 5823, + EndPos: 5829, }, Expr: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 321, - EndLine: 321, - StartPos: 5823, - EndPos: 5828, + EndLine: 321, + StartPos: 5823, + EndPos: 5828, }, Variable: &expr.ConstFetch{ Position: &position.Position{ StartLine: 321, - EndLine: 321, - StartPos: 5823, - EndPos: 5825, + EndLine: 321, + StartPos: 5823, + EndPos: 5825, }, Constant: &name.Name{ Position: &position.Position{ StartLine: 321, - EndLine: 321, - StartPos: 5823, - EndPos: 5825, + EndLine: 321, + StartPos: 5823, + EndPos: 5825, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 321, - EndLine: 321, - StartPos: 5823, - EndPos: 5825, + EndLine: 321, + StartPos: 5823, + EndPos: 5825, }, Value: "foo", }, @@ -15127,9 +15040,9 @@ func TestPhp5(t *testing.T) { Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 321, - EndLine: 321, - StartPos: 5827, - EndPos: 5827, + EndLine: 321, + StartPos: 5827, + EndPos: 5827, }, Value: "0", }, @@ -15138,32 +15051,32 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 322, - EndLine: 322, - StartPos: 5833, - EndPos: 5844, + EndLine: 322, + StartPos: 5833, + EndPos: 5844, }, Expr: &expr.ClassConstFetch{ Position: &position.Position{ StartLine: 322, - EndLine: 322, - StartPos: 5833, - EndPos: 5843, + EndLine: 322, + StartPos: 5833, + EndPos: 5843, }, Class: &node.Identifier{ Position: &position.Position{ StartLine: 322, - EndLine: 322, - StartPos: 5833, - EndPos: 5838, + EndLine: 322, + StartPos: 5833, + EndPos: 5838, }, Value: "static", }, ConstantName: &node.Identifier{ Position: &position.Position{ StartLine: 322, - EndLine: 322, - StartPos: 5841, - EndPos: 5843, + EndLine: 322, + StartPos: 5841, + EndPos: 5843, }, Value: "foo", }, @@ -15172,30 +15085,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 324, - EndLine: 324, - StartPos: 5849, - EndPos: 5857, + EndLine: 324, + StartPos: 5849, + EndPos: 5857, }, Expr: &expr.New{ Position: &position.Position{ StartLine: 324, - EndLine: 324, - StartPos: 5849, - EndPos: 5856, + EndLine: 324, + StartPos: 5849, + EndPos: 5856, }, Class: &expr.Variable{ Position: &position.Position{ StartLine: 324, - EndLine: 324, - StartPos: 5853, - EndPos: 5856, + EndLine: 324, + StartPos: 5853, + EndPos: 5856, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 324, - EndLine: 324, - StartPos: 5853, - EndPos: 5856, + EndLine: 324, + StartPos: 5853, + EndPos: 5856, }, Value: "foo", }, @@ -15205,37 +15118,37 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 325, - EndLine: 325, - StartPos: 5861, - EndPos: 5875, + EndLine: 325, + StartPos: 5861, + EndPos: 5875, }, Expr: &expr.New{ Position: &position.Position{ StartLine: 325, - EndLine: 325, - StartPos: 5861, - EndPos: 5874, + EndLine: 325, + StartPos: 5861, + EndPos: 5874, }, Class: &expr.StaticPropertyFetch{ Position: &position.Position{ StartLine: 325, - EndLine: 325, - StartPos: 5865, - EndPos: 5874, + EndLine: 325, + StartPos: 5865, + EndPos: 5874, }, Class: &expr.Variable{ Position: &position.Position{ StartLine: 325, - EndLine: 325, - StartPos: 5865, - EndPos: 5868, + EndLine: 325, + StartPos: 5865, + EndPos: 5868, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 325, - EndLine: 325, - StartPos: 5865, - EndPos: 5868, + EndLine: 325, + StartPos: 5865, + EndPos: 5868, }, Value: "foo", }, @@ -15243,16 +15156,16 @@ func TestPhp5(t *testing.T) { Property: &expr.Variable{ Position: &position.Position{ StartLine: 325, - EndLine: 325, - StartPos: 5871, - EndPos: 5874, + EndLine: 325, + StartPos: 5871, + EndPos: 5874, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 325, - EndLine: 325, - StartPos: 5871, - EndPos: 5874, + EndLine: 325, + StartPos: 5871, + EndPos: 5874, }, Value: "bar", }, @@ -15263,44 +15176,44 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 326, - EndLine: 326, - StartPos: 5879, - EndPos: 5891, + EndLine: 326, + StartPos: 5879, + EndPos: 5891, }, Expr: &expr.New{ Position: &position.Position{ StartLine: 326, - EndLine: 326, - StartPos: 5879, - EndPos: 5889, + EndLine: 326, + StartPos: 5879, + EndPos: 5889, }, Class: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 326, - EndLine: 326, - StartPos: 5889, - EndPos: 5889, + EndLine: 326, + StartPos: 5889, + EndPos: 5889, }, Variable: &expr.PropertyFetch{ Position: &position.Position{ StartLine: 326, - EndLine: 326, - StartPos: 5887, - EndPos: 5889, + EndLine: 326, + StartPos: 5887, + EndPos: 5889, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 326, - EndLine: 326, - StartPos: 5883, - EndPos: 5887, + EndLine: 326, + StartPos: 5883, + EndPos: 5887, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 326, - EndLine: 326, - StartPos: 5883, - EndPos: 5884, + EndLine: 326, + StartPos: 5883, + EndPos: 5884, }, Value: "a", }, @@ -15308,9 +15221,9 @@ func TestPhp5(t *testing.T) { Property: &node.Identifier{ Position: &position.Position{ StartLine: 326, - EndLine: 326, - StartPos: 5887, - EndPos: 5887, + EndLine: 326, + StartPos: 5887, + EndPos: 5887, }, Value: "b", }, @@ -15318,9 +15231,9 @@ func TestPhp5(t *testing.T) { Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 326, - EndLine: 326, - StartPos: 5889, - EndPos: 5889, + EndLine: 326, + StartPos: 5889, + EndPos: 5889, }, Value: "0", }, @@ -15330,65 +15243,65 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5895, - EndPos: 5926, + EndLine: 327, + StartPos: 5895, + EndPos: 5926, }, Expr: &expr.New{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5895, - EndPos: 5924, + EndLine: 327, + StartPos: 5895, + EndPos: 5924, }, Class: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5924, - EndPos: 5924, + EndLine: 327, + StartPos: 5924, + EndPos: 5924, }, Variable: &expr.PropertyFetch{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5922, - EndPos: 5924, + EndLine: 327, + StartPos: 5922, + EndPos: 5924, }, Variable: &expr.PropertyFetch{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5918, - EndPos: 5922, + EndLine: 327, + StartPos: 5918, + EndPos: 5922, }, Variable: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5905, - EndPos: 5919, + EndLine: 327, + StartPos: 5905, + EndPos: 5919, }, Variable: &expr.PropertyFetch{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5903, - EndPos: 5914, + EndLine: 327, + StartPos: 5903, + EndPos: 5914, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5899, - EndPos: 5903, + EndLine: 327, + StartPos: 5899, + EndPos: 5903, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5899, - EndPos: 5900, + EndLine: 327, + StartPos: 5899, + EndPos: 5900, }, Value: "a", }, @@ -15396,9 +15309,9 @@ func TestPhp5(t *testing.T) { Property: &node.Identifier{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5903, - EndPos: 5903, + EndLine: 327, + StartPos: 5903, + EndPos: 5903, }, Value: "b", }, @@ -15406,23 +15319,23 @@ func TestPhp5(t *testing.T) { Dim: &expr.Ternary{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5905, - EndPos: 5914, + EndLine: 327, + StartPos: 5905, + EndPos: 5914, }, Condition: &expr.Variable{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5905, - EndPos: 5906, + EndLine: 327, + StartPos: 5905, + EndPos: 5906, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5905, - EndPos: 5906, + EndLine: 327, + StartPos: 5905, + EndPos: 5906, }, Value: "b", }, @@ -15430,24 +15343,24 @@ func TestPhp5(t *testing.T) { IfFalse: &expr.ConstFetch{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5911, - EndPos: 5914, + EndLine: 327, + StartPos: 5911, + EndPos: 5914, }, Constant: &name.Name{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5911, - EndPos: 5914, + EndLine: 327, + StartPos: 5911, + EndPos: 5914, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5911, - EndPos: 5914, + EndLine: 327, + StartPos: 5911, + EndPos: 5914, }, Value: "null", }, @@ -15459,16 +15372,16 @@ func TestPhp5(t *testing.T) { Property: &expr.Variable{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5918, - EndPos: 5919, + EndLine: 327, + StartPos: 5918, + EndPos: 5919, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5918, - EndPos: 5919, + EndLine: 327, + StartPos: 5918, + EndPos: 5919, }, Value: "c", }, @@ -15477,9 +15390,9 @@ func TestPhp5(t *testing.T) { Property: &node.Identifier{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5922, - EndPos: 5922, + EndLine: 327, + StartPos: 5922, + EndPos: 5922, }, Value: "d", }, @@ -15487,9 +15400,9 @@ func TestPhp5(t *testing.T) { Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5924, - EndPos: 5924, + EndLine: 327, + StartPos: 5924, + EndPos: 5924, }, Value: "0", }, @@ -15499,31 +15412,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5927, - EndPos: 5945, + EndLine: 327, + StartPos: 5927, + EndPos: 5945, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5934, - EndPos: 5944, + EndLine: 327, + StartPos: 5934, + EndPos: 5944, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5934, - EndPos: 5935, + EndLine: 327, + StartPos: 5934, + EndPos: 5935, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5934, - EndPos: 5935, + EndLine: 327, + StartPos: 5934, + EndPos: 5935, }, Value: "a", }, @@ -15531,31 +15444,31 @@ func TestPhp5(t *testing.T) { Expr: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5939, - EndPos: 5944, + EndLine: 327, + StartPos: 5939, + EndPos: 5944, }, Variable: &expr.ShortArray{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5939, - EndPos: 5941, + EndLine: 327, + StartPos: 5939, + EndPos: 5941, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5940, - EndPos: 5940, + EndLine: 327, + StartPos: 5940, + EndPos: 5940, }, Val: &scalar.Lnumber{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5940, - EndPos: 5940, + EndLine: 327, + StartPos: 5940, + EndPos: 5940, }, Value: "1", }, @@ -15565,9 +15478,9 @@ func TestPhp5(t *testing.T) { Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 327, - EndLine: 327, - StartPos: 5943, - EndPos: 5943, + EndLine: 327, + StartPos: 5943, + EndPos: 5943, }, Value: "0", }, @@ -15578,31 +15491,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 329, - EndLine: 329, - StartPos: 5950, - EndPos: 5964, + EndLine: 329, + StartPos: 5950, + EndPos: 5964, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 329, - EndLine: 329, - StartPos: 5957, - EndPos: 5963, + EndLine: 329, + StartPos: 5957, + EndPos: 5963, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 329, - EndLine: 329, - StartPos: 5957, - EndPos: 5958, + EndLine: 329, + StartPos: 5957, + EndPos: 5958, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 329, - EndLine: 329, - StartPos: 5957, - EndPos: 5958, + EndLine: 329, + StartPos: 5957, + EndPos: 5958, }, Value: "a", }, @@ -15610,16 +15523,16 @@ func TestPhp5(t *testing.T) { Expr: &expr.BooleanNot{ Position: &position.Position{ StartLine: 329, - EndLine: 329, - StartPos: 5962, - EndPos: 5963, + EndLine: 329, + StartPos: 5962, + EndPos: 5963, }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 329, - EndLine: 329, - StartPos: 5963, - EndPos: 5963, + EndLine: 329, + StartPos: 5963, + EndPos: 5963, }, Value: "1", }, @@ -15630,31 +15543,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 330, - EndLine: 330, - StartPos: 5968, - EndPos: 5982, + EndLine: 330, + StartPos: 5968, + EndPos: 5982, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 330, - EndLine: 330, - StartPos: 5975, - EndPos: 5981, + EndLine: 330, + StartPos: 5975, + EndPos: 5981, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 330, - EndLine: 330, - StartPos: 5975, - EndPos: 5976, + EndLine: 330, + StartPos: 5975, + EndPos: 5976, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 330, - EndLine: 330, - StartPos: 5975, - EndPos: 5976, + EndLine: 330, + StartPos: 5975, + EndPos: 5976, }, Value: "a", }, @@ -15662,16 +15575,16 @@ func TestPhp5(t *testing.T) { Expr: &expr.BitwiseNot{ Position: &position.Position{ StartLine: 330, - EndLine: 330, - StartPos: 5980, - EndPos: 5981, + EndLine: 330, + StartPos: 5980, + EndPos: 5981, }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 330, - EndLine: 330, - StartPos: 5981, - EndPos: 5981, + EndLine: 330, + StartPos: 5981, + EndPos: 5981, }, Value: "1", }, @@ -15682,31 +15595,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 331, - EndLine: 331, - StartPos: 5986, - EndPos: 6000, + EndLine: 331, + StartPos: 5986, + EndPos: 6000, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 331, - EndLine: 331, - StartPos: 5993, - EndPos: 5999, + EndLine: 331, + StartPos: 5993, + EndPos: 5999, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 331, - EndLine: 331, - StartPos: 5993, - EndPos: 5994, + EndLine: 331, + StartPos: 5993, + EndPos: 5994, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 331, - EndLine: 331, - StartPos: 5993, - EndPos: 5994, + EndLine: 331, + StartPos: 5993, + EndPos: 5994, }, Value: "a", }, @@ -15714,16 +15627,16 @@ func TestPhp5(t *testing.T) { Expr: &expr.UnaryPlus{ Position: &position.Position{ StartLine: 331, - EndLine: 331, - StartPos: 5998, - EndPos: 5999, + EndLine: 331, + StartPos: 5998, + EndPos: 5999, }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 331, - EndLine: 331, - StartPos: 5999, - EndPos: 5999, + EndLine: 331, + StartPos: 5999, + EndPos: 5999, }, Value: "1", }, @@ -15734,31 +15647,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 332, - EndLine: 332, - StartPos: 6004, - EndPos: 6018, + EndLine: 332, + StartPos: 6004, + EndPos: 6018, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 332, - EndLine: 332, - StartPos: 6011, - EndPos: 6017, + EndLine: 332, + StartPos: 6011, + EndPos: 6017, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 332, - EndLine: 332, - StartPos: 6011, - EndPos: 6012, + EndLine: 332, + StartPos: 6011, + EndPos: 6012, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 332, - EndLine: 332, - StartPos: 6011, - EndPos: 6012, + EndLine: 332, + StartPos: 6011, + EndPos: 6012, }, Value: "a", }, @@ -15766,16 +15679,16 @@ func TestPhp5(t *testing.T) { Expr: &expr.UnaryMinus{ Position: &position.Position{ StartLine: 332, - EndLine: 332, - StartPos: 6016, - EndPos: 6017, + EndLine: 332, + StartPos: 6016, + EndPos: 6017, }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 332, - EndLine: 332, - StartPos: 6017, - EndPos: 6017, + EndLine: 332, + StartPos: 6017, + EndPos: 6017, }, Value: "1", }, @@ -15786,31 +15699,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 333, - EndLine: 333, - StartPos: 6022, - EndPos: 6037, + EndLine: 333, + StartPos: 6022, + EndPos: 6037, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 333, - EndLine: 333, - StartPos: 6029, - EndPos: 6035, + EndLine: 333, + StartPos: 6029, + EndPos: 6035, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 333, - EndLine: 333, - StartPos: 6029, - EndPos: 6030, + EndLine: 333, + StartPos: 6029, + EndPos: 6030, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 333, - EndLine: 333, - StartPos: 6029, - EndPos: 6030, + EndLine: 333, + StartPos: 6029, + EndPos: 6030, }, Value: "a", }, @@ -15818,9 +15731,9 @@ func TestPhp5(t *testing.T) { Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 333, - EndLine: 333, - StartPos: 6035, - EndPos: 6035, + EndLine: 333, + StartPos: 6035, + EndPos: 6035, }, Value: "1", }, @@ -15830,31 +15743,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 334, - EndLine: 334, - StartPos: 6041, - EndPos: 6059, + EndLine: 334, + StartPos: 6041, + EndPos: 6059, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 334, - EndLine: 334, - StartPos: 6048, - EndPos: 6058, + EndLine: 334, + StartPos: 6048, + EndPos: 6058, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 334, - EndLine: 334, - StartPos: 6048, - EndPos: 6049, + EndLine: 334, + StartPos: 6048, + EndPos: 6049, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 334, - EndLine: 334, - StartPos: 6048, - EndPos: 6049, + EndLine: 334, + StartPos: 6048, + EndPos: 6049, }, Value: "a", }, @@ -15862,25 +15775,25 @@ func TestPhp5(t *testing.T) { Expr: &expr.Ternary{ Position: &position.Position{ StartLine: 334, - EndLine: 334, - StartPos: 6053, - EndPos: 6058, + EndLine: 334, + StartPos: 6053, + EndPos: 6058, }, Condition: &scalar.Lnumber{ Position: &position.Position{ StartLine: 334, - EndLine: 334, - StartPos: 6053, - EndPos: 6053, + EndLine: 334, + StartPos: 6053, + EndPos: 6053, }, Value: "1", }, IfFalse: &scalar.Lnumber{ Position: &position.Position{ StartLine: 334, - EndLine: 334, - StartPos: 6058, - EndPos: 6058, + EndLine: 334, + StartPos: 6058, + EndPos: 6058, }, Value: "2", }, @@ -15891,31 +15804,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 335, - EndLine: 335, - StartPos: 6063, - EndPos: 6084, + EndLine: 335, + StartPos: 6063, + EndPos: 6084, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 335, - EndLine: 335, - StartPos: 6070, - EndPos: 6083, + EndLine: 335, + StartPos: 6070, + EndPos: 6083, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 335, - EndLine: 335, - StartPos: 6070, - EndPos: 6071, + EndLine: 335, + StartPos: 6070, + EndPos: 6071, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 335, - EndLine: 335, - StartPos: 6070, - EndPos: 6071, + EndLine: 335, + StartPos: 6070, + EndPos: 6071, }, Value: "a", }, @@ -15923,34 +15836,34 @@ func TestPhp5(t *testing.T) { Expr: &expr.Ternary{ Position: &position.Position{ StartLine: 335, - EndLine: 335, - StartPos: 6075, - EndPos: 6083, + EndLine: 335, + StartPos: 6075, + EndPos: 6083, }, Condition: &scalar.Lnumber{ Position: &position.Position{ StartLine: 335, - EndLine: 335, - StartPos: 6075, - EndPos: 6075, + EndLine: 335, + StartPos: 6075, + EndPos: 6075, }, Value: "1", }, IfTrue: &scalar.Lnumber{ Position: &position.Position{ StartLine: 335, - EndLine: 335, - StartPos: 6079, - EndPos: 6079, + EndLine: 335, + StartPos: 6079, + EndPos: 6079, }, Value: "2", }, IfFalse: &scalar.Lnumber{ Position: &position.Position{ StartLine: 335, - EndLine: 335, - StartPos: 6083, - EndPos: 6083, + EndLine: 335, + StartPos: 6083, + EndPos: 6083, }, Value: "3", }, @@ -15961,31 +15874,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 336, - EndLine: 336, - StartPos: 6088, - EndPos: 6105, + EndLine: 336, + StartPos: 6088, + EndPos: 6105, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 336, - EndLine: 336, - StartPos: 6095, - EndPos: 6104, + EndLine: 336, + StartPos: 6095, + EndPos: 6104, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 336, - EndLine: 336, - StartPos: 6095, - EndPos: 6096, + EndLine: 336, + StartPos: 6095, + EndPos: 6096, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 336, - EndLine: 336, - StartPos: 6095, - EndPos: 6096, + EndLine: 336, + StartPos: 6095, + EndPos: 6096, }, Value: "a", }, @@ -15993,25 +15906,25 @@ func TestPhp5(t *testing.T) { Expr: &binary.BitwiseAnd{ Position: &position.Position{ StartLine: 336, - EndLine: 336, - StartPos: 6100, - EndPos: 6104, + EndLine: 336, + StartPos: 6100, + EndPos: 6104, }, Left: &scalar.Lnumber{ Position: &position.Position{ StartLine: 336, - EndLine: 336, - StartPos: 6100, - EndPos: 6100, + EndLine: 336, + StartPos: 6100, + EndPos: 6100, }, Value: "1", }, Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 336, - EndLine: 336, - StartPos: 6104, - EndPos: 6104, + EndLine: 336, + StartPos: 6104, + EndPos: 6104, }, Value: "2", }, @@ -16022,31 +15935,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 337, - EndLine: 337, - StartPos: 6109, - EndPos: 6126, + EndLine: 337, + StartPos: 6109, + EndPos: 6126, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 337, - EndLine: 337, - StartPos: 6116, - EndPos: 6125, + EndLine: 337, + StartPos: 6116, + EndPos: 6125, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 337, - EndLine: 337, - StartPos: 6116, - EndPos: 6117, + EndLine: 337, + StartPos: 6116, + EndPos: 6117, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 337, - EndLine: 337, - StartPos: 6116, - EndPos: 6117, + EndLine: 337, + StartPos: 6116, + EndPos: 6117, }, Value: "a", }, @@ -16054,25 +15967,25 @@ func TestPhp5(t *testing.T) { Expr: &binary.BitwiseOr{ Position: &position.Position{ StartLine: 337, - EndLine: 337, - StartPos: 6121, - EndPos: 6125, + EndLine: 337, + StartPos: 6121, + EndPos: 6125, }, Left: &scalar.Lnumber{ Position: &position.Position{ StartLine: 337, - EndLine: 337, - StartPos: 6121, - EndPos: 6121, + EndLine: 337, + StartPos: 6121, + EndPos: 6121, }, Value: "1", }, Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 337, - EndLine: 337, - StartPos: 6125, - EndPos: 6125, + EndLine: 337, + StartPos: 6125, + EndPos: 6125, }, Value: "2", }, @@ -16083,31 +15996,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 338, - EndLine: 338, - StartPos: 6130, - EndPos: 6147, + EndLine: 338, + StartPos: 6130, + EndPos: 6147, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 338, - EndLine: 338, - StartPos: 6137, - EndPos: 6146, + EndLine: 338, + StartPos: 6137, + EndPos: 6146, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 338, - EndLine: 338, - StartPos: 6137, - EndPos: 6138, + EndLine: 338, + StartPos: 6137, + EndPos: 6138, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 338, - EndLine: 338, - StartPos: 6137, - EndPos: 6138, + EndLine: 338, + StartPos: 6137, + EndPos: 6138, }, Value: "a", }, @@ -16115,25 +16028,25 @@ func TestPhp5(t *testing.T) { Expr: &binary.BitwiseXor{ Position: &position.Position{ StartLine: 338, - EndLine: 338, - StartPos: 6142, - EndPos: 6146, + EndLine: 338, + StartPos: 6142, + EndPos: 6146, }, Left: &scalar.Lnumber{ Position: &position.Position{ StartLine: 338, - EndLine: 338, - StartPos: 6142, - EndPos: 6142, + EndLine: 338, + StartPos: 6142, + EndPos: 6142, }, Value: "1", }, Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 338, - EndLine: 338, - StartPos: 6146, - EndPos: 6146, + EndLine: 338, + StartPos: 6146, + EndPos: 6146, }, Value: "2", }, @@ -16144,31 +16057,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 339, - EndLine: 339, - StartPos: 6151, - EndPos: 6169, + EndLine: 339, + StartPos: 6151, + EndPos: 6169, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 339, - EndLine: 339, - StartPos: 6158, - EndPos: 6168, + EndLine: 339, + StartPos: 6158, + EndPos: 6168, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 339, - EndLine: 339, - StartPos: 6158, - EndPos: 6159, + EndLine: 339, + StartPos: 6158, + EndPos: 6159, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 339, - EndLine: 339, - StartPos: 6158, - EndPos: 6159, + EndLine: 339, + StartPos: 6158, + EndPos: 6159, }, Value: "a", }, @@ -16176,25 +16089,25 @@ func TestPhp5(t *testing.T) { Expr: &binary.BooleanAnd{ Position: &position.Position{ StartLine: 339, - EndLine: 339, - StartPos: 6163, - EndPos: 6168, + EndLine: 339, + StartPos: 6163, + EndPos: 6168, }, Left: &scalar.Lnumber{ Position: &position.Position{ StartLine: 339, - EndLine: 339, - StartPos: 6163, - EndPos: 6163, + EndLine: 339, + StartPos: 6163, + EndPos: 6163, }, Value: "1", }, Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 339, - EndLine: 339, - StartPos: 6168, - EndPos: 6168, + EndLine: 339, + StartPos: 6168, + EndPos: 6168, }, Value: "2", }, @@ -16205,31 +16118,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 340, - EndLine: 340, - StartPos: 6173, - EndPos: 6191, + EndLine: 340, + StartPos: 6173, + EndPos: 6191, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 340, - EndLine: 340, - StartPos: 6180, - EndPos: 6190, + EndLine: 340, + StartPos: 6180, + EndPos: 6190, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 340, - EndLine: 340, - StartPos: 6180, - EndPos: 6181, + EndLine: 340, + StartPos: 6180, + EndPos: 6181, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 340, - EndLine: 340, - StartPos: 6180, - EndPos: 6181, + EndLine: 340, + StartPos: 6180, + EndPos: 6181, }, Value: "a", }, @@ -16237,25 +16150,25 @@ func TestPhp5(t *testing.T) { Expr: &binary.BooleanOr{ Position: &position.Position{ StartLine: 340, - EndLine: 340, - StartPos: 6185, - EndPos: 6190, + EndLine: 340, + StartPos: 6185, + EndPos: 6190, }, Left: &scalar.Lnumber{ Position: &position.Position{ StartLine: 340, - EndLine: 340, - StartPos: 6185, - EndPos: 6185, + EndLine: 340, + StartPos: 6185, + EndPos: 6185, }, Value: "1", }, Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 340, - EndLine: 340, - StartPos: 6190, - EndPos: 6190, + EndLine: 340, + StartPos: 6190, + EndPos: 6190, }, Value: "2", }, @@ -16266,31 +16179,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 341, - EndLine: 341, - StartPos: 6195, - EndPos: 6212, + EndLine: 341, + StartPos: 6195, + EndPos: 6212, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 341, - EndLine: 341, - StartPos: 6202, - EndPos: 6211, + EndLine: 341, + StartPos: 6202, + EndPos: 6211, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 341, - EndLine: 341, - StartPos: 6202, - EndPos: 6203, + EndLine: 341, + StartPos: 6202, + EndPos: 6203, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 341, - EndLine: 341, - StartPos: 6202, - EndPos: 6203, + EndLine: 341, + StartPos: 6202, + EndPos: 6203, }, Value: "a", }, @@ -16298,25 +16211,25 @@ func TestPhp5(t *testing.T) { Expr: &binary.Concat{ Position: &position.Position{ StartLine: 341, - EndLine: 341, - StartPos: 6207, - EndPos: 6211, + EndLine: 341, + StartPos: 6207, + EndPos: 6211, }, Left: &scalar.Lnumber{ Position: &position.Position{ StartLine: 341, - EndLine: 341, - StartPos: 6207, - EndPos: 6207, + EndLine: 341, + StartPos: 6207, + EndPos: 6207, }, Value: "1", }, Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 341, - EndLine: 341, - StartPos: 6211, - EndPos: 6211, + EndLine: 341, + StartPos: 6211, + EndPos: 6211, }, Value: "2", }, @@ -16327,31 +16240,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 342, - EndLine: 342, - StartPos: 6216, - EndPos: 6233, + EndLine: 342, + StartPos: 6216, + EndPos: 6233, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 342, - EndLine: 342, - StartPos: 6223, - EndPos: 6232, + EndLine: 342, + StartPos: 6223, + EndPos: 6232, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 342, - EndLine: 342, - StartPos: 6223, - EndPos: 6224, + EndLine: 342, + StartPos: 6223, + EndPos: 6224, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 342, - EndLine: 342, - StartPos: 6223, - EndPos: 6224, + EndLine: 342, + StartPos: 6223, + EndPos: 6224, }, Value: "a", }, @@ -16359,25 +16272,25 @@ func TestPhp5(t *testing.T) { Expr: &binary.Div{ Position: &position.Position{ StartLine: 342, - EndLine: 342, - StartPos: 6228, - EndPos: 6232, + EndLine: 342, + StartPos: 6228, + EndPos: 6232, }, Left: &scalar.Lnumber{ Position: &position.Position{ StartLine: 342, - EndLine: 342, - StartPos: 6228, - EndPos: 6228, + EndLine: 342, + StartPos: 6228, + EndPos: 6228, }, Value: "1", }, Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 342, - EndLine: 342, - StartPos: 6232, - EndPos: 6232, + EndLine: 342, + StartPos: 6232, + EndPos: 6232, }, Value: "2", }, @@ -16388,31 +16301,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 343, - EndLine: 343, - StartPos: 6237, - EndPos: 6255, + EndLine: 343, + StartPos: 6237, + EndPos: 6255, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 343, - EndLine: 343, - StartPos: 6244, - EndPos: 6254, + EndLine: 343, + StartPos: 6244, + EndPos: 6254, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 343, - EndLine: 343, - StartPos: 6244, - EndPos: 6245, + EndLine: 343, + StartPos: 6244, + EndPos: 6245, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 343, - EndLine: 343, - StartPos: 6244, - EndPos: 6245, + EndLine: 343, + StartPos: 6244, + EndPos: 6245, }, Value: "a", }, @@ -16420,25 +16333,25 @@ func TestPhp5(t *testing.T) { Expr: &binary.Equal{ Position: &position.Position{ StartLine: 343, - EndLine: 343, - StartPos: 6249, - EndPos: 6254, + EndLine: 343, + StartPos: 6249, + EndPos: 6254, }, Left: &scalar.Lnumber{ Position: &position.Position{ StartLine: 343, - EndLine: 343, - StartPos: 6249, - EndPos: 6249, + EndLine: 343, + StartPos: 6249, + EndPos: 6249, }, Value: "1", }, Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 343, - EndLine: 343, - StartPos: 6254, - EndPos: 6254, + EndLine: 343, + StartPos: 6254, + EndPos: 6254, }, Value: "2", }, @@ -16449,31 +16362,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 344, - EndLine: 344, - StartPos: 6259, - EndPos: 6277, + EndLine: 344, + StartPos: 6259, + EndPos: 6277, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 344, - EndLine: 344, - StartPos: 6266, - EndPos: 6276, + EndLine: 344, + StartPos: 6266, + EndPos: 6276, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 344, - EndLine: 344, - StartPos: 6266, - EndPos: 6267, + EndLine: 344, + StartPos: 6266, + EndPos: 6267, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 344, - EndLine: 344, - StartPos: 6266, - EndPos: 6267, + EndLine: 344, + StartPos: 6266, + EndPos: 6267, }, Value: "a", }, @@ -16481,25 +16394,25 @@ func TestPhp5(t *testing.T) { Expr: &binary.GreaterOrEqual{ Position: &position.Position{ StartLine: 344, - EndLine: 344, - StartPos: 6271, - EndPos: 6276, + EndLine: 344, + StartPos: 6271, + EndPos: 6276, }, Left: &scalar.Lnumber{ Position: &position.Position{ StartLine: 344, - EndLine: 344, - StartPos: 6271, - EndPos: 6271, + EndLine: 344, + StartPos: 6271, + EndPos: 6271, }, Value: "1", }, Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 344, - EndLine: 344, - StartPos: 6276, - EndPos: 6276, + EndLine: 344, + StartPos: 6276, + EndPos: 6276, }, Value: "2", }, @@ -16510,31 +16423,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 345, - EndLine: 345, - StartPos: 6281, - EndPos: 6298, + EndLine: 345, + StartPos: 6281, + EndPos: 6298, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 345, - EndLine: 345, - StartPos: 6288, - EndPos: 6297, + EndLine: 345, + StartPos: 6288, + EndPos: 6297, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 345, - EndLine: 345, - StartPos: 6288, - EndPos: 6289, + EndLine: 345, + StartPos: 6288, + EndPos: 6289, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 345, - EndLine: 345, - StartPos: 6288, - EndPos: 6289, + EndLine: 345, + StartPos: 6288, + EndPos: 6289, }, Value: "a", }, @@ -16542,25 +16455,25 @@ func TestPhp5(t *testing.T) { Expr: &binary.Greater{ Position: &position.Position{ StartLine: 345, - EndLine: 345, - StartPos: 6293, - EndPos: 6297, + EndLine: 345, + StartPos: 6293, + EndPos: 6297, }, Left: &scalar.Lnumber{ Position: &position.Position{ StartLine: 345, - EndLine: 345, - StartPos: 6293, - EndPos: 6293, + EndLine: 345, + StartPos: 6293, + EndPos: 6293, }, Value: "1", }, Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 345, - EndLine: 345, - StartPos: 6297, - EndPos: 6297, + EndLine: 345, + StartPos: 6297, + EndPos: 6297, }, Value: "2", }, @@ -16571,31 +16484,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 346, - EndLine: 346, - StartPos: 6302, - EndPos: 6321, + EndLine: 346, + StartPos: 6302, + EndPos: 6321, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 346, - EndLine: 346, - StartPos: 6309, - EndPos: 6320, + EndLine: 346, + StartPos: 6309, + EndPos: 6320, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 346, - EndLine: 346, - StartPos: 6309, - EndPos: 6310, + EndLine: 346, + StartPos: 6309, + EndPos: 6310, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 346, - EndLine: 346, - StartPos: 6309, - EndPos: 6310, + EndLine: 346, + StartPos: 6309, + EndPos: 6310, }, Value: "a", }, @@ -16603,25 +16516,25 @@ func TestPhp5(t *testing.T) { Expr: &binary.Identical{ Position: &position.Position{ StartLine: 346, - EndLine: 346, - StartPos: 6314, - EndPos: 6320, + EndLine: 346, + StartPos: 6314, + EndPos: 6320, }, Left: &scalar.Lnumber{ Position: &position.Position{ StartLine: 346, - EndLine: 346, - StartPos: 6314, - EndPos: 6314, + EndLine: 346, + StartPos: 6314, + EndPos: 6314, }, Value: "1", }, Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 346, - EndLine: 346, - StartPos: 6320, - EndPos: 6320, + EndLine: 346, + StartPos: 6320, + EndPos: 6320, }, Value: "2", }, @@ -16632,31 +16545,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 347, - EndLine: 347, - StartPos: 6325, - EndPos: 6344, + EndLine: 347, + StartPos: 6325, + EndPos: 6344, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 347, - EndLine: 347, - StartPos: 6332, - EndPos: 6343, + EndLine: 347, + StartPos: 6332, + EndPos: 6343, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 347, - EndLine: 347, - StartPos: 6332, - EndPos: 6333, + EndLine: 347, + StartPos: 6332, + EndPos: 6333, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 347, - EndLine: 347, - StartPos: 6332, - EndPos: 6333, + EndLine: 347, + StartPos: 6332, + EndPos: 6333, }, Value: "a", }, @@ -16664,25 +16577,25 @@ func TestPhp5(t *testing.T) { Expr: &binary.LogicalAnd{ Position: &position.Position{ StartLine: 347, - EndLine: 347, - StartPos: 6337, - EndPos: 6343, + EndLine: 347, + StartPos: 6337, + EndPos: 6343, }, Left: &scalar.Lnumber{ Position: &position.Position{ StartLine: 347, - EndLine: 347, - StartPos: 6337, - EndPos: 6337, + EndLine: 347, + StartPos: 6337, + EndPos: 6337, }, Value: "1", }, Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 347, - EndLine: 347, - StartPos: 6343, - EndPos: 6343, + EndLine: 347, + StartPos: 6343, + EndPos: 6343, }, Value: "2", }, @@ -16693,31 +16606,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 348, - EndLine: 348, - StartPos: 6348, - EndPos: 6366, + EndLine: 348, + StartPos: 6348, + EndPos: 6366, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 348, - EndLine: 348, - StartPos: 6355, - EndPos: 6365, + EndLine: 348, + StartPos: 6355, + EndPos: 6365, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 348, - EndLine: 348, - StartPos: 6355, - EndPos: 6356, + EndLine: 348, + StartPos: 6355, + EndPos: 6356, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 348, - EndLine: 348, - StartPos: 6355, - EndPos: 6356, + EndLine: 348, + StartPos: 6355, + EndPos: 6356, }, Value: "a", }, @@ -16725,25 +16638,25 @@ func TestPhp5(t *testing.T) { Expr: &binary.LogicalOr{ Position: &position.Position{ StartLine: 348, - EndLine: 348, - StartPos: 6360, - EndPos: 6365, + EndLine: 348, + StartPos: 6360, + EndPos: 6365, }, Left: &scalar.Lnumber{ Position: &position.Position{ StartLine: 348, - EndLine: 348, - StartPos: 6360, - EndPos: 6360, + EndLine: 348, + StartPos: 6360, + EndPos: 6360, }, Value: "1", }, Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 348, - EndLine: 348, - StartPos: 6365, - EndPos: 6365, + EndLine: 348, + StartPos: 6365, + EndPos: 6365, }, Value: "2", }, @@ -16754,31 +16667,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 349, - EndLine: 349, - StartPos: 6370, - EndPos: 6389, + EndLine: 349, + StartPos: 6370, + EndPos: 6389, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 349, - EndLine: 349, - StartPos: 6377, - EndPos: 6388, + EndLine: 349, + StartPos: 6377, + EndPos: 6388, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 349, - EndLine: 349, - StartPos: 6377, - EndPos: 6378, + EndLine: 349, + StartPos: 6377, + EndPos: 6378, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 349, - EndLine: 349, - StartPos: 6377, - EndPos: 6378, + EndLine: 349, + StartPos: 6377, + EndPos: 6378, }, Value: "a", }, @@ -16786,25 +16699,25 @@ func TestPhp5(t *testing.T) { Expr: &binary.LogicalXor{ Position: &position.Position{ StartLine: 349, - EndLine: 349, - StartPos: 6382, - EndPos: 6388, + EndLine: 349, + StartPos: 6382, + EndPos: 6388, }, Left: &scalar.Lnumber{ Position: &position.Position{ StartLine: 349, - EndLine: 349, - StartPos: 6382, - EndPos: 6382, + EndLine: 349, + StartPos: 6382, + EndPos: 6382, }, Value: "1", }, Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 349, - EndLine: 349, - StartPos: 6388, - EndPos: 6388, + EndLine: 349, + StartPos: 6388, + EndPos: 6388, }, Value: "2", }, @@ -16815,31 +16728,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 350, - EndLine: 350, - StartPos: 6393, - EndPos: 6410, + EndLine: 350, + StartPos: 6393, + EndPos: 6410, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 350, - EndLine: 350, - StartPos: 6400, - EndPos: 6409, + EndLine: 350, + StartPos: 6400, + EndPos: 6409, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 350, - EndLine: 350, - StartPos: 6400, - EndPos: 6401, + EndLine: 350, + StartPos: 6400, + EndPos: 6401, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 350, - EndLine: 350, - StartPos: 6400, - EndPos: 6401, + EndLine: 350, + StartPos: 6400, + EndPos: 6401, }, Value: "a", }, @@ -16847,25 +16760,25 @@ func TestPhp5(t *testing.T) { Expr: &binary.Minus{ Position: &position.Position{ StartLine: 350, - EndLine: 350, - StartPos: 6405, - EndPos: 6409, + EndLine: 350, + StartPos: 6405, + EndPos: 6409, }, Left: &scalar.Lnumber{ Position: &position.Position{ StartLine: 350, - EndLine: 350, - StartPos: 6405, - EndPos: 6405, + EndLine: 350, + StartPos: 6405, + EndPos: 6405, }, Value: "1", }, Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 350, - EndLine: 350, - StartPos: 6409, - EndPos: 6409, + EndLine: 350, + StartPos: 6409, + EndPos: 6409, }, Value: "2", }, @@ -16876,31 +16789,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 351, - EndLine: 351, - StartPos: 6414, - EndPos: 6431, + EndLine: 351, + StartPos: 6414, + EndPos: 6431, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 351, - EndLine: 351, - StartPos: 6421, - EndPos: 6430, + EndLine: 351, + StartPos: 6421, + EndPos: 6430, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 351, - EndLine: 351, - StartPos: 6421, - EndPos: 6422, + EndLine: 351, + StartPos: 6421, + EndPos: 6422, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 351, - EndLine: 351, - StartPos: 6421, - EndPos: 6422, + EndLine: 351, + StartPos: 6421, + EndPos: 6422, }, Value: "a", }, @@ -16908,25 +16821,25 @@ func TestPhp5(t *testing.T) { Expr: &binary.Mod{ Position: &position.Position{ StartLine: 351, - EndLine: 351, - StartPos: 6426, - EndPos: 6430, + EndLine: 351, + StartPos: 6426, + EndPos: 6430, }, Left: &scalar.Lnumber{ Position: &position.Position{ StartLine: 351, - EndLine: 351, - StartPos: 6426, - EndPos: 6426, + EndLine: 351, + StartPos: 6426, + EndPos: 6426, }, Value: "1", }, Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 351, - EndLine: 351, - StartPos: 6430, - EndPos: 6430, + EndLine: 351, + StartPos: 6430, + EndPos: 6430, }, Value: "2", }, @@ -16937,31 +16850,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 352, - EndLine: 352, - StartPos: 6435, - EndPos: 6452, + EndLine: 352, + StartPos: 6435, + EndPos: 6452, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 352, - EndLine: 352, - StartPos: 6442, - EndPos: 6451, + EndLine: 352, + StartPos: 6442, + EndPos: 6451, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 352, - EndLine: 352, - StartPos: 6442, - EndPos: 6443, + EndLine: 352, + StartPos: 6442, + EndPos: 6443, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 352, - EndLine: 352, - StartPos: 6442, - EndPos: 6443, + EndLine: 352, + StartPos: 6442, + EndPos: 6443, }, Value: "a", }, @@ -16969,25 +16882,25 @@ func TestPhp5(t *testing.T) { Expr: &binary.Mul{ Position: &position.Position{ StartLine: 352, - EndLine: 352, - StartPos: 6447, - EndPos: 6451, + EndLine: 352, + StartPos: 6447, + EndPos: 6451, }, Left: &scalar.Lnumber{ Position: &position.Position{ StartLine: 352, - EndLine: 352, - StartPos: 6447, - EndPos: 6447, + EndLine: 352, + StartPos: 6447, + EndPos: 6447, }, Value: "1", }, Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 352, - EndLine: 352, - StartPos: 6451, - EndPos: 6451, + EndLine: 352, + StartPos: 6451, + EndPos: 6451, }, Value: "2", }, @@ -16998,31 +16911,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 353, - EndLine: 353, - StartPos: 6456, - EndPos: 6474, + EndLine: 353, + StartPos: 6456, + EndPos: 6474, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 353, - EndLine: 353, - StartPos: 6463, - EndPos: 6473, + EndLine: 353, + StartPos: 6463, + EndPos: 6473, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 353, - EndLine: 353, - StartPos: 6463, - EndPos: 6464, + EndLine: 353, + StartPos: 6463, + EndPos: 6464, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 353, - EndLine: 353, - StartPos: 6463, - EndPos: 6464, + EndLine: 353, + StartPos: 6463, + EndPos: 6464, }, Value: "a", }, @@ -17030,25 +16943,25 @@ func TestPhp5(t *testing.T) { Expr: &binary.NotEqual{ Position: &position.Position{ StartLine: 353, - EndLine: 353, - StartPos: 6468, - EndPos: 6473, + EndLine: 353, + StartPos: 6468, + EndPos: 6473, }, Left: &scalar.Lnumber{ Position: &position.Position{ StartLine: 353, - EndLine: 353, - StartPos: 6468, - EndPos: 6468, + EndLine: 353, + StartPos: 6468, + EndPos: 6468, }, Value: "1", }, Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 353, - EndLine: 353, - StartPos: 6473, - EndPos: 6473, + EndLine: 353, + StartPos: 6473, + EndPos: 6473, }, Value: "2", }, @@ -17059,31 +16972,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 354, - EndLine: 354, - StartPos: 6478, - EndPos: 6497, + EndLine: 354, + StartPos: 6478, + EndPos: 6497, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 354, - EndLine: 354, - StartPos: 6485, - EndPos: 6496, + EndLine: 354, + StartPos: 6485, + EndPos: 6496, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 354, - EndLine: 354, - StartPos: 6485, - EndPos: 6486, + EndLine: 354, + StartPos: 6485, + EndPos: 6486, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 354, - EndLine: 354, - StartPos: 6485, - EndPos: 6486, + EndLine: 354, + StartPos: 6485, + EndPos: 6486, }, Value: "a", }, @@ -17091,25 +17004,25 @@ func TestPhp5(t *testing.T) { Expr: &binary.NotIdentical{ Position: &position.Position{ StartLine: 354, - EndLine: 354, - StartPos: 6490, - EndPos: 6496, + EndLine: 354, + StartPos: 6490, + EndPos: 6496, }, Left: &scalar.Lnumber{ Position: &position.Position{ StartLine: 354, - EndLine: 354, - StartPos: 6490, - EndPos: 6490, + EndLine: 354, + StartPos: 6490, + EndPos: 6490, }, Value: "1", }, Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 354, - EndLine: 354, - StartPos: 6496, - EndPos: 6496, + EndLine: 354, + StartPos: 6496, + EndPos: 6496, }, Value: "2", }, @@ -17120,31 +17033,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 355, - EndLine: 355, - StartPos: 6501, - EndPos: 6518, + EndLine: 355, + StartPos: 6501, + EndPos: 6518, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 355, - EndLine: 355, - StartPos: 6508, - EndPos: 6517, + EndLine: 355, + StartPos: 6508, + EndPos: 6517, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 355, - EndLine: 355, - StartPos: 6508, - EndPos: 6509, + EndLine: 355, + StartPos: 6508, + EndPos: 6509, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 355, - EndLine: 355, - StartPos: 6508, - EndPos: 6509, + EndLine: 355, + StartPos: 6508, + EndPos: 6509, }, Value: "a", }, @@ -17152,25 +17065,25 @@ func TestPhp5(t *testing.T) { Expr: &binary.Plus{ Position: &position.Position{ StartLine: 355, - EndLine: 355, - StartPos: 6513, - EndPos: 6517, + EndLine: 355, + StartPos: 6513, + EndPos: 6517, }, Left: &scalar.Lnumber{ Position: &position.Position{ StartLine: 355, - EndLine: 355, - StartPos: 6513, - EndPos: 6513, + EndLine: 355, + StartPos: 6513, + EndPos: 6513, }, Value: "1", }, Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 355, - EndLine: 355, - StartPos: 6517, - EndPos: 6517, + EndLine: 355, + StartPos: 6517, + EndPos: 6517, }, Value: "2", }, @@ -17181,31 +17094,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 356, - EndLine: 356, - StartPos: 6522, - EndPos: 6540, + EndLine: 356, + StartPos: 6522, + EndPos: 6540, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 356, - EndLine: 356, - StartPos: 6529, - EndPos: 6539, + EndLine: 356, + StartPos: 6529, + EndPos: 6539, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 356, - EndLine: 356, - StartPos: 6529, - EndPos: 6530, + EndLine: 356, + StartPos: 6529, + EndPos: 6530, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 356, - EndLine: 356, - StartPos: 6529, - EndPos: 6530, + EndLine: 356, + StartPos: 6529, + EndPos: 6530, }, Value: "a", }, @@ -17213,25 +17126,25 @@ func TestPhp5(t *testing.T) { Expr: &binary.Pow{ Position: &position.Position{ StartLine: 356, - EndLine: 356, - StartPos: 6534, - EndPos: 6539, + EndLine: 356, + StartPos: 6534, + EndPos: 6539, }, Left: &scalar.Lnumber{ Position: &position.Position{ StartLine: 356, - EndLine: 356, - StartPos: 6534, - EndPos: 6534, + EndLine: 356, + StartPos: 6534, + EndPos: 6534, }, Value: "1", }, Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 356, - EndLine: 356, - StartPos: 6539, - EndPos: 6539, + EndLine: 356, + StartPos: 6539, + EndPos: 6539, }, Value: "2", }, @@ -17242,31 +17155,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 357, - EndLine: 357, - StartPos: 6544, - EndPos: 6562, + EndLine: 357, + StartPos: 6544, + EndPos: 6562, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 357, - EndLine: 357, - StartPos: 6551, - EndPos: 6561, + EndLine: 357, + StartPos: 6551, + EndPos: 6561, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 357, - EndLine: 357, - StartPos: 6551, - EndPos: 6552, + EndLine: 357, + StartPos: 6551, + EndPos: 6552, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 357, - EndLine: 357, - StartPos: 6551, - EndPos: 6552, + EndLine: 357, + StartPos: 6551, + EndPos: 6552, }, Value: "a", }, @@ -17274,25 +17187,25 @@ func TestPhp5(t *testing.T) { Expr: &binary.ShiftLeft{ Position: &position.Position{ StartLine: 357, - EndLine: 357, - StartPos: 6556, - EndPos: 6561, + EndLine: 357, + StartPos: 6556, + EndPos: 6561, }, Left: &scalar.Lnumber{ Position: &position.Position{ StartLine: 357, - EndLine: 357, - StartPos: 6556, - EndPos: 6556, + EndLine: 357, + StartPos: 6556, + EndPos: 6556, }, Value: "1", }, Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 357, - EndLine: 357, - StartPos: 6561, - EndPos: 6561, + EndLine: 357, + StartPos: 6561, + EndPos: 6561, }, Value: "2", }, @@ -17303,31 +17216,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 358, - EndLine: 358, - StartPos: 6566, - EndPos: 6584, + EndLine: 358, + StartPos: 6566, + EndPos: 6584, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 358, - EndLine: 358, - StartPos: 6573, - EndPos: 6583, + EndLine: 358, + StartPos: 6573, + EndPos: 6583, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 358, - EndLine: 358, - StartPos: 6573, - EndPos: 6574, + EndLine: 358, + StartPos: 6573, + EndPos: 6574, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 358, - EndLine: 358, - StartPos: 6573, - EndPos: 6574, + EndLine: 358, + StartPos: 6573, + EndPos: 6574, }, Value: "a", }, @@ -17335,25 +17248,25 @@ func TestPhp5(t *testing.T) { Expr: &binary.ShiftRight{ Position: &position.Position{ StartLine: 358, - EndLine: 358, - StartPos: 6578, - EndPos: 6583, + EndLine: 358, + StartPos: 6578, + EndPos: 6583, }, Left: &scalar.Lnumber{ Position: &position.Position{ StartLine: 358, - EndLine: 358, - StartPos: 6578, - EndPos: 6578, + EndLine: 358, + StartPos: 6578, + EndPos: 6578, }, Value: "1", }, Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 358, - EndLine: 358, - StartPos: 6583, - EndPos: 6583, + EndLine: 358, + StartPos: 6583, + EndPos: 6583, }, Value: "2", }, @@ -17364,31 +17277,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 359, - EndLine: 359, - StartPos: 6588, - EndPos: 6606, + EndLine: 359, + StartPos: 6588, + EndPos: 6606, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 359, - EndLine: 359, - StartPos: 6595, - EndPos: 6605, + EndLine: 359, + StartPos: 6595, + EndPos: 6605, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 359, - EndLine: 359, - StartPos: 6595, - EndPos: 6596, + EndLine: 359, + StartPos: 6595, + EndPos: 6596, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 359, - EndLine: 359, - StartPos: 6595, - EndPos: 6596, + EndLine: 359, + StartPos: 6595, + EndPos: 6596, }, Value: "a", }, @@ -17396,25 +17309,25 @@ func TestPhp5(t *testing.T) { Expr: &binary.SmallerOrEqual{ Position: &position.Position{ StartLine: 359, - EndLine: 359, - StartPos: 6600, - EndPos: 6605, + EndLine: 359, + StartPos: 6600, + EndPos: 6605, }, Left: &scalar.Lnumber{ Position: &position.Position{ StartLine: 359, - EndLine: 359, - StartPos: 6600, - EndPos: 6600, + EndLine: 359, + StartPos: 6600, + EndPos: 6600, }, Value: "1", }, Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 359, - EndLine: 359, - StartPos: 6605, - EndPos: 6605, + EndLine: 359, + StartPos: 6605, + EndPos: 6605, }, Value: "2", }, @@ -17425,31 +17338,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 360, - EndLine: 360, - StartPos: 6610, - EndPos: 6627, + EndLine: 360, + StartPos: 6610, + EndPos: 6627, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 360, - EndLine: 360, - StartPos: 6617, - EndPos: 6626, + EndLine: 360, + StartPos: 6617, + EndPos: 6626, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 360, - EndLine: 360, - StartPos: 6617, - EndPos: 6618, + EndLine: 360, + StartPos: 6617, + EndPos: 6618, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 360, - EndLine: 360, - StartPos: 6617, - EndPos: 6618, + EndLine: 360, + StartPos: 6617, + EndPos: 6618, }, Value: "a", }, @@ -17457,25 +17370,25 @@ func TestPhp5(t *testing.T) { Expr: &binary.Smaller{ Position: &position.Position{ StartLine: 360, - EndLine: 360, - StartPos: 6622, - EndPos: 6626, + EndLine: 360, + StartPos: 6622, + EndPos: 6626, }, Left: &scalar.Lnumber{ Position: &position.Position{ StartLine: 360, - EndLine: 360, - StartPos: 6622, - EndPos: 6622, + EndLine: 360, + StartPos: 6622, + EndPos: 6622, }, Value: "1", }, Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 360, - EndLine: 360, - StartPos: 6626, - EndPos: 6626, + EndLine: 360, + StartPos: 6626, + EndPos: 6626, }, Value: "2", }, @@ -17486,31 +17399,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 361, - EndLine: 361, - StartPos: 6631, - EndPos: 6651, + EndLine: 361, + StartPos: 6631, + EndPos: 6651, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 361, - EndLine: 361, - StartPos: 6638, - EndPos: 6650, + EndLine: 361, + StartPos: 6638, + EndPos: 6650, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 361, - EndLine: 361, - StartPos: 6638, - EndPos: 6639, + EndLine: 361, + StartPos: 6638, + EndPos: 6639, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 361, - EndLine: 361, - StartPos: 6638, - EndPos: 6639, + EndLine: 361, + StartPos: 6638, + EndPos: 6639, }, Value: "a", }, @@ -17518,24 +17431,24 @@ func TestPhp5(t *testing.T) { Expr: &expr.ClassConstFetch{ Position: &position.Position{ StartLine: 361, - EndLine: 361, - StartPos: 6643, - EndPos: 6650, + EndLine: 361, + StartPos: 6643, + EndPos: 6650, }, Class: &name.Name{ Position: &position.Position{ StartLine: 361, - EndLine: 361, - StartPos: 6643, - EndPos: 6645, + EndLine: 361, + StartPos: 6643, + EndPos: 6645, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 361, - EndLine: 361, - StartPos: 6643, - EndPos: 6645, + EndLine: 361, + StartPos: 6643, + EndPos: 6645, }, Value: "Foo", }, @@ -17544,9 +17457,9 @@ func TestPhp5(t *testing.T) { ConstantName: &node.Identifier{ Position: &position.Position{ StartLine: 361, - EndLine: 361, - StartPos: 6648, - EndPos: 6650, + EndLine: 361, + StartPos: 6648, + EndPos: 6650, }, Value: "bar", }, @@ -17557,31 +17470,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 362, - EndLine: 362, - StartPos: 6655, - EndPos: 6677, + EndLine: 362, + StartPos: 6655, + EndPos: 6677, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 362, - EndLine: 362, - StartPos: 6662, - EndPos: 6676, + EndLine: 362, + StartPos: 6662, + EndPos: 6676, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 362, - EndLine: 362, - StartPos: 6662, - EndPos: 6663, + EndLine: 362, + StartPos: 6662, + EndPos: 6663, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 362, - EndLine: 362, - StartPos: 6662, - EndPos: 6663, + EndLine: 362, + StartPos: 6662, + EndPos: 6663, }, Value: "a", }, @@ -17589,24 +17502,24 @@ func TestPhp5(t *testing.T) { Expr: &expr.ClassConstFetch{ Position: &position.Position{ StartLine: 362, - EndLine: 362, - StartPos: 6667, - EndPos: 6676, + EndLine: 362, + StartPos: 6667, + EndPos: 6676, }, Class: &name.Name{ Position: &position.Position{ StartLine: 362, - EndLine: 362, - StartPos: 6667, - EndPos: 6669, + EndLine: 362, + StartPos: 6667, + EndPos: 6669, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 362, - EndLine: 362, - StartPos: 6667, - EndPos: 6669, + EndLine: 362, + StartPos: 6667, + EndPos: 6669, }, Value: "Foo", }, @@ -17615,9 +17528,9 @@ func TestPhp5(t *testing.T) { ConstantName: &node.Identifier{ Position: &position.Position{ StartLine: 362, - EndLine: 362, - StartPos: 6672, - EndPos: 6676, + EndLine: 362, + StartPos: 6672, + EndPos: 6676, }, Value: "class", }, @@ -17628,31 +17541,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 363, - EndLine: 363, - StartPos: 6681, - EndPos: 6702, + EndLine: 363, + StartPos: 6681, + EndPos: 6702, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 363, - EndLine: 363, - StartPos: 6688, - EndPos: 6701, + EndLine: 363, + StartPos: 6688, + EndPos: 6701, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 363, - EndLine: 363, - StartPos: 6688, - EndPos: 6689, + EndLine: 363, + StartPos: 6688, + EndPos: 6689, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 363, - EndLine: 363, - StartPos: 6688, - EndPos: 6689, + EndLine: 363, + StartPos: 6688, + EndPos: 6689, }, Value: "a", }, @@ -17660,9 +17573,9 @@ func TestPhp5(t *testing.T) { Expr: &scalar.MagicConstant{ Position: &position.Position{ StartLine: 363, - EndLine: 363, - StartPos: 6693, - EndPos: 6701, + EndLine: 363, + StartPos: 6693, + EndPos: 6701, }, Value: "__CLASS__", }, @@ -17672,31 +17585,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 364, - EndLine: 364, - StartPos: 6706, - EndPos: 6721, + EndLine: 364, + StartPos: 6706, + EndPos: 6721, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 364, - EndLine: 364, - StartPos: 6713, - EndPos: 6720, + EndLine: 364, + StartPos: 6713, + EndPos: 6720, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 364, - EndLine: 364, - StartPos: 6713, - EndPos: 6714, + EndLine: 364, + StartPos: 6713, + EndPos: 6714, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 364, - EndLine: 364, - StartPos: 6713, - EndPos: 6714, + EndLine: 364, + StartPos: 6713, + EndPos: 6714, }, Value: "a", }, @@ -17704,24 +17617,24 @@ func TestPhp5(t *testing.T) { Expr: &expr.ConstFetch{ Position: &position.Position{ StartLine: 364, - EndLine: 364, - StartPos: 6718, - EndPos: 6720, + EndLine: 364, + StartPos: 6718, + EndPos: 6720, }, Constant: &name.Name{ Position: &position.Position{ StartLine: 364, - EndLine: 364, - StartPos: 6718, - EndPos: 6720, + EndLine: 364, + StartPos: 6718, + EndPos: 6720, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 364, - EndLine: 364, - StartPos: 6718, - EndPos: 6720, + EndLine: 364, + StartPos: 6718, + EndPos: 6720, }, Value: "Foo", }, @@ -17734,31 +17647,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 365, - EndLine: 365, - StartPos: 6725, - EndPos: 6750, + EndLine: 365, + StartPos: 6725, + EndPos: 6750, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 365, - EndLine: 365, - StartPos: 6732, - EndPos: 6749, + EndLine: 365, + StartPos: 6732, + EndPos: 6749, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 365, - EndLine: 365, - StartPos: 6732, - EndPos: 6733, + EndLine: 365, + StartPos: 6732, + EndPos: 6733, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 365, - EndLine: 365, - StartPos: 6732, - EndPos: 6733, + EndLine: 365, + StartPos: 6732, + EndPos: 6733, }, Value: "a", }, @@ -17766,24 +17679,24 @@ func TestPhp5(t *testing.T) { Expr: &expr.ConstFetch{ Position: &position.Position{ StartLine: 365, - EndLine: 365, - StartPos: 6737, - EndPos: 6749, + EndLine: 365, + StartPos: 6737, + EndPos: 6749, }, Constant: &name.Relative{ Position: &position.Position{ StartLine: 365, - EndLine: 365, - StartPos: 6737, - EndPos: 6749, + EndLine: 365, + StartPos: 6737, + EndPos: 6749, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 365, - EndLine: 365, - StartPos: 6747, - EndPos: 6749, + EndLine: 365, + StartPos: 6747, + EndPos: 6749, }, Value: "Foo", }, @@ -17796,31 +17709,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 366, - EndLine: 366, - StartPos: 6754, - EndPos: 6770, + EndLine: 366, + StartPos: 6754, + EndPos: 6770, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 366, - EndLine: 366, - StartPos: 6761, - EndPos: 6769, + EndLine: 366, + StartPos: 6761, + EndPos: 6769, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 366, - EndLine: 366, - StartPos: 6761, - EndPos: 6762, + EndLine: 366, + StartPos: 6761, + EndPos: 6762, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 366, - EndLine: 366, - StartPos: 6761, - EndPos: 6762, + EndLine: 366, + StartPos: 6761, + EndPos: 6762, }, Value: "a", }, @@ -17828,24 +17741,24 @@ func TestPhp5(t *testing.T) { Expr: &expr.ConstFetch{ Position: &position.Position{ StartLine: 366, - EndLine: 366, - StartPos: 6766, - EndPos: 6769, + EndLine: 366, + StartPos: 6766, + EndPos: 6769, }, Constant: &name.FullyQualified{ Position: &position.Position{ StartLine: 366, - EndLine: 366, - StartPos: 6766, - EndPos: 6769, + EndLine: 366, + StartPos: 6766, + EndPos: 6769, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 366, - EndLine: 366, - StartPos: 6767, - EndPos: 6769, + EndLine: 366, + StartPos: 6767, + EndPos: 6769, }, Value: "Foo", }, @@ -17858,31 +17771,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 367, - EndLine: 367, - StartPos: 6774, - EndPos: 6793, + EndLine: 367, + StartPos: 6774, + EndPos: 6793, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 367, - EndLine: 367, - StartPos: 6781, - EndPos: 6792, + EndLine: 367, + StartPos: 6781, + EndPos: 6792, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 367, - EndLine: 367, - StartPos: 6781, - EndPos: 6782, + EndLine: 367, + StartPos: 6781, + EndPos: 6782, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 367, - EndLine: 367, - StartPos: 6781, - EndPos: 6782, + EndLine: 367, + StartPos: 6781, + EndPos: 6782, }, Value: "a", }, @@ -17890,9 +17803,9 @@ func TestPhp5(t *testing.T) { Expr: &expr.Array{ Position: &position.Position{ StartLine: 367, - EndLine: 367, - StartPos: 6786, - EndPos: 6792, + EndLine: 367, + StartPos: 6786, + EndPos: 6792, }, }, }, @@ -17901,31 +17814,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 368, - EndLine: 368, - StartPos: 6797, - EndPos: 6825, + EndLine: 368, + StartPos: 6797, + EndPos: 6825, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 368, - EndLine: 368, - StartPos: 6804, - EndPos: 6824, + EndLine: 368, + StartPos: 6804, + EndPos: 6824, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 368, - EndLine: 368, - StartPos: 6804, - EndPos: 6805, + EndLine: 368, + StartPos: 6804, + EndPos: 6805, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 368, - EndLine: 368, - StartPos: 6804, - EndPos: 6805, + EndLine: 368, + StartPos: 6804, + EndPos: 6805, }, Value: "a", }, @@ -17933,33 +17846,33 @@ func TestPhp5(t *testing.T) { Expr: &expr.Array{ Position: &position.Position{ StartLine: 368, - EndLine: 368, - StartPos: 6809, - EndPos: 6824, + EndLine: 368, + StartPos: 6809, + EndPos: 6824, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 368, - EndLine: 368, - StartPos: 6815, - EndPos: 6820, + EndLine: 368, + StartPos: 6815, + EndPos: 6820, }, Key: &scalar.Lnumber{ Position: &position.Position{ StartLine: 368, - EndLine: 368, - StartPos: 6815, - EndPos: 6815, + EndLine: 368, + StartPos: 6815, + EndPos: 6815, }, Value: "1", }, Val: &scalar.Lnumber{ Position: &position.Position{ StartLine: 368, - EndLine: 368, - StartPos: 6820, - EndPos: 6820, + EndLine: 368, + StartPos: 6820, + EndPos: 6820, }, Value: "1", }, @@ -17967,16 +17880,16 @@ func TestPhp5(t *testing.T) { &expr.ArrayItem{ Position: &position.Position{ StartLine: 368, - EndLine: 368, - StartPos: 6823, - EndPos: 6823, + EndLine: 368, + StartPos: 6823, + EndPos: 6823, }, Val: &scalar.Lnumber{ Position: &position.Position{ StartLine: 368, - EndLine: 368, - StartPos: 6823, - EndPos: 6823, + EndLine: 368, + StartPos: 6823, + EndPos: 6823, }, Value: "2", }, @@ -17989,31 +17902,31 @@ func TestPhp5(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 369, - EndLine: 369, - StartPos: 6829, - EndPos: 6855, + EndLine: 369, + StartPos: 6829, + EndPos: 6855, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 369, - EndLine: 369, - StartPos: 6836, - EndPos: 6854, + EndLine: 369, + StartPos: 6836, + EndPos: 6854, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 369, - EndLine: 369, - StartPos: 6836, - EndPos: 6837, + EndLine: 369, + StartPos: 6836, + EndPos: 6837, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 369, - EndLine: 369, - StartPos: 6836, - EndPos: 6837, + EndLine: 369, + StartPos: 6836, + EndPos: 6837, }, Value: "a", }, @@ -18021,31 +17934,31 @@ func TestPhp5(t *testing.T) { Expr: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 369, - EndLine: 369, - StartPos: 6841, - EndPos: 6854, + EndLine: 369, + StartPos: 6841, + EndPos: 6854, }, Variable: &expr.ShortArray{ Position: &position.Position{ StartLine: 369, - EndLine: 369, - StartPos: 6841, - EndPos: 6851, + EndLine: 369, + StartPos: 6841, + EndPos: 6851, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 369, - EndLine: 369, - StartPos: 6842, - EndPos: 6842, + EndLine: 369, + StartPos: 6842, + EndPos: 6842, }, Val: &scalar.Lnumber{ Position: &position.Position{ StartLine: 369, - EndLine: 369, - StartPos: 6842, - EndPos: 6842, + EndLine: 369, + StartPos: 6842, + EndPos: 6842, }, Value: "1", }, @@ -18053,25 +17966,25 @@ func TestPhp5(t *testing.T) { &expr.ArrayItem{ Position: &position.Position{ StartLine: 369, - EndLine: 369, - StartPos: 6845, - EndPos: 6850, + EndLine: 369, + StartPos: 6845, + EndPos: 6850, }, Key: &scalar.Lnumber{ Position: &position.Position{ StartLine: 369, - EndLine: 369, - StartPos: 6845, - EndPos: 6845, + EndLine: 369, + StartPos: 6845, + EndPos: 6845, }, Value: "2", }, Val: &scalar.Lnumber{ Position: &position.Position{ StartLine: 369, - EndLine: 369, - StartPos: 6850, - EndPos: 6850, + EndLine: 369, + StartPos: 6850, + EndPos: 6850, }, Value: "2", }, @@ -18081,9 +17994,9 @@ func TestPhp5(t *testing.T) { Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 369, - EndLine: 369, - StartPos: 6853, - EndPos: 6853, + EndLine: 369, + StartPos: 6853, + EndPos: 6853, }, Value: "0", }, @@ -18094,23 +18007,23 @@ func TestPhp5(t *testing.T) { &stmt.If{ Position: &position.Position{ StartLine: 371, - EndLine: 371, - StartPos: 6860, - EndPos: 6874, + EndLine: 371, + StartPos: 6860, + EndPos: 6874, }, Cond: &expr.Yield{ Position: &position.Position{ StartLine: 371, - EndLine: 371, - StartPos: 6864, - EndPos: 6870, + EndLine: 371, + StartPos: 6864, + EndPos: 6870, }, Value: &scalar.Lnumber{ Position: &position.Position{ StartLine: 371, - EndLine: 371, - StartPos: 6870, - EndPos: 6870, + EndLine: 371, + StartPos: 6870, + EndPos: 6870, }, Value: "1", }, @@ -18118,42 +18031,41 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 371, - EndLine: 371, - StartPos: 6873, - EndPos: 6874, - }, - Stmts: []node.Node{ + EndLine: 371, + StartPos: 6873, + EndPos: 6874, }, + Stmts: []node.Node{}, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 372, - EndLine: 372, - StartPos: 6878, - EndPos: 6888, + EndLine: 372, + StartPos: 6878, + EndPos: 6888, }, Expr: &expr.StaticPropertyFetch{ Position: &position.Position{ StartLine: 372, - EndLine: 372, - StartPos: 6878, - EndPos: 6887, + EndLine: 372, + StartPos: 6878, + EndPos: 6887, }, Class: &name.Name{ Position: &position.Position{ StartLine: 372, - EndLine: 372, - StartPos: 6878, - EndPos: 6880, + EndLine: 372, + StartPos: 6878, + EndPos: 6880, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 372, - EndLine: 372, - StartPos: 6878, - EndPos: 6880, + EndLine: 372, + StartPos: 6878, + EndPos: 6880, }, Value: "Foo", }, @@ -18162,23 +18074,23 @@ func TestPhp5(t *testing.T) { Property: &expr.Variable{ Position: &position.Position{ StartLine: 372, - EndLine: 372, - StartPos: 6883, - EndPos: 6887, + EndLine: 372, + StartPos: 6883, + EndPos: 6887, }, VarName: &expr.Variable{ Position: &position.Position{ StartLine: 372, - EndLine: 372, - StartPos: 6884, - EndPos: 6887, + EndLine: 372, + StartPos: 6884, + EndPos: 6887, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 372, - EndLine: 372, - StartPos: 6884, - EndPos: 6887, + EndLine: 372, + StartPos: 6884, + EndPos: 6887, }, Value: "bar", }, @@ -18189,30 +18101,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 374, - EndLine: 374, - StartPos: 6893, - EndPos: 6899, + EndLine: 374, + StartPos: 6893, + EndPos: 6899, }, Expr: &expr.FunctionCall{ Position: &position.Position{ StartLine: 374, - EndLine: 374, - StartPos: 6893, - EndPos: 6898, + EndLine: 374, + StartPos: 6893, + EndPos: 6898, }, Function: &expr.Variable{ Position: &position.Position{ StartLine: 374, - EndLine: 374, - StartPos: 6893, - EndPos: 6896, + EndLine: 374, + StartPos: 6893, + EndPos: 6896, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 374, - EndLine: 374, - StartPos: 6893, - EndPos: 6896, + EndLine: 374, + StartPos: 6893, + EndPos: 6896, }, Value: "foo", }, @@ -18220,9 +18132,9 @@ func TestPhp5(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 374, - EndLine: 374, - StartPos: 6897, - EndPos: 6898, + EndLine: 374, + StartPos: 6897, + EndPos: 6898, }, }, }, @@ -18230,44 +18142,44 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 375, - EndLine: 375, - StartPos: 6903, - EndPos: 6915, + EndLine: 375, + StartPos: 6903, + EndPos: 6915, }, Expr: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 375, - EndLine: 375, - StartPos: 6903, - EndPos: 6914, + EndLine: 375, + StartPos: 6903, + EndPos: 6914, }, Variable: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 375, - EndLine: 375, - StartPos: 6903, - EndPos: 6911, + EndLine: 375, + StartPos: 6903, + EndPos: 6911, }, Variable: &expr.FunctionCall{ Position: &position.Position{ StartLine: 375, - EndLine: 375, - StartPos: 6903, - EndPos: 6908, + EndLine: 375, + StartPos: 6903, + EndPos: 6908, }, Function: &expr.Variable{ Position: &position.Position{ StartLine: 375, - EndLine: 375, - StartPos: 6903, - EndPos: 6906, + EndLine: 375, + StartPos: 6903, + EndPos: 6906, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 375, - EndLine: 375, - StartPos: 6903, - EndPos: 6906, + EndLine: 375, + StartPos: 6903, + EndPos: 6906, }, Value: "foo", }, @@ -18275,18 +18187,18 @@ func TestPhp5(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 375, - EndLine: 375, - StartPos: 6907, - EndPos: 6908, + EndLine: 375, + StartPos: 6907, + EndPos: 6908, }, }, }, Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 375, - EndLine: 375, - StartPos: 6910, - EndPos: 6910, + EndLine: 375, + StartPos: 6910, + EndPos: 6910, }, Value: "0", }, @@ -18294,9 +18206,9 @@ func TestPhp5(t *testing.T) { Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 375, - EndLine: 375, - StartPos: 6913, - EndPos: 6913, + EndLine: 375, + StartPos: 6913, + EndPos: 6913, }, Value: "0", }, @@ -18305,30 +18217,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 376, - EndLine: 376, - StartPos: 6919, - EndPos: 6925, + EndLine: 376, + StartPos: 6919, + EndPos: 6925, }, Expr: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 376, - EndLine: 376, - StartPos: 6919, - EndPos: 6924, + EndLine: 376, + StartPos: 6919, + EndPos: 6924, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 376, - EndLine: 376, - StartPos: 6919, - EndPos: 6920, + EndLine: 376, + StartPos: 6919, + EndPos: 6920, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 376, - EndLine: 376, - StartPos: 6919, - EndPos: 6920, + EndLine: 376, + StartPos: 6919, + EndPos: 6920, }, Value: "a", }, @@ -18336,16 +18248,16 @@ func TestPhp5(t *testing.T) { Dim: &expr.Variable{ Position: &position.Position{ StartLine: 376, - EndLine: 376, - StartPos: 6922, - EndPos: 6923, + EndLine: 376, + StartPos: 6922, + EndPos: 6923, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 376, - EndLine: 376, - StartPos: 6922, - EndPos: 6923, + EndLine: 376, + StartPos: 6922, + EndPos: 6923, }, Value: "b", }, @@ -18355,30 +18267,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 377, - EndLine: 377, - StartPos: 6929, - EndPos: 6934, + EndLine: 377, + StartPos: 6929, + EndPos: 6934, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 377, - EndLine: 377, - StartPos: 6929, - EndPos: 6933, + EndLine: 377, + StartPos: 6929, + EndPos: 6933, }, VarName: &expr.Variable{ Position: &position.Position{ StartLine: 377, - EndLine: 377, - StartPos: 6931, - EndPos: 6932, + EndLine: 377, + StartPos: 6931, + EndPos: 6932, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 377, - EndLine: 377, - StartPos: 6931, - EndPos: 6932, + EndLine: 377, + StartPos: 6931, + EndPos: 6932, }, Value: "a", }, @@ -18388,30 +18300,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 378, - EndLine: 378, - StartPos: 6938, - EndPos: 6952, + EndLine: 378, + StartPos: 6938, + EndPos: 6952, }, Expr: &expr.StaticCall{ Position: &position.Position{ StartLine: 378, - EndLine: 378, - StartPos: 6938, - EndPos: 6951, + EndLine: 378, + StartPos: 6938, + EndPos: 6951, }, Class: &expr.Variable{ Position: &position.Position{ StartLine: 378, - EndLine: 378, - StartPos: 6938, - EndPos: 6941, + EndLine: 378, + StartPos: 6938, + EndPos: 6941, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 378, - EndLine: 378, - StartPos: 6938, - EndPos: 6941, + EndLine: 378, + StartPos: 6938, + EndPos: 6941, }, Value: "foo", }, @@ -18419,16 +18331,16 @@ func TestPhp5(t *testing.T) { Call: &expr.Variable{ Position: &position.Position{ StartLine: 378, - EndLine: 378, - StartPos: 6944, - EndPos: 6949, + EndLine: 378, + StartPos: 6944, + EndPos: 6949, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 378, - EndLine: 378, - StartPos: 6945, - EndPos: 6948, + EndLine: 378, + StartPos: 6945, + EndPos: 6948, }, Value: "bar", }, @@ -18436,9 +18348,9 @@ func TestPhp5(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 378, - EndLine: 378, - StartPos: 6950, - EndPos: 6951, + EndLine: 378, + StartPos: 6950, + EndPos: 6951, }, }, }, @@ -18446,30 +18358,30 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 379, - EndLine: 379, - StartPos: 6956, - EndPos: 6965, + EndLine: 379, + StartPos: 6956, + EndPos: 6965, }, Expr: &expr.ClassConstFetch{ Position: &position.Position{ StartLine: 379, - EndLine: 379, - StartPos: 6956, - EndPos: 6964, + EndLine: 379, + StartPos: 6956, + EndPos: 6964, }, Class: &expr.Variable{ Position: &position.Position{ StartLine: 379, - EndLine: 379, - StartPos: 6956, - EndPos: 6959, + EndLine: 379, + StartPos: 6956, + EndPos: 6959, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 379, - EndLine: 379, - StartPos: 6956, - EndPos: 6959, + EndLine: 379, + StartPos: 6956, + EndPos: 6959, }, Value: "foo", }, @@ -18477,9 +18389,9 @@ func TestPhp5(t *testing.T) { ConstantName: &node.Identifier{ Position: &position.Position{ StartLine: 379, - EndLine: 379, - StartPos: 6962, - EndPos: 6964, + EndLine: 379, + StartPos: 6962, + EndPos: 6964, }, Value: "bar", }, diff --git a/php7/php7_test.go b/php7/php7_test.go index a5ab734..9dc3546 100644 --- a/php7/php7_test.go +++ b/php7/php7_test.go @@ -384,39 +384,39 @@ func TestPhp7(t *testing.T) { expected := &node.Root{ Position: &position.Position{ StartLine: 2, - EndLine: 347, - StartPos: 6, - EndPos: 6318, + EndLine: 347, + StartPos: 6, + EndPos: 6318, }, Stmts: []node.Node{ &stmt.Expression{ Position: &position.Position{ StartLine: 2, - EndLine: 2, - StartPos: 6, - EndPos: 20, + EndLine: 2, + StartPos: 6, + EndPos: 20, }, Expr: &expr.FunctionCall{ Position: &position.Position{ StartLine: 2, - EndLine: 2, - StartPos: 6, - EndPos: 19, + EndLine: 2, + StartPos: 6, + EndPos: 19, }, Function: &name.Name{ Position: &position.Position{ StartLine: 2, - EndLine: 2, - StartPos: 6, - EndPos: 8, + EndLine: 2, + StartPos: 6, + EndPos: 8, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 2, - EndLine: 2, - StartPos: 6, - EndPos: 8, + EndLine: 2, + StartPos: 6, + EndPos: 8, }, Value: "foo", }, @@ -425,33 +425,33 @@ func TestPhp7(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 2, - EndLine: 2, - StartPos: 9, - EndPos: 19, + EndLine: 2, + StartPos: 9, + EndPos: 19, }, Arguments: []node.Node{ &node.Argument{ Position: &position.Position{ StartLine: 2, - EndLine: 2, - StartPos: 10, - EndPos: 11, + EndLine: 2, + StartPos: 10, + EndPos: 11, }, - Variadic: false, + Variadic: false, IsReference: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 2, - EndLine: 2, - StartPos: 10, - EndPos: 11, + EndLine: 2, + StartPos: 10, + EndPos: 11, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 2, - EndLine: 2, - StartPos: 10, - EndPos: 11, + EndLine: 2, + StartPos: 10, + EndPos: 11, }, Value: "a", }, @@ -460,25 +460,25 @@ func TestPhp7(t *testing.T) { &node.Argument{ Position: &position.Position{ StartLine: 2, - EndLine: 2, - StartPos: 14, - EndPos: 18, + EndLine: 2, + StartPos: 14, + EndPos: 18, }, IsReference: false, - Variadic: true, + Variadic: true, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 2, - EndLine: 2, - StartPos: 17, - EndPos: 18, + EndLine: 2, + StartPos: 17, + EndPos: 18, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 2, - EndLine: 2, - StartPos: 17, - EndPos: 18, + EndLine: 2, + StartPos: 17, + EndPos: 18, }, Value: "b", }, @@ -491,30 +491,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 3, - EndLine: 3, - StartPos: 24, - EndPos: 39, + EndLine: 3, + StartPos: 24, + EndPos: 39, }, Expr: &expr.FunctionCall{ Position: &position.Position{ StartLine: 3, - EndLine: 3, - StartPos: 24, - EndPos: 38, + EndLine: 3, + StartPos: 24, + EndPos: 38, }, Function: &expr.Variable{ Position: &position.Position{ StartLine: 3, - EndLine: 3, - StartPos: 24, - EndPos: 27, + EndLine: 3, + StartPos: 24, + EndPos: 27, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 3, - EndLine: 3, - StartPos: 24, - EndPos: 27, + EndLine: 3, + StartPos: 24, + EndPos: 27, }, Value: "foo", }, @@ -522,33 +522,33 @@ func TestPhp7(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 3, - EndLine: 3, - StartPos: 28, - EndPos: 38, + EndLine: 3, + StartPos: 28, + EndPos: 38, }, Arguments: []node.Node{ &node.Argument{ Position: &position.Position{ StartLine: 3, - EndLine: 3, - StartPos: 29, - EndPos: 30, + EndLine: 3, + StartPos: 29, + EndPos: 30, }, - Variadic: false, + Variadic: false, IsReference: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 3, - EndLine: 3, - StartPos: 29, - EndPos: 30, + EndLine: 3, + StartPos: 29, + EndPos: 30, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 3, - EndLine: 3, - StartPos: 29, - EndPos: 30, + EndLine: 3, + StartPos: 29, + EndPos: 30, }, Value: "a", }, @@ -557,25 +557,25 @@ func TestPhp7(t *testing.T) { &node.Argument{ Position: &position.Position{ StartLine: 3, - EndLine: 3, - StartPos: 33, - EndPos: 37, + EndLine: 3, + StartPos: 33, + EndPos: 37, }, - Variadic: true, + Variadic: true, IsReference: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 3, - EndLine: 3, - StartPos: 36, - EndPos: 37, + EndLine: 3, + StartPos: 36, + EndPos: 37, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 3, - EndLine: 3, - StartPos: 36, - EndPos: 37, + EndLine: 3, + StartPos: 36, + EndPos: 37, }, Value: "b", }, @@ -588,30 +588,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 4, - EndLine: 4, - StartPos: 43, - EndPos: 63, + EndLine: 4, + StartPos: 43, + EndPos: 63, }, Expr: &expr.MethodCall{ Position: &position.Position{ StartLine: 4, - EndLine: 4, - StartPos: 43, - EndPos: 62, + EndLine: 4, + StartPos: 43, + EndPos: 62, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 4, - EndLine: 4, - StartPos: 43, - EndPos: 46, + EndLine: 4, + StartPos: 43, + EndPos: 46, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 4, - EndLine: 4, - StartPos: 43, - EndPos: 46, + EndLine: 4, + StartPos: 43, + EndPos: 46, }, Value: "foo", }, @@ -619,42 +619,42 @@ func TestPhp7(t *testing.T) { Method: &node.Identifier{ Position: &position.Position{ StartLine: 4, - EndLine: 4, - StartPos: 49, - EndPos: 51, + EndLine: 4, + StartPos: 49, + EndPos: 51, }, Value: "bar", }, ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 4, - EndLine: 4, - StartPos: 52, - EndPos: 62, + EndLine: 4, + StartPos: 52, + EndPos: 62, }, Arguments: []node.Node{ &node.Argument{ Position: &position.Position{ StartLine: 4, - EndLine: 4, - StartPos: 53, - EndPos: 54, + EndLine: 4, + StartPos: 53, + EndPos: 54, }, IsReference: false, - Variadic: false, + Variadic: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 4, - EndLine: 4, - StartPos: 53, - EndPos: 54, + EndLine: 4, + StartPos: 53, + EndPos: 54, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 4, - EndLine: 4, - StartPos: 53, - EndPos: 54, + EndLine: 4, + StartPos: 53, + EndPos: 54, }, Value: "a", }, @@ -663,25 +663,25 @@ func TestPhp7(t *testing.T) { &node.Argument{ Position: &position.Position{ StartLine: 4, - EndLine: 4, - StartPos: 57, - EndPos: 61, + EndLine: 4, + StartPos: 57, + EndPos: 61, }, - Variadic: true, + Variadic: true, IsReference: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 4, - EndLine: 4, - StartPos: 60, - EndPos: 61, + EndLine: 4, + StartPos: 60, + EndPos: 61, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 4, - EndLine: 4, - StartPos: 60, - EndPos: 61, + EndLine: 4, + StartPos: 60, + EndPos: 61, }, Value: "b", }, @@ -694,31 +694,31 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 5, - EndLine: 5, - StartPos: 67, - EndPos: 86, + EndLine: 5, + StartPos: 67, + EndPos: 86, }, Expr: &expr.StaticCall{ Position: &position.Position{ StartLine: 5, - EndLine: 5, - StartPos: 67, - EndPos: 85, + EndLine: 5, + StartPos: 67, + EndPos: 85, }, Class: &name.Name{ Position: &position.Position{ StartLine: 5, - EndLine: 5, - StartPos: 67, - EndPos: 69, + EndLine: 5, + StartPos: 67, + EndPos: 69, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 5, - EndLine: 5, - StartPos: 67, - EndPos: 69, + EndLine: 5, + StartPos: 67, + EndPos: 69, }, Value: "foo", }, @@ -727,42 +727,42 @@ func TestPhp7(t *testing.T) { Call: &node.Identifier{ Position: &position.Position{ StartLine: 5, - EndLine: 5, - StartPos: 72, - EndPos: 74, + EndLine: 5, + StartPos: 72, + EndPos: 74, }, Value: "bar", }, ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 5, - EndLine: 5, - StartPos: 75, - EndPos: 85, + EndLine: 5, + StartPos: 75, + EndPos: 85, }, Arguments: []node.Node{ &node.Argument{ Position: &position.Position{ StartLine: 5, - EndLine: 5, - StartPos: 76, - EndPos: 77, + EndLine: 5, + StartPos: 76, + EndPos: 77, }, - Variadic: false, + Variadic: false, IsReference: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 5, - EndLine: 5, - StartPos: 76, - EndPos: 77, + EndLine: 5, + StartPos: 76, + EndPos: 77, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 5, - EndLine: 5, - StartPos: 76, - EndPos: 77, + EndLine: 5, + StartPos: 76, + EndPos: 77, }, Value: "a", }, @@ -771,25 +771,25 @@ func TestPhp7(t *testing.T) { &node.Argument{ Position: &position.Position{ StartLine: 5, - EndLine: 5, - StartPos: 80, - EndPos: 84, + EndLine: 5, + StartPos: 80, + EndPos: 84, }, - Variadic: true, + Variadic: true, IsReference: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 5, - EndLine: 5, - StartPos: 83, - EndPos: 84, + EndLine: 5, + StartPos: 83, + EndPos: 84, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 5, - EndLine: 5, - StartPos: 83, - EndPos: 84, + EndLine: 5, + StartPos: 83, + EndPos: 84, }, Value: "b", }, @@ -802,30 +802,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 6, - EndLine: 6, - StartPos: 90, - EndPos: 110, + EndLine: 6, + StartPos: 90, + EndPos: 110, }, Expr: &expr.StaticCall{ Position: &position.Position{ StartLine: 6, - EndLine: 6, - StartPos: 90, - EndPos: 109, + EndLine: 6, + StartPos: 90, + EndPos: 109, }, Class: &expr.Variable{ Position: &position.Position{ StartLine: 6, - EndLine: 6, - StartPos: 90, - EndPos: 93, + EndLine: 6, + StartPos: 90, + EndPos: 93, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 6, - EndLine: 6, - StartPos: 90, - EndPos: 93, + EndLine: 6, + StartPos: 90, + EndPos: 93, }, Value: "foo", }, @@ -833,42 +833,42 @@ func TestPhp7(t *testing.T) { Call: &node.Identifier{ Position: &position.Position{ StartLine: 6, - EndLine: 6, - StartPos: 96, - EndPos: 98, + EndLine: 6, + StartPos: 96, + EndPos: 98, }, Value: "bar", }, ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 6, - EndLine: 6, - StartPos: 99, - EndPos: 109, + EndLine: 6, + StartPos: 99, + EndPos: 109, }, Arguments: []node.Node{ &node.Argument{ Position: &position.Position{ StartLine: 6, - EndLine: 6, - StartPos: 100, - EndPos: 101, + EndLine: 6, + StartPos: 100, + EndPos: 101, }, - Variadic: false, + Variadic: false, IsReference: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 6, - EndLine: 6, - StartPos: 100, - EndPos: 101, + EndLine: 6, + StartPos: 100, + EndPos: 101, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 6, - EndLine: 6, - StartPos: 100, - EndPos: 101, + EndLine: 6, + StartPos: 100, + EndPos: 101, }, Value: "a", }, @@ -877,25 +877,25 @@ func TestPhp7(t *testing.T) { &node.Argument{ Position: &position.Position{ StartLine: 6, - EndLine: 6, - StartPos: 104, - EndPos: 108, + EndLine: 6, + StartPos: 104, + EndPos: 108, }, - Variadic: true, + Variadic: true, IsReference: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 6, - EndLine: 6, - StartPos: 107, - EndPos: 108, + EndLine: 6, + StartPos: 107, + EndPos: 108, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 6, - EndLine: 6, - StartPos: 107, - EndPos: 108, + EndLine: 6, + StartPos: 107, + EndPos: 108, }, Value: "b", }, @@ -908,31 +908,31 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 7, - EndLine: 7, - StartPos: 114, - EndPos: 132, + EndLine: 7, + StartPos: 114, + EndPos: 132, }, Expr: &expr.New{ Position: &position.Position{ StartLine: 7, - EndLine: 7, - StartPos: 114, - EndPos: 131, + EndLine: 7, + StartPos: 114, + EndPos: 131, }, Class: &name.Name{ Position: &position.Position{ StartLine: 7, - EndLine: 7, - StartPos: 118, - EndPos: 120, + EndLine: 7, + StartPos: 118, + EndPos: 120, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 7, - EndLine: 7, - StartPos: 118, - EndPos: 120, + EndLine: 7, + StartPos: 118, + EndPos: 120, }, Value: "foo", }, @@ -941,33 +941,33 @@ func TestPhp7(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 7, - EndLine: 7, - StartPos: 121, - EndPos: 131, + EndLine: 7, + StartPos: 121, + EndPos: 131, }, Arguments: []node.Node{ &node.Argument{ Position: &position.Position{ StartLine: 7, - EndLine: 7, - StartPos: 122, - EndPos: 123, + EndLine: 7, + StartPos: 122, + EndPos: 123, }, - Variadic: false, + Variadic: false, IsReference: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 7, - EndLine: 7, - StartPos: 122, - EndPos: 123, + EndLine: 7, + StartPos: 122, + EndPos: 123, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 7, - EndLine: 7, - StartPos: 122, - EndPos: 123, + EndLine: 7, + StartPos: 122, + EndPos: 123, }, Value: "a", }, @@ -976,25 +976,25 @@ func TestPhp7(t *testing.T) { &node.Argument{ Position: &position.Position{ StartLine: 7, - EndLine: 7, - StartPos: 126, - EndPos: 130, + EndLine: 7, + StartPos: 126, + EndPos: 130, }, - Variadic: true, + Variadic: true, IsReference: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 7, - EndLine: 7, - StartPos: 129, - EndPos: 130, + EndLine: 7, + StartPos: 129, + EndPos: 130, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 7, - EndLine: 7, - StartPos: 129, - EndPos: 130, + EndLine: 7, + StartPos: 129, + EndPos: 130, }, Value: "b", }, @@ -1007,55 +1007,55 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 9, - EndLine: 9, - StartPos: 161, - EndPos: 185, + EndLine: 9, + StartPos: 161, + EndPos: 185, }, Expr: &expr.New{ Position: &position.Position{ StartLine: 9, - EndLine: 9, - StartPos: 161, - EndPos: 184, + EndLine: 9, + StartPos: 161, + EndPos: 184, }, Class: &stmt.Class{ Position: &position.Position{ StartLine: 9, - EndLine: 9, - StartPos: 165, - EndPos: 184, + EndLine: 9, + StartPos: 165, + EndPos: 184, }, PhpDocComment: "/** anonymous class */", ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 9, - EndLine: 9, - StartPos: 171, - EndPos: 181, + EndLine: 9, + StartPos: 171, + EndPos: 181, }, Arguments: []node.Node{ &node.Argument{ Position: &position.Position{ StartLine: 9, - EndLine: 9, - StartPos: 172, - EndPos: 173, + EndLine: 9, + StartPos: 172, + EndPos: 173, }, - Variadic: false, + Variadic: false, IsReference: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 9, - EndLine: 9, - StartPos: 172, - EndPos: 173, + EndLine: 9, + StartPos: 172, + EndPos: 173, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 9, - EndLine: 9, - StartPos: 172, - EndPos: 173, + EndLine: 9, + StartPos: 172, + EndPos: 173, }, Value: "a", }, @@ -1064,25 +1064,25 @@ func TestPhp7(t *testing.T) { &node.Argument{ Position: &position.Position{ StartLine: 9, - EndLine: 9, - StartPos: 176, - EndPos: 180, + EndLine: 9, + StartPos: 176, + EndPos: 180, }, - Variadic: true, + Variadic: true, IsReference: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 9, - EndLine: 9, - StartPos: 179, - EndPos: 180, + EndLine: 9, + StartPos: 179, + EndPos: 180, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 9, - EndLine: 9, - StartPos: 179, - EndPos: 180, + EndLine: 9, + StartPos: 179, + EndPos: 180, }, Value: "b", }, @@ -1090,65 +1090,63 @@ func TestPhp7(t *testing.T) { }, }, }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 10, - EndLine: 10, - StartPos: 189, - EndPos: 201, + EndLine: 10, + StartPos: 189, + EndPos: 201, }, Expr: &expr.New{ Position: &position.Position{ StartLine: 10, - EndLine: 10, - StartPos: 189, - EndPos: 200, + EndLine: 10, + StartPos: 189, + EndPos: 200, }, Class: &stmt.Class{ Position: &position.Position{ StartLine: 10, - EndLine: 10, - StartPos: 193, - EndPos: 200, + EndLine: 10, + StartPos: 193, + EndPos: 200, }, PhpDocComment: "", - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 11, - EndLine: 11, - StartPos: 205, - EndPos: 213, + EndLine: 11, + StartPos: 205, + EndPos: 213, }, Expr: &expr.New{ Position: &position.Position{ StartLine: 11, - EndLine: 11, - StartPos: 205, - EndPos: 212, + EndLine: 11, + StartPos: 205, + EndPos: 212, }, Class: &expr.Variable{ Position: &position.Position{ StartLine: 11, - EndLine: 11, - StartPos: 209, - EndPos: 212, + EndLine: 11, + StartPos: 209, + EndPos: 212, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 11, - EndLine: 11, - StartPos: 209, - EndPos: 212, + EndLine: 11, + StartPos: 209, + EndPos: 212, }, Value: "foo", }, @@ -1158,37 +1156,37 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 12, - EndLine: 12, - StartPos: 217, - EndPos: 228, + EndLine: 12, + StartPos: 217, + EndPos: 228, }, Expr: &expr.New{ Position: &position.Position{ StartLine: 12, - EndLine: 12, - StartPos: 217, - EndPos: 227, + EndLine: 12, + StartPos: 217, + EndPos: 227, }, Class: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 12, - EndLine: 12, - StartPos: 221, - EndPos: 227, + EndLine: 12, + StartPos: 221, + EndPos: 227, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 12, - EndLine: 12, - StartPos: 221, - EndPos: 224, + EndLine: 12, + StartPos: 221, + EndPos: 224, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 12, - EndLine: 12, - StartPos: 221, - EndPos: 224, + EndLine: 12, + StartPos: 221, + EndPos: 224, }, Value: "foo", }, @@ -1196,9 +1194,9 @@ func TestPhp7(t *testing.T) { Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 12, - EndLine: 12, - StartPos: 226, - EndPos: 226, + EndLine: 12, + StartPos: 226, + EndPos: 226, }, Value: "1", }, @@ -1208,37 +1206,37 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 13, - EndLine: 13, - StartPos: 232, - EndPos: 246, + EndLine: 13, + StartPos: 232, + EndPos: 246, }, Expr: &expr.New{ Position: &position.Position{ StartLine: 13, - EndLine: 13, - StartPos: 232, - EndPos: 245, + EndLine: 13, + StartPos: 232, + EndPos: 245, }, Class: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 13, - EndLine: 13, - StartPos: 236, - EndPos: 245, + EndLine: 13, + StartPos: 236, + EndPos: 245, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 13, - EndLine: 13, - StartPos: 236, - EndPos: 239, + EndLine: 13, + StartPos: 236, + EndPos: 239, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 13, - EndLine: 13, - StartPos: 236, - EndPos: 239, + EndLine: 13, + StartPos: 236, + EndPos: 239, }, Value: "foo", }, @@ -1246,16 +1244,16 @@ func TestPhp7(t *testing.T) { Dim: &expr.Variable{ Position: &position.Position{ StartLine: 13, - EndLine: 13, - StartPos: 241, - EndPos: 244, + EndLine: 13, + StartPos: 241, + EndPos: 244, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 13, - EndLine: 13, - StartPos: 241, - EndPos: 244, + EndLine: 13, + StartPos: 241, + EndPos: 244, }, Value: "bar", }, @@ -1266,37 +1264,37 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 14, - EndLine: 14, - StartPos: 250, - EndPos: 263, + EndLine: 14, + StartPos: 250, + EndPos: 263, }, Expr: &expr.New{ Position: &position.Position{ StartLine: 14, - EndLine: 14, - StartPos: 250, - EndPos: 262, + EndLine: 14, + StartPos: 250, + EndPos: 262, }, Class: &expr.PropertyFetch{ Position: &position.Position{ StartLine: 14, - EndLine: 14, - StartPos: 254, - EndPos: 262, + EndLine: 14, + StartPos: 254, + EndPos: 262, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 14, - EndLine: 14, - StartPos: 254, - EndPos: 257, + EndLine: 14, + StartPos: 254, + EndPos: 257, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 14, - EndLine: 14, - StartPos: 254, - EndPos: 257, + EndLine: 14, + StartPos: 254, + EndPos: 257, }, Value: "foo", }, @@ -1304,9 +1302,9 @@ func TestPhp7(t *testing.T) { Property: &node.Identifier{ Position: &position.Position{ StartLine: 14, - EndLine: 14, - StartPos: 260, - EndPos: 262, + EndLine: 14, + StartPos: 260, + EndPos: 262, }, Value: "bar", }, @@ -1316,37 +1314,37 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 15, - EndLine: 15, - StartPos: 267, - EndPos: 281, + EndLine: 15, + StartPos: 267, + EndPos: 281, }, Expr: &expr.New{ Position: &position.Position{ StartLine: 15, - EndLine: 15, - StartPos: 267, - EndPos: 280, + EndLine: 15, + StartPos: 267, + EndPos: 280, }, Class: &expr.StaticPropertyFetch{ Position: &position.Position{ StartLine: 15, - EndLine: 15, - StartPos: 271, - EndPos: 280, + EndLine: 15, + StartPos: 271, + EndPos: 280, }, Class: &expr.Variable{ Position: &position.Position{ StartLine: 15, - EndLine: 15, - StartPos: 271, - EndPos: 274, + EndLine: 15, + StartPos: 271, + EndPos: 274, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 15, - EndLine: 15, - StartPos: 271, - EndPos: 274, + EndLine: 15, + StartPos: 271, + EndPos: 274, }, Value: "foo", }, @@ -1354,16 +1352,16 @@ func TestPhp7(t *testing.T) { Property: &expr.Variable{ Position: &position.Position{ StartLine: 15, - EndLine: 15, - StartPos: 277, - EndPos: 280, + EndLine: 15, + StartPos: 277, + EndPos: 280, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 15, - EndLine: 15, - StartPos: 277, - EndPos: 280, + EndLine: 15, + StartPos: 277, + EndPos: 280, }, Value: "bar", }, @@ -1374,46 +1372,46 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 16, - EndLine: 16, - StartPos: 285, - EndPos: 301, + EndLine: 16, + StartPos: 285, + EndPos: 301, }, Expr: &expr.New{ Position: &position.Position{ StartLine: 16, - EndLine: 16, - StartPos: 285, - EndPos: 300, + EndLine: 16, + StartPos: 285, + EndPos: 300, }, Class: &expr.StaticPropertyFetch{ Position: &position.Position{ StartLine: 16, - EndLine: 16, - StartPos: 289, - EndPos: 300, + EndLine: 16, + StartPos: 289, + EndPos: 300, }, Class: &node.Identifier{ Position: &position.Position{ StartLine: 16, - EndLine: 16, - StartPos: 289, - EndPos: 294, + EndLine: 16, + StartPos: 289, + EndPos: 294, }, Value: "static", }, Property: &expr.Variable{ Position: &position.Position{ StartLine: 16, - EndLine: 16, - StartPos: 297, - EndPos: 300, + EndLine: 16, + StartPos: 297, + EndPos: 300, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 16, - EndLine: 16, - StartPos: 297, - EndPos: 300, + EndLine: 16, + StartPos: 297, + EndPos: 300, }, Value: "bar", }, @@ -1424,18 +1422,18 @@ func TestPhp7(t *testing.T) { &stmt.Function{ Position: &position.Position{ StartLine: 18, - EndLine: 18, - StartPos: 306, - EndPos: 350, + EndLine: 18, + StartPos: 306, + EndPos: 350, }, - ReturnsRef: false, + ReturnsRef: false, PhpDocComment: "", FunctionName: &node.Identifier{ Position: &position.Position{ StartLine: 18, - EndLine: 18, - StartPos: 315, - EndPos: 317, + EndLine: 18, + StartPos: 315, + EndPos: 317, }, Value: "foo", }, @@ -1443,33 +1441,33 @@ func TestPhp7(t *testing.T) { &node.Parameter{ Position: &position.Position{ StartLine: 18, - EndLine: 18, - StartPos: 319, - EndPos: 332, + EndLine: 18, + StartPos: 319, + EndPos: 332, }, - ByRef: false, + ByRef: false, Variadic: false, VariableType: &node.Nullable{ Position: &position.Position{ StartLine: 18, - EndLine: 18, - StartPos: 319, - EndPos: 322, + EndLine: 18, + StartPos: 319, + EndPos: 322, }, Expr: &name.Name{ Position: &position.Position{ StartLine: 18, - EndLine: 18, - StartPos: 320, - EndPos: 322, + EndLine: 18, + StartPos: 320, + EndPos: 322, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 18, - EndLine: 18, - StartPos: 320, - EndPos: 322, + EndLine: 18, + StartPos: 320, + EndPos: 322, }, Value: "bar", }, @@ -1479,16 +1477,16 @@ func TestPhp7(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 18, - EndLine: 18, - StartPos: 324, - EndPos: 327, + EndLine: 18, + StartPos: 324, + EndPos: 327, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 18, - EndLine: 18, - StartPos: 324, - EndPos: 327, + EndLine: 18, + StartPos: 324, + EndPos: 327, }, Value: "bar", }, @@ -1496,24 +1494,24 @@ func TestPhp7(t *testing.T) { DefaultValue: &expr.ConstFetch{ Position: &position.Position{ StartLine: 18, - EndLine: 18, - StartPos: 329, - EndPos: 332, + EndLine: 18, + StartPos: 329, + EndPos: 332, }, Constant: &name.Name{ Position: &position.Position{ StartLine: 18, - EndLine: 18, - StartPos: 329, - EndPos: 332, + EndLine: 18, + StartPos: 329, + EndPos: 332, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 18, - EndLine: 18, - StartPos: 329, - EndPos: 332, + EndLine: 18, + StartPos: 329, + EndPos: 332, }, Value: "null", }, @@ -1524,26 +1522,26 @@ func TestPhp7(t *testing.T) { &node.Parameter{ Position: &position.Position{ StartLine: 18, - EndLine: 18, - StartPos: 335, - EndPos: 346, + EndLine: 18, + StartPos: 335, + EndPos: 346, }, - ByRef: true, + ByRef: true, Variadic: true, VariableType: &name.Name{ Position: &position.Position{ StartLine: 18, - EndLine: 18, - StartPos: 335, - EndPos: 337, + EndLine: 18, + StartPos: 335, + EndPos: 337, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 18, - EndLine: 18, - StartPos: 335, - EndPos: 337, + EndLine: 18, + StartPos: 335, + EndPos: 337, }, Value: "baz", }, @@ -1552,39 +1550,38 @@ func TestPhp7(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 18, - EndLine: 18, - StartPos: 343, - EndPos: 346, + EndLine: 18, + StartPos: 343, + EndPos: 346, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 18, - EndLine: 18, - StartPos: 343, - EndPos: 346, + EndLine: 18, + StartPos: 343, + EndPos: 346, }, Value: "baz", }, }, }, }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, &stmt.Class{ Position: &position.Position{ StartLine: 19, - EndLine: 19, - StartPos: 354, - EndPos: 417, + EndLine: 19, + StartPos: 354, + EndPos: 417, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 19, - EndLine: 19, - StartPos: 360, - EndPos: 362, + EndLine: 19, + StartPos: 360, + EndPos: 362, }, Value: "foo", }, @@ -1592,18 +1589,18 @@ func TestPhp7(t *testing.T) { &stmt.ClassMethod{ Position: &position.Position{ StartLine: 19, - EndLine: 19, - StartPos: 365, - EndPos: 416, + EndLine: 19, + StartPos: 365, + EndPos: 416, }, - ReturnsRef: false, + ReturnsRef: false, PhpDocComment: "", MethodName: &node.Identifier{ Position: &position.Position{ StartLine: 19, - EndLine: 19, - StartPos: 381, - EndPos: 383, + EndLine: 19, + StartPos: 381, + EndPos: 383, }, Value: "foo", }, @@ -1611,9 +1608,9 @@ func TestPhp7(t *testing.T) { &node.Identifier{ Position: &position.Position{ StartLine: 19, - EndLine: 19, - StartPos: 365, - EndPos: 370, + EndLine: 19, + StartPos: 365, + EndPos: 370, }, Value: "public", }, @@ -1622,33 +1619,33 @@ func TestPhp7(t *testing.T) { &node.Parameter{ Position: &position.Position{ StartLine: 19, - EndLine: 19, - StartPos: 385, - EndPos: 398, + EndLine: 19, + StartPos: 385, + EndPos: 398, }, - ByRef: false, + ByRef: false, Variadic: false, VariableType: &node.Nullable{ Position: &position.Position{ StartLine: 19, - EndLine: 19, - StartPos: 385, - EndPos: 388, + EndLine: 19, + StartPos: 385, + EndPos: 388, }, Expr: &name.Name{ Position: &position.Position{ StartLine: 19, - EndLine: 19, - StartPos: 386, - EndPos: 388, + EndLine: 19, + StartPos: 386, + EndPos: 388, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 19, - EndLine: 19, - StartPos: 386, - EndPos: 388, + EndLine: 19, + StartPos: 386, + EndPos: 388, }, Value: "bar", }, @@ -1658,16 +1655,16 @@ func TestPhp7(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 19, - EndLine: 19, - StartPos: 390, - EndPos: 393, + EndLine: 19, + StartPos: 390, + EndPos: 393, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 19, - EndLine: 19, - StartPos: 390, - EndPos: 393, + EndLine: 19, + StartPos: 390, + EndPos: 393, }, Value: "bar", }, @@ -1675,24 +1672,24 @@ func TestPhp7(t *testing.T) { DefaultValue: &expr.ConstFetch{ Position: &position.Position{ StartLine: 19, - EndLine: 19, - StartPos: 395, - EndPos: 398, + EndLine: 19, + StartPos: 395, + EndPos: 398, }, Constant: &name.Name{ Position: &position.Position{ StartLine: 19, - EndLine: 19, - StartPos: 395, - EndPos: 398, + EndLine: 19, + StartPos: 395, + EndPos: 398, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 19, - EndLine: 19, - StartPos: 395, - EndPos: 398, + EndLine: 19, + StartPos: 395, + EndPos: 398, }, Value: "null", }, @@ -1703,26 +1700,26 @@ func TestPhp7(t *testing.T) { &node.Parameter{ Position: &position.Position{ StartLine: 19, - EndLine: 19, - StartPos: 401, - EndPos: 412, + EndLine: 19, + StartPos: 401, + EndPos: 412, }, - ByRef: true, + ByRef: true, Variadic: true, VariableType: &name.Name{ Position: &position.Position{ StartLine: 19, - EndLine: 19, - StartPos: 401, - EndPos: 403, + EndLine: 19, + StartPos: 401, + EndPos: 403, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 19, - EndLine: 19, - StartPos: 401, - EndPos: 403, + EndLine: 19, + StartPos: 401, + EndPos: 403, }, Value: "baz", }, @@ -1731,16 +1728,16 @@ func TestPhp7(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 19, - EndLine: 19, - StartPos: 409, - EndPos: 412, + EndLine: 19, + StartPos: 409, + EndPos: 412, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 19, - EndLine: 19, - StartPos: 409, - EndPos: 412, + EndLine: 19, + StartPos: 409, + EndPos: 412, }, Value: "baz", }, @@ -1750,12 +1747,11 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 19, - EndLine: 19, - StartPos: 415, - EndPos: 416, - }, - Stmts: []node.Node{ + EndLine: 19, + StartPos: 415, + EndPos: 416, }, + Stmts: []node.Node{}, }, }, }, @@ -1763,51 +1759,51 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 20, - EndLine: 20, - StartPos: 421, - EndPos: 462, + EndLine: 20, + StartPos: 421, + EndPos: 462, }, Expr: &expr.Closure{ Position: &position.Position{ StartLine: 20, - EndLine: 20, - StartPos: 421, - EndPos: 461, + EndLine: 20, + StartPos: 421, + EndPos: 461, }, - ReturnsRef: false, - Static: false, + ReturnsRef: false, + Static: false, PhpDocComment: "", Params: []node.Node{ &node.Parameter{ Position: &position.Position{ StartLine: 20, - EndLine: 20, - StartPos: 430, - EndPos: 443, + EndLine: 20, + StartPos: 430, + EndPos: 443, }, - ByRef: false, + ByRef: false, Variadic: false, VariableType: &node.Nullable{ Position: &position.Position{ StartLine: 20, - EndLine: 20, - StartPos: 430, - EndPos: 433, + EndLine: 20, + StartPos: 430, + EndPos: 433, }, Expr: &name.Name{ Position: &position.Position{ StartLine: 20, - EndLine: 20, - StartPos: 431, - EndPos: 433, + EndLine: 20, + StartPos: 431, + EndPos: 433, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 20, - EndLine: 20, - StartPos: 431, - EndPos: 433, + EndLine: 20, + StartPos: 431, + EndPos: 433, }, Value: "bar", }, @@ -1817,16 +1813,16 @@ func TestPhp7(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 20, - EndLine: 20, - StartPos: 435, - EndPos: 438, + EndLine: 20, + StartPos: 435, + EndPos: 438, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 20, - EndLine: 20, - StartPos: 435, - EndPos: 438, + EndLine: 20, + StartPos: 435, + EndPos: 438, }, Value: "bar", }, @@ -1834,24 +1830,24 @@ func TestPhp7(t *testing.T) { DefaultValue: &expr.ConstFetch{ Position: &position.Position{ StartLine: 20, - EndLine: 20, - StartPos: 440, - EndPos: 443, + EndLine: 20, + StartPos: 440, + EndPos: 443, }, Constant: &name.Name{ Position: &position.Position{ StartLine: 20, - EndLine: 20, - StartPos: 440, - EndPos: 443, + EndLine: 20, + StartPos: 440, + EndPos: 443, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 20, - EndLine: 20, - StartPos: 440, - EndPos: 443, + EndLine: 20, + StartPos: 440, + EndPos: 443, }, Value: "null", }, @@ -1862,26 +1858,26 @@ func TestPhp7(t *testing.T) { &node.Parameter{ Position: &position.Position{ StartLine: 20, - EndLine: 20, - StartPos: 446, - EndPos: 457, + EndLine: 20, + StartPos: 446, + EndPos: 457, }, - ByRef: true, + ByRef: true, Variadic: true, VariableType: &name.Name{ Position: &position.Position{ StartLine: 20, - EndLine: 20, - StartPos: 446, - EndPos: 448, + EndLine: 20, + StartPos: 446, + EndPos: 448, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 20, - EndLine: 20, - StartPos: 446, - EndPos: 448, + EndLine: 20, + StartPos: 446, + EndPos: 448, }, Value: "baz", }, @@ -1890,74 +1886,73 @@ func TestPhp7(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 20, - EndLine: 20, - StartPos: 454, - EndPos: 457, + EndLine: 20, + StartPos: 454, + EndPos: 457, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 20, - EndLine: 20, - StartPos: 454, - EndPos: 457, + EndLine: 20, + StartPos: 454, + EndPos: 457, }, Value: "baz", }, }, }, }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 21, - EndLine: 21, - StartPos: 466, - EndPos: 514, + EndLine: 21, + StartPos: 466, + EndPos: 514, }, Expr: &expr.Closure{ Position: &position.Position{ StartLine: 21, - EndLine: 21, - StartPos: 466, - EndPos: 513, + EndLine: 21, + StartPos: 466, + EndPos: 513, }, - ReturnsRef: false, - Static: true, + ReturnsRef: false, + Static: true, PhpDocComment: "", Params: []node.Node{ &node.Parameter{ Position: &position.Position{ StartLine: 21, - EndLine: 21, - StartPos: 482, - EndPos: 495, + EndLine: 21, + StartPos: 482, + EndPos: 495, }, - ByRef: false, + ByRef: false, Variadic: false, VariableType: &node.Nullable{ Position: &position.Position{ StartLine: 21, - EndLine: 21, - StartPos: 482, - EndPos: 485, + EndLine: 21, + StartPos: 482, + EndPos: 485, }, Expr: &name.Name{ Position: &position.Position{ StartLine: 21, - EndLine: 21, - StartPos: 483, - EndPos: 485, + EndLine: 21, + StartPos: 483, + EndPos: 485, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 21, - EndLine: 21, - StartPos: 483, - EndPos: 485, + EndLine: 21, + StartPos: 483, + EndPos: 485, }, Value: "bar", }, @@ -1967,16 +1962,16 @@ func TestPhp7(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 21, - EndLine: 21, - StartPos: 487, - EndPos: 490, + EndLine: 21, + StartPos: 487, + EndPos: 490, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 21, - EndLine: 21, - StartPos: 487, - EndPos: 490, + EndLine: 21, + StartPos: 487, + EndPos: 490, }, Value: "bar", }, @@ -1984,24 +1979,24 @@ func TestPhp7(t *testing.T) { DefaultValue: &expr.ConstFetch{ Position: &position.Position{ StartLine: 21, - EndLine: 21, - StartPos: 492, - EndPos: 495, + EndLine: 21, + StartPos: 492, + EndPos: 495, }, Constant: &name.Name{ Position: &position.Position{ StartLine: 21, - EndLine: 21, - StartPos: 492, - EndPos: 495, + EndLine: 21, + StartPos: 492, + EndPos: 495, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 21, - EndLine: 21, - StartPos: 492, - EndPos: 495, + EndLine: 21, + StartPos: 492, + EndPos: 495, }, Value: "null", }, @@ -2012,26 +2007,26 @@ func TestPhp7(t *testing.T) { &node.Parameter{ Position: &position.Position{ StartLine: 21, - EndLine: 21, - StartPos: 498, - EndPos: 509, + EndLine: 21, + StartPos: 498, + EndPos: 509, }, Variadic: true, - ByRef: true, + ByRef: true, VariableType: &name.Name{ Position: &position.Position{ StartLine: 21, - EndLine: 21, - StartPos: 498, - EndPos: 500, + EndLine: 21, + StartPos: 498, + EndPos: 500, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 21, - EndLine: 21, - StartPos: 498, - EndPos: 500, + EndLine: 21, + StartPos: 498, + EndPos: 500, }, Value: "baz", }, @@ -2040,39 +2035,38 @@ func TestPhp7(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 21, - EndLine: 21, - StartPos: 506, - EndPos: 509, + EndLine: 21, + StartPos: 506, + EndPos: 509, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 21, - EndLine: 21, - StartPos: 506, - EndPos: 509, + EndLine: 21, + StartPos: 506, + EndPos: 509, }, Value: "baz", }, }, }, }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 23, - EndLine: 23, - StartPos: 519, - EndPos: 538, + EndLine: 23, + StartPos: 519, + EndPos: 538, }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 23, - EndLine: 23, - StartPos: 519, - EndPos: 537, + EndLine: 23, + StartPos: 519, + EndPos: 537, }, Value: "1234567890123456789", }, @@ -2080,16 +2074,16 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 24, - EndLine: 24, - StartPos: 542, - EndPos: 562, + EndLine: 24, + StartPos: 542, + EndPos: 562, }, Expr: &scalar.Dnumber{ Position: &position.Position{ StartLine: 24, - EndLine: 24, - StartPos: 542, - EndPos: 561, + EndLine: 24, + StartPos: 542, + EndPos: 561, }, Value: "12345678901234567890", }, @@ -2097,16 +2091,16 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 25, - EndLine: 25, - StartPos: 566, - EndPos: 568, + EndLine: 25, + StartPos: 566, + EndPos: 568, }, Expr: &scalar.Dnumber{ Position: &position.Position{ StartLine: 25, - EndLine: 25, - StartPos: 566, - EndPos: 567, + EndLine: 25, + StartPos: 566, + EndPos: 567, }, Value: "0.", }, @@ -2114,16 +2108,16 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 26, - EndLine: 26, - StartPos: 572, - EndPos: 638, + EndLine: 26, + StartPos: 572, + EndPos: 638, }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 26, - EndLine: 26, - StartPos: 572, - EndPos: 637, + EndLine: 26, + StartPos: 572, + EndPos: 637, }, Value: "0b0111111111111111111111111111111111111111111111111111111111111111", }, @@ -2131,16 +2125,16 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 27, - EndLine: 27, - StartPos: 642, - EndPos: 708, + EndLine: 27, + StartPos: 642, + EndPos: 708, }, Expr: &scalar.Dnumber{ Position: &position.Position{ StartLine: 27, - EndLine: 27, - StartPos: 642, - EndPos: 707, + EndLine: 27, + StartPos: 642, + EndPos: 707, }, Value: "0b1111111111111111111111111111111111111111111111111111111111111111", }, @@ -2148,16 +2142,16 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 28, - EndLine: 28, - StartPos: 712, - EndPos: 732, + EndLine: 28, + StartPos: 712, + EndPos: 732, }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 28, - EndLine: 28, - StartPos: 712, - EndPos: 731, + EndLine: 28, + StartPos: 712, + EndPos: 731, }, Value: "0x007111111111111111", }, @@ -2165,16 +2159,16 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 29, - EndLine: 29, - StartPos: 736, - EndPos: 754, + EndLine: 29, + StartPos: 736, + EndPos: 754, }, Expr: &scalar.Dnumber{ Position: &position.Position{ StartLine: 29, - EndLine: 29, - StartPos: 736, - EndPos: 753, + EndLine: 29, + StartPos: 736, + EndPos: 753, }, Value: "0x8111111111111111", }, @@ -2182,16 +2176,16 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 30, - EndLine: 30, - StartPos: 758, - EndPos: 767, + EndLine: 30, + StartPos: 758, + EndPos: 767, }, Expr: &scalar.MagicConstant{ Position: &position.Position{ StartLine: 30, - EndLine: 30, - StartPos: 758, - EndPos: 766, + EndLine: 30, + StartPos: 758, + EndPos: 766, }, Value: "__CLASS__", }, @@ -2199,16 +2193,16 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 31, - EndLine: 31, - StartPos: 771, - EndPos: 778, + EndLine: 31, + StartPos: 771, + EndPos: 778, }, Expr: &scalar.MagicConstant{ Position: &position.Position{ StartLine: 31, - EndLine: 31, - StartPos: 771, - EndPos: 777, + EndLine: 31, + StartPos: 771, + EndPos: 777, }, Value: "__DIR__", }, @@ -2216,16 +2210,16 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 32, - EndLine: 32, - StartPos: 782, - EndPos: 790, + EndLine: 32, + StartPos: 782, + EndPos: 790, }, Expr: &scalar.MagicConstant{ Position: &position.Position{ StartLine: 32, - EndLine: 32, - StartPos: 782, - EndPos: 789, + EndLine: 32, + StartPos: 782, + EndPos: 789, }, Value: "__FILE__", }, @@ -2233,16 +2227,16 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 33, - EndLine: 33, - StartPos: 794, - EndPos: 806, + EndLine: 33, + StartPos: 794, + EndPos: 806, }, Expr: &scalar.MagicConstant{ Position: &position.Position{ StartLine: 33, - EndLine: 33, - StartPos: 794, - EndPos: 805, + EndLine: 33, + StartPos: 794, + EndPos: 805, }, Value: "__FUNCTION__", }, @@ -2250,16 +2244,16 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 34, - EndLine: 34, - StartPos: 810, - EndPos: 818, + EndLine: 34, + StartPos: 810, + EndPos: 818, }, Expr: &scalar.MagicConstant{ Position: &position.Position{ StartLine: 34, - EndLine: 34, - StartPos: 810, - EndPos: 817, + EndLine: 34, + StartPos: 810, + EndPos: 817, }, Value: "__LINE__", }, @@ -2267,16 +2261,16 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 35, - EndLine: 35, - StartPos: 822, - EndPos: 835, + EndLine: 35, + StartPos: 822, + EndPos: 835, }, Expr: &scalar.MagicConstant{ Position: &position.Position{ StartLine: 35, - EndLine: 35, - StartPos: 822, - EndPos: 834, + EndLine: 35, + StartPos: 822, + EndPos: 834, }, Value: "__NAMESPACE__", }, @@ -2284,16 +2278,16 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 36, - EndLine: 36, - StartPos: 839, - EndPos: 849, + EndLine: 36, + StartPos: 839, + EndPos: 849, }, Expr: &scalar.MagicConstant{ Position: &position.Position{ StartLine: 36, - EndLine: 36, - StartPos: 839, - EndPos: 848, + EndLine: 36, + StartPos: 839, + EndPos: 848, }, Value: "__METHOD__", }, @@ -2301,16 +2295,16 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 37, - EndLine: 37, - StartPos: 853, - EndPos: 862, + EndLine: 37, + StartPos: 853, + EndPos: 862, }, Expr: &scalar.MagicConstant{ Position: &position.Position{ StartLine: 37, - EndLine: 37, - StartPos: 853, - EndPos: 861, + EndLine: 37, + StartPos: 853, + EndPos: 861, }, Value: "__TRAIT__", }, @@ -2318,40 +2312,40 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 39, - EndLine: 39, - StartPos: 867, - EndPos: 878, + EndLine: 39, + StartPos: 867, + EndPos: 878, }, Expr: &scalar.Encapsed{ Position: &position.Position{ StartLine: 39, - EndLine: 39, - StartPos: 867, - EndPos: 877, + EndLine: 39, + StartPos: 867, + EndPos: 877, }, Parts: []node.Node{ &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 39, - EndLine: 39, - StartPos: 868, - EndPos: 872, + EndLine: 39, + StartPos: 868, + EndPos: 872, }, Value: "test ", }, &expr.Variable{ Position: &position.Position{ StartLine: 39, - EndLine: 39, - StartPos: 873, - EndPos: 876, + EndLine: 39, + StartPos: 873, + EndPos: 876, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 39, - EndLine: 39, - StartPos: 873, - EndPos: 876, + EndLine: 39, + StartPos: 873, + EndPos: 876, }, Value: "var", }, @@ -2362,47 +2356,47 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 40, - EndLine: 40, - StartPos: 882, - EndPos: 896, + EndLine: 40, + StartPos: 882, + EndPos: 896, }, Expr: &scalar.Encapsed{ Position: &position.Position{ StartLine: 40, - EndLine: 40, - StartPos: 882, - EndPos: 895, + EndLine: 40, + StartPos: 882, + EndPos: 895, }, Parts: []node.Node{ &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 40, - EndLine: 40, - StartPos: 883, - EndPos: 887, + EndLine: 40, + StartPos: 883, + EndPos: 887, }, Value: "test ", }, &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 40, - EndLine: 40, - StartPos: 888, - EndPos: 894, + EndLine: 40, + StartPos: 888, + EndPos: 894, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 40, - EndLine: 40, - StartPos: 888, - EndPos: 891, + EndLine: 40, + StartPos: 888, + EndPos: 891, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 40, - EndLine: 40, - StartPos: 888, - EndPos: 891, + EndLine: 40, + StartPos: 888, + EndPos: 891, }, Value: "var", }, @@ -2410,9 +2404,9 @@ func TestPhp7(t *testing.T) { Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 40, - EndLine: 40, - StartPos: 893, - EndPos: 893, + EndLine: 40, + StartPos: 893, + EndPos: 893, }, Value: "1", }, @@ -2423,47 +2417,47 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 41, - EndLine: 41, - StartPos: 900, - EndPos: 915, + EndLine: 41, + StartPos: 900, + EndPos: 915, }, Expr: &scalar.Encapsed{ Position: &position.Position{ StartLine: 41, - EndLine: 41, - StartPos: 900, - EndPos: 914, + EndLine: 41, + StartPos: 900, + EndPos: 914, }, Parts: []node.Node{ &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 41, - EndLine: 41, - StartPos: 901, - EndPos: 905, + EndLine: 41, + StartPos: 901, + EndPos: 905, }, Value: "test ", }, &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 41, - EndLine: 41, - StartPos: 906, - EndPos: 913, + EndLine: 41, + StartPos: 906, + EndPos: 913, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 41, - EndLine: 41, - StartPos: 906, - EndPos: 909, + EndLine: 41, + StartPos: 906, + EndPos: 909, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 41, - EndLine: 41, - StartPos: 906, - EndPos: 909, + EndLine: 41, + StartPos: 906, + EndPos: 909, }, Value: "var", }, @@ -2471,16 +2465,16 @@ func TestPhp7(t *testing.T) { Dim: &expr.UnaryMinus{ Position: &position.Position{ StartLine: 41, - EndLine: 41, - StartPos: 911, - EndPos: 912, + EndLine: 41, + StartPos: 911, + EndPos: 912, }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 41, - EndLine: 41, - StartPos: 911, - EndPos: 912, + EndLine: 41, + StartPos: 911, + EndPos: 912, }, Value: "1", }, @@ -2492,47 +2486,47 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 42, - EndLine: 42, - StartPos: 919, - EndPos: 972, + EndLine: 42, + StartPos: 919, + EndPos: 972, }, Expr: &scalar.Encapsed{ Position: &position.Position{ StartLine: 42, - EndLine: 42, - StartPos: 919, - EndPos: 971, + EndLine: 42, + StartPos: 919, + EndPos: 971, }, Parts: []node.Node{ &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 42, - EndLine: 42, - StartPos: 920, - EndPos: 924, + EndLine: 42, + StartPos: 920, + EndPos: 924, }, Value: "test ", }, &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 42, - EndLine: 42, - StartPos: 925, - EndPos: 970, + EndLine: 42, + StartPos: 925, + EndPos: 970, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 42, - EndLine: 42, - StartPos: 925, - EndPos: 928, + EndLine: 42, + StartPos: 925, + EndPos: 928, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 42, - EndLine: 42, - StartPos: 925, - EndPos: 928, + EndLine: 42, + StartPos: 925, + EndPos: 928, }, Value: "var", }, @@ -2540,9 +2534,9 @@ func TestPhp7(t *testing.T) { Dim: &scalar.String{ Position: &position.Position{ StartLine: 42, - EndLine: 42, - StartPos: 930, - EndPos: 969, + EndLine: 42, + StartPos: 930, + EndPos: 969, }, Value: "1234567890123456789012345678901234567890", }, @@ -2553,47 +2547,47 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 43, - EndLine: 43, - StartPos: 976, - EndPos: 1030, + EndLine: 43, + StartPos: 976, + EndPos: 1030, }, Expr: &scalar.Encapsed{ Position: &position.Position{ StartLine: 43, - EndLine: 43, - StartPos: 976, - EndPos: 1029, + EndLine: 43, + StartPos: 976, + EndPos: 1029, }, Parts: []node.Node{ &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 43, - EndLine: 43, - StartPos: 977, - EndPos: 981, + EndLine: 43, + StartPos: 977, + EndPos: 981, }, Value: "test ", }, &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 43, - EndLine: 43, - StartPos: 982, - EndPos: 1028, + EndLine: 43, + StartPos: 982, + EndPos: 1028, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 43, - EndLine: 43, - StartPos: 982, - EndPos: 985, + EndLine: 43, + StartPos: 982, + EndPos: 985, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 43, - EndLine: 43, - StartPos: 982, - EndPos: 985, + EndLine: 43, + StartPos: 982, + EndPos: 985, }, Value: "var", }, @@ -2601,9 +2595,9 @@ func TestPhp7(t *testing.T) { Dim: &scalar.String{ Position: &position.Position{ StartLine: 43, - EndLine: 43, - StartPos: 987, - EndPos: 1027, + EndLine: 43, + StartPos: 987, + EndPos: 1027, }, Value: "-1234567890123456789012345678901234567890", }, @@ -2614,47 +2608,47 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 44, - EndLine: 44, - StartPos: 1034, - EndPos: 1050, + EndLine: 44, + StartPos: 1034, + EndPos: 1050, }, Expr: &scalar.Encapsed{ Position: &position.Position{ StartLine: 44, - EndLine: 44, - StartPos: 1034, - EndPos: 1049, + EndLine: 44, + StartPos: 1034, + EndPos: 1049, }, Parts: []node.Node{ &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 44, - EndLine: 44, - StartPos: 1035, - EndPos: 1039, + EndLine: 44, + StartPos: 1035, + EndPos: 1039, }, Value: "test ", }, &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 44, - EndLine: 44, - StartPos: 1040, - EndPos: 1048, + EndLine: 44, + StartPos: 1040, + EndPos: 1048, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 44, - EndLine: 44, - StartPos: 1040, - EndPos: 1043, + EndLine: 44, + StartPos: 1040, + EndPos: 1043, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 44, - EndLine: 44, - StartPos: 1040, - EndPos: 1043, + EndLine: 44, + StartPos: 1040, + EndPos: 1043, }, Value: "var", }, @@ -2662,9 +2656,9 @@ func TestPhp7(t *testing.T) { Dim: &scalar.String{ Position: &position.Position{ StartLine: 44, - EndLine: 44, - StartPos: 1045, - EndPos: 1047, + EndLine: 44, + StartPos: 1045, + EndPos: 1047, }, Value: "bar", }, @@ -2675,47 +2669,47 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 45, - EndLine: 45, - StartPos: 1054, - EndPos: 1071, + EndLine: 45, + StartPos: 1054, + EndPos: 1071, }, Expr: &scalar.Encapsed{ Position: &position.Position{ StartLine: 45, - EndLine: 45, - StartPos: 1054, - EndPos: 1070, + EndLine: 45, + StartPos: 1054, + EndPos: 1070, }, Parts: []node.Node{ &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 45, - EndLine: 45, - StartPos: 1055, - EndPos: 1059, + EndLine: 45, + StartPos: 1055, + EndPos: 1059, }, Value: "test ", }, &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 45, - EndLine: 45, - StartPos: 1060, - EndPos: 1069, + EndLine: 45, + StartPos: 1060, + EndPos: 1069, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 45, - EndLine: 45, - StartPos: 1060, - EndPos: 1063, + EndLine: 45, + StartPos: 1060, + EndPos: 1063, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 45, - EndLine: 45, - StartPos: 1060, - EndPos: 1063, + EndLine: 45, + StartPos: 1060, + EndPos: 1063, }, Value: "var", }, @@ -2723,16 +2717,16 @@ func TestPhp7(t *testing.T) { Dim: &expr.Variable{ Position: &position.Position{ StartLine: 45, - EndLine: 45, - StartPos: 1065, - EndPos: 1068, + EndLine: 45, + StartPos: 1065, + EndPos: 1068, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 45, - EndLine: 45, - StartPos: 1065, - EndPos: 1068, + EndLine: 45, + StartPos: 1065, + EndPos: 1068, }, Value: "bar", }, @@ -2744,31 +2738,31 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 46, - EndLine: 46, - StartPos: 1075, - EndPos: 1086, + EndLine: 46, + StartPos: 1075, + EndPos: 1086, }, Expr: &scalar.Encapsed{ Position: &position.Position{ StartLine: 46, - EndLine: 46, - StartPos: 1075, - EndPos: 1085, + EndLine: 46, + StartPos: 1075, + EndPos: 1085, }, Parts: []node.Node{ &expr.Variable{ Position: &position.Position{ StartLine: 46, - EndLine: 46, - StartPos: 1076, - EndPos: 1079, + EndLine: 46, + StartPos: 1076, + EndPos: 1079, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 46, - EndLine: 46, - StartPos: 1076, - EndPos: 1079, + EndLine: 46, + StartPos: 1076, + EndPos: 1079, }, Value: "foo", }, @@ -2776,25 +2770,25 @@ func TestPhp7(t *testing.T) { &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 46, - EndLine: 46, - StartPos: 1080, - EndPos: 1080, + EndLine: 46, + StartPos: 1080, + EndPos: 1080, }, Value: " ", }, &expr.Variable{ Position: &position.Position{ StartLine: 46, - EndLine: 46, - StartPos: 1081, - EndPos: 1084, + EndLine: 46, + StartPos: 1081, + EndPos: 1084, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 46, - EndLine: 46, - StartPos: 1081, - EndPos: 1084, + EndLine: 46, + StartPos: 1081, + EndPos: 1084, }, Value: "bar", }, @@ -2805,47 +2799,47 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 47, - EndLine: 47, - StartPos: 1090, - EndPos: 1108, + EndLine: 47, + StartPos: 1090, + EndPos: 1108, }, Expr: &scalar.Encapsed{ Position: &position.Position{ StartLine: 47, - EndLine: 47, - StartPos: 1090, - EndPos: 1107, + EndLine: 47, + StartPos: 1090, + EndPos: 1107, }, Parts: []node.Node{ &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 47, - EndLine: 47, - StartPos: 1091, - EndPos: 1095, + EndLine: 47, + StartPos: 1091, + EndPos: 1095, }, Value: "test ", }, &expr.PropertyFetch{ Position: &position.Position{ StartLine: 47, - EndLine: 47, - StartPos: 1096, - EndPos: 1104, + EndLine: 47, + StartPos: 1096, + EndPos: 1104, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 47, - EndLine: 47, - StartPos: 1096, - EndPos: 1099, + EndLine: 47, + StartPos: 1096, + EndPos: 1099, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 47, - EndLine: 47, - StartPos: 1096, - EndPos: 1099, + EndLine: 47, + StartPos: 1096, + EndPos: 1099, }, Value: "foo", }, @@ -2853,9 +2847,9 @@ func TestPhp7(t *testing.T) { Property: &node.Identifier{ Position: &position.Position{ StartLine: 47, - EndLine: 47, - StartPos: 1102, - EndPos: 1104, + EndLine: 47, + StartPos: 1102, + EndPos: 1104, }, Value: "bar", }, @@ -2863,9 +2857,9 @@ func TestPhp7(t *testing.T) { &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 47, - EndLine: 47, - StartPos: 1105, - EndPos: 1106, + EndLine: 47, + StartPos: 1105, + EndPos: 1106, }, Value: "()", }, @@ -2875,40 +2869,40 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 48, - EndLine: 48, - StartPos: 1112, - EndPos: 1125, + EndLine: 48, + StartPos: 1112, + EndPos: 1125, }, Expr: &scalar.Encapsed{ Position: &position.Position{ StartLine: 48, - EndLine: 48, - StartPos: 1112, - EndPos: 1124, + EndLine: 48, + StartPos: 1112, + EndPos: 1124, }, Parts: []node.Node{ &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 48, - EndLine: 48, - StartPos: 1113, - EndPos: 1117, + EndLine: 48, + StartPos: 1113, + EndPos: 1117, }, Value: "test ", }, &expr.Variable{ Position: &position.Position{ StartLine: 48, - EndLine: 48, - StartPos: 1118, - EndPos: 1123, + EndLine: 48, + StartPos: 1118, + EndPos: 1123, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 48, - EndLine: 48, - StartPos: 1120, - EndPos: 1122, + EndLine: 48, + StartPos: 1120, + EndPos: 1122, }, Value: "foo", }, @@ -2919,47 +2913,47 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 49, - EndLine: 49, - StartPos: 1129, - EndPos: 1145, + EndLine: 49, + StartPos: 1129, + EndPos: 1145, }, Expr: &scalar.Encapsed{ Position: &position.Position{ StartLine: 49, - EndLine: 49, - StartPos: 1129, - EndPos: 1144, + EndLine: 49, + StartPos: 1129, + EndPos: 1144, }, Parts: []node.Node{ &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 49, - EndLine: 49, - StartPos: 1130, - EndPos: 1134, + EndLine: 49, + StartPos: 1130, + EndPos: 1134, }, Value: "test ", }, &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 49, - EndLine: 49, - StartPos: 1135, - EndPos: 1143, + EndLine: 49, + StartPos: 1135, + EndPos: 1143, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 49, - EndLine: 49, - StartPos: 1137, - EndPos: 1139, + EndLine: 49, + StartPos: 1137, + EndPos: 1139, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 49, - EndLine: 49, - StartPos: 1137, - EndPos: 1139, + EndLine: 49, + StartPos: 1137, + EndPos: 1139, }, Value: "foo", }, @@ -2967,9 +2961,9 @@ func TestPhp7(t *testing.T) { Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 49, - EndLine: 49, - StartPos: 1141, - EndPos: 1141, + EndLine: 49, + StartPos: 1141, + EndPos: 1141, }, Value: "0", }, @@ -2980,47 +2974,47 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 50, - EndLine: 50, - StartPos: 1149, - EndPos: 1163, + EndLine: 50, + StartPos: 1149, + EndPos: 1163, }, Expr: &scalar.Encapsed{ Position: &position.Position{ StartLine: 50, - EndLine: 50, - StartPos: 1149, - EndPos: 1162, + EndLine: 50, + StartPos: 1149, + EndPos: 1162, }, Parts: []node.Node{ &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 50, - EndLine: 50, - StartPos: 1150, - EndPos: 1154, + EndLine: 50, + StartPos: 1150, + EndPos: 1154, }, Value: "test ", }, &expr.Variable{ Position: &position.Position{ StartLine: 50, - EndLine: 50, - StartPos: 1155, - EndPos: 1161, + EndLine: 50, + StartPos: 1155, + EndPos: 1161, }, VarName: &expr.Variable{ Position: &position.Position{ StartLine: 50, - EndLine: 50, - StartPos: 1157, - EndPos: 1160, + EndLine: 50, + StartPos: 1157, + EndPos: 1160, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 50, - EndLine: 50, - StartPos: 1157, - EndPos: 1160, + EndLine: 50, + StartPos: 1157, + EndPos: 1160, }, Value: "foo", }, @@ -3032,47 +3026,47 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 51, - EndLine: 51, - StartPos: 1167, - EndPos: 1187, + EndLine: 51, + StartPos: 1167, + EndPos: 1187, }, Expr: &scalar.Encapsed{ Position: &position.Position{ StartLine: 51, - EndLine: 51, - StartPos: 1167, - EndPos: 1186, + EndLine: 51, + StartPos: 1167, + EndPos: 1186, }, Parts: []node.Node{ &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 51, - EndLine: 51, - StartPos: 1168, - EndPos: 1172, + EndLine: 51, + StartPos: 1168, + EndPos: 1172, }, Value: "test ", }, &expr.MethodCall{ Position: &position.Position{ StartLine: 51, - EndLine: 51, - StartPos: 1174, - EndPos: 1184, + EndLine: 51, + StartPos: 1174, + EndPos: 1184, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 51, - EndLine: 51, - StartPos: 1174, - EndPos: 1177, + EndLine: 51, + StartPos: 1174, + EndPos: 1177, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 51, - EndLine: 51, - StartPos: 1174, - EndPos: 1177, + EndLine: 51, + StartPos: 1174, + EndPos: 1177, }, Value: "foo", }, @@ -3080,18 +3074,18 @@ func TestPhp7(t *testing.T) { Method: &node.Identifier{ Position: &position.Position{ StartLine: 51, - EndLine: 51, - StartPos: 1180, - EndPos: 1182, + EndLine: 51, + StartPos: 1180, + EndPos: 1182, }, Value: "bar", }, ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 51, - EndLine: 51, - StartPos: 1183, - EndPos: 1184, + EndLine: 51, + StartPos: 1183, + EndPos: 1184, }, }, }, @@ -3101,23 +3095,23 @@ func TestPhp7(t *testing.T) { &stmt.AltIf{ Position: &position.Position{ StartLine: 53, - EndLine: 54, - StartPos: 1192, - EndPos: 1209, + EndLine: 54, + StartPos: 1192, + EndPos: 1209, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 53, - EndLine: 53, - StartPos: 1196, - EndPos: 1197, + EndLine: 53, + StartPos: 1196, + EndPos: 1197, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 53, - EndLine: 53, - StartPos: 1196, - EndPos: 1197, + EndLine: 53, + StartPos: 1196, + EndPos: 1197, }, Value: "a", }, @@ -3125,34 +3119,33 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - Stmts: []node.Node{ + EndLine: -1, + StartPos: -1, + EndPos: -1, }, + Stmts: []node.Node{}, }, }, &stmt.AltIf{ Position: &position.Position{ StartLine: 55, - EndLine: 57, - StartPos: 1213, - EndPos: 1245, + EndLine: 57, + StartPos: 1213, + EndPos: 1245, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 55, - EndLine: 55, - StartPos: 1217, - EndPos: 1218, + EndLine: 55, + StartPos: 1217, + EndPos: 1218, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 55, - EndLine: 55, - StartPos: 1217, - EndPos: 1218, + EndLine: 55, + StartPos: 1217, + EndPos: 1218, }, Value: "a", }, @@ -3160,34 +3153,33 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - Stmts: []node.Node{ + EndLine: -1, + StartPos: -1, + EndPos: -1, }, + Stmts: []node.Node{}, }, ElseIf: []node.Node{ &stmt.AltElseIf{ Position: &position.Position{ StartLine: 56, - EndLine: -1, - StartPos: 1225, - EndPos: -1, + EndLine: -1, + StartPos: 1225, + EndPos: -1, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 56, - EndLine: 56, - StartPos: 1233, - EndPos: 1234, + EndLine: 56, + StartPos: 1233, + EndPos: 1234, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 56, - EndLine: 56, - StartPos: 1233, - EndPos: 1234, + EndLine: 56, + StartPos: 1233, + EndPos: 1234, }, Value: "b", }, @@ -3195,12 +3187,11 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - Stmts: []node.Node{ + EndLine: -1, + StartPos: -1, + EndPos: -1, }, + Stmts: []node.Node{}, }, }, }, @@ -3208,23 +3199,23 @@ func TestPhp7(t *testing.T) { &stmt.AltIf{ Position: &position.Position{ StartLine: 58, - EndLine: 60, - StartPos: 1249, - EndPos: 1274, + EndLine: 60, + StartPos: 1249, + EndPos: 1274, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 58, - EndLine: 58, - StartPos: 1253, - EndPos: 1254, + EndLine: 58, + StartPos: 1253, + EndPos: 1254, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 58, - EndLine: 58, - StartPos: 1253, - EndPos: 1254, + EndLine: 58, + StartPos: 1253, + EndPos: 1254, }, Value: "a", }, @@ -3232,52 +3223,50 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - Stmts: []node.Node{ + EndLine: -1, + StartPos: -1, + EndPos: -1, }, + Stmts: []node.Node{}, }, Else: &stmt.AltElse{ Position: &position.Position{ StartLine: 59, - EndLine: -1, - StartPos: 1261, - EndPos: -1, + EndLine: -1, + StartPos: 1261, + EndPos: -1, }, Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - Stmts: []node.Node{ + EndLine: -1, + StartPos: -1, + EndPos: -1, }, + Stmts: []node.Node{}, }, }, }, &stmt.AltIf{ Position: &position.Position{ StartLine: 61, - EndLine: 65, - StartPos: 1278, - EndPos: 1333, + EndLine: 65, + StartPos: 1278, + EndPos: 1333, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 61, - EndLine: 61, - StartPos: 1282, - EndPos: 1283, + EndLine: 61, + StartPos: 1282, + EndPos: 1283, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 61, - EndLine: 61, - StartPos: 1282, - EndPos: 1283, + EndLine: 61, + StartPos: 1282, + EndPos: 1283, }, Value: "a", }, @@ -3285,34 +3274,33 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - Stmts: []node.Node{ + EndLine: -1, + StartPos: -1, + EndPos: -1, }, + Stmts: []node.Node{}, }, ElseIf: []node.Node{ &stmt.AltElseIf{ Position: &position.Position{ StartLine: 62, - EndLine: -1, - StartPos: 1290, - EndPos: -1, + EndLine: -1, + StartPos: 1290, + EndPos: -1, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 62, - EndLine: 62, - StartPos: 1298, - EndPos: 1299, + EndLine: 62, + StartPos: 1298, + EndPos: 1299, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 62, - EndLine: 62, - StartPos: 1298, - EndPos: 1299, + EndLine: 62, + StartPos: 1298, + EndPos: 1299, }, Value: "b", }, @@ -3320,34 +3308,33 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - Stmts: []node.Node{ + EndLine: -1, + StartPos: -1, + EndPos: -1, }, + Stmts: []node.Node{}, }, }, &stmt.AltElseIf{ Position: &position.Position{ StartLine: 63, - EndLine: -1, - StartPos: 1305, - EndPos: -1, + EndLine: -1, + StartPos: 1305, + EndPos: -1, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 63, - EndLine: 63, - StartPos: 1313, - EndPos: 1314, + EndLine: 63, + StartPos: 1313, + EndPos: 1314, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 63, - EndLine: 63, - StartPos: 1313, - EndPos: 1314, + EndLine: 63, + StartPos: 1313, + EndPos: 1314, }, Value: "c", }, @@ -3355,64 +3342,62 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - Stmts: []node.Node{ + EndLine: -1, + StartPos: -1, + EndPos: -1, }, + Stmts: []node.Node{}, }, }, }, Else: &stmt.AltElse{ Position: &position.Position{ StartLine: 64, - EndLine: -1, - StartPos: 1320, - EndPos: -1, + EndLine: -1, + StartPos: 1320, + EndPos: -1, }, Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - Stmts: []node.Node{ + EndLine: -1, + StartPos: -1, + EndPos: -1, }, + Stmts: []node.Node{}, }, }, }, &stmt.While{ Position: &position.Position{ StartLine: 67, - EndLine: 67, - StartPos: 1338, - EndPos: 1357, + EndLine: 67, + StartPos: 1338, + EndPos: 1357, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 67, - EndLine: 67, - StartPos: 1345, - EndPos: 1345, + EndLine: 67, + StartPos: 1345, + EndPos: 1345, }, Value: "1", }, Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 67, - EndLine: 67, - StartPos: 1348, - EndPos: 1357, + EndLine: 67, + StartPos: 1348, + EndPos: 1357, }, Stmts: []node.Node{ &stmt.Break{ Position: &position.Position{ StartLine: 67, - EndLine: 67, - StartPos: 1350, - EndPos: 1355, + EndLine: 67, + StartPos: 1350, + EndPos: 1355, }, }, }, @@ -3421,40 +3406,40 @@ func TestPhp7(t *testing.T) { &stmt.While{ Position: &position.Position{ StartLine: 68, - EndLine: 68, - StartPos: 1361, - EndPos: 1382, + EndLine: 68, + StartPos: 1361, + EndPos: 1382, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 68, - EndLine: 68, - StartPos: 1368, - EndPos: 1368, + EndLine: 68, + StartPos: 1368, + EndPos: 1368, }, Value: "1", }, Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 68, - EndLine: 68, - StartPos: 1371, - EndPos: 1382, + EndLine: 68, + StartPos: 1371, + EndPos: 1382, }, Stmts: []node.Node{ &stmt.Break{ Position: &position.Position{ StartLine: 68, - EndLine: 68, - StartPos: 1373, - EndPos: 1380, + EndLine: 68, + StartPos: 1373, + EndPos: 1380, }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 68, - EndLine: 68, - StartPos: 1379, - EndPos: 1379, + EndLine: 68, + StartPos: 1379, + EndPos: 1379, }, Value: "2", }, @@ -3465,40 +3450,40 @@ func TestPhp7(t *testing.T) { &stmt.AltWhile{ Position: &position.Position{ StartLine: 69, - EndLine: 69, - StartPos: 1386, - EndPos: 1416, + EndLine: 69, + StartPos: 1386, + EndPos: 1416, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 69, - EndLine: 69, - StartPos: 1393, - EndPos: 1393, + EndLine: 69, + StartPos: 1393, + EndPos: 1393, }, Value: "1", }, Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 69, - EndLine: 69, - StartPos: 1398, - EndPos: 1406, + EndLine: 69, + StartPos: 1398, + EndPos: 1406, }, Stmts: []node.Node{ &stmt.Break{ Position: &position.Position{ StartLine: 69, - EndLine: 69, - StartPos: 1398, - EndPos: 1406, + EndLine: 69, + StartPos: 1398, + EndPos: 1406, }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 69, - EndLine: 69, - StartPos: 1404, - EndPos: 1404, + EndLine: 69, + StartPos: 1404, + EndPos: 1404, }, Value: "3", }, @@ -3509,17 +3494,17 @@ func TestPhp7(t *testing.T) { &stmt.Class{ Position: &position.Position{ StartLine: 70, - EndLine: 70, - StartPos: 1420, - EndPos: 1462, + EndLine: 70, + StartPos: 1420, + EndPos: 1462, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 70, - EndLine: 70, - StartPos: 1426, - EndPos: 1428, + EndLine: 70, + StartPos: 1426, + EndPos: 1428, }, Value: "foo", }, @@ -3527,17 +3512,17 @@ func TestPhp7(t *testing.T) { &stmt.ClassConstList{ Position: &position.Position{ StartLine: 70, - EndLine: 70, - StartPos: 1431, - EndPos: 1460, + EndLine: 70, + StartPos: 1431, + EndPos: 1460, }, Modifiers: []node.Node{ &node.Identifier{ Position: &position.Position{ StartLine: 70, - EndLine: 70, - StartPos: 1431, - EndPos: 1436, + EndLine: 70, + StartPos: 1431, + EndPos: 1436, }, Value: "public", }, @@ -3546,26 +3531,26 @@ func TestPhp7(t *testing.T) { &stmt.Constant{ Position: &position.Position{ StartLine: 70, - EndLine: 70, - StartPos: 1444, - EndPos: 1450, + EndLine: 70, + StartPos: 1444, + EndPos: 1450, }, PhpDocComment: "", ConstantName: &node.Identifier{ Position: &position.Position{ StartLine: 70, - EndLine: 70, - StartPos: 1444, - EndPos: 1446, + EndLine: 70, + StartPos: 1444, + EndPos: 1446, }, Value: "FOO", }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 70, - EndLine: 70, - StartPos: 1450, - EndPos: 1450, + EndLine: 70, + StartPos: 1450, + EndPos: 1450, }, Value: "1", }, @@ -3573,26 +3558,26 @@ func TestPhp7(t *testing.T) { &stmt.Constant{ Position: &position.Position{ StartLine: 70, - EndLine: 70, - StartPos: 1453, - EndPos: 1459, + EndLine: 70, + StartPos: 1453, + EndPos: 1459, }, PhpDocComment: "", ConstantName: &node.Identifier{ Position: &position.Position{ StartLine: 70, - EndLine: 70, - StartPos: 1453, - EndPos: 1455, + EndLine: 70, + StartPos: 1453, + EndPos: 1455, }, Value: "BAR", }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 70, - EndLine: 70, - StartPos: 1459, - EndPos: 1459, + EndLine: 70, + StartPos: 1459, + EndPos: 1459, }, Value: "2", }, @@ -3604,17 +3589,17 @@ func TestPhp7(t *testing.T) { &stmt.Class{ Position: &position.Position{ StartLine: 71, - EndLine: 71, - StartPos: 1466, - EndPos: 1501, + EndLine: 71, + StartPos: 1466, + EndPos: 1501, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 71, - EndLine: 71, - StartPos: 1472, - EndPos: 1474, + EndLine: 71, + StartPos: 1472, + EndPos: 1474, }, Value: "foo", }, @@ -3622,34 +3607,34 @@ func TestPhp7(t *testing.T) { &stmt.ClassConstList{ Position: &position.Position{ StartLine: 71, - EndLine: 71, - StartPos: 1477, - EndPos: 1499, + EndLine: 71, + StartPos: 1477, + EndPos: 1499, }, Consts: []node.Node{ &stmt.Constant{ Position: &position.Position{ StartLine: 71, - EndLine: 71, - StartPos: 1483, - EndPos: 1489, + EndLine: 71, + StartPos: 1483, + EndPos: 1489, }, PhpDocComment: "", ConstantName: &node.Identifier{ Position: &position.Position{ StartLine: 71, - EndLine: 71, - StartPos: 1483, - EndPos: 1485, + EndLine: 71, + StartPos: 1483, + EndPos: 1485, }, Value: "FOO", }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 71, - EndLine: 71, - StartPos: 1489, - EndPos: 1489, + EndLine: 71, + StartPos: 1489, + EndPos: 1489, }, Value: "1", }, @@ -3657,26 +3642,26 @@ func TestPhp7(t *testing.T) { &stmt.Constant{ Position: &position.Position{ StartLine: 71, - EndLine: 71, - StartPos: 1492, - EndPos: 1498, + EndLine: 71, + StartPos: 1492, + EndPos: 1498, }, PhpDocComment: "", ConstantName: &node.Identifier{ Position: &position.Position{ StartLine: 71, - EndLine: 71, - StartPos: 1492, - EndPos: 1494, + EndLine: 71, + StartPos: 1492, + EndPos: 1494, }, Value: "BAR", }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 71, - EndLine: 71, - StartPos: 1498, - EndPos: 1498, + EndLine: 71, + StartPos: 1498, + EndPos: 1498, }, Value: "2", }, @@ -3688,17 +3673,17 @@ func TestPhp7(t *testing.T) { &stmt.Class{ Position: &position.Position{ StartLine: 72, - EndLine: 72, - StartPos: 1505, - EndPos: 1534, + EndLine: 72, + StartPos: 1505, + EndPos: 1534, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 72, - EndLine: 72, - StartPos: 1511, - EndPos: 1513, + EndLine: 72, + StartPos: 1511, + EndPos: 1513, }, Value: "foo", }, @@ -3706,30 +3691,29 @@ func TestPhp7(t *testing.T) { &stmt.ClassMethod{ Position: &position.Position{ StartLine: 72, - EndLine: 72, - StartPos: 1516, - EndPos: 1532, + EndLine: 72, + StartPos: 1516, + EndPos: 1532, }, - ReturnsRef: false, + ReturnsRef: false, PhpDocComment: "", MethodName: &node.Identifier{ Position: &position.Position{ StartLine: 72, - EndLine: 72, - StartPos: 1525, - EndPos: 1527, + EndLine: 72, + StartPos: 1525, + EndPos: 1527, }, Value: "bar", }, Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 72, - EndLine: 72, - StartPos: 1531, - EndPos: 1532, - }, - Stmts: []node.Node{ + EndLine: 72, + StartPos: 1531, + EndPos: 1532, }, + Stmts: []node.Node{}, }, }, }, @@ -3737,17 +3721,17 @@ func TestPhp7(t *testing.T) { &stmt.Class{ Position: &position.Position{ StartLine: 73, - EndLine: 73, - StartPos: 1538, - EndPos: 1582, + EndLine: 73, + StartPos: 1538, + EndPos: 1582, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 73, - EndLine: 73, - StartPos: 1544, - EndPos: 1546, + EndLine: 73, + StartPos: 1544, + EndPos: 1546, }, Value: "foo", }, @@ -3755,18 +3739,18 @@ func TestPhp7(t *testing.T) { &stmt.ClassMethod{ Position: &position.Position{ StartLine: 73, - EndLine: 73, - StartPos: 1549, - EndPos: 1580, + EndLine: 73, + StartPos: 1549, + EndPos: 1580, }, PhpDocComment: "", - ReturnsRef: true, + ReturnsRef: true, MethodName: &node.Identifier{ Position: &position.Position{ StartLine: 73, - EndLine: 73, - StartPos: 1573, - EndPos: 1575, + EndLine: 73, + StartPos: 1573, + EndPos: 1575, }, Value: "bar", }, @@ -3774,18 +3758,18 @@ func TestPhp7(t *testing.T) { &node.Identifier{ Position: &position.Position{ StartLine: 73, - EndLine: 73, - StartPos: 1549, - EndPos: 1554, + EndLine: 73, + StartPos: 1549, + EndPos: 1554, }, Value: "public", }, &node.Identifier{ Position: &position.Position{ StartLine: 73, - EndLine: 73, - StartPos: 1556, - EndPos: 1561, + EndLine: 73, + StartPos: 1556, + EndPos: 1561, }, Value: "static", }, @@ -3793,12 +3777,11 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 73, - EndLine: 73, - StartPos: 1579, - EndPos: 1580, - }, - Stmts: []node.Node{ + EndLine: 73, + StartPos: 1579, + EndPos: 1580, }, + Stmts: []node.Node{}, }, }, }, @@ -3806,17 +3789,17 @@ func TestPhp7(t *testing.T) { &stmt.Class{ Position: &position.Position{ StartLine: 74, - EndLine: 74, - StartPos: 1586, - EndPos: 1636, + EndLine: 74, + StartPos: 1586, + EndPos: 1636, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 74, - EndLine: 74, - StartPos: 1592, - EndPos: 1594, + EndLine: 74, + StartPos: 1592, + EndPos: 1594, }, Value: "foo", }, @@ -3824,18 +3807,18 @@ func TestPhp7(t *testing.T) { &stmt.ClassMethod{ Position: &position.Position{ StartLine: 74, - EndLine: 74, - StartPos: 1597, - EndPos: 1634, + EndLine: 74, + StartPos: 1597, + EndPos: 1634, }, - ReturnsRef: true, + ReturnsRef: true, PhpDocComment: "", MethodName: &node.Identifier{ Position: &position.Position{ StartLine: 74, - EndLine: 74, - StartPos: 1621, - EndPos: 1623, + EndLine: 74, + StartPos: 1621, + EndPos: 1623, }, Value: "bar", }, @@ -3843,18 +3826,18 @@ func TestPhp7(t *testing.T) { &node.Identifier{ Position: &position.Position{ StartLine: 74, - EndLine: 74, - StartPos: 1597, - EndPos: 1602, + EndLine: 74, + StartPos: 1597, + EndPos: 1602, }, Value: "public", }, &node.Identifier{ Position: &position.Position{ StartLine: 74, - EndLine: 74, - StartPos: 1604, - EndPos: 1609, + EndLine: 74, + StartPos: 1604, + EndPos: 1609, }, Value: "static", }, @@ -3862,17 +3845,17 @@ func TestPhp7(t *testing.T) { ReturnType: &name.Name{ Position: &position.Position{ StartLine: 74, - EndLine: 74, - StartPos: 1628, - EndPos: 1631, + EndLine: 74, + StartPos: 1628, + EndPos: 1631, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 74, - EndLine: 74, - StartPos: 1628, - EndPos: 1631, + EndLine: 74, + StartPos: 1628, + EndPos: 1631, }, Value: "void", }, @@ -3881,12 +3864,11 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 74, - EndLine: 74, - StartPos: 1633, - EndPos: 1634, - }, - Stmts: []node.Node{ + EndLine: 74, + StartPos: 1633, + EndPos: 1634, }, + Stmts: []node.Node{}, }, }, }, @@ -3894,17 +3876,17 @@ func TestPhp7(t *testing.T) { &stmt.Class{ Position: &position.Position{ StartLine: 75, - EndLine: 75, - StartPos: 1640, - EndPos: 1660, + EndLine: 75, + StartPos: 1640, + EndPos: 1660, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 75, - EndLine: 75, - StartPos: 1655, - EndPos: 1657, + EndLine: 75, + StartPos: 1655, + EndPos: 1657, }, Value: "foo", }, @@ -3912,30 +3894,29 @@ func TestPhp7(t *testing.T) { &node.Identifier{ Position: &position.Position{ StartLine: 75, - EndLine: 75, - StartPos: 1640, - EndPos: 1647, + EndLine: 75, + StartPos: 1640, + EndPos: 1647, }, Value: "abstract", }, }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, &stmt.Class{ Position: &position.Position{ StartLine: 76, - EndLine: 76, - StartPos: 1664, - EndPos: 1694, + EndLine: 76, + StartPos: 1664, + EndPos: 1694, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 76, - EndLine: 76, - StartPos: 1676, - EndPos: 1678, + EndLine: 76, + StartPos: 1676, + EndPos: 1678, }, Value: "foo", }, @@ -3943,9 +3924,9 @@ func TestPhp7(t *testing.T) { &node.Identifier{ Position: &position.Position{ StartLine: 76, - EndLine: 76, - StartPos: 1664, - EndPos: 1668, + EndLine: 76, + StartPos: 1664, + EndPos: 1668, }, Value: "final", }, @@ -3953,47 +3934,46 @@ func TestPhp7(t *testing.T) { Extends: &stmt.ClassExtends{ Position: &position.Position{ StartLine: 76, - EndLine: 76, - StartPos: 1680, - EndPos: 1690, + EndLine: 76, + StartPos: 1680, + EndPos: 1690, }, ClassName: &name.Name{ Position: &position.Position{ StartLine: 76, - EndLine: 76, - StartPos: 1688, - EndPos: 1690, + EndLine: 76, + StartPos: 1688, + EndPos: 1690, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 76, - EndLine: 76, - StartPos: 1688, - EndPos: 1690, + EndLine: 76, + StartPos: 1688, + EndPos: 1690, }, Value: "bar", }, }, }, }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, &stmt.Class{ Position: &position.Position{ StartLine: 77, - EndLine: 77, - StartPos: 1698, - EndPos: 1731, + EndLine: 77, + StartPos: 1698, + EndPos: 1731, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 77, - EndLine: 77, - StartPos: 1710, - EndPos: 1712, + EndLine: 77, + StartPos: 1710, + EndPos: 1712, }, Value: "foo", }, @@ -4001,9 +3981,9 @@ func TestPhp7(t *testing.T) { &node.Identifier{ Position: &position.Position{ StartLine: 77, - EndLine: 77, - StartPos: 1698, - EndPos: 1702, + EndLine: 77, + StartPos: 1698, + EndPos: 1702, }, Value: "final", }, @@ -4011,25 +3991,25 @@ func TestPhp7(t *testing.T) { Implements: &stmt.ClassImplements{ Position: &position.Position{ StartLine: 77, - EndLine: 77, - StartPos: 1714, - EndPos: 1727, + EndLine: 77, + StartPos: 1714, + EndPos: 1727, }, InterfaceNames: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 77, - EndLine: 77, - StartPos: 1725, - EndPos: 1727, + EndLine: 77, + StartPos: 1725, + EndPos: 1727, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 77, - EndLine: 77, - StartPos: 1725, - EndPos: 1727, + EndLine: 77, + StartPos: 1725, + EndPos: 1727, }, Value: "bar", }, @@ -4037,23 +4017,22 @@ func TestPhp7(t *testing.T) { }, }, }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, &stmt.Class{ Position: &position.Position{ StartLine: 78, - EndLine: 78, - StartPos: 1735, - EndPos: 1773, + EndLine: 78, + StartPos: 1735, + EndPos: 1773, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 78, - EndLine: 78, - StartPos: 1747, - EndPos: 1749, + EndLine: 78, + StartPos: 1747, + EndPos: 1749, }, Value: "foo", }, @@ -4061,9 +4040,9 @@ func TestPhp7(t *testing.T) { &node.Identifier{ Position: &position.Position{ StartLine: 78, - EndLine: 78, - StartPos: 1735, - EndPos: 1739, + EndLine: 78, + StartPos: 1735, + EndPos: 1739, }, Value: "final", }, @@ -4071,25 +4050,25 @@ func TestPhp7(t *testing.T) { Implements: &stmt.ClassImplements{ Position: &position.Position{ StartLine: 78, - EndLine: 78, - StartPos: 1751, - EndPos: 1769, + EndLine: 78, + StartPos: 1751, + EndPos: 1769, }, InterfaceNames: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 78, - EndLine: 78, - StartPos: 1762, - EndPos: 1764, + EndLine: 78, + StartPos: 1762, + EndPos: 1764, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 78, - EndLine: 78, - StartPos: 1762, - EndPos: 1764, + EndLine: 78, + StartPos: 1762, + EndPos: 1764, }, Value: "bar", }, @@ -4098,17 +4077,17 @@ func TestPhp7(t *testing.T) { &name.Name{ Position: &position.Position{ StartLine: 78, - EndLine: 78, - StartPos: 1767, - EndPos: 1769, + EndLine: 78, + StartPos: 1767, + EndPos: 1769, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 78, - EndLine: 78, - StartPos: 1767, - EndPos: 1769, + EndLine: 78, + StartPos: 1767, + EndPos: 1769, }, Value: "baz", }, @@ -4116,60 +4095,59 @@ func TestPhp7(t *testing.T) { }, }, }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, &stmt.Expression{ Position: &position.Position{ StartLine: 79, - EndLine: 79, - StartPos: 1777, - EndPos: 1824, + EndLine: 79, + StartPos: 1777, + EndPos: 1824, }, Expr: &expr.New{ Position: &position.Position{ StartLine: 79, - EndLine: 79, - StartPos: 1777, - EndPos: 1823, + EndLine: 79, + StartPos: 1777, + EndPos: 1823, }, Class: &stmt.Class{ Position: &position.Position{ StartLine: 79, - EndLine: 79, - StartPos: 1781, - EndPos: 1823, + EndLine: 79, + StartPos: 1781, + EndPos: 1823, }, PhpDocComment: "", ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 79, - EndLine: 79, - StartPos: 1786, - EndPos: 1787, + EndLine: 79, + StartPos: 1786, + EndPos: 1787, }, }, Extends: &stmt.ClassExtends{ Position: &position.Position{ StartLine: 79, - EndLine: 79, - StartPos: 1789, - EndPos: 1799, + EndLine: 79, + StartPos: 1789, + EndPos: 1799, }, ClassName: &name.Name{ Position: &position.Position{ StartLine: 79, - EndLine: 79, - StartPos: 1797, - EndPos: 1799, + EndLine: 79, + StartPos: 1797, + EndPos: 1799, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 79, - EndLine: 79, - StartPos: 1797, - EndPos: 1799, + EndLine: 79, + StartPos: 1797, + EndPos: 1799, }, Value: "foo", }, @@ -4179,25 +4157,25 @@ func TestPhp7(t *testing.T) { Implements: &stmt.ClassImplements{ Position: &position.Position{ StartLine: 79, - EndLine: 79, - StartPos: 1801, - EndPos: 1819, + EndLine: 79, + StartPos: 1801, + EndPos: 1819, }, InterfaceNames: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 79, - EndLine: 79, - StartPos: 1812, - EndPos: 1814, + EndLine: 79, + StartPos: 1812, + EndPos: 1814, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 79, - EndLine: 79, - StartPos: 1812, - EndPos: 1814, + EndLine: 79, + StartPos: 1812, + EndPos: 1814, }, Value: "bar", }, @@ -4206,17 +4184,17 @@ func TestPhp7(t *testing.T) { &name.Name{ Position: &position.Position{ StartLine: 79, - EndLine: 79, - StartPos: 1817, - EndPos: 1819, + EndLine: 79, + StartPos: 1817, + EndPos: 1819, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 79, - EndLine: 79, - StartPos: 1817, - EndPos: 1819, + EndLine: 79, + StartPos: 1817, + EndPos: 1819, }, Value: "baz", }, @@ -4224,42 +4202,41 @@ func TestPhp7(t *testing.T) { }, }, }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, }, }, &stmt.ConstList{ Position: &position.Position{ StartLine: 81, - EndLine: 81, - StartPos: 1829, - EndPos: 1851, + EndLine: 81, + StartPos: 1829, + EndPos: 1851, }, Consts: []node.Node{ &stmt.Constant{ Position: &position.Position{ StartLine: 81, - EndLine: 81, - StartPos: 1835, - EndPos: 1841, + EndLine: 81, + StartPos: 1835, + EndPos: 1841, }, PhpDocComment: "", ConstantName: &node.Identifier{ Position: &position.Position{ StartLine: 81, - EndLine: 81, - StartPos: 1835, - EndPos: 1837, + EndLine: 81, + StartPos: 1835, + EndPos: 1837, }, Value: "FOO", }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 81, - EndLine: 81, - StartPos: 1841, - EndPos: 1841, + EndLine: 81, + StartPos: 1841, + EndPos: 1841, }, Value: "1", }, @@ -4267,26 +4244,26 @@ func TestPhp7(t *testing.T) { &stmt.Constant{ Position: &position.Position{ StartLine: 81, - EndLine: 81, - StartPos: 1844, - EndPos: 1850, + EndLine: 81, + StartPos: 1844, + EndPos: 1850, }, PhpDocComment: "", ConstantName: &node.Identifier{ Position: &position.Position{ StartLine: 81, - EndLine: 81, - StartPos: 1844, - EndPos: 1846, + EndLine: 81, + StartPos: 1844, + EndPos: 1846, }, Value: "BAR", }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 81, - EndLine: 81, - StartPos: 1850, - EndPos: 1850, + EndLine: 81, + StartPos: 1850, + EndPos: 1850, }, Value: "2", }, @@ -4296,33 +4273,33 @@ func TestPhp7(t *testing.T) { &stmt.While{ Position: &position.Position{ StartLine: 82, - EndLine: 82, - StartPos: 1855, - EndPos: 1877, + EndLine: 82, + StartPos: 1855, + EndPos: 1877, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 82, - EndLine: 82, - StartPos: 1862, - EndPos: 1862, + EndLine: 82, + StartPos: 1862, + EndPos: 1862, }, Value: "1", }, Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 82, - EndLine: 82, - StartPos: 1865, - EndPos: 1877, + EndLine: 82, + StartPos: 1865, + EndPos: 1877, }, Stmts: []node.Node{ &stmt.Continue{ Position: &position.Position{ StartLine: 82, - EndLine: 82, - StartPos: 1867, - EndPos: 1875, + EndLine: 82, + StartPos: 1867, + EndPos: 1875, }, }, }, @@ -4331,40 +4308,40 @@ func TestPhp7(t *testing.T) { &stmt.While{ Position: &position.Position{ StartLine: 83, - EndLine: 83, - StartPos: 1881, - EndPos: 1905, + EndLine: 83, + StartPos: 1881, + EndPos: 1905, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 83, - EndLine: 83, - StartPos: 1888, - EndPos: 1888, + EndLine: 83, + StartPos: 1888, + EndPos: 1888, }, Value: "1", }, Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 83, - EndLine: 83, - StartPos: 1891, - EndPos: 1905, + EndLine: 83, + StartPos: 1891, + EndPos: 1905, }, Stmts: []node.Node{ &stmt.Continue{ Position: &position.Position{ StartLine: 83, - EndLine: 83, - StartPos: 1893, - EndPos: 1903, + EndLine: 83, + StartPos: 1893, + EndPos: 1903, }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 83, - EndLine: 83, - StartPos: 1902, - EndPos: 1902, + EndLine: 83, + StartPos: 1902, + EndPos: 1902, }, Value: "2", }, @@ -4375,40 +4352,40 @@ func TestPhp7(t *testing.T) { &stmt.While{ Position: &position.Position{ StartLine: 84, - EndLine: 84, - StartPos: 1909, - EndPos: 1934, + EndLine: 84, + StartPos: 1909, + EndPos: 1934, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 84, - EndLine: 84, - StartPos: 1916, - EndPos: 1916, + EndLine: 84, + StartPos: 1916, + EndPos: 1916, }, Value: "1", }, Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 84, - EndLine: 84, - StartPos: 1919, - EndPos: 1934, + EndLine: 84, + StartPos: 1919, + EndPos: 1934, }, Stmts: []node.Node{ &stmt.Continue{ Position: &position.Position{ StartLine: 84, - EndLine: 84, - StartPos: 1921, - EndPos: 1932, + EndLine: 84, + StartPos: 1921, + EndPos: 1932, }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 84, - EndLine: 84, - StartPos: 1930, - EndPos: 1930, + EndLine: 84, + StartPos: 1930, + EndPos: 1930, }, Value: "3", }, @@ -4419,34 +4396,34 @@ func TestPhp7(t *testing.T) { &stmt.Declare{ Position: &position.Position{ StartLine: 85, - EndLine: 85, - StartPos: 1938, - EndPos: 1954, + EndLine: 85, + StartPos: 1938, + EndPos: 1954, }, Consts: []node.Node{ &stmt.Constant{ Position: &position.Position{ StartLine: 85, - EndLine: 85, - StartPos: 1946, - EndPos: 1952, + EndLine: 85, + StartPos: 1946, + EndPos: 1952, }, PhpDocComment: "", ConstantName: &node.Identifier{ Position: &position.Position{ StartLine: 85, - EndLine: 85, - StartPos: 1946, - EndPos: 1950, + EndLine: 85, + StartPos: 1946, + EndPos: 1950, }, Value: "ticks", }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 85, - EndLine: 85, - StartPos: 1952, - EndPos: 1952, + EndLine: 85, + StartPos: 1952, + EndPos: 1952, }, Value: "1", }, @@ -4455,43 +4432,43 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.Nop{ Position: &position.Position{ StartLine: 85, - EndLine: 85, - StartPos: 1954, - EndPos: 1954, + EndLine: 85, + StartPos: 1954, + EndPos: 1954, }, }, }, &stmt.Declare{ Position: &position.Position{ StartLine: 86, - EndLine: 86, - StartPos: 1958, - EndPos: 1976, + EndLine: 86, + StartPos: 1958, + EndPos: 1976, }, Consts: []node.Node{ &stmt.Constant{ Position: &position.Position{ StartLine: 86, - EndLine: 86, - StartPos: 1966, - EndPos: 1972, + EndLine: 86, + StartPos: 1966, + EndPos: 1972, }, PhpDocComment: "", ConstantName: &node.Identifier{ Position: &position.Position{ StartLine: 86, - EndLine: 86, - StartPos: 1966, - EndPos: 1970, + EndLine: 86, + StartPos: 1966, + EndPos: 1970, }, Value: "ticks", }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 86, - EndLine: 86, - StartPos: 1972, - EndPos: 1972, + EndLine: 86, + StartPos: 1972, + EndPos: 1972, }, Value: "1", }, @@ -4500,45 +4477,44 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 86, - EndLine: 86, - StartPos: 1975, - EndPos: 1976, - }, - Stmts: []node.Node{ + EndLine: 86, + StartPos: 1975, + EndPos: 1976, }, + Stmts: []node.Node{}, }, }, &stmt.Declare{ Position: &position.Position{ StartLine: 87, - EndLine: 87, - StartPos: 1980, - EndPos: 2008, + EndLine: 87, + StartPos: 1980, + EndPos: 2008, }, Consts: []node.Node{ &stmt.Constant{ Position: &position.Position{ StartLine: 87, - EndLine: 87, - StartPos: 1988, - EndPos: 1994, + EndLine: 87, + StartPos: 1988, + EndPos: 1994, }, PhpDocComment: "", ConstantName: &node.Identifier{ Position: &position.Position{ StartLine: 87, - EndLine: 87, - StartPos: 1988, - EndPos: 1992, + EndLine: 87, + StartPos: 1988, + EndPos: 1992, }, Value: "ticks", }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 87, - EndLine: 87, - StartPos: 1994, - EndPos: 1994, + EndLine: 87, + StartPos: 1994, + EndPos: 1994, }, Value: "1", }, @@ -4547,37 +4523,35 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 87, - EndLine: 87, - StartPos: 1996, - EndPos: 2008, - }, - Stmts: []node.Node{ + EndLine: 87, + StartPos: 1996, + EndPos: 2008, }, + Stmts: []node.Node{}, }, }, &stmt.Do{ Position: &position.Position{ StartLine: 88, - EndLine: 88, - StartPos: 2012, - EndPos: 2026, + EndLine: 88, + StartPos: 2012, + EndPos: 2026, }, Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 88, - EndLine: 88, - StartPos: 2015, - EndPos: 2016, - }, - Stmts: []node.Node{ + EndLine: 88, + StartPos: 2015, + EndPos: 2016, }, + Stmts: []node.Node{}, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 88, - EndLine: 88, - StartPos: 2024, - EndPos: 2024, + EndLine: 88, + StartPos: 2024, + EndPos: 2024, }, Value: "1", }, @@ -4585,24 +4559,24 @@ func TestPhp7(t *testing.T) { &stmt.Echo{ Position: &position.Position{ StartLine: 89, - EndLine: 89, - StartPos: 2030, - EndPos: 2040, + EndLine: 89, + StartPos: 2030, + EndPos: 2040, }, Exprs: []node.Node{ &expr.Variable{ Position: &position.Position{ StartLine: 89, - EndLine: 89, - StartPos: 2035, - EndPos: 2036, + EndLine: 89, + StartPos: 2035, + EndPos: 2036, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 89, - EndLine: 89, - StartPos: 2035, - EndPos: 2036, + EndLine: 89, + StartPos: 2035, + EndPos: 2036, }, Value: "a", }, @@ -4610,9 +4584,9 @@ func TestPhp7(t *testing.T) { &scalar.Lnumber{ Position: &position.Position{ StartLine: 89, - EndLine: 89, - StartPos: 2039, - EndPos: 2039, + EndLine: 89, + StartPos: 2039, + EndPos: 2039, }, Value: "1", }, @@ -4621,24 +4595,24 @@ func TestPhp7(t *testing.T) { &stmt.Echo{ Position: &position.Position{ StartLine: 90, - EndLine: 90, - StartPos: 2044, - EndPos: 2052, + EndLine: 90, + StartPos: 2044, + EndPos: 2052, }, Exprs: []node.Node{ &expr.Variable{ Position: &position.Position{ StartLine: 90, - EndLine: 90, - StartPos: 2049, - EndPos: 2050, + EndLine: 90, + StartPos: 2049, + EndPos: 2050, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 90, - EndLine: 90, - StartPos: 2049, - EndPos: 2050, + EndLine: 90, + StartPos: 2049, + EndPos: 2050, }, Value: "a", }, @@ -4648,31 +4622,31 @@ func TestPhp7(t *testing.T) { &stmt.For{ Position: &position.Position{ StartLine: 91, - EndLine: 91, - StartPos: 2056, - EndPos: 2090, + EndLine: 91, + StartPos: 2056, + EndPos: 2090, }, Init: []node.Node{ &assign.Assign{ Position: &position.Position{ StartLine: 91, - EndLine: 91, - StartPos: 2060, - EndPos: 2065, + EndLine: 91, + StartPos: 2060, + EndPos: 2065, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 91, - EndLine: 91, - StartPos: 2060, - EndPos: 2061, + EndLine: 91, + StartPos: 2060, + EndPos: 2061, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 91, - EndLine: 91, - StartPos: 2060, - EndPos: 2061, + EndLine: 91, + StartPos: 2060, + EndPos: 2061, }, Value: "i", }, @@ -4680,9 +4654,9 @@ func TestPhp7(t *testing.T) { Expression: &scalar.Lnumber{ Position: &position.Position{ StartLine: 91, - EndLine: 91, - StartPos: 2065, - EndPos: 2065, + EndLine: 91, + StartPos: 2065, + EndPos: 2065, }, Value: "0", }, @@ -4692,23 +4666,23 @@ func TestPhp7(t *testing.T) { &binary.Smaller{ Position: &position.Position{ StartLine: 91, - EndLine: 91, - StartPos: 2068, - EndPos: 2074, + EndLine: 91, + StartPos: 2068, + EndPos: 2074, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 91, - EndLine: 91, - StartPos: 2068, - EndPos: 2069, + EndLine: 91, + StartPos: 2068, + EndPos: 2069, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 91, - EndLine: 91, - StartPos: 2068, - EndPos: 2069, + EndLine: 91, + StartPos: 2068, + EndPos: 2069, }, Value: "i", }, @@ -4716,9 +4690,9 @@ func TestPhp7(t *testing.T) { Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 91, - EndLine: 91, - StartPos: 2073, - EndPos: 2074, + EndLine: 91, + StartPos: 2073, + EndPos: 2074, }, Value: "10", }, @@ -4728,23 +4702,23 @@ func TestPhp7(t *testing.T) { &expr.PostInc{ Position: &position.Position{ StartLine: 91, - EndLine: 91, - StartPos: 2077, - EndPos: 2080, + EndLine: 91, + StartPos: 2077, + EndPos: 2080, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 91, - EndLine: 91, - StartPos: 2077, - EndPos: 2078, + EndLine: 91, + StartPos: 2077, + EndPos: 2078, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 91, - EndLine: 91, - StartPos: 2077, - EndPos: 2078, + EndLine: 91, + StartPos: 2077, + EndPos: 2078, }, Value: "i", }, @@ -4753,23 +4727,23 @@ func TestPhp7(t *testing.T) { &expr.PostInc{ Position: &position.Position{ StartLine: 91, - EndLine: 91, - StartPos: 2083, - EndPos: 2086, + EndLine: 91, + StartPos: 2083, + EndPos: 2086, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 91, - EndLine: 91, - StartPos: 2083, - EndPos: 2084, + EndLine: 91, + StartPos: 2083, + EndPos: 2084, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 91, - EndLine: 91, - StartPos: 2083, - EndPos: 2084, + EndLine: 91, + StartPos: 2083, + EndPos: 2084, }, Value: "i", }, @@ -4779,42 +4753,41 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 91, - EndLine: 91, - StartPos: 2089, - EndPos: 2090, - }, - Stmts: []node.Node{ + EndLine: 91, + StartPos: 2089, + EndPos: 2090, }, + Stmts: []node.Node{}, }, }, &stmt.AltFor{ Position: &position.Position{ StartLine: 92, - EndLine: 92, - StartPos: 2094, - EndPos: 2129, + EndLine: 92, + StartPos: 2094, + EndPos: 2129, }, Cond: []node.Node{ &binary.Smaller{ Position: &position.Position{ StartLine: 92, - EndLine: 92, - StartPos: 2100, - EndPos: 2106, + EndLine: 92, + StartPos: 2100, + EndPos: 2106, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 92, - EndLine: 92, - StartPos: 2100, - EndPos: 2101, + EndLine: 92, + StartPos: 2100, + EndPos: 2101, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 92, - EndLine: 92, - StartPos: 2100, - EndPos: 2101, + EndLine: 92, + StartPos: 2100, + EndPos: 2101, }, Value: "i", }, @@ -4822,9 +4795,9 @@ func TestPhp7(t *testing.T) { Right: &scalar.Lnumber{ Position: &position.Position{ StartLine: 92, - EndLine: 92, - StartPos: 2105, - EndPos: 2106, + EndLine: 92, + StartPos: 2105, + EndPos: 2106, }, Value: "10", }, @@ -4834,23 +4807,23 @@ func TestPhp7(t *testing.T) { &expr.PostInc{ Position: &position.Position{ StartLine: 92, - EndLine: 92, - StartPos: 2109, - EndPos: 2112, + EndLine: 92, + StartPos: 2109, + EndPos: 2112, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 92, - EndLine: 92, - StartPos: 2109, - EndPos: 2110, + EndLine: 92, + StartPos: 2109, + EndPos: 2110, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 92, - EndLine: 92, - StartPos: 2109, - EndPos: 2110, + EndLine: 92, + StartPos: 2109, + EndPos: 2110, }, Value: "i", }, @@ -4859,23 +4832,23 @@ func TestPhp7(t *testing.T) { &expr.PostInc{ Position: &position.Position{ StartLine: 92, - EndLine: 92, - StartPos: 2115, - EndPos: 2118, + EndLine: 92, + StartPos: 2115, + EndPos: 2118, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 92, - EndLine: 92, - StartPos: 2115, - EndPos: 2116, + EndLine: 92, + StartPos: 2115, + EndPos: 2116, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 92, - EndLine: 92, - StartPos: 2115, - EndPos: 2116, + EndLine: 92, + StartPos: 2115, + EndPos: 2116, }, Value: "i", }, @@ -4885,34 +4858,33 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - Stmts: []node.Node{ + EndLine: -1, + StartPos: -1, + EndPos: -1, }, + Stmts: []node.Node{}, }, }, &stmt.Foreach{ Position: &position.Position{ StartLine: 93, - EndLine: 93, - StartPos: 2133, - EndPos: 2153, + EndLine: 93, + StartPos: 2133, + EndPos: 2153, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 93, - EndLine: 93, - StartPos: 2142, - EndPos: 2143, + EndLine: 93, + StartPos: 2142, + EndPos: 2143, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 93, - EndLine: 93, - StartPos: 2142, - EndPos: 2143, + EndLine: 93, + StartPos: 2142, + EndPos: 2143, }, Value: "a", }, @@ -4920,16 +4892,16 @@ func TestPhp7(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 93, - EndLine: 93, - StartPos: 2148, - EndPos: 2149, + EndLine: 93, + StartPos: 2148, + EndPos: 2149, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 93, - EndLine: 93, - StartPos: 2148, - EndPos: 2149, + EndLine: 93, + StartPos: 2148, + EndPos: 2149, }, Value: "v", }, @@ -4937,34 +4909,33 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 93, - EndLine: 93, - StartPos: 2152, - EndPos: 2153, - }, - Stmts: []node.Node{ + EndLine: 93, + StartPos: 2152, + EndPos: 2153, }, + Stmts: []node.Node{}, }, }, &stmt.AltForeach{ Position: &position.Position{ StartLine: 94, - EndLine: 94, - StartPos: 2157, - EndPos: 2188, + EndLine: 94, + StartPos: 2157, + EndPos: 2188, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 94, - EndLine: 94, - StartPos: 2166, - EndPos: 2167, + EndLine: 94, + StartPos: 2166, + EndPos: 2167, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 94, - EndLine: 94, - StartPos: 2166, - EndPos: 2167, + EndLine: 94, + StartPos: 2166, + EndPos: 2167, }, Value: "a", }, @@ -4972,16 +4943,16 @@ func TestPhp7(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 94, - EndLine: 94, - StartPos: 2172, - EndPos: 2173, + EndLine: 94, + StartPos: 2172, + EndPos: 2173, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 94, - EndLine: 94, - StartPos: 2172, - EndPos: 2173, + EndLine: 94, + StartPos: 2172, + EndPos: 2173, }, Value: "v", }, @@ -4989,34 +4960,33 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - Stmts: []node.Node{ + EndLine: -1, + StartPos: -1, + EndPos: -1, }, + Stmts: []node.Node{}, }, }, &stmt.Foreach{ Position: &position.Position{ StartLine: 95, - EndLine: 95, - StartPos: 2192, - EndPos: 2218, + EndLine: 95, + StartPos: 2192, + EndPos: 2218, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 95, - EndLine: 95, - StartPos: 2201, - EndPos: 2202, + EndLine: 95, + StartPos: 2201, + EndPos: 2202, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 95, - EndLine: 95, - StartPos: 2201, - EndPos: 2202, + EndLine: 95, + StartPos: 2201, + EndPos: 2202, }, Value: "a", }, @@ -5024,16 +4994,16 @@ func TestPhp7(t *testing.T) { Key: &expr.Variable{ Position: &position.Position{ StartLine: 95, - EndLine: 95, - StartPos: 2207, - EndPos: 2208, + EndLine: 95, + StartPos: 2207, + EndPos: 2208, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 95, - EndLine: 95, - StartPos: 2207, - EndPos: 2208, + EndLine: 95, + StartPos: 2207, + EndPos: 2208, }, Value: "k", }, @@ -5041,16 +5011,16 @@ func TestPhp7(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 95, - EndLine: 95, - StartPos: 2213, - EndPos: 2214, + EndLine: 95, + StartPos: 2213, + EndPos: 2214, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 95, - EndLine: 95, - StartPos: 2213, - EndPos: 2214, + EndLine: 95, + StartPos: 2213, + EndPos: 2214, }, Value: "v", }, @@ -5058,34 +5028,33 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 95, - EndLine: 95, - StartPos: 2217, - EndPos: 2218, - }, - Stmts: []node.Node{ + EndLine: 95, + StartPos: 2217, + EndPos: 2218, }, + Stmts: []node.Node{}, }, }, &stmt.Foreach{ Position: &position.Position{ StartLine: 96, - EndLine: 96, - StartPos: 2222, - EndPos: 2249, + EndLine: 96, + StartPos: 2222, + EndPos: 2249, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 96, - EndLine: 96, - StartPos: 2231, - EndPos: 2232, + EndLine: 96, + StartPos: 2231, + EndPos: 2232, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 96, - EndLine: 96, - StartPos: 2231, - EndPos: 2232, + EndLine: 96, + StartPos: 2231, + EndPos: 2232, }, Value: "a", }, @@ -5093,16 +5062,16 @@ func TestPhp7(t *testing.T) { Key: &expr.Variable{ Position: &position.Position{ StartLine: 96, - EndLine: 96, - StartPos: 2237, - EndPos: 2238, + EndLine: 96, + StartPos: 2237, + EndPos: 2238, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 96, - EndLine: 96, - StartPos: 2237, - EndPos: 2238, + EndLine: 96, + StartPos: 2237, + EndPos: 2238, }, Value: "k", }, @@ -5110,23 +5079,23 @@ func TestPhp7(t *testing.T) { Variable: &expr.Reference{ Position: &position.Position{ StartLine: 96, - EndLine: 96, - StartPos: 2243, - EndPos: 2245, + EndLine: 96, + StartPos: 2243, + EndPos: 2245, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 96, - EndLine: 96, - StartPos: 2244, - EndPos: 2245, + EndLine: 96, + StartPos: 2244, + EndPos: 2245, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 96, - EndLine: 96, - StartPos: 2244, - EndPos: 2245, + EndLine: 96, + StartPos: 2244, + EndPos: 2245, }, Value: "v", }, @@ -5135,34 +5104,33 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 96, - EndLine: 96, - StartPos: 2248, - EndPos: 2249, - }, - Stmts: []node.Node{ + EndLine: 96, + StartPos: 2248, + EndPos: 2249, }, + Stmts: []node.Node{}, }, }, &stmt.Foreach{ Position: &position.Position{ StartLine: 97, - EndLine: 97, - StartPos: 2253, - EndPos: 2285, + EndLine: 97, + StartPos: 2253, + EndPos: 2285, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 97, - EndLine: 97, - StartPos: 2262, - EndPos: 2263, + EndLine: 97, + StartPos: 2262, + EndPos: 2263, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 97, - EndLine: 97, - StartPos: 2262, - EndPos: 2263, + EndLine: 97, + StartPos: 2262, + EndPos: 2263, }, Value: "a", }, @@ -5170,16 +5138,16 @@ func TestPhp7(t *testing.T) { Key: &expr.Variable{ Position: &position.Position{ StartLine: 97, - EndLine: 97, - StartPos: 2268, - EndPos: 2269, + EndLine: 97, + StartPos: 2268, + EndPos: 2269, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 97, - EndLine: 97, - StartPos: 2268, - EndPos: 2269, + EndLine: 97, + StartPos: 2268, + EndPos: 2269, }, Value: "k", }, @@ -5187,31 +5155,31 @@ func TestPhp7(t *testing.T) { Variable: &expr.List{ Position: &position.Position{ StartLine: 97, - EndLine: 97, - StartPos: 2274, - EndPos: 2281, + EndLine: 97, + StartPos: 2274, + EndPos: 2281, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 97, - EndLine: 97, - StartPos: 2279, - EndPos: 2280, + EndLine: 97, + StartPos: 2279, + EndPos: 2280, }, Val: &expr.Variable{ Position: &position.Position{ StartLine: 97, - EndLine: 97, - StartPos: 2279, - EndPos: 2280, + EndLine: 97, + StartPos: 2279, + EndPos: 2280, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 97, - EndLine: 97, - StartPos: 2279, - EndPos: 2280, + EndLine: 97, + StartPos: 2279, + EndPos: 2280, }, Value: "v", }, @@ -5222,34 +5190,33 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 97, - EndLine: 97, - StartPos: 2284, - EndPos: 2285, - }, - Stmts: []node.Node{ + EndLine: 97, + StartPos: 2284, + EndPos: 2285, }, + Stmts: []node.Node{}, }, }, &stmt.Foreach{ Position: &position.Position{ StartLine: 98, - EndLine: 98, - StartPos: 2289, - EndPos: 2317, + EndLine: 98, + StartPos: 2289, + EndPos: 2317, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 98, - EndLine: 98, - StartPos: 2298, - EndPos: 2299, + EndLine: 98, + StartPos: 2298, + EndPos: 2299, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 98, - EndLine: 98, - StartPos: 2298, - EndPos: 2299, + EndLine: 98, + StartPos: 2298, + EndPos: 2299, }, Value: "a", }, @@ -5257,16 +5224,16 @@ func TestPhp7(t *testing.T) { Key: &expr.Variable{ Position: &position.Position{ StartLine: 98, - EndLine: 98, - StartPos: 2304, - EndPos: 2305, + EndLine: 98, + StartPos: 2304, + EndPos: 2305, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 98, - EndLine: 98, - StartPos: 2304, - EndPos: 2305, + EndLine: 98, + StartPos: 2304, + EndPos: 2305, }, Value: "k", }, @@ -5274,31 +5241,31 @@ func TestPhp7(t *testing.T) { Variable: &expr.ShortList{ Position: &position.Position{ StartLine: 98, - EndLine: 98, - StartPos: 2310, - EndPos: 2313, + EndLine: 98, + StartPos: 2310, + EndPos: 2313, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 98, - EndLine: 98, - StartPos: 2311, - EndPos: 2312, + EndLine: 98, + StartPos: 2311, + EndPos: 2312, }, Val: &expr.Variable{ Position: &position.Position{ StartLine: 98, - EndLine: 98, - StartPos: 2311, - EndPos: 2312, + EndLine: 98, + StartPos: 2311, + EndPos: 2312, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 98, - EndLine: 98, - StartPos: 2311, - EndPos: 2312, + EndLine: 98, + StartPos: 2311, + EndPos: 2312, }, Value: "v", }, @@ -5309,50 +5276,48 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 98, - EndLine: 98, - StartPos: 2316, - EndPos: 2317, - }, - Stmts: []node.Node{ + EndLine: 98, + StartPos: 2316, + EndPos: 2317, }, + Stmts: []node.Node{}, }, }, &stmt.Function{ Position: &position.Position{ StartLine: 99, - EndLine: 99, - StartPos: 2321, - EndPos: 2337, + EndLine: 99, + StartPos: 2321, + EndPos: 2337, }, - ReturnsRef: false, + ReturnsRef: false, PhpDocComment: "", FunctionName: &node.Identifier{ Position: &position.Position{ StartLine: 99, - EndLine: 99, - StartPos: 2330, - EndPos: 2332, + EndLine: 99, + StartPos: 2330, + EndPos: 2332, }, Value: "foo", }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, &stmt.Function{ Position: &position.Position{ StartLine: 100, - EndLine: 100, - StartPos: 2341, - EndPos: 2364, + EndLine: 100, + StartPos: 2341, + EndPos: 2364, }, - ReturnsRef: false, + ReturnsRef: false, PhpDocComment: "", FunctionName: &node.Identifier{ Position: &position.Position{ StartLine: 100, - EndLine: 100, - StartPos: 2350, - EndPos: 2352, + EndLine: 100, + StartPos: 2350, + EndPos: 2352, }, Value: "foo", }, @@ -5360,9 +5325,9 @@ func TestPhp7(t *testing.T) { &stmt.Return{ Position: &position.Position{ StartLine: 100, - EndLine: 100, - StartPos: 2357, - EndPos: 2363, + EndLine: 100, + StartPos: 2357, + EndPos: 2363, }, }, }, @@ -5370,18 +5335,18 @@ func TestPhp7(t *testing.T) { &stmt.Function{ Position: &position.Position{ StartLine: 101, - EndLine: 101, - StartPos: 2368, - EndPos: 2394, + EndLine: 101, + StartPos: 2368, + EndPos: 2394, }, - ReturnsRef: true, + ReturnsRef: true, PhpDocComment: "", FunctionName: &node.Identifier{ Position: &position.Position{ StartLine: 101, - EndLine: 101, - StartPos: 2378, - EndPos: 2380, + EndLine: 101, + StartPos: 2378, + EndPos: 2380, }, Value: "foo", }, @@ -5389,16 +5354,16 @@ func TestPhp7(t *testing.T) { &stmt.Return{ Position: &position.Position{ StartLine: 101, - EndLine: 101, - StartPos: 2385, - EndPos: 2393, + EndLine: 101, + StartPos: 2385, + EndPos: 2393, }, Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 101, - EndLine: 101, - StartPos: 2392, - EndPos: 2392, + EndLine: 101, + StartPos: 2392, + EndPos: 2392, }, Value: "1", }, @@ -5408,64 +5373,63 @@ func TestPhp7(t *testing.T) { &stmt.Function{ Position: &position.Position{ StartLine: 102, - EndLine: 102, - StartPos: 2398, - EndPos: 2421, + EndLine: 102, + StartPos: 2398, + EndPos: 2421, }, - ReturnsRef: true, + ReturnsRef: true, PhpDocComment: "", FunctionName: &node.Identifier{ Position: &position.Position{ StartLine: 102, - EndLine: 102, - StartPos: 2408, - EndPos: 2410, + EndLine: 102, + StartPos: 2408, + EndPos: 2410, }, Value: "foo", }, ReturnType: &name.Name{ Position: &position.Position{ StartLine: 102, - EndLine: 102, - StartPos: 2415, - EndPos: 2418, + EndLine: 102, + StartPos: 2415, + EndPos: 2418, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 102, - EndLine: 102, - StartPos: 2415, - EndPos: 2418, + EndLine: 102, + StartPos: 2415, + EndPos: 2418, }, Value: "void", }, }, }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, &stmt.Global{ Position: &position.Position{ StartLine: 103, - EndLine: 103, - StartPos: 2425, - EndPos: 2438, + EndLine: 103, + StartPos: 2425, + EndPos: 2438, }, Vars: []node.Node{ &expr.Variable{ Position: &position.Position{ StartLine: 103, - EndLine: 103, - StartPos: 2432, - EndPos: 2433, + EndLine: 103, + StartPos: 2432, + EndPos: 2433, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 103, - EndLine: 103, - StartPos: 2432, - EndPos: 2433, + EndLine: 103, + StartPos: 2432, + EndPos: 2433, }, Value: "a", }, @@ -5473,16 +5437,16 @@ func TestPhp7(t *testing.T) { &expr.Variable{ Position: &position.Position{ StartLine: 103, - EndLine: 103, - StartPos: 2436, - EndPos: 2437, + EndLine: 103, + StartPos: 2436, + EndPos: 2437, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 103, - EndLine: 103, - StartPos: 2436, - EndPos: 2437, + EndLine: 103, + StartPos: 2436, + EndPos: 2437, }, Value: "b", }, @@ -5492,16 +5456,16 @@ func TestPhp7(t *testing.T) { &stmt.Label{ Position: &position.Position{ StartLine: 104, - EndLine: 104, - StartPos: 2442, - EndPos: 2443, + EndLine: 104, + StartPos: 2442, + EndPos: 2443, }, LabelName: &node.Identifier{ Position: &position.Position{ StartLine: 104, - EndLine: 104, - StartPos: 2442, - EndPos: 2442, + EndLine: 104, + StartPos: 2442, + EndPos: 2442, }, Value: "a", }, @@ -5509,16 +5473,16 @@ func TestPhp7(t *testing.T) { &stmt.Goto{ Position: &position.Position{ StartLine: 105, - EndLine: 105, - StartPos: 2448, - EndPos: 2454, + EndLine: 105, + StartPos: 2448, + EndPos: 2454, }, Label: &node.Identifier{ Position: &position.Position{ StartLine: 105, - EndLine: 105, - StartPos: 2453, - EndPos: 2453, + EndLine: 105, + StartPos: 2453, + EndPos: 2453, }, Value: "a", }, @@ -5526,31 +5490,31 @@ func TestPhp7(t *testing.T) { &stmt.HaltCompiler{ Position: &position.Position{ StartLine: 106, - EndLine: 106, - StartPos: 2458, - EndPos: 2475, + EndLine: 106, + StartPos: 2458, + EndPos: 2475, }, }, &stmt.If{ Position: &position.Position{ StartLine: 107, - EndLine: 107, - StartPos: 2479, - EndPos: 2488, + EndLine: 107, + StartPos: 2479, + EndPos: 2488, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 107, - EndLine: 107, - StartPos: 2483, - EndPos: 2484, + EndLine: 107, + StartPos: 2483, + EndPos: 2484, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 107, - EndLine: 107, - StartPos: 2483, - EndPos: 2484, + EndLine: 107, + StartPos: 2483, + EndPos: 2484, }, Value: "a", }, @@ -5558,34 +5522,33 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 107, - EndLine: 107, - StartPos: 2487, - EndPos: 2488, - }, - Stmts: []node.Node{ + EndLine: 107, + StartPos: 2487, + EndPos: 2488, }, + Stmts: []node.Node{}, }, }, &stmt.If{ Position: &position.Position{ StartLine: 108, - EndLine: 108, - StartPos: 2492, - EndPos: 2516, + EndLine: 108, + StartPos: 2492, + EndPos: 2516, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 108, - EndLine: 108, - StartPos: 2496, - EndPos: 2497, + EndLine: 108, + StartPos: 2496, + EndPos: 2497, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 108, - EndLine: 108, - StartPos: 2496, - EndPos: 2497, + EndLine: 108, + StartPos: 2496, + EndPos: 2497, }, Value: "a", }, @@ -5593,34 +5556,33 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 108, - EndLine: 108, - StartPos: 2500, - EndPos: 2501, - }, - Stmts: []node.Node{ + EndLine: 108, + StartPos: 2500, + EndPos: 2501, }, + Stmts: []node.Node{}, }, ElseIf: []node.Node{ &stmt.ElseIf{ Position: &position.Position{ StartLine: 108, - EndLine: 108, - StartPos: 2503, - EndPos: 2516, + EndLine: 108, + StartPos: 2503, + EndPos: 2516, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 108, - EndLine: 108, - StartPos: 2511, - EndPos: 2512, + EndLine: 108, + StartPos: 2511, + EndPos: 2512, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 108, - EndLine: 108, - StartPos: 2511, - EndPos: 2512, + EndLine: 108, + StartPos: 2511, + EndPos: 2512, }, Value: "b", }, @@ -5628,12 +5590,11 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 108, - EndLine: 108, - StartPos: 2515, - EndPos: 2516, - }, - Stmts: []node.Node{ + EndLine: 108, + StartPos: 2515, + EndPos: 2516, }, + Stmts: []node.Node{}, }, }, }, @@ -5641,23 +5602,23 @@ func TestPhp7(t *testing.T) { &stmt.If{ Position: &position.Position{ StartLine: 109, - EndLine: 109, - StartPos: 2520, - EndPos: 2537, + EndLine: 109, + StartPos: 2520, + EndPos: 2537, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 109, - EndLine: 109, - StartPos: 2524, - EndPos: 2525, + EndLine: 109, + StartPos: 2524, + EndPos: 2525, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 109, - EndLine: 109, - StartPos: 2524, - EndPos: 2525, + EndLine: 109, + StartPos: 2524, + EndPos: 2525, }, Value: "a", }, @@ -5665,52 +5626,50 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 109, - EndLine: 109, - StartPos: 2528, - EndPos: 2529, - }, - Stmts: []node.Node{ + EndLine: 109, + StartPos: 2528, + EndPos: 2529, }, + Stmts: []node.Node{}, }, Else: &stmt.Else{ Position: &position.Position{ StartLine: 109, - EndLine: 109, - StartPos: 2531, - EndPos: 2537, + EndLine: 109, + StartPos: 2531, + EndPos: 2537, }, Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 109, - EndLine: 109, - StartPos: 2536, - EndPos: 2537, - }, - Stmts: []node.Node{ + EndLine: 109, + StartPos: 2536, + EndPos: 2537, }, + Stmts: []node.Node{}, }, }, }, &stmt.If{ Position: &position.Position{ StartLine: 110, - EndLine: 110, - StartPos: 2541, - EndPos: 2588, + EndLine: 110, + StartPos: 2541, + EndPos: 2588, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 110, - EndLine: 110, - StartPos: 2545, - EndPos: 2546, + EndLine: 110, + StartPos: 2545, + EndPos: 2546, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 110, - EndLine: 110, - StartPos: 2545, - EndPos: 2546, + EndLine: 110, + StartPos: 2545, + EndPos: 2546, }, Value: "a", }, @@ -5718,34 +5677,33 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 110, - EndLine: 110, - StartPos: 2549, - EndPos: 2550, - }, - Stmts: []node.Node{ + EndLine: 110, + StartPos: 2549, + EndPos: 2550, }, + Stmts: []node.Node{}, }, ElseIf: []node.Node{ &stmt.ElseIf{ Position: &position.Position{ StartLine: 110, - EndLine: 110, - StartPos: 2552, - EndPos: 2565, + EndLine: 110, + StartPos: 2552, + EndPos: 2565, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 110, - EndLine: 110, - StartPos: 2560, - EndPos: 2561, + EndLine: 110, + StartPos: 2560, + EndPos: 2561, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 110, - EndLine: 110, - StartPos: 2560, - EndPos: 2561, + EndLine: 110, + StartPos: 2560, + EndPos: 2561, }, Value: "b", }, @@ -5753,34 +5711,33 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 110, - EndLine: 110, - StartPos: 2564, - EndPos: 2565, - }, - Stmts: []node.Node{ + EndLine: 110, + StartPos: 2564, + EndPos: 2565, }, + Stmts: []node.Node{}, }, }, &stmt.ElseIf{ Position: &position.Position{ StartLine: 110, - EndLine: 110, - StartPos: 2567, - EndPos: 2580, + EndLine: 110, + StartPos: 2567, + EndPos: 2580, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 110, - EndLine: 110, - StartPos: 2575, - EndPos: 2576, + EndLine: 110, + StartPos: 2575, + EndPos: 2576, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 110, - EndLine: 110, - StartPos: 2575, - EndPos: 2576, + EndLine: 110, + StartPos: 2575, + EndPos: 2576, }, Value: "c", }, @@ -5788,54 +5745,52 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 110, - EndLine: 110, - StartPos: 2579, - EndPos: 2580, - }, - Stmts: []node.Node{ + EndLine: 110, + StartPos: 2579, + EndPos: 2580, }, + Stmts: []node.Node{}, }, }, }, Else: &stmt.Else{ Position: &position.Position{ StartLine: 110, - EndLine: 110, - StartPos: 2582, - EndPos: 2588, + EndLine: 110, + StartPos: 2582, + EndPos: 2588, }, Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 110, - EndLine: 110, - StartPos: 2587, - EndPos: 2588, - }, - Stmts: []node.Node{ + EndLine: 110, + StartPos: 2587, + EndPos: 2588, }, + Stmts: []node.Node{}, }, }, }, &stmt.If{ Position: &position.Position{ StartLine: 111, - EndLine: 111, - StartPos: 2592, - EndPos: 2640, + EndLine: 111, + StartPos: 2592, + EndPos: 2640, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 111, - EndLine: 111, - StartPos: 2596, - EndPos: 2597, + EndLine: 111, + StartPos: 2596, + EndPos: 2597, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 111, - EndLine: 111, - StartPos: 2596, - EndPos: 2597, + EndLine: 111, + StartPos: 2596, + EndPos: 2597, }, Value: "a", }, @@ -5843,34 +5798,33 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 111, - EndLine: 111, - StartPos: 2600, - EndPos: 2601, - }, - Stmts: []node.Node{ + EndLine: 111, + StartPos: 2600, + EndPos: 2601, }, + Stmts: []node.Node{}, }, ElseIf: []node.Node{ &stmt.ElseIf{ Position: &position.Position{ StartLine: 111, - EndLine: 111, - StartPos: 2603, - EndPos: 2616, + EndLine: 111, + StartPos: 2603, + EndPos: 2616, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 111, - EndLine: 111, - StartPos: 2611, - EndPos: 2612, + EndLine: 111, + StartPos: 2611, + EndPos: 2612, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 111, - EndLine: 111, - StartPos: 2611, - EndPos: 2612, + EndLine: 111, + StartPos: 2611, + EndPos: 2612, }, Value: "b", }, @@ -5878,42 +5832,41 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 111, - EndLine: 111, - StartPos: 2615, - EndPos: 2616, - }, - Stmts: []node.Node{ + EndLine: 111, + StartPos: 2615, + EndPos: 2616, }, + Stmts: []node.Node{}, }, }, }, Else: &stmt.Else{ Position: &position.Position{ StartLine: 111, - EndLine: 111, - StartPos: 2618, - EndPos: 2640, + EndLine: 111, + StartPos: 2618, + EndPos: 2640, }, Stmt: &stmt.If{ Position: &position.Position{ StartLine: 111, - EndLine: 111, - StartPos: 2623, - EndPos: 2640, + EndLine: 111, + StartPos: 2623, + EndPos: 2640, }, Cond: &expr.Variable{ Position: &position.Position{ StartLine: 111, - EndLine: 111, - StartPos: 2627, - EndPos: 2628, + EndLine: 111, + StartPos: 2627, + EndPos: 2628, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 111, - EndLine: 111, - StartPos: 2627, - EndPos: 2628, + EndLine: 111, + StartPos: 2627, + EndPos: 2628, }, Value: "c", }, @@ -5921,29 +5874,27 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 111, - EndLine: 111, - StartPos: 2631, - EndPos: 2632, - }, - Stmts: []node.Node{ + EndLine: 111, + StartPos: 2631, + EndPos: 2632, }, + Stmts: []node.Node{}, }, Else: &stmt.Else{ Position: &position.Position{ StartLine: 111, - EndLine: 111, - StartPos: 2634, - EndPos: 2640, + EndLine: 111, + StartPos: 2634, + EndPos: 2640, }, Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 111, - EndLine: 111, - StartPos: 2639, - EndPos: 2640, - }, - Stmts: []node.Node{ + EndLine: 111, + StartPos: 2639, + EndPos: 2640, }, + Stmts: []node.Node{}, }, }, }, @@ -5952,79 +5903,78 @@ func TestPhp7(t *testing.T) { &stmt.Nop{ Position: &position.Position{ StartLine: 112, - EndLine: 112, - StartPos: 2644, - EndPos: 2645, + EndLine: 112, + StartPos: 2644, + EndPos: 2645, }, }, &stmt.InlineHtml{ Position: &position.Position{ StartLine: 112, - EndLine: 112, - StartPos: 2647, - EndPos: 2658, + EndLine: 112, + StartPos: 2647, + EndPos: 2658, }, Value: "
", }, &stmt.Interface{ Position: &position.Position{ StartLine: 113, - EndLine: 113, - StartPos: 2664, - EndPos: 2679, + EndLine: 113, + StartPos: 2664, + EndPos: 2679, }, PhpDocComment: "", InterfaceName: &node.Identifier{ Position: &position.Position{ StartLine: 113, - EndLine: 113, - StartPos: 2674, - EndPos: 2676, + EndLine: 113, + StartPos: 2674, + EndPos: 2676, }, Value: "Foo", }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, &stmt.Interface{ Position: &position.Position{ StartLine: 114, - EndLine: 114, - StartPos: 2683, - EndPos: 2710, + EndLine: 114, + StartPos: 2683, + EndPos: 2710, }, PhpDocComment: "", InterfaceName: &node.Identifier{ Position: &position.Position{ StartLine: 114, - EndLine: 114, - StartPos: 2693, - EndPos: 2695, + EndLine: 114, + StartPos: 2693, + EndPos: 2695, }, Value: "Foo", }, Extends: &stmt.InterfaceExtends{ Position: &position.Position{ StartLine: 114, - EndLine: 114, - StartPos: 2697, - EndPos: 2707, + EndLine: 114, + StartPos: 2697, + EndPos: 2707, }, InterfaceNames: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 114, - EndLine: 114, - StartPos: 2705, - EndPos: 2707, + EndLine: 114, + StartPos: 2705, + EndPos: 2707, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 114, - EndLine: 114, - StartPos: 2705, - EndPos: 2707, + EndLine: 114, + StartPos: 2705, + EndPos: 2707, }, Value: "Bar", }, @@ -6032,48 +5982,47 @@ func TestPhp7(t *testing.T) { }, }, }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, &stmt.Interface{ Position: &position.Position{ StartLine: 115, - EndLine: 115, - StartPos: 2714, - EndPos: 2746, + EndLine: 115, + StartPos: 2714, + EndPos: 2746, }, PhpDocComment: "", InterfaceName: &node.Identifier{ Position: &position.Position{ StartLine: 115, - EndLine: 115, - StartPos: 2724, - EndPos: 2726, + EndLine: 115, + StartPos: 2724, + EndPos: 2726, }, Value: "Foo", }, Extends: &stmt.InterfaceExtends{ Position: &position.Position{ StartLine: 115, - EndLine: 115, - StartPos: 2728, - EndPos: 2743, + EndLine: 115, + StartPos: 2728, + EndPos: 2743, }, InterfaceNames: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 115, - EndLine: 115, - StartPos: 2736, - EndPos: 2738, + EndLine: 115, + StartPos: 2736, + EndPos: 2738, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 115, - EndLine: 115, - StartPos: 2736, - EndPos: 2738, + EndLine: 115, + StartPos: 2736, + EndPos: 2738, }, Value: "Bar", }, @@ -6082,17 +6031,17 @@ func TestPhp7(t *testing.T) { &name.Name{ Position: &position.Position{ StartLine: 115, - EndLine: 115, - StartPos: 2741, - EndPos: 2743, + EndLine: 115, + StartPos: 2741, + EndPos: 2743, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 115, - EndLine: 115, - StartPos: 2741, - EndPos: 2743, + EndLine: 115, + StartPos: 2741, + EndPos: 2743, }, Value: "Baz", }, @@ -6100,30 +6049,29 @@ func TestPhp7(t *testing.T) { }, }, }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, &stmt.Namespace{ Position: &position.Position{ StartLine: 116, - EndLine: 116, - StartPos: 2750, - EndPos: 2763, + EndLine: 116, + StartPos: 2750, + EndPos: 2763, }, NamespaceName: &name.Name{ Position: &position.Position{ StartLine: 116, - EndLine: 116, - StartPos: 2760, - EndPos: 2762, + EndLine: 116, + StartPos: 2760, + EndPos: 2762, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 116, - EndLine: 116, - StartPos: 2760, - EndPos: 2762, + EndLine: 116, + StartPos: 2760, + EndPos: 2762, }, Value: "Foo", }, @@ -6133,56 +6081,54 @@ func TestPhp7(t *testing.T) { &stmt.Namespace{ Position: &position.Position{ StartLine: 117, - EndLine: 117, - StartPos: 2767, - EndPos: 2782, + EndLine: 117, + StartPos: 2767, + EndPos: 2782, }, NamespaceName: &name.Name{ Position: &position.Position{ StartLine: 117, - EndLine: 117, - StartPos: 2777, - EndPos: 2779, + EndLine: 117, + StartPos: 2777, + EndPos: 2779, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 117, - EndLine: 117, - StartPos: 2777, - EndPos: 2779, + EndLine: 117, + StartPos: 2777, + EndPos: 2779, }, Value: "Foo", }, }, }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, &stmt.Namespace{ Position: &position.Position{ StartLine: 118, - EndLine: 118, - StartPos: 2786, - EndPos: 2797, - }, - Stmts: []node.Node{ + EndLine: 118, + StartPos: 2786, + EndPos: 2797, }, + Stmts: []node.Node{}, }, &stmt.Class{ Position: &position.Position{ StartLine: 119, - EndLine: 119, - StartPos: 2801, - EndPos: 2819, + EndLine: 119, + StartPos: 2801, + EndPos: 2819, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 119, - EndLine: 119, - StartPos: 2807, - EndPos: 2809, + EndLine: 119, + StartPos: 2807, + EndPos: 2809, }, Value: "foo", }, @@ -6190,17 +6136,17 @@ func TestPhp7(t *testing.T) { &stmt.PropertyList{ Position: &position.Position{ StartLine: 119, - EndLine: 119, - StartPos: 2812, - EndPos: 2818, + EndLine: 119, + StartPos: 2812, + EndPos: 2818, }, Modifiers: []node.Node{ &node.Identifier{ Position: &position.Position{ StartLine: 119, - EndLine: 119, - StartPos: 2812, - EndPos: 2814, + EndLine: 119, + StartPos: 2812, + EndPos: 2814, }, Value: "var", }, @@ -6209,24 +6155,24 @@ func TestPhp7(t *testing.T) { &stmt.Property{ Position: &position.Position{ StartLine: 119, - EndLine: 119, - StartPos: 2816, - EndPos: 2817, + EndLine: 119, + StartPos: 2816, + EndPos: 2817, }, PhpDocComment: "", Variable: &expr.Variable{ Position: &position.Position{ StartLine: 119, - EndLine: 119, - StartPos: 2816, - EndPos: 2817, + EndLine: 119, + StartPos: 2816, + EndPos: 2817, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 119, - EndLine: 119, - StartPos: 2816, - EndPos: 2817, + EndLine: 119, + StartPos: 2816, + EndPos: 2817, }, Value: "a", }, @@ -6239,17 +6185,17 @@ func TestPhp7(t *testing.T) { &stmt.Class{ Position: &position.Position{ StartLine: 120, - EndLine: 120, - StartPos: 2823, - EndPos: 2859, + EndLine: 120, + StartPos: 2823, + EndPos: 2859, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 120, - EndLine: 120, - StartPos: 2829, - EndPos: 2831, + EndLine: 120, + StartPos: 2829, + EndPos: 2831, }, Value: "foo", }, @@ -6257,26 +6203,26 @@ func TestPhp7(t *testing.T) { &stmt.PropertyList{ Position: &position.Position{ StartLine: 120, - EndLine: 120, - StartPos: 2834, - EndPos: 2858, + EndLine: 120, + StartPos: 2834, + EndPos: 2858, }, Modifiers: []node.Node{ &node.Identifier{ Position: &position.Position{ StartLine: 120, - EndLine: 120, - StartPos: 2834, - EndPos: 2839, + EndLine: 120, + StartPos: 2834, + EndPos: 2839, }, Value: "public", }, &node.Identifier{ Position: &position.Position{ StartLine: 120, - EndLine: 120, - StartPos: 2841, - EndPos: 2846, + EndLine: 120, + StartPos: 2841, + EndPos: 2846, }, Value: "static", }, @@ -6285,24 +6231,24 @@ func TestPhp7(t *testing.T) { &stmt.Property{ Position: &position.Position{ StartLine: 120, - EndLine: 120, - StartPos: 2848, - EndPos: 2849, + EndLine: 120, + StartPos: 2848, + EndPos: 2849, }, PhpDocComment: "", Variable: &expr.Variable{ Position: &position.Position{ StartLine: 120, - EndLine: 120, - StartPos: 2848, - EndPos: 2849, + EndLine: 120, + StartPos: 2848, + EndPos: 2849, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 120, - EndLine: 120, - StartPos: 2848, - EndPos: 2849, + EndLine: 120, + StartPos: 2848, + EndPos: 2849, }, Value: "a", }, @@ -6311,24 +6257,24 @@ func TestPhp7(t *testing.T) { &stmt.Property{ Position: &position.Position{ StartLine: 120, - EndLine: 120, - StartPos: 2852, - EndPos: 2857, + EndLine: 120, + StartPos: 2852, + EndPos: 2857, }, PhpDocComment: "", Variable: &expr.Variable{ Position: &position.Position{ StartLine: 120, - EndLine: 120, - StartPos: 2852, - EndPos: 2853, + EndLine: 120, + StartPos: 2852, + EndPos: 2853, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 120, - EndLine: 120, - StartPos: 2852, - EndPos: 2853, + EndLine: 120, + StartPos: 2852, + EndPos: 2853, }, Value: "b", }, @@ -6336,9 +6282,9 @@ func TestPhp7(t *testing.T) { Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 120, - EndLine: 120, - StartPos: 2857, - EndPos: 2857, + EndLine: 120, + StartPos: 2857, + EndPos: 2857, }, Value: "1", }, @@ -6350,31 +6296,31 @@ func TestPhp7(t *testing.T) { &stmt.Static{ Position: &position.Position{ StartLine: 121, - EndLine: 121, - StartPos: 2863, - EndPos: 2880, + EndLine: 121, + StartPos: 2863, + EndPos: 2880, }, Vars: []node.Node{ &stmt.StaticVar{ Position: &position.Position{ StartLine: 121, - EndLine: 121, - StartPos: 2870, - EndPos: 2871, + EndLine: 121, + StartPos: 2870, + EndPos: 2871, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 121, - EndLine: 121, - StartPos: 2870, - EndPos: 2871, + EndLine: 121, + StartPos: 2870, + EndPos: 2871, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 121, - EndLine: 121, - StartPos: 2870, - EndPos: 2871, + EndLine: 121, + StartPos: 2870, + EndPos: 2871, }, Value: "a", }, @@ -6383,23 +6329,23 @@ func TestPhp7(t *testing.T) { &stmt.StaticVar{ Position: &position.Position{ StartLine: 121, - EndLine: 121, - StartPos: 2874, - EndPos: 2879, + EndLine: 121, + StartPos: 2874, + EndPos: 2879, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 121, - EndLine: 121, - StartPos: 2874, - EndPos: 2875, + EndLine: 121, + StartPos: 2874, + EndPos: 2875, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 121, - EndLine: 121, - StartPos: 2874, - EndPos: 2875, + EndLine: 121, + StartPos: 2874, + EndPos: 2875, }, Value: "b", }, @@ -6407,9 +6353,9 @@ func TestPhp7(t *testing.T) { Expr: &scalar.Lnumber{ Position: &position.Position{ StartLine: 121, - EndLine: 121, - StartPos: 2879, - EndPos: 2879, + EndLine: 121, + StartPos: 2879, + EndPos: 2879, }, Value: "1", }, @@ -6419,74 +6365,71 @@ func TestPhp7(t *testing.T) { &stmt.AltSwitch{ Position: &position.Position{ StartLine: 123, - EndLine: 127, - StartPos: 2885, - EndPos: 2943, + EndLine: 127, + StartPos: 2885, + EndPos: 2943, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 123, - EndLine: 123, - StartPos: 2893, - EndPos: 2893, + EndLine: 123, + StartPos: 2893, + EndPos: 2893, }, Value: "1", }, CaseList: &stmt.CaseList{ Position: &position.Position{ StartLine: 124, - EndLine: -1, - StartPos: 2901, - EndPos: -1, + EndLine: -1, + StartPos: 2901, + EndPos: -1, }, Cases: []node.Node{ &stmt.Case{ Position: &position.Position{ StartLine: 124, - EndLine: -1, - StartPos: 2901, - EndPos: -1, + EndLine: -1, + StartPos: 2901, + EndPos: -1, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 124, - EndLine: 124, - StartPos: 2906, - EndPos: 2906, + EndLine: 124, + StartPos: 2906, + EndPos: 2906, }, Value: "1", }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, &stmt.Default{ Position: &position.Position{ StartLine: 125, - EndLine: -1, - StartPos: 2912, - EndPos: -1, - }, - Stmts: []node.Node{ + EndLine: -1, + StartPos: 2912, + EndPos: -1, }, + Stmts: []node.Node{}, }, &stmt.Case{ Position: &position.Position{ StartLine: 126, - EndLine: -1, - StartPos: 2924, - EndPos: -1, + EndLine: -1, + StartPos: 2924, + EndPos: -1, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 126, - EndLine: 126, - StartPos: 2929, - EndPos: 2929, + EndLine: 126, + StartPos: 2929, + EndPos: 2929, }, Value: "2", }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, }, }, @@ -6494,64 +6437,62 @@ func TestPhp7(t *testing.T) { &stmt.AltSwitch{ Position: &position.Position{ StartLine: 129, - EndLine: 132, - StartPos: 2948, - EndPos: 2995, + EndLine: 132, + StartPos: 2948, + EndPos: 2995, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 129, - EndLine: 129, - StartPos: 2956, - EndPos: 2956, + EndLine: 129, + StartPos: 2956, + EndPos: 2956, }, Value: "1", }, CaseList: &stmt.CaseList{ Position: &position.Position{ StartLine: 130, - EndLine: -1, - StartPos: 2965, - EndPos: -1, + EndLine: -1, + StartPos: 2965, + EndPos: -1, }, Cases: []node.Node{ &stmt.Case{ Position: &position.Position{ StartLine: 130, - EndLine: -1, - StartPos: 2965, - EndPos: -1, + EndLine: -1, + StartPos: 2965, + EndPos: -1, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 130, - EndLine: 130, - StartPos: 2970, - EndPos: 2970, + EndLine: 130, + StartPos: 2970, + EndPos: 2970, }, Value: "1", }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, &stmt.Case{ Position: &position.Position{ StartLine: 131, - EndLine: -1, - StartPos: 2976, - EndPos: -1, + EndLine: -1, + StartPos: 2976, + EndPos: -1, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 131, - EndLine: 131, - StartPos: 2981, - EndPos: 2981, + EndLine: 131, + StartPos: 2981, + EndPos: 2981, }, Value: "2", }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, }, }, @@ -6559,40 +6500,40 @@ func TestPhp7(t *testing.T) { &stmt.Switch{ Position: &position.Position{ StartLine: 134, - EndLine: 137, - StartPos: 3002, - EndPos: 3053, + EndLine: 137, + StartPos: 3002, + EndPos: 3053, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 134, - EndLine: 134, - StartPos: 3010, - EndPos: 3010, + EndLine: 134, + StartPos: 3010, + EndPos: 3010, }, Value: "1", }, CaseList: &stmt.CaseList{ Position: &position.Position{ StartLine: 134, - EndLine: 137, - StartPos: 3013, - EndPos: 3053, + EndLine: 137, + StartPos: 3013, + EndPos: 3053, }, Cases: []node.Node{ &stmt.Case{ Position: &position.Position{ StartLine: 135, - EndLine: 135, - StartPos: 3018, - EndPos: 3031, + EndLine: 135, + StartPos: 3018, + EndPos: 3031, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 135, - EndLine: 135, - StartPos: 3023, - EndPos: 3023, + EndLine: 135, + StartPos: 3023, + EndPos: 3023, }, Value: "1", }, @@ -6600,9 +6541,9 @@ func TestPhp7(t *testing.T) { &stmt.Break{ Position: &position.Position{ StartLine: 135, - EndLine: 135, - StartPos: 3026, - EndPos: 3031, + EndLine: 135, + StartPos: 3026, + EndPos: 3031, }, }, }, @@ -6610,16 +6551,16 @@ func TestPhp7(t *testing.T) { &stmt.Case{ Position: &position.Position{ StartLine: 136, - EndLine: 136, - StartPos: 3036, - EndPos: 3049, + EndLine: 136, + StartPos: 3036, + EndPos: 3049, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 136, - EndLine: 136, - StartPos: 3041, - EndPos: 3041, + EndLine: 136, + StartPos: 3041, + EndPos: 3041, }, Value: "2", }, @@ -6627,9 +6568,9 @@ func TestPhp7(t *testing.T) { &stmt.Break{ Position: &position.Position{ StartLine: 136, - EndLine: 136, - StartPos: 3044, - EndPos: 3049, + EndLine: 136, + StartPos: 3044, + EndPos: 3049, }, }, }, @@ -6640,40 +6581,40 @@ func TestPhp7(t *testing.T) { &stmt.Switch{ Position: &position.Position{ StartLine: 139, - EndLine: 142, - StartPos: 3060, - EndPos: 3112, + EndLine: 142, + StartPos: 3060, + EndPos: 3112, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 139, - EndLine: 139, - StartPos: 3068, - EndPos: 3068, + EndLine: 139, + StartPos: 3068, + EndPos: 3068, }, Value: "1", }, CaseList: &stmt.CaseList{ Position: &position.Position{ StartLine: 139, - EndLine: 142, - StartPos: 3071, - EndPos: 3112, + EndLine: 142, + StartPos: 3071, + EndPos: 3112, }, Cases: []node.Node{ &stmt.Case{ Position: &position.Position{ StartLine: 140, - EndLine: 140, - StartPos: 3077, - EndPos: 3090, + EndLine: 140, + StartPos: 3077, + EndPos: 3090, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 140, - EndLine: 140, - StartPos: 3082, - EndPos: 3082, + EndLine: 140, + StartPos: 3082, + EndPos: 3082, }, Value: "1", }, @@ -6681,9 +6622,9 @@ func TestPhp7(t *testing.T) { &stmt.Break{ Position: &position.Position{ StartLine: 140, - EndLine: 140, - StartPos: 3085, - EndPos: 3090, + EndLine: 140, + StartPos: 3085, + EndPos: 3090, }, }, }, @@ -6691,16 +6632,16 @@ func TestPhp7(t *testing.T) { &stmt.Case{ Position: &position.Position{ StartLine: 141, - EndLine: 141, - StartPos: 3095, - EndPos: 3108, + EndLine: 141, + StartPos: 3095, + EndPos: 3108, }, Cond: &scalar.Lnumber{ Position: &position.Position{ StartLine: 141, - EndLine: 141, - StartPos: 3100, - EndPos: 3100, + EndLine: 141, + StartPos: 3100, + EndPos: 3100, }, Value: "2", }, @@ -6708,9 +6649,9 @@ func TestPhp7(t *testing.T) { &stmt.Break{ Position: &position.Position{ StartLine: 141, - EndLine: 141, - StartPos: 3103, - EndPos: 3108, + EndLine: 141, + StartPos: 3103, + EndPos: 3108, }, }, }, @@ -6721,23 +6662,23 @@ func TestPhp7(t *testing.T) { &stmt.Throw{ Position: &position.Position{ StartLine: 144, - EndLine: 144, - StartPos: 3117, - EndPos: 3125, + EndLine: 144, + StartPos: 3117, + EndPos: 3125, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 144, - EndLine: 144, - StartPos: 3123, - EndPos: 3124, + EndLine: 144, + StartPos: 3123, + EndPos: 3124, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 144, - EndLine: 144, - StartPos: 3123, - EndPos: 3124, + EndLine: 144, + StartPos: 3123, + EndPos: 3124, }, Value: "e", }, @@ -6746,37 +6687,36 @@ func TestPhp7(t *testing.T) { &stmt.Trait{ Position: &position.Position{ StartLine: 146, - EndLine: 146, - StartPos: 3130, - EndPos: 3141, + EndLine: 146, + StartPos: 3130, + EndPos: 3141, }, PhpDocComment: "", TraitName: &node.Identifier{ Position: &position.Position{ StartLine: 146, - EndLine: 146, - StartPos: 3136, - EndPos: 3138, + EndLine: 146, + StartPos: 3136, + EndPos: 3138, }, Value: "Foo", }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, &stmt.Class{ Position: &position.Position{ StartLine: 147, - EndLine: 147, - StartPos: 3145, - EndPos: 3166, + EndLine: 147, + StartPos: 3145, + EndPos: 3166, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 147, - EndLine: 147, - StartPos: 3151, - EndPos: 3153, + EndLine: 147, + StartPos: 3151, + EndPos: 3153, }, Value: "Foo", }, @@ -6784,25 +6724,25 @@ func TestPhp7(t *testing.T) { &stmt.TraitUse{ Position: &position.Position{ StartLine: 147, - EndLine: 147, - StartPos: 3157, - EndPos: 3164, + EndLine: 147, + StartPos: 3157, + EndPos: 3164, }, Traits: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 147, - EndLine: 147, - StartPos: 3161, - EndPos: 3163, + EndLine: 147, + StartPos: 3161, + EndPos: 3163, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 147, - EndLine: 147, - StartPos: 3161, - EndPos: 3163, + EndLine: 147, + StartPos: 3161, + EndPos: 3163, }, Value: "Bar", }, @@ -6815,17 +6755,17 @@ func TestPhp7(t *testing.T) { &stmt.Class{ Position: &position.Position{ StartLine: 148, - EndLine: 148, - StartPos: 3170, - EndPos: 3198, + EndLine: 148, + StartPos: 3170, + EndPos: 3198, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 148, - EndLine: 148, - StartPos: 3176, - EndPos: 3178, + EndLine: 148, + StartPos: 3176, + EndPos: 3178, }, Value: "Foo", }, @@ -6833,25 +6773,25 @@ func TestPhp7(t *testing.T) { &stmt.TraitUse{ Position: &position.Position{ StartLine: 148, - EndLine: 148, - StartPos: 3182, - EndPos: 3196, + EndLine: 148, + StartPos: 3182, + EndPos: 3196, }, Traits: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 148, - EndLine: 148, - StartPos: 3186, - EndPos: 3188, + EndLine: 148, + StartPos: 3186, + EndPos: 3188, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 148, - EndLine: 148, - StartPos: 3186, - EndPos: 3188, + EndLine: 148, + StartPos: 3186, + EndPos: 3188, }, Value: "Bar", }, @@ -6860,17 +6800,17 @@ func TestPhp7(t *testing.T) { &name.Name{ Position: &position.Position{ StartLine: 148, - EndLine: 148, - StartPos: 3191, - EndPos: 3193, + EndLine: 148, + StartPos: 3191, + EndPos: 3193, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 148, - EndLine: 148, - StartPos: 3191, - EndPos: 3193, + EndLine: 148, + StartPos: 3191, + EndPos: 3193, }, Value: "Baz", }, @@ -6880,9 +6820,9 @@ func TestPhp7(t *testing.T) { TraitAdaptationList: &stmt.TraitAdaptationList{ Position: &position.Position{ StartLine: 148, - EndLine: 148, - StartPos: 3195, - EndPos: 3196, + EndLine: 148, + StartPos: 3195, + EndPos: 3196, }, }, }, @@ -6891,17 +6831,17 @@ func TestPhp7(t *testing.T) { &stmt.Class{ Position: &position.Position{ StartLine: 149, - EndLine: 149, - StartPos: 3202, - EndPos: 3247, + EndLine: 149, + StartPos: 3202, + EndPos: 3247, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 149, - EndLine: 149, - StartPos: 3208, - EndPos: 3210, + EndLine: 149, + StartPos: 3208, + EndPos: 3210, }, Value: "Foo", }, @@ -6909,25 +6849,25 @@ func TestPhp7(t *testing.T) { &stmt.TraitUse{ Position: &position.Position{ StartLine: 149, - EndLine: 149, - StartPos: 3214, - EndPos: 3245, + EndLine: 149, + StartPos: 3214, + EndPos: 3245, }, Traits: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 149, - EndLine: 149, - StartPos: 3218, - EndPos: 3220, + EndLine: 149, + StartPos: 3218, + EndPos: 3220, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 149, - EndLine: 149, - StartPos: 3218, - EndPos: 3220, + EndLine: 149, + StartPos: 3218, + EndPos: 3220, }, Value: "Bar", }, @@ -6936,17 +6876,17 @@ func TestPhp7(t *testing.T) { &name.Name{ Position: &position.Position{ StartLine: 149, - EndLine: 149, - StartPos: 3223, - EndPos: 3225, + EndLine: 149, + StartPos: 3223, + EndPos: 3225, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 149, - EndLine: 149, - StartPos: 3223, - EndPos: 3225, + EndLine: 149, + StartPos: 3223, + EndPos: 3225, }, Value: "Baz", }, @@ -6956,31 +6896,31 @@ func TestPhp7(t *testing.T) { TraitAdaptationList: &stmt.TraitAdaptationList{ Position: &position.Position{ StartLine: 149, - EndLine: 149, - StartPos: 3227, - EndPos: 3245, + EndLine: 149, + StartPos: 3227, + EndPos: 3245, }, Adaptations: []node.Node{ &stmt.TraitUseAlias{ Position: &position.Position{ StartLine: 149, - EndLine: 149, - StartPos: 3229, - EndPos: 3242, + EndLine: 149, + StartPos: 3229, + EndPos: 3242, }, Ref: &stmt.TraitMethodRef{ Position: &position.Position{ StartLine: 149, - EndLine: 149, - StartPos: 3229, - EndPos: 3231, + EndLine: 149, + StartPos: 3229, + EndPos: 3231, }, Method: &node.Identifier{ Position: &position.Position{ StartLine: 149, - EndLine: 149, - StartPos: 3229, - EndPos: 3231, + EndLine: 149, + StartPos: 3229, + EndPos: 3231, }, Value: "one", }, @@ -6988,9 +6928,9 @@ func TestPhp7(t *testing.T) { Alias: &node.Identifier{ Position: &position.Position{ StartLine: 149, - EndLine: 149, - StartPos: 3236, - EndPos: 3242, + EndLine: 149, + StartPos: 3236, + EndPos: 3242, }, Value: "include", }, @@ -7003,17 +6943,17 @@ func TestPhp7(t *testing.T) { &stmt.Class{ Position: &position.Position{ StartLine: 150, - EndLine: 150, - StartPos: 3251, - EndPos: 3295, + EndLine: 150, + StartPos: 3251, + EndPos: 3295, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 150, - EndLine: 150, - StartPos: 3257, - EndPos: 3259, + EndLine: 150, + StartPos: 3257, + EndPos: 3259, }, Value: "Foo", }, @@ -7021,25 +6961,25 @@ func TestPhp7(t *testing.T) { &stmt.TraitUse{ Position: &position.Position{ StartLine: 150, - EndLine: 150, - StartPos: 3263, - EndPos: 3293, + EndLine: 150, + StartPos: 3263, + EndPos: 3293, }, Traits: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 150, - EndLine: 150, - StartPos: 3267, - EndPos: 3269, + EndLine: 150, + StartPos: 3267, + EndPos: 3269, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 150, - EndLine: 150, - StartPos: 3267, - EndPos: 3269, + EndLine: 150, + StartPos: 3267, + EndPos: 3269, }, Value: "Bar", }, @@ -7048,17 +6988,17 @@ func TestPhp7(t *testing.T) { &name.Name{ Position: &position.Position{ StartLine: 150, - EndLine: 150, - StartPos: 3272, - EndPos: 3274, + EndLine: 150, + StartPos: 3272, + EndPos: 3274, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 150, - EndLine: 150, - StartPos: 3272, - EndPos: 3274, + EndLine: 150, + StartPos: 3272, + EndPos: 3274, }, Value: "Baz", }, @@ -7068,31 +7008,31 @@ func TestPhp7(t *testing.T) { TraitAdaptationList: &stmt.TraitAdaptationList{ Position: &position.Position{ StartLine: 150, - EndLine: 150, - StartPos: 3276, - EndPos: 3293, + EndLine: 150, + StartPos: 3276, + EndPos: 3293, }, Adaptations: []node.Node{ &stmt.TraitUseAlias{ Position: &position.Position{ StartLine: 150, - EndLine: 150, - StartPos: 3278, - EndPos: 3290, + EndLine: 150, + StartPos: 3278, + EndPos: 3290, }, Ref: &stmt.TraitMethodRef{ Position: &position.Position{ StartLine: 150, - EndLine: 150, - StartPos: 3278, - EndPos: 3280, + EndLine: 150, + StartPos: 3278, + EndPos: 3280, }, Method: &node.Identifier{ Position: &position.Position{ StartLine: 150, - EndLine: 150, - StartPos: 3278, - EndPos: 3280, + EndLine: 150, + StartPos: 3278, + EndPos: 3280, }, Value: "one", }, @@ -7100,9 +7040,9 @@ func TestPhp7(t *testing.T) { Modifier: &node.Identifier{ Position: &position.Position{ StartLine: 150, - EndLine: 150, - StartPos: 3285, - EndPos: 3290, + EndLine: 150, + StartPos: 3285, + EndPos: 3290, }, Value: "public", }, @@ -7115,17 +7055,17 @@ func TestPhp7(t *testing.T) { &stmt.Class{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3299, - EndPos: 3347, + EndLine: 151, + StartPos: 3299, + EndPos: 3347, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3305, - EndPos: 3307, + EndLine: 151, + StartPos: 3305, + EndPos: 3307, }, Value: "Foo", }, @@ -7133,25 +7073,25 @@ func TestPhp7(t *testing.T) { &stmt.TraitUse{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3311, - EndPos: 3345, + EndLine: 151, + StartPos: 3311, + EndPos: 3345, }, Traits: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3315, - EndPos: 3317, + EndLine: 151, + StartPos: 3315, + EndPos: 3317, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3315, - EndPos: 3317, + EndLine: 151, + StartPos: 3315, + EndPos: 3317, }, Value: "Bar", }, @@ -7160,17 +7100,17 @@ func TestPhp7(t *testing.T) { &name.Name{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3320, - EndPos: 3322, + EndLine: 151, + StartPos: 3320, + EndPos: 3322, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3320, - EndPos: 3322, + EndLine: 151, + StartPos: 3320, + EndPos: 3322, }, Value: "Baz", }, @@ -7180,31 +7120,31 @@ func TestPhp7(t *testing.T) { TraitAdaptationList: &stmt.TraitAdaptationList{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3324, - EndPos: 3345, + EndLine: 151, + StartPos: 3324, + EndPos: 3345, }, Adaptations: []node.Node{ &stmt.TraitUseAlias{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3326, - EndPos: 3342, + EndLine: 151, + StartPos: 3326, + EndPos: 3342, }, Ref: &stmt.TraitMethodRef{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3326, - EndPos: 3328, + EndLine: 151, + StartPos: 3326, + EndPos: 3328, }, Method: &node.Identifier{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3326, - EndPos: 3328, + EndLine: 151, + StartPos: 3326, + EndPos: 3328, }, Value: "one", }, @@ -7212,18 +7152,18 @@ func TestPhp7(t *testing.T) { Modifier: &node.Identifier{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3333, - EndPos: 3338, + EndLine: 151, + StartPos: 3333, + EndPos: 3338, }, Value: "public", }, Alias: &node.Identifier{ Position: &position.Position{ StartLine: 151, - EndLine: 151, - StartPos: 3340, - EndPos: 3342, + EndLine: 151, + StartPos: 3340, + EndPos: 3342, }, Value: "two", }, @@ -7236,17 +7176,17 @@ func TestPhp7(t *testing.T) { &stmt.Class{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3351, - EndPos: 3427, + EndLine: 152, + StartPos: 3351, + EndPos: 3427, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3357, - EndPos: 3359, + EndLine: 152, + StartPos: 3357, + EndPos: 3359, }, Value: "Foo", }, @@ -7254,25 +7194,25 @@ func TestPhp7(t *testing.T) { &stmt.TraitUse{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3363, - EndPos: 3425, + EndLine: 152, + StartPos: 3363, + EndPos: 3425, }, Traits: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3367, - EndPos: 3369, + EndLine: 152, + StartPos: 3367, + EndPos: 3369, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3367, - EndPos: 3369, + EndLine: 152, + StartPos: 3367, + EndPos: 3369, }, Value: "Bar", }, @@ -7281,17 +7221,17 @@ func TestPhp7(t *testing.T) { &name.Name{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3372, - EndPos: 3374, + EndLine: 152, + StartPos: 3372, + EndPos: 3374, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3372, - EndPos: 3374, + EndLine: 152, + StartPos: 3372, + EndPos: 3374, }, Value: "Baz", }, @@ -7301,39 +7241,39 @@ func TestPhp7(t *testing.T) { TraitAdaptationList: &stmt.TraitAdaptationList{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3376, - EndPos: 3425, + EndLine: 152, + StartPos: 3376, + EndPos: 3425, }, Adaptations: []node.Node{ &stmt.TraitUsePrecedence{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3378, - EndPos: 3405, + EndLine: 152, + StartPos: 3378, + EndPos: 3405, }, Ref: &stmt.TraitMethodRef{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3378, - EndPos: 3385, + EndLine: 152, + StartPos: 3378, + EndPos: 3385, }, Trait: &name.Name{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3378, - EndPos: 3380, + EndLine: 152, + StartPos: 3378, + EndPos: 3380, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3378, - EndPos: 3380, + EndLine: 152, + StartPos: 3378, + EndPos: 3380, }, Value: "Bar", }, @@ -7342,9 +7282,9 @@ func TestPhp7(t *testing.T) { Method: &node.Identifier{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3383, - EndPos: 3385, + EndLine: 152, + StartPos: 3383, + EndPos: 3385, }, Value: "one", }, @@ -7353,17 +7293,17 @@ func TestPhp7(t *testing.T) { &name.Name{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3397, - EndPos: 3399, + EndLine: 152, + StartPos: 3397, + EndPos: 3399, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3397, - EndPos: 3399, + EndLine: 152, + StartPos: 3397, + EndPos: 3399, }, Value: "Baz", }, @@ -7372,17 +7312,17 @@ func TestPhp7(t *testing.T) { &name.Name{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3402, - EndPos: 3405, + EndLine: 152, + StartPos: 3402, + EndPos: 3405, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3402, - EndPos: 3405, + EndLine: 152, + StartPos: 3402, + EndPos: 3405, }, Value: "Quux", }, @@ -7393,31 +7333,31 @@ func TestPhp7(t *testing.T) { &stmt.TraitUseAlias{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3408, - EndPos: 3422, + EndLine: 152, + StartPos: 3408, + EndPos: 3422, }, Ref: &stmt.TraitMethodRef{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3408, - EndPos: 3415, + EndLine: 152, + StartPos: 3408, + EndPos: 3415, }, Trait: &name.Name{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3408, - EndPos: 3410, + EndLine: 152, + StartPos: 3408, + EndPos: 3410, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3408, - EndPos: 3410, + EndLine: 152, + StartPos: 3408, + EndPos: 3410, }, Value: "Baz", }, @@ -7426,9 +7366,9 @@ func TestPhp7(t *testing.T) { Method: &node.Identifier{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3413, - EndPos: 3415, + EndLine: 152, + StartPos: 3413, + EndPos: 3415, }, Value: "one", }, @@ -7436,9 +7376,9 @@ func TestPhp7(t *testing.T) { Alias: &node.Identifier{ Position: &position.Position{ StartLine: 152, - EndLine: 152, - StartPos: 3420, - EndPos: 3422, + EndLine: 152, + StartPos: 3420, + EndPos: 3422, }, Value: "two", }, @@ -7451,47 +7391,44 @@ func TestPhp7(t *testing.T) { &stmt.Try{ Position: &position.Position{ StartLine: 154, - EndLine: -1, - StartPos: 3432, - EndPos: -1, - }, - Stmts: []node.Node{ - }, - Catches: []node.Node{ + EndLine: -1, + StartPos: 3432, + EndPos: -1, }, + Stmts: []node.Node{}, + Catches: []node.Node{}, }, &stmt.Try{ Position: &position.Position{ StartLine: 155, - EndLine: 155, - StartPos: 3441, - EndPos: 3470, - }, - Stmts: []node.Node{ + EndLine: 155, + StartPos: 3441, + EndPos: 3470, }, + Stmts: []node.Node{}, Catches: []node.Node{ &stmt.Catch{ Position: &position.Position{ StartLine: 155, - EndLine: 155, - StartPos: 3448, - EndPos: 3470, + EndLine: 155, + StartPos: 3448, + EndPos: 3470, }, Types: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 155, - EndLine: 155, - StartPos: 3455, - EndPos: 3463, + EndLine: 155, + StartPos: 3455, + EndPos: 3463, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 155, - EndLine: 155, - StartPos: 3455, - EndPos: 3463, + EndLine: 155, + StartPos: 3455, + EndPos: 3463, }, Value: "Exception", }, @@ -7501,57 +7438,55 @@ func TestPhp7(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 155, - EndLine: 155, - StartPos: 3465, - EndPos: 3466, + EndLine: 155, + StartPos: 3465, + EndPos: 3466, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 155, - EndLine: 155, - StartPos: 3465, - EndPos: 3466, + EndLine: 155, + StartPos: 3465, + EndPos: 3466, }, Value: "e", }, }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, }, }, &stmt.Try{ Position: &position.Position{ StartLine: 156, - EndLine: 156, - StartPos: 3474, - EndPos: 3520, - }, - Stmts: []node.Node{ + EndLine: 156, + StartPos: 3474, + EndPos: 3520, }, + Stmts: []node.Node{}, Catches: []node.Node{ &stmt.Catch{ Position: &position.Position{ StartLine: 156, - EndLine: 156, - StartPos: 3481, - EndPos: 3520, + EndLine: 156, + StartPos: 3481, + EndPos: 3520, }, Types: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 156, - EndLine: 156, - StartPos: 3488, - EndPos: 3496, + EndLine: 156, + StartPos: 3488, + EndPos: 3496, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 156, - EndLine: 156, - StartPos: 3488, - EndPos: 3496, + EndLine: 156, + StartPos: 3488, + EndPos: 3496, }, Value: "Exception", }, @@ -7560,17 +7495,17 @@ func TestPhp7(t *testing.T) { &name.Name{ Position: &position.Position{ StartLine: 156, - EndLine: 156, - StartPos: 3498, - EndPos: 3513, + EndLine: 156, + StartPos: 3498, + EndPos: 3513, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 156, - EndLine: 156, - StartPos: 3498, - EndPos: 3513, + EndLine: 156, + StartPos: 3498, + EndPos: 3513, }, Value: "RuntimeException", }, @@ -7580,57 +7515,55 @@ func TestPhp7(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 156, - EndLine: 156, - StartPos: 3515, - EndPos: 3516, + EndLine: 156, + StartPos: 3515, + EndPos: 3516, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 156, - EndLine: 156, - StartPos: 3515, - EndPos: 3516, + EndLine: 156, + StartPos: 3515, + EndPos: 3516, }, Value: "e", }, }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, }, }, &stmt.Try{ Position: &position.Position{ StartLine: 157, - EndLine: 157, - StartPos: 3524, - EndPos: 3584, - }, - Stmts: []node.Node{ + EndLine: 157, + StartPos: 3524, + EndPos: 3584, }, + Stmts: []node.Node{}, Catches: []node.Node{ &stmt.Catch{ Position: &position.Position{ StartLine: 157, - EndLine: 157, - StartPos: 3531, - EndPos: 3553, + EndLine: 157, + StartPos: 3531, + EndPos: 3553, }, Types: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 157, - EndLine: 157, - StartPos: 3538, - EndPos: 3546, + EndLine: 157, + StartPos: 3538, + EndPos: 3546, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 157, - EndLine: 157, - StartPos: 3538, - EndPos: 3546, + EndLine: 157, + StartPos: 3538, + EndPos: 3546, }, Value: "Exception", }, @@ -7640,45 +7573,44 @@ func TestPhp7(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 157, - EndLine: 157, - StartPos: 3548, - EndPos: 3549, + EndLine: 157, + StartPos: 3548, + EndPos: 3549, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 157, - EndLine: 157, - StartPos: 3548, - EndPos: 3549, + EndLine: 157, + StartPos: 3548, + EndPos: 3549, }, Value: "e", }, }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, &stmt.Catch{ Position: &position.Position{ StartLine: 157, - EndLine: 157, - StartPos: 3555, - EndPos: 3584, + EndLine: 157, + StartPos: 3555, + EndPos: 3584, }, Types: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 157, - EndLine: 157, - StartPos: 3562, - EndPos: 3577, + EndLine: 157, + StartPos: 3562, + EndPos: 3577, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 157, - EndLine: 157, - StartPos: 3562, - EndPos: 3577, + EndLine: 157, + StartPos: 3562, + EndPos: 3577, }, Value: "RuntimeException", }, @@ -7688,57 +7620,55 @@ func TestPhp7(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 157, - EndLine: 157, - StartPos: 3579, - EndPos: 3580, + EndLine: 157, + StartPos: 3579, + EndPos: 3580, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 157, - EndLine: 157, - StartPos: 3579, - EndPos: 3580, + EndLine: 157, + StartPos: 3579, + EndPos: 3580, }, Value: "e", }, }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, }, }, &stmt.Try{ Position: &position.Position{ StartLine: 158, - EndLine: 158, - StartPos: 3588, - EndPos: 3628, - }, - Stmts: []node.Node{ + EndLine: 158, + StartPos: 3588, + EndPos: 3628, }, + Stmts: []node.Node{}, Catches: []node.Node{ &stmt.Catch{ Position: &position.Position{ StartLine: 158, - EndLine: 158, - StartPos: 3595, - EndPos: 3617, + EndLine: 158, + StartPos: 3595, + EndPos: 3617, }, Types: []node.Node{ &name.Name{ Position: &position.Position{ StartLine: 158, - EndLine: 158, - StartPos: 3602, - EndPos: 3610, + EndLine: 158, + StartPos: 3602, + EndPos: 3610, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 158, - EndLine: 158, - StartPos: 3602, - EndPos: 3610, + EndLine: 158, + StartPos: 3602, + EndPos: 3610, }, Value: "Exception", }, @@ -7748,56 +7678,54 @@ func TestPhp7(t *testing.T) { Variable: &expr.Variable{ Position: &position.Position{ StartLine: 158, - EndLine: 158, - StartPos: 3612, - EndPos: 3613, + EndLine: 158, + StartPos: 3612, + EndPos: 3613, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 158, - EndLine: 158, - StartPos: 3612, - EndPos: 3613, + EndLine: 158, + StartPos: 3612, + EndPos: 3613, }, Value: "e", }, }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, }, Finally: &stmt.Finally{ Position: &position.Position{ StartLine: 158, - EndLine: 158, - StartPos: 3619, - EndPos: 3628, - }, - Stmts: []node.Node{ + EndLine: 158, + StartPos: 3619, + EndPos: 3628, }, + Stmts: []node.Node{}, }, }, &stmt.Unset{ Position: &position.Position{ StartLine: 160, - EndLine: 160, - StartPos: 3633, - EndPos: 3647, + EndLine: 160, + StartPos: 3633, + EndPos: 3647, }, Vars: []node.Node{ &expr.Variable{ Position: &position.Position{ StartLine: 160, - EndLine: 160, - StartPos: 3639, - EndPos: 3640, + EndLine: 160, + StartPos: 3639, + EndPos: 3640, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 160, - EndLine: 160, - StartPos: 3639, - EndPos: 3640, + EndLine: 160, + StartPos: 3639, + EndPos: 3640, }, Value: "a", }, @@ -7805,16 +7733,16 @@ func TestPhp7(t *testing.T) { &expr.Variable{ Position: &position.Position{ StartLine: 160, - EndLine: 160, - StartPos: 3643, - EndPos: 3644, + EndLine: 160, + StartPos: 3643, + EndPos: 3644, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 160, - EndLine: 160, - StartPos: 3643, - EndPos: 3644, + EndLine: 160, + StartPos: 3643, + EndPos: 3644, }, Value: "b", }, @@ -7824,32 +7752,32 @@ func TestPhp7(t *testing.T) { &stmt.UseList{ Position: &position.Position{ StartLine: 162, - EndLine: 162, - StartPos: 3652, - EndPos: 3659, + EndLine: 162, + StartPos: 3652, + EndPos: 3659, }, Uses: []node.Node{ &stmt.Use{ Position: &position.Position{ StartLine: 162, - EndLine: 162, - StartPos: 3656, - EndPos: 3658, + EndLine: 162, + StartPos: 3656, + EndPos: 3658, }, Use: &name.Name{ Position: &position.Position{ StartLine: 162, - EndLine: 162, - StartPos: 3656, - EndPos: 3658, + EndLine: 162, + StartPos: 3656, + EndPos: 3658, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 162, - EndLine: 162, - StartPos: 3656, - EndPos: 3658, + EndLine: 162, + StartPos: 3656, + EndPos: 3658, }, Value: "Foo", }, @@ -7861,32 +7789,32 @@ func TestPhp7(t *testing.T) { &stmt.UseList{ Position: &position.Position{ StartLine: 163, - EndLine: 163, - StartPos: 3663, - EndPos: 3671, + EndLine: 163, + StartPos: 3663, + EndPos: 3671, }, Uses: []node.Node{ &stmt.Use{ Position: &position.Position{ StartLine: 163, - EndLine: 163, - StartPos: 3668, - EndPos: 3670, + EndLine: 163, + StartPos: 3668, + EndPos: 3670, }, Use: &name.Name{ Position: &position.Position{ StartLine: 163, - EndLine: 163, - StartPos: 3668, - EndPos: 3670, + EndLine: 163, + StartPos: 3668, + EndPos: 3670, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 163, - EndLine: 163, - StartPos: 3668, - EndPos: 3670, + EndLine: 163, + StartPos: 3668, + EndPos: 3670, }, Value: "Foo", }, @@ -7898,32 +7826,32 @@ func TestPhp7(t *testing.T) { &stmt.UseList{ Position: &position.Position{ StartLine: 164, - EndLine: 164, - StartPos: 3675, - EndPos: 3690, + EndLine: 164, + StartPos: 3675, + EndPos: 3690, }, Uses: []node.Node{ &stmt.Use{ Position: &position.Position{ StartLine: 164, - EndLine: 164, - StartPos: 3680, - EndPos: 3689, + EndLine: 164, + StartPos: 3680, + EndPos: 3689, }, Use: &name.Name{ Position: &position.Position{ StartLine: 164, - EndLine: 164, - StartPos: 3680, - EndPos: 3682, + EndLine: 164, + StartPos: 3680, + EndPos: 3682, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 164, - EndLine: 164, - StartPos: 3680, - EndPos: 3682, + EndLine: 164, + StartPos: 3680, + EndPos: 3682, }, Value: "Foo", }, @@ -7932,9 +7860,9 @@ func TestPhp7(t *testing.T) { Alias: &node.Identifier{ Position: &position.Position{ StartLine: 164, - EndLine: 164, - StartPos: 3687, - EndPos: 3689, + EndLine: 164, + StartPos: 3687, + EndPos: 3689, }, Value: "Bar", }, @@ -7944,32 +7872,32 @@ func TestPhp7(t *testing.T) { &stmt.UseList{ Position: &position.Position{ StartLine: 165, - EndLine: 165, - StartPos: 3694, - EndPos: 3706, + EndLine: 165, + StartPos: 3694, + EndPos: 3706, }, Uses: []node.Node{ &stmt.Use{ Position: &position.Position{ StartLine: 165, - EndLine: 165, - StartPos: 3698, - EndPos: 3700, + EndLine: 165, + StartPos: 3698, + EndPos: 3700, }, Use: &name.Name{ Position: &position.Position{ StartLine: 165, - EndLine: 165, - StartPos: 3698, - EndPos: 3700, + EndLine: 165, + StartPos: 3698, + EndPos: 3700, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 165, - EndLine: 165, - StartPos: 3698, - EndPos: 3700, + EndLine: 165, + StartPos: 3698, + EndPos: 3700, }, Value: "Foo", }, @@ -7979,24 +7907,24 @@ func TestPhp7(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 165, - EndLine: 165, - StartPos: 3703, - EndPos: 3705, + EndLine: 165, + StartPos: 3703, + EndPos: 3705, }, Use: &name.Name{ Position: &position.Position{ StartLine: 165, - EndLine: 165, - StartPos: 3703, - EndPos: 3705, + EndLine: 165, + StartPos: 3703, + EndPos: 3705, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 165, - EndLine: 165, - StartPos: 3703, - EndPos: 3705, + EndLine: 165, + StartPos: 3703, + EndPos: 3705, }, Value: "Bar", }, @@ -8008,32 +7936,32 @@ func TestPhp7(t *testing.T) { &stmt.UseList{ Position: &position.Position{ StartLine: 166, - EndLine: 166, - StartPos: 3710, - EndPos: 3729, + EndLine: 166, + StartPos: 3710, + EndPos: 3729, }, Uses: []node.Node{ &stmt.Use{ Position: &position.Position{ StartLine: 166, - EndLine: 166, - StartPos: 3714, - EndPos: 3716, + EndLine: 166, + StartPos: 3714, + EndPos: 3716, }, Use: &name.Name{ Position: &position.Position{ StartLine: 166, - EndLine: 166, - StartPos: 3714, - EndPos: 3716, + EndLine: 166, + StartPos: 3714, + EndPos: 3716, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 166, - EndLine: 166, - StartPos: 3714, - EndPos: 3716, + EndLine: 166, + StartPos: 3714, + EndPos: 3716, }, Value: "Foo", }, @@ -8043,24 +7971,24 @@ func TestPhp7(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 166, - EndLine: 166, - StartPos: 3719, - EndPos: 3728, + EndLine: 166, + StartPos: 3719, + EndPos: 3728, }, Use: &name.Name{ Position: &position.Position{ StartLine: 166, - EndLine: 166, - StartPos: 3719, - EndPos: 3721, + EndLine: 166, + StartPos: 3719, + EndPos: 3721, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 166, - EndLine: 166, - StartPos: 3719, - EndPos: 3721, + EndLine: 166, + StartPos: 3719, + EndPos: 3721, }, Value: "Bar", }, @@ -8069,9 +7997,9 @@ func TestPhp7(t *testing.T) { Alias: &node.Identifier{ Position: &position.Position{ StartLine: 166, - EndLine: 166, - StartPos: 3726, - EndPos: 3728, + EndLine: 166, + StartPos: 3726, + EndPos: 3728, }, Value: "Baz", }, @@ -8081,16 +8009,16 @@ func TestPhp7(t *testing.T) { &stmt.UseList{ Position: &position.Position{ StartLine: 167, - EndLine: 167, - StartPos: 3733, - EndPos: 3755, + EndLine: 167, + StartPos: 3733, + EndPos: 3755, }, UseType: &node.Identifier{ Position: &position.Position{ StartLine: 167, - EndLine: 167, - StartPos: 3737, - EndPos: 3744, + EndLine: 167, + StartPos: 3737, + EndPos: 3744, }, Value: "function", }, @@ -8098,24 +8026,24 @@ func TestPhp7(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 167, - EndLine: 167, - StartPos: 3746, - EndPos: 3748, + EndLine: 167, + StartPos: 3746, + EndPos: 3748, }, Use: &name.Name{ Position: &position.Position{ StartLine: 167, - EndLine: 167, - StartPos: 3746, - EndPos: 3748, + EndLine: 167, + StartPos: 3746, + EndPos: 3748, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 167, - EndLine: 167, - StartPos: 3746, - EndPos: 3748, + EndLine: 167, + StartPos: 3746, + EndPos: 3748, }, Value: "Foo", }, @@ -8125,24 +8053,24 @@ func TestPhp7(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 167, - EndLine: 167, - StartPos: 3752, - EndPos: 3754, + EndLine: 167, + StartPos: 3752, + EndPos: 3754, }, Use: &name.Name{ Position: &position.Position{ StartLine: 167, - EndLine: 167, - StartPos: 3752, - EndPos: 3754, + EndLine: 167, + StartPos: 3752, + EndPos: 3754, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 167, - EndLine: 167, - StartPos: 3752, - EndPos: 3754, + EndLine: 167, + StartPos: 3752, + EndPos: 3754, }, Value: "Bar", }, @@ -8154,16 +8082,16 @@ func TestPhp7(t *testing.T) { &stmt.UseList{ Position: &position.Position{ StartLine: 168, - EndLine: 168, - StartPos: 3759, - EndPos: 3795, + EndLine: 168, + StartPos: 3759, + EndPos: 3795, }, UseType: &node.Identifier{ Position: &position.Position{ StartLine: 168, - EndLine: 168, - StartPos: 3763, - EndPos: 3770, + EndLine: 168, + StartPos: 3763, + EndPos: 3770, }, Value: "function", }, @@ -8171,24 +8099,24 @@ func TestPhp7(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 168, - EndLine: 168, - StartPos: 3772, - EndPos: 3781, + EndLine: 168, + StartPos: 3772, + EndPos: 3781, }, Use: &name.Name{ Position: &position.Position{ StartLine: 168, - EndLine: 168, - StartPos: 3772, - EndPos: 3774, + EndLine: 168, + StartPos: 3772, + EndPos: 3774, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 168, - EndLine: 168, - StartPos: 3772, - EndPos: 3774, + EndLine: 168, + StartPos: 3772, + EndPos: 3774, }, Value: "Foo", }, @@ -8197,9 +8125,9 @@ func TestPhp7(t *testing.T) { Alias: &node.Identifier{ Position: &position.Position{ StartLine: 168, - EndLine: 168, - StartPos: 3779, - EndPos: 3781, + EndLine: 168, + StartPos: 3779, + EndPos: 3781, }, Value: "foo", }, @@ -8207,24 +8135,24 @@ func TestPhp7(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 168, - EndLine: 168, - StartPos: 3785, - EndPos: 3794, + EndLine: 168, + StartPos: 3785, + EndPos: 3794, }, Use: &name.Name{ Position: &position.Position{ StartLine: 168, - EndLine: 168, - StartPos: 3785, - EndPos: 3787, + EndLine: 168, + StartPos: 3785, + EndPos: 3787, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 168, - EndLine: 168, - StartPos: 3785, - EndPos: 3787, + EndLine: 168, + StartPos: 3785, + EndPos: 3787, }, Value: "Bar", }, @@ -8233,9 +8161,9 @@ func TestPhp7(t *testing.T) { Alias: &node.Identifier{ Position: &position.Position{ StartLine: 168, - EndLine: 168, - StartPos: 3792, - EndPos: 3794, + EndLine: 168, + StartPos: 3792, + EndPos: 3794, }, Value: "bar", }, @@ -8245,16 +8173,16 @@ func TestPhp7(t *testing.T) { &stmt.UseList{ Position: &position.Position{ StartLine: 169, - EndLine: 169, - StartPos: 3799, - EndPos: 3818, + EndLine: 169, + StartPos: 3799, + EndPos: 3818, }, UseType: &node.Identifier{ Position: &position.Position{ StartLine: 169, - EndLine: 169, - StartPos: 3803, - EndPos: 3807, + EndLine: 169, + StartPos: 3803, + EndPos: 3807, }, Value: "const", }, @@ -8262,24 +8190,24 @@ func TestPhp7(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 169, - EndLine: 169, - StartPos: 3809, - EndPos: 3811, + EndLine: 169, + StartPos: 3809, + EndPos: 3811, }, Use: &name.Name{ Position: &position.Position{ StartLine: 169, - EndLine: 169, - StartPos: 3809, - EndPos: 3811, + EndLine: 169, + StartPos: 3809, + EndPos: 3811, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 169, - EndLine: 169, - StartPos: 3809, - EndPos: 3811, + EndLine: 169, + StartPos: 3809, + EndPos: 3811, }, Value: "Foo", }, @@ -8289,24 +8217,24 @@ func TestPhp7(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 169, - EndLine: 169, - StartPos: 3815, - EndPos: 3817, + EndLine: 169, + StartPos: 3815, + EndPos: 3817, }, Use: &name.Name{ Position: &position.Position{ StartLine: 169, - EndLine: 169, - StartPos: 3815, - EndPos: 3817, + EndLine: 169, + StartPos: 3815, + EndPos: 3817, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 169, - EndLine: 169, - StartPos: 3815, - EndPos: 3817, + EndLine: 169, + StartPos: 3815, + EndPos: 3817, }, Value: "Bar", }, @@ -8318,16 +8246,16 @@ func TestPhp7(t *testing.T) { &stmt.UseList{ Position: &position.Position{ StartLine: 170, - EndLine: 170, - StartPos: 3822, - EndPos: 3855, + EndLine: 170, + StartPos: 3822, + EndPos: 3855, }, UseType: &node.Identifier{ Position: &position.Position{ StartLine: 170, - EndLine: 170, - StartPos: 3826, - EndPos: 3830, + EndLine: 170, + StartPos: 3826, + EndPos: 3830, }, Value: "const", }, @@ -8335,24 +8263,24 @@ func TestPhp7(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 170, - EndLine: 170, - StartPos: 3832, - EndPos: 3841, + EndLine: 170, + StartPos: 3832, + EndPos: 3841, }, Use: &name.Name{ Position: &position.Position{ StartLine: 170, - EndLine: 170, - StartPos: 3832, - EndPos: 3834, + EndLine: 170, + StartPos: 3832, + EndPos: 3834, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 170, - EndLine: 170, - StartPos: 3832, - EndPos: 3834, + EndLine: 170, + StartPos: 3832, + EndPos: 3834, }, Value: "Foo", }, @@ -8361,9 +8289,9 @@ func TestPhp7(t *testing.T) { Alias: &node.Identifier{ Position: &position.Position{ StartLine: 170, - EndLine: 170, - StartPos: 3839, - EndPos: 3841, + EndLine: 170, + StartPos: 3839, + EndPos: 3841, }, Value: "foo", }, @@ -8371,24 +8299,24 @@ func TestPhp7(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 170, - EndLine: 170, - StartPos: 3845, - EndPos: 3854, + EndLine: 170, + StartPos: 3845, + EndPos: 3854, }, Use: &name.Name{ Position: &position.Position{ StartLine: 170, - EndLine: 170, - StartPos: 3845, - EndPos: 3847, + EndLine: 170, + StartPos: 3845, + EndPos: 3847, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 170, - EndLine: 170, - StartPos: 3845, - EndPos: 3847, + EndLine: 170, + StartPos: 3845, + EndPos: 3847, }, Value: "Bar", }, @@ -8397,9 +8325,9 @@ func TestPhp7(t *testing.T) { Alias: &node.Identifier{ Position: &position.Position{ StartLine: 170, - EndLine: 170, - StartPos: 3852, - EndPos: 3854, + EndLine: 170, + StartPos: 3852, + EndPos: 3854, }, Value: "bar", }, @@ -8409,24 +8337,24 @@ func TestPhp7(t *testing.T) { &stmt.GroupUse{ Position: &position.Position{ StartLine: 172, - EndLine: 172, - StartPos: 3860, - EndPos: 3879, + EndLine: 172, + StartPos: 3860, + EndPos: 3879, }, Prefix: &name.Name{ Position: &position.Position{ StartLine: 172, - EndLine: 172, - StartPos: 3865, - EndPos: 3867, + EndLine: 172, + StartPos: 3865, + EndPos: 3867, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 172, - EndLine: 172, - StartPos: 3865, - EndPos: 3867, + EndLine: 172, + StartPos: 3865, + EndPos: 3867, }, Value: "Foo", }, @@ -8436,24 +8364,24 @@ func TestPhp7(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 172, - EndLine: 172, - StartPos: 3870, - EndPos: 3872, + EndLine: 172, + StartPos: 3870, + EndPos: 3872, }, Use: &name.Name{ Position: &position.Position{ StartLine: 172, - EndLine: 172, - StartPos: 3870, - EndPos: 3872, + EndLine: 172, + StartPos: 3870, + EndPos: 3872, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 172, - EndLine: 172, - StartPos: 3870, - EndPos: 3872, + EndLine: 172, + StartPos: 3870, + EndPos: 3872, }, Value: "Bar", }, @@ -8463,24 +8391,24 @@ func TestPhp7(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 172, - EndLine: 172, - StartPos: 3875, - EndPos: 3877, + EndLine: 172, + StartPos: 3875, + EndPos: 3877, }, Use: &name.Name{ Position: &position.Position{ StartLine: 172, - EndLine: 172, - StartPos: 3875, - EndPos: 3877, + EndLine: 172, + StartPos: 3875, + EndPos: 3877, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 172, - EndLine: 172, - StartPos: 3875, - EndPos: 3877, + EndLine: 172, + StartPos: 3875, + EndPos: 3877, }, Value: "Baz", }, @@ -8492,24 +8420,24 @@ func TestPhp7(t *testing.T) { &stmt.GroupUse{ Position: &position.Position{ StartLine: 173, - EndLine: 173, - StartPos: 3883, - EndPos: 3909, + EndLine: 173, + StartPos: 3883, + EndPos: 3909, }, Prefix: &name.Name{ Position: &position.Position{ StartLine: 173, - EndLine: 173, - StartPos: 3887, - EndPos: 3889, + EndLine: 173, + StartPos: 3887, + EndPos: 3889, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 173, - EndLine: 173, - StartPos: 3887, - EndPos: 3889, + EndLine: 173, + StartPos: 3887, + EndPos: 3889, }, Value: "Foo", }, @@ -8519,24 +8447,24 @@ func TestPhp7(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 173, - EndLine: 173, - StartPos: 3892, - EndPos: 3894, + EndLine: 173, + StartPos: 3892, + EndPos: 3894, }, Use: &name.Name{ Position: &position.Position{ StartLine: 173, - EndLine: 173, - StartPos: 3892, - EndPos: 3894, + EndLine: 173, + StartPos: 3892, + EndPos: 3894, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 173, - EndLine: 173, - StartPos: 3892, - EndPos: 3894, + EndLine: 173, + StartPos: 3892, + EndPos: 3894, }, Value: "Bar", }, @@ -8546,24 +8474,24 @@ func TestPhp7(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 173, - EndLine: 173, - StartPos: 3897, - EndPos: 3907, + EndLine: 173, + StartPos: 3897, + EndPos: 3907, }, Use: &name.Name{ Position: &position.Position{ StartLine: 173, - EndLine: 173, - StartPos: 3897, - EndPos: 3899, + EndLine: 173, + StartPos: 3897, + EndPos: 3899, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 173, - EndLine: 173, - StartPos: 3897, - EndPos: 3899, + EndLine: 173, + StartPos: 3897, + EndPos: 3899, }, Value: "Baz", }, @@ -8572,9 +8500,9 @@ func TestPhp7(t *testing.T) { Alias: &node.Identifier{ Position: &position.Position{ StartLine: 173, - EndLine: 173, - StartPos: 3904, - EndPos: 3907, + EndLine: 173, + StartPos: 3904, + EndPos: 3907, }, Value: "quux", }, @@ -8584,33 +8512,33 @@ func TestPhp7(t *testing.T) { &stmt.GroupUse{ Position: &position.Position{ StartLine: 174, - EndLine: 174, - StartPos: 3913, - EndPos: 3940, + EndLine: 174, + StartPos: 3913, + EndPos: 3940, }, UseType: &node.Identifier{ Position: &position.Position{ StartLine: 174, - EndLine: 174, - StartPos: 3917, - EndPos: 3924, + EndLine: 174, + StartPos: 3917, + EndPos: 3924, }, Value: "function", }, Prefix: &name.Name{ Position: &position.Position{ StartLine: 174, - EndLine: 174, - StartPos: 3926, - EndPos: 3928, + EndLine: 174, + StartPos: 3926, + EndPos: 3928, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 174, - EndLine: 174, - StartPos: 3926, - EndPos: 3928, + EndLine: 174, + StartPos: 3926, + EndPos: 3928, }, Value: "Foo", }, @@ -8620,24 +8548,24 @@ func TestPhp7(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 174, - EndLine: 174, - StartPos: 3931, - EndPos: 3933, + EndLine: 174, + StartPos: 3931, + EndPos: 3933, }, Use: &name.Name{ Position: &position.Position{ StartLine: 174, - EndLine: 174, - StartPos: 3931, - EndPos: 3933, + EndLine: 174, + StartPos: 3931, + EndPos: 3933, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 174, - EndLine: 174, - StartPos: 3931, - EndPos: 3933, + EndLine: 174, + StartPos: 3931, + EndPos: 3933, }, Value: "Bar", }, @@ -8647,24 +8575,24 @@ func TestPhp7(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 174, - EndLine: 174, - StartPos: 3936, - EndPos: 3938, + EndLine: 174, + StartPos: 3936, + EndPos: 3938, }, Use: &name.Name{ Position: &position.Position{ StartLine: 174, - EndLine: 174, - StartPos: 3936, - EndPos: 3938, + EndLine: 174, + StartPos: 3936, + EndPos: 3938, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 174, - EndLine: 174, - StartPos: 3936, - EndPos: 3938, + EndLine: 174, + StartPos: 3936, + EndPos: 3938, }, Value: "Baz", }, @@ -8676,33 +8604,33 @@ func TestPhp7(t *testing.T) { &stmt.GroupUse{ Position: &position.Position{ StartLine: 175, - EndLine: 175, - StartPos: 3944, - EndPos: 3969, + EndLine: 175, + StartPos: 3944, + EndPos: 3969, }, UseType: &node.Identifier{ Position: &position.Position{ StartLine: 175, - EndLine: 175, - StartPos: 3948, - EndPos: 3952, + EndLine: 175, + StartPos: 3948, + EndPos: 3952, }, Value: "const", }, Prefix: &name.Name{ Position: &position.Position{ StartLine: 175, - EndLine: 175, - StartPos: 3955, - EndPos: 3957, + EndLine: 175, + StartPos: 3955, + EndPos: 3957, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 175, - EndLine: 175, - StartPos: 3955, - EndPos: 3957, + EndLine: 175, + StartPos: 3955, + EndPos: 3957, }, Value: "Foo", }, @@ -8712,24 +8640,24 @@ func TestPhp7(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 175, - EndLine: 175, - StartPos: 3960, - EndPos: 3962, + EndLine: 175, + StartPos: 3960, + EndPos: 3962, }, Use: &name.Name{ Position: &position.Position{ StartLine: 175, - EndLine: 175, - StartPos: 3960, - EndPos: 3962, + EndLine: 175, + StartPos: 3960, + EndPos: 3962, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 175, - EndLine: 175, - StartPos: 3960, - EndPos: 3962, + EndLine: 175, + StartPos: 3960, + EndPos: 3962, }, Value: "Bar", }, @@ -8739,24 +8667,24 @@ func TestPhp7(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 175, - EndLine: 175, - StartPos: 3965, - EndPos: 3967, + EndLine: 175, + StartPos: 3965, + EndPos: 3967, }, Use: &name.Name{ Position: &position.Position{ StartLine: 175, - EndLine: 175, - StartPos: 3965, - EndPos: 3967, + EndLine: 175, + StartPos: 3965, + EndPos: 3967, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 175, - EndLine: 175, - StartPos: 3965, - EndPos: 3967, + EndLine: 175, + StartPos: 3965, + EndPos: 3967, }, Value: "Baz", }, @@ -8768,24 +8696,24 @@ func TestPhp7(t *testing.T) { &stmt.GroupUse{ Position: &position.Position{ StartLine: 176, - EndLine: 176, - StartPos: 3973, - EndPos: 4006, + EndLine: 176, + StartPos: 3973, + EndPos: 4006, }, Prefix: &name.Name{ Position: &position.Position{ StartLine: 176, - EndLine: 176, - StartPos: 3977, - EndPos: 3979, + EndLine: 176, + StartPos: 3977, + EndPos: 3979, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 176, - EndLine: 176, - StartPos: 3977, - EndPos: 3979, + EndLine: 176, + StartPos: 3977, + EndPos: 3979, }, Value: "Foo", }, @@ -8795,33 +8723,33 @@ func TestPhp7(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 176, - EndLine: 176, - StartPos: 3988, - EndPos: 3990, + EndLine: 176, + StartPos: 3988, + EndPos: 3990, }, UseType: &node.Identifier{ Position: &position.Position{ StartLine: 176, - EndLine: 176, - StartPos: 3982, - EndPos: 3986, + EndLine: 176, + StartPos: 3982, + EndPos: 3986, }, Value: "const", }, Use: &name.Name{ Position: &position.Position{ StartLine: 176, - EndLine: 176, - StartPos: 3988, - EndPos: 3990, + EndLine: 176, + StartPos: 3988, + EndPos: 3990, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 176, - EndLine: 176, - StartPos: 3988, - EndPos: 3990, + EndLine: 176, + StartPos: 3988, + EndPos: 3990, }, Value: "Bar", }, @@ -8831,33 +8759,33 @@ func TestPhp7(t *testing.T) { &stmt.Use{ Position: &position.Position{ StartLine: 176, - EndLine: 176, - StartPos: 4002, - EndPos: 4004, + EndLine: 176, + StartPos: 4002, + EndPos: 4004, }, UseType: &node.Identifier{ Position: &position.Position{ StartLine: 176, - EndLine: 176, - StartPos: 3993, - EndPos: 4000, + EndLine: 176, + StartPos: 3993, + EndPos: 4000, }, Value: "function", }, Use: &name.Name{ Position: &position.Position{ StartLine: 176, - EndLine: 176, - StartPos: 4002, - EndPos: 4004, + EndLine: 176, + StartPos: 4002, + EndPos: 4004, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 176, - EndLine: 176, - StartPos: 4002, - EndPos: 4004, + EndLine: 176, + StartPos: 4002, + EndPos: 4004, }, Value: "Baz", }, @@ -8869,30 +8797,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 178, - EndLine: 178, - StartPos: 4011, - EndPos: 4016, + EndLine: 178, + StartPos: 4011, + EndPos: 4016, }, Expr: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 178, - EndLine: 178, - StartPos: 4011, - EndPos: 4015, + EndLine: 178, + StartPos: 4011, + EndPos: 4015, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 178, - EndLine: 178, - StartPos: 4011, - EndPos: 4012, + EndLine: 178, + StartPos: 4011, + EndPos: 4012, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 178, - EndLine: 178, - StartPos: 4011, - EndPos: 4012, + EndLine: 178, + StartPos: 4011, + EndPos: 4012, }, Value: "a", }, @@ -8900,9 +8828,9 @@ func TestPhp7(t *testing.T) { Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 178, - EndLine: 178, - StartPos: 4014, - EndPos: 4014, + EndLine: 178, + StartPos: 4014, + EndPos: 4014, }, Value: "1", }, @@ -8911,37 +8839,37 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 179, - EndLine: 179, - StartPos: 4020, - EndPos: 4028, + EndLine: 179, + StartPos: 4020, + EndPos: 4028, }, Expr: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 179, - EndLine: 179, - StartPos: 4020, - EndPos: 4027, + EndLine: 179, + StartPos: 4020, + EndPos: 4027, }, Variable: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 179, - EndLine: 179, - StartPos: 4020, - EndPos: 4024, + EndLine: 179, + StartPos: 4020, + EndPos: 4024, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 179, - EndLine: 179, - StartPos: 4020, - EndPos: 4021, + EndLine: 179, + StartPos: 4020, + EndPos: 4021, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 179, - EndLine: 179, - StartPos: 4020, - EndPos: 4021, + EndLine: 179, + StartPos: 4020, + EndPos: 4021, }, Value: "a", }, @@ -8949,9 +8877,9 @@ func TestPhp7(t *testing.T) { Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 179, - EndLine: 179, - StartPos: 4023, - EndPos: 4023, + EndLine: 179, + StartPos: 4023, + EndPos: 4023, }, Value: "1", }, @@ -8959,9 +8887,9 @@ func TestPhp7(t *testing.T) { Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 179, - EndLine: 179, - StartPos: 4026, - EndPos: 4026, + EndLine: 179, + StartPos: 4026, + EndPos: 4026, }, Value: "2", }, @@ -8970,49 +8898,48 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 180, - EndLine: 180, - StartPos: 4032, - EndPos: 4039, + EndLine: 180, + StartPos: 4032, + EndPos: 4039, }, Expr: &expr.Array{ Position: &position.Position{ StartLine: 180, - EndLine: 180, - StartPos: 4032, - EndPos: 4038, - }, - Items: []node.Node{ + EndLine: 180, + StartPos: 4032, + EndPos: 4038, }, + Items: []node.Node{}, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 181, - EndLine: 181, - StartPos: 4043, - EndPos: 4051, + EndLine: 181, + StartPos: 4043, + EndPos: 4051, }, Expr: &expr.Array{ Position: &position.Position{ StartLine: 181, - EndLine: 181, - StartPos: 4043, - EndPos: 4050, + EndLine: 181, + StartPos: 4043, + EndPos: 4050, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 181, - EndLine: 181, - StartPos: 4049, - EndPos: 4049, + EndLine: 181, + StartPos: 4049, + EndPos: 4049, }, Val: &scalar.Lnumber{ Position: &position.Position{ StartLine: 181, - EndLine: 181, - StartPos: 4049, - EndPos: 4049, + EndLine: 181, + StartPos: 4049, + EndPos: 4049, }, Value: "1", }, @@ -9023,40 +8950,40 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 182, - EndLine: 182, - StartPos: 4055, - EndPos: 4072, + EndLine: 182, + StartPos: 4055, + EndPos: 4072, }, Expr: &expr.Array{ Position: &position.Position{ StartLine: 182, - EndLine: 182, - StartPos: 4055, - EndPos: 4071, + EndLine: 182, + StartPos: 4055, + EndPos: 4071, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 182, - EndLine: 182, - StartPos: 4061, - EndPos: 4064, + EndLine: 182, + StartPos: 4061, + EndPos: 4064, }, Key: &scalar.Lnumber{ Position: &position.Position{ StartLine: 182, - EndLine: 182, - StartPos: 4061, - EndPos: 4061, + EndLine: 182, + StartPos: 4061, + EndPos: 4061, }, Value: "1", }, Val: &scalar.Lnumber{ Position: &position.Position{ StartLine: 182, - EndLine: 182, - StartPos: 4064, - EndPos: 4064, + EndLine: 182, + StartPos: 4064, + EndPos: 4064, }, Value: "1", }, @@ -9064,68 +8991,67 @@ func TestPhp7(t *testing.T) { &expr.ArrayItem{ Position: &position.Position{ StartLine: 182, - EndLine: 182, - StartPos: 4067, - EndPos: 4069, + EndLine: 182, + StartPos: 4067, + EndPos: 4069, }, Val: &expr.Reference{ Position: &position.Position{ StartLine: 182, - EndLine: 182, - StartPos: 4067, - EndPos: 4069, + EndLine: 182, + StartPos: 4067, + EndPos: 4069, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 182, - EndLine: 182, - StartPos: 4068, - EndPos: 4069, + EndLine: 182, + StartPos: 4068, + EndPos: 4069, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 182, - EndLine: 182, - StartPos: 4068, - EndPos: 4069, + EndLine: 182, + StartPos: 4068, + EndPos: 4069, }, Value: "b", }, }, }, }, - &expr.ArrayItem{ - }, + &expr.ArrayItem{}, }, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 183, - EndLine: 183, - StartPos: 4076, - EndPos: 4079, + EndLine: 183, + StartPos: 4076, + EndPos: 4079, }, Expr: &expr.BitwiseNot{ Position: &position.Position{ StartLine: 183, - EndLine: 183, - StartPos: 4076, - EndPos: 4078, + EndLine: 183, + StartPos: 4076, + EndPos: 4078, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 183, - EndLine: 183, - StartPos: 4077, - EndPos: 4078, + EndLine: 183, + StartPos: 4077, + EndPos: 4078, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 183, - EndLine: 183, - StartPos: 4077, - EndPos: 4078, + EndLine: 183, + StartPos: 4077, + EndPos: 4078, }, Value: "a", }, @@ -9135,30 +9061,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 184, - EndLine: 184, - StartPos: 4083, - EndPos: 4086, + EndLine: 184, + StartPos: 4083, + EndPos: 4086, }, Expr: &expr.BooleanNot{ Position: &position.Position{ StartLine: 184, - EndLine: 184, - StartPos: 4083, - EndPos: 4085, + EndLine: 184, + StartPos: 4083, + EndPos: 4085, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 184, - EndLine: 184, - StartPos: 4084, - EndPos: 4085, + EndLine: 184, + StartPos: 4084, + EndPos: 4085, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 184, - EndLine: 184, - StartPos: 4084, - EndPos: 4085, + EndLine: 184, + StartPos: 4084, + EndPos: 4085, }, Value: "a", }, @@ -9168,31 +9094,31 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 186, - EndLine: 186, - StartPos: 4091, - EndPos: 4099, + EndLine: 186, + StartPos: 4091, + EndPos: 4099, }, Expr: &expr.ClassConstFetch{ Position: &position.Position{ StartLine: 186, - EndLine: 186, - StartPos: 4091, - EndPos: 4098, + EndLine: 186, + StartPos: 4091, + EndPos: 4098, }, Class: &name.Name{ Position: &position.Position{ StartLine: 186, - EndLine: 186, - StartPos: 4091, - EndPos: 4093, + EndLine: 186, + StartPos: 4091, + EndPos: 4093, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 186, - EndLine: 186, - StartPos: 4091, - EndPos: 4093, + EndLine: 186, + StartPos: 4091, + EndPos: 4093, }, Value: "Foo", }, @@ -9201,9 +9127,9 @@ func TestPhp7(t *testing.T) { ConstantName: &node.Identifier{ Position: &position.Position{ StartLine: 186, - EndLine: 186, - StartPos: 4096, - EndPos: 4098, + EndLine: 186, + StartPos: 4096, + EndPos: 4098, }, Value: "Bar", }, @@ -9212,30 +9138,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 187, - EndLine: 187, - StartPos: 4103, - EndPos: 4112, + EndLine: 187, + StartPos: 4103, + EndPos: 4112, }, Expr: &expr.ClassConstFetch{ Position: &position.Position{ StartLine: 187, - EndLine: 187, - StartPos: 4103, - EndPos: 4111, + EndLine: 187, + StartPos: 4103, + EndPos: 4111, }, Class: &expr.Variable{ Position: &position.Position{ StartLine: 187, - EndLine: 187, - StartPos: 4103, - EndPos: 4106, + EndLine: 187, + StartPos: 4103, + EndPos: 4106, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 187, - EndLine: 187, - StartPos: 4103, - EndPos: 4106, + EndLine: 187, + StartPos: 4103, + EndPos: 4106, }, Value: "foo", }, @@ -9243,9 +9169,9 @@ func TestPhp7(t *testing.T) { ConstantName: &node.Identifier{ Position: &position.Position{ StartLine: 187, - EndLine: 187, - StartPos: 4109, - EndPos: 4111, + EndLine: 187, + StartPos: 4109, + EndPos: 4111, }, Value: "Bar", }, @@ -9254,30 +9180,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 188, - EndLine: 188, - StartPos: 4116, - EndPos: 4125, + EndLine: 188, + StartPos: 4116, + EndPos: 4125, }, Expr: &expr.Clone{ Position: &position.Position{ StartLine: 188, - EndLine: 188, - StartPos: 4116, - EndPos: 4123, + EndLine: 188, + StartPos: 4116, + EndPos: 4123, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 188, - EndLine: 188, - StartPos: 4122, - EndPos: 4123, + EndLine: 188, + StartPos: 4122, + EndPos: 4123, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 188, - EndLine: 188, - StartPos: 4122, - EndPos: 4123, + EndLine: 188, + StartPos: 4122, + EndPos: 4123, }, Value: "a", }, @@ -9287,30 +9213,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 189, - EndLine: 189, - StartPos: 4129, - EndPos: 4137, + EndLine: 189, + StartPos: 4129, + EndPos: 4137, }, Expr: &expr.Clone{ Position: &position.Position{ StartLine: 189, - EndLine: 189, - StartPos: 4129, - EndPos: 4136, + EndLine: 189, + StartPos: 4129, + EndPos: 4136, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 189, - EndLine: 189, - StartPos: 4135, - EndPos: 4136, + EndLine: 189, + StartPos: 4135, + EndPos: 4136, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 189, - EndLine: 189, - StartPos: 4135, - EndPos: 4136, + EndLine: 189, + StartPos: 4135, + EndPos: 4136, }, Value: "a", }, @@ -9320,64 +9246,63 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 190, - EndLine: 190, - StartPos: 4141, - EndPos: 4153, + EndLine: 190, + StartPos: 4141, + EndPos: 4153, }, Expr: &expr.Closure{ Position: &position.Position{ StartLine: 190, - EndLine: 190, - StartPos: 4141, - EndPos: 4152, + EndLine: 190, + StartPos: 4141, + EndPos: 4152, }, - ReturnsRef: false, - Static: false, + ReturnsRef: false, + Static: false, PhpDocComment: "", - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 191, - EndLine: 191, - StartPos: 4157, - EndPos: 4190, + EndLine: 191, + StartPos: 4157, + EndPos: 4190, }, Expr: &expr.Closure{ Position: &position.Position{ StartLine: 191, - EndLine: 191, - StartPos: 4157, - EndPos: 4189, + EndLine: 191, + StartPos: 4157, + EndPos: 4189, }, PhpDocComment: "", - ReturnsRef: false, - Static: false, + ReturnsRef: false, + Static: false, Params: []node.Node{ &node.Parameter{ Position: &position.Position{ StartLine: 191, - EndLine: 191, - StartPos: 4166, - EndPos: 4167, + EndLine: 191, + StartPos: 4166, + EndPos: 4167, }, - ByRef: false, + ByRef: false, Variadic: false, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 191, - EndLine: 191, - StartPos: 4166, - EndPos: 4167, + EndLine: 191, + StartPos: 4166, + EndPos: 4167, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 191, - EndLine: 191, - StartPos: 4166, - EndPos: 4167, + EndLine: 191, + StartPos: 4166, + EndPos: 4167, }, Value: "a", }, @@ -9386,25 +9311,25 @@ func TestPhp7(t *testing.T) { &node.Parameter{ Position: &position.Position{ StartLine: 191, - EndLine: 191, - StartPos: 4170, - EndPos: 4171, + EndLine: 191, + StartPos: 4170, + EndPos: 4171, }, - ByRef: false, + ByRef: false, Variadic: false, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 191, - EndLine: 191, - StartPos: 4170, - EndPos: 4171, + EndLine: 191, + StartPos: 4170, + EndPos: 4171, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 191, - EndLine: 191, - StartPos: 4170, - EndPos: 4171, + EndLine: 191, + StartPos: 4170, + EndPos: 4171, }, Value: "b", }, @@ -9414,24 +9339,24 @@ func TestPhp7(t *testing.T) { ClosureUse: &expr.ClosureUse{ Position: &position.Position{ StartLine: 191, - EndLine: 191, - StartPos: 4174, - EndPos: 4186, + EndLine: 191, + StartPos: 4174, + EndPos: 4186, }, Uses: []node.Node{ &expr.Variable{ Position: &position.Position{ StartLine: 191, - EndLine: 191, - StartPos: 4179, - EndPos: 4180, + EndLine: 191, + StartPos: 4179, + EndPos: 4180, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 191, - EndLine: 191, - StartPos: 4179, - EndPos: 4180, + EndLine: 191, + StartPos: 4179, + EndPos: 4180, }, Value: "c", }, @@ -9439,23 +9364,23 @@ func TestPhp7(t *testing.T) { &expr.Reference{ Position: &position.Position{ StartLine: 191, - EndLine: 191, - StartPos: 4183, - EndPos: 4185, + EndLine: 191, + StartPos: 4183, + EndPos: 4185, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 191, - EndLine: 191, - StartPos: 4184, - EndPos: 4185, + EndLine: 191, + StartPos: 4184, + EndPos: 4185, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 191, - EndLine: 191, - StartPos: 4184, - EndPos: 4185, + EndLine: 191, + StartPos: 4184, + EndPos: 4185, }, Value: "d", }, @@ -9463,78 +9388,76 @@ func TestPhp7(t *testing.T) { }, }, }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 192, - EndLine: 192, - StartPos: 4194, - EndPos: 4213, + EndLine: 192, + StartPos: 4194, + EndPos: 4213, }, Expr: &expr.Closure{ Position: &position.Position{ StartLine: 192, - EndLine: 192, - StartPos: 4194, - EndPos: 4212, + EndLine: 192, + StartPos: 4194, + EndPos: 4212, }, - ReturnsRef: false, - Static: false, + ReturnsRef: false, + Static: false, PhpDocComment: "", ReturnType: &name.Name{ Position: &position.Position{ StartLine: 192, - EndLine: 192, - StartPos: 4206, - EndPos: 4209, + EndLine: 192, + StartPos: 4206, + EndPos: 4209, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 192, - EndLine: 192, - StartPos: 4206, - EndPos: 4209, + EndLine: 192, + StartPos: 4206, + EndPos: 4209, }, Value: "void", }, }, }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 193, - EndLine: 193, - StartPos: 4217, - EndPos: 4220, + EndLine: 193, + StartPos: 4217, + EndPos: 4220, }, Expr: &expr.ConstFetch{ Position: &position.Position{ StartLine: 193, - EndLine: 193, - StartPos: 4217, - EndPos: 4219, + EndLine: 193, + StartPos: 4217, + EndPos: 4219, }, Constant: &name.Name{ Position: &position.Position{ StartLine: 193, - EndLine: 193, - StartPos: 4217, - EndPos: 4219, + EndLine: 193, + StartPos: 4217, + EndPos: 4219, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 193, - EndLine: 193, - StartPos: 4217, - EndPos: 4219, + EndLine: 193, + StartPos: 4217, + EndPos: 4219, }, Value: "foo", }, @@ -9545,31 +9468,31 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 194, - EndLine: 194, - StartPos: 4224, - EndPos: 4237, + EndLine: 194, + StartPos: 4224, + EndPos: 4237, }, Expr: &expr.ConstFetch{ Position: &position.Position{ StartLine: 194, - EndLine: 194, - StartPos: 4224, - EndPos: 4236, + EndLine: 194, + StartPos: 4224, + EndPos: 4236, }, Constant: &name.Relative{ Position: &position.Position{ StartLine: 194, - EndLine: 194, - StartPos: 4224, - EndPos: 4236, + EndLine: 194, + StartPos: 4224, + EndPos: 4236, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 194, - EndLine: 194, - StartPos: 4234, - EndPos: 4236, + EndLine: 194, + StartPos: 4234, + EndPos: 4236, }, Value: "foo", }, @@ -9580,31 +9503,31 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 195, - EndLine: 195, - StartPos: 4241, - EndPos: 4245, + EndLine: 195, + StartPos: 4241, + EndPos: 4245, }, Expr: &expr.ConstFetch{ Position: &position.Position{ StartLine: 195, - EndLine: 195, - StartPos: 4241, - EndPos: 4244, + EndLine: 195, + StartPos: 4241, + EndPos: 4244, }, Constant: &name.FullyQualified{ Position: &position.Position{ StartLine: 195, - EndLine: 195, - StartPos: 4241, - EndPos: 4244, + EndLine: 195, + StartPos: 4241, + EndPos: 4244, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 195, - EndLine: 195, - StartPos: 4242, - EndPos: 4244, + EndLine: 195, + StartPos: 4242, + EndPos: 4244, }, Value: "foo", }, @@ -9615,30 +9538,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 197, - EndLine: 197, - StartPos: 4250, - EndPos: 4259, + EndLine: 197, + StartPos: 4250, + EndPos: 4259, }, Expr: &expr.Empty{ Position: &position.Position{ StartLine: 197, - EndLine: 197, - StartPos: 4250, - EndPos: 4258, + EndLine: 197, + StartPos: 4250, + EndPos: 4258, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 197, - EndLine: 197, - StartPos: 4256, - EndPos: 4257, + EndLine: 197, + StartPos: 4256, + EndPos: 4257, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 197, - EndLine: 197, - StartPos: 4256, - EndPos: 4257, + EndLine: 197, + StartPos: 4256, + EndPos: 4257, }, Value: "a", }, @@ -9648,30 +9571,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 198, - EndLine: 198, - StartPos: 4263, - EndPos: 4266, + EndLine: 198, + StartPos: 4263, + EndPos: 4266, }, Expr: &expr.ErrorSuppress{ Position: &position.Position{ StartLine: 198, - EndLine: 198, - StartPos: 4263, - EndPos: 4265, + EndLine: 198, + StartPos: 4263, + EndPos: 4265, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 198, - EndLine: 198, - StartPos: 4264, - EndPos: 4265, + EndLine: 198, + StartPos: 4264, + EndPos: 4265, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 198, - EndLine: 198, - StartPos: 4264, - EndPos: 4265, + EndLine: 198, + StartPos: 4264, + EndPos: 4265, }, Value: "a", }, @@ -9681,30 +9604,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 199, - EndLine: 199, - StartPos: 4270, - EndPos: 4278, + EndLine: 199, + StartPos: 4270, + EndPos: 4278, }, Expr: &expr.Eval{ Position: &position.Position{ StartLine: 199, - EndLine: 199, - StartPos: 4270, - EndPos: 4277, + EndLine: 199, + StartPos: 4270, + EndPos: 4277, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 199, - EndLine: 199, - StartPos: 4275, - EndPos: 4276, + EndLine: 199, + StartPos: 4275, + EndPos: 4276, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 199, - EndLine: 199, - StartPos: 4275, - EndPos: 4276, + EndLine: 199, + StartPos: 4275, + EndPos: 4276, }, Value: "a", }, @@ -9714,46 +9637,46 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 200, - EndLine: 200, - StartPos: 4282, - EndPos: 4286, + EndLine: 200, + StartPos: 4282, + EndPos: 4286, }, Expr: &expr.Exit{ Position: &position.Position{ StartLine: 200, - EndLine: 200, - StartPos: 4282, - EndPos: 4285, + EndLine: 200, + StartPos: 4282, + EndPos: 4285, }, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 201, - EndLine: 201, - StartPos: 4290, - EndPos: 4298, + EndLine: 201, + StartPos: 4290, + EndPos: 4298, }, Expr: &expr.Exit{ Position: &position.Position{ StartLine: 201, - EndLine: 201, - StartPos: 4290, - EndPos: 4297, + EndLine: 201, + StartPos: 4290, + EndPos: 4297, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 201, - EndLine: 201, - StartPos: 4295, - EndPos: 4296, + EndLine: 201, + StartPos: 4295, + EndPos: 4296, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 201, - EndLine: 201, - StartPos: 4295, - EndPos: 4296, + EndLine: 201, + StartPos: 4295, + EndPos: 4296, }, Value: "a", }, @@ -9763,46 +9686,46 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 202, - EndLine: 202, - StartPos: 4302, - EndPos: 4305, + EndLine: 202, + StartPos: 4302, + EndPos: 4305, }, Expr: &expr.Die{ Position: &position.Position{ StartLine: 202, - EndLine: 202, - StartPos: 4302, - EndPos: 4304, + EndLine: 202, + StartPos: 4302, + EndPos: 4304, }, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 203, - EndLine: 203, - StartPos: 4309, - EndPos: 4316, + EndLine: 203, + StartPos: 4309, + EndPos: 4316, }, Expr: &expr.Die{ Position: &position.Position{ StartLine: 203, - EndLine: 203, - StartPos: 4309, - EndPos: 4315, + EndLine: 203, + StartPos: 4309, + EndPos: 4315, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 203, - EndLine: 203, - StartPos: 4313, - EndPos: 4314, + EndLine: 203, + StartPos: 4313, + EndPos: 4314, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 203, - EndLine: 203, - StartPos: 4313, - EndPos: 4314, + EndLine: 203, + StartPos: 4313, + EndPos: 4314, }, Value: "a", }, @@ -9812,31 +9735,31 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 204, - EndLine: 204, - StartPos: 4320, - EndPos: 4325, + EndLine: 204, + StartPos: 4320, + EndPos: 4325, }, Expr: &expr.FunctionCall{ Position: &position.Position{ StartLine: 204, - EndLine: 204, - StartPos: 4320, - EndPos: 4324, + EndLine: 204, + StartPos: 4320, + EndPos: 4324, }, Function: &name.Name{ Position: &position.Position{ StartLine: 204, - EndLine: 204, - StartPos: 4320, - EndPos: 4322, + EndLine: 204, + StartPos: 4320, + EndPos: 4322, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 204, - EndLine: 204, - StartPos: 4320, - EndPos: 4322, + EndLine: 204, + StartPos: 4320, + EndPos: 4322, }, Value: "foo", }, @@ -9845,9 +9768,9 @@ func TestPhp7(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 204, - EndLine: 204, - StartPos: 4323, - EndPos: 4324, + EndLine: 204, + StartPos: 4323, + EndPos: 4324, }, }, }, @@ -9855,31 +9778,31 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 205, - EndLine: 205, - StartPos: 4329, - EndPos: 4344, + EndLine: 205, + StartPos: 4329, + EndPos: 4344, }, Expr: &expr.FunctionCall{ Position: &position.Position{ StartLine: 205, - EndLine: 205, - StartPos: 4329, - EndPos: 4343, + EndLine: 205, + StartPos: 4329, + EndPos: 4343, }, Function: &name.Relative{ Position: &position.Position{ StartLine: 205, - EndLine: 205, - StartPos: 4329, - EndPos: 4341, + EndLine: 205, + StartPos: 4329, + EndPos: 4341, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 205, - EndLine: 205, - StartPos: 4339, - EndPos: 4341, + EndLine: 205, + StartPos: 4339, + EndPos: 4341, }, Value: "foo", }, @@ -9888,9 +9811,9 @@ func TestPhp7(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 205, - EndLine: 205, - StartPos: 4342, - EndPos: 4343, + EndLine: 205, + StartPos: 4342, + EndPos: 4343, }, }, }, @@ -9898,31 +9821,31 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 206, - EndLine: 206, - StartPos: 4348, - EndPos: 4354, + EndLine: 206, + StartPos: 4348, + EndPos: 4354, }, Expr: &expr.FunctionCall{ Position: &position.Position{ StartLine: 206, - EndLine: 206, - StartPos: 4348, - EndPos: 4353, + EndLine: 206, + StartPos: 4348, + EndPos: 4353, }, Function: &name.FullyQualified{ Position: &position.Position{ StartLine: 206, - EndLine: 206, - StartPos: 4348, - EndPos: 4351, + EndLine: 206, + StartPos: 4348, + EndPos: 4351, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 206, - EndLine: 206, - StartPos: 4349, - EndPos: 4351, + EndLine: 206, + StartPos: 4349, + EndPos: 4351, }, Value: "foo", }, @@ -9931,9 +9854,9 @@ func TestPhp7(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 206, - EndLine: 206, - StartPos: 4352, - EndPos: 4353, + EndLine: 206, + StartPos: 4352, + EndPos: 4353, }, }, }, @@ -9941,30 +9864,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 207, - EndLine: 207, - StartPos: 4358, - EndPos: 4364, + EndLine: 207, + StartPos: 4358, + EndPos: 4364, }, Expr: &expr.FunctionCall{ Position: &position.Position{ StartLine: 207, - EndLine: 207, - StartPos: 4358, - EndPos: 4363, + EndLine: 207, + StartPos: 4358, + EndPos: 4363, }, Function: &expr.Variable{ Position: &position.Position{ StartLine: 207, - EndLine: 207, - StartPos: 4358, - EndPos: 4361, + EndLine: 207, + StartPos: 4358, + EndPos: 4361, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 207, - EndLine: 207, - StartPos: 4358, - EndPos: 4361, + EndLine: 207, + StartPos: 4358, + EndPos: 4361, }, Value: "foo", }, @@ -9972,9 +9895,9 @@ func TestPhp7(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 207, - EndLine: 207, - StartPos: 4362, - EndPos: 4363, + EndLine: 207, + StartPos: 4362, + EndPos: 4363, }, }, }, @@ -9982,30 +9905,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 209, - EndLine: 209, - StartPos: 4369, - EndPos: 4373, + EndLine: 209, + StartPos: 4369, + EndPos: 4373, }, Expr: &expr.PostDec{ Position: &position.Position{ StartLine: 209, - EndLine: 209, - StartPos: 4369, - EndPos: 4372, + EndLine: 209, + StartPos: 4369, + EndPos: 4372, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 209, - EndLine: 209, - StartPos: 4369, - EndPos: 4370, + EndLine: 209, + StartPos: 4369, + EndPos: 4370, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 209, - EndLine: 209, - StartPos: 4369, - EndPos: 4370, + EndLine: 209, + StartPos: 4369, + EndPos: 4370, }, Value: "a", }, @@ -10015,30 +9938,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 210, - EndLine: 210, - StartPos: 4377, - EndPos: 4381, + EndLine: 210, + StartPos: 4377, + EndPos: 4381, }, Expr: &expr.PostInc{ Position: &position.Position{ StartLine: 210, - EndLine: 210, - StartPos: 4377, - EndPos: 4380, + EndLine: 210, + StartPos: 4377, + EndPos: 4380, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 210, - EndLine: 210, - StartPos: 4377, - EndPos: 4378, + EndLine: 210, + StartPos: 4377, + EndPos: 4378, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 210, - EndLine: 210, - StartPos: 4377, - EndPos: 4378, + EndLine: 210, + StartPos: 4377, + EndPos: 4378, }, Value: "a", }, @@ -10048,30 +9971,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 211, - EndLine: 211, - StartPos: 4385, - EndPos: 4389, + EndLine: 211, + StartPos: 4385, + EndPos: 4389, }, Expr: &expr.PreDec{ Position: &position.Position{ StartLine: 211, - EndLine: 211, - StartPos: 4385, - EndPos: 4388, + EndLine: 211, + StartPos: 4385, + EndPos: 4388, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 211, - EndLine: 211, - StartPos: 4387, - EndPos: 4388, + EndLine: 211, + StartPos: 4387, + EndPos: 4388, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 211, - EndLine: 211, - StartPos: 4387, - EndPos: 4388, + EndLine: 211, + StartPos: 4387, + EndPos: 4388, }, Value: "a", }, @@ -10081,30 +10004,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 212, - EndLine: 212, - StartPos: 4393, - EndPos: 4397, + EndLine: 212, + StartPos: 4393, + EndPos: 4397, }, Expr: &expr.PreInc{ Position: &position.Position{ StartLine: 212, - EndLine: 212, - StartPos: 4393, - EndPos: 4396, + EndLine: 212, + StartPos: 4393, + EndPos: 4396, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 212, - EndLine: 212, - StartPos: 4395, - EndPos: 4396, + EndLine: 212, + StartPos: 4395, + EndPos: 4396, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 212, - EndLine: 212, - StartPos: 4395, - EndPos: 4396, + EndLine: 212, + StartPos: 4395, + EndPos: 4396, }, Value: "a", }, @@ -10114,30 +10037,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 214, - EndLine: 214, - StartPos: 4402, - EndPos: 4412, + EndLine: 214, + StartPos: 4402, + EndPos: 4412, }, Expr: &expr.Include{ Position: &position.Position{ StartLine: 214, - EndLine: 214, - StartPos: 4402, - EndPos: 4411, + EndLine: 214, + StartPos: 4402, + EndPos: 4411, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 214, - EndLine: 214, - StartPos: 4410, - EndPos: 4411, + EndLine: 214, + StartPos: 4410, + EndPos: 4411, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 214, - EndLine: 214, - StartPos: 4410, - EndPos: 4411, + EndLine: 214, + StartPos: 4410, + EndPos: 4411, }, Value: "a", }, @@ -10147,30 +10070,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 215, - EndLine: 215, - StartPos: 4416, - EndPos: 4431, + EndLine: 215, + StartPos: 4416, + EndPos: 4431, }, Expr: &expr.IncludeOnce{ Position: &position.Position{ StartLine: 215, - EndLine: 215, - StartPos: 4416, - EndPos: 4430, + EndLine: 215, + StartPos: 4416, + EndPos: 4430, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 215, - EndLine: 215, - StartPos: 4429, - EndPos: 4430, + EndLine: 215, + StartPos: 4429, + EndPos: 4430, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 215, - EndLine: 215, - StartPos: 4429, - EndPos: 4430, + EndLine: 215, + StartPos: 4429, + EndPos: 4430, }, Value: "a", }, @@ -10180,30 +10103,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 216, - EndLine: 216, - StartPos: 4435, - EndPos: 4445, + EndLine: 216, + StartPos: 4435, + EndPos: 4445, }, Expr: &expr.Require{ Position: &position.Position{ StartLine: 216, - EndLine: 216, - StartPos: 4435, - EndPos: 4444, + EndLine: 216, + StartPos: 4435, + EndPos: 4444, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 216, - EndLine: 216, - StartPos: 4443, - EndPos: 4444, + EndLine: 216, + StartPos: 4443, + EndPos: 4444, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 216, - EndLine: 216, - StartPos: 4443, - EndPos: 4444, + EndLine: 216, + StartPos: 4443, + EndPos: 4444, }, Value: "a", }, @@ -10213,30 +10136,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 217, - EndLine: 217, - StartPos: 4449, - EndPos: 4464, + EndLine: 217, + StartPos: 4449, + EndPos: 4464, }, Expr: &expr.RequireOnce{ Position: &position.Position{ StartLine: 217, - EndLine: 217, - StartPos: 4449, - EndPos: 4463, + EndLine: 217, + StartPos: 4449, + EndPos: 4463, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 217, - EndLine: 217, - StartPos: 4462, - EndPos: 4463, + EndLine: 217, + StartPos: 4462, + EndPos: 4463, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 217, - EndLine: 217, - StartPos: 4462, - EndPos: 4463, + EndLine: 217, + StartPos: 4462, + EndPos: 4463, }, Value: "a", }, @@ -10246,30 +10169,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 219, - EndLine: 219, - StartPos: 4469, - EndPos: 4486, + EndLine: 219, + StartPos: 4469, + EndPos: 4486, }, Expr: &expr.InstanceOf{ Position: &position.Position{ StartLine: 219, - EndLine: 219, - StartPos: 4469, - EndPos: 4485, + EndLine: 219, + StartPos: 4469, + EndPos: 4485, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 219, - EndLine: 219, - StartPos: 4469, - EndPos: 4470, + EndLine: 219, + StartPos: 4469, + EndPos: 4470, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 219, - EndLine: 219, - StartPos: 4469, - EndPos: 4470, + EndLine: 219, + StartPos: 4469, + EndPos: 4470, }, Value: "a", }, @@ -10277,17 +10200,17 @@ func TestPhp7(t *testing.T) { Class: &name.Name{ Position: &position.Position{ StartLine: 219, - EndLine: 219, - StartPos: 4483, - EndPos: 4485, + EndLine: 219, + StartPos: 4483, + EndPos: 4485, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 219, - EndLine: 219, - StartPos: 4483, - EndPos: 4485, + EndLine: 219, + StartPos: 4483, + EndPos: 4485, }, Value: "Foo", }, @@ -10298,30 +10221,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 220, - EndLine: 220, - StartPos: 4490, - EndPos: 4517, + EndLine: 220, + StartPos: 4490, + EndPos: 4517, }, Expr: &expr.InstanceOf{ Position: &position.Position{ StartLine: 220, - EndLine: 220, - StartPos: 4490, - EndPos: 4516, + EndLine: 220, + StartPos: 4490, + EndPos: 4516, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 220, - EndLine: 220, - StartPos: 4490, - EndPos: 4491, + EndLine: 220, + StartPos: 4490, + EndPos: 4491, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 220, - EndLine: 220, - StartPos: 4490, - EndPos: 4491, + EndLine: 220, + StartPos: 4490, + EndPos: 4491, }, Value: "a", }, @@ -10329,17 +10252,17 @@ func TestPhp7(t *testing.T) { Class: &name.Relative{ Position: &position.Position{ StartLine: 220, - EndLine: 220, - StartPos: 4504, - EndPos: 4516, + EndLine: 220, + StartPos: 4504, + EndPos: 4516, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 220, - EndLine: 220, - StartPos: 4514, - EndPos: 4516, + EndLine: 220, + StartPos: 4514, + EndPos: 4516, }, Value: "Foo", }, @@ -10350,30 +10273,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 221, - EndLine: 221, - StartPos: 4521, - EndPos: 4539, + EndLine: 221, + StartPos: 4521, + EndPos: 4539, }, Expr: &expr.InstanceOf{ Position: &position.Position{ StartLine: 221, - EndLine: 221, - StartPos: 4521, - EndPos: 4538, + EndLine: 221, + StartPos: 4521, + EndPos: 4538, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 221, - EndLine: 221, - StartPos: 4521, - EndPos: 4522, + EndLine: 221, + StartPos: 4521, + EndPos: 4522, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 221, - EndLine: 221, - StartPos: 4521, - EndPos: 4522, + EndLine: 221, + StartPos: 4521, + EndPos: 4522, }, Value: "a", }, @@ -10381,17 +10304,17 @@ func TestPhp7(t *testing.T) { Class: &name.FullyQualified{ Position: &position.Position{ StartLine: 221, - EndLine: 221, - StartPos: 4535, - EndPos: 4538, + EndLine: 221, + StartPos: 4535, + EndPos: 4538, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 221, - EndLine: 221, - StartPos: 4536, - EndPos: 4538, + EndLine: 221, + StartPos: 4536, + EndPos: 4538, }, Value: "Foo", }, @@ -10402,31 +10325,31 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 223, - EndLine: 223, - StartPos: 4544, - EndPos: 4557, + EndLine: 223, + StartPos: 4544, + EndPos: 4557, }, Expr: &expr.Isset{ Position: &position.Position{ StartLine: 223, - EndLine: 223, - StartPos: 4544, - EndPos: 4556, + EndLine: 223, + StartPos: 4544, + EndPos: 4556, }, Variables: []node.Node{ &expr.Variable{ Position: &position.Position{ StartLine: 223, - EndLine: 223, - StartPos: 4550, - EndPos: 4551, + EndLine: 223, + StartPos: 4550, + EndPos: 4551, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 223, - EndLine: 223, - StartPos: 4550, - EndPos: 4551, + EndLine: 223, + StartPos: 4550, + EndPos: 4551, }, Value: "a", }, @@ -10434,16 +10357,16 @@ func TestPhp7(t *testing.T) { &expr.Variable{ Position: &position.Position{ StartLine: 223, - EndLine: 223, - StartPos: 4554, - EndPos: 4555, + EndLine: 223, + StartPos: 4554, + EndPos: 4555, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 223, - EndLine: 223, - StartPos: 4554, - EndPos: 4555, + EndLine: 223, + StartPos: 4554, + EndPos: 4555, }, Value: "b", }, @@ -10454,45 +10377,45 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 224, - EndLine: 224, - StartPos: 4561, - EndPos: 4574, + EndLine: 224, + StartPos: 4561, + EndPos: 4574, }, Expr: &assign.Assign{ Position: &position.Position{ StartLine: 224, - EndLine: 224, - StartPos: 4561, - EndPos: 4573, + EndLine: 224, + StartPos: 4561, + EndPos: 4573, }, Variable: &expr.List{ Position: &position.Position{ StartLine: 224, - EndLine: 224, - StartPos: 4561, - EndPos: 4568, + EndLine: 224, + StartPos: 4561, + EndPos: 4568, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 224, - EndLine: 224, - StartPos: 4566, - EndPos: 4567, + EndLine: 224, + StartPos: 4566, + EndPos: 4567, }, Val: &expr.Variable{ Position: &position.Position{ StartLine: 224, - EndLine: 224, - StartPos: 4566, - EndPos: 4567, + EndLine: 224, + StartPos: 4566, + EndPos: 4567, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 224, - EndLine: 224, - StartPos: 4566, - EndPos: 4567, + EndLine: 224, + StartPos: 4566, + EndPos: 4567, }, Value: "a", }, @@ -10503,16 +10426,16 @@ func TestPhp7(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 224, - EndLine: 224, - StartPos: 4572, - EndPos: 4573, + EndLine: 224, + StartPos: 4572, + EndPos: 4573, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 224, - EndLine: 224, - StartPos: 4572, - EndPos: 4573, + EndLine: 224, + StartPos: 4572, + EndPos: 4573, }, Value: "b", }, @@ -10522,52 +10445,52 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 225, - EndLine: 225, - StartPos: 4578, - EndPos: 4593, + EndLine: 225, + StartPos: 4578, + EndPos: 4593, }, Expr: &assign.Assign{ Position: &position.Position{ StartLine: 225, - EndLine: 225, - StartPos: 4578, - EndPos: 4592, + EndLine: 225, + StartPos: 4578, + EndPos: 4592, }, Variable: &expr.List{ Position: &position.Position{ StartLine: 225, - EndLine: 225, - StartPos: 4578, - EndPos: 4587, + EndLine: 225, + StartPos: 4578, + EndPos: 4587, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 225, - EndLine: 225, - StartPos: 4583, - EndPos: 4586, + EndLine: 225, + StartPos: 4583, + EndPos: 4586, }, Val: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 225, - EndLine: 225, - StartPos: 4583, - EndPos: 4586, + EndLine: 225, + StartPos: 4583, + EndPos: 4586, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 225, - EndLine: 225, - StartPos: 4583, - EndPos: 4584, + EndLine: 225, + StartPos: 4583, + EndPos: 4584, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 225, - EndLine: 225, - StartPos: 4583, - EndPos: 4584, + EndLine: 225, + StartPos: 4583, + EndPos: 4584, }, Value: "a", }, @@ -10579,16 +10502,16 @@ func TestPhp7(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 225, - EndLine: 225, - StartPos: 4591, - EndPos: 4592, + EndLine: 225, + StartPos: 4591, + EndPos: 4592, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 225, - EndLine: 225, - StartPos: 4591, - EndPos: 4592, + EndLine: 225, + StartPos: 4591, + EndPos: 4592, }, Value: "b", }, @@ -10598,60 +10521,60 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 226, - EndLine: 226, - StartPos: 4597, - EndPos: 4616, + EndLine: 226, + StartPos: 4597, + EndPos: 4616, }, Expr: &assign.Assign{ Position: &position.Position{ StartLine: 226, - EndLine: 226, - StartPos: 4597, - EndPos: 4615, + EndLine: 226, + StartPos: 4597, + EndPos: 4615, }, Variable: &expr.List{ Position: &position.Position{ StartLine: 226, - EndLine: 226, - StartPos: 4597, - EndPos: 4610, + EndLine: 226, + StartPos: 4597, + EndPos: 4610, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 226, - EndLine: 226, - StartPos: 4602, - EndPos: 4609, + EndLine: 226, + StartPos: 4602, + EndPos: 4609, }, Val: &expr.List{ Position: &position.Position{ StartLine: 226, - EndLine: 226, - StartPos: 4602, - EndPos: 4609, + EndLine: 226, + StartPos: 4602, + EndPos: 4609, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 226, - EndLine: 226, - StartPos: 4607, - EndPos: 4608, + EndLine: 226, + StartPos: 4607, + EndPos: 4608, }, Val: &expr.Variable{ Position: &position.Position{ StartLine: 226, - EndLine: 226, - StartPos: 4607, - EndPos: 4608, + EndLine: 226, + StartPos: 4607, + EndPos: 4608, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 226, - EndLine: 226, - StartPos: 4607, - EndPos: 4608, + EndLine: 226, + StartPos: 4607, + EndPos: 4608, }, Value: "a", }, @@ -10665,16 +10588,16 @@ func TestPhp7(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 226, - EndLine: 226, - StartPos: 4614, - EndPos: 4615, + EndLine: 226, + StartPos: 4614, + EndPos: 4615, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 226, - EndLine: 226, - StartPos: 4614, - EndPos: 4615, + EndLine: 226, + StartPos: 4614, + EndPos: 4615, }, Value: "b", }, @@ -10684,30 +10607,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 228, - EndLine: 228, - StartPos: 4621, - EndPos: 4630, + EndLine: 228, + StartPos: 4621, + EndPos: 4630, }, Expr: &expr.MethodCall{ Position: &position.Position{ StartLine: 228, - EndLine: 228, - StartPos: 4621, - EndPos: 4629, + EndLine: 228, + StartPos: 4621, + EndPos: 4629, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 228, - EndLine: 228, - StartPos: 4621, - EndPos: 4622, + EndLine: 228, + StartPos: 4621, + EndPos: 4622, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 228, - EndLine: 228, - StartPos: 4621, - EndPos: 4622, + EndLine: 228, + StartPos: 4621, + EndPos: 4622, }, Value: "a", }, @@ -10715,18 +10638,18 @@ func TestPhp7(t *testing.T) { Method: &node.Identifier{ Position: &position.Position{ StartLine: 228, - EndLine: 228, - StartPos: 4625, - EndPos: 4627, + EndLine: 228, + StartPos: 4625, + EndPos: 4627, }, Value: "foo", }, ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 228, - EndLine: 228, - StartPos: 4628, - EndPos: 4629, + EndLine: 228, + StartPos: 4628, + EndPos: 4629, }, }, }, @@ -10734,31 +10657,31 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 229, - EndLine: 229, - StartPos: 4634, - EndPos: 4643, + EndLine: 229, + StartPos: 4634, + EndPos: 4643, }, Expr: &expr.New{ Position: &position.Position{ StartLine: 229, - EndLine: 229, - StartPos: 4634, - EndPos: 4642, + EndLine: 229, + StartPos: 4634, + EndPos: 4642, }, Class: &name.Name{ Position: &position.Position{ StartLine: 229, - EndLine: 229, - StartPos: 4638, - EndPos: 4640, + EndLine: 229, + StartPos: 4638, + EndPos: 4640, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 229, - EndLine: 229, - StartPos: 4638, - EndPos: 4640, + EndLine: 229, + StartPos: 4638, + EndPos: 4640, }, Value: "Foo", }, @@ -10767,9 +10690,9 @@ func TestPhp7(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 229, - EndLine: 229, - StartPos: 4641, - EndPos: 4642, + EndLine: 229, + StartPos: 4641, + EndPos: 4642, }, }, }, @@ -10777,31 +10700,31 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 230, - EndLine: 230, - StartPos: 4647, - EndPos: 4666, + EndLine: 230, + StartPos: 4647, + EndPos: 4666, }, Expr: &expr.New{ Position: &position.Position{ StartLine: 230, - EndLine: 230, - StartPos: 4647, - EndPos: 4665, + EndLine: 230, + StartPos: 4647, + EndPos: 4665, }, Class: &name.Relative{ Position: &position.Position{ StartLine: 230, - EndLine: 230, - StartPos: 4651, - EndPos: 4663, + EndLine: 230, + StartPos: 4651, + EndPos: 4663, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 230, - EndLine: 230, - StartPos: 4661, - EndPos: 4663, + EndLine: 230, + StartPos: 4661, + EndPos: 4663, }, Value: "Foo", }, @@ -10810,9 +10733,9 @@ func TestPhp7(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 230, - EndLine: 230, - StartPos: 4664, - EndPos: 4665, + EndLine: 230, + StartPos: 4664, + EndPos: 4665, }, }, }, @@ -10820,31 +10743,31 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 231, - EndLine: 231, - StartPos: 4670, - EndPos: 4680, + EndLine: 231, + StartPos: 4670, + EndPos: 4680, }, Expr: &expr.New{ Position: &position.Position{ StartLine: 231, - EndLine: 231, - StartPos: 4670, - EndPos: 4679, + EndLine: 231, + StartPos: 4670, + EndPos: 4679, }, Class: &name.FullyQualified{ Position: &position.Position{ StartLine: 231, - EndLine: 231, - StartPos: 4674, - EndPos: 4677, + EndLine: 231, + StartPos: 4674, + EndPos: 4677, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 231, - EndLine: 231, - StartPos: 4675, - EndPos: 4677, + EndLine: 231, + StartPos: 4675, + EndPos: 4677, }, Value: "Foo", }, @@ -10853,9 +10776,9 @@ func TestPhp7(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 231, - EndLine: 231, - StartPos: 4678, - EndPos: 4679, + EndLine: 231, + StartPos: 4678, + EndPos: 4679, }, }, }, @@ -10863,55 +10786,55 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 232, - EndLine: 232, - StartPos: 4684, - EndPos: 4708, + EndLine: 232, + StartPos: 4684, + EndPos: 4708, }, Expr: &expr.New{ Position: &position.Position{ StartLine: 232, - EndLine: 232, - StartPos: 4684, - EndPos: 4707, + EndLine: 232, + StartPos: 4684, + EndPos: 4707, }, Class: &stmt.Class{ Position: &position.Position{ StartLine: 232, - EndLine: 232, - StartPos: 4688, - EndPos: 4707, + EndLine: 232, + StartPos: 4688, + EndPos: 4707, }, PhpDocComment: "", ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 232, - EndLine: 232, - StartPos: 4694, - EndPos: 4704, + EndLine: 232, + StartPos: 4694, + EndPos: 4704, }, Arguments: []node.Node{ &node.Argument{ Position: &position.Position{ StartLine: 232, - EndLine: 232, - StartPos: 4695, - EndPos: 4696, + EndLine: 232, + StartPos: 4695, + EndPos: 4696, }, - Variadic: false, + Variadic: false, IsReference: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 232, - EndLine: 232, - StartPos: 4695, - EndPos: 4696, + EndLine: 232, + StartPos: 4695, + EndPos: 4696, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 232, - EndLine: 232, - StartPos: 4695, - EndPos: 4696, + EndLine: 232, + StartPos: 4695, + EndPos: 4696, }, Value: "a", }, @@ -10920,25 +10843,25 @@ func TestPhp7(t *testing.T) { &node.Argument{ Position: &position.Position{ StartLine: 232, - EndLine: 232, - StartPos: 4699, - EndPos: 4703, + EndLine: 232, + StartPos: 4699, + EndPos: 4703, }, - Variadic: true, + Variadic: true, IsReference: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 232, - EndLine: 232, - StartPos: 4702, - EndPos: 4703, + EndLine: 232, + StartPos: 4702, + EndPos: 4703, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 232, - EndLine: 232, - StartPos: 4702, - EndPos: 4703, + EndLine: 232, + StartPos: 4702, + EndPos: 4703, }, Value: "b", }, @@ -10946,38 +10869,37 @@ func TestPhp7(t *testing.T) { }, }, }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 233, - EndLine: 233, - StartPos: 4712, - EndPos: 4721, + EndLine: 233, + StartPos: 4712, + EndPos: 4721, }, Expr: &expr.Print{ Position: &position.Position{ StartLine: 233, - EndLine: 233, - StartPos: 4712, - EndPos: 4719, + EndLine: 233, + StartPos: 4712, + EndPos: 4719, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 233, - EndLine: 233, - StartPos: 4718, - EndPos: 4719, + EndLine: 233, + StartPos: 4718, + EndPos: 4719, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 233, - EndLine: 233, - StartPos: 4718, - EndPos: 4719, + EndLine: 233, + StartPos: 4718, + EndPos: 4719, }, Value: "a", }, @@ -10987,30 +10909,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 234, - EndLine: 234, - StartPos: 4725, - EndPos: 4732, + EndLine: 234, + StartPos: 4725, + EndPos: 4732, }, Expr: &expr.PropertyFetch{ Position: &position.Position{ StartLine: 234, - EndLine: 234, - StartPos: 4725, - EndPos: 4731, + EndLine: 234, + StartPos: 4725, + EndPos: 4731, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 234, - EndLine: 234, - StartPos: 4725, - EndPos: 4726, + EndLine: 234, + StartPos: 4725, + EndPos: 4726, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 234, - EndLine: 234, - StartPos: 4725, - EndPos: 4726, + EndLine: 234, + StartPos: 4725, + EndPos: 4726, }, Value: "a", }, @@ -11018,9 +10940,9 @@ func TestPhp7(t *testing.T) { Property: &node.Identifier{ Position: &position.Position{ StartLine: 234, - EndLine: 234, - StartPos: 4729, - EndPos: 4731, + EndLine: 234, + StartPos: 4729, + EndPos: 4731, }, Value: "foo", }, @@ -11029,40 +10951,40 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 235, - EndLine: 235, - StartPos: 4736, - EndPos: 4744, + EndLine: 235, + StartPos: 4736, + EndPos: 4744, }, Expr: &expr.ShellExec{ Position: &position.Position{ StartLine: 235, - EndLine: 235, - StartPos: 4736, - EndPos: 4743, + EndLine: 235, + StartPos: 4736, + EndPos: 4743, }, Parts: []node.Node{ &scalar.EncapsedStringPart{ Position: &position.Position{ StartLine: 235, - EndLine: 235, - StartPos: 4737, - EndPos: 4740, + EndLine: 235, + StartPos: 4737, + EndPos: 4740, }, Value: "cmd ", }, &expr.Variable{ Position: &position.Position{ StartLine: 235, - EndLine: 235, - StartPos: 4741, - EndPos: 4742, + EndLine: 235, + StartPos: 4741, + EndPos: 4742, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 235, - EndLine: 235, - StartPos: 4741, - EndPos: 4742, + EndLine: 235, + StartPos: 4741, + EndPos: 4742, }, Value: "a", }, @@ -11073,16 +10995,16 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 236, - EndLine: 236, - StartPos: 4748, - EndPos: 4753, + EndLine: 236, + StartPos: 4748, + EndPos: 4753, }, Expr: &expr.ShellExec{ Position: &position.Position{ StartLine: 236, - EndLine: 236, - StartPos: 4748, - EndPos: 4752, + EndLine: 236, + StartPos: 4748, + EndPos: 4752, }, Parts: []node.Node{ &scalar.EncapsedStringPart{ @@ -11094,67 +11016,65 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 237, - EndLine: 237, - StartPos: 4757, - EndPos: 4759, + EndLine: 237, + StartPos: 4757, + EndPos: 4759, }, Expr: &expr.ShellExec{ Position: &position.Position{ StartLine: 237, - EndLine: 237, - StartPos: 4757, - EndPos: 4758, - }, - Parts: []node.Node{ + EndLine: 237, + StartPos: 4757, + EndPos: 4758, }, + Parts: []node.Node{}, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 238, - EndLine: 238, - StartPos: 4763, - EndPos: 4765, + EndLine: 238, + StartPos: 4763, + EndPos: 4765, }, Expr: &expr.ShortArray{ Position: &position.Position{ StartLine: 238, - EndLine: 238, - StartPos: 4763, - EndPos: 4764, - }, - Items: []node.Node{ + EndLine: 238, + StartPos: 4763, + EndPos: 4764, }, + Items: []node.Node{}, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 239, - EndLine: 239, - StartPos: 4769, - EndPos: 4772, + EndLine: 239, + StartPos: 4769, + EndPos: 4772, }, Expr: &expr.ShortArray{ Position: &position.Position{ StartLine: 239, - EndLine: 239, - StartPos: 4769, - EndPos: 4771, + EndLine: 239, + StartPos: 4769, + EndPos: 4771, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 239, - EndLine: 239, - StartPos: 4770, - EndPos: 4770, + EndLine: 239, + StartPos: 4770, + EndPos: 4770, }, Val: &scalar.Lnumber{ Position: &position.Position{ StartLine: 239, - EndLine: 239, - StartPos: 4770, - EndPos: 4770, + EndLine: 239, + StartPos: 4770, + EndPos: 4770, }, Value: "1", }, @@ -11165,40 +11085,40 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 240, - EndLine: 240, - StartPos: 4776, - EndPos: 4788, + EndLine: 240, + StartPos: 4776, + EndPos: 4788, }, Expr: &expr.ShortArray{ Position: &position.Position{ StartLine: 240, - EndLine: 240, - StartPos: 4776, - EndPos: 4787, + EndLine: 240, + StartPos: 4776, + EndPos: 4787, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 240, - EndLine: 240, - StartPos: 4777, - EndPos: 4780, + EndLine: 240, + StartPos: 4777, + EndPos: 4780, }, Key: &scalar.Lnumber{ Position: &position.Position{ StartLine: 240, - EndLine: 240, - StartPos: 4777, - EndPos: 4777, + EndLine: 240, + StartPos: 4777, + EndPos: 4777, }, Value: "1", }, Val: &scalar.Lnumber{ Position: &position.Position{ StartLine: 240, - EndLine: 240, - StartPos: 4780, - EndPos: 4780, + EndLine: 240, + StartPos: 4780, + EndPos: 4780, }, Value: "1", }, @@ -11206,83 +11126,82 @@ func TestPhp7(t *testing.T) { &expr.ArrayItem{ Position: &position.Position{ StartLine: 240, - EndLine: 240, - StartPos: 4783, - EndPos: 4785, + EndLine: 240, + StartPos: 4783, + EndPos: 4785, }, Val: &expr.Reference{ Position: &position.Position{ StartLine: 240, - EndLine: 240, - StartPos: 4783, - EndPos: 4785, + EndLine: 240, + StartPos: 4783, + EndPos: 4785, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 240, - EndLine: 240, - StartPos: 4784, - EndPos: 4785, + EndLine: 240, + StartPos: 4784, + EndPos: 4785, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 240, - EndLine: 240, - StartPos: 4784, - EndPos: 4785, + EndLine: 240, + StartPos: 4784, + EndPos: 4785, }, Value: "b", }, }, }, }, - &expr.ArrayItem{ - }, + &expr.ArrayItem{}, }, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 242, - EndLine: 242, - StartPos: 4793, - EndPos: 4802, + EndLine: 242, + StartPos: 4793, + EndPos: 4802, }, Expr: &assign.Assign{ Position: &position.Position{ StartLine: 242, - EndLine: 242, - StartPos: 4793, - EndPos: 4801, + EndLine: 242, + StartPos: 4793, + EndPos: 4801, }, Variable: &expr.ShortList{ Position: &position.Position{ StartLine: 242, - EndLine: 242, - StartPos: 4793, - EndPos: 4796, + EndLine: 242, + StartPos: 4793, + EndPos: 4796, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 242, - EndLine: 242, - StartPos: 4794, - EndPos: 4795, + EndLine: 242, + StartPos: 4794, + EndPos: 4795, }, Val: &expr.Variable{ Position: &position.Position{ StartLine: 242, - EndLine: 242, - StartPos: 4794, - EndPos: 4795, + EndLine: 242, + StartPos: 4794, + EndPos: 4795, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 242, - EndLine: 242, - StartPos: 4794, - EndPos: 4795, + EndLine: 242, + StartPos: 4794, + EndPos: 4795, }, Value: "a", }, @@ -11293,16 +11212,16 @@ func TestPhp7(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 242, - EndLine: 242, - StartPos: 4800, - EndPos: 4801, + EndLine: 242, + StartPos: 4800, + EndPos: 4801, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 242, - EndLine: 242, - StartPos: 4800, - EndPos: 4801, + EndLine: 242, + StartPos: 4800, + EndPos: 4801, }, Value: "b", }, @@ -11312,52 +11231,52 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 243, - EndLine: 243, - StartPos: 4806, - EndPos: 4817, + EndLine: 243, + StartPos: 4806, + EndPos: 4817, }, Expr: &assign.Assign{ Position: &position.Position{ StartLine: 243, - EndLine: 243, - StartPos: 4806, - EndPos: 4816, + EndLine: 243, + StartPos: 4806, + EndPos: 4816, }, Variable: &expr.ShortList{ Position: &position.Position{ StartLine: 243, - EndLine: 243, - StartPos: 4806, - EndPos: 4811, + EndLine: 243, + StartPos: 4806, + EndPos: 4811, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 243, - EndLine: 243, - StartPos: 4807, - EndPos: 4810, + EndLine: 243, + StartPos: 4807, + EndPos: 4810, }, Val: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 243, - EndLine: 243, - StartPos: 4807, - EndPos: 4810, + EndLine: 243, + StartPos: 4807, + EndPos: 4810, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 243, - EndLine: 243, - StartPos: 4807, - EndPos: 4808, + EndLine: 243, + StartPos: 4807, + EndPos: 4808, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 243, - EndLine: 243, - StartPos: 4807, - EndPos: 4808, + EndLine: 243, + StartPos: 4807, + EndPos: 4808, }, Value: "a", }, @@ -11369,16 +11288,16 @@ func TestPhp7(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 243, - EndLine: 243, - StartPos: 4815, - EndPos: 4816, + EndLine: 243, + StartPos: 4815, + EndPos: 4816, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 243, - EndLine: 243, - StartPos: 4815, - EndPos: 4816, + EndLine: 243, + StartPos: 4815, + EndPos: 4816, }, Value: "b", }, @@ -11388,60 +11307,60 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 244, - EndLine: 244, - StartPos: 4821, - EndPos: 4836, + EndLine: 244, + StartPos: 4821, + EndPos: 4836, }, Expr: &assign.Assign{ Position: &position.Position{ StartLine: 244, - EndLine: 244, - StartPos: 4821, - EndPos: 4835, + EndLine: 244, + StartPos: 4821, + EndPos: 4835, }, Variable: &expr.ShortList{ Position: &position.Position{ StartLine: 244, - EndLine: 244, - StartPos: 4821, - EndPos: 4830, + EndLine: 244, + StartPos: 4821, + EndPos: 4830, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 244, - EndLine: 244, - StartPos: 4822, - EndPos: 4829, + EndLine: 244, + StartPos: 4822, + EndPos: 4829, }, Val: &expr.List{ Position: &position.Position{ StartLine: 244, - EndLine: 244, - StartPos: 4822, - EndPos: 4829, + EndLine: 244, + StartPos: 4822, + EndPos: 4829, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 244, - EndLine: 244, - StartPos: 4827, - EndPos: 4828, + EndLine: 244, + StartPos: 4827, + EndPos: 4828, }, Val: &expr.Variable{ Position: &position.Position{ StartLine: 244, - EndLine: 244, - StartPos: 4827, - EndPos: 4828, + EndLine: 244, + StartPos: 4827, + EndPos: 4828, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 244, - EndLine: 244, - StartPos: 4827, - EndPos: 4828, + EndLine: 244, + StartPos: 4827, + EndPos: 4828, }, Value: "a", }, @@ -11455,16 +11374,16 @@ func TestPhp7(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 244, - EndLine: 244, - StartPos: 4834, - EndPos: 4835, + EndLine: 244, + StartPos: 4834, + EndPos: 4835, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 244, - EndLine: 244, - StartPos: 4834, - EndPos: 4835, + EndLine: 244, + StartPos: 4834, + EndPos: 4835, }, Value: "b", }, @@ -11474,31 +11393,31 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 245, - EndLine: 245, - StartPos: 4840, - EndPos: 4850, + EndLine: 245, + StartPos: 4840, + EndPos: 4850, }, Expr: &expr.StaticCall{ Position: &position.Position{ StartLine: 245, - EndLine: 245, - StartPos: 4840, - EndPos: 4849, + EndLine: 245, + StartPos: 4840, + EndPos: 4849, }, Class: &name.Name{ Position: &position.Position{ StartLine: 245, - EndLine: 245, - StartPos: 4840, - EndPos: 4842, + EndLine: 245, + StartPos: 4840, + EndPos: 4842, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 245, - EndLine: 245, - StartPos: 4840, - EndPos: 4842, + EndLine: 245, + StartPos: 4840, + EndPos: 4842, }, Value: "Foo", }, @@ -11507,18 +11426,18 @@ func TestPhp7(t *testing.T) { Call: &node.Identifier{ Position: &position.Position{ StartLine: 245, - EndLine: 245, - StartPos: 4845, - EndPos: 4847, + EndLine: 245, + StartPos: 4845, + EndPos: 4847, }, Value: "bar", }, ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 245, - EndLine: 245, - StartPos: 4848, - EndPos: 4849, + EndLine: 245, + StartPos: 4848, + EndPos: 4849, }, }, }, @@ -11526,31 +11445,31 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 246, - EndLine: 246, - StartPos: 4854, - EndPos: 4874, + EndLine: 246, + StartPos: 4854, + EndPos: 4874, }, Expr: &expr.StaticCall{ Position: &position.Position{ StartLine: 246, - EndLine: 246, - StartPos: 4854, - EndPos: 4873, + EndLine: 246, + StartPos: 4854, + EndPos: 4873, }, Class: &name.Relative{ Position: &position.Position{ StartLine: 246, - EndLine: 246, - StartPos: 4854, - EndPos: 4866, + EndLine: 246, + StartPos: 4854, + EndPos: 4866, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 246, - EndLine: 246, - StartPos: 4864, - EndPos: 4866, + EndLine: 246, + StartPos: 4864, + EndPos: 4866, }, Value: "Foo", }, @@ -11559,18 +11478,18 @@ func TestPhp7(t *testing.T) { Call: &node.Identifier{ Position: &position.Position{ StartLine: 246, - EndLine: 246, - StartPos: 4869, - EndPos: 4871, + EndLine: 246, + StartPos: 4869, + EndPos: 4871, }, Value: "bar", }, ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 246, - EndLine: 246, - StartPos: 4872, - EndPos: 4873, + EndLine: 246, + StartPos: 4872, + EndPos: 4873, }, }, }, @@ -11578,31 +11497,31 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 247, - EndLine: 247, - StartPos: 4878, - EndPos: 4889, + EndLine: 247, + StartPos: 4878, + EndPos: 4889, }, Expr: &expr.StaticCall{ Position: &position.Position{ StartLine: 247, - EndLine: 247, - StartPos: 4878, - EndPos: 4888, + EndLine: 247, + StartPos: 4878, + EndPos: 4888, }, Class: &name.FullyQualified{ Position: &position.Position{ StartLine: 247, - EndLine: 247, - StartPos: 4878, - EndPos: 4881, + EndLine: 247, + StartPos: 4878, + EndPos: 4881, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 247, - EndLine: 247, - StartPos: 4879, - EndPos: 4881, + EndLine: 247, + StartPos: 4879, + EndPos: 4881, }, Value: "Foo", }, @@ -11611,18 +11530,18 @@ func TestPhp7(t *testing.T) { Call: &node.Identifier{ Position: &position.Position{ StartLine: 247, - EndLine: 247, - StartPos: 4884, - EndPos: 4886, + EndLine: 247, + StartPos: 4884, + EndPos: 4886, }, Value: "bar", }, ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 247, - EndLine: 247, - StartPos: 4887, - EndPos: 4888, + EndLine: 247, + StartPos: 4887, + EndPos: 4888, }, }, }, @@ -11630,31 +11549,31 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 248, - EndLine: 248, - StartPos: 4893, - EndPos: 4902, + EndLine: 248, + StartPos: 4893, + EndPos: 4902, }, Expr: &expr.StaticPropertyFetch{ Position: &position.Position{ StartLine: 248, - EndLine: 248, - StartPos: 4893, - EndPos: 4901, + EndLine: 248, + StartPos: 4893, + EndPos: 4901, }, Class: &name.Name{ Position: &position.Position{ StartLine: 248, - EndLine: 248, - StartPos: 4893, - EndPos: 4895, + EndLine: 248, + StartPos: 4893, + EndPos: 4895, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 248, - EndLine: 248, - StartPos: 4893, - EndPos: 4895, + EndLine: 248, + StartPos: 4893, + EndPos: 4895, }, Value: "Foo", }, @@ -11663,16 +11582,16 @@ func TestPhp7(t *testing.T) { Property: &expr.Variable{ Position: &position.Position{ StartLine: 248, - EndLine: 248, - StartPos: 4898, - EndPos: 4901, + EndLine: 248, + StartPos: 4898, + EndPos: 4901, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 248, - EndLine: 248, - StartPos: 4898, - EndPos: 4901, + EndLine: 248, + StartPos: 4898, + EndPos: 4901, }, Value: "bar", }, @@ -11682,30 +11601,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 249, - EndLine: 249, - StartPos: 4906, - EndPos: 4916, + EndLine: 249, + StartPos: 4906, + EndPos: 4916, }, Expr: &expr.StaticPropertyFetch{ Position: &position.Position{ StartLine: 249, - EndLine: 249, - StartPos: 4906, - EndPos: 4915, + EndLine: 249, + StartPos: 4906, + EndPos: 4915, }, Class: &expr.Variable{ Position: &position.Position{ StartLine: 249, - EndLine: 249, - StartPos: 4906, - EndPos: 4909, + EndLine: 249, + StartPos: 4906, + EndPos: 4909, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 249, - EndLine: 249, - StartPos: 4906, - EndPos: 4909, + EndLine: 249, + StartPos: 4906, + EndPos: 4909, }, Value: "foo", }, @@ -11713,16 +11632,16 @@ func TestPhp7(t *testing.T) { Property: &expr.Variable{ Position: &position.Position{ StartLine: 249, - EndLine: 249, - StartPos: 4912, - EndPos: 4915, + EndLine: 249, + StartPos: 4912, + EndPos: 4915, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 249, - EndLine: 249, - StartPos: 4912, - EndPos: 4915, + EndLine: 249, + StartPos: 4912, + EndPos: 4915, }, Value: "bar", }, @@ -11732,31 +11651,31 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 250, - EndLine: 250, - StartPos: 4920, - EndPos: 4939, + EndLine: 250, + StartPos: 4920, + EndPos: 4939, }, Expr: &expr.StaticPropertyFetch{ Position: &position.Position{ StartLine: 250, - EndLine: 250, - StartPos: 4920, - EndPos: 4938, + EndLine: 250, + StartPos: 4920, + EndPos: 4938, }, Class: &name.Relative{ Position: &position.Position{ StartLine: 250, - EndLine: 250, - StartPos: 4920, - EndPos: 4932, + EndLine: 250, + StartPos: 4920, + EndPos: 4932, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 250, - EndLine: 250, - StartPos: 4930, - EndPos: 4932, + EndLine: 250, + StartPos: 4930, + EndPos: 4932, }, Value: "Foo", }, @@ -11765,16 +11684,16 @@ func TestPhp7(t *testing.T) { Property: &expr.Variable{ Position: &position.Position{ StartLine: 250, - EndLine: 250, - StartPos: 4935, - EndPos: 4938, + EndLine: 250, + StartPos: 4935, + EndPos: 4938, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 250, - EndLine: 250, - StartPos: 4935, - EndPos: 4938, + EndLine: 250, + StartPos: 4935, + EndPos: 4938, }, Value: "bar", }, @@ -11784,31 +11703,31 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 251, - EndLine: 251, - StartPos: 4943, - EndPos: 4953, + EndLine: 251, + StartPos: 4943, + EndPos: 4953, }, Expr: &expr.StaticPropertyFetch{ Position: &position.Position{ StartLine: 251, - EndLine: 251, - StartPos: 4943, - EndPos: 4952, + EndLine: 251, + StartPos: 4943, + EndPos: 4952, }, Class: &name.FullyQualified{ Position: &position.Position{ StartLine: 251, - EndLine: 251, - StartPos: 4943, - EndPos: 4946, + EndLine: 251, + StartPos: 4943, + EndPos: 4946, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 251, - EndLine: 251, - StartPos: 4944, - EndPos: 4946, + EndLine: 251, + StartPos: 4944, + EndPos: 4946, }, Value: "Foo", }, @@ -11817,16 +11736,16 @@ func TestPhp7(t *testing.T) { Property: &expr.Variable{ Position: &position.Position{ StartLine: 251, - EndLine: 251, - StartPos: 4949, - EndPos: 4952, + EndLine: 251, + StartPos: 4949, + EndPos: 4952, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 251, - EndLine: 251, - StartPos: 4949, - EndPos: 4952, + EndLine: 251, + StartPos: 4949, + EndPos: 4952, }, Value: "bar", }, @@ -11836,30 +11755,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 252, - EndLine: 252, - StartPos: 4957, - EndPos: 4969, + EndLine: 252, + StartPos: 4957, + EndPos: 4969, }, Expr: &expr.Ternary{ Position: &position.Position{ StartLine: 252, - EndLine: 252, - StartPos: 4957, - EndPos: 4968, + EndLine: 252, + StartPos: 4957, + EndPos: 4968, }, Condition: &expr.Variable{ Position: &position.Position{ StartLine: 252, - EndLine: 252, - StartPos: 4957, - EndPos: 4958, + EndLine: 252, + StartPos: 4957, + EndPos: 4958, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 252, - EndLine: 252, - StartPos: 4957, - EndPos: 4958, + EndLine: 252, + StartPos: 4957, + EndPos: 4958, }, Value: "a", }, @@ -11867,16 +11786,16 @@ func TestPhp7(t *testing.T) { IfTrue: &expr.Variable{ Position: &position.Position{ StartLine: 252, - EndLine: 252, - StartPos: 4962, - EndPos: 4963, + EndLine: 252, + StartPos: 4962, + EndPos: 4963, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 252, - EndLine: 252, - StartPos: 4962, - EndPos: 4963, + EndLine: 252, + StartPos: 4962, + EndPos: 4963, }, Value: "b", }, @@ -11884,16 +11803,16 @@ func TestPhp7(t *testing.T) { IfFalse: &expr.Variable{ Position: &position.Position{ StartLine: 252, - EndLine: 252, - StartPos: 4967, - EndPos: 4968, + EndLine: 252, + StartPos: 4967, + EndPos: 4968, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 252, - EndLine: 252, - StartPos: 4967, - EndPos: 4968, + EndLine: 252, + StartPos: 4967, + EndPos: 4968, }, Value: "c", }, @@ -11903,30 +11822,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 253, - EndLine: 253, - StartPos: 4973, - EndPos: 4982, + EndLine: 253, + StartPos: 4973, + EndPos: 4982, }, Expr: &expr.Ternary{ Position: &position.Position{ StartLine: 253, - EndLine: 253, - StartPos: 4973, - EndPos: 4981, + EndLine: 253, + StartPos: 4973, + EndPos: 4981, }, Condition: &expr.Variable{ Position: &position.Position{ StartLine: 253, - EndLine: 253, - StartPos: 4973, - EndPos: 4974, + EndLine: 253, + StartPos: 4973, + EndPos: 4974, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 253, - EndLine: 253, - StartPos: 4973, - EndPos: 4974, + EndLine: 253, + StartPos: 4973, + EndPos: 4974, }, Value: "a", }, @@ -11934,16 +11853,16 @@ func TestPhp7(t *testing.T) { IfFalse: &expr.Variable{ Position: &position.Position{ StartLine: 253, - EndLine: 253, - StartPos: 4980, - EndPos: 4981, + EndLine: 253, + StartPos: 4980, + EndPos: 4981, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 253, - EndLine: 253, - StartPos: 4980, - EndPos: 4981, + EndLine: 253, + StartPos: 4980, + EndPos: 4981, }, Value: "c", }, @@ -11953,30 +11872,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 254, - EndLine: 254, - StartPos: 4986, - EndPos: 5008, + EndLine: 254, + StartPos: 4986, + EndPos: 5008, }, Expr: &expr.Ternary{ Position: &position.Position{ StartLine: 254, - EndLine: 254, - StartPos: 4986, - EndPos: 5007, + EndLine: 254, + StartPos: 4986, + EndPos: 5007, }, Condition: &expr.Variable{ Position: &position.Position{ StartLine: 254, - EndLine: 254, - StartPos: 4986, - EndPos: 4987, + EndLine: 254, + StartPos: 4986, + EndPos: 4987, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 254, - EndLine: 254, - StartPos: 4986, - EndPos: 4987, + EndLine: 254, + StartPos: 4986, + EndPos: 4987, }, Value: "a", }, @@ -11984,23 +11903,23 @@ func TestPhp7(t *testing.T) { IfTrue: &expr.Ternary{ Position: &position.Position{ StartLine: 254, - EndLine: 254, - StartPos: 4991, - EndPos: 5002, + EndLine: 254, + StartPos: 4991, + EndPos: 5002, }, Condition: &expr.Variable{ Position: &position.Position{ StartLine: 254, - EndLine: 254, - StartPos: 4991, - EndPos: 4992, + EndLine: 254, + StartPos: 4991, + EndPos: 4992, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 254, - EndLine: 254, - StartPos: 4991, - EndPos: 4992, + EndLine: 254, + StartPos: 4991, + EndPos: 4992, }, Value: "b", }, @@ -12008,16 +11927,16 @@ func TestPhp7(t *testing.T) { IfTrue: &expr.Variable{ Position: &position.Position{ StartLine: 254, - EndLine: 254, - StartPos: 4996, - EndPos: 4997, + EndLine: 254, + StartPos: 4996, + EndPos: 4997, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 254, - EndLine: 254, - StartPos: 4996, - EndPos: 4997, + EndLine: 254, + StartPos: 4996, + EndPos: 4997, }, Value: "c", }, @@ -12025,16 +11944,16 @@ func TestPhp7(t *testing.T) { IfFalse: &expr.Variable{ Position: &position.Position{ StartLine: 254, - EndLine: 254, - StartPos: 5001, - EndPos: 5002, + EndLine: 254, + StartPos: 5001, + EndPos: 5002, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 254, - EndLine: 254, - StartPos: 5001, - EndPos: 5002, + EndLine: 254, + StartPos: 5001, + EndPos: 5002, }, Value: "d", }, @@ -12043,16 +11962,16 @@ func TestPhp7(t *testing.T) { IfFalse: &expr.Variable{ Position: &position.Position{ StartLine: 254, - EndLine: 254, - StartPos: 5006, - EndPos: 5007, + EndLine: 254, + StartPos: 5006, + EndPos: 5007, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 254, - EndLine: 254, - StartPos: 5006, - EndPos: 5007, + EndLine: 254, + StartPos: 5006, + EndPos: 5007, }, Value: "e", }, @@ -12062,37 +11981,37 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 255, - EndLine: 255, - StartPos: 5012, - EndPos: 5034, + EndLine: 255, + StartPos: 5012, + EndPos: 5034, }, Expr: &expr.Ternary{ Position: &position.Position{ StartLine: 255, - EndLine: 255, - StartPos: 5012, - EndPos: 5033, + EndLine: 255, + StartPos: 5012, + EndPos: 5033, }, Condition: &expr.Ternary{ Position: &position.Position{ StartLine: 255, - EndLine: 255, - StartPos: 5012, - EndPos: 5023, + EndLine: 255, + StartPos: 5012, + EndPos: 5023, }, Condition: &expr.Variable{ Position: &position.Position{ StartLine: 255, - EndLine: 255, - StartPos: 5012, - EndPos: 5013, + EndLine: 255, + StartPos: 5012, + EndPos: 5013, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 255, - EndLine: 255, - StartPos: 5012, - EndPos: 5013, + EndLine: 255, + StartPos: 5012, + EndPos: 5013, }, Value: "a", }, @@ -12100,16 +12019,16 @@ func TestPhp7(t *testing.T) { IfTrue: &expr.Variable{ Position: &position.Position{ StartLine: 255, - EndLine: 255, - StartPos: 5017, - EndPos: 5018, + EndLine: 255, + StartPos: 5017, + EndPos: 5018, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 255, - EndLine: 255, - StartPos: 5017, - EndPos: 5018, + EndLine: 255, + StartPos: 5017, + EndPos: 5018, }, Value: "b", }, @@ -12117,16 +12036,16 @@ func TestPhp7(t *testing.T) { IfFalse: &expr.Variable{ Position: &position.Position{ StartLine: 255, - EndLine: 255, - StartPos: 5022, - EndPos: 5023, + EndLine: 255, + StartPos: 5022, + EndPos: 5023, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 255, - EndLine: 255, - StartPos: 5022, - EndPos: 5023, + EndLine: 255, + StartPos: 5022, + EndPos: 5023, }, Value: "c", }, @@ -12135,16 +12054,16 @@ func TestPhp7(t *testing.T) { IfTrue: &expr.Variable{ Position: &position.Position{ StartLine: 255, - EndLine: 255, - StartPos: 5027, - EndPos: 5028, + EndLine: 255, + StartPos: 5027, + EndPos: 5028, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 255, - EndLine: 255, - StartPos: 5027, - EndPos: 5028, + EndLine: 255, + StartPos: 5027, + EndPos: 5028, }, Value: "d", }, @@ -12152,16 +12071,16 @@ func TestPhp7(t *testing.T) { IfFalse: &expr.Variable{ Position: &position.Position{ StartLine: 255, - EndLine: 255, - StartPos: 5032, - EndPos: 5033, + EndLine: 255, + StartPos: 5032, + EndPos: 5033, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 255, - EndLine: 255, - StartPos: 5032, - EndPos: 5033, + EndLine: 255, + StartPos: 5032, + EndPos: 5033, }, Value: "e", }, @@ -12171,30 +12090,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 256, - EndLine: 256, - StartPos: 5038, - EndPos: 5041, + EndLine: 256, + StartPos: 5038, + EndPos: 5041, }, Expr: &expr.UnaryMinus{ Position: &position.Position{ StartLine: 256, - EndLine: 256, - StartPos: 5038, - EndPos: 5040, + EndLine: 256, + StartPos: 5038, + EndPos: 5040, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 256, - EndLine: 256, - StartPos: 5039, - EndPos: 5040, + EndLine: 256, + StartPos: 5039, + EndPos: 5040, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 256, - EndLine: 256, - StartPos: 5039, - EndPos: 5040, + EndLine: 256, + StartPos: 5039, + EndPos: 5040, }, Value: "a", }, @@ -12204,30 +12123,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 257, - EndLine: 257, - StartPos: 5045, - EndPos: 5048, + EndLine: 257, + StartPos: 5045, + EndPos: 5048, }, Expr: &expr.UnaryPlus{ Position: &position.Position{ StartLine: 257, - EndLine: 257, - StartPos: 5045, - EndPos: 5047, + EndLine: 257, + StartPos: 5045, + EndPos: 5047, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 257, - EndLine: 257, - StartPos: 5046, - EndPos: 5047, + EndLine: 257, + StartPos: 5046, + EndPos: 5047, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 257, - EndLine: 257, - StartPos: 5046, - EndPos: 5047, + EndLine: 257, + StartPos: 5046, + EndPos: 5047, }, Value: "a", }, @@ -12237,30 +12156,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 258, - EndLine: 258, - StartPos: 5052, - EndPos: 5055, + EndLine: 258, + StartPos: 5052, + EndPos: 5055, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 258, - EndLine: 258, - StartPos: 5052, - EndPos: 5054, + EndLine: 258, + StartPos: 5052, + EndPos: 5054, }, VarName: &expr.Variable{ Position: &position.Position{ StartLine: 258, - EndLine: 258, - StartPos: 5053, - EndPos: 5054, + EndLine: 258, + StartPos: 5053, + EndPos: 5054, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 258, - EndLine: 258, - StartPos: 5053, - EndPos: 5054, + EndLine: 258, + StartPos: 5053, + EndPos: 5054, }, Value: "a", }, @@ -12270,46 +12189,46 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 259, - EndLine: 259, - StartPos: 5059, - EndPos: 5064, + EndLine: 259, + StartPos: 5059, + EndPos: 5064, }, Expr: &expr.Yield{ Position: &position.Position{ StartLine: 259, - EndLine: 259, - StartPos: 5059, - EndPos: 5063, + EndLine: 259, + StartPos: 5059, + EndPos: 5063, }, }, }, &stmt.Expression{ Position: &position.Position{ StartLine: 260, - EndLine: 260, - StartPos: 5068, - EndPos: 5076, + EndLine: 260, + StartPos: 5068, + EndPos: 5076, }, Expr: &expr.Yield{ Position: &position.Position{ StartLine: 260, - EndLine: 260, - StartPos: 5068, - EndPos: 5075, + EndLine: 260, + StartPos: 5068, + EndPos: 5075, }, Value: &expr.Variable{ Position: &position.Position{ StartLine: 260, - EndLine: 260, - StartPos: 5074, - EndPos: 5075, + EndLine: 260, + StartPos: 5074, + EndPos: 5075, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 260, - EndLine: 260, - StartPos: 5074, - EndPos: 5075, + EndLine: 260, + StartPos: 5074, + EndPos: 5075, }, Value: "a", }, @@ -12319,30 +12238,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 261, - EndLine: 261, - StartPos: 5080, - EndPos: 5094, + EndLine: 261, + StartPos: 5080, + EndPos: 5094, }, Expr: &expr.Yield{ Position: &position.Position{ StartLine: 261, - EndLine: 261, - StartPos: 5080, - EndPos: 5093, + EndLine: 261, + StartPos: 5080, + EndPos: 5093, }, Key: &expr.Variable{ Position: &position.Position{ StartLine: 261, - EndLine: 261, - StartPos: 5086, - EndPos: 5087, + EndLine: 261, + StartPos: 5086, + EndPos: 5087, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 261, - EndLine: 261, - StartPos: 5086, - EndPos: 5087, + EndLine: 261, + StartPos: 5086, + EndPos: 5087, }, Value: "a", }, @@ -12350,16 +12269,16 @@ func TestPhp7(t *testing.T) { Value: &expr.Variable{ Position: &position.Position{ StartLine: 261, - EndLine: 261, - StartPos: 5092, - EndPos: 5093, + EndLine: 261, + StartPos: 5092, + EndPos: 5093, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 261, - EndLine: 261, - StartPos: 5092, - EndPos: 5093, + EndLine: 261, + StartPos: 5092, + EndPos: 5093, }, Value: "b", }, @@ -12369,30 +12288,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 262, - EndLine: 262, - StartPos: 5098, - EndPos: 5111, + EndLine: 262, + StartPos: 5098, + EndPos: 5111, }, Expr: &expr.YieldFrom{ Position: &position.Position{ StartLine: 262, - EndLine: 262, - StartPos: 5098, - EndPos: 5110, + EndLine: 262, + StartPos: 5098, + EndPos: 5110, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 262, - EndLine: 262, - StartPos: 5109, - EndPos: 5110, + EndLine: 262, + StartPos: 5109, + EndPos: 5110, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 262, - EndLine: 262, - StartPos: 5109, - EndPos: 5110, + EndLine: 262, + StartPos: 5109, + EndPos: 5110, }, Value: "a", }, @@ -12402,30 +12321,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 264, - EndLine: 264, - StartPos: 5118, - EndPos: 5127, + EndLine: 264, + StartPos: 5118, + EndPos: 5127, }, Expr: &cast.Array{ Position: &position.Position{ StartLine: 264, - EndLine: 264, - StartPos: 5118, - EndPos: 5126, + EndLine: 264, + StartPos: 5118, + EndPos: 5126, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 264, - EndLine: 264, - StartPos: 5125, - EndPos: 5126, + EndLine: 264, + StartPos: 5125, + EndPos: 5126, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 264, - EndLine: 264, - StartPos: 5125, - EndPos: 5126, + EndLine: 264, + StartPos: 5125, + EndPos: 5126, }, Value: "a", }, @@ -12435,30 +12354,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 265, - EndLine: 265, - StartPos: 5131, - EndPos: 5142, + EndLine: 265, + StartPos: 5131, + EndPos: 5142, }, Expr: &cast.Bool{ Position: &position.Position{ StartLine: 265, - EndLine: 265, - StartPos: 5131, - EndPos: 5141, + EndLine: 265, + StartPos: 5131, + EndPos: 5141, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 265, - EndLine: 265, - StartPos: 5140, - EndPos: 5141, + EndLine: 265, + StartPos: 5140, + EndPos: 5141, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 265, - EndLine: 265, - StartPos: 5140, - EndPos: 5141, + EndLine: 265, + StartPos: 5140, + EndPos: 5141, }, Value: "a", }, @@ -12468,30 +12387,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 266, - EndLine: 266, - StartPos: 5146, - EndPos: 5154, + EndLine: 266, + StartPos: 5146, + EndPos: 5154, }, Expr: &cast.Bool{ Position: &position.Position{ StartLine: 266, - EndLine: 266, - StartPos: 5146, - EndPos: 5153, + EndLine: 266, + StartPos: 5146, + EndPos: 5153, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 266, - EndLine: 266, - StartPos: 5152, - EndPos: 5153, + EndLine: 266, + StartPos: 5152, + EndPos: 5153, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 266, - EndLine: 266, - StartPos: 5152, - EndPos: 5153, + EndLine: 266, + StartPos: 5152, + EndPos: 5153, }, Value: "a", }, @@ -12501,30 +12420,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 267, - EndLine: 267, - StartPos: 5158, - EndPos: 5168, + EndLine: 267, + StartPos: 5158, + EndPos: 5168, }, Expr: &cast.Double{ Position: &position.Position{ StartLine: 267, - EndLine: 267, - StartPos: 5158, - EndPos: 5167, + EndLine: 267, + StartPos: 5158, + EndPos: 5167, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 267, - EndLine: 267, - StartPos: 5166, - EndPos: 5167, + EndLine: 267, + StartPos: 5166, + EndPos: 5167, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 267, - EndLine: 267, - StartPos: 5166, - EndPos: 5167, + EndLine: 267, + StartPos: 5166, + EndPos: 5167, }, Value: "a", }, @@ -12534,30 +12453,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 268, - EndLine: 268, - StartPos: 5172, - EndPos: 5181, + EndLine: 268, + StartPos: 5172, + EndPos: 5181, }, Expr: &cast.Double{ Position: &position.Position{ StartLine: 268, - EndLine: 268, - StartPos: 5172, - EndPos: 5180, + EndLine: 268, + StartPos: 5172, + EndPos: 5180, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 268, - EndLine: 268, - StartPos: 5179, - EndPos: 5180, + EndLine: 268, + StartPos: 5179, + EndPos: 5180, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 268, - EndLine: 268, - StartPos: 5179, - EndPos: 5180, + EndLine: 268, + StartPos: 5179, + EndPos: 5180, }, Value: "a", }, @@ -12567,30 +12486,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 269, - EndLine: 269, - StartPos: 5185, - EndPos: 5196, + EndLine: 269, + StartPos: 5185, + EndPos: 5196, }, Expr: &cast.Int{ Position: &position.Position{ StartLine: 269, - EndLine: 269, - StartPos: 5185, - EndPos: 5195, + EndLine: 269, + StartPos: 5185, + EndPos: 5195, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 269, - EndLine: 269, - StartPos: 5194, - EndPos: 5195, + EndLine: 269, + StartPos: 5194, + EndPos: 5195, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 269, - EndLine: 269, - StartPos: 5194, - EndPos: 5195, + EndLine: 269, + StartPos: 5194, + EndPos: 5195, }, Value: "a", }, @@ -12600,30 +12519,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 270, - EndLine: 270, - StartPos: 5200, - EndPos: 5207, + EndLine: 270, + StartPos: 5200, + EndPos: 5207, }, Expr: &cast.Int{ Position: &position.Position{ StartLine: 270, - EndLine: 270, - StartPos: 5200, - EndPos: 5206, + EndLine: 270, + StartPos: 5200, + EndPos: 5206, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 270, - EndLine: 270, - StartPos: 5205, - EndPos: 5206, + EndLine: 270, + StartPos: 5205, + EndPos: 5206, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 270, - EndLine: 270, - StartPos: 5205, - EndPos: 5206, + EndLine: 270, + StartPos: 5205, + EndPos: 5206, }, Value: "a", }, @@ -12633,30 +12552,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 271, - EndLine: 271, - StartPos: 5211, - EndPos: 5221, + EndLine: 271, + StartPos: 5211, + EndPos: 5221, }, Expr: &cast.Object{ Position: &position.Position{ StartLine: 271, - EndLine: 271, - StartPos: 5211, - EndPos: 5220, + EndLine: 271, + StartPos: 5211, + EndPos: 5220, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 271, - EndLine: 271, - StartPos: 5219, - EndPos: 5220, + EndLine: 271, + StartPos: 5219, + EndPos: 5220, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 271, - EndLine: 271, - StartPos: 5219, - EndPos: 5220, + EndLine: 271, + StartPos: 5219, + EndPos: 5220, }, Value: "a", }, @@ -12666,30 +12585,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 272, - EndLine: 272, - StartPos: 5225, - EndPos: 5235, + EndLine: 272, + StartPos: 5225, + EndPos: 5235, }, Expr: &cast.String{ Position: &position.Position{ StartLine: 272, - EndLine: 272, - StartPos: 5225, - EndPos: 5234, + EndLine: 272, + StartPos: 5225, + EndPos: 5234, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 272, - EndLine: 272, - StartPos: 5233, - EndPos: 5234, + EndLine: 272, + StartPos: 5233, + EndPos: 5234, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 272, - EndLine: 272, - StartPos: 5233, - EndPos: 5234, + EndLine: 272, + StartPos: 5233, + EndPos: 5234, }, Value: "a", }, @@ -12699,30 +12618,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 273, - EndLine: 273, - StartPos: 5239, - EndPos: 5248, + EndLine: 273, + StartPos: 5239, + EndPos: 5248, }, Expr: &cast.Unset{ Position: &position.Position{ StartLine: 273, - EndLine: 273, - StartPos: 5239, - EndPos: 5247, + EndLine: 273, + StartPos: 5239, + EndPos: 5247, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 273, - EndLine: 273, - StartPos: 5246, - EndPos: 5247, + EndLine: 273, + StartPos: 5246, + EndPos: 5247, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 273, - EndLine: 273, - StartPos: 5246, - EndPos: 5247, + EndLine: 273, + StartPos: 5246, + EndPos: 5247, }, Value: "a", }, @@ -12732,30 +12651,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 275, - EndLine: 275, - StartPos: 5253, - EndPos: 5260, + EndLine: 275, + StartPos: 5253, + EndPos: 5260, }, Expr: &binary.BitwiseAnd{ Position: &position.Position{ StartLine: 275, - EndLine: 275, - StartPos: 5253, - EndPos: 5259, + EndLine: 275, + StartPos: 5253, + EndPos: 5259, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 275, - EndLine: 275, - StartPos: 5253, - EndPos: 5254, + EndLine: 275, + StartPos: 5253, + EndPos: 5254, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 275, - EndLine: 275, - StartPos: 5253, - EndPos: 5254, + EndLine: 275, + StartPos: 5253, + EndPos: 5254, }, Value: "a", }, @@ -12763,16 +12682,16 @@ func TestPhp7(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 275, - EndLine: 275, - StartPos: 5258, - EndPos: 5259, + EndLine: 275, + StartPos: 5258, + EndPos: 5259, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 275, - EndLine: 275, - StartPos: 5258, - EndPos: 5259, + EndLine: 275, + StartPos: 5258, + EndPos: 5259, }, Value: "b", }, @@ -12782,30 +12701,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 276, - EndLine: 276, - StartPos: 5264, - EndPos: 5271, + EndLine: 276, + StartPos: 5264, + EndPos: 5271, }, Expr: &binary.BitwiseOr{ Position: &position.Position{ StartLine: 276, - EndLine: 276, - StartPos: 5264, - EndPos: 5270, + EndLine: 276, + StartPos: 5264, + EndPos: 5270, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 276, - EndLine: 276, - StartPos: 5264, - EndPos: 5265, + EndLine: 276, + StartPos: 5264, + EndPos: 5265, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 276, - EndLine: 276, - StartPos: 5264, - EndPos: 5265, + EndLine: 276, + StartPos: 5264, + EndPos: 5265, }, Value: "a", }, @@ -12813,16 +12732,16 @@ func TestPhp7(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 276, - EndLine: 276, - StartPos: 5269, - EndPos: 5270, + EndLine: 276, + StartPos: 5269, + EndPos: 5270, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 276, - EndLine: 276, - StartPos: 5269, - EndPos: 5270, + EndLine: 276, + StartPos: 5269, + EndPos: 5270, }, Value: "b", }, @@ -12832,30 +12751,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 277, - EndLine: 277, - StartPos: 5275, - EndPos: 5282, + EndLine: 277, + StartPos: 5275, + EndPos: 5282, }, Expr: &binary.BitwiseXor{ Position: &position.Position{ StartLine: 277, - EndLine: 277, - StartPos: 5275, - EndPos: 5281, + EndLine: 277, + StartPos: 5275, + EndPos: 5281, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 277, - EndLine: 277, - StartPos: 5275, - EndPos: 5276, + EndLine: 277, + StartPos: 5275, + EndPos: 5276, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 277, - EndLine: 277, - StartPos: 5275, - EndPos: 5276, + EndLine: 277, + StartPos: 5275, + EndPos: 5276, }, Value: "a", }, @@ -12863,16 +12782,16 @@ func TestPhp7(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 277, - EndLine: 277, - StartPos: 5280, - EndPos: 5281, + EndLine: 277, + StartPos: 5280, + EndPos: 5281, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 277, - EndLine: 277, - StartPos: 5280, - EndPos: 5281, + EndLine: 277, + StartPos: 5280, + EndPos: 5281, }, Value: "b", }, @@ -12882,30 +12801,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 278, - EndLine: 278, - StartPos: 5286, - EndPos: 5294, + EndLine: 278, + StartPos: 5286, + EndPos: 5294, }, Expr: &binary.BooleanAnd{ Position: &position.Position{ StartLine: 278, - EndLine: 278, - StartPos: 5286, - EndPos: 5293, + EndLine: 278, + StartPos: 5286, + EndPos: 5293, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 278, - EndLine: 278, - StartPos: 5286, - EndPos: 5287, + EndLine: 278, + StartPos: 5286, + EndPos: 5287, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 278, - EndLine: 278, - StartPos: 5286, - EndPos: 5287, + EndLine: 278, + StartPos: 5286, + EndPos: 5287, }, Value: "a", }, @@ -12913,16 +12832,16 @@ func TestPhp7(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 278, - EndLine: 278, - StartPos: 5292, - EndPos: 5293, + EndLine: 278, + StartPos: 5292, + EndPos: 5293, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 278, - EndLine: 278, - StartPos: 5292, - EndPos: 5293, + EndLine: 278, + StartPos: 5292, + EndPos: 5293, }, Value: "b", }, @@ -12932,30 +12851,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 279, - EndLine: 279, - StartPos: 5298, - EndPos: 5306, + EndLine: 279, + StartPos: 5298, + EndPos: 5306, }, Expr: &binary.BooleanOr{ Position: &position.Position{ StartLine: 279, - EndLine: 279, - StartPos: 5298, - EndPos: 5305, + EndLine: 279, + StartPos: 5298, + EndPos: 5305, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 279, - EndLine: 279, - StartPos: 5298, - EndPos: 5299, + EndLine: 279, + StartPos: 5298, + EndPos: 5299, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 279, - EndLine: 279, - StartPos: 5298, - EndPos: 5299, + EndLine: 279, + StartPos: 5298, + EndPos: 5299, }, Value: "a", }, @@ -12963,16 +12882,16 @@ func TestPhp7(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 279, - EndLine: 279, - StartPos: 5304, - EndPos: 5305, + EndLine: 279, + StartPos: 5304, + EndPos: 5305, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 279, - EndLine: 279, - StartPos: 5304, - EndPos: 5305, + EndLine: 279, + StartPos: 5304, + EndPos: 5305, }, Value: "b", }, @@ -12982,30 +12901,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 280, - EndLine: 280, - StartPos: 5310, - EndPos: 5318, + EndLine: 280, + StartPos: 5310, + EndPos: 5318, }, Expr: &binary.Coalesce{ Position: &position.Position{ StartLine: 280, - EndLine: 280, - StartPos: 5310, - EndPos: 5317, + EndLine: 280, + StartPos: 5310, + EndPos: 5317, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 280, - EndLine: 280, - StartPos: 5310, - EndPos: 5311, + EndLine: 280, + StartPos: 5310, + EndPos: 5311, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 280, - EndLine: 280, - StartPos: 5310, - EndPos: 5311, + EndLine: 280, + StartPos: 5310, + EndPos: 5311, }, Value: "a", }, @@ -13013,16 +12932,16 @@ func TestPhp7(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 280, - EndLine: 280, - StartPos: 5316, - EndPos: 5317, + EndLine: 280, + StartPos: 5316, + EndPos: 5317, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 280, - EndLine: 280, - StartPos: 5316, - EndPos: 5317, + EndLine: 280, + StartPos: 5316, + EndPos: 5317, }, Value: "b", }, @@ -13032,30 +12951,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 281, - EndLine: 281, - StartPos: 5322, - EndPos: 5329, + EndLine: 281, + StartPos: 5322, + EndPos: 5329, }, Expr: &binary.Concat{ Position: &position.Position{ StartLine: 281, - EndLine: 281, - StartPos: 5322, - EndPos: 5328, + EndLine: 281, + StartPos: 5322, + EndPos: 5328, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 281, - EndLine: 281, - StartPos: 5322, - EndPos: 5323, + EndLine: 281, + StartPos: 5322, + EndPos: 5323, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 281, - EndLine: 281, - StartPos: 5322, - EndPos: 5323, + EndLine: 281, + StartPos: 5322, + EndPos: 5323, }, Value: "a", }, @@ -13063,16 +12982,16 @@ func TestPhp7(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 281, - EndLine: 281, - StartPos: 5327, - EndPos: 5328, + EndLine: 281, + StartPos: 5327, + EndPos: 5328, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 281, - EndLine: 281, - StartPos: 5327, - EndPos: 5328, + EndLine: 281, + StartPos: 5327, + EndPos: 5328, }, Value: "b", }, @@ -13082,30 +13001,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 282, - EndLine: 282, - StartPos: 5333, - EndPos: 5340, + EndLine: 282, + StartPos: 5333, + EndPos: 5340, }, Expr: &binary.Div{ Position: &position.Position{ StartLine: 282, - EndLine: 282, - StartPos: 5333, - EndPos: 5339, + EndLine: 282, + StartPos: 5333, + EndPos: 5339, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 282, - EndLine: 282, - StartPos: 5333, - EndPos: 5334, + EndLine: 282, + StartPos: 5333, + EndPos: 5334, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 282, - EndLine: 282, - StartPos: 5333, - EndPos: 5334, + EndLine: 282, + StartPos: 5333, + EndPos: 5334, }, Value: "a", }, @@ -13113,16 +13032,16 @@ func TestPhp7(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 282, - EndLine: 282, - StartPos: 5338, - EndPos: 5339, + EndLine: 282, + StartPos: 5338, + EndPos: 5339, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 282, - EndLine: 282, - StartPos: 5338, - EndPos: 5339, + EndLine: 282, + StartPos: 5338, + EndPos: 5339, }, Value: "b", }, @@ -13132,30 +13051,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 283, - EndLine: 283, - StartPos: 5344, - EndPos: 5352, + EndLine: 283, + StartPos: 5344, + EndPos: 5352, }, Expr: &binary.Equal{ Position: &position.Position{ StartLine: 283, - EndLine: 283, - StartPos: 5344, - EndPos: 5351, + EndLine: 283, + StartPos: 5344, + EndPos: 5351, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 283, - EndLine: 283, - StartPos: 5344, - EndPos: 5345, + EndLine: 283, + StartPos: 5344, + EndPos: 5345, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 283, - EndLine: 283, - StartPos: 5344, - EndPos: 5345, + EndLine: 283, + StartPos: 5344, + EndPos: 5345, }, Value: "a", }, @@ -13163,16 +13082,16 @@ func TestPhp7(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 283, - EndLine: 283, - StartPos: 5350, - EndPos: 5351, + EndLine: 283, + StartPos: 5350, + EndPos: 5351, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 283, - EndLine: 283, - StartPos: 5350, - EndPos: 5351, + EndLine: 283, + StartPos: 5350, + EndPos: 5351, }, Value: "b", }, @@ -13182,30 +13101,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 284, - EndLine: 284, - StartPos: 5356, - EndPos: 5364, + EndLine: 284, + StartPos: 5356, + EndPos: 5364, }, Expr: &binary.GreaterOrEqual{ Position: &position.Position{ StartLine: 284, - EndLine: 284, - StartPos: 5356, - EndPos: 5363, + EndLine: 284, + StartPos: 5356, + EndPos: 5363, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 284, - EndLine: 284, - StartPos: 5356, - EndPos: 5357, + EndLine: 284, + StartPos: 5356, + EndPos: 5357, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 284, - EndLine: 284, - StartPos: 5356, - EndPos: 5357, + EndLine: 284, + StartPos: 5356, + EndPos: 5357, }, Value: "a", }, @@ -13213,16 +13132,16 @@ func TestPhp7(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 284, - EndLine: 284, - StartPos: 5362, - EndPos: 5363, + EndLine: 284, + StartPos: 5362, + EndPos: 5363, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 284, - EndLine: 284, - StartPos: 5362, - EndPos: 5363, + EndLine: 284, + StartPos: 5362, + EndPos: 5363, }, Value: "b", }, @@ -13232,30 +13151,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 285, - EndLine: 285, - StartPos: 5368, - EndPos: 5375, + EndLine: 285, + StartPos: 5368, + EndPos: 5375, }, Expr: &binary.Greater{ Position: &position.Position{ StartLine: 285, - EndLine: 285, - StartPos: 5368, - EndPos: 5374, + EndLine: 285, + StartPos: 5368, + EndPos: 5374, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 285, - EndLine: 285, - StartPos: 5368, - EndPos: 5369, + EndLine: 285, + StartPos: 5368, + EndPos: 5369, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 285, - EndLine: 285, - StartPos: 5368, - EndPos: 5369, + EndLine: 285, + StartPos: 5368, + EndPos: 5369, }, Value: "a", }, @@ -13263,16 +13182,16 @@ func TestPhp7(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 285, - EndLine: 285, - StartPos: 5373, - EndPos: 5374, + EndLine: 285, + StartPos: 5373, + EndPos: 5374, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 285, - EndLine: 285, - StartPos: 5373, - EndPos: 5374, + EndLine: 285, + StartPos: 5373, + EndPos: 5374, }, Value: "b", }, @@ -13282,30 +13201,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 286, - EndLine: 286, - StartPos: 5379, - EndPos: 5388, + EndLine: 286, + StartPos: 5379, + EndPos: 5388, }, Expr: &binary.Identical{ Position: &position.Position{ StartLine: 286, - EndLine: 286, - StartPos: 5379, - EndPos: 5387, + EndLine: 286, + StartPos: 5379, + EndPos: 5387, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 286, - EndLine: 286, - StartPos: 5379, - EndPos: 5380, + EndLine: 286, + StartPos: 5379, + EndPos: 5380, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 286, - EndLine: 286, - StartPos: 5379, - EndPos: 5380, + EndLine: 286, + StartPos: 5379, + EndPos: 5380, }, Value: "a", }, @@ -13313,16 +13232,16 @@ func TestPhp7(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 286, - EndLine: 286, - StartPos: 5386, - EndPos: 5387, + EndLine: 286, + StartPos: 5386, + EndPos: 5387, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 286, - EndLine: 286, - StartPos: 5386, - EndPos: 5387, + EndLine: 286, + StartPos: 5386, + EndPos: 5387, }, Value: "b", }, @@ -13332,30 +13251,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 287, - EndLine: 287, - StartPos: 5392, - EndPos: 5401, + EndLine: 287, + StartPos: 5392, + EndPos: 5401, }, Expr: &binary.LogicalAnd{ Position: &position.Position{ StartLine: 287, - EndLine: 287, - StartPos: 5392, - EndPos: 5400, + EndLine: 287, + StartPos: 5392, + EndPos: 5400, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 287, - EndLine: 287, - StartPos: 5392, - EndPos: 5393, + EndLine: 287, + StartPos: 5392, + EndPos: 5393, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 287, - EndLine: 287, - StartPos: 5392, - EndPos: 5393, + EndLine: 287, + StartPos: 5392, + EndPos: 5393, }, Value: "a", }, @@ -13363,16 +13282,16 @@ func TestPhp7(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 287, - EndLine: 287, - StartPos: 5399, - EndPos: 5400, + EndLine: 287, + StartPos: 5399, + EndPos: 5400, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 287, - EndLine: 287, - StartPos: 5399, - EndPos: 5400, + EndLine: 287, + StartPos: 5399, + EndPos: 5400, }, Value: "b", }, @@ -13382,30 +13301,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 288, - EndLine: 288, - StartPos: 5405, - EndPos: 5413, + EndLine: 288, + StartPos: 5405, + EndPos: 5413, }, Expr: &binary.LogicalOr{ Position: &position.Position{ StartLine: 288, - EndLine: 288, - StartPos: 5405, - EndPos: 5412, + EndLine: 288, + StartPos: 5405, + EndPos: 5412, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 288, - EndLine: 288, - StartPos: 5405, - EndPos: 5406, + EndLine: 288, + StartPos: 5405, + EndPos: 5406, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 288, - EndLine: 288, - StartPos: 5405, - EndPos: 5406, + EndLine: 288, + StartPos: 5405, + EndPos: 5406, }, Value: "a", }, @@ -13413,16 +13332,16 @@ func TestPhp7(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 288, - EndLine: 288, - StartPos: 5411, - EndPos: 5412, + EndLine: 288, + StartPos: 5411, + EndPos: 5412, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 288, - EndLine: 288, - StartPos: 5411, - EndPos: 5412, + EndLine: 288, + StartPos: 5411, + EndPos: 5412, }, Value: "b", }, @@ -13432,30 +13351,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 289, - EndLine: 289, - StartPos: 5417, - EndPos: 5426, + EndLine: 289, + StartPos: 5417, + EndPos: 5426, }, Expr: &binary.LogicalXor{ Position: &position.Position{ StartLine: 289, - EndLine: 289, - StartPos: 5417, - EndPos: 5425, + EndLine: 289, + StartPos: 5417, + EndPos: 5425, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 289, - EndLine: 289, - StartPos: 5417, - EndPos: 5418, + EndLine: 289, + StartPos: 5417, + EndPos: 5418, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 289, - EndLine: 289, - StartPos: 5417, - EndPos: 5418, + EndLine: 289, + StartPos: 5417, + EndPos: 5418, }, Value: "a", }, @@ -13463,16 +13382,16 @@ func TestPhp7(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 289, - EndLine: 289, - StartPos: 5424, - EndPos: 5425, + EndLine: 289, + StartPos: 5424, + EndPos: 5425, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 289, - EndLine: 289, - StartPos: 5424, - EndPos: 5425, + EndLine: 289, + StartPos: 5424, + EndPos: 5425, }, Value: "b", }, @@ -13482,30 +13401,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 290, - EndLine: 290, - StartPos: 5430, - EndPos: 5437, + EndLine: 290, + StartPos: 5430, + EndPos: 5437, }, Expr: &binary.Minus{ Position: &position.Position{ StartLine: 290, - EndLine: 290, - StartPos: 5430, - EndPos: 5436, + EndLine: 290, + StartPos: 5430, + EndPos: 5436, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 290, - EndLine: 290, - StartPos: 5430, - EndPos: 5431, + EndLine: 290, + StartPos: 5430, + EndPos: 5431, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 290, - EndLine: 290, - StartPos: 5430, - EndPos: 5431, + EndLine: 290, + StartPos: 5430, + EndPos: 5431, }, Value: "a", }, @@ -13513,16 +13432,16 @@ func TestPhp7(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 290, - EndLine: 290, - StartPos: 5435, - EndPos: 5436, + EndLine: 290, + StartPos: 5435, + EndPos: 5436, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 290, - EndLine: 290, - StartPos: 5435, - EndPos: 5436, + EndLine: 290, + StartPos: 5435, + EndPos: 5436, }, Value: "b", }, @@ -13532,30 +13451,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 291, - EndLine: 291, - StartPos: 5441, - EndPos: 5448, + EndLine: 291, + StartPos: 5441, + EndPos: 5448, }, Expr: &binary.Mod{ Position: &position.Position{ StartLine: 291, - EndLine: 291, - StartPos: 5441, - EndPos: 5447, + EndLine: 291, + StartPos: 5441, + EndPos: 5447, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 291, - EndLine: 291, - StartPos: 5441, - EndPos: 5442, + EndLine: 291, + StartPos: 5441, + EndPos: 5442, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 291, - EndLine: 291, - StartPos: 5441, - EndPos: 5442, + EndLine: 291, + StartPos: 5441, + EndPos: 5442, }, Value: "a", }, @@ -13563,16 +13482,16 @@ func TestPhp7(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 291, - EndLine: 291, - StartPos: 5446, - EndPos: 5447, + EndLine: 291, + StartPos: 5446, + EndPos: 5447, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 291, - EndLine: 291, - StartPos: 5446, - EndPos: 5447, + EndLine: 291, + StartPos: 5446, + EndPos: 5447, }, Value: "b", }, @@ -13582,30 +13501,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 292, - EndLine: 292, - StartPos: 5452, - EndPos: 5459, + EndLine: 292, + StartPos: 5452, + EndPos: 5459, }, Expr: &binary.Mul{ Position: &position.Position{ StartLine: 292, - EndLine: 292, - StartPos: 5452, - EndPos: 5458, + EndLine: 292, + StartPos: 5452, + EndPos: 5458, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 292, - EndLine: 292, - StartPos: 5452, - EndPos: 5453, + EndLine: 292, + StartPos: 5452, + EndPos: 5453, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 292, - EndLine: 292, - StartPos: 5452, - EndPos: 5453, + EndLine: 292, + StartPos: 5452, + EndPos: 5453, }, Value: "a", }, @@ -13613,16 +13532,16 @@ func TestPhp7(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 292, - EndLine: 292, - StartPos: 5457, - EndPos: 5458, + EndLine: 292, + StartPos: 5457, + EndPos: 5458, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 292, - EndLine: 292, - StartPos: 5457, - EndPos: 5458, + EndLine: 292, + StartPos: 5457, + EndPos: 5458, }, Value: "b", }, @@ -13632,30 +13551,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 293, - EndLine: 293, - StartPos: 5463, - EndPos: 5471, + EndLine: 293, + StartPos: 5463, + EndPos: 5471, }, Expr: &binary.NotEqual{ Position: &position.Position{ StartLine: 293, - EndLine: 293, - StartPos: 5463, - EndPos: 5470, + EndLine: 293, + StartPos: 5463, + EndPos: 5470, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 293, - EndLine: 293, - StartPos: 5463, - EndPos: 5464, + EndLine: 293, + StartPos: 5463, + EndPos: 5464, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 293, - EndLine: 293, - StartPos: 5463, - EndPos: 5464, + EndLine: 293, + StartPos: 5463, + EndPos: 5464, }, Value: "a", }, @@ -13663,16 +13582,16 @@ func TestPhp7(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 293, - EndLine: 293, - StartPos: 5469, - EndPos: 5470, + EndLine: 293, + StartPos: 5469, + EndPos: 5470, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 293, - EndLine: 293, - StartPos: 5469, - EndPos: 5470, + EndLine: 293, + StartPos: 5469, + EndPos: 5470, }, Value: "b", }, @@ -13682,30 +13601,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 294, - EndLine: 294, - StartPos: 5475, - EndPos: 5484, + EndLine: 294, + StartPos: 5475, + EndPos: 5484, }, Expr: &binary.NotIdentical{ Position: &position.Position{ StartLine: 294, - EndLine: 294, - StartPos: 5475, - EndPos: 5483, + EndLine: 294, + StartPos: 5475, + EndPos: 5483, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 294, - EndLine: 294, - StartPos: 5475, - EndPos: 5476, + EndLine: 294, + StartPos: 5475, + EndPos: 5476, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 294, - EndLine: 294, - StartPos: 5475, - EndPos: 5476, + EndLine: 294, + StartPos: 5475, + EndPos: 5476, }, Value: "a", }, @@ -13713,16 +13632,16 @@ func TestPhp7(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 294, - EndLine: 294, - StartPos: 5482, - EndPos: 5483, + EndLine: 294, + StartPos: 5482, + EndPos: 5483, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 294, - EndLine: 294, - StartPos: 5482, - EndPos: 5483, + EndLine: 294, + StartPos: 5482, + EndPos: 5483, }, Value: "b", }, @@ -13732,30 +13651,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 295, - EndLine: 295, - StartPos: 5488, - EndPos: 5495, + EndLine: 295, + StartPos: 5488, + EndPos: 5495, }, Expr: &binary.Plus{ Position: &position.Position{ StartLine: 295, - EndLine: 295, - StartPos: 5488, - EndPos: 5494, + EndLine: 295, + StartPos: 5488, + EndPos: 5494, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 295, - EndLine: 295, - StartPos: 5488, - EndPos: 5489, + EndLine: 295, + StartPos: 5488, + EndPos: 5489, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 295, - EndLine: 295, - StartPos: 5488, - EndPos: 5489, + EndLine: 295, + StartPos: 5488, + EndPos: 5489, }, Value: "a", }, @@ -13763,16 +13682,16 @@ func TestPhp7(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 295, - EndLine: 295, - StartPos: 5493, - EndPos: 5494, + EndLine: 295, + StartPos: 5493, + EndPos: 5494, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 295, - EndLine: 295, - StartPos: 5493, - EndPos: 5494, + EndLine: 295, + StartPos: 5493, + EndPos: 5494, }, Value: "b", }, @@ -13782,30 +13701,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 296, - EndLine: 296, - StartPos: 5499, - EndPos: 5507, + EndLine: 296, + StartPos: 5499, + EndPos: 5507, }, Expr: &binary.Pow{ Position: &position.Position{ StartLine: 296, - EndLine: 296, - StartPos: 5499, - EndPos: 5506, + EndLine: 296, + StartPos: 5499, + EndPos: 5506, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 296, - EndLine: 296, - StartPos: 5499, - EndPos: 5500, + EndLine: 296, + StartPos: 5499, + EndPos: 5500, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 296, - EndLine: 296, - StartPos: 5499, - EndPos: 5500, + EndLine: 296, + StartPos: 5499, + EndPos: 5500, }, Value: "a", }, @@ -13813,16 +13732,16 @@ func TestPhp7(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 296, - EndLine: 296, - StartPos: 5505, - EndPos: 5506, + EndLine: 296, + StartPos: 5505, + EndPos: 5506, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 296, - EndLine: 296, - StartPos: 5505, - EndPos: 5506, + EndLine: 296, + StartPos: 5505, + EndPos: 5506, }, Value: "b", }, @@ -13832,30 +13751,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 297, - EndLine: 297, - StartPos: 5511, - EndPos: 5519, + EndLine: 297, + StartPos: 5511, + EndPos: 5519, }, Expr: &binary.ShiftLeft{ Position: &position.Position{ StartLine: 297, - EndLine: 297, - StartPos: 5511, - EndPos: 5518, + EndLine: 297, + StartPos: 5511, + EndPos: 5518, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 297, - EndLine: 297, - StartPos: 5511, - EndPos: 5512, + EndLine: 297, + StartPos: 5511, + EndPos: 5512, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 297, - EndLine: 297, - StartPos: 5511, - EndPos: 5512, + EndLine: 297, + StartPos: 5511, + EndPos: 5512, }, Value: "a", }, @@ -13863,16 +13782,16 @@ func TestPhp7(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 297, - EndLine: 297, - StartPos: 5517, - EndPos: 5518, + EndLine: 297, + StartPos: 5517, + EndPos: 5518, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 297, - EndLine: 297, - StartPos: 5517, - EndPos: 5518, + EndLine: 297, + StartPos: 5517, + EndPos: 5518, }, Value: "b", }, @@ -13882,30 +13801,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 298, - EndLine: 298, - StartPos: 5523, - EndPos: 5531, + EndLine: 298, + StartPos: 5523, + EndPos: 5531, }, Expr: &binary.ShiftRight{ Position: &position.Position{ StartLine: 298, - EndLine: 298, - StartPos: 5523, - EndPos: 5530, + EndLine: 298, + StartPos: 5523, + EndPos: 5530, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 298, - EndLine: 298, - StartPos: 5523, - EndPos: 5524, + EndLine: 298, + StartPos: 5523, + EndPos: 5524, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 298, - EndLine: 298, - StartPos: 5523, - EndPos: 5524, + EndLine: 298, + StartPos: 5523, + EndPos: 5524, }, Value: "a", }, @@ -13913,16 +13832,16 @@ func TestPhp7(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 298, - EndLine: 298, - StartPos: 5529, - EndPos: 5530, + EndLine: 298, + StartPos: 5529, + EndPos: 5530, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 298, - EndLine: 298, - StartPos: 5529, - EndPos: 5530, + EndLine: 298, + StartPos: 5529, + EndPos: 5530, }, Value: "b", }, @@ -13932,30 +13851,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 299, - EndLine: 299, - StartPos: 5535, - EndPos: 5543, + EndLine: 299, + StartPos: 5535, + EndPos: 5543, }, Expr: &binary.SmallerOrEqual{ Position: &position.Position{ StartLine: 299, - EndLine: 299, - StartPos: 5535, - EndPos: 5542, + EndLine: 299, + StartPos: 5535, + EndPos: 5542, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 299, - EndLine: 299, - StartPos: 5535, - EndPos: 5536, + EndLine: 299, + StartPos: 5535, + EndPos: 5536, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 299, - EndLine: 299, - StartPos: 5535, - EndPos: 5536, + EndLine: 299, + StartPos: 5535, + EndPos: 5536, }, Value: "a", }, @@ -13963,16 +13882,16 @@ func TestPhp7(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 299, - EndLine: 299, - StartPos: 5541, - EndPos: 5542, + EndLine: 299, + StartPos: 5541, + EndPos: 5542, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 299, - EndLine: 299, - StartPos: 5541, - EndPos: 5542, + EndLine: 299, + StartPos: 5541, + EndPos: 5542, }, Value: "b", }, @@ -13982,30 +13901,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 300, - EndLine: 300, - StartPos: 5547, - EndPos: 5554, + EndLine: 300, + StartPos: 5547, + EndPos: 5554, }, Expr: &binary.Smaller{ Position: &position.Position{ StartLine: 300, - EndLine: 300, - StartPos: 5547, - EndPos: 5553, + EndLine: 300, + StartPos: 5547, + EndPos: 5553, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 300, - EndLine: 300, - StartPos: 5547, - EndPos: 5548, + EndLine: 300, + StartPos: 5547, + EndPos: 5548, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 300, - EndLine: 300, - StartPos: 5547, - EndPos: 5548, + EndLine: 300, + StartPos: 5547, + EndPos: 5548, }, Value: "a", }, @@ -14013,16 +13932,16 @@ func TestPhp7(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 300, - EndLine: 300, - StartPos: 5552, - EndPos: 5553, + EndLine: 300, + StartPos: 5552, + EndPos: 5553, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 300, - EndLine: 300, - StartPos: 5552, - EndPos: 5553, + EndLine: 300, + StartPos: 5552, + EndPos: 5553, }, Value: "b", }, @@ -14032,30 +13951,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 301, - EndLine: 301, - StartPos: 5558, - EndPos: 5567, + EndLine: 301, + StartPos: 5558, + EndPos: 5567, }, Expr: &binary.Spaceship{ Position: &position.Position{ StartLine: 301, - EndLine: 301, - StartPos: 5558, - EndPos: 5566, + EndLine: 301, + StartPos: 5558, + EndPos: 5566, }, Left: &expr.Variable{ Position: &position.Position{ StartLine: 301, - EndLine: 301, - StartPos: 5558, - EndPos: 5559, + EndLine: 301, + StartPos: 5558, + EndPos: 5559, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 301, - EndLine: 301, - StartPos: 5558, - EndPos: 5559, + EndLine: 301, + StartPos: 5558, + EndPos: 5559, }, Value: "a", }, @@ -14063,16 +13982,16 @@ func TestPhp7(t *testing.T) { Right: &expr.Variable{ Position: &position.Position{ StartLine: 301, - EndLine: 301, - StartPos: 5565, - EndPos: 5566, + EndLine: 301, + StartPos: 5565, + EndPos: 5566, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 301, - EndLine: 301, - StartPos: 5565, - EndPos: 5566, + EndLine: 301, + StartPos: 5565, + EndPos: 5566, }, Value: "b", }, @@ -14082,30 +14001,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 303, - EndLine: 303, - StartPos: 5572, - EndPos: 5580, + EndLine: 303, + StartPos: 5572, + EndPos: 5580, }, Expr: &assign.Reference{ Position: &position.Position{ StartLine: 303, - EndLine: 303, - StartPos: 5572, - EndPos: 5579, + EndLine: 303, + StartPos: 5572, + EndPos: 5579, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 303, - EndLine: 303, - StartPos: 5572, - EndPos: 5573, + EndLine: 303, + StartPos: 5572, + EndPos: 5573, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 303, - EndLine: 303, - StartPos: 5572, - EndPos: 5573, + EndLine: 303, + StartPos: 5572, + EndPos: 5573, }, Value: "a", }, @@ -14113,16 +14032,16 @@ func TestPhp7(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 303, - EndLine: 303, - StartPos: 5578, - EndPos: 5579, + EndLine: 303, + StartPos: 5578, + EndPos: 5579, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 303, - EndLine: 303, - StartPos: 5578, - EndPos: 5579, + EndLine: 303, + StartPos: 5578, + EndPos: 5579, }, Value: "b", }, @@ -14132,30 +14051,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 304, - EndLine: 304, - StartPos: 5584, - EndPos: 5591, + EndLine: 304, + StartPos: 5584, + EndPos: 5591, }, Expr: &assign.Assign{ Position: &position.Position{ StartLine: 304, - EndLine: 304, - StartPos: 5584, - EndPos: 5590, + EndLine: 304, + StartPos: 5584, + EndPos: 5590, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 304, - EndLine: 304, - StartPos: 5584, - EndPos: 5585, + EndLine: 304, + StartPos: 5584, + EndPos: 5585, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 304, - EndLine: 304, - StartPos: 5584, - EndPos: 5585, + EndLine: 304, + StartPos: 5584, + EndPos: 5585, }, Value: "a", }, @@ -14163,16 +14082,16 @@ func TestPhp7(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 304, - EndLine: 304, - StartPos: 5589, - EndPos: 5590, + EndLine: 304, + StartPos: 5589, + EndPos: 5590, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 304, - EndLine: 304, - StartPos: 5589, - EndPos: 5590, + EndLine: 304, + StartPos: 5589, + EndPos: 5590, }, Value: "b", }, @@ -14182,30 +14101,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 305, - EndLine: 305, - StartPos: 5595, - EndPos: 5603, + EndLine: 305, + StartPos: 5595, + EndPos: 5603, }, Expr: &assign.BitwiseAnd{ Position: &position.Position{ StartLine: 305, - EndLine: 305, - StartPos: 5595, - EndPos: 5602, + EndLine: 305, + StartPos: 5595, + EndPos: 5602, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 305, - EndLine: 305, - StartPos: 5595, - EndPos: 5596, + EndLine: 305, + StartPos: 5595, + EndPos: 5596, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 305, - EndLine: 305, - StartPos: 5595, - EndPos: 5596, + EndLine: 305, + StartPos: 5595, + EndPos: 5596, }, Value: "a", }, @@ -14213,16 +14132,16 @@ func TestPhp7(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 305, - EndLine: 305, - StartPos: 5601, - EndPos: 5602, + EndLine: 305, + StartPos: 5601, + EndPos: 5602, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 305, - EndLine: 305, - StartPos: 5601, - EndPos: 5602, + EndLine: 305, + StartPos: 5601, + EndPos: 5602, }, Value: "b", }, @@ -14232,30 +14151,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 306, - EndLine: 306, - StartPos: 5607, - EndPos: 5615, + EndLine: 306, + StartPos: 5607, + EndPos: 5615, }, Expr: &assign.BitwiseOr{ Position: &position.Position{ StartLine: 306, - EndLine: 306, - StartPos: 5607, - EndPos: 5614, + EndLine: 306, + StartPos: 5607, + EndPos: 5614, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 306, - EndLine: 306, - StartPos: 5607, - EndPos: 5608, + EndLine: 306, + StartPos: 5607, + EndPos: 5608, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 306, - EndLine: 306, - StartPos: 5607, - EndPos: 5608, + EndLine: 306, + StartPos: 5607, + EndPos: 5608, }, Value: "a", }, @@ -14263,16 +14182,16 @@ func TestPhp7(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 306, - EndLine: 306, - StartPos: 5613, - EndPos: 5614, + EndLine: 306, + StartPos: 5613, + EndPos: 5614, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 306, - EndLine: 306, - StartPos: 5613, - EndPos: 5614, + EndLine: 306, + StartPos: 5613, + EndPos: 5614, }, Value: "b", }, @@ -14282,30 +14201,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 307, - EndLine: 307, - StartPos: 5619, - EndPos: 5627, + EndLine: 307, + StartPos: 5619, + EndPos: 5627, }, Expr: &assign.BitwiseXor{ Position: &position.Position{ StartLine: 307, - EndLine: 307, - StartPos: 5619, - EndPos: 5626, + EndLine: 307, + StartPos: 5619, + EndPos: 5626, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 307, - EndLine: 307, - StartPos: 5619, - EndPos: 5620, + EndLine: 307, + StartPos: 5619, + EndPos: 5620, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 307, - EndLine: 307, - StartPos: 5619, - EndPos: 5620, + EndLine: 307, + StartPos: 5619, + EndPos: 5620, }, Value: "a", }, @@ -14313,16 +14232,16 @@ func TestPhp7(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 307, - EndLine: 307, - StartPos: 5625, - EndPos: 5626, + EndLine: 307, + StartPos: 5625, + EndPos: 5626, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 307, - EndLine: 307, - StartPos: 5625, - EndPos: 5626, + EndLine: 307, + StartPos: 5625, + EndPos: 5626, }, Value: "b", }, @@ -14332,30 +14251,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 308, - EndLine: 308, - StartPos: 5631, - EndPos: 5639, + EndLine: 308, + StartPos: 5631, + EndPos: 5639, }, Expr: &assign.Concat{ Position: &position.Position{ StartLine: 308, - EndLine: 308, - StartPos: 5631, - EndPos: 5638, + EndLine: 308, + StartPos: 5631, + EndPos: 5638, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 308, - EndLine: 308, - StartPos: 5631, - EndPos: 5632, + EndLine: 308, + StartPos: 5631, + EndPos: 5632, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 308, - EndLine: 308, - StartPos: 5631, - EndPos: 5632, + EndLine: 308, + StartPos: 5631, + EndPos: 5632, }, Value: "a", }, @@ -14363,16 +14282,16 @@ func TestPhp7(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 308, - EndLine: 308, - StartPos: 5637, - EndPos: 5638, + EndLine: 308, + StartPos: 5637, + EndPos: 5638, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 308, - EndLine: 308, - StartPos: 5637, - EndPos: 5638, + EndLine: 308, + StartPos: 5637, + EndPos: 5638, }, Value: "b", }, @@ -14382,30 +14301,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 309, - EndLine: 309, - StartPos: 5643, - EndPos: 5651, + EndLine: 309, + StartPos: 5643, + EndPos: 5651, }, Expr: &assign.Div{ Position: &position.Position{ StartLine: 309, - EndLine: 309, - StartPos: 5643, - EndPos: 5650, + EndLine: 309, + StartPos: 5643, + EndPos: 5650, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 309, - EndLine: 309, - StartPos: 5643, - EndPos: 5644, + EndLine: 309, + StartPos: 5643, + EndPos: 5644, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 309, - EndLine: 309, - StartPos: 5643, - EndPos: 5644, + EndLine: 309, + StartPos: 5643, + EndPos: 5644, }, Value: "a", }, @@ -14413,16 +14332,16 @@ func TestPhp7(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 309, - EndLine: 309, - StartPos: 5649, - EndPos: 5650, + EndLine: 309, + StartPos: 5649, + EndPos: 5650, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 309, - EndLine: 309, - StartPos: 5649, - EndPos: 5650, + EndLine: 309, + StartPos: 5649, + EndPos: 5650, }, Value: "b", }, @@ -14432,30 +14351,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 310, - EndLine: 310, - StartPos: 5655, - EndPos: 5663, + EndLine: 310, + StartPos: 5655, + EndPos: 5663, }, Expr: &assign.Minus{ Position: &position.Position{ StartLine: 310, - EndLine: 310, - StartPos: 5655, - EndPos: 5662, + EndLine: 310, + StartPos: 5655, + EndPos: 5662, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 310, - EndLine: 310, - StartPos: 5655, - EndPos: 5656, + EndLine: 310, + StartPos: 5655, + EndPos: 5656, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 310, - EndLine: 310, - StartPos: 5655, - EndPos: 5656, + EndLine: 310, + StartPos: 5655, + EndPos: 5656, }, Value: "a", }, @@ -14463,16 +14382,16 @@ func TestPhp7(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 310, - EndLine: 310, - StartPos: 5661, - EndPos: 5662, + EndLine: 310, + StartPos: 5661, + EndPos: 5662, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 310, - EndLine: 310, - StartPos: 5661, - EndPos: 5662, + EndLine: 310, + StartPos: 5661, + EndPos: 5662, }, Value: "b", }, @@ -14482,30 +14401,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 311, - EndLine: 311, - StartPos: 5667, - EndPos: 5675, + EndLine: 311, + StartPos: 5667, + EndPos: 5675, }, Expr: &assign.Mod{ Position: &position.Position{ StartLine: 311, - EndLine: 311, - StartPos: 5667, - EndPos: 5674, + EndLine: 311, + StartPos: 5667, + EndPos: 5674, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 311, - EndLine: 311, - StartPos: 5667, - EndPos: 5668, + EndLine: 311, + StartPos: 5667, + EndPos: 5668, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 311, - EndLine: 311, - StartPos: 5667, - EndPos: 5668, + EndLine: 311, + StartPos: 5667, + EndPos: 5668, }, Value: "a", }, @@ -14513,16 +14432,16 @@ func TestPhp7(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 311, - EndLine: 311, - StartPos: 5673, - EndPos: 5674, + EndLine: 311, + StartPos: 5673, + EndPos: 5674, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 311, - EndLine: 311, - StartPos: 5673, - EndPos: 5674, + EndLine: 311, + StartPos: 5673, + EndPos: 5674, }, Value: "b", }, @@ -14532,30 +14451,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 312, - EndLine: 312, - StartPos: 5679, - EndPos: 5687, + EndLine: 312, + StartPos: 5679, + EndPos: 5687, }, Expr: &assign.Mul{ Position: &position.Position{ StartLine: 312, - EndLine: 312, - StartPos: 5679, - EndPos: 5686, + EndLine: 312, + StartPos: 5679, + EndPos: 5686, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 312, - EndLine: 312, - StartPos: 5679, - EndPos: 5680, + EndLine: 312, + StartPos: 5679, + EndPos: 5680, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 312, - EndLine: 312, - StartPos: 5679, - EndPos: 5680, + EndLine: 312, + StartPos: 5679, + EndPos: 5680, }, Value: "a", }, @@ -14563,16 +14482,16 @@ func TestPhp7(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 312, - EndLine: 312, - StartPos: 5685, - EndPos: 5686, + EndLine: 312, + StartPos: 5685, + EndPos: 5686, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 312, - EndLine: 312, - StartPos: 5685, - EndPos: 5686, + EndLine: 312, + StartPos: 5685, + EndPos: 5686, }, Value: "b", }, @@ -14582,30 +14501,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 313, - EndLine: 313, - StartPos: 5691, - EndPos: 5699, + EndLine: 313, + StartPos: 5691, + EndPos: 5699, }, Expr: &assign.Plus{ Position: &position.Position{ StartLine: 313, - EndLine: 313, - StartPos: 5691, - EndPos: 5698, + EndLine: 313, + StartPos: 5691, + EndPos: 5698, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 313, - EndLine: 313, - StartPos: 5691, - EndPos: 5692, + EndLine: 313, + StartPos: 5691, + EndPos: 5692, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 313, - EndLine: 313, - StartPos: 5691, - EndPos: 5692, + EndLine: 313, + StartPos: 5691, + EndPos: 5692, }, Value: "a", }, @@ -14613,16 +14532,16 @@ func TestPhp7(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 313, - EndLine: 313, - StartPos: 5697, - EndPos: 5698, + EndLine: 313, + StartPos: 5697, + EndPos: 5698, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 313, - EndLine: 313, - StartPos: 5697, - EndPos: 5698, + EndLine: 313, + StartPos: 5697, + EndPos: 5698, }, Value: "b", }, @@ -14632,30 +14551,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 314, - EndLine: 314, - StartPos: 5703, - EndPos: 5712, + EndLine: 314, + StartPos: 5703, + EndPos: 5712, }, Expr: &assign.Pow{ Position: &position.Position{ StartLine: 314, - EndLine: 314, - StartPos: 5703, - EndPos: 5711, + EndLine: 314, + StartPos: 5703, + EndPos: 5711, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 314, - EndLine: 314, - StartPos: 5703, - EndPos: 5704, + EndLine: 314, + StartPos: 5703, + EndPos: 5704, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 314, - EndLine: 314, - StartPos: 5703, - EndPos: 5704, + EndLine: 314, + StartPos: 5703, + EndPos: 5704, }, Value: "a", }, @@ -14663,16 +14582,16 @@ func TestPhp7(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 314, - EndLine: 314, - StartPos: 5710, - EndPos: 5711, + EndLine: 314, + StartPos: 5710, + EndPos: 5711, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 314, - EndLine: 314, - StartPos: 5710, - EndPos: 5711, + EndLine: 314, + StartPos: 5710, + EndPos: 5711, }, Value: "b", }, @@ -14682,30 +14601,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 315, - EndLine: 315, - StartPos: 5716, - EndPos: 5725, + EndLine: 315, + StartPos: 5716, + EndPos: 5725, }, Expr: &assign.ShiftLeft{ Position: &position.Position{ StartLine: 315, - EndLine: 315, - StartPos: 5716, - EndPos: 5724, + EndLine: 315, + StartPos: 5716, + EndPos: 5724, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 315, - EndLine: 315, - StartPos: 5716, - EndPos: 5717, + EndLine: 315, + StartPos: 5716, + EndPos: 5717, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 315, - EndLine: 315, - StartPos: 5716, - EndPos: 5717, + EndLine: 315, + StartPos: 5716, + EndPos: 5717, }, Value: "a", }, @@ -14713,16 +14632,16 @@ func TestPhp7(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 315, - EndLine: 315, - StartPos: 5723, - EndPos: 5724, + EndLine: 315, + StartPos: 5723, + EndPos: 5724, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 315, - EndLine: 315, - StartPos: 5723, - EndPos: 5724, + EndLine: 315, + StartPos: 5723, + EndPos: 5724, }, Value: "b", }, @@ -14732,30 +14651,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 316, - EndLine: 316, - StartPos: 5729, - EndPos: 5738, + EndLine: 316, + StartPos: 5729, + EndPos: 5738, }, Expr: &assign.ShiftRight{ Position: &position.Position{ StartLine: 316, - EndLine: 316, - StartPos: 5729, - EndPos: 5737, + EndLine: 316, + StartPos: 5729, + EndPos: 5737, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 316, - EndLine: 316, - StartPos: 5729, - EndPos: 5730, + EndLine: 316, + StartPos: 5729, + EndPos: 5730, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 316, - EndLine: 316, - StartPos: 5729, - EndPos: 5730, + EndLine: 316, + StartPos: 5729, + EndPos: 5730, }, Value: "a", }, @@ -14763,16 +14682,16 @@ func TestPhp7(t *testing.T) { Expression: &expr.Variable{ Position: &position.Position{ StartLine: 316, - EndLine: 316, - StartPos: 5736, - EndPos: 5737, + EndLine: 316, + StartPos: 5736, + EndPos: 5737, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 316, - EndLine: 316, - StartPos: 5736, - EndPos: 5737, + EndLine: 316, + StartPos: 5736, + EndPos: 5737, }, Value: "b", }, @@ -14782,17 +14701,17 @@ func TestPhp7(t *testing.T) { &stmt.Class{ Position: &position.Position{ StartLine: 318, - EndLine: 318, - StartPos: 5743, - EndPos: 5781, + EndLine: 318, + StartPos: 5743, + EndPos: 5781, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 318, - EndLine: 318, - StartPos: 5749, - EndPos: 5751, + EndLine: 318, + StartPos: 5749, + EndPos: 5751, }, Value: "foo", }, @@ -14800,18 +14719,18 @@ func TestPhp7(t *testing.T) { &stmt.ClassMethod{ Position: &position.Position{ StartLine: 318, - EndLine: 318, - StartPos: 5754, - EndPos: 5779, + EndLine: 318, + StartPos: 5754, + EndPos: 5779, }, PhpDocComment: "", - ReturnsRef: false, + ReturnsRef: false, MethodName: &node.Identifier{ Position: &position.Position{ StartLine: 318, - EndLine: 318, - StartPos: 5770, - EndPos: 5774, + EndLine: 318, + StartPos: 5770, + EndPos: 5774, }, Value: "class", }, @@ -14819,9 +14738,9 @@ func TestPhp7(t *testing.T) { &node.Identifier{ Position: &position.Position{ StartLine: 318, - EndLine: 318, - StartPos: 5754, - EndPos: 5759, + EndLine: 318, + StartPos: 5754, + EndPos: 5759, }, Value: "public", }, @@ -14829,12 +14748,11 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 318, - EndLine: 318, - StartPos: 5778, - EndPos: 5779, - }, - Stmts: []node.Node{ + EndLine: 318, + StartPos: 5778, + EndPos: 5779, }, + Stmts: []node.Node{}, }, }, }, @@ -14842,40 +14760,40 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 319, - EndLine: 319, - StartPos: 5785, - EndPos: 5795, + EndLine: 319, + StartPos: 5785, + EndPos: 5795, }, Expr: &expr.FunctionCall{ Position: &position.Position{ StartLine: 319, - EndLine: 319, - StartPos: 5785, - EndPos: 5794, + EndLine: 319, + StartPos: 5785, + EndPos: 5794, }, Function: &name.FullyQualified{ Position: &position.Position{ StartLine: 319, - EndLine: 319, - StartPos: 5785, - EndPos: 5792, + EndLine: 319, + StartPos: 5785, + EndPos: 5792, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 319, - EndLine: 319, - StartPos: 5786, - EndPos: 5788, + EndLine: 319, + StartPos: 5786, + EndPos: 5788, }, Value: "foo", }, &name.NamePart{ Position: &position.Position{ StartLine: 319, - EndLine: 319, - StartPos: 5790, - EndPos: 5792, + EndLine: 319, + StartPos: 5790, + EndPos: 5792, }, Value: "bar", }, @@ -14884,9 +14802,9 @@ func TestPhp7(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 319, - EndLine: 319, - StartPos: 5793, - EndPos: 5794, + EndLine: 319, + StartPos: 5793, + EndPos: 5794, }, }, }, @@ -14894,18 +14812,18 @@ func TestPhp7(t *testing.T) { &stmt.Function{ Position: &position.Position{ StartLine: 321, - EndLine: 327, - StartPos: 5800, - EndPos: 5926, + EndLine: 327, + StartPos: 5800, + EndPos: 5926, }, - ReturnsRef: false, + ReturnsRef: false, PhpDocComment: "", FunctionName: &node.Identifier{ Position: &position.Position{ StartLine: 321, - EndLine: 321, - StartPos: 5809, - EndPos: 5811, + EndLine: 321, + StartPos: 5809, + EndPos: 5811, }, Value: "foo", }, @@ -14913,25 +14831,25 @@ func TestPhp7(t *testing.T) { &node.Parameter{ Position: &position.Position{ StartLine: 321, - EndLine: 321, - StartPos: 5813, - EndPos: 5815, + EndLine: 321, + StartPos: 5813, + EndPos: 5815, }, - ByRef: true, + ByRef: true, Variadic: false, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 321, - EndLine: 321, - StartPos: 5814, - EndPos: 5815, + EndLine: 321, + StartPos: 5814, + EndPos: 5815, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 321, - EndLine: 321, - StartPos: 5814, - EndPos: 5815, + EndLine: 321, + StartPos: 5814, + EndPos: 5815, }, Value: "a", }, @@ -14940,25 +14858,25 @@ func TestPhp7(t *testing.T) { &node.Parameter{ Position: &position.Position{ StartLine: 321, - EndLine: 321, - StartPos: 5818, - EndPos: 5822, + EndLine: 321, + StartPos: 5818, + EndPos: 5822, }, - ByRef: false, + ByRef: false, Variadic: true, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 321, - EndLine: 321, - StartPos: 5821, - EndPos: 5822, + EndLine: 321, + StartPos: 5821, + EndPos: 5822, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 321, - EndLine: 321, - StartPos: 5821, - EndPos: 5822, + EndLine: 321, + StartPos: 5821, + EndPos: 5822, }, Value: "b", }, @@ -14969,109 +14887,105 @@ func TestPhp7(t *testing.T) { &stmt.HaltCompiler{ Position: &position.Position{ StartLine: 322, - EndLine: 322, - StartPos: 5830, - EndPos: 5847, + EndLine: 322, + StartPos: 5830, + EndPos: 5847, }, }, &stmt.Function{ Position: &position.Position{ StartLine: 323, - EndLine: 323, - StartPos: 5852, - EndPos: 5868, + EndLine: 323, + StartPos: 5852, + EndPos: 5868, }, - ReturnsRef: false, + ReturnsRef: false, PhpDocComment: "", FunctionName: &node.Identifier{ Position: &position.Position{ StartLine: 323, - EndLine: 323, - StartPos: 5861, - EndPos: 5863, + EndLine: 323, + StartPos: 5861, + EndPos: 5863, }, Value: "bar", }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, &stmt.Class{ Position: &position.Position{ StartLine: 324, - EndLine: 324, - StartPos: 5873, - EndPos: 5884, + EndLine: 324, + StartPos: 5873, + EndPos: 5884, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 324, - EndLine: 324, - StartPos: 5879, - EndPos: 5881, + EndLine: 324, + StartPos: 5879, + EndPos: 5881, }, Value: "Baz", }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, &stmt.Trait{ Position: &position.Position{ StartLine: 325, - EndLine: 325, - StartPos: 5889, - EndPos: 5900, + EndLine: 325, + StartPos: 5889, + EndPos: 5900, }, PhpDocComment: "", TraitName: &node.Identifier{ Position: &position.Position{ StartLine: 325, - EndLine: 325, - StartPos: 5895, - EndPos: 5898, + EndLine: 325, + StartPos: 5895, + EndPos: 5898, }, Value: "Quux", }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, &stmt.Interface{ Position: &position.Position{ StartLine: 326, - EndLine: 326, - StartPos: 5905, - EndPos: 5922, + EndLine: 326, + StartPos: 5905, + EndPos: 5922, }, PhpDocComment: "", InterfaceName: &node.Identifier{ Position: &position.Position{ StartLine: 326, - EndLine: 326, - StartPos: 5915, - EndPos: 5919, + EndLine: 326, + StartPos: 5915, + EndPos: 5919, }, Value: "Quuux", }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, }, }, &stmt.Function{ Position: &position.Position{ StartLine: 329, - EndLine: 329, - StartPos: 5933, - EndPos: 5975, + EndLine: 329, + StartPos: 5933, + EndPos: 5975, }, PhpDocComment: "", - ReturnsRef: false, + ReturnsRef: false, FunctionName: &node.Identifier{ Position: &position.Position{ StartLine: 329, - EndLine: 329, - StartPos: 5942, - EndPos: 5944, + EndLine: 329, + StartPos: 5942, + EndPos: 5944, }, Value: "foo", }, @@ -15079,25 +14993,25 @@ func TestPhp7(t *testing.T) { &node.Parameter{ Position: &position.Position{ StartLine: 329, - EndLine: 329, - StartPos: 5946, - EndPos: 5952, + EndLine: 329, + StartPos: 5946, + EndPos: 5952, }, - ByRef: true, + ByRef: true, Variadic: false, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 329, - EndLine: 329, - StartPos: 5947, - EndPos: 5948, + EndLine: 329, + StartPos: 5947, + EndPos: 5948, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 329, - EndLine: 329, - StartPos: 5947, - EndPos: 5948, + EndLine: 329, + StartPos: 5947, + EndPos: 5948, }, Value: "a", }, @@ -15105,9 +15019,9 @@ func TestPhp7(t *testing.T) { DefaultValue: &scalar.Lnumber{ Position: &position.Position{ StartLine: 329, - EndLine: 329, - StartPos: 5952, - EndPos: 5952, + EndLine: 329, + StartPos: 5952, + EndPos: 5952, }, Value: "1", }, @@ -15115,25 +15029,25 @@ func TestPhp7(t *testing.T) { &node.Parameter{ Position: &position.Position{ StartLine: 329, - EndLine: 329, - StartPos: 5955, - EndPos: 5963, + EndLine: 329, + StartPos: 5955, + EndPos: 5963, }, Variadic: true, - ByRef: false, + ByRef: false, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 329, - EndLine: 329, - StartPos: 5958, - EndPos: 5959, + EndLine: 329, + StartPos: 5958, + EndPos: 5959, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 329, - EndLine: 329, - StartPos: 5958, - EndPos: 5959, + EndLine: 329, + StartPos: 5958, + EndPos: 5959, }, Value: "b", }, @@ -15141,9 +15055,9 @@ func TestPhp7(t *testing.T) { DefaultValue: &scalar.Lnumber{ Position: &position.Position{ StartLine: 329, - EndLine: 329, - StartPos: 5963, - EndPos: 5963, + EndLine: 329, + StartPos: 5963, + EndPos: 5963, }, Value: "1", }, @@ -15151,25 +15065,25 @@ func TestPhp7(t *testing.T) { &node.Parameter{ Position: &position.Position{ StartLine: 329, - EndLine: 329, - StartPos: 5966, - EndPos: 5971, + EndLine: 329, + StartPos: 5966, + EndPos: 5971, }, - ByRef: false, + ByRef: false, Variadic: false, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 329, - EndLine: 329, - StartPos: 5966, - EndPos: 5967, + EndLine: 329, + StartPos: 5966, + EndPos: 5967, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 329, - EndLine: 329, - StartPos: 5966, - EndPos: 5967, + EndLine: 329, + StartPos: 5966, + EndPos: 5967, }, Value: "c", }, @@ -15177,32 +15091,31 @@ func TestPhp7(t *testing.T) { DefaultValue: &scalar.Lnumber{ Position: &position.Position{ StartLine: 329, - EndLine: 329, - StartPos: 5971, - EndPos: 5971, + EndLine: 329, + StartPos: 5971, + EndPos: 5971, }, Value: "1", }, }, }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, &stmt.Function{ Position: &position.Position{ StartLine: 330, - EndLine: 330, - StartPos: 5979, - EndPos: 6016, + EndLine: 330, + StartPos: 5979, + EndPos: 6016, }, - ReturnsRef: false, + ReturnsRef: false, PhpDocComment: "", FunctionName: &node.Identifier{ Position: &position.Position{ StartLine: 330, - EndLine: 330, - StartPos: 5988, - EndPos: 5990, + EndLine: 330, + StartPos: 5988, + EndPos: 5990, }, Value: "foo", }, @@ -15210,34 +15123,34 @@ func TestPhp7(t *testing.T) { &node.Parameter{ Position: &position.Position{ StartLine: 330, - EndLine: 330, - StartPos: 5992, - EndPos: 5999, + EndLine: 330, + StartPos: 5992, + EndPos: 5999, }, - ByRef: false, + ByRef: false, Variadic: false, VariableType: &node.Identifier{ Position: &position.Position{ StartLine: 330, - EndLine: 330, - StartPos: 5992, - EndPos: 5996, + EndLine: 330, + StartPos: 5992, + EndPos: 5996, }, Value: "array", }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 330, - EndLine: 330, - StartPos: 5998, - EndPos: 5999, + EndLine: 330, + StartPos: 5998, + EndPos: 5999, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 330, - EndLine: 330, - StartPos: 5998, - EndPos: 5999, + EndLine: 330, + StartPos: 5998, + EndPos: 5999, }, Value: "a", }, @@ -15246,57 +15159,56 @@ func TestPhp7(t *testing.T) { &node.Parameter{ Position: &position.Position{ StartLine: 330, - EndLine: 330, - StartPos: 6002, - EndPos: 6012, + EndLine: 330, + StartPos: 6002, + EndPos: 6012, }, - ByRef: false, + ByRef: false, Variadic: false, VariableType: &node.Identifier{ Position: &position.Position{ StartLine: 330, - EndLine: 330, - StartPos: 6002, - EndPos: 6009, + EndLine: 330, + StartPos: 6002, + EndPos: 6009, }, Value: "callable", }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 330, - EndLine: 330, - StartPos: 6011, - EndPos: 6012, + EndLine: 330, + StartPos: 6011, + EndPos: 6012, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 330, - EndLine: 330, - StartPos: 6011, - EndPos: 6012, + EndLine: 330, + StartPos: 6011, + EndPos: 6012, }, Value: "b", }, }, }, }, - Stmts: []node.Node{ - }, + Stmts: []node.Node{}, }, &stmt.Class{ Position: &position.Position{ StartLine: 331, - EndLine: 331, - StartPos: 6020, - EndPos: 6121, + EndLine: 331, + StartPos: 6020, + EndPos: 6121, }, PhpDocComment: "", ClassName: &node.Identifier{ Position: &position.Position{ StartLine: 331, - EndLine: 331, - StartPos: 6041, - EndPos: 6043, + EndLine: 331, + StartPos: 6041, + EndPos: 6043, }, Value: "foo", }, @@ -15304,18 +15216,18 @@ func TestPhp7(t *testing.T) { &node.Identifier{ Position: &position.Position{ StartLine: 331, - EndLine: 331, - StartPos: 6020, - EndPos: 6027, + EndLine: 331, + StartPos: 6020, + EndPos: 6027, }, Value: "abstract", }, &node.Identifier{ Position: &position.Position{ StartLine: 331, - EndLine: 331, - StartPos: 6029, - EndPos: 6033, + EndLine: 331, + StartPos: 6029, + EndPos: 6033, }, Value: "final", }, @@ -15324,18 +15236,18 @@ func TestPhp7(t *testing.T) { &stmt.ClassMethod{ Position: &position.Position{ StartLine: 331, - EndLine: 331, - StartPos: 6047, - EndPos: 6087, + EndLine: 331, + StartPos: 6047, + EndPos: 6087, }, - ReturnsRef: false, + ReturnsRef: false, PhpDocComment: "", MethodName: &node.Identifier{ Position: &position.Position{ StartLine: 331, - EndLine: 331, - StartPos: 6082, - EndPos: 6084, + EndLine: 331, + StartPos: 6082, + EndPos: 6084, }, Value: "bar", }, @@ -15343,27 +15255,27 @@ func TestPhp7(t *testing.T) { &node.Identifier{ Position: &position.Position{ StartLine: 331, - EndLine: 331, - StartPos: 6047, - EndPos: 6054, + EndLine: 331, + StartPos: 6047, + EndPos: 6054, }, Value: "abstract", }, &node.Identifier{ Position: &position.Position{ StartLine: 331, - EndLine: 331, - StartPos: 6056, - EndPos: 6064, + EndLine: 331, + StartPos: 6056, + EndPos: 6064, }, Value: "protected", }, &node.Identifier{ Position: &position.Position{ StartLine: 331, - EndLine: 331, - StartPos: 6066, - EndPos: 6071, + EndLine: 331, + StartPos: 6066, + EndPos: 6071, }, Value: "static", }, @@ -15371,27 +15283,27 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.Nop{ Position: &position.Position{ StartLine: 331, - EndLine: 331, - StartPos: 6087, - EndPos: 6087, + EndLine: 331, + StartPos: 6087, + EndPos: 6087, }, }, }, &stmt.ClassMethod{ Position: &position.Position{ StartLine: 331, - EndLine: 331, - StartPos: 6089, - EndPos: 6119, + EndLine: 331, + StartPos: 6089, + EndPos: 6119, }, - ReturnsRef: false, + ReturnsRef: false, PhpDocComment: "", MethodName: &node.Identifier{ Position: &position.Position{ StartLine: 331, - EndLine: 331, - StartPos: 6112, - EndPos: 6114, + EndLine: 331, + StartPos: 6112, + EndPos: 6114, }, Value: "baz", }, @@ -15399,18 +15311,18 @@ func TestPhp7(t *testing.T) { &node.Identifier{ Position: &position.Position{ StartLine: 331, - EndLine: 331, - StartPos: 6089, - EndPos: 6093, + EndLine: 331, + StartPos: 6089, + EndPos: 6093, }, Value: "final", }, &node.Identifier{ Position: &position.Position{ StartLine: 331, - EndLine: 331, - StartPos: 6095, - EndPos: 6101, + EndLine: 331, + StartPos: 6095, + EndPos: 6101, }, Value: "private", }, @@ -15418,12 +15330,11 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{ Position: &position.Position{ StartLine: 331, - EndLine: 331, - StartPos: 6118, - EndPos: 6119, - }, - Stmts: []node.Node{ + EndLine: 331, + StartPos: 6118, + EndPos: 6119, }, + Stmts: []node.Node{}, }, }, }, @@ -15431,38 +15342,38 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 333, - EndLine: 333, - StartPos: 6127, - EndPos: 6140, + EndLine: 333, + StartPos: 6127, + EndPos: 6140, }, Expr: &expr.PropertyFetch{ Position: &position.Position{ StartLine: 333, - EndLine: 333, - StartPos: 6127, - EndPos: 6139, + EndLine: 333, + StartPos: 6127, + EndPos: 6139, }, Variable: &expr.New{ Position: &position.Position{ StartLine: 333, - EndLine: 333, - StartPos: 6127, - EndPos: 6133, + EndLine: 333, + StartPos: 6127, + EndPos: 6133, }, Class: &name.Name{ Position: &position.Position{ StartLine: 333, - EndLine: 333, - StartPos: 6131, - EndPos: 6133, + EndLine: 333, + StartPos: 6131, + EndPos: 6133, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 333, - EndLine: 333, - StartPos: 6131, - EndPos: 6133, + EndLine: 333, + StartPos: 6131, + EndPos: 6133, }, Value: "Foo", }, @@ -15472,9 +15383,9 @@ func TestPhp7(t *testing.T) { Property: &node.Identifier{ Position: &position.Position{ StartLine: 333, - EndLine: 333, - StartPos: 6137, - EndPos: 6139, + EndLine: 333, + StartPos: 6137, + EndPos: 6139, }, Value: "bar", }, @@ -15483,38 +15394,38 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 334, - EndLine: 334, - StartPos: 6145, - EndPos: 6155, + EndLine: 334, + StartPos: 6145, + EndPos: 6155, }, Expr: &expr.FunctionCall{ Position: &position.Position{ StartLine: 334, - EndLine: 334, - StartPos: 6145, - EndPos: 6154, + EndLine: 334, + StartPos: 6145, + EndPos: 6154, }, Function: &expr.New{ Position: &position.Position{ StartLine: 334, - EndLine: 334, - StartPos: 6145, - EndPos: 6151, + EndLine: 334, + StartPos: 6145, + EndPos: 6151, }, Class: &name.Name{ Position: &position.Position{ StartLine: 334, - EndLine: 334, - StartPos: 6149, - EndPos: 6151, + EndLine: 334, + StartPos: 6149, + EndPos: 6151, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 334, - EndLine: 334, - StartPos: 6149, - EndPos: 6151, + EndLine: 334, + StartPos: 6149, + EndPos: 6151, }, Value: "Foo", }, @@ -15524,9 +15435,9 @@ func TestPhp7(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 334, - EndLine: 334, - StartPos: 6153, - EndPos: 6154, + EndLine: 334, + StartPos: 6153, + EndPos: 6154, }, }, }, @@ -15534,52 +15445,52 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 335, - EndLine: 335, - StartPos: 6159, - EndPos: 6170, + EndLine: 335, + StartPos: 6159, + EndPos: 6170, }, Expr: &expr.FunctionCall{ Position: &position.Position{ StartLine: 335, - EndLine: 335, - StartPos: 6159, - EndPos: 6169, + EndLine: 335, + StartPos: 6159, + EndPos: 6169, }, Function: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 335, - EndLine: 335, - StartPos: 6159, - EndPos: 6167, + EndLine: 335, + StartPos: 6159, + EndPos: 6167, }, Variable: &expr.ShortArray{ Position: &position.Position{ StartLine: 335, - EndLine: 335, - StartPos: 6159, - EndPos: 6164, + EndLine: 335, + StartPos: 6159, + EndPos: 6164, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 335, - EndLine: 335, - StartPos: 6160, - EndPos: 6163, + EndLine: 335, + StartPos: 6160, + EndPos: 6163, }, Val: &expr.Variable{ Position: &position.Position{ StartLine: 335, - EndLine: 335, - StartPos: 6160, - EndPos: 6163, + EndLine: 335, + StartPos: 6160, + EndPos: 6163, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 335, - EndLine: 335, - StartPos: 6160, - EndPos: 6163, + EndLine: 335, + StartPos: 6160, + EndPos: 6163, }, Value: "foo", }, @@ -15590,9 +15501,9 @@ func TestPhp7(t *testing.T) { Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 335, - EndLine: 335, - StartPos: 6166, - EndPos: 6166, + EndLine: 335, + StartPos: 6166, + EndPos: 6166, }, Value: "0", }, @@ -15600,9 +15511,9 @@ func TestPhp7(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 335, - EndLine: 335, - StartPos: 6168, - EndPos: 6169, + EndLine: 335, + StartPos: 6168, + EndPos: 6169, }, }, }, @@ -15610,45 +15521,45 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 336, - EndLine: 336, - StartPos: 6174, - EndPos: 6182, + EndLine: 336, + StartPos: 6174, + EndPos: 6182, }, Expr: &expr.FunctionCall{ Position: &position.Position{ StartLine: 336, - EndLine: 336, - StartPos: 6174, - EndPos: 6181, + EndLine: 336, + StartPos: 6174, + EndPos: 6181, }, Function: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 336, - EndLine: 336, - StartPos: 6174, - EndPos: 6179, + EndLine: 336, + StartPos: 6174, + EndPos: 6179, }, Variable: &expr.ConstFetch{ Position: &position.Position{ StartLine: 336, - EndLine: 336, - StartPos: 6174, - EndPos: 6176, + EndLine: 336, + StartPos: 6174, + EndPos: 6176, }, Constant: &name.Name{ Position: &position.Position{ StartLine: 336, - EndLine: 336, - StartPos: 6174, - EndPos: 6176, + EndLine: 336, + StartPos: 6174, + EndPos: 6176, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 336, - EndLine: 336, - StartPos: 6174, - EndPos: 6176, + EndLine: 336, + StartPos: 6174, + EndPos: 6176, }, Value: "foo", }, @@ -15658,9 +15569,9 @@ func TestPhp7(t *testing.T) { Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 336, - EndLine: 336, - StartPos: 6178, - EndPos: 6178, + EndLine: 336, + StartPos: 6178, + EndPos: 6178, }, Value: "1", }, @@ -15668,9 +15579,9 @@ func TestPhp7(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 336, - EndLine: 336, - StartPos: 6180, - EndPos: 6181, + EndLine: 336, + StartPos: 6180, + EndPos: 6181, }, }, }, @@ -15678,32 +15589,32 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 337, - EndLine: 337, - StartPos: 6186, - EndPos: 6193, + EndLine: 337, + StartPos: 6186, + EndPos: 6193, }, Expr: &expr.FunctionCall{ Position: &position.Position{ StartLine: 337, - EndLine: 337, - StartPos: 6186, - EndPos: 6192, + EndLine: 337, + StartPos: 6186, + EndPos: 6192, }, Function: &scalar.String{ Position: &position.Position{ StartLine: 337, - EndLine: 337, - StartPos: 6186, - EndPos: 6190, + EndLine: 337, + StartPos: 6186, + EndPos: 6190, }, Value: "\"foo\"", }, ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 337, - EndLine: 337, - StartPos: 6191, - EndPos: 6192, + EndLine: 337, + StartPos: 6191, + EndPos: 6192, }, }, }, @@ -15711,45 +15622,45 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 338, - EndLine: 338, - StartPos: 6197, - EndPos: 6208, + EndLine: 338, + StartPos: 6197, + EndPos: 6208, }, Expr: &expr.FunctionCall{ Position: &position.Position{ StartLine: 338, - EndLine: 338, - StartPos: 6197, - EndPos: 6207, + EndLine: 338, + StartPos: 6197, + EndPos: 6207, }, Function: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 338, - EndLine: 338, - StartPos: 6197, - EndPos: 6205, + EndLine: 338, + StartPos: 6197, + EndPos: 6205, }, Variable: &expr.ShortArray{ Position: &position.Position{ StartLine: 338, - EndLine: 338, - StartPos: 6197, - EndPos: 6199, + EndLine: 338, + StartPos: 6197, + EndPos: 6199, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 338, - EndLine: 338, - StartPos: 6198, - EndPos: 6198, + EndLine: 338, + StartPos: 6198, + EndPos: 6198, }, Val: &scalar.Lnumber{ Position: &position.Position{ StartLine: 338, - EndLine: 338, - StartPos: 6198, - EndPos: 6198, + EndLine: 338, + StartPos: 6198, + EndPos: 6198, }, Value: "1", }, @@ -15759,16 +15670,16 @@ func TestPhp7(t *testing.T) { Dim: &expr.Variable{ Position: &position.Position{ StartLine: 338, - EndLine: 338, - StartPos: 6201, - EndPos: 6204, + EndLine: 338, + StartPos: 6201, + EndPos: 6204, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 338, - EndLine: 338, - StartPos: 6201, - EndPos: 6204, + EndLine: 338, + StartPos: 6201, + EndPos: 6204, }, Value: "foo", }, @@ -15777,9 +15688,9 @@ func TestPhp7(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 338, - EndLine: 338, - StartPos: 6206, - EndPos: 6207, + EndLine: 338, + StartPos: 6206, + EndPos: 6207, }, }, }, @@ -15787,38 +15698,38 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 339, - EndLine: 339, - StartPos: 6212, - EndPos: 6220, + EndLine: 339, + StartPos: 6212, + EndPos: 6220, }, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 339, - EndLine: 339, - StartPos: 6212, - EndPos: 6219, + EndLine: 339, + StartPos: 6212, + EndPos: 6219, }, VarName: &expr.FunctionCall{ Position: &position.Position{ StartLine: 339, - EndLine: 339, - StartPos: 6214, - EndPos: 6218, + EndLine: 339, + StartPos: 6214, + EndPos: 6218, }, Function: &name.Name{ Position: &position.Position{ StartLine: 339, - EndLine: 339, - StartPos: 6214, - EndPos: 6216, + EndLine: 339, + StartPos: 6214, + EndPos: 6216, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 339, - EndLine: 339, - StartPos: 6214, - EndPos: 6216, + EndLine: 339, + StartPos: 6214, + EndPos: 6216, }, Value: "foo", }, @@ -15827,9 +15738,9 @@ func TestPhp7(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 339, - EndLine: 339, - StartPos: 6217, - EndPos: 6218, + EndLine: 339, + StartPos: 6217, + EndPos: 6218, }, }, }, @@ -15838,31 +15749,31 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 341, - EndLine: 341, - StartPos: 6225, - EndPos: 6236, + EndLine: 341, + StartPos: 6225, + EndPos: 6236, }, Expr: &expr.StaticCall{ Position: &position.Position{ StartLine: 341, - EndLine: 341, - StartPos: 6225, - EndPos: 6235, + EndLine: 341, + StartPos: 6225, + EndPos: 6235, }, Class: &name.Name{ Position: &position.Position{ StartLine: 341, - EndLine: 341, - StartPos: 6225, - EndPos: 6227, + EndLine: 341, + StartPos: 6225, + EndPos: 6227, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 341, - EndLine: 341, - StartPos: 6225, - EndPos: 6227, + EndLine: 341, + StartPos: 6225, + EndPos: 6227, }, Value: "Foo", }, @@ -15871,16 +15782,16 @@ func TestPhp7(t *testing.T) { Call: &expr.Variable{ Position: &position.Position{ StartLine: 341, - EndLine: 341, - StartPos: 6230, - EndPos: 6233, + EndLine: 341, + StartPos: 6230, + EndPos: 6233, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 341, - EndLine: 341, - StartPos: 6230, - EndPos: 6233, + EndLine: 341, + StartPos: 6230, + EndPos: 6233, }, Value: "bar", }, @@ -15888,9 +15799,9 @@ func TestPhp7(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 341, - EndLine: 341, - StartPos: 6234, - EndPos: 6235, + EndLine: 341, + StartPos: 6234, + EndPos: 6235, }, }, }, @@ -15898,31 +15809,31 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 342, - EndLine: 342, - StartPos: 6240, - EndPos: 6256, + EndLine: 342, + StartPos: 6240, + EndPos: 6256, }, Expr: &expr.StaticCall{ Position: &position.Position{ StartLine: 342, - EndLine: 342, - StartPos: 6240, - EndPos: 6255, + EndLine: 342, + StartPos: 6240, + EndPos: 6255, }, Class: &name.Name{ Position: &position.Position{ StartLine: 342, - EndLine: 342, - StartPos: 6240, - EndPos: 6242, + EndLine: 342, + StartPos: 6240, + EndPos: 6242, }, Parts: []node.Node{ &name.NamePart{ Position: &position.Position{ StartLine: 342, - EndLine: 342, - StartPos: 6240, - EndPos: 6242, + EndLine: 342, + StartPos: 6240, + EndPos: 6242, }, Value: "Foo", }, @@ -15931,23 +15842,23 @@ func TestPhp7(t *testing.T) { Call: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 342, - EndLine: 342, - StartPos: 6246, - EndPos: 6252, + EndLine: 342, + StartPos: 6246, + EndPos: 6252, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 342, - EndLine: 342, - StartPos: 6246, - EndPos: 6249, + EndLine: 342, + StartPos: 6246, + EndPos: 6249, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 342, - EndLine: 342, - StartPos: 6246, - EndPos: 6249, + EndLine: 342, + StartPos: 6246, + EndPos: 6249, }, Value: "bar", }, @@ -15955,9 +15866,9 @@ func TestPhp7(t *testing.T) { Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 342, - EndLine: 342, - StartPos: 6251, - EndPos: 6251, + EndLine: 342, + StartPos: 6251, + EndPos: 6251, }, Value: "0", }, @@ -15965,9 +15876,9 @@ func TestPhp7(t *testing.T) { ArgumentList: &node.ArgumentList{ Position: &position.Position{ StartLine: 342, - EndLine: 342, - StartPos: 6254, - EndPos: 6255, + EndLine: 342, + StartPos: 6254, + EndPos: 6255, }, }, }, @@ -15975,30 +15886,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 344, - EndLine: 344, - StartPos: 6263, - EndPos: 6273, + EndLine: 344, + StartPos: 6263, + EndPos: 6273, }, Expr: &expr.PropertyFetch{ Position: &position.Position{ StartLine: 344, - EndLine: 344, - StartPos: 6263, - EndPos: 6272, + EndLine: 344, + StartPos: 6263, + EndPos: 6272, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 344, - EndLine: 344, - StartPos: 6263, - EndPos: 6266, + EndLine: 344, + StartPos: 6263, + EndPos: 6266, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 344, - EndLine: 344, - StartPos: 6263, - EndPos: 6266, + EndLine: 344, + StartPos: 6263, + EndPos: 6266, }, Value: "foo", }, @@ -16006,16 +15917,16 @@ func TestPhp7(t *testing.T) { Property: &expr.Variable{ Position: &position.Position{ StartLine: 344, - EndLine: 344, - StartPos: 6269, - EndPos: 6272, + EndLine: 344, + StartPos: 6269, + EndPos: 6272, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 344, - EndLine: 344, - StartPos: 6269, - EndPos: 6272, + EndLine: 344, + StartPos: 6269, + EndPos: 6272, }, Value: "bar", }, @@ -16025,30 +15936,30 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 345, - EndLine: 345, - StartPos: 6277, - EndPos: 6292, + EndLine: 345, + StartPos: 6277, + EndPos: 6292, }, Expr: &expr.PropertyFetch{ Position: &position.Position{ StartLine: 345, - EndLine: 345, - StartPos: 6277, - EndPos: 6290, + EndLine: 345, + StartPos: 6277, + EndPos: 6290, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 345, - EndLine: 345, - StartPos: 6277, - EndPos: 6280, + EndLine: 345, + StartPos: 6277, + EndPos: 6280, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 345, - EndLine: 345, - StartPos: 6277, - EndPos: 6280, + EndLine: 345, + StartPos: 6277, + EndPos: 6280, }, Value: "foo", }, @@ -16056,23 +15967,23 @@ func TestPhp7(t *testing.T) { Property: &expr.ArrayDimFetch{ Position: &position.Position{ StartLine: 345, - EndLine: 345, - StartPos: 6284, - EndPos: 6290, + EndLine: 345, + StartPos: 6284, + EndPos: 6290, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 345, - EndLine: 345, - StartPos: 6284, - EndPos: 6287, + EndLine: 345, + StartPos: 6284, + EndPos: 6287, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 345, - EndLine: 345, - StartPos: 6284, - EndPos: 6287, + EndLine: 345, + StartPos: 6284, + EndPos: 6287, }, Value: "bar", }, @@ -16080,9 +15991,9 @@ func TestPhp7(t *testing.T) { Dim: &scalar.Lnumber{ Position: &position.Position{ StartLine: 345, - EndLine: 345, - StartPos: 6289, - EndPos: 6289, + EndLine: 345, + StartPos: 6289, + EndPos: 6289, }, Value: "0", }, @@ -16092,54 +16003,54 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Position: &position.Position{ StartLine: 347, - EndLine: 347, - StartPos: 6297, - EndPos: 6318, + EndLine: 347, + StartPos: 6297, + EndPos: 6318, }, Expr: &expr.ShortArray{ Position: &position.Position{ StartLine: 347, - EndLine: 347, - StartPos: 6297, - EndPos: 6317, + EndLine: 347, + StartPos: 6297, + EndPos: 6317, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 347, - EndLine: 347, - StartPos: 6298, - EndPos: 6303, + EndLine: 347, + StartPos: 6298, + EndPos: 6303, }, Key: &scalar.Lnumber{ Position: &position.Position{ StartLine: 347, - EndLine: 347, - StartPos: 6298, - EndPos: 6298, + EndLine: 347, + StartPos: 6298, + EndPos: 6298, }, Value: "1", }, Val: &expr.Reference{ Position: &position.Position{ StartLine: 347, - EndLine: 347, - StartPos: 6301, - EndPos: 6303, + EndLine: 347, + StartPos: 6301, + EndPos: 6303, }, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 347, - EndLine: 347, - StartPos: 6302, - EndPos: 6303, + EndLine: 347, + StartPos: 6302, + EndPos: 6303, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 347, - EndLine: 347, - StartPos: 6302, - EndPos: 6303, + EndLine: 347, + StartPos: 6302, + EndPos: 6303, }, Value: "a", }, @@ -16149,47 +16060,47 @@ func TestPhp7(t *testing.T) { &expr.ArrayItem{ Position: &position.Position{ StartLine: 347, - EndLine: 347, - StartPos: 6306, - EndPos: 6316, + EndLine: 347, + StartPos: 6306, + EndPos: 6316, }, Key: &scalar.Lnumber{ Position: &position.Position{ StartLine: 347, - EndLine: 347, - StartPos: 6306, - EndPos: 6306, + EndLine: 347, + StartPos: 6306, + EndPos: 6306, }, Value: "2", }, Val: &expr.List{ Position: &position.Position{ StartLine: 347, - EndLine: 347, - StartPos: 6309, - EndPos: 6316, + EndLine: 347, + StartPos: 6309, + EndPos: 6316, }, Items: []node.Node{ &expr.ArrayItem{ Position: &position.Position{ StartLine: 347, - EndLine: 347, - StartPos: 6314, - EndPos: 6315, + EndLine: 347, + StartPos: 6314, + EndPos: 6315, }, Val: &expr.Variable{ Position: &position.Position{ StartLine: 347, - EndLine: 347, - StartPos: 6314, - EndPos: 6315, + EndLine: 347, + StartPos: 6314, + EndPos: 6315, }, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 347, - EndLine: 347, - StartPos: 6314, - EndPos: 6315, + EndLine: 347, + StartPos: 6314, + EndPos: 6315, }, Value: "b", }, From c4c0934c514cf718426f8a43586c80b0a3eb34fe Mon Sep 17 00:00:00 2001 From: z7zmey Date: Sun, 8 Jul 2018 01:06:49 +0300 Subject: [PATCH 014/117] tokens constants moved to lexer_tokens.go --- scanner/lexer.go | 412 +--------------------------------------- scanner/lexer_tokens.go | 140 ++++++++++++++ 2 files changed, 142 insertions(+), 410 deletions(-) create mode 100644 scanner/lexer_tokens.go diff --git a/scanner/lexer.go b/scanner/lexer.go index d16103c..8d5e23a 100644 --- a/scanner/lexer.go +++ b/scanner/lexer.go @@ -4,7 +4,7 @@ package scanner import ( "bufio" "bytes" - "go/token" + t "go/token" "io" "sync" "unicode" @@ -23,414 +23,6 @@ const ( classOther ) -// T_INCLUDE token -const T_INCLUDE = 57346 - -// T_INCLUDE_ONCE token -const T_INCLUDE_ONCE = 57347 - -// T_EXIT token -const T_EXIT = 57348 - -// T_IF token -const T_IF = 57349 - -// T_LNUMBER token -const T_LNUMBER = 57350 - -// T_DNUMBER token -const T_DNUMBER = 57351 - -// T_STRING token -const T_STRING = 57352 - -// T_STRING_VARNAME token -const T_STRING_VARNAME = 57353 - -// T_VARIABLE token -const T_VARIABLE = 57354 - -// T_NUM_STRING token -const T_NUM_STRING = 57355 - -// T_INLINE_HTML token -const T_INLINE_HTML = 57356 - -// T_CHARACTER token -const T_CHARACTER = 57357 - -// T_BAD_CHARACTER token -const T_BAD_CHARACTER = 57358 - -// T_ENCAPSED_AND_WHITESPACE token -const T_ENCAPSED_AND_WHITESPACE = 57359 - -// T_CONSTANT_ENCAPSED_STRING token -const T_CONSTANT_ENCAPSED_STRING = 57360 - -// T_ECHO token -const T_ECHO = 57361 - -// T_DO token -const T_DO = 57362 - -// T_WHILE token -const T_WHILE = 57363 - -// T_ENDWHILE token -const T_ENDWHILE = 57364 - -// T_FOR token -const T_FOR = 57365 - -// T_ENDFOR token -const T_ENDFOR = 57366 - -// T_FOREACH token -const T_FOREACH = 57367 - -// T_ENDFOREACH token -const T_ENDFOREACH = 57368 - -// T_DECLARE token -const T_DECLARE = 57369 - -// T_ENDDECLARE token -const T_ENDDECLARE = 57370 - -// T_AS token -const T_AS = 57371 - -// T_SWITCH token -const T_SWITCH = 57372 - -// T_ENDSWITCH token -const T_ENDSWITCH = 57373 - -// T_CASE token -const T_CASE = 57374 - -// T_DEFAULT token -const T_DEFAULT = 57375 - -// T_BREAK token -const T_BREAK = 57376 - -// T_CONTINUE token -const T_CONTINUE = 57377 - -// T_GOTO token -const T_GOTO = 57378 - -// T_FUNCTION token -const T_FUNCTION = 57379 - -// T_CONST token -const T_CONST = 57380 - -// T_RETURN token -const T_RETURN = 57381 - -// T_TRY token -const T_TRY = 57382 - -// T_CATCH token -const T_CATCH = 57383 - -// T_FINALLY token -const T_FINALLY = 57384 - -// T_THROW token -const T_THROW = 57385 - -// T_USE token -const T_USE = 57386 - -// T_INSTEADOF token -const T_INSTEADOF = 57387 - -// T_GLOBAL token -const T_GLOBAL = 57388 - -// T_VAR token -const T_VAR = 57389 - -// T_UNSET token -const T_UNSET = 57390 - -// T_ISSET token -const T_ISSET = 57391 - -// T_EMPTY token -const T_EMPTY = 57392 - -// T_HALT_COMPILER token -const T_HALT_COMPILER = 57393 - -// T_CLASS token -const T_CLASS = 57394 - -// T_TRAIT token -const T_TRAIT = 57395 - -// T_INTERFACE token -const T_INTERFACE = 57396 - -// T_EXTENDS token -const T_EXTENDS = 57397 - -// T_IMPLEMENTS token -const T_IMPLEMENTS = 57398 - -// T_OBJECT_OPERATOR token -const T_OBJECT_OPERATOR = 57399 - -// T_DOUBLE_ARROW token -const T_DOUBLE_ARROW = 57400 - -// T_LIST token -const T_LIST = 57401 - -// T_ARRAY token -const T_ARRAY = 57402 - -// T_CALLABLE token -const T_CALLABLE = 57403 - -// T_CLASS_C token -const T_CLASS_C = 57404 - -// T_TRAIT_C token -const T_TRAIT_C = 57405 - -// T_METHOD_C token -const T_METHOD_C = 57406 - -// T_FUNC_C token -const T_FUNC_C = 57407 - -// T_LINE token -const T_LINE = 57408 - -// T_FILE token -const T_FILE = 57409 - -// T_COMMENT token -const T_COMMENT = 57410 - -// T_DOC_COMMENT token -const T_DOC_COMMENT = 57411 - -// T_OPEN_TAG token -const T_OPEN_TAG = 57412 - -// T_OPEN_TAG_WITH_ECHO token -const T_OPEN_TAG_WITH_ECHO = 57413 - -// T_CLOSE_TAG token -const T_CLOSE_TAG = 57414 - -// T_WHITESPACE token -const T_WHITESPACE = 57415 - -// T_START_HEREDOC token -const T_START_HEREDOC = 57416 - -// T_END_HEREDOC token -const T_END_HEREDOC = 57417 - -// T_DOLLAR_OPEN_CURLY_BRACES token -const T_DOLLAR_OPEN_CURLY_BRACES = 57418 - -// T_CURLY_OPEN token -const T_CURLY_OPEN = 57419 - -// T_PAAMAYIM_NEKUDOTAYIM token -const T_PAAMAYIM_NEKUDOTAYIM = 57420 - -// T_NAMESPACE token -const T_NAMESPACE = 57421 - -// T_NS_C token -const T_NS_C = 57422 - -// T_DIR token -const T_DIR = 57423 - -// T_NS_SEPARATOR token -const T_NS_SEPARATOR = 57424 - -// T_ELLIPSIS token -const T_ELLIPSIS = 57425 - -// T_EVAL token -const T_EVAL = 57426 - -// T_REQUIRE token -const T_REQUIRE = 57427 - -// T_REQUIRE_ONCE token -const T_REQUIRE_ONCE = 57428 - -// T_LOGICAL_OR token -const T_LOGICAL_OR = 57429 - -// T_LOGICAL_XOR token -const T_LOGICAL_XOR = 57430 - -// T_LOGICAL_AND token -const T_LOGICAL_AND = 57431 - -// T_INSTANCEOF token -const T_INSTANCEOF = 57432 - -// T_NEW token -const T_NEW = 57433 - -// T_CLONE token -const T_CLONE = 57434 - -// T_ELSEIF token -const T_ELSEIF = 57435 - -// T_ELSE token -const T_ELSE = 57436 - -// T_ENDIF token -const T_ENDIF = 57437 - -// T_PRINT token -const T_PRINT = 57438 - -// T_YIELD token -const T_YIELD = 57439 - -// T_STATIC token -const T_STATIC = 57440 - -// T_ABSTRACT token -const T_ABSTRACT = 57441 - -// T_FINAL token -const T_FINAL = 57442 - -// T_PRIVATE token -const T_PRIVATE = 57443 - -// T_PROTECTED token -const T_PROTECTED = 57444 - -// T_PUBLIC token -const T_PUBLIC = 57445 - -// T_INC token -const T_INC = 57446 - -// T_DEC token -const T_DEC = 57447 - -// T_YIELD_FROM token -const T_YIELD_FROM = 57448 - -// T_INT_CAST token -const T_INT_CAST = 57449 - -// T_DOUBLE_CAST token -const T_DOUBLE_CAST = 57450 - -// T_STRING_CAST token -const T_STRING_CAST = 57451 - -// T_ARRAY_CAST token -const T_ARRAY_CAST = 57452 - -// T_OBJECT_CAST token -const T_OBJECT_CAST = 57453 - -// T_BOOL_CAST token -const T_BOOL_CAST = 57454 - -// T_UNSET_CAST token -const T_UNSET_CAST = 57455 - -// T_COALESCE token -const T_COALESCE = 57456 - -// T_SPACESHIP token -const T_SPACESHIP = 57457 - -// T_NOELSE token -const T_NOELSE = 57458 - -// T_PLUS_EQUAL token -const T_PLUS_EQUAL = 57459 - -// T_MINUS_EQUAL token -const T_MINUS_EQUAL = 57460 - -// T_MUL_EQUAL token -const T_MUL_EQUAL = 57461 - -// T_POW_EQUAL token -const T_POW_EQUAL = 57462 - -// T_DIV_EQUAL token -const T_DIV_EQUAL = 57463 - -// T_CONCAT_EQUAL token -const T_CONCAT_EQUAL = 57464 - -// T_MOD_EQUAL token -const T_MOD_EQUAL = 57465 - -// T_AND_EQUAL token -const T_AND_EQUAL = 57466 - -// T_OR_EQUAL token -const T_OR_EQUAL = 57467 - -// T_XOR_EQUAL token -const T_XOR_EQUAL = 57468 - -// T_SL_EQUAL token -const T_SL_EQUAL = 57469 - -// T_SR_EQUAL token -const T_SR_EQUAL = 57470 - -// T_BOOLEAN_OR token -const T_BOOLEAN_OR = 57471 - -// T_BOOLEAN_AND token -const T_BOOLEAN_AND = 57472 - -// T_POW token -const T_POW = 57473 - -// T_SL token -const T_SL = 57474 - -// T_SR token -const T_SR = 57475 - -// T_IS_IDENTICAL token -const T_IS_IDENTICAL = 57476 - -// T_IS_NOT_IDENTICAL token -const T_IS_NOT_IDENTICAL = 57477 - -// T_IS_EQUAL token -const T_IS_EQUAL = 57478 - -// T_IS_NOT_EQUAL token -const T_IS_NOT_EQUAL = 57479 - -// T_IS_SMALLER_OR_EQUAL token -const T_IS_SMALLER_OR_EQUAL = 57480 - -// T_IS_GREATER_OR_EQUAL token -const T_IS_GREATER_OR_EQUAL = 57481 - // Lval parsers yySymType must implement this interface type Lval interface { Token(tkn *Token) @@ -468,7 +60,7 @@ func Rune2Class(r rune) int { // NewLexer the Lexer constructor func NewLexer(src io.Reader, fName string) *Lexer { - file := token.NewFileSet().AddFile(fName, -1, 1<<31-3) + file := t.NewFileSet().AddFile(fName, -1, 1<<31-3) lx, err := lex.New(file, bufio.NewReader(src), lex.RuneClass(Rune2Class)) if err != nil { panic(err) diff --git a/scanner/lexer_tokens.go b/scanner/lexer_tokens.go new file mode 100644 index 0000000..8f53114 --- /dev/null +++ b/scanner/lexer_tokens.go @@ -0,0 +1,140 @@ +package scanner + +const ( + T_INCLUDE int = iota + 57346 + T_INCLUDE_ONCE + T_EXIT + T_IF + T_LNUMBER + T_DNUMBER + T_STRING + T_STRING_VARNAME + T_VARIABLE + T_NUM_STRING + T_INLINE_HTML + T_CHARACTER + T_BAD_CHARACTER + T_ENCAPSED_AND_WHITESPACE + T_CONSTANT_ENCAPSED_STRING + T_ECHO + T_DO + T_WHILE + T_ENDWHILE + T_FOR + T_ENDFOR + T_FOREACH + T_ENDFOREACH + T_DECLARE + T_ENDDECLARE + T_AS + T_SWITCH + T_ENDSWITCH + T_CASE + T_DEFAULT + T_BREAK + T_CONTINUE + T_GOTO + T_FUNCTION + T_CONST + T_RETURN + T_TRY + T_CATCH + T_FINALLY + T_THROW + T_USE + T_INSTEADOF + T_GLOBAL + T_VAR + T_UNSET + T_ISSET + T_EMPTY + T_HALT_COMPILER + T_CLASS + T_TRAIT + T_INTERFACE + T_EXTENDS + T_IMPLEMENTS + T_OBJECT_OPERATOR + T_DOUBLE_ARROW + T_LIST + T_ARRAY + T_CALLABLE + T_CLASS_C + T_TRAIT_C + T_METHOD_C + T_FUNC_C + T_LINE + T_FILE + T_COMMENT + T_DOC_COMMENT + T_OPEN_TAG + T_OPEN_TAG_WITH_ECHO + T_CLOSE_TAG + T_WHITESPACE + T_START_HEREDOC + T_END_HEREDOC + T_DOLLAR_OPEN_CURLY_BRACES + T_CURLY_OPEN + T_PAAMAYIM_NEKUDOTAYIM + T_NAMESPACE + T_NS_C + T_DIR + T_NS_SEPARATOR + T_ELLIPSIS + T_EVAL + T_REQUIRE + T_REQUIRE_ONCE + T_LOGICAL_OR + T_LOGICAL_XOR + T_LOGICAL_AND + T_INSTANCEOF + T_NEW + T_CLONE + T_ELSEIF + T_ELSE + T_ENDIF + T_PRINT + T_YIELD + T_STATIC + T_ABSTRACT + T_FINAL + T_PRIVATE + T_PROTECTED + T_PUBLIC + T_INC + T_DEC + T_YIELD_FROM + T_INT_CAST + T_DOUBLE_CAST + T_STRING_CAST + T_ARRAY_CAST + T_OBJECT_CAST + T_BOOL_CAST + T_UNSET_CAST + T_COALESCE + T_SPACESHIP + T_NOELSE + T_PLUS_EQUAL + T_MINUS_EQUAL + T_MUL_EQUAL + T_POW_EQUAL + T_DIV_EQUAL + T_CONCAT_EQUAL + T_MOD_EQUAL + T_AND_EQUAL + T_OR_EQUAL + T_XOR_EQUAL + T_SL_EQUAL + T_SR_EQUAL + T_BOOLEAN_OR + T_BOOLEAN_AND + T_POW + T_SL + T_SR + T_IS_IDENTICAL + T_IS_NOT_IDENTICAL + T_IS_EQUAL + T_IS_NOT_EQUAL + T_IS_SMALLER_OR_EQUAL + T_IS_GREATER_OR_EQUAL +) From 15a1a81924a473f478412a4aee04227c82851b6c Mon Sep 17 00:00:00 2001 From: z7zmey Date: Mon, 2 Jul 2018 20:48:55 +0300 Subject: [PATCH 015/117] #13: the printer prints nodes with meta(comments and whitespaces) saved by the parser --- Makefile | 1 + meta/tokenName.go | 163 + meta/tokenName_string.go | 16 + meta/tokenName_test.go | 29 + meta/tokenNames.go | 328 -- node/stmt/n_trait_use.go | 4 +- node/stmt/t_trait_use_test.go | 16 + php5/php5.go | 1203 ++++---- php5/php5.y | 167 +- php5/php5_test.go | 30 +- php7/php7.go | 1126 ++++--- php7/php7.y | 144 +- php7/php7_test.go | 36 +- printer/pretty_printer.go | 2182 ++++++++++++++ printer/pretty_printer_test.go | 4097 +++++++++++++++++++++++++ printer/printer.go | 1573 +++++++--- printer/printer_parsed_test.go | 955 ++++++ printer/printer_test.go | 4528 +++++++++++++++++++--------- scanner/lexer.go | 1 + scanner/scanner.go | 1001 +++--- scanner/scanner.l | 14 +- scanner/scanner_test.go | 95 +- visitor/dumper.go | 3 +- visitor/dumper_test.go | 8 +- visitor/go_dumper_test.go | 826 ++--- visitor/json_dumper.go | 4 +- visitor/json_dumper_test.go | 2 +- visitor/namespace_resolver.go | 4 +- visitor/pretty_json_dumper.go | 2 +- visitor/pretty_json_dumper_test.go | 17 +- 30 files changed, 14110 insertions(+), 4465 deletions(-) create mode 100644 meta/tokenName.go create mode 100644 meta/tokenName_string.go create mode 100644 meta/tokenName_test.go delete mode 100644 meta/tokenNames.go create mode 100644 printer/pretty_printer.go create mode 100644 printer/pretty_printer_test.go create mode 100644 printer/printer_parsed_test.go diff --git a/Makefile b/Makefile index 568b883..460cda5 100644 --- a/Makefile +++ b/Makefile @@ -6,6 +6,7 @@ fmt: find . -type f -iregex '.*\.go' -exec gofmt -l -s -w '{}' + build: + go generate ./... go build run: diff --git a/meta/tokenName.go b/meta/tokenName.go new file mode 100644 index 0000000..f3ad33d --- /dev/null +++ b/meta/tokenName.go @@ -0,0 +1,163 @@ +package meta + +// TokenName is used to specify a comment position +type TokenName int + +//go:generate stringer -type=TokenName -output ./tokenName_string.go +const ( + UnknownToken TokenName = iota + NodeStart + NodeEnd + MagicConstantToken + IncludeToken + IncludeOnceToken + ExitToken + IfToken + LnumberToken + DnumberToken + StringToken + StringVarnameToken + VariableToken + NumStringToken + InlineHTMLToken + EncapsedAndWhitespaceToken + ConstantEncapsedStringToken + EchoToken + DoToken + WhileToken + EndwhileToken + ForInitSemicolonToken + ForCondSemicolonToken + ForToken + EndforToken + ForeachToken + EndforeachToken + DeclareToken + EnddeclareToken + AsToken + SwitchToken + SwitchSemicolonToken + EndswitchToken + CaseToken + DefaultToken + BreakToken + ContinueToken + GotoToken + FunctionToken + ConstToken + ReturnToken + TryToken + CatchToken + FinallyToken + ThrowToken + UseToken + InsteadofToken + GlobalToken + VarToken + UnsetToken + IssetToken + EmptyToken + ClassToken + TraitToken + InterfaceToken + ExtendsToken + ImplementsToken + DoubleArrowToken + ListToken + ArrayToken + CallableToken + StartHeredocToken + DollarOpenCurlyBracesToken + CurlyOpenToken + PaamayimNekudotayimToken + NamespaceToken + NsSeparatorToken + EllipsisToken + EvalToken + RequireToken + RequireOnceToken + LogicalOrToken + LogicalXorToken + LogicalAndToken + InstanceofToken + NewToken + CloneToken + ElseifToken + ElseToken + EndifToken + PrintToken + YieldToken + StaticToken + AbstractToken + FinalToken + PrivateToken + ProtectedToken + PublicToken + IncToken + DecToken + YieldFromToken + ObjectOperatorToken + IntCastToken + DoubleCastToken + StringCastToken + ArrayCastToken + ObjectCastToken + BoolCastToken + UnsetCastToken + CoalesceToken + SpaceshipToken + PlusEqualToken + MinusEqualToken + MulEqualToken + PowEqualToken + DivEqualToken + ConcatEqualToken + ModEqualToken + AndEqualToken + OrEqualToken + XorEqualToken + SlEqualToken + SrEqualToken + BooleanOrToken + BooleanAndToken + PowToken + SlToken + SrToken + IsIdenticalToken + IsNotIdenticalToken + IsEqualToken + IsNotEqualToken + IsSmallerOrEqualToken + IsGreaterOrEqualToken + HaltCompilerToken + IdentifierToken + CaseSeparatorToken // ';' or ':' + DoubleQuoteToken // '"' + BackquoteToken // '`' + OpenCurlyBracesToken // '{' + CloseCurlyBracesToken // '}' + SemiColonToken // ';' + ColonToken // ':' + OpenParenthesisToken // '(' + CloseParenthesisToken // ')' + OpenSquareBracket // '[' + CloseSquareBracket // ']' + QuestionMarkToken // '?' + AmpersandToken // '&' + MinusToken // '-' + PlusToken // '+' + ExclamationMarkToken // '!' + TildeToken // '~' + AtToken // '@' + DollarToken // '$' + CommaToken // ',' + VerticalBarToken // '|' + EqualToken // '=' + CaretToken // '^' + AsteriskToken // '*' + SlashToken // '/' + PercentToken // '%' + LessToken // '<' + GreaterToken // '>' + DotToken // '.' +) diff --git a/meta/tokenName_string.go b/meta/tokenName_string.go new file mode 100644 index 0000000..a906696 --- /dev/null +++ b/meta/tokenName_string.go @@ -0,0 +1,16 @@ +// Code generated by "stringer -type=TokenName -output ./tokenName_string.go"; DO NOT EDIT. + +package meta + +import "strconv" + +const _TokenName_name = "UnknownTokenNodeStartNodeEndMagicConstantTokenIncludeTokenIncludeOnceTokenExitTokenIfTokenLnumberTokenDnumberTokenStringTokenStringVarnameTokenVariableTokenNumStringTokenInlineHTMLTokenEncapsedAndWhitespaceTokenConstantEncapsedStringTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenSwitchSemicolonTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenUseTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenIssetTokenEmptyTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenListTokenArrayTokenCallableTokenStartHeredocTokenDollarOpenCurlyBracesTokenCurlyOpenTokenPaamayimNekudotayimTokenNamespaceTokenNsSeparatorTokenEllipsisTokenEvalTokenRequireTokenRequireOnceTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenNewTokenCloneTokenElseifTokenElseTokenEndifTokenPrintTokenYieldTokenStaticTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenYieldFromTokenObjectOperatorTokenIntCastTokenDoubleCastTokenStringCastTokenArrayCastTokenObjectCastTokenBoolCastTokenUnsetCastTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenIdentifierTokenCaseSeparatorTokenDoubleQuoteTokenBackquoteTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenExclamationMarkTokenTildeTokenAtTokenDollarTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" + +var _TokenName_index = [...]uint16{0, 12, 21, 28, 46, 58, 74, 83, 90, 102, 114, 125, 143, 156, 170, 185, 211, 238, 247, 254, 264, 277, 298, 319, 327, 338, 350, 365, 377, 392, 399, 410, 430, 444, 453, 465, 475, 488, 497, 510, 520, 531, 539, 549, 561, 571, 579, 593, 604, 612, 622, 632, 642, 652, 662, 676, 688, 703, 719, 728, 738, 751, 768, 794, 808, 832, 846, 862, 875, 884, 896, 912, 926, 941, 956, 971, 979, 989, 1000, 1009, 1019, 1029, 1039, 1050, 1063, 1073, 1085, 1099, 1110, 1118, 1126, 1140, 1159, 1171, 1186, 1201, 1215, 1230, 1243, 1257, 1270, 1284, 1298, 1313, 1326, 1339, 1352, 1368, 1381, 1394, 1406, 1419, 1431, 1443, 1457, 1472, 1480, 1487, 1494, 1510, 1529, 1541, 1556, 1577, 1598, 1615, 1630, 1648, 1664, 1678, 1698, 1719, 1733, 1743, 1763, 1784, 1801, 1819, 1836, 1850, 1860, 1869, 1889, 1899, 1906, 1917, 1927, 1943, 1953, 1963, 1976, 1986, 1998, 2007, 2019, 2027} + +func (i TokenName) String() string { + if i < 0 || i >= TokenName(len(_TokenName_index)-1) { + return "TokenName(" + strconv.FormatInt(int64(i), 10) + ")" + } + return _TokenName_name[_TokenName_index[i]:_TokenName_index[i+1]] +} diff --git a/meta/tokenName_test.go b/meta/tokenName_test.go new file mode 100644 index 0000000..ab3c706 --- /dev/null +++ b/meta/tokenName_test.go @@ -0,0 +1,29 @@ +package meta_test + +import ( + "testing" + + "github.com/z7zmey/php-parser/meta" +) + +func TestTokenNameString(t *testing.T) { + c := meta.NsSeparatorToken + + expected := "NsSeparatorToken" + actual := c.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestWrongTokenNameString(t *testing.T) { + c := meta.TokenName(-1) + + expected := "TokenName(-1)" + actual := c.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} diff --git a/meta/tokenNames.go b/meta/tokenNames.go deleted file mode 100644 index 87ab28f..0000000 --- a/meta/tokenNames.go +++ /dev/null @@ -1,328 +0,0 @@ -package meta - -// TokenName is used to specify a comment position -type TokenName int - -const ( - UnknownToken TokenName = iota - IncludeToken - IncludeOnceToken - ExitToken - IfToken - LnumberToken - DnumberToken - StringToken - StringVarnameToken - VariableToken - NumStringToken - InlineHTMLToken - EncapsedAndWhitespaceToken - ConstantEncapsedStringToken - EchoToken - DoToken - WhileToken - EndwhileToken - ForInitSemicolonToken - ForCondSemicolonToken - ForToken - EndforToken - ForeachToken - EndforeachToken - DeclareToken - EnddeclareToken - AsToken - SwitchToken - EndswitchToken - CaseToken - DefaultToken - BreakToken - ContinueToken - GotoToken - FunctionToken - ConstToken - ReturnToken - TryToken - CatchToken - FinallyToken - ThrowToken - UseToken - InsteadofToken - GlobalToken - VarToken - UnsetToken - IssetToken - EmptyToken - ClassToken - TraitToken - InterfaceToken - ExtendsToken - ImplementsToken - DoubleArrowToken - ListToken - ArrayToken - CallableToken - ClassCToken - TraitCToken - MethodCToken - FuncCToken - LineToken - FileToken - StartHeredocToken - DollarOpenCurlyBracesToken - CurlyOpenToken - PaamayimNekudotayimToken - NamespaceToken - NsCToken - DirToken - NsSeparatorToken - EllipsisToken - EvalToken - RequireToken - RequireOnceToken - LogicalOrToken - LogicalXorToken - LogicalAndToken - InstanceofToken - NewToken - CloneToken - ElseifToken - ElseToken - EndifToken - PrintToken - YieldToken - StaticToken - AbstractToken - FinalToken - PrivateToken - ProtectedToken - PublicToken - IncToken - DecToken - YieldFromToken - ObjectOperatorToken - IntCastToken - DoubleCastToken - StringCastToken - ArrayCastToken - ObjectCastToken - BoolCastToken - UnsetCastToken - CoalesceToken - SpaceshipToken - PlusEqualToken - MinusEqualToken - MulEqualToken - PowEqualToken - DivEqualToken - ConcatEqualToken - ModEqualToken - AndEqualToken - OrEqualToken - XorEqualToken - SlEqualToken - SrEqualToken - BooleanOrToken - BooleanAndToken - PowToken - SlToken - SrToken - IsIdenticalToken - IsNotIdenticalToken - IsEqualToken - IsNotEqualToken - IsSmallerOrEqualToken - IsGreaterOrEqualToken - HaltCompilerToken - IdentifierToken - CaseSeparatorToken // ';' or ':' - DoubleQuoteToken // '"' - BackquoteToken // '`' - OpenCurlyBracesToken // '{' - CloseCurlyBracesToken // '}' - SemiColonToken // ';' - ColonToken // ':' - OpenParenthesisToken // '(' - CloseParenthesisToken // ')' - OpenSquareBracket // '[' - CloseSquareBracket // ']' - QuestionMarkToken // '?' - AmpersandToken // '&' - MinusToken // '-' - PlusToken // '+' - ExclamationMarkToken // '!' - TildeToken // '~' - AtToken // '@' - DollarToken // '$' - CommaToken // ',' - VerticalBarToken // '|' - EqualToken // '=' - CaretToken // '^' - AsteriskToken // '*' - SlashToken // '/' - PercentToken // '%' - LessToken // '<' - GreaterToken // '>' - DotToken // '.' -) - -var TokenNames = map[TokenName]string{ - UnknownToken: "UnknownToken", - IncludeToken: "IncludeToken", - IncludeOnceToken: "IncludeOnceToken", - ExitToken: "ExitToken", - IfToken: "IfToken", - LnumberToken: "LnumberToken", - DnumberToken: "DnumberToken", - StringToken: "StringToken", - StringVarnameToken: "StringVarnameToken", - VariableToken: "VariableToken", - NumStringToken: "NumStringToken", - InlineHTMLToken: "InlineHTMLToken", - EncapsedAndWhitespaceToken: "EncapsedAndWhitespaceToken", - ConstantEncapsedStringToken: "ConstantEncapsedStringToken", - EchoToken: "EchoToken", - DoToken: "DoToken", - WhileToken: "WhileToken", - EndwhileToken: "EndwhileToken", - ForInitSemicolonToken: "ForInitSemicolonToken", - ForCondSemicolonToken: "ForCondSemicolonToken", - ForToken: "ForToken", - EndforToken: "EndforToken", - ForeachToken: "ForeachToken", - EndforeachToken: "EndforeachToken", - DeclareToken: "DeclareToken", - EnddeclareToken: "EnddeclareToken", - AsToken: "AsToken", - SwitchToken: "SwitchToken", - EndswitchToken: "EndswitchToken", - CaseToken: "CaseToken", - DefaultToken: "DefaultToken", - BreakToken: "BreakToken", - ContinueToken: "ContinueToken", - GotoToken: "GotoToken", - FunctionToken: "FunctionToken", - ConstToken: "ConstToken", - ReturnToken: "ReturnToken", - TryToken: "TryToken", - CatchToken: "CatchToken", - FinallyToken: "FinallyToken", - ThrowToken: "ThrowToken", - UseToken: "UseToken", - InsteadofToken: "InsteadofToken", - GlobalToken: "GlobalToken", - VarToken: "VarToken", - UnsetToken: "UnsetToken", - IssetToken: "IssetToken", - EmptyToken: "EmptyToken", - ClassToken: "ClassToken", - TraitToken: "TraitToken", - InterfaceToken: "InterfaceToken", - ExtendsToken: "ExtendsToken", - ImplementsToken: "ImplementsToken", - DoubleArrowToken: "DoubleArrowToken", - ListToken: "ListToken", - ArrayToken: "ArrayToken", - CallableToken: "CallableToken", - ClassCToken: "ClassCToken", - TraitCToken: "TraitCToken", - MethodCToken: "MethodCToken", - FuncCToken: "FuncCToken", - LineToken: "LineToken", - FileToken: "FileToken", - StartHeredocToken: "StartHeredocToken", - DollarOpenCurlyBracesToken: "DollarOpenCurlyBracesToken", - CurlyOpenToken: "CurlyOpenToken", - PaamayimNekudotayimToken: "PaamayimNekudotayimToken", - NamespaceToken: "NamespaceToken", - NsCToken: "NsCToken", - DirToken: "DirToken", - NsSeparatorToken: "NsSeparatorToken", - EllipsisToken: "EllipsisToken", - EvalToken: "EvalToken", - RequireToken: "RequireToken", - RequireOnceToken: "RequireOnceToken", - LogicalOrToken: "LogicalOrToken", - LogicalXorToken: "LogicalXorToken", - LogicalAndToken: "LogicalAndToken", - InstanceofToken: "InstanceofToken", - NewToken: "NewToken", - CloneToken: "CloneToken", - ElseifToken: "ElseifToken", - ElseToken: "ElseToken", - EndifToken: "EndifToken", - PrintToken: "PrintToken", - YieldToken: "YieldToken", - StaticToken: "StaticToken", - AbstractToken: "AbstractToken", - FinalToken: "FinalToken", - PrivateToken: "PrivateToken", - ProtectedToken: "ProtectedToken", - PublicToken: "PublicToken", - IncToken: "IncToken", - DecToken: "DecToken", - YieldFromToken: "YieldFromToken", - ObjectOperatorToken: "ObjectOperatorToken", - IntCastToken: "IntCastToken", - DoubleCastToken: "DoubleCastToken", - StringCastToken: "StringCastToken", - ArrayCastToken: "ArrayCastToken", - ObjectCastToken: "ObjectCastToken", - BoolCastToken: "BoolCastToken", - UnsetCastToken: "UnsetCastToken", - CoalesceToken: "CoalesceToken", - SpaceshipToken: "SpaceshipToken", - PlusEqualToken: "PlusEqualToken", - MinusEqualToken: "MinusEqualToken", - MulEqualToken: "MulEqualToken", - PowEqualToken: "PowEqualToken", - DivEqualToken: "DivEqualToken", - ConcatEqualToken: "ConcatEqualToken", - ModEqualToken: "ModEqualToken", - AndEqualToken: "AndEqualToken", - OrEqualToken: "OrEqualToken", - XorEqualToken: "XorEqualToken", - SlEqualToken: "SlEqualToken", - SrEqualToken: "SrEqualToken", - BooleanOrToken: "BooleanOrToken", - BooleanAndToken: "BooleanAndToken", - PowToken: "PowToken", - SlToken: "SlToken", - SrToken: "SrToken", - IsIdenticalToken: "IsIdenticalToken", - IsNotIdenticalToken: "IsNotIdenticalToken", - IsEqualToken: "IsEqualToken", - IsNotEqualToken: "IsNotEqualToken", - IsSmallerOrEqualToken: "IsSmallerOrEqualToken", - IsGreaterOrEqualToken: "IsGreaterOrEqualToken", - HaltCompilerToken: "HaltCompilerToken", - IdentifierToken: "IdentifierToken", - CaseSeparatorToken: "CaseSeparatorToken", - DoubleQuoteToken: "DoubleQuoteToken", - BackquoteToken: "BackquoteToken", - OpenCurlyBracesToken: "OpenCurlyBracesToken", - CloseCurlyBracesToken: "CloseCurlyBracesToken", - SemiColonToken: "SemiColonToken", - ColonToken: "ColonToken", - OpenParenthesisToken: "OpenParenthesisToken", - CloseParenthesisToken: "CloseParenthesisToken", - OpenSquareBracket: "OpenSquareBracket", - CloseSquareBracket: "CloseSquareBracket", - QuestionMarkToken: "QuestionMarkToken", - AmpersandToken: "AmpersandToken", - MinusToken: "MinusToken", - PlusToken: "PlusToken", - ExclamationMarkToken: "ExclamationMarkToken", - TildeToken: "TildeToken", - AtToken: "AtToken", - DollarToken: "DollarToken", - CommaToken: "CommaToken", - VerticalBarToken: "VerticalBarToken", - EqualToken: "EqualToken", - CaretToken: "CaretToken", - AsteriskToken: "AsteriskToken", - SlashToken: "SlashToken", - PercentToken: "PercentToken", - LessToken: "LessToken", - GreaterToken: "GreaterToken", - DotToken: "DotToken", -} diff --git a/node/stmt/n_trait_use.go b/node/stmt/n_trait_use.go index 18316df..b8c454f 100644 --- a/node/stmt/n_trait_use.go +++ b/node/stmt/n_trait_use.go @@ -12,11 +12,11 @@ type TraitUse struct { Meta []meta.Meta Position *position.Position Traits []node.Node - TraitAdaptationList *TraitAdaptationList + TraitAdaptationList node.Node } // NewTraitUse node constructor -func NewTraitUse(Traits []node.Node, InnerAdaptationList *TraitAdaptationList) *TraitUse { +func NewTraitUse(Traits []node.Node, InnerAdaptationList node.Node) *TraitUse { return &TraitUse{ Traits: Traits, TraitAdaptationList: InnerAdaptationList, diff --git a/node/stmt/t_trait_use_test.go b/node/stmt/t_trait_use_test.go index 6fc5cf0..c3ea79b 100644 --- a/node/stmt/t_trait_use_test.go +++ b/node/stmt/t_trait_use_test.go @@ -70,6 +70,14 @@ func TestTraitUse(t *testing.T) { }, }, }, + TraitAdaptationList: &stmt.Nop{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 23, + EndPos: 23, + }, + }, }, }, }, @@ -163,6 +171,14 @@ func TestTraitsUse(t *testing.T) { }, }, }, + TraitAdaptationList: &stmt.Nop{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 28, + EndPos: 28, + }, + }, }, }, }, diff --git a/php5/php5.go b/php5/php5.go index 7b87967..5267eee 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -346,7 +346,7 @@ const yyEofCode = 1 const yyErrCode = 2 const yyInitialStackSize = 16 -//line php5/php5.y:6789 +//line php5/php5.y:6798 type simpleIndirectReference struct { all []*expr.Variable last *expr.Variable @@ -2331,10 +2331,14 @@ yydefault: yylex.(*Parser).rootNode.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + + if yylex.(*Parser).currentToken.Value == "\xff" { + addMeta(yylex.(*Parser).rootNode, yylex.(*Parser).currentToken.Meta, meta.NodeEnd) + } } case 2: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:291 + //line php5/php5.y:295 { if yyDollar[2].node != nil { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -2344,7 +2348,7 @@ yydefault: } case 3: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:299 + //line php5/php5.y:303 { yyVAL.list = []node.Node{} @@ -2352,7 +2356,7 @@ yydefault: } case 4: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:308 + //line php5/php5.y:312 { namePart := name.NewNamePart(yyDollar[1].token.Value) yyVAL.list = []node.Node{namePart} @@ -2367,7 +2371,7 @@ yydefault: } case 5: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:321 + //line php5/php5.y:325 { namePart := name.NewNamePart(yyDollar[3].token.Value) yyVAL.list = append(yyDollar[1].list, namePart) @@ -2383,7 +2387,7 @@ yydefault: } case 6: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:338 + //line php5/php5.y:342 { // error yyVAL.node = nil @@ -2392,7 +2396,7 @@ yydefault: } case 7: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:345 + //line php5/php5.y:349 { yyVAL.node = yyDollar[1].node @@ -2400,7 +2404,7 @@ yydefault: } case 8: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:351 + //line php5/php5.y:355 { yyVAL.node = yyDollar[1].node @@ -2408,7 +2412,7 @@ yydefault: } case 9: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:357 + //line php5/php5.y:361 { yyVAL.node = yyDollar[1].node @@ -2416,7 +2420,7 @@ yydefault: } case 10: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:363 + //line php5/php5.y:367 { yyVAL.node = stmt.NewHaltCompiler() @@ -2433,7 +2437,7 @@ yydefault: } case 11: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:378 + //line php5/php5.y:382 { name := name.NewName(yyDollar[2].list) yyVAL.node = stmt.NewNamespace(name, nil) @@ -2450,7 +2454,7 @@ yydefault: } case 12: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:393 + //line php5/php5.y:397 { name := name.NewName(yyDollar[2].list) yyVAL.node = stmt.NewNamespace(name, yyDollar[4].list) @@ -2468,7 +2472,7 @@ yydefault: } case 13: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:409 + //line php5/php5.y:413 { yyVAL.node = stmt.NewNamespace(nil, yyDollar[3].list) @@ -2484,7 +2488,7 @@ yydefault: } case 14: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:423 + //line php5/php5.y:427 { yyVAL.node = stmt.NewUseList(nil, yyDollar[2].list) @@ -2499,7 +2503,7 @@ yydefault: } case 15: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:436 + //line php5/php5.y:440 { useType := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewUseList(useType, yyDollar[3].list) @@ -2510,14 +2514,14 @@ yydefault: // save comments addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.UseToken) - addMeta(useType, yyDollar[2].token.Meta, meta.UseToken) + addMeta(useType, yyDollar[2].token.Meta, meta.IdentifierToken) addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 16: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:452 + //line php5/php5.y:456 { useType := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewUseList(useType, yyDollar[3].list) @@ -2528,14 +2532,14 @@ yydefault: // save comments addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.UseToken) - addMeta(useType, yyDollar[2].token.Meta, meta.UseToken) + addMeta(useType, yyDollar[2].token.Meta, meta.IdentifierToken) addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 17: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:468 + //line php5/php5.y:472 { yyVAL.node = yyDollar[1].node @@ -2549,18 +2553,18 @@ yydefault: } case 18: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:483 + //line php5/php5.y:487 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) + addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 19: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:492 + //line php5/php5.y:496 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -2568,7 +2572,7 @@ yydefault: } case 20: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:501 + //line php5/php5.y:505 { name := name.NewName(yyDollar[1].list) yyVAL.node = stmt.NewUse(nil, name, nil) @@ -2581,7 +2585,7 @@ yydefault: } case 21: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:512 + //line php5/php5.y:516 { name := name.NewName(yyDollar[1].list) alias := node.NewIdentifier(yyDollar[3].token.Value) @@ -2594,13 +2598,13 @@ yydefault: // save comments addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.AsToken) - addMeta(alias, yyDollar[3].token.Meta, meta.StringToken) + addMeta(alias, yyDollar[3].token.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 22: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:529 + //line php5/php5.y:533 { name := name.NewName(yyDollar[2].list) yyVAL.node = stmt.NewUse(nil, name, nil) @@ -2616,7 +2620,7 @@ yydefault: } case 23: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:543 + //line php5/php5.y:547 { name := name.NewName(yyDollar[2].list) alias := node.NewIdentifier(yyDollar[4].token.Value) @@ -2630,24 +2634,24 @@ yydefault: // save comments addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.NsSeparatorToken) addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.AsToken) - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.StringToken) + addMeta(alias, yyDollar[4].token.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 24: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:564 + //line php5/php5.y:568 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) + addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 25: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:573 + //line php5/php5.y:577 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -2655,7 +2659,7 @@ yydefault: } case 26: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:582 + //line php5/php5.y:586 { name := name.NewName(yyDollar[1].list) yyVAL.node = stmt.NewUse(nil, name, nil) @@ -2668,7 +2672,7 @@ yydefault: } case 27: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:593 + //line php5/php5.y:597 { name := name.NewName(yyDollar[1].list) alias := node.NewIdentifier(yyDollar[3].token.Value) @@ -2681,13 +2685,13 @@ yydefault: // save comments addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.AsToken) - addMeta(alias, yyDollar[3].token.Meta, meta.StringToken) + addMeta(alias, yyDollar[3].token.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 28: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:610 + //line php5/php5.y:614 { name := name.NewName(yyDollar[2].list) yyVAL.node = stmt.NewUse(nil, name, nil) @@ -2703,7 +2707,7 @@ yydefault: } case 29: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:624 + //line php5/php5.y:628 { name := name.NewName(yyDollar[2].list) alias := node.NewIdentifier(yyDollar[4].token.Value) @@ -2717,24 +2721,24 @@ yydefault: // save comments addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.NsSeparatorToken) addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.AsToken) - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.StringToken) + addMeta(alias, yyDollar[4].token.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 30: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:645 + //line php5/php5.y:649 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) + addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 31: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:654 + //line php5/php5.y:658 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -2742,7 +2746,7 @@ yydefault: } case 32: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:663 + //line php5/php5.y:667 { name := name.NewName(yyDollar[1].list) yyVAL.node = stmt.NewUse(nil, name, nil) @@ -2755,7 +2759,7 @@ yydefault: } case 33: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:674 + //line php5/php5.y:678 { name := name.NewName(yyDollar[1].list) alias := node.NewIdentifier(yyDollar[3].token.Value) @@ -2768,13 +2772,13 @@ yydefault: // save comments addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.AsToken) - addMeta(alias, yyDollar[3].token.Meta, meta.StringToken) + addMeta(alias, yyDollar[3].token.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 34: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:691 + //line php5/php5.y:695 { name := name.NewName(yyDollar[2].list) yyVAL.node = stmt.NewUse(nil, name, nil) @@ -2790,7 +2794,7 @@ yydefault: } case 35: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:705 + //line php5/php5.y:709 { name := name.NewName(yyDollar[2].list) alias := node.NewIdentifier(yyDollar[4].token.Value) @@ -2804,13 +2808,13 @@ yydefault: // save comments addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.NsSeparatorToken) addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.AsToken) - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.StringToken) + addMeta(alias, yyDollar[4].token.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 36: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:726 + //line php5/php5.y:730 { name := node.NewIdentifier(yyDollar[3].token.Value) constant := stmt.NewConstant(name, yyDollar[5].node, "") @@ -2825,14 +2829,14 @@ yydefault: // save comments addMeta(lastNode(constList.Consts), yyDollar[2].token.Meta, meta.CommaToken) - addMeta(name, yyDollar[3].token.Meta, meta.StringToken) + addMeta(name, yyDollar[3].token.Meta, meta.IdentifierToken) addMeta(constant, yyDollar[4].token.Meta, meta.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 37: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:746 + //line php5/php5.y:750 { name := node.NewIdentifier(yyDollar[2].token.Value) constant := stmt.NewConstant(name, yyDollar[4].node, "") @@ -2846,14 +2850,14 @@ yydefault: // save comments addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ConstToken) - addMeta(name, yyDollar[2].token.Meta, meta.StringToken) + addMeta(name, yyDollar[2].token.Meta, meta.IdentifierToken) addMeta(constant, yyDollar[3].token.Meta, meta.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 38: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:768 + //line php5/php5.y:772 { if yyDollar[2].node != nil { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -2863,7 +2867,7 @@ yydefault: } case 39: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:776 + //line php5/php5.y:780 { yyVAL.list = []node.Node{} @@ -2871,7 +2875,7 @@ yydefault: } case 40: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:786 + //line php5/php5.y:790 { // error yyVAL.node = nil @@ -2880,7 +2884,7 @@ yydefault: } case 41: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:793 + //line php5/php5.y:797 { yyVAL.node = yyDollar[1].node @@ -2888,7 +2892,7 @@ yydefault: } case 42: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:799 + //line php5/php5.y:803 { yyVAL.node = yyDollar[1].node @@ -2896,7 +2900,7 @@ yydefault: } case 43: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:805 + //line php5/php5.y:809 { yyVAL.node = yyDollar[1].node @@ -2904,7 +2908,7 @@ yydefault: } case 44: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:811 + //line php5/php5.y:815 { yyVAL.node = stmt.NewHaltCompiler() @@ -2921,7 +2925,7 @@ yydefault: } case 45: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:830 + //line php5/php5.y:834 { yyVAL.node = yyDollar[1].node @@ -2929,7 +2933,7 @@ yydefault: } case 46: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:836 + //line php5/php5.y:840 { label := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewLabel(label) @@ -2939,14 +2943,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - addMeta(label, yyDollar[1].token.Meta, meta.StringToken) + addMeta(label, yyDollar[1].token.Meta, meta.IdentifierToken) addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.ColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 47: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:854 + //line php5/php5.y:858 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) @@ -2961,7 +2965,7 @@ yydefault: } case 48: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:867 + //line php5/php5.y:871 { yyVAL.node = stmt.NewIf(yyDollar[2].node, yyDollar[3].node, yyDollar[4].list, yyDollar[5].node) @@ -2981,7 +2985,7 @@ yydefault: } case 49: yyDollar = yyS[yypt-8 : yypt+1] - //line php5/php5.y:885 + //line php5/php5.y:889 { stmts := stmt.NewStmtList(yyDollar[4].list) yyVAL.node = stmt.NewAltIf(yyDollar[2].node, stmts, yyDollar[5].list, yyDollar[6].node) @@ -3000,7 +3004,7 @@ yydefault: } case 50: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:902 + //line php5/php5.y:906 { switch n := yyDollar[3].node.(type) { case *stmt.While: @@ -3021,7 +3025,7 @@ yydefault: } case 51: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:921 + //line php5/php5.y:925 { yyVAL.node = stmt.NewDo(yyDollar[2].node, yyDollar[4].node) @@ -3037,7 +3041,7 @@ yydefault: } case 52: yyDollar = yyS[yypt-9 : yypt+1] - //line php5/php5.y:935 + //line php5/php5.y:939 { switch n := yyDollar[9].node.(type) { case *stmt.For: @@ -3066,7 +3070,7 @@ yydefault: } case 53: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:962 + //line php5/php5.y:966 { switch n := yyDollar[3].node.(type) { case *stmt.Switch: @@ -3089,7 +3093,7 @@ yydefault: } case 54: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:983 + //line php5/php5.y:987 { yyVAL.node = stmt.NewBreak(nil) @@ -3104,7 +3108,7 @@ yydefault: } case 55: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:996 + //line php5/php5.y:1000 { yyVAL.node = stmt.NewBreak(yyDollar[2].node) @@ -3119,7 +3123,7 @@ yydefault: } case 56: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1009 + //line php5/php5.y:1013 { yyVAL.node = stmt.NewContinue(nil) @@ -3134,7 +3138,7 @@ yydefault: } case 57: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1022 + //line php5/php5.y:1026 { yyVAL.node = stmt.NewContinue(yyDollar[2].node) @@ -3149,7 +3153,7 @@ yydefault: } case 58: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1035 + //line php5/php5.y:1039 { yyVAL.node = stmt.NewReturn(nil) @@ -3164,7 +3168,7 @@ yydefault: } case 59: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1048 + //line php5/php5.y:1052 { yyVAL.node = stmt.NewReturn(yyDollar[2].node) @@ -3179,7 +3183,7 @@ yydefault: } case 60: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1061 + //line php5/php5.y:1065 { yyVAL.node = stmt.NewReturn(yyDollar[2].node) @@ -3194,7 +3198,7 @@ yydefault: } case 61: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1074 + //line php5/php5.y:1078 { yyVAL.node = stmt.NewExpression(yyDollar[1].node) @@ -3208,7 +3212,7 @@ yydefault: } case 62: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1086 + //line php5/php5.y:1090 { yyVAL.node = stmt.NewGlobal(yyDollar[2].list) @@ -3223,7 +3227,7 @@ yydefault: } case 63: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1099 + //line php5/php5.y:1103 { yyVAL.node = stmt.NewStatic(yyDollar[2].list) @@ -3238,7 +3242,7 @@ yydefault: } case 64: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1112 + //line php5/php5.y:1116 { yyVAL.node = stmt.NewEcho(yyDollar[2].list) @@ -3253,7 +3257,7 @@ yydefault: } case 65: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1125 + //line php5/php5.y:1129 { yyVAL.node = stmt.NewInlineHtml(yyDollar[1].token.Value) @@ -3267,7 +3271,7 @@ yydefault: } case 66: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1137 + //line php5/php5.y:1141 { yyVAL.node = stmt.NewExpression(yyDollar[1].node) @@ -3281,7 +3285,7 @@ yydefault: } case 67: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1149 + //line php5/php5.y:1153 { yyVAL.node = stmt.NewUnset(yyDollar[3].list) @@ -3298,7 +3302,7 @@ yydefault: } case 68: yyDollar = yyS[yypt-8 : yypt+1] - //line php5/php5.y:1164 + //line php5/php5.y:1168 { if yyDollar[6].node == nil { switch n := yyDollar[8].node.(type) { @@ -3337,7 +3341,7 @@ yydefault: } case 69: yyDollar = yyS[yypt-8 : yypt+1] - //line php5/php5.y:1201 + //line php5/php5.y:1205 { if yyDollar[6].node == nil { switch n := yyDollar[8].node.(type) { @@ -3376,7 +3380,7 @@ yydefault: } case 70: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1238 + //line php5/php5.y:1242 { yyVAL.node = stmt.NewDeclare(yyDollar[3].list, yyDollar[5].node) @@ -3392,7 +3396,7 @@ yydefault: } case 71: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1252 + //line php5/php5.y:1256 { yyVAL.node = stmt.NewNop() @@ -3406,7 +3410,7 @@ yydefault: } case 72: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:1264 + //line php5/php5.y:1268 { yyVAL.node = stmt.NewTry(yyDollar[3].list, yyDollar[5].list, yyDollar[6].node) @@ -3426,7 +3430,7 @@ yydefault: } case 73: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1282 + //line php5/php5.y:1286 { yyVAL.node = stmt.NewThrow(yyDollar[2].node) @@ -3441,7 +3445,7 @@ yydefault: } case 74: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1295 + //line php5/php5.y:1299 { label := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewGoto(label) @@ -3452,14 +3456,14 @@ yydefault: // save comments addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.GotoToken) - addMeta(label, yyDollar[2].token.Meta, meta.StringToken) + addMeta(label, yyDollar[2].token.Meta, meta.IdentifierToken) addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 75: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1314 + //line php5/php5.y:1318 { yyVAL.list = []node.Node{} @@ -3467,7 +3471,7 @@ yydefault: } case 76: yyDollar = yyS[yypt-9 : yypt+1] - //line php5/php5.y:1320 + //line php5/php5.y:1324 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[4].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -3482,7 +3486,7 @@ yydefault: // save comments addMeta(catch, yyDollar[1].token.Meta, meta.CatchToken) addMeta(catch, yyDollar[2].token.Meta, meta.OpenParenthesisToken) - addMeta(variable, yyDollar[4].token.Meta, meta.StringToken) + addMeta(variable, yyDollar[4].token.Meta, meta.VariableToken) addMeta(catch, yyDollar[5].token.Meta, meta.CloseParenthesisToken) addMeta(catch, yyDollar[6].token.Meta, meta.OpenCurlyBracesToken) addMeta(catch, yyDollar[8].token.Meta, meta.CloseCurlyBracesToken) @@ -3491,7 +3495,7 @@ yydefault: } case 77: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1345 + //line php5/php5.y:1349 { yyVAL.node = nil @@ -3499,7 +3503,7 @@ yydefault: } case 78: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1351 + //line php5/php5.y:1355 { yyVAL.node = stmt.NewFinally(yyDollar[3].list) @@ -3515,7 +3519,7 @@ yydefault: } case 79: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1368 + //line php5/php5.y:1372 { yyVAL.list = yyDollar[1].list @@ -3523,7 +3527,7 @@ yydefault: } case 80: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1374 + //line php5/php5.y:1378 { yyVAL.list = []node.Node{} @@ -3531,7 +3535,7 @@ yydefault: } case 81: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1383 + //line php5/php5.y:1387 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -3539,7 +3543,7 @@ yydefault: } case 82: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1389 + //line php5/php5.y:1393 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -3547,7 +3551,7 @@ yydefault: } case 83: yyDollar = yyS[yypt-8 : yypt+1] - //line php5/php5.y:1398 + //line php5/php5.y:1402 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[4].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -3561,7 +3565,7 @@ yydefault: // save comments addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.CatchToken) addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenParenthesisToken) - addMeta(variable, yyDollar[4].token.Meta, meta.StringToken) + addMeta(variable, yyDollar[4].token.Meta, meta.VariableToken) addMeta(yyVAL.node, yyDollar[5].token.Meta, meta.CloseParenthesisToken) addMeta(yyVAL.node, yyDollar[6].token.Meta, meta.OpenCurlyBracesToken) addMeta(yyVAL.node, yyDollar[8].token.Meta, meta.CloseCurlyBracesToken) @@ -3570,7 +3574,7 @@ yydefault: } case 84: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1422 + //line php5/php5.y:1426 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -3578,18 +3582,18 @@ yydefault: } case 85: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1428 + //line php5/php5.y:1432 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) + addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 86: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1440 + //line php5/php5.y:1444 { yyVAL.node = yyDollar[1].node @@ -3597,7 +3601,7 @@ yydefault: } case 87: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1449 + //line php5/php5.y:1453 { yyVAL.node = yyDollar[1].node @@ -3605,7 +3609,7 @@ yydefault: } case 88: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1458 + //line php5/php5.y:1462 { yyVAL.node = yyDollar[1].node @@ -3613,31 +3617,31 @@ yydefault: } case 89: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1467 + //line php5/php5.y:1471 { yyVAL.token = nil } case 90: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1471 + //line php5/php5.y:1475 { yyVAL.token = yyDollar[1].token } case 91: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1478 + //line php5/php5.y:1482 { yyVAL.token = nil } case 92: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1482 + //line php5/php5.y:1486 { yyVAL.token = yyDollar[1].token } case 93: yyDollar = yyS[yypt-9 : yypt+1] - //line php5/php5.y:1489 + //line php5/php5.y:1493 { name := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewFunction(name, yyDollar[2].token != nil, yyDollar[5].list, nil, yyDollar[8].list, "") @@ -3651,7 +3655,7 @@ yydefault: if yyDollar[2].token != nil { addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.AmpersandToken) } - addMeta(name, yyDollar[3].token.Meta, meta.StringToken) + addMeta(name, yyDollar[3].token.Meta, meta.IdentifierToken) addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.OpenParenthesisToken) addMeta(yyVAL.node, yyDollar[6].token.Meta, meta.CloseParenthesisToken) addMeta(yyVAL.node, yyDollar[7].token.Meta, meta.OpenCurlyBracesToken) @@ -3661,7 +3665,7 @@ yydefault: } case 94: yyDollar = yyS[yypt-7 : yypt+1] - //line php5/php5.y:1514 + //line php5/php5.y:1518 { name := node.NewIdentifier(yyDollar[2].token.Value) switch n := yyDollar[1].node.(type) { @@ -3683,7 +3687,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[7].token)) // save comments - addMeta(name, yyDollar[2].token.Meta, meta.StringToken) + addMeta(name, yyDollar[2].token.Meta, meta.IdentifierToken) addMeta(yyVAL.node, yyDollar[5].token.Meta, meta.OpenCurlyBracesToken) addMeta(yyVAL.node, yyDollar[7].token.Meta, meta.CloseCurlyBracesToken) @@ -3691,7 +3695,7 @@ yydefault: } case 95: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:1542 + //line php5/php5.y:1546 { name := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewInterface(name, yyDollar[3].InterfaceExtends, yyDollar[5].list, "") @@ -3701,7 +3705,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[6].token)) // save comments - addMeta(name, yyDollar[2].token.Meta, meta.StringToken) + addMeta(name, yyDollar[2].token.Meta, meta.IdentifierToken) addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.OpenCurlyBracesToken) addMeta(yyVAL.node, yyDollar[6].token.Meta, meta.CloseCurlyBracesToken) @@ -3709,7 +3713,7 @@ yydefault: } case 96: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1562 + //line php5/php5.y:1566 { yyVAL.node = stmt.NewClass(nil, nil, nil, nil, nil, nil, "") @@ -3723,7 +3727,7 @@ yydefault: } case 97: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1574 + //line php5/php5.y:1578 { classModifier := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewClass(nil, []node.Node{classModifier}, nil, nil, nil, nil, "") @@ -3733,14 +3737,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - addMeta(classModifier, yyDollar[1].token.Meta, meta.AbstractToken) + addMeta(classModifier, yyDollar[1].token.Meta, meta.IdentifierToken) addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.ClassToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 98: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1589 + //line php5/php5.y:1593 { yyVAL.node = stmt.NewTrait(nil, nil, "") @@ -3754,7 +3758,7 @@ yydefault: } case 99: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1601 + //line php5/php5.y:1605 { classModifier := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewClass(nil, []node.Node{classModifier}, nil, nil, nil, nil, "") @@ -3764,14 +3768,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - addMeta(classModifier, yyDollar[1].token.Meta, meta.FinalToken) + addMeta(classModifier, yyDollar[1].token.Meta, meta.IdentifierToken) addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.ClassToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 100: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1619 + //line php5/php5.y:1623 { yyVAL.ClassExtends = nil @@ -3779,7 +3783,7 @@ yydefault: } case 101: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1625 + //line php5/php5.y:1629 { yyVAL.ClassExtends = stmt.NewClassExtends(yyDollar[2].node) @@ -3793,13 +3797,13 @@ yydefault: } case 102: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1640 + //line php5/php5.y:1644 { yyVAL.token = yyDollar[1].token } case 103: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1647 + //line php5/php5.y:1651 { yyVAL.InterfaceExtends = nil @@ -3807,7 +3811,7 @@ yydefault: } case 104: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1653 + //line php5/php5.y:1657 { yyVAL.InterfaceExtends = stmt.NewInterfaceExtends(yyDollar[2].list) @@ -3821,7 +3825,7 @@ yydefault: } case 105: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1668 + //line php5/php5.y:1672 { yyVAL.ClassImplements = nil @@ -3829,7 +3833,7 @@ yydefault: } case 106: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1674 + //line php5/php5.y:1678 { yyVAL.ClassImplements = stmt.NewClassImplements(yyDollar[2].list) @@ -3843,7 +3847,7 @@ yydefault: } case 107: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1689 + //line php5/php5.y:1693 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -3851,18 +3855,18 @@ yydefault: } case 108: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1695 + //line php5/php5.y:1699 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) + addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 109: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1707 + //line php5/php5.y:1711 { yyVAL.node = nil @@ -3870,7 +3874,7 @@ yydefault: } case 110: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1713 + //line php5/php5.y:1717 { yyVAL.node = yyDollar[2].node @@ -3881,7 +3885,7 @@ yydefault: } case 111: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1725 + //line php5/php5.y:1729 { yyVAL.node = yyDollar[1].node @@ -3889,7 +3893,7 @@ yydefault: } case 112: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1731 + //line php5/php5.y:1735 { yyVAL.node = expr.NewReference(yyDollar[2].node) @@ -3903,7 +3907,7 @@ yydefault: } case 113: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1743 + //line php5/php5.y:1747 { yyVAL.node = expr.NewList(yyDollar[3].list) @@ -3919,7 +3923,7 @@ yydefault: } case 114: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1760 + //line php5/php5.y:1764 { yyVAL.node = stmt.NewFor(nil, nil, nil, yyDollar[1].node) @@ -3930,7 +3934,7 @@ yydefault: } case 115: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1769 + //line php5/php5.y:1773 { stmtList := stmt.NewStmtList(yyDollar[2].list) yyVAL.node = stmt.NewAltFor(nil, nil, nil, stmtList) @@ -3948,7 +3952,7 @@ yydefault: } case 116: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1788 + //line php5/php5.y:1792 { yyVAL.node = stmt.NewForeach(nil, nil, nil, yyDollar[1].node) @@ -3959,7 +3963,7 @@ yydefault: } case 117: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1797 + //line php5/php5.y:1801 { stmtList := stmt.NewStmtList(yyDollar[2].list) yyVAL.node = stmt.NewAltForeach(nil, nil, nil, stmtList) @@ -3977,7 +3981,7 @@ yydefault: } case 118: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1817 + //line php5/php5.y:1821 { yyVAL.node = yyDollar[1].node @@ -3985,7 +3989,7 @@ yydefault: } case 119: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1823 + //line php5/php5.y:1827 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) @@ -4001,7 +4005,7 @@ yydefault: } case 120: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1841 + //line php5/php5.y:1845 { name := node.NewIdentifier(yyDollar[1].token.Value) constant := stmt.NewConstant(name, yyDollar[3].node, "") @@ -4012,14 +4016,14 @@ yydefault: constant.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) // save comments - addMeta(name, yyDollar[1].token.Meta, meta.StringToken) + addMeta(name, yyDollar[1].token.Meta, meta.IdentifierToken) addMeta(constant, yyDollar[2].token.Meta, meta.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 121: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1857 + //line php5/php5.y:1861 { name := node.NewIdentifier(yyDollar[3].token.Value) constant := stmt.NewConstant(name, yyDollar[5].node, "") @@ -4031,14 +4035,14 @@ yydefault: // save comments addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) - addMeta(name, yyDollar[3].token.Meta, meta.StringToken) + addMeta(name, yyDollar[3].token.Meta, meta.IdentifierToken) addMeta(constant, yyDollar[4].token.Meta, meta.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 122: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1878 + //line php5/php5.y:1882 { caseList := stmt.NewCaseList(yyDollar[2].list) yyVAL.node = stmt.NewSwitch(nil, caseList) @@ -4055,7 +4059,7 @@ yydefault: } case 123: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1893 + //line php5/php5.y:1897 { caseList := stmt.NewCaseList(yyDollar[3].list) yyVAL.node = stmt.NewSwitch(nil, caseList) @@ -4073,7 +4077,7 @@ yydefault: } case 124: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1909 + //line php5/php5.y:1913 { caseList := stmt.NewCaseList(yyDollar[2].list) yyVAL.node = stmt.NewAltSwitch(nil, caseList) @@ -4083,15 +4087,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - addMeta(caseList, yyDollar[1].token.Meta, meta.ColonToken) - addMeta(caseList, yyDollar[3].token.Meta, meta.EndswitchToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ColonToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.EndswitchToken) addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 125: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1925 + //line php5/php5.y:1929 { caseList := stmt.NewCaseList(yyDollar[3].list) @@ -4102,16 +4106,16 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[5].token)) // save comments - addMeta(caseList, yyDollar[1].token.Meta, meta.ColonToken) - addMeta(caseList, yyDollar[2].token.Meta, meta.SemiColonToken) - addMeta(caseList, yyDollar[4].token.Meta, meta.EndswitchToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ColonToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.SwitchSemicolonToken) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.EndswitchToken) addMeta(yyVAL.node, yyDollar[5].token.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 126: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1947 + //line php5/php5.y:1951 { yyVAL.list = []node.Node{} @@ -4119,7 +4123,7 @@ yydefault: } case 127: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1953 + //line php5/php5.y:1957 { _case := stmt.NewCase(yyDollar[3].node, yyDollar[5].list) yyVAL.list = append(yyDollar[1].list, _case) @@ -4135,7 +4139,7 @@ yydefault: } case 128: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1967 + //line php5/php5.y:1971 { _default := stmt.NewDefault(yyDollar[4].list) yyVAL.list = append(yyDollar[1].list, _default) @@ -4151,19 +4155,19 @@ yydefault: } case 129: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1985 + //line php5/php5.y:1989 { yyVAL.token = yyDollar[1].token } case 130: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1989 + //line php5/php5.y:1993 { yyVAL.token = yyDollar[1].token } case 131: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1997 + //line php5/php5.y:2001 { yyVAL.node = stmt.NewWhile(nil, yyDollar[1].node) @@ -4174,7 +4178,7 @@ yydefault: } case 132: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2006 + //line php5/php5.y:2010 { stmtList := stmt.NewStmtList(yyDollar[2].list) yyVAL.node = stmt.NewAltWhile(nil, stmtList) @@ -4192,7 +4196,7 @@ yydefault: } case 133: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2027 + //line php5/php5.y:2031 { yyVAL.list = nil @@ -4200,7 +4204,7 @@ yydefault: } case 134: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2033 + //line php5/php5.y:2037 { _elseIf := stmt.NewElseIf(yyDollar[3].node, yyDollar[4].node) yyVAL.list = append(yyDollar[1].list, _elseIf) @@ -4215,7 +4219,7 @@ yydefault: } case 135: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2050 + //line php5/php5.y:2054 { yyVAL.list = nil @@ -4223,7 +4227,7 @@ yydefault: } case 136: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:2056 + //line php5/php5.y:2060 { stmts := stmt.NewStmtList(yyDollar[5].list) _elseIf := stmt.NewAltElseIf(yyDollar[3].node, stmts) @@ -4241,7 +4245,7 @@ yydefault: } case 137: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2076 + //line php5/php5.y:2080 { yyVAL.node = nil @@ -4249,7 +4253,7 @@ yydefault: } case 138: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2082 + //line php5/php5.y:2086 { yyVAL.node = stmt.NewElse(yyDollar[2].node) @@ -4263,7 +4267,7 @@ yydefault: } case 139: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2098 + //line php5/php5.y:2102 { yyVAL.node = nil @@ -4271,7 +4275,7 @@ yydefault: } case 140: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2104 + //line php5/php5.y:2108 { stmts := stmt.NewStmtList(yyDollar[3].list) yyVAL.node = stmt.NewAltElse(stmts) @@ -4288,7 +4292,7 @@ yydefault: } case 141: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2123 + //line php5/php5.y:2127 { yyVAL.list = yyDollar[1].list @@ -4296,7 +4300,7 @@ yydefault: } case 142: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2129 + //line php5/php5.y:2133 { yyVAL.list = nil @@ -4304,7 +4308,7 @@ yydefault: } case 143: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2138 + //line php5/php5.y:2142 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4312,18 +4316,18 @@ yydefault: } case 144: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2144 + //line php5/php5.y:2148 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) + addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 145: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2156 + //line php5/php5.y:2160 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[4].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -4355,7 +4359,7 @@ yydefault: } case 146: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:2186 + //line php5/php5.y:2190 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[4].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -4388,7 +4392,7 @@ yydefault: } case 147: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2221 + //line php5/php5.y:2225 { yyVAL.node = nil @@ -4396,7 +4400,7 @@ yydefault: } case 148: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2227 + //line php5/php5.y:2231 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4404,13 +4408,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ArrayToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 149: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2239 + //line php5/php5.y:2243 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4418,13 +4422,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.CallableToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 150: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2251 + //line php5/php5.y:2255 { yyVAL.node = yyDollar[1].node @@ -4432,7 +4436,7 @@ yydefault: } case 151: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2261 + //line php5/php5.y:2265 { yyVAL.node = node.NewArgumentList(nil) @@ -4447,7 +4451,7 @@ yydefault: } case 152: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2274 + //line php5/php5.y:2278 { yyVAL.node = node.NewArgumentList(yyDollar[2].list) @@ -4462,7 +4466,7 @@ yydefault: } case 153: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2287 + //line php5/php5.y:2291 { arg := node.NewArgument(yyDollar[2].node, false, false) yyVAL.node = node.NewArgumentList([]node.Node{arg}) @@ -4479,7 +4483,7 @@ yydefault: } case 154: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2306 + //line php5/php5.y:2310 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4487,18 +4491,18 @@ yydefault: } case 155: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2312 + //line php5/php5.y:2316 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) + addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 156: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2324 + //line php5/php5.y:2328 { yyVAL.node = node.NewArgument(yyDollar[1].node, false, false) @@ -4509,7 +4513,7 @@ yydefault: } case 157: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2333 + //line php5/php5.y:2337 { yyVAL.node = node.NewArgument(yyDollar[1].node, false, false) @@ -4520,7 +4524,7 @@ yydefault: } case 158: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2342 + //line php5/php5.y:2346 { yyVAL.node = node.NewArgument(yyDollar[2].node, false, true) @@ -4534,7 +4538,7 @@ yydefault: } case 159: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2354 + //line php5/php5.y:2358 { yyVAL.node = node.NewArgument(yyDollar[2].node, true, false) @@ -4548,18 +4552,18 @@ yydefault: } case 160: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2369 + //line php5/php5.y:2373 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) + addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 161: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2378 + //line php5/php5.y:2382 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4567,7 +4571,7 @@ yydefault: } case 162: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2388 + //line php5/php5.y:2392 { name := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(name) @@ -4583,7 +4587,7 @@ yydefault: } case 163: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2402 + //line php5/php5.y:2406 { yyVAL.node = expr.NewVariable(yyDollar[2].node) @@ -4597,7 +4601,7 @@ yydefault: } case 164: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2414 + //line php5/php5.y:2418 { yyVAL.node = expr.NewVariable(yyDollar[3].node) @@ -4613,7 +4617,7 @@ yydefault: } case 165: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2432 + //line php5/php5.y:2436 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[3].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -4633,7 +4637,7 @@ yydefault: } case 166: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:2450 + //line php5/php5.y:2454 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[3].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -4654,7 +4658,7 @@ yydefault: } case 167: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2469 + //line php5/php5.y:2473 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -4673,7 +4677,7 @@ yydefault: } case 168: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2486 + //line php5/php5.y:2490 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -4693,7 +4697,7 @@ yydefault: } case 169: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2508 + //line php5/php5.y:2512 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -4701,7 +4705,7 @@ yydefault: } case 170: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2514 + //line php5/php5.y:2518 { yyVAL.list = []node.Node{} @@ -4709,7 +4713,7 @@ yydefault: } case 171: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2524 + //line php5/php5.y:2528 { yyVAL.node = stmt.NewPropertyList(yyDollar[1].list, yyDollar[2].list) @@ -4723,7 +4727,7 @@ yydefault: } case 172: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2536 + //line php5/php5.y:2540 { yyVAL.node = yyDollar[1].node @@ -4737,7 +4741,7 @@ yydefault: } case 173: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2548 + //line php5/php5.y:2552 { yyVAL.node = yyDollar[1].node @@ -4745,7 +4749,7 @@ yydefault: } case 174: yyDollar = yyS[yypt-8 : yypt+1] - //line php5/php5.y:2554 + //line php5/php5.y:2558 { name := node.NewIdentifier(yyDollar[4].token.Value) yyVAL.node = stmt.NewClassMethod(name, yyDollar[1].list, yyDollar[3].token != nil, yyDollar[6].list, nil, yyDollar[8].node, "") @@ -4771,16 +4775,9 @@ yydefault: } case 175: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2581 + //line php5/php5.y:2585 { - var adaptationList *stmt.TraitAdaptationList - switch n := yyDollar[3].node.(type) { - case *stmt.TraitAdaptationList: - adaptationList = n - default: - adaptationList = nil - } - yyVAL.node = stmt.NewTraitUse(yyDollar[2].list, adaptationList) + yyVAL.node = stmt.NewTraitUse(yyDollar[2].list, yyDollar[3].node) // save position yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) @@ -4792,7 +4789,7 @@ yydefault: } case 176: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2603 + //line php5/php5.y:2600 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4800,18 +4797,18 @@ yydefault: } case 177: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2609 + //line php5/php5.y:2606 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) + addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 178: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2621 + //line php5/php5.y:2618 { yyVAL.node = stmt.NewNop() @@ -4824,7 +4821,7 @@ yydefault: } case 179: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2633 + //line php5/php5.y:2630 { yyVAL.node = stmt.NewTraitAdaptationList(yyDollar[2].list) @@ -4838,7 +4835,7 @@ yydefault: } case 180: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2648 + //line php5/php5.y:2645 { yyVAL.list = nil @@ -4846,7 +4843,7 @@ yydefault: } case 181: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2654 + //line php5/php5.y:2651 { yyVAL.list = yyDollar[1].list @@ -4854,7 +4851,7 @@ yydefault: } case 182: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2663 + //line php5/php5.y:2660 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4862,7 +4859,7 @@ yydefault: } case 183: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2669 + //line php5/php5.y:2666 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -4870,7 +4867,7 @@ yydefault: } case 184: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2678 + //line php5/php5.y:2675 { yyVAL.node = yyDollar[1].node @@ -4881,7 +4878,7 @@ yydefault: } case 185: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2687 + //line php5/php5.y:2684 { yyVAL.node = yyDollar[1].node @@ -4892,7 +4889,7 @@ yydefault: } case 186: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2699 + //line php5/php5.y:2696 { yyVAL.node = stmt.NewTraitUsePrecedence(yyDollar[1].node, yyDollar[3].list) @@ -4906,7 +4903,7 @@ yydefault: } case 187: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2714 + //line php5/php5.y:2711 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4914,18 +4911,18 @@ yydefault: } case 188: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2720 + //line php5/php5.y:2717 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) + addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 189: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2732 + //line php5/php5.y:2729 { name := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewTraitMethodRef(nil, name) @@ -4941,7 +4938,7 @@ yydefault: } case 190: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2746 + //line php5/php5.y:2743 { yyVAL.node = yyDollar[1].node @@ -4949,7 +4946,7 @@ yydefault: } case 191: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2755 + //line php5/php5.y:2752 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewTraitMethodRef(yyDollar[1].node, target) @@ -4966,7 +4963,7 @@ yydefault: } case 192: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2773 + //line php5/php5.y:2770 { alias := node.NewIdentifier(yyDollar[4].token.Value) yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, yyDollar[3].node, alias) @@ -4983,7 +4980,7 @@ yydefault: } case 193: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2788 + //line php5/php5.y:2785 { yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, yyDollar[3].node, nil) @@ -4997,7 +4994,7 @@ yydefault: } case 194: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2803 + //line php5/php5.y:2800 { yyVAL.node = nil @@ -5005,7 +5002,7 @@ yydefault: } case 195: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2809 + //line php5/php5.y:2806 { yyVAL.node = yyDollar[1].node @@ -5013,7 +5010,7 @@ yydefault: } case 196: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2818 + //line php5/php5.y:2815 { yyVAL.node = stmt.NewNop() @@ -5027,7 +5024,7 @@ yydefault: } case 197: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2830 + //line php5/php5.y:2827 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) @@ -5042,7 +5039,7 @@ yydefault: } case 198: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2846 + //line php5/php5.y:2843 { yyVAL.list = yyDollar[1].list @@ -5050,7 +5047,7 @@ yydefault: } case 199: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2852 + //line php5/php5.y:2849 { modifier := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.list = []node.Node{modifier} @@ -5059,13 +5056,13 @@ yydefault: modifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(modifier, yyDollar[1].token.Meta, meta.VarToken) + addMeta(modifier, yyDollar[1].token.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 200: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2868 + //line php5/php5.y:2865 { yyVAL.list = nil @@ -5073,7 +5070,7 @@ yydefault: } case 201: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2874 + //line php5/php5.y:2871 { yyVAL.list = yyDollar[1].list @@ -5081,7 +5078,7 @@ yydefault: } case 202: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2883 + //line php5/php5.y:2880 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -5089,7 +5086,7 @@ yydefault: } case 203: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2889 + //line php5/php5.y:2886 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -5097,7 +5094,7 @@ yydefault: } case 204: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2898 + //line php5/php5.y:2895 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5105,13 +5102,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.PublicToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 205: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2910 + //line php5/php5.y:2907 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5119,13 +5116,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ProtectedToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 206: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2922 + //line php5/php5.y:2919 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5133,13 +5130,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.PrivateToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 207: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2934 + //line php5/php5.y:2931 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5147,13 +5144,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.StaticToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 208: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2946 + //line php5/php5.y:2943 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5161,13 +5158,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.AbstractToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 209: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2958 + //line php5/php5.y:2955 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5175,13 +5172,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.FinalToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 210: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2973 + //line php5/php5.y:2970 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[3].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -5201,7 +5198,7 @@ yydefault: } case 211: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:2991 + //line php5/php5.y:2988 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[3].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -5222,7 +5219,7 @@ yydefault: } case 212: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3010 + //line php5/php5.y:3007 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -5241,7 +5238,7 @@ yydefault: } case 213: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3027 + //line php5/php5.y:3024 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -5261,7 +5258,7 @@ yydefault: } case 214: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:3048 + //line php5/php5.y:3045 { name := node.NewIdentifier(yyDollar[3].token.Value) constant := stmt.NewConstant(name, yyDollar[5].node, "") @@ -5283,7 +5280,7 @@ yydefault: } case 215: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3068 + //line php5/php5.y:3065 { name := node.NewIdentifier(yyDollar[2].token.Value) constant := stmt.NewConstant(name, yyDollar[4].node, "") @@ -5303,18 +5300,18 @@ yydefault: } case 216: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3089 + //line php5/php5.y:3086 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) + addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 217: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3098 + //line php5/php5.y:3095 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -5322,7 +5319,7 @@ yydefault: } case 218: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3108 + //line php5/php5.y:3105 { yyVAL.list = nil @@ -5330,7 +5327,7 @@ yydefault: } case 219: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3114 + //line php5/php5.y:3111 { yyVAL.list = yyDollar[1].list @@ -5338,18 +5335,18 @@ yydefault: } case 220: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3123 + //line php5/php5.y:3120 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) + addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 221: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3132 + //line php5/php5.y:3129 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -5357,7 +5354,7 @@ yydefault: } case 222: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3141 + //line php5/php5.y:3138 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) @@ -5365,7 +5362,7 @@ yydefault: } case 223: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3147 + //line php5/php5.y:3144 { yyVAL.list = yyDollar[1].list @@ -5373,7 +5370,7 @@ yydefault: } case 224: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3156 + //line php5/php5.y:3153 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yyVAL.list = append(yyDollar[1].list, fetch) @@ -5389,7 +5386,7 @@ yydefault: } case 225: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3170 + //line php5/php5.y:3167 { fetch := expr.NewArrayDimFetch(nil, yyDollar[2].node) yyVAL.list = []node.Node{fetch} @@ -5405,7 +5402,7 @@ yydefault: } case 226: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3187 + //line php5/php5.y:3184 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) @@ -5413,7 +5410,7 @@ yydefault: } case 227: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3193 + //line php5/php5.y:3190 { yyVAL.list = yyDollar[1].list @@ -5421,7 +5418,7 @@ yydefault: } case 228: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3199 + //line php5/php5.y:3196 { yyVAL.list = yyDollar[1].list @@ -5429,7 +5426,7 @@ yydefault: } case 229: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3208 + //line php5/php5.y:3205 { yyVAL.list = nil @@ -5437,7 +5434,7 @@ yydefault: } case 230: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3214 + //line php5/php5.y:3211 { yyVAL.list = yyDollar[1].list @@ -5445,7 +5442,7 @@ yydefault: } case 231: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3223 + //line php5/php5.y:3220 { if yyDollar[3].node != nil { @@ -5463,7 +5460,7 @@ yydefault: } case 232: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:3242 + //line php5/php5.y:3239 { list := expr.NewList(yyDollar[3].list) yyVAL.node = assign.NewAssign(list, yyDollar[6].node) @@ -5482,7 +5479,7 @@ yydefault: } case 233: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3259 + //line php5/php5.y:3256 { yyVAL.node = assign.NewAssign(yyDollar[1].node, yyDollar[3].node) @@ -5496,7 +5493,7 @@ yydefault: } case 234: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3271 + //line php5/php5.y:3268 { yyVAL.node = assign.NewReference(yyDollar[1].node, yyDollar[4].node) @@ -5511,7 +5508,7 @@ yydefault: } case 235: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:3284 + //line php5/php5.y:3281 { var _new *expr.New @@ -5539,7 +5536,7 @@ yydefault: } case 236: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3310 + //line php5/php5.y:3307 { yyVAL.node = expr.NewClone(yyDollar[2].node) @@ -5553,7 +5550,7 @@ yydefault: } case 237: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3322 + //line php5/php5.y:3319 { yyVAL.node = assign.NewPlus(yyDollar[1].node, yyDollar[3].node) @@ -5567,7 +5564,7 @@ yydefault: } case 238: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3334 + //line php5/php5.y:3331 { yyVAL.node = assign.NewMinus(yyDollar[1].node, yyDollar[3].node) @@ -5581,7 +5578,7 @@ yydefault: } case 239: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3346 + //line php5/php5.y:3343 { yyVAL.node = assign.NewMul(yyDollar[1].node, yyDollar[3].node) @@ -5595,7 +5592,7 @@ yydefault: } case 240: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3358 + //line php5/php5.y:3355 { yyVAL.node = assign.NewPow(yyDollar[1].node, yyDollar[3].node) @@ -5609,7 +5606,7 @@ yydefault: } case 241: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3370 + //line php5/php5.y:3367 { yyVAL.node = assign.NewDiv(yyDollar[1].node, yyDollar[3].node) @@ -5623,7 +5620,7 @@ yydefault: } case 242: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3382 + //line php5/php5.y:3379 { yyVAL.node = assign.NewConcat(yyDollar[1].node, yyDollar[3].node) @@ -5637,7 +5634,7 @@ yydefault: } case 243: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3394 + //line php5/php5.y:3391 { yyVAL.node = assign.NewMod(yyDollar[1].node, yyDollar[3].node) @@ -5651,7 +5648,7 @@ yydefault: } case 244: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3406 + //line php5/php5.y:3403 { yyVAL.node = assign.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) @@ -5665,7 +5662,7 @@ yydefault: } case 245: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3418 + //line php5/php5.y:3415 { yyVAL.node = assign.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) @@ -5679,7 +5676,7 @@ yydefault: } case 246: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3430 + //line php5/php5.y:3427 { yyVAL.node = assign.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) @@ -5693,7 +5690,7 @@ yydefault: } case 247: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3442 + //line php5/php5.y:3439 { yyVAL.node = assign.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) @@ -5707,7 +5704,7 @@ yydefault: } case 248: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3454 + //line php5/php5.y:3451 { yyVAL.node = assign.NewShiftRight(yyDollar[1].node, yyDollar[3].node) @@ -5721,7 +5718,7 @@ yydefault: } case 249: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3466 + //line php5/php5.y:3463 { yyVAL.node = expr.NewPostInc(yyDollar[1].node) @@ -5735,7 +5732,7 @@ yydefault: } case 250: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3478 + //line php5/php5.y:3475 { yyVAL.node = expr.NewPreInc(yyDollar[2].node) @@ -5749,7 +5746,7 @@ yydefault: } case 251: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3490 + //line php5/php5.y:3487 { yyVAL.node = expr.NewPostDec(yyDollar[1].node) @@ -5763,7 +5760,7 @@ yydefault: } case 252: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3502 + //line php5/php5.y:3499 { yyVAL.node = expr.NewPreDec(yyDollar[2].node) @@ -5777,7 +5774,7 @@ yydefault: } case 253: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3514 + //line php5/php5.y:3511 { yyVAL.node = binary.NewBooleanOr(yyDollar[1].node, yyDollar[3].node) @@ -5791,7 +5788,7 @@ yydefault: } case 254: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3526 + //line php5/php5.y:3523 { yyVAL.node = binary.NewBooleanAnd(yyDollar[1].node, yyDollar[3].node) @@ -5805,7 +5802,7 @@ yydefault: } case 255: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3538 + //line php5/php5.y:3535 { yyVAL.node = binary.NewLogicalOr(yyDollar[1].node, yyDollar[3].node) @@ -5819,7 +5816,7 @@ yydefault: } case 256: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3550 + //line php5/php5.y:3547 { yyVAL.node = binary.NewLogicalAnd(yyDollar[1].node, yyDollar[3].node) @@ -5833,7 +5830,7 @@ yydefault: } case 257: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3562 + //line php5/php5.y:3559 { yyVAL.node = binary.NewLogicalXor(yyDollar[1].node, yyDollar[3].node) @@ -5847,7 +5844,7 @@ yydefault: } case 258: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3574 + //line php5/php5.y:3571 { yyVAL.node = binary.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) @@ -5861,7 +5858,7 @@ yydefault: } case 259: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3586 + //line php5/php5.y:3583 { yyVAL.node = binary.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) @@ -5875,7 +5872,7 @@ yydefault: } case 260: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3598 + //line php5/php5.y:3595 { yyVAL.node = binary.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) @@ -5889,7 +5886,7 @@ yydefault: } case 261: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3610 + //line php5/php5.y:3607 { yyVAL.node = binary.NewConcat(yyDollar[1].node, yyDollar[3].node) @@ -5903,7 +5900,7 @@ yydefault: } case 262: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3622 + //line php5/php5.y:3619 { yyVAL.node = binary.NewPlus(yyDollar[1].node, yyDollar[3].node) @@ -5917,7 +5914,7 @@ yydefault: } case 263: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3634 + //line php5/php5.y:3631 { yyVAL.node = binary.NewMinus(yyDollar[1].node, yyDollar[3].node) @@ -5931,7 +5928,7 @@ yydefault: } case 264: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3646 + //line php5/php5.y:3643 { yyVAL.node = binary.NewMul(yyDollar[1].node, yyDollar[3].node) @@ -5945,7 +5942,7 @@ yydefault: } case 265: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3658 + //line php5/php5.y:3655 { yyVAL.node = binary.NewPow(yyDollar[1].node, yyDollar[3].node) @@ -5959,7 +5956,7 @@ yydefault: } case 266: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3670 + //line php5/php5.y:3667 { yyVAL.node = binary.NewDiv(yyDollar[1].node, yyDollar[3].node) @@ -5973,7 +5970,7 @@ yydefault: } case 267: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3682 + //line php5/php5.y:3679 { yyVAL.node = binary.NewMod(yyDollar[1].node, yyDollar[3].node) @@ -5987,7 +5984,7 @@ yydefault: } case 268: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3694 + //line php5/php5.y:3691 { yyVAL.node = binary.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) @@ -6001,7 +5998,7 @@ yydefault: } case 269: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3706 + //line php5/php5.y:3703 { yyVAL.node = binary.NewShiftRight(yyDollar[1].node, yyDollar[3].node) @@ -6015,7 +6012,7 @@ yydefault: } case 270: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3718 + //line php5/php5.y:3715 { yyVAL.node = expr.NewUnaryPlus(yyDollar[2].node) @@ -6029,7 +6026,7 @@ yydefault: } case 271: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3730 + //line php5/php5.y:3727 { yyVAL.node = expr.NewUnaryMinus(yyDollar[2].node) @@ -6043,7 +6040,7 @@ yydefault: } case 272: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3742 + //line php5/php5.y:3739 { yyVAL.node = expr.NewBooleanNot(yyDollar[2].node) @@ -6057,7 +6054,7 @@ yydefault: } case 273: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3754 + //line php5/php5.y:3751 { yyVAL.node = expr.NewBitwiseNot(yyDollar[2].node) @@ -6071,7 +6068,7 @@ yydefault: } case 274: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3766 + //line php5/php5.y:3763 { yyVAL.node = binary.NewIdentical(yyDollar[1].node, yyDollar[3].node) @@ -6085,7 +6082,7 @@ yydefault: } case 275: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3778 + //line php5/php5.y:3775 { yyVAL.node = binary.NewNotIdentical(yyDollar[1].node, yyDollar[3].node) @@ -6099,7 +6096,7 @@ yydefault: } case 276: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3790 + //line php5/php5.y:3787 { yyVAL.node = binary.NewEqual(yyDollar[1].node, yyDollar[3].node) @@ -6113,7 +6110,7 @@ yydefault: } case 277: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3802 + //line php5/php5.y:3799 { yyVAL.node = binary.NewNotEqual(yyDollar[1].node, yyDollar[3].node) @@ -6127,7 +6124,7 @@ yydefault: } case 278: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3814 + //line php5/php5.y:3811 { yyVAL.node = binary.NewSmaller(yyDollar[1].node, yyDollar[3].node) @@ -6141,7 +6138,7 @@ yydefault: } case 279: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3826 + //line php5/php5.y:3823 { yyVAL.node = binary.NewSmallerOrEqual(yyDollar[1].node, yyDollar[3].node) @@ -6155,7 +6152,7 @@ yydefault: } case 280: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3838 + //line php5/php5.y:3835 { yyVAL.node = binary.NewGreater(yyDollar[1].node, yyDollar[3].node) @@ -6169,7 +6166,7 @@ yydefault: } case 281: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3850 + //line php5/php5.y:3847 { yyVAL.node = binary.NewGreaterOrEqual(yyDollar[1].node, yyDollar[3].node) @@ -6183,7 +6180,7 @@ yydefault: } case 282: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3862 + //line php5/php5.y:3859 { yyVAL.node = expr.NewInstanceOf(yyDollar[1].node, yyDollar[3].node) @@ -6197,7 +6194,7 @@ yydefault: } case 283: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3874 + //line php5/php5.y:3871 { yyVAL.node = yyDollar[1].node @@ -6205,7 +6202,7 @@ yydefault: } case 284: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3880 + //line php5/php5.y:3877 { yyVAL.node = yyDollar[1].node @@ -6213,7 +6210,7 @@ yydefault: } case 285: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3886 + //line php5/php5.y:3883 { yyVAL.node = yyDollar[2].node @@ -6244,7 +6241,7 @@ yydefault: } case 286: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:3915 + //line php5/php5.y:3912 { yyVAL.node = expr.NewTernary(yyDollar[1].node, yyDollar[3].node, yyDollar[5].node) @@ -6259,7 +6256,7 @@ yydefault: } case 287: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3928 + //line php5/php5.y:3925 { yyVAL.node = expr.NewTernary(yyDollar[1].node, nil, yyDollar[4].node) @@ -6274,7 +6271,7 @@ yydefault: } case 288: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3941 + //line php5/php5.y:3938 { yyVAL.node = yyDollar[1].node @@ -6282,7 +6279,7 @@ yydefault: } case 289: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3947 + //line php5/php5.y:3944 { yyVAL.node = cast.NewInt(yyDollar[2].node) @@ -6296,7 +6293,7 @@ yydefault: } case 290: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3959 + //line php5/php5.y:3956 { yyVAL.node = cast.NewDouble(yyDollar[2].node) @@ -6310,7 +6307,7 @@ yydefault: } case 291: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3971 + //line php5/php5.y:3968 { yyVAL.node = cast.NewString(yyDollar[2].node) @@ -6324,7 +6321,7 @@ yydefault: } case 292: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3983 + //line php5/php5.y:3980 { yyVAL.node = cast.NewArray(yyDollar[2].node) @@ -6338,7 +6335,7 @@ yydefault: } case 293: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3995 + //line php5/php5.y:3992 { yyVAL.node = cast.NewObject(yyDollar[2].node) @@ -6352,7 +6349,7 @@ yydefault: } case 294: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4007 + //line php5/php5.y:4004 { yyVAL.node = cast.NewBool(yyDollar[2].node) @@ -6366,7 +6363,7 @@ yydefault: } case 295: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4019 + //line php5/php5.y:4016 { yyVAL.node = cast.NewUnset(yyDollar[2].node) @@ -6380,7 +6377,7 @@ yydefault: } case 296: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4031 + //line php5/php5.y:4028 { if strings.EqualFold(yyDollar[1].token.Value, "die") { yyVAL.node = expr.NewDie(nil) @@ -6410,7 +6407,7 @@ yydefault: } case 297: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4059 + //line php5/php5.y:4056 { yyVAL.node = expr.NewErrorSuppress(yyDollar[2].node) @@ -6424,7 +6421,7 @@ yydefault: } case 298: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4071 + //line php5/php5.y:4068 { yyVAL.node = yyDollar[1].node @@ -6432,7 +6429,7 @@ yydefault: } case 299: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4077 + //line php5/php5.y:4074 { yyVAL.node = yyDollar[1].node @@ -6440,7 +6437,7 @@ yydefault: } case 300: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4083 + //line php5/php5.y:4080 { yyVAL.node = yyDollar[1].node @@ -6448,7 +6445,7 @@ yydefault: } case 301: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4089 + //line php5/php5.y:4086 { yyVAL.node = expr.NewShellExec(yyDollar[2].list) @@ -6463,7 +6460,7 @@ yydefault: } case 302: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4102 + //line php5/php5.y:4099 { yyVAL.node = expr.NewPrint(yyDollar[2].node) @@ -6477,7 +6474,7 @@ yydefault: } case 303: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4114 + //line php5/php5.y:4111 { yyVAL.node = expr.NewYield(nil, nil) @@ -6491,7 +6488,7 @@ yydefault: } case 304: yyDollar = yyS[yypt-9 : yypt+1] - //line php5/php5.y:4126 + //line php5/php5.y:4123 { yyVAL.node = expr.NewClosure(yyDollar[4].list, yyDollar[6].ClosureUse, nil, yyDollar[8].list, false, yyDollar[2].token != nil, "") @@ -6512,7 +6509,7 @@ yydefault: } case 305: yyDollar = yyS[yypt-10 : yypt+1] - //line php5/php5.y:4145 + //line php5/php5.y:4142 { yyVAL.node = expr.NewClosure(yyDollar[5].list, yyDollar[7].ClosureUse, nil, yyDollar[9].list, true, yyDollar[3].token != nil, "") @@ -6534,7 +6531,7 @@ yydefault: } case 306: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4168 + //line php5/php5.y:4165 { yyVAL.node = expr.NewYield(nil, yyDollar[2].node) @@ -6548,7 +6545,7 @@ yydefault: } case 307: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4180 + //line php5/php5.y:4177 { yyVAL.node = expr.NewYield(nil, yyDollar[2].node) @@ -6562,7 +6559,7 @@ yydefault: } case 308: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4192 + //line php5/php5.y:4189 { yyVAL.node = expr.NewYield(yyDollar[2].node, yyDollar[4].node) @@ -6577,7 +6574,7 @@ yydefault: } case 309: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4205 + //line php5/php5.y:4202 { yyVAL.node = expr.NewYield(yyDollar[2].node, yyDollar[4].node) @@ -6592,7 +6589,7 @@ yydefault: } case 310: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4221 + //line php5/php5.y:4218 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -6607,7 +6604,7 @@ yydefault: } case 311: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4234 + //line php5/php5.y:4231 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -6622,7 +6619,7 @@ yydefault: } case 312: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4247 + //line php5/php5.y:4244 { str := scalar.NewString(yyDollar[1].token.Value) yyVAL.node = expr.NewArrayDimFetch(str, yyDollar[3].node) @@ -6639,7 +6636,7 @@ yydefault: } case 313: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4262 + //line php5/php5.y:4259 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -6654,7 +6651,7 @@ yydefault: } case 314: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4278 + //line php5/php5.y:4275 { yyVAL.node = expr.NewArray(yyDollar[3].list) @@ -6670,7 +6667,7 @@ yydefault: } case 315: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4292 + //line php5/php5.y:4289 { yyVAL.node = expr.NewShortArray(yyDollar[2].list) @@ -6685,13 +6682,13 @@ yydefault: } case 316: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4308 + //line php5/php5.y:4305 { yyVAL.token = yyDollar[1].token } case 317: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:4315 + //line php5/php5.y:4312 { yyVAL.ClosureUse = nil @@ -6699,7 +6696,7 @@ yydefault: } case 318: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4321 + //line php5/php5.y:4318 { yyVAL.ClosureUse = expr.NewClosureUse(yyDollar[3].list) @@ -6709,7 +6706,7 @@ yydefault: } case 319: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4332 + //line php5/php5.y:4329 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[3].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -6727,7 +6724,7 @@ yydefault: } case 320: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4348 + //line php5/php5.y:4345 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[4].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -6748,7 +6745,7 @@ yydefault: } case 321: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4367 + //line php5/php5.y:4364 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -6765,7 +6762,7 @@ yydefault: } case 322: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4382 + //line php5/php5.y:4379 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[2].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -6785,7 +6782,7 @@ yydefault: } case 323: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4403 + //line php5/php5.y:4400 { name := name.NewName(yyDollar[1].list) yyVAL.node = expr.NewFunctionCall(name, yyDollar[2].node.(*node.ArgumentList)) @@ -6798,7 +6795,7 @@ yydefault: } case 324: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4414 + //line php5/php5.y:4411 { funcName := name.NewRelative(yyDollar[3].list) yyVAL.node = expr.NewFunctionCall(funcName, yyDollar[4].node.(*node.ArgumentList)) @@ -6815,7 +6812,7 @@ yydefault: } case 325: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4429 + //line php5/php5.y:4426 { funcName := name.NewFullyQualified(yyDollar[2].list) yyVAL.node = expr.NewFunctionCall(funcName, yyDollar[3].node.(*node.ArgumentList)) @@ -6831,7 +6828,7 @@ yydefault: } case 326: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4443 + //line php5/php5.y:4440 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -6845,7 +6842,7 @@ yydefault: } case 327: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4455 + //line php5/php5.y:4452 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -6859,7 +6856,7 @@ yydefault: } case 328: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4467 + //line php5/php5.y:4464 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -6873,7 +6870,7 @@ yydefault: } case 329: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4479 + //line php5/php5.y:4476 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -6887,7 +6884,7 @@ yydefault: } case 330: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4491 + //line php5/php5.y:4488 { yyVAL.node = expr.NewFunctionCall(yyDollar[1].node, yyDollar[2].node.(*node.ArgumentList)) @@ -6898,7 +6895,7 @@ yydefault: } case 331: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4503 + //line php5/php5.y:4500 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -6906,13 +6903,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.StaticToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 332: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4515 + //line php5/php5.y:4512 { yyVAL.node = name.NewName(yyDollar[1].list) @@ -6923,7 +6920,7 @@ yydefault: } case 333: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4524 + //line php5/php5.y:4521 { yyVAL.node = name.NewRelative(yyDollar[3].list) @@ -6938,7 +6935,7 @@ yydefault: } case 334: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4537 + //line php5/php5.y:4534 { yyVAL.node = name.NewFullyQualified(yyDollar[2].list) @@ -6952,7 +6949,7 @@ yydefault: } case 335: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4552 + //line php5/php5.y:4549 { yyVAL.node = name.NewName(yyDollar[1].list) @@ -6963,7 +6960,7 @@ yydefault: } case 336: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4561 + //line php5/php5.y:4558 { yyVAL.node = name.NewRelative(yyDollar[3].list) @@ -6978,7 +6975,7 @@ yydefault: } case 337: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4574 + //line php5/php5.y:4571 { yyVAL.node = name.NewFullyQualified(yyDollar[2].list) @@ -6992,7 +6989,7 @@ yydefault: } case 338: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4589 + //line php5/php5.y:4586 { yyVAL.node = yyDollar[1].node @@ -7000,7 +6997,7 @@ yydefault: } case 339: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4595 + //line php5/php5.y:4592 { yyVAL.node = yyDollar[1].node @@ -7008,7 +7005,7 @@ yydefault: } case 340: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4604 + //line php5/php5.y:4601 { yyVAL.node = yyDollar[1].node @@ -7047,7 +7044,7 @@ yydefault: } case 341: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4641 + //line php5/php5.y:4638 { yyVAL.node = yyDollar[1].node @@ -7055,7 +7052,7 @@ yydefault: } case 342: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4651 + //line php5/php5.y:4648 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) @@ -7063,7 +7060,7 @@ yydefault: } case 343: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:4657 + //line php5/php5.y:4654 { yyVAL.list = []node.Node{} @@ -7071,7 +7068,7 @@ yydefault: } case 344: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4667 + //line php5/php5.y:4664 { yyVAL.list = yyDollar[2].list @@ -7082,7 +7079,7 @@ yydefault: } case 345: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:4679 + //line php5/php5.y:4676 { yyVAL.node = nil @@ -7090,7 +7087,7 @@ yydefault: } case 346: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4685 + //line php5/php5.y:4682 { yyVAL.node = expr.NewExit(nil) @@ -7105,7 +7102,7 @@ yydefault: } case 347: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4698 + //line php5/php5.y:4695 { yyVAL.node = expr.NewExit(yyDollar[1].node) @@ -7116,7 +7113,7 @@ yydefault: } case 348: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:4710 + //line php5/php5.y:4707 { yyVAL.list = []node.Node{} @@ -7124,7 +7121,7 @@ yydefault: } case 349: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4716 + //line php5/php5.y:4713 { yyVAL.list = []node.Node{scalar.NewEncapsedStringPart(yyDollar[1].token.Value)} @@ -7132,7 +7129,7 @@ yydefault: } case 350: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4722 + //line php5/php5.y:4719 { yyVAL.list = yyDollar[1].list @@ -7140,7 +7137,7 @@ yydefault: } case 351: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:4731 + //line php5/php5.y:4728 { yyVAL.node = nil @@ -7148,7 +7145,7 @@ yydefault: } case 352: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4737 + //line php5/php5.y:4734 { yyVAL.node = yyDollar[1].node @@ -7156,7 +7153,7 @@ yydefault: } case 353: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4746 + //line php5/php5.y:4743 { yyVAL.node = scalar.NewLnumber(yyDollar[1].token.Value) @@ -7170,7 +7167,7 @@ yydefault: } case 354: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4758 + //line php5/php5.y:4755 { yyVAL.node = scalar.NewDnumber(yyDollar[1].token.Value) @@ -7184,7 +7181,7 @@ yydefault: } case 355: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4770 + //line php5/php5.y:4767 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) @@ -7198,7 +7195,7 @@ yydefault: } case 356: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4782 + //line php5/php5.y:4779 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7206,13 +7203,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.LineToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.MagicConstantToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 357: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4794 + //line php5/php5.y:4791 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7220,13 +7217,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.FileToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.MagicConstantToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 358: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4806 + //line php5/php5.y:4803 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7234,13 +7231,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.DirToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.MagicConstantToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 359: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4818 + //line php5/php5.y:4815 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7248,13 +7245,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.TraitCToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.MagicConstantToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 360: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4830 + //line php5/php5.y:4827 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7262,13 +7259,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.MethodCToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.MagicConstantToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 361: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4842 + //line php5/php5.y:4839 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7276,13 +7273,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.FuncCToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.MagicConstantToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 362: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4854 + //line php5/php5.y:4851 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7290,13 +7287,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.NsCToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.MagicConstantToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 363: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4866 + //line php5/php5.y:4863 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, []node.Node{encapsed}) @@ -7312,7 +7309,7 @@ yydefault: } case 364: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4880 + //line php5/php5.y:4877 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, nil) @@ -7326,7 +7323,7 @@ yydefault: } case 365: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4895 + //line php5/php5.y:4892 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -7343,7 +7340,7 @@ yydefault: } case 366: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4913 + //line php5/php5.y:4910 { yyVAL.node = yyDollar[1].node @@ -7351,7 +7348,7 @@ yydefault: } case 367: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4922 + //line php5/php5.y:4919 { yyVAL.node = yyDollar[1].node @@ -7359,7 +7356,7 @@ yydefault: } case 368: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4928 + //line php5/php5.y:4925 { yyVAL.node = yyDollar[1].node @@ -7367,7 +7364,7 @@ yydefault: } case 369: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4934 + //line php5/php5.y:4931 { name := name.NewName(yyDollar[1].list) yyVAL.node = expr.NewConstFetch(name) @@ -7380,7 +7377,7 @@ yydefault: } case 370: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4945 + //line php5/php5.y:4942 { name := name.NewRelative(yyDollar[3].list) yyVAL.node = expr.NewConstFetch(name) @@ -7390,14 +7387,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.NamespaceToken) - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.NsSeparatorToken) + addMeta(name, yyDollar[1].token.Meta, meta.NamespaceToken) + addMeta(name, yyDollar[2].token.Meta, meta.NsSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 371: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4960 + //line php5/php5.y:4957 { name := name.NewFullyQualified(yyDollar[2].list) yyVAL.node = expr.NewConstFetch(name) @@ -7407,13 +7404,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.NsSeparatorToken) + addMeta(name, yyDollar[1].token.Meta, meta.NsSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 372: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4974 + //line php5/php5.y:4971 { yyVAL.node = expr.NewArray(yyDollar[3].list) @@ -7429,7 +7426,7 @@ yydefault: } case 373: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4988 + //line php5/php5.y:4985 { yyVAL.node = expr.NewShortArray(yyDollar[2].list) @@ -7444,7 +7441,7 @@ yydefault: } case 374: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5001 + //line php5/php5.y:4998 { yyVAL.node = yyDollar[1].node @@ -7452,7 +7449,7 @@ yydefault: } case 375: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5007 + //line php5/php5.y:5004 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7460,13 +7457,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ClassCToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.MagicConstantToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 376: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5019 + //line php5/php5.y:5016 { yyVAL.node = yyDollar[1].node @@ -7474,7 +7471,7 @@ yydefault: } case 377: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:5028 + //line php5/php5.y:5025 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -7489,7 +7486,7 @@ yydefault: } case 378: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5041 + //line php5/php5.y:5038 { yyVAL.node = binary.NewPlus(yyDollar[1].node, yyDollar[3].node) @@ -7503,7 +7500,7 @@ yydefault: } case 379: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5053 + //line php5/php5.y:5050 { yyVAL.node = binary.NewMinus(yyDollar[1].node, yyDollar[3].node) @@ -7517,7 +7514,7 @@ yydefault: } case 380: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5065 + //line php5/php5.y:5062 { yyVAL.node = binary.NewMul(yyDollar[1].node, yyDollar[3].node) @@ -7531,7 +7528,7 @@ yydefault: } case 381: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5077 + //line php5/php5.y:5074 { yyVAL.node = binary.NewPow(yyDollar[1].node, yyDollar[3].node) @@ -7545,7 +7542,7 @@ yydefault: } case 382: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5089 + //line php5/php5.y:5086 { yyVAL.node = binary.NewDiv(yyDollar[1].node, yyDollar[3].node) @@ -7559,7 +7556,7 @@ yydefault: } case 383: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5101 + //line php5/php5.y:5098 { yyVAL.node = binary.NewMod(yyDollar[1].node, yyDollar[3].node) @@ -7573,7 +7570,7 @@ yydefault: } case 384: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5113 + //line php5/php5.y:5110 { yyVAL.node = expr.NewBooleanNot(yyDollar[2].node) @@ -7587,7 +7584,7 @@ yydefault: } case 385: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5125 + //line php5/php5.y:5122 { yyVAL.node = expr.NewBitwiseNot(yyDollar[2].node) @@ -7601,7 +7598,7 @@ yydefault: } case 386: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5137 + //line php5/php5.y:5134 { yyVAL.node = binary.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) @@ -7615,7 +7612,7 @@ yydefault: } case 387: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5149 + //line php5/php5.y:5146 { yyVAL.node = binary.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) @@ -7629,7 +7626,7 @@ yydefault: } case 388: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5161 + //line php5/php5.y:5158 { yyVAL.node = binary.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) @@ -7643,7 +7640,7 @@ yydefault: } case 389: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5173 + //line php5/php5.y:5170 { yyVAL.node = binary.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) @@ -7657,7 +7654,7 @@ yydefault: } case 390: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5185 + //line php5/php5.y:5182 { yyVAL.node = binary.NewShiftRight(yyDollar[1].node, yyDollar[3].node) @@ -7671,7 +7668,7 @@ yydefault: } case 391: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5197 + //line php5/php5.y:5194 { yyVAL.node = binary.NewConcat(yyDollar[1].node, yyDollar[3].node) @@ -7685,7 +7682,7 @@ yydefault: } case 392: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5209 + //line php5/php5.y:5206 { yyVAL.node = binary.NewLogicalXor(yyDollar[1].node, yyDollar[3].node) @@ -7699,7 +7696,7 @@ yydefault: } case 393: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5221 + //line php5/php5.y:5218 { yyVAL.node = binary.NewLogicalAnd(yyDollar[1].node, yyDollar[3].node) @@ -7713,7 +7710,7 @@ yydefault: } case 394: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5233 + //line php5/php5.y:5230 { yyVAL.node = binary.NewLogicalOr(yyDollar[1].node, yyDollar[3].node) @@ -7727,7 +7724,7 @@ yydefault: } case 395: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5245 + //line php5/php5.y:5242 { yyVAL.node = binary.NewBooleanAnd(yyDollar[1].node, yyDollar[3].node) @@ -7741,7 +7738,7 @@ yydefault: } case 396: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5257 + //line php5/php5.y:5254 { yyVAL.node = binary.NewBooleanOr(yyDollar[1].node, yyDollar[3].node) @@ -7755,7 +7752,7 @@ yydefault: } case 397: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5269 + //line php5/php5.y:5266 { yyVAL.node = binary.NewIdentical(yyDollar[1].node, yyDollar[3].node) @@ -7769,7 +7766,7 @@ yydefault: } case 398: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5281 + //line php5/php5.y:5278 { yyVAL.node = binary.NewNotIdentical(yyDollar[1].node, yyDollar[3].node) @@ -7783,7 +7780,7 @@ yydefault: } case 399: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5293 + //line php5/php5.y:5290 { yyVAL.node = binary.NewEqual(yyDollar[1].node, yyDollar[3].node) @@ -7797,7 +7794,7 @@ yydefault: } case 400: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5305 + //line php5/php5.y:5302 { yyVAL.node = binary.NewNotEqual(yyDollar[1].node, yyDollar[3].node) @@ -7811,7 +7808,7 @@ yydefault: } case 401: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5317 + //line php5/php5.y:5314 { yyVAL.node = binary.NewSmaller(yyDollar[1].node, yyDollar[3].node) @@ -7825,7 +7822,7 @@ yydefault: } case 402: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5329 + //line php5/php5.y:5326 { yyVAL.node = binary.NewGreater(yyDollar[1].node, yyDollar[3].node) @@ -7839,7 +7836,7 @@ yydefault: } case 403: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5341 + //line php5/php5.y:5338 { yyVAL.node = binary.NewSmallerOrEqual(yyDollar[1].node, yyDollar[3].node) @@ -7853,7 +7850,7 @@ yydefault: } case 404: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5353 + //line php5/php5.y:5350 { yyVAL.node = binary.NewGreaterOrEqual(yyDollar[1].node, yyDollar[3].node) @@ -7867,7 +7864,7 @@ yydefault: } case 405: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:5365 + //line php5/php5.y:5362 { yyVAL.node = expr.NewTernary(yyDollar[1].node, nil, yyDollar[4].node) @@ -7882,7 +7879,7 @@ yydefault: } case 406: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:5378 + //line php5/php5.y:5375 { yyVAL.node = expr.NewTernary(yyDollar[1].node, yyDollar[3].node, yyDollar[5].node) @@ -7897,7 +7894,7 @@ yydefault: } case 407: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5391 + //line php5/php5.y:5388 { yyVAL.node = expr.NewUnaryPlus(yyDollar[2].node) @@ -7911,7 +7908,7 @@ yydefault: } case 408: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5403 + //line php5/php5.y:5400 { yyVAL.node = expr.NewUnaryMinus(yyDollar[2].node) @@ -7925,7 +7922,7 @@ yydefault: } case 409: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5415 + //line php5/php5.y:5412 { yyVAL.node = yyDollar[2].node @@ -7937,7 +7934,7 @@ yydefault: } case 410: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5428 + //line php5/php5.y:5425 { yyVAL.node = yyDollar[1].node @@ -7945,7 +7942,7 @@ yydefault: } case 411: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5434 + //line php5/php5.y:5431 { name := name.NewName(yyDollar[1].list) yyVAL.node = expr.NewConstFetch(name) @@ -7958,7 +7955,7 @@ yydefault: } case 412: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5445 + //line php5/php5.y:5442 { name := name.NewRelative(yyDollar[3].list) yyVAL.node = expr.NewConstFetch(name) @@ -7966,14 +7963,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(name)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.NamespaceToken) - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.NsSeparatorToken) + addMeta(name, yyDollar[1].token.Meta, meta.NamespaceToken) + addMeta(name, yyDollar[2].token.Meta, meta.NsSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 413: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5458 + //line php5/php5.y:5455 { name := name.NewFullyQualified(yyDollar[2].list) yyVAL.node = expr.NewConstFetch(name) @@ -7983,13 +7980,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(name)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.NsSeparatorToken) + addMeta(name, yyDollar[1].token.Meta, meta.NsSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 414: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5475 + //line php5/php5.y:5472 { name := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = expr.NewVariable(name) @@ -7999,13 +7996,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(name, yyDollar[1].token.Meta, meta.StringVarnameToken) + addMeta(name, yyDollar[1].token.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 415: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5489 + //line php5/php5.y:5486 { yyVAL.node = yyDollar[1].node @@ -8013,7 +8010,7 @@ yydefault: } case 416: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5495 + //line php5/php5.y:5492 { yyVAL.node = yyDollar[1].node @@ -8021,7 +8018,7 @@ yydefault: } case 417: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5501 + //line php5/php5.y:5498 { yyVAL.node = yyDollar[1].node @@ -8029,7 +8026,7 @@ yydefault: } case 418: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5507 + //line php5/php5.y:5504 { yyVAL.node = scalar.NewEncapsed(yyDollar[2].list) @@ -8043,7 +8040,7 @@ yydefault: } case 419: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5519 + //line php5/php5.y:5516 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, yyDollar[2].list) @@ -8057,7 +8054,7 @@ yydefault: } case 420: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5531 + //line php5/php5.y:5528 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -8065,13 +8062,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ClassCToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.MagicConstantToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 421: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:5546 + //line php5/php5.y:5543 { yyVAL.list = nil @@ -8079,7 +8076,7 @@ yydefault: } case 422: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5552 + //line php5/php5.y:5549 { yyVAL.list = yyDollar[1].list @@ -8092,19 +8089,19 @@ yydefault: } case 423: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:5566 + //line php5/php5.y:5563 { yyVAL.token = nil } case 424: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5570 + //line php5/php5.y:5567 { yyVAL.token = yyDollar[1].token } case 425: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:5577 + //line php5/php5.y:5574 { arrayItem := expr.NewArrayItem(yyDollar[3].node, yyDollar[5].node) yyVAL.list = append(yyDollar[1].list, arrayItem) @@ -8120,7 +8117,7 @@ yydefault: } case 426: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5591 + //line php5/php5.y:5588 { arrayItem := expr.NewArrayItem(nil, yyDollar[3].node) yyVAL.list = append(yyDollar[1].list, arrayItem) @@ -8135,7 +8132,7 @@ yydefault: } case 427: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5604 + //line php5/php5.y:5601 { arrayItem := expr.NewArrayItem(yyDollar[1].node, yyDollar[3].node) yyVAL.list = []node.Node{arrayItem} @@ -8150,7 +8147,7 @@ yydefault: } case 428: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5617 + //line php5/php5.y:5614 { arrayItem := expr.NewArrayItem(nil, yyDollar[1].node) yyVAL.list = []node.Node{arrayItem} @@ -8162,7 +8159,7 @@ yydefault: } case 429: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5630 + //line php5/php5.y:5627 { yyVAL.node = yyDollar[1].node @@ -8170,7 +8167,7 @@ yydefault: } case 430: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5636 + //line php5/php5.y:5633 { yyVAL.node = yyDollar[1].node @@ -8178,23 +8175,31 @@ yydefault: } case 431: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5645 + //line php5/php5.y:5642 { yyVAL.node = yyDollar[2].node + // save comments + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.OpenParenthesisToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.CloseParenthesisToken) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 432: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5651 + //line php5/php5.y:5652 { yyVAL.node = yyDollar[2].node + // save comments + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.OpenParenthesisToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.CloseParenthesisToken) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 433: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5661 + //line php5/php5.y:5666 { yyVAL.node = yyDollar[1].node @@ -8202,7 +8207,7 @@ yydefault: } case 434: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5671 + //line php5/php5.y:5676 { yyVAL.node = yyDollar[1].node @@ -8210,7 +8215,7 @@ yydefault: } case 435: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5680 + //line php5/php5.y:5685 { yyVAL.node = yyDollar[1].node @@ -8218,7 +8223,7 @@ yydefault: } case 436: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:5689 + //line php5/php5.y:5694 { yyVAL.node = yyDollar[1].node @@ -8272,7 +8277,7 @@ yydefault: } case 437: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5741 + //line php5/php5.y:5746 { yyVAL.node = yyDollar[1].node @@ -8280,7 +8285,7 @@ yydefault: } case 438: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5750 + //line php5/php5.y:5755 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) @@ -8288,7 +8293,7 @@ yydefault: } case 439: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:5756 + //line php5/php5.y:5761 { yyVAL.list = []node.Node{} @@ -8296,7 +8301,7 @@ yydefault: } case 440: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5766 + //line php5/php5.y:5771 { if yyDollar[3].list != nil { yyDollar[3].list[0].(*expr.MethodCall).Method = yyDollar[2].list[len(yyDollar[2].list)-1].(*expr.PropertyFetch).Property @@ -8312,7 +8317,7 @@ yydefault: } case 441: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:5783 + //line php5/php5.y:5788 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yyVAL.list = append(yyDollar[1].list, fetch) @@ -8328,7 +8333,7 @@ yydefault: } case 442: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:5797 + //line php5/php5.y:5802 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yyVAL.list = []node.Node{yyDollar[1].node, fetch} @@ -8344,7 +8349,7 @@ yydefault: } case 443: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5814 + //line php5/php5.y:5819 { yyVAL.node = expr.NewMethodCall(nil, nil, yyDollar[1].node.(*node.ArgumentList)) @@ -8355,7 +8360,7 @@ yydefault: } case 444: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5826 + //line php5/php5.y:5831 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -8363,7 +8368,7 @@ yydefault: } case 445: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5832 + //line php5/php5.y:5837 { yyVAL.list = yyDollar[1].list @@ -8371,7 +8376,7 @@ yydefault: } case 446: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:5838 + //line php5/php5.y:5843 { yyVAL.list = nil @@ -8379,7 +8384,7 @@ yydefault: } case 447: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5847 + //line php5/php5.y:5852 { yyVAL.node = yyDollar[1].node @@ -8387,7 +8392,7 @@ yydefault: } case 448: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5853 + //line php5/php5.y:5858 { yyDollar[1].simpleIndirectReference.last.SetVarName(yyDollar[2].node) @@ -8401,7 +8406,7 @@ yydefault: } case 449: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5868 + //line php5/php5.y:5873 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -8415,7 +8420,7 @@ yydefault: } case 450: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5880 + //line php5/php5.y:5885 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -8429,7 +8434,7 @@ yydefault: } case 451: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5895 + //line php5/php5.y:5900 { yyVAL.node = yyDollar[1].node @@ -8437,7 +8442,7 @@ yydefault: } case 452: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:5904 + //line php5/php5.y:5909 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -8452,7 +8457,7 @@ yydefault: } case 453: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:5917 + //line php5/php5.y:5922 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -8467,7 +8472,7 @@ yydefault: } case 454: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5933 + //line php5/php5.y:5938 { yyVAL.node = yyDollar[1].node @@ -8475,7 +8480,7 @@ yydefault: } case 455: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5939 + //line php5/php5.y:5944 { yyVAL.node = yyDollar[1].node @@ -8483,7 +8488,7 @@ yydefault: } case 456: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5945 + //line php5/php5.y:5950 { yyVAL.node = yyDollar[1].node @@ -8491,7 +8496,7 @@ yydefault: } case 457: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5955 + //line php5/php5.y:5960 { yyVAL.node = yyDollar[1].node @@ -8499,7 +8504,7 @@ yydefault: } case 458: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5961 + //line php5/php5.y:5966 { yyDollar[1].simpleIndirectReference.last.SetVarName(yyDollar[2].node) @@ -8513,7 +8518,7 @@ yydefault: } case 459: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5973 + //line php5/php5.y:5978 { yyVAL.node = yyDollar[1].node @@ -8521,7 +8526,7 @@ yydefault: } case 460: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:5982 + //line php5/php5.y:5987 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -8536,7 +8541,7 @@ yydefault: } case 461: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:5995 + //line php5/php5.y:6000 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -8551,7 +8556,7 @@ yydefault: } case 462: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6008 + //line php5/php5.y:6013 { yyVAL.node = yyDollar[1].node @@ -8559,7 +8564,7 @@ yydefault: } case 463: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6018 + //line php5/php5.y:6023 { name := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(name) @@ -8575,7 +8580,7 @@ yydefault: } case 464: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6032 + //line php5/php5.y:6037 { yyVAL.node = expr.NewVariable(yyDollar[3].node) @@ -8591,7 +8596,7 @@ yydefault: } case 465: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:6049 + //line php5/php5.y:6054 { yyVAL.node = nil @@ -8599,7 +8604,7 @@ yydefault: } case 466: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6055 + //line php5/php5.y:6060 { yyVAL.node = yyDollar[1].node @@ -8607,7 +8612,7 @@ yydefault: } case 467: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6065 + //line php5/php5.y:6070 { yyVAL.list = yyDollar[1].list @@ -8615,7 +8620,7 @@ yydefault: } case 468: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6071 + //line php5/php5.y:6076 { fetch := expr.NewPropertyFetch(nil, yyDollar[1].node) yyVAL.list = []node.Node{fetch} @@ -8627,7 +8632,7 @@ yydefault: } case 469: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6084 + //line php5/php5.y:6089 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yyVAL.list = append(yyDollar[1].list, fetch) @@ -8643,7 +8648,7 @@ yydefault: } case 470: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6098 + //line php5/php5.y:6103 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yyVAL.list = append(yyDollar[1].list, fetch) @@ -8659,7 +8664,7 @@ yydefault: } case 471: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6112 + //line php5/php5.y:6117 { fetch := expr.NewPropertyFetch(nil, yyDollar[1].node) yyVAL.list = []node.Node{fetch} @@ -8671,7 +8676,7 @@ yydefault: } case 472: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6125 + //line php5/php5.y:6130 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -8679,13 +8684,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.StringToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 473: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6137 + //line php5/php5.y:6142 { yyVAL.node = yyDollar[2].node @@ -8700,7 +8705,7 @@ yydefault: } case 474: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6153 + //line php5/php5.y:6158 { n := expr.NewVariable(nil) yyVAL.simpleIndirectReference = simpleIndirectReference{[]*expr.Variable{n}, n} @@ -8715,7 +8720,7 @@ yydefault: } case 475: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6166 + //line php5/php5.y:6171 { n := expr.NewVariable(nil) @@ -8734,7 +8739,7 @@ yydefault: } case 476: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6186 + //line php5/php5.y:6191 { if len(yyDollar[1].list) == 0 { yyDollar[1].list = []node.Node{expr.NewArrayItem(nil, nil)} @@ -8743,13 +8748,13 @@ yydefault: yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) + addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 477: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6199 + //line php5/php5.y:6204 { if yyDollar[1].node.(*expr.ArrayItem).Key == nil && yyDollar[1].node.(*expr.ArrayItem).Val == nil { yyVAL.list = []node.Node{} @@ -8761,7 +8766,7 @@ yydefault: } case 478: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6213 + //line php5/php5.y:6218 { yyVAL.node = expr.NewArrayItem(nil, yyDollar[1].node) @@ -8772,7 +8777,7 @@ yydefault: } case 479: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6222 + //line php5/php5.y:6227 { item := expr.NewList(yyDollar[3].list) yyVAL.node = expr.NewArrayItem(nil, item) @@ -8790,7 +8795,7 @@ yydefault: } case 480: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:6238 + //line php5/php5.y:6243 { yyVAL.node = expr.NewArrayItem(nil, nil) @@ -8798,7 +8803,7 @@ yydefault: } case 481: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:6248 + //line php5/php5.y:6253 { yyVAL.list = []node.Node{} @@ -8806,7 +8811,7 @@ yydefault: } case 482: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6254 + //line php5/php5.y:6259 { yyVAL.list = yyDollar[1].list @@ -8823,7 +8828,7 @@ yydefault: } case 483: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:6272 + //line php5/php5.y:6277 { arrayItem := expr.NewArrayItem(yyDollar[3].node, yyDollar[5].node) yyVAL.list = append(yyDollar[1].list, arrayItem) @@ -8839,7 +8844,7 @@ yydefault: } case 484: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6286 + //line php5/php5.y:6291 { arrayItem := expr.NewArrayItem(nil, yyDollar[3].node) yyVAL.list = append(yyDollar[1].list, arrayItem) @@ -8854,7 +8859,7 @@ yydefault: } case 485: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6299 + //line php5/php5.y:6304 { arrayItem := expr.NewArrayItem(yyDollar[1].node, yyDollar[3].node) yyVAL.list = []node.Node{arrayItem} @@ -8869,7 +8874,7 @@ yydefault: } case 486: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6312 + //line php5/php5.y:6317 { arrayItem := expr.NewArrayItem(nil, yyDollar[1].node) yyVAL.list = []node.Node{arrayItem} @@ -8881,7 +8886,7 @@ yydefault: } case 487: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:6322 + //line php5/php5.y:6327 { reference := expr.NewReference(yyDollar[6].node) arrayItem := expr.NewArrayItem(yyDollar[3].node, reference) @@ -8900,7 +8905,7 @@ yydefault: } case 488: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6339 + //line php5/php5.y:6344 { reference := expr.NewReference(yyDollar[4].node) arrayItem := expr.NewArrayItem(nil, reference) @@ -8918,7 +8923,7 @@ yydefault: } case 489: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6355 + //line php5/php5.y:6360 { reference := expr.NewReference(yyDollar[4].node) arrayItem := expr.NewArrayItem(yyDollar[1].node, reference) @@ -8936,7 +8941,7 @@ yydefault: } case 490: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6371 + //line php5/php5.y:6376 { reference := expr.NewReference(yyDollar[2].node) arrayItem := expr.NewArrayItem(nil, reference) @@ -8953,7 +8958,7 @@ yydefault: } case 491: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6389 + //line php5/php5.y:6394 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -8961,7 +8966,7 @@ yydefault: } case 492: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6395 + //line php5/php5.y:6400 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yyVAL.list = append(yyDollar[1].list, encapsed) @@ -8976,7 +8981,7 @@ yydefault: } case 493: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6408 + //line php5/php5.y:6413 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -8984,7 +8989,7 @@ yydefault: } case 494: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6414 + //line php5/php5.y:6419 { encapsed := scalar.NewEncapsedStringPart(yyDollar[1].token.Value) yyVAL.list = []node.Node{encapsed, yyDollar[2].node} @@ -8999,7 +9004,7 @@ yydefault: } case 495: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6430 + //line php5/php5.y:6435 { name := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(name) @@ -9015,7 +9020,7 @@ yydefault: } case 496: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6444 + //line php5/php5.y:6449 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -9035,7 +9040,7 @@ yydefault: } case 497: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6462 + //line php5/php5.y:6467 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -9051,13 +9056,13 @@ yydefault: // save comments addMeta(variable, yyDollar[1].token.Meta, meta.VariableToken) addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.ObjectOperatorToken) - addMeta(fetch, yyDollar[3].token.Meta, meta.StringToken) + addMeta(fetch, yyDollar[3].token.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 498: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6482 + //line php5/php5.y:6487 { yyVAL.node = expr.NewVariable(yyDollar[2].node) @@ -9072,7 +9077,7 @@ yydefault: } case 499: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6495 + //line php5/php5.y:6500 { name := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = expr.NewVariable(name) @@ -9083,14 +9088,14 @@ yydefault: // save comments addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.DollarOpenCurlyBracesToken) - addMeta(name, yyDollar[2].token.Meta, meta.StringVarnameToken) + addMeta(name, yyDollar[2].token.Meta, meta.IdentifierToken) addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 500: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:6511 + //line php5/php5.y:6516 { identifier := node.NewIdentifier(yyDollar[2].token.Value) variable := expr.NewVariable(identifier) @@ -9112,7 +9117,7 @@ yydefault: } case 501: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6531 + //line php5/php5.y:6536 { yyVAL.node = yyDollar[2].node @@ -9120,7 +9125,7 @@ yydefault: } case 502: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6540 + //line php5/php5.y:6545 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) @@ -9134,7 +9139,7 @@ yydefault: } case 503: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6552 + //line php5/php5.y:6557 { // TODO: add option to handle 64 bit integer if _, err := strconv.Atoi(yyDollar[1].token.Value); err == nil { @@ -9153,7 +9158,7 @@ yydefault: } case 504: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6569 + //line php5/php5.y:6574 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(identifier) @@ -9169,7 +9174,7 @@ yydefault: } case 505: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6586 + //line php5/php5.y:6591 { yyVAL.node = expr.NewIsset(yyDollar[3].list) @@ -9185,7 +9190,7 @@ yydefault: } case 506: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6600 + //line php5/php5.y:6605 { yyVAL.node = expr.NewEmpty(yyDollar[3].node) @@ -9201,7 +9206,7 @@ yydefault: } case 507: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6614 + //line php5/php5.y:6619 { yyVAL.node = expr.NewEmpty(yyDollar[3].node) @@ -9217,7 +9222,7 @@ yydefault: } case 508: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6628 + //line php5/php5.y:6633 { yyVAL.node = expr.NewInclude(yyDollar[2].node) @@ -9231,7 +9236,7 @@ yydefault: } case 509: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6640 + //line php5/php5.y:6645 { yyVAL.node = expr.NewIncludeOnce(yyDollar[2].node) @@ -9245,7 +9250,7 @@ yydefault: } case 510: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6652 + //line php5/php5.y:6657 { yyVAL.node = expr.NewEval(yyDollar[3].node) @@ -9261,7 +9266,7 @@ yydefault: } case 511: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6666 + //line php5/php5.y:6671 { yyVAL.node = expr.NewRequire(yyDollar[2].node) @@ -9275,7 +9280,7 @@ yydefault: } case 512: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6678 + //line php5/php5.y:6683 { yyVAL.node = expr.NewRequireOnce(yyDollar[2].node) @@ -9289,7 +9294,7 @@ yydefault: } case 513: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6693 + //line php5/php5.y:6698 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -9297,18 +9302,18 @@ yydefault: } case 514: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6699 + //line php5/php5.y:6704 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) + addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 515: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6711 + //line php5/php5.y:6716 { yyVAL.node = yyDollar[1].node @@ -9316,7 +9321,7 @@ yydefault: } case 516: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6717 + //line php5/php5.y:6722 { yyVAL.node = yyDollar[1].node @@ -9324,7 +9329,7 @@ yydefault: } case 517: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6726 + //line php5/php5.y:6731 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -9335,12 +9340,13 @@ yydefault: // save comments addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.PaamayimNekudotayimToken) + addMeta(target, yyDollar[3].token.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 518: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6740 + //line php5/php5.y:6746 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -9351,12 +9357,13 @@ yydefault: // save comments addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.PaamayimNekudotayimToken) + addMeta(target, yyDollar[3].token.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 519: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6757 + //line php5/php5.y:6764 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -9367,12 +9374,13 @@ yydefault: // save comments addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.PaamayimNekudotayimToken) + addMeta(target, yyDollar[3].token.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 520: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6774 + //line php5/php5.y:6782 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -9383,6 +9391,7 @@ yydefault: // save comments addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.PaamayimNekudotayimToken) + addMeta(target, yyDollar[3].token.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php5/php5.y b/php5/php5.y index fa5bc7e..d5c7c38 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -283,6 +283,10 @@ start: yylex.(*Parser).rootNode.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + + if yylex.(*Parser).currentToken.Value == "\xff" { + addMeta(yylex.(*Parser).rootNode, yylex.(*Parser).currentToken.Meta, meta.NodeEnd) + } } ; @@ -443,7 +447,7 @@ top_statement: // save comments addMeta($$, $1.Meta, meta.UseToken) - addMeta(useType, $2.Meta, meta.UseToken) + addMeta(useType, $2.Meta, meta.IdentifierToken) addMeta($$, $4.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -459,7 +463,7 @@ top_statement: // save comments addMeta($$, $1.Meta, meta.UseToken) - addMeta(useType, $2.Meta, meta.UseToken) + addMeta(useType, $2.Meta, meta.IdentifierToken) addMeta($$, $4.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -484,7 +488,7 @@ use_declarations: $$ = append($1, $3) // save comments - addMeta(lastNode($1), $2.Meta, meta.CommaToken) + addMeta(lastNode($1), $2.Meta, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -521,7 +525,7 @@ use_declaration: // save comments addMeta($$, $2.Meta, meta.AsToken) - addMeta(alias, $3.Meta, meta.StringToken) + addMeta(alias, $3.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -553,7 +557,7 @@ use_declaration: // save comments addMeta($$, $1.Meta, meta.NsSeparatorToken) addMeta($$, $3.Meta, meta.AsToken) - addMeta($$, $4.Meta, meta.StringToken) + addMeta(alias, $4.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -565,7 +569,7 @@ use_function_declarations: $$ = append($1, $3) // save comments - addMeta(lastNode($1), $2.Meta, meta.CommaToken) + addMeta(lastNode($1), $2.Meta, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -602,7 +606,7 @@ use_function_declaration: // save comments addMeta($$, $2.Meta, meta.AsToken) - addMeta(alias, $3.Meta, meta.StringToken) + addMeta(alias, $3.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -634,7 +638,7 @@ use_function_declaration: // save comments addMeta($$, $1.Meta, meta.NsSeparatorToken) addMeta($$, $3.Meta, meta.AsToken) - addMeta($$, $4.Meta, meta.StringToken) + addMeta(alias, $4.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -646,7 +650,7 @@ use_const_declarations: $$ = append($1, $3) // save comments - addMeta(lastNode($1), $2.Meta, meta.CommaToken) + addMeta(lastNode($1), $2.Meta, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -683,7 +687,7 @@ use_const_declaration: // save comments addMeta($$, $2.Meta, meta.AsToken) - addMeta(alias, $3.Meta, meta.StringToken) + addMeta(alias, $3.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -715,7 +719,7 @@ use_const_declaration: // save comments addMeta($$, $1.Meta, meta.NsSeparatorToken) addMeta($$, $3.Meta, meta.AsToken) - addMeta($$, $4.Meta, meta.StringToken) + addMeta(alias, $4.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -737,7 +741,7 @@ constant_declaration: // save comments addMeta(lastNode(constList.Consts), $2.Meta, meta.CommaToken) - addMeta(name, $3.Meta, meta.StringToken) + addMeta(name, $3.Meta, meta.IdentifierToken) addMeta(constant, $4.Meta, meta.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -756,7 +760,7 @@ constant_declaration: // save comments addMeta($$, $1.Meta, meta.ConstToken) - addMeta(name, $2.Meta, meta.StringToken) + addMeta(name, $2.Meta, meta.IdentifierToken) addMeta(constant, $3.Meta, meta.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -842,7 +846,7 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - addMeta(label, $1.Meta, meta.StringToken) + addMeta(label, $1.Meta, meta.IdentifierToken) addMeta($$, $2.Meta, meta.ColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -1302,7 +1306,7 @@ unticked_statement: // save comments addMeta($$, $1.Meta, meta.GotoToken) - addMeta(label, $2.Meta, meta.StringToken) + addMeta(label, $2.Meta, meta.IdentifierToken) addMeta($$, $3.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -1331,7 +1335,7 @@ catch_statement: // save comments addMeta(catch, $1.Meta, meta.CatchToken) addMeta(catch, $2.Meta, meta.OpenParenthesisToken) - addMeta(variable, $4.Meta, meta.StringToken) + addMeta(variable, $4.Meta, meta.VariableToken) addMeta(catch, $5.Meta, meta.CloseParenthesisToken) addMeta(catch, $6.Meta, meta.OpenCurlyBracesToken) addMeta(catch, $8.Meta, meta.CloseCurlyBracesToken) @@ -1408,7 +1412,7 @@ additional_catch: // save comments addMeta($$, $1.Meta, meta.CatchToken) addMeta($$, $2.Meta, meta.OpenParenthesisToken) - addMeta(variable, $4.Meta, meta.StringToken) + addMeta(variable, $4.Meta, meta.VariableToken) addMeta($$, $5.Meta, meta.CloseParenthesisToken) addMeta($$, $6.Meta, meta.OpenCurlyBracesToken) addMeta($$, $8.Meta, meta.CloseCurlyBracesToken) @@ -1429,7 +1433,7 @@ unset_variables: $$ = append($1, $3) // save comments - addMeta(lastNode($1), $2.Meta, meta.CommaToken) + addMeta(lastNode($1), $2.Meta, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1499,7 +1503,7 @@ unticked_function_declaration_statement: if $2 != nil { addMeta($$, $2.Meta, meta.AmpersandToken) } - addMeta(name, $3.Meta, meta.StringToken) + addMeta(name, $3.Meta, meta.IdentifierToken) addMeta($$, $4.Meta, meta.OpenParenthesisToken) addMeta($$, $6.Meta, meta.CloseParenthesisToken) addMeta($$, $7.Meta, meta.OpenCurlyBracesToken) @@ -1532,7 +1536,7 @@ unticked_class_declaration_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $7)) // save comments - addMeta(name, $2.Meta, meta.StringToken) + addMeta(name, $2.Meta, meta.IdentifierToken) addMeta($$, $5.Meta, meta.OpenCurlyBracesToken) addMeta($$, $7.Meta, meta.CloseCurlyBracesToken) @@ -1548,7 +1552,7 @@ unticked_class_declaration_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $6)) // save comments - addMeta(name, $2.Meta, meta.StringToken) + addMeta(name, $2.Meta, meta.IdentifierToken) addMeta($$, $4.Meta, meta.OpenCurlyBracesToken) addMeta($$, $6.Meta, meta.CloseCurlyBracesToken) @@ -1580,7 +1584,7 @@ class_entry_type: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - addMeta(classModifier, $1.Meta, meta.AbstractToken) + addMeta(classModifier, $1.Meta, meta.IdentifierToken) addMeta($$, $2.Meta, meta.ClassToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -1607,7 +1611,7 @@ class_entry_type: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - addMeta(classModifier, $1.Meta, meta.FinalToken) + addMeta(classModifier, $1.Meta, meta.IdentifierToken) addMeta($$, $2.Meta, meta.ClassToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -1696,7 +1700,7 @@ interface_list: $$ = append($1, $3) // save comments - addMeta(lastNode($1), $2.Meta, meta.CommaToken) + addMeta(lastNode($1), $2.Meta, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1848,7 +1852,7 @@ declare_list: constant.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) // save comments - addMeta(name, $1.Meta, meta.StringToken) + addMeta(name, $1.Meta, meta.IdentifierToken) addMeta(constant, $2.Meta, meta.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -1865,7 +1869,7 @@ declare_list: // save comments addMeta(lastNode($1), $2.Meta, meta.CommaToken) - addMeta(name, $3.Meta, meta.StringToken) + addMeta(name, $3.Meta, meta.IdentifierToken) addMeta(constant, $4.Meta, meta.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -1915,8 +1919,8 @@ switch_case_list: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - addMeta(caseList, $1.Meta, meta.ColonToken) - addMeta(caseList, $3.Meta, meta.EndswitchToken) + addMeta($$, $1.Meta, meta.ColonToken) + addMeta($$, $3.Meta, meta.EndswitchToken) addMeta($$, $4.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -1932,9 +1936,9 @@ switch_case_list: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5)) // save comments - addMeta(caseList, $1.Meta, meta.ColonToken) - addMeta(caseList, $2.Meta, meta.SemiColonToken) - addMeta(caseList, $4.Meta, meta.EndswitchToken) + addMeta($$, $1.Meta, meta.ColonToken) + addMeta($$, $2.Meta, meta.SwitchSemicolonToken) + addMeta($$, $4.Meta, meta.EndswitchToken) addMeta($$, $5.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -2145,7 +2149,7 @@ non_empty_parameter_list: $$ = append($1, $3) // save comments - addMeta(lastNode($1), $2.Meta, meta.CommaToken) + addMeta(lastNode($1), $2.Meta, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2231,7 +2235,7 @@ optional_class_type: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.ArrayToken) + addMeta($$, $1.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2243,7 +2247,7 @@ optional_class_type: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.CallableToken) + addMeta($$, $1.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2313,7 +2317,7 @@ non_empty_function_call_parameter_list: $$ = append($1, $3) // save comments - addMeta(lastNode($1), $2.Meta, meta.CommaToken) + addMeta(lastNode($1), $2.Meta, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2370,7 +2374,7 @@ global_var_list: $$ = append($1, $3) // save comments - addMeta(lastNode($1), $2.Meta, meta.CommaToken) + addMeta(lastNode($1), $2.Meta, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2579,14 +2583,7 @@ class_statement: trait_use_statement: T_USE trait_list trait_adaptations { - var adaptationList *stmt.TraitAdaptationList - switch n := $3.(type) { - case *stmt.TraitAdaptationList: - adaptationList = n - default: - adaptationList = nil - } - $$ = stmt.NewTraitUse($2, adaptationList) + $$ = stmt.NewTraitUse($2, $3) // save position $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) @@ -2610,7 +2607,7 @@ trait_list: $$ = append($1, $3) // save comments - addMeta(lastNode($1), $2.Meta, meta.CommaToken) + addMeta(lastNode($1), $2.Meta, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2721,7 +2718,7 @@ trait_reference_list: $$ = append($1, $3) // save comments - addMeta(lastNode($1), $2.Meta, meta.CommaToken) + addMeta(lastNode($1), $2.Meta, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2857,7 +2854,7 @@ variable_modifiers: modifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta(modifier, $1.Meta, meta.VarToken) + addMeta(modifier, $1.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2902,7 +2899,7 @@ member_modifier: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.PublicToken) + addMeta($$, $1.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2914,7 +2911,7 @@ member_modifier: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.ProtectedToken) + addMeta($$, $1.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2926,7 +2923,7 @@ member_modifier: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.PrivateToken) + addMeta($$, $1.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2938,7 +2935,7 @@ member_modifier: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.StaticToken) + addMeta($$, $1.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2950,7 +2947,7 @@ member_modifier: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.AbstractToken) + addMeta($$, $1.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2962,7 +2959,7 @@ member_modifier: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.FinalToken) + addMeta($$, $1.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3090,7 +3087,7 @@ echo_expr_list: $$ = append($1, $3) // save comments - addMeta(lastNode($1), $2.Meta, meta.CommaToken) + addMeta(lastNode($1), $2.Meta, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3124,7 +3121,7 @@ non_empty_for_expr: $$ = append($1, $3) // save comments - addMeta(lastNode($1), $2.Meta, meta.CommaToken) + addMeta(lastNode($1), $2.Meta, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4507,7 +4504,7 @@ class_name: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.StaticToken) + addMeta($$, $1.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4786,7 +4783,7 @@ common_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.LineToken) + addMeta($$, $1.Meta, meta.MagicConstantToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4798,7 +4795,7 @@ common_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.FileToken) + addMeta($$, $1.Meta, meta.MagicConstantToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4810,7 +4807,7 @@ common_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.DirToken) + addMeta($$, $1.Meta, meta.MagicConstantToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4822,7 +4819,7 @@ common_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.TraitCToken) + addMeta($$, $1.Meta, meta.MagicConstantToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4834,7 +4831,7 @@ common_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.MethodCToken) + addMeta($$, $1.Meta, meta.MagicConstantToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4846,7 +4843,7 @@ common_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.FuncCToken) + addMeta($$, $1.Meta, meta.MagicConstantToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4858,7 +4855,7 @@ common_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.NsCToken) + addMeta($$, $1.Meta, meta.MagicConstantToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4951,8 +4948,8 @@ static_scalar_value: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3)) // save comments - addMeta($$, $1.Meta, meta.NamespaceToken) - addMeta($$, $2.Meta, meta.NsSeparatorToken) + addMeta(name, $1.Meta, meta.NamespaceToken) + addMeta(name, $2.Meta, meta.NsSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4966,7 +4963,7 @@ static_scalar_value: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) // save comments - addMeta($$, $1.Meta, meta.NsSeparatorToken) + addMeta(name, $1.Meta, meta.NsSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5011,7 +5008,7 @@ static_scalar_value: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.ClassCToken) + addMeta($$, $1.Meta, meta.MagicConstantToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5449,8 +5446,8 @@ general_constant: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(name)) // save comments - addMeta($$, $1.Meta, meta.NamespaceToken) - addMeta($$, $2.Meta, meta.NsSeparatorToken) + addMeta(name, $1.Meta, meta.NamespaceToken) + addMeta(name, $2.Meta, meta.NsSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5464,7 +5461,7 @@ general_constant: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(name)) // save comments - addMeta($$, $1.Meta, meta.NsSeparatorToken) + addMeta(name, $1.Meta, meta.NsSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5481,7 +5478,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta(name, $1.Meta, meta.StringVarnameToken) + addMeta(name, $1.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5535,7 +5532,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.ClassCToken) + addMeta($$, $1.Meta, meta.MagicConstantToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5643,13 +5640,21 @@ expr: parenthesis_expr: '(' expr ')' { - $$ = $2 + $$ = $2 + + // save comments + addMeta($$, $1.Meta, meta.OpenParenthesisToken) + addMeta($$, $3.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | '(' yield_expr ')' { - $$ = $2 + $$ = $2 + + // save comments + addMeta($$, $1.Meta, meta.OpenParenthesisToken) + addMeta($$, $3.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6129,7 +6134,7 @@ variable_name: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.StringToken) + addMeta($$, $1.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6191,7 +6196,7 @@ assignment_list: $$ = append($1, $3) // save comments - addMeta(lastNode($1), $2.Meta, meta.CommaToken) + addMeta(lastNode($1), $2.Meta, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6474,7 +6479,7 @@ encaps_var: // save comments addMeta(variable, $1.Meta, meta.VariableToken) addMeta($$, $2.Meta, meta.ObjectOperatorToken) - addMeta(fetch, $3.Meta, meta.StringToken) + addMeta(fetch, $3.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6502,7 +6507,7 @@ encaps_var: // save comments addMeta($$, $1.Meta, meta.DollarOpenCurlyBracesToken) - addMeta(name, $2.Meta, meta.StringVarnameToken) + addMeta(name, $2.Meta, meta.IdentifierToken) addMeta($$, $3.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -6700,7 +6705,7 @@ isset_variables: $$ = append($1, $3) // save comments - addMeta(lastNode($1), $2.Meta, meta.CommaToken) + addMeta(lastNode($1), $2.Meta, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6733,6 +6738,7 @@ class_constant: // save comments addMeta($$, $2.Meta, meta.PaamayimNekudotayimToken) + addMeta(target, $3.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6747,6 +6753,7 @@ class_constant: // save comments addMeta($$, $2.Meta, meta.PaamayimNekudotayimToken) + addMeta(target, $3.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6764,6 +6771,7 @@ static_class_name_scalar: // save comments addMeta($$, $2.Meta, meta.PaamayimNekudotayimToken) + addMeta(target, $3.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6781,6 +6789,7 @@ class_name_scalar: // save comments addMeta($$, $2.Meta, meta.PaamayimNekudotayimToken) + addMeta(target, $3.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php5/php5_test.go b/php5/php5_test.go index 4a6d106..6e47f41 100644 --- a/php5/php5_test.go +++ b/php5/php5_test.go @@ -470,8 +470,8 @@ func TestPhp5(t *testing.T) { StartPos: 10, EndPos: 11, }, - IsReference: false, Variadic: false, + IsReference: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 2, @@ -497,8 +497,8 @@ func TestPhp5(t *testing.T) { StartPos: 14, EndPos: 18, }, - IsReference: false, Variadic: true, + IsReference: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 2, @@ -567,8 +567,8 @@ func TestPhp5(t *testing.T) { StartPos: 29, EndPos: 30, }, - Variadic: false, IsReference: false, + Variadic: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 3, @@ -700,8 +700,8 @@ func TestPhp5(t *testing.T) { StartPos: 57, EndPos: 61, }, - Variadic: true, IsReference: false, + Variadic: true, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 4, @@ -887,8 +887,8 @@ func TestPhp5(t *testing.T) { StartPos: 100, EndPos: 101, }, - IsReference: false, Variadic: false, + IsReference: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 6, @@ -914,8 +914,8 @@ func TestPhp5(t *testing.T) { StartPos: 104, EndPos: 108, }, - Variadic: true, IsReference: false, + Variadic: true, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 6, @@ -1044,8 +1044,8 @@ func TestPhp5(t *testing.T) { StartPos: 137, EndPos: 180, }, - ReturnsRef: false, PhpDocComment: "", + ReturnsRef: false, FunctionName: &node.Identifier{ Position: &position.Position{ StartLine: 9, @@ -1383,8 +1383,8 @@ func TestPhp5(t *testing.T) { StartPos: 259, EndPos: 271, }, - ByRef: false, Variadic: false, + ByRef: false, VariableType: &name.Name{ Position: &position.Position{ StartLine: 11, @@ -1513,9 +1513,9 @@ func TestPhp5(t *testing.T) { StartPos: 294, EndPos: 340, }, + ReturnsRef: false, Static: true, PhpDocComment: "", - ReturnsRef: false, Params: []node.Node{ &node.Parameter{ Position: &position.Position{ @@ -4624,8 +4624,8 @@ func TestPhp5(t *testing.T) { StartPos: 2104, EndPos: 2120, }, - PhpDocComment: "", ReturnsRef: false, + PhpDocComment: "", FunctionName: &node.Identifier{ Position: &position.Position{ StartLine: 90, @@ -6441,6 +6441,14 @@ func TestPhp5(t *testing.T) { }, }, }, + TraitAdaptationList: &stmt.Nop{ + Position: &position.Position{ + StartLine: 142, + EndLine: 142, + StartPos: 3077, + EndPos: 3077, + }, + }, }, }, }, @@ -8626,9 +8634,9 @@ func TestPhp5(t *testing.T) { StartPos: 3963, EndPos: 3995, }, - ReturnsRef: false, Static: false, PhpDocComment: "", + ReturnsRef: false, Params: []node.Node{ &node.Parameter{ Position: &position.Position{ diff --git a/php7/php7.go b/php7/php7.go index 5109b8c..0c348de 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -18,9 +18,11 @@ import ( "github.com/z7zmey/php-parser/node/scalar" "github.com/z7zmey/php-parser/node/stmt" "github.com/z7zmey/php-parser/scanner" + + "github.com/davecgh/go-spew/spew" ) -//line php7/php7.y:22 +//line php7/php7.y:24 type yySymType struct { yys int node node.Node @@ -346,7 +348,7 @@ const yyEofCode = 1 const yyErrCode = 2 const yyInitialStackSize = 16 -//line php7/php7.y:5345 +//line php7/php7.y:5343 //line yacctab:1 var yyExca = [...]int{ @@ -2114,7 +2116,7 @@ yydefault: case 1: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:300 + //line php7/php7.y:302 { yylex.(*Parser).rootNode = node.NewRoot(yyDollar[1].list) @@ -2122,466 +2124,470 @@ yydefault: yylex.(*Parser).rootNode.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + + if yylex.(*Parser).currentToken.Value == "\xff" { + addMeta(yylex.(*Parser).rootNode, yylex.(*Parser).currentToken.Meta, meta.NodeEnd) + } } case 2: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:311 + //line php7/php7.y:317 { yyVAL.token = yyDollar[1].token } case 3: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:311 + //line php7/php7.y:317 { yyVAL.token = yyDollar[1].token } case 4: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:311 + //line php7/php7.y:317 { yyVAL.token = yyDollar[1].token } case 5: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:311 + //line php7/php7.y:317 { yyVAL.token = yyDollar[1].token } case 6: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:311 + //line php7/php7.y:317 { yyVAL.token = yyDollar[1].token } case 7: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:311 + //line php7/php7.y:317 { yyVAL.token = yyDollar[1].token } case 8: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:311 + //line php7/php7.y:317 { yyVAL.token = yyDollar[1].token } case 9: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:311 + //line php7/php7.y:317 { yyVAL.token = yyDollar[1].token } case 10: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:312 + //line php7/php7.y:318 { yyVAL.token = yyDollar[1].token } case 11: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:312 + //line php7/php7.y:318 { yyVAL.token = yyDollar[1].token } case 12: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:312 + //line php7/php7.y:318 { yyVAL.token = yyDollar[1].token } case 13: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:312 + //line php7/php7.y:318 { yyVAL.token = yyDollar[1].token } case 14: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:312 + //line php7/php7.y:318 { yyVAL.token = yyDollar[1].token } case 15: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:312 + //line php7/php7.y:318 { yyVAL.token = yyDollar[1].token } case 16: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:312 + //line php7/php7.y:318 { yyVAL.token = yyDollar[1].token } case 17: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:312 + //line php7/php7.y:318 { yyVAL.token = yyDollar[1].token } case 18: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:312 + //line php7/php7.y:318 { yyVAL.token = yyDollar[1].token } case 19: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:312 + //line php7/php7.y:318 { yyVAL.token = yyDollar[1].token } case 20: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:312 + //line php7/php7.y:318 { yyVAL.token = yyDollar[1].token } case 21: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:312 + //line php7/php7.y:318 { yyVAL.token = yyDollar[1].token } case 22: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:313 + //line php7/php7.y:319 { yyVAL.token = yyDollar[1].token } case 23: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:313 + //line php7/php7.y:319 { yyVAL.token = yyDollar[1].token } case 24: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:313 + //line php7/php7.y:319 { yyVAL.token = yyDollar[1].token } case 25: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:313 + //line php7/php7.y:319 { yyVAL.token = yyDollar[1].token } case 26: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:313 + //line php7/php7.y:319 { yyVAL.token = yyDollar[1].token } case 27: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:313 + //line php7/php7.y:319 { yyVAL.token = yyDollar[1].token } case 28: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:313 + //line php7/php7.y:319 { yyVAL.token = yyDollar[1].token } case 29: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:313 + //line php7/php7.y:319 { yyVAL.token = yyDollar[1].token } case 30: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:313 + //line php7/php7.y:319 { yyVAL.token = yyDollar[1].token } case 31: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:313 + //line php7/php7.y:319 { yyVAL.token = yyDollar[1].token } case 32: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:314 + //line php7/php7.y:320 { yyVAL.token = yyDollar[1].token } case 33: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:314 + //line php7/php7.y:320 { yyVAL.token = yyDollar[1].token } case 34: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:314 + //line php7/php7.y:320 { yyVAL.token = yyDollar[1].token } case 35: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:314 + //line php7/php7.y:320 { yyVAL.token = yyDollar[1].token } case 36: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:314 + //line php7/php7.y:320 { yyVAL.token = yyDollar[1].token } case 37: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:314 + //line php7/php7.y:320 { yyVAL.token = yyDollar[1].token } case 38: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:314 + //line php7/php7.y:320 { yyVAL.token = yyDollar[1].token } case 39: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:314 + //line php7/php7.y:320 { yyVAL.token = yyDollar[1].token } case 40: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:314 + //line php7/php7.y:320 { yyVAL.token = yyDollar[1].token } case 41: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:314 + //line php7/php7.y:320 { yyVAL.token = yyDollar[1].token } case 42: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:315 + //line php7/php7.y:321 { yyVAL.token = yyDollar[1].token } case 43: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:315 + //line php7/php7.y:321 { yyVAL.token = yyDollar[1].token } case 44: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:315 + //line php7/php7.y:321 { yyVAL.token = yyDollar[1].token } case 45: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:315 + //line php7/php7.y:321 { yyVAL.token = yyDollar[1].token } case 46: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:315 + //line php7/php7.y:321 { yyVAL.token = yyDollar[1].token } case 47: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:315 + //line php7/php7.y:321 { yyVAL.token = yyDollar[1].token } case 48: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:315 + //line php7/php7.y:321 { yyVAL.token = yyDollar[1].token } case 49: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:315 + //line php7/php7.y:321 { yyVAL.token = yyDollar[1].token } case 50: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:315 + //line php7/php7.y:321 { yyVAL.token = yyDollar[1].token } case 51: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:315 + //line php7/php7.y:321 { yyVAL.token = yyDollar[1].token } case 52: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:315 + //line php7/php7.y:321 { yyVAL.token = yyDollar[1].token } case 53: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:316 + //line php7/php7.y:322 { yyVAL.token = yyDollar[1].token } case 54: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:316 + //line php7/php7.y:322 { yyVAL.token = yyDollar[1].token } case 55: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:316 + //line php7/php7.y:322 { yyVAL.token = yyDollar[1].token } case 56: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:316 + //line php7/php7.y:322 { yyVAL.token = yyDollar[1].token } case 57: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:316 + //line php7/php7.y:322 { yyVAL.token = yyDollar[1].token } case 58: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:316 + //line php7/php7.y:322 { yyVAL.token = yyDollar[1].token } case 59: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:316 + //line php7/php7.y:322 { yyVAL.token = yyDollar[1].token } case 60: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:316 + //line php7/php7.y:322 { yyVAL.token = yyDollar[1].token } case 61: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:317 + //line php7/php7.y:323 { yyVAL.token = yyDollar[1].token } case 62: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:317 + //line php7/php7.y:323 { yyVAL.token = yyDollar[1].token } case 63: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:317 + //line php7/php7.y:323 { yyVAL.token = yyDollar[1].token } case 64: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:317 + //line php7/php7.y:323 { yyVAL.token = yyDollar[1].token } case 65: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:317 + //line php7/php7.y:323 { yyVAL.token = yyDollar[1].token } case 66: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:317 + //line php7/php7.y:323 { yyVAL.token = yyDollar[1].token } case 67: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:317 + //line php7/php7.y:323 { yyVAL.token = yyDollar[1].token } case 68: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:317 + //line php7/php7.y:323 { yyVAL.token = yyDollar[1].token } case 69: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:322 + //line php7/php7.y:328 { yyVAL.token = yyDollar[1].token } case 70: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:325 + //line php7/php7.y:331 { yyVAL.token = yyDollar[1].token } case 71: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:325 + //line php7/php7.y:331 { yyVAL.token = yyDollar[1].token } case 72: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:325 + //line php7/php7.y:331 { yyVAL.token = yyDollar[1].token } case 73: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:325 + //line php7/php7.y:331 { yyVAL.token = yyDollar[1].token } case 74: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:325 + //line php7/php7.y:331 { yyVAL.token = yyDollar[1].token } case 75: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:325 + //line php7/php7.y:331 { yyVAL.token = yyDollar[1].token } case 76: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:330 + //line php7/php7.y:336 { yyVAL.token = yyDollar[1].token } case 77: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:334 + //line php7/php7.y:340 { yyVAL.token = yyDollar[1].token } case 78: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:341 + //line php7/php7.y:347 { if yyDollar[2].node != nil { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -2591,7 +2597,7 @@ yydefault: } case 79: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:349 + //line php7/php7.y:355 { yyVAL.list = []node.Node{} @@ -2599,7 +2605,7 @@ yydefault: } case 80: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:358 + //line php7/php7.y:364 { namePart := name.NewNamePart(yyDollar[1].token.Value) yyVAL.list = []node.Node{namePart} @@ -2614,7 +2620,7 @@ yydefault: } case 81: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:371 + //line php7/php7.y:377 { namePart := name.NewNamePart(yyDollar[3].token.Value) yyVAL.list = append(yyDollar[1].list, namePart) @@ -2630,7 +2636,7 @@ yydefault: } case 82: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:388 + //line php7/php7.y:394 { yyVAL.node = name.NewName(yyDollar[1].list) @@ -2641,7 +2647,7 @@ yydefault: } case 83: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:397 + //line php7/php7.y:403 { yyVAL.node = name.NewRelative(yyDollar[3].list) @@ -2656,7 +2662,7 @@ yydefault: } case 84: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:410 + //line php7/php7.y:416 { yyVAL.node = name.NewFullyQualified(yyDollar[2].list) @@ -2670,7 +2676,7 @@ yydefault: } case 85: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:425 + //line php7/php7.y:431 { // error yyVAL.node = nil @@ -2679,7 +2685,7 @@ yydefault: } case 86: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:432 + //line php7/php7.y:438 { yyVAL.node = yyDollar[1].node @@ -2687,7 +2693,7 @@ yydefault: } case 87: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:438 + //line php7/php7.y:444 { yyVAL.node = yyDollar[1].node @@ -2695,7 +2701,7 @@ yydefault: } case 88: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:444 + //line php7/php7.y:450 { yyVAL.node = yyDollar[1].node @@ -2703,7 +2709,7 @@ yydefault: } case 89: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:450 + //line php7/php7.y:456 { yyVAL.node = yyDollar[1].node @@ -2711,7 +2717,7 @@ yydefault: } case 90: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:456 + //line php7/php7.y:462 { yyVAL.node = yyDollar[1].node @@ -2719,7 +2725,7 @@ yydefault: } case 91: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:462 + //line php7/php7.y:468 { yyVAL.node = stmt.NewHaltCompiler() @@ -2736,7 +2742,7 @@ yydefault: } case 92: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:477 + //line php7/php7.y:483 { name := name.NewName(yyDollar[2].list) yyVAL.node = stmt.NewNamespace(name, nil) @@ -2753,7 +2759,7 @@ yydefault: } case 93: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:492 + //line php7/php7.y:498 { name := name.NewName(yyDollar[2].list) yyVAL.node = stmt.NewNamespace(name, yyDollar[4].list) @@ -2771,7 +2777,7 @@ yydefault: } case 94: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:508 + //line php7/php7.y:514 { yyVAL.node = stmt.NewNamespace(nil, yyDollar[3].list) @@ -2787,7 +2793,7 @@ yydefault: } case 95: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:522 + //line php7/php7.y:528 { yyVAL.node = yyDollar[2].node @@ -2802,7 +2808,7 @@ yydefault: } case 96: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:535 + //line php7/php7.y:541 { yyVAL.node = yyDollar[3].node.(*stmt.GroupUse).SetUseType(yyDollar[2].node) @@ -2817,7 +2823,7 @@ yydefault: } case 97: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:548 + //line php7/php7.y:554 { yyVAL.node = stmt.NewUseList(nil, yyDollar[2].list) @@ -2832,7 +2838,7 @@ yydefault: } case 98: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:561 + //line php7/php7.y:567 { yyVAL.node = stmt.NewUseList(yyDollar[2].node, yyDollar[3].list) @@ -2847,7 +2853,7 @@ yydefault: } case 99: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:574 + //line php7/php7.y:580 { yyVAL.node = stmt.NewConstList(yyDollar[2].list) @@ -2862,7 +2868,7 @@ yydefault: } case 100: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:590 + //line php7/php7.y:596 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -2870,13 +2876,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.FunctionToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 101: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:602 + //line php7/php7.y:608 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -2884,13 +2890,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ConstToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 102: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:617 + //line php7/php7.y:623 { name := name.NewName(yyDollar[1].list) yyVAL.node = stmt.NewGroupUse(nil, name, yyDollar[4].list) @@ -2911,7 +2917,7 @@ yydefault: } case 103: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:636 + //line php7/php7.y:642 { name := name.NewName(yyDollar[2].list) yyVAL.node = stmt.NewGroupUse(nil, name, yyDollar[5].list) @@ -2933,7 +2939,7 @@ yydefault: } case 104: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:659 + //line php7/php7.y:665 { name := name.NewName(yyDollar[1].list) yyVAL.node = stmt.NewGroupUse(nil, name, yyDollar[4].list) @@ -2954,7 +2960,7 @@ yydefault: } case 105: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:678 + //line php7/php7.y:684 { name := name.NewName(yyDollar[2].list) yyVAL.node = stmt.NewGroupUse(nil, name, yyDollar[5].list) @@ -2976,30 +2982,30 @@ yydefault: } case 106: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:701 + //line php7/php7.y:707 { yyVAL.token = nil } case 107: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:705 + //line php7/php7.y:711 { yyVAL.token = yyDollar[1].token } case 108: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:712 + //line php7/php7.y:718 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) + addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 109: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:721 + //line php7/php7.y:727 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -3007,18 +3013,18 @@ yydefault: } case 110: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:730 + //line php7/php7.y:736 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) + addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 111: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:739 + //line php7/php7.y:745 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -3026,18 +3032,18 @@ yydefault: } case 112: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:748 + //line php7/php7.y:754 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) + addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 113: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:757 + //line php7/php7.y:763 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -3045,7 +3051,7 @@ yydefault: } case 114: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:766 + //line php7/php7.y:772 { yyVAL.node = yyDollar[1].node @@ -3053,7 +3059,7 @@ yydefault: } case 115: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:772 + //line php7/php7.y:778 { yyVAL.node = yyDollar[2].node.(*stmt.Use).SetUseType(yyDollar[1].node) @@ -3061,7 +3067,7 @@ yydefault: } case 116: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:781 + //line php7/php7.y:787 { name := name.NewName(yyDollar[1].list) yyVAL.node = stmt.NewUse(nil, name, nil) @@ -3074,7 +3080,7 @@ yydefault: } case 117: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:792 + //line php7/php7.y:798 { name := name.NewName(yyDollar[1].list) alias := node.NewIdentifier(yyDollar[3].token.Value) @@ -3087,13 +3093,13 @@ yydefault: // save comments addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.AsToken) - addMeta(alias, yyDollar[3].token.Meta, meta.StringToken) + addMeta(alias, yyDollar[3].token.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 118: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:812 + //line php7/php7.y:818 { yyVAL.node = yyDollar[1].node @@ -3101,7 +3107,7 @@ yydefault: } case 119: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:818 + //line php7/php7.y:824 { yyVAL.node = yyDollar[2].node @@ -3112,18 +3118,18 @@ yydefault: } case 120: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:830 + //line php7/php7.y:836 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) + addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 121: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:839 + //line php7/php7.y:845 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -3131,7 +3137,7 @@ yydefault: } case 122: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:848 + //line php7/php7.y:854 { if yyDollar[2].node != nil { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -3141,7 +3147,7 @@ yydefault: } case 123: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:856 + //line php7/php7.y:862 { yyVAL.list = []node.Node{} @@ -3149,7 +3155,7 @@ yydefault: } case 124: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:865 + //line php7/php7.y:871 { // error yyVAL.node = nil @@ -3158,7 +3164,7 @@ yydefault: } case 125: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:872 + //line php7/php7.y:878 { yyVAL.node = yyDollar[1].node @@ -3166,7 +3172,7 @@ yydefault: } case 126: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:878 + //line php7/php7.y:884 { yyVAL.node = yyDollar[1].node @@ -3174,7 +3180,7 @@ yydefault: } case 127: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:884 + //line php7/php7.y:890 { yyVAL.node = yyDollar[1].node @@ -3182,7 +3188,7 @@ yydefault: } case 128: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:890 + //line php7/php7.y:896 { yyVAL.node = yyDollar[1].node @@ -3190,7 +3196,7 @@ yydefault: } case 129: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:896 + //line php7/php7.y:902 { yyVAL.node = yyDollar[1].node @@ -3198,7 +3204,7 @@ yydefault: } case 130: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:902 + //line php7/php7.y:908 { yyVAL.node = stmt.NewHaltCompiler() @@ -3215,7 +3221,7 @@ yydefault: } case 131: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:919 + //line php7/php7.y:925 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) @@ -3230,7 +3236,7 @@ yydefault: } case 132: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:932 + //line php7/php7.y:938 { yyVAL.node = yyDollar[1].node @@ -3238,7 +3244,7 @@ yydefault: } case 133: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:938 + //line php7/php7.y:944 { yyVAL.node = yyDollar[1].node @@ -3246,7 +3252,7 @@ yydefault: } case 134: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:944 + //line php7/php7.y:950 { switch n := yyDollar[5].node.(type) { case *stmt.While: @@ -3269,7 +3275,7 @@ yydefault: } case 135: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:965 + //line php7/php7.y:971 { yyVAL.node = stmt.NewDo(yyDollar[2].node, yyDollar[5].node) @@ -3287,7 +3293,7 @@ yydefault: } case 136: yyDollar = yyS[yypt-9 : yypt+1] - //line php7/php7.y:981 + //line php7/php7.y:987 { switch n := yyDollar[9].node.(type) { case *stmt.For: @@ -3316,7 +3322,7 @@ yydefault: } case 137: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:1008 + //line php7/php7.y:1014 { switch n := yyDollar[5].node.(type) { case *stmt.Switch: @@ -3341,7 +3347,7 @@ yydefault: } case 138: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1031 + //line php7/php7.y:1037 { yyVAL.node = stmt.NewBreak(yyDollar[2].node) @@ -3356,7 +3362,7 @@ yydefault: } case 139: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1044 + //line php7/php7.y:1050 { yyVAL.node = stmt.NewContinue(yyDollar[2].node) @@ -3371,7 +3377,7 @@ yydefault: } case 140: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1057 + //line php7/php7.y:1063 { yyVAL.node = stmt.NewReturn(yyDollar[2].node) @@ -3386,7 +3392,7 @@ yydefault: } case 141: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1070 + //line php7/php7.y:1076 { yyVAL.node = stmt.NewGlobal(yyDollar[2].list) @@ -3401,7 +3407,7 @@ yydefault: } case 142: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1083 + //line php7/php7.y:1089 { yyVAL.node = stmt.NewStatic(yyDollar[2].list) @@ -3416,7 +3422,7 @@ yydefault: } case 143: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1096 + //line php7/php7.y:1102 { yyVAL.node = stmt.NewEcho(yyDollar[2].list) @@ -3431,7 +3437,7 @@ yydefault: } case 144: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1109 + //line php7/php7.y:1115 { yyVAL.node = stmt.NewInlineHtml(yyDollar[1].token.Value) @@ -3445,7 +3451,7 @@ yydefault: } case 145: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1121 + //line php7/php7.y:1127 { yyVAL.node = stmt.NewExpression(yyDollar[1].node) @@ -3459,7 +3465,7 @@ yydefault: } case 146: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1133 + //line php7/php7.y:1139 { yyVAL.node = stmt.NewUnset(yyDollar[3].list) @@ -3479,7 +3485,7 @@ yydefault: } case 147: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:1151 + //line php7/php7.y:1157 { switch n := yyDollar[7].node.(type) { case *stmt.Foreach: @@ -3505,7 +3511,7 @@ yydefault: } case 148: yyDollar = yyS[yypt-9 : yypt+1] - //line php7/php7.y:1175 + //line php7/php7.y:1181 { switch n := yyDollar[9].node.(type) { case *stmt.Foreach: @@ -3534,7 +3540,7 @@ yydefault: } case 149: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:1202 + //line php7/php7.y:1208 { yyVAL.node = stmt.NewDeclare(yyDollar[3].list, yyDollar[5].node) @@ -3550,7 +3556,7 @@ yydefault: } case 150: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1216 + //line php7/php7.y:1222 { yyVAL.node = stmt.NewNop() @@ -3564,7 +3570,7 @@ yydefault: } case 151: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1228 + //line php7/php7.y:1234 { if yyDollar[6].node == nil { yyVAL.node = stmt.NewTry(yyDollar[3].list, yyDollar[5].list, yyDollar[6].node) @@ -3583,7 +3589,7 @@ yydefault: } case 152: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1245 + //line php7/php7.y:1251 { yyVAL.node = stmt.NewThrow(yyDollar[2].node) @@ -3598,7 +3604,7 @@ yydefault: } case 153: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1258 + //line php7/php7.y:1264 { label := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewGoto(label) @@ -3609,14 +3615,14 @@ yydefault: // save comments addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.GotoToken) - addMeta(label, yyDollar[2].token.Meta, meta.StringToken) + addMeta(label, yyDollar[2].token.Meta, meta.IdentifierToken) addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 154: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1274 + //line php7/php7.y:1280 { label := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewLabel(label) @@ -3626,14 +3632,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - addMeta(label, yyDollar[1].token.Meta, meta.StringToken) + addMeta(label, yyDollar[1].token.Meta, meta.IdentifierToken) addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.ColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 155: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1291 + //line php7/php7.y:1297 { yyVAL.list = []node.Node{} @@ -3641,7 +3647,7 @@ yydefault: } case 156: yyDollar = yyS[yypt-9 : yypt+1] - //line php7/php7.y:1297 + //line php7/php7.y:1303 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[5].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -3656,7 +3662,7 @@ yydefault: // save comments addMeta(catch, yyDollar[2].token.Meta, meta.CatchToken) addMeta(catch, yyDollar[3].token.Meta, meta.OpenParenthesisToken) - addMeta(variable, yyDollar[5].token.Meta, meta.StringToken) + addMeta(variable, yyDollar[5].token.Meta, meta.VariableToken) addMeta(catch, yyDollar[6].token.Meta, meta.CloseParenthesisToken) addMeta(catch, yyDollar[7].token.Meta, meta.OpenCurlyBracesToken) addMeta(catch, yyDollar[9].token.Meta, meta.CloseCurlyBracesToken) @@ -3665,7 +3671,7 @@ yydefault: } case 157: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1321 + //line php7/php7.y:1327 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -3673,18 +3679,18 @@ yydefault: } case 158: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1327 + //line php7/php7.y:1333 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.VerticalBarToken) + addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 159: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1339 + //line php7/php7.y:1345 { yyVAL.node = nil @@ -3692,7 +3698,7 @@ yydefault: } case 160: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1345 + //line php7/php7.y:1351 { yyVAL.node = stmt.NewFinally(yyDollar[3].list) @@ -3708,7 +3714,7 @@ yydefault: } case 161: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1362 + //line php7/php7.y:1368 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -3716,18 +3722,18 @@ yydefault: } case 162: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1368 + //line php7/php7.y:1374 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) + addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 163: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1380 + //line php7/php7.y:1386 { yyVAL.node = yyDollar[1].node @@ -3735,7 +3741,7 @@ yydefault: } case 164: yyDollar = yyS[yypt-11 : yypt+1] - //line php7/php7.y:1389 + //line php7/php7.y:1395 { name := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewFunction(name, yyDollar[2].token != nil, yyDollar[6].list, yyDollar[8].node, yyDollar[10].list, yyDollar[4].str) @@ -3749,7 +3755,7 @@ yydefault: if yyDollar[2].token != nil { addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.AmpersandToken) } - addMeta(name, yyDollar[3].token.Meta, meta.StringToken) + addMeta(name, yyDollar[3].token.Meta, meta.IdentifierToken) addMeta(yyVAL.node, yyDollar[5].token.Meta, meta.OpenParenthesisToken) addMeta(yyVAL.node, yyDollar[7].token.Meta, meta.CloseParenthesisToken) addMeta(yyVAL.node, yyDollar[9].token.Meta, meta.OpenCurlyBracesToken) @@ -3759,31 +3765,31 @@ yydefault: } case 165: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1415 + //line php7/php7.y:1421 { yyVAL.token = nil } case 166: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1419 + //line php7/php7.y:1425 { yyVAL.token = yyDollar[1].token } case 167: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1426 + //line php7/php7.y:1432 { yyVAL.token = nil } case 168: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1430 + //line php7/php7.y:1436 { yyVAL.token = yyDollar[1].token } case 169: yyDollar = yyS[yypt-9 : yypt+1] - //line php7/php7.y:1437 + //line php7/php7.y:1443 { name := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewClass(name, yyDollar[1].list, nil, yyDollar[4].ClassExtends, yyDollar[5].ClassImplements, yyDollar[8].list, yyDollar[6].str) @@ -3794,7 +3800,7 @@ yydefault: // save comments addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.ClassToken) - addMeta(name, yyDollar[3].token.Meta, meta.StringToken) + addMeta(name, yyDollar[3].token.Meta, meta.IdentifierToken) addMeta(yyVAL.node, yyDollar[7].token.Meta, meta.OpenCurlyBracesToken) addMeta(yyVAL.node, yyDollar[9].token.Meta, meta.CloseCurlyBracesToken) @@ -3802,7 +3808,7 @@ yydefault: } case 170: yyDollar = yyS[yypt-8 : yypt+1] - //line php7/php7.y:1454 + //line php7/php7.y:1460 { name := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewClass(name, nil, nil, yyDollar[3].ClassExtends, yyDollar[4].ClassImplements, yyDollar[7].list, yyDollar[5].str) @@ -3813,7 +3819,7 @@ yydefault: // save comments addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ClassToken) - addMeta(name, yyDollar[2].token.Meta, meta.StringToken) + addMeta(name, yyDollar[2].token.Meta, meta.IdentifierToken) addMeta(yyVAL.node, yyDollar[6].token.Meta, meta.OpenCurlyBracesToken) addMeta(yyVAL.node, yyDollar[8].token.Meta, meta.CloseCurlyBracesToken) @@ -3821,7 +3827,7 @@ yydefault: } case 171: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1474 + //line php7/php7.y:1480 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -3829,7 +3835,7 @@ yydefault: } case 172: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1480 + //line php7/php7.y:1486 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -3837,7 +3843,7 @@ yydefault: } case 173: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1489 + //line php7/php7.y:1495 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -3845,13 +3851,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.AbstractToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 174: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1501 + //line php7/php7.y:1507 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -3859,13 +3865,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.FinalToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 175: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1516 + //line php7/php7.y:1522 { name := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewTrait(name, yyDollar[5].list, yyDollar[3].str) @@ -3876,7 +3882,7 @@ yydefault: // save comments addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.TraitToken) - addMeta(name, yyDollar[2].token.Meta, meta.StringToken) + addMeta(name, yyDollar[2].token.Meta, meta.IdentifierToken) addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.OpenCurlyBracesToken) addMeta(yyVAL.node, yyDollar[6].token.Meta, meta.CloseCurlyBracesToken) @@ -3884,7 +3890,7 @@ yydefault: } case 176: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:1536 + //line php7/php7.y:1542 { name := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewInterface(name, yyDollar[3].InterfaceExtends, yyDollar[6].list, yyDollar[4].str) @@ -3895,7 +3901,7 @@ yydefault: // save comments addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.InterfaceToken) - addMeta(name, yyDollar[2].token.Meta, meta.StringToken) + addMeta(name, yyDollar[2].token.Meta, meta.IdentifierToken) addMeta(yyVAL.node, yyDollar[5].token.Meta, meta.OpenCurlyBracesToken) addMeta(yyVAL.node, yyDollar[7].token.Meta, meta.CloseCurlyBracesToken) @@ -3903,7 +3909,7 @@ yydefault: } case 177: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1556 + //line php7/php7.y:1562 { yyVAL.ClassExtends = nil @@ -3911,7 +3917,7 @@ yydefault: } case 178: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1562 + //line php7/php7.y:1568 { yyVAL.ClassExtends = stmt.NewClassExtends(yyDollar[2].node) @@ -3925,7 +3931,7 @@ yydefault: } case 179: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1577 + //line php7/php7.y:1583 { yyVAL.InterfaceExtends = nil @@ -3933,7 +3939,7 @@ yydefault: } case 180: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1583 + //line php7/php7.y:1589 { yyVAL.InterfaceExtends = stmt.NewInterfaceExtends(yyDollar[2].list) @@ -3947,7 +3953,7 @@ yydefault: } case 181: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1598 + //line php7/php7.y:1604 { yyVAL.ClassImplements = nil @@ -3955,7 +3961,7 @@ yydefault: } case 182: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1604 + //line php7/php7.y:1610 { yyVAL.ClassImplements = stmt.NewClassImplements(yyDollar[2].list) @@ -3969,7 +3975,7 @@ yydefault: } case 183: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1619 + //line php7/php7.y:1625 { yyVAL.node = yyDollar[1].node @@ -3977,7 +3983,7 @@ yydefault: } case 184: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1625 + //line php7/php7.y:1631 { yyVAL.node = expr.NewReference(yyDollar[2].node) @@ -3991,7 +3997,7 @@ yydefault: } case 185: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1637 + //line php7/php7.y:1643 { yyVAL.node = expr.NewList(yyDollar[3].list) @@ -4007,7 +4013,7 @@ yydefault: } case 186: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1651 + //line php7/php7.y:1657 { yyVAL.node = expr.NewShortList(yyDollar[2].list) @@ -4022,7 +4028,7 @@ yydefault: } case 187: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1667 + //line php7/php7.y:1673 { yyVAL.node = stmt.NewFor(nil, nil, nil, yyDollar[1].node) @@ -4033,7 +4039,7 @@ yydefault: } case 188: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1676 + //line php7/php7.y:1682 { stmtList := stmt.NewStmtList(yyDollar[2].list) yyVAL.node = stmt.NewAltFor(nil, nil, nil, stmtList) @@ -4051,7 +4057,7 @@ yydefault: } case 189: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1695 + //line php7/php7.y:1701 { yyVAL.node = stmt.NewForeach(nil, nil, nil, yyDollar[1].node) @@ -4062,7 +4068,7 @@ yydefault: } case 190: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1704 + //line php7/php7.y:1710 { stmtList := stmt.NewStmtList(yyDollar[2].list) yyVAL.node = stmt.NewAltForeach(nil, nil, nil, stmtList) @@ -4080,7 +4086,7 @@ yydefault: } case 191: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1723 + //line php7/php7.y:1729 { yyVAL.node = yyDollar[1].node @@ -4088,7 +4094,7 @@ yydefault: } case 192: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1729 + //line php7/php7.y:1735 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) @@ -4104,7 +4110,7 @@ yydefault: } case 193: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1746 + //line php7/php7.y:1752 { caseList := stmt.NewCaseList(yyDollar[2].list) yyVAL.node = stmt.NewSwitch(nil, caseList) @@ -4121,7 +4127,7 @@ yydefault: } case 194: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1761 + //line php7/php7.y:1767 { caseList := stmt.NewCaseList(yyDollar[3].list) yyVAL.node = stmt.NewSwitch(nil, caseList) @@ -4139,7 +4145,7 @@ yydefault: } case 195: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1777 + //line php7/php7.y:1783 { caseList := stmt.NewCaseList(yyDollar[2].list) yyVAL.node = stmt.NewAltSwitch(nil, caseList) @@ -4149,15 +4155,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - addMeta(caseList, yyDollar[1].token.Meta, meta.ColonToken) - addMeta(caseList, yyDollar[3].token.Meta, meta.EndswitchToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ColonToken) + addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.EndswitchToken) addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 196: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:1793 + //line php7/php7.y:1799 { caseList := stmt.NewCaseList(yyDollar[3].list) @@ -4168,16 +4174,16 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[5].token)) // save comments - addMeta(caseList, yyDollar[1].token.Meta, meta.ColonToken) - addMeta(caseList, yyDollar[2].token.Meta, meta.SemiColonToken) - addMeta(caseList, yyDollar[4].token.Meta, meta.EndswitchToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ColonToken) + addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.SwitchSemicolonToken) + addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.EndswitchToken) addMeta(yyVAL.node, yyDollar[5].token.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 197: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1814 + //line php7/php7.y:1820 { yyVAL.list = []node.Node{} @@ -4185,7 +4191,7 @@ yydefault: } case 198: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:1820 + //line php7/php7.y:1826 { _case := stmt.NewCase(yyDollar[3].node, yyDollar[5].list) yyVAL.list = append(yyDollar[1].list, _case) @@ -4201,7 +4207,7 @@ yydefault: } case 199: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1834 + //line php7/php7.y:1840 { _default := stmt.NewDefault(yyDollar[4].list) yyVAL.list = append(yyDollar[1].list, _default) @@ -4217,19 +4223,19 @@ yydefault: } case 200: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1851 + //line php7/php7.y:1857 { yyVAL.token = yyDollar[1].token } case 201: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1855 + //line php7/php7.y:1861 { yyVAL.token = yyDollar[1].token } case 202: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1862 + //line php7/php7.y:1868 { yyVAL.node = stmt.NewWhile(nil, yyDollar[1].node) @@ -4240,7 +4246,7 @@ yydefault: } case 203: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1871 + //line php7/php7.y:1877 { stmtList := stmt.NewStmtList(yyDollar[2].list) yyVAL.node = stmt.NewAltWhile(nil, stmtList) @@ -4258,7 +4264,7 @@ yydefault: } case 204: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:1890 + //line php7/php7.y:1896 { yyVAL.node = stmt.NewIf(yyDollar[3].node, yyDollar[5].node, nil, nil) @@ -4274,7 +4280,7 @@ yydefault: } case 205: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1904 + //line php7/php7.y:1910 { _elseIf := stmt.NewElseIf(yyDollar[4].node, yyDollar[6].node) yyVAL.node = yyDollar[1].node.(*stmt.If).AddElseIf(_elseIf) @@ -4292,7 +4298,7 @@ yydefault: } case 206: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1923 + //line php7/php7.y:1929 { yyVAL.node = yyDollar[1].node @@ -4300,7 +4306,7 @@ yydefault: } case 207: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1929 + //line php7/php7.y:1935 { _else := stmt.NewElse(yyDollar[3].node) yyVAL.node = yyDollar[1].node.(*stmt.If).SetElse(_else) @@ -4310,13 +4316,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.ElseToken) + addMeta(_else, yyDollar[2].token.Meta, meta.ElseToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 208: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1946 + //line php7/php7.y:1952 { stmts := stmt.NewStmtList(yyDollar[6].list) yyVAL.node = stmt.NewAltIf(yyDollar[3].node, stmts, nil, nil) @@ -4335,7 +4341,7 @@ yydefault: } case 209: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:1963 + //line php7/php7.y:1969 { stmts := stmt.NewStmtList(yyDollar[7].list) _elseIf := stmt.NewAltElseIf(yyDollar[4].node, stmts) @@ -4355,7 +4361,7 @@ yydefault: } case 210: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1984 + //line php7/php7.y:1990 { yyVAL.node = yyDollar[1].node @@ -4370,7 +4376,7 @@ yydefault: } case 211: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1997 + //line php7/php7.y:2003 { stmts := stmt.NewStmtList(yyDollar[4].list) _else := stmt.NewAltElse(stmts) @@ -4391,7 +4397,7 @@ yydefault: } case 212: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2019 + //line php7/php7.y:2025 { yyVAL.list = yyDollar[1].list @@ -4399,7 +4405,7 @@ yydefault: } case 213: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:2025 + //line php7/php7.y:2031 { yyVAL.list = nil @@ -4407,7 +4413,7 @@ yydefault: } case 214: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2034 + //line php7/php7.y:2040 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4415,18 +4421,18 @@ yydefault: } case 215: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2040 + //line php7/php7.y:2046 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) + addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 216: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2052 + //line php7/php7.y:2058 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[4].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -4458,7 +4464,7 @@ yydefault: } case 217: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:2082 + //line php7/php7.y:2088 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[4].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -4491,7 +4497,7 @@ yydefault: } case 218: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:2116 + //line php7/php7.y:2122 { yyVAL.node = nil @@ -4499,7 +4505,7 @@ yydefault: } case 219: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2122 + //line php7/php7.y:2128 { yyVAL.node = yyDollar[1].node @@ -4507,7 +4513,7 @@ yydefault: } case 220: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2131 + //line php7/php7.y:2137 { yyVAL.node = yyDollar[1].node @@ -4515,7 +4521,7 @@ yydefault: } case 221: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2137 + //line php7/php7.y:2143 { yyVAL.node = node.NewNullable(yyDollar[2].node) @@ -4529,7 +4535,7 @@ yydefault: } case 222: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2152 + //line php7/php7.y:2158 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4537,13 +4543,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ArrayToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 223: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2164 + //line php7/php7.y:2170 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4551,13 +4557,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.CallableToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 224: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2176 + //line php7/php7.y:2182 { yyVAL.node = yyDollar[1].node @@ -4565,7 +4571,7 @@ yydefault: } case 225: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:2185 + //line php7/php7.y:2191 { yyVAL.node = nil @@ -4573,7 +4579,7 @@ yydefault: } case 226: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2191 + //line php7/php7.y:2197 { yyVAL.node = yyDollar[2].node @@ -4584,7 +4590,7 @@ yydefault: } case 227: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2203 + //line php7/php7.y:2209 { yyVAL.node = node.NewArgumentList(nil) @@ -4599,7 +4605,7 @@ yydefault: } case 228: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2216 + //line php7/php7.y:2222 { yyVAL.node = node.NewArgumentList(yyDollar[2].list) @@ -4617,7 +4623,7 @@ yydefault: } case 229: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2235 + //line php7/php7.y:2241 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4625,18 +4631,18 @@ yydefault: } case 230: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2241 + //line php7/php7.y:2247 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) + addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 231: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2253 + //line php7/php7.y:2259 { yyVAL.node = node.NewArgument(yyDollar[1].node, false, false) @@ -4647,7 +4653,7 @@ yydefault: } case 232: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2262 + //line php7/php7.y:2268 { yyVAL.node = node.NewArgument(yyDollar[2].node, true, false) @@ -4661,18 +4667,18 @@ yydefault: } case 233: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2277 + //line php7/php7.y:2283 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) + addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 234: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2286 + //line php7/php7.y:2292 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4680,7 +4686,7 @@ yydefault: } case 235: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2295 + //line php7/php7.y:2301 { yyVAL.node = yyDollar[1].node @@ -4688,18 +4694,18 @@ yydefault: } case 236: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2304 + //line php7/php7.y:2310 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) + addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 237: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2313 + //line php7/php7.y:2319 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4707,7 +4713,7 @@ yydefault: } case 238: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2322 + //line php7/php7.y:2328 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -4725,7 +4731,7 @@ yydefault: } case 239: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2338 + //line php7/php7.y:2344 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -4744,7 +4750,7 @@ yydefault: } case 240: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2358 + //line php7/php7.y:2364 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -4752,7 +4758,7 @@ yydefault: } case 241: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:2364 + //line php7/php7.y:2370 { yyVAL.list = []node.Node{} @@ -4760,7 +4766,7 @@ yydefault: } case 242: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2373 + //line php7/php7.y:2379 { yyVAL.node = stmt.NewPropertyList(yyDollar[1].list, yyDollar[2].list) @@ -4774,7 +4780,7 @@ yydefault: } case 243: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2385 + //line php7/php7.y:2391 { yyVAL.node = stmt.NewClassConstList(yyDollar[1].list, yyDollar[3].list) @@ -4789,18 +4795,9 @@ yydefault: } case 244: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2398 + //line php7/php7.y:2404 { - var adaptationList *stmt.TraitAdaptationList - - switch n := yyDollar[3].node.(type) { - case *stmt.TraitAdaptationList: - adaptationList = n - default: - adaptationList = nil - } - - yyVAL.node = stmt.NewTraitUse(yyDollar[2].list, adaptationList) + yyVAL.node = stmt.NewTraitUse(yyDollar[2].list, yyDollar[3].node) // save position yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) @@ -4812,7 +4809,7 @@ yydefault: } case 245: yyDollar = yyS[yypt-10 : yypt+1] - //line php7/php7.y:2419 + //line php7/php7.y:2416 { name := node.NewIdentifier(yyDollar[4].token.Value) yyVAL.node = stmt.NewClassMethod(name, yyDollar[1].list, yyDollar[3].token != nil, yyDollar[7].list, yyDollar[9].node, yyDollar[10].node, yyDollar[5].str) @@ -4838,7 +4835,7 @@ yydefault: } case 246: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2446 + //line php7/php7.y:2443 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4846,18 +4843,18 @@ yydefault: } case 247: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2452 + //line php7/php7.y:2449 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) + addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 248: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2464 + //line php7/php7.y:2461 { yyVAL.node = stmt.NewNop() @@ -4870,7 +4867,7 @@ yydefault: } case 249: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2476 + //line php7/php7.y:2473 { yyVAL.node = stmt.NewTraitAdaptationList(nil) @@ -4884,7 +4881,7 @@ yydefault: } case 250: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2488 + //line php7/php7.y:2485 { yyVAL.node = stmt.NewTraitAdaptationList(yyDollar[2].list) @@ -4898,7 +4895,7 @@ yydefault: } case 251: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2503 + //line php7/php7.y:2500 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4906,7 +4903,7 @@ yydefault: } case 252: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2509 + //line php7/php7.y:2506 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -4914,7 +4911,7 @@ yydefault: } case 253: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2518 + //line php7/php7.y:2515 { yyVAL.node = yyDollar[1].node @@ -4925,7 +4922,7 @@ yydefault: } case 254: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2527 + //line php7/php7.y:2524 { yyVAL.node = yyDollar[1].node @@ -4936,7 +4933,7 @@ yydefault: } case 255: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2539 + //line php7/php7.y:2536 { yyVAL.node = stmt.NewTraitUsePrecedence(yyDollar[1].node, yyDollar[3].list) @@ -4950,7 +4947,7 @@ yydefault: } case 256: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2554 + //line php7/php7.y:2551 { alias := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, nil, alias) @@ -4961,13 +4958,13 @@ yydefault: // save comments addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.AsToken) - addMeta(alias, yyDollar[3].token.Meta, meta.StringToken) + addMeta(alias, yyDollar[3].token.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 257: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2569 + //line php7/php7.y:2566 { alias := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, nil, alias) @@ -4978,13 +4975,13 @@ yydefault: // save comments addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.AsToken) - addMeta(alias, yyDollar[3].token.Meta, meta.StringToken) + addMeta(alias, yyDollar[3].token.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 258: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2584 + //line php7/php7.y:2581 { alias := node.NewIdentifier(yyDollar[4].token.Value) yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, yyDollar[3].node, alias) @@ -5001,7 +4998,7 @@ yydefault: } case 259: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2599 + //line php7/php7.y:2596 { yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, yyDollar[3].node, nil) @@ -5015,7 +5012,7 @@ yydefault: } case 260: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2614 + //line php7/php7.y:2611 { name := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewTraitMethodRef(nil, name) @@ -5031,7 +5028,7 @@ yydefault: } case 261: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2628 + //line php7/php7.y:2625 { yyVAL.node = yyDollar[1].node @@ -5039,7 +5036,7 @@ yydefault: } case 262: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2637 + //line php7/php7.y:2634 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewTraitMethodRef(yyDollar[1].node, target) @@ -5056,7 +5053,7 @@ yydefault: } case 263: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2655 + //line php7/php7.y:2652 { yyVAL.node = stmt.NewNop() @@ -5070,7 +5067,7 @@ yydefault: } case 264: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2667 + //line php7/php7.y:2664 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) @@ -5085,7 +5082,7 @@ yydefault: } case 265: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2683 + //line php7/php7.y:2680 { yyVAL.list = yyDollar[1].list @@ -5093,7 +5090,7 @@ yydefault: } case 266: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2689 + //line php7/php7.y:2686 { modifier := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.list = []node.Node{modifier} @@ -5102,13 +5099,13 @@ yydefault: modifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(modifier, yyDollar[1].token.Meta, meta.VarToken) + addMeta(modifier, yyDollar[1].token.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 267: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:2705 + //line php7/php7.y:2702 { yyVAL.list = nil @@ -5116,7 +5113,7 @@ yydefault: } case 268: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2711 + //line php7/php7.y:2708 { yyVAL.list = yyDollar[1].list @@ -5124,7 +5121,7 @@ yydefault: } case 269: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2720 + //line php7/php7.y:2717 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -5132,7 +5129,7 @@ yydefault: } case 270: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2726 + //line php7/php7.y:2723 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -5140,7 +5137,7 @@ yydefault: } case 271: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2735 + //line php7/php7.y:2732 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5148,13 +5145,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.PublicToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 272: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2747 + //line php7/php7.y:2744 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5162,13 +5159,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ProtectedToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 273: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2759 + //line php7/php7.y:2756 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5176,13 +5173,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.PrivateToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 274: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2771 + //line php7/php7.y:2768 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5190,13 +5187,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.StaticToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 275: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2783 + //line php7/php7.y:2780 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5204,13 +5201,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.AbstractToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 276: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2795 + //line php7/php7.y:2792 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5218,24 +5215,24 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.FinalToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 277: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2810 + //line php7/php7.y:2807 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) + addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 278: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2819 + //line php7/php7.y:2816 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -5243,7 +5240,7 @@ yydefault: } case 279: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2828 + //line php7/php7.y:2825 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -5261,7 +5258,7 @@ yydefault: } case 280: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2844 + //line php7/php7.y:2841 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -5280,18 +5277,18 @@ yydefault: } case 281: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2864 + //line php7/php7.y:2861 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) + addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 282: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2873 + //line php7/php7.y:2870 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -5299,7 +5296,7 @@ yydefault: } case 283: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2882 + //line php7/php7.y:2879 { name := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewConstant(name, yyDollar[3].node, yyDollar[4].str) @@ -5316,7 +5313,7 @@ yydefault: } case 284: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2900 + //line php7/php7.y:2897 { name := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewConstant(name, yyDollar[3].node, yyDollar[4].str) @@ -5326,25 +5323,25 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) // save comments - addMeta(name, yyDollar[1].token.Meta, meta.StringToken) + addMeta(name, yyDollar[1].token.Meta, meta.IdentifierToken) addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 285: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2918 + //line php7/php7.y:2915 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) + addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 286: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2927 + //line php7/php7.y:2924 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -5352,7 +5349,7 @@ yydefault: } case 287: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2936 + //line php7/php7.y:2933 { yyVAL.node = yyDollar[1].node @@ -5360,7 +5357,7 @@ yydefault: } case 288: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:2945 + //line php7/php7.y:2942 { yyVAL.list = nil @@ -5368,7 +5365,7 @@ yydefault: } case 289: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2951 + //line php7/php7.y:2948 { yyVAL.list = yyDollar[1].list @@ -5376,18 +5373,18 @@ yydefault: } case 290: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2960 + //line php7/php7.y:2957 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) + addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 291: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2969 + //line php7/php7.y:2966 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -5395,7 +5392,7 @@ yydefault: } case 292: yyDollar = yyS[yypt-8 : yypt+1] - //line php7/php7.y:2978 + //line php7/php7.y:2975 { if yyDollar[2].node != nil { yyVAL.node = stmt.NewClass(nil, nil, yyDollar[2].node.(*node.ArgumentList), yyDollar[3].ClassExtends, yyDollar[4].ClassImplements, yyDollar[7].list, yyDollar[5].str) @@ -5415,7 +5412,7 @@ yydefault: } case 293: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2999 + //line php7/php7.y:2996 { if yyDollar[3].node != nil { yyVAL.node = expr.NewNew(yyDollar[2].node, yyDollar[3].node.(*node.ArgumentList)) @@ -5432,7 +5429,7 @@ yydefault: } case 294: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3014 + //line php7/php7.y:3011 { yyVAL.node = expr.NewNew(yyDollar[2].node, nil) @@ -5446,7 +5443,7 @@ yydefault: } case 295: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:3029 + //line php7/php7.y:3026 { list := expr.NewList(yyDollar[3].list) yyVAL.node = assign.NewAssign(list, yyDollar[6].node) @@ -5465,7 +5462,7 @@ yydefault: } case 296: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:3046 + //line php7/php7.y:3043 { shortList := expr.NewShortList(yyDollar[2].list) yyVAL.node = assign.NewAssign(shortList, yyDollar[5].node) @@ -5483,7 +5480,7 @@ yydefault: } case 297: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3062 + //line php7/php7.y:3059 { yyVAL.node = assign.NewAssign(yyDollar[1].node, yyDollar[3].node) @@ -5497,7 +5494,7 @@ yydefault: } case 298: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3074 + //line php7/php7.y:3071 { yyVAL.node = assign.NewReference(yyDollar[1].node, yyDollar[4].node) @@ -5512,7 +5509,7 @@ yydefault: } case 299: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3087 + //line php7/php7.y:3084 { yyVAL.node = expr.NewClone(yyDollar[2].node) @@ -5526,7 +5523,7 @@ yydefault: } case 300: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3099 + //line php7/php7.y:3096 { yyVAL.node = assign.NewPlus(yyDollar[1].node, yyDollar[3].node) @@ -5540,7 +5537,7 @@ yydefault: } case 301: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3111 + //line php7/php7.y:3108 { yyVAL.node = assign.NewMinus(yyDollar[1].node, yyDollar[3].node) @@ -5554,7 +5551,7 @@ yydefault: } case 302: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3123 + //line php7/php7.y:3120 { yyVAL.node = assign.NewMul(yyDollar[1].node, yyDollar[3].node) @@ -5568,7 +5565,7 @@ yydefault: } case 303: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3135 + //line php7/php7.y:3132 { yyVAL.node = assign.NewPow(yyDollar[1].node, yyDollar[3].node) @@ -5582,7 +5579,7 @@ yydefault: } case 304: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3147 + //line php7/php7.y:3144 { yyVAL.node = assign.NewDiv(yyDollar[1].node, yyDollar[3].node) @@ -5596,7 +5593,7 @@ yydefault: } case 305: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3159 + //line php7/php7.y:3156 { yyVAL.node = assign.NewConcat(yyDollar[1].node, yyDollar[3].node) @@ -5610,7 +5607,7 @@ yydefault: } case 306: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3171 + //line php7/php7.y:3168 { yyVAL.node = assign.NewMod(yyDollar[1].node, yyDollar[3].node) @@ -5624,7 +5621,7 @@ yydefault: } case 307: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3183 + //line php7/php7.y:3180 { yyVAL.node = assign.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) @@ -5638,7 +5635,7 @@ yydefault: } case 308: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3195 + //line php7/php7.y:3192 { yyVAL.node = assign.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) @@ -5652,7 +5649,7 @@ yydefault: } case 309: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3207 + //line php7/php7.y:3204 { yyVAL.node = assign.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) @@ -5666,7 +5663,7 @@ yydefault: } case 310: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3219 + //line php7/php7.y:3216 { yyVAL.node = assign.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) @@ -5680,7 +5677,7 @@ yydefault: } case 311: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3231 + //line php7/php7.y:3228 { yyVAL.node = assign.NewShiftRight(yyDollar[1].node, yyDollar[3].node) @@ -5694,7 +5691,7 @@ yydefault: } case 312: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3243 + //line php7/php7.y:3240 { yyVAL.node = expr.NewPostInc(yyDollar[1].node) @@ -5708,7 +5705,7 @@ yydefault: } case 313: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3255 + //line php7/php7.y:3252 { yyVAL.node = expr.NewPreInc(yyDollar[2].node) @@ -5722,7 +5719,7 @@ yydefault: } case 314: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3267 + //line php7/php7.y:3264 { yyVAL.node = expr.NewPostDec(yyDollar[1].node) @@ -5736,7 +5733,7 @@ yydefault: } case 315: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3279 + //line php7/php7.y:3276 { yyVAL.node = expr.NewPreDec(yyDollar[2].node) @@ -5750,7 +5747,7 @@ yydefault: } case 316: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3291 + //line php7/php7.y:3288 { yyVAL.node = binary.NewBooleanOr(yyDollar[1].node, yyDollar[3].node) @@ -5764,7 +5761,7 @@ yydefault: } case 317: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3303 + //line php7/php7.y:3300 { yyVAL.node = binary.NewBooleanAnd(yyDollar[1].node, yyDollar[3].node) @@ -5778,7 +5775,7 @@ yydefault: } case 318: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3315 + //line php7/php7.y:3312 { yyVAL.node = binary.NewLogicalOr(yyDollar[1].node, yyDollar[3].node) @@ -5792,7 +5789,7 @@ yydefault: } case 319: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3327 + //line php7/php7.y:3324 { yyVAL.node = binary.NewLogicalAnd(yyDollar[1].node, yyDollar[3].node) @@ -5806,7 +5803,7 @@ yydefault: } case 320: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3339 + //line php7/php7.y:3336 { yyVAL.node = binary.NewLogicalXor(yyDollar[1].node, yyDollar[3].node) @@ -5820,7 +5817,7 @@ yydefault: } case 321: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3351 + //line php7/php7.y:3348 { yyVAL.node = binary.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) @@ -5834,7 +5831,7 @@ yydefault: } case 322: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3363 + //line php7/php7.y:3360 { yyVAL.node = binary.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) @@ -5848,7 +5845,7 @@ yydefault: } case 323: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3375 + //line php7/php7.y:3372 { yyVAL.node = binary.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) @@ -5862,7 +5859,7 @@ yydefault: } case 324: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3387 + //line php7/php7.y:3384 { yyVAL.node = binary.NewConcat(yyDollar[1].node, yyDollar[3].node) @@ -5876,7 +5873,7 @@ yydefault: } case 325: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3399 + //line php7/php7.y:3396 { yyVAL.node = binary.NewPlus(yyDollar[1].node, yyDollar[3].node) @@ -5890,7 +5887,7 @@ yydefault: } case 326: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3411 + //line php7/php7.y:3408 { yyVAL.node = binary.NewMinus(yyDollar[1].node, yyDollar[3].node) @@ -5904,7 +5901,7 @@ yydefault: } case 327: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3423 + //line php7/php7.y:3420 { yyVAL.node = binary.NewMul(yyDollar[1].node, yyDollar[3].node) @@ -5918,7 +5915,7 @@ yydefault: } case 328: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3435 + //line php7/php7.y:3432 { yyVAL.node = binary.NewPow(yyDollar[1].node, yyDollar[3].node) @@ -5932,7 +5929,7 @@ yydefault: } case 329: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3447 + //line php7/php7.y:3444 { yyVAL.node = binary.NewDiv(yyDollar[1].node, yyDollar[3].node) @@ -5946,7 +5943,7 @@ yydefault: } case 330: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3459 + //line php7/php7.y:3456 { yyVAL.node = binary.NewMod(yyDollar[1].node, yyDollar[3].node) @@ -5960,7 +5957,7 @@ yydefault: } case 331: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3471 + //line php7/php7.y:3468 { yyVAL.node = binary.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) @@ -5974,7 +5971,7 @@ yydefault: } case 332: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3483 + //line php7/php7.y:3480 { yyVAL.node = binary.NewShiftRight(yyDollar[1].node, yyDollar[3].node) @@ -5988,7 +5985,7 @@ yydefault: } case 333: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3495 + //line php7/php7.y:3492 { yyVAL.node = expr.NewUnaryPlus(yyDollar[2].node) @@ -6002,7 +5999,7 @@ yydefault: } case 334: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3507 + //line php7/php7.y:3504 { yyVAL.node = expr.NewUnaryMinus(yyDollar[2].node) @@ -6016,7 +6013,7 @@ yydefault: } case 335: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3519 + //line php7/php7.y:3516 { yyVAL.node = expr.NewBooleanNot(yyDollar[2].node) @@ -6030,7 +6027,7 @@ yydefault: } case 336: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3531 + //line php7/php7.y:3528 { yyVAL.node = expr.NewBitwiseNot(yyDollar[2].node) @@ -6044,7 +6041,7 @@ yydefault: } case 337: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3543 + //line php7/php7.y:3540 { yyVAL.node = binary.NewIdentical(yyDollar[1].node, yyDollar[3].node) @@ -6058,7 +6055,7 @@ yydefault: } case 338: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3555 + //line php7/php7.y:3552 { yyVAL.node = binary.NewNotIdentical(yyDollar[1].node, yyDollar[3].node) @@ -6072,7 +6069,7 @@ yydefault: } case 339: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3567 + //line php7/php7.y:3564 { yyVAL.node = binary.NewEqual(yyDollar[1].node, yyDollar[3].node) @@ -6086,7 +6083,7 @@ yydefault: } case 340: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3579 + //line php7/php7.y:3576 { yyVAL.node = binary.NewNotEqual(yyDollar[1].node, yyDollar[3].node) @@ -6100,7 +6097,7 @@ yydefault: } case 341: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3591 + //line php7/php7.y:3588 { yyVAL.node = binary.NewSmaller(yyDollar[1].node, yyDollar[3].node) @@ -6114,7 +6111,7 @@ yydefault: } case 342: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3603 + //line php7/php7.y:3600 { yyVAL.node = binary.NewSmallerOrEqual(yyDollar[1].node, yyDollar[3].node) @@ -6128,7 +6125,7 @@ yydefault: } case 343: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3615 + //line php7/php7.y:3612 { yyVAL.node = binary.NewGreater(yyDollar[1].node, yyDollar[3].node) @@ -6142,7 +6139,7 @@ yydefault: } case 344: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3627 + //line php7/php7.y:3624 { yyVAL.node = binary.NewGreaterOrEqual(yyDollar[1].node, yyDollar[3].node) @@ -6156,7 +6153,7 @@ yydefault: } case 345: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3639 + //line php7/php7.y:3636 { yyVAL.node = binary.NewSpaceship(yyDollar[1].node, yyDollar[3].node) @@ -6170,7 +6167,7 @@ yydefault: } case 346: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3651 + //line php7/php7.y:3648 { yyVAL.node = expr.NewInstanceOf(yyDollar[1].node, yyDollar[3].node) @@ -6184,7 +6181,7 @@ yydefault: } case 347: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3663 + //line php7/php7.y:3660 { yyVAL.node = yyDollar[2].node @@ -6196,7 +6193,7 @@ yydefault: } case 348: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3673 + //line php7/php7.y:3670 { yyVAL.node = yyDollar[1].node @@ -6204,7 +6201,7 @@ yydefault: } case 349: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:3679 + //line php7/php7.y:3676 { yyVAL.node = expr.NewTernary(yyDollar[1].node, yyDollar[3].node, yyDollar[5].node) @@ -6219,7 +6216,7 @@ yydefault: } case 350: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3692 + //line php7/php7.y:3689 { yyVAL.node = expr.NewTernary(yyDollar[1].node, nil, yyDollar[4].node) @@ -6234,7 +6231,7 @@ yydefault: } case 351: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3705 + //line php7/php7.y:3702 { yyVAL.node = binary.NewCoalesce(yyDollar[1].node, yyDollar[3].node) @@ -6248,7 +6245,7 @@ yydefault: } case 352: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3717 + //line php7/php7.y:3714 { yyVAL.node = yyDollar[1].node @@ -6256,7 +6253,7 @@ yydefault: } case 353: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3723 + //line php7/php7.y:3720 { yyVAL.node = cast.NewInt(yyDollar[2].node) @@ -6270,7 +6267,7 @@ yydefault: } case 354: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3735 + //line php7/php7.y:3732 { yyVAL.node = cast.NewDouble(yyDollar[2].node) @@ -6284,7 +6281,7 @@ yydefault: } case 355: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3747 + //line php7/php7.y:3744 { yyVAL.node = cast.NewString(yyDollar[2].node) @@ -6298,7 +6295,7 @@ yydefault: } case 356: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3759 + //line php7/php7.y:3756 { yyVAL.node = cast.NewArray(yyDollar[2].node) @@ -6312,7 +6309,7 @@ yydefault: } case 357: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3771 + //line php7/php7.y:3768 { yyVAL.node = cast.NewObject(yyDollar[2].node) @@ -6326,7 +6323,7 @@ yydefault: } case 358: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3783 + //line php7/php7.y:3780 { yyVAL.node = cast.NewBool(yyDollar[2].node) @@ -6340,7 +6337,7 @@ yydefault: } case 359: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3795 + //line php7/php7.y:3792 { yyVAL.node = cast.NewUnset(yyDollar[2].node) @@ -6354,7 +6351,7 @@ yydefault: } case 360: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3807 + //line php7/php7.y:3804 { if strings.EqualFold(yyDollar[1].token.Value, "die") { yyVAL.node = expr.NewDie(nil) @@ -6382,7 +6379,7 @@ yydefault: } case 361: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3833 + //line php7/php7.y:3830 { yyVAL.node = expr.NewErrorSuppress(yyDollar[2].node) @@ -6396,7 +6393,7 @@ yydefault: } case 362: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3845 + //line php7/php7.y:3842 { yyVAL.node = yyDollar[1].node @@ -6404,7 +6401,7 @@ yydefault: } case 363: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3851 + //line php7/php7.y:3848 { yyVAL.node = expr.NewShellExec(yyDollar[2].list) @@ -6419,7 +6416,7 @@ yydefault: } case 364: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3864 + //line php7/php7.y:3861 { yyVAL.node = expr.NewPrint(yyDollar[2].node) @@ -6433,7 +6430,7 @@ yydefault: } case 365: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3876 + //line php7/php7.y:3873 { yyVAL.node = expr.NewYield(nil, nil) @@ -6447,7 +6444,7 @@ yydefault: } case 366: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3888 + //line php7/php7.y:3885 { yyVAL.node = expr.NewYield(nil, yyDollar[2].node) @@ -6461,7 +6458,7 @@ yydefault: } case 367: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3900 + //line php7/php7.y:3897 { yyVAL.node = expr.NewYield(yyDollar[2].node, yyDollar[4].node) @@ -6476,7 +6473,7 @@ yydefault: } case 368: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3913 + //line php7/php7.y:3910 { yyVAL.node = expr.NewYieldFrom(yyDollar[2].node) @@ -6490,7 +6487,7 @@ yydefault: } case 369: yyDollar = yyS[yypt-11 : yypt+1] - //line php7/php7.y:3925 + //line php7/php7.y:3922 { yyVAL.node = expr.NewClosure(yyDollar[5].list, yyDollar[7].ClosureUse, yyDollar[8].node, yyDollar[10].list, false, yyDollar[2].token != nil, yyDollar[3].str) @@ -6511,7 +6508,7 @@ yydefault: } case 370: yyDollar = yyS[yypt-12 : yypt+1] - //line php7/php7.y:3944 + //line php7/php7.y:3941 { yyVAL.node = expr.NewClosure(yyDollar[6].list, yyDollar[8].ClosureUse, yyDollar[9].node, yyDollar[11].list, true, yyDollar[3].token != nil, yyDollar[4].str) @@ -6533,7 +6530,7 @@ yydefault: } case 371: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3967 + //line php7/php7.y:3964 { yyVAL.str = yylex.(*Parser).PhpDocComment yylex.(*Parser).PhpDocComment = "" @@ -6542,19 +6539,19 @@ yydefault: } case 372: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3977 + //line php7/php7.y:3974 { yyVAL.token = nil } case 373: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3981 + //line php7/php7.y:3978 { yyVAL.token = yyDollar[1].token } case 374: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3988 + //line php7/php7.y:3985 { yyVAL.ClosureUse = nil @@ -6562,7 +6559,7 @@ yydefault: } case 375: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3994 + //line php7/php7.y:3991 { yyVAL.ClosureUse = expr.NewClosureUse(yyDollar[3].list) @@ -6578,18 +6575,18 @@ yydefault: } case 376: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4011 + //line php7/php7.y:4008 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) + addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 377: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4020 + //line php7/php7.y:4017 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -6597,7 +6594,7 @@ yydefault: } case 378: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4029 + //line php7/php7.y:4026 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(identifier) @@ -6613,7 +6610,7 @@ yydefault: } case 379: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4043 + //line php7/php7.y:4040 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[2].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -6632,7 +6629,7 @@ yydefault: } case 380: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4063 + //line php7/php7.y:4060 { yyVAL.node = expr.NewFunctionCall(yyDollar[1].node, yyDollar[2].node.(*node.ArgumentList)) @@ -6643,7 +6640,7 @@ yydefault: } case 381: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4072 + //line php7/php7.y:4069 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -6657,7 +6654,7 @@ yydefault: } case 382: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4084 + //line php7/php7.y:4081 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -6671,7 +6668,7 @@ yydefault: } case 383: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4096 + //line php7/php7.y:4093 { yyVAL.node = expr.NewFunctionCall(yyDollar[1].node, yyDollar[2].node.(*node.ArgumentList)) @@ -6682,7 +6679,7 @@ yydefault: } case 384: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4108 + //line php7/php7.y:4105 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -6690,13 +6687,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.StaticToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 385: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4120 + //line php7/php7.y:4117 { yyVAL.node = yyDollar[1].node @@ -6704,7 +6701,7 @@ yydefault: } case 386: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4129 + //line php7/php7.y:4126 { yyVAL.node = yyDollar[1].node @@ -6712,7 +6709,7 @@ yydefault: } case 387: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4135 + //line php7/php7.y:4132 { yyVAL.node = yyDollar[1].node @@ -6720,7 +6717,7 @@ yydefault: } case 388: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4144 + //line php7/php7.y:4141 { yyVAL.node = nil @@ -6728,7 +6725,7 @@ yydefault: } case 389: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4150 + //line php7/php7.y:4147 { yyVAL.node = expr.NewExit(yyDollar[2].node) @@ -6736,14 +6733,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.OpenParenthesisToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.CloseParenthesisToken) + addMeta(yyDollar[2].node, yyDollar[1].token.Meta, meta.OpenParenthesisToken) + addMeta(yyDollar[2].node, yyDollar[3].token.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 390: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4166 + //line php7/php7.y:4163 { yyVAL.list = []node.Node{} @@ -6751,7 +6748,7 @@ yydefault: } case 391: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4172 + //line php7/php7.y:4169 { yyVAL.list = []node.Node{scalar.NewEncapsedStringPart(yyDollar[1].token.Value)} @@ -6759,7 +6756,7 @@ yydefault: } case 392: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4178 + //line php7/php7.y:4175 { yyVAL.list = yyDollar[1].list @@ -6767,7 +6764,7 @@ yydefault: } case 393: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4187 + //line php7/php7.y:4184 { yyVAL.node = nil @@ -6775,7 +6772,7 @@ yydefault: } case 394: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4193 + //line php7/php7.y:4190 { yyVAL.node = yyDollar[1].node @@ -6783,7 +6780,7 @@ yydefault: } case 395: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4202 + //line php7/php7.y:4199 { yyVAL.node = expr.NewArray(yyDollar[3].list) @@ -6799,7 +6796,7 @@ yydefault: } case 396: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4216 + //line php7/php7.y:4213 { yyVAL.node = expr.NewShortArray(yyDollar[2].list) @@ -6814,7 +6811,7 @@ yydefault: } case 397: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4229 + //line php7/php7.y:4226 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) @@ -6828,7 +6825,7 @@ yydefault: } case 398: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4244 + //line php7/php7.y:4241 { yyVAL.node = scalar.NewLnumber(yyDollar[1].token.Value) @@ -6842,7 +6839,7 @@ yydefault: } case 399: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4256 + //line php7/php7.y:4253 { yyVAL.node = scalar.NewDnumber(yyDollar[1].token.Value) @@ -6856,7 +6853,7 @@ yydefault: } case 400: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4268 + //line php7/php7.y:4265 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6864,13 +6861,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.LineToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.MagicConstantToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 401: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4280 + //line php7/php7.y:4277 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6878,13 +6875,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.FileToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.MagicConstantToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 402: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4292 + //line php7/php7.y:4289 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6892,13 +6889,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.DirToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.MagicConstantToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 403: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4304 + //line php7/php7.y:4301 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6906,13 +6903,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.TraitCToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.MagicConstantToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 404: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4316 + //line php7/php7.y:4313 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6920,13 +6917,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.MethodCToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.MagicConstantToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 405: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4328 + //line php7/php7.y:4325 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6934,13 +6931,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.FuncCToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.MagicConstantToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 406: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4340 + //line php7/php7.y:4337 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6948,13 +6945,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.NsCToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.MagicConstantToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 407: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4352 + //line php7/php7.y:4349 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6962,13 +6959,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ClassCToken) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.MagicConstantToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 408: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4364 + //line php7/php7.y:4361 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, []node.Node{encapsed}) @@ -6984,7 +6981,7 @@ yydefault: } case 409: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4378 + //line php7/php7.y:4375 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, nil) @@ -6998,7 +6995,7 @@ yydefault: } case 410: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4390 + //line php7/php7.y:4387 { yyVAL.node = scalar.NewEncapsed(yyDollar[2].list) @@ -7012,7 +7009,7 @@ yydefault: } case 411: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4402 + //line php7/php7.y:4399 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, yyDollar[2].list) @@ -7026,7 +7023,7 @@ yydefault: } case 412: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4414 + //line php7/php7.y:4411 { yyVAL.node = yyDollar[1].node @@ -7034,7 +7031,7 @@ yydefault: } case 413: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4420 + //line php7/php7.y:4417 { yyVAL.node = yyDollar[1].node @@ -7042,7 +7039,7 @@ yydefault: } case 414: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4429 + //line php7/php7.y:4426 { yyVAL.node = expr.NewConstFetch(yyDollar[1].node) @@ -7053,7 +7050,7 @@ yydefault: } case 415: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4438 + //line php7/php7.y:4435 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -7070,7 +7067,7 @@ yydefault: } case 416: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4453 + //line php7/php7.y:4450 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -7087,7 +7084,7 @@ yydefault: } case 417: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4471 + //line php7/php7.y:4468 { yyVAL.node = yyDollar[1].node @@ -7095,7 +7092,7 @@ yydefault: } case 418: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4477 + //line php7/php7.y:4474 { yyVAL.node = yyDollar[1].node @@ -7103,7 +7100,7 @@ yydefault: } case 419: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4486 + //line php7/php7.y:4483 { yyVAL.node = nil @@ -7111,7 +7108,7 @@ yydefault: } case 420: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4492 + //line php7/php7.y:4489 { yyVAL.node = yyDollar[1].node @@ -7119,7 +7116,7 @@ yydefault: } case 421: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4501 + //line php7/php7.y:4498 { yyVAL.node = yyDollar[1].node @@ -7127,7 +7124,7 @@ yydefault: } case 422: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4510 + //line php7/php7.y:4507 { yyVAL.node = yyDollar[1].node @@ -7135,7 +7132,7 @@ yydefault: } case 423: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4516 + //line php7/php7.y:4513 { yyVAL.node = yyDollar[2].node @@ -7147,7 +7144,7 @@ yydefault: } case 424: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4526 + //line php7/php7.y:4523 { yyVAL.node = yyDollar[1].node @@ -7155,7 +7152,7 @@ yydefault: } case 425: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4535 + //line php7/php7.y:4532 { yyVAL.node = yyDollar[1].node @@ -7163,7 +7160,7 @@ yydefault: } case 426: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4541 + //line php7/php7.y:4538 { yyVAL.node = yyDollar[2].node @@ -7175,7 +7172,7 @@ yydefault: } case 427: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4551 + //line php7/php7.y:4548 { yyVAL.node = yyDollar[1].node @@ -7183,7 +7180,7 @@ yydefault: } case 428: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4560 + //line php7/php7.y:4557 { yyVAL.node = yyDollar[1].node @@ -7191,7 +7188,7 @@ yydefault: } case 429: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4566 + //line php7/php7.y:4563 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -7206,7 +7203,7 @@ yydefault: } case 430: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4579 + //line php7/php7.y:4576 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -7221,7 +7218,7 @@ yydefault: } case 431: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4592 + //line php7/php7.y:4589 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -7236,7 +7233,7 @@ yydefault: } case 432: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4605 + //line php7/php7.y:4602 { yyVAL.node = expr.NewMethodCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -7250,7 +7247,7 @@ yydefault: } case 433: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4617 + //line php7/php7.y:4614 { yyVAL.node = yyDollar[1].node @@ -7258,7 +7255,7 @@ yydefault: } case 434: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4626 + //line php7/php7.y:4623 { yyVAL.node = yyDollar[1].node @@ -7266,7 +7263,7 @@ yydefault: } case 435: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4632 + //line php7/php7.y:4629 { yyVAL.node = yyDollar[1].node @@ -7274,7 +7271,7 @@ yydefault: } case 436: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4638 + //line php7/php7.y:4635 { yyVAL.node = expr.NewPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -7288,7 +7285,7 @@ yydefault: } case 437: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4653 + //line php7/php7.y:4650 { name := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(name) @@ -7304,7 +7301,7 @@ yydefault: } case 438: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4667 + //line php7/php7.y:4664 { yyVAL.node = expr.NewVariable(yyDollar[3].node) @@ -7320,7 +7317,7 @@ yydefault: } case 439: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4681 + //line php7/php7.y:4678 { yyVAL.node = expr.NewVariable(yyDollar[2].node) @@ -7334,7 +7331,7 @@ yydefault: } case 440: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4696 + //line php7/php7.y:4693 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -7348,7 +7345,7 @@ yydefault: } case 441: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4708 + //line php7/php7.y:4705 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -7362,7 +7359,7 @@ yydefault: } case 442: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4723 + //line php7/php7.y:4720 { yyVAL.node = yyDollar[1].node @@ -7370,7 +7367,7 @@ yydefault: } case 443: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4729 + //line php7/php7.y:4726 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -7385,7 +7382,7 @@ yydefault: } case 444: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4742 + //line php7/php7.y:4739 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -7400,7 +7397,7 @@ yydefault: } case 445: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4755 + //line php7/php7.y:4752 { yyVAL.node = expr.NewPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -7414,7 +7411,7 @@ yydefault: } case 446: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4767 + //line php7/php7.y:4764 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -7428,7 +7425,7 @@ yydefault: } case 447: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4779 + //line php7/php7.y:4776 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -7442,7 +7439,7 @@ yydefault: } case 448: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4794 + //line php7/php7.y:4791 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -7456,7 +7453,7 @@ yydefault: } case 449: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4806 + //line php7/php7.y:4803 { yyVAL.node = yyDollar[2].node @@ -7468,7 +7465,7 @@ yydefault: } case 450: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4816 + //line php7/php7.y:4813 { yyVAL.node = yyDollar[1].node @@ -7476,7 +7473,7 @@ yydefault: } case 451: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4825 + //line php7/php7.y:4822 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -7484,13 +7481,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.StringToken) + spew.Dump(yyDollar[1].token.Meta) + addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 452: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4837 + //line php7/php7.y:4835 { yyVAL.node = yyDollar[2].node @@ -7502,7 +7500,7 @@ yydefault: } case 453: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4847 + //line php7/php7.y:4845 { yyVAL.node = yyDollar[1].node @@ -7510,7 +7508,7 @@ yydefault: } case 454: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4856 + //line php7/php7.y:4854 { yyVAL.list = yyDollar[1].list @@ -7518,7 +7516,7 @@ yydefault: } case 455: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4865 + //line php7/php7.y:4863 { yyVAL.node = expr.NewArrayItem(nil, nil) @@ -7526,7 +7524,7 @@ yydefault: } case 456: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4871 + //line php7/php7.y:4869 { yyVAL.node = yyDollar[1].node @@ -7534,7 +7532,7 @@ yydefault: } case 457: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4880 + //line php7/php7.y:4878 { if len(yyDollar[1].list) == 0 { yyDollar[1].list = []node.Node{expr.NewArrayItem(nil, nil)} @@ -7543,13 +7541,13 @@ yydefault: yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) + addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 458: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4893 + //line php7/php7.y:4891 { if yyDollar[1].node.(*expr.ArrayItem).Key == nil && yyDollar[1].node.(*expr.ArrayItem).Val == nil { yyVAL.list = []node.Node{} @@ -7561,7 +7559,7 @@ yydefault: } case 459: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4906 + //line php7/php7.y:4904 { yyVAL.node = expr.NewArrayItem(yyDollar[1].node, yyDollar[3].node) @@ -7575,7 +7573,7 @@ yydefault: } case 460: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4918 + //line php7/php7.y:4916 { yyVAL.node = expr.NewArrayItem(nil, yyDollar[1].node) @@ -7586,7 +7584,7 @@ yydefault: } case 461: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4927 + //line php7/php7.y:4925 { reference := expr.NewReference(yyDollar[4].node) yyVAL.node = expr.NewArrayItem(yyDollar[1].node, reference) @@ -7603,7 +7601,7 @@ yydefault: } case 462: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4942 + //line php7/php7.y:4940 { reference := expr.NewReference(yyDollar[2].node) yyVAL.node = expr.NewArrayItem(nil, reference) @@ -7619,7 +7617,7 @@ yydefault: } case 463: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:4956 + //line php7/php7.y:4954 { // TODO: Cannot use list() as standalone expression list := expr.NewList(yyDollar[5].list) @@ -7639,7 +7637,7 @@ yydefault: } case 464: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4974 + //line php7/php7.y:4972 { // TODO: Cannot use list() as standalone expression list := expr.NewList(yyDollar[3].list) @@ -7658,7 +7656,7 @@ yydefault: } case 465: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4994 + //line php7/php7.y:4992 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -7666,7 +7664,7 @@ yydefault: } case 466: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5000 + //line php7/php7.y:4998 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yyVAL.list = append(yyDollar[1].list, encapsed) @@ -7681,7 +7679,7 @@ yydefault: } case 467: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5013 + //line php7/php7.y:5011 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -7689,7 +7687,7 @@ yydefault: } case 468: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5019 + //line php7/php7.y:5017 { encapsed := scalar.NewEncapsedStringPart(yyDollar[1].token.Value) yyVAL.list = []node.Node{encapsed, yyDollar[2].node} @@ -7704,7 +7702,7 @@ yydefault: } case 469: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5035 + //line php7/php7.y:5033 { name := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(name) @@ -7720,7 +7718,7 @@ yydefault: } case 470: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:5049 + //line php7/php7.y:5047 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -7740,7 +7738,7 @@ yydefault: } case 471: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5067 + //line php7/php7.y:5065 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -7756,13 +7754,13 @@ yydefault: // save comments addMeta(variable, yyDollar[1].token.Meta, meta.VariableToken) addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.ObjectOperatorToken) - addMeta(fetch, yyDollar[3].token.Meta, meta.StringToken) + addMeta(fetch, yyDollar[3].token.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 472: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5087 + //line php7/php7.y:5085 { yyVAL.node = expr.NewVariable(yyDollar[2].node) @@ -7777,7 +7775,7 @@ yydefault: } case 473: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5100 + //line php7/php7.y:5098 { name := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = expr.NewVariable(name) @@ -7788,14 +7786,14 @@ yydefault: // save comments addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.DollarOpenCurlyBracesToken) - addMeta(name, yyDollar[2].token.Meta, meta.StringVarnameToken) + addMeta(name, yyDollar[2].token.Meta, meta.IdentifierToken) addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 474: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:5116 + //line php7/php7.y:5114 { identifier := node.NewIdentifier(yyDollar[2].token.Value) variable := expr.NewVariable(identifier) @@ -7817,7 +7815,7 @@ yydefault: } case 475: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5136 + //line php7/php7.y:5134 { yyVAL.node = yyDollar[2].node @@ -7825,7 +7823,7 @@ yydefault: } case 476: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5145 + //line php7/php7.y:5143 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) @@ -7839,7 +7837,7 @@ yydefault: } case 477: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5157 + //line php7/php7.y:5155 { // TODO: add option to handle 64 bit integer if _, err := strconv.Atoi(yyDollar[1].token.Value); err == nil { @@ -7858,7 +7856,7 @@ yydefault: } case 478: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5174 + //line php7/php7.y:5172 { var lnumber *scalar.Lnumber // TODO: add option to handle 64 bit integer @@ -7891,7 +7889,7 @@ yydefault: } case 479: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5205 + //line php7/php7.y:5203 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(identifier) @@ -7907,7 +7905,7 @@ yydefault: } case 480: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:5222 + //line php7/php7.y:5220 { yyVAL.node = expr.NewIsset(yyDollar[3].list) @@ -7926,7 +7924,7 @@ yydefault: } case 481: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:5239 + //line php7/php7.y:5237 { yyVAL.node = expr.NewEmpty(yyDollar[3].node) @@ -7942,7 +7940,7 @@ yydefault: } case 482: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5253 + //line php7/php7.y:5251 { yyVAL.node = expr.NewInclude(yyDollar[2].node) @@ -7956,7 +7954,7 @@ yydefault: } case 483: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5265 + //line php7/php7.y:5263 { yyVAL.node = expr.NewIncludeOnce(yyDollar[2].node) @@ -7970,7 +7968,7 @@ yydefault: } case 484: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:5277 + //line php7/php7.y:5275 { yyVAL.node = expr.NewEval(yyDollar[3].node) @@ -7986,7 +7984,7 @@ yydefault: } case 485: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5291 + //line php7/php7.y:5289 { yyVAL.node = expr.NewRequire(yyDollar[2].node) @@ -8000,7 +7998,7 @@ yydefault: } case 486: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5303 + //line php7/php7.y:5301 { yyVAL.node = expr.NewRequireOnce(yyDollar[2].node) @@ -8014,7 +8012,7 @@ yydefault: } case 487: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5318 + //line php7/php7.y:5316 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -8022,18 +8020,18 @@ yydefault: } case 488: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5324 + //line php7/php7.y:5322 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) + addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 489: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5336 + //line php7/php7.y:5334 { yyVAL.node = yyDollar[1].node diff --git a/php7/php7.y b/php7/php7.y index bc6c4bd..8b90edc 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -15,6 +15,8 @@ import ( "github.com/z7zmey/php-parser/node/expr/assign" "github.com/z7zmey/php-parser/node/expr/binary" "github.com/z7zmey/php-parser/node/expr/cast" + + "github.com/davecgh/go-spew/spew" ) %} @@ -304,6 +306,10 @@ start: yylex.(*Parser).rootNode.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + + if yylex.(*Parser).currentToken.Value == "\xff" { + addMeta(yylex.(*Parser).rootNode, yylex.(*Parser).currentToken.Meta, meta.NodeEnd) + } } ; @@ -594,7 +600,7 @@ use_type: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.FunctionToken) + addMeta($$, $1.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -606,7 +612,7 @@ use_type: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.ConstToken) + addMeta($$, $1.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -713,7 +719,7 @@ inline_use_declarations: $$ = append($1, $3) // save comments - addMeta(lastNode($1), $2.Meta, meta.CommaToken) + addMeta(lastNode($1), $2.Meta, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -731,7 +737,7 @@ unprefixed_use_declarations: $$ = append($1, $3) // save comments - addMeta(lastNode($1), $2.Meta, meta.CommaToken) + addMeta(lastNode($1), $2.Meta, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -749,7 +755,7 @@ use_declarations: $$ = append($1, $3) // save comments - addMeta(lastNode($1), $2.Meta, meta.CommaToken) + addMeta(lastNode($1), $2.Meta, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -801,7 +807,7 @@ unprefixed_use_declaration: // save comments addMeta($$, $2.Meta, meta.AsToken) - addMeta(alias, $3.Meta, meta.StringToken) + addMeta(alias, $3.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -831,7 +837,7 @@ const_list: $$ = append($1, $3) // save comments - addMeta(lastNode($1), $2.Meta, meta.CommaToken) + addMeta(lastNode($1), $2.Meta, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1265,7 +1271,7 @@ statement: // save comments addMeta($$, $1.Meta, meta.GotoToken) - addMeta(label, $2.Meta, meta.StringToken) + addMeta(label, $2.Meta, meta.IdentifierToken) addMeta($$, $3.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -1280,7 +1286,7 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - addMeta(label, $1.Meta, meta.StringToken) + addMeta(label, $1.Meta, meta.IdentifierToken) addMeta($$, $2.Meta, meta.ColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -1308,7 +1314,7 @@ catch_list: // save comments addMeta(catch, $2.Meta, meta.CatchToken) addMeta(catch, $3.Meta, meta.OpenParenthesisToken) - addMeta(variable, $5.Meta, meta.StringToken) + addMeta(variable, $5.Meta, meta.VariableToken) addMeta(catch, $6.Meta, meta.CloseParenthesisToken) addMeta(catch, $7.Meta, meta.OpenCurlyBracesToken) addMeta(catch, $9.Meta, meta.CloseCurlyBracesToken) @@ -1328,7 +1334,7 @@ catch_name_list: $$ = append($1, $3) // save comments - addMeta(lastNode($1), $2.Meta, meta.VerticalBarToken) + addMeta(lastNode($1), $2.Meta, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1369,7 +1375,7 @@ unset_variables: $$ = append($1, $3) // save comments - addMeta(lastNode($1), $2.Meta, meta.CommaToken) + addMeta(lastNode($1), $2.Meta, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1400,7 +1406,7 @@ function_declaration_statement: if $2 != nil { addMeta($$, $2.Meta, meta.AmpersandToken) } - addMeta(name, $3.Meta, meta.StringToken) + addMeta(name, $3.Meta, meta.IdentifierToken) addMeta($$, $5.Meta, meta.OpenParenthesisToken) addMeta($$, $7.Meta, meta.CloseParenthesisToken) addMeta($$, $9.Meta, meta.OpenCurlyBracesToken) @@ -1444,7 +1450,7 @@ class_declaration_statement: // save comments addMeta($$, $2.Meta, meta.ClassToken) - addMeta(name, $3.Meta, meta.StringToken) + addMeta(name, $3.Meta, meta.IdentifierToken) addMeta($$, $7.Meta, meta.OpenCurlyBracesToken) addMeta($$, $9.Meta, meta.CloseCurlyBracesToken) @@ -1461,7 +1467,7 @@ class_declaration_statement: // save comments addMeta($$, $1.Meta, meta.ClassToken) - addMeta(name, $2.Meta, meta.StringToken) + addMeta(name, $2.Meta, meta.IdentifierToken) addMeta($$, $6.Meta, meta.OpenCurlyBracesToken) addMeta($$, $8.Meta, meta.CloseCurlyBracesToken) @@ -1493,7 +1499,7 @@ class_modifier: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.AbstractToken) + addMeta($$, $1.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1505,7 +1511,7 @@ class_modifier: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.FinalToken) + addMeta($$, $1.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1523,7 +1529,7 @@ trait_declaration_statement: // save comments addMeta($$, $1.Meta, meta.TraitToken) - addMeta(name, $2.Meta, meta.StringToken) + addMeta(name, $2.Meta, meta.IdentifierToken) addMeta($$, $4.Meta, meta.OpenCurlyBracesToken) addMeta($$, $6.Meta, meta.CloseCurlyBracesToken) @@ -1543,7 +1549,7 @@ interface_declaration_statement: // save comments addMeta($$, $1.Meta, meta.InterfaceToken) - addMeta(name, $2.Meta, meta.StringToken) + addMeta(name, $2.Meta, meta.IdentifierToken) addMeta($$, $5.Meta, meta.OpenCurlyBracesToken) addMeta($$, $7.Meta, meta.CloseCurlyBracesToken) @@ -1783,8 +1789,8 @@ switch_case_list: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - addMeta(caseList, $1.Meta, meta.ColonToken) - addMeta(caseList, $3.Meta, meta.EndswitchToken) + addMeta($$, $1.Meta, meta.ColonToken) + addMeta($$, $3.Meta, meta.EndswitchToken) addMeta($$, $4.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -1800,9 +1806,9 @@ switch_case_list: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5)) // save comments - addMeta(caseList, $1.Meta, meta.ColonToken) - addMeta(caseList, $2.Meta, meta.SemiColonToken) - addMeta(caseList, $4.Meta, meta.EndswitchToken) + addMeta($$, $1.Meta, meta.ColonToken) + addMeta($$, $2.Meta, meta.SwitchSemicolonToken) + addMeta($$, $4.Meta, meta.EndswitchToken) addMeta($$, $5.Meta, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -1935,7 +1941,7 @@ if_stmt: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.ElseToken) + addMeta(_else, $2.Meta, meta.ElseToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2041,7 +2047,7 @@ non_empty_parameter_list: $$ = append($1, $3) // save comments - addMeta(lastNode($1), $2.Meta, meta.CommaToken) + addMeta(lastNode($1), $2.Meta, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2156,7 +2162,7 @@ type: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.ArrayToken) + addMeta($$, $1.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2168,7 +2174,7 @@ type: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.CallableToken) + addMeta($$, $1.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2242,7 +2248,7 @@ non_empty_argument_list: $$ = append($1, $3) // save comments - addMeta(lastNode($1), $2.Meta, meta.CommaToken) + addMeta(lastNode($1), $2.Meta, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2278,7 +2284,7 @@ global_var_list: $$ = append($1, $3) // save comments - addMeta(lastNode($1), $2.Meta, meta.CommaToken) + addMeta(lastNode($1), $2.Meta, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2305,7 +2311,7 @@ static_var_list: $$ = append($1, $3) // save comments - addMeta(lastNode($1), $2.Meta, meta.CommaToken) + addMeta(lastNode($1), $2.Meta, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2396,16 +2402,7 @@ class_statement: } | T_USE name_list trait_adaptations { - var adaptationList *stmt.TraitAdaptationList - - switch n := $3.(type) { - case *stmt.TraitAdaptationList: - adaptationList = n - default: - adaptationList = nil - } - - $$ = stmt.NewTraitUse($2, adaptationList) + $$ = stmt.NewTraitUse($2, $3) // save position $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) @@ -2453,7 +2450,7 @@ name_list: $$ = append($1, $3) // save comments - addMeta(lastNode($1), $2.Meta, meta.CommaToken) + addMeta(lastNode($1), $2.Meta, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2561,7 +2558,7 @@ trait_alias: // save comments addMeta($$, $2.Meta, meta.AsToken) - addMeta(alias, $3.Meta, meta.StringToken) + addMeta(alias, $3.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2576,7 +2573,7 @@ trait_alias: // save comments addMeta($$, $2.Meta, meta.AsToken) - addMeta(alias, $3.Meta, meta.StringToken) + addMeta(alias, $3.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2694,7 +2691,7 @@ variable_modifiers: modifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta(modifier, $1.Meta, meta.VarToken) + addMeta(modifier, $1.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2739,7 +2736,7 @@ member_modifier: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.PublicToken) + addMeta($$, $1.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2751,7 +2748,7 @@ member_modifier: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.ProtectedToken) + addMeta($$, $1.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2763,7 +2760,7 @@ member_modifier: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.PrivateToken) + addMeta($$, $1.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2775,7 +2772,7 @@ member_modifier: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.StaticToken) + addMeta($$, $1.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2787,7 +2784,7 @@ member_modifier: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.AbstractToken) + addMeta($$, $1.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2799,7 +2796,7 @@ member_modifier: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.FinalToken) + addMeta($$, $1.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2811,7 +2808,7 @@ property_list: $$ = append($1, $3) // save comments - addMeta(lastNode($1), $2.Meta, meta.CommaToken) + addMeta(lastNode($1), $2.Meta, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2865,7 +2862,7 @@ class_const_list: $$ = append($1, $3) // save comments - addMeta(lastNode($1), $2.Meta, meta.CommaToken) + addMeta(lastNode($1), $2.Meta, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2906,7 +2903,7 @@ const_decl: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) // save comments - addMeta(name, $1.Meta, meta.StringToken) + addMeta(name, $1.Meta, meta.IdentifierToken) addMeta($$, $2.Meta, meta.EqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -2919,7 +2916,7 @@ echo_expr_list: $$ = append($1, $3) // save comments - addMeta(lastNode($1), $2.Meta, meta.CommaToken) + addMeta(lastNode($1), $2.Meta, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2961,7 +2958,7 @@ non_empty_for_exprs: $$ = append($1, $3) // save comments - addMeta(lastNode($1), $2.Meta, meta.CommaToken) + addMeta(lastNode($1), $2.Meta, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4012,7 +4009,7 @@ lexical_var_list: $$ = append($1, $3) // save comments - addMeta(lastNode($1), $2.Meta, meta.CommaToken) + addMeta(lastNode($1), $2.Meta, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4112,7 +4109,7 @@ class_name: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.StaticToken) + addMeta($$, $1.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4154,8 +4151,8 @@ exit_expr: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - addMeta($$, $1.Meta, meta.OpenParenthesisToken) - addMeta($$, $3.Meta, meta.CloseParenthesisToken) + addMeta($2, $1.Meta, meta.OpenParenthesisToken) + addMeta($2, $3.Meta, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4272,7 +4269,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.LineToken) + addMeta($$, $1.Meta, meta.MagicConstantToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4284,7 +4281,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.FileToken) + addMeta($$, $1.Meta, meta.MagicConstantToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4296,7 +4293,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.DirToken) + addMeta($$, $1.Meta, meta.MagicConstantToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4308,7 +4305,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.TraitCToken) + addMeta($$, $1.Meta, meta.MagicConstantToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4320,7 +4317,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.MethodCToken) + addMeta($$, $1.Meta, meta.MagicConstantToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4332,7 +4329,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.FuncCToken) + addMeta($$, $1.Meta, meta.MagicConstantToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4344,7 +4341,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.NsCToken) + addMeta($$, $1.Meta, meta.MagicConstantToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4356,7 +4353,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.ClassCToken) + addMeta($$, $1.Meta, meta.MagicConstantToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4829,7 +4826,8 @@ property_name: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.StringToken) + spew.Dump($1.Meta) + addMeta($$, $1.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4885,7 +4883,7 @@ non_empty_array_pair_list: $$ = append($1, $3) // save comments - addMeta(lastNode($1), $2.Meta, meta.CommaToken) + addMeta(lastNode($1), $2.Meta, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5079,7 +5077,7 @@ encaps_var: // save comments addMeta(variable, $1.Meta, meta.VariableToken) addMeta($$, $2.Meta, meta.ObjectOperatorToken) - addMeta(fetch, $3.Meta, meta.StringToken) + addMeta(fetch, $3.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5107,7 +5105,7 @@ encaps_var: // save comments addMeta($$, $1.Meta, meta.DollarOpenCurlyBracesToken) - addMeta(name, $2.Meta, meta.StringVarnameToken) + addMeta(name, $2.Meta, meta.IdentifierToken) addMeta($$, $3.Meta, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -5325,7 +5323,7 @@ isset_variables: $$ = append($1, $3) // save comments - addMeta(lastNode($1), $2.Meta, meta.CommaToken) + addMeta(lastNode($1), $2.Meta, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php7/php7_test.go b/php7/php7_test.go index 9dc3546..74645fb 100644 --- a/php7/php7_test.go +++ b/php7/php7_test.go @@ -464,8 +464,8 @@ func TestPhp7(t *testing.T) { StartPos: 14, EndPos: 18, }, - IsReference: false, Variadic: true, + IsReference: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 2, @@ -561,8 +561,8 @@ func TestPhp7(t *testing.T) { StartPos: 33, EndPos: 37, }, - Variadic: true, IsReference: false, + Variadic: true, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 3, @@ -640,8 +640,8 @@ func TestPhp7(t *testing.T) { StartPos: 53, EndPos: 54, }, - IsReference: false, Variadic: false, + IsReference: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 4, @@ -667,8 +667,8 @@ func TestPhp7(t *testing.T) { StartPos: 57, EndPos: 61, }, - Variadic: true, IsReference: false, + Variadic: true, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 4, @@ -775,8 +775,8 @@ func TestPhp7(t *testing.T) { StartPos: 80, EndPos: 84, }, - Variadic: true, IsReference: false, + Variadic: true, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 5, @@ -881,8 +881,8 @@ func TestPhp7(t *testing.T) { StartPos: 104, EndPos: 108, }, - Variadic: true, IsReference: false, + Variadic: true, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 6, @@ -1862,8 +1862,8 @@ func TestPhp7(t *testing.T) { StartPos: 446, EndPos: 457, }, - ByRef: true, Variadic: true, + ByRef: true, VariableType: &name.Name{ Position: &position.Position{ StartLine: 20, @@ -2011,8 +2011,8 @@ func TestPhp7(t *testing.T) { StartPos: 498, EndPos: 509, }, - Variadic: true, ByRef: true, + Variadic: true, VariableType: &name.Name{ Position: &position.Position{ StartLine: 21, @@ -3743,8 +3743,8 @@ func TestPhp7(t *testing.T) { StartPos: 1549, EndPos: 1580, }, - PhpDocComment: "", ReturnsRef: true, + PhpDocComment: "", MethodName: &node.Identifier{ Position: &position.Position{ StartLine: 73, @@ -3811,8 +3811,8 @@ func TestPhp7(t *testing.T) { StartPos: 1597, EndPos: 1634, }, - ReturnsRef: true, PhpDocComment: "", + ReturnsRef: true, MethodName: &node.Identifier{ Position: &position.Position{ StartLine: 74, @@ -6749,6 +6749,14 @@ func TestPhp7(t *testing.T) { }, }, }, + TraitAdaptationList: &stmt.Nop{ + Position: &position.Position{ + StartLine: 147, + EndLine: 147, + StartPos: 3164, + EndPos: 3164, + }, + }, }, }, }, @@ -9277,9 +9285,9 @@ func TestPhp7(t *testing.T) { StartPos: 4157, EndPos: 4189, }, - PhpDocComment: "", ReturnsRef: false, Static: false, + PhpDocComment: "", Params: []node.Node{ &node.Parameter{ Position: &position.Position{ @@ -14978,8 +14986,8 @@ func TestPhp7(t *testing.T) { StartPos: 5933, EndPos: 5975, }, - PhpDocComment: "", ReturnsRef: false, + PhpDocComment: "", FunctionName: &node.Identifier{ Position: &position.Position{ StartLine: 329, @@ -15033,8 +15041,8 @@ func TestPhp7(t *testing.T) { StartPos: 5955, EndPos: 5963, }, - Variadic: true, ByRef: false, + Variadic: true, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 329, @@ -15108,8 +15116,8 @@ func TestPhp7(t *testing.T) { StartPos: 5979, EndPos: 6016, }, - ReturnsRef: false, PhpDocComment: "", + ReturnsRef: false, FunctionName: &node.Identifier{ Position: &position.Position{ StartLine: 330, diff --git a/printer/pretty_printer.go b/printer/pretty_printer.go new file mode 100644 index 0000000..9fd17e6 --- /dev/null +++ b/printer/pretty_printer.go @@ -0,0 +1,2182 @@ +package printer + +import ( + "io" + "strings" + + "github.com/z7zmey/php-parser/node/stmt" + + "github.com/z7zmey/php-parser/node" + "github.com/z7zmey/php-parser/node/expr" + "github.com/z7zmey/php-parser/node/expr/assign" + "github.com/z7zmey/php-parser/node/expr/binary" + "github.com/z7zmey/php-parser/node/expr/cast" + "github.com/z7zmey/php-parser/node/name" + "github.com/z7zmey/php-parser/node/scalar" +) + +type PrettyPrinter struct { + w io.Writer + indentStr string + indentDepth int +} + +// NewPrettyPrinter - Constructor for PrettyPrinter +func NewPrettyPrinter(w io.Writer, indentStr string) *PrettyPrinter { + return &PrettyPrinter{ + w: w, + indentStr: indentStr, + indentDepth: 0, + } +} + +func (p *PrettyPrinter) Print(n node.Node) { + p.printNode(n) +} + +func (p *PrettyPrinter) joinPrint(glue string, nn []node.Node) { + for k, n := range nn { + if k > 0 { + io.WriteString(p.w, glue) + } + + p.Print(n) + } +} + +func (p *PrettyPrinter) printNodes(nn []node.Node) { + p.indentDepth++ + l := len(nn) - 1 + for k, n := range nn { + p.printIndent() + p.Print(n) + if k < l { + io.WriteString(p.w, "\n") + } + } + p.indentDepth-- +} + +func (p *PrettyPrinter) printIndent() { + for i := 0; i < p.indentDepth; i++ { + io.WriteString(p.w, p.indentStr) + } +} + +func (p *PrettyPrinter) printNode(n node.Node) { + switch n.(type) { + + // node + + case *node.Root: + p.printNodeRoot(n) + case *node.Identifier: + p.printNodeIdentifier(n) + case *node.Parameter: + p.printNodeParameter(n) + case *node.Nullable: + p.printNodeNullable(n) + case *node.Argument: + p.printNodeArgument(n) + + // name + + case *name.NamePart: + p.printNameNamePart(n) + case *name.Name: + p.printNameName(n) + case *name.FullyQualified: + p.printNameFullyQualified(n) + case *name.Relative: + p.printNameRelative(n) + + // scalar + + case *scalar.Lnumber: + p.printScalarLNumber(n) + case *scalar.Dnumber: + p.printScalarDNumber(n) + case *scalar.String: + p.printScalarString(n) + case *scalar.EncapsedStringPart: + p.printScalarEncapsedStringPart(n) + case *scalar.Encapsed: + p.printScalarEncapsed(n) + case *scalar.Heredoc: + p.printScalarHeredoc(n) + case *scalar.MagicConstant: + p.printScalarMagicConstant(n) + + // assign + + case *assign.Assign: + p.printAssign(n) + case *assign.Reference: + p.printReference(n) + case *assign.BitwiseAnd: + p.printAssignBitwiseAnd(n) + case *assign.BitwiseOr: + p.printAssignBitwiseOr(n) + case *assign.BitwiseXor: + p.printAssignBitwiseXor(n) + case *assign.Concat: + p.printAssignConcat(n) + case *assign.Div: + p.printAssignDiv(n) + case *assign.Minus: + p.printAssignMinus(n) + case *assign.Mod: + p.printAssignMod(n) + case *assign.Mul: + p.printAssignMul(n) + case *assign.Plus: + p.printAssignPlus(n) + case *assign.Pow: + p.printAssignPow(n) + case *assign.ShiftLeft: + p.printAssignShiftLeft(n) + case *assign.ShiftRight: + p.printAssignShiftRight(n) + + // binary + + case *binary.BitwiseAnd: + p.printBinaryBitwiseAnd(n) + case *binary.BitwiseOr: + p.printBinaryBitwiseOr(n) + case *binary.BitwiseXor: + p.printBinaryBitwiseXor(n) + case *binary.BooleanAnd: + p.printBinaryBooleanAnd(n) + case *binary.BooleanOr: + p.printBinaryBooleanOr(n) + case *binary.Coalesce: + p.printBinaryCoalesce(n) + case *binary.Concat: + p.printBinaryConcat(n) + case *binary.Div: + p.printBinaryDiv(n) + case *binary.Equal: + p.printBinaryEqual(n) + case *binary.GreaterOrEqual: + p.printBinaryGreaterOrEqual(n) + case *binary.Greater: + p.printBinaryGreater(n) + case *binary.Identical: + p.printBinaryIdentical(n) + case *binary.LogicalAnd: + p.printBinaryLogicalAnd(n) + case *binary.LogicalOr: + p.printBinaryLogicalOr(n) + case *binary.LogicalXor: + p.printBinaryLogicalXor(n) + case *binary.Minus: + p.printBinaryMinus(n) + case *binary.Mod: + p.printBinaryMod(n) + case *binary.Mul: + p.printBinaryMul(n) + case *binary.NotEqual: + p.printBinaryNotEqual(n) + case *binary.NotIdentical: + p.printBinaryNotIdentical(n) + case *binary.Plus: + p.printBinaryPlus(n) + case *binary.Pow: + p.printBinaryPow(n) + case *binary.ShiftLeft: + p.printBinaryShiftLeft(n) + case *binary.ShiftRight: + p.printBinaryShiftRight(n) + case *binary.SmallerOrEqual: + p.printBinarySmallerOrEqual(n) + case *binary.Smaller: + p.printBinarySmaller(n) + case *binary.Spaceship: + p.printBinarySpaceship(n) + + // cast + + case *cast.Array: + p.printArray(n) + case *cast.Bool: + p.printBool(n) + case *cast.Double: + p.printDouble(n) + case *cast.Int: + p.printInt(n) + case *cast.Object: + p.printObject(n) + case *cast.String: + p.printString(n) + case *cast.Unset: + p.printUnset(n) + + // expr + + case *expr.ArrayDimFetch: + p.printExprArrayDimFetch(n) + case *expr.ArrayItem: + p.printExprArrayItem(n) + case *expr.Array: + p.printExprArray(n) + case *expr.BitwiseNot: + p.printExprBitwiseNot(n) + case *expr.BooleanNot: + p.printExprBooleanNot(n) + case *expr.ClassConstFetch: + p.printExprClassConstFetch(n) + case *expr.Clone: + p.printExprClone(n) + case *expr.ClosureUse: + p.printExprClosureUse(n) + case *expr.Closure: + p.printExprClosure(n) + case *expr.ConstFetch: + p.printExprConstFetch(n) + case *expr.Die: + p.printExprDie(n) + case *expr.Empty: + p.printExprEmpty(n) + case *expr.ErrorSuppress: + p.printExprErrorSuppress(n) + case *expr.Eval: + p.printExprEval(n) + case *expr.Exit: + p.printExprExit(n) + case *expr.FunctionCall: + p.printExprFunctionCall(n) + case *expr.Include: + p.printExprInclude(n) + case *expr.IncludeOnce: + p.printExprIncludeOnce(n) + case *expr.InstanceOf: + p.printExprInstanceOf(n) + case *expr.Isset: + p.printExprIsset(n) + case *expr.List: + p.printExprList(n) + case *expr.MethodCall: + p.printExprMethodCall(n) + case *expr.New: + p.printExprNew(n) + case *expr.PostDec: + p.printExprPostDec(n) + case *expr.PostInc: + p.printExprPostInc(n) + case *expr.PreDec: + p.printExprPreDec(n) + case *expr.PreInc: + p.printExprPreInc(n) + case *expr.Print: + p.printExprPrint(n) + case *expr.PropertyFetch: + p.printExprPropertyFetch(n) + case *expr.Reference: + p.printExprReference(n) + case *expr.Require: + p.printExprRequire(n) + case *expr.RequireOnce: + p.printExprRequireOnce(n) + case *expr.ShellExec: + p.printExprShellExec(n) + case *expr.ShortArray: + p.printExprShortArray(n) + case *expr.ShortList: + p.printExprShortList(n) + case *expr.StaticCall: + p.printExprStaticCall(n) + case *expr.StaticPropertyFetch: + p.printExprStaticPropertyFetch(n) + case *expr.Ternary: + p.printExprTernary(n) + case *expr.UnaryMinus: + p.printExprUnaryMinus(n) + case *expr.UnaryPlus: + p.printExprUnaryPlus(n) + case *expr.Variable: + p.printExprVariable(n) + case *expr.YieldFrom: + p.printExprYieldFrom(n) + case *expr.Yield: + p.printExprYield(n) + + // stmt + + case *stmt.AltElseIf: + p.printStmtAltElseIf(n) + case *stmt.AltElse: + p.printStmtAltElse(n) + case *stmt.AltFor: + p.printStmtAltFor(n) + case *stmt.AltForeach: + p.printStmtAltForeach(n) + case *stmt.AltIf: + p.printStmtAltIf(n) + case *stmt.AltSwitch: + p.printStmtAltSwitch(n) + case *stmt.AltWhile: + p.printStmtAltWhile(n) + case *stmt.Break: + p.printStmtBreak(n) + case *stmt.Case: + p.printStmtCase(n) + case *stmt.Catch: + p.printStmtCatch(n) + case *stmt.ClassMethod: + p.printStmtClassMethod(n) + case *stmt.Class: + p.printStmtClass(n) + case *stmt.ClassConstList: + p.printStmtClassConstList(n) + case *stmt.Constant: + p.printStmtConstant(n) + case *stmt.Continue: + p.printStmtContinue(n) + case *stmt.Declare: + p.printStmtDeclare(n) + case *stmt.Default: + p.printStmtDefault(n) + case *stmt.Do: + p.printStmtDo(n) + case *stmt.Echo: + p.printStmtEcho(n) + case *stmt.ElseIf: + p.printStmtElseif(n) + case *stmt.Else: + p.printStmtElse(n) + case *stmt.Expression: + p.printStmtExpression(n) + case *stmt.Finally: + p.printStmtFinally(n) + case *stmt.For: + p.printStmtFor(n) + case *stmt.Foreach: + p.printStmtForeach(n) + case *stmt.Function: + p.printStmtFunction(n) + case *stmt.Global: + p.printStmtGlobal(n) + case *stmt.Goto: + p.printStmtGoto(n) + case *stmt.GroupUse: + p.printStmtGroupUse(n) + case *stmt.HaltCompiler: + p.printStmtHaltCompiler(n) + case *stmt.If: + p.printStmtIf(n) + case *stmt.InlineHtml: + p.printStmtInlineHTML(n) + case *stmt.Interface: + p.printStmtInterface(n) + case *stmt.Label: + p.printStmtLabel(n) + case *stmt.Namespace: + p.printStmtNamespace(n) + case *stmt.Nop: + p.printStmtNop(n) + case *stmt.PropertyList: + p.printStmtPropertyList(n) + case *stmt.Property: + p.printStmtProperty(n) + case *stmt.Return: + p.printStmtReturn(n) + case *stmt.StaticVar: + p.printStmtStaticVar(n) + case *stmt.Static: + p.printStmtStatic(n) + case *stmt.StmtList: + p.printStmtStmtList(n) + case *stmt.Switch: + p.printStmtSwitch(n) + case *stmt.Throw: + p.printStmtThrow(n) + case *stmt.TraitMethodRef: + p.printStmtTraitMethodRef(n) + case *stmt.TraitUseAlias: + p.printStmtTraitUseAlias(n) + case *stmt.TraitUsePrecedence: + p.printStmtTraitUsePrecedence(n) + case *stmt.TraitUse: + p.printStmtTraitUse(n) + case *stmt.Trait: + p.printStmtTrait(n) + case *stmt.Try: + p.printStmtTry(n) + case *stmt.Unset: + p.printStmtUnset(n) + case *stmt.UseList: + p.printStmtUseList(n) + case *stmt.Use: + p.printStmtUse(n) + case *stmt.While: + p.printStmtWhile(n) + } +} + +// node + +func (p *PrettyPrinter) printNodeRoot(n node.Node) { + v := n.(*node.Root) + + if len(v.Stmts) > 0 { + firstStmt := v.Stmts[0] + v.Stmts = v.Stmts[1:] + + switch fs := firstStmt.(type) { + case *stmt.InlineHtml: + io.WriteString(p.w, fs.Value) + io.WriteString(p.w, " 0 { + io.WriteString(p.w, "\\") + } + + p.Print(part) + } +} + +func (p *PrettyPrinter) printNameFullyQualified(n node.Node) { + nn := n.(*name.FullyQualified) + + for _, part := range nn.Parts { + io.WriteString(p.w, "\\") + p.Print(part) + } +} + +func (p *PrettyPrinter) printNameRelative(n node.Node) { + nn := n.(*name.Relative) + + io.WriteString(p.w, "namespace") + for _, part := range nn.Parts { + io.WriteString(p.w, "\\") + p.Print(part) + } +} + +// scalar + +func (p *PrettyPrinter) printScalarLNumber(n node.Node) { + v := n.(*scalar.Lnumber).Value + io.WriteString(p.w, v) +} + +func (p *PrettyPrinter) printScalarDNumber(n node.Node) { + v := n.(*scalar.Dnumber).Value + io.WriteString(p.w, v) +} + +func (p *PrettyPrinter) printScalarString(n node.Node) { + v := n.(*scalar.String).Value + + io.WriteString(p.w, v) +} + +func (p *PrettyPrinter) printScalarEncapsedStringPart(n node.Node) { + v := n.(*scalar.EncapsedStringPart).Value + io.WriteString(p.w, v) +} + +func (p *PrettyPrinter) printScalarEncapsed(n node.Node) { + io.WriteString(p.w, "\"") + + for _, nn := range n.(*scalar.Encapsed).Parts { + p.Print(nn) + } + + io.WriteString(p.w, "\"") +} + +func (p *PrettyPrinter) printScalarHeredoc(n node.Node) { + nn := n.(*scalar.Heredoc) + + io.WriteString(p.w, "<<<") + io.WriteString(p.w, nn.Label) + io.WriteString(p.w, "\n") + + for _, nn := range nn.Parts { + p.Print(nn) + } + + io.WriteString(p.w, strings.Trim(nn.Label, "\"'")) +} + +func (p *PrettyPrinter) printScalarMagicConstant(n node.Node) { + v := n.(*scalar.MagicConstant).Value + io.WriteString(p.w, v) +} + +// Assign + +func (p *PrettyPrinter) printAssign(n node.Node) { + nn := n.(*assign.Assign) + p.Print(nn.Variable) + io.WriteString(p.w, " = ") + p.Print(nn.Expression) +} + +func (p *PrettyPrinter) printReference(n node.Node) { + nn := n.(*assign.Reference) + p.Print(nn.Variable) + io.WriteString(p.w, " =& ") + p.Print(nn.Expression) +} + +func (p *PrettyPrinter) printAssignBitwiseAnd(n node.Node) { + nn := n.(*assign.BitwiseAnd) + p.Print(nn.Variable) + io.WriteString(p.w, " &= ") + p.Print(nn.Expression) +} + +func (p *PrettyPrinter) printAssignBitwiseOr(n node.Node) { + nn := n.(*assign.BitwiseOr) + p.Print(nn.Variable) + io.WriteString(p.w, " |= ") + p.Print(nn.Expression) +} + +func (p *PrettyPrinter) printAssignBitwiseXor(n node.Node) { + nn := n.(*assign.BitwiseXor) + p.Print(nn.Variable) + io.WriteString(p.w, " ^= ") + p.Print(nn.Expression) +} + +func (p *PrettyPrinter) printAssignConcat(n node.Node) { + nn := n.(*assign.Concat) + p.Print(nn.Variable) + io.WriteString(p.w, " .= ") + p.Print(nn.Expression) +} + +func (p *PrettyPrinter) printAssignDiv(n node.Node) { + nn := n.(*assign.Div) + p.Print(nn.Variable) + io.WriteString(p.w, " /= ") + p.Print(nn.Expression) +} + +func (p *PrettyPrinter) printAssignMinus(n node.Node) { + nn := n.(*assign.Minus) + p.Print(nn.Variable) + io.WriteString(p.w, " -= ") + p.Print(nn.Expression) +} + +func (p *PrettyPrinter) printAssignMod(n node.Node) { + nn := n.(*assign.Mod) + p.Print(nn.Variable) + io.WriteString(p.w, " %= ") + p.Print(nn.Expression) +} + +func (p *PrettyPrinter) printAssignMul(n node.Node) { + nn := n.(*assign.Mul) + p.Print(nn.Variable) + io.WriteString(p.w, " *= ") + p.Print(nn.Expression) +} + +func (p *PrettyPrinter) printAssignPlus(n node.Node) { + nn := n.(*assign.Plus) + p.Print(nn.Variable) + io.WriteString(p.w, " += ") + p.Print(nn.Expression) +} + +func (p *PrettyPrinter) printAssignPow(n node.Node) { + nn := n.(*assign.Pow) + p.Print(nn.Variable) + io.WriteString(p.w, " **= ") + p.Print(nn.Expression) +} + +func (p *PrettyPrinter) printAssignShiftLeft(n node.Node) { + nn := n.(*assign.ShiftLeft) + p.Print(nn.Variable) + io.WriteString(p.w, " <<= ") + p.Print(nn.Expression) +} + +func (p *PrettyPrinter) printAssignShiftRight(n node.Node) { + nn := n.(*assign.ShiftRight) + p.Print(nn.Variable) + io.WriteString(p.w, " >>= ") + p.Print(nn.Expression) +} + +// binary + +func (p *PrettyPrinter) printBinaryBitwiseAnd(n node.Node) { + nn := n.(*binary.BitwiseAnd) + + p.Print(nn.Left) + io.WriteString(p.w, " & ") + p.Print(nn.Right) +} + +func (p *PrettyPrinter) printBinaryBitwiseOr(n node.Node) { + nn := n.(*binary.BitwiseOr) + + p.Print(nn.Left) + io.WriteString(p.w, " | ") + p.Print(nn.Right) +} + +func (p *PrettyPrinter) printBinaryBitwiseXor(n node.Node) { + nn := n.(*binary.BitwiseXor) + + p.Print(nn.Left) + io.WriteString(p.w, " ^ ") + p.Print(nn.Right) +} + +func (p *PrettyPrinter) printBinaryBooleanAnd(n node.Node) { + nn := n.(*binary.BooleanAnd) + + p.Print(nn.Left) + io.WriteString(p.w, " && ") + p.Print(nn.Right) +} + +func (p *PrettyPrinter) printBinaryBooleanOr(n node.Node) { + nn := n.(*binary.BooleanOr) + + p.Print(nn.Left) + io.WriteString(p.w, " || ") + p.Print(nn.Right) +} + +func (p *PrettyPrinter) printBinaryCoalesce(n node.Node) { + nn := n.(*binary.Coalesce) + + p.Print(nn.Left) + io.WriteString(p.w, " ?? ") + p.Print(nn.Right) +} + +func (p *PrettyPrinter) printBinaryConcat(n node.Node) { + nn := n.(*binary.Concat) + + p.Print(nn.Left) + io.WriteString(p.w, " . ") + p.Print(nn.Right) +} + +func (p *PrettyPrinter) printBinaryDiv(n node.Node) { + nn := n.(*binary.Div) + + p.Print(nn.Left) + io.WriteString(p.w, " / ") + p.Print(nn.Right) +} + +func (p *PrettyPrinter) printBinaryEqual(n node.Node) { + nn := n.(*binary.Equal) + + p.Print(nn.Left) + io.WriteString(p.w, " == ") + p.Print(nn.Right) +} + +func (p *PrettyPrinter) printBinaryGreaterOrEqual(n node.Node) { + nn := n.(*binary.GreaterOrEqual) + + p.Print(nn.Left) + io.WriteString(p.w, " >= ") + p.Print(nn.Right) +} + +func (p *PrettyPrinter) printBinaryGreater(n node.Node) { + nn := n.(*binary.Greater) + + p.Print(nn.Left) + io.WriteString(p.w, " > ") + p.Print(nn.Right) +} + +func (p *PrettyPrinter) printBinaryIdentical(n node.Node) { + nn := n.(*binary.Identical) + + p.Print(nn.Left) + io.WriteString(p.w, " === ") + p.Print(nn.Right) +} + +func (p *PrettyPrinter) printBinaryLogicalAnd(n node.Node) { + nn := n.(*binary.LogicalAnd) + + p.Print(nn.Left) + io.WriteString(p.w, " and ") + p.Print(nn.Right) +} + +func (p *PrettyPrinter) printBinaryLogicalOr(n node.Node) { + nn := n.(*binary.LogicalOr) + + p.Print(nn.Left) + io.WriteString(p.w, " or ") + p.Print(nn.Right) +} + +func (p *PrettyPrinter) printBinaryLogicalXor(n node.Node) { + nn := n.(*binary.LogicalXor) + + p.Print(nn.Left) + io.WriteString(p.w, " xor ") + p.Print(nn.Right) +} + +func (p *PrettyPrinter) printBinaryMinus(n node.Node) { + nn := n.(*binary.Minus) + + p.Print(nn.Left) + io.WriteString(p.w, " - ") + p.Print(nn.Right) +} + +func (p *PrettyPrinter) printBinaryMod(n node.Node) { + nn := n.(*binary.Mod) + + p.Print(nn.Left) + io.WriteString(p.w, " % ") + p.Print(nn.Right) +} + +func (p *PrettyPrinter) printBinaryMul(n node.Node) { + nn := n.(*binary.Mul) + + p.Print(nn.Left) + io.WriteString(p.w, " * ") + p.Print(nn.Right) +} + +func (p *PrettyPrinter) printBinaryNotEqual(n node.Node) { + nn := n.(*binary.NotEqual) + + p.Print(nn.Left) + io.WriteString(p.w, " != ") + p.Print(nn.Right) +} + +func (p *PrettyPrinter) printBinaryNotIdentical(n node.Node) { + nn := n.(*binary.NotIdentical) + + p.Print(nn.Left) + io.WriteString(p.w, " !== ") + p.Print(nn.Right) +} + +func (p *PrettyPrinter) printBinaryPlus(n node.Node) { + nn := n.(*binary.Plus) + + p.Print(nn.Left) + io.WriteString(p.w, " + ") + p.Print(nn.Right) +} + +func (p *PrettyPrinter) printBinaryPow(n node.Node) { + nn := n.(*binary.Pow) + + p.Print(nn.Left) + io.WriteString(p.w, " ** ") + p.Print(nn.Right) +} + +func (p *PrettyPrinter) printBinaryShiftLeft(n node.Node) { + nn := n.(*binary.ShiftLeft) + + p.Print(nn.Left) + io.WriteString(p.w, " << ") + p.Print(nn.Right) +} + +func (p *PrettyPrinter) printBinaryShiftRight(n node.Node) { + nn := n.(*binary.ShiftRight) + + p.Print(nn.Left) + io.WriteString(p.w, " >> ") + p.Print(nn.Right) +} + +func (p *PrettyPrinter) printBinarySmallerOrEqual(n node.Node) { + nn := n.(*binary.SmallerOrEqual) + + p.Print(nn.Left) + io.WriteString(p.w, " <= ") + p.Print(nn.Right) +} + +func (p *PrettyPrinter) printBinarySmaller(n node.Node) { + nn := n.(*binary.Smaller) + + p.Print(nn.Left) + io.WriteString(p.w, " < ") + p.Print(nn.Right) +} + +func (p *PrettyPrinter) printBinarySpaceship(n node.Node) { + nn := n.(*binary.Spaceship) + + p.Print(nn.Left) + io.WriteString(p.w, " <=> ") + p.Print(nn.Right) +} + +// cast + +func (p *PrettyPrinter) printArray(n node.Node) { + nn := n.(*cast.Array) + + io.WriteString(p.w, "(array)") + p.Print(nn.Expr) +} + +func (p *PrettyPrinter) printBool(n node.Node) { + nn := n.(*cast.Bool) + + io.WriteString(p.w, "(bool)") + p.Print(nn.Expr) +} + +func (p *PrettyPrinter) printDouble(n node.Node) { + nn := n.(*cast.Double) + + io.WriteString(p.w, "(float)") + p.Print(nn.Expr) +} + +func (p *PrettyPrinter) printInt(n node.Node) { + nn := n.(*cast.Int) + + io.WriteString(p.w, "(int)") + p.Print(nn.Expr) +} + +func (p *PrettyPrinter) printObject(n node.Node) { + nn := n.(*cast.Object) + + io.WriteString(p.w, "(object)") + p.Print(nn.Expr) +} + +func (p *PrettyPrinter) printString(n node.Node) { + nn := n.(*cast.String) + + io.WriteString(p.w, "(string)") + p.Print(nn.Expr) +} + +func (p *PrettyPrinter) printUnset(n node.Node) { + nn := n.(*cast.Unset) + + io.WriteString(p.w, "(unset)") + p.Print(nn.Expr) +} + +// expr + +func (p *PrettyPrinter) printExprArrayDimFetch(n node.Node) { + nn := n.(*expr.ArrayDimFetch) + p.Print(nn.Variable) + io.WriteString(p.w, "[") + p.Print(nn.Dim) + io.WriteString(p.w, "]") +} + +func (p *PrettyPrinter) printExprArrayItem(n node.Node) { + nn := n.(*expr.ArrayItem) + + if nn.Key != nil { + p.Print(nn.Key) + io.WriteString(p.w, " => ") + } + + p.Print(nn.Val) +} + +func (p *PrettyPrinter) printExprArray(n node.Node) { + nn := n.(*expr.Array) + + io.WriteString(p.w, "array(") + p.joinPrint(", ", nn.Items) + io.WriteString(p.w, ")") +} + +func (p *PrettyPrinter) printExprBitwiseNot(n node.Node) { + nn := n.(*expr.BitwiseNot) + io.WriteString(p.w, "~") + p.Print(nn.Expr) +} + +func (p *PrettyPrinter) printExprBooleanNot(n node.Node) { + nn := n.(*expr.BooleanNot) + io.WriteString(p.w, "!") + p.Print(nn.Expr) +} + +func (p *PrettyPrinter) printExprClassConstFetch(n node.Node) { + nn := n.(*expr.ClassConstFetch) + + p.Print(nn.Class) + io.WriteString(p.w, "::") + io.WriteString(p.w, nn.ConstantName.(*node.Identifier).Value) +} + +func (p *PrettyPrinter) printExprClone(n node.Node) { + nn := n.(*expr.Clone) + + io.WriteString(p.w, "clone ") + p.Print(nn.Expr) +} + +func (p *PrettyPrinter) printExprClosureUse(n node.Node) { + nn := n.(*expr.ClosureUse) + + io.WriteString(p.w, "use (") + p.joinPrint(", ", nn.Uses) + io.WriteString(p.w, ")") +} + +func (p *PrettyPrinter) printExprClosure(n node.Node) { + nn := n.(*expr.Closure) + + if nn.Static { + io.WriteString(p.w, "static ") + } + + io.WriteString(p.w, "function ") + + if nn.ReturnsRef { + io.WriteString(p.w, "&") + } + + io.WriteString(p.w, "(") + p.joinPrint(", ", nn.Params) + io.WriteString(p.w, ")") + + if nn.ClosureUse != nil { + io.WriteString(p.w, " ") + p.Print(nn.ClosureUse) + } + + if nn.ReturnType != nil { + io.WriteString(p.w, ": ") + p.Print(nn.ReturnType) + } + + io.WriteString(p.w, " {\n") + p.printNodes(nn.Stmts) + io.WriteString(p.w, "\n") + p.printIndent() + io.WriteString(p.w, "}") +} + +func (p *PrettyPrinter) printExprConstFetch(n node.Node) { + nn := n.(*expr.ConstFetch) + + p.Print(nn.Constant) +} + +func (p *PrettyPrinter) printExprDie(n node.Node) { + nn := n.(*expr.Die) + + io.WriteString(p.w, "die(") + p.Print(nn.Expr) + io.WriteString(p.w, ")") +} + +func (p *PrettyPrinter) printExprEmpty(n node.Node) { + nn := n.(*expr.Empty) + + io.WriteString(p.w, "empty(") + p.Print(nn.Expr) + io.WriteString(p.w, ")") +} + +func (p *PrettyPrinter) printExprErrorSuppress(n node.Node) { + nn := n.(*expr.ErrorSuppress) + + io.WriteString(p.w, "@") + p.Print(nn.Expr) +} + +func (p *PrettyPrinter) printExprEval(n node.Node) { + nn := n.(*expr.Eval) + + io.WriteString(p.w, "eval(") + p.Print(nn.Expr) + io.WriteString(p.w, ")") +} + +func (p *PrettyPrinter) printExprExit(n node.Node) { + nn := n.(*expr.Exit) + + io.WriteString(p.w, "exit(") + p.Print(nn.Expr) + io.WriteString(p.w, ")") +} + +func (p *PrettyPrinter) printExprFunctionCall(n node.Node) { + nn := n.(*expr.FunctionCall) + + p.Print(nn.Function) + io.WriteString(p.w, "(") + p.joinPrint(", ", nn.ArgumentList.Arguments) + io.WriteString(p.w, ")") +} + +func (p *PrettyPrinter) printExprInclude(n node.Node) { + nn := n.(*expr.Include) + + io.WriteString(p.w, "include ") + p.Print(nn.Expr) +} + +func (p *PrettyPrinter) printExprIncludeOnce(n node.Node) { + nn := n.(*expr.IncludeOnce) + + io.WriteString(p.w, "include_once ") + p.Print(nn.Expr) +} + +func (p *PrettyPrinter) printExprInstanceOf(n node.Node) { + nn := n.(*expr.InstanceOf) + + p.Print(nn.Expr) + io.WriteString(p.w, " instanceof ") + p.Print(nn.Class) +} + +func (p *PrettyPrinter) printExprIsset(n node.Node) { + nn := n.(*expr.Isset) + + io.WriteString(p.w, "isset(") + p.joinPrint(", ", nn.Variables) + io.WriteString(p.w, ")") +} + +func (p *PrettyPrinter) printExprList(n node.Node) { + nn := n.(*expr.List) + + io.WriteString(p.w, "list(") + p.joinPrint(", ", nn.Items) + io.WriteString(p.w, ")") +} + +func (p *PrettyPrinter) printExprMethodCall(n node.Node) { + nn := n.(*expr.MethodCall) + + p.Print(nn.Variable) + io.WriteString(p.w, "->") + p.Print(nn.Method) + io.WriteString(p.w, "(") + p.joinPrint(", ", nn.ArgumentList.Arguments) + io.WriteString(p.w, ")") +} + +func (p *PrettyPrinter) printExprNew(n node.Node) { + nn := n.(*expr.New) + + io.WriteString(p.w, "new ") + p.Print(nn.Class) + + if nn.ArgumentList != nil { + io.WriteString(p.w, "(") + p.joinPrint(", ", nn.ArgumentList.Arguments) + io.WriteString(p.w, ")") + } +} + +func (p *PrettyPrinter) printExprPostDec(n node.Node) { + nn := n.(*expr.PostDec) + + p.Print(nn.Variable) + io.WriteString(p.w, "--") +} + +func (p *PrettyPrinter) printExprPostInc(n node.Node) { + nn := n.(*expr.PostInc) + + p.Print(nn.Variable) + io.WriteString(p.w, "++") +} + +func (p *PrettyPrinter) printExprPreDec(n node.Node) { + nn := n.(*expr.PreDec) + + io.WriteString(p.w, "--") + p.Print(nn.Variable) +} + +func (p *PrettyPrinter) printExprPreInc(n node.Node) { + nn := n.(*expr.PreInc) + + io.WriteString(p.w, "++") + p.Print(nn.Variable) +} + +func (p *PrettyPrinter) printExprPrint(n node.Node) { + nn := n.(*expr.Print) + + io.WriteString(p.w, "print(") + p.Print(nn.Expr) + io.WriteString(p.w, ")") +} + +func (p *PrettyPrinter) printExprPropertyFetch(n node.Node) { + nn := n.(*expr.PropertyFetch) + + p.Print(nn.Variable) + io.WriteString(p.w, "->") + p.Print(nn.Property) +} + +func (p *PrettyPrinter) printExprReference(n node.Node) { + nn := n.(*expr.Reference) + + io.WriteString(p.w, "&") + p.Print(nn.Variable) +} + +func (p *PrettyPrinter) printExprRequire(n node.Node) { + nn := n.(*expr.Require) + + io.WriteString(p.w, "require ") + p.Print(nn.Expr) +} + +func (p *PrettyPrinter) printExprRequireOnce(n node.Node) { + nn := n.(*expr.RequireOnce) + + io.WriteString(p.w, "require_once ") + p.Print(nn.Expr) +} + +func (p *PrettyPrinter) printExprShellExec(n node.Node) { + nn := n.(*expr.ShellExec) + + io.WriteString(p.w, "`") + for _, part := range nn.Parts { + p.Print(part) + } + io.WriteString(p.w, "`") +} + +func (p *PrettyPrinter) printExprShortArray(n node.Node) { + nn := n.(*expr.ShortArray) + + io.WriteString(p.w, "[") + p.joinPrint(", ", nn.Items) + io.WriteString(p.w, "]") +} + +func (p *PrettyPrinter) printExprShortList(n node.Node) { + nn := n.(*expr.ShortList) + + io.WriteString(p.w, "[") + p.joinPrint(", ", nn.Items) + io.WriteString(p.w, "]") +} + +func (p *PrettyPrinter) printExprStaticCall(n node.Node) { + nn := n.(*expr.StaticCall) + + p.Print(nn.Class) + io.WriteString(p.w, "::") + p.Print(nn.Call) + io.WriteString(p.w, "(") + p.joinPrint(", ", nn.ArgumentList.Arguments) + io.WriteString(p.w, ")") +} + +func (p *PrettyPrinter) printExprStaticPropertyFetch(n node.Node) { + nn := n.(*expr.StaticPropertyFetch) + + p.Print(nn.Class) + io.WriteString(p.w, "::") + p.Print(nn.Property) +} + +func (p *PrettyPrinter) printExprTernary(n node.Node) { + nn := n.(*expr.Ternary) + + p.Print(nn.Condition) + io.WriteString(p.w, " ?") + + if nn.IfTrue != nil { + io.WriteString(p.w, " ") + p.Print(nn.IfTrue) + io.WriteString(p.w, " ") + } + + io.WriteString(p.w, ": ") + p.Print(nn.IfFalse) +} + +func (p *PrettyPrinter) printExprUnaryMinus(n node.Node) { + nn := n.(*expr.UnaryMinus) + + io.WriteString(p.w, "-") + p.Print(nn.Expr) +} + +func (p *PrettyPrinter) printExprUnaryPlus(n node.Node) { + nn := n.(*expr.UnaryPlus) + + io.WriteString(p.w, "+") + p.Print(nn.Expr) +} + +func (p *PrettyPrinter) printExprVariable(n node.Node) { + io.WriteString(p.w, "$") + p.Print(n.(*expr.Variable).VarName) +} + +func (p *PrettyPrinter) printExprYieldFrom(n node.Node) { + nn := n.(*expr.YieldFrom) + + io.WriteString(p.w, "yield from ") + p.Print(nn.Expr) +} + +func (p *PrettyPrinter) printExprYield(n node.Node) { + nn := n.(*expr.Yield) + + io.WriteString(p.w, "yield ") + + if nn.Key != nil { + p.Print(nn.Key) + io.WriteString(p.w, " => ") + } + + p.Print(nn.Value) +} + +// smtm + +func (p *PrettyPrinter) printStmtAltElseIf(n node.Node) { + nn := n.(*stmt.AltElseIf) + + io.WriteString(p.w, "elseif (") + p.Print(nn.Cond) + io.WriteString(p.w, ") :") + + if s := nn.Stmt.(*stmt.StmtList).Stmts; len(s) > 0 { + io.WriteString(p.w, "\n") + p.printNodes(s) + } +} + +func (p *PrettyPrinter) printStmtAltElse(n node.Node) { + nn := n.(*stmt.AltElse) + + io.WriteString(p.w, "else :") + + if s := nn.Stmt.(*stmt.StmtList).Stmts; len(s) > 0 { + io.WriteString(p.w, "\n") + p.printNodes(s) + } +} + +func (p *PrettyPrinter) printStmtAltFor(n node.Node) { + nn := n.(*stmt.AltFor) + + io.WriteString(p.w, "for (") + p.joinPrint(", ", nn.Init) + io.WriteString(p.w, "; ") + p.joinPrint(", ", nn.Cond) + io.WriteString(p.w, "; ") + p.joinPrint(", ", nn.Loop) + io.WriteString(p.w, ") :\n") + + s := nn.Stmt.(*stmt.StmtList) + p.printNodes(s.Stmts) + io.WriteString(p.w, "\n") + p.printIndent() + + io.WriteString(p.w, "endfor;") +} + +func (p *PrettyPrinter) printStmtAltForeach(n node.Node) { + nn := n.(*stmt.AltForeach) + + io.WriteString(p.w, "foreach (") + p.Print(nn.Expr) + io.WriteString(p.w, " as ") + + if nn.Key != nil { + p.Print(nn.Key) + io.WriteString(p.w, " => ") + } + + p.Print(nn.Variable) + + io.WriteString(p.w, ") :\n") + + s := nn.Stmt.(*stmt.StmtList) + p.printNodes(s.Stmts) + + io.WriteString(p.w, "\n") + p.printIndent() + io.WriteString(p.w, "endforeach;") +} + +func (p *PrettyPrinter) printStmtAltIf(n node.Node) { + nn := n.(*stmt.AltIf) + + io.WriteString(p.w, "if (") + p.Print(nn.Cond) + io.WriteString(p.w, ") :\n") + + s := nn.Stmt.(*stmt.StmtList) + p.printNodes(s.Stmts) + + for _, elseif := range nn.ElseIf { + io.WriteString(p.w, "\n") + p.printIndent() + p.Print(elseif) + } + + if nn.Else != nil { + io.WriteString(p.w, "\n") + p.printIndent() + p.Print(nn.Else) + } + + io.WriteString(p.w, "\n") + p.printIndent() + io.WriteString(p.w, "endif;") +} + +func (p *PrettyPrinter) printStmtAltSwitch(n node.Node) { + nn := n.(*stmt.AltSwitch) + + io.WriteString(p.w, "switch (") + p.Print(nn.Cond) + io.WriteString(p.w, ") :\n") + + s := nn.CaseList.Cases + p.printNodes(s) + + io.WriteString(p.w, "\n") + p.printIndent() + io.WriteString(p.w, "endswitch;") +} + +func (p *PrettyPrinter) printStmtAltWhile(n node.Node) { + nn := n.(*stmt.AltWhile) + + io.WriteString(p.w, "while (") + p.Print(nn.Cond) + io.WriteString(p.w, ") :\n") + + s := nn.Stmt.(*stmt.StmtList) + p.printNodes(s.Stmts) + + io.WriteString(p.w, "\n") + p.printIndent() + io.WriteString(p.w, "endwhile;") +} + +func (p *PrettyPrinter) printStmtBreak(n node.Node) { + nn := n.(*stmt.Break) + + io.WriteString(p.w, "break") + if nn.Expr != nil { + io.WriteString(p.w, " ") + p.Print(nn.Expr) + } + + io.WriteString(p.w, ";") +} + +func (p *PrettyPrinter) printStmtCase(n node.Node) { + nn := n.(*stmt.Case) + + io.WriteString(p.w, "case ") + p.Print(nn.Cond) + io.WriteString(p.w, ":") + + if len(nn.Stmts) > 0 { + io.WriteString(p.w, "\n") + p.printNodes(nn.Stmts) + } +} + +func (p *PrettyPrinter) printStmtCatch(n node.Node) { + nn := n.(*stmt.Catch) + + io.WriteString(p.w, "catch (") + p.joinPrint(" | ", nn.Types) + io.WriteString(p.w, " ") + p.Print(nn.Variable) + io.WriteString(p.w, ") {\n") + p.printNodes(nn.Stmts) + io.WriteString(p.w, "\n") + p.printIndent() + io.WriteString(p.w, "}") +} + +func (p *PrettyPrinter) printStmtClassMethod(n node.Node) { + nn := n.(*stmt.ClassMethod) + + if nn.Modifiers != nil { + p.joinPrint(" ", nn.Modifiers) + io.WriteString(p.w, " ") + } + io.WriteString(p.w, "function ") + + if nn.ReturnsRef { + io.WriteString(p.w, "&") + } + + p.Print(nn.MethodName) + io.WriteString(p.w, "(") + p.joinPrint(", ", nn.Params) + io.WriteString(p.w, ")") + + if nn.ReturnType != nil { + io.WriteString(p.w, ": ") + p.Print(nn.ReturnType) + } + + switch s := nn.Stmt.(type) { + case *stmt.StmtList: + io.WriteString(p.w, "\n") + p.printIndent() + io.WriteString(p.w, "{\n") + p.printNodes(s.Stmts) + io.WriteString(p.w, "\n") + p.printIndent() + io.WriteString(p.w, "}") + default: + p.Print(s) + } +} + +func (p *PrettyPrinter) printStmtClass(n node.Node) { + nn := n.(*stmt.Class) + + if nn.Modifiers != nil { + p.joinPrint(" ", nn.Modifiers) + io.WriteString(p.w, " ") + } + io.WriteString(p.w, "class") + + if nn.ClassName != nil { + io.WriteString(p.w, " ") + p.Print(nn.ClassName) + } + + if nn.ArgumentList != nil { + io.WriteString(p.w, "(") + p.joinPrint(", ", nn.ArgumentList.Arguments) + io.WriteString(p.w, ")") + } + + if nn.Extends != nil { + io.WriteString(p.w, " extends ") + p.Print(nn.Extends.ClassName) + } + + if nn.Implements != nil { + io.WriteString(p.w, " implements ") + p.joinPrint(", ", nn.Implements.InterfaceNames) + } + + io.WriteString(p.w, "\n") + p.printIndent() + io.WriteString(p.w, "{\n") + p.printNodes(nn.Stmts) + io.WriteString(p.w, "\n") + p.printIndent() + io.WriteString(p.w, "}") +} + +func (p *PrettyPrinter) printStmtClassConstList(n node.Node) { + nn := n.(*stmt.ClassConstList) + + if nn.Modifiers != nil { + p.joinPrint(" ", nn.Modifiers) + io.WriteString(p.w, " ") + } + io.WriteString(p.w, "const ") + + p.joinPrint(", ", nn.Consts) + + io.WriteString(p.w, ";") +} + +func (p *PrettyPrinter) printStmtConstant(n node.Node) { + nn := n.(*stmt.Constant) + + p.Print(nn.ConstantName) + io.WriteString(p.w, " = ") + p.Print(nn.Expr) +} + +func (p *PrettyPrinter) printStmtContinue(n node.Node) { + nn := n.(*stmt.Continue) + + io.WriteString(p.w, "continue") + if nn.Expr != nil { + io.WriteString(p.w, " ") + p.Print(nn.Expr) + } + + io.WriteString(p.w, ";") +} + +func (p *PrettyPrinter) printStmtDeclare(n node.Node) { + nn := n.(*stmt.Declare) + + io.WriteString(p.w, "declare(") + p.joinPrint(", ", nn.Consts) + io.WriteString(p.w, ")") + + switch s := nn.Stmt.(type) { + case *stmt.Nop: + p.Print(s) + break + case *stmt.StmtList: + io.WriteString(p.w, " ") + p.Print(s) + default: + io.WriteString(p.w, "\n") + p.indentDepth++ + p.printIndent() + p.Print(s) + p.indentDepth-- + } +} + +func (p *PrettyPrinter) printStmtDefault(n node.Node) { + nn := n.(*stmt.Default) + io.WriteString(p.w, "default:") + + if len(nn.Stmts) > 0 { + io.WriteString(p.w, "\n") + p.printNodes(nn.Stmts) + } +} + +func (p *PrettyPrinter) printStmtDo(n node.Node) { + nn := n.(*stmt.Do) + io.WriteString(p.w, "do") + + switch s := nn.Stmt.(type) { + case *stmt.StmtList: + io.WriteString(p.w, " ") + p.Print(s) + io.WriteString(p.w, " ") + default: + io.WriteString(p.w, "\n") + p.indentDepth++ + p.printIndent() + p.Print(s) + p.indentDepth-- + io.WriteString(p.w, "\n") + p.printIndent() + } + + io.WriteString(p.w, "while (") + p.Print(nn.Cond) + io.WriteString(p.w, ");") +} + +func (p *PrettyPrinter) printStmtEcho(n node.Node) { + nn := n.(*stmt.Echo) + io.WriteString(p.w, "echo ") + p.joinPrint(", ", nn.Exprs) + io.WriteString(p.w, ";") +} + +func (p *PrettyPrinter) printStmtElseif(n node.Node) { + nn := n.(*stmt.ElseIf) + + io.WriteString(p.w, "elseif (") + p.Print(nn.Cond) + io.WriteString(p.w, ")") + + switch s := nn.Stmt.(type) { + case *stmt.Nop: + p.Print(s) + break + case *stmt.StmtList: + io.WriteString(p.w, " ") + p.Print(s) + default: + io.WriteString(p.w, "\n") + p.indentDepth++ + p.printIndent() + p.Print(s) + p.indentDepth-- + } +} + +func (p *PrettyPrinter) printStmtElse(n node.Node) { + nn := n.(*stmt.Else) + + io.WriteString(p.w, "else") + + switch s := nn.Stmt.(type) { + case *stmt.Nop: + p.Print(s) + break + case *stmt.StmtList: + io.WriteString(p.w, " ") + p.Print(s) + default: + io.WriteString(p.w, "\n") + p.indentDepth++ + p.printIndent() + p.Print(s) + p.indentDepth-- + } +} + +func (p *PrettyPrinter) printStmtExpression(n node.Node) { + nn := n.(*stmt.Expression) + + p.Print(nn.Expr) + + io.WriteString(p.w, ";") +} + +func (p *PrettyPrinter) printStmtFinally(n node.Node) { + nn := n.(*stmt.Finally) + + io.WriteString(p.w, "finally {\n") + p.printNodes(nn.Stmts) + io.WriteString(p.w, "\n") + p.printIndent() + io.WriteString(p.w, "}") +} + +func (p *PrettyPrinter) printStmtFor(n node.Node) { + nn := n.(*stmt.For) + + io.WriteString(p.w, "for (") + p.joinPrint(", ", nn.Init) + io.WriteString(p.w, "; ") + p.joinPrint(", ", nn.Cond) + io.WriteString(p.w, "; ") + p.joinPrint(", ", nn.Loop) + io.WriteString(p.w, ")") + + switch s := nn.Stmt.(type) { + case *stmt.Nop: + p.Print(s) + break + case *stmt.StmtList: + io.WriteString(p.w, " ") + p.Print(s) + default: + io.WriteString(p.w, "\n") + p.indentDepth++ + p.printIndent() + p.Print(s) + p.indentDepth-- + } +} + +func (p *PrettyPrinter) printStmtForeach(n node.Node) { + nn := n.(*stmt.Foreach) + + io.WriteString(p.w, "foreach (") + p.Print(nn.Expr) + io.WriteString(p.w, " as ") + + if nn.Key != nil { + p.Print(nn.Key) + io.WriteString(p.w, " => ") + } + + p.Print(nn.Variable) + io.WriteString(p.w, ")") + + switch s := nn.Stmt.(type) { + case *stmt.Nop: + p.Print(s) + break + case *stmt.StmtList: + io.WriteString(p.w, " ") + p.Print(s) + default: + io.WriteString(p.w, "\n") + p.indentDepth++ + p.printIndent() + p.Print(s) + p.indentDepth-- + } +} + +func (p *PrettyPrinter) printStmtFunction(n node.Node) { + nn := n.(*stmt.Function) + + io.WriteString(p.w, "function ") + + if nn.ReturnsRef { + io.WriteString(p.w, "&") + } + + p.Print(nn.FunctionName) + + io.WriteString(p.w, "(") + p.joinPrint(", ", nn.Params) + io.WriteString(p.w, ")") + + if nn.ReturnType != nil { + io.WriteString(p.w, ": ") + p.Print(nn.ReturnType) + } + + io.WriteString(p.w, " {\n") + p.printNodes(nn.Stmts) + io.WriteString(p.w, "\n") + p.printIndent() + io.WriteString(p.w, "}") +} + +func (p *PrettyPrinter) printStmtGlobal(n node.Node) { + nn := n.(*stmt.Global) + + io.WriteString(p.w, "global ") + p.joinPrint(", ", nn.Vars) + io.WriteString(p.w, ";") +} + +func (p *PrettyPrinter) printStmtGoto(n node.Node) { + nn := n.(*stmt.Goto) + + io.WriteString(p.w, "goto ") + p.Print(nn.Label) + io.WriteString(p.w, ";") +} + +func (p *PrettyPrinter) printStmtGroupUse(n node.Node) { + nn := n.(*stmt.GroupUse) + + io.WriteString(p.w, "use ") + + if nn.UseType != nil { + p.Print(nn.UseType) + io.WriteString(p.w, " ") + } + + p.Print(nn.Prefix) + io.WriteString(p.w, "\\{") + p.joinPrint(", ", nn.UseList) + io.WriteString(p.w, "};") +} + +func (p *PrettyPrinter) printStmtHaltCompiler(n node.Node) { + io.WriteString(p.w, "__halt_compiler();") +} + +func (p *PrettyPrinter) printStmtIf(n node.Node) { + nn := n.(*stmt.If) + + io.WriteString(p.w, "if (") + p.Print(nn.Cond) + io.WriteString(p.w, ")") + + switch s := nn.Stmt.(type) { + case *stmt.Nop: + p.Print(s) + break + case *stmt.StmtList: + io.WriteString(p.w, " ") + p.Print(s) + default: + io.WriteString(p.w, "\n") + p.indentDepth++ + p.printIndent() + p.Print(s) + p.indentDepth-- + } + + if nn.ElseIf != nil { + io.WriteString(p.w, "\n") + p.indentDepth-- + p.printNodes(nn.ElseIf) + p.indentDepth++ + } + + if nn.Else != nil { + io.WriteString(p.w, "\n") + p.printIndent() + p.Print(nn.Else) + } +} + +func (p *PrettyPrinter) printStmtInlineHTML(n node.Node) { + nn := n.(*stmt.InlineHtml) + + io.WriteString(p.w, "?>") + io.WriteString(p.w, nn.Value) + io.WriteString(p.w, "HTML"}, + &stmt.Expression{ + Expr: &scalar.Heredoc{ + Label: "\"LBL\"", + Parts: []node.Node{ + &scalar.EncapsedStringPart{Value: "hello world\n"}, + }, + }, + }, + }, + }) + + expected := `
HTML
>= $b` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +// binary + +func TestPrintBinaryBitwiseAnd(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&binary.BitwiseAnd{ + Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + }) + + expected := `$a & $b` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintBinaryBitwiseOr(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&binary.BitwiseOr{ + Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + }) + + expected := `$a | $b` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintBinaryBitwiseXor(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&binary.BitwiseXor{ + Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + }) + + expected := `$a ^ $b` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintBinaryBooleanAnd(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&binary.BooleanAnd{ + Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + }) + + expected := `$a && $b` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintBinaryBooleanOr(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&binary.BooleanOr{ + Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + }) + + expected := `$a || $b` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintBinaryCoalesce(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&binary.Coalesce{ + Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + }) + + expected := `$a ?? $b` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintBinaryConcat(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&binary.Concat{ + Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + }) + + expected := `$a . $b` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintBinaryDiv(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&binary.Div{ + Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + }) + + expected := `$a / $b` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintBinaryEqual(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&binary.Equal{ + Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + }) + + expected := `$a == $b` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintBinaryGreaterOrEqual(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&binary.GreaterOrEqual{ + Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + }) + + expected := `$a >= $b` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintBinaryGreater(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&binary.Greater{ + Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + }) + + expected := `$a > $b` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintBinaryIdentical(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&binary.Identical{ + Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + }) + + expected := `$a === $b` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintBinaryLogicalAnd(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&binary.LogicalAnd{ + Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + }) + + expected := `$a and $b` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintBinaryLogicalOr(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&binary.LogicalOr{ + Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + }) + + expected := `$a or $b` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintBinaryLogicalXor(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&binary.LogicalXor{ + Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + }) + + expected := `$a xor $b` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintBinaryMinus(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&binary.Minus{ + Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + }) + + expected := `$a - $b` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintBinaryMod(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&binary.Mod{ + Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + }) + + expected := `$a % $b` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintBinaryMul(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&binary.Mul{ + Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + }) + + expected := `$a * $b` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintBinaryNotEqual(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&binary.NotEqual{ + Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + }) + + expected := `$a != $b` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintBinaryNotIdentical(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&binary.NotIdentical{ + Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + }) + + expected := `$a !== $b` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintBinaryPlus(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&binary.Plus{ + Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + }) + + expected := `$a + $b` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintBinaryPow(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&binary.Pow{ + Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + }) + + expected := `$a ** $b` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintBinaryShiftLeft(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&binary.ShiftLeft{ + Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + }) + + expected := `$a << $b` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintBinaryShiftRight(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&binary.ShiftRight{ + Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + }) + + expected := `$a >> $b` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintBinarySmallerOrEqual(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&binary.SmallerOrEqual{ + Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + }) + + expected := `$a <= $b` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintBinarySmaller(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&binary.Smaller{ + Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + }) + + expected := `$a < $b` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintBinarySpaceship(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&binary.Spaceship{ + Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + }) + + expected := `$a <=> $b` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +// cast + +func TestPrintArray(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&cast.Array{ + Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + }) + + expected := `(array)$var` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintBool(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&cast.Bool{ + Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + }) + + expected := `(bool)$var` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintDouble(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&cast.Double{ + Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + }) + + expected := `(float)$var` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintInt(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&cast.Int{ + Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + }) + + expected := `(int)$var` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintObject(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&cast.Object{ + Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + }) + + expected := `(object)$var` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintString(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&cast.String{ + Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + }) + + expected := `(string)$var` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintUnset(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&cast.Unset{ + Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + }) + + expected := `(unset)$var` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +// expr + +func TestPrintExprArrayDimFetch(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&expr.ArrayDimFetch{ + Variable: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + Dim: &scalar.Lnumber{Value: "1"}, + }) + + expected := `$var[1]` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintExprArrayItemWithKey(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&expr.ArrayItem{ + Key: &scalar.String{Value: "'Hello'"}, + Val: &expr.Variable{VarName: &node.Identifier{Value: "world"}}, + }) + + expected := `'Hello' => $world` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintExprArrayItem(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&expr.ArrayItem{ + Val: &expr.Reference{Variable: &expr.Variable{VarName: &node.Identifier{Value: "world"}}}, + }) + + expected := `&$world` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintExprArray(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&expr.Array{ + Items: []node.Node{ + &expr.ArrayItem{ + Key: &scalar.String{Value: "'Hello'"}, + Val: &expr.Variable{VarName: &node.Identifier{Value: "world"}}, + }, + &expr.ArrayItem{ + Key: &scalar.Lnumber{Value: "2"}, + Val: &expr.Reference{Variable: &expr.Variable{VarName: &node.Identifier{Value: "var"}}}, + }, + &expr.ArrayItem{ + Val: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + }, + }, + }) + + expected := `array('Hello' => $world, 2 => &$var, $var)` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintExprBitwiseNot(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&expr.BitwiseNot{ + Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + }) + + expected := `~$var` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintExprBooleanNot(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&expr.BooleanNot{ + Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + }) + + expected := `!$var` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintExprClassConstFetch(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&expr.ClassConstFetch{ + Class: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + ConstantName: &node.Identifier{Value: "CONST"}, + }) + + expected := `$var::CONST` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintExprClone(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&expr.Clone{ + Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + }) + + expected := `clone $var` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintExprClosureUse(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&expr.ClosureUse{ + Uses: []node.Node{ + &expr.Reference{Variable: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}}, + &expr.Variable{VarName: &node.Identifier{Value: "bar"}}, + }, + }) + + expected := `use (&$foo, $bar)` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintExprClosure(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&stmt.Namespace{ + Stmts: []node.Node{ + &expr.Closure{ + Static: true, + ReturnsRef: true, + Params: []node.Node{ + &node.Parameter{ + ByRef: true, + Variadic: false, + Variable: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + }, + }, + ClosureUse: &expr.ClosureUse{ + Uses: []node.Node{ + &expr.Reference{Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, + &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + }, + }, + ReturnType: &name.FullyQualified{Parts: []node.Node{&name.NamePart{Value: "Foo"}}}, + Stmts: []node.Node{ + &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, + }, + }, + }, + }) + + expected := `namespace { + static function &(&$var) use (&$a, $b): \Foo { + $a; + } +}` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintExprConstFetch(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&expr.ConstFetch{ + Constant: &name.Name{Parts: []node.Node{&name.NamePart{Value: "null"}}}, + }) + + expected := "null" + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintDie(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&expr.Die{Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}}) + + expected := `die($var)` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintEmpty(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&expr.Empty{Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}}) + + expected := `empty($var)` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrettyPrinterrorSuppress(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&expr.ErrorSuppress{Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}}) + + expected := `@$var` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintEval(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&expr.Eval{Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}}) + + expected := `eval($var)` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintExit(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&expr.Exit{Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}}) + + expected := `exit($var)` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintFunctionCall(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&expr.FunctionCall{ + Function: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + ArgumentList: &node.ArgumentList{ + Arguments: []node.Node{ + &node.Argument{ + IsReference: true, + Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + }, + &node.Argument{ + Variadic: true, + Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + }, + &node.Argument{ + Expr: &expr.Variable{VarName: &node.Identifier{Value: "c"}}, + }, + }, + }, + }) + + expected := `$var(&$a, ...$b, $c)` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintInclude(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&expr.Include{Expr: &scalar.String{Value: "'path'"}}) + + expected := `include 'path'` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintIncludeOnce(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&expr.IncludeOnce{Expr: &scalar.String{Value: "'path'"}}) + + expected := `include_once 'path'` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintInstanceOf(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&expr.InstanceOf{ + Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + Class: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Foo"}}}, + }) + + expected := `$var instanceof Foo` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintIsset(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&expr.Isset{ + Variables: []node.Node{ + &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + }, + }) + + expected := `isset($a, $b)` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintList(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&expr.List{ + Items: []node.Node{ + &expr.ArrayItem{ + Val: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + }, + &expr.ArrayItem{ + Val: &expr.List{ + Items: []node.Node{ + &expr.ArrayItem{ + Val: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + }, + &expr.ArrayItem{ + Val: &expr.Variable{VarName: &node.Identifier{Value: "c"}}, + }, + }, + }, + }, + }, + }) + + expected := `list($a, list($b, $c))` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintMethodCall(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&expr.MethodCall{ + Variable: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, + Method: &node.Identifier{Value: "bar"}, + ArgumentList: &node.ArgumentList{ + Arguments: []node.Node{ + &node.Argument{ + Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + }, + &node.Argument{ + Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + }, + }, + }, + }) + + expected := `$foo->bar($a, $b)` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintNew(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&expr.New{ + Class: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Foo"}}}, + ArgumentList: &node.ArgumentList{ + Arguments: []node.Node{ + &node.Argument{ + Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + }, + &node.Argument{ + Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + }, + }, + }, + }) + + expected := `new Foo($a, $b)` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintPostDec(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&expr.PostDec{ + Variable: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + }) + + expected := `$var--` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintPostInc(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&expr.PostInc{ + Variable: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + }) + + expected := `$var++` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintPreDec(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&expr.PreDec{ + Variable: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + }) + + expected := `--$var` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintPreInc(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&expr.PreInc{ + Variable: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + }) + + expected := `++$var` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintPrint(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&expr.Print{Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}}) + + expected := `print($var)` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintPropertyFetch(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&expr.PropertyFetch{ + Variable: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, + Property: &node.Identifier{Value: "bar"}, + }) + + expected := `$foo->bar` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintExprReference(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&expr.Reference{ + Variable: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, + }) + + expected := `&$foo` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintRequire(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&expr.Require{Expr: &scalar.String{Value: "'path'"}}) + + expected := `require 'path'` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintRequireOnce(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&expr.RequireOnce{Expr: &scalar.String{Value: "'path'"}}) + + expected := `require_once 'path'` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintShellExec(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&expr.ShellExec{ + Parts: []node.Node{ + &scalar.EncapsedStringPart{Value: "hello "}, + &expr.Variable{VarName: &node.Identifier{Value: "world"}}, + &scalar.EncapsedStringPart{Value: "!"}, + }, + }) + + expected := "`hello $world!`" + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintExprShortArray(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&expr.ShortArray{ + Items: []node.Node{ + &expr.ArrayItem{ + Key: &scalar.String{Value: "'Hello'"}, + Val: &expr.Variable{VarName: &node.Identifier{Value: "world"}}, + }, + &expr.ArrayItem{ + Key: &scalar.Lnumber{Value: "2"}, + Val: &expr.Reference{Variable: &expr.Variable{VarName: &node.Identifier{Value: "var"}}}, + }, + &expr.ArrayItem{ + Val: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + }, + }, + }) + + expected := `['Hello' => $world, 2 => &$var, $var]` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintShortList(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&expr.ShortList{ + Items: []node.Node{ + &expr.ArrayItem{ + Val: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + }, + &expr.ArrayItem{ + Val: &expr.List{ + Items: []node.Node{ + &expr.ArrayItem{ + Val: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + }, + &expr.ArrayItem{ + Val: &expr.Variable{VarName: &node.Identifier{Value: "c"}}, + }, + }, + }, + }, + }, + }) + + expected := `[$a, list($b, $c)]` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintStaticCall(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&expr.StaticCall{ + Class: &node.Identifier{Value: "Foo"}, + Call: &node.Identifier{Value: "bar"}, + ArgumentList: &node.ArgumentList{ + Arguments: []node.Node{ + &node.Argument{ + Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + }, + &node.Argument{ + Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + }, + }, + }, + }) + + expected := `Foo::bar($a, $b)` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintStaticPropertyFetch(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&expr.StaticPropertyFetch{ + Class: &node.Identifier{Value: "Foo"}, + Property: &expr.Variable{VarName: &node.Identifier{Value: "bar"}}, + }) + + expected := `Foo::$bar` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintTernary(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&expr.Ternary{ + Condition: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + IfFalse: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + }) + + expected := `$a ?: $b` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintTernaryFull(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&expr.Ternary{ + Condition: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + IfTrue: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + IfFalse: &expr.Variable{VarName: &node.Identifier{Value: "c"}}, + }) + + expected := `$a ? $b : $c` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintUnaryMinus(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&expr.UnaryMinus{ + Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + }) + + expected := `-$var` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintUnaryPlus(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&expr.UnaryPlus{ + Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + }) + + expected := `+$var` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintVariable(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&expr.Variable{VarName: &expr.Variable{VarName: &node.Identifier{Value: "var"}}}) + + expected := `$$var` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintYieldFrom(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&expr.YieldFrom{ + Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + }) + + expected := `yield from $var` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintYield(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&expr.Yield{ + Value: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + }) + + expected := `yield $var` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintYieldFull(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&expr.Yield{ + Key: &expr.Variable{VarName: &node.Identifier{Value: "k"}}, + Value: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + }) + + expected := `yield $k => $var` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +// stmt + +func TestPrintAltElseIf(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&stmt.AltElseIf{ + Cond: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Stmt: &stmt.StmtList{ + Stmts: []node.Node{ + &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + }, + }, + }) + + expected := `elseif ($a) : + $b;` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintAltElseIfEmpty(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&stmt.AltElseIf{ + Cond: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Stmt: &stmt.StmtList{}, + }) + + expected := `elseif ($a) :` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintAltElse(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&stmt.AltElse{ + Stmt: &stmt.StmtList{ + Stmts: []node.Node{ + &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + }, + }, + }) + + expected := `else : + $b;` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintAltElseEmpty(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&stmt.AltElse{ + Stmt: &stmt.StmtList{}, + }) + + expected := `else :` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintAltFor(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&stmt.Namespace{ + Stmts: []node.Node{ + &stmt.AltFor{ + Init: []node.Node{ + &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + }, + Cond: []node.Node{ + &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + }, + Loop: []node.Node{ + &expr.Variable{VarName: &node.Identifier{Value: "c"}}, + }, + Stmt: &stmt.StmtList{ + Stmts: []node.Node{ + &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "d"}}}, + }, + }, + }, + }, + }) + + expected := `namespace { + for ($a; $b; $c) : + $d; + endfor; +}` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintAltForeach(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&stmt.Namespace{ + Stmts: []node.Node{ + &stmt.AltForeach{ + Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + Key: &expr.Variable{VarName: &node.Identifier{Value: "key"}}, + Variable: &expr.Reference{Variable: &expr.Variable{VarName: &node.Identifier{Value: "val"}}}, + Stmt: &stmt.StmtList{ + Stmts: []node.Node{ + &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "d"}}}, + }, + }, + }, + }, + }) + + expected := `namespace { + foreach ($var as $key => &$val) : + $d; + endforeach; +}` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintAltIf(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&stmt.Namespace{ + Stmts: []node.Node{ + &stmt.AltIf{ + Cond: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Stmt: &stmt.StmtList{ + Stmts: []node.Node{ + &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "d"}}}, + }, + }, + ElseIf: []node.Node{ + &stmt.AltElseIf{ + Cond: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Stmt: &stmt.StmtList{ + Stmts: []node.Node{ + &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + }, + }, + }, + &stmt.AltElseIf{ + Cond: &expr.Variable{VarName: &node.Identifier{Value: "c"}}, + Stmt: &stmt.StmtList{}, + }, + }, + Else: &stmt.AltElse{ + Stmt: &stmt.StmtList{ + Stmts: []node.Node{ + &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + }, + }, + }, + }, + }, + }) + + expected := `namespace { + if ($a) : + $d; + elseif ($b) : + $b; + elseif ($c) : + else : + $b; + endif; +}` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintStmtAltSwitch(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&stmt.Namespace{ + Stmts: []node.Node{ + &stmt.AltSwitch{ + Cond: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + CaseList: &stmt.CaseList{ + Cases: []node.Node{ + &stmt.Case{ + Cond: &scalar.String{Value: "'a'"}, + Stmts: []node.Node{ + &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, + }, + }, + &stmt.Case{ + Cond: &scalar.String{Value: "'b'"}, + Stmts: []node.Node{ + &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + }, + }, + }, + }, + }, + }, + }) + + expected := `namespace { + switch ($var) : + case 'a': + $a; + case 'b': + $b; + endswitch; +}` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintAltWhile(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&stmt.Namespace{ + Stmts: []node.Node{ + &stmt.AltWhile{ + Cond: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Stmt: &stmt.StmtList{ + Stmts: []node.Node{ + &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + }, + }, + }, + }, + }) + + expected := `namespace { + while ($a) : + $b; + endwhile; +}` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintStmtBreak(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&stmt.Break{ + Expr: &scalar.Lnumber{Value: "1"}, + }) + + expected := "break 1;" + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintStmtCase(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&stmt.Case{ + Cond: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Stmts: []node.Node{ + &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, + }, + }) + + expected := `case $a: + $a;` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintStmtCaseEmpty(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&stmt.Case{ + Cond: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Stmts: []node.Node{}, + }) + + expected := "case $a:" + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintStmtCatch(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&stmt.Namespace{ + Stmts: []node.Node{ + &stmt.Catch{ + Types: []node.Node{ + &name.Name{Parts: []node.Node{&name.NamePart{Value: "Exception"}}}, + &name.FullyQualified{Parts: []node.Node{&name.NamePart{Value: "RuntimeException"}}}, + }, + Variable: &expr.Variable{VarName: &node.Identifier{Value: "e"}}, + Stmts: []node.Node{ + &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, + }, + }, + }, + }) + + expected := `namespace { + catch (Exception | \RuntimeException $e) { + $a; + } +}` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintStmtClassMethod(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&stmt.ClassMethod{ + Modifiers: []node.Node{&node.Identifier{Value: "public"}}, + ReturnsRef: true, + MethodName: &node.Identifier{Value: "foo"}, + Params: []node.Node{ + &node.Parameter{ + ByRef: true, + VariableType: &node.Nullable{Expr: &name.Name{Parts: []node.Node{&name.NamePart{Value: "int"}}}}, + Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + DefaultValue: &expr.ConstFetch{Constant: &name.Name{Parts: []node.Node{&name.NamePart{Value: "null"}}}}, + }, + &node.Parameter{ + Variadic: true, + Variable: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + }, + }, + ReturnType: &name.Name{Parts: []node.Node{&name.NamePart{Value: "void"}}}, + Stmt: &stmt.StmtList{ + Stmts: []node.Node{ + &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, + }, + }, + }) + + expected := `public function &foo(?int &$a = null, ...$b): void +{ + $a; +}` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} +func TestPrintStmtAbstractClassMethod(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&stmt.ClassMethod{ + Modifiers: []node.Node{&node.Identifier{Value: "public"}}, + ReturnsRef: true, + MethodName: &node.Identifier{Value: "foo"}, + Params: []node.Node{ + &node.Parameter{ + ByRef: true, + VariableType: &node.Nullable{Expr: &name.Name{Parts: []node.Node{&name.NamePart{Value: "int"}}}}, + Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + DefaultValue: &expr.ConstFetch{Constant: &name.Name{Parts: []node.Node{&name.NamePart{Value: "null"}}}}, + }, + &node.Parameter{ + Variadic: true, + Variable: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + }, + }, + ReturnType: &name.Name{Parts: []node.Node{&name.NamePart{Value: "void"}}}, + Stmt: &stmt.Nop{}, + }) + + expected := `public function &foo(?int &$a = null, ...$b): void;` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintStmtClass(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&stmt.Namespace{ + Stmts: []node.Node{ + &stmt.Class{ + Modifiers: []node.Node{&node.Identifier{Value: "abstract"}}, + ClassName: &node.Identifier{Value: "Foo"}, + Extends: &stmt.ClassExtends{ + ClassName: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Bar"}}}, + }, + Implements: &stmt.ClassImplements{ + InterfaceNames: []node.Node{ + &name.Name{Parts: []node.Node{&name.NamePart{Value: "Baz"}}}, + &name.Name{Parts: []node.Node{&name.NamePart{Value: "Quuz"}}}, + }, + }, + Stmts: []node.Node{ + &stmt.ClassConstList{ + Modifiers: []node.Node{&node.Identifier{Value: "public"}}, + Consts: []node.Node{ + &stmt.Constant{ + ConstantName: &node.Identifier{Value: "FOO"}, + Expr: &scalar.String{Value: "'bar'"}, + }, + }, + }, + }, + }, + }, + }) + + expected := `namespace { + abstract class Foo extends Bar implements Baz, Quuz + { + public const FOO = 'bar'; + } +}` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintStmtAnonymousClass(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&stmt.Namespace{ + Stmts: []node.Node{ + &stmt.Class{ + Modifiers: []node.Node{&node.Identifier{Value: "abstract"}}, + ArgumentList: &node.ArgumentList{ + Arguments: []node.Node{ + &node.Argument{ + Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + }, + &node.Argument{ + Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + }, + }, + }, + Extends: &stmt.ClassExtends{ + ClassName: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Bar"}}}, + }, + Implements: &stmt.ClassImplements{ + InterfaceNames: []node.Node{ + &name.Name{Parts: []node.Node{&name.NamePart{Value: "Baz"}}}, + &name.Name{Parts: []node.Node{&name.NamePart{Value: "Quuz"}}}, + }, + }, + Stmts: []node.Node{ + &stmt.ClassConstList{ + Modifiers: []node.Node{&node.Identifier{Value: "public"}}, + Consts: []node.Node{ + &stmt.Constant{ + ConstantName: &node.Identifier{Value: "FOO"}, + Expr: &scalar.String{Value: "'bar'"}, + }, + }, + }, + }, + }, + }, + }) + + expected := `namespace { + abstract class($a, $b) extends Bar implements Baz, Quuz + { + public const FOO = 'bar'; + } +}` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintStmtClassConstList(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&stmt.ClassConstList{ + Modifiers: []node.Node{&node.Identifier{Value: "public"}}, + Consts: []node.Node{ + &stmt.Constant{ + ConstantName: &node.Identifier{Value: "FOO"}, + Expr: &scalar.String{Value: "'a'"}, + }, + &stmt.Constant{ + ConstantName: &node.Identifier{Value: "BAR"}, + Expr: &scalar.String{Value: "'b'"}, + }, + }, + }) + + expected := `public const FOO = 'a', BAR = 'b';` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintStmtConstant(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&stmt.Constant{ + ConstantName: &node.Identifier{Value: "FOO"}, + Expr: &scalar.String{Value: "'BAR'"}, + }) + + expected := "FOO = 'BAR'" + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintStmtContinue(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&stmt.Continue{ + Expr: &scalar.Lnumber{Value: "1"}, + }) + + expected := `continue 1;` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintStmtDeclareStmts(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&stmt.StmtList{ + Stmts: []node.Node{ + &stmt.Declare{ + Consts: []node.Node{ + &stmt.Constant{ + ConstantName: &node.Identifier{Value: "FOO"}, + Expr: &scalar.String{Value: "'bar'"}, + }, + }, + Stmt: &stmt.StmtList{ + Stmts: []node.Node{ + &stmt.Nop{}, + }, + }, + }, + }, + }) + + expected := `{ + declare(FOO = 'bar') { + ; + } +}` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintStmtDeclareExpr(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&stmt.StmtList{ + Stmts: []node.Node{ + &stmt.Declare{ + Consts: []node.Node{ + &stmt.Constant{ + ConstantName: &node.Identifier{Value: "FOO"}, + Expr: &scalar.String{Value: "'bar'"}, + }, + }, + Stmt: &stmt.Expression{Expr: &scalar.String{Value: "'bar'"}}, + }, + }, + }) + + expected := `{ + declare(FOO = 'bar') + 'bar'; +}` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintStmtDeclareNop(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&stmt.Declare{ + Consts: []node.Node{ + &stmt.Constant{ + ConstantName: &node.Identifier{Value: "FOO"}, + Expr: &scalar.String{Value: "'bar'"}, + }, + }, + Stmt: &stmt.Nop{}, + }) + + expected := `declare(FOO = 'bar');` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintStmtDefalut(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&stmt.Default{ + Stmts: []node.Node{ + &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, + }, + }) + + expected := `default: + $a;` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintStmtDefalutEmpty(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&stmt.Default{ + Stmts: []node.Node{}, + }) + + expected := `default:` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintStmtDo_Expression(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&stmt.Namespace{ + Stmts: []node.Node{ + &stmt.Do{ + Cond: &scalar.Lnumber{Value: "1"}, + Stmt: &stmt.Expression{ + Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + }, + }, + }, + }) + + expected := `namespace { + do + $a; + while (1); +}` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintStmtDo_StmtList(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&stmt.Namespace{ + Stmts: []node.Node{ + &stmt.Do{ + Cond: &scalar.Lnumber{Value: "1"}, + Stmt: &stmt.StmtList{ + Stmts: []node.Node{ + &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, + }, + }, + }, + }, + }) + + expected := `namespace { + do { + $a; + } while (1); +}` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintStmtEcho(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&stmt.Echo{ + Exprs: []node.Node{ + &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + }, + }) + + expected := `echo $a, $b;` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintStmtElseIfStmts(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&stmt.ElseIf{ + Cond: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Stmt: &stmt.StmtList{ + Stmts: []node.Node{ + &stmt.Nop{}, + }, + }, + }) + + expected := `elseif ($a) { + ; +}` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintStmtElseIfExpr(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&stmt.ElseIf{ + Cond: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Stmt: &stmt.Expression{Expr: &scalar.String{Value: "'bar'"}}, + }) + + expected := `elseif ($a) + 'bar';` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintStmtElseIfNop(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&stmt.ElseIf{ + Cond: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Stmt: &stmt.Nop{}, + }) + + expected := `elseif ($a);` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintStmtElseStmts(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&stmt.Else{ + Stmt: &stmt.StmtList{ + Stmts: []node.Node{ + &stmt.Nop{}, + }, + }, + }) + + expected := `else { + ; +}` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintStmtElseExpr(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&stmt.Else{ + Stmt: &stmt.Expression{Expr: &scalar.String{Value: "'bar'"}}, + }) + + expected := `else + 'bar';` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintStmtElseNop(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&stmt.Else{ + Stmt: &stmt.Nop{}, + }) + + expected := `else;` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintExpression(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}) + + expected := `$a;` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintStmtFinally(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&stmt.Namespace{ + Stmts: []node.Node{ + &stmt.Finally{ + Stmts: []node.Node{ + &stmt.Nop{}, + }, + }, + }, + }) + + expected := `namespace { + finally { + ; + } +}` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintStmtForStmts(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&stmt.Namespace{ + Stmts: []node.Node{ + &stmt.For{ + Init: []node.Node{ + &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + }, + Cond: []node.Node{ + &expr.Variable{VarName: &node.Identifier{Value: "c"}}, + &expr.Variable{VarName: &node.Identifier{Value: "d"}}, + }, + Loop: []node.Node{ + &expr.Variable{VarName: &node.Identifier{Value: "e"}}, + &expr.Variable{VarName: &node.Identifier{Value: "f"}}, + }, + Stmt: &stmt.StmtList{ + Stmts: []node.Node{ + &stmt.Nop{}, + }, + }, + }, + }, + }) + + expected := `namespace { + for ($a, $b; $c, $d; $e, $f) { + ; + } +}` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintStmtForExpr(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&stmt.Namespace{ + Stmts: []node.Node{ + &stmt.For{ + Init: []node.Node{ + &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + }, + Cond: []node.Node{ + &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + }, + Loop: []node.Node{ + &expr.Variable{VarName: &node.Identifier{Value: "c"}}, + }, + Stmt: &stmt.Expression{Expr: &scalar.String{Value: "'bar'"}}, + }, + }, + }) + + expected := `namespace { + for ($a; $b; $c) + 'bar'; +}` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintStmtForNop(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&stmt.For{ + Init: []node.Node{ + &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + }, + Cond: []node.Node{ + &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + }, + Loop: []node.Node{ + &expr.Variable{VarName: &node.Identifier{Value: "c"}}, + }, + Stmt: &stmt.Nop{}, + }) + + expected := `for ($a; $b; $c);` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintStmtForeachStmts(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&stmt.Namespace{ + Stmts: []node.Node{ + &stmt.Foreach{ + Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Variable: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Stmt: &stmt.StmtList{ + Stmts: []node.Node{ + &stmt.Nop{}, + }, + }, + }, + }, + }) + + expected := `namespace { + foreach ($a as $b) { + ; + } +}` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintStmtForeachExpr(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&stmt.Namespace{ + Stmts: []node.Node{ + &stmt.Foreach{ + Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Key: &expr.Variable{VarName: &node.Identifier{Value: "k"}}, + Variable: &expr.Variable{VarName: &node.Identifier{Value: "v"}}, + Stmt: &stmt.Expression{Expr: &scalar.String{Value: "'bar'"}}, + }, + }, + }) + + expected := `namespace { + foreach ($a as $k => $v) + 'bar'; +}` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintStmtForeachNop(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&stmt.Foreach{ + Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Key: &expr.Variable{VarName: &node.Identifier{Value: "k"}}, + Variable: &expr.Reference{Variable: &expr.Variable{VarName: &node.Identifier{Value: "v"}}}, + Stmt: &stmt.Nop{}, + }) + + expected := `foreach ($a as $k => &$v);` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintStmtFunction(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&stmt.Namespace{ + Stmts: []node.Node{ + &stmt.Function{ + ReturnsRef: true, + FunctionName: &node.Identifier{Value: "foo"}, + Params: []node.Node{ + &node.Parameter{ + ByRef: true, + Variadic: false, + Variable: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + }, + }, + ReturnType: &name.FullyQualified{Parts: []node.Node{&name.NamePart{Value: "Foo"}}}, + Stmts: []node.Node{ + &stmt.Nop{}, + }, + }, + }, + }) + + expected := `namespace { + function &foo(&$var): \Foo { + ; + } +}` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintStmtGlobal(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&stmt.Global{ + Vars: []node.Node{ + &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + }, + }) + + expected := `global $a, $b;` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintStmtGoto(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&stmt.Goto{ + Label: &node.Identifier{Value: "FOO"}, + }) + + expected := `goto FOO;` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintStmtGroupUse(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&stmt.GroupUse{ + UseType: &node.Identifier{Value: "function"}, + Prefix: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Foo"}}}, + UseList: []node.Node{ + &stmt.Use{ + Use: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Bar"}}}, + Alias: &node.Identifier{Value: "Baz"}, + }, + &stmt.Use{ + Use: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Quuz"}}}, + }, + }, + }) + + expected := `use function Foo\{Bar as Baz, Quuz};` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintHaltCompiler(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&stmt.HaltCompiler{}) + + expected := `__halt_compiler();` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintIfExpression(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&stmt.Namespace{ + Stmts: []node.Node{ + &stmt.If{ + Cond: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Stmt: &stmt.Expression{ + Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + }, + ElseIf: []node.Node{ + &stmt.ElseIf{ + Cond: &expr.Variable{VarName: &node.Identifier{Value: "c"}}, + Stmt: &stmt.StmtList{ + Stmts: []node.Node{ + &stmt.Expression{ + Expr: &expr.Variable{VarName: &node.Identifier{Value: "d"}}, + }, + }, + }, + }, + &stmt.ElseIf{ + Cond: &expr.Variable{VarName: &node.Identifier{Value: "e"}}, + Stmt: &stmt.Nop{}, + }, + }, + Else: &stmt.Else{ + Stmt: &stmt.Expression{ + Expr: &expr.Variable{VarName: &node.Identifier{Value: "f"}}, + }, + }, + }, + }, + }) + + expected := `namespace { + if ($a) + $b; + elseif ($c) { + $d; + } + elseif ($e); + else + $f; +}` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintIfStmtList(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&stmt.Namespace{ + Stmts: []node.Node{ + &stmt.If{ + Cond: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Stmt: &stmt.StmtList{ + Stmts: []node.Node{ + &stmt.Expression{ + Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + }, + }, + }, + }, + }, + }) + + expected := `namespace { + if ($a) { + $b; + } +}` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintIfNop(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&stmt.If{ + Cond: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Stmt: &stmt.Nop{}, + }) + + expected := `if ($a);` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintInlineHtml(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&stmt.InlineHtml{ + Value: "test", + }) + + expected := `?>test 0 { - firstStmt := v.Stmts[0] - v.Stmts = v.Stmts[1:] + var stmts []node.Node + + if len(nn.Stmts) > 0 { + firstStmt := nn.Stmts[0] + stmts = nn.Stmts[1:] switch fs := firstStmt.(type) { case *stmt.InlineHtml: io.WriteString(p.w, fs.Value) - io.WriteString(p.w, " 0 { @@ -506,62 +540,108 @@ func (p *Printer) printNameName(n node.Node) { p.Print(part) } + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printNameFullyQualified(n node.Node) { nn := n.(*name.FullyQualified) + p.printMeta(nn, meta.NodeStart) + + p.printMeta(nn, meta.NsSeparatorToken) for _, part := range nn.Parts { io.WriteString(p.w, "\\") p.Print(part) } + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printNameRelative(n node.Node) { nn := n.(*name.Relative) + p.printMeta(nn, meta.NodeStart) + p.printMeta(nn, meta.NamespaceToken) io.WriteString(p.w, "namespace") - for _, part := range nn.Parts { + for k, part := range nn.Parts { + if k == 0 { + p.printMeta(nn, meta.NsSeparatorToken) + } io.WriteString(p.w, "\\") p.Print(part) } + + p.printMeta(nn, meta.NodeEnd) } // scalar func (p *Printer) printScalarLNumber(n node.Node) { - v := n.(*scalar.Lnumber).Value - io.WriteString(p.w, v) + nn := n.(*scalar.Lnumber) + p.printMeta(nn, meta.NodeStart) + + p.printMeta(nn, meta.LnumberToken) + + io.WriteString(p.w, nn.Value) + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printScalarDNumber(n node.Node) { - v := n.(*scalar.Dnumber).Value - io.WriteString(p.w, v) + nn := n.(*scalar.Dnumber) + p.printMeta(nn, meta.NodeStart) + + p.printMeta(nn, meta.DnumberToken) + + io.WriteString(p.w, nn.Value) + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printScalarString(n node.Node) { - v := n.(*scalar.String).Value + nn := n.(*scalar.String) + p.printMeta(nn, meta.NodeStart) - io.WriteString(p.w, v) + p.printMeta(nn, meta.ConstantEncapsedStringToken) + + io.WriteString(p.w, nn.Value) + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printScalarEncapsedStringPart(n node.Node) { - v := n.(*scalar.EncapsedStringPart).Value - io.WriteString(p.w, v) + nn := n.(*scalar.EncapsedStringPart) + p.printMeta(nn, meta.NodeStart) + + p.printMeta(nn, meta.EncapsedAndWhitespaceToken) + + io.WriteString(p.w, nn.Value) + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printScalarEncapsed(n node.Node) { + nn := n.(*scalar.Encapsed) + p.printMeta(nn, meta.NodeStart) + + p.printMeta(nn, meta.DoubleQuoteToken) io.WriteString(p.w, "\"") - for _, nn := range n.(*scalar.Encapsed).Parts { - p.Print(nn) + for _, part := range nn.Parts { + p.Print(part) } io.WriteString(p.w, "\"") + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printScalarHeredoc(n node.Node) { nn := n.(*scalar.Heredoc) + p.printMeta(nn, meta.NodeStart) + + p.printMeta(nn, meta.StartHeredocToken) io.WriteString(p.w, "<<<") io.WriteString(p.w, nn.Label) @@ -572,1611 +652,2228 @@ func (p *Printer) printScalarHeredoc(n node.Node) { } io.WriteString(p.w, strings.Trim(nn.Label, "\"'")) + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printScalarMagicConstant(n node.Node) { - v := n.(*scalar.MagicConstant).Value - io.WriteString(p.w, v) + nn := n.(*scalar.MagicConstant) + p.printMeta(nn, meta.NodeStart) + + p.printMeta(nn, meta.MagicConstantToken) + + io.WriteString(p.w, nn.Value) + + p.printMeta(nn, meta.NodeEnd) } // Assign func (p *Printer) printAssign(n node.Node) { nn := n.(*assign.Assign) + p.printMeta(nn, meta.NodeStart) p.Print(nn.Variable) - io.WriteString(p.w, " = ") + p.printMeta(nn, meta.EqualToken) + io.WriteString(p.w, "=") p.Print(nn.Expression) + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printReference(n node.Node) { nn := n.(*assign.Reference) + p.printMeta(nn, meta.NodeStart) p.Print(nn.Variable) - io.WriteString(p.w, " =& ") + p.printMeta(nn, meta.EqualToken) + io.WriteString(p.w, "=") + p.printMeta(nn, meta.AmpersandToken) + io.WriteString(p.w, "&") p.Print(nn.Expression) + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printAssignBitwiseAnd(n node.Node) { nn := n.(*assign.BitwiseAnd) + p.printMeta(nn, meta.NodeStart) p.Print(nn.Variable) - io.WriteString(p.w, " &= ") + p.printMeta(nn, meta.AndEqualToken) + io.WriteString(p.w, "&") + io.WriteString(p.w, "=") p.Print(nn.Expression) + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printAssignBitwiseOr(n node.Node) { nn := n.(*assign.BitwiseOr) + p.printMeta(nn, meta.NodeStart) p.Print(nn.Variable) - io.WriteString(p.w, " |= ") + p.printMeta(nn, meta.OrEqualToken) + io.WriteString(p.w, "|=") p.Print(nn.Expression) + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printAssignBitwiseXor(n node.Node) { nn := n.(*assign.BitwiseXor) + p.printMeta(nn, meta.NodeStart) p.Print(nn.Variable) - io.WriteString(p.w, " ^= ") + p.printMeta(nn, meta.XorEqualToken) + io.WriteString(p.w, "^=") p.Print(nn.Expression) + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printAssignConcat(n node.Node) { nn := n.(*assign.Concat) + p.printMeta(nn, meta.NodeStart) p.Print(nn.Variable) - io.WriteString(p.w, " .= ") + p.printMeta(nn, meta.ConcatEqualToken) + io.WriteString(p.w, ".=") p.Print(nn.Expression) + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printAssignDiv(n node.Node) { nn := n.(*assign.Div) + p.printMeta(nn, meta.NodeStart) p.Print(nn.Variable) - io.WriteString(p.w, " /= ") + p.printMeta(nn, meta.DivEqualToken) + io.WriteString(p.w, "/=") p.Print(nn.Expression) + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printAssignMinus(n node.Node) { nn := n.(*assign.Minus) + p.printMeta(nn, meta.NodeStart) p.Print(nn.Variable) - io.WriteString(p.w, " -= ") + p.printMeta(nn, meta.MinusEqualToken) + io.WriteString(p.w, "-=") p.Print(nn.Expression) + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printAssignMod(n node.Node) { nn := n.(*assign.Mod) + p.printMeta(nn, meta.NodeStart) p.Print(nn.Variable) - io.WriteString(p.w, " %= ") + p.printMeta(nn, meta.ModEqualToken) + io.WriteString(p.w, "%=") p.Print(nn.Expression) + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printAssignMul(n node.Node) { nn := n.(*assign.Mul) + p.printMeta(nn, meta.NodeStart) p.Print(nn.Variable) - io.WriteString(p.w, " *= ") + p.printMeta(nn, meta.MulEqualToken) + io.WriteString(p.w, "*=") p.Print(nn.Expression) + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printAssignPlus(n node.Node) { nn := n.(*assign.Plus) + p.printMeta(nn, meta.NodeStart) p.Print(nn.Variable) - io.WriteString(p.w, " += ") + p.printMeta(nn, meta.PlusEqualToken) + io.WriteString(p.w, "+=") p.Print(nn.Expression) + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printAssignPow(n node.Node) { nn := n.(*assign.Pow) + p.printMeta(nn, meta.NodeStart) p.Print(nn.Variable) - io.WriteString(p.w, " **= ") + p.printMeta(nn, meta.PowEqualToken) + io.WriteString(p.w, "**=") p.Print(nn.Expression) + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printAssignShiftLeft(n node.Node) { nn := n.(*assign.ShiftLeft) + p.printMeta(nn, meta.NodeStart) p.Print(nn.Variable) - io.WriteString(p.w, " <<= ") + p.printMeta(nn, meta.SlEqualToken) + io.WriteString(p.w, "<<=") p.Print(nn.Expression) + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printAssignShiftRight(n node.Node) { nn := n.(*assign.ShiftRight) + p.printMeta(nn, meta.NodeStart) p.Print(nn.Variable) - io.WriteString(p.w, " >>= ") + p.printMeta(nn, meta.SrEqualToken) + io.WriteString(p.w, ">>=") p.Print(nn.Expression) + + p.printMeta(nn, meta.NodeEnd) } // binary func (p *Printer) printBinaryBitwiseAnd(n node.Node) { nn := n.(*binary.BitwiseAnd) + p.printMeta(nn, meta.NodeStart) p.Print(nn.Left) - io.WriteString(p.w, " & ") + p.printMeta(nn, meta.AmpersandToken) + io.WriteString(p.w, "&") p.Print(nn.Right) + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printBinaryBitwiseOr(n node.Node) { nn := n.(*binary.BitwiseOr) + p.printMeta(nn, meta.NodeStart) p.Print(nn.Left) - io.WriteString(p.w, " | ") + p.printMeta(nn, meta.VerticalBarToken) + io.WriteString(p.w, "|") p.Print(nn.Right) + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printBinaryBitwiseXor(n node.Node) { nn := n.(*binary.BitwiseXor) + p.printMeta(nn, meta.NodeStart) p.Print(nn.Left) - io.WriteString(p.w, " ^ ") + p.printMeta(nn, meta.CaretToken) + io.WriteString(p.w, "^") p.Print(nn.Right) + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printBinaryBooleanAnd(n node.Node) { nn := n.(*binary.BooleanAnd) + p.printMeta(nn, meta.NodeStart) p.Print(nn.Left) - io.WriteString(p.w, " && ") + p.printMeta(nn, meta.BooleanAndToken) + io.WriteString(p.w, "&&") p.Print(nn.Right) + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printBinaryBooleanOr(n node.Node) { nn := n.(*binary.BooleanOr) + p.printMeta(nn, meta.NodeStart) p.Print(nn.Left) - io.WriteString(p.w, " || ") + p.printMeta(nn, meta.BooleanOrToken) + io.WriteString(p.w, "||") p.Print(nn.Right) + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printBinaryCoalesce(n node.Node) { nn := n.(*binary.Coalesce) + p.printMeta(nn, meta.NodeStart) p.Print(nn.Left) - io.WriteString(p.w, " ?? ") + p.printMeta(nn, meta.CoalesceToken) + io.WriteString(p.w, "??") p.Print(nn.Right) + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printBinaryConcat(n node.Node) { nn := n.(*binary.Concat) + p.printMeta(nn, meta.NodeStart) p.Print(nn.Left) - io.WriteString(p.w, " . ") + p.printMeta(nn, meta.DotToken) + io.WriteString(p.w, ".") p.Print(nn.Right) + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printBinaryDiv(n node.Node) { nn := n.(*binary.Div) + p.printMeta(nn, meta.NodeStart) p.Print(nn.Left) - io.WriteString(p.w, " / ") + p.printMeta(nn, meta.SlashToken) + io.WriteString(p.w, "/") p.Print(nn.Right) + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printBinaryEqual(n node.Node) { nn := n.(*binary.Equal) + p.printMeta(nn, meta.NodeStart) p.Print(nn.Left) - io.WriteString(p.w, " == ") + p.printMeta(nn, meta.IsEqualToken) + io.WriteString(p.w, "==") p.Print(nn.Right) + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printBinaryGreaterOrEqual(n node.Node) { nn := n.(*binary.GreaterOrEqual) + p.printMeta(nn, meta.NodeStart) p.Print(nn.Left) - io.WriteString(p.w, " >= ") + p.printMeta(nn, meta.IsGreaterOrEqualToken) + io.WriteString(p.w, ">=") p.Print(nn.Right) + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printBinaryGreater(n node.Node) { nn := n.(*binary.Greater) + p.printMeta(nn, meta.NodeStart) p.Print(nn.Left) - io.WriteString(p.w, " > ") + p.printMeta(nn, meta.GreaterToken) + io.WriteString(p.w, ">") p.Print(nn.Right) + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printBinaryIdentical(n node.Node) { nn := n.(*binary.Identical) + p.printMeta(nn, meta.NodeStart) p.Print(nn.Left) - io.WriteString(p.w, " === ") + p.printMeta(nn, meta.IsIdenticalToken) + io.WriteString(p.w, "===") p.Print(nn.Right) + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printBinaryLogicalAnd(n node.Node) { nn := n.(*binary.LogicalAnd) + p.printMeta(nn, meta.NodeStart) p.Print(nn.Left) - io.WriteString(p.w, " and ") + p.printMeta(nn, meta.LogicalAndToken) + io.WriteString(p.w, "and") p.Print(nn.Right) + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printBinaryLogicalOr(n node.Node) { nn := n.(*binary.LogicalOr) + p.printMeta(nn, meta.NodeStart) p.Print(nn.Left) - io.WriteString(p.w, " or ") + p.printMeta(nn, meta.LogicalOrToken) + io.WriteString(p.w, "or") p.Print(nn.Right) + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printBinaryLogicalXor(n node.Node) { nn := n.(*binary.LogicalXor) + p.printMeta(nn, meta.NodeStart) p.Print(nn.Left) - io.WriteString(p.w, " xor ") + p.printMeta(nn, meta.LogicalXorToken) + io.WriteString(p.w, "xor") p.Print(nn.Right) + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printBinaryMinus(n node.Node) { nn := n.(*binary.Minus) + p.printMeta(nn, meta.NodeStart) p.Print(nn.Left) - io.WriteString(p.w, " - ") + p.printMeta(nn, meta.MinusToken) + io.WriteString(p.w, "-") p.Print(nn.Right) + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printBinaryMod(n node.Node) { nn := n.(*binary.Mod) + p.printMeta(nn, meta.NodeStart) p.Print(nn.Left) - io.WriteString(p.w, " % ") + p.printMeta(nn, meta.PercentToken) + io.WriteString(p.w, "%") p.Print(nn.Right) + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printBinaryMul(n node.Node) { nn := n.(*binary.Mul) + p.printMeta(nn, meta.NodeStart) p.Print(nn.Left) - io.WriteString(p.w, " * ") + p.printMeta(nn, meta.AsteriskToken) + io.WriteString(p.w, "*") p.Print(nn.Right) + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printBinaryNotEqual(n node.Node) { nn := n.(*binary.NotEqual) + p.printMeta(nn, meta.NodeStart) p.Print(nn.Left) - io.WriteString(p.w, " != ") + p.printMeta(nn, meta.IsNotEqualToken) + io.WriteString(p.w, "!=") p.Print(nn.Right) + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printBinaryNotIdentical(n node.Node) { nn := n.(*binary.NotIdentical) + p.printMeta(nn, meta.NodeStart) p.Print(nn.Left) - io.WriteString(p.w, " !== ") + p.printMeta(nn, meta.IsNotIdenticalToken) + io.WriteString(p.w, "!==") p.Print(nn.Right) + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printBinaryPlus(n node.Node) { nn := n.(*binary.Plus) + p.printMeta(nn, meta.NodeStart) p.Print(nn.Left) - io.WriteString(p.w, " + ") + p.printMeta(nn, meta.PlusToken) + io.WriteString(p.w, "+") p.Print(nn.Right) + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printBinaryPow(n node.Node) { nn := n.(*binary.Pow) + p.printMeta(nn, meta.NodeStart) p.Print(nn.Left) - io.WriteString(p.w, " ** ") + p.printMeta(nn, meta.PowToken) + io.WriteString(p.w, "**") p.Print(nn.Right) + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printBinaryShiftLeft(n node.Node) { nn := n.(*binary.ShiftLeft) + p.printMeta(nn, meta.NodeStart) p.Print(nn.Left) - io.WriteString(p.w, " << ") + p.printMeta(nn, meta.SlToken) + io.WriteString(p.w, "<<") p.Print(nn.Right) + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printBinaryShiftRight(n node.Node) { nn := n.(*binary.ShiftRight) + p.printMeta(nn, meta.NodeStart) p.Print(nn.Left) - io.WriteString(p.w, " >> ") + p.printMeta(nn, meta.SrToken) + io.WriteString(p.w, ">>") p.Print(nn.Right) + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printBinarySmallerOrEqual(n node.Node) { nn := n.(*binary.SmallerOrEqual) + p.printMeta(nn, meta.NodeStart) p.Print(nn.Left) - io.WriteString(p.w, " <= ") + p.printMeta(nn, meta.IsSmallerOrEqualToken) + io.WriteString(p.w, "<=") p.Print(nn.Right) + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printBinarySmaller(n node.Node) { nn := n.(*binary.Smaller) + p.printMeta(nn, meta.NodeStart) p.Print(nn.Left) - io.WriteString(p.w, " < ") + p.printMeta(nn, meta.LessToken) + io.WriteString(p.w, "<") p.Print(nn.Right) + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printBinarySpaceship(n node.Node) { nn := n.(*binary.Spaceship) + p.printMeta(nn, meta.NodeStart) p.Print(nn.Left) - io.WriteString(p.w, " <=> ") + p.printMeta(nn, meta.SpaceshipToken) + io.WriteString(p.w, "<=>") p.Print(nn.Right) + + p.printMeta(nn, meta.NodeEnd) } // cast func (p *Printer) printArray(n node.Node) { nn := n.(*cast.Array) + p.printMeta(nn, meta.NodeStart) + p.printMeta(nn, meta.ArrayCastToken) io.WriteString(p.w, "(array)") p.Print(nn.Expr) + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printBool(n node.Node) { nn := n.(*cast.Bool) + p.printMeta(nn, meta.NodeStart) + p.printMeta(nn, meta.BoolCastToken) io.WriteString(p.w, "(bool)") p.Print(nn.Expr) + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printDouble(n node.Node) { nn := n.(*cast.Double) + p.printMeta(nn, meta.NodeStart) + p.printMeta(nn, meta.DoubleCastToken) io.WriteString(p.w, "(float)") p.Print(nn.Expr) + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printInt(n node.Node) { nn := n.(*cast.Int) + p.printMeta(nn, meta.NodeStart) + p.printMeta(nn, meta.IntCastToken) io.WriteString(p.w, "(int)") p.Print(nn.Expr) + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printObject(n node.Node) { nn := n.(*cast.Object) + p.printMeta(nn, meta.NodeStart) + p.printMeta(nn, meta.ObjectCastToken) io.WriteString(p.w, "(object)") p.Print(nn.Expr) + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printString(n node.Node) { nn := n.(*cast.String) + p.printMeta(nn, meta.NodeStart) + p.printMeta(nn, meta.StringCastToken) io.WriteString(p.w, "(string)") p.Print(nn.Expr) + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printUnset(n node.Node) { nn := n.(*cast.Unset) + p.printMeta(nn, meta.NodeStart) + p.printMeta(nn, meta.UnsetCastToken) io.WriteString(p.w, "(unset)") p.Print(nn.Expr) + + p.printMeta(nn, meta.NodeEnd) } // expr func (p *Printer) printExprArrayDimFetch(n node.Node) { nn := n.(*expr.ArrayDimFetch) + p.printMeta(nn, meta.NodeStart) p.Print(nn.Variable) + p.printMeta(nn, meta.OpenSquareBracket) io.WriteString(p.w, "[") p.Print(nn.Dim) + p.printMeta(nn, meta.CloseSquareBracket) io.WriteString(p.w, "]") + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printExprArrayItem(n node.Node) { nn := n.(*expr.ArrayItem) + p.printMeta(nn, meta.NodeStart) if nn.Key != nil { p.Print(nn.Key) - io.WriteString(p.w, " => ") + p.printMeta(nn, meta.DoubleArrowToken) + io.WriteString(p.w, "=>") } p.Print(nn.Val) + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printExprArray(n node.Node) { nn := n.(*expr.Array) + p.printMeta(nn, meta.NodeStart) - io.WriteString(p.w, "array(") - p.joinPrint(", ", nn.Items) + p.printMeta(nn, meta.ArrayToken) + io.WriteString(p.w, "array") + p.printMeta(nn, meta.OpenParenthesisToken) + io.WriteString(p.w, "(") + p.joinPrint(",", nn.Items) + p.printMeta(nn, meta.CloseParenthesisToken) io.WriteString(p.w, ")") + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printExprBitwiseNot(n node.Node) { nn := n.(*expr.BitwiseNot) + p.printMeta(nn, meta.NodeStart) + p.printMeta(nn, meta.TildeToken) io.WriteString(p.w, "~") p.Print(nn.Expr) + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printExprBooleanNot(n node.Node) { nn := n.(*expr.BooleanNot) + p.printMeta(nn, meta.NodeStart) + p.printMeta(nn, meta.ExclamationMarkToken) io.WriteString(p.w, "!") p.Print(nn.Expr) + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printExprClassConstFetch(n node.Node) { nn := n.(*expr.ClassConstFetch) + p.printMeta(nn, meta.NodeStart) p.Print(nn.Class) + p.printMeta(nn, meta.PaamayimNekudotayimToken) io.WriteString(p.w, "::") - io.WriteString(p.w, nn.ConstantName.(*node.Identifier).Value) + p.Print(nn.ConstantName) + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printExprClone(n node.Node) { nn := n.(*expr.Clone) + p.printMeta(nn, meta.NodeStart) - io.WriteString(p.w, "clone ") + p.printMeta(nn, meta.CloneToken) + io.WriteString(p.w, "clone") p.Print(nn.Expr) + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printExprClosureUse(n node.Node) { nn := n.(*expr.ClosureUse) + p.printMeta(nn, meta.NodeStart) - io.WriteString(p.w, "use (") - p.joinPrint(", ", nn.Uses) + p.printMeta(nn, meta.UseToken) + io.WriteString(p.w, "use") + p.printMeta(nn, meta.OpenParenthesisToken) + io.WriteString(p.w, "(") + p.joinPrint(",", nn.Uses) + p.printMeta(nn, meta.CloseParenthesisToken) io.WriteString(p.w, ")") + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printExprClosure(n node.Node) { nn := n.(*expr.Closure) + p.printMeta(nn, meta.NodeStart) if nn.Static { - io.WriteString(p.w, "static ") + p.printMeta(nn, meta.StaticToken) + io.WriteString(p.w, "static") } - io.WriteString(p.w, "function ") + p.printMeta(nn, meta.FunctionToken) + io.WriteString(p.w, "function") if nn.ReturnsRef { + p.printMeta(nn, meta.AmpersandToken) io.WriteString(p.w, "&") } + p.printMeta(nn, meta.OpenParenthesisToken) io.WriteString(p.w, "(") - p.joinPrint(", ", nn.Params) + p.joinPrint(",", nn.Params) + p.printMeta(nn, meta.CloseParenthesisToken) io.WriteString(p.w, ")") if nn.ClosureUse != nil { - io.WriteString(p.w, " ") p.Print(nn.ClosureUse) } if nn.ReturnType != nil { - io.WriteString(p.w, ": ") + p.printMeta(nn.ReturnType, meta.ColonToken) + io.WriteString(p.w, ":") p.Print(nn.ReturnType) } - io.WriteString(p.w, " {\n") + p.printMeta(nn, meta.OpenCurlyBracesToken) + io.WriteString(p.w, "{") p.printNodes(nn.Stmts) - io.WriteString(p.w, "\n") - p.printIndent() + p.printMeta(nn, meta.CloseCurlyBracesToken) io.WriteString(p.w, "}") + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printExprConstFetch(n node.Node) { nn := n.(*expr.ConstFetch) + p.printMeta(nn, meta.NodeStart) p.Print(nn.Constant) + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printExprDie(n node.Node) { nn := n.(*expr.Die) + p.printMeta(nn, meta.NodeStart) - io.WriteString(p.w, "die(") + p.printMeta(nn, meta.ExitToken) + io.WriteString(p.w, "die") + p.printMeta(nn.Expr, meta.OpenParenthesisToken) + io.WriteString(p.w, "(") p.Print(nn.Expr) + p.printMeta(nn.Expr, meta.CloseParenthesisToken) io.WriteString(p.w, ")") + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printExprEmpty(n node.Node) { nn := n.(*expr.Empty) + p.printMeta(nn, meta.NodeStart) - io.WriteString(p.w, "empty(") + p.printMeta(nn, meta.EmptyToken) + io.WriteString(p.w, "empty") + p.printMeta(nn, meta.OpenParenthesisToken) + io.WriteString(p.w, "(") p.Print(nn.Expr) + p.printMeta(nn, meta.CloseParenthesisToken) io.WriteString(p.w, ")") + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printExprErrorSuppress(n node.Node) { nn := n.(*expr.ErrorSuppress) + p.printMeta(nn, meta.NodeStart) + p.printMeta(nn, meta.AtToken) io.WriteString(p.w, "@") p.Print(nn.Expr) + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printExprEval(n node.Node) { nn := n.(*expr.Eval) + p.printMeta(nn, meta.NodeStart) - io.WriteString(p.w, "eval(") + p.printMeta(nn, meta.EvalToken) + io.WriteString(p.w, "eval") + p.printMeta(nn, meta.OpenParenthesisToken) + io.WriteString(p.w, "(") p.Print(nn.Expr) + p.printMeta(nn, meta.CloseParenthesisToken) io.WriteString(p.w, ")") + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printExprExit(n node.Node) { nn := n.(*expr.Exit) + p.printMeta(nn, meta.NodeStart) - io.WriteString(p.w, "exit(") + p.printMeta(nn, meta.ExitToken) + io.WriteString(p.w, "exit") + p.printMeta(nn.Expr, meta.OpenParenthesisToken) + io.WriteString(p.w, "(") p.Print(nn.Expr) + p.printMeta(nn.Expr, meta.CloseParenthesisToken) io.WriteString(p.w, ")") + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printExprFunctionCall(n node.Node) { nn := n.(*expr.FunctionCall) + p.printMeta(nn, meta.NodeStart) p.Print(nn.Function) + p.printMeta(nn.ArgumentList, meta.OpenParenthesisToken) io.WriteString(p.w, "(") - p.joinPrint(", ", nn.ArgumentList.Arguments) + p.joinPrint(",", nn.ArgumentList.Arguments) + p.printMeta(nn.ArgumentList, meta.CloseParenthesisToken) io.WriteString(p.w, ")") + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printExprInclude(n node.Node) { nn := n.(*expr.Include) + p.printMeta(nn, meta.NodeStart) - io.WriteString(p.w, "include ") + p.printMeta(nn, meta.IncludeToken) + io.WriteString(p.w, "include") p.Print(nn.Expr) + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printExprIncludeOnce(n node.Node) { nn := n.(*expr.IncludeOnce) + p.printMeta(nn, meta.NodeStart) - io.WriteString(p.w, "include_once ") + p.printMeta(nn, meta.IncludeOnceToken) + io.WriteString(p.w, "include_once") p.Print(nn.Expr) + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printExprInstanceOf(n node.Node) { nn := n.(*expr.InstanceOf) + p.printMeta(nn, meta.NodeStart) p.Print(nn.Expr) - io.WriteString(p.w, " instanceof ") + p.printMeta(nn, meta.InstanceofToken) + io.WriteString(p.w, "instanceof") p.Print(nn.Class) + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printExprIsset(n node.Node) { nn := n.(*expr.Isset) + p.printMeta(nn, meta.NodeStart) - io.WriteString(p.w, "isset(") - p.joinPrint(", ", nn.Variables) + p.printMeta(nn, meta.IssetToken) + io.WriteString(p.w, "isset") + p.printMeta(nn, meta.OpenParenthesisToken) + io.WriteString(p.w, "(") + p.joinPrint(",", nn.Variables) + p.printMeta(nn, meta.CloseParenthesisToken) io.WriteString(p.w, ")") + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printExprList(n node.Node) { nn := n.(*expr.List) + p.printMeta(nn, meta.NodeStart) - io.WriteString(p.w, "list(") - p.joinPrint(", ", nn.Items) + p.printMeta(nn, meta.ListToken) + io.WriteString(p.w, "list") + p.printMeta(nn, meta.OpenParenthesisToken) + io.WriteString(p.w, "(") + p.joinPrint(",", nn.Items) + p.printMeta(nn, meta.CloseParenthesisToken) io.WriteString(p.w, ")") + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printExprMethodCall(n node.Node) { nn := n.(*expr.MethodCall) + p.printMeta(nn, meta.NodeStart) p.Print(nn.Variable) + p.printMeta(nn, meta.ObjectOperatorToken) io.WriteString(p.w, "->") p.Print(nn.Method) + p.printMeta(nn.ArgumentList, meta.OpenParenthesisToken) io.WriteString(p.w, "(") - p.joinPrint(", ", nn.ArgumentList.Arguments) + p.joinPrint(",", nn.ArgumentList.Arguments) + p.printMeta(nn.ArgumentList, meta.CloseParenthesisToken) io.WriteString(p.w, ")") + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printExprNew(n node.Node) { nn := n.(*expr.New) + p.printMeta(nn, meta.NodeStart) - io.WriteString(p.w, "new ") + p.printMeta(nn, meta.NewToken) + io.WriteString(p.w, "new") p.Print(nn.Class) if nn.ArgumentList != nil { + p.printMeta(nn.ArgumentList, meta.OpenParenthesisToken) io.WriteString(p.w, "(") - p.joinPrint(", ", nn.ArgumentList.Arguments) + p.joinPrint(",", nn.ArgumentList.Arguments) + p.printMeta(nn.ArgumentList, meta.CloseParenthesisToken) io.WriteString(p.w, ")") } + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printExprPostDec(n node.Node) { nn := n.(*expr.PostDec) + p.printMeta(nn, meta.NodeStart) p.Print(nn.Variable) + p.printMeta(nn, meta.DecToken) io.WriteString(p.w, "--") + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printExprPostInc(n node.Node) { nn := n.(*expr.PostInc) + p.printMeta(nn, meta.NodeStart) p.Print(nn.Variable) + p.printMeta(nn, meta.IncToken) io.WriteString(p.w, "++") + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printExprPreDec(n node.Node) { nn := n.(*expr.PreDec) + p.printMeta(nn, meta.NodeStart) + p.printMeta(nn, meta.DecToken) io.WriteString(p.w, "--") p.Print(nn.Variable) + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printExprPreInc(n node.Node) { nn := n.(*expr.PreInc) + p.printMeta(nn, meta.NodeStart) + p.printMeta(nn, meta.IncToken) io.WriteString(p.w, "++") p.Print(nn.Variable) + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printExprPrint(n node.Node) { nn := n.(*expr.Print) + p.printMeta(nn, meta.NodeStart) - io.WriteString(p.w, "print(") + p.printMeta(nn, meta.PrintToken) + io.WriteString(p.w, "print") + p.printMeta(nn.Expr, meta.OpenParenthesisToken) + io.WriteString(p.w, "(") p.Print(nn.Expr) + p.printMeta(nn.Expr, meta.CloseParenthesisToken) io.WriteString(p.w, ")") + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printExprPropertyFetch(n node.Node) { nn := n.(*expr.PropertyFetch) + p.printMeta(nn, meta.NodeStart) p.Print(nn.Variable) + p.printMeta(nn, meta.ObjectOperatorToken) io.WriteString(p.w, "->") p.Print(nn.Property) + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printExprReference(n node.Node) { nn := n.(*expr.Reference) + p.printMeta(nn, meta.NodeStart) + p.printMeta(nn, meta.AmpersandToken) io.WriteString(p.w, "&") p.Print(nn.Variable) + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printExprRequire(n node.Node) { nn := n.(*expr.Require) + p.printMeta(nn, meta.NodeStart) - io.WriteString(p.w, "require ") + p.printMeta(nn, meta.RequireToken) + io.WriteString(p.w, "require") p.Print(nn.Expr) + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printExprRequireOnce(n node.Node) { nn := n.(*expr.RequireOnce) + p.printMeta(nn, meta.NodeStart) - io.WriteString(p.w, "require_once ") + p.printMeta(nn, meta.RequireOnceToken) + io.WriteString(p.w, "require_once") p.Print(nn.Expr) + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printExprShellExec(n node.Node) { nn := n.(*expr.ShellExec) + p.printMeta(nn, meta.NodeStart) + p.printMeta(nn, meta.BackquoteToken) io.WriteString(p.w, "`") for _, part := range nn.Parts { p.Print(part) } io.WriteString(p.w, "`") + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printExprShortArray(n node.Node) { nn := n.(*expr.ShortArray) + p.printMeta(nn, meta.NodeStart) + p.printMeta(nn, meta.OpenSquareBracket) io.WriteString(p.w, "[") - p.joinPrint(", ", nn.Items) + p.joinPrint(",", nn.Items) + p.printMeta(nn, meta.CloseSquareBracket) io.WriteString(p.w, "]") + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printExprShortList(n node.Node) { nn := n.(*expr.ShortList) + p.printMeta(nn, meta.NodeStart) + p.printMeta(nn, meta.OpenSquareBracket) io.WriteString(p.w, "[") - p.joinPrint(", ", nn.Items) + p.joinPrint(",", nn.Items) + p.printMeta(nn, meta.CloseSquareBracket) io.WriteString(p.w, "]") + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printExprStaticCall(n node.Node) { nn := n.(*expr.StaticCall) + p.printMeta(nn, meta.NodeStart) p.Print(nn.Class) + p.printMeta(nn, meta.PaamayimNekudotayimToken) io.WriteString(p.w, "::") p.Print(nn.Call) + p.printMeta(nn.ArgumentList, meta.OpenParenthesisToken) io.WriteString(p.w, "(") - p.joinPrint(", ", nn.ArgumentList.Arguments) + p.joinPrint(",", nn.ArgumentList.Arguments) + p.printMeta(nn.ArgumentList, meta.CloseParenthesisToken) io.WriteString(p.w, ")") + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printExprStaticPropertyFetch(n node.Node) { nn := n.(*expr.StaticPropertyFetch) + p.printMeta(nn, meta.NodeStart) p.Print(nn.Class) + p.printMeta(nn, meta.PaamayimNekudotayimToken) io.WriteString(p.w, "::") p.Print(nn.Property) + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printExprTernary(n node.Node) { nn := n.(*expr.Ternary) + p.printMeta(nn, meta.NodeStart) p.Print(nn.Condition) - io.WriteString(p.w, " ?") + p.printMeta(nn, meta.QuestionMarkToken) + io.WriteString(p.w, "?") if nn.IfTrue != nil { - io.WriteString(p.w, " ") p.Print(nn.IfTrue) - io.WriteString(p.w, " ") } - io.WriteString(p.w, ": ") + p.printMeta(nn, meta.ColonToken) + io.WriteString(p.w, ":") p.Print(nn.IfFalse) + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printExprUnaryMinus(n node.Node) { nn := n.(*expr.UnaryMinus) + p.printMeta(nn, meta.NodeStart) + p.printMeta(nn, meta.MinusToken) io.WriteString(p.w, "-") p.Print(nn.Expr) + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printExprUnaryPlus(n node.Node) { nn := n.(*expr.UnaryPlus) + p.printMeta(nn, meta.NodeStart) + p.printMeta(nn, meta.PlusToken) io.WriteString(p.w, "+") p.Print(nn.Expr) + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printExprVariable(n node.Node) { + nn := n.(*expr.Variable) + p.printMeta(nn, meta.NodeStart) + p.printMeta(nn, meta.VariableToken) io.WriteString(p.w, "$") - p.Print(n.(*expr.Variable).VarName) + p.Print(nn.VarName) + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printExprYieldFrom(n node.Node) { nn := n.(*expr.YieldFrom) + p.printMeta(nn, meta.NodeStart) - io.WriteString(p.w, "yield from ") + p.printMeta(nn, meta.YieldFromToken) + io.WriteString(p.w, "yield from") p.Print(nn.Expr) + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printExprYield(n node.Node) { nn := n.(*expr.Yield) + p.printMeta(nn, meta.NodeStart) - io.WriteString(p.w, "yield ") + p.printMeta(nn, meta.YieldToken) + io.WriteString(p.w, "yield") if nn.Key != nil { p.Print(nn.Key) - io.WriteString(p.w, " => ") + p.printMeta(nn, meta.DoubleArrowToken) + io.WriteString(p.w, "=>") } p.Print(nn.Value) + + p.printMeta(nn, meta.NodeEnd) } // smtm func (p *Printer) printStmtAltElseIf(n node.Node) { nn := n.(*stmt.AltElseIf) + p.printMeta(nn, meta.NodeStart) - io.WriteString(p.w, "elseif (") + p.printMeta(nn, meta.ElseifToken) + io.WriteString(p.w, "elseif") + p.printMeta(nn, meta.OpenParenthesisToken) + io.WriteString(p.w, "(") p.Print(nn.Cond) - io.WriteString(p.w, ") :") + p.printMeta(nn, meta.CloseParenthesisToken) + io.WriteString(p.w, ")") + p.printMeta(nn, meta.ColonToken) + io.WriteString(p.w, ":") if s := nn.Stmt.(*stmt.StmtList).Stmts; len(s) > 0 { - io.WriteString(p.w, "\n") p.printNodes(s) } + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printStmtAltElse(n node.Node) { nn := n.(*stmt.AltElse) + p.printMeta(nn, meta.NodeStart) - io.WriteString(p.w, "else :") + p.printMeta(nn, meta.ElseToken) + io.WriteString(p.w, "else") + p.printMeta(nn, meta.ColonToken) + io.WriteString(p.w, ":") if s := nn.Stmt.(*stmt.StmtList).Stmts; len(s) > 0 { - io.WriteString(p.w, "\n") p.printNodes(s) } + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printStmtAltFor(n node.Node) { nn := n.(*stmt.AltFor) + p.printMeta(nn, meta.NodeStart) - io.WriteString(p.w, "for (") - p.joinPrint(", ", nn.Init) - io.WriteString(p.w, "; ") - p.joinPrint(", ", nn.Cond) - io.WriteString(p.w, "; ") - p.joinPrint(", ", nn.Loop) - io.WriteString(p.w, ") :\n") + p.printMeta(nn, meta.ForToken) + io.WriteString(p.w, "for") + p.printMeta(nn, meta.OpenParenthesisToken) + io.WriteString(p.w, "(") + p.joinPrint(",", nn.Init) + p.printMeta(nn, meta.ForInitSemicolonToken) + io.WriteString(p.w, ";") + p.joinPrint(",", nn.Cond) + p.printMeta(nn, meta.ForCondSemicolonToken) + io.WriteString(p.w, ";") + p.joinPrint(",", nn.Loop) + p.printMeta(nn, meta.CloseParenthesisToken) + io.WriteString(p.w, ")") + p.printMeta(nn, meta.ColonToken) + io.WriteString(p.w, ":") s := nn.Stmt.(*stmt.StmtList) p.printNodes(s.Stmts) - io.WriteString(p.w, "\n") - p.printIndent() - io.WriteString(p.w, "endfor;") + p.printMeta(nn, meta.EndforToken) + io.WriteString(p.w, "endfor") + p.printMeta(nn, meta.SemiColonToken) + io.WriteString(p.w, ";") + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printStmtAltForeach(n node.Node) { nn := n.(*stmt.AltForeach) + p.printMeta(nn, meta.NodeStart) - io.WriteString(p.w, "foreach (") + p.printMeta(nn, meta.ForeachToken) + io.WriteString(p.w, "foreach") + p.printMeta(nn, meta.OpenParenthesisToken) + io.WriteString(p.w, "(") p.Print(nn.Expr) - io.WriteString(p.w, " as ") + p.printMeta(nn, meta.AsToken) + io.WriteString(p.w, "as") if nn.Key != nil { p.Print(nn.Key) - io.WriteString(p.w, " => ") + p.printMeta(nn, meta.DoubleArrowToken) + io.WriteString(p.w, "=>") } p.Print(nn.Variable) - io.WriteString(p.w, ") :\n") + p.printMeta(nn, meta.CloseParenthesisToken) + io.WriteString(p.w, ")") + p.printMeta(nn, meta.ColonToken) + io.WriteString(p.w, ":") s := nn.Stmt.(*stmt.StmtList) p.printNodes(s.Stmts) - io.WriteString(p.w, "\n") - p.printIndent() - io.WriteString(p.w, "endforeach;") + p.printMeta(nn, meta.EndforeachToken) + io.WriteString(p.w, "endforeach") + p.printMeta(nn, meta.SemiColonToken) + io.WriteString(p.w, ";") + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printStmtAltIf(n node.Node) { nn := n.(*stmt.AltIf) + p.printMeta(nn, meta.NodeStart) - io.WriteString(p.w, "if (") + p.printMeta(nn, meta.IfToken) + io.WriteString(p.w, "if") + p.printMeta(nn, meta.OpenParenthesisToken) + io.WriteString(p.w, "(") p.Print(nn.Cond) - io.WriteString(p.w, ") :\n") + p.printMeta(nn, meta.CloseParenthesisToken) + io.WriteString(p.w, ")") + p.printMeta(nn, meta.ColonToken) + io.WriteString(p.w, ":") s := nn.Stmt.(*stmt.StmtList) p.printNodes(s.Stmts) for _, elseif := range nn.ElseIf { - io.WriteString(p.w, "\n") - p.printIndent() p.Print(elseif) } if nn.Else != nil { - io.WriteString(p.w, "\n") - p.printIndent() p.Print(nn.Else) } - io.WriteString(p.w, "\n") - p.printIndent() - io.WriteString(p.w, "endif;") + p.printMeta(nn, meta.EndifToken) + io.WriteString(p.w, "endif") + p.printMeta(nn, meta.SemiColonToken) + io.WriteString(p.w, ";") + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printStmtAltSwitch(n node.Node) { nn := n.(*stmt.AltSwitch) + p.printMeta(nn, meta.NodeStart) - io.WriteString(p.w, "switch (") + p.printMeta(nn, meta.SwitchToken) + io.WriteString(p.w, "switch") + p.printMeta(nn, meta.OpenParenthesisToken) + io.WriteString(p.w, "(") p.Print(nn.Cond) - io.WriteString(p.w, ") :\n") + p.printMeta(nn, meta.CloseParenthesisToken) + io.WriteString(p.w, ")") + p.printMeta(nn, meta.ColonToken) + io.WriteString(p.w, ":") + p.printMeta(nn, meta.SwitchSemicolonToken) + io.WriteString(p.w, ";") s := nn.CaseList.Cases p.printNodes(s) - io.WriteString(p.w, "\n") - p.printIndent() - io.WriteString(p.w, "endswitch;") + p.printMeta(nn, meta.EndswitchToken) + io.WriteString(p.w, "endswitch") + p.printMeta(nn, meta.SemiColonToken) + io.WriteString(p.w, ";") + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printStmtAltWhile(n node.Node) { nn := n.(*stmt.AltWhile) + p.printMeta(nn, meta.NodeStart) - io.WriteString(p.w, "while (") + p.printMeta(nn, meta.WhileToken) + io.WriteString(p.w, "while") + p.printMeta(nn, meta.OpenParenthesisToken) + io.WriteString(p.w, "(") p.Print(nn.Cond) - io.WriteString(p.w, ") :\n") + p.printMeta(nn, meta.CloseParenthesisToken) + io.WriteString(p.w, ")") + p.printMeta(nn, meta.ColonToken) + io.WriteString(p.w, ":") s := nn.Stmt.(*stmt.StmtList) p.printNodes(s.Stmts) - io.WriteString(p.w, "\n") - p.printIndent() - io.WriteString(p.w, "endwhile;") + p.printMeta(nn, meta.EndwhileToken) + io.WriteString(p.w, "endwhile") + p.printMeta(nn, meta.SemiColonToken) + io.WriteString(p.w, ";") + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printStmtBreak(n node.Node) { nn := n.(*stmt.Break) + p.printMeta(nn, meta.NodeStart) + p.printMeta(nn, meta.BreakToken) io.WriteString(p.w, "break") if nn.Expr != nil { - io.WriteString(p.w, " ") + p.printMeta(nn.Expr, meta.OpenParenthesisToken) + io.WriteString(p.w, "(") p.Print(nn.Expr) + p.printMeta(nn.Expr, meta.CloseParenthesisToken) + io.WriteString(p.w, ")") } + p.printMeta(nn, meta.SemiColonToken) io.WriteString(p.w, ";") + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printStmtCase(n node.Node) { nn := n.(*stmt.Case) + p.printMeta(nn, meta.NodeStart) - io.WriteString(p.w, "case ") + p.printMeta(nn, meta.CaseToken) + io.WriteString(p.w, "case") p.Print(nn.Cond) + p.printMeta(nn, meta.CaseSeparatorToken) io.WriteString(p.w, ":") if len(nn.Stmts) > 0 { - io.WriteString(p.w, "\n") p.printNodes(nn.Stmts) } + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printStmtCatch(n node.Node) { nn := n.(*stmt.Catch) + p.printMeta(nn, meta.NodeStart) - io.WriteString(p.w, "catch (") - p.joinPrint(" | ", nn.Types) - io.WriteString(p.w, " ") + p.printMeta(nn, meta.CatchToken) + io.WriteString(p.w, "catch") + p.printMeta(nn, meta.OpenParenthesisToken) + io.WriteString(p.w, "(") + p.joinPrint("|", nn.Types) p.Print(nn.Variable) - io.WriteString(p.w, ") {\n") + p.printMeta(nn, meta.CloseParenthesisToken) + io.WriteString(p.w, ")") + p.printMeta(nn, meta.OpenCurlyBracesToken) + io.WriteString(p.w, "{") p.printNodes(nn.Stmts) - io.WriteString(p.w, "\n") - p.printIndent() + p.printMeta(nn, meta.CloseCurlyBracesToken) io.WriteString(p.w, "}") + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printStmtClassMethod(n node.Node) { nn := n.(*stmt.ClassMethod) + p.printMeta(nn, meta.NodeStart) if nn.Modifiers != nil { - p.joinPrint(" ", nn.Modifiers) - io.WriteString(p.w, " ") + p.joinPrint("", nn.Modifiers) } - io.WriteString(p.w, "function ") + p.printMeta(nn, meta.FunctionToken) + io.WriteString(p.w, "function") if nn.ReturnsRef { + p.printMeta(nn, meta.AmpersandToken) io.WriteString(p.w, "&") } p.Print(nn.MethodName) + p.printMeta(nn, meta.OpenParenthesisToken) io.WriteString(p.w, "(") - p.joinPrint(", ", nn.Params) + p.joinPrint(",", nn.Params) + p.printMeta(nn, meta.CloseParenthesisToken) io.WriteString(p.w, ")") if nn.ReturnType != nil { - io.WriteString(p.w, ": ") + p.printMeta(nn.ReturnType, meta.ColonToken) + io.WriteString(p.w, ":") p.Print(nn.ReturnType) } - switch s := nn.Stmt.(type) { - case *stmt.StmtList: - io.WriteString(p.w, "\n") - p.printIndent() - io.WriteString(p.w, "{\n") - p.printNodes(s.Stmts) - io.WriteString(p.w, "\n") - p.printIndent() - io.WriteString(p.w, "}") - default: - p.Print(s) - } + p.Print(nn.Stmt) + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printStmtClass(n node.Node) { nn := n.(*stmt.Class) + p.printMeta(nn, meta.NodeStart) if nn.Modifiers != nil { - p.joinPrint(" ", nn.Modifiers) - io.WriteString(p.w, " ") + p.joinPrint("", nn.Modifiers) } + p.printMeta(nn, meta.ClassToken) io.WriteString(p.w, "class") if nn.ClassName != nil { - io.WriteString(p.w, " ") p.Print(nn.ClassName) } if nn.ArgumentList != nil { + p.printMeta(nn.ArgumentList, meta.OpenParenthesisToken) io.WriteString(p.w, "(") - p.joinPrint(", ", nn.ArgumentList.Arguments) + p.joinPrint(",", nn.ArgumentList.Arguments) + p.printMeta(nn.ArgumentList, meta.CloseParenthesisToken) io.WriteString(p.w, ")") } if nn.Extends != nil { - io.WriteString(p.w, " extends ") + p.printMeta(nn.Extends, meta.ExtendsToken) + io.WriteString(p.w, "extends") p.Print(nn.Extends.ClassName) } if nn.Implements != nil { - io.WriteString(p.w, " implements ") - p.joinPrint(", ", nn.Implements.InterfaceNames) + p.printMeta(nn.Implements, meta.ImplementsToken) + io.WriteString(p.w, "implements") + p.joinPrint(",", nn.Implements.InterfaceNames) } - io.WriteString(p.w, "\n") - p.printIndent() - io.WriteString(p.w, "{\n") + p.printMeta(nn, meta.OpenCurlyBracesToken) + io.WriteString(p.w, "{") p.printNodes(nn.Stmts) - io.WriteString(p.w, "\n") - p.printIndent() + p.printMeta(nn, meta.CloseCurlyBracesToken) io.WriteString(p.w, "}") + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printStmtClassConstList(n node.Node) { nn := n.(*stmt.ClassConstList) + p.printMeta(nn, meta.NodeStart) if nn.Modifiers != nil { - p.joinPrint(" ", nn.Modifiers) - io.WriteString(p.w, " ") + p.joinPrint("", nn.Modifiers) } - io.WriteString(p.w, "const ") + p.printMeta(nn, meta.ConstToken) + io.WriteString(p.w, "const") - p.joinPrint(", ", nn.Consts) + p.joinPrint(",", nn.Consts) + p.printMeta(nn, meta.SemiColonToken) io.WriteString(p.w, ";") + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printStmtConstant(n node.Node) { nn := n.(*stmt.Constant) + p.printMeta(nn, meta.NodeStart) p.Print(nn.ConstantName) - io.WriteString(p.w, " = ") + p.printMeta(nn, meta.EqualToken) + io.WriteString(p.w, "=") p.Print(nn.Expr) + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printStmtContinue(n node.Node) { nn := n.(*stmt.Continue) + p.printMeta(nn, meta.NodeStart) + p.printMeta(nn, meta.ContinueToken) io.WriteString(p.w, "continue") + if nn.Expr != nil { - io.WriteString(p.w, " ") + p.printMeta(nn.Expr, meta.OpenParenthesisToken) + io.WriteString(p.w, "(") p.Print(nn.Expr) + p.printMeta(nn.Expr, meta.CloseParenthesisToken) + io.WriteString(p.w, ")") } + p.printMeta(nn, meta.SemiColonToken) io.WriteString(p.w, ";") + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printStmtDeclare(n node.Node) { nn := n.(*stmt.Declare) + p.printMeta(nn, meta.NodeStart) - io.WriteString(p.w, "declare(") - p.joinPrint(", ", nn.Consts) + p.printMeta(nn, meta.DeclareToken) + io.WriteString(p.w, "declare") + p.printMeta(nn, meta.OpenParenthesisToken) + io.WriteString(p.w, "(") + p.joinPrint(",", nn.Consts) + p.printMeta(nn, meta.CloseParenthesisToken) io.WriteString(p.w, ")") - switch s := nn.Stmt.(type) { - case *stmt.Nop: - p.Print(s) - break - case *stmt.StmtList: - io.WriteString(p.w, " ") - p.Print(s) - default: - io.WriteString(p.w, "\n") - p.indentDepth++ - p.printIndent() - p.Print(s) - p.indentDepth-- - } + p.Print(nn.Stmt) + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printStmtDefault(n node.Node) { nn := n.(*stmt.Default) - io.WriteString(p.w, "default:") + p.printMeta(nn, meta.NodeStart) + + p.printMeta(nn, meta.DefaultToken) + io.WriteString(p.w, "default") + p.printMeta(nn, meta.CaseSeparatorToken) + io.WriteString(p.w, ":") if len(nn.Stmts) > 0 { - io.WriteString(p.w, "\n") p.printNodes(nn.Stmts) } + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printStmtDo(n node.Node) { nn := n.(*stmt.Do) + p.printMeta(nn, meta.NodeStart) + + p.printMeta(nn, meta.DoToken) io.WriteString(p.w, "do") - switch s := nn.Stmt.(type) { - case *stmt.StmtList: - io.WriteString(p.w, " ") - p.Print(s) - io.WriteString(p.w, " ") - default: - io.WriteString(p.w, "\n") - p.indentDepth++ - p.printIndent() - p.Print(s) - p.indentDepth-- - io.WriteString(p.w, "\n") - p.printIndent() - } + p.Print(nn.Stmt) - io.WriteString(p.w, "while (") + p.printMeta(nn, meta.WhileToken) + io.WriteString(p.w, "while") + p.printMeta(nn, meta.OpenParenthesisToken) + io.WriteString(p.w, "(") p.Print(nn.Cond) - io.WriteString(p.w, ");") + p.printMeta(nn, meta.CloseParenthesisToken) + io.WriteString(p.w, ")") + p.printMeta(nn, meta.SemiColonToken) + io.WriteString(p.w, ";") + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printStmtEcho(n node.Node) { nn := n.(*stmt.Echo) - io.WriteString(p.w, "echo ") - p.joinPrint(", ", nn.Exprs) + p.printMeta(nn, meta.NodeStart) + + p.printMeta(nn, meta.EchoToken) + io.WriteString(p.w, "echo") + p.joinPrint(",", nn.Exprs) + p.printMeta(nn, meta.SemiColonToken) io.WriteString(p.w, ";") + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printStmtElseif(n node.Node) { nn := n.(*stmt.ElseIf) + p.printMeta(nn, meta.NodeStart) - io.WriteString(p.w, "elseif (") + p.printMeta(nn, meta.ElseifToken) + io.WriteString(p.w, "elseif") + p.printMeta(nn, meta.OpenParenthesisToken) + io.WriteString(p.w, "(") p.Print(nn.Cond) + p.printMeta(nn, meta.CloseParenthesisToken) io.WriteString(p.w, ")") - switch s := nn.Stmt.(type) { - case *stmt.Nop: - p.Print(s) - break - case *stmt.StmtList: - io.WriteString(p.w, " ") - p.Print(s) - default: - io.WriteString(p.w, "\n") - p.indentDepth++ - p.printIndent() - p.Print(s) - p.indentDepth-- - } + p.Print(nn.Stmt) + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printStmtElse(n node.Node) { nn := n.(*stmt.Else) + p.printMeta(nn, meta.NodeStart) + p.printMeta(nn, meta.ElseToken) io.WriteString(p.w, "else") - switch s := nn.Stmt.(type) { - case *stmt.Nop: - p.Print(s) - break - case *stmt.StmtList: - io.WriteString(p.w, " ") - p.Print(s) - default: - io.WriteString(p.w, "\n") - p.indentDepth++ - p.printIndent() - p.Print(s) - p.indentDepth-- - } + p.Print(nn.Stmt) + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printStmtExpression(n node.Node) { nn := n.(*stmt.Expression) + p.printMeta(nn, meta.NodeStart) p.Print(nn.Expr) + p.printMeta(nn, meta.SemiColonToken) io.WriteString(p.w, ";") + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printStmtFinally(n node.Node) { nn := n.(*stmt.Finally) + p.printMeta(nn, meta.NodeStart) - io.WriteString(p.w, "finally {\n") + p.printMeta(nn, meta.FinallyToken) + io.WriteString(p.w, "finally") + p.printMeta(nn, meta.OpenCurlyBracesToken) + io.WriteString(p.w, "{") p.printNodes(nn.Stmts) - io.WriteString(p.w, "\n") - p.printIndent() + p.printMeta(nn, meta.CloseCurlyBracesToken) io.WriteString(p.w, "}") + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printStmtFor(n node.Node) { nn := n.(*stmt.For) + p.printMeta(nn, meta.NodeStart) - io.WriteString(p.w, "for (") - p.joinPrint(", ", nn.Init) - io.WriteString(p.w, "; ") - p.joinPrint(", ", nn.Cond) - io.WriteString(p.w, "; ") - p.joinPrint(", ", nn.Loop) + p.printMeta(nn, meta.ForToken) + io.WriteString(p.w, "for") + p.printMeta(nn, meta.OpenParenthesisToken) + io.WriteString(p.w, "(") + p.joinPrint(",", nn.Init) + p.printMeta(nn, meta.ForInitSemicolonToken) + io.WriteString(p.w, ";") + p.joinPrint(",", nn.Cond) + p.printMeta(nn, meta.ForCondSemicolonToken) + io.WriteString(p.w, ";") + p.joinPrint(",", nn.Loop) + p.printMeta(nn, meta.CloseParenthesisToken) io.WriteString(p.w, ")") - switch s := nn.Stmt.(type) { - case *stmt.Nop: - p.Print(s) - break - case *stmt.StmtList: - io.WriteString(p.w, " ") - p.Print(s) - default: - io.WriteString(p.w, "\n") - p.indentDepth++ - p.printIndent() - p.Print(s) - p.indentDepth-- - } + p.Print(nn.Stmt) + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printStmtForeach(n node.Node) { nn := n.(*stmt.Foreach) + p.printMeta(nn, meta.NodeStart) - io.WriteString(p.w, "foreach (") + p.printMeta(nn, meta.ForeachToken) + io.WriteString(p.w, "foreach") + p.printMeta(nn, meta.OpenParenthesisToken) + io.WriteString(p.w, "(") p.Print(nn.Expr) - io.WriteString(p.w, " as ") + p.printMeta(nn, meta.AsToken) + io.WriteString(p.w, "as") if nn.Key != nil { p.Print(nn.Key) - io.WriteString(p.w, " => ") + p.printMeta(nn, meta.DoubleArrowToken) + io.WriteString(p.w, "=>") } p.Print(nn.Variable) + p.printMeta(nn, meta.CloseParenthesisToken) io.WriteString(p.w, ")") - switch s := nn.Stmt.(type) { - case *stmt.Nop: - p.Print(s) - break - case *stmt.StmtList: - io.WriteString(p.w, " ") - p.Print(s) - default: - io.WriteString(p.w, "\n") - p.indentDepth++ - p.printIndent() - p.Print(s) - p.indentDepth-- - } + p.Print(nn.Stmt) + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printStmtFunction(n node.Node) { nn := n.(*stmt.Function) + p.printMeta(nn, meta.NodeStart) - io.WriteString(p.w, "function ") + p.printMeta(nn, meta.FunctionToken) + io.WriteString(p.w, "function") if nn.ReturnsRef { + p.printMeta(nn, meta.AmpersandToken) io.WriteString(p.w, "&") } p.Print(nn.FunctionName) + p.printMeta(nn, meta.OpenParenthesisToken) io.WriteString(p.w, "(") - p.joinPrint(", ", nn.Params) + p.joinPrint(",", nn.Params) + p.printMeta(nn, meta.CloseParenthesisToken) io.WriteString(p.w, ")") if nn.ReturnType != nil { - io.WriteString(p.w, ": ") + p.printMeta(nn.ReturnType, meta.ColonToken) + io.WriteString(p.w, ":") p.Print(nn.ReturnType) } - io.WriteString(p.w, " {\n") + p.printMeta(nn, meta.OpenCurlyBracesToken) + io.WriteString(p.w, "{") p.printNodes(nn.Stmts) - io.WriteString(p.w, "\n") - p.printIndent() + p.printMeta(nn, meta.CloseCurlyBracesToken) io.WriteString(p.w, "}") + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printStmtGlobal(n node.Node) { nn := n.(*stmt.Global) + p.printMeta(nn, meta.NodeStart) - io.WriteString(p.w, "global ") - p.joinPrint(", ", nn.Vars) + p.printMeta(nn, meta.GlobalToken) + io.WriteString(p.w, "global") + p.joinPrint(",", nn.Vars) + p.printMeta(nn, meta.SemiColonToken) io.WriteString(p.w, ";") + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printStmtGoto(n node.Node) { nn := n.(*stmt.Goto) + p.printMeta(nn, meta.NodeStart) - io.WriteString(p.w, "goto ") + p.printMeta(nn, meta.GotoToken) + io.WriteString(p.w, "goto") p.Print(nn.Label) + p.printMeta(nn, meta.SemiColonToken) io.WriteString(p.w, ";") + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printStmtGroupUse(n node.Node) { nn := n.(*stmt.GroupUse) + p.printMeta(nn, meta.NodeStart) - io.WriteString(p.w, "use ") + p.printMeta(nn, meta.UseToken) + io.WriteString(p.w, "use") if nn.UseType != nil { p.Print(nn.UseType) - io.WriteString(p.w, " ") } p.Print(nn.Prefix) - io.WriteString(p.w, "\\{") - p.joinPrint(", ", nn.UseList) - io.WriteString(p.w, "};") + p.printMeta(nn, meta.NsSeparatorToken) + io.WriteString(p.w, "\\") + p.printMeta(nn, meta.OpenCurlyBracesToken) + io.WriteString(p.w, "{") + p.joinPrint(",", nn.UseList) + p.printMeta(nn, meta.CloseCurlyBracesToken) + io.WriteString(p.w, "}") + p.printMeta(nn, meta.SemiColonToken) + io.WriteString(p.w, ";") + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printStmtHaltCompiler(n node.Node) { - io.WriteString(p.w, "__halt_compiler();") + nn := n.(*stmt.HaltCompiler) + p.printMeta(nn, meta.NodeStart) + + p.printMeta(n, meta.HaltCompilerToken) + io.WriteString(p.w, "__halt_compiler") + p.printMeta(n, meta.OpenParenthesisToken) + io.WriteString(p.w, "(") + p.printMeta(n, meta.CloseParenthesisToken) + io.WriteString(p.w, ")") + p.printMeta(n, meta.SemiColonToken) + io.WriteString(p.w, ";") + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printStmtIf(n node.Node) { nn := n.(*stmt.If) + p.printMeta(nn, meta.NodeStart) - io.WriteString(p.w, "if (") + p.printMeta(n, meta.IfToken) + io.WriteString(p.w, "if") + p.printMeta(n, meta.OpenParenthesisToken) + io.WriteString(p.w, "(") p.Print(nn.Cond) + p.printMeta(n, meta.CloseParenthesisToken) io.WriteString(p.w, ")") - switch s := nn.Stmt.(type) { - case *stmt.Nop: - p.Print(s) - break - case *stmt.StmtList: - io.WriteString(p.w, " ") - p.Print(s) - default: - io.WriteString(p.w, "\n") - p.indentDepth++ - p.printIndent() - p.Print(s) - p.indentDepth-- - } + p.Print(nn.Stmt) if nn.ElseIf != nil { - io.WriteString(p.w, "\n") - p.indentDepth-- p.printNodes(nn.ElseIf) - p.indentDepth++ } if nn.Else != nil { - io.WriteString(p.w, "\n") - p.printIndent() p.Print(nn.Else) } + + p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printStmtInlineHTML(n node.Node) { nn := n.(*stmt.InlineHtml) + p.printMeta(nn, meta.NodeStart) + p.printMeta(n, meta.InlineHTMLToken) io.WriteString(p.w, "?>") io.WriteString(p.w, nn.Value) io.WriteString(p.w, "Hello + bar ( ' ' ) ; + } elseif ( isset ( $b [ 2 ] ) ) + list( , $c , ) = $b; + else if ( 1 ); + else { + echo '' ; + }` + + actual := print(parse(src)) + + if src != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", src, actual) + } +} + +func TestParseAndPrintNew(t *testing.T) { + src := ` b ; + print ( $a ) ;` + + actual := print(parse(src)) + + if src != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", src, actual) + } +} + +func TestParseAndPrintForeachReferenceShellExec(t *testing.T) { + src := ` & $v ) { + ` + "` $v cmd `" + ` ; + }` + + actual := print(parse(src)) + + if src != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", src, actual) + } +} + +func TestParseAndPrintShortListShortArray(t *testing.T) { + src := ` $v ; + yield from $a ;` + + actual := print(parse(src)) + + if src != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", src, actual) + } +} + +func TestParseAndPrintAltIfExitDie(t *testing.T) { + src := ` & $v ) : + echo $v ; + endforeach ;` + + actual := print(parse(src)) + + if src != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", src, actual) + } +} + +func TestParseAndPrintAltSwitchCaseBreakContinueDefault(t *testing.T) { + src := `test>= $b ; + ` + + actual := print(parse(src)) + + if src != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", src, actual) + } +} + +func TestParseAndPrintBinary(t *testing.T) { + src := `= $b ; + $a > $b ; + $a === $b ; + $a and $b ; + $a or $b ; + $a xor $b ; + $a - $b ; + $a % $b ; + $a * $b ; + $a != $b ; + $a !== $b ; + $a + $b ; + $a ** $b ; + $a << $b ; + $a >> $b ; + $a <= $b ; + $a < $b ; + $a <=> $b ; + ` + + actual := print(parse(src)) + + if src != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", src, actual) + } +} + +func TestParseAndPrintUnary(t *testing.T) { + src := ` 2 ] ; + $a = array( 0 , 2 => 2 ) ; + ` + + actual := print(parse(src)) + + if src != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", src, actual) + } +} + +func TestParseAndPrintClassConstFetch(t *testing.T) { + src := `HTML"}, &stmt.Expression{ - Expr: &scalar.Heredoc{ - Label: "\"LBL\"", - Parts: []node.Node{ - &scalar.EncapsedStringPart{Value: "hello world\n"}, + Expr: &expr.Variable{ + VarName: &node.Identifier{ + Value: "a", }, }, }, }, }) - expected := `
HTML
HTML>= $b` + expected := `$a >>=$b` actual := o.String() if expected != actual { @@ -648,16 +989,22 @@ func TestPrintAssignShiftRight(t *testing.T) { // binary -func TestPrintBinaryBitwiseAnd(t *testing.T) { +func TestPrinterPrintBinaryBitwiseAnd(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&binary.BitwiseAnd{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.AmpersandToken, + }, + }, Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, }) - expected := `$a & $b` + expected := `$a &$b` actual := o.String() if expected != actual { @@ -665,16 +1012,22 @@ func TestPrintBinaryBitwiseAnd(t *testing.T) { } } -func TestPrintBinaryBitwiseOr(t *testing.T) { +func TestPrinterPrintBinaryBitwiseOr(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&binary.BitwiseOr{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.VerticalBarToken, + }, + }, Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, }) - expected := `$a | $b` + expected := `$a |$b` actual := o.String() if expected != actual { @@ -682,16 +1035,22 @@ func TestPrintBinaryBitwiseOr(t *testing.T) { } } -func TestPrintBinaryBitwiseXor(t *testing.T) { +func TestPrinterPrintBinaryBitwiseXor(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&binary.BitwiseXor{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.CaretToken, + }, + }, Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, }) - expected := `$a ^ $b` + expected := `$a ^$b` actual := o.String() if expected != actual { @@ -699,16 +1058,22 @@ func TestPrintBinaryBitwiseXor(t *testing.T) { } } -func TestPrintBinaryBooleanAnd(t *testing.T) { +func TestPrinterPrintBinaryBooleanAnd(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&binary.BooleanAnd{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.BooleanAndToken, + }, + }, Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, }) - expected := `$a && $b` + expected := `$a &&$b` actual := o.String() if expected != actual { @@ -716,16 +1081,22 @@ func TestPrintBinaryBooleanAnd(t *testing.T) { } } -func TestPrintBinaryBooleanOr(t *testing.T) { +func TestPrinterPrintBinaryBooleanOr(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&binary.BooleanOr{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.BooleanOrToken, + }, + }, Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, }) - expected := `$a || $b` + expected := `$a ||$b` actual := o.String() if expected != actual { @@ -733,16 +1104,22 @@ func TestPrintBinaryBooleanOr(t *testing.T) { } } -func TestPrintBinaryCoalesce(t *testing.T) { +func TestPrinterPrintBinaryCoalesce(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&binary.Coalesce{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.CoalesceToken, + }, + }, Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, }) - expected := `$a ?? $b` + expected := `$a ??$b` actual := o.String() if expected != actual { @@ -750,16 +1127,22 @@ func TestPrintBinaryCoalesce(t *testing.T) { } } -func TestPrintBinaryConcat(t *testing.T) { +func TestPrinterPrintBinaryConcat(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&binary.Concat{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.DotToken, + }, + }, Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, }) - expected := `$a . $b` + expected := `$a .$b` actual := o.String() if expected != actual { @@ -767,16 +1150,22 @@ func TestPrintBinaryConcat(t *testing.T) { } } -func TestPrintBinaryDiv(t *testing.T) { +func TestPrinterPrintBinaryDiv(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&binary.Div{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.SlashToken, + }, + }, Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, }) - expected := `$a / $b` + expected := `$a /$b` actual := o.String() if expected != actual { @@ -784,16 +1173,22 @@ func TestPrintBinaryDiv(t *testing.T) { } } -func TestPrintBinaryEqual(t *testing.T) { +func TestPrinterPrintBinaryEqual(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&binary.Equal{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.IsEqualToken, + }, + }, Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, }) - expected := `$a == $b` + expected := `$a ==$b` actual := o.String() if expected != actual { @@ -801,16 +1196,22 @@ func TestPrintBinaryEqual(t *testing.T) { } } -func TestPrintBinaryGreaterOrEqual(t *testing.T) { +func TestPrinterPrintBinaryGreaterOrEqual(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&binary.GreaterOrEqual{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.IsGreaterOrEqualToken, + }, + }, Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, }) - expected := `$a >= $b` + expected := `$a >=$b` actual := o.String() if expected != actual { @@ -818,16 +1219,22 @@ func TestPrintBinaryGreaterOrEqual(t *testing.T) { } } -func TestPrintBinaryGreater(t *testing.T) { +func TestPrinterPrintBinaryGreater(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&binary.Greater{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.GreaterToken, + }, + }, Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, }) - expected := `$a > $b` + expected := `$a >$b` actual := o.String() if expected != actual { @@ -835,16 +1242,22 @@ func TestPrintBinaryGreater(t *testing.T) { } } -func TestPrintBinaryIdentical(t *testing.T) { +func TestPrinterPrintBinaryIdentical(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&binary.Identical{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.IsIdenticalToken, + }, + }, Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, }) - expected := `$a === $b` + expected := `$a ===$b` actual := o.String() if expected != actual { @@ -852,16 +1265,22 @@ func TestPrintBinaryIdentical(t *testing.T) { } } -func TestPrintBinaryLogicalAnd(t *testing.T) { +func TestPrinterPrintBinaryLogicalAnd(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&binary.LogicalAnd{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.LogicalAndToken, + }, + }, Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, }) - expected := `$a and $b` + expected := `$a and$b` actual := o.String() if expected != actual { @@ -869,16 +1288,22 @@ func TestPrintBinaryLogicalAnd(t *testing.T) { } } -func TestPrintBinaryLogicalOr(t *testing.T) { +func TestPrinterPrintBinaryLogicalOr(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&binary.LogicalOr{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.LogicalOrToken, + }, + }, Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, }) - expected := `$a or $b` + expected := `$a or$b` actual := o.String() if expected != actual { @@ -886,16 +1311,22 @@ func TestPrintBinaryLogicalOr(t *testing.T) { } } -func TestPrintBinaryLogicalXor(t *testing.T) { +func TestPrinterPrintBinaryLogicalXor(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&binary.LogicalXor{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.LogicalXorToken, + }, + }, Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, }) - expected := `$a xor $b` + expected := `$a xor$b` actual := o.String() if expected != actual { @@ -903,16 +1334,22 @@ func TestPrintBinaryLogicalXor(t *testing.T) { } } -func TestPrintBinaryMinus(t *testing.T) { +func TestPrinterPrintBinaryMinus(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&binary.Minus{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.MinusToken, + }, + }, Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, }) - expected := `$a - $b` + expected := `$a -$b` actual := o.String() if expected != actual { @@ -920,16 +1357,22 @@ func TestPrintBinaryMinus(t *testing.T) { } } -func TestPrintBinaryMod(t *testing.T) { +func TestPrinterPrintBinaryMod(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&binary.Mod{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.PercentToken, + }, + }, Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, }) - expected := `$a % $b` + expected := `$a %$b` actual := o.String() if expected != actual { @@ -937,16 +1380,22 @@ func TestPrintBinaryMod(t *testing.T) { } } -func TestPrintBinaryMul(t *testing.T) { +func TestPrinterPrintBinaryMul(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&binary.Mul{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.AsteriskToken, + }, + }, Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, }) - expected := `$a * $b` + expected := `$a *$b` actual := o.String() if expected != actual { @@ -954,16 +1403,22 @@ func TestPrintBinaryMul(t *testing.T) { } } -func TestPrintBinaryNotEqual(t *testing.T) { +func TestPrinterPrintBinaryNotEqual(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&binary.NotEqual{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.IsNotEqualToken, + }, + }, Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, }) - expected := `$a != $b` + expected := `$a !=$b` actual := o.String() if expected != actual { @@ -971,16 +1426,22 @@ func TestPrintBinaryNotEqual(t *testing.T) { } } -func TestPrintBinaryNotIdentical(t *testing.T) { +func TestPrinterPrintBinaryNotIdentical(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&binary.NotIdentical{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.IsNotIdenticalToken, + }, + }, Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, }) - expected := `$a !== $b` + expected := `$a !==$b` actual := o.String() if expected != actual { @@ -988,16 +1449,22 @@ func TestPrintBinaryNotIdentical(t *testing.T) { } } -func TestPrintBinaryPlus(t *testing.T) { +func TestPrinterPrintBinaryPlus(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&binary.Plus{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.PlusToken, + }, + }, Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, }) - expected := `$a + $b` + expected := `$a +$b` actual := o.String() if expected != actual { @@ -1005,16 +1472,22 @@ func TestPrintBinaryPlus(t *testing.T) { } } -func TestPrintBinaryPow(t *testing.T) { +func TestPrinterPrintBinaryPow(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&binary.Pow{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.PowToken, + }, + }, Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, }) - expected := `$a ** $b` + expected := `$a **$b` actual := o.String() if expected != actual { @@ -1022,16 +1495,22 @@ func TestPrintBinaryPow(t *testing.T) { } } -func TestPrintBinaryShiftLeft(t *testing.T) { +func TestPrinterPrintBinaryShiftLeft(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&binary.ShiftLeft{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.SlToken, + }, + }, Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, }) - expected := `$a << $b` + expected := `$a <<$b` actual := o.String() if expected != actual { @@ -1039,16 +1518,22 @@ func TestPrintBinaryShiftLeft(t *testing.T) { } } -func TestPrintBinaryShiftRight(t *testing.T) { +func TestPrinterPrintBinaryShiftRight(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&binary.ShiftRight{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.SrToken, + }, + }, Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, }) - expected := `$a >> $b` + expected := `$a >>$b` actual := o.String() if expected != actual { @@ -1056,16 +1541,22 @@ func TestPrintBinaryShiftRight(t *testing.T) { } } -func TestPrintBinarySmallerOrEqual(t *testing.T) { +func TestPrinterPrintBinarySmallerOrEqual(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&binary.SmallerOrEqual{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.IsSmallerOrEqualToken, + }, + }, Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, }) - expected := `$a <= $b` + expected := `$a <=$b` actual := o.String() if expected != actual { @@ -1073,16 +1564,22 @@ func TestPrintBinarySmallerOrEqual(t *testing.T) { } } -func TestPrintBinarySmaller(t *testing.T) { +func TestPrinterPrintBinarySmaller(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&binary.Smaller{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.LessToken, + }, + }, Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, }) - expected := `$a < $b` + expected := `$a <$b` actual := o.String() if expected != actual { @@ -1090,16 +1587,22 @@ func TestPrintBinarySmaller(t *testing.T) { } } -func TestPrintBinarySpaceship(t *testing.T) { +func TestPrinterPrintBinarySpaceship(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&binary.Spaceship{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.SpaceshipToken, + }, + }, Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, }) - expected := `$a <=> $b` + expected := `$a <=>$b` actual := o.String() if expected != actual { @@ -1109,15 +1612,21 @@ func TestPrintBinarySpaceship(t *testing.T) { // cast -func TestPrintArray(t *testing.T) { +func TestPrinterPrintArray(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&cast.Array{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.ArrayCastToken, + }, + }, Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, }) - expected := `(array)$var` + expected := ` (array)$var` actual := o.String() if expected != actual { @@ -1125,15 +1634,21 @@ func TestPrintArray(t *testing.T) { } } -func TestPrintBool(t *testing.T) { +func TestPrinterPrintBool(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&cast.Bool{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.BoolCastToken, + }, + }, Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, }) - expected := `(bool)$var` + expected := ` (bool)$var` actual := o.String() if expected != actual { @@ -1141,15 +1656,21 @@ func TestPrintBool(t *testing.T) { } } -func TestPrintDouble(t *testing.T) { +func TestPrinterPrintDouble(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&cast.Double{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.DoubleCastToken, + }, + }, Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, }) - expected := `(float)$var` + expected := ` (float)$var` actual := o.String() if expected != actual { @@ -1157,15 +1678,21 @@ func TestPrintDouble(t *testing.T) { } } -func TestPrintInt(t *testing.T) { +func TestPrinterPrintInt(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&cast.Int{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.IntCastToken, + }, + }, Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, }) - expected := `(int)$var` + expected := ` (int)$var` actual := o.String() if expected != actual { @@ -1173,15 +1700,21 @@ func TestPrintInt(t *testing.T) { } } -func TestPrintObject(t *testing.T) { +func TestPrinterPrintObject(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&cast.Object{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.ObjectCastToken, + }, + }, Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, }) - expected := `(object)$var` + expected := ` (object)$var` actual := o.String() if expected != actual { @@ -1189,15 +1722,21 @@ func TestPrintObject(t *testing.T) { } } -func TestPrintString(t *testing.T) { +func TestPrinterPrintString(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&cast.String{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.StringCastToken, + }, + }, Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, }) - expected := `(string)$var` + expected := ` (string)$var` actual := o.String() if expected != actual { @@ -1205,15 +1744,21 @@ func TestPrintString(t *testing.T) { } } -func TestPrintUnset(t *testing.T) { +func TestPrinterPrintUnset(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&cast.Unset{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.UnsetCastToken, + }, + }, Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, }) - expected := `(unset)$var` + expected := ` (unset)$var` actual := o.String() if expected != actual { @@ -1223,16 +1768,26 @@ func TestPrintUnset(t *testing.T) { // expr -func TestPrintExprArrayDimFetch(t *testing.T) { +func TestPrinterPrintExprArrayDimFetch(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&expr.ArrayDimFetch{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.OpenSquareBracket, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.CloseSquareBracket, + }, + }, Variable: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, Dim: &scalar.Lnumber{Value: "1"}, }) - expected := `$var[1]` + expected := `$var [1 ]` actual := o.String() if expected != actual { @@ -1240,13 +1795,27 @@ func TestPrintExprArrayDimFetch(t *testing.T) { } } -func TestPrintExprArrayItemWithKey(t *testing.T) { +func TestPrinterPrintExprArrayItemWithKey(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&expr.ArrayItem{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.DoubleArrowToken, + }, + }, Key: &scalar.String{Value: "'Hello'"}, - Val: &expr.Variable{VarName: &node.Identifier{Value: "world"}}, + Val: &expr.Variable{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.VariableToken, + }, + }, + VarName: &node.Identifier{Value: "world"}, + }, }) expected := `'Hello' => $world` @@ -1257,10 +1826,10 @@ func TestPrintExprArrayItemWithKey(t *testing.T) { } } -func TestPrintExprArrayItem(t *testing.T) { +func TestPrinterPrintExprArrayItem(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&expr.ArrayItem{ Val: &expr.Reference{Variable: &expr.Variable{VarName: &node.Identifier{Value: "world"}}}, }) @@ -1273,11 +1842,25 @@ func TestPrintExprArrayItem(t *testing.T) { } } -func TestPrintExprArray(t *testing.T) { +func TestPrinterPrintExprArray(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&expr.Array{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.ArrayToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.OpenParenthesisToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.CloseParenthesisToken, + }, + }, Items: []node.Node{ &expr.ArrayItem{ Key: &scalar.String{Value: "'Hello'"}, @@ -1293,7 +1876,7 @@ func TestPrintExprArray(t *testing.T) { }, }) - expected := `array('Hello' => $world, 2 => &$var, $var)` + expected := ` array ('Hello'=>$world,2=>&$var,$var )` actual := o.String() if expected != actual { @@ -1301,15 +1884,21 @@ func TestPrintExprArray(t *testing.T) { } } -func TestPrintExprBitwiseNot(t *testing.T) { +func TestPrinterPrintExprBitwiseNot(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&expr.BitwiseNot{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.TildeToken, + }, + }, Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, }) - expected := `~$var` + expected := ` ~$var` actual := o.String() if expected != actual { @@ -1317,15 +1906,21 @@ func TestPrintExprBitwiseNot(t *testing.T) { } } -func TestPrintExprBooleanNot(t *testing.T) { +func TestPrinterPrintExprBooleanNot(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&expr.BooleanNot{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.ExclamationMarkToken, + }, + }, Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, }) - expected := `!$var` + expected := ` !$var` actual := o.String() if expected != actual { @@ -1333,16 +1928,30 @@ func TestPrintExprBooleanNot(t *testing.T) { } } -func TestPrintExprClassConstFetch(t *testing.T) { +func TestPrinterPrintExprClassConstFetch(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&expr.ClassConstFetch{ - Class: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, - ConstantName: &node.Identifier{Value: "CONST"}, + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.PaamayimNekudotayimToken, + }, + }, + Class: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + ConstantName: &node.Identifier{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.IdentifierToken, + }, + }, + Value: "CONST", + }, }) - expected := `$var::CONST` + expected := `$var :: CONST` actual := o.String() if expected != actual { @@ -1350,15 +1959,21 @@ func TestPrintExprClassConstFetch(t *testing.T) { } } -func TestPrintExprClone(t *testing.T) { +func TestPrinterPrintExprClone(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&expr.Clone{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.CloneToken, + }, + }, Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, }) - expected := `clone $var` + expected := ` clone$var` actual := o.String() if expected != actual { @@ -1366,18 +1981,32 @@ func TestPrintExprClone(t *testing.T) { } } -func TestPrintExprClosureUse(t *testing.T) { +func TestPrinterPrintExprClosureUse(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&expr.ClosureUse{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.UseToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.OpenParenthesisToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.CloseParenthesisToken, + }, + }, Uses: []node.Node{ &expr.Reference{Variable: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}}, &expr.Variable{VarName: &node.Identifier{Value: "bar"}}, }, }) - expected := `use (&$foo, $bar)` + expected := ` use (&$foo,$bar )` actual := o.String() if expected != actual { @@ -1385,41 +2014,71 @@ func TestPrintExprClosureUse(t *testing.T) { } } -func TestPrintExprClosure(t *testing.T) { +func TestPrinterPrintExprClosure(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") - p.Print(&stmt.Namespace{ - Stmts: []node.Node{ - &expr.Closure{ - Static: true, - ReturnsRef: true, - Params: []node.Node{ - &node.Parameter{ - ByRef: true, - Variadic: false, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, - }, - }, - ClosureUse: &expr.ClosureUse{ - Uses: []node.Node{ - &expr.Reference{Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, - &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - }, - ReturnType: &name.FullyQualified{Parts: []node.Node{&name.NamePart{Value: "Foo"}}}, - Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, + p := printer.NewPrinter(o) + p.Print(&expr.Closure{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.StaticToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.FunctionToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.AmpersandToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.OpenParenthesisToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.CloseParenthesisToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.OpenCurlyBracesToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.CloseCurlyBracesToken, + }, + }, + Static: true, + ReturnsRef: true, + Params: []node.Node{ + &node.Parameter{ + ByRef: true, + Variadic: false, + Variable: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + }, + }, + ClosureUse: &expr.ClosureUse{ + Uses: []node.Node{ + &expr.Reference{Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, + &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + }, + }, + ReturnType: &name.FullyQualified{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.ColonToken, }, }, + Parts: []node.Node{&name.NamePart{Value: "Foo"}}, + }, + Stmts: []node.Node{ + &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, }, }) - expected := `namespace { - static function &(&$var) use (&$a, $b): \Foo { - $a; - } -}` + expected := ` static function & (&$var )use(&$a,$b) :\Foo {$a; }` actual := o.String() if expected != actual { @@ -1427,10 +2086,10 @@ func TestPrintExprClosure(t *testing.T) { } } -func TestPrintExprConstFetch(t *testing.T) { +func TestPrinterPrintExprConstFetch(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&expr.ConstFetch{ Constant: &name.Name{Parts: []node.Node{&name.NamePart{Value: "null"}}}, }) @@ -1443,13 +2102,33 @@ func TestPrintExprConstFetch(t *testing.T) { } } -func TestPrintDie(t *testing.T) { +func TestPrinterPrintDie(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") - p.Print(&expr.Die{Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}}) + p := printer.NewPrinter(o) + p.Print(&expr.Die{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.ExitToken, + }, + }, + Expr: &expr.Variable{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.OpenParenthesisToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.CloseParenthesisToken, + }, + }, + VarName: &node.Identifier{Value: "var"}, + }, + }) - expected := `die($var)` + expected := ` die ($var )` actual := o.String() if expected != actual { @@ -1457,13 +2136,29 @@ func TestPrintDie(t *testing.T) { } } -func TestPrintEmpty(t *testing.T) { +func TestPrinterPrintEmpty(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") - p.Print(&expr.Empty{Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}}) + p := printer.NewPrinter(o) + p.Print(&expr.Empty{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.EmptyToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.OpenParenthesisToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.CloseParenthesisToken, + }, + }, + Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + }) - expected := `empty($var)` + expected := ` empty ($var )` actual := o.String() if expected != actual { @@ -1471,13 +2166,21 @@ func TestPrintEmpty(t *testing.T) { } } -func TestPrintErrorSuppress(t *testing.T) { +func TestPrinterPrettyPrinterrorSuppress(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") - p.Print(&expr.ErrorSuppress{Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}}) + p := printer.NewPrinter(o) + p.Print(&expr.ErrorSuppress{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.AtToken, + }, + }, + Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + }) - expected := `@$var` + expected := ` @$var` actual := o.String() if expected != actual { @@ -1485,13 +2188,29 @@ func TestPrintErrorSuppress(t *testing.T) { } } -func TestPrintEval(t *testing.T) { +func TestPrinterPrintEval(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") - p.Print(&expr.Eval{Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}}) + p := printer.NewPrinter(o) + p.Print(&expr.Eval{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.EvalToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.OpenParenthesisToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.CloseParenthesisToken, + }, + }, + Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + }) - expected := `eval($var)` + expected := ` eval ($var )` actual := o.String() if expected != actual { @@ -1499,13 +2218,33 @@ func TestPrintEval(t *testing.T) { } } -func TestPrintExit(t *testing.T) { +func TestPrinterPrintExit(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") - p.Print(&expr.Exit{Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}}) + p := printer.NewPrinter(o) + p.Print(&expr.Exit{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.ExitToken, + }, + }, + Expr: &expr.Variable{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.OpenParenthesisToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.CloseParenthesisToken, + }, + }, + VarName: &node.Identifier{Value: "var"}, + }, + }) - expected := `exit($var)` + expected := ` exit ($var )` actual := o.String() if expected != actual { @@ -1513,13 +2252,23 @@ func TestPrintExit(t *testing.T) { } } -func TestPrintFunctionCall(t *testing.T) { +func TestPrinterPrintFunctionCall(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&expr.FunctionCall{ Function: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, ArgumentList: &node.ArgumentList{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.OpenParenthesisToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.CloseParenthesisToken, + }, + }, Arguments: []node.Node{ &node.Argument{ IsReference: true, @@ -1536,7 +2285,7 @@ func TestPrintFunctionCall(t *testing.T) { }, }) - expected := `$var(&$a, ...$b, $c)` + expected := `$var (&$a,...$b,$c )` actual := o.String() if expected != actual { @@ -1544,13 +2293,21 @@ func TestPrintFunctionCall(t *testing.T) { } } -func TestPrintInclude(t *testing.T) { +func TestPrinterPrintInclude(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") - p.Print(&expr.Include{Expr: &scalar.String{Value: "'path'"}}) + p := printer.NewPrinter(o) + p.Print(&expr.Include{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.IncludeToken, + }, + }, + Expr: &scalar.String{Value: "'path'"}, + }) - expected := `include 'path'` + expected := ` include'path'` actual := o.String() if expected != actual { @@ -1558,13 +2315,20 @@ func TestPrintInclude(t *testing.T) { } } -func TestPrintIncludeOnce(t *testing.T) { +func TestPrinterPrintIncludeOnce(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") - p.Print(&expr.IncludeOnce{Expr: &scalar.String{Value: "'path'"}}) + p := printer.NewPrinter(o) + p.Print(&expr.IncludeOnce{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.IncludeOnceToken, + }, + }, Expr: &scalar.String{Value: "'path'"}, + }) - expected := `include_once 'path'` + expected := ` include_once'path'` actual := o.String() if expected != actual { @@ -1572,16 +2336,22 @@ func TestPrintIncludeOnce(t *testing.T) { } } -func TestPrintInstanceOf(t *testing.T) { +func TestPrinterPrintInstanceOf(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&expr.InstanceOf{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.InstanceofToken, + }, + }, Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, Class: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Foo"}}}, }) - expected := `$var instanceof Foo` + expected := `$var instanceofFoo` actual := o.String() if expected != actual { @@ -1589,18 +2359,32 @@ func TestPrintInstanceOf(t *testing.T) { } } -func TestPrintIsset(t *testing.T) { +func TestPrinterPrintIsset(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&expr.Isset{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.IssetToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.OpenParenthesisToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.CloseParenthesisToken, + }, + }, Variables: []node.Node{ &expr.Variable{VarName: &node.Identifier{Value: "a"}}, &expr.Variable{VarName: &node.Identifier{Value: "b"}}, }, }) - expected := `isset($a, $b)` + expected := ` isset ($a,$b )` actual := o.String() if expected != actual { @@ -1608,11 +2392,25 @@ func TestPrintIsset(t *testing.T) { } } -func TestPrintList(t *testing.T) { +func TestPrinterPrintList(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&expr.List{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.ListToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.OpenParenthesisToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.CloseParenthesisToken, + }, + }, Items: []node.Node{ &expr.ArrayItem{ Val: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, @@ -1632,7 +2430,7 @@ func TestPrintList(t *testing.T) { }, }) - expected := `list($a, list($b, $c))` + expected := ` list ($a,list($b,$c) )` actual := o.String() if expected != actual { @@ -1640,14 +2438,30 @@ func TestPrintList(t *testing.T) { } } -func TestPrintMethodCall(t *testing.T) { +func TestPrinterPrintMethodCall(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&expr.MethodCall{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.ObjectOperatorToken, + }, + }, Variable: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, Method: &node.Identifier{Value: "bar"}, ArgumentList: &node.ArgumentList{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.OpenParenthesisToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.CloseParenthesisToken, + }, + }, Arguments: []node.Node{ &node.Argument{ Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, @@ -1659,7 +2473,7 @@ func TestPrintMethodCall(t *testing.T) { }, }) - expected := `$foo->bar($a, $b)` + expected := `$foo ->bar ($a,$b )` actual := o.String() if expected != actual { @@ -1667,13 +2481,41 @@ func TestPrintMethodCall(t *testing.T) { } } -func TestPrintNew(t *testing.T) { +func TestPrinterPrintNew(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&expr.New{ - Class: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Foo"}}}, + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.NewToken, + }, + }, + Class: &name.Name{ + Parts: []node.Node{ + &name.NamePart{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.StringToken, + }, + }, + Value: "Foo", + }, + }, + }, ArgumentList: &node.ArgumentList{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.OpenParenthesisToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.CloseParenthesisToken, + }, + }, Arguments: []node.Node{ &node.Argument{ Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, @@ -1685,7 +2527,7 @@ func TestPrintNew(t *testing.T) { }, }) - expected := `new Foo($a, $b)` + expected := ` new Foo ($a,$b )` actual := o.String() if expected != actual { @@ -1693,15 +2535,21 @@ func TestPrintNew(t *testing.T) { } } -func TestPrintPostDec(t *testing.T) { +func TestPrinterPrintPostDec(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&expr.PostDec{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.DecToken, + }, + }, Variable: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, }) - expected := `$var--` + expected := `$var --` actual := o.String() if expected != actual { @@ -1709,15 +2557,21 @@ func TestPrintPostDec(t *testing.T) { } } -func TestPrintPostInc(t *testing.T) { +func TestPrinterPrintPostInc(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&expr.PostInc{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.IncToken, + }, + }, Variable: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, }) - expected := `$var++` + expected := `$var ++` actual := o.String() if expected != actual { @@ -1725,15 +2579,21 @@ func TestPrintPostInc(t *testing.T) { } } -func TestPrintPreDec(t *testing.T) { +func TestPrinterPrintPreDec(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&expr.PreDec{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.DecToken, + }, + }, Variable: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, }) - expected := `--$var` + expected := ` --$var` actual := o.String() if expected != actual { @@ -1741,15 +2601,21 @@ func TestPrintPreDec(t *testing.T) { } } -func TestPrintPreInc(t *testing.T) { +func TestPrinterPrintPreInc(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&expr.PreInc{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.IncToken, + }, + }, Variable: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, }) - expected := `++$var` + expected := ` ++$var` actual := o.String() if expected != actual { @@ -1757,13 +2623,33 @@ func TestPrintPreInc(t *testing.T) { } } -func TestPrintPrint(t *testing.T) { +func TestPrinterPrintPrint(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") - p.Print(&expr.Print{Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}}) + p := printer.NewPrinter(o) + p.Print(&expr.Print{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.PrintToken, + }, + }, + Expr: &expr.Variable{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.OpenParenthesisToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.CloseParenthesisToken, + }, + }, + VarName: &node.Identifier{Value: "var"}, + }, + }) - expected := `print($var)` + expected := ` print ($var )` actual := o.String() if expected != actual { @@ -1771,16 +2657,22 @@ func TestPrintPrint(t *testing.T) { } } -func TestPrintPropertyFetch(t *testing.T) { +func TestPrinterPrintPropertyFetch(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&expr.PropertyFetch{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.ObjectOperatorToken, + }, + }, Variable: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, Property: &node.Identifier{Value: "bar"}, }) - expected := `$foo->bar` + expected := `$foo ->bar` actual := o.String() if expected != actual { @@ -1788,15 +2680,21 @@ func TestPrintPropertyFetch(t *testing.T) { } } -func TestPrintExprReference(t *testing.T) { +func TestPrinterPrintExprReference(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&expr.Reference{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.AmpersandToken, + }, + }, Variable: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, }) - expected := `&$foo` + expected := ` &$foo` actual := o.String() if expected != actual { @@ -1804,13 +2702,21 @@ func TestPrintExprReference(t *testing.T) { } } -func TestPrintRequire(t *testing.T) { +func TestPrinterPrintRequire(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") - p.Print(&expr.Require{Expr: &scalar.String{Value: "'path'"}}) + p := printer.NewPrinter(o) + p.Print(&expr.Require{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.RequireToken, + }, + }, + Expr: &scalar.String{Value: "'path'"}, + }) - expected := `require 'path'` + expected := ` require'path'` actual := o.String() if expected != actual { @@ -1818,13 +2724,21 @@ func TestPrintRequire(t *testing.T) { } } -func TestPrintRequireOnce(t *testing.T) { +func TestPrinterPrintRequireOnce(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") - p.Print(&expr.RequireOnce{Expr: &scalar.String{Value: "'path'"}}) + p := printer.NewPrinter(o) + p.Print(&expr.RequireOnce{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.RequireOnceToken, + }, + }, + Expr: &scalar.String{Value: "'path'"}, + }) - expected := `require_once 'path'` + expected := ` require_once'path'` actual := o.String() if expected != actual { @@ -1832,11 +2746,17 @@ func TestPrintRequireOnce(t *testing.T) { } } -func TestPrintShellExec(t *testing.T) { +func TestPrinterPrintShellExec(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&expr.ShellExec{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.BackquoteToken, + }, + }, Parts: []node.Node{ &scalar.EncapsedStringPart{Value: "hello "}, &expr.Variable{VarName: &node.Identifier{Value: "world"}}, @@ -1844,7 +2764,7 @@ func TestPrintShellExec(t *testing.T) { }, }) - expected := "`hello $world!`" + expected := " `hello $world!`" actual := o.String() if expected != actual { @@ -1852,11 +2772,21 @@ func TestPrintShellExec(t *testing.T) { } } -func TestPrintExprShortArray(t *testing.T) { +func TestPrinterPrintExprShortArray(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&expr.ShortArray{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.OpenSquareBracket, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.CloseSquareBracket, + }, + }, Items: []node.Node{ &expr.ArrayItem{ Key: &scalar.String{Value: "'Hello'"}, @@ -1872,7 +2802,7 @@ func TestPrintExprShortArray(t *testing.T) { }, }) - expected := `['Hello' => $world, 2 => &$var, $var]` + expected := ` ['Hello'=>$world,2=>&$var,$var ]` actual := o.String() if expected != actual { @@ -1880,11 +2810,21 @@ func TestPrintExprShortArray(t *testing.T) { } } -func TestPrintShortList(t *testing.T) { +func TestPrinterPrintShortList(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&expr.ShortList{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.OpenSquareBracket, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.CloseSquareBracket, + }, + }, Items: []node.Node{ &expr.ArrayItem{ Val: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, @@ -1904,7 +2844,7 @@ func TestPrintShortList(t *testing.T) { }, }) - expected := `[$a, list($b, $c)]` + expected := ` [$a,list($b,$c) ]` actual := o.String() if expected != actual { @@ -1912,14 +2852,30 @@ func TestPrintShortList(t *testing.T) { } } -func TestPrintStaticCall(t *testing.T) { +func TestPrinterPrintStaticCall(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&expr.StaticCall{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.PaamayimNekudotayimToken, + }, + }, Class: &node.Identifier{Value: "Foo"}, Call: &node.Identifier{Value: "bar"}, ArgumentList: &node.ArgumentList{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.OpenParenthesisToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.CloseParenthesisToken, + }, + }, Arguments: []node.Node{ &node.Argument{ Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, @@ -1931,7 +2887,7 @@ func TestPrintStaticCall(t *testing.T) { }, }) - expected := `Foo::bar($a, $b)` + expected := `Foo ::bar ($a,$b )` actual := o.String() if expected != actual { @@ -1939,16 +2895,22 @@ func TestPrintStaticCall(t *testing.T) { } } -func TestPrintStaticPropertyFetch(t *testing.T) { +func TestPrinterPrintStaticPropertyFetch(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&expr.StaticPropertyFetch{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.PaamayimNekudotayimToken, + }, + }, Class: &node.Identifier{Value: "Foo"}, Property: &expr.Variable{VarName: &node.Identifier{Value: "bar"}}, }) - expected := `Foo::$bar` + expected := `Foo ::$bar` actual := o.String() if expected != actual { @@ -1956,16 +2918,26 @@ func TestPrintStaticPropertyFetch(t *testing.T) { } } -func TestPrintTernary(t *testing.T) { +func TestPrinterPrintTernary(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&expr.Ternary{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.QuestionMarkToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.ColonToken, + }, + }, Condition: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, IfFalse: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, }) - expected := `$a ?: $b` + expected := `$a ? :$b` actual := o.String() if expected != actual { @@ -1973,17 +2945,27 @@ func TestPrintTernary(t *testing.T) { } } -func TestPrintTernaryFull(t *testing.T) { +func TestPrinterPrintTernaryFull(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&expr.Ternary{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.QuestionMarkToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.ColonToken, + }, + }, Condition: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, IfTrue: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, IfFalse: &expr.Variable{VarName: &node.Identifier{Value: "c"}}, }) - expected := `$a ? $b : $c` + expected := `$a ?$b :$c` actual := o.String() if expected != actual { @@ -1991,15 +2973,21 @@ func TestPrintTernaryFull(t *testing.T) { } } -func TestPrintUnaryMinus(t *testing.T) { +func TestPrinterPrintUnaryMinus(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&expr.UnaryMinus{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.MinusToken, + }, + }, Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, }) - expected := `-$var` + expected := ` -$var` actual := o.String() if expected != actual { @@ -2007,15 +2995,21 @@ func TestPrintUnaryMinus(t *testing.T) { } } -func TestPrintUnaryPlus(t *testing.T) { +func TestPrinterPrintUnaryPlus(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&expr.UnaryPlus{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.PlusToken, + }, + }, Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, }) - expected := `+$var` + expected := ` +$var` actual := o.String() if expected != actual { @@ -2023,13 +3017,23 @@ func TestPrintUnaryPlus(t *testing.T) { } } -func TestPrintVariable(t *testing.T) { +func TestPrinterPrintVariable(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") - p.Print(&expr.Variable{VarName: &expr.Variable{VarName: &node.Identifier{Value: "var"}}}) + p := printer.NewPrinter(o) + p.Print(&expr.Variable{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.VariableToken, + }, + }, + VarName: &expr.Variable{ + VarName: &node.Identifier{Value: "var"}, + }, + }) - expected := `$$var` + expected := ` $$var` actual := o.String() if expected != actual { @@ -2037,15 +3041,21 @@ func TestPrintVariable(t *testing.T) { } } -func TestPrintYieldFrom(t *testing.T) { +func TestPrinterPrintYieldFrom(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&expr.YieldFrom{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.YieldFromToken, + }, + }, Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, }) - expected := `yield from $var` + expected := ` yield from$var` actual := o.String() if expected != actual { @@ -2053,15 +3063,21 @@ func TestPrintYieldFrom(t *testing.T) { } } -func TestPrintYield(t *testing.T) { +func TestPrinterPrintYield(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&expr.Yield{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.YieldToken, + }, + }, Value: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, }) - expected := `yield $var` + expected := ` yield$var` actual := o.String() if expected != actual { @@ -2069,16 +3085,26 @@ func TestPrintYield(t *testing.T) { } } -func TestPrintYieldFull(t *testing.T) { +func TestPrinterPrintYieldFull(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&expr.Yield{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.YieldToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.DoubleArrowToken, + }, + }, Key: &expr.Variable{VarName: &node.Identifier{Value: "k"}}, Value: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, }) - expected := `yield $k => $var` + expected := ` yield$k =>$var` actual := o.String() if expected != actual { @@ -2088,11 +3114,29 @@ func TestPrintYieldFull(t *testing.T) { // stmt -func TestPrintAltElseIf(t *testing.T) { +func TestPrinterPrintAltElseIf(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&stmt.AltElseIf{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.ElseifToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.OpenParenthesisToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.CloseParenthesisToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.ColonToken, + }, + }, Cond: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, Stmt: &stmt.StmtList{ Stmts: []node.Node{ @@ -2101,8 +3145,7 @@ func TestPrintAltElseIf(t *testing.T) { }, }) - expected := `elseif ($a) : - $b;` + expected := ` elseif ($a ) :$b;` actual := o.String() if expected != actual { @@ -2110,16 +3153,34 @@ func TestPrintAltElseIf(t *testing.T) { } } -func TestPrintAltElseIfEmpty(t *testing.T) { +func TestPrinterPrintAltElseIfEmpty(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&stmt.AltElseIf{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.ElseifToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.OpenParenthesisToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.CloseParenthesisToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.ColonToken, + }, + }, Cond: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, Stmt: &stmt.StmtList{}, }) - expected := `elseif ($a) :` + expected := ` elseif ($a ) :` actual := o.String() if expected != actual { @@ -2127,11 +3188,21 @@ func TestPrintAltElseIfEmpty(t *testing.T) { } } -func TestPrintAltElse(t *testing.T) { +func TestPrinterPrintAltElse(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&stmt.AltElse{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.ElseToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.ColonToken, + }, + }, Stmt: &stmt.StmtList{ Stmts: []node.Node{ &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, @@ -2139,8 +3210,7 @@ func TestPrintAltElse(t *testing.T) { }, }) - expected := `else : - $b;` + expected := ` else :$b;` actual := o.String() if expected != actual { @@ -2148,15 +3218,25 @@ func TestPrintAltElse(t *testing.T) { } } -func TestPrintAltElseEmpty(t *testing.T) { +func TestPrinterPrintAltElseEmpty(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&stmt.AltElse{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.ElseToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.ColonToken, + }, + }, Stmt: &stmt.StmtList{}, }) - expected := `else :` + expected := ` else :` actual := o.String() if expected != actual { @@ -2164,36 +3244,187 @@ func TestPrintAltElseEmpty(t *testing.T) { } } -func TestPrintAltFor(t *testing.T) { +func TestPrinterPrintAltFor(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") - p.Print(&stmt.Namespace{ - Stmts: []node.Node{ - &stmt.AltFor{ - Init: []node.Node{ - &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - }, - Cond: []node.Node{ - &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - Loop: []node.Node{ - &expr.Variable{VarName: &node.Identifier{Value: "c"}}, - }, + p := printer.NewPrinter(o) + p.Print(&stmt.AltFor{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.ForToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.OpenParenthesisToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.ForInitSemicolonToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.ForCondSemicolonToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.CloseParenthesisToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.ColonToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.EndforToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.SemiColonToken, + }, + }, + Init: []node.Node{ + &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + }, + Cond: []node.Node{ + &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + }, + Loop: []node.Node{ + &expr.Variable{VarName: &node.Identifier{Value: "c"}}, + }, + Stmt: &stmt.StmtList{ + Stmts: []node.Node{ + &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "d"}}}, + }, + }, + }) + + expected := ` for ($a ;$b ;$c ) :$d; endfor ;` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrinterPrintAltForeach(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrinter(o) + p.Print(&stmt.AltForeach{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.ForeachToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.OpenParenthesisToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.AsToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.DoubleArrowToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.CloseParenthesisToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.ColonToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.EndforeachToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.SemiColonToken, + }, + }, + Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + Key: &expr.Variable{VarName: &node.Identifier{Value: "key"}}, + Variable: &expr.Reference{Variable: &expr.Variable{VarName: &node.Identifier{Value: "val"}}}, + Stmt: &stmt.StmtList{ + Stmts: []node.Node{ + &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "d"}}}, + }, + }, + }) + + expected := ` foreach ($var as$key =>&$val ) :$d; endforeach ;` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrinterPrintAltIf(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrinter(o) + p.Print(&stmt.AltIf{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.IfToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.OpenParenthesisToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.CloseParenthesisToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.ColonToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.EndifToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.SemiColonToken, + }, + }, + Cond: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Stmt: &stmt.StmtList{ + Stmts: []node.Node{ + &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "d"}}}, + }, + }, + ElseIf: []node.Node{ + &stmt.AltElseIf{ + Cond: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, Stmt: &stmt.StmtList{ Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "d"}}}, + &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, }, }, }, + &stmt.AltElseIf{ + Cond: &expr.Variable{VarName: &node.Identifier{Value: "c"}}, + Stmt: &stmt.StmtList{}, + }, + }, + Else: &stmt.AltElse{ + Stmt: &stmt.StmtList{ + Stmts: []node.Node{ + &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + }, + }, }, }) - expected := `namespace { - for ($a; $b; $c) : - $d; - endfor; -}` + expected := ` if ($a ) :$d;elseif($b):$b;elseif($c):else:$b; endif ;` actual := o.String() if expected != actual { @@ -2201,144 +3432,52 @@ func TestPrintAltFor(t *testing.T) { } } -func TestPrintAltForeach(t *testing.T) { +func TestPrinterPrintStmtAltSwitch(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") - p.Print(&stmt.Namespace{ - Stmts: []node.Node{ - &stmt.AltForeach{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, - Key: &expr.Variable{VarName: &node.Identifier{Value: "key"}}, - Variable: &expr.Reference{Variable: &expr.Variable{VarName: &node.Identifier{Value: "val"}}}, - Stmt: &stmt.StmtList{ + p := printer.NewPrinter(o) + p.Print(&stmt.AltSwitch{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.SwitchToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.OpenParenthesisToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.CloseParenthesisToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.ColonToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.SwitchSemicolonToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.EndswitchToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.SemiColonToken, + }, + }, + Cond: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + CaseList: &stmt.CaseList{ + Cases: []node.Node{ + &stmt.Case{ + Cond: &scalar.String{Value: "'a'"}, Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "d"}}}, + &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, }, }, - }, - }, - }) - - expected := `namespace { - foreach ($var as $key => &$val) : - $d; - endforeach; -}` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintAltIf(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrinter(o, " ") - p.Print(&stmt.Namespace{ - Stmts: []node.Node{ - &stmt.AltIf{ - Cond: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Stmt: &stmt.StmtList{ - Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "d"}}}, - }, - }, - ElseIf: []node.Node{ - &stmt.AltElseIf{ - Cond: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - Stmt: &stmt.StmtList{ - Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, - }, - }, - }, - &stmt.AltElseIf{ - Cond: &expr.Variable{VarName: &node.Identifier{Value: "c"}}, - Stmt: &stmt.StmtList{}, - }, - }, - Else: &stmt.AltElse{ - Stmt: &stmt.StmtList{ - Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, - }, - }, - }, - }, - }, - }) - - expected := `namespace { - if ($a) : - $d; - elseif ($b) : - $b; - elseif ($c) : - else : - $b; - endif; -}` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintStmtAltSwitch(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrinter(o, " ") - p.Print(&stmt.Namespace{ - Stmts: []node.Node{ - &stmt.AltSwitch{ - Cond: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, - CaseList: &stmt.CaseList{ - Cases: []node.Node{ - &stmt.Case{ - Cond: &scalar.String{Value: "'a'"}, - Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, - }, - }, - &stmt.Case{ - Cond: &scalar.String{Value: "'b'"}, - Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, - }, - }, - }, - }, - }, - }, - }) - - expected := `namespace { - switch ($var) : - case 'a': - $a; - case 'b': - $b; - endswitch; -}` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintAltWhile(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrinter(o, " ") - p.Print(&stmt.Namespace{ - Stmts: []node.Node{ - &stmt.AltWhile{ - Cond: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Stmt: &stmt.StmtList{ + &stmt.Case{ + Cond: &scalar.String{Value: "'b'"}, Stmts: []node.Node{ &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, }, @@ -2347,11 +3486,7 @@ func TestPrintAltWhile(t *testing.T) { }, }) - expected := `namespace { - while ($a) : - $b; - endwhile; -}` + expected := ` switch ($var ) : ;case'a':$a;case'b':$b; endswitch ;` actual := o.String() if expected != actual { @@ -2359,15 +3494,46 @@ func TestPrintAltWhile(t *testing.T) { } } -func TestPrintStmtBreak(t *testing.T) { +func TestPrinterPrintAltWhile(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") - p.Print(&stmt.Break{ - Expr: &scalar.Lnumber{Value: "1"}, + p := printer.NewPrinter(o) + p.Print(&stmt.AltWhile{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.WhileToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.OpenParenthesisToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.CloseParenthesisToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.ColonToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.EndwhileToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.SemiColonToken, + }, + }, + Cond: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Stmt: &stmt.StmtList{ + Stmts: []node.Node{ + &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + }, + }, }) - expected := "break 1;" + expected := ` while ($a ) :$b; endwhile ;` actual := o.String() if expected != actual { @@ -2375,19 +3541,66 @@ func TestPrintStmtBreak(t *testing.T) { } } -func TestPrintStmtCase(t *testing.T) { +func TestPrinterPrintStmtBreak(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) + p.Print(&stmt.Break{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.BreakToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.SemiColonToken, + }, + }, + Expr: &scalar.Lnumber{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.OpenParenthesisToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.CloseParenthesisToken, + }, + }, + Value: "1", + }, + }) + + expected := " break (1 ) ;" + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrinterPrintStmtCase(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrinter(o) p.Print(&stmt.Case{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.CaseToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.CaseSeparatorToken, + }, + }, Cond: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, Stmts: []node.Node{ &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, }, }) - expected := `case $a: - $a;` + expected := ` case$a :$a;` actual := o.String() if expected != actual { @@ -2395,16 +3608,26 @@ func TestPrintStmtCase(t *testing.T) { } } -func TestPrintStmtCaseEmpty(t *testing.T) { +func TestPrinterPrintStmtCaseEmpty(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&stmt.Case{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.CaseToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.CaseSeparatorToken, + }, + }, Cond: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, Stmts: []node.Node{}, }) - expected := "case $a:" + expected := " case$a :" actual := o.String() if expected != actual { @@ -2412,30 +3635,44 @@ func TestPrintStmtCaseEmpty(t *testing.T) { } } -func TestPrintStmtCatch(t *testing.T) { +func TestPrinterPrintStmtCatch(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") - p.Print(&stmt.Namespace{ - Stmts: []node.Node{ - &stmt.Catch{ - Types: []node.Node{ - &name.Name{Parts: []node.Node{&name.NamePart{Value: "Exception"}}}, - &name.FullyQualified{Parts: []node.Node{&name.NamePart{Value: "RuntimeException"}}}, - }, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "e"}}, - Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, - }, + p := printer.NewPrinter(o) + p.Print(&stmt.Catch{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.CatchToken, }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.OpenParenthesisToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.CloseParenthesisToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.OpenCurlyBracesToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.CloseCurlyBracesToken, + }, + }, + Types: []node.Node{ + &name.Name{Parts: []node.Node{&name.NamePart{Value: "Exception"}}}, + &name.FullyQualified{Parts: []node.Node{&name.NamePart{Value: "RuntimeException"}}}, + }, + Variable: &expr.Variable{VarName: &node.Identifier{Value: "e"}}, + Stmts: []node.Node{ + &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, }, }) - expected := `namespace { - catch (Exception | \RuntimeException $e) { - $a; - } -}` + expected := ` catch (Exception|\RuntimeException$e ) {$a; }` actual := o.String() if expected != actual { @@ -2443,11 +3680,29 @@ func TestPrintStmtCatch(t *testing.T) { } } -func TestPrintStmtClassMethod(t *testing.T) { +func TestPrinterPrintStmtClassMethod(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&stmt.ClassMethod{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.FunctionToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.AmpersandToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.OpenParenthesisToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.CloseParenthesisToken, + }, + }, Modifiers: []node.Node{&node.Identifier{Value: "public"}}, ReturnsRef: true, MethodName: &node.Identifier{Value: "foo"}, @@ -2463,29 +3718,62 @@ func TestPrintStmtClassMethod(t *testing.T) { Variable: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, }, }, - ReturnType: &name.Name{Parts: []node.Node{&name.NamePart{Value: "void"}}}, + ReturnType: &name.Name{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.ColonToken, + }, + }, + Parts: []node.Node{&name.NamePart{Value: "void"}}, + }, Stmt: &stmt.StmtList{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.OpenCurlyBracesToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.CloseCurlyBracesToken, + }, + }, Stmts: []node.Node{ &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, }, }, }) - expected := `public function &foo(?int &$a = null, ...$b): void -{ - $a; -}` + expected := `public function &foo (?int&$a=null,...$b ) :void {$a; }` actual := o.String() if expected != actual { t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) } } -func TestPrintStmtAbstractClassMethod(t *testing.T) { +func TestPrinterPrintStmtAbstractClassMethod(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&stmt.ClassMethod{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.FunctionToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.AmpersandToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.OpenParenthesisToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.CloseParenthesisToken, + }, + }, Modifiers: []node.Node{&node.Identifier{Value: "public"}}, ReturnsRef: true, MethodName: &node.Identifier{Value: "foo"}, @@ -2501,11 +3789,19 @@ func TestPrintStmtAbstractClassMethod(t *testing.T) { Variable: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, }, }, - ReturnType: &name.Name{Parts: []node.Node{&name.NamePart{Value: "void"}}}, - Stmt: &stmt.Nop{}, + ReturnType: &name.Name{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.ColonToken, + }, + }, + Parts: []node.Node{&name.NamePart{Value: "void"}}, + }, + Stmt: &stmt.Nop{}, }) - expected := `public function &foo(?int &$a = null, ...$b): void;` + expected := `public function &foo (?int&$a=null,...$b ) :void;` actual := o.String() if expected != actual { @@ -2513,45 +3809,62 @@ func TestPrintStmtAbstractClassMethod(t *testing.T) { } } -func TestPrintStmtClass(t *testing.T) { +func TestPrinterPrintStmtClass(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") - p.Print(&stmt.Namespace{ + p := printer.NewPrinter(o) + p.Print(&stmt.Class{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.ClassToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.OpenCurlyBracesToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.CloseCurlyBracesToken, + }, + }, + Modifiers: []node.Node{&node.Identifier{Value: "abstract"}}, + ClassName: &node.Identifier{Value: "Foo"}, + Extends: &stmt.ClassExtends{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.ExtendsToken, + }, + }, + ClassName: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Bar"}}}, + }, + Implements: &stmt.ClassImplements{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.ImplementsToken, + }, + }, + InterfaceNames: []node.Node{ + &name.Name{Parts: []node.Node{&name.NamePart{Value: "Baz"}}}, + &name.Name{Parts: []node.Node{&name.NamePart{Value: "Quuz"}}}, + }, + }, Stmts: []node.Node{ - &stmt.Class{ - Modifiers: []node.Node{&node.Identifier{Value: "abstract"}}, - ClassName: &node.Identifier{Value: "Foo"}, - Extends: &stmt.ClassExtends{ - ClassName: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Bar"}}}, - }, - Implements: &stmt.ClassImplements{ - InterfaceNames: []node.Node{ - &name.Name{Parts: []node.Node{&name.NamePart{Value: "Baz"}}}, - &name.Name{Parts: []node.Node{&name.NamePart{Value: "Quuz"}}}, - }, - }, - Stmts: []node.Node{ - &stmt.ClassConstList{ - Modifiers: []node.Node{&node.Identifier{Value: "public"}}, - Consts: []node.Node{ - &stmt.Constant{ - ConstantName: &node.Identifier{Value: "FOO"}, - Expr: &scalar.String{Value: "'bar'"}, - }, - }, + &stmt.ClassConstList{ + Modifiers: []node.Node{&node.Identifier{Value: "public"}}, + Consts: []node.Node{ + &stmt.Constant{ + ConstantName: &node.Identifier{Value: "FOO"}, + Expr: &scalar.String{Value: "'bar'"}, }, }, }, }, }) - expected := `namespace { - abstract class Foo extends Bar implements Baz, Quuz - { - public const FOO = 'bar'; - } -}` + expected := `abstract classFoo extendsBar implementsBaz,Quuz {publicconstFOO='bar'; }` actual := o.String() if expected != actual { @@ -2559,54 +3872,81 @@ func TestPrintStmtClass(t *testing.T) { } } -func TestPrintStmtAnonymousClass(t *testing.T) { +func TestPrinterPrintStmtAnonymousClass(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") - p.Print(&stmt.Namespace{ + p := printer.NewPrinter(o) + p.Print(&stmt.Class{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.ClassToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.OpenCurlyBracesToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.CloseCurlyBracesToken, + }, + }, + Modifiers: []node.Node{&node.Identifier{Value: "abstract"}}, + ArgumentList: &node.ArgumentList{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.OpenParenthesisToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.CloseParenthesisToken, + }, + }, + Arguments: []node.Node{ + &node.Argument{ + Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + }, + &node.Argument{ + Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + }, + }, + }, + Extends: &stmt.ClassExtends{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.ExtendsToken, + }, + }, + ClassName: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Bar"}}}, + }, + Implements: &stmt.ClassImplements{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.ImplementsToken, + }, + }, + InterfaceNames: []node.Node{ + &name.Name{Parts: []node.Node{&name.NamePart{Value: "Baz"}}}, + &name.Name{Parts: []node.Node{&name.NamePart{Value: "Quuz"}}}, + }, + }, Stmts: []node.Node{ - &stmt.Class{ - Modifiers: []node.Node{&node.Identifier{Value: "abstract"}}, - ArgumentList: &node.ArgumentList{ - Arguments: []node.Node{ - &node.Argument{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - }, - &node.Argument{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - }, - }, - Extends: &stmt.ClassExtends{ - ClassName: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Bar"}}}, - }, - Implements: &stmt.ClassImplements{ - InterfaceNames: []node.Node{ - &name.Name{Parts: []node.Node{&name.NamePart{Value: "Baz"}}}, - &name.Name{Parts: []node.Node{&name.NamePart{Value: "Quuz"}}}, - }, - }, - Stmts: []node.Node{ - &stmt.ClassConstList{ - Modifiers: []node.Node{&node.Identifier{Value: "public"}}, - Consts: []node.Node{ - &stmt.Constant{ - ConstantName: &node.Identifier{Value: "FOO"}, - Expr: &scalar.String{Value: "'bar'"}, - }, - }, + &stmt.ClassConstList{ + Modifiers: []node.Node{&node.Identifier{Value: "public"}}, + Consts: []node.Node{ + &stmt.Constant{ + ConstantName: &node.Identifier{Value: "FOO"}, + Expr: &scalar.String{Value: "'bar'"}, }, }, }, }, }) - expected := `namespace { - abstract class($a, $b) extends Bar implements Baz, Quuz - { - public const FOO = 'bar'; - } -}` + expected := `abstract class ($a,$b ) extendsBar implementsBaz,Quuz {publicconstFOO='bar'; }` actual := o.String() if expected != actual { @@ -2614,11 +3954,21 @@ func TestPrintStmtAnonymousClass(t *testing.T) { } } -func TestPrintStmtClassConstList(t *testing.T) { +func TestPrinterPrintStmtClassConstList(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&stmt.ClassConstList{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.ConstToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.SemiColonToken, + }, + }, Modifiers: []node.Node{&node.Identifier{Value: "public"}}, Consts: []node.Node{ &stmt.Constant{ @@ -2632,7 +3982,7 @@ func TestPrintStmtClassConstList(t *testing.T) { }, }) - expected := `public const FOO = 'a', BAR = 'b';` + expected := `public constFOO='a',BAR='b' ;` actual := o.String() if expected != actual { @@ -2640,16 +3990,22 @@ func TestPrintStmtClassConstList(t *testing.T) { } } -func TestPrintStmtConstant(t *testing.T) { +func TestPrinterPrintStmtConstant(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&stmt.Constant{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.EqualToken, + }, + }, ConstantName: &node.Identifier{Value: "FOO"}, Expr: &scalar.String{Value: "'BAR'"}, }) - expected := "FOO = 'BAR'" + expected := "FOO ='BAR'" actual := o.String() if expected != actual { @@ -2657,15 +4013,37 @@ func TestPrintStmtConstant(t *testing.T) { } } -func TestPrintStmtContinue(t *testing.T) { +func TestPrinterPrintStmtContinue(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&stmt.Continue{ - Expr: &scalar.Lnumber{Value: "1"}, + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.ContinueToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.SemiColonToken, + }, + }, + Expr: &scalar.Lnumber{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.OpenParenthesisToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.CloseParenthesisToken, + }, + }, + Value: "1", + }, }) - expected := `continue 1;` + expected := ` continue (1 ) ;` actual := o.String() if expected != actual { @@ -2673,33 +4051,39 @@ func TestPrintStmtContinue(t *testing.T) { } } -func TestPrintStmtDeclareStmts(t *testing.T) { +func TestPrinterPrintStmtDeclareStmts(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") - p.Print(&stmt.StmtList{ - Stmts: []node.Node{ - &stmt.Declare{ - Consts: []node.Node{ - &stmt.Constant{ - ConstantName: &node.Identifier{Value: "FOO"}, - Expr: &scalar.String{Value: "'bar'"}, - }, - }, - Stmt: &stmt.StmtList{ - Stmts: []node.Node{ - &stmt.Nop{}, - }, - }, + p := printer.NewPrinter(o) + p.Print(&stmt.Declare{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.DeclareToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.OpenParenthesisToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.CloseParenthesisToken, + }, + }, + Consts: []node.Node{ + &stmt.Constant{ + ConstantName: &node.Identifier{Value: "FOO"}, + Expr: &scalar.String{Value: "'bar'"}, + }, + }, + Stmt: &stmt.StmtList{ + Stmts: []node.Node{ + &stmt.Nop{}, }, }, }) - expected := `{ - declare(FOO = 'bar') { - ; - } -}` + expected := ` declare (FOO='bar' ){;}` actual := o.String() if expected != actual { @@ -2707,28 +4091,35 @@ func TestPrintStmtDeclareStmts(t *testing.T) { } } -func TestPrintStmtDeclareExpr(t *testing.T) { +func TestPrinterPrintStmtDeclareExpr(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") - p.Print(&stmt.StmtList{ - Stmts: []node.Node{ - &stmt.Declare{ - Consts: []node.Node{ - &stmt.Constant{ - ConstantName: &node.Identifier{Value: "FOO"}, - Expr: &scalar.String{Value: "'bar'"}, - }, - }, - Stmt: &stmt.Expression{Expr: &scalar.String{Value: "'bar'"}}, + p := printer.NewPrinter(o) + p.Print(&stmt.Declare{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.DeclareToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.OpenParenthesisToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.CloseParenthesisToken, }, }, + Consts: []node.Node{ + &stmt.Constant{ + ConstantName: &node.Identifier{Value: "FOO"}, + Expr: &scalar.String{Value: "'bar'"}, + }, + }, + Stmt: &stmt.Expression{Expr: &scalar.String{Value: "'bar'"}}, }) - expected := `{ - declare(FOO = 'bar') - 'bar'; -}` + expected := ` declare (FOO='bar' )'bar';` actual := o.String() if expected != actual { @@ -2736,10 +4127,10 @@ func TestPrintStmtDeclareExpr(t *testing.T) { } } -func TestPrintStmtDeclareNop(t *testing.T) { +func TestPrinterPrintStmtDeclareNop(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&stmt.Declare{ Consts: []node.Node{ &stmt.Constant{ @@ -2750,7 +4141,7 @@ func TestPrintStmtDeclareNop(t *testing.T) { Stmt: &stmt.Nop{}, }) - expected := `declare(FOO = 'bar');` + expected := `declare(FOO='bar');` actual := o.String() if expected != actual { @@ -2758,18 +4149,27 @@ func TestPrintStmtDeclareNop(t *testing.T) { } } -func TestPrintStmtDefalut(t *testing.T) { +func TestPrinterPrintStmtDefalut(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&stmt.Default{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.DefaultToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.CaseSeparatorToken, + }, + }, Stmts: []node.Node{ &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, }, }) - expected := `default: - $a;` + expected := ` default :$a;` actual := o.String() if expected != actual { @@ -2777,15 +4177,25 @@ func TestPrintStmtDefalut(t *testing.T) { } } -func TestPrintStmtDefalutEmpty(t *testing.T) { +func TestPrinterPrintStmtDefalutEmpty(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&stmt.Default{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.DefaultToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.CaseSeparatorToken, + }, + }, Stmts: []node.Node{}, }) - expected := `default:` + expected := ` default :` actual := o.String() if expected != actual { @@ -2793,26 +4203,83 @@ func TestPrintStmtDefalutEmpty(t *testing.T) { } } -func TestPrintStmtDo_Expression(t *testing.T) { +func TestPrinterPrintStmtDo_Expression(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") - p.Print(&stmt.Namespace{ - Stmts: []node.Node{ - &stmt.Do{ - Cond: &scalar.Lnumber{Value: "1"}, - Stmt: &stmt.Expression{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - }, + p := printer.NewPrinter(o) + p.Print(&stmt.Do{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.DoToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.WhileToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.OpenParenthesisToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.CloseParenthesisToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.SemiColonToken, + }, + }, + Cond: &scalar.Lnumber{Value: "1"}, + Stmt: &stmt.Expression{ + Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + }, + }) + + expected := ` do$a; while (1 ) ;` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrinterPrintStmtDo_StmtList(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrinter(o) + p.Print(&stmt.Do{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.DoToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.WhileToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.OpenParenthesisToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.CloseParenthesisToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.SemiColonToken, + }, + }, + Cond: &scalar.Lnumber{Value: "1"}, + Stmt: &stmt.StmtList{ + Stmts: []node.Node{ + &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, }, }, }) - expected := `namespace { - do - $a; - while (1); -}` + expected := ` do{$a;} while (1 ) ;` actual := o.String() if expected != actual { @@ -2820,47 +4287,28 @@ func TestPrintStmtDo_Expression(t *testing.T) { } } -func TestPrintStmtDo_StmtList(t *testing.T) { +func TestPrinterPrintStmtEcho(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") - p.Print(&stmt.Namespace{ - Stmts: []node.Node{ - &stmt.Do{ - Cond: &scalar.Lnumber{Value: "1"}, - Stmt: &stmt.StmtList{ - Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, - }, - }, - }, - }, - }) - - expected := `namespace { - do { - $a; - } while (1); -}` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintStmtEcho(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&stmt.Echo{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.EchoToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.SemiColonToken, + }, + }, Exprs: []node.Node{ &expr.Variable{VarName: &node.Identifier{Value: "a"}}, &expr.Variable{VarName: &node.Identifier{Value: "b"}}, }, }) - expected := `echo $a, $b;` + expected := ` echo$a,$b ;` actual := o.String() if expected != actual { @@ -2868,11 +4316,25 @@ func TestPrintStmtEcho(t *testing.T) { } } -func TestPrintStmtElseIfStmts(t *testing.T) { +func TestPrinterPrintStmtElseIfStmts(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&stmt.ElseIf{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.ElseifToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.OpenParenthesisToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.CloseParenthesisToken, + }, + }, Cond: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, Stmt: &stmt.StmtList{ Stmts: []node.Node{ @@ -2881,9 +4343,7 @@ func TestPrintStmtElseIfStmts(t *testing.T) { }, }) - expected := `elseif ($a) { - ; -}` + expected := ` elseif ($a ){;}` actual := o.String() if expected != actual { @@ -2891,17 +4351,30 @@ func TestPrintStmtElseIfStmts(t *testing.T) { } } -func TestPrintStmtElseIfExpr(t *testing.T) { +func TestPrinterPrintStmtElseIfExpr(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&stmt.ElseIf{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.ElseifToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.OpenParenthesisToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.CloseParenthesisToken, + }, + }, Cond: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, Stmt: &stmt.Expression{Expr: &scalar.String{Value: "'bar'"}}, }) - expected := `elseif ($a) - 'bar';` + expected := ` elseif ($a )'bar';` actual := o.String() if expected != actual { @@ -2909,16 +4382,16 @@ func TestPrintStmtElseIfExpr(t *testing.T) { } } -func TestPrintStmtElseIfNop(t *testing.T) { +func TestPrinterPrintStmtElseIfNop(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&stmt.ElseIf{ Cond: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, Stmt: &stmt.Nop{}, }) - expected := `elseif ($a);` + expected := `elseif($a);` actual := o.String() if expected != actual { @@ -2926,11 +4399,17 @@ func TestPrintStmtElseIfNop(t *testing.T) { } } -func TestPrintStmtElseStmts(t *testing.T) { +func TestPrinterPrintStmtElseStmts(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&stmt.Else{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.ElseToken, + }, + }, Stmt: &stmt.StmtList{ Stmts: []node.Node{ &stmt.Nop{}, @@ -2938,9 +4417,7 @@ func TestPrintStmtElseStmts(t *testing.T) { }, }) - expected := `else { - ; -}` + expected := ` else{;}` actual := o.String() if expected != actual { @@ -2948,16 +4425,21 @@ func TestPrintStmtElseStmts(t *testing.T) { } } -func TestPrintStmtElseExpr(t *testing.T) { +func TestPrinterPrintStmtElseExpr(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&stmt.Else{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.ElseToken, + }, + }, Stmt: &stmt.Expression{Expr: &scalar.String{Value: "'bar'"}}, }) - expected := `else - 'bar';` + expected := ` else'bar';` actual := o.String() if expected != actual { @@ -2965,10 +4447,10 @@ func TestPrintStmtElseExpr(t *testing.T) { } } -func TestPrintStmtElseNop(t *testing.T) { +func TestPrinterPrintStmtElseNop(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&stmt.Else{ Stmt: &stmt.Nop{}, }) @@ -2981,13 +4463,21 @@ func TestPrintStmtElseNop(t *testing.T) { } } -func TestPrintExpression(t *testing.T) { +func TestPrinterPrintExpression(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") - p.Print(&stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}) + p := printer.NewPrinter(o) + p.Print(&stmt.Expression{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.SemiColonToken, + }, + }, + Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + }) - expected := `$a;` + expected := `$a ;` actual := o.String() if expected != actual { @@ -2995,25 +4485,31 @@ func TestPrintExpression(t *testing.T) { } } -func TestPrintStmtFinally(t *testing.T) { +func TestPrinterPrintStmtFinally(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") - p.Print(&stmt.Namespace{ - Stmts: []node.Node{ - &stmt.Finally{ - Stmts: []node.Node{ - &stmt.Nop{}, - }, + p := printer.NewPrinter(o) + p.Print(&stmt.Finally{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.FinallyToken, }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.OpenCurlyBracesToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.CloseCurlyBracesToken, + }, + }, + Stmts: []node.Node{ + &stmt.Nop{}, }, }) - expected := `namespace { - finally { - ; - } -}` + expected := ` finally {; }` actual := o.String() if expected != actual { @@ -3021,126 +4517,53 @@ func TestPrintStmtFinally(t *testing.T) { } } -func TestPrintStmtForStmts(t *testing.T) { +func TestPrinterPrintStmtFor(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") - p.Print(&stmt.Namespace{ - Stmts: []node.Node{ - &stmt.For{ - Init: []node.Node{ - &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - Cond: []node.Node{ - &expr.Variable{VarName: &node.Identifier{Value: "c"}}, - &expr.Variable{VarName: &node.Identifier{Value: "d"}}, - }, - Loop: []node.Node{ - &expr.Variable{VarName: &node.Identifier{Value: "e"}}, - &expr.Variable{VarName: &node.Identifier{Value: "f"}}, - }, - Stmt: &stmt.StmtList{ - Stmts: []node.Node{ - &stmt.Nop{}, - }, - }, - }, - }, - }) - - expected := `namespace { - for ($a, $b; $c, $d; $e, $f) { - ; - } -}` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintStmtForExpr(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrinter(o, " ") - p.Print(&stmt.Namespace{ - Stmts: []node.Node{ - &stmt.For{ - Init: []node.Node{ - &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - }, - Cond: []node.Node{ - &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - Loop: []node.Node{ - &expr.Variable{VarName: &node.Identifier{Value: "c"}}, - }, - Stmt: &stmt.Expression{Expr: &scalar.String{Value: "'bar'"}}, - }, - }, - }) - - expected := `namespace { - for ($a; $b; $c) - 'bar'; -}` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintStmtForNop(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&stmt.For{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.ForToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.OpenParenthesisToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.ForInitSemicolonToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.ForCondSemicolonToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.CloseParenthesisToken, + }, + }, Init: []node.Node{ &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - }, - Cond: []node.Node{ &expr.Variable{VarName: &node.Identifier{Value: "b"}}, }, - Loop: []node.Node{ + Cond: []node.Node{ &expr.Variable{VarName: &node.Identifier{Value: "c"}}, + &expr.Variable{VarName: &node.Identifier{Value: "d"}}, }, - Stmt: &stmt.Nop{}, - }) - - expected := `for ($a; $b; $c);` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintStmtForeachStmts(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrinter(o, " ") - p.Print(&stmt.Namespace{ - Stmts: []node.Node{ - &stmt.Foreach{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - Stmt: &stmt.StmtList{ - Stmts: []node.Node{ - &stmt.Nop{}, - }, - }, + Loop: []node.Node{ + &expr.Variable{VarName: &node.Identifier{Value: "e"}}, + &expr.Variable{VarName: &node.Identifier{Value: "f"}}, + }, + Stmt: &stmt.StmtList{ + Stmts: []node.Node{ + &stmt.Nop{}, }, }, }) - expected := `namespace { - foreach ($a as $b) { - ; - } -}` + expected := ` for ($a,$b ;$c,$d ;$e,$f ){;}` actual := o.String() if expected != actual { @@ -3148,80 +4571,44 @@ func TestPrintStmtForeachStmts(t *testing.T) { } } -func TestPrintStmtForeachExpr(t *testing.T) { +func TestPrinterPrintStmtForeach(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") - p.Print(&stmt.Namespace{ - Stmts: []node.Node{ - &stmt.Foreach{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Key: &expr.Variable{VarName: &node.Identifier{Value: "k"}}, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "v"}}, - Stmt: &stmt.Expression{Expr: &scalar.String{Value: "'bar'"}}, - }, - }, - }) - - expected := `namespace { - foreach ($a as $k => $v) - 'bar'; -}` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintStmtForeachNop(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&stmt.Foreach{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.ForeachToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.OpenParenthesisToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.AsToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.DoubleArrowToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.CloseParenthesisToken, + }, + }, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, Key: &expr.Variable{VarName: &node.Identifier{Value: "k"}}, - Variable: &expr.Reference{Variable: &expr.Variable{VarName: &node.Identifier{Value: "v"}}}, - Stmt: &stmt.Nop{}, - }) - - expected := `foreach ($a as $k => &$v);` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintStmtFunction(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrinter(o, " ") - p.Print(&stmt.Namespace{ - Stmts: []node.Node{ - &stmt.Function{ - ReturnsRef: true, - FunctionName: &node.Identifier{Value: "foo"}, - Params: []node.Node{ - &node.Parameter{ - ByRef: true, - Variadic: false, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, - }, - }, - ReturnType: &name.FullyQualified{Parts: []node.Node{&name.NamePart{Value: "Foo"}}}, - Stmts: []node.Node{ - &stmt.Nop{}, - }, + Variable: &expr.Variable{VarName: &node.Identifier{Value: "v"}}, + Stmt: &stmt.StmtList{ + Stmts: []node.Node{ + &stmt.Nop{}, }, }, }) - expected := `namespace { - function &foo(&$var): \Foo { - ; - } -}` + expected := ` foreach ($a as$k =>$v ){;}` actual := o.String() if expected != actual { @@ -3229,18 +4616,90 @@ func TestPrintStmtFunction(t *testing.T) { } } -func TestPrintStmtGlobal(t *testing.T) { +func TestPrinterPrintStmtFunction(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) + p.Print(&stmt.Function{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.FunctionToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.AmpersandToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.OpenParenthesisToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.CloseParenthesisToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.OpenCurlyBracesToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.CloseCurlyBracesToken, + }, + }, + ReturnsRef: true, + FunctionName: &node.Identifier{Value: "foo"}, + Params: []node.Node{ + &node.Parameter{ + ByRef: true, + Variadic: false, + Variable: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + }, + }, + ReturnType: &name.FullyQualified{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.ColonToken, + }, + }, + Parts: []node.Node{&name.NamePart{Value: "Foo"}}, + }, + Stmts: []node.Node{ + &stmt.Nop{}, + }, + }) + + expected := ` function &foo (&$var ) :\Foo {; }` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrinterPrintStmtGlobal(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrinter(o) p.Print(&stmt.Global{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.GlobalToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.SemiColonToken, + }, + }, Vars: []node.Node{ &expr.Variable{VarName: &node.Identifier{Value: "a"}}, &expr.Variable{VarName: &node.Identifier{Value: "b"}}, }, }) - expected := `global $a, $b;` + expected := ` global$a,$b ;` actual := o.String() if expected != actual { @@ -3248,15 +4707,25 @@ func TestPrintStmtGlobal(t *testing.T) { } } -func TestPrintStmtGoto(t *testing.T) { +func TestPrinterPrintStmtGoto(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&stmt.Goto{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.GotoToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.SemiColonToken, + }, + }, Label: &node.Identifier{Value: "FOO"}, }) - expected := `goto FOO;` + expected := ` gotoFOO ;` actual := o.String() if expected != actual { @@ -3264,11 +4733,33 @@ func TestPrintStmtGoto(t *testing.T) { } } -func TestPrintStmtGroupUse(t *testing.T) { +func TestPrinterPrintStmtGroupUse(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&stmt.GroupUse{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.UseToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.NsSeparatorToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.OpenCurlyBracesToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.CloseCurlyBracesToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.SemiColonToken, + }, + }, UseType: &node.Identifier{Value: "function"}, Prefix: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Foo"}}}, UseList: []node.Node{ @@ -3282,7 +4773,7 @@ func TestPrintStmtGroupUse(t *testing.T) { }, }) - expected := `use function Foo\{Bar as Baz, Quuz};` + expected := ` usefunctionFoo \ {BarasBaz,Quuz } ;` actual := o.String() if expected != actual { @@ -3290,66 +4781,32 @@ func TestPrintStmtGroupUse(t *testing.T) { } } -func TestPrintHaltCompiler(t *testing.T) { +func TestPrinterPrintHaltCompiler(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") - p.Print(&stmt.HaltCompiler{}) - - expected := `__halt_compiler();` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintIfExpression(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrinter(o, " ") - p.Print(&stmt.Namespace{ - Stmts: []node.Node{ - &stmt.If{ - Cond: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Stmt: &stmt.Expression{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - ElseIf: []node.Node{ - &stmt.ElseIf{ - Cond: &expr.Variable{VarName: &node.Identifier{Value: "c"}}, - Stmt: &stmt.StmtList{ - Stmts: []node.Node{ - &stmt.Expression{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "d"}}, - }, - }, - }, - }, - &stmt.ElseIf{ - Cond: &expr.Variable{VarName: &node.Identifier{Value: "e"}}, - Stmt: &stmt.Nop{}, - }, - }, - Else: &stmt.Else{ - Stmt: &stmt.Expression{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "f"}}, - }, - }, + p := printer.NewPrinter(o) + p.Print(&stmt.HaltCompiler{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.HaltCompilerToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.OpenParenthesisToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.CloseParenthesisToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.SemiColonToken, }, }, }) - expected := `namespace { - if ($a) - $b; - elseif ($c) { - $d; - } - elseif ($e); - else - $f; -}` + expected := ` __halt_compiler ( ) ;` actual := o.String() if expected != actual { @@ -3357,30 +4814,53 @@ func TestPrintIfExpression(t *testing.T) { } } -func TestPrintIfStmtList(t *testing.T) { +func TestPrinterPrintIfExpression(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") - p.Print(&stmt.Namespace{ - Stmts: []node.Node{ - &stmt.If{ - Cond: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + p := printer.NewPrinter(o) + p.Print(&stmt.If{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.IfToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.OpenParenthesisToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.CloseParenthesisToken, + }, + }, + Cond: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Stmt: &stmt.Expression{ + Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + }, + ElseIf: []node.Node{ + &stmt.ElseIf{ + Cond: &expr.Variable{VarName: &node.Identifier{Value: "c"}}, Stmt: &stmt.StmtList{ Stmts: []node.Node{ &stmt.Expression{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Expr: &expr.Variable{VarName: &node.Identifier{Value: "d"}}, }, }, }, }, + &stmt.ElseIf{ + Cond: &expr.Variable{VarName: &node.Identifier{Value: "e"}}, + Stmt: &stmt.Nop{}, + }, + }, + Else: &stmt.Else{ + Stmt: &stmt.Expression{ + Expr: &expr.Variable{VarName: &node.Identifier{Value: "f"}}, + }, }, }) - expected := `namespace { - if ($a) { - $b; - } -}` + expected := ` if ($a )$b;elseif($c){$d;}elseif($e);else$f;` actual := o.String() if expected != actual { @@ -3388,16 +4868,53 @@ func TestPrintIfStmtList(t *testing.T) { } } -func TestPrintIfNop(t *testing.T) { +func TestPrinterPrintIfStmtList(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) + p.Print(&stmt.If{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.IfToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.OpenParenthesisToken, + }, + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.CloseParenthesisToken, + }, + }, + Cond: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Stmt: &stmt.StmtList{ + Stmts: []node.Node{ + &stmt.Expression{ + Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + }, + }, + }, + }) + + expected := ` if ($a ){$b;}` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrinterPrintIfNop(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrinter(o) p.Print(&stmt.If{ Cond: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, Stmt: &stmt.Nop{}, }) - expected := `if ($a);` + expected := `if($a);` actual := o.String() if expected != actual { @@ -3405,15 +4922,21 @@ func TestPrintIfNop(t *testing.T) { } } -func TestPrintInlineHtml(t *testing.T) { +func TestPrinterPrintInlineHtml(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o, " ") + p := printer.NewPrinter(o) p.Print(&stmt.InlineHtml{ + Meta: []meta.Meta{ + &meta.WhiteSpace{ + Value: " ", + TokenName: meta.InlineHTMLToken, + }, + }, Value: "test", }) - expected := `?>testtest= '1' && c <= '9': goto yystate117 } @@ -5812,27 +5812,18 @@ yystate452: } yystate453: - c = l.Next() - switch { - default: - goto yyabort - case c >= '\x01' && c <= '/' || c >= ':' && c <= '@' || c >= '[' && c <= '^' || c == '`' || c >= '{' && c <= '\u007f': - goto yystate454 - } - -yystate454: c = l.Next() yyrule = 69 l.Mark() goto yyrule69 -yystate455: +yystate454: c = l.Next() yyrule = 95 l.Mark() goto yyrule95 -yystate456: +yystate455: c = l.Next() yyrule = 128 l.Mark() @@ -5840,15 +5831,28 @@ yystate456: default: goto yyrule128 case c == '=': - goto yystate457 + goto yystate456 } -yystate457: +yystate456: c = l.Next() yyrule = 108 l.Mark() goto yyrule108 +yystate457: + c = l.Next() + yyrule = 132 + l.Mark() + switch { + default: + goto yyrule132 + case c == '_': + goto yystate458 + case c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c >= 'a' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': + goto yystate159 + } + yystate458: c = l.Next() yyrule = 132 @@ -5856,9 +5860,23 @@ yystate458: switch { default: goto yyrule132 - case c == '_': + case c == 'C' || c == 'c': goto yystate459 - case c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c >= 'a' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': + case c == 'D' || c == 'd': + goto yystate466 + case c == 'F' || c == 'f': + goto yystate471 + case c == 'H' || c == 'h': + goto yystate486 + case c == 'L' || c == 'l': + goto yystate499 + case c == 'M' || c == 'm': + goto yystate505 + case c == 'N' || c == 'n': + goto yystate513 + case c == 'T' || c == 't': + goto yystate524 + case c >= '0' && c <= '9' || c == 'A' || c == 'B' || c == 'E' || c == 'G' || c >= 'I' && c <= 'K' || c >= 'O' && c <= 'S' || c >= 'U' && c <= 'Z' || c == '_' || c == 'a' || c == 'b' || c == 'e' || c == 'g' || c >= 'i' && c <= 'k' || c >= 'o' && c <= 's' || c >= 'u' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': goto yystate159 } @@ -5869,23 +5887,9 @@ yystate459: switch { default: goto yyrule132 - case c == 'C' || c == 'c': - goto yystate460 - case c == 'D' || c == 'd': - goto yystate467 - case c == 'F' || c == 'f': - goto yystate472 - case c == 'H' || c == 'h': - goto yystate487 case c == 'L' || c == 'l': - goto yystate500 - case c == 'M' || c == 'm': - goto yystate506 - case c == 'N' || c == 'n': - goto yystate514 - case c == 'T' || c == 't': - goto yystate525 - case c >= '0' && c <= '9' || c == 'A' || c == 'B' || c == 'E' || c == 'G' || c >= 'I' && c <= 'K' || c >= 'O' && c <= 'S' || c >= 'U' && c <= 'Z' || c == '_' || c == 'a' || c == 'b' || c == 'e' || c == 'g' || c >= 'i' && c <= 'k' || c >= 'o' && c <= 's' || c >= 'u' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': + goto yystate460 + case c >= '0' && c <= '9' || c >= 'A' && c <= 'K' || c >= 'M' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'k' || c >= 'm' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': goto yystate159 } @@ -5896,9 +5900,9 @@ yystate460: switch { default: goto yyrule132 - case c == 'L' || c == 'l': + case c == 'A' || c == 'a': goto yystate461 - case c >= '0' && c <= '9' || c >= 'A' && c <= 'K' || c >= 'M' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'k' || c >= 'm' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': + case c >= '0' && c <= '9' || c >= 'B' && c <= 'Z' || c == '_' || c >= 'b' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': goto yystate159 } @@ -5909,9 +5913,9 @@ yystate461: switch { default: goto yyrule132 - case c == 'A' || c == 'a': + case c == 'S' || c == 's': goto yystate462 - case c >= '0' && c <= '9' || c >= 'B' && c <= 'Z' || c == '_' || c >= 'b' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': + case c >= '0' && c <= '9' || c >= 'A' && c <= 'R' || c >= 'T' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'r' || c >= 't' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': goto yystate159 } @@ -5935,9 +5939,9 @@ yystate463: switch { default: goto yyrule132 - case c == 'S' || c == 's': + case c == '_': goto yystate464 - case c >= '0' && c <= '9' || c >= 'A' && c <= 'R' || c >= 'T' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'r' || c >= 't' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': + case c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c >= 'a' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': goto yystate159 } @@ -5955,19 +5959,6 @@ yystate464: } yystate465: - c = l.Next() - yyrule = 132 - l.Mark() - switch { - default: - goto yyrule132 - case c == '_': - goto yystate466 - case c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c >= 'a' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': - goto yystate159 - } - -yystate466: c = l.Next() yyrule = 75 l.Mark() @@ -5978,6 +5969,19 @@ yystate466: goto yystate159 } +yystate466: + c = l.Next() + yyrule = 132 + l.Mark() + switch { + default: + goto yyrule132 + case c == 'I' || c == 'i': + goto yystate467 + case c >= '0' && c <= '9' || c >= 'A' && c <= 'H' || c >= 'J' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'h' || c >= 'j' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': + goto yystate159 + } + yystate467: c = l.Next() yyrule = 132 @@ -5985,9 +5989,9 @@ yystate467: switch { default: goto yyrule132 - case c == 'I' || c == 'i': + case c == 'R' || c == 'r': goto yystate468 - case c >= '0' && c <= '9' || c >= 'A' && c <= 'H' || c >= 'J' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'h' || c >= 'j' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': + case c >= '0' && c <= '9' || c >= 'A' && c <= 'Q' || c >= 'S' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'q' || c >= 's' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': goto yystate159 } @@ -5998,9 +6002,9 @@ yystate468: switch { default: goto yyrule132 - case c == 'R' || c == 'r': + case c == '_': goto yystate469 - case c >= '0' && c <= '9' || c >= 'A' && c <= 'Q' || c >= 'S' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'q' || c >= 's' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': + case c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c >= 'a' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': goto yystate159 } @@ -6018,19 +6022,6 @@ yystate469: } yystate470: - c = l.Next() - yyrule = 132 - l.Mark() - switch { - default: - goto yyrule132 - case c == '_': - goto yystate471 - case c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c >= 'a' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': - goto yystate159 - } - -yystate471: c = l.Next() yyrule = 76 l.Mark() @@ -6041,6 +6032,21 @@ yystate471: goto yystate159 } +yystate471: + c = l.Next() + yyrule = 132 + l.Mark() + switch { + default: + goto yyrule132 + case c == 'I' || c == 'i': + goto yystate472 + case c == 'U' || c == 'u': + goto yystate477 + case c >= '0' && c <= '9' || c >= 'A' && c <= 'H' || c >= 'J' && c <= 'T' || c >= 'V' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'h' || c >= 'j' && c <= 't' || c >= 'v' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': + goto yystate159 + } + yystate472: c = l.Next() yyrule = 132 @@ -6048,11 +6054,9 @@ yystate472: switch { default: goto yyrule132 - case c == 'I' || c == 'i': + case c == 'L' || c == 'l': goto yystate473 - case c == 'U' || c == 'u': - goto yystate478 - case c >= '0' && c <= '9' || c >= 'A' && c <= 'H' || c >= 'J' && c <= 'T' || c >= 'V' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'h' || c >= 'j' && c <= 't' || c >= 'v' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': + case c >= '0' && c <= '9' || c >= 'A' && c <= 'K' || c >= 'M' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'k' || c >= 'm' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': goto yystate159 } @@ -6063,9 +6067,9 @@ yystate473: switch { default: goto yyrule132 - case c == 'L' || c == 'l': + case c == 'E' || c == 'e': goto yystate474 - case c >= '0' && c <= '9' || c >= 'A' && c <= 'K' || c >= 'M' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'k' || c >= 'm' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': + case c >= '0' && c <= '9' || c >= 'A' && c <= 'D' || c >= 'F' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'd' || c >= 'f' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': goto yystate159 } @@ -6076,9 +6080,9 @@ yystate474: switch { default: goto yyrule132 - case c == 'E' || c == 'e': + case c == '_': goto yystate475 - case c >= '0' && c <= '9' || c >= 'A' && c <= 'D' || c >= 'F' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'd' || c >= 'f' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': + case c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c >= 'a' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': goto yystate159 } @@ -6096,19 +6100,6 @@ yystate475: } yystate476: - c = l.Next() - yyrule = 132 - l.Mark() - switch { - default: - goto yyrule132 - case c == '_': - goto yystate477 - case c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c >= 'a' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': - goto yystate159 - } - -yystate477: c = l.Next() yyrule = 77 l.Mark() @@ -6119,6 +6110,19 @@ yystate477: goto yystate159 } +yystate477: + c = l.Next() + yyrule = 132 + l.Mark() + switch { + default: + goto yyrule132 + case c == 'N' || c == 'n': + goto yystate478 + case c >= '0' && c <= '9' || c >= 'A' && c <= 'M' || c >= 'O' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'm' || c >= 'o' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': + goto yystate159 + } + yystate478: c = l.Next() yyrule = 132 @@ -6126,9 +6130,9 @@ yystate478: switch { default: goto yyrule132 - case c == 'N' || c == 'n': + case c == 'C' || c == 'c': goto yystate479 - case c >= '0' && c <= '9' || c >= 'A' && c <= 'M' || c >= 'O' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'm' || c >= 'o' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': + case c >= '0' && c <= '9' || c == 'A' || c == 'B' || c >= 'D' && c <= 'Z' || c == '_' || c == 'a' || c == 'b' || c >= 'd' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': goto yystate159 } @@ -6139,9 +6143,9 @@ yystate479: switch { default: goto yyrule132 - case c == 'C' || c == 'c': + case c == 'T' || c == 't': goto yystate480 - case c >= '0' && c <= '9' || c == 'A' || c == 'B' || c >= 'D' && c <= 'Z' || c == '_' || c == 'a' || c == 'b' || c >= 'd' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': + case c >= '0' && c <= '9' || c >= 'A' && c <= 'S' || c >= 'U' && c <= 'Z' || c == '_' || c >= 'a' && c <= 's' || c >= 'u' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': goto yystate159 } @@ -6152,9 +6156,9 @@ yystate480: switch { default: goto yyrule132 - case c == 'T' || c == 't': + case c == 'I' || c == 'i': goto yystate481 - case c >= '0' && c <= '9' || c >= 'A' && c <= 'S' || c >= 'U' && c <= 'Z' || c == '_' || c >= 'a' && c <= 's' || c >= 'u' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': + case c >= '0' && c <= '9' || c >= 'A' && c <= 'H' || c >= 'J' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'h' || c >= 'j' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': goto yystate159 } @@ -6165,9 +6169,9 @@ yystate481: switch { default: goto yyrule132 - case c == 'I' || c == 'i': + case c == 'O' || c == 'o': goto yystate482 - case c >= '0' && c <= '9' || c >= 'A' && c <= 'H' || c >= 'J' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'h' || c >= 'j' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': + case c >= '0' && c <= '9' || c >= 'A' && c <= 'N' || c >= 'P' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'n' || c >= 'p' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': goto yystate159 } @@ -6178,9 +6182,9 @@ yystate482: switch { default: goto yyrule132 - case c == 'O' || c == 'o': + case c == 'N' || c == 'n': goto yystate483 - case c >= '0' && c <= '9' || c >= 'A' && c <= 'N' || c >= 'P' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'n' || c >= 'p' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': + case c >= '0' && c <= '9' || c >= 'A' && c <= 'M' || c >= 'O' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'm' || c >= 'o' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': goto yystate159 } @@ -6191,9 +6195,9 @@ yystate483: switch { default: goto yyrule132 - case c == 'N' || c == 'n': + case c == '_': goto yystate484 - case c >= '0' && c <= '9' || c >= 'A' && c <= 'M' || c >= 'O' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'm' || c >= 'o' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': + case c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c >= 'a' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': goto yystate159 } @@ -6211,19 +6215,6 @@ yystate484: } yystate485: - c = l.Next() - yyrule = 132 - l.Mark() - switch { - default: - goto yyrule132 - case c == '_': - goto yystate486 - case c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c >= 'a' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': - goto yystate159 - } - -yystate486: c = l.Next() yyrule = 78 l.Mark() @@ -6234,6 +6225,19 @@ yystate486: goto yystate159 } +yystate486: + c = l.Next() + yyrule = 132 + l.Mark() + switch { + default: + goto yyrule132 + case c == 'A' || c == 'a': + goto yystate487 + case c >= '0' && c <= '9' || c >= 'B' && c <= 'Z' || c == '_' || c >= 'b' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': + goto yystate159 + } + yystate487: c = l.Next() yyrule = 132 @@ -6241,9 +6245,9 @@ yystate487: switch { default: goto yyrule132 - case c == 'A' || c == 'a': + case c == 'L' || c == 'l': goto yystate488 - case c >= '0' && c <= '9' || c >= 'B' && c <= 'Z' || c == '_' || c >= 'b' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': + case c >= '0' && c <= '9' || c >= 'A' && c <= 'K' || c >= 'M' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'k' || c >= 'm' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': goto yystate159 } @@ -6254,9 +6258,9 @@ yystate488: switch { default: goto yyrule132 - case c == 'L' || c == 'l': + case c == 'T' || c == 't': goto yystate489 - case c >= '0' && c <= '9' || c >= 'A' && c <= 'K' || c >= 'M' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'k' || c >= 'm' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': + case c >= '0' && c <= '9' || c >= 'A' && c <= 'S' || c >= 'U' && c <= 'Z' || c == '_' || c >= 'a' && c <= 's' || c >= 'u' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': goto yystate159 } @@ -6267,9 +6271,9 @@ yystate489: switch { default: goto yyrule132 - case c == 'T' || c == 't': + case c == '_': goto yystate490 - case c >= '0' && c <= '9' || c >= 'A' && c <= 'S' || c >= 'U' && c <= 'Z' || c == '_' || c >= 'a' && c <= 's' || c >= 'u' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': + case c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c >= 'a' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': goto yystate159 } @@ -6280,9 +6284,9 @@ yystate490: switch { default: goto yyrule132 - case c == '_': + case c == 'C' || c == 'c': goto yystate491 - case c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c >= 'a' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': + case c >= '0' && c <= '9' || c == 'A' || c == 'B' || c >= 'D' && c <= 'Z' || c == '_' || c == 'a' || c == 'b' || c >= 'd' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': goto yystate159 } @@ -6293,9 +6297,9 @@ yystate491: switch { default: goto yyrule132 - case c == 'C' || c == 'c': + case c == 'O' || c == 'o': goto yystate492 - case c >= '0' && c <= '9' || c == 'A' || c == 'B' || c >= 'D' && c <= 'Z' || c == '_' || c == 'a' || c == 'b' || c >= 'd' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': + case c >= '0' && c <= '9' || c >= 'A' && c <= 'N' || c >= 'P' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'n' || c >= 'p' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': goto yystate159 } @@ -6306,9 +6310,9 @@ yystate492: switch { default: goto yyrule132 - case c == 'O' || c == 'o': + case c == 'M' || c == 'm': goto yystate493 - case c >= '0' && c <= '9' || c >= 'A' && c <= 'N' || c >= 'P' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'n' || c >= 'p' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': + case c >= '0' && c <= '9' || c >= 'A' && c <= 'L' || c >= 'N' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'l' || c >= 'n' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': goto yystate159 } @@ -6319,9 +6323,9 @@ yystate493: switch { default: goto yyrule132 - case c == 'M' || c == 'm': + case c == 'P' || c == 'p': goto yystate494 - case c >= '0' && c <= '9' || c >= 'A' && c <= 'L' || c >= 'N' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'l' || c >= 'n' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': + case c >= '0' && c <= '9' || c >= 'A' && c <= 'O' || c >= 'Q' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'o' || c >= 'q' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': goto yystate159 } @@ -6332,9 +6336,9 @@ yystate494: switch { default: goto yyrule132 - case c == 'P' || c == 'p': + case c == 'I' || c == 'i': goto yystate495 - case c >= '0' && c <= '9' || c >= 'A' && c <= 'O' || c >= 'Q' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'o' || c >= 'q' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': + case c >= '0' && c <= '9' || c >= 'A' && c <= 'H' || c >= 'J' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'h' || c >= 'j' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': goto yystate159 } @@ -6345,9 +6349,9 @@ yystate495: switch { default: goto yyrule132 - case c == 'I' || c == 'i': + case c == 'L' || c == 'l': goto yystate496 - case c >= '0' && c <= '9' || c >= 'A' && c <= 'H' || c >= 'J' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'h' || c >= 'j' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': + case c >= '0' && c <= '9' || c >= 'A' && c <= 'K' || c >= 'M' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'k' || c >= 'm' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': goto yystate159 } @@ -6358,26 +6362,13 @@ yystate496: switch { default: goto yyrule132 - case c == 'L' || c == 'l': + case c == 'E' || c == 'e': goto yystate497 - case c >= '0' && c <= '9' || c >= 'A' && c <= 'K' || c >= 'M' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'k' || c >= 'm' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': + case c >= '0' && c <= '9' || c >= 'A' && c <= 'D' || c >= 'F' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'd' || c >= 'f' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': goto yystate159 } yystate497: - c = l.Next() - yyrule = 132 - l.Mark() - switch { - default: - goto yyrule132 - case c == 'E' || c == 'e': - goto yystate498 - case c >= '0' && c <= '9' || c >= 'A' && c <= 'D' || c >= 'F' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'd' || c >= 'f' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': - goto yystate159 - } - -yystate498: c = l.Next() yyrule = 132 l.Mark() @@ -6385,12 +6376,12 @@ yystate498: default: goto yyrule132 case c == 'R' || c == 'r': - goto yystate499 + goto yystate498 case c >= '0' && c <= '9' || c >= 'A' && c <= 'Q' || c >= 'S' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'q' || c >= 's' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': goto yystate159 } -yystate499: +yystate498: c = l.Next() yyrule = 83 l.Mark() @@ -6401,7 +6392,7 @@ yystate499: goto yystate159 } -yystate500: +yystate499: c = l.Next() yyrule = 132 l.Mark() @@ -6409,11 +6400,24 @@ yystate500: default: goto yyrule132 case c == 'I' || c == 'i': - goto yystate501 + goto yystate500 case c >= '0' && c <= '9' || c >= 'A' && c <= 'H' || c >= 'J' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'h' || c >= 'j' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': goto yystate159 } +yystate500: + c = l.Next() + yyrule = 132 + l.Mark() + switch { + default: + goto yyrule132 + case c == 'N' || c == 'n': + goto yystate501 + case c >= '0' && c <= '9' || c >= 'A' && c <= 'M' || c >= 'O' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'm' || c >= 'o' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': + goto yystate159 + } + yystate501: c = l.Next() yyrule = 132 @@ -6421,9 +6425,9 @@ yystate501: switch { default: goto yyrule132 - case c == 'N' || c == 'n': + case c == 'E' || c == 'e': goto yystate502 - case c >= '0' && c <= '9' || c >= 'A' && c <= 'M' || c >= 'O' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'm' || c >= 'o' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': + case c >= '0' && c <= '9' || c >= 'A' && c <= 'D' || c >= 'F' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'd' || c >= 'f' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': goto yystate159 } @@ -6434,9 +6438,9 @@ yystate502: switch { default: goto yyrule132 - case c == 'E' || c == 'e': + case c == '_': goto yystate503 - case c >= '0' && c <= '9' || c >= 'A' && c <= 'D' || c >= 'F' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'd' || c >= 'f' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': + case c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c >= 'a' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': goto yystate159 } @@ -6454,19 +6458,6 @@ yystate503: } yystate504: - c = l.Next() - yyrule = 132 - l.Mark() - switch { - default: - goto yyrule132 - case c == '_': - goto yystate505 - case c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c >= 'a' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': - goto yystate159 - } - -yystate505: c = l.Next() yyrule = 79 l.Mark() @@ -6477,6 +6468,19 @@ yystate505: goto yystate159 } +yystate505: + c = l.Next() + yyrule = 132 + l.Mark() + switch { + default: + goto yyrule132 + case c == 'E' || c == 'e': + goto yystate506 + case c >= '0' && c <= '9' || c >= 'A' && c <= 'D' || c >= 'F' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'd' || c >= 'f' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': + goto yystate159 + } + yystate506: c = l.Next() yyrule = 132 @@ -6484,9 +6488,9 @@ yystate506: switch { default: goto yyrule132 - case c == 'E' || c == 'e': + case c == 'T' || c == 't': goto yystate507 - case c >= '0' && c <= '9' || c >= 'A' && c <= 'D' || c >= 'F' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'd' || c >= 'f' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': + case c >= '0' && c <= '9' || c >= 'A' && c <= 'S' || c >= 'U' && c <= 'Z' || c == '_' || c >= 'a' && c <= 's' || c >= 'u' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': goto yystate159 } @@ -6497,9 +6501,9 @@ yystate507: switch { default: goto yyrule132 - case c == 'T' || c == 't': + case c == 'H' || c == 'h': goto yystate508 - case c >= '0' && c <= '9' || c >= 'A' && c <= 'S' || c >= 'U' && c <= 'Z' || c == '_' || c >= 'a' && c <= 's' || c >= 'u' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': + case c >= '0' && c <= '9' || c >= 'A' && c <= 'G' || c >= 'I' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'g' || c >= 'i' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': goto yystate159 } @@ -6510,9 +6514,9 @@ yystate508: switch { default: goto yyrule132 - case c == 'H' || c == 'h': + case c == 'O' || c == 'o': goto yystate509 - case c >= '0' && c <= '9' || c >= 'A' && c <= 'G' || c >= 'I' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'g' || c >= 'i' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': + case c >= '0' && c <= '9' || c >= 'A' && c <= 'N' || c >= 'P' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'n' || c >= 'p' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': goto yystate159 } @@ -6523,9 +6527,9 @@ yystate509: switch { default: goto yyrule132 - case c == 'O' || c == 'o': + case c == 'D' || c == 'd': goto yystate510 - case c >= '0' && c <= '9' || c >= 'A' && c <= 'N' || c >= 'P' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'n' || c >= 'p' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': + case c >= '0' && c <= '9' || c >= 'A' && c <= 'C' || c >= 'E' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'c' || c >= 'e' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': goto yystate159 } @@ -6536,9 +6540,9 @@ yystate510: switch { default: goto yyrule132 - case c == 'D' || c == 'd': + case c == '_': goto yystate511 - case c >= '0' && c <= '9' || c >= 'A' && c <= 'C' || c >= 'E' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'c' || c >= 'e' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': + case c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c >= 'a' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': goto yystate159 } @@ -6556,19 +6560,6 @@ yystate511: } yystate512: - c = l.Next() - yyrule = 132 - l.Mark() - switch { - default: - goto yyrule132 - case c == '_': - goto yystate513 - case c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c >= 'a' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': - goto yystate159 - } - -yystate513: c = l.Next() yyrule = 81 l.Mark() @@ -6579,6 +6570,19 @@ yystate513: goto yystate159 } +yystate513: + c = l.Next() + yyrule = 132 + l.Mark() + switch { + default: + goto yyrule132 + case c == 'A' || c == 'a': + goto yystate514 + case c >= '0' && c <= '9' || c >= 'B' && c <= 'Z' || c == '_' || c >= 'b' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': + goto yystate159 + } + yystate514: c = l.Next() yyrule = 132 @@ -6586,9 +6590,9 @@ yystate514: switch { default: goto yyrule132 - case c == 'A' || c == 'a': + case c == 'M' || c == 'm': goto yystate515 - case c >= '0' && c <= '9' || c >= 'B' && c <= 'Z' || c == '_' || c >= 'b' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': + case c >= '0' && c <= '9' || c >= 'A' && c <= 'L' || c >= 'N' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'l' || c >= 'n' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': goto yystate159 } @@ -6599,9 +6603,9 @@ yystate515: switch { default: goto yyrule132 - case c == 'M' || c == 'm': + case c == 'E' || c == 'e': goto yystate516 - case c >= '0' && c <= '9' || c >= 'A' && c <= 'L' || c >= 'N' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'l' || c >= 'n' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': + case c >= '0' && c <= '9' || c >= 'A' && c <= 'D' || c >= 'F' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'd' || c >= 'f' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': goto yystate159 } @@ -6612,9 +6616,9 @@ yystate516: switch { default: goto yyrule132 - case c == 'E' || c == 'e': + case c == 'S' || c == 's': goto yystate517 - case c >= '0' && c <= '9' || c >= 'A' && c <= 'D' || c >= 'F' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'd' || c >= 'f' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': + case c >= '0' && c <= '9' || c >= 'A' && c <= 'R' || c >= 'T' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'r' || c >= 't' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': goto yystate159 } @@ -6625,9 +6629,9 @@ yystate517: switch { default: goto yyrule132 - case c == 'S' || c == 's': + case c == 'P' || c == 'p': goto yystate518 - case c >= '0' && c <= '9' || c >= 'A' && c <= 'R' || c >= 'T' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'r' || c >= 't' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': + case c >= '0' && c <= '9' || c >= 'A' && c <= 'O' || c >= 'Q' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'o' || c >= 'q' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': goto yystate159 } @@ -6638,9 +6642,9 @@ yystate518: switch { default: goto yyrule132 - case c == 'P' || c == 'p': + case c == 'A' || c == 'a': goto yystate519 - case c >= '0' && c <= '9' || c >= 'A' && c <= 'O' || c >= 'Q' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'o' || c >= 'q' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': + case c >= '0' && c <= '9' || c >= 'B' && c <= 'Z' || c == '_' || c >= 'b' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': goto yystate159 } @@ -6651,9 +6655,9 @@ yystate519: switch { default: goto yyrule132 - case c == 'A' || c == 'a': + case c == 'C' || c == 'c': goto yystate520 - case c >= '0' && c <= '9' || c >= 'B' && c <= 'Z' || c == '_' || c >= 'b' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': + case c >= '0' && c <= '9' || c == 'A' || c == 'B' || c >= 'D' && c <= 'Z' || c == '_' || c == 'a' || c == 'b' || c >= 'd' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': goto yystate159 } @@ -6664,9 +6668,9 @@ yystate520: switch { default: goto yyrule132 - case c == 'C' || c == 'c': + case c == 'E' || c == 'e': goto yystate521 - case c >= '0' && c <= '9' || c == 'A' || c == 'B' || c >= 'D' && c <= 'Z' || c == '_' || c == 'a' || c == 'b' || c >= 'd' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': + case c >= '0' && c <= '9' || c >= 'A' && c <= 'D' || c >= 'F' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'd' || c >= 'f' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': goto yystate159 } @@ -6677,9 +6681,9 @@ yystate521: switch { default: goto yyrule132 - case c == 'E' || c == 'e': + case c == '_': goto yystate522 - case c >= '0' && c <= '9' || c >= 'A' && c <= 'D' || c >= 'F' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'd' || c >= 'f' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': + case c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c >= 'a' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': goto yystate159 } @@ -6697,19 +6701,6 @@ yystate522: } yystate523: - c = l.Next() - yyrule = 132 - l.Mark() - switch { - default: - goto yyrule132 - case c == '_': - goto yystate524 - case c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c >= 'a' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': - goto yystate159 - } - -yystate524: c = l.Next() yyrule = 80 l.Mark() @@ -6720,6 +6711,19 @@ yystate524: goto yystate159 } +yystate524: + c = l.Next() + yyrule = 132 + l.Mark() + switch { + default: + goto yyrule132 + case c == 'R' || c == 'r': + goto yystate525 + case c >= '0' && c <= '9' || c >= 'A' && c <= 'Q' || c >= 'S' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'q' || c >= 's' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': + goto yystate159 + } + yystate525: c = l.Next() yyrule = 132 @@ -6727,9 +6731,9 @@ yystate525: switch { default: goto yyrule132 - case c == 'R' || c == 'r': + case c == 'A' || c == 'a': goto yystate526 - case c >= '0' && c <= '9' || c >= 'A' && c <= 'Q' || c >= 'S' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'q' || c >= 's' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': + case c >= '0' && c <= '9' || c >= 'B' && c <= 'Z' || c == '_' || c >= 'b' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': goto yystate159 } @@ -6740,9 +6744,9 @@ yystate526: switch { default: goto yyrule132 - case c == 'A' || c == 'a': + case c == 'I' || c == 'i': goto yystate527 - case c >= '0' && c <= '9' || c >= 'B' && c <= 'Z' || c == '_' || c >= 'b' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': + case c >= '0' && c <= '9' || c >= 'A' && c <= 'H' || c >= 'J' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'h' || c >= 'j' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': goto yystate159 } @@ -6753,9 +6757,9 @@ yystate527: switch { default: goto yyrule132 - case c == 'I' || c == 'i': + case c == 'T' || c == 't': goto yystate528 - case c >= '0' && c <= '9' || c >= 'A' && c <= 'H' || c >= 'J' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'h' || c >= 'j' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': + case c >= '0' && c <= '9' || c >= 'A' && c <= 'S' || c >= 'U' && c <= 'Z' || c == '_' || c >= 'a' && c <= 's' || c >= 'u' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': goto yystate159 } @@ -6766,9 +6770,9 @@ yystate528: switch { default: goto yyrule132 - case c == 'T' || c == 't': + case c == '_': goto yystate529 - case c >= '0' && c <= '9' || c >= 'A' && c <= 'S' || c >= 'U' && c <= 'Z' || c == '_' || c >= 'a' && c <= 's' || c >= 'u' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': + case c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c >= 'a' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': goto yystate159 } @@ -6786,19 +6790,6 @@ yystate529: } yystate530: - c = l.Next() - yyrule = 132 - l.Mark() - switch { - default: - goto yyrule132 - case c == '_': - goto yystate531 - case c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c >= 'a' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': - goto yystate159 - } - -yystate531: c = l.Next() yyrule = 82 l.Mark() @@ -6809,13 +6800,13 @@ yystate531: goto yystate159 } -yystate532: +yystate531: c = l.Next() yyrule = 139 l.Mark() goto yyrule139 -yystate533: +yystate532: c = l.Next() yyrule = 132 l.Mark() @@ -6825,23 +6816,23 @@ yystate533: case c == '"': goto yystate18 case c == '<': - goto yystate534 + goto yystate533 case c == 'R' || c == 'r': goto yystate175 case c >= '0' && c <= '9' || c >= 'A' && c <= 'Q' || c >= 'S' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'q' || c >= 's' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': goto yystate159 } +yystate533: + c = l.Next() + switch { + default: + goto yyabort + case c == '<': + goto yystate534 + } + yystate534: - c = l.Next() - switch { - default: - goto yyabort - case c == '<': - goto yystate535 - } - -yystate535: c = l.Next() switch { default: @@ -6850,13 +6841,13 @@ yystate535: goto yystate132 } -yystate536: +yystate535: c = l.Next() yyrule = 129 l.Mark() goto yyrule129 -yystate537: +yystate536: c = l.Next() yyrule = 128 l.Mark() @@ -6864,59 +6855,59 @@ yystate537: default: goto yyrule128 case c == '=': - goto yystate538 + goto yystate537 case c == '|': - goto yystate539 + goto yystate538 } -yystate538: +yystate537: c = l.Next() yyrule = 101 l.Mark() goto yyrule101 -yystate539: +yystate538: c = l.Next() yyrule = 99 l.Mark() goto yyrule99 -yystate540: +yystate539: c = l.Next() yyrule = 130 l.Mark() goto yyrule130 - goto yystate541 // silence unused label error -yystate541: + goto yystate540 // silence unused label error +yystate540: c = l.Next() -yystart541: +yystart540: switch { default: goto yyabort case c == '"': - goto yystate543 - case c == '$': - goto yystate544 - case c == '{': - goto yystate547 - case c >= '\x01' && c <= '!' || c == '#' || c >= '%' && c <= 'z' || c >= '|' && c <= 'ÿ': goto yystate542 + case c == '$': + goto yystate543 + case c == '{': + goto yystate546 + case c >= '\x01' && c <= '!' || c == '#' || c >= '%' && c <= 'z' || c >= '|' && c <= 'ÿ': + goto yystate541 } -yystate542: +yystate541: c = l.Next() yyrule = 150 l.Mark() goto yyrule150 -yystate543: +yystate542: c = l.Next() yyrule = 146 l.Mark() goto yyrule146 -yystate544: +yystate543: c = l.Next() yyrule = 150 l.Mark() @@ -6924,12 +6915,12 @@ yystate544: default: goto yyrule150 case c == '{': - goto yystate546 - case c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': goto yystate545 + case c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': + goto yystate544 } -yystate545: +yystate544: c = l.Next() yyrule = 149 l.Mark() @@ -6937,16 +6928,16 @@ yystate545: default: goto yyrule149 case c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': - goto yystate545 + goto yystate544 } -yystate546: +yystate545: c = l.Next() yyrule = 148 l.Mark() goto yyrule148 -yystate547: +yystate546: c = l.Next() yyrule = 150 l.Mark() @@ -6954,41 +6945,41 @@ yystate547: default: goto yyrule150 case c == '$': - goto yystate548 + goto yystate547 } -yystate548: +yystate547: c = l.Next() yyrule = 147 l.Mark() goto yyrule147 - goto yystate549 // silence unused label error -yystate549: + goto yystate548 // silence unused label error +yystate548: c = l.Next() -yystart549: +yystart548: switch { default: goto yyabort case c == '$': - goto yystate551 - case c == '-': - goto yystate553 - case c == '[': - goto yystate558 - case c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': - goto yystate556 - case c >= '\x01' && c <= '#' || c >= '%' && c <= ',' || c >= '.' && c <= '@' || c >= '\\' && c <= '^' || c == '`' || c >= '{' && c <= '~': goto yystate550 + case c == '-': + goto yystate552 + case c == '[': + goto yystate557 + case c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': + goto yystate555 + case c >= '\x01' && c <= '#' || c >= '%' && c <= ',' || c >= '.' && c <= '@' || c >= '\\' && c <= '^' || c == '`' || c >= '{' && c <= '~': + goto yystate549 } -yystate550: +yystate549: c = l.Next() yyrule = 157 l.Mark() goto yyrule157 -yystate551: +yystate550: c = l.Next() yyrule = 157 l.Mark() @@ -6996,10 +6987,10 @@ yystate551: default: goto yyrule157 case c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': - goto yystate552 + goto yystate551 } -yystate552: +yystate551: c = l.Next() yyrule = 153 l.Mark() @@ -7007,10 +6998,10 @@ yystate552: default: goto yyrule153 case c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': - goto yystate552 + goto yystate551 } -yystate553: +yystate552: c = l.Next() yyrule = 157 l.Mark() @@ -7018,19 +7009,19 @@ yystate553: default: goto yyrule157 case c == '>': - goto yystate554 + goto yystate553 } -yystate554: +yystate553: c = l.Next() switch { default: goto yyabort case c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': - goto yystate555 + goto yystate554 } -yystate555: +yystate554: c = l.Next() yyrule = 154 l.Mark() @@ -7038,7 +7029,18 @@ yystate555: default: goto yyrule154 case c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': - goto yystate555 + goto yystate554 + } + +yystate555: + c = l.Next() + yyrule = 155 + l.Mark() + switch { + default: + goto yyrule155 + case c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': + goto yystate556 } yystate556: @@ -7049,59 +7051,54 @@ yystate556: default: goto yyrule155 case c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': - goto yystate557 + goto yystate556 } yystate557: - c = l.Next() - yyrule = 155 - l.Mark() - switch { - default: - goto yyrule155 - case c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': - goto yystate557 - } - -yystate558: c = l.Next() yyrule = 156 l.Mark() goto yyrule156 - goto yystate559 // silence unused label error -yystate559: + goto yystate558 // silence unused label error +yystate558: c = l.Next() -yystart559: +yystart558: switch { default: goto yyabort case c == '!' || c == '%' || c == '&' || c >= '(' && c <= '/' || c >= ':' && c <= '@' || c == '[' || c == '^' || c == '|' || c == '~': - goto yystate563 - case c == '$': - goto yystate564 - case c == '0': - goto yystate566 - case c == '\n': goto yystate562 - case c == '\t' || c == '\r' || c == ' ' || c == '#' || c == '\'' || c == '\\': + case c == '$': + goto yystate563 + case c == '0': + goto yystate565 + case c == '\n': goto yystate561 - case c == ']': - goto yystate575 - case c >= '1' && c <= '9': - goto yystate572 - case c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': - goto yystate573 - case c >= '\x01' && c <= '\b' || c == '\v' || c == '\f' || c >= '\x0e' && c <= '\x1f' || c == '"' || c == '`' || c == '{' || c == '}': + case c == '\t' || c == '\r' || c == ' ' || c == '#' || c == '\'' || c == '\\': goto yystate560 + case c == ']': + goto yystate574 + case c >= '1' && c <= '9': + goto yystate571 + case c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': + goto yystate572 + case c >= '\x01' && c <= '\b' || c == '\v' || c == '\f' || c >= '\x0e' && c <= '\x1f' || c == '"' || c == '`' || c == '{' || c == '}': + goto yystate559 } -yystate560: +yystate559: c = l.Next() yyrule = 164 l.Mark() goto yyrule164 +yystate560: + c = l.Next() + yyrule = 162 + l.Mark() + goto yyrule162 + yystate561: c = l.Next() yyrule = 162 @@ -7109,18 +7106,12 @@ yystate561: goto yyrule162 yystate562: - c = l.Next() - yyrule = 162 - l.Mark() - goto yyrule162 - -yystate563: c = l.Next() yyrule = 163 l.Mark() goto yyrule163 -yystate564: +yystate563: c = l.Next() yyrule = 163 l.Mark() @@ -7128,10 +7119,10 @@ yystate564: default: goto yyrule163 case c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': - goto yystate565 + goto yystate564 } -yystate565: +yystate564: c = l.Next() yyrule = 159 l.Mark() @@ -7139,7 +7130,22 @@ yystate565: default: goto yyrule159 case c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': - goto yystate565 + goto yystate564 + } + +yystate565: + c = l.Next() + yyrule = 158 + l.Mark() + switch { + default: + goto yyrule158 + case c == 'B' || c == 'b': + goto yystate567 + case c == 'X' || c == 'x': + goto yystate569 + case c >= '0' && c <= '9': + goto yystate566 } yystate566: @@ -7149,35 +7155,20 @@ yystate566: switch { default: goto yyrule158 - case c == 'B' || c == 'b': - goto yystate568 - case c == 'X' || c == 'x': - goto yystate570 case c >= '0' && c <= '9': - goto yystate567 + goto yystate566 } yystate567: - c = l.Next() - yyrule = 158 - l.Mark() - switch { - default: - goto yyrule158 - case c >= '0' && c <= '9': - goto yystate567 - } - -yystate568: c = l.Next() switch { default: goto yyabort case c == '0' || c == '1': - goto yystate569 + goto yystate568 } -yystate569: +yystate568: c = l.Next() yyrule = 158 l.Mark() @@ -7185,16 +7176,27 @@ yystate569: default: goto yyrule158 case c == '0' || c == '1': - goto yystate569 + goto yystate568 } -yystate570: +yystate569: c = l.Next() switch { default: goto yyabort case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': - goto yystate571 + goto yystate570 + } + +yystate570: + c = l.Next() + yyrule = 158 + l.Mark() + switch { + default: + goto yyrule158 + case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': + goto yystate570 } yystate571: @@ -7204,19 +7206,19 @@ yystate571: switch { default: goto yyrule158 - case c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f': - goto yystate571 + case c >= '0' && c <= '9': + goto yystate566 } yystate572: c = l.Next() - yyrule = 158 + yyrule = 160 l.Mark() switch { default: - goto yyrule158 - case c >= '0' && c <= '9': - goto yystate567 + goto yyrule160 + case c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': + goto yystate573 } yystate573: @@ -7227,46 +7229,35 @@ yystate573: default: goto yyrule160 case c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': - goto yystate574 + goto yystate573 } yystate574: - c = l.Next() - yyrule = 160 - l.Mark() - switch { - default: - goto yyrule160 - case c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': - goto yystate574 - } - -yystate575: c = l.Next() yyrule = 161 l.Mark() goto yyrule161 - goto yystate576 // silence unused label error -yystate576: + goto yystate575 // silence unused label error +yystate575: c = l.Next() -yystart576: +yystart575: switch { default: goto yyabort case c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': - goto yystate578 - case c >= '\x01' && c <= '\t' || c >= '\v' && c <= '@' || c >= '[' && c <= '^' || c == '`' || c >= '{' && c <= '~': goto yystate577 + case c >= '\x01' && c <= '\t' || c >= '\v' && c <= '@' || c >= '[' && c <= '^' || c == '`' || c >= '{' && c <= '~': + goto yystate576 } -yystate577: +yystate576: c = l.Next() yyrule = 166 l.Mark() goto yyrule166 -yystate578: +yystate577: c = l.Next() yyrule = 166 l.Mark() @@ -7274,53 +7265,64 @@ yystate578: default: goto yyrule166 case c == '[' || c == '}': - goto yystate580 - case c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': goto yystate579 + case c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': + goto yystate578 } -yystate579: +yystate578: c = l.Next() switch { default: goto yyabort case c == '[' || c == '}': - goto yystate580 - case c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': goto yystate579 + case c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': + goto yystate578 } -yystate580: +yystate579: c = l.Next() yyrule = 165 l.Mark() goto yyrule165 - goto yystate581 // silence unused label error -yystate581: + goto yystate580 // silence unused label error +yystate580: c = l.Next() -yystart581: +yystart580: switch { default: goto yyabort case c == '-': - goto yystate585 - case c == '\n': goto yystate584 - case c == '\t' || c == '\r' || c == ' ': + case c == '\n': goto yystate583 - case c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': - goto yystate587 - case c >= '\x01' && c <= '\b' || c == '\v' || c == '\f' || c >= '\x0e' && c <= '\x1f' || c >= '!' && c <= ',' || c >= '.' && c <= '@' || c >= '[' && c <= '^' || c == '`' || c >= '{' && c <= '~': + case c == '\t' || c == '\r' || c == ' ': goto yystate582 + case c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': + goto yystate586 + case c >= '\x01' && c <= '\b' || c == '\v' || c == '\f' || c >= '\x0e' && c <= '\x1f' || c >= '!' && c <= ',' || c >= '.' && c <= '@' || c >= '[' && c <= '^' || c == '`' || c >= '{' && c <= '~': + goto yystate581 } -yystate582: +yystate581: c = l.Next() yyrule = 137 l.Mark() goto yyrule137 +yystate582: + c = l.Next() + yyrule = 134 + l.Mark() + switch { + default: + goto yyrule134 + case c == '\t' || c == '\n' || c == '\r' || c == ' ': + goto yystate583 + } + yystate583: c = l.Next() yyrule = 134 @@ -7329,21 +7331,10 @@ yystate583: default: goto yyrule134 case c == '\t' || c == '\n' || c == '\r' || c == ' ': - goto yystate584 + goto yystate583 } yystate584: - c = l.Next() - yyrule = 134 - l.Mark() - switch { - default: - goto yyrule134 - case c == '\t' || c == '\n' || c == '\r' || c == ' ': - goto yystate584 - } - -yystate585: c = l.Next() yyrule = 137 l.Mark() @@ -7351,15 +7342,26 @@ yystate585: default: goto yyrule137 case c == '>': - goto yystate586 + goto yystate585 } -yystate586: +yystate585: c = l.Next() yyrule = 135 l.Mark() goto yyrule135 +yystate586: + c = l.Next() + yyrule = 136 + l.Mark() + switch { + default: + goto yyrule136 + case c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': + goto yystate587 + } + yystate587: c = l.Next() yyrule = 136 @@ -7368,32 +7370,21 @@ yystate587: default: goto yyrule136 case c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': - goto yystate588 + goto yystate587 } + goto yystate588 // silence unused label error yystate588: c = l.Next() - yyrule = 136 - l.Mark() - switch { - default: - goto yyrule136 - case c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': - goto yystate588 - } - - goto yystate589 // silence unused label error -yystate589: - c = l.Next() -yystart589: +yystart588: switch { default: goto yyabort case c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': - goto yystate590 + goto yystate589 } -yystate590: +yystate589: c = l.Next() yyrule = 144 l.Mark() @@ -7401,54 +7392,67 @@ yystate590: default: goto yyrule144 case c == ';': - goto yystate591 - case c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': goto yystate590 + case c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': + goto yystate589 } -yystate591: +yystate590: c = l.Next() yyrule = 143 l.Mark() goto yyrule143 - goto yystate592 // silence unused label error -yystate592: + goto yystate591 // silence unused label error +yystate591: c = l.Next() -yystart592: +yystart591: switch { default: goto yyabort case c >= '\x01' && c <= 'ÿ': - goto yystate593 + goto yystate592 } -yystate593: +yystate592: c = l.Next() yyrule = 142 l.Mark() goto yyrule142 - goto yystate594 // silence unused label error -yystate594: + goto yystate593 // silence unused label error +yystate593: c = l.Next() -yystart594: +yystart593: switch { default: goto yyabort case c == '$': - goto yystate596 - case c == '{': - goto yystate597 - case c >= '\x01' && c <= '#' || c >= '%' && c <= 'z' || c >= '|' && c <= 'ÿ': goto yystate595 + case c == '{': + goto yystate596 + case c >= '\x01' && c <= '#' || c >= '%' && c <= 'z' || c >= '|' && c <= 'ÿ': + goto yystate594 } +yystate594: + c = l.Next() + yyrule = 152 + l.Mark() + goto yyrule152 + yystate595: c = l.Next() yyrule = 152 l.Mark() - goto yyrule152 + switch { + default: + goto yyrule152 + case c == '{': + goto yystate545 + case c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': + goto yystate544 + } yystate596: c = l.Next() @@ -7457,47 +7461,34 @@ yystate596: switch { default: goto yyrule152 - case c == '{': - goto yystate546 - case c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': - goto yystate545 + case c == '$': + goto yystate547 } + goto yystate597 // silence unused label error yystate597: c = l.Next() - yyrule = 152 - l.Mark() - switch { - default: - goto yyrule152 - case c == '$': - goto yystate548 - } - - goto yystate598 // silence unused label error -yystate598: - c = l.Next() -yystart598: +yystart597: switch { default: goto yyabort case c == '$': - goto yystate600 - case c == '`': - goto yystate601 - case c == '{': - goto yystate602 - case c >= '\x01' && c <= '#' || c >= '%' && c <= '_' || c >= 'a' && c <= 'z' || c >= '|' && c <= 'ÿ': goto yystate599 + case c == '`': + goto yystate600 + case c == '{': + goto yystate601 + case c >= '\x01' && c <= '#' || c >= '%' && c <= '_' || c >= 'a' && c <= 'z' || c >= '|' && c <= 'ÿ': + goto yystate598 } -yystate599: +yystate598: c = l.Next() yyrule = 151 l.Mark() goto yyrule151 -yystate600: +yystate599: c = l.Next() yyrule = 151 l.Mark() @@ -7505,18 +7496,18 @@ yystate600: default: goto yyrule151 case c == '{': - goto yystate546 - case c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': goto yystate545 + case c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'z' || c >= '\u007f' && c <= 'ÿ': + goto yystate544 } -yystate601: +yystate600: c = l.Next() yyrule = 140 l.Mark() goto yyrule140 -yystate602: +yystate601: c = l.Next() yyrule = 151 l.Mark() @@ -7524,7 +7515,7 @@ yystate602: default: goto yyrule151 case c == '$': - goto yystate548 + goto yystate547 } yyrule1: // [ \t\n\r]+ @@ -7997,7 +7988,7 @@ yyrule68: // while return T_WHILE goto yystate0 } -yyrule69: // yield[ \t\n\r]+from[^a-zA-Z0-9_\x80-\xff] +yyrule69: // yield[ \t\n\r]+from { lval.Token(l.createToken(l.Token())) return T_YIELD_FROM @@ -8356,6 +8347,7 @@ yyrule126: // (#|[/][/]) } case '\n': + c = l.Next() case '?': c = l.Next() if c == '>' { @@ -8441,8 +8433,10 @@ yyrule133: // -> goto yystate0 } yyrule134: // [ \t\n\r]+ - - goto yystate0 + { + l.addWhiteSpace(l.Token()) + goto yystate0 + } yyrule135: // -> { lval.Token(l.createToken(l.Token())) @@ -8899,8 +8893,13 @@ yyrule166: // . goto yyabort // silence unused label error yyabort: // no lexem recognized - if c, ok := l.Abort(); ok { - return int(c) + if _, ok := l.Abort(); ok { + // always return same $end token + if l.lastToken == nil { + l.lastToken = l.createToken(l.Token()) + } + lval.Token(l.lastToken) + return -1 } goto yyAction } diff --git a/scanner/scanner.l b/scanner/scanner.l index cfa3dda..53fc614 100644 --- a/scanner/scanner.l +++ b/scanner/scanner.l @@ -191,7 +191,7 @@ NEW_LINE (\r|\n|\r\n) use lval.Token(l.createToken(l.Token())); return T_USE var lval.Token(l.createToken(l.Token())); return T_VAR while lval.Token(l.createToken(l.Token())); return T_WHILE -yield[ \t\n\r]+from[^a-zA-Z0-9_\x80-\xff] lval.Token(l.createToken(l.Token())); return T_YIELD_FROM +yield[ \t\n\r]+from lval.Token(l.createToken(l.Token())); return T_YIELD_FROM yield lval.Token(l.createToken(l.Token())); return T_YIELD include lval.Token(l.createToken(l.Token())); return T_INCLUDE include_once lval.Token(l.createToken(l.Token())); return T_INCLUDE_ONCE @@ -266,6 +266,7 @@ NEW_LINE (\r|\n|\r\n) } case '\n': + c = l.Next() case '?': c = l.Next() @@ -322,7 +323,7 @@ NEW_LINE (\r|\n|\r\n) {VAR_NAME} lval.Token(l.createToken(l.Token())); return T_STRING -> l.begin(PROPERTY);lval.Token(l.createToken(l.Token())); return T_OBJECT_OPERATOR; -[ \t\n\r]+ +[ \t\n\r]+ l.addWhiteSpace(l.Token()) -> lval.Token(l.createToken(l.Token())); return T_OBJECT_OPERATOR; {VAR_NAME} l.begin(PHP);lval.Token(l.createToken(l.Token())); return T_STRING; . l.ungetChars(1);l.begin(PHP) @@ -650,6 +651,13 @@ NEW_LINE (\r|\n|\r\n) . l.ungetChars(1);l.popState();l.pushState(PHP) %% - if c, ok := l.Abort(); ok { return int(c) } + if _, ok := l.Abort(); ok { + // always return same $end token + if l.lastToken == nil { + l.lastToken = l.createToken(l.Token()) + } + lval.Token(l.lastToken); + return -1 + } goto yyAction } \ No newline at end of file diff --git a/scanner/scanner_test.go b/scanner/scanner_test.go index 9f52559..408d0ff 100644 --- a/scanner/scanner_test.go +++ b/scanner/scanner_test.go @@ -904,7 +904,6 @@ func TestCommentNewLine(t *testing.T) { expected := []meta.Meta{ meta.NewWhiteSpace(" ", position.NewPosition(1, 1, 6, 6)), meta.NewComment("//test\n", position.NewPosition(1, 1, 7, 13)), - meta.NewWhiteSpace("\n", position.NewPosition(1, 1, 13, 13)), } lexer := scanner.NewLexer(bytes.NewBufferString(src), "test.php") @@ -913,7 +912,7 @@ func TestCommentNewLine(t *testing.T) { lexer.Lex(lv) - actual := lexer.Meta + actual := lv.Tkn.Meta assertEqual(t, expected, actual) } @@ -932,7 +931,7 @@ func TestCommentNewLine1(t *testing.T) { lexer.Lex(lv) - actual := lexer.Meta + actual := lv.Tkn.Meta assertEqual(t, expected, actual) } @@ -943,7 +942,6 @@ func TestCommentNewLine2(t *testing.T) { expected := []meta.Meta{ meta.NewWhiteSpace(" ", position.NewPosition(1, 1, 6, 6)), meta.NewComment("#test\r\n", position.NewPosition(1, 1, 7, 13)), - meta.NewWhiteSpace("\n", position.NewPosition(1, 1, 13, 13)), } lexer := scanner.NewLexer(bytes.NewBufferString(src), "test.php") @@ -952,7 +950,7 @@ func TestCommentNewLine2(t *testing.T) { lexer.Lex(lv) - actual := lexer.Meta + actual := lv.Tkn.Meta assertEqual(t, expected, actual) } @@ -972,7 +970,7 @@ func TestCommentWithPhpEndTag(t *testing.T) { lexer.Lex(lv) - actual := lexer.Meta + actual := lv.Tkn.Meta assertEqual(t, expected, actual) } @@ -992,7 +990,7 @@ func TestInlineComment(t *testing.T) { lexer.Lex(lv) - actual := lexer.Meta + actual := lv.Tkn.Meta assertEqual(t, expected, actual) } @@ -1032,7 +1030,88 @@ func TestEmptyInlineComment2(t *testing.T) { lexer.Lex(lv) - actual := lexer.Meta + actual := lv.Tkn.Meta assertEqual(t, expected, actual) } + +func TestMethodCallTokens(t *testing.T) { + src := ` bar ( '' ) ;` + + lexer := scanner.NewLexer(bytes.NewBufferString(src), "test.php") + lexer.WithMeta = true + lv := &lval{} + + expected := []meta.Meta{ + meta.NewWhiteSpace("\n\t", position.NewPosition(1, 2, 6, 7)), + } + lexer.Lex(lv) + actual := lv.Tkn.Meta + assertEqual(t, expected, actual) + + expected = []meta.Meta{ + meta.NewWhiteSpace(" ", position.NewPosition(2, 2, 10, 10)), + } + lexer.Lex(lv) + actual = lv.Tkn.Meta + assertEqual(t, expected, actual) + + expected = []meta.Meta{ + meta.NewWhiteSpace(" ", position.NewPosition(2, 2, 13, 13)), + } + lexer.Lex(lv) + actual = lv.Tkn.Meta + assertEqual(t, expected, actual) + + expected = []meta.Meta{ + meta.NewWhiteSpace(" ", position.NewPosition(2, 2, 17, 17)), + } + lexer.Lex(lv) + actual = lv.Tkn.Meta + assertEqual(t, expected, actual) + + expected = []meta.Meta{ + meta.NewWhiteSpace(" ", position.NewPosition(2, 2, 19, 19)), + } + lexer.Lex(lv) + actual = lv.Tkn.Meta + assertEqual(t, expected, actual) + + expected = []meta.Meta{ + meta.NewWhiteSpace(" ", position.NewPosition(2, 2, 22, 22)), + } + lexer.Lex(lv) + actual = lv.Tkn.Meta + assertEqual(t, expected, actual) + + expected = []meta.Meta{ + meta.NewWhiteSpace(" ", position.NewPosition(2, 2, 24, 24)), + } + lexer.Lex(lv) + actual = lv.Tkn.Meta + assertEqual(t, expected, actual) +} + +func TestYieldFromTokens(t *testing.T) { + src := ` 0 { fmt.Fprintf(d.Writer, "%v\"Meta\":\n", d.Indent+" ") for _, m := range mm { - fmt.Fprintf(d.Writer, "%v%q before %q\n", d.Indent+" ", m, meta.TokenNames[m.GetTokenName()]) + fmt.Fprintf(d.Writer, "%v%q before %q\n", d.Indent+" ", m, m.GetTokenName().String()) } } diff --git a/visitor/dumper_test.go b/visitor/dumper_test.go index 1c2d9e0..73ac034 100644 --- a/visitor/dumper_test.go +++ b/visitor/dumper_test.go @@ -68,7 +68,7 @@ func ExampleDumper() { // | [*node.Identifier] // | "Position": Pos{Line: 4-4 Pos: 35-37} // | "Meta": - // | " " before "StringToken" + // | " " before "IdentifierToken" // | "Value": "Bar" // | "Stmts": // | [*stmt.ClassMethod] @@ -87,15 +87,15 @@ func ExampleDumper() { // | [*node.Identifier] // | "Position": Pos{Line: 5-5 Pos: 45-50} // | "Meta": - // | "\n\t\t\t\t" before "PublicToken" + // | "\n\t\t\t\t" before "IdentifierToken" // | "Value": "public" // | "Params": // | [*node.Parameter] // | "Position": Pos{Line: 5-5 Pos: 74-89} // | "Meta": // | " " before "EqualToken" - // | "Variadic": false // | "ByRef": false + // | "Variadic": false // | "VariableType": // | [*name.Name] // | "Position": Pos{Line: 5-5 Pos: 74-77} @@ -141,7 +141,7 @@ func ExampleDumper() { // | "Meta": // | "\n\t\t\t\t\t" before "VariableToken" // | "// some comment\n" before "VariableToken" - // | "\n\t\t\t\t\t" before "VariableToken" + // | "\t\t\t\t\t" before "VariableToken" // | "VarName": // | [*node.Identifier] // | "Position": Pos{Line: 8-8 Pos: 124-127} diff --git a/visitor/go_dumper_test.go b/visitor/go_dumper_test.go index ef0fb63..c2c012d 100644 --- a/visitor/go_dumper_test.go +++ b/visitor/go_dumper_test.go @@ -35,417 +35,417 @@ func ExampleGoDumper() { nodes.Walk(dumper) // Unordered output: - //&node.Root{ - // Position: &position.Position{ - // StartLine: 3, - // EndLine: 11, - // StartPos: 10, - // EndPos: 142, - // }, - // Stmts: []node.Node{ - // &stmt.Namespace{ - // Position: &position.Position{ - // StartLine: 3, - // EndLine: 11, - // StartPos: 10, - // EndPos: 142, - // }, - // Meta: []meta.Meta{ - // &meta.WhiteSpace{ - // Position: &position.Position{ - // StartLine: 1, - // EndLine: 3, - // StartPos: 6, - // EndPos: 9, - // }, - // Value: "\n\n\t\t", - // TokenName: 67, - // }, - // &meta.WhiteSpace{ - // Position: &position.Position{ - // StartLine: 3, - // EndLine: 3, - // StartPos: 23, - // EndPos: 23, - // }, - // Value: " ", - // TokenName: 133, - // }, - // &meta.WhiteSpace{ - // Position: &position.Position{ - // StartLine: 10, - // EndLine: 11, - // StartPos: 139, - // EndPos: 141, - // }, - // Value: "\n\t\t", - // TokenName: 134, - // }, - // }, - // NamespaceName: &name.Name{ - // Position: &position.Position{ - // StartLine: 3, - // EndLine: 3, - // StartPos: 20, - // EndPos: 22, - // }, - // Parts: []node.Node{ - // &name.NamePart{ - // Position: &position.Position{ - // StartLine: 3, - // EndLine: 3, - // StartPos: 20, - // EndPos: 22, - // }, - // Meta: []meta.Meta{ - // &meta.WhiteSpace{ - // Position: &position.Position{ - // StartLine: 3, - // EndLine: 3, - // StartPos: 19, - // EndPos: 19, - // }, - // Value: " ", - // TokenName: 7, - // }, - // }, - // Value: "Foo", - // }, - // }, - // }, - // Stmts: []node.Node{ - // &stmt.Class{ - // Position: &position.Position{ - // StartLine: 4, - // EndLine: 10, - // StartPos: 29, - // EndPos: 138, - // }, - // Meta: []meta.Meta{ - // &meta.WhiteSpace{ - // Position: &position.Position{ - // StartLine: 3, - // EndLine: 4, - // StartPos: 25, - // EndPos: 28, - // }, - // Value: "\n\t\t\t", - // TokenName: 48, - // }, - // &meta.WhiteSpace{ - // Position: &position.Position{ - // StartLine: 4, - // EndLine: 4, - // StartPos: 38, - // EndPos: 38, - // }, - // Value: " ", - // TokenName: 133, - // }, - // &meta.WhiteSpace{ - // Position: &position.Position{ - // StartLine: 9, - // EndLine: 10, - // StartPos: 134, - // EndPos: 137, - // }, - // Value: "\n\t\t\t", - // TokenName: 134, - // }, - // }, - // PhpDocComment: "", - // ClassName: &node.Identifier{ - // Position: &position.Position{ - // StartLine: 4, - // EndLine: 4, - // StartPos: 35, - // EndPos: 37, - // }, - // Meta: []meta.Meta{ - // &meta.WhiteSpace{ - // Position: &position.Position{ - // StartLine: 4, - // EndLine: 4, - // StartPos: 34, - // EndPos: 34, - // }, - // Value: " ", - // TokenName: 7, - // }, - // }, - // Value: "Bar", - // }, - // Stmts: []node.Node{ - // &stmt.ClassMethod{ - // Position: &position.Position{ - // StartLine: 5, - // EndLine: 9, - // StartPos: 45, - // EndPos: 133, - // }, - // Meta: []meta.Meta{ - // &meta.WhiteSpace{ - // Position: &position.Position{ - // StartLine: 5, - // EndLine: 5, - // StartPos: 51, - // EndPos: 51, - // }, - // Value: " ", - // TokenName: 34, - // }, - // }, - // ReturnsRef: false, - // PhpDocComment: "", - // MethodName: &node.Identifier{ - // Position: &position.Position{ - // StartLine: 5, - // EndLine: 5, - // StartPos: 61, - // EndPos: 72, - // }, - // Meta: []meta.Meta{ - // &meta.WhiteSpace{ - // Position: &position.Position{ - // StartLine: 5, - // EndLine: 5, - // StartPos: 60, - // EndPos: 60, - // }, - // Value: " ", - // TokenName: 129, - // }, - // }, - // Value: "FunctionName", - // }, - // Modifiers: []node.Node{ - // &node.Identifier{ - // Position: &position.Position{ - // StartLine: 5, - // EndLine: 5, - // StartPos: 45, - // EndPos: 50, - // }, - // Meta: []meta.Meta{ - // &meta.WhiteSpace{ - // Position: &position.Position{ - // StartLine: 4, - // EndLine: 5, - // StartPos: 40, - // EndPos: 44, - // }, - // Value: "\n\t\t\t\t", - // TokenName: 91, - // }, - // }, - // Value: "public", - // }, - // }, - // Params: []node.Node{ - // &node.Parameter{ - // Position: &position.Position{ - // StartLine: 5, - // EndLine: 5, - // StartPos: 74, - // EndPos: 89, - // }, - // Meta: []meta.Meta{ - // &meta.WhiteSpace{ - // Position: &position.Position{ - // StartLine: 5, - // EndLine: 5, - // StartPos: 83, - // EndPos: 83, - // }, - // Value: " ", - // TokenName: 151, - // }, - // }, - // Variadic: false, - // ByRef: false, - // VariableType: &name.Name{ - // Position: &position.Position{ - // StartLine: 5, - // EndLine: 5, - // StartPos: 74, - // EndPos: 77, - // }, - // Parts: []node.Node{ - // &name.NamePart{ - // Position: &position.Position{ - // StartLine: 5, - // EndLine: 5, - // StartPos: 74, - // EndPos: 77, - // }, - // Value: "Type", - // }, - // }, - // }, - // Variable: &expr.Variable{ - // Position: &position.Position{ - // StartLine: 5, - // EndLine: 5, - // StartPos: 79, - // EndPos: 82, - // }, - // Meta: []meta.Meta{ - // &meta.WhiteSpace{ - // Position: &position.Position{ - // StartLine: 5, - // EndLine: 5, - // StartPos: 78, - // EndPos: 78, - // }, - // Value: " ", - // TokenName: 9, - // }, - // }, - // VarName: &node.Identifier{ - // Position: &position.Position{ - // StartLine: 5, - // EndLine: 5, - // StartPos: 79, - // EndPos: 82, - // }, - // Value: "var", - // }, - // }, - // DefaultValue: &expr.ConstFetch{ - // Position: &position.Position{ - // StartLine: 5, - // EndLine: 5, - // StartPos: 86, - // EndPos: 89, - // }, - // Constant: &name.Name{ - // Position: &position.Position{ - // StartLine: 5, - // EndLine: 5, - // StartPos: 86, - // EndPos: 89, - // }, - // Parts: []node.Node{ - // &name.NamePart{ - // Position: &position.Position{ - // StartLine: 5, - // EndLine: 5, - // StartPos: 86, - // EndPos: 89, - // }, - // Meta: []meta.Meta{ - // &meta.WhiteSpace{ - // Position: &position.Position{ - // StartLine: 5, - // EndLine: 5, - // StartPos: 85, - // EndPos: 85, - // }, - // Value: " ", - // TokenName: 7, - // }, - // }, - // Value: "null", - // }, - // }, - // }, - // }, - // }, - // }, - // Stmt: &stmt.StmtList{ - // Position: &position.Position{ - // StartLine: 6, - // EndLine: 9, - // StartPos: 96, - // EndPos: 133, - // }, - // Meta: []meta.Meta{ - // &meta.WhiteSpace{ - // Position: &position.Position{ - // StartLine: 5, - // EndLine: 6, - // StartPos: 91, - // EndPos: 95, - // }, - // Value: "\n\t\t\t\t", - // TokenName: 133, - // }, - // &meta.WhiteSpace{ - // Position: &position.Position{ - // StartLine: 8, - // EndLine: 9, - // StartPos: 128, - // EndPos: 132, - // }, - // Value: "\n\t\t\t\t", - // TokenName: 134, - // }, - // }, - // Stmts: []node.Node{ - // &stmt.Expression{ - // Position: &position.Position{ - // StartLine: 8, - // EndLine: 8, - // StartPos: 123, - // EndPos: 127, - // }, - // Expr: &expr.Variable{ - // Position: &position.Position{ - // StartLine: 8, - // EndLine: 8, - // StartPos: 123, - // EndPos: 126, - // }, - // Meta: []meta.Meta{ - // &meta.WhiteSpace{ - // Position: &position.Position{ - // StartLine: 6, - // EndLine: 7, - // StartPos: 97, - // EndPos: 102, - // }, - // Value: "\n\t\t\t\t\t", - // TokenName: 9, - // }, - // &meta.Comment{ - // Position: &position.Position{ - // StartLine: 7, - // EndLine: 7, - // StartPos: 103, - // EndPos: 117, - // }, - // Value: "//some comment\n", - // TokenName: 9, - // }, - // &meta.WhiteSpace{ - // Position: &position.Position{ - // StartLine: 7, - // EndLine: 8, - // StartPos: 117, - // EndPos: 122, - // }, - // Value: "\n\t\t\t\t\t", - // TokenName: 9, - // }, - // }, - // VarName: &node.Identifier{ - // Position: &position.Position{ - // StartLine: 8, - // EndLine: 8, - // StartPos: 123, - // EndPos: 126, - // }, - // Value: "var", - // }, - // }, - // }, - // }, - // }, - // }, - // }, - // }, - // }, - // }, - // }, - //} + // &node.Root{ + // Position: &position.Position{ + // StartLine: 3, + // EndLine: 11, + // StartPos: 10, + // EndPos: 142, + // }, + // Stmts: []node.Node{ + // &stmt.Namespace{ + // Position: &position.Position{ + // StartLine: 3, + // EndLine: 11, + // StartPos: 10, + // EndPos: 142, + // }, + // Meta: []meta.Meta{ + // &meta.WhiteSpace{ + // Position: &position.Position{ + // StartLine: 1, + // EndLine: 3, + // StartPos: 6, + // EndPos: 9, + // }, + // Value: "\n\n\t\t", + // TokenName: 65, + // }, + // &meta.WhiteSpace{ + // Position: &position.Position{ + // StartLine: 3, + // EndLine: 3, + // StartPos: 23, + // EndPos: 23, + // }, + // Value: " ", + // TokenName: 129, + // }, + // &meta.WhiteSpace{ + // Position: &position.Position{ + // StartLine: 10, + // EndLine: 11, + // StartPos: 139, + // EndPos: 141, + // }, + // Value: "\n\t\t", + // TokenName: 130, + // }, + // }, + // NamespaceName: &name.Name{ + // Position: &position.Position{ + // StartLine: 3, + // EndLine: 3, + // StartPos: 20, + // EndPos: 22, + // }, + // Parts: []node.Node{ + // &name.NamePart{ + // Position: &position.Position{ + // StartLine: 3, + // EndLine: 3, + // StartPos: 20, + // EndPos: 22, + // }, + // Meta: []meta.Meta{ + // &meta.WhiteSpace{ + // Position: &position.Position{ + // StartLine: 3, + // EndLine: 3, + // StartPos: 19, + // EndPos: 19, + // }, + // Value: " ", + // TokenName: 10, + // }, + // }, + // Value: "Foo", + // }, + // }, + // }, + // Stmts: []node.Node{ + // &stmt.Class{ + // Position: &position.Position{ + // StartLine: 4, + // EndLine: 10, + // StartPos: 29, + // EndPos: 138, + // }, + // Meta: []meta.Meta{ + // &meta.WhiteSpace{ + // Position: &position.Position{ + // StartLine: 3, + // EndLine: 4, + // StartPos: 25, + // EndPos: 28, + // }, + // Value: "\n\t\t\t", + // TokenName: 52, + // }, + // &meta.WhiteSpace{ + // Position: &position.Position{ + // StartLine: 4, + // EndLine: 4, + // StartPos: 38, + // EndPos: 38, + // }, + // Value: " ", + // TokenName: 129, + // }, + // &meta.WhiteSpace{ + // Position: &position.Position{ + // StartLine: 9, + // EndLine: 10, + // StartPos: 134, + // EndPos: 137, + // }, + // Value: "\n\t\t\t", + // TokenName: 130, + // }, + // }, + // PhpDocComment: "", + // ClassName: &node.Identifier{ + // Position: &position.Position{ + // StartLine: 4, + // EndLine: 4, + // StartPos: 35, + // EndPos: 37, + // }, + // Meta: []meta.Meta{ + // &meta.WhiteSpace{ + // Position: &position.Position{ + // StartLine: 4, + // EndLine: 4, + // StartPos: 34, + // EndPos: 34, + // }, + // Value: " ", + // TokenName: 125, + // }, + // }, + // Value: "Bar", + // }, + // Stmts: []node.Node{ + // &stmt.ClassMethod{ + // Position: &position.Position{ + // StartLine: 5, + // EndLine: 9, + // StartPos: 45, + // EndPos: 133, + // }, + // Meta: []meta.Meta{ + // &meta.WhiteSpace{ + // Position: &position.Position{ + // StartLine: 5, + // EndLine: 5, + // StartPos: 51, + // EndPos: 51, + // }, + // Value: " ", + // TokenName: 38, + // }, + // }, + // ReturnsRef: false, + // PhpDocComment: "", + // MethodName: &node.Identifier{ + // Position: &position.Position{ + // StartLine: 5, + // EndLine: 5, + // StartPos: 61, + // EndPos: 72, + // }, + // Meta: []meta.Meta{ + // &meta.WhiteSpace{ + // Position: &position.Position{ + // StartLine: 5, + // EndLine: 5, + // StartPos: 60, + // EndPos: 60, + // }, + // Value: " ", + // TokenName: 125, + // }, + // }, + // Value: "FunctionName", + // }, + // Modifiers: []node.Node{ + // &node.Identifier{ + // Position: &position.Position{ + // StartLine: 5, + // EndLine: 5, + // StartPos: 45, + // EndPos: 50, + // }, + // Meta: []meta.Meta{ + // &meta.WhiteSpace{ + // Position: &position.Position{ + // StartLine: 4, + // EndLine: 5, + // StartPos: 40, + // EndPos: 44, + // }, + // Value: "\n\t\t\t\t", + // TokenName: 125, + // }, + // }, + // Value: "public", + // }, + // }, + // Params: []node.Node{ + // &node.Parameter{ + // Position: &position.Position{ + // StartLine: 5, + // EndLine: 5, + // StartPos: 74, + // EndPos: 89, + // }, + // Meta: []meta.Meta{ + // &meta.WhiteSpace{ + // Position: &position.Position{ + // StartLine: 5, + // EndLine: 5, + // StartPos: 83, + // EndPos: 83, + // }, + // Value: " ", + // TokenName: 147, + // }, + // }, + // ByRef: false, + // Variadic: false, + // VariableType: &name.Name{ + // Position: &position.Position{ + // StartLine: 5, + // EndLine: 5, + // StartPos: 74, + // EndPos: 77, + // }, + // Parts: []node.Node{ + // &name.NamePart{ + // Position: &position.Position{ + // StartLine: 5, + // EndLine: 5, + // StartPos: 74, + // EndPos: 77, + // }, + // Value: "Type", + // }, + // }, + // }, + // Variable: &expr.Variable{ + // Position: &position.Position{ + // StartLine: 5, + // EndLine: 5, + // StartPos: 79, + // EndPos: 82, + // }, + // Meta: []meta.Meta{ + // &meta.WhiteSpace{ + // Position: &position.Position{ + // StartLine: 5, + // EndLine: 5, + // StartPos: 78, + // EndPos: 78, + // }, + // Value: " ", + // TokenName: 12, + // }, + // }, + // VarName: &node.Identifier{ + // Position: &position.Position{ + // StartLine: 5, + // EndLine: 5, + // StartPos: 79, + // EndPos: 82, + // }, + // Value: "var", + // }, + // }, + // DefaultValue: &expr.ConstFetch{ + // Position: &position.Position{ + // StartLine: 5, + // EndLine: 5, + // StartPos: 86, + // EndPos: 89, + // }, + // Constant: &name.Name{ + // Position: &position.Position{ + // StartLine: 5, + // EndLine: 5, + // StartPos: 86, + // EndPos: 89, + // }, + // Parts: []node.Node{ + // &name.NamePart{ + // Position: &position.Position{ + // StartLine: 5, + // EndLine: 5, + // StartPos: 86, + // EndPos: 89, + // }, + // Meta: []meta.Meta{ + // &meta.WhiteSpace{ + // Position: &position.Position{ + // StartLine: 5, + // EndLine: 5, + // StartPos: 85, + // EndPos: 85, + // }, + // Value: " ", + // TokenName: 10, + // }, + // }, + // Value: "null", + // }, + // }, + // }, + // }, + // }, + // }, + // Stmt: &stmt.StmtList{ + // Position: &position.Position{ + // StartLine: 6, + // EndLine: 9, + // StartPos: 96, + // EndPos: 133, + // }, + // Meta: []meta.Meta{ + // &meta.WhiteSpace{ + // Position: &position.Position{ + // StartLine: 5, + // EndLine: 6, + // StartPos: 91, + // EndPos: 95, + // }, + // Value: "\n\t\t\t\t", + // TokenName: 129, + // }, + // &meta.WhiteSpace{ + // Position: &position.Position{ + // StartLine: 8, + // EndLine: 9, + // StartPos: 128, + // EndPos: 132, + // }, + // Value: "\n\t\t\t\t", + // TokenName: 130, + // }, + // }, + // Stmts: []node.Node{ + // &stmt.Expression{ + // Position: &position.Position{ + // StartLine: 8, + // EndLine: 8, + // StartPos: 123, + // EndPos: 127, + // }, + // Expr: &expr.Variable{ + // Position: &position.Position{ + // StartLine: 8, + // EndLine: 8, + // StartPos: 123, + // EndPos: 126, + // }, + // Meta: []meta.Meta{ + // &meta.WhiteSpace{ + // Position: &position.Position{ + // StartLine: 6, + // EndLine: 7, + // StartPos: 97, + // EndPos: 102, + // }, + // Value: "\n\t\t\t\t\t", + // TokenName: 12, + // }, + // &meta.Comment{ + // Position: &position.Position{ + // StartLine: 7, + // EndLine: 7, + // StartPos: 103, + // EndPos: 117, + // }, + // Value: "//some comment\n", + // TokenName: 12, + // }, + // &meta.WhiteSpace{ + // Position: &position.Position{ + // StartLine: 8, + // EndLine: 8, + // StartPos: 118, + // EndPos: 122, + // }, + // Value: "\t\t\t\t\t", + // TokenName: 12, + // }, + // }, + // VarName: &node.Identifier{ + // Position: &position.Position{ + // StartLine: 8, + // EndLine: 8, + // StartPos: 123, + // EndPos: 126, + // }, + // Value: "var", + // }, + // }, + // }, + // }, + // }, + // }, + // }, + // }, + // }, + // }, + // }, + // } } diff --git a/visitor/json_dumper.go b/visitor/json_dumper.go index f0e1934..cafe3b3 100644 --- a/visitor/json_dumper.go +++ b/visitor/json_dumper.go @@ -53,9 +53,9 @@ func (d *JsonDumper) EnterNode(w walker.Walkable) bool { switch m.(type) { case *meta.Comment: - fmt.Fprintf(d.Writer, "{%q:%q,%q:%q,%q:%q}", "type", "*meta.Comment", "value", m.String(), "tokenName", meta.TokenNames[m.GetTokenName()]) + fmt.Fprintf(d.Writer, "{%q:%q,%q:%q,%q:%q}", "type", "*meta.Comment", "value", m.String(), "tokenName", m.GetTokenName().String()) case *meta.WhiteSpace: - fmt.Fprintf(d.Writer, "{%q:%q,%q:%q,%q:%q}", "type", "*meta.WhiteSpace", "value", m.String(), "tokenName", meta.TokenNames[m.GetTokenName()]) + fmt.Fprintf(d.Writer, "{%q:%q,%q:%q,%q:%q}", "type", "*meta.WhiteSpace", "value", m.String(), "tokenName", m.GetTokenName().String()) } } diff --git a/visitor/json_dumper_test.go b/visitor/json_dumper_test.go index b99f8ac..b3baebc 100644 --- a/visitor/json_dumper_test.go +++ b/visitor/json_dumper_test.go @@ -37,5 +37,5 @@ func ExampleJsonDumper() { nodes.Walk(dumper) // Output: - // {"type":"*node.Root","position":{"startPos":10,"endPos":166,"startLine":3,"endLine":12},"Stmts":[{"type":"*stmt.Namespace","position":{"startPos":10,"endPos":166,"startLine":3,"endLine":12},"meta":[{"type":"*meta.WhiteSpace","value":"\n\n\t\t","tokenName":"NamespaceToken"},{"type":"*meta.WhiteSpace","value":" ","tokenName":"OpenCurlyBracesToken"},{"type":"*meta.WhiteSpace","value":"\n\t\t","tokenName":"CloseCurlyBracesToken"}],"NamespaceName":{"type":"*name.Name","position":{"startPos":20,"endPos":22,"startLine":3,"endLine":3},"Parts":[{"type":"*name.NamePart","position":{"startPos":20,"endPos":22,"startLine":3,"endLine":3},"meta":[{"type":"*meta.WhiteSpace","value":" ","tokenName":"StringToken"}],"Value":"Foo"}]},"Stmts":[{"type":"*stmt.Class","position":{"startPos":29,"endPos":162,"startLine":4,"endLine":11},"namespacedName":"Foo\\Bar","meta":[{"type":"*meta.WhiteSpace","value":"\n\t\t\t","tokenName":"ClassToken"},{"type":"*meta.WhiteSpace","value":" ","tokenName":"OpenCurlyBracesToken"},{"type":"*meta.WhiteSpace","value":"\n\t\t\t","tokenName":"CloseCurlyBracesToken"}],"PhpDocComment":"","ClassName":{"type":"*node.Identifier","position":{"startPos":35,"endPos":37,"startLine":4,"endLine":4},"meta":[{"type":"*meta.WhiteSpace","value":" ","tokenName":"StringToken"}],"Value":"Bar"},"Stmts":[{"type":"*stmt.ClassMethod","position":{"startPos":45,"endPos":157,"startLine":5,"endLine":10},"meta":[{"type":"*meta.WhiteSpace","value":" ","tokenName":"FunctionToken"}],"PhpDocComment":"","ReturnsRef":false,"MethodName":{"type":"*node.Identifier","position":{"startPos":61,"endPos":72,"startLine":5,"endLine":5},"meta":[{"type":"*meta.WhiteSpace","value":" ","tokenName":"IdentifierToken"}],"Value":"FunctionName"},"Modifiers":[{"type":"*node.Identifier","position":{"startPos":45,"endPos":50,"startLine":5,"endLine":5},"meta":[{"type":"*meta.WhiteSpace","value":"\n\t\t\t\t","tokenName":"PublicToken"}],"Value":"public"}],"Params":[{"type":"*node.Parameter","position":{"startPos":74,"endPos":89,"startLine":5,"endLine":5},"meta":[{"type":"*meta.WhiteSpace","value":" ","tokenName":"EqualToken"}],"ByRef":false,"Variadic":false,"VariableType":{"type":"*name.Name","position":{"startPos":74,"endPos":77,"startLine":5,"endLine":5},"namespacedName":"Foo\\Type","Parts":[{"type":"*name.NamePart","position":{"startPos":74,"endPos":77,"startLine":5,"endLine":5},"Value":"Type"}]},"Variable":{"type":"*expr.Variable","position":{"startPos":79,"endPos":82,"startLine":5,"endLine":5},"meta":[{"type":"*meta.WhiteSpace","value":" ","tokenName":"VariableToken"}],"VarName":{"type":"*node.Identifier","position":{"startPos":79,"endPos":82,"startLine":5,"endLine":5},"Value":"var"}},"DefaultValue":{"type":"*expr.ConstFetch","position":{"startPos":86,"endPos":89,"startLine":5,"endLine":5},"Constant":{"type":"*name.Name","position":{"startPos":86,"endPos":89,"startLine":5,"endLine":5},"namespacedName":"null","Parts":[{"type":"*name.NamePart","position":{"startPos":86,"endPos":89,"startLine":5,"endLine":5},"meta":[{"type":"*meta.WhiteSpace","value":" ","tokenName":"StringToken"}],"Value":"null"}]}}}],"Stmt":{"type":"*stmt.StmtList","position":{"startPos":96,"endPos":157,"startLine":6,"endLine":10},"meta":[{"type":"*meta.WhiteSpace","value":"\n\t\t\t\t","tokenName":"OpenCurlyBracesToken"},{"type":"*meta.WhiteSpace","value":"\n\t\t\t\t","tokenName":"CloseCurlyBracesToken"}],"Stmts":[{"type":"*stmt.Expression","position":{"startPos":147,"endPos":151,"startLine":9,"endLine":9},"Expr":{"type":"*expr.Variable","position":{"startPos":147,"endPos":150,"startLine":9,"endLine":9},"meta":[{"type":"*meta.WhiteSpace","value":"\n\t\t\t\t\t","tokenName":"VariableToken"},{"type":"*meta.Comment","value":"// some comment\n","tokenName":"VariableToken"},{"type":"*meta.WhiteSpace","value":"\n\t\t\t\t\t","tokenName":"VariableToken"},{"type":"*meta.Comment","value":"// second comment\n","tokenName":"VariableToken"},{"type":"*meta.WhiteSpace","value":"\n\t\t\t\t\t","tokenName":"VariableToken"}],"VarName":{"type":"*node.Identifier","position":{"startPos":147,"endPos":150,"startLine":9,"endLine":9},"Value":"var"}}}]}}]}]}]} + // {"type":"*node.Root","position":{"startPos":10,"endPos":166,"startLine":3,"endLine":12},"Stmts":[{"type":"*stmt.Namespace","position":{"startPos":10,"endPos":166,"startLine":3,"endLine":12},"meta":[{"type":"*meta.WhiteSpace","value":"\n\n\t\t","tokenName":"NamespaceToken"},{"type":"*meta.WhiteSpace","value":" ","tokenName":"OpenCurlyBracesToken"},{"type":"*meta.WhiteSpace","value":"\n\t\t","tokenName":"CloseCurlyBracesToken"}],"NamespaceName":{"type":"*name.Name","position":{"startPos":20,"endPos":22,"startLine":3,"endLine":3},"Parts":[{"type":"*name.NamePart","position":{"startPos":20,"endPos":22,"startLine":3,"endLine":3},"meta":[{"type":"*meta.WhiteSpace","value":" ","tokenName":"StringToken"}],"Value":"Foo"}]},"Stmts":[{"type":"*stmt.Class","position":{"startPos":29,"endPos":162,"startLine":4,"endLine":11},"namespacedName":"Foo\\Bar","meta":[{"type":"*meta.WhiteSpace","value":"\n\t\t\t","tokenName":"ClassToken"},{"type":"*meta.WhiteSpace","value":" ","tokenName":"OpenCurlyBracesToken"},{"type":"*meta.WhiteSpace","value":"\n\t\t\t","tokenName":"CloseCurlyBracesToken"}],"PhpDocComment":"","ClassName":{"type":"*node.Identifier","position":{"startPos":35,"endPos":37,"startLine":4,"endLine":4},"meta":[{"type":"*meta.WhiteSpace","value":" ","tokenName":"IdentifierToken"}],"Value":"Bar"},"Stmts":[{"type":"*stmt.ClassMethod","position":{"startPos":45,"endPos":157,"startLine":5,"endLine":10},"meta":[{"type":"*meta.WhiteSpace","value":" ","tokenName":"FunctionToken"}],"PhpDocComment":"","ReturnsRef":false,"MethodName":{"type":"*node.Identifier","position":{"startPos":61,"endPos":72,"startLine":5,"endLine":5},"meta":[{"type":"*meta.WhiteSpace","value":" ","tokenName":"IdentifierToken"}],"Value":"FunctionName"},"Modifiers":[{"type":"*node.Identifier","position":{"startPos":45,"endPos":50,"startLine":5,"endLine":5},"meta":[{"type":"*meta.WhiteSpace","value":"\n\t\t\t\t","tokenName":"IdentifierToken"}],"Value":"public"}],"Params":[{"type":"*node.Parameter","position":{"startPos":74,"endPos":89,"startLine":5,"endLine":5},"meta":[{"type":"*meta.WhiteSpace","value":" ","tokenName":"EqualToken"}],"ByRef":false,"Variadic":false,"VariableType":{"type":"*name.Name","position":{"startPos":74,"endPos":77,"startLine":5,"endLine":5},"namespacedName":"Foo\\Type","Parts":[{"type":"*name.NamePart","position":{"startPos":74,"endPos":77,"startLine":5,"endLine":5},"Value":"Type"}]},"Variable":{"type":"*expr.Variable","position":{"startPos":79,"endPos":82,"startLine":5,"endLine":5},"meta":[{"type":"*meta.WhiteSpace","value":" ","tokenName":"VariableToken"}],"VarName":{"type":"*node.Identifier","position":{"startPos":79,"endPos":82,"startLine":5,"endLine":5},"Value":"var"}},"DefaultValue":{"type":"*expr.ConstFetch","position":{"startPos":86,"endPos":89,"startLine":5,"endLine":5},"Constant":{"type":"*name.Name","position":{"startPos":86,"endPos":89,"startLine":5,"endLine":5},"namespacedName":"null","Parts":[{"type":"*name.NamePart","position":{"startPos":86,"endPos":89,"startLine":5,"endLine":5},"meta":[{"type":"*meta.WhiteSpace","value":" ","tokenName":"StringToken"}],"Value":"null"}]}}}],"Stmt":{"type":"*stmt.StmtList","position":{"startPos":96,"endPos":157,"startLine":6,"endLine":10},"meta":[{"type":"*meta.WhiteSpace","value":"\n\t\t\t\t","tokenName":"OpenCurlyBracesToken"},{"type":"*meta.WhiteSpace","value":"\n\t\t\t\t","tokenName":"CloseCurlyBracesToken"}],"Stmts":[{"type":"*stmt.Expression","position":{"startPos":147,"endPos":151,"startLine":9,"endLine":9},"Expr":{"type":"*expr.Variable","position":{"startPos":147,"endPos":150,"startLine":9,"endLine":9},"meta":[{"type":"*meta.WhiteSpace","value":"\n\t\t\t\t\t","tokenName":"VariableToken"},{"type":"*meta.Comment","value":"// some comment\n","tokenName":"VariableToken"},{"type":"*meta.WhiteSpace","value":"\t\t\t\t\t","tokenName":"VariableToken"},{"type":"*meta.Comment","value":"// second comment\n","tokenName":"VariableToken"},{"type":"*meta.WhiteSpace","value":"\t\t\t\t\t","tokenName":"VariableToken"}],"VarName":{"type":"*node.Identifier","position":{"startPos":147,"endPos":150,"startLine":9,"endLine":9},"Value":"var"}}}]}}]}]}]} } diff --git a/visitor/namespace_resolver.go b/visitor/namespace_resolver.go index c4d47fc..f8b0ea1 100644 --- a/visitor/namespace_resolver.go +++ b/visitor/namespace_resolver.go @@ -156,8 +156,8 @@ func (nsr *NamespaceResolver) EnterNode(w walker.Walkable) bool { nsr.ResolveName(t, "") } - if n.TraitAdaptationList != nil { - for _, a := range n.TraitAdaptationList.Adaptations { + if adaptationList, ok := n.TraitAdaptationList.(*stmt.TraitAdaptationList); ok { + for _, a := range adaptationList.Adaptations { switch aa := a.(type) { case *stmt.TraitUsePrecedence: refTrait := aa.Ref.(*stmt.TraitMethodRef).Trait diff --git a/visitor/pretty_json_dumper.go b/visitor/pretty_json_dumper.go index 9b5b04b..63d5007 100644 --- a/visitor/pretty_json_dumper.go +++ b/visitor/pretty_json_dumper.go @@ -105,7 +105,7 @@ func (d *PrettyJsonDumper) EnterNode(w walker.Walkable) bool { d.printIndent(d.Writer) fmt.Fprintf(d.Writer, "%q: %q,\n", "value", m.String()) d.printIndent(d.Writer) - fmt.Fprintf(d.Writer, "%q: %q\n", "tokenName", meta.TokenNames[m.GetTokenName()]) + fmt.Fprintf(d.Writer, "%q: %q\n", "tokenName", m.GetTokenName().String()) d.depth-- d.printIndent(d.Writer) fmt.Fprint(d.Writer, "}") diff --git a/visitor/pretty_json_dumper_test.go b/visitor/pretty_json_dumper_test.go index 92d753d..16a1e22 100644 --- a/visitor/pretty_json_dumper_test.go +++ b/visitor/pretty_json_dumper_test.go @@ -45,6 +45,13 @@ func ExamplePrettyJsonDumper() { // "startLine": 3, // "endLine": 14 // }, + // "meta": [ + // { + // "type": "*meta.WhiteSpace", + // "value": "\n\t\t", + // "tokenName": "NodeEnd" + // } + // ], // "Stmts": [ // { // "type": "*stmt.Namespace", @@ -139,7 +146,7 @@ func ExamplePrettyJsonDumper() { // { // "type": "*meta.WhiteSpace", // "value": " ", - // "tokenName": "StringToken" + // "tokenName": "IdentifierToken" // } // ], // "Value": "Bar" @@ -192,7 +199,7 @@ func ExamplePrettyJsonDumper() { // { // "type": "*meta.WhiteSpace", // "value": "\n\t\t\t\t", - // "tokenName": "PublicToken" + // "tokenName": "IdentifierToken" // } // ], // "Value": "public" @@ -354,7 +361,7 @@ func ExamplePrettyJsonDumper() { // }, // { // "type": "*meta.WhiteSpace", - // "value": "\n\t\t\t\t\t", + // "value": "\t\t\t\t\t", // "tokenName": "VariableToken" // }, // { @@ -364,7 +371,7 @@ func ExamplePrettyJsonDumper() { // }, // { // "type": "*meta.WhiteSpace", - // "value": "\n\t\t\t\t\t", + // "value": "\t\t\t\t\t", // "tokenName": "VariableToken" // } // ], @@ -420,7 +427,7 @@ func ExamplePrettyJsonDumper() { // { // "type": "*meta.WhiteSpace", // "value": " ", - // "tokenName": "StringToken" + // "tokenName": "IdentifierToken" // } // ], // "Value": "foo" From 18d6d59292196783250bb37d534dce7ab7694a46 Mon Sep 17 00:00:00 2001 From: z7zmey Date: Tue, 10 Jul 2018 00:51:02 +0300 Subject: [PATCH 016/117] #50: nodes stmt.Exit and stmt.Die was merged --- .gitignore | 4 +- node/expr/n_die.go | 61 ----- node/expr/n_exit.go | 5 +- node/expr/t_exit_test.go | 92 ++++++- node/expr/t_meta_test.go | 1 - node/expr/t_visitor_test.go | 10 +- php5/php5.go | 477 +++++++++++++++++---------------- php5/php5.y | 27 +- php5/php5_test.go | 8 +- php7/php7.go | 283 +++++++++---------- php7/php7.y | 23 +- php7/php7_test.go | 8 +- printer/pretty_printer.go | 16 +- printer/pretty_printer_test.go | 30 +-- printer/printer.go | 27 +- printer/printer_parsed_test.go | 17 +- printer/printer_test.go | 88 +++--- 17 files changed, 605 insertions(+), 572 deletions(-) delete mode 100644 node/expr/n_die.go diff --git a/.gitignore b/.gitignore index 032c7f4..4592fa6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,8 @@ .vscode php-parser +**/*.test + *example.php cpu.pprof mem.pprof -php7.test -php5.test diff --git a/node/expr/n_die.go b/node/expr/n_die.go deleted file mode 100644 index 6346645..0000000 --- a/node/expr/n_die.go +++ /dev/null @@ -1,61 +0,0 @@ -package expr - -import ( - "github.com/z7zmey/php-parser/meta" - "github.com/z7zmey/php-parser/node" - "github.com/z7zmey/php-parser/position" - "github.com/z7zmey/php-parser/walker" -) - -// Die node -type Die struct { - Meta []meta.Meta - Position *position.Position - Expr node.Node -} - -// NewDie node constructor -func NewDie(Expr node.Node) *Die { - return &Die{ - Expr: Expr, - } -} - -// SetPosition sets node position -func (n *Die) SetPosition(p *position.Position) { - n.Position = p -} - -// GetPosition returns node positions -func (n *Die) GetPosition() *position.Position { - return n.Position -} - -func (n *Die) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *Die) GetMeta() []meta.Meta { - return n.Meta -} - -// Attributes returns node attributes as map -func (n *Die) Attributes() map[string]interface{} { - return nil -} - -// Walk traverses nodes -// Walk is invoked recursively until v.EnterNode returns true -func (n *Die) Walk(v walker.Visitor) { - if v.EnterNode(n) == false { - return - } - - if n.Expr != nil { - v.EnterChildNode("Expr", n) - n.Expr.Walk(v) - v.LeaveChildNode("Expr", n) - } - - v.LeaveNode(n) -} diff --git a/node/expr/n_exit.go b/node/expr/n_exit.go index d2e90be..721f2f2 100644 --- a/node/expr/n_exit.go +++ b/node/expr/n_exit.go @@ -10,6 +10,7 @@ import ( // Exit node type Exit struct { Meta []meta.Meta + Die bool Position *position.Position Expr node.Node } @@ -41,7 +42,9 @@ func (n *Exit) GetMeta() []meta.Meta { // Attributes returns node attributes as map func (n *Exit) Attributes() map[string]interface{} { - return nil + return map[string]interface{}{ + "Die": n.Die, + } } // Walk traverses nodes diff --git a/node/expr/t_exit_test.go b/node/expr/t_exit_test.go index 9a12acf..5a71604 100644 --- a/node/expr/t_exit_test.go +++ b/node/expr/t_exit_test.go @@ -32,6 +32,7 @@ func TestExit(t *testing.T) { EndPos: 8, }, Expr: &expr.Exit{ + Die: false, Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -54,6 +55,48 @@ func TestExit(t *testing.T) { assertEqual(t, expected, actual) } +func TestExitEmpty(t *testing.T) { + src := ` Date: Wed, 11 Jul 2018 17:01:31 +0300 Subject: [PATCH 017/117] trace profiling added --- .gitignore | 1 + README.md | 2 +- main.go | 4 +++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 4592fa6..9e6bbd0 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ php-parser cpu.pprof mem.pprof +trace.out \ No newline at end of file diff --git a/README.md b/README.md index c347b95..dbcfff4 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ php-parser [flags] ... | -d |string| dump format: [custom, go, json, pretty-json] | | -p | bool | show positions | | -r | bool | resolve names | -| -prof |string| start profiler: [cpu, mem] | +| -prof |string| start profiler: [cpu, mem, trace] | | -meta | bool | show meta info | | -php5 | bool | parse as PHP5 | diff --git a/main.go b/main.go index 2c46f11..25b8977 100644 --- a/main.go +++ b/main.go @@ -29,7 +29,7 @@ func main() { withMeta = flag.Bool("meta", false, "show meta") showResolvedNs = flag.Bool("r", false, "resolve names") flag.StringVar(&dumpType, "d", "", "dump format: [custom, go, json, pretty_json]") - flag.StringVar(&profiler, "prof", "", "start profiler: [cpu, mem]") + flag.StringVar(&profiler, "prof", "", "start profiler: [cpu, mem, trace]") flag.Parse() @@ -38,6 +38,8 @@ func main() { defer profile.Start(profile.ProfilePath("."), profile.NoShutdownHook).Stop() case "mem": defer profile.Start(profile.MemProfile, profile.ProfilePath("."), profile.NoShutdownHook).Stop() + case "trace": + defer profile.Start(profile.TraceProfile, profile.ProfilePath("."), profile.NoShutdownHook).Stop() } pathCh := make(chan string) From 8df2e7cef1d3b89b4e22c37f4599f9b2d5367912 Mon Sep 17 00:00:00 2001 From: z7zmey Date: Wed, 11 Jul 2018 18:05:38 +0300 Subject: [PATCH 018/117] delete spew dump --- php7/php7.go | 985 +++++++++++++++++++++++++-------------------------- php7/php7.y | 3 - 2 files changed, 491 insertions(+), 497 deletions(-) diff --git a/php7/php7.go b/php7/php7.go index 5fc1736..6645ba6 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -18,11 +18,9 @@ import ( "github.com/z7zmey/php-parser/node/scalar" "github.com/z7zmey/php-parser/node/stmt" "github.com/z7zmey/php-parser/scanner" - - "github.com/davecgh/go-spew/spew" ) -//line php7/php7.y:24 +//line php7/php7.y:22 type yySymType struct { yys int node node.Node @@ -348,7 +346,7 @@ const yyEofCode = 1 const yyErrCode = 2 const yyInitialStackSize = 16 -//line php7/php7.y:5344 +//line php7/php7.y:5341 //line yacctab:1 var yyExca = [...]int{ @@ -2116,7 +2114,7 @@ yydefault: case 1: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:302 + //line php7/php7.y:300 { yylex.(*Parser).rootNode = node.NewRoot(yyDollar[1].list) @@ -2131,463 +2129,463 @@ yydefault: } case 2: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:317 + //line php7/php7.y:315 { yyVAL.token = yyDollar[1].token } case 3: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:317 + //line php7/php7.y:315 { yyVAL.token = yyDollar[1].token } case 4: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:317 + //line php7/php7.y:315 { yyVAL.token = yyDollar[1].token } case 5: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:317 + //line php7/php7.y:315 { yyVAL.token = yyDollar[1].token } case 6: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:317 + //line php7/php7.y:315 { yyVAL.token = yyDollar[1].token } case 7: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:317 + //line php7/php7.y:315 { yyVAL.token = yyDollar[1].token } case 8: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:317 + //line php7/php7.y:315 { yyVAL.token = yyDollar[1].token } case 9: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:317 + //line php7/php7.y:315 { yyVAL.token = yyDollar[1].token } case 10: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:318 + //line php7/php7.y:316 { yyVAL.token = yyDollar[1].token } case 11: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:318 + //line php7/php7.y:316 { yyVAL.token = yyDollar[1].token } case 12: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:318 + //line php7/php7.y:316 { yyVAL.token = yyDollar[1].token } case 13: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:318 + //line php7/php7.y:316 { yyVAL.token = yyDollar[1].token } case 14: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:318 + //line php7/php7.y:316 { yyVAL.token = yyDollar[1].token } case 15: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:318 + //line php7/php7.y:316 { yyVAL.token = yyDollar[1].token } case 16: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:318 + //line php7/php7.y:316 { yyVAL.token = yyDollar[1].token } case 17: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:318 + //line php7/php7.y:316 { yyVAL.token = yyDollar[1].token } case 18: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:318 + //line php7/php7.y:316 { yyVAL.token = yyDollar[1].token } case 19: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:318 + //line php7/php7.y:316 { yyVAL.token = yyDollar[1].token } case 20: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:318 + //line php7/php7.y:316 { yyVAL.token = yyDollar[1].token } case 21: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:318 + //line php7/php7.y:316 { yyVAL.token = yyDollar[1].token } case 22: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:319 + //line php7/php7.y:317 { yyVAL.token = yyDollar[1].token } case 23: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:319 + //line php7/php7.y:317 { yyVAL.token = yyDollar[1].token } case 24: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:319 + //line php7/php7.y:317 { yyVAL.token = yyDollar[1].token } case 25: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:319 + //line php7/php7.y:317 { yyVAL.token = yyDollar[1].token } case 26: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:319 + //line php7/php7.y:317 { yyVAL.token = yyDollar[1].token } case 27: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:319 + //line php7/php7.y:317 { yyVAL.token = yyDollar[1].token } case 28: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:319 + //line php7/php7.y:317 { yyVAL.token = yyDollar[1].token } case 29: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:319 + //line php7/php7.y:317 { yyVAL.token = yyDollar[1].token } case 30: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:319 + //line php7/php7.y:317 { yyVAL.token = yyDollar[1].token } case 31: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:319 + //line php7/php7.y:317 { yyVAL.token = yyDollar[1].token } case 32: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:320 + //line php7/php7.y:318 { yyVAL.token = yyDollar[1].token } case 33: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:320 + //line php7/php7.y:318 { yyVAL.token = yyDollar[1].token } case 34: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:320 + //line php7/php7.y:318 { yyVAL.token = yyDollar[1].token } case 35: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:320 + //line php7/php7.y:318 { yyVAL.token = yyDollar[1].token } case 36: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:320 + //line php7/php7.y:318 { yyVAL.token = yyDollar[1].token } case 37: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:320 + //line php7/php7.y:318 { yyVAL.token = yyDollar[1].token } case 38: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:320 + //line php7/php7.y:318 { yyVAL.token = yyDollar[1].token } case 39: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:320 + //line php7/php7.y:318 { yyVAL.token = yyDollar[1].token } case 40: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:320 + //line php7/php7.y:318 { yyVAL.token = yyDollar[1].token } case 41: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:320 + //line php7/php7.y:318 { yyVAL.token = yyDollar[1].token } case 42: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:321 + //line php7/php7.y:319 { yyVAL.token = yyDollar[1].token } case 43: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:321 + //line php7/php7.y:319 { yyVAL.token = yyDollar[1].token } case 44: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:321 + //line php7/php7.y:319 { yyVAL.token = yyDollar[1].token } case 45: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:321 + //line php7/php7.y:319 { yyVAL.token = yyDollar[1].token } case 46: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:321 + //line php7/php7.y:319 { yyVAL.token = yyDollar[1].token } case 47: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:321 + //line php7/php7.y:319 { yyVAL.token = yyDollar[1].token } case 48: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:321 + //line php7/php7.y:319 { yyVAL.token = yyDollar[1].token } case 49: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:321 + //line php7/php7.y:319 { yyVAL.token = yyDollar[1].token } case 50: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:321 + //line php7/php7.y:319 { yyVAL.token = yyDollar[1].token } case 51: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:321 + //line php7/php7.y:319 { yyVAL.token = yyDollar[1].token } case 52: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:321 + //line php7/php7.y:319 { yyVAL.token = yyDollar[1].token } case 53: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:322 + //line php7/php7.y:320 { yyVAL.token = yyDollar[1].token } case 54: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:322 + //line php7/php7.y:320 { yyVAL.token = yyDollar[1].token } case 55: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:322 + //line php7/php7.y:320 { yyVAL.token = yyDollar[1].token } case 56: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:322 + //line php7/php7.y:320 { yyVAL.token = yyDollar[1].token } case 57: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:322 + //line php7/php7.y:320 { yyVAL.token = yyDollar[1].token } case 58: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:322 + //line php7/php7.y:320 { yyVAL.token = yyDollar[1].token } case 59: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:322 + //line php7/php7.y:320 { yyVAL.token = yyDollar[1].token } case 60: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:322 + //line php7/php7.y:320 { yyVAL.token = yyDollar[1].token } case 61: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:323 + //line php7/php7.y:321 { yyVAL.token = yyDollar[1].token } case 62: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:323 + //line php7/php7.y:321 { yyVAL.token = yyDollar[1].token } case 63: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:323 + //line php7/php7.y:321 { yyVAL.token = yyDollar[1].token } case 64: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:323 + //line php7/php7.y:321 { yyVAL.token = yyDollar[1].token } case 65: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:323 + //line php7/php7.y:321 { yyVAL.token = yyDollar[1].token } case 66: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:323 + //line php7/php7.y:321 { yyVAL.token = yyDollar[1].token } case 67: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:323 + //line php7/php7.y:321 { yyVAL.token = yyDollar[1].token } case 68: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:323 + //line php7/php7.y:321 { yyVAL.token = yyDollar[1].token } case 69: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:328 + //line php7/php7.y:326 { yyVAL.token = yyDollar[1].token } case 70: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:331 + //line php7/php7.y:329 { yyVAL.token = yyDollar[1].token } case 71: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:331 + //line php7/php7.y:329 { yyVAL.token = yyDollar[1].token } case 72: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:331 + //line php7/php7.y:329 { yyVAL.token = yyDollar[1].token } case 73: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:331 + //line php7/php7.y:329 { yyVAL.token = yyDollar[1].token } case 74: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:331 + //line php7/php7.y:329 { yyVAL.token = yyDollar[1].token } case 75: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:331 + //line php7/php7.y:329 { yyVAL.token = yyDollar[1].token } case 76: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:336 + //line php7/php7.y:334 { yyVAL.token = yyDollar[1].token } case 77: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:340 + //line php7/php7.y:338 { yyVAL.token = yyDollar[1].token } case 78: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:347 + //line php7/php7.y:345 { if yyDollar[2].node != nil { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -2597,7 +2595,7 @@ yydefault: } case 79: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:355 + //line php7/php7.y:353 { yyVAL.list = []node.Node{} @@ -2605,7 +2603,7 @@ yydefault: } case 80: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:364 + //line php7/php7.y:362 { namePart := name.NewNamePart(yyDollar[1].token.Value) yyVAL.list = []node.Node{namePart} @@ -2620,7 +2618,7 @@ yydefault: } case 81: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:377 + //line php7/php7.y:375 { namePart := name.NewNamePart(yyDollar[3].token.Value) yyVAL.list = append(yyDollar[1].list, namePart) @@ -2636,7 +2634,7 @@ yydefault: } case 82: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:394 + //line php7/php7.y:392 { yyVAL.node = name.NewName(yyDollar[1].list) @@ -2647,7 +2645,7 @@ yydefault: } case 83: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:403 + //line php7/php7.y:401 { yyVAL.node = name.NewRelative(yyDollar[3].list) @@ -2662,7 +2660,7 @@ yydefault: } case 84: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:416 + //line php7/php7.y:414 { yyVAL.node = name.NewFullyQualified(yyDollar[2].list) @@ -2676,7 +2674,7 @@ yydefault: } case 85: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:431 + //line php7/php7.y:429 { // error yyVAL.node = nil @@ -2685,7 +2683,7 @@ yydefault: } case 86: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:438 + //line php7/php7.y:436 { yyVAL.node = yyDollar[1].node @@ -2693,7 +2691,7 @@ yydefault: } case 87: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:444 + //line php7/php7.y:442 { yyVAL.node = yyDollar[1].node @@ -2701,7 +2699,7 @@ yydefault: } case 88: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:450 + //line php7/php7.y:448 { yyVAL.node = yyDollar[1].node @@ -2709,7 +2707,7 @@ yydefault: } case 89: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:456 + //line php7/php7.y:454 { yyVAL.node = yyDollar[1].node @@ -2717,7 +2715,7 @@ yydefault: } case 90: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:462 + //line php7/php7.y:460 { yyVAL.node = yyDollar[1].node @@ -2725,7 +2723,7 @@ yydefault: } case 91: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:468 + //line php7/php7.y:466 { yyVAL.node = stmt.NewHaltCompiler() @@ -2742,7 +2740,7 @@ yydefault: } case 92: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:483 + //line php7/php7.y:481 { name := name.NewName(yyDollar[2].list) yyVAL.node = stmt.NewNamespace(name, nil) @@ -2759,7 +2757,7 @@ yydefault: } case 93: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:498 + //line php7/php7.y:496 { name := name.NewName(yyDollar[2].list) yyVAL.node = stmt.NewNamespace(name, yyDollar[4].list) @@ -2777,7 +2775,7 @@ yydefault: } case 94: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:514 + //line php7/php7.y:512 { yyVAL.node = stmt.NewNamespace(nil, yyDollar[3].list) @@ -2793,7 +2791,7 @@ yydefault: } case 95: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:528 + //line php7/php7.y:526 { yyVAL.node = yyDollar[2].node @@ -2808,7 +2806,7 @@ yydefault: } case 96: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:541 + //line php7/php7.y:539 { yyVAL.node = yyDollar[3].node.(*stmt.GroupUse).SetUseType(yyDollar[2].node) @@ -2823,7 +2821,7 @@ yydefault: } case 97: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:554 + //line php7/php7.y:552 { yyVAL.node = stmt.NewUseList(nil, yyDollar[2].list) @@ -2838,7 +2836,7 @@ yydefault: } case 98: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:567 + //line php7/php7.y:565 { yyVAL.node = stmt.NewUseList(yyDollar[2].node, yyDollar[3].list) @@ -2853,7 +2851,7 @@ yydefault: } case 99: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:580 + //line php7/php7.y:578 { yyVAL.node = stmt.NewConstList(yyDollar[2].list) @@ -2868,7 +2866,7 @@ yydefault: } case 100: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:596 + //line php7/php7.y:594 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -2882,7 +2880,7 @@ yydefault: } case 101: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:608 + //line php7/php7.y:606 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -2896,7 +2894,7 @@ yydefault: } case 102: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:623 + //line php7/php7.y:621 { name := name.NewName(yyDollar[1].list) yyVAL.node = stmt.NewGroupUse(nil, name, yyDollar[4].list) @@ -2917,7 +2915,7 @@ yydefault: } case 103: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:642 + //line php7/php7.y:640 { name := name.NewName(yyDollar[2].list) yyVAL.node = stmt.NewGroupUse(nil, name, yyDollar[5].list) @@ -2939,7 +2937,7 @@ yydefault: } case 104: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:665 + //line php7/php7.y:663 { name := name.NewName(yyDollar[1].list) yyVAL.node = stmt.NewGroupUse(nil, name, yyDollar[4].list) @@ -2960,7 +2958,7 @@ yydefault: } case 105: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:684 + //line php7/php7.y:682 { name := name.NewName(yyDollar[2].list) yyVAL.node = stmt.NewGroupUse(nil, name, yyDollar[5].list) @@ -2982,19 +2980,19 @@ yydefault: } case 106: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:707 + //line php7/php7.y:705 { yyVAL.token = nil } case 107: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:711 + //line php7/php7.y:709 { yyVAL.token = yyDollar[1].token } case 108: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:718 + //line php7/php7.y:716 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -3005,7 +3003,7 @@ yydefault: } case 109: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:727 + //line php7/php7.y:725 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -3013,7 +3011,7 @@ yydefault: } case 110: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:736 + //line php7/php7.y:734 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -3024,7 +3022,7 @@ yydefault: } case 111: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:745 + //line php7/php7.y:743 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -3032,7 +3030,7 @@ yydefault: } case 112: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:754 + //line php7/php7.y:752 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -3043,7 +3041,7 @@ yydefault: } case 113: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:763 + //line php7/php7.y:761 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -3051,7 +3049,7 @@ yydefault: } case 114: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:772 + //line php7/php7.y:770 { yyVAL.node = yyDollar[1].node @@ -3059,7 +3057,7 @@ yydefault: } case 115: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:778 + //line php7/php7.y:776 { yyVAL.node = yyDollar[2].node.(*stmt.Use).SetUseType(yyDollar[1].node) @@ -3067,7 +3065,7 @@ yydefault: } case 116: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:787 + //line php7/php7.y:785 { name := name.NewName(yyDollar[1].list) yyVAL.node = stmt.NewUse(nil, name, nil) @@ -3080,7 +3078,7 @@ yydefault: } case 117: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:798 + //line php7/php7.y:796 { name := name.NewName(yyDollar[1].list) alias := node.NewIdentifier(yyDollar[3].token.Value) @@ -3099,7 +3097,7 @@ yydefault: } case 118: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:818 + //line php7/php7.y:816 { yyVAL.node = yyDollar[1].node @@ -3107,7 +3105,7 @@ yydefault: } case 119: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:824 + //line php7/php7.y:822 { yyVAL.node = yyDollar[2].node @@ -3118,7 +3116,7 @@ yydefault: } case 120: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:836 + //line php7/php7.y:834 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -3129,7 +3127,7 @@ yydefault: } case 121: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:845 + //line php7/php7.y:843 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -3137,7 +3135,7 @@ yydefault: } case 122: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:854 + //line php7/php7.y:852 { if yyDollar[2].node != nil { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -3147,7 +3145,7 @@ yydefault: } case 123: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:862 + //line php7/php7.y:860 { yyVAL.list = []node.Node{} @@ -3155,7 +3153,7 @@ yydefault: } case 124: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:871 + //line php7/php7.y:869 { // error yyVAL.node = nil @@ -3164,7 +3162,7 @@ yydefault: } case 125: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:878 + //line php7/php7.y:876 { yyVAL.node = yyDollar[1].node @@ -3172,7 +3170,7 @@ yydefault: } case 126: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:884 + //line php7/php7.y:882 { yyVAL.node = yyDollar[1].node @@ -3180,7 +3178,7 @@ yydefault: } case 127: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:890 + //line php7/php7.y:888 { yyVAL.node = yyDollar[1].node @@ -3188,7 +3186,7 @@ yydefault: } case 128: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:896 + //line php7/php7.y:894 { yyVAL.node = yyDollar[1].node @@ -3196,7 +3194,7 @@ yydefault: } case 129: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:902 + //line php7/php7.y:900 { yyVAL.node = yyDollar[1].node @@ -3204,7 +3202,7 @@ yydefault: } case 130: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:908 + //line php7/php7.y:906 { yyVAL.node = stmt.NewHaltCompiler() @@ -3221,7 +3219,7 @@ yydefault: } case 131: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:925 + //line php7/php7.y:923 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) @@ -3236,7 +3234,7 @@ yydefault: } case 132: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:938 + //line php7/php7.y:936 { yyVAL.node = yyDollar[1].node @@ -3244,7 +3242,7 @@ yydefault: } case 133: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:944 + //line php7/php7.y:942 { yyVAL.node = yyDollar[1].node @@ -3252,7 +3250,7 @@ yydefault: } case 134: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:950 + //line php7/php7.y:948 { switch n := yyDollar[5].node.(type) { case *stmt.While: @@ -3275,7 +3273,7 @@ yydefault: } case 135: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:971 + //line php7/php7.y:969 { yyVAL.node = stmt.NewDo(yyDollar[2].node, yyDollar[5].node) @@ -3293,7 +3291,7 @@ yydefault: } case 136: yyDollar = yyS[yypt-9 : yypt+1] - //line php7/php7.y:987 + //line php7/php7.y:985 { switch n := yyDollar[9].node.(type) { case *stmt.For: @@ -3322,7 +3320,7 @@ yydefault: } case 137: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:1014 + //line php7/php7.y:1012 { switch n := yyDollar[5].node.(type) { case *stmt.Switch: @@ -3347,7 +3345,7 @@ yydefault: } case 138: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1037 + //line php7/php7.y:1035 { yyVAL.node = stmt.NewBreak(yyDollar[2].node) @@ -3362,7 +3360,7 @@ yydefault: } case 139: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1050 + //line php7/php7.y:1048 { yyVAL.node = stmt.NewContinue(yyDollar[2].node) @@ -3377,7 +3375,7 @@ yydefault: } case 140: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1063 + //line php7/php7.y:1061 { yyVAL.node = stmt.NewReturn(yyDollar[2].node) @@ -3392,7 +3390,7 @@ yydefault: } case 141: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1076 + //line php7/php7.y:1074 { yyVAL.node = stmt.NewGlobal(yyDollar[2].list) @@ -3407,7 +3405,7 @@ yydefault: } case 142: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1089 + //line php7/php7.y:1087 { yyVAL.node = stmt.NewStatic(yyDollar[2].list) @@ -3422,7 +3420,7 @@ yydefault: } case 143: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1102 + //line php7/php7.y:1100 { yyVAL.node = stmt.NewEcho(yyDollar[2].list) @@ -3437,7 +3435,7 @@ yydefault: } case 144: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1115 + //line php7/php7.y:1113 { yyVAL.node = stmt.NewInlineHtml(yyDollar[1].token.Value) @@ -3451,7 +3449,7 @@ yydefault: } case 145: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1127 + //line php7/php7.y:1125 { yyVAL.node = stmt.NewExpression(yyDollar[1].node) @@ -3465,7 +3463,7 @@ yydefault: } case 146: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1139 + //line php7/php7.y:1137 { yyVAL.node = stmt.NewUnset(yyDollar[3].list) @@ -3485,7 +3483,7 @@ yydefault: } case 147: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:1157 + //line php7/php7.y:1155 { switch n := yyDollar[7].node.(type) { case *stmt.Foreach: @@ -3511,7 +3509,7 @@ yydefault: } case 148: yyDollar = yyS[yypt-9 : yypt+1] - //line php7/php7.y:1181 + //line php7/php7.y:1179 { switch n := yyDollar[9].node.(type) { case *stmt.Foreach: @@ -3540,7 +3538,7 @@ yydefault: } case 149: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:1208 + //line php7/php7.y:1206 { yyVAL.node = stmt.NewDeclare(yyDollar[3].list, yyDollar[5].node) @@ -3556,7 +3554,7 @@ yydefault: } case 150: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1222 + //line php7/php7.y:1220 { yyVAL.node = stmt.NewNop() @@ -3570,7 +3568,7 @@ yydefault: } case 151: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1234 + //line php7/php7.y:1232 { if yyDollar[6].node == nil { yyVAL.node = stmt.NewTry(yyDollar[3].list, yyDollar[5].list, yyDollar[6].node) @@ -3589,7 +3587,7 @@ yydefault: } case 152: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1251 + //line php7/php7.y:1249 { yyVAL.node = stmt.NewThrow(yyDollar[2].node) @@ -3604,7 +3602,7 @@ yydefault: } case 153: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1264 + //line php7/php7.y:1262 { label := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewGoto(label) @@ -3622,7 +3620,7 @@ yydefault: } case 154: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1280 + //line php7/php7.y:1278 { label := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewLabel(label) @@ -3639,7 +3637,7 @@ yydefault: } case 155: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1297 + //line php7/php7.y:1295 { yyVAL.list = []node.Node{} @@ -3647,7 +3645,7 @@ yydefault: } case 156: yyDollar = yyS[yypt-9 : yypt+1] - //line php7/php7.y:1303 + //line php7/php7.y:1301 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[5].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -3671,7 +3669,7 @@ yydefault: } case 157: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1327 + //line php7/php7.y:1325 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -3679,7 +3677,7 @@ yydefault: } case 158: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1333 + //line php7/php7.y:1331 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -3690,7 +3688,7 @@ yydefault: } case 159: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1345 + //line php7/php7.y:1343 { yyVAL.node = nil @@ -3698,7 +3696,7 @@ yydefault: } case 160: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1351 + //line php7/php7.y:1349 { yyVAL.node = stmt.NewFinally(yyDollar[3].list) @@ -3714,7 +3712,7 @@ yydefault: } case 161: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1368 + //line php7/php7.y:1366 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -3722,7 +3720,7 @@ yydefault: } case 162: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1374 + //line php7/php7.y:1372 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -3733,7 +3731,7 @@ yydefault: } case 163: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1386 + //line php7/php7.y:1384 { yyVAL.node = yyDollar[1].node @@ -3741,7 +3739,7 @@ yydefault: } case 164: yyDollar = yyS[yypt-11 : yypt+1] - //line php7/php7.y:1395 + //line php7/php7.y:1393 { name := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewFunction(name, yyDollar[2].token != nil, yyDollar[6].list, yyDollar[8].node, yyDollar[10].list, yyDollar[4].str) @@ -3765,31 +3763,31 @@ yydefault: } case 165: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1421 + //line php7/php7.y:1419 { yyVAL.token = nil } case 166: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1425 + //line php7/php7.y:1423 { yyVAL.token = yyDollar[1].token } case 167: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1432 + //line php7/php7.y:1430 { yyVAL.token = nil } case 168: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1436 + //line php7/php7.y:1434 { yyVAL.token = yyDollar[1].token } case 169: yyDollar = yyS[yypt-9 : yypt+1] - //line php7/php7.y:1443 + //line php7/php7.y:1441 { name := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewClass(name, yyDollar[1].list, nil, yyDollar[4].ClassExtends, yyDollar[5].ClassImplements, yyDollar[8].list, yyDollar[6].str) @@ -3808,7 +3806,7 @@ yydefault: } case 170: yyDollar = yyS[yypt-8 : yypt+1] - //line php7/php7.y:1460 + //line php7/php7.y:1458 { name := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewClass(name, nil, nil, yyDollar[3].ClassExtends, yyDollar[4].ClassImplements, yyDollar[7].list, yyDollar[5].str) @@ -3827,7 +3825,7 @@ yydefault: } case 171: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1480 + //line php7/php7.y:1478 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -3835,7 +3833,7 @@ yydefault: } case 172: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1486 + //line php7/php7.y:1484 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -3843,7 +3841,7 @@ yydefault: } case 173: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1495 + //line php7/php7.y:1493 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -3857,7 +3855,7 @@ yydefault: } case 174: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1507 + //line php7/php7.y:1505 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -3871,7 +3869,7 @@ yydefault: } case 175: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1522 + //line php7/php7.y:1520 { name := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewTrait(name, yyDollar[5].list, yyDollar[3].str) @@ -3890,7 +3888,7 @@ yydefault: } case 176: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:1542 + //line php7/php7.y:1540 { name := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewInterface(name, yyDollar[3].InterfaceExtends, yyDollar[6].list, yyDollar[4].str) @@ -3909,7 +3907,7 @@ yydefault: } case 177: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1562 + //line php7/php7.y:1560 { yyVAL.ClassExtends = nil @@ -3917,7 +3915,7 @@ yydefault: } case 178: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1568 + //line php7/php7.y:1566 { yyVAL.ClassExtends = stmt.NewClassExtends(yyDollar[2].node) @@ -3931,7 +3929,7 @@ yydefault: } case 179: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1583 + //line php7/php7.y:1581 { yyVAL.InterfaceExtends = nil @@ -3939,7 +3937,7 @@ yydefault: } case 180: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1589 + //line php7/php7.y:1587 { yyVAL.InterfaceExtends = stmt.NewInterfaceExtends(yyDollar[2].list) @@ -3953,7 +3951,7 @@ yydefault: } case 181: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1604 + //line php7/php7.y:1602 { yyVAL.ClassImplements = nil @@ -3961,7 +3959,7 @@ yydefault: } case 182: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1610 + //line php7/php7.y:1608 { yyVAL.ClassImplements = stmt.NewClassImplements(yyDollar[2].list) @@ -3975,7 +3973,7 @@ yydefault: } case 183: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1625 + //line php7/php7.y:1623 { yyVAL.node = yyDollar[1].node @@ -3983,7 +3981,7 @@ yydefault: } case 184: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1631 + //line php7/php7.y:1629 { yyVAL.node = expr.NewReference(yyDollar[2].node) @@ -3997,7 +3995,7 @@ yydefault: } case 185: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1643 + //line php7/php7.y:1641 { yyVAL.node = expr.NewList(yyDollar[3].list) @@ -4013,7 +4011,7 @@ yydefault: } case 186: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1657 + //line php7/php7.y:1655 { yyVAL.node = expr.NewShortList(yyDollar[2].list) @@ -4028,7 +4026,7 @@ yydefault: } case 187: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1673 + //line php7/php7.y:1671 { yyVAL.node = stmt.NewFor(nil, nil, nil, yyDollar[1].node) @@ -4039,7 +4037,7 @@ yydefault: } case 188: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1682 + //line php7/php7.y:1680 { stmtList := stmt.NewStmtList(yyDollar[2].list) yyVAL.node = stmt.NewAltFor(nil, nil, nil, stmtList) @@ -4057,7 +4055,7 @@ yydefault: } case 189: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1701 + //line php7/php7.y:1699 { yyVAL.node = stmt.NewForeach(nil, nil, nil, yyDollar[1].node) @@ -4068,7 +4066,7 @@ yydefault: } case 190: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1710 + //line php7/php7.y:1708 { stmtList := stmt.NewStmtList(yyDollar[2].list) yyVAL.node = stmt.NewAltForeach(nil, nil, nil, stmtList) @@ -4086,7 +4084,7 @@ yydefault: } case 191: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1729 + //line php7/php7.y:1727 { yyVAL.node = yyDollar[1].node @@ -4094,7 +4092,7 @@ yydefault: } case 192: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1735 + //line php7/php7.y:1733 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) @@ -4110,7 +4108,7 @@ yydefault: } case 193: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1752 + //line php7/php7.y:1750 { caseList := stmt.NewCaseList(yyDollar[2].list) yyVAL.node = stmt.NewSwitch(nil, caseList) @@ -4127,7 +4125,7 @@ yydefault: } case 194: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1767 + //line php7/php7.y:1765 { caseList := stmt.NewCaseList(yyDollar[3].list) yyVAL.node = stmt.NewSwitch(nil, caseList) @@ -4145,7 +4143,7 @@ yydefault: } case 195: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1783 + //line php7/php7.y:1781 { caseList := stmt.NewCaseList(yyDollar[2].list) yyVAL.node = stmt.NewAltSwitch(nil, caseList) @@ -4163,7 +4161,7 @@ yydefault: } case 196: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:1799 + //line php7/php7.y:1797 { caseList := stmt.NewCaseList(yyDollar[3].list) @@ -4183,7 +4181,7 @@ yydefault: } case 197: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1820 + //line php7/php7.y:1818 { yyVAL.list = []node.Node{} @@ -4191,7 +4189,7 @@ yydefault: } case 198: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:1826 + //line php7/php7.y:1824 { _case := stmt.NewCase(yyDollar[3].node, yyDollar[5].list) yyVAL.list = append(yyDollar[1].list, _case) @@ -4207,7 +4205,7 @@ yydefault: } case 199: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1840 + //line php7/php7.y:1838 { _default := stmt.NewDefault(yyDollar[4].list) yyVAL.list = append(yyDollar[1].list, _default) @@ -4223,19 +4221,19 @@ yydefault: } case 200: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1857 + //line php7/php7.y:1855 { yyVAL.token = yyDollar[1].token } case 201: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1861 + //line php7/php7.y:1859 { yyVAL.token = yyDollar[1].token } case 202: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1868 + //line php7/php7.y:1866 { yyVAL.node = stmt.NewWhile(nil, yyDollar[1].node) @@ -4246,7 +4244,7 @@ yydefault: } case 203: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1877 + //line php7/php7.y:1875 { stmtList := stmt.NewStmtList(yyDollar[2].list) yyVAL.node = stmt.NewAltWhile(nil, stmtList) @@ -4264,7 +4262,7 @@ yydefault: } case 204: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:1896 + //line php7/php7.y:1894 { yyVAL.node = stmt.NewIf(yyDollar[3].node, yyDollar[5].node, nil, nil) @@ -4280,7 +4278,7 @@ yydefault: } case 205: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1910 + //line php7/php7.y:1908 { _elseIf := stmt.NewElseIf(yyDollar[4].node, yyDollar[6].node) yyVAL.node = yyDollar[1].node.(*stmt.If).AddElseIf(_elseIf) @@ -4298,7 +4296,7 @@ yydefault: } case 206: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1929 + //line php7/php7.y:1927 { yyVAL.node = yyDollar[1].node @@ -4306,7 +4304,7 @@ yydefault: } case 207: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1935 + //line php7/php7.y:1933 { _else := stmt.NewElse(yyDollar[3].node) yyVAL.node = yyDollar[1].node.(*stmt.If).SetElse(_else) @@ -4322,7 +4320,7 @@ yydefault: } case 208: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1952 + //line php7/php7.y:1950 { stmts := stmt.NewStmtList(yyDollar[6].list) yyVAL.node = stmt.NewAltIf(yyDollar[3].node, stmts, nil, nil) @@ -4341,7 +4339,7 @@ yydefault: } case 209: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:1969 + //line php7/php7.y:1967 { stmts := stmt.NewStmtList(yyDollar[7].list) _elseIf := stmt.NewAltElseIf(yyDollar[4].node, stmts) @@ -4361,7 +4359,7 @@ yydefault: } case 210: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1990 + //line php7/php7.y:1988 { yyVAL.node = yyDollar[1].node @@ -4376,7 +4374,7 @@ yydefault: } case 211: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:2003 + //line php7/php7.y:2001 { stmts := stmt.NewStmtList(yyDollar[4].list) _else := stmt.NewAltElse(stmts) @@ -4397,7 +4395,7 @@ yydefault: } case 212: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2025 + //line php7/php7.y:2023 { yyVAL.list = yyDollar[1].list @@ -4405,7 +4403,7 @@ yydefault: } case 213: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:2031 + //line php7/php7.y:2029 { yyVAL.list = nil @@ -4413,7 +4411,7 @@ yydefault: } case 214: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2040 + //line php7/php7.y:2038 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4421,7 +4419,7 @@ yydefault: } case 215: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2046 + //line php7/php7.y:2044 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4432,7 +4430,7 @@ yydefault: } case 216: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2058 + //line php7/php7.y:2056 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[4].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -4464,7 +4462,7 @@ yydefault: } case 217: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:2088 + //line php7/php7.y:2086 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[4].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -4497,7 +4495,7 @@ yydefault: } case 218: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:2122 + //line php7/php7.y:2120 { yyVAL.node = nil @@ -4505,7 +4503,7 @@ yydefault: } case 219: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2128 + //line php7/php7.y:2126 { yyVAL.node = yyDollar[1].node @@ -4513,7 +4511,7 @@ yydefault: } case 220: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2137 + //line php7/php7.y:2135 { yyVAL.node = yyDollar[1].node @@ -4521,7 +4519,7 @@ yydefault: } case 221: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2143 + //line php7/php7.y:2141 { yyVAL.node = node.NewNullable(yyDollar[2].node) @@ -4535,7 +4533,7 @@ yydefault: } case 222: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2158 + //line php7/php7.y:2156 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4549,7 +4547,7 @@ yydefault: } case 223: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2170 + //line php7/php7.y:2168 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4563,7 +4561,7 @@ yydefault: } case 224: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2182 + //line php7/php7.y:2180 { yyVAL.node = yyDollar[1].node @@ -4571,7 +4569,7 @@ yydefault: } case 225: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:2191 + //line php7/php7.y:2189 { yyVAL.node = nil @@ -4579,7 +4577,7 @@ yydefault: } case 226: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2197 + //line php7/php7.y:2195 { yyVAL.node = yyDollar[2].node @@ -4590,7 +4588,7 @@ yydefault: } case 227: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2209 + //line php7/php7.y:2207 { yyVAL.node = node.NewArgumentList(nil) @@ -4605,7 +4603,7 @@ yydefault: } case 228: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2222 + //line php7/php7.y:2220 { yyVAL.node = node.NewArgumentList(yyDollar[2].list) @@ -4623,7 +4621,7 @@ yydefault: } case 229: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2241 + //line php7/php7.y:2239 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4631,7 +4629,7 @@ yydefault: } case 230: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2247 + //line php7/php7.y:2245 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4642,7 +4640,7 @@ yydefault: } case 231: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2259 + //line php7/php7.y:2257 { yyVAL.node = node.NewArgument(yyDollar[1].node, false, false) @@ -4653,7 +4651,7 @@ yydefault: } case 232: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2268 + //line php7/php7.y:2266 { yyVAL.node = node.NewArgument(yyDollar[2].node, true, false) @@ -4667,7 +4665,7 @@ yydefault: } case 233: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2283 + //line php7/php7.y:2281 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4678,7 +4676,7 @@ yydefault: } case 234: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2292 + //line php7/php7.y:2290 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4686,7 +4684,7 @@ yydefault: } case 235: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2301 + //line php7/php7.y:2299 { yyVAL.node = yyDollar[1].node @@ -4694,7 +4692,7 @@ yydefault: } case 236: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2310 + //line php7/php7.y:2308 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4705,7 +4703,7 @@ yydefault: } case 237: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2319 + //line php7/php7.y:2317 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4713,7 +4711,7 @@ yydefault: } case 238: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2328 + //line php7/php7.y:2326 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -4731,7 +4729,7 @@ yydefault: } case 239: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2344 + //line php7/php7.y:2342 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -4750,7 +4748,7 @@ yydefault: } case 240: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2364 + //line php7/php7.y:2362 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -4758,7 +4756,7 @@ yydefault: } case 241: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:2370 + //line php7/php7.y:2368 { yyVAL.list = []node.Node{} @@ -4766,7 +4764,7 @@ yydefault: } case 242: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2379 + //line php7/php7.y:2377 { yyVAL.node = stmt.NewPropertyList(yyDollar[1].list, yyDollar[2].list) @@ -4780,7 +4778,7 @@ yydefault: } case 243: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2391 + //line php7/php7.y:2389 { yyVAL.node = stmt.NewClassConstList(yyDollar[1].list, yyDollar[3].list) @@ -4795,7 +4793,7 @@ yydefault: } case 244: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2404 + //line php7/php7.y:2402 { yyVAL.node = stmt.NewTraitUse(yyDollar[2].list, yyDollar[3].node) @@ -4809,7 +4807,7 @@ yydefault: } case 245: yyDollar = yyS[yypt-10 : yypt+1] - //line php7/php7.y:2416 + //line php7/php7.y:2414 { name := node.NewIdentifier(yyDollar[4].token.Value) yyVAL.node = stmt.NewClassMethod(name, yyDollar[1].list, yyDollar[3].token != nil, yyDollar[7].list, yyDollar[9].node, yyDollar[10].node, yyDollar[5].str) @@ -4835,7 +4833,7 @@ yydefault: } case 246: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2443 + //line php7/php7.y:2441 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4843,7 +4841,7 @@ yydefault: } case 247: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2449 + //line php7/php7.y:2447 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4854,7 +4852,7 @@ yydefault: } case 248: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2461 + //line php7/php7.y:2459 { yyVAL.node = stmt.NewNop() @@ -4867,7 +4865,7 @@ yydefault: } case 249: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2473 + //line php7/php7.y:2471 { yyVAL.node = stmt.NewTraitAdaptationList(nil) @@ -4881,7 +4879,7 @@ yydefault: } case 250: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2485 + //line php7/php7.y:2483 { yyVAL.node = stmt.NewTraitAdaptationList(yyDollar[2].list) @@ -4895,7 +4893,7 @@ yydefault: } case 251: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2500 + //line php7/php7.y:2498 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4903,7 +4901,7 @@ yydefault: } case 252: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2506 + //line php7/php7.y:2504 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -4911,7 +4909,7 @@ yydefault: } case 253: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2515 + //line php7/php7.y:2513 { yyVAL.node = yyDollar[1].node @@ -4922,7 +4920,7 @@ yydefault: } case 254: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2524 + //line php7/php7.y:2522 { yyVAL.node = yyDollar[1].node @@ -4933,7 +4931,7 @@ yydefault: } case 255: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2536 + //line php7/php7.y:2534 { yyVAL.node = stmt.NewTraitUsePrecedence(yyDollar[1].node, yyDollar[3].list) @@ -4947,7 +4945,7 @@ yydefault: } case 256: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2551 + //line php7/php7.y:2549 { alias := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, nil, alias) @@ -4964,7 +4962,7 @@ yydefault: } case 257: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2566 + //line php7/php7.y:2564 { alias := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, nil, alias) @@ -4981,7 +4979,7 @@ yydefault: } case 258: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2581 + //line php7/php7.y:2579 { alias := node.NewIdentifier(yyDollar[4].token.Value) yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, yyDollar[3].node, alias) @@ -4998,7 +4996,7 @@ yydefault: } case 259: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2596 + //line php7/php7.y:2594 { yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, yyDollar[3].node, nil) @@ -5012,7 +5010,7 @@ yydefault: } case 260: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2611 + //line php7/php7.y:2609 { name := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewTraitMethodRef(nil, name) @@ -5028,7 +5026,7 @@ yydefault: } case 261: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2625 + //line php7/php7.y:2623 { yyVAL.node = yyDollar[1].node @@ -5036,7 +5034,7 @@ yydefault: } case 262: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2634 + //line php7/php7.y:2632 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewTraitMethodRef(yyDollar[1].node, target) @@ -5053,7 +5051,7 @@ yydefault: } case 263: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2652 + //line php7/php7.y:2650 { yyVAL.node = stmt.NewNop() @@ -5067,7 +5065,7 @@ yydefault: } case 264: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2664 + //line php7/php7.y:2662 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) @@ -5082,7 +5080,7 @@ yydefault: } case 265: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2680 + //line php7/php7.y:2678 { yyVAL.list = yyDollar[1].list @@ -5090,7 +5088,7 @@ yydefault: } case 266: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2686 + //line php7/php7.y:2684 { modifier := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.list = []node.Node{modifier} @@ -5105,7 +5103,7 @@ yydefault: } case 267: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:2702 + //line php7/php7.y:2700 { yyVAL.list = nil @@ -5113,7 +5111,7 @@ yydefault: } case 268: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2708 + //line php7/php7.y:2706 { yyVAL.list = yyDollar[1].list @@ -5121,7 +5119,7 @@ yydefault: } case 269: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2717 + //line php7/php7.y:2715 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -5129,7 +5127,7 @@ yydefault: } case 270: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2723 + //line php7/php7.y:2721 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -5137,7 +5135,7 @@ yydefault: } case 271: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2732 + //line php7/php7.y:2730 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5151,7 +5149,7 @@ yydefault: } case 272: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2744 + //line php7/php7.y:2742 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5165,7 +5163,7 @@ yydefault: } case 273: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2756 + //line php7/php7.y:2754 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5179,7 +5177,7 @@ yydefault: } case 274: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2768 + //line php7/php7.y:2766 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5193,7 +5191,7 @@ yydefault: } case 275: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2780 + //line php7/php7.y:2778 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5207,7 +5205,7 @@ yydefault: } case 276: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2792 + //line php7/php7.y:2790 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5221,7 +5219,7 @@ yydefault: } case 277: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2807 + //line php7/php7.y:2805 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -5232,7 +5230,7 @@ yydefault: } case 278: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2816 + //line php7/php7.y:2814 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -5240,7 +5238,7 @@ yydefault: } case 279: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2825 + //line php7/php7.y:2823 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -5258,7 +5256,7 @@ yydefault: } case 280: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2841 + //line php7/php7.y:2839 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -5277,7 +5275,7 @@ yydefault: } case 281: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2861 + //line php7/php7.y:2859 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -5288,7 +5286,7 @@ yydefault: } case 282: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2870 + //line php7/php7.y:2868 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -5296,7 +5294,7 @@ yydefault: } case 283: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2879 + //line php7/php7.y:2877 { name := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewConstant(name, yyDollar[3].node, yyDollar[4].str) @@ -5313,7 +5311,7 @@ yydefault: } case 284: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2897 + //line php7/php7.y:2895 { name := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewConstant(name, yyDollar[3].node, yyDollar[4].str) @@ -5330,7 +5328,7 @@ yydefault: } case 285: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2915 + //line php7/php7.y:2913 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -5341,7 +5339,7 @@ yydefault: } case 286: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2924 + //line php7/php7.y:2922 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -5349,7 +5347,7 @@ yydefault: } case 287: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2933 + //line php7/php7.y:2931 { yyVAL.node = yyDollar[1].node @@ -5357,7 +5355,7 @@ yydefault: } case 288: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:2942 + //line php7/php7.y:2940 { yyVAL.list = nil @@ -5365,7 +5363,7 @@ yydefault: } case 289: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2948 + //line php7/php7.y:2946 { yyVAL.list = yyDollar[1].list @@ -5373,7 +5371,7 @@ yydefault: } case 290: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2957 + //line php7/php7.y:2955 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -5384,7 +5382,7 @@ yydefault: } case 291: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2966 + //line php7/php7.y:2964 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -5392,7 +5390,7 @@ yydefault: } case 292: yyDollar = yyS[yypt-8 : yypt+1] - //line php7/php7.y:2975 + //line php7/php7.y:2973 { if yyDollar[2].node != nil { yyVAL.node = stmt.NewClass(nil, nil, yyDollar[2].node.(*node.ArgumentList), yyDollar[3].ClassExtends, yyDollar[4].ClassImplements, yyDollar[7].list, yyDollar[5].str) @@ -5412,7 +5410,7 @@ yydefault: } case 293: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2996 + //line php7/php7.y:2994 { if yyDollar[3].node != nil { yyVAL.node = expr.NewNew(yyDollar[2].node, yyDollar[3].node.(*node.ArgumentList)) @@ -5429,7 +5427,7 @@ yydefault: } case 294: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3011 + //line php7/php7.y:3009 { yyVAL.node = expr.NewNew(yyDollar[2].node, nil) @@ -5443,7 +5441,7 @@ yydefault: } case 295: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:3026 + //line php7/php7.y:3024 { list := expr.NewList(yyDollar[3].list) yyVAL.node = assign.NewAssign(list, yyDollar[6].node) @@ -5462,7 +5460,7 @@ yydefault: } case 296: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:3043 + //line php7/php7.y:3041 { shortList := expr.NewShortList(yyDollar[2].list) yyVAL.node = assign.NewAssign(shortList, yyDollar[5].node) @@ -5480,7 +5478,7 @@ yydefault: } case 297: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3059 + //line php7/php7.y:3057 { yyVAL.node = assign.NewAssign(yyDollar[1].node, yyDollar[3].node) @@ -5494,7 +5492,7 @@ yydefault: } case 298: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3071 + //line php7/php7.y:3069 { yyVAL.node = assign.NewReference(yyDollar[1].node, yyDollar[4].node) @@ -5509,7 +5507,7 @@ yydefault: } case 299: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3084 + //line php7/php7.y:3082 { yyVAL.node = expr.NewClone(yyDollar[2].node) @@ -5523,7 +5521,7 @@ yydefault: } case 300: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3096 + //line php7/php7.y:3094 { yyVAL.node = assign.NewPlus(yyDollar[1].node, yyDollar[3].node) @@ -5537,7 +5535,7 @@ yydefault: } case 301: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3108 + //line php7/php7.y:3106 { yyVAL.node = assign.NewMinus(yyDollar[1].node, yyDollar[3].node) @@ -5551,7 +5549,7 @@ yydefault: } case 302: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3120 + //line php7/php7.y:3118 { yyVAL.node = assign.NewMul(yyDollar[1].node, yyDollar[3].node) @@ -5565,7 +5563,7 @@ yydefault: } case 303: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3132 + //line php7/php7.y:3130 { yyVAL.node = assign.NewPow(yyDollar[1].node, yyDollar[3].node) @@ -5579,7 +5577,7 @@ yydefault: } case 304: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3144 + //line php7/php7.y:3142 { yyVAL.node = assign.NewDiv(yyDollar[1].node, yyDollar[3].node) @@ -5593,7 +5591,7 @@ yydefault: } case 305: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3156 + //line php7/php7.y:3154 { yyVAL.node = assign.NewConcat(yyDollar[1].node, yyDollar[3].node) @@ -5607,7 +5605,7 @@ yydefault: } case 306: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3168 + //line php7/php7.y:3166 { yyVAL.node = assign.NewMod(yyDollar[1].node, yyDollar[3].node) @@ -5621,7 +5619,7 @@ yydefault: } case 307: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3180 + //line php7/php7.y:3178 { yyVAL.node = assign.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) @@ -5635,7 +5633,7 @@ yydefault: } case 308: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3192 + //line php7/php7.y:3190 { yyVAL.node = assign.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) @@ -5649,7 +5647,7 @@ yydefault: } case 309: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3204 + //line php7/php7.y:3202 { yyVAL.node = assign.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) @@ -5663,7 +5661,7 @@ yydefault: } case 310: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3216 + //line php7/php7.y:3214 { yyVAL.node = assign.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) @@ -5677,7 +5675,7 @@ yydefault: } case 311: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3228 + //line php7/php7.y:3226 { yyVAL.node = assign.NewShiftRight(yyDollar[1].node, yyDollar[3].node) @@ -5691,7 +5689,7 @@ yydefault: } case 312: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3240 + //line php7/php7.y:3238 { yyVAL.node = expr.NewPostInc(yyDollar[1].node) @@ -5705,7 +5703,7 @@ yydefault: } case 313: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3252 + //line php7/php7.y:3250 { yyVAL.node = expr.NewPreInc(yyDollar[2].node) @@ -5719,7 +5717,7 @@ yydefault: } case 314: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3264 + //line php7/php7.y:3262 { yyVAL.node = expr.NewPostDec(yyDollar[1].node) @@ -5733,7 +5731,7 @@ yydefault: } case 315: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3276 + //line php7/php7.y:3274 { yyVAL.node = expr.NewPreDec(yyDollar[2].node) @@ -5747,7 +5745,7 @@ yydefault: } case 316: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3288 + //line php7/php7.y:3286 { yyVAL.node = binary.NewBooleanOr(yyDollar[1].node, yyDollar[3].node) @@ -5761,7 +5759,7 @@ yydefault: } case 317: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3300 + //line php7/php7.y:3298 { yyVAL.node = binary.NewBooleanAnd(yyDollar[1].node, yyDollar[3].node) @@ -5775,7 +5773,7 @@ yydefault: } case 318: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3312 + //line php7/php7.y:3310 { yyVAL.node = binary.NewLogicalOr(yyDollar[1].node, yyDollar[3].node) @@ -5789,7 +5787,7 @@ yydefault: } case 319: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3324 + //line php7/php7.y:3322 { yyVAL.node = binary.NewLogicalAnd(yyDollar[1].node, yyDollar[3].node) @@ -5803,7 +5801,7 @@ yydefault: } case 320: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3336 + //line php7/php7.y:3334 { yyVAL.node = binary.NewLogicalXor(yyDollar[1].node, yyDollar[3].node) @@ -5817,7 +5815,7 @@ yydefault: } case 321: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3348 + //line php7/php7.y:3346 { yyVAL.node = binary.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) @@ -5831,7 +5829,7 @@ yydefault: } case 322: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3360 + //line php7/php7.y:3358 { yyVAL.node = binary.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) @@ -5845,7 +5843,7 @@ yydefault: } case 323: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3372 + //line php7/php7.y:3370 { yyVAL.node = binary.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) @@ -5859,7 +5857,7 @@ yydefault: } case 324: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3384 + //line php7/php7.y:3382 { yyVAL.node = binary.NewConcat(yyDollar[1].node, yyDollar[3].node) @@ -5873,7 +5871,7 @@ yydefault: } case 325: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3396 + //line php7/php7.y:3394 { yyVAL.node = binary.NewPlus(yyDollar[1].node, yyDollar[3].node) @@ -5887,7 +5885,7 @@ yydefault: } case 326: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3408 + //line php7/php7.y:3406 { yyVAL.node = binary.NewMinus(yyDollar[1].node, yyDollar[3].node) @@ -5901,7 +5899,7 @@ yydefault: } case 327: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3420 + //line php7/php7.y:3418 { yyVAL.node = binary.NewMul(yyDollar[1].node, yyDollar[3].node) @@ -5915,7 +5913,7 @@ yydefault: } case 328: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3432 + //line php7/php7.y:3430 { yyVAL.node = binary.NewPow(yyDollar[1].node, yyDollar[3].node) @@ -5929,7 +5927,7 @@ yydefault: } case 329: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3444 + //line php7/php7.y:3442 { yyVAL.node = binary.NewDiv(yyDollar[1].node, yyDollar[3].node) @@ -5943,7 +5941,7 @@ yydefault: } case 330: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3456 + //line php7/php7.y:3454 { yyVAL.node = binary.NewMod(yyDollar[1].node, yyDollar[3].node) @@ -5957,7 +5955,7 @@ yydefault: } case 331: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3468 + //line php7/php7.y:3466 { yyVAL.node = binary.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) @@ -5971,7 +5969,7 @@ yydefault: } case 332: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3480 + //line php7/php7.y:3478 { yyVAL.node = binary.NewShiftRight(yyDollar[1].node, yyDollar[3].node) @@ -5985,7 +5983,7 @@ yydefault: } case 333: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3492 + //line php7/php7.y:3490 { yyVAL.node = expr.NewUnaryPlus(yyDollar[2].node) @@ -5999,7 +5997,7 @@ yydefault: } case 334: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3504 + //line php7/php7.y:3502 { yyVAL.node = expr.NewUnaryMinus(yyDollar[2].node) @@ -6013,7 +6011,7 @@ yydefault: } case 335: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3516 + //line php7/php7.y:3514 { yyVAL.node = expr.NewBooleanNot(yyDollar[2].node) @@ -6027,7 +6025,7 @@ yydefault: } case 336: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3528 + //line php7/php7.y:3526 { yyVAL.node = expr.NewBitwiseNot(yyDollar[2].node) @@ -6041,7 +6039,7 @@ yydefault: } case 337: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3540 + //line php7/php7.y:3538 { yyVAL.node = binary.NewIdentical(yyDollar[1].node, yyDollar[3].node) @@ -6055,7 +6053,7 @@ yydefault: } case 338: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3552 + //line php7/php7.y:3550 { yyVAL.node = binary.NewNotIdentical(yyDollar[1].node, yyDollar[3].node) @@ -6069,7 +6067,7 @@ yydefault: } case 339: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3564 + //line php7/php7.y:3562 { yyVAL.node = binary.NewEqual(yyDollar[1].node, yyDollar[3].node) @@ -6083,7 +6081,7 @@ yydefault: } case 340: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3576 + //line php7/php7.y:3574 { yyVAL.node = binary.NewNotEqual(yyDollar[1].node, yyDollar[3].node) @@ -6097,7 +6095,7 @@ yydefault: } case 341: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3588 + //line php7/php7.y:3586 { yyVAL.node = binary.NewSmaller(yyDollar[1].node, yyDollar[3].node) @@ -6111,7 +6109,7 @@ yydefault: } case 342: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3600 + //line php7/php7.y:3598 { yyVAL.node = binary.NewSmallerOrEqual(yyDollar[1].node, yyDollar[3].node) @@ -6125,7 +6123,7 @@ yydefault: } case 343: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3612 + //line php7/php7.y:3610 { yyVAL.node = binary.NewGreater(yyDollar[1].node, yyDollar[3].node) @@ -6139,7 +6137,7 @@ yydefault: } case 344: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3624 + //line php7/php7.y:3622 { yyVAL.node = binary.NewGreaterOrEqual(yyDollar[1].node, yyDollar[3].node) @@ -6153,7 +6151,7 @@ yydefault: } case 345: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3636 + //line php7/php7.y:3634 { yyVAL.node = binary.NewSpaceship(yyDollar[1].node, yyDollar[3].node) @@ -6167,7 +6165,7 @@ yydefault: } case 346: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3648 + //line php7/php7.y:3646 { yyVAL.node = expr.NewInstanceOf(yyDollar[1].node, yyDollar[3].node) @@ -6181,7 +6179,7 @@ yydefault: } case 347: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3660 + //line php7/php7.y:3658 { yyVAL.node = yyDollar[2].node @@ -6193,7 +6191,7 @@ yydefault: } case 348: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3670 + //line php7/php7.y:3668 { yyVAL.node = yyDollar[1].node @@ -6201,7 +6199,7 @@ yydefault: } case 349: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:3676 + //line php7/php7.y:3674 { yyVAL.node = expr.NewTernary(yyDollar[1].node, yyDollar[3].node, yyDollar[5].node) @@ -6216,7 +6214,7 @@ yydefault: } case 350: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3689 + //line php7/php7.y:3687 { yyVAL.node = expr.NewTernary(yyDollar[1].node, nil, yyDollar[4].node) @@ -6231,7 +6229,7 @@ yydefault: } case 351: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3702 + //line php7/php7.y:3700 { yyVAL.node = binary.NewCoalesce(yyDollar[1].node, yyDollar[3].node) @@ -6245,7 +6243,7 @@ yydefault: } case 352: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3714 + //line php7/php7.y:3712 { yyVAL.node = yyDollar[1].node @@ -6253,7 +6251,7 @@ yydefault: } case 353: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3720 + //line php7/php7.y:3718 { yyVAL.node = cast.NewInt(yyDollar[2].node) @@ -6267,7 +6265,7 @@ yydefault: } case 354: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3732 + //line php7/php7.y:3730 { yyVAL.node = cast.NewDouble(yyDollar[2].node) @@ -6281,7 +6279,7 @@ yydefault: } case 355: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3744 + //line php7/php7.y:3742 { yyVAL.node = cast.NewString(yyDollar[2].node) @@ -6295,7 +6293,7 @@ yydefault: } case 356: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3756 + //line php7/php7.y:3754 { yyVAL.node = cast.NewArray(yyDollar[2].node) @@ -6309,7 +6307,7 @@ yydefault: } case 357: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3768 + //line php7/php7.y:3766 { yyVAL.node = cast.NewObject(yyDollar[2].node) @@ -6323,7 +6321,7 @@ yydefault: } case 358: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3780 + //line php7/php7.y:3778 { yyVAL.node = cast.NewBool(yyDollar[2].node) @@ -6337,7 +6335,7 @@ yydefault: } case 359: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3792 + //line php7/php7.y:3790 { yyVAL.node = cast.NewUnset(yyDollar[2].node) @@ -6351,7 +6349,7 @@ yydefault: } case 360: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3804 + //line php7/php7.y:3802 { var e *expr.Exit if yyDollar[2].node != nil { @@ -6380,7 +6378,7 @@ yydefault: } case 361: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3831 + //line php7/php7.y:3829 { yyVAL.node = expr.NewErrorSuppress(yyDollar[2].node) @@ -6394,7 +6392,7 @@ yydefault: } case 362: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3843 + //line php7/php7.y:3841 { yyVAL.node = yyDollar[1].node @@ -6402,7 +6400,7 @@ yydefault: } case 363: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3849 + //line php7/php7.y:3847 { yyVAL.node = expr.NewShellExec(yyDollar[2].list) @@ -6417,7 +6415,7 @@ yydefault: } case 364: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3862 + //line php7/php7.y:3860 { yyVAL.node = expr.NewPrint(yyDollar[2].node) @@ -6431,7 +6429,7 @@ yydefault: } case 365: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3874 + //line php7/php7.y:3872 { yyVAL.node = expr.NewYield(nil, nil) @@ -6445,7 +6443,7 @@ yydefault: } case 366: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3886 + //line php7/php7.y:3884 { yyVAL.node = expr.NewYield(nil, yyDollar[2].node) @@ -6459,7 +6457,7 @@ yydefault: } case 367: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3898 + //line php7/php7.y:3896 { yyVAL.node = expr.NewYield(yyDollar[2].node, yyDollar[4].node) @@ -6474,7 +6472,7 @@ yydefault: } case 368: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3911 + //line php7/php7.y:3909 { yyVAL.node = expr.NewYieldFrom(yyDollar[2].node) @@ -6488,7 +6486,7 @@ yydefault: } case 369: yyDollar = yyS[yypt-11 : yypt+1] - //line php7/php7.y:3923 + //line php7/php7.y:3921 { yyVAL.node = expr.NewClosure(yyDollar[5].list, yyDollar[7].ClosureUse, yyDollar[8].node, yyDollar[10].list, false, yyDollar[2].token != nil, yyDollar[3].str) @@ -6509,7 +6507,7 @@ yydefault: } case 370: yyDollar = yyS[yypt-12 : yypt+1] - //line php7/php7.y:3942 + //line php7/php7.y:3940 { yyVAL.node = expr.NewClosure(yyDollar[6].list, yyDollar[8].ClosureUse, yyDollar[9].node, yyDollar[11].list, true, yyDollar[3].token != nil, yyDollar[4].str) @@ -6531,7 +6529,7 @@ yydefault: } case 371: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3965 + //line php7/php7.y:3963 { yyVAL.str = yylex.(*Parser).PhpDocComment yylex.(*Parser).PhpDocComment = "" @@ -6540,19 +6538,19 @@ yydefault: } case 372: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3975 + //line php7/php7.y:3973 { yyVAL.token = nil } case 373: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3979 + //line php7/php7.y:3977 { yyVAL.token = yyDollar[1].token } case 374: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3986 + //line php7/php7.y:3984 { yyVAL.ClosureUse = nil @@ -6560,7 +6558,7 @@ yydefault: } case 375: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3992 + //line php7/php7.y:3990 { yyVAL.ClosureUse = expr.NewClosureUse(yyDollar[3].list) @@ -6576,7 +6574,7 @@ yydefault: } case 376: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4009 + //line php7/php7.y:4007 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -6587,7 +6585,7 @@ yydefault: } case 377: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4018 + //line php7/php7.y:4016 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -6595,7 +6593,7 @@ yydefault: } case 378: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4027 + //line php7/php7.y:4025 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(identifier) @@ -6611,7 +6609,7 @@ yydefault: } case 379: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4041 + //line php7/php7.y:4039 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[2].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -6630,7 +6628,7 @@ yydefault: } case 380: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4061 + //line php7/php7.y:4059 { yyVAL.node = expr.NewFunctionCall(yyDollar[1].node, yyDollar[2].node.(*node.ArgumentList)) @@ -6641,7 +6639,7 @@ yydefault: } case 381: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4070 + //line php7/php7.y:4068 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -6655,7 +6653,7 @@ yydefault: } case 382: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4082 + //line php7/php7.y:4080 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -6669,7 +6667,7 @@ yydefault: } case 383: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4094 + //line php7/php7.y:4092 { yyVAL.node = expr.NewFunctionCall(yyDollar[1].node, yyDollar[2].node.(*node.ArgumentList)) @@ -6680,7 +6678,7 @@ yydefault: } case 384: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4106 + //line php7/php7.y:4104 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -6694,7 +6692,7 @@ yydefault: } case 385: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4118 + //line php7/php7.y:4116 { yyVAL.node = yyDollar[1].node @@ -6702,7 +6700,7 @@ yydefault: } case 386: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4127 + //line php7/php7.y:4125 { yyVAL.node = yyDollar[1].node @@ -6710,7 +6708,7 @@ yydefault: } case 387: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4133 + //line php7/php7.y:4131 { yyVAL.node = yyDollar[1].node @@ -6718,7 +6716,7 @@ yydefault: } case 388: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4142 + //line php7/php7.y:4140 { yyVAL.node = nil @@ -6726,7 +6724,7 @@ yydefault: } case 389: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4148 + //line php7/php7.y:4146 { yyVAL.node = expr.NewExit(yyDollar[2].node) @@ -6741,7 +6739,7 @@ yydefault: } case 390: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4164 + //line php7/php7.y:4162 { yyVAL.list = []node.Node{} @@ -6749,7 +6747,7 @@ yydefault: } case 391: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4170 + //line php7/php7.y:4168 { yyVAL.list = []node.Node{scalar.NewEncapsedStringPart(yyDollar[1].token.Value)} @@ -6757,7 +6755,7 @@ yydefault: } case 392: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4176 + //line php7/php7.y:4174 { yyVAL.list = yyDollar[1].list @@ -6765,7 +6763,7 @@ yydefault: } case 393: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4185 + //line php7/php7.y:4183 { yyVAL.node = nil @@ -6773,7 +6771,7 @@ yydefault: } case 394: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4191 + //line php7/php7.y:4189 { yyVAL.node = yyDollar[1].node @@ -6781,7 +6779,7 @@ yydefault: } case 395: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4200 + //line php7/php7.y:4198 { yyVAL.node = expr.NewArray(yyDollar[3].list) @@ -6797,7 +6795,7 @@ yydefault: } case 396: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4214 + //line php7/php7.y:4212 { yyVAL.node = expr.NewShortArray(yyDollar[2].list) @@ -6812,7 +6810,7 @@ yydefault: } case 397: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4227 + //line php7/php7.y:4225 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) @@ -6826,7 +6824,7 @@ yydefault: } case 398: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4242 + //line php7/php7.y:4240 { yyVAL.node = scalar.NewLnumber(yyDollar[1].token.Value) @@ -6840,7 +6838,7 @@ yydefault: } case 399: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4254 + //line php7/php7.y:4252 { yyVAL.node = scalar.NewDnumber(yyDollar[1].token.Value) @@ -6854,7 +6852,7 @@ yydefault: } case 400: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4266 + //line php7/php7.y:4264 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6868,7 +6866,7 @@ yydefault: } case 401: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4278 + //line php7/php7.y:4276 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6882,7 +6880,7 @@ yydefault: } case 402: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4290 + //line php7/php7.y:4288 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6896,7 +6894,7 @@ yydefault: } case 403: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4302 + //line php7/php7.y:4300 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6910,7 +6908,7 @@ yydefault: } case 404: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4314 + //line php7/php7.y:4312 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6924,7 +6922,7 @@ yydefault: } case 405: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4326 + //line php7/php7.y:4324 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6938,7 +6936,7 @@ yydefault: } case 406: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4338 + //line php7/php7.y:4336 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6952,7 +6950,7 @@ yydefault: } case 407: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4350 + //line php7/php7.y:4348 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6966,7 +6964,7 @@ yydefault: } case 408: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4362 + //line php7/php7.y:4360 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, []node.Node{encapsed}) @@ -6982,7 +6980,7 @@ yydefault: } case 409: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4376 + //line php7/php7.y:4374 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, nil) @@ -6996,7 +6994,7 @@ yydefault: } case 410: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4388 + //line php7/php7.y:4386 { yyVAL.node = scalar.NewEncapsed(yyDollar[2].list) @@ -7010,7 +7008,7 @@ yydefault: } case 411: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4400 + //line php7/php7.y:4398 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, yyDollar[2].list) @@ -7024,7 +7022,7 @@ yydefault: } case 412: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4412 + //line php7/php7.y:4410 { yyVAL.node = yyDollar[1].node @@ -7032,7 +7030,7 @@ yydefault: } case 413: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4418 + //line php7/php7.y:4416 { yyVAL.node = yyDollar[1].node @@ -7040,7 +7038,7 @@ yydefault: } case 414: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4427 + //line php7/php7.y:4425 { yyVAL.node = expr.NewConstFetch(yyDollar[1].node) @@ -7051,7 +7049,7 @@ yydefault: } case 415: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4436 + //line php7/php7.y:4434 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -7068,7 +7066,7 @@ yydefault: } case 416: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4451 + //line php7/php7.y:4449 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -7085,7 +7083,7 @@ yydefault: } case 417: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4469 + //line php7/php7.y:4467 { yyVAL.node = yyDollar[1].node @@ -7093,7 +7091,7 @@ yydefault: } case 418: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4475 + //line php7/php7.y:4473 { yyVAL.node = yyDollar[1].node @@ -7101,7 +7099,7 @@ yydefault: } case 419: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4484 + //line php7/php7.y:4482 { yyVAL.node = nil @@ -7109,7 +7107,7 @@ yydefault: } case 420: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4490 + //line php7/php7.y:4488 { yyVAL.node = yyDollar[1].node @@ -7117,7 +7115,7 @@ yydefault: } case 421: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4499 + //line php7/php7.y:4497 { yyVAL.node = yyDollar[1].node @@ -7125,7 +7123,7 @@ yydefault: } case 422: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4508 + //line php7/php7.y:4506 { yyVAL.node = yyDollar[1].node @@ -7133,7 +7131,7 @@ yydefault: } case 423: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4514 + //line php7/php7.y:4512 { yyVAL.node = yyDollar[2].node @@ -7145,7 +7143,7 @@ yydefault: } case 424: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4524 + //line php7/php7.y:4522 { yyVAL.node = yyDollar[1].node @@ -7153,7 +7151,7 @@ yydefault: } case 425: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4533 + //line php7/php7.y:4531 { yyVAL.node = yyDollar[1].node @@ -7161,7 +7159,7 @@ yydefault: } case 426: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4539 + //line php7/php7.y:4537 { yyVAL.node = yyDollar[2].node @@ -7173,7 +7171,7 @@ yydefault: } case 427: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4549 + //line php7/php7.y:4547 { yyVAL.node = yyDollar[1].node @@ -7181,7 +7179,7 @@ yydefault: } case 428: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4558 + //line php7/php7.y:4556 { yyVAL.node = yyDollar[1].node @@ -7189,7 +7187,7 @@ yydefault: } case 429: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4564 + //line php7/php7.y:4562 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -7204,7 +7202,7 @@ yydefault: } case 430: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4577 + //line php7/php7.y:4575 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -7219,7 +7217,7 @@ yydefault: } case 431: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4590 + //line php7/php7.y:4588 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -7234,7 +7232,7 @@ yydefault: } case 432: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4603 + //line php7/php7.y:4601 { yyVAL.node = expr.NewMethodCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -7248,7 +7246,7 @@ yydefault: } case 433: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4615 + //line php7/php7.y:4613 { yyVAL.node = yyDollar[1].node @@ -7256,7 +7254,7 @@ yydefault: } case 434: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4624 + //line php7/php7.y:4622 { yyVAL.node = yyDollar[1].node @@ -7264,7 +7262,7 @@ yydefault: } case 435: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4630 + //line php7/php7.y:4628 { yyVAL.node = yyDollar[1].node @@ -7272,7 +7270,7 @@ yydefault: } case 436: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4636 + //line php7/php7.y:4634 { yyVAL.node = expr.NewPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -7286,7 +7284,7 @@ yydefault: } case 437: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4651 + //line php7/php7.y:4649 { name := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(name) @@ -7302,7 +7300,7 @@ yydefault: } case 438: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4665 + //line php7/php7.y:4663 { yyVAL.node = expr.NewVariable(yyDollar[3].node) @@ -7318,7 +7316,7 @@ yydefault: } case 439: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4679 + //line php7/php7.y:4677 { yyVAL.node = expr.NewVariable(yyDollar[2].node) @@ -7332,7 +7330,7 @@ yydefault: } case 440: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4694 + //line php7/php7.y:4692 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -7346,7 +7344,7 @@ yydefault: } case 441: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4706 + //line php7/php7.y:4704 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -7360,7 +7358,7 @@ yydefault: } case 442: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4721 + //line php7/php7.y:4719 { yyVAL.node = yyDollar[1].node @@ -7368,7 +7366,7 @@ yydefault: } case 443: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4727 + //line php7/php7.y:4725 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -7383,7 +7381,7 @@ yydefault: } case 444: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4740 + //line php7/php7.y:4738 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -7398,7 +7396,7 @@ yydefault: } case 445: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4753 + //line php7/php7.y:4751 { yyVAL.node = expr.NewPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -7412,7 +7410,7 @@ yydefault: } case 446: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4765 + //line php7/php7.y:4763 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -7426,7 +7424,7 @@ yydefault: } case 447: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4777 + //line php7/php7.y:4775 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -7440,7 +7438,7 @@ yydefault: } case 448: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4792 + //line php7/php7.y:4790 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -7454,7 +7452,7 @@ yydefault: } case 449: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4804 + //line php7/php7.y:4802 { yyVAL.node = yyDollar[2].node @@ -7466,7 +7464,7 @@ yydefault: } case 450: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4814 + //line php7/php7.y:4812 { yyVAL.node = yyDollar[1].node @@ -7474,7 +7472,7 @@ yydefault: } case 451: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4823 + //line php7/php7.y:4821 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -7482,14 +7480,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - spew.Dump(yyDollar[1].token.Meta) addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 452: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4836 + //line php7/php7.y:4833 { yyVAL.node = yyDollar[2].node @@ -7501,7 +7498,7 @@ yydefault: } case 453: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4846 + //line php7/php7.y:4843 { yyVAL.node = yyDollar[1].node @@ -7509,7 +7506,7 @@ yydefault: } case 454: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4855 + //line php7/php7.y:4852 { yyVAL.list = yyDollar[1].list @@ -7517,7 +7514,7 @@ yydefault: } case 455: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4864 + //line php7/php7.y:4861 { yyVAL.node = expr.NewArrayItem(nil, nil) @@ -7525,7 +7522,7 @@ yydefault: } case 456: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4870 + //line php7/php7.y:4867 { yyVAL.node = yyDollar[1].node @@ -7533,7 +7530,7 @@ yydefault: } case 457: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4879 + //line php7/php7.y:4876 { if len(yyDollar[1].list) == 0 { yyDollar[1].list = []node.Node{expr.NewArrayItem(nil, nil)} @@ -7548,7 +7545,7 @@ yydefault: } case 458: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4892 + //line php7/php7.y:4889 { if yyDollar[1].node.(*expr.ArrayItem).Key == nil && yyDollar[1].node.(*expr.ArrayItem).Val == nil { yyVAL.list = []node.Node{} @@ -7560,7 +7557,7 @@ yydefault: } case 459: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4905 + //line php7/php7.y:4902 { yyVAL.node = expr.NewArrayItem(yyDollar[1].node, yyDollar[3].node) @@ -7574,7 +7571,7 @@ yydefault: } case 460: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4917 + //line php7/php7.y:4914 { yyVAL.node = expr.NewArrayItem(nil, yyDollar[1].node) @@ -7585,7 +7582,7 @@ yydefault: } case 461: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4926 + //line php7/php7.y:4923 { reference := expr.NewReference(yyDollar[4].node) yyVAL.node = expr.NewArrayItem(yyDollar[1].node, reference) @@ -7602,7 +7599,7 @@ yydefault: } case 462: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4941 + //line php7/php7.y:4938 { reference := expr.NewReference(yyDollar[2].node) yyVAL.node = expr.NewArrayItem(nil, reference) @@ -7618,7 +7615,7 @@ yydefault: } case 463: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:4955 + //line php7/php7.y:4952 { // TODO: Cannot use list() as standalone expression list := expr.NewList(yyDollar[5].list) @@ -7638,7 +7635,7 @@ yydefault: } case 464: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4973 + //line php7/php7.y:4970 { // TODO: Cannot use list() as standalone expression list := expr.NewList(yyDollar[3].list) @@ -7657,7 +7654,7 @@ yydefault: } case 465: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4993 + //line php7/php7.y:4990 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -7665,7 +7662,7 @@ yydefault: } case 466: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4999 + //line php7/php7.y:4996 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yyVAL.list = append(yyDollar[1].list, encapsed) @@ -7680,7 +7677,7 @@ yydefault: } case 467: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5012 + //line php7/php7.y:5009 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -7688,7 +7685,7 @@ yydefault: } case 468: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5018 + //line php7/php7.y:5015 { encapsed := scalar.NewEncapsedStringPart(yyDollar[1].token.Value) yyVAL.list = []node.Node{encapsed, yyDollar[2].node} @@ -7703,7 +7700,7 @@ yydefault: } case 469: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5034 + //line php7/php7.y:5031 { name := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(name) @@ -7719,7 +7716,7 @@ yydefault: } case 470: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:5048 + //line php7/php7.y:5045 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -7739,7 +7736,7 @@ yydefault: } case 471: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5066 + //line php7/php7.y:5063 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -7761,7 +7758,7 @@ yydefault: } case 472: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5086 + //line php7/php7.y:5083 { yyVAL.node = expr.NewVariable(yyDollar[2].node) @@ -7776,7 +7773,7 @@ yydefault: } case 473: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5099 + //line php7/php7.y:5096 { name := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = expr.NewVariable(name) @@ -7794,7 +7791,7 @@ yydefault: } case 474: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:5115 + //line php7/php7.y:5112 { identifier := node.NewIdentifier(yyDollar[2].token.Value) variable := expr.NewVariable(identifier) @@ -7816,7 +7813,7 @@ yydefault: } case 475: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5135 + //line php7/php7.y:5132 { yyVAL.node = yyDollar[2].node @@ -7824,7 +7821,7 @@ yydefault: } case 476: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5144 + //line php7/php7.y:5141 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) @@ -7838,7 +7835,7 @@ yydefault: } case 477: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5156 + //line php7/php7.y:5153 { // TODO: add option to handle 64 bit integer if _, err := strconv.Atoi(yyDollar[1].token.Value); err == nil { @@ -7857,7 +7854,7 @@ yydefault: } case 478: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5173 + //line php7/php7.y:5170 { var lnumber *scalar.Lnumber // TODO: add option to handle 64 bit integer @@ -7890,7 +7887,7 @@ yydefault: } case 479: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5204 + //line php7/php7.y:5201 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(identifier) @@ -7906,7 +7903,7 @@ yydefault: } case 480: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:5221 + //line php7/php7.y:5218 { yyVAL.node = expr.NewIsset(yyDollar[3].list) @@ -7925,7 +7922,7 @@ yydefault: } case 481: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:5238 + //line php7/php7.y:5235 { yyVAL.node = expr.NewEmpty(yyDollar[3].node) @@ -7941,7 +7938,7 @@ yydefault: } case 482: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5252 + //line php7/php7.y:5249 { yyVAL.node = expr.NewInclude(yyDollar[2].node) @@ -7955,7 +7952,7 @@ yydefault: } case 483: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5264 + //line php7/php7.y:5261 { yyVAL.node = expr.NewIncludeOnce(yyDollar[2].node) @@ -7969,7 +7966,7 @@ yydefault: } case 484: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:5276 + //line php7/php7.y:5273 { yyVAL.node = expr.NewEval(yyDollar[3].node) @@ -7985,7 +7982,7 @@ yydefault: } case 485: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5290 + //line php7/php7.y:5287 { yyVAL.node = expr.NewRequire(yyDollar[2].node) @@ -7999,7 +7996,7 @@ yydefault: } case 486: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5302 + //line php7/php7.y:5299 { yyVAL.node = expr.NewRequireOnce(yyDollar[2].node) @@ -8013,7 +8010,7 @@ yydefault: } case 487: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5317 + //line php7/php7.y:5314 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -8021,7 +8018,7 @@ yydefault: } case 488: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5323 + //line php7/php7.y:5320 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -8032,7 +8029,7 @@ yydefault: } case 489: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5335 + //line php7/php7.y:5332 { yyVAL.node = yyDollar[1].node diff --git a/php7/php7.y b/php7/php7.y index e9ec936..1cc8b95 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -15,8 +15,6 @@ import ( "github.com/z7zmey/php-parser/node/expr/assign" "github.com/z7zmey/php-parser/node/expr/binary" "github.com/z7zmey/php-parser/node/expr/cast" - - "github.com/davecgh/go-spew/spew" ) %} @@ -4827,7 +4825,6 @@ property_name: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - spew.Dump($1.Meta) addMeta($$, $1.Meta, meta.IdentifierToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) From b70fb72a459e7aae1d1f31b00c1e9edc2c6e7cab Mon Sep 17 00:00:00 2001 From: z7zmey Date: Wed, 11 Jul 2018 18:59:04 +0300 Subject: [PATCH 019/117] small improvements --- main.go | 53 ++++++++++++++++++++++++++++++++++------------------- 1 file changed, 34 insertions(+), 19 deletions(-) diff --git a/main.go b/main.go index 25b8977..6ccd7c8 100644 --- a/main.go +++ b/main.go @@ -1,11 +1,15 @@ package main import ( + "bufio" + "bytes" "flag" "fmt" + "io/ioutil" "log" "os" "path/filepath" + "runtime" "sync" "github.com/karrick/godirwalk" @@ -24,6 +28,11 @@ var profiler string var withMeta *bool var showResolvedNs *bool +type file struct { + path string + content []byte +} + func main() { usePhp5 = flag.Bool("php5", false, "parse as PHP5") withMeta = flag.Bool("meta", false, "show meta") @@ -42,27 +51,29 @@ func main() { defer profile.Start(profile.TraceProfile, profile.ProfilePath("."), profile.NoShutdownHook).Stop() } - pathCh := make(chan string) - resultCh := make(chan parser.Parser) + numCpu := runtime.NumCPU() + + fileCh := make(chan *file, numCpu) + resultCh := make(chan parser.Parser, numCpu) // run 4 concurrent parserWorkers - for i := 0; i < 4; i++ { - go parserWorker(pathCh, resultCh) + for i := 0; i < numCpu; i++ { + go parserWorker(fileCh, resultCh) } // run printer goroutine go printer(resultCh) // process files - processPath(flag.Args(), pathCh) + processPath(flag.Args(), fileCh) // wait the all files done wg.Wait() - close(pathCh) + close(fileCh) close(resultCh) } -func processPath(pathList []string, pathCh chan<- string) { +func processPath(pathList []string, fileCh chan<- *file) { for _, path := range pathList { real, err := realpath.Realpath(path) checkErr(err) @@ -72,14 +83,18 @@ func processPath(pathList []string, pathCh chan<- string) { if !s.IsDir() { wg.Add(1) - pathCh <- real + content, err := ioutil.ReadFile(real) + checkErr(err) + fileCh <- &file{real, content} } else { godirwalk.Walk(real, &godirwalk.Options{ Unsorted: true, Callback: func(osPathname string, de *godirwalk.Dirent) error { if !de.IsDir() && filepath.Ext(osPathname) == ".php" { wg.Add(1) - pathCh <- osPathname + content, err := ioutil.ReadFile(osPathname) + checkErr(err) + fileCh <- &file{osPathname, content} } return nil }, @@ -91,22 +106,21 @@ func processPath(pathList []string, pathCh chan<- string) { } } -func parserWorker(pathCh <-chan string, result chan<- parser.Parser) { +func parserWorker(fileCh <-chan *file, result chan<- parser.Parser) { var parserWorker parser.Parser for { - path, ok := <-pathCh + f, ok := <-fileCh if !ok { return } - src, err := os.Open(path) - checkErr(err) + src := bytes.NewReader(f.content) if *usePhp5 { - parserWorker = php5.NewParser(src, path) + parserWorker = php5.NewParser(src, f.path) } else { - parserWorker = php7.NewParser(src, path) + parserWorker = php7.NewParser(src, f.path) } if *withMeta { @@ -115,8 +129,6 @@ func parserWorker(pathCh <-chan string, result chan<- parser.Parser) { parserWorker.Parse() - src.Close() - result <- parserWorker } } @@ -124,18 +136,21 @@ func parserWorker(pathCh <-chan string, result chan<- parser.Parser) { func printer(result <-chan parser.Parser) { var counter int + w := bufio.NewWriter(os.Stdout) + for { parserWorker, ok := <-result if !ok { + w.Flush() return } counter++ - fmt.Printf("==> [%d] %s\n", counter, parserWorker.GetPath()) + fmt.Fprintf(w, "==> [%d] %s\n", counter, parserWorker.GetPath()) for _, e := range parserWorker.GetErrors() { - fmt.Println(e) + fmt.Fprintln(w, e) } var nsResolver *visitor.NamespaceResolver From 4da7b36056848fc5c73f5ce201dbee595d5daba3 Mon Sep 17 00:00:00 2001 From: z7zmey Date: Thu, 12 Jul 2018 10:53:36 +0300 Subject: [PATCH 020/117] created TokenPool --- scanner/lexer.go | 9 +++------ scanner/token_pool.go | 22 ++++++++++++++++++++++ scanner/token_pool_test.go | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 59 insertions(+), 6 deletions(-) create mode 100644 scanner/token_pool.go create mode 100644 scanner/token_pool_test.go diff --git a/scanner/lexer.go b/scanner/lexer.go index 6f02ab1..0c43ec8 100644 --- a/scanner/lexer.go +++ b/scanner/lexer.go @@ -6,7 +6,6 @@ import ( "bytes" t "go/token" "io" - "sync" "unicode" "github.com/z7zmey/php-parser/position" @@ -36,7 +35,7 @@ type Lexer struct { Meta []meta.Meta heredocLabel string tokenBytesBuf *bytes.Buffer - TokenPool sync.Pool + TokenPool *TokenPool WithMeta bool lastToken *Token } @@ -74,9 +73,7 @@ func NewLexer(src io.Reader, fName string) *Lexer { Meta: nil, heredocLabel: "", tokenBytesBuf: &bytes.Buffer{}, - TokenPool: sync.Pool{ - New: func() interface{} { return &Token{} }, - }, + TokenPool: &TokenPool{}, } } @@ -123,7 +120,7 @@ func (l *Lexer) createToken(chars []lex.Char) *Token { firstChar := chars[0] lastChar := chars[len(chars)-1] - token := l.TokenPool.Get().(*Token) + token := l.TokenPool.Get() token.Meta = l.Meta token.Value = l.tokenString(chars) diff --git a/scanner/token_pool.go b/scanner/token_pool.go new file mode 100644 index 0000000..bad7986 --- /dev/null +++ b/scanner/token_pool.go @@ -0,0 +1,22 @@ +package scanner + +// TokenPool light version of sync.Pool for Token objects +type TokenPool struct { + pool []*Token +} + +// Get returns *Token from pool or creates new object +func (tp *TokenPool) Get() *Token { + if len(tp.pool) < 1 { + return new(Token) + } + + t := tp.pool[len(tp.pool)-1] + tp.pool = tp.pool[:len(tp.pool)-1] + return t +} + +// Put returns *Token to pool +func (tp *TokenPool) Put(t *Token) { + tp.pool = append(tp.pool, t) +} diff --git a/scanner/token_pool_test.go b/scanner/token_pool_test.go new file mode 100644 index 0000000..1d92d4f --- /dev/null +++ b/scanner/token_pool_test.go @@ -0,0 +1,34 @@ +package scanner_test + +import ( + "reflect" + "testing" + + "github.com/z7zmey/php-parser/scanner" +) + +func TestTokenPoolGetNew(t *testing.T) { + tp := new(scanner.TokenPool) + + newToken := tp.Get() + + if newToken == nil { + t.Errorf("*TokenPool.Get() must return new *Token object\n") + } +} + +func TestTokenPoolGetFromPool(t *testing.T) { + tp := new(scanner.TokenPool) + + expectedToken := &scanner.Token{ + Value: "test", + } + + tp.Put(expectedToken) + + actualToken := tp.Get() + + if !reflect.DeepEqual(expectedToken, actualToken) { + t.Errorf("*TokenPool.Put() must return *Token object from pool\n") + } +} From 867095823da3b05689a043f22160b515eb356131 Mon Sep 17 00:00:00 2001 From: z7zmey Date: Sat, 14 Jul 2018 18:00:48 +0300 Subject: [PATCH 021/117] fixed bug when heredoc starts by `\`; removing `\n` from a heredoc value end --- node/scalar/t_heredoc_test.go | 26 +- php5/php5_test.go | 21 +- php7/php7_test.go | 21 +- printer/printer.go | 1 + printer/printer_test.go | 4 +- scanner/lexer.go | 2 + scanner/lexer_tokens.go | 5 +- scanner/lexer_tokens_string.go | 17 + scanner/scanner.go | 375 ++++++++-------- scanner/scanner.l | 387 ++++++++-------- scanner/scanner_test.go | 780 +++++++++++++++++---------------- 11 files changed, 848 insertions(+), 791 deletions(-) create mode 100644 scanner/lexer_tokens_string.go diff --git a/node/scalar/t_heredoc_test.go b/node/scalar/t_heredoc_test.go index 47d8bd8..8a56a8d 100644 --- a/node/scalar/t_heredoc_test.go +++ b/node/scalar/t_heredoc_test.go @@ -70,15 +70,6 @@ LBL; Value: "var", }, }, - &scalar.EncapsedStringPart{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 20, - EndPos: 20, - }, - Value: "\n", - }, }, }, }, @@ -152,15 +143,6 @@ LBL; Value: "var", }, }, - &scalar.EncapsedStringPart{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 22, - EndPos: 22, - }, - Value: "\n", - }, }, }, }, @@ -213,9 +195,9 @@ LBL; StartLine: 2, EndLine: 2, StartPos: 13, - EndPos: 22, + EndPos: 21, }, - Value: "test $var\n", + Value: "test $var", }, }, }, @@ -313,9 +295,9 @@ CAD; StartLine: 2, EndLine: 2, StartPos: 11, - EndPos: 17, + EndPos: 16, }, - Value: "\thello\n", + Value: "\thello", }, }, }, diff --git a/php5/php5_test.go b/php5/php5_test.go index c8ba1fe..3e172db 100644 --- a/php5/php5_test.go +++ b/php5/php5_test.go @@ -18597,9 +18597,9 @@ CAD; StartLine: 5, EndLine: 5, StartPos: 27, - EndPos: 33, + EndPos: 32, }, - Value: "\thello\n", + Value: "\thello", }, }, }, @@ -18625,9 +18625,9 @@ CAD; StartLine: 8, EndLine: 8, StartPos: 50, - EndPos: 56, + EndPos: 55, }, - Value: "\thello\n", + Value: "\thello", }, }, }, @@ -18674,15 +18674,6 @@ CAD; Value: "world", }, }, - &scalar.EncapsedStringPart{ - Position: &position.Position{ - StartLine: 11, - EndLine: 11, - StartPos: 86, - EndPos: 86, - }, - Value: "\n", - }, }, }, }, @@ -18707,9 +18698,9 @@ CAD; StartLine: 14, EndLine: 14, StartPos: 103, - EndPos: 116, + EndPos: 115, }, - Value: "\thello $world\n", + Value: "\thello $world", }, }, }, diff --git a/php7/php7_test.go b/php7/php7_test.go index a2bcc71..07bb196 100644 --- a/php7/php7_test.go +++ b/php7/php7_test.go @@ -16312,9 +16312,9 @@ CAD; StartLine: 5, EndLine: 5, StartPos: 27, - EndPos: 33, + EndPos: 32, }, - Value: "\thello\n", + Value: "\thello", }, }, }, @@ -16340,9 +16340,9 @@ CAD; StartLine: 8, EndLine: 8, StartPos: 50, - EndPos: 56, + EndPos: 55, }, - Value: "\thello\n", + Value: "\thello", }, }, }, @@ -16389,15 +16389,6 @@ CAD; Value: "world", }, }, - &scalar.EncapsedStringPart{ - Position: &position.Position{ - StartLine: 11, - EndLine: 11, - StartPos: 86, - EndPos: 86, - }, - Value: "\n", - }, }, }, }, @@ -16422,9 +16413,9 @@ CAD; StartLine: 14, EndLine: 14, StartPos: 103, - EndPos: 116, + EndPos: 115, }, - Value: "\thello $world\n", + Value: "\thello $world", }, }, }, diff --git a/printer/printer.go b/printer/printer.go index 30ba013..26febed 100644 --- a/printer/printer.go +++ b/printer/printer.go @@ -665,6 +665,7 @@ func (p *Printer) printScalarHeredoc(n node.Node) { } } + io.WriteString(p.w, "\n") io.WriteString(p.w, strings.Trim(nn.Label, "\"'")) p.printMeta(nn, meta.NodeEnd) diff --git a/printer/printer_test.go b/printer/printer_test.go index 5f5e155..2f3e097 100644 --- a/printer/printer_test.go +++ b/printer/printer_test.go @@ -575,7 +575,7 @@ func TestPrinterPrintScalarHeredoc(t *testing.T) { Parts: []node.Node{ &scalar.EncapsedStringPart{Value: "hello "}, &expr.Variable{VarName: &node.Identifier{Value: "var"}}, - &scalar.EncapsedStringPart{Value: " world\n"}, + &scalar.EncapsedStringPart{Value: " world"}, }, }) @@ -602,7 +602,7 @@ func TestPrinterPrintScalarNowdoc(t *testing.T) { }, Label: "'LBL'", Parts: []node.Node{ - &scalar.EncapsedStringPart{Value: "hello world\n"}, + &scalar.EncapsedStringPart{Value: "hello world"}, }, }) diff --git a/scanner/lexer.go b/scanner/lexer.go index 0c43ec8..dd6c05a 100644 --- a/scanner/lexer.go +++ b/scanner/lexer.go @@ -124,6 +124,8 @@ func (l *Lexer) createToken(chars []lex.Char) *Token { token.Meta = l.Meta token.Value = l.tokenString(chars) + // fmt.Println(l.tokenString(chars)) + token.StartLine = l.File.Line(firstChar.Pos()) token.EndLine = l.File.Line(lastChar.Pos()) token.StartPos = int(firstChar.Pos()) diff --git a/scanner/lexer_tokens.go b/scanner/lexer_tokens.go index 8f53114..82b7633 100644 --- a/scanner/lexer_tokens.go +++ b/scanner/lexer_tokens.go @@ -1,7 +1,10 @@ package scanner +type LexerToken int + +//go:generate stringer -type=LexerToken -output ./lexer_tokens_string.go const ( - T_INCLUDE int = iota + 57346 + T_INCLUDE LexerToken = iota + 57346 T_INCLUDE_ONCE T_EXIT T_IF diff --git a/scanner/lexer_tokens_string.go b/scanner/lexer_tokens_string.go new file mode 100644 index 0000000..02e938f --- /dev/null +++ b/scanner/lexer_tokens_string.go @@ -0,0 +1,17 @@ +// Code generated by "stringer -type=LexerToken -output ./lexer_tokens_string.go"; DO NOT EDIT. + +package scanner + +import "strconv" + +const _LexerToken_name = "T_INCLUDET_INCLUDE_ONCET_EXITT_IFT_LNUMBERT_DNUMBERT_STRINGT_STRING_VARNAMET_VARIABLET_NUM_STRINGT_INLINE_HTMLT_CHARACTERT_BAD_CHARACTERT_ENCAPSED_AND_WHITESPACET_CONSTANT_ENCAPSED_STRINGT_ECHOT_DOT_WHILET_ENDWHILET_FORT_ENDFORT_FOREACHT_ENDFOREACHT_DECLARET_ENDDECLARET_AST_SWITCHT_ENDSWITCHT_CASET_DEFAULTT_BREAKT_CONTINUET_GOTOT_FUNCTIONT_CONSTT_RETURNT_TRYT_CATCHT_FINALLYT_THROWT_USET_INSTEADOFT_GLOBALT_VART_UNSETT_ISSETT_EMPTYT_HALT_COMPILERT_CLASST_TRAITT_INTERFACET_EXTENDST_IMPLEMENTST_OBJECT_OPERATORT_DOUBLE_ARROWT_LISTT_ARRAYT_CALLABLET_CLASS_CT_TRAIT_CT_METHOD_CT_FUNC_CT_LINET_FILET_COMMENTT_DOC_COMMENTT_OPEN_TAGT_OPEN_TAG_WITH_ECHOT_CLOSE_TAGT_WHITESPACET_START_HEREDOCT_END_HEREDOCT_DOLLAR_OPEN_CURLY_BRACEST_CURLY_OPENT_PAAMAYIM_NEKUDOTAYIMT_NAMESPACET_NS_CT_DIRT_NS_SEPARATORT_ELLIPSIST_EVALT_REQUIRET_REQUIRE_ONCET_LOGICAL_ORT_LOGICAL_XORT_LOGICAL_ANDT_INSTANCEOFT_NEWT_CLONET_ELSEIFT_ELSET_ENDIFT_PRINTT_YIELDT_STATICT_ABSTRACTT_FINALT_PRIVATET_PROTECTEDT_PUBLICT_INCT_DECT_YIELD_FROMT_INT_CASTT_DOUBLE_CASTT_STRING_CASTT_ARRAY_CASTT_OBJECT_CASTT_BOOL_CASTT_UNSET_CASTT_COALESCET_SPACESHIPT_NOELSET_PLUS_EQUALT_MINUS_EQUALT_MUL_EQUALT_POW_EQUALT_DIV_EQUALT_CONCAT_EQUALT_MOD_EQUALT_AND_EQUALT_OR_EQUALT_XOR_EQUALT_SL_EQUALT_SR_EQUALT_BOOLEAN_ORT_BOOLEAN_ANDT_POWT_SLT_SRT_IS_IDENTICALT_IS_NOT_IDENTICALT_IS_EQUALT_IS_NOT_EQUALT_IS_SMALLER_OR_EQUALT_IS_GREATER_OR_EQUAL" + +var _LexerToken_index = [...]uint16{0, 9, 23, 29, 33, 42, 51, 59, 75, 85, 97, 110, 121, 136, 161, 187, 193, 197, 204, 214, 219, 227, 236, 248, 257, 269, 273, 281, 292, 298, 307, 314, 324, 330, 340, 347, 355, 360, 367, 376, 383, 388, 399, 407, 412, 419, 426, 433, 448, 455, 462, 473, 482, 494, 511, 525, 531, 538, 548, 557, 566, 576, 584, 590, 596, 605, 618, 628, 648, 659, 671, 686, 699, 725, 737, 759, 770, 776, 781, 795, 805, 811, 820, 834, 846, 859, 872, 884, 889, 896, 904, 910, 917, 924, 931, 939, 949, 956, 965, 976, 984, 989, 994, 1006, 1016, 1029, 1042, 1054, 1067, 1078, 1090, 1100, 1111, 1119, 1131, 1144, 1155, 1166, 1177, 1191, 1202, 1213, 1223, 1234, 1244, 1254, 1266, 1279, 1284, 1288, 1292, 1306, 1324, 1334, 1348, 1369, 1390} + +func (i LexerToken) String() string { + i -= 57346 + if i < 0 || i >= LexerToken(len(_LexerToken_index)-1) { + return "LexerToken(" + strconv.FormatInt(int64(i+57346), 10) + ")" + } + return _LexerToken_name[_LexerToken_index[i]:_LexerToken_index[i+1]] +} diff --git a/scanner/scanner.go b/scanner/scanner.go index f49e966..43cd767 100644 --- a/scanner/scanner.go +++ b/scanner/scanner.go @@ -7542,7 +7542,7 @@ yyrule2: // . c = l.Next() } lval.Token(l.createToken(tb)) - return T_INLINE_HTML + return int(T_INLINE_HTML) } yyrule3: // \<\?php([ \t]|{NEW_LINE}) { @@ -7559,7 +7559,7 @@ yyrule5: // \<\?= { l.begin(PHP) lval.Token(l.createToken(l.Token())) - return T_ECHO + return int(T_ECHO) goto yystate0 } yyrule6: // [ \t\n\r]+ @@ -7584,7 +7584,7 @@ yyrule8: // \?\>{NEW_LINE}? yyrule9: // {DNUM}|{EXPONENT_DNUM} { lval.Token(l.createToken(l.Token())) - return T_DNUMBER + return int(T_DNUMBER) goto yystate0 } yyrule10: // {BNUM} @@ -7606,10 +7606,10 @@ yyrule10: // {BNUM} } if len(tb)-i < 64 { lval.Token(l.createToken(l.Token())) - return T_LNUMBER + return int(T_LNUMBER) } else { lval.Token(l.createToken(l.Token())) - return T_DNUMBER + return int(T_DNUMBER) } goto yystate0 } @@ -7618,10 +7618,10 @@ yyrule11: // {LNUM} if len(l.Token()) < 20 { lval.Token(l.createToken(l.Token())) - return T_LNUMBER + return int(T_LNUMBER) } else { lval.Token(l.createToken(l.Token())) - return T_DNUMBER + return int(T_DNUMBER) } goto yystate0 } @@ -7645,689 +7645,689 @@ yyrule12: // {HNUM} length := len(tb) - i if length < 16 || (length == 16 && tb[i].Rune <= '7') { lval.Token(l.createToken(l.Token())) - return T_LNUMBER + return int(T_LNUMBER) } else { lval.Token(l.createToken(l.Token())) - return T_DNUMBER + return int(T_DNUMBER) } goto yystate0 } yyrule13: // abstract { lval.Token(l.createToken(l.Token())) - return T_ABSTRACT + return int(T_ABSTRACT) goto yystate0 } yyrule14: // array { lval.Token(l.createToken(l.Token())) - return T_ARRAY + return int(T_ARRAY) goto yystate0 } yyrule15: // as { lval.Token(l.createToken(l.Token())) - return T_AS + return int(T_AS) goto yystate0 } yyrule16: // break { lval.Token(l.createToken(l.Token())) - return T_BREAK + return int(T_BREAK) goto yystate0 } yyrule17: // callable { lval.Token(l.createToken(l.Token())) - return T_CALLABLE + return int(T_CALLABLE) goto yystate0 } yyrule18: // case { lval.Token(l.createToken(l.Token())) - return T_CASE + return int(T_CASE) goto yystate0 } yyrule19: // catch { lval.Token(l.createToken(l.Token())) - return T_CATCH + return int(T_CATCH) goto yystate0 } yyrule20: // class { lval.Token(l.createToken(l.Token())) - return T_CLASS + return int(T_CLASS) goto yystate0 } yyrule21: // clone { lval.Token(l.createToken(l.Token())) - return T_CLONE + return int(T_CLONE) goto yystate0 } yyrule22: // const { lval.Token(l.createToken(l.Token())) - return T_CONST + return int(T_CONST) goto yystate0 } yyrule23: // continue { lval.Token(l.createToken(l.Token())) - return T_CONTINUE + return int(T_CONTINUE) goto yystate0 } yyrule24: // declare { lval.Token(l.createToken(l.Token())) - return T_DECLARE + return int(T_DECLARE) goto yystate0 } yyrule25: // default { lval.Token(l.createToken(l.Token())) - return T_DEFAULT + return int(T_DEFAULT) goto yystate0 } yyrule26: // do { lval.Token(l.createToken(l.Token())) - return T_DO + return int(T_DO) goto yystate0 } yyrule27: // echo { lval.Token(l.createToken(l.Token())) - return T_ECHO + return int(T_ECHO) goto yystate0 } yyrule28: // else { lval.Token(l.createToken(l.Token())) - return T_ELSE + return int(T_ELSE) goto yystate0 } yyrule29: // elseif { lval.Token(l.createToken(l.Token())) - return T_ELSEIF + return int(T_ELSEIF) goto yystate0 } yyrule30: // empty { lval.Token(l.createToken(l.Token())) - return T_EMPTY + return int(T_EMPTY) goto yystate0 } yyrule31: // enddeclare { lval.Token(l.createToken(l.Token())) - return T_ENDDECLARE + return int(T_ENDDECLARE) goto yystate0 } yyrule32: // endfor { lval.Token(l.createToken(l.Token())) - return T_ENDFOR + return int(T_ENDFOR) goto yystate0 } yyrule33: // endforeach { lval.Token(l.createToken(l.Token())) - return T_ENDFOREACH + return int(T_ENDFOREACH) goto yystate0 } yyrule34: // endif { lval.Token(l.createToken(l.Token())) - return T_ENDIF + return int(T_ENDIF) goto yystate0 } yyrule35: // endswitch { lval.Token(l.createToken(l.Token())) - return T_ENDSWITCH + return int(T_ENDSWITCH) goto yystate0 } yyrule36: // endwhile { lval.Token(l.createToken(l.Token())) - return T_ENDWHILE + return int(T_ENDWHILE) goto yystate0 } yyrule37: // eval { lval.Token(l.createToken(l.Token())) - return T_EVAL + return int(T_EVAL) goto yystate0 } yyrule38: // exit|die { lval.Token(l.createToken(l.Token())) - return T_EXIT + return int(T_EXIT) goto yystate0 } yyrule39: // extends { lval.Token(l.createToken(l.Token())) - return T_EXTENDS + return int(T_EXTENDS) goto yystate0 } yyrule40: // final { lval.Token(l.createToken(l.Token())) - return T_FINAL + return int(T_FINAL) goto yystate0 } yyrule41: // finally { lval.Token(l.createToken(l.Token())) - return T_FINALLY + return int(T_FINALLY) goto yystate0 } yyrule42: // for { lval.Token(l.createToken(l.Token())) - return T_FOR + return int(T_FOR) goto yystate0 } yyrule43: // foreach { lval.Token(l.createToken(l.Token())) - return T_FOREACH + return int(T_FOREACH) goto yystate0 } yyrule44: // function|cfunction { lval.Token(l.createToken(l.Token())) - return T_FUNCTION + return int(T_FUNCTION) goto yystate0 } yyrule45: // global { lval.Token(l.createToken(l.Token())) - return T_GLOBAL + return int(T_GLOBAL) goto yystate0 } yyrule46: // goto { lval.Token(l.createToken(l.Token())) - return T_GOTO + return int(T_GOTO) goto yystate0 } yyrule47: // if { lval.Token(l.createToken(l.Token())) - return T_IF + return int(T_IF) goto yystate0 } yyrule48: // isset { lval.Token(l.createToken(l.Token())) - return T_ISSET + return int(T_ISSET) goto yystate0 } yyrule49: // implements { lval.Token(l.createToken(l.Token())) - return T_IMPLEMENTS + return int(T_IMPLEMENTS) goto yystate0 } yyrule50: // instanceof { lval.Token(l.createToken(l.Token())) - return T_INSTANCEOF + return int(T_INSTANCEOF) goto yystate0 } yyrule51: // insteadof { lval.Token(l.createToken(l.Token())) - return T_INSTEADOF + return int(T_INSTEADOF) goto yystate0 } yyrule52: // interface { lval.Token(l.createToken(l.Token())) - return T_INTERFACE + return int(T_INTERFACE) goto yystate0 } yyrule53: // list { lval.Token(l.createToken(l.Token())) - return T_LIST + return int(T_LIST) goto yystate0 } yyrule54: // namespace { lval.Token(l.createToken(l.Token())) - return T_NAMESPACE + return int(T_NAMESPACE) goto yystate0 } yyrule55: // private { lval.Token(l.createToken(l.Token())) - return T_PRIVATE + return int(T_PRIVATE) goto yystate0 } yyrule56: // public { lval.Token(l.createToken(l.Token())) - return T_PUBLIC + return int(T_PUBLIC) goto yystate0 } yyrule57: // print { lval.Token(l.createToken(l.Token())) - return T_PRINT + return int(T_PRINT) goto yystate0 } yyrule58: // protected { lval.Token(l.createToken(l.Token())) - return T_PROTECTED + return int(T_PROTECTED) goto yystate0 } yyrule59: // return { lval.Token(l.createToken(l.Token())) - return T_RETURN + return int(T_RETURN) goto yystate0 } yyrule60: // static { lval.Token(l.createToken(l.Token())) - return T_STATIC + return int(T_STATIC) goto yystate0 } yyrule61: // switch { lval.Token(l.createToken(l.Token())) - return T_SWITCH + return int(T_SWITCH) goto yystate0 } yyrule62: // throw { lval.Token(l.createToken(l.Token())) - return T_THROW + return int(T_THROW) goto yystate0 } yyrule63: // trait { lval.Token(l.createToken(l.Token())) - return T_TRAIT + return int(T_TRAIT) goto yystate0 } yyrule64: // try { lval.Token(l.createToken(l.Token())) - return T_TRY + return int(T_TRY) goto yystate0 } yyrule65: // unset { lval.Token(l.createToken(l.Token())) - return T_UNSET + return int(T_UNSET) goto yystate0 } yyrule66: // use { lval.Token(l.createToken(l.Token())) - return T_USE + return int(T_USE) goto yystate0 } yyrule67: // var { lval.Token(l.createToken(l.Token())) - return T_VAR + return int(T_VAR) goto yystate0 } yyrule68: // while { lval.Token(l.createToken(l.Token())) - return T_WHILE + return int(T_WHILE) goto yystate0 } yyrule69: // yield[ \t\n\r]+from { lval.Token(l.createToken(l.Token())) - return T_YIELD_FROM + return int(T_YIELD_FROM) goto yystate0 } yyrule70: // yield { lval.Token(l.createToken(l.Token())) - return T_YIELD + return int(T_YIELD) goto yystate0 } yyrule71: // include { lval.Token(l.createToken(l.Token())) - return T_INCLUDE + return int(T_INCLUDE) goto yystate0 } yyrule72: // include_once { lval.Token(l.createToken(l.Token())) - return T_INCLUDE_ONCE + return int(T_INCLUDE_ONCE) goto yystate0 } yyrule73: // require { lval.Token(l.createToken(l.Token())) - return T_REQUIRE + return int(T_REQUIRE) goto yystate0 } yyrule74: // require_once { lval.Token(l.createToken(l.Token())) - return T_REQUIRE_ONCE + return int(T_REQUIRE_ONCE) goto yystate0 } yyrule75: // __CLASS__ { lval.Token(l.createToken(l.Token())) - return T_CLASS_C + return int(T_CLASS_C) goto yystate0 } yyrule76: // __DIR__ { lval.Token(l.createToken(l.Token())) - return T_DIR + return int(T_DIR) goto yystate0 } yyrule77: // __FILE__ { lval.Token(l.createToken(l.Token())) - return T_FILE + return int(T_FILE) goto yystate0 } yyrule78: // __FUNCTION__ { lval.Token(l.createToken(l.Token())) - return T_FUNC_C + return int(T_FUNC_C) goto yystate0 } yyrule79: // __LINE__ { lval.Token(l.createToken(l.Token())) - return T_LINE + return int(T_LINE) goto yystate0 } yyrule80: // __NAMESPACE__ { lval.Token(l.createToken(l.Token())) - return T_NS_C + return int(T_NS_C) goto yystate0 } yyrule81: // __METHOD__ { lval.Token(l.createToken(l.Token())) - return T_METHOD_C + return int(T_METHOD_C) goto yystate0 } yyrule82: // __TRAIT__ { lval.Token(l.createToken(l.Token())) - return T_TRAIT_C + return int(T_TRAIT_C) goto yystate0 } yyrule83: // __halt_compiler { lval.Token(l.createToken(l.Token())) - return T_HALT_COMPILER + return int(T_HALT_COMPILER) goto yystate0 } yyrule84: // \([ \t]*array[ \t]*\) { lval.Token(l.createToken(l.Token())) - return T_ARRAY_CAST + return int(T_ARRAY_CAST) goto yystate0 } yyrule85: // \([ \t]*(bool|boolean)[ \t]*\) { lval.Token(l.createToken(l.Token())) - return T_BOOL_CAST + return int(T_BOOL_CAST) goto yystate0 } yyrule86: // \([ \t]*(real|double|float)[ \t]*\) { lval.Token(l.createToken(l.Token())) - return T_DOUBLE_CAST + return int(T_DOUBLE_CAST) goto yystate0 } yyrule87: // \([ \t]*(int|integer)[ \t]*\) { lval.Token(l.createToken(l.Token())) - return T_INT_CAST + return int(T_INT_CAST) goto yystate0 } yyrule88: // \([ \t]*object[ \t]*\) { lval.Token(l.createToken(l.Token())) - return T_OBJECT_CAST + return int(T_OBJECT_CAST) goto yystate0 } yyrule89: // \([ \t]*(string|binary)[ \t]*\) { lval.Token(l.createToken(l.Token())) - return T_STRING_CAST + return int(T_STRING_CAST) goto yystate0 } yyrule90: // \([ \t]*unset[ \t]*\) { lval.Token(l.createToken(l.Token())) - return T_UNSET_CAST + return int(T_UNSET_CAST) goto yystate0 } yyrule91: // new { lval.Token(l.createToken(l.Token())) - return T_NEW + return int(T_NEW) goto yystate0 } yyrule92: // and { lval.Token(l.createToken(l.Token())) - return T_LOGICAL_AND + return int(T_LOGICAL_AND) goto yystate0 } yyrule93: // or { lval.Token(l.createToken(l.Token())) - return T_LOGICAL_OR + return int(T_LOGICAL_OR) goto yystate0 } yyrule94: // xor { lval.Token(l.createToken(l.Token())) - return T_LOGICAL_XOR + return int(T_LOGICAL_XOR) goto yystate0 } yyrule95: // \\ { lval.Token(l.createToken(l.Token())) - return T_NS_SEPARATOR + return int(T_NS_SEPARATOR) goto yystate0 } yyrule96: // \.\.\. { lval.Token(l.createToken(l.Token())) - return T_ELLIPSIS + return int(T_ELLIPSIS) goto yystate0 } yyrule97: // :: { lval.Token(l.createToken(l.Token())) - return T_PAAMAYIM_NEKUDOTAYIM // T_DOUBLE_COLON + return int(T_PAAMAYIM_NEKUDOTAYIM) // T_DOUBLE_COLON goto yystate0 } yyrule98: // && { lval.Token(l.createToken(l.Token())) - return T_BOOLEAN_AND + return int(T_BOOLEAN_AND) goto yystate0 } yyrule99: // \|\| { lval.Token(l.createToken(l.Token())) - return T_BOOLEAN_OR + return int(T_BOOLEAN_OR) goto yystate0 } yyrule100: // &= { lval.Token(l.createToken(l.Token())) - return T_AND_EQUAL + return int(T_AND_EQUAL) goto yystate0 } yyrule101: // \|= { lval.Token(l.createToken(l.Token())) - return T_OR_EQUAL + return int(T_OR_EQUAL) goto yystate0 } yyrule102: // \.= { lval.Token(l.createToken(l.Token())) - return T_CONCAT_EQUAL + return int(T_CONCAT_EQUAL) goto yystate0 } yyrule103: // \*= { lval.Token(l.createToken(l.Token())) - return T_MUL_EQUAL + return int(T_MUL_EQUAL) goto yystate0 } yyrule104: // \*\*= { lval.Token(l.createToken(l.Token())) - return T_POW_EQUAL + return int(T_POW_EQUAL) goto yystate0 } yyrule105: // [/]= { lval.Token(l.createToken(l.Token())) - return T_DIV_EQUAL + return int(T_DIV_EQUAL) goto yystate0 } yyrule106: // \+= { lval.Token(l.createToken(l.Token())) - return T_PLUS_EQUAL + return int(T_PLUS_EQUAL) goto yystate0 } yyrule107: // -= { lval.Token(l.createToken(l.Token())) - return T_MINUS_EQUAL + return int(T_MINUS_EQUAL) goto yystate0 } yyrule108: // \^= { lval.Token(l.createToken(l.Token())) - return T_XOR_EQUAL + return int(T_XOR_EQUAL) goto yystate0 } yyrule109: // %= { lval.Token(l.createToken(l.Token())) - return T_MOD_EQUAL + return int(T_MOD_EQUAL) goto yystate0 } yyrule110: // -- { lval.Token(l.createToken(l.Token())) - return T_DEC + return int(T_DEC) goto yystate0 } yyrule111: // \+\+ { lval.Token(l.createToken(l.Token())) - return T_INC + return int(T_INC) goto yystate0 } yyrule112: // => { lval.Token(l.createToken(l.Token())) - return T_DOUBLE_ARROW + return int(T_DOUBLE_ARROW) goto yystate0 } yyrule113: // \<=\> { lval.Token(l.createToken(l.Token())) - return T_SPACESHIP + return int(T_SPACESHIP) goto yystate0 } yyrule114: // \!=|\<\> { lval.Token(l.createToken(l.Token())) - return T_IS_NOT_EQUAL + return int(T_IS_NOT_EQUAL) goto yystate0 } yyrule115: // \!== { lval.Token(l.createToken(l.Token())) - return T_IS_NOT_IDENTICAL + return int(T_IS_NOT_IDENTICAL) goto yystate0 } yyrule116: // == { lval.Token(l.createToken(l.Token())) - return T_IS_EQUAL + return int(T_IS_EQUAL) goto yystate0 } yyrule117: // === { lval.Token(l.createToken(l.Token())) - return T_IS_IDENTICAL + return int(T_IS_IDENTICAL) goto yystate0 } yyrule118: // \<\<= { lval.Token(l.createToken(l.Token())) - return T_SL_EQUAL + return int(T_SL_EQUAL) goto yystate0 } yyrule119: // \>\>= { lval.Token(l.createToken(l.Token())) - return T_SR_EQUAL + return int(T_SR_EQUAL) goto yystate0 } yyrule120: // \>= { lval.Token(l.createToken(l.Token())) - return T_IS_GREATER_OR_EQUAL + return int(T_IS_GREATER_OR_EQUAL) goto yystate0 } yyrule121: // \<= { lval.Token(l.createToken(l.Token())) - return T_IS_SMALLER_OR_EQUAL + return int(T_IS_SMALLER_OR_EQUAL) goto yystate0 } yyrule122: // \*\* { lval.Token(l.createToken(l.Token())) - return T_POW + return int(T_POW) goto yystate0 } yyrule123: // \<\< { lval.Token(l.createToken(l.Token())) - return T_SL + return int(T_SL) goto yystate0 } yyrule124: // \>\> { lval.Token(l.createToken(l.Token())) - return T_SR + return int(T_SR) goto yystate0 } yyrule125: // \?\? { lval.Token(l.createToken(l.Token())) - return T_COALESCE + return int(T_COALESCE) goto yystate0 } yyrule126: // (#|[/][/]) @@ -8416,20 +8416,20 @@ yyrule130: // \} yyrule131: // \${VAR_NAME} { lval.Token(l.createToken(l.Token())) - return T_VARIABLE + return int(T_VARIABLE) goto yystate0 } yyrule132: // {VAR_NAME} { lval.Token(l.createToken(l.Token())) - return T_STRING + return int(T_STRING) goto yystate0 } yyrule133: // -> { l.begin(PROPERTY) lval.Token(l.createToken(l.Token())) - return T_OBJECT_OPERATOR + return int(T_OBJECT_OPERATOR) goto yystate0 } yyrule134: // [ \t\n\r]+ @@ -8440,14 +8440,14 @@ yyrule134: // [ \t\n\r]+ yyrule135: // -> { lval.Token(l.createToken(l.Token())) - return T_OBJECT_OPERATOR + return int(T_OBJECT_OPERATOR) goto yystate0 } yyrule136: // {VAR_NAME} { l.begin(PHP) lval.Token(l.createToken(l.Token())) - return T_STRING + return int(T_STRING) goto yystate0 } yyrule137: // . @@ -8459,7 +8459,7 @@ yyrule137: // . yyrule138: // [\']([^\\\']*([\\].)*)*[\'] { lval.Token(l.createToken(l.Token())) - return T_CONSTANT_ENCAPSED_STRING + return int(T_CONSTANT_ENCAPSED_STRING) goto yystate0 } yyrule139: // ` @@ -8531,7 +8531,7 @@ yyrule141: // [b]?\<\<\<[ \t]*({VAR_NAME}|([']{VAR_NAME}['])|(["]{VAR_NAME}["])) } l.ungetChars(ungetCnt) lval.Token(l.createToken(heredocToken)) - return T_START_HEREDOC + return int(T_START_HEREDOC) } yyrule142: // .|[ \t\n\r] { @@ -8547,11 +8547,13 @@ yyrule142: // .|[ \t\n\r] if l.heredocLabel+";" == string(searchLabel) { l.begin(HEREDOC_END) tb = l.ungetChars(len(l.heredocLabel) + 1) + tb = tb[:len(tb)-1] break } if l.heredocLabel == string(searchLabel) { l.begin(HEREDOC_END) tb = l.ungetChars(len(l.heredocLabel)) + tb = tb[:len(tb)-1] break } @@ -8562,20 +8564,20 @@ yyrule142: // .|[ \t\n\r] c = l.Next() } lval.Token(l.createToken(tb)) - return T_ENCAPSED_AND_WHITESPACE + return int(T_ENCAPSED_AND_WHITESPACE) } yyrule143: // {VAR_NAME}\; { l.begin(PHP) lval.Token(l.createToken(l.ungetChars(1))) - return T_END_HEREDOC + return int(T_END_HEREDOC) goto yystate0 } yyrule144: // {VAR_NAME} { l.begin(PHP) lval.Token(l.createToken(l.Token())) - return T_END_HEREDOC + return int(T_END_HEREDOC) goto yystate0 } yyrule145: // [b]?[\"] @@ -8603,7 +8605,7 @@ yyrule145: // [b]?[\"] case '"': c = l.Next() lval.Token(l.createToken(l.Token())) - return T_CONSTANT_ENCAPSED_STRING + return int(T_CONSTANT_ENCAPSED_STRING) break F case '$': @@ -8639,14 +8641,14 @@ yyrule147: // \{\$ { lval.Token(l.createToken(l.ungetChars(1))) l.pushState(PHP) - return T_CURLY_OPEN + return int(T_CURLY_OPEN) goto yystate0 } yyrule148: // \$\{ { l.pushState(STRING_VAR_NAME) lval.Token(l.createToken(l.Token())) - return T_DOLLAR_OPEN_CURLY_BRACES + return int(T_DOLLAR_OPEN_CURLY_BRACES) goto yystate0 } yyrule149: // \${VAR_NAME} @@ -8666,13 +8668,13 @@ yyrule150: // .|[ \t\n\r] if c == '{' || isValidFirstVarNameRune(rune(c)) { l.ungetChars(1) lval.Token(l.createToken(tb[:len(tb)-1])) - return T_ENCAPSED_AND_WHITESPACE + return int(T_ENCAPSED_AND_WHITESPACE) } case '{': if rune(c) == '$' { l.ungetChars(1) lval.Token(l.createToken(tb[:len(tb)-1])) - return T_ENCAPSED_AND_WHITESPACE + return int(T_ENCAPSED_AND_WHITESPACE) } case '\\': currentChar := l.Last @@ -8681,7 +8683,7 @@ yyrule150: // .|[ \t\n\r] } if rune(c) == '"' { lval.Token(l.createToken(l.Token())) - return T_ENCAPSED_AND_WHITESPACE + return int(T_ENCAPSED_AND_WHITESPACE) } currentChar = l.Last tb = append(tb, currentChar) @@ -8703,13 +8705,13 @@ yyrule151: // .|[ \t\n\r] if c == '{' || isValidFirstVarNameRune(rune(c)) { l.ungetChars(1) lval.Token(l.createToken(tb[:len(tb)-1])) - return T_ENCAPSED_AND_WHITESPACE + return int(T_ENCAPSED_AND_WHITESPACE) } case '{': if rune(c) == '$' { l.ungetChars(1) lval.Token(l.createToken(tb[:len(tb)-1])) - return T_ENCAPSED_AND_WHITESPACE + return int(T_ENCAPSED_AND_WHITESPACE) } case '\\': currentChar := l.Last @@ -8718,7 +8720,7 @@ yyrule151: // .|[ \t\n\r] } if rune(c) == '`' { lval.Token(l.createToken(l.Token())) - return T_ENCAPSED_AND_WHITESPACE + return int(T_ENCAPSED_AND_WHITESPACE) } currentChar = l.Last tb = append(tb, currentChar) @@ -8733,64 +8735,77 @@ yyrule152: // .|[ \t\n\r] { searchLabel := []byte{} - tb := []lex.Char{} + currentChar := l.Prev + tb := []lex.Char{currentChar} + HEREDOC_FOR: for { - if c == -1 { - break - } nls := 0 - switch c { + switch currentChar.Rune { case '\r': - nls = 1 - c := l.Next() - if c != '\n' { - nls = 0 - l.ungetChars(0) + if c == '\n' { + nls = 1 + currentChar := l.Last + tb = append(tb, currentChar) + c = l.Next() } fallthrough case '\n': if l.heredocLabel+";" == string(searchLabel) { l.begin(HEREDOC_END) - tb = l.ungetChars(len(l.heredocLabel) + 1 + nls) + l.ungetChars(len(l.heredocLabel) + 1 + nls) + + i := len(tb) - len(l.heredocLabel) - 3 - nls + if i < 1 { + break HEREDOC_FOR + } + tb = tb[:i] + lval.Token(l.createToken(tb)) - return T_ENCAPSED_AND_WHITESPACE + return int(T_ENCAPSED_AND_WHITESPACE) } if l.heredocLabel == string(searchLabel) { l.begin(HEREDOC_END) - tb = l.ungetChars(len(l.heredocLabel) + nls) + l.ungetChars(len(l.heredocLabel) + nls) + + i := len(tb) - len(l.heredocLabel) - 2 - nls + if i < 1 { + break HEREDOC_FOR + } + tb = tb[:i] lval.Token(l.createToken(tb)) - return T_ENCAPSED_AND_WHITESPACE + return int(T_ENCAPSED_AND_WHITESPACE) } searchLabel = []byte{} - case '$': - c = l.Next() - if rune(c) == '{' || isValidFirstVarNameRune(rune(c)) { - tb = l.ungetChars(1) - lval.Token(l.createToken(tb)) - return T_ENCAPSED_AND_WHITESPACE + if c == '{' || isValidFirstVarNameRune(rune(c)) { + l.ungetChars(1) + lval.Token(l.createToken(tb[:len(tb)-1])) + return int(T_ENCAPSED_AND_WHITESPACE) } - l.ungetChars(0) - case '{': - c = l.Next() if rune(c) == '$' { - tb = l.ungetChars(1) - lval.Token(l.createToken(tb)) - return T_ENCAPSED_AND_WHITESPACE + l.ungetChars(1) + lval.Token(l.createToken(tb[:len(tb)-1])) + return int(T_ENCAPSED_AND_WHITESPACE) } - l.ungetChars(0) case '\\': - c = l.Next() - if c == '\n' || c == '\r' { - l.ungetChars(0) + if c != '\n' && c != '\r' { + currentChar := l.Last + tb = append(tb, currentChar) + c = l.Next() } default: - searchLabel = append(searchLabel, byte(rune(c))) + searchLabel = append(searchLabel, byte(rune(currentChar.Rune))) } + if c == -1 { + break + } + + currentChar = l.Last + tb = append(tb, currentChar) c = l.Next() } goto yystate0 @@ -8798,20 +8813,20 @@ yyrule152: // .|[ \t\n\r] yyrule153: // \${VAR_NAME} { lval.Token(l.createToken(l.Token())) - return T_VARIABLE + return int(T_VARIABLE) goto yystate0 } yyrule154: // ->{VAR_NAME} { lval.Token(l.createToken(l.ungetChars(len(l.Token()) - 2))) - return T_OBJECT_OPERATOR + return int(T_OBJECT_OPERATOR) goto yystate0 } yyrule155: // {VAR_NAME} { l.popState() lval.Token(l.createToken(l.Token())) - return T_STRING + return int(T_STRING) goto yystate0 } yyrule156: // \[ @@ -8830,19 +8845,19 @@ yyrule157: // .|[ \t\n\r] yyrule158: // {LNUM}|{HNUM}|{BNUM} { lval.Token(l.createToken(l.Token())) - return T_NUM_STRING + return int(T_NUM_STRING) goto yystate0 } yyrule159: // \${VAR_NAME} { lval.Token(l.createToken(l.Token())) - return T_VARIABLE + return int(T_VARIABLE) goto yystate0 } yyrule160: // {VAR_NAME} { lval.Token(l.createToken(l.Token())) - return T_STRING + return int(T_STRING) goto yystate0 } yyrule161: // \] @@ -8858,7 +8873,7 @@ yyrule162: // [ \n\r\t\\'#] l.popState() l.popState() lval.Token(l.createToken(l.Token())) - return T_ENCAPSED_AND_WHITESPACE + return int(T_ENCAPSED_AND_WHITESPACE) goto yystate0 } yyrule163: // {OPERATORS} @@ -8878,7 +8893,7 @@ yyrule165: // {VAR_NAME}[\[\}] l.popState() l.pushState(PHP) lval.Token(l.createToken(l.ungetChars(1))) - return T_STRING_VARNAME + return int(T_STRING_VARNAME) goto yystate0 } yyrule166: // . diff --git a/scanner/scanner.l b/scanner/scanner.l index 53fc614..0d81b83 100644 --- a/scanner/scanner.l +++ b/scanner/scanner.l @@ -82,17 +82,17 @@ NEW_LINE (\r|\n|\r\n) } lval.Token(l.createToken(tb)) - return T_INLINE_HTML + return int(T_INLINE_HTML) \<\?php([ \t]|{NEW_LINE}) l.begin(PHP);l.ungetChars(len(l.Token())-5) \<\? l.begin(PHP); -\<\?= l.begin(PHP);lval.Token(l.createToken(l.Token())); return T_ECHO; +\<\?= l.begin(PHP);lval.Token(l.createToken(l.Token())); return int(T_ECHO); [ \t\n\r]+ l.addWhiteSpace(l.Token()) [;][ \t\n\r]*\?\>{NEW_LINE}? l.begin(INITIAL);lval.Token(l.createToken(l.Token())); return Rune2Class(';'); \?\>{NEW_LINE}? l.begin(INITIAL);lval.Token(l.createToken(l.Token())); return Rune2Class(';'); -{DNUM}|{EXPONENT_DNUM} lval.Token(l.createToken(l.Token())); return T_DNUMBER +{DNUM}|{EXPONENT_DNUM} lval.Token(l.createToken(l.Token())); return int(T_DNUMBER) {BNUM} tb := l.Token() i:=2 @@ -106,15 +106,15 @@ NEW_LINE (\r|\n|\r\n) } } if len(tb) - i < 64 { - lval.Token(l.createToken(l.Token())); return T_LNUMBER + lval.Token(l.createToken(l.Token())); return int(T_LNUMBER) } else { - lval.Token(l.createToken(l.Token())); return T_DNUMBER + lval.Token(l.createToken(l.Token())); return int(T_DNUMBER) } {LNUM} if len(l.Token()) < 20 { - lval.Token(l.createToken(l.Token())); return T_LNUMBER + lval.Token(l.createToken(l.Token())); return int(T_LNUMBER) } else { - lval.Token(l.createToken(l.Token())); return T_DNUMBER + lval.Token(l.createToken(l.Token())); return int(T_DNUMBER) } {HNUM} tb := l.Token() @@ -130,124 +130,124 @@ NEW_LINE (\r|\n|\r\n) } length := len(tb) - i if length < 16 || (length == 16 && tb[i].Rune <= '7') { - lval.Token(l.createToken(l.Token())); return T_LNUMBER + lval.Token(l.createToken(l.Token())); return int(T_LNUMBER) } else { - lval.Token(l.createToken(l.Token())); return T_DNUMBER + lval.Token(l.createToken(l.Token())); return int(T_DNUMBER) } -abstract lval.Token(l.createToken(l.Token())); return T_ABSTRACT -array lval.Token(l.createToken(l.Token())); return T_ARRAY -as lval.Token(l.createToken(l.Token())); return T_AS -break lval.Token(l.createToken(l.Token())); return T_BREAK -callable lval.Token(l.createToken(l.Token())); return T_CALLABLE -case lval.Token(l.createToken(l.Token())); return T_CASE -catch lval.Token(l.createToken(l.Token())); return T_CATCH -class lval.Token(l.createToken(l.Token())); return T_CLASS -clone lval.Token(l.createToken(l.Token())); return T_CLONE -const lval.Token(l.createToken(l.Token())); return T_CONST -continue lval.Token(l.createToken(l.Token())); return T_CONTINUE -declare lval.Token(l.createToken(l.Token())); return T_DECLARE -default lval.Token(l.createToken(l.Token())); return T_DEFAULT -do lval.Token(l.createToken(l.Token())); return T_DO -echo lval.Token(l.createToken(l.Token())); return T_ECHO -else lval.Token(l.createToken(l.Token())); return T_ELSE -elseif lval.Token(l.createToken(l.Token())); return T_ELSEIF -empty lval.Token(l.createToken(l.Token())); return T_EMPTY -enddeclare lval.Token(l.createToken(l.Token())); return T_ENDDECLARE -endfor lval.Token(l.createToken(l.Token())); return T_ENDFOR -endforeach lval.Token(l.createToken(l.Token())); return T_ENDFOREACH -endif lval.Token(l.createToken(l.Token())); return T_ENDIF -endswitch lval.Token(l.createToken(l.Token())); return T_ENDSWITCH -endwhile lval.Token(l.createToken(l.Token())); return T_ENDWHILE -eval lval.Token(l.createToken(l.Token())); return T_EVAL -exit|die lval.Token(l.createToken(l.Token())); return T_EXIT -extends lval.Token(l.createToken(l.Token())); return T_EXTENDS -final lval.Token(l.createToken(l.Token())); return T_FINAL -finally lval.Token(l.createToken(l.Token())); return T_FINALLY -for lval.Token(l.createToken(l.Token())); return T_FOR -foreach lval.Token(l.createToken(l.Token())); return T_FOREACH -function|cfunction lval.Token(l.createToken(l.Token())); return T_FUNCTION -global lval.Token(l.createToken(l.Token())); return T_GLOBAL -goto lval.Token(l.createToken(l.Token())); return T_GOTO -if lval.Token(l.createToken(l.Token())); return T_IF -isset lval.Token(l.createToken(l.Token())); return T_ISSET -implements lval.Token(l.createToken(l.Token())); return T_IMPLEMENTS -instanceof lval.Token(l.createToken(l.Token())); return T_INSTANCEOF -insteadof lval.Token(l.createToken(l.Token())); return T_INSTEADOF -interface lval.Token(l.createToken(l.Token())); return T_INTERFACE -list lval.Token(l.createToken(l.Token())); return T_LIST -namespace lval.Token(l.createToken(l.Token())); return T_NAMESPACE -private lval.Token(l.createToken(l.Token())); return T_PRIVATE -public lval.Token(l.createToken(l.Token())); return T_PUBLIC -print lval.Token(l.createToken(l.Token())); return T_PRINT -protected lval.Token(l.createToken(l.Token())); return T_PROTECTED -return lval.Token(l.createToken(l.Token())); return T_RETURN -static lval.Token(l.createToken(l.Token())); return T_STATIC -switch lval.Token(l.createToken(l.Token())); return T_SWITCH -throw lval.Token(l.createToken(l.Token())); return T_THROW -trait lval.Token(l.createToken(l.Token())); return T_TRAIT -try lval.Token(l.createToken(l.Token())); return T_TRY -unset lval.Token(l.createToken(l.Token())); return T_UNSET -use lval.Token(l.createToken(l.Token())); return T_USE -var lval.Token(l.createToken(l.Token())); return T_VAR -while lval.Token(l.createToken(l.Token())); return T_WHILE -yield[ \t\n\r]+from lval.Token(l.createToken(l.Token())); return T_YIELD_FROM -yield lval.Token(l.createToken(l.Token())); return T_YIELD -include lval.Token(l.createToken(l.Token())); return T_INCLUDE -include_once lval.Token(l.createToken(l.Token())); return T_INCLUDE_ONCE -require lval.Token(l.createToken(l.Token())); return T_REQUIRE -require_once lval.Token(l.createToken(l.Token())); return T_REQUIRE_ONCE -__CLASS__ lval.Token(l.createToken(l.Token())); return T_CLASS_C -__DIR__ lval.Token(l.createToken(l.Token())); return T_DIR -__FILE__ lval.Token(l.createToken(l.Token())); return T_FILE -__FUNCTION__ lval.Token(l.createToken(l.Token())); return T_FUNC_C -__LINE__ lval.Token(l.createToken(l.Token())); return T_LINE -__NAMESPACE__ lval.Token(l.createToken(l.Token())); return T_NS_C -__METHOD__ lval.Token(l.createToken(l.Token())); return T_METHOD_C -__TRAIT__ lval.Token(l.createToken(l.Token())); return T_TRAIT_C -__halt_compiler lval.Token(l.createToken(l.Token())); return T_HALT_COMPILER -\([ \t]*array[ \t]*\) lval.Token(l.createToken(l.Token())); return T_ARRAY_CAST -\([ \t]*(bool|boolean)[ \t]*\) lval.Token(l.createToken(l.Token())); return T_BOOL_CAST -\([ \t]*(real|double|float)[ \t]*\) lval.Token(l.createToken(l.Token())); return T_DOUBLE_CAST -\([ \t]*(int|integer)[ \t]*\) lval.Token(l.createToken(l.Token())); return T_INT_CAST -\([ \t]*object[ \t]*\) lval.Token(l.createToken(l.Token())); return T_OBJECT_CAST -\([ \t]*(string|binary)[ \t]*\) lval.Token(l.createToken(l.Token())); return T_STRING_CAST -\([ \t]*unset[ \t]*\) lval.Token(l.createToken(l.Token())); return T_UNSET_CAST -new lval.Token(l.createToken(l.Token())); return T_NEW -and lval.Token(l.createToken(l.Token())); return T_LOGICAL_AND -or lval.Token(l.createToken(l.Token())); return T_LOGICAL_OR -xor lval.Token(l.createToken(l.Token())); return T_LOGICAL_XOR -\\ lval.Token(l.createToken(l.Token())); return T_NS_SEPARATOR -\.\.\. lval.Token(l.createToken(l.Token())); return T_ELLIPSIS -:: lval.Token(l.createToken(l.Token())); return T_PAAMAYIM_NEKUDOTAYIM // T_DOUBLE_COLON -&& lval.Token(l.createToken(l.Token())); return T_BOOLEAN_AND -\|\| lval.Token(l.createToken(l.Token())); return T_BOOLEAN_OR -&= lval.Token(l.createToken(l.Token())); return T_AND_EQUAL -\|= lval.Token(l.createToken(l.Token())); return T_OR_EQUAL -\.= lval.Token(l.createToken(l.Token())); return T_CONCAT_EQUAL -\*= lval.Token(l.createToken(l.Token())); return T_MUL_EQUAL -\*\*= lval.Token(l.createToken(l.Token())); return T_POW_EQUAL -[/]= lval.Token(l.createToken(l.Token())); return T_DIV_EQUAL -\+= lval.Token(l.createToken(l.Token())); return T_PLUS_EQUAL --= lval.Token(l.createToken(l.Token())); return T_MINUS_EQUAL -\^= lval.Token(l.createToken(l.Token())); return T_XOR_EQUAL -%= lval.Token(l.createToken(l.Token())); return T_MOD_EQUAL --- lval.Token(l.createToken(l.Token())); return T_DEC -\+\+ lval.Token(l.createToken(l.Token())); return T_INC -=> lval.Token(l.createToken(l.Token())); return T_DOUBLE_ARROW -\<=\> lval.Token(l.createToken(l.Token())); return T_SPACESHIP -\!=|\<\> lval.Token(l.createToken(l.Token())); return T_IS_NOT_EQUAL -\!== lval.Token(l.createToken(l.Token())); return T_IS_NOT_IDENTICAL -== lval.Token(l.createToken(l.Token())); return T_IS_EQUAL -=== lval.Token(l.createToken(l.Token())); return T_IS_IDENTICAL -\<\<= lval.Token(l.createToken(l.Token())); return T_SL_EQUAL -\>\>= lval.Token(l.createToken(l.Token())); return T_SR_EQUAL -\>= lval.Token(l.createToken(l.Token())); return T_IS_GREATER_OR_EQUAL -\<= lval.Token(l.createToken(l.Token())); return T_IS_SMALLER_OR_EQUAL -\*\* lval.Token(l.createToken(l.Token())); return T_POW -\<\< lval.Token(l.createToken(l.Token())); return T_SL -\>\> lval.Token(l.createToken(l.Token())); return T_SR -\?\? lval.Token(l.createToken(l.Token())); return T_COALESCE +abstract lval.Token(l.createToken(l.Token())); return int(T_ABSTRACT) +array lval.Token(l.createToken(l.Token())); return int(T_ARRAY) +as lval.Token(l.createToken(l.Token())); return int(T_AS) +break lval.Token(l.createToken(l.Token())); return int(T_BREAK) +callable lval.Token(l.createToken(l.Token())); return int(T_CALLABLE) +case lval.Token(l.createToken(l.Token())); return int(T_CASE) +catch lval.Token(l.createToken(l.Token())); return int(T_CATCH) +class lval.Token(l.createToken(l.Token())); return int(T_CLASS) +clone lval.Token(l.createToken(l.Token())); return int(T_CLONE) +const lval.Token(l.createToken(l.Token())); return int(T_CONST) +continue lval.Token(l.createToken(l.Token())); return int(T_CONTINUE) +declare lval.Token(l.createToken(l.Token())); return int(T_DECLARE) +default lval.Token(l.createToken(l.Token())); return int(T_DEFAULT) +do lval.Token(l.createToken(l.Token())); return int(T_DO) +echo lval.Token(l.createToken(l.Token())); return int(T_ECHO) +else lval.Token(l.createToken(l.Token())); return int(T_ELSE) +elseif lval.Token(l.createToken(l.Token())); return int(T_ELSEIF) +empty lval.Token(l.createToken(l.Token())); return int(T_EMPTY) +enddeclare lval.Token(l.createToken(l.Token())); return int(T_ENDDECLARE) +endfor lval.Token(l.createToken(l.Token())); return int(T_ENDFOR) +endforeach lval.Token(l.createToken(l.Token())); return int(T_ENDFOREACH) +endif lval.Token(l.createToken(l.Token())); return int(T_ENDIF) +endswitch lval.Token(l.createToken(l.Token())); return int(T_ENDSWITCH) +endwhile lval.Token(l.createToken(l.Token())); return int(T_ENDWHILE) +eval lval.Token(l.createToken(l.Token())); return int(T_EVAL) +exit|die lval.Token(l.createToken(l.Token())); return int(T_EXIT) +extends lval.Token(l.createToken(l.Token())); return int(T_EXTENDS) +final lval.Token(l.createToken(l.Token())); return int(T_FINAL) +finally lval.Token(l.createToken(l.Token())); return int(T_FINALLY) +for lval.Token(l.createToken(l.Token())); return int(T_FOR) +foreach lval.Token(l.createToken(l.Token())); return int(T_FOREACH) +function|cfunction lval.Token(l.createToken(l.Token())); return int(T_FUNCTION) +global lval.Token(l.createToken(l.Token())); return int(T_GLOBAL) +goto lval.Token(l.createToken(l.Token())); return int(T_GOTO) +if lval.Token(l.createToken(l.Token())); return int(T_IF) +isset lval.Token(l.createToken(l.Token())); return int(T_ISSET) +implements lval.Token(l.createToken(l.Token())); return int(T_IMPLEMENTS) +instanceof lval.Token(l.createToken(l.Token())); return int(T_INSTANCEOF) +insteadof lval.Token(l.createToken(l.Token())); return int(T_INSTEADOF) +interface lval.Token(l.createToken(l.Token())); return int(T_INTERFACE) +list lval.Token(l.createToken(l.Token())); return int(T_LIST) +namespace lval.Token(l.createToken(l.Token())); return int(T_NAMESPACE) +private lval.Token(l.createToken(l.Token())); return int(T_PRIVATE) +public lval.Token(l.createToken(l.Token())); return int(T_PUBLIC) +print lval.Token(l.createToken(l.Token())); return int(T_PRINT) +protected lval.Token(l.createToken(l.Token())); return int(T_PROTECTED) +return lval.Token(l.createToken(l.Token())); return int(T_RETURN) +static lval.Token(l.createToken(l.Token())); return int(T_STATIC) +switch lval.Token(l.createToken(l.Token())); return int(T_SWITCH) +throw lval.Token(l.createToken(l.Token())); return int(T_THROW) +trait lval.Token(l.createToken(l.Token())); return int(T_TRAIT) +try lval.Token(l.createToken(l.Token())); return int(T_TRY) +unset lval.Token(l.createToken(l.Token())); return int(T_UNSET) +use lval.Token(l.createToken(l.Token())); return int(T_USE) +var lval.Token(l.createToken(l.Token())); return int(T_VAR) +while lval.Token(l.createToken(l.Token())); return int(T_WHILE) +yield[ \t\n\r]+from lval.Token(l.createToken(l.Token())); return int(T_YIELD_FROM) +yield lval.Token(l.createToken(l.Token())); return int(T_YIELD) +include lval.Token(l.createToken(l.Token())); return int(T_INCLUDE) +include_once lval.Token(l.createToken(l.Token())); return int(T_INCLUDE_ONCE) +require lval.Token(l.createToken(l.Token())); return int(T_REQUIRE) +require_once lval.Token(l.createToken(l.Token())); return int(T_REQUIRE_ONCE) +__CLASS__ lval.Token(l.createToken(l.Token())); return int(T_CLASS_C) +__DIR__ lval.Token(l.createToken(l.Token())); return int(T_DIR) +__FILE__ lval.Token(l.createToken(l.Token())); return int(T_FILE) +__FUNCTION__ lval.Token(l.createToken(l.Token())); return int(T_FUNC_C) +__LINE__ lval.Token(l.createToken(l.Token())); return int(T_LINE) +__NAMESPACE__ lval.Token(l.createToken(l.Token())); return int(T_NS_C) +__METHOD__ lval.Token(l.createToken(l.Token())); return int(T_METHOD_C) +__TRAIT__ lval.Token(l.createToken(l.Token())); return int(T_TRAIT_C) +__halt_compiler lval.Token(l.createToken(l.Token())); return int(T_HALT_COMPILER) +\([ \t]*array[ \t]*\) lval.Token(l.createToken(l.Token())); return int(T_ARRAY_CAST) +\([ \t]*(bool|boolean)[ \t]*\) lval.Token(l.createToken(l.Token())); return int(T_BOOL_CAST) +\([ \t]*(real|double|float)[ \t]*\) lval.Token(l.createToken(l.Token())); return int(T_DOUBLE_CAST) +\([ \t]*(int|integer)[ \t]*\) lval.Token(l.createToken(l.Token())); return int(T_INT_CAST) +\([ \t]*object[ \t]*\) lval.Token(l.createToken(l.Token())); return int(T_OBJECT_CAST) +\([ \t]*(string|binary)[ \t]*\) lval.Token(l.createToken(l.Token())); return int(T_STRING_CAST) +\([ \t]*unset[ \t]*\) lval.Token(l.createToken(l.Token())); return int(T_UNSET_CAST) +new lval.Token(l.createToken(l.Token())); return int(T_NEW) +and lval.Token(l.createToken(l.Token())); return int(T_LOGICAL_AND) +or lval.Token(l.createToken(l.Token())); return int(T_LOGICAL_OR) +xor lval.Token(l.createToken(l.Token())); return int(T_LOGICAL_XOR) +\\ lval.Token(l.createToken(l.Token())); return int(T_NS_SEPARATOR) +\.\.\. lval.Token(l.createToken(l.Token())); return int(T_ELLIPSIS) +:: lval.Token(l.createToken(l.Token())); return int(T_PAAMAYIM_NEKUDOTAYIM) // T_DOUBLE_COLON +&& lval.Token(l.createToken(l.Token())); return int(T_BOOLEAN_AND) +\|\| lval.Token(l.createToken(l.Token())); return int(T_BOOLEAN_OR) +&= lval.Token(l.createToken(l.Token())); return int(T_AND_EQUAL) +\|= lval.Token(l.createToken(l.Token())); return int(T_OR_EQUAL) +\.= lval.Token(l.createToken(l.Token())); return int(T_CONCAT_EQUAL) +\*= lval.Token(l.createToken(l.Token())); return int(T_MUL_EQUAL) +\*\*= lval.Token(l.createToken(l.Token())); return int(T_POW_EQUAL) +[/]= lval.Token(l.createToken(l.Token())); return int(T_DIV_EQUAL) +\+= lval.Token(l.createToken(l.Token())); return int(T_PLUS_EQUAL) +-= lval.Token(l.createToken(l.Token())); return int(T_MINUS_EQUAL) +\^= lval.Token(l.createToken(l.Token())); return int(T_XOR_EQUAL) +%= lval.Token(l.createToken(l.Token())); return int(T_MOD_EQUAL) +-- lval.Token(l.createToken(l.Token())); return int(T_DEC) +\+\+ lval.Token(l.createToken(l.Token())); return int(T_INC) +=> lval.Token(l.createToken(l.Token())); return int(T_DOUBLE_ARROW) +\<=\> lval.Token(l.createToken(l.Token())); return int(T_SPACESHIP) +\!=|\<\> lval.Token(l.createToken(l.Token())); return int(T_IS_NOT_EQUAL) +\!== lval.Token(l.createToken(l.Token())); return int(T_IS_NOT_IDENTICAL) +== lval.Token(l.createToken(l.Token())); return int(T_IS_EQUAL) +=== lval.Token(l.createToken(l.Token())); return int(T_IS_IDENTICAL) +\<\<= lval.Token(l.createToken(l.Token())); return int(T_SL_EQUAL) +\>\>= lval.Token(l.createToken(l.Token())); return int(T_SR_EQUAL) +\>= lval.Token(l.createToken(l.Token())); return int(T_IS_GREATER_OR_EQUAL) +\<= lval.Token(l.createToken(l.Token())); return int(T_IS_SMALLER_OR_EQUAL) +\*\* lval.Token(l.createToken(l.Token())); return int(T_POW) +\<\< lval.Token(l.createToken(l.Token())); return int(T_SL) +\>\> lval.Token(l.createToken(l.Token())); return int(T_SR) +\?\? lval.Token(l.createToken(l.Token())); return int(T_COALESCE) (#|[/][/]) tb := l.Token() @@ -319,16 +319,16 @@ NEW_LINE (\r|\n|\r\n) \{ l.pushState(PHP); lval.Token(l.createToken(l.Token())); return Rune2Class(rune(l.TokenBytes(nil)[0])) \} l.popState(); lval.Token(l.createToken(l.Token())); return Rune2Class(rune(l.TokenBytes(nil)[0])); l.PhpDocComment = "" -\${VAR_NAME} lval.Token(l.createToken(l.Token())); return T_VARIABLE -{VAR_NAME} lval.Token(l.createToken(l.Token())); return T_STRING +\${VAR_NAME} lval.Token(l.createToken(l.Token())); return int(T_VARIABLE) +{VAR_NAME} lval.Token(l.createToken(l.Token())); return int(T_STRING) --> l.begin(PROPERTY);lval.Token(l.createToken(l.Token())); return T_OBJECT_OPERATOR; +-> l.begin(PROPERTY);lval.Token(l.createToken(l.Token())); return int(T_OBJECT_OPERATOR); [ \t\n\r]+ l.addWhiteSpace(l.Token()) --> lval.Token(l.createToken(l.Token())); return T_OBJECT_OPERATOR; -{VAR_NAME} l.begin(PHP);lval.Token(l.createToken(l.Token())); return T_STRING; +-> lval.Token(l.createToken(l.Token())); return int(T_OBJECT_OPERATOR); +{VAR_NAME} l.begin(PHP);lval.Token(l.createToken(l.Token())); return int(T_STRING); . l.ungetChars(1);l.begin(PHP) -[\']([^\\\']*([\\].)*)*[\'] lval.Token(l.createToken(l.Token())); return T_CONSTANT_ENCAPSED_STRING; +[\']([^\\\']*([\\].)*)*[\'] lval.Token(l.createToken(l.Token())); return int(T_CONSTANT_ENCAPSED_STRING); ` l.begin(BACKQUOTE); lval.Token(l.createToken(l.Token())); return Rune2Class(rune(l.TokenBytes(nil)[0])) ` l.begin(PHP); lval.Token(l.createToken(l.Token())); return Rune2Class(rune(l.TokenBytes(nil)[0])) @@ -394,7 +394,7 @@ NEW_LINE (\r|\n|\r\n) l.ungetChars(ungetCnt) lval.Token(l.createToken(heredocToken)); - return T_START_HEREDOC + return int(T_START_HEREDOC) .|[ \t\n\r] searchLabel := []byte{} @@ -409,12 +409,14 @@ NEW_LINE (\r|\n|\r\n) if l.heredocLabel + ";" == string(searchLabel) { l.begin(HEREDOC_END) tb = l.ungetChars(len(l.heredocLabel)+1) + tb = tb[:len(tb)-1] break; } if l.heredocLabel == string(searchLabel) { l.begin(HEREDOC_END) tb = l.ungetChars(len(l.heredocLabel)) + tb = tb[:len(tb)-1] break; } @@ -427,10 +429,10 @@ NEW_LINE (\r|\n|\r\n) } lval.Token(l.createToken(tb) ) - return T_ENCAPSED_AND_WHITESPACE + return int(T_ENCAPSED_AND_WHITESPACE) -{VAR_NAME}\; l.begin(PHP);lval.Token(l.createToken(l.ungetChars(1))); return T_END_HEREDOC -{VAR_NAME} l.begin(PHP);lval.Token(l.createToken(l.Token())); return T_END_HEREDOC +{VAR_NAME}\; l.begin(PHP);lval.Token(l.createToken(l.ungetChars(1))); return int(T_END_HEREDOC) +{VAR_NAME} l.begin(PHP);lval.Token(l.createToken(l.Token())); return int(T_END_HEREDOC) [b]?[\"] binPrefix := l.Token()[0].Rune == 'b' @@ -453,7 +455,7 @@ NEW_LINE (\r|\n|\r\n) switch c { case '"' : c = l.Next(); - lval.Token(l.createToken(l.Token())); return T_CONSTANT_ENCAPSED_STRING + lval.Token(l.createToken(l.Token())); return int(T_CONSTANT_ENCAPSED_STRING) break F; case '$': @@ -480,8 +482,8 @@ NEW_LINE (\r|\n|\r\n) } \" l.popState(); lval.Token(l.createToken(l.Token())); return Rune2Class(l.Token()[0].Rune) -\{\$ lval.Token(l.createToken(l.ungetChars(1))); l.pushState(PHP); return T_CURLY_OPEN -\$\{ l.pushState(STRING_VAR_NAME); lval.Token(l.createToken(l.Token())); return T_DOLLAR_OPEN_CURLY_BRACES +\{\$ lval.Token(l.createToken(l.ungetChars(1))); l.pushState(PHP); return int(T_CURLY_OPEN) +\$\{ l.pushState(STRING_VAR_NAME); lval.Token(l.createToken(l.Token())); return int(T_DOLLAR_OPEN_CURLY_BRACES) \${VAR_NAME} l.ungetChars(len(l.Token()));l.pushState(STRING_VAR) .|[ \t\n\r] currentChar := l.Prev @@ -492,14 +494,14 @@ NEW_LINE (\r|\n|\r\n) if c == '{' || isValidFirstVarNameRune(rune(c)) { l.ungetChars(1) lval.Token(l.createToken(tb[:len(tb)-1])); - return T_ENCAPSED_AND_WHITESPACE + return int(T_ENCAPSED_AND_WHITESPACE) } case '{': if rune(c) == '$' { l.ungetChars(1) lval.Token(l.createToken(tb[:len(tb)-1])); - return T_ENCAPSED_AND_WHITESPACE + return int(T_ENCAPSED_AND_WHITESPACE) } case '\\': @@ -510,7 +512,7 @@ NEW_LINE (\r|\n|\r\n) if rune(c) == '"' { lval.Token(l.createToken(l.Token())); - return T_ENCAPSED_AND_WHITESPACE + return int(T_ENCAPSED_AND_WHITESPACE) } currentChar = l.Last @@ -532,14 +534,14 @@ NEW_LINE (\r|\n|\r\n) if c == '{' || isValidFirstVarNameRune(rune(c)) { l.ungetChars(1) lval.Token(l.createToken(tb[:len(tb)-1])); - return T_ENCAPSED_AND_WHITESPACE + return int(T_ENCAPSED_AND_WHITESPACE) } case '{': if rune(c) == '$' { l.ungetChars(1) lval.Token(l.createToken(tb[:len(tb)-1])); - return T_ENCAPSED_AND_WHITESPACE + return int(T_ENCAPSED_AND_WHITESPACE) } case '\\': @@ -550,7 +552,7 @@ NEW_LINE (\r|\n|\r\n) if rune(c) == '`' { lval.Token(l.createToken(l.Token())); - return T_ENCAPSED_AND_WHITESPACE + return int(T_ENCAPSED_AND_WHITESPACE) } currentChar = l.Last @@ -564,90 +566,105 @@ NEW_LINE (\r|\n|\r\n) .|[ \t\n\r] searchLabel := []byte{} - tb := []lex.Char{} + currentChar := l.Prev + tb := []lex.Char{currentChar} - for { - if c == -1 { - break; - } - + HEREDOC_FOR:for { nls := 0 - switch c { + switch currentChar.Rune { case '\r': - nls = 1 - c := l.Next() - if c != '\n' { - nls = 0 - l.ungetChars(0) + if c == '\n' { + nls = 1 + currentChar := l.Last + tb = append(tb, currentChar) + c = l.Next(); } fallthrough case '\n': - if l.heredocLabel + ";" == string(searchLabel) { + if l.heredocLabel + ";" == string(searchLabel) { l.begin(HEREDOC_END) - tb = l.ungetChars(len(l.heredocLabel)+1+nls) + l.ungetChars(len(l.heredocLabel)+1+nls) + + i := len(tb) - len(l.heredocLabel) - 3 - nls + if i < 1 { + break HEREDOC_FOR; + } + tb = tb[:i] + lval.Token(l.createToken(tb)); - return T_ENCAPSED_AND_WHITESPACE + return int(T_ENCAPSED_AND_WHITESPACE) } if l.heredocLabel == string(searchLabel) { l.begin(HEREDOC_END) - tb = l.ungetChars(len(l.heredocLabel)+nls) + l.ungetChars(len(l.heredocLabel)+nls) + + i := len(tb) - len(l.heredocLabel) - 2 - nls + if i < 1 { + break HEREDOC_FOR; + } + tb = tb[:i] + lval.Token(l.createToken(tb)); - return T_ENCAPSED_AND_WHITESPACE + return int(T_ENCAPSED_AND_WHITESPACE) } searchLabel = []byte{} - + case '$': - c = l.Next(); - if rune(c) == '{' || isValidFirstVarNameRune(rune(c)) { - tb = l.ungetChars(1) - lval.Token(l.createToken(tb)); - return T_ENCAPSED_AND_WHITESPACE - } - l.ungetChars(0) - + if c == '{' || isValidFirstVarNameRune(rune(c)) { + l.ungetChars(1) + lval.Token(l.createToken(tb[:len(tb)-1])); + return int(T_ENCAPSED_AND_WHITESPACE) + } + case '{': - c = l.Next(); if rune(c) == '$' { - tb = l.ungetChars(1) - lval.Token(l.createToken(tb)); - return T_ENCAPSED_AND_WHITESPACE - } - l.ungetChars(0) + l.ungetChars(1) + lval.Token(l.createToken(tb[:len(tb)-1])); + return int(T_ENCAPSED_AND_WHITESPACE) + } case '\\': - c = l.Next(); - if c == '\n' || c == '\r' { - l.ungetChars(0) + if c != '\n' && c != '\r' { + currentChar := l.Last + tb = append(tb, currentChar) + c = l.Next(); } default: - searchLabel = append(searchLabel, byte(rune(c))) + searchLabel = append(searchLabel, byte(rune(currentChar.Rune))) } + if c == -1 { + break; + } + + currentChar = l.Last + tb = append(tb, currentChar) c = l.Next() + } -\${VAR_NAME} lval.Token(l.createToken(l.Token())); return T_VARIABLE -->{VAR_NAME} lval.Token(l.createToken(l.ungetChars(len(l.Token())-2))); return T_OBJECT_OPERATOR -{VAR_NAME} l.popState();lval.Token(l.createToken(l.Token())); return T_STRING +\${VAR_NAME} lval.Token(l.createToken(l.Token())); return int(T_VARIABLE) +->{VAR_NAME} lval.Token(l.createToken(l.ungetChars(len(l.Token())-2))); return int(T_OBJECT_OPERATOR) +{VAR_NAME} l.popState();lval.Token(l.createToken(l.Token())); return int(T_STRING) \[ l.pushState(STRING_VAR_INDEX);lval.Token(l.createToken(l.Token())); return Rune2Class(rune(l.TokenBytes(nil)[0])) .|[ \t\n\r] l.ungetChars(1);l.popState() -{LNUM}|{HNUM}|{BNUM} lval.Token(l.createToken(l.Token())); return T_NUM_STRING -\${VAR_NAME} lval.Token(l.createToken(l.Token())); return T_VARIABLE -{VAR_NAME} lval.Token(l.createToken(l.Token())); return T_STRING +{LNUM}|{HNUM}|{BNUM} lval.Token(l.createToken(l.Token())); return int(T_NUM_STRING) +\${VAR_NAME} lval.Token(l.createToken(l.Token())); return int(T_VARIABLE) +{VAR_NAME} lval.Token(l.createToken(l.Token())); return int(T_STRING) \] l.popState(); l.popState();lval.Token(l.createToken(l.Token())); return Rune2Class(rune(l.TokenBytes(nil)[0])) -[ \n\r\t\\'#] l.popState(); l.popState();lval.Token(l.createToken(l.Token())); return T_ENCAPSED_AND_WHITESPACE +[ \n\r\t\\'#] l.popState(); l.popState();lval.Token(l.createToken(l.Token())); return int(T_ENCAPSED_AND_WHITESPACE) {OPERATORS} lval.Token(l.createToken(l.Token())); return Rune2Class(rune(l.TokenBytes(nil)[0])) . lval.Token(l.createToken(l.Token())); return Rune2Class(rune(l.TokenBytes(nil)[0])) -{VAR_NAME}[\[\}] l.popState();l.pushState(PHP);lval.Token(l.createToken(l.ungetChars(1))); return T_STRING_VARNAME +{VAR_NAME}[\[\}] l.popState();l.pushState(PHP);lval.Token(l.createToken(l.ungetChars(1))); return int(T_STRING_VARNAME) . l.ungetChars(1);l.popState();l.pushState(PHP) %% diff --git a/scanner/scanner_test.go b/scanner/scanner_test.go index 408d0ff..c640944 100644 --- a/scanner/scanner_test.go +++ b/scanner/scanner_test.go @@ -230,194 +230,194 @@ func TestTokens(t *testing.T) { ` - expected := []int{ - scanner.T_INLINE_HTML, - scanner.Rune2Class(';'), - scanner.T_ECHO, - scanner.Rune2Class(';'), + expected := []string{ + scanner.T_INLINE_HTML.String(), + scanner.LexerToken(scanner.Rune2Class(';')).String(), + scanner.T_ECHO.String(), + scanner.LexerToken(scanner.Rune2Class(';')).String(), - scanner.T_DNUMBER, - scanner.T_DNUMBER, - scanner.T_DNUMBER, - scanner.T_DNUMBER, + scanner.T_DNUMBER.String(), + scanner.T_DNUMBER.String(), + scanner.T_DNUMBER.String(), + scanner.T_DNUMBER.String(), - scanner.T_LNUMBER, - scanner.T_DNUMBER, + scanner.T_LNUMBER.String(), + scanner.T_DNUMBER.String(), - scanner.T_LNUMBER, - scanner.T_DNUMBER, + scanner.T_LNUMBER.String(), + scanner.T_DNUMBER.String(), - scanner.T_LNUMBER, - scanner.T_DNUMBER, + scanner.T_LNUMBER.String(), + scanner.T_DNUMBER.String(), - scanner.T_ABSTRACT, - scanner.T_ARRAY, - scanner.T_AS, - scanner.T_BREAK, - scanner.T_CALLABLE, - scanner.T_CASE, - scanner.T_CATCH, - scanner.T_CLASS, - scanner.T_CLONE, - scanner.T_CONST, - scanner.T_CONTINUE, - scanner.T_DECLARE, - scanner.T_DEFAULT, - scanner.T_DO, - scanner.T_ECHO, - scanner.T_ELSE, - scanner.T_ELSEIF, - scanner.T_EMPTY, - scanner.T_ENDDECLARE, - scanner.T_ENDFOR, - scanner.T_ENDFOREACH, - scanner.T_ENDIF, - scanner.T_ENDSWITCH, - scanner.T_ENDWHILE, - scanner.T_EVAL, - scanner.T_EXIT, - scanner.T_EXTENDS, - scanner.T_FINAL, - scanner.T_FINALLY, - scanner.T_FOR, - scanner.T_FOREACH, - scanner.T_FUNCTION, - scanner.T_FUNCTION, - scanner.T_GLOBAL, - scanner.T_GOTO, - scanner.T_IF, - scanner.T_ISSET, - scanner.T_IMPLEMENTS, - scanner.T_INSTANCEOF, - scanner.T_INSTEADOF, - scanner.T_INTERFACE, - scanner.T_LIST, - scanner.T_NAMESPACE, - scanner.T_PRIVATE, - scanner.T_PUBLIC, - scanner.T_PRINT, - scanner.T_PROTECTED, - scanner.T_RETURN, - scanner.T_STATIC, - scanner.T_SWITCH, - scanner.T_THROW, - scanner.T_TRAIT, - scanner.T_TRY, - scanner.T_UNSET, - scanner.T_USE, - scanner.T_VAR, - scanner.T_WHILE, - scanner.T_YIELD_FROM, - scanner.T_YIELD, - scanner.T_INCLUDE, - scanner.T_INCLUDE_ONCE, - scanner.T_REQUIRE, - scanner.T_REQUIRE_ONCE, + scanner.T_ABSTRACT.String(), + scanner.T_ARRAY.String(), + scanner.T_AS.String(), + scanner.T_BREAK.String(), + scanner.T_CALLABLE.String(), + scanner.T_CASE.String(), + scanner.T_CATCH.String(), + scanner.T_CLASS.String(), + scanner.T_CLONE.String(), + scanner.T_CONST.String(), + scanner.T_CONTINUE.String(), + scanner.T_DECLARE.String(), + scanner.T_DEFAULT.String(), + scanner.T_DO.String(), + scanner.T_ECHO.String(), + scanner.T_ELSE.String(), + scanner.T_ELSEIF.String(), + scanner.T_EMPTY.String(), + scanner.T_ENDDECLARE.String(), + scanner.T_ENDFOR.String(), + scanner.T_ENDFOREACH.String(), + scanner.T_ENDIF.String(), + scanner.T_ENDSWITCH.String(), + scanner.T_ENDWHILE.String(), + scanner.T_EVAL.String(), + scanner.T_EXIT.String(), + scanner.T_EXTENDS.String(), + scanner.T_FINAL.String(), + scanner.T_FINALLY.String(), + scanner.T_FOR.String(), + scanner.T_FOREACH.String(), + scanner.T_FUNCTION.String(), + scanner.T_FUNCTION.String(), + scanner.T_GLOBAL.String(), + scanner.T_GOTO.String(), + scanner.T_IF.String(), + scanner.T_ISSET.String(), + scanner.T_IMPLEMENTS.String(), + scanner.T_INSTANCEOF.String(), + scanner.T_INSTEADOF.String(), + scanner.T_INTERFACE.String(), + scanner.T_LIST.String(), + scanner.T_NAMESPACE.String(), + scanner.T_PRIVATE.String(), + scanner.T_PUBLIC.String(), + scanner.T_PRINT.String(), + scanner.T_PROTECTED.String(), + scanner.T_RETURN.String(), + scanner.T_STATIC.String(), + scanner.T_SWITCH.String(), + scanner.T_THROW.String(), + scanner.T_TRAIT.String(), + scanner.T_TRY.String(), + scanner.T_UNSET.String(), + scanner.T_USE.String(), + scanner.T_VAR.String(), + scanner.T_WHILE.String(), + scanner.T_YIELD_FROM.String(), + scanner.T_YIELD.String(), + scanner.T_INCLUDE.String(), + scanner.T_INCLUDE_ONCE.String(), + scanner.T_REQUIRE.String(), + scanner.T_REQUIRE_ONCE.String(), - scanner.T_CLASS_C, - scanner.T_DIR, - scanner.T_FILE, - scanner.T_FUNC_C, - scanner.T_LINE, - scanner.T_NS_C, - scanner.T_METHOD_C, - scanner.T_TRAIT_C, - scanner.T_HALT_COMPILER, + scanner.T_CLASS_C.String(), + scanner.T_DIR.String(), + scanner.T_FILE.String(), + scanner.T_FUNC_C.String(), + scanner.T_LINE.String(), + scanner.T_NS_C.String(), + scanner.T_METHOD_C.String(), + scanner.T_TRAIT_C.String(), + scanner.T_HALT_COMPILER.String(), - scanner.T_NEW, - scanner.T_LOGICAL_AND, - scanner.T_LOGICAL_OR, - scanner.T_LOGICAL_XOR, + scanner.T_NEW.String(), + scanner.T_LOGICAL_AND.String(), + scanner.T_LOGICAL_OR.String(), + scanner.T_LOGICAL_XOR.String(), - scanner.T_NS_SEPARATOR, - scanner.T_ELLIPSIS, - scanner.T_PAAMAYIM_NEKUDOTAYIM, - scanner.T_BOOLEAN_AND, - scanner.T_BOOLEAN_OR, - scanner.T_AND_EQUAL, - scanner.T_OR_EQUAL, - scanner.T_CONCAT_EQUAL, - scanner.T_MUL_EQUAL, - scanner.T_POW_EQUAL, - scanner.T_DIV_EQUAL, - scanner.T_PLUS_EQUAL, - scanner.T_MINUS_EQUAL, - scanner.T_XOR_EQUAL, - scanner.T_MOD_EQUAL, - scanner.T_DEC, - scanner.T_INC, - scanner.T_DOUBLE_ARROW, - scanner.T_SPACESHIP, - scanner.T_IS_NOT_EQUAL, - scanner.T_IS_NOT_EQUAL, - scanner.T_IS_NOT_IDENTICAL, - scanner.T_IS_EQUAL, - scanner.T_IS_IDENTICAL, - scanner.T_SL_EQUAL, - scanner.T_SR_EQUAL, - scanner.T_IS_GREATER_OR_EQUAL, - scanner.T_IS_SMALLER_OR_EQUAL, - scanner.T_POW, - scanner.T_SL, - scanner.T_SR, - scanner.T_COALESCE, + scanner.T_NS_SEPARATOR.String(), + scanner.T_ELLIPSIS.String(), + scanner.T_PAAMAYIM_NEKUDOTAYIM.String(), + scanner.T_BOOLEAN_AND.String(), + scanner.T_BOOLEAN_OR.String(), + scanner.T_AND_EQUAL.String(), + scanner.T_OR_EQUAL.String(), + scanner.T_CONCAT_EQUAL.String(), + scanner.T_MUL_EQUAL.String(), + scanner.T_POW_EQUAL.String(), + scanner.T_DIV_EQUAL.String(), + scanner.T_PLUS_EQUAL.String(), + scanner.T_MINUS_EQUAL.String(), + scanner.T_XOR_EQUAL.String(), + scanner.T_MOD_EQUAL.String(), + scanner.T_DEC.String(), + scanner.T_INC.String(), + scanner.T_DOUBLE_ARROW.String(), + scanner.T_SPACESHIP.String(), + scanner.T_IS_NOT_EQUAL.String(), + scanner.T_IS_NOT_EQUAL.String(), + scanner.T_IS_NOT_IDENTICAL.String(), + scanner.T_IS_EQUAL.String(), + scanner.T_IS_IDENTICAL.String(), + scanner.T_SL_EQUAL.String(), + scanner.T_SR_EQUAL.String(), + scanner.T_IS_GREATER_OR_EQUAL.String(), + scanner.T_IS_SMALLER_OR_EQUAL.String(), + scanner.T_POW.String(), + scanner.T_SL.String(), + scanner.T_SR.String(), + scanner.T_COALESCE.String(), - scanner.Rune2Class(';'), - scanner.Rune2Class(':'), - scanner.Rune2Class(','), - scanner.Rune2Class('.'), - scanner.Rune2Class('['), - scanner.Rune2Class(']'), - scanner.Rune2Class('('), - scanner.Rune2Class(')'), - scanner.Rune2Class('|'), - scanner.Rune2Class('/'), - scanner.Rune2Class('^'), - scanner.Rune2Class('&'), - scanner.Rune2Class('+'), - scanner.Rune2Class('-'), - scanner.Rune2Class('*'), - scanner.Rune2Class('='), - scanner.Rune2Class('%'), - scanner.Rune2Class('!'), - scanner.Rune2Class('~'), - scanner.Rune2Class('$'), - scanner.Rune2Class('<'), - scanner.Rune2Class('>'), - scanner.Rune2Class('?'), - scanner.Rune2Class('@'), - scanner.Rune2Class('{'), - scanner.Rune2Class('}'), + scanner.LexerToken(scanner.Rune2Class(';')).String(), + scanner.LexerToken(scanner.Rune2Class(':')).String(), + scanner.LexerToken(scanner.Rune2Class(',')).String(), + scanner.LexerToken(scanner.Rune2Class('.')).String(), + scanner.LexerToken(scanner.Rune2Class('[')).String(), + scanner.LexerToken(scanner.Rune2Class(']')).String(), + scanner.LexerToken(scanner.Rune2Class('(')).String(), + scanner.LexerToken(scanner.Rune2Class(')')).String(), + scanner.LexerToken(scanner.Rune2Class('|')).String(), + scanner.LexerToken(scanner.Rune2Class('/')).String(), + scanner.LexerToken(scanner.Rune2Class('^')).String(), + scanner.LexerToken(scanner.Rune2Class('&')).String(), + scanner.LexerToken(scanner.Rune2Class('+')).String(), + scanner.LexerToken(scanner.Rune2Class('-')).String(), + scanner.LexerToken(scanner.Rune2Class('*')).String(), + scanner.LexerToken(scanner.Rune2Class('=')).String(), + scanner.LexerToken(scanner.Rune2Class('%')).String(), + scanner.LexerToken(scanner.Rune2Class('!')).String(), + scanner.LexerToken(scanner.Rune2Class('~')).String(), + scanner.LexerToken(scanner.Rune2Class('$')).String(), + scanner.LexerToken(scanner.Rune2Class('<')).String(), + scanner.LexerToken(scanner.Rune2Class('>')).String(), + scanner.LexerToken(scanner.Rune2Class('?')).String(), + scanner.LexerToken(scanner.Rune2Class('@')).String(), + scanner.LexerToken(scanner.Rune2Class('{')).String(), + scanner.LexerToken(scanner.Rune2Class('}')).String(), - scanner.T_VARIABLE, - scanner.T_STRING, + scanner.T_VARIABLE.String(), + scanner.T_STRING.String(), - scanner.T_OBJECT_OPERATOR, - scanner.T_OBJECT_OPERATOR, - scanner.T_STRING, + scanner.T_OBJECT_OPERATOR.String(), + scanner.T_OBJECT_OPERATOR.String(), + scanner.T_STRING.String(), - scanner.T_CONSTANT_ENCAPSED_STRING, - scanner.T_CONSTANT_ENCAPSED_STRING, - scanner.T_CONSTANT_ENCAPSED_STRING, + scanner.T_CONSTANT_ENCAPSED_STRING.String(), + scanner.T_CONSTANT_ENCAPSED_STRING.String(), + scanner.T_CONSTANT_ENCAPSED_STRING.String(), - scanner.T_ARRAY_CAST, - scanner.T_BOOL_CAST, - scanner.T_BOOL_CAST, - scanner.T_DOUBLE_CAST, - scanner.T_DOUBLE_CAST, - scanner.T_DOUBLE_CAST, - scanner.T_INT_CAST, - scanner.T_INT_CAST, - scanner.T_OBJECT_CAST, - scanner.T_STRING_CAST, - scanner.T_STRING_CAST, - scanner.T_UNSET_CAST, + scanner.T_ARRAY_CAST.String(), + scanner.T_BOOL_CAST.String(), + scanner.T_BOOL_CAST.String(), + scanner.T_DOUBLE_CAST.String(), + scanner.T_DOUBLE_CAST.String(), + scanner.T_DOUBLE_CAST.String(), + scanner.T_INT_CAST.String(), + scanner.T_INT_CAST.String(), + scanner.T_OBJECT_CAST.String(), + scanner.T_STRING_CAST.String(), + scanner.T_STRING_CAST.String(), + scanner.T_UNSET_CAST.String(), } lexer := scanner.NewLexer(bytes.NewBufferString(src), "test.php") lexer.WithMeta = true lv := &lval{} - actual := []int{} + actual := []string{} for { token := lexer.Lex(lv) @@ -425,7 +425,7 @@ func TestTokens(t *testing.T) { break } - actual = append(actual, token) + actual = append(actual, scanner.LexerToken(token).String()) } assertEqual(t, expected, actual) @@ -448,65 +448,65 @@ func TestTeplateStringTokens(t *testing.T) { "$0$foo" ` - expected := []int{ - scanner.Rune2Class('"'), - scanner.T_ENCAPSED_AND_WHITESPACE, - scanner.T_VARIABLE, - scanner.Rune2Class('"'), + expected := []string{ + scanner.LexerToken(scanner.Rune2Class('"')).String(), + scanner.T_ENCAPSED_AND_WHITESPACE.String(), + scanner.T_VARIABLE.String(), + scanner.LexerToken(scanner.Rune2Class('"')).String(), - scanner.Rune2Class('"'), - scanner.T_ENCAPSED_AND_WHITESPACE, - scanner.T_VARIABLE, - scanner.T_CURLY_OPEN, - scanner.T_VARIABLE, - scanner.Rune2Class('}'), - scanner.Rune2Class('"'), + scanner.LexerToken(scanner.Rune2Class('"')).String(), + scanner.T_ENCAPSED_AND_WHITESPACE.String(), + scanner.T_VARIABLE.String(), + scanner.T_CURLY_OPEN.String(), + scanner.T_VARIABLE.String(), + scanner.LexerToken(scanner.Rune2Class('}')).String(), + scanner.LexerToken(scanner.Rune2Class('"')).String(), - scanner.Rune2Class('"'), - scanner.T_ENCAPSED_AND_WHITESPACE, - scanner.T_VARIABLE, - scanner.T_ENCAPSED_AND_WHITESPACE, - scanner.T_CURLY_OPEN, - scanner.T_VARIABLE, - scanner.Rune2Class('}'), - scanner.T_ENCAPSED_AND_WHITESPACE, - scanner.T_DOLLAR_OPEN_CURLY_BRACES, - scanner.T_STRING_VARNAME, - scanner.Rune2Class('}'), - scanner.T_ENCAPSED_AND_WHITESPACE, - scanner.Rune2Class('"'), + scanner.LexerToken(scanner.Rune2Class('"')).String(), + scanner.T_ENCAPSED_AND_WHITESPACE.String(), + scanner.T_VARIABLE.String(), + scanner.T_ENCAPSED_AND_WHITESPACE.String(), + scanner.T_CURLY_OPEN.String(), + scanner.T_VARIABLE.String(), + scanner.LexerToken(scanner.Rune2Class('}')).String(), + scanner.T_ENCAPSED_AND_WHITESPACE.String(), + scanner.T_DOLLAR_OPEN_CURLY_BRACES.String(), + scanner.T_STRING_VARNAME.String(), + scanner.LexerToken(scanner.Rune2Class('}')).String(), + scanner.T_ENCAPSED_AND_WHITESPACE.String(), + scanner.LexerToken(scanner.Rune2Class('"')).String(), - scanner.Rune2Class('"'), - scanner.T_CURLY_OPEN, - scanner.T_VARIABLE, - scanner.Rune2Class('}'), - scanner.Rune2Class('"'), + scanner.LexerToken(scanner.Rune2Class('"')).String(), + scanner.T_CURLY_OPEN.String(), + scanner.T_VARIABLE.String(), + scanner.LexerToken(scanner.Rune2Class('}')).String(), + scanner.LexerToken(scanner.Rune2Class('"')).String(), - scanner.Rune2Class('"'), - scanner.T_VARIABLE, - scanner.T_ENCAPSED_AND_WHITESPACE, - scanner.Rune2Class('"'), + scanner.LexerToken(scanner.Rune2Class('"')).String(), + scanner.T_VARIABLE.String(), + scanner.T_ENCAPSED_AND_WHITESPACE.String(), + scanner.LexerToken(scanner.Rune2Class('"')).String(), - scanner.Rune2Class('"'), - scanner.T_VARIABLE, - scanner.T_ENCAPSED_AND_WHITESPACE, - scanner.Rune2Class('"'), + scanner.LexerToken(scanner.Rune2Class('"')).String(), + scanner.T_VARIABLE.String(), + scanner.T_ENCAPSED_AND_WHITESPACE.String(), + scanner.LexerToken(scanner.Rune2Class('"')).String(), - scanner.Rune2Class('"'), - scanner.T_ENCAPSED_AND_WHITESPACE, - scanner.T_VARIABLE, - scanner.Rune2Class('"'), + scanner.LexerToken(scanner.Rune2Class('"')).String(), + scanner.T_ENCAPSED_AND_WHITESPACE.String(), + scanner.T_VARIABLE.String(), + scanner.LexerToken(scanner.Rune2Class('"')).String(), - scanner.Rune2Class('"'), - scanner.T_ENCAPSED_AND_WHITESPACE, - scanner.T_VARIABLE, - scanner.Rune2Class('"'), + scanner.LexerToken(scanner.Rune2Class('"')).String(), + scanner.T_ENCAPSED_AND_WHITESPACE.String(), + scanner.T_VARIABLE.String(), + scanner.LexerToken(scanner.Rune2Class('"')).String(), } lexer := scanner.NewLexer(bytes.NewBufferString(src), "test.php") lexer.WithMeta = true lv := &lval{} - actual := []int{} + actual := []string{} for { token := lexer.Lex(lv) @@ -514,7 +514,7 @@ func TestTeplateStringTokens(t *testing.T) { break } - actual = append(actual, token) + actual = append(actual, scanner.LexerToken(token).String()) } assertEqual(t, expected, actual) @@ -534,65 +534,65 @@ func TestBackquoteStringTokens(t *testing.T) { ` + "`$0$foo`" + ` ` - expected := []int{ - scanner.Rune2Class('`'), - scanner.T_ENCAPSED_AND_WHITESPACE, - scanner.T_VARIABLE, - scanner.Rune2Class('`'), + expected := []string{ + scanner.LexerToken(scanner.Rune2Class('`')).String(), + scanner.T_ENCAPSED_AND_WHITESPACE.String(), + scanner.T_VARIABLE.String(), + scanner.LexerToken(scanner.Rune2Class('`')).String(), - scanner.Rune2Class('`'), - scanner.T_ENCAPSED_AND_WHITESPACE, - scanner.T_VARIABLE, - scanner.T_CURLY_OPEN, - scanner.T_VARIABLE, - scanner.Rune2Class('}'), - scanner.Rune2Class('`'), + scanner.LexerToken(scanner.Rune2Class('`')).String(), + scanner.T_ENCAPSED_AND_WHITESPACE.String(), + scanner.T_VARIABLE.String(), + scanner.T_CURLY_OPEN.String(), + scanner.T_VARIABLE.String(), + scanner.LexerToken(scanner.Rune2Class('}')).String(), + scanner.LexerToken(scanner.Rune2Class('`')).String(), - scanner.Rune2Class('`'), - scanner.T_ENCAPSED_AND_WHITESPACE, - scanner.T_VARIABLE, - scanner.T_ENCAPSED_AND_WHITESPACE, - scanner.T_CURLY_OPEN, - scanner.T_VARIABLE, - scanner.Rune2Class('}'), - scanner.T_ENCAPSED_AND_WHITESPACE, - scanner.T_DOLLAR_OPEN_CURLY_BRACES, - scanner.T_STRING_VARNAME, - scanner.Rune2Class('}'), - scanner.T_ENCAPSED_AND_WHITESPACE, - scanner.Rune2Class('`'), + scanner.LexerToken(scanner.Rune2Class('`')).String(), + scanner.T_ENCAPSED_AND_WHITESPACE.String(), + scanner.T_VARIABLE.String(), + scanner.T_ENCAPSED_AND_WHITESPACE.String(), + scanner.T_CURLY_OPEN.String(), + scanner.T_VARIABLE.String(), + scanner.LexerToken(scanner.Rune2Class('}')).String(), + scanner.T_ENCAPSED_AND_WHITESPACE.String(), + scanner.T_DOLLAR_OPEN_CURLY_BRACES.String(), + scanner.T_STRING_VARNAME.String(), + scanner.LexerToken(scanner.Rune2Class('}')).String(), + scanner.T_ENCAPSED_AND_WHITESPACE.String(), + scanner.LexerToken(scanner.Rune2Class('`')).String(), - scanner.Rune2Class('`'), - scanner.T_CURLY_OPEN, - scanner.T_VARIABLE, - scanner.Rune2Class('}'), - scanner.Rune2Class('`'), + scanner.LexerToken(scanner.Rune2Class('`')).String(), + scanner.T_CURLY_OPEN.String(), + scanner.T_VARIABLE.String(), + scanner.LexerToken(scanner.Rune2Class('}')).String(), + scanner.LexerToken(scanner.Rune2Class('`')).String(), - scanner.Rune2Class('`'), - scanner.T_VARIABLE, - scanner.T_ENCAPSED_AND_WHITESPACE, - scanner.Rune2Class('`'), + scanner.LexerToken(scanner.Rune2Class('`')).String(), + scanner.T_VARIABLE.String(), + scanner.T_ENCAPSED_AND_WHITESPACE.String(), + scanner.LexerToken(scanner.Rune2Class('`')).String(), - scanner.Rune2Class('`'), - scanner.T_VARIABLE, - scanner.T_ENCAPSED_AND_WHITESPACE, - scanner.Rune2Class('`'), + scanner.LexerToken(scanner.Rune2Class('`')).String(), + scanner.T_VARIABLE.String(), + scanner.T_ENCAPSED_AND_WHITESPACE.String(), + scanner.LexerToken(scanner.Rune2Class('`')).String(), - scanner.Rune2Class('`'), - scanner.T_ENCAPSED_AND_WHITESPACE, - scanner.T_VARIABLE, - scanner.Rune2Class('`'), + scanner.LexerToken(scanner.Rune2Class('`')).String(), + scanner.T_ENCAPSED_AND_WHITESPACE.String(), + scanner.T_VARIABLE.String(), + scanner.LexerToken(scanner.Rune2Class('`')).String(), - scanner.Rune2Class('`'), - scanner.T_ENCAPSED_AND_WHITESPACE, - scanner.T_VARIABLE, - scanner.Rune2Class('`'), + scanner.LexerToken(scanner.Rune2Class('`')).String(), + scanner.T_ENCAPSED_AND_WHITESPACE.String(), + scanner.T_VARIABLE.String(), + scanner.LexerToken(scanner.Rune2Class('`')).String(), } lexer := scanner.NewLexer(bytes.NewBufferString(src), "test.php") lexer.WithMeta = true lv := &lval{} - actual := []int{} + actual := []string{} for { token := lexer.Lex(lv) @@ -600,7 +600,7 @@ func TestBackquoteStringTokens(t *testing.T) { break } - actual = append(actual, token) + actual = append(actual, scanner.LexerToken(token).String()) } assertEqual(t, expected, actual) @@ -630,63 +630,64 @@ CAT; CAT; ` - expected := []int{ - scanner.T_START_HEREDOC, - scanner.T_ENCAPSED_AND_WHITESPACE, - scanner.T_END_HEREDOC, - scanner.Rune2Class(';'), + expected := []string{ + scanner.T_START_HEREDOC.String(), + scanner.T_ENCAPSED_AND_WHITESPACE.String(), + scanner.T_END_HEREDOC.String(), + scanner.LexerToken(scanner.Rune2Class(';')).String(), - scanner.T_START_HEREDOC, - scanner.T_ENCAPSED_AND_WHITESPACE, - scanner.T_END_HEREDOC, - scanner.Rune2Class(';'), + scanner.T_START_HEREDOC.String(), + scanner.T_ENCAPSED_AND_WHITESPACE.String(), + scanner.T_END_HEREDOC.String(), + scanner.LexerToken(scanner.Rune2Class(';')).String(), - scanner.T_START_HEREDOC, - scanner.T_ENCAPSED_AND_WHITESPACE, - scanner.T_VARIABLE, - scanner.T_OBJECT_OPERATOR, - scanner.T_STRING, - scanner.T_ENCAPSED_AND_WHITESPACE, - scanner.T_VARIABLE, - scanner.Rune2Class('['), - scanner.T_NUM_STRING, - scanner.Rune2Class(']'), - scanner.T_ENCAPSED_AND_WHITESPACE, - scanner.T_VARIABLE, - scanner.Rune2Class('['), - scanner.T_NUM_STRING, - scanner.Rune2Class(']'), - scanner.T_ENCAPSED_AND_WHITESPACE, - scanner.T_VARIABLE, - scanner.Rune2Class('['), - scanner.T_NUM_STRING, - scanner.Rune2Class(']'), - scanner.T_ENCAPSED_AND_WHITESPACE, - scanner.T_VARIABLE, - scanner.Rune2Class('['), - scanner.T_STRING, - scanner.Rune2Class(']'), - scanner.T_ENCAPSED_AND_WHITESPACE, - scanner.T_VARIABLE, - scanner.Rune2Class('['), - scanner.T_VARIABLE, - scanner.Rune2Class(']'), - scanner.T_ENCAPSED_AND_WHITESPACE, scanner.T_CURLY_OPEN, - scanner.T_VARIABLE, - scanner.Rune2Class('}'), - scanner.T_ENCAPSED_AND_WHITESPACE, - scanner.T_DOLLAR_OPEN_CURLY_BRACES, - scanner.T_STRING_VARNAME, - scanner.Rune2Class('}'), - scanner.T_ENCAPSED_AND_WHITESPACE, - scanner.T_END_HEREDOC, - scanner.Rune2Class(';'), + scanner.T_START_HEREDOC.String(), + scanner.T_ENCAPSED_AND_WHITESPACE.String(), + scanner.T_VARIABLE.String(), + scanner.T_OBJECT_OPERATOR.String(), + scanner.T_STRING.String(), + scanner.T_ENCAPSED_AND_WHITESPACE.String(), + scanner.T_VARIABLE.String(), + scanner.LexerToken(scanner.Rune2Class('[')).String(), + scanner.T_NUM_STRING.String(), + scanner.LexerToken(scanner.Rune2Class(']')).String(), + scanner.T_ENCAPSED_AND_WHITESPACE.String(), + scanner.T_VARIABLE.String(), + scanner.LexerToken(scanner.Rune2Class('[')).String(), + scanner.T_NUM_STRING.String(), + scanner.LexerToken(scanner.Rune2Class(']')).String(), + scanner.T_ENCAPSED_AND_WHITESPACE.String(), + scanner.T_VARIABLE.String(), + scanner.LexerToken(scanner.Rune2Class('[')).String(), + scanner.T_NUM_STRING.String(), + scanner.LexerToken(scanner.Rune2Class(']')).String(), + scanner.T_ENCAPSED_AND_WHITESPACE.String(), + scanner.T_VARIABLE.String(), + scanner.LexerToken(scanner.Rune2Class('[')).String(), + scanner.T_STRING.String(), + scanner.LexerToken(scanner.Rune2Class(']')).String(), + scanner.T_ENCAPSED_AND_WHITESPACE.String(), + scanner.T_VARIABLE.String(), + scanner.LexerToken(scanner.Rune2Class('[')).String(), + scanner.T_VARIABLE.String(), + scanner.LexerToken(scanner.Rune2Class(']')).String(), + scanner.T_ENCAPSED_AND_WHITESPACE.String(), + scanner.T_CURLY_OPEN.String(), + scanner.T_VARIABLE.String(), + scanner.LexerToken(scanner.Rune2Class('}')).String(), + scanner.T_ENCAPSED_AND_WHITESPACE.String(), + scanner.T_DOLLAR_OPEN_CURLY_BRACES.String(), + scanner.T_STRING_VARNAME.String(), + scanner.LexerToken(scanner.Rune2Class('}')).String(), + scanner.T_ENCAPSED_AND_WHITESPACE.String(), + scanner.T_END_HEREDOC.String(), + scanner.LexerToken(scanner.Rune2Class(';')).String(), } lexer := scanner.NewLexer(bytes.NewBufferString(src), "test.php") lexer.WithMeta = true lv := &lval{} - actual := []int{} + actual := []string{} for { token := lexer.Lex(lv) @@ -694,7 +695,7 @@ CAT; break } - actual = append(actual, token) + actual = append(actual, scanner.LexerToken(token).String()) } assertEqual(t, expected, actual) @@ -723,44 +724,42 @@ $foo$bar\ CAT ` - expected := []int{ - scanner.T_START_HEREDOC, - scanner.T_VARIABLE, - scanner.T_ENCAPSED_AND_WHITESPACE, - scanner.T_END_HEREDOC, - scanner.Rune2Class(';'), + expected := []string{ + scanner.T_START_HEREDOC.String(), + scanner.T_VARIABLE.String(), + scanner.T_ENCAPSED_AND_WHITESPACE.String(), + scanner.T_END_HEREDOC.String(), + scanner.LexerToken(scanner.Rune2Class(';')).String(), - scanner.T_START_HEREDOC, - scanner.T_VARIABLE, - scanner.T_ENCAPSED_AND_WHITESPACE, - scanner.T_END_HEREDOC, - scanner.Rune2Class(';'), + scanner.T_START_HEREDOC.String(), + scanner.T_VARIABLE.String(), + scanner.T_ENCAPSED_AND_WHITESPACE.String(), + scanner.T_END_HEREDOC.String(), + scanner.LexerToken(scanner.Rune2Class(';')).String(), - scanner.T_START_HEREDOC, - scanner.T_ENCAPSED_AND_WHITESPACE, - scanner.T_VARIABLE, - scanner.T_ENCAPSED_AND_WHITESPACE, - scanner.T_END_HEREDOC, - scanner.Rune2Class(';'), + scanner.T_START_HEREDOC.String(), + scanner.T_ENCAPSED_AND_WHITESPACE.String(), + scanner.T_VARIABLE.String(), + scanner.T_END_HEREDOC.String(), + scanner.LexerToken(scanner.Rune2Class(';')).String(), - scanner.T_START_HEREDOC, - scanner.T_ENCAPSED_AND_WHITESPACE, - scanner.T_VARIABLE, - scanner.T_ENCAPSED_AND_WHITESPACE, - scanner.T_END_HEREDOC, - scanner.Rune2Class(';'), + scanner.T_START_HEREDOC.String(), + scanner.T_ENCAPSED_AND_WHITESPACE.String(), + scanner.T_VARIABLE.String(), + scanner.T_END_HEREDOC.String(), + scanner.LexerToken(scanner.Rune2Class(';')).String(), - scanner.T_START_HEREDOC, - scanner.T_VARIABLE, - scanner.T_VARIABLE, - scanner.T_ENCAPSED_AND_WHITESPACE, - scanner.T_END_HEREDOC, + scanner.T_START_HEREDOC.String(), + scanner.T_VARIABLE.String(), + scanner.T_VARIABLE.String(), + scanner.T_ENCAPSED_AND_WHITESPACE.String(), + scanner.T_END_HEREDOC.String(), } lexer := scanner.NewLexer(bytes.NewBufferString(src), "test.php") lexer.WithMeta = true lv := &lval{} - actual := []int{} + actual := []string{} for { token := lexer.Lex(lv) @@ -768,7 +767,46 @@ CAT break } - actual = append(actual, token) + actual = append(actual, scanner.LexerToken(token).String()) + } + + assertEqual(t, expected, actual) +} + +func TestHereDocTokens3(t *testing.T) { + src := ` test ` - expected := []int{ - scanner.T_VARIABLE, - scanner.Rune2Class(';'), - scanner.T_INLINE_HTML, + expected := []string{ + scanner.T_VARIABLE.String(), + scanner.LexerToken(scanner.Rune2Class(';')).String(), + scanner.T_INLINE_HTML.String(), - scanner.T_VARIABLE, - scanner.Rune2Class(';'), - scanner.T_INLINE_HTML, + scanner.T_VARIABLE.String(), + scanner.LexerToken(scanner.Rune2Class(';')).String(), + scanner.T_INLINE_HTML.String(), } lexer := scanner.NewLexer(bytes.NewBufferString(src), "test.php") lexer.WithMeta = true lv := &lval{} - actual := []int{} + actual := []string{} for { token := lexer.Lex(lv) @@ -801,7 +839,7 @@ func TestInlineHtmlNopTokens(t *testing.T) { break } - actual = append(actual, token) + actual = append(actual, scanner.LexerToken(token).String()) } assertEqual(t, expected, actual) @@ -810,12 +848,12 @@ func TestInlineHtmlNopTokens(t *testing.T) { func TestStringTokensAfterVariable(t *testing.T) { src := ` Date: Sun, 29 Jul 2018 11:44:38 +0300 Subject: [PATCH 022/117] #51 saving optional tokes and tokens that have different representation as meta --- main.go | 16 +- meta/collection.go | 115 + meta/collection_test.go | 422 +++ meta/comment.go | 39 - meta/comment_test.go | 44 - meta/data.go | 17 + meta/data_test.go | 21 + meta/meta.go | 12 - meta/tokenName.go | 5 +- meta/tokenName_string.go | 4 +- meta/type.go | 11 + meta/type_string.go | 16 + meta/type_test.go | 29 + meta/white_space.go | 37 - meta/white_space_test.go | 44 - node/expr/assign/n_assign.go | 10 +- node/expr/assign/n_assign_ref.go | 10 +- node/expr/assign/n_bitwise_and.go | 10 +- node/expr/assign/n_bitwise_or.go | 10 +- node/expr/assign/n_bitwise_xor.go | 10 +- node/expr/assign/n_concat.go | 10 +- node/expr/assign/n_div.go | 10 +- node/expr/assign/n_minus.go | 10 +- node/expr/assign/n_mod.go | 10 +- node/expr/assign/n_mul.go | 10 +- node/expr/assign/n_plus.go | 10 +- node/expr/assign/n_pow.go | 10 +- node/expr/assign/n_shift_left.go | 10 +- node/expr/assign/n_shift_right.go | 10 +- node/expr/assign/t_meta_test.go | 16 +- node/expr/binary/n_bitwise_and.go | 10 +- node/expr/binary/n_bitwise_or.go | 10 +- node/expr/binary/n_bitwise_xor.go | 10 +- node/expr/binary/n_boolean_and.go | 10 +- node/expr/binary/n_boolean_or.go | 10 +- node/expr/binary/n_coalesce.go | 10 +- node/expr/binary/n_concat.go | 10 +- node/expr/binary/n_div.go | 10 +- node/expr/binary/n_equal.go | 10 +- node/expr/binary/n_greater.go | 10 +- node/expr/binary/n_greater_or_equal.go | 10 +- node/expr/binary/n_identical.go | 10 +- node/expr/binary/n_logical_and.go | 10 +- node/expr/binary/n_logical_or.go | 10 +- node/expr/binary/n_logical_xor.go | 10 +- node/expr/binary/n_minus.go | 10 +- node/expr/binary/n_mod.go | 10 +- node/expr/binary/n_mul.go | 10 +- node/expr/binary/n_not_equal.go | 10 +- node/expr/binary/n_not_identical.go | 10 +- node/expr/binary/n_plus.go | 10 +- node/expr/binary/n_pow.go | 10 +- node/expr/binary/n_shift_left.go | 10 +- node/expr/binary/n_shift_right.go | 10 +- node/expr/binary/n_smaller.go | 10 +- node/expr/binary/n_smaller_or_equal.go | 10 +- node/expr/binary/n_spaceship.go | 10 +- node/expr/binary/t_meta_test.go | 16 +- node/expr/cast/n_cast_array.go | 10 +- node/expr/cast/n_cast_bool.go | 10 +- node/expr/cast/n_cast_double.go | 10 +- node/expr/cast/n_cast_int.go | 10 +- node/expr/cast/n_cast_object.go | 10 +- node/expr/cast/n_cast_string.go | 10 +- node/expr/cast/n_cast_unset.go | 10 +- node/expr/cast/t_meta_test.go | 16 +- node/expr/n_array.go | 10 +- node/expr/n_array_dim_fetch.go | 10 +- node/expr/n_array_item.go | 10 +- node/expr/n_bitwise_not.go | 10 +- node/expr/n_boolean_not.go | 10 +- node/expr/n_class_const_fetch.go | 10 +- node/expr/n_clone.go | 10 +- node/expr/n_closure.go | 10 +- node/expr/n_closure_use.go | 10 +- node/expr/n_const_fetch.go | 10 +- node/expr/n_empty.go | 10 +- node/expr/n_error_suppress.go | 10 +- node/expr/n_eval.go | 10 +- node/expr/n_exit.go | 10 +- node/expr/n_function_call.go | 10 +- node/expr/n_include.go | 10 +- node/expr/n_include_once.go | 10 +- node/expr/n_instance_of.go | 10 +- node/expr/n_isset.go | 10 +- node/expr/n_list.go | 10 +- node/expr/n_method_call.go | 10 +- node/expr/n_new.go | 10 +- node/expr/n_post_dec.go | 10 +- node/expr/n_post_inc.go | 10 +- node/expr/n_pre_dec.go | 10 +- node/expr/n_pre_inc.go | 10 +- node/expr/n_print.go | 10 +- node/expr/n_property_fetch.go | 10 +- node/expr/n_reference.go | 10 +- node/expr/n_require.go | 10 +- node/expr/n_require_once.go | 10 +- node/expr/n_shell_exec.go | 10 +- node/expr/n_short_array.go | 10 +- node/expr/n_short_list.go | 10 +- node/expr/n_static_call.go | 10 +- node/expr/n_static_property_fetch.go | 10 +- node/expr/n_ternary.go | 10 +- node/expr/n_unary_minus.go | 10 +- node/expr/n_unary_plus.go | 10 +- node/expr/n_variable.go | 19 +- node/expr/n_yield.go | 10 +- node/expr/n_yield_from.go | 10 +- node/expr/t_meta_test.go | 16 +- node/expr/t_visitor_test.go | 4 +- node/n_argument.go | 10 +- node/n_argument_list.go | 10 +- node/n_identifier.go | 10 +- node/n_nullable.go | 10 +- node/n_parameter.go | 10 +- node/n_root.go | 10 +- node/name/n_fully_qualified.go | 10 +- node/name/n_name.go | 10 +- node/name/n_name_part.go | 10 +- node/name/n_relative.go | 10 +- node/name/t_meta_test.go | 16 +- node/node.go | 3 +- node/scalar/node_dnumber.go | 10 +- node/scalar/node_encapsed.go | 10 +- node/scalar/node_encapsed_string_part.go | 10 +- node/scalar/node_heredoc.go | 10 +- node/scalar/node_lnumber.go | 10 +- node/scalar/node_magic_constant.go | 10 +- node/scalar/node_string.go | 10 +- node/scalar/t_encapsed_test.go | 2 + node/scalar/t_meta_test.go | 16 +- node/stmt/n_alt_else.go | 10 +- node/stmt/n_alt_else_if.go | 10 +- node/stmt/n_alt_for.go | 10 +- node/stmt/n_alt_foreach.go | 10 +- node/stmt/n_alt_if.go | 10 +- node/stmt/n_alt_switch.go | 10 +- node/stmt/n_alt_while.go | 10 +- node/stmt/n_break.go | 10 +- node/stmt/n_case.go | 10 +- node/stmt/n_case_list.go | 10 +- node/stmt/n_catch.go | 10 +- node/stmt/n_class.go | 10 +- node/stmt/n_class_const_list.go | 10 +- node/stmt/n_class_extends.go | 10 +- node/stmt/n_class_implements.go | 10 +- node/stmt/n_class_method.go | 10 +- node/stmt/n_const_list.go | 10 +- node/stmt/n_constant.go | 10 +- node/stmt/n_continue.go | 10 +- node/stmt/n_declare.go | 14 +- node/stmt/n_default.go | 10 +- node/stmt/n_do.go | 10 +- node/stmt/n_echo.go | 10 +- node/stmt/n_else.go | 10 +- node/stmt/n_else_if.go | 10 +- node/stmt/n_expression.go | 10 +- node/stmt/n_finally.go | 10 +- node/stmt/n_for.go | 10 +- node/stmt/n_foreach.go | 10 +- node/stmt/n_function.go | 10 +- node/stmt/n_global.go | 10 +- node/stmt/n_goto.go | 10 +- node/stmt/n_group_use.go | 10 +- node/stmt/n_halt_compiler.go | 10 +- node/stmt/n_if.go | 10 +- node/stmt/n_inline_html.go | 10 +- node/stmt/n_interface.go | 10 +- node/stmt/n_interface_extends.go | 10 +- node/stmt/n_label.go | 10 +- node/stmt/n_namespace.go | 10 +- node/stmt/n_nop.go | 10 +- node/stmt/n_property.go | 10 +- node/stmt/n_property_list.go | 10 +- node/stmt/n_return.go | 10 +- node/stmt/n_static.go | 10 +- node/stmt/n_static_var.go | 10 +- node/stmt/n_stmt_list.go | 10 +- node/stmt/n_switch.go | 10 +- node/stmt/n_throw.go | 10 +- node/stmt/n_trait.go | 10 +- node/stmt/n_trait_adaptation_list.go | 10 +- node/stmt/n_trait_method_ref.go | 10 +- node/stmt/n_trait_use.go | 10 +- node/stmt/n_trait_use_alias.go | 10 +- node/stmt/n_trait_use_precedence.go | 10 +- node/stmt/n_try.go | 10 +- node/stmt/n_unset.go | 10 +- node/stmt/n_use.go | 10 +- node/stmt/n_use_list.go | 10 +- node/stmt/n_while.go | 10 +- node/stmt/t_alt_if_test.go | 3 + node/stmt/t_declare_test.go | 9 +- node/stmt/t_meta_test.go | 16 +- node/t_meta_test.go | 16 +- php5/parser.go | 32 +- php5/php5.go | 2382 +++++++++-------- php5/php5.y | 1360 +++++----- php5/php5_test.go | 374 ++- php7/parser.go | 30 +- php7/php7.go | 1932 ++++++------- php7/php7.y | 1136 ++++---- php7/php7_test.go | 345 ++- printer/pretty_printer.go | 3 +- printer/printer.go | 210 +- printer/printer_parsed_php5_test.go | 1390 ++++++++++ ...ed_test.go => printer_parsed_php7_test.go} | 1264 ++++++--- printer/printer_test.go | 2000 +++++++++----- scanner/lexer.go | 64 +- scanner/scanner.go | 21 +- scanner/scanner.l | 20 +- scanner/scanner_test.go | 259 +- scanner/token.go | 2 +- scanner/token_test.go | 8 +- visitor/dumper.go | 6 +- visitor/dumper_test.go | 5 + visitor/go_dumper.go | 26 +- visitor/go_dumper_test.go | 130 +- visitor/json_dumper.go | 16 +- visitor/json_dumper_test.go | 2 +- visitor/namespace_resolver_test.go | 2 +- visitor/pretty_json_dumper.go | 18 +- visitor/pretty_json_dumper_test.go | 107 +- 223 files changed, 9832 insertions(+), 5976 deletions(-) create mode 100644 meta/collection.go create mode 100644 meta/collection_test.go delete mode 100644 meta/comment.go delete mode 100644 meta/comment_test.go create mode 100644 meta/data.go create mode 100644 meta/data_test.go delete mode 100644 meta/meta.go create mode 100644 meta/type.go create mode 100644 meta/type_string.go create mode 100644 meta/type_test.go delete mode 100644 meta/white_space.go delete mode 100644 meta/white_space_test.go create mode 100644 printer/printer_parsed_php5_test.go rename printer/{printer_parsed_test.go => printer_parsed_php7_test.go} (54%) diff --git a/main.go b/main.go index 6ccd7c8..3d0a4df 100644 --- a/main.go +++ b/main.go @@ -18,6 +18,7 @@ import ( "github.com/z7zmey/php-parser/parser" "github.com/z7zmey/php-parser/php5" "github.com/z7zmey/php-parser/php7" + "github.com/z7zmey/php-parser/printer" "github.com/z7zmey/php-parser/visitor" ) @@ -27,6 +28,7 @@ var dumpType string var profiler string var withMeta *bool var showResolvedNs *bool +var printBack *bool type file struct { path string @@ -37,6 +39,7 @@ func main() { usePhp5 = flag.Bool("php5", false, "parse as PHP5") withMeta = flag.Bool("meta", false, "show meta") showResolvedNs = flag.Bool("r", false, "resolve names") + printBack = flag.Bool("pb", false, "print AST back into the parsed file") flag.StringVar(&dumpType, "d", "", "dump format: [custom, go, json, pretty_json]") flag.StringVar(&profiler, "prof", "", "start profiler: [cpu, mem, trace]") @@ -62,7 +65,7 @@ func main() { } // run printer goroutine - go printer(resultCh) + go printerWorker(resultCh) // process files processPath(flag.Args(), fileCh) @@ -133,7 +136,7 @@ func parserWorker(fileCh <-chan *file, result chan<- parser.Parser) { } } -func printer(result <-chan parser.Parser) { +func printerWorker(result <-chan parser.Parser) { var counter int w := bufio.NewWriter(os.Stdout) @@ -153,6 +156,15 @@ func printer(result <-chan parser.Parser) { fmt.Fprintln(w, e) } + if *printBack { + o := bytes.NewBuffer([]byte{}) + p := printer.NewPrinter(o) + p.Print(parserWorker.GetRootNode()) + + err := ioutil.WriteFile(parserWorker.GetPath(), o.Bytes(), 0644) + checkErr(err) + } + var nsResolver *visitor.NamespaceResolver if *showResolvedNs { nsResolver = visitor.NewNamespaceResolver() diff --git a/meta/collection.go b/meta/collection.go new file mode 100644 index 0000000..c0500a0 --- /dev/null +++ b/meta/collection.go @@ -0,0 +1,115 @@ +package meta + +// Collection of Meta objects +type Collection []*Data + +// SetTokenName sets TokenName for the all elements in the collection +func (mc *Collection) SetTokenName(tn TokenName) *Collection { + for _, m := range *mc { + m.TokenName = tn + } + + return mc +} + +// Push adds elements to the end of an Collection +func (mc *Collection) Push(mm ...*Data) *Collection { + *mc = append(*mc, mm...) + return mc +} + +// Unshift prepends elements to the beginning of an Collection +func (mc *Collection) Unshift(mm ...*Data) *Collection { + *mc = append(mm, *mc...) + return mc +} + +// AppendTo - appends elements of the collection to the end of the target collection +func (mc *Collection) AppendTo(target *Collection) *Collection { + if len(*mc) == 0 { + return mc + } + *target = append(*target, *mc...) + return mc +} + +// PrependTo - prepends elements of the collection to the start of the target collection +func (mc *Collection) PrependTo(target *Collection) *Collection { + if len(*mc) == 0 { + return mc + } + *target = append(*mc, *target...) + return mc +} + +// Cut elements by TokenName +func (mc *Collection) Cut(f Filter) *Collection { + collection := (*mc)[:0] + cutted := Collection{} + + for _, m := range *mc { + if fr := f(m); fr { + cutted = append(cutted, m) + } else { + collection = append(collection, m) + } + } + + *mc = collection + + return &cutted +} + +// Filter function signature +type Filter func(d *Data) bool + +// TokenNameFilter generates filter function that returns true +// if data.TokenName exactly same as given +func TokenNameFilter(tn TokenName) Filter { + return func(d *Data) bool { + return d.TokenName == tn + } +} + +// TypeFilter generates filter function that returns true +// if data.Type exactly same as given +func TypeFilter(t Type) Filter { + return func(d *Data) bool { + return d.Type == t + } +} + +// AndFilter generates filter function that returns true +// if all given filters return true +func AndFilter(filters ...Filter) Filter { + return func(d *Data) bool { + for _, filter := range filters { + if result := filter(d); !result { + return false + } + } + + return true + } +} + +// OrFilter generates filter function that returns true +// if one of given filters return true +func OrFilter(filters ...Filter) Filter { + return func(d *Data) bool { + for _, filter := range filters { + if result := filter(d); result { + return true + } + } + + return false + } +} + +// NotFilter negates given filter +func NotFilter(f Filter) Filter { + return func(d *Data) bool { + return !f(d) + } +} diff --git a/meta/collection_test.go b/meta/collection_test.go new file mode 100644 index 0000000..652b001 --- /dev/null +++ b/meta/collection_test.go @@ -0,0 +1,422 @@ +package meta_test + +import ( + "reflect" + "testing" + + "github.com/kylelemons/godebug/pretty" + "github.com/z7zmey/php-parser/meta" +) + +func TestCollectionSetTokenName(t *testing.T) { + + // prepare + + whiteSpace := &meta.Data{ + Type: meta.WhiteSpaceType, + Value: "\n", + } + comment := &meta.Data{ + Type: meta.CommentType, + Value: "// some comment", + } + + baseCollection := meta.Collection{whiteSpace, comment} + + // action + + baseCollection.SetTokenName(meta.OpenParenthesisToken) + + // check + + for _, m := range baseCollection { + if m.TokenName != meta.OpenParenthesisToken { + t.Error("The TokenName must be set for all Meta objects") + } + } +} + +func TestCollectionPush(t *testing.T) { + + // prepare + + whiteSpace := &meta.Data{ + Type: meta.WhiteSpaceType, + Value: "\n", + } + comment := &meta.Data{ + Type: meta.CommentType, + Value: "// some comment", + } + + actualCollection := meta.Collection{whiteSpace} + expectedCollection := meta.Collection{whiteSpace, comment} + + // action + + actualCollection.Push(comment) + + // check + + if !reflect.DeepEqual(expectedCollection, actualCollection) { + diff := pretty.Compare(expectedCollection, actualCollection) + + if diff != "" { + t.Errorf("\nexpected and actual collections are not equal\ndiff: (-expected +actual)\n%s", diff) + } else { + t.Errorf("\nexpected and actual collections are not equal\n") + } + } +} + +func TestCollectionUnshift(t *testing.T) { + + // prepare + + whiteSpace := &meta.Data{ + Type: meta.WhiteSpaceType, + Value: "\n", + } + comment := &meta.Data{ + Type: meta.CommentType, + Value: "// some comment", + } + + actualCollection := meta.Collection{comment} + expectedCollection := meta.Collection{whiteSpace, comment} + + // action + + actualCollection.Unshift(whiteSpace) + + // check + + if !reflect.DeepEqual(expectedCollection, actualCollection) { + diff := pretty.Compare(expectedCollection, actualCollection) + + if diff != "" { + t.Errorf("\nexpected and actual collections are not equal\ndiff: (-expected +actual)\n%s", diff) + } else { + t.Errorf("\nexpected and actual collections are not equal\n") + } + } +} + +func TestCollectionAppendTo(t *testing.T) { + + // prepare + + whiteSpace := &meta.Data{ + Type: meta.WhiteSpaceType, + Value: "\n", + } + comment := &meta.Data{ + Type: meta.CommentType, + Value: "// some comment", + } + + actualCollection := meta.Collection{whiteSpace} + expectedCollection := meta.Collection{whiteSpace, comment} + + baseCollection := meta.Collection{comment} + + // action + + baseCollection.AppendTo(&actualCollection) + + // check + + if !reflect.DeepEqual(expectedCollection, actualCollection) { + diff := pretty.Compare(expectedCollection, actualCollection) + + if diff != "" { + t.Errorf("\nexpected and actual collections are not equal\ndiff: (-expected +actual)\n%s", diff) + } else { + t.Errorf("\nexpected and actual collections are not equal\n") + } + } +} + +func TestEmptyCollectionAppendTo(t *testing.T) { + + // prepare + + whiteSpace := &meta.Data{ + Type: meta.WhiteSpaceType, + Value: "\n", + } + + actualCollection := meta.Collection{whiteSpace} + expectedCollection := meta.Collection{whiteSpace} + + var baseCollection meta.Collection = nil + + // action + + baseCollection.AppendTo(&actualCollection) + + // check + + if !reflect.DeepEqual(expectedCollection, actualCollection) { + diff := pretty.Compare(expectedCollection, actualCollection) + + if diff != "" { + t.Errorf("\nexpected and actual collections are not equal\ndiff: (-expected +actual)\n%s", diff) + } else { + t.Errorf("\nexpected and actual collections are not equal\n") + } + } +} + +func TestCollectionPrependTo(t *testing.T) { + + // prepare + + whiteSpace := &meta.Data{ + Type: meta.WhiteSpaceType, + Value: "\n", + } + comment := &meta.Data{ + Type: meta.CommentType, + Value: "// some comment", + } + + actualCollection := meta.Collection{comment} + expectedCollection := meta.Collection{whiteSpace, comment} + + baseCollection := meta.Collection{whiteSpace} + + // action + + baseCollection.PrependTo(&actualCollection) + + // check + + if !reflect.DeepEqual(expectedCollection, actualCollection) { + diff := pretty.Compare(expectedCollection, actualCollection) + + if diff != "" { + t.Errorf("\nexpected and actual collections are not equal\ndiff: (-expected +actual)\n%s", diff) + } else { + t.Errorf("\nexpected and actual collections are not equal\n") + } + } +} + +func TestEmptyCollectionPrependTo(t *testing.T) { + + // prepare + + comment := &meta.Data{ + Type: meta.CommentType, + Value: "// some comment", + } + + actualCollection := meta.Collection{comment} + expectedCollection := meta.Collection{comment} + + baseCollection := meta.Collection{} + + // action + + baseCollection.PrependTo(&actualCollection) + + // check + + if !reflect.DeepEqual(expectedCollection, actualCollection) { + diff := pretty.Compare(expectedCollection, actualCollection) + + if diff != "" { + t.Errorf("\nexpected and actual collections are not equal\ndiff: (-expected +actual)\n%s", diff) + } else { + t.Errorf("\nexpected and actual collections are not equal\n") + } + } +} + +func TestCollectionCutByTokenName(t *testing.T) { + + // prepare + + whiteSpace := &meta.Data{ + Type: meta.WhiteSpaceType, + Value: "\n", + } + OpenParenthesisComment := &meta.Data{ + Type: meta.CommentType, + Value: "// some comment", + TokenName: meta.OpenParenthesisToken, + } + OpenParenthesisToken := &meta.Data{ + Type: meta.TokenType, + Value: "(", + TokenName: meta.OpenParenthesisToken, + } + CloseParenthesisToken := &meta.Data{ + Type: meta.TokenType, + Value: ")", + TokenName: meta.CloseParenthesisToken, + } + + actualCollection := meta.Collection{whiteSpace, OpenParenthesisComment, OpenParenthesisToken, CloseParenthesisToken} + + expectedCollection := meta.Collection{whiteSpace, CloseParenthesisToken} + expectedCuttedCollection := &meta.Collection{OpenParenthesisComment, OpenParenthesisToken} + + // action + + actualCuttedCollection := actualCollection.Cut( + meta.TokenNameFilter(meta.OpenParenthesisToken), + ) + + // check + + if !reflect.DeepEqual(expectedCollection, actualCollection) { + diff := pretty.Compare(expectedCollection, actualCollection) + + if diff != "" { + t.Errorf("\nexpected and actual collections are not equal\ndiff: (-expected +actual)\n%s", diff) + } else { + t.Errorf("\nexpected and actual collections are not equal\n") + } + } + + if !reflect.DeepEqual(expectedCuttedCollection, actualCuttedCollection) { + diff := pretty.Compare(expectedCuttedCollection, actualCuttedCollection) + + if diff != "" { + t.Errorf("\nexpected and actual cutted collections are not equal\ndiff: (-expected +actual)\n%s", diff) + } else { + t.Errorf("\nexpected and actual cutted collections are not equal\n") + } + } +} + +func TestCollectionCutByTokenTypes(t *testing.T) { + + // prepare + + whiteSpace := &meta.Data{ + Type: meta.WhiteSpaceType, + Value: "\n", + } + OpenParenthesisComment := &meta.Data{ + Type: meta.CommentType, + Value: "// some comment", + TokenName: meta.OpenParenthesisToken, + } + OpenParenthesisToken := &meta.Data{ + Type: meta.TokenType, + Value: "(", + TokenName: meta.OpenParenthesisToken, + } + CloseParenthesisToken := &meta.Data{ + Type: meta.TokenType, + Value: ")", + TokenName: meta.CloseParenthesisToken, + } + + actualCollection := meta.Collection{whiteSpace, OpenParenthesisComment, OpenParenthesisToken, CloseParenthesisToken} + + expectedCollection := meta.Collection{OpenParenthesisToken, CloseParenthesisToken} + expectedCuttedCollection := &meta.Collection{whiteSpace, OpenParenthesisComment} + + // action + + actualCuttedCollection := actualCollection.Cut(meta.OrFilter( + meta.TypeFilter(meta.CommentType), + meta.TypeFilter(meta.WhiteSpaceType)), + ) + + // check + + if !reflect.DeepEqual(expectedCollection, actualCollection) { + diff := pretty.Compare(expectedCollection, actualCollection) + + if diff != "" { + t.Errorf("\nexpected and actual collections are not equal\ndiff: (-expected +actual)\n%s", diff) + } else { + t.Errorf("\nexpected and actual collections are not equal\n") + } + } + + if !reflect.DeepEqual(expectedCuttedCollection, actualCuttedCollection) { + diff := pretty.Compare(expectedCuttedCollection, actualCuttedCollection) + + if diff != "" { + t.Errorf("\nexpected and actual cutted collections are not equal\ndiff: (-expected +actual)\n%s", diff) + } else { + t.Errorf("\nexpected and actual cutted collections are not equal\n") + } + } +} + +func TestCollectionCutByTokenNameButNotType(t *testing.T) { + + // prepare + + whiteSpace := &meta.Data{ + Type: meta.WhiteSpaceType, + Value: "\n", + } + OpenParenthesisComment := &meta.Data{ + Type: meta.CommentType, + Value: "// some comment", + TokenName: meta.OpenParenthesisToken, + } + OpenParenthesisToken := &meta.Data{ + Type: meta.TokenType, + Value: "(", + TokenName: meta.OpenParenthesisToken, + } + CloseParenthesisToken := &meta.Data{ + Type: meta.TokenType, + Value: ")", + TokenName: meta.CloseParenthesisToken, + } + + actualCollection := meta.Collection{ + whiteSpace, + OpenParenthesisComment, + OpenParenthesisToken, + CloseParenthesisToken, + } + + expectedCollection := meta.Collection{ + whiteSpace, + OpenParenthesisToken, + CloseParenthesisToken, + } + expectedCuttedCollection := &meta.Collection{ + OpenParenthesisComment, + } + + // action + + actualCuttedCollection := actualCollection.Cut(meta.AndFilter( + meta.TokenNameFilter(meta.OpenParenthesisToken), + meta.NotFilter(meta.TypeFilter(meta.TokenType))), + ) + + // check + + if !reflect.DeepEqual(expectedCollection, actualCollection) { + diff := pretty.Compare(expectedCollection, actualCollection) + + if diff != "" { + t.Errorf("\nexpected and actual collections are not equal\ndiff: (-expected +actual)\n%s", diff) + } else { + t.Errorf("\nexpected and actual collections are not equal\n") + } + } + + if !reflect.DeepEqual(expectedCuttedCollection, actualCuttedCollection) { + diff := pretty.Compare(expectedCuttedCollection, actualCuttedCollection) + + if diff != "" { + t.Errorf("\nexpected and actual cutted collections are not equal\ndiff: (-expected +actual)\n%s", diff) + } else { + t.Errorf("\nexpected and actual cutted collections are not equal\n") + } + } +} diff --git a/meta/comment.go b/meta/comment.go deleted file mode 100644 index c264f58..0000000 --- a/meta/comment.go +++ /dev/null @@ -1,39 +0,0 @@ -package meta - -import ( - "github.com/z7zmey/php-parser/position" -) - -// Comment aggrigates information about comment /** -type Comment struct { - Value string - Position *position.Position - TokenName TokenName -} - -// NewComment - Comment constructor -func NewComment(value string, pos *position.Position) *Comment { - return &Comment{ - Value: value, - Position: pos, - TokenName: UnknownToken, - } -} - -// SetTokenName sets token name -func (c *Comment) SetTokenName(tokenName TokenName) { - c.TokenName = tokenName -} - -// GetTokenName returns token name -func (c *Comment) GetTokenName() TokenName { - return c.TokenName -} - -func (c *Comment) String() string { - return c.Value -} - -func (c *Comment) GetPosition() *position.Position { - return c.Position -} diff --git a/meta/comment_test.go b/meta/comment_test.go deleted file mode 100644 index d509113..0000000 --- a/meta/comment_test.go +++ /dev/null @@ -1,44 +0,0 @@ -package meta_test - -import ( - "testing" - - "github.com/z7zmey/php-parser/position" - - "github.com/z7zmey/php-parser/meta" -) - -func TestCommentPrint(t *testing.T) { - expected := "/** hello world */" - - comment := meta.NewComment(expected, nil) - - actual := comment.String() - - if expected != actual { - t.Errorf("expected and actual are not equal\n") - } -} - -func TestCommentSetGetTokenName(t *testing.T) { - expected := meta.ArrayToken - c := meta.NewComment("/** hello world */", nil) - c.SetTokenName(expected) - - actual := c.GetTokenName() - - if expected != actual { - t.Errorf("expected and actual are not equal\n") - } -} - -func TestCommentGetPosition(t *testing.T) { - expected := position.NewPosition(1, 1, 1, 1) - c := meta.NewComment("/** hello world */", expected) - - actual := c.GetPosition() - - if expected != actual { - t.Errorf("expected and actual are not equal\n") - } -} diff --git a/meta/data.go b/meta/data.go new file mode 100644 index 0000000..e45e6a0 --- /dev/null +++ b/meta/data.go @@ -0,0 +1,17 @@ +package meta + +import ( + "github.com/z7zmey/php-parser/position" +) + +// Data contain additional information that isn't part of AST +type Data struct { + Value string + Type Type + Position *position.Position + TokenName TokenName +} + +func (d *Data) String() string { + return d.Value +} diff --git a/meta/data_test.go b/meta/data_test.go new file mode 100644 index 0000000..cb5c5e8 --- /dev/null +++ b/meta/data_test.go @@ -0,0 +1,21 @@ +package meta_test + +import ( + "testing" + + "github.com/z7zmey/php-parser/meta" +) + +func TestCommentPrint(t *testing.T) { + expected := "/** hello world */" + + comment := meta.Data{ + Value: expected, + } + + actual := comment.String() + + if expected != actual { + t.Errorf("expected and actual are not equal\n") + } +} diff --git a/meta/meta.go b/meta/meta.go deleted file mode 100644 index d14d504..0000000 --- a/meta/meta.go +++ /dev/null @@ -1,12 +0,0 @@ -package meta - -import ( - "github.com/z7zmey/php-parser/position" -) - -type Meta interface { - String() string - SetTokenName(tn TokenName) - GetTokenName() TokenName - GetPosition() *position.Position -} diff --git a/meta/tokenName.go b/meta/tokenName.go index f3ad33d..05a08f0 100644 --- a/meta/tokenName.go +++ b/meta/tokenName.go @@ -36,7 +36,6 @@ const ( EnddeclareToken AsToken SwitchToken - SwitchSemicolonToken EndswitchToken CaseToken DefaultToken @@ -68,9 +67,11 @@ const ( CallableToken StartHeredocToken DollarOpenCurlyBracesToken + DollarCloseCurlyBracesToken CurlyOpenToken PaamayimNekudotayimToken NamespaceToken + UseLeadingNsSeparatorToken NsSeparatorToken EllipsisToken EvalToken @@ -80,7 +81,7 @@ const ( LogicalXorToken LogicalAndToken InstanceofToken - NewToken + NewAnchor CloneToken ElseifToken ElseToken diff --git a/meta/tokenName_string.go b/meta/tokenName_string.go index a906696..819f7f0 100644 --- a/meta/tokenName_string.go +++ b/meta/tokenName_string.go @@ -4,9 +4,9 @@ package meta import "strconv" -const _TokenName_name = "UnknownTokenNodeStartNodeEndMagicConstantTokenIncludeTokenIncludeOnceTokenExitTokenIfTokenLnumberTokenDnumberTokenStringTokenStringVarnameTokenVariableTokenNumStringTokenInlineHTMLTokenEncapsedAndWhitespaceTokenConstantEncapsedStringTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenSwitchSemicolonTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenUseTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenIssetTokenEmptyTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenListTokenArrayTokenCallableTokenStartHeredocTokenDollarOpenCurlyBracesTokenCurlyOpenTokenPaamayimNekudotayimTokenNamespaceTokenNsSeparatorTokenEllipsisTokenEvalTokenRequireTokenRequireOnceTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenNewTokenCloneTokenElseifTokenElseTokenEndifTokenPrintTokenYieldTokenStaticTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenYieldFromTokenObjectOperatorTokenIntCastTokenDoubleCastTokenStringCastTokenArrayCastTokenObjectCastTokenBoolCastTokenUnsetCastTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenIdentifierTokenCaseSeparatorTokenDoubleQuoteTokenBackquoteTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenExclamationMarkTokenTildeTokenAtTokenDollarTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" +const _TokenName_name = "UnknownTokenNodeStartNodeEndMagicConstantTokenIncludeTokenIncludeOnceTokenExitTokenIfTokenLnumberTokenDnumberTokenStringTokenStringVarnameTokenVariableTokenNumStringTokenInlineHTMLTokenEncapsedAndWhitespaceTokenConstantEncapsedStringTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenUseTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenIssetTokenEmptyTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenListTokenArrayTokenCallableTokenStartHeredocTokenDollarOpenCurlyBracesTokenDollarCloseCurlyBracesTokenCurlyOpenTokenPaamayimNekudotayimTokenNamespaceTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenEvalTokenRequireTokenRequireOnceTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenNewAnchorCloneTokenElseifTokenElseTokenEndifTokenPrintTokenYieldTokenStaticTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenYieldFromTokenObjectOperatorTokenIntCastTokenDoubleCastTokenStringCastTokenArrayCastTokenObjectCastTokenBoolCastTokenUnsetCastTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenIdentifierTokenCaseSeparatorTokenDoubleQuoteTokenBackquoteTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenExclamationMarkTokenTildeTokenAtTokenDollarTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" -var _TokenName_index = [...]uint16{0, 12, 21, 28, 46, 58, 74, 83, 90, 102, 114, 125, 143, 156, 170, 185, 211, 238, 247, 254, 264, 277, 298, 319, 327, 338, 350, 365, 377, 392, 399, 410, 430, 444, 453, 465, 475, 488, 497, 510, 520, 531, 539, 549, 561, 571, 579, 593, 604, 612, 622, 632, 642, 652, 662, 676, 688, 703, 719, 728, 738, 751, 768, 794, 808, 832, 846, 862, 875, 884, 896, 912, 926, 941, 956, 971, 979, 989, 1000, 1009, 1019, 1029, 1039, 1050, 1063, 1073, 1085, 1099, 1110, 1118, 1126, 1140, 1159, 1171, 1186, 1201, 1215, 1230, 1243, 1257, 1270, 1284, 1298, 1313, 1326, 1339, 1352, 1368, 1381, 1394, 1406, 1419, 1431, 1443, 1457, 1472, 1480, 1487, 1494, 1510, 1529, 1541, 1556, 1577, 1598, 1615, 1630, 1648, 1664, 1678, 1698, 1719, 1733, 1743, 1763, 1784, 1801, 1819, 1836, 1850, 1860, 1869, 1889, 1899, 1906, 1917, 1927, 1943, 1953, 1963, 1976, 1986, 1998, 2007, 2019, 2027} +var _TokenName_index = [...]uint16{0, 12, 21, 28, 46, 58, 74, 83, 90, 102, 114, 125, 143, 156, 170, 185, 211, 238, 247, 254, 264, 277, 298, 319, 327, 338, 350, 365, 377, 392, 399, 410, 424, 433, 445, 455, 468, 477, 490, 500, 511, 519, 529, 541, 551, 559, 573, 584, 592, 602, 612, 622, 632, 642, 656, 668, 683, 699, 708, 718, 731, 748, 774, 801, 815, 839, 853, 879, 895, 908, 917, 929, 945, 959, 974, 989, 1004, 1013, 1023, 1034, 1043, 1053, 1063, 1073, 1084, 1097, 1107, 1119, 1133, 1144, 1152, 1160, 1174, 1193, 1205, 1220, 1235, 1249, 1264, 1277, 1291, 1304, 1318, 1332, 1347, 1360, 1373, 1386, 1402, 1415, 1428, 1440, 1453, 1465, 1477, 1491, 1506, 1514, 1521, 1528, 1544, 1563, 1575, 1590, 1611, 1632, 1649, 1664, 1682, 1698, 1712, 1732, 1753, 1767, 1777, 1797, 1818, 1835, 1853, 1870, 1884, 1894, 1903, 1923, 1933, 1940, 1951, 1961, 1977, 1987, 1997, 2010, 2020, 2032, 2041, 2053, 2061} func (i TokenName) String() string { if i < 0 || i >= TokenName(len(_TokenName_index)-1) { diff --git a/meta/type.go b/meta/type.go new file mode 100644 index 0000000..783149f --- /dev/null +++ b/meta/type.go @@ -0,0 +1,11 @@ +package meta + +// Type TODO +type Type int + +//go:generate stringer -type=Type -output ./type_string.go +const ( + CommentType Type = iota + WhiteSpaceType + TokenType +) diff --git a/meta/type_string.go b/meta/type_string.go new file mode 100644 index 0000000..69cb010 --- /dev/null +++ b/meta/type_string.go @@ -0,0 +1,16 @@ +// Code generated by "stringer -type=Type -output ./type_string.go"; DO NOT EDIT. + +package meta + +import "strconv" + +const _Type_name = "CommentTypeWhiteSpaceTypeTokenType" + +var _Type_index = [...]uint8{0, 11, 25, 34} + +func (i Type) String() string { + if i < 0 || i >= Type(len(_Type_index)-1) { + return "Type(" + strconv.FormatInt(int64(i), 10) + ")" + } + return _Type_name[_Type_index[i]:_Type_index[i+1]] +} diff --git a/meta/type_test.go b/meta/type_test.go new file mode 100644 index 0000000..bb2564e --- /dev/null +++ b/meta/type_test.go @@ -0,0 +1,29 @@ +package meta_test + +import ( + "testing" + + "github.com/z7zmey/php-parser/meta" +) + +func TestTypeString(t *testing.T) { + c := meta.CommentType + + expected := "CommentType" + actual := c.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestWrongTypeString(t *testing.T) { + c := meta.Type(-1) + + expected := "Type(-1)" + actual := c.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} diff --git a/meta/white_space.go b/meta/white_space.go deleted file mode 100644 index ea12613..0000000 --- a/meta/white_space.go +++ /dev/null @@ -1,37 +0,0 @@ -package meta - -import ( - "github.com/z7zmey/php-parser/position" -) - -type WhiteSpace struct { - Value string - Position *position.Position - TokenName TokenName -} - -func NewWhiteSpace(value string, pos *position.Position) *WhiteSpace { - return &WhiteSpace{ - Value: value, - Position: pos, - TokenName: UnknownToken, - } -} - -// SetTokenName sets token name -func (c *WhiteSpace) SetTokenName(tokenName TokenName) { - c.TokenName = tokenName -} - -// GetTokenName returns token name -func (c *WhiteSpace) GetTokenName() TokenName { - return c.TokenName -} - -func (el *WhiteSpace) String() string { - return el.Value -} - -func (el *WhiteSpace) GetPosition() *position.Position { - return el.Position -} diff --git a/meta/white_space_test.go b/meta/white_space_test.go deleted file mode 100644 index b609126..0000000 --- a/meta/white_space_test.go +++ /dev/null @@ -1,44 +0,0 @@ -package meta_test - -import ( - "testing" - - "github.com/z7zmey/php-parser/position" - - "github.com/z7zmey/php-parser/meta" -) - -func TestWhiteSpacePrint(t *testing.T) { - expected := "\n " - - w := meta.NewWhiteSpace(expected, nil) - - actual := w.String() - - if expected != actual { - t.Errorf("expected and actual are not equal\n") - } -} - -func TestWhiteSpaceSetGetTokenName(t *testing.T) { - expected := meta.ArrayToken - w := meta.NewWhiteSpace("\n ", nil) - w.SetTokenName(expected) - - actual := w.GetTokenName() - - if expected != actual { - t.Errorf("expected and actual are not equal\n") - } -} - -func TestWhiteSpaceGetPosition(t *testing.T) { - expected := position.NewPosition(1, 1, 1, 1) - q := meta.NewWhiteSpace("\n ", expected) - - actual := q.GetPosition() - - if expected != actual { - t.Errorf("expected and actual are not equal\n") - } -} diff --git a/node/expr/assign/n_assign.go b/node/expr/assign/n_assign.go index 87048b0..d2d4db4 100644 --- a/node/expr/assign/n_assign.go +++ b/node/expr/assign/n_assign.go @@ -9,7 +9,7 @@ import ( // Assign node type Assign struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Variable node.Node Expression node.Node @@ -33,12 +33,8 @@ func (n *Assign) GetPosition() *position.Position { return n.Position } -func (n *Assign) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *Assign) GetMeta() []meta.Meta { - return n.Meta +func (n *Assign) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/assign/n_assign_ref.go b/node/expr/assign/n_assign_ref.go index ec9970e..90eff92 100644 --- a/node/expr/assign/n_assign_ref.go +++ b/node/expr/assign/n_assign_ref.go @@ -9,7 +9,7 @@ import ( // Reference node type Reference struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Variable node.Node Expression node.Node @@ -33,12 +33,8 @@ func (n *Reference) GetPosition() *position.Position { return n.Position } -func (n *Reference) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *Reference) GetMeta() []meta.Meta { - return n.Meta +func (n *Reference) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/assign/n_bitwise_and.go b/node/expr/assign/n_bitwise_and.go index 088e125..5d84216 100644 --- a/node/expr/assign/n_bitwise_and.go +++ b/node/expr/assign/n_bitwise_and.go @@ -9,7 +9,7 @@ import ( // BitwiseAnd node type BitwiseAnd struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Variable node.Node Expression node.Node @@ -33,12 +33,8 @@ func (n *BitwiseAnd) GetPosition() *position.Position { return n.Position } -func (n *BitwiseAnd) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *BitwiseAnd) GetMeta() []meta.Meta { - return n.Meta +func (n *BitwiseAnd) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/assign/n_bitwise_or.go b/node/expr/assign/n_bitwise_or.go index 216d511..bb54040 100644 --- a/node/expr/assign/n_bitwise_or.go +++ b/node/expr/assign/n_bitwise_or.go @@ -9,7 +9,7 @@ import ( // BitwiseOr node type BitwiseOr struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Variable node.Node Expression node.Node @@ -33,12 +33,8 @@ func (n *BitwiseOr) GetPosition() *position.Position { return n.Position } -func (n *BitwiseOr) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *BitwiseOr) GetMeta() []meta.Meta { - return n.Meta +func (n *BitwiseOr) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/assign/n_bitwise_xor.go b/node/expr/assign/n_bitwise_xor.go index 2d43254..b1f9dad 100644 --- a/node/expr/assign/n_bitwise_xor.go +++ b/node/expr/assign/n_bitwise_xor.go @@ -9,7 +9,7 @@ import ( // BitwiseXor node type BitwiseXor struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Variable node.Node Expression node.Node @@ -33,12 +33,8 @@ func (n *BitwiseXor) GetPosition() *position.Position { return n.Position } -func (n *BitwiseXor) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *BitwiseXor) GetMeta() []meta.Meta { - return n.Meta +func (n *BitwiseXor) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/assign/n_concat.go b/node/expr/assign/n_concat.go index 9b8f65a..44c175b 100644 --- a/node/expr/assign/n_concat.go +++ b/node/expr/assign/n_concat.go @@ -9,7 +9,7 @@ import ( // Concat node type Concat struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Variable node.Node Expression node.Node @@ -33,12 +33,8 @@ func (n *Concat) GetPosition() *position.Position { return n.Position } -func (n *Concat) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *Concat) GetMeta() []meta.Meta { - return n.Meta +func (n *Concat) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/assign/n_div.go b/node/expr/assign/n_div.go index ca53aa9..a988398 100644 --- a/node/expr/assign/n_div.go +++ b/node/expr/assign/n_div.go @@ -9,7 +9,7 @@ import ( // Div node type Div struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Variable node.Node Expression node.Node @@ -33,12 +33,8 @@ func (n *Div) GetPosition() *position.Position { return n.Position } -func (n *Div) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *Div) GetMeta() []meta.Meta { - return n.Meta +func (n *Div) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/assign/n_minus.go b/node/expr/assign/n_minus.go index af84b16..1ea308c 100644 --- a/node/expr/assign/n_minus.go +++ b/node/expr/assign/n_minus.go @@ -9,7 +9,7 @@ import ( // Minus node type Minus struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Variable node.Node Expression node.Node @@ -33,12 +33,8 @@ func (n *Minus) GetPosition() *position.Position { return n.Position } -func (n *Minus) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *Minus) GetMeta() []meta.Meta { - return n.Meta +func (n *Minus) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/assign/n_mod.go b/node/expr/assign/n_mod.go index 64c9dac..281394e 100644 --- a/node/expr/assign/n_mod.go +++ b/node/expr/assign/n_mod.go @@ -9,7 +9,7 @@ import ( // Mod node type Mod struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Variable node.Node Expression node.Node @@ -33,12 +33,8 @@ func (n *Mod) GetPosition() *position.Position { return n.Position } -func (n *Mod) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *Mod) GetMeta() []meta.Meta { - return n.Meta +func (n *Mod) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/assign/n_mul.go b/node/expr/assign/n_mul.go index 5e9b4fe..f2cb5ae 100644 --- a/node/expr/assign/n_mul.go +++ b/node/expr/assign/n_mul.go @@ -9,7 +9,7 @@ import ( // Mul node type Mul struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Variable node.Node Expression node.Node @@ -33,12 +33,8 @@ func (n *Mul) GetPosition() *position.Position { return n.Position } -func (n *Mul) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *Mul) GetMeta() []meta.Meta { - return n.Meta +func (n *Mul) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/assign/n_plus.go b/node/expr/assign/n_plus.go index fd3d6a3..0f3b137 100644 --- a/node/expr/assign/n_plus.go +++ b/node/expr/assign/n_plus.go @@ -9,7 +9,7 @@ import ( // Plus node type Plus struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Variable node.Node Expression node.Node @@ -33,12 +33,8 @@ func (n *Plus) GetPosition() *position.Position { return n.Position } -func (n *Plus) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *Plus) GetMeta() []meta.Meta { - return n.Meta +func (n *Plus) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/assign/n_pow.go b/node/expr/assign/n_pow.go index e42ee3e..fa5a17f 100644 --- a/node/expr/assign/n_pow.go +++ b/node/expr/assign/n_pow.go @@ -9,7 +9,7 @@ import ( // Pow node type Pow struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Variable node.Node Expression node.Node @@ -33,12 +33,8 @@ func (n *Pow) GetPosition() *position.Position { return n.Position } -func (n *Pow) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *Pow) GetMeta() []meta.Meta { - return n.Meta +func (n *Pow) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/assign/n_shift_left.go b/node/expr/assign/n_shift_left.go index 38184e4..963bf56 100644 --- a/node/expr/assign/n_shift_left.go +++ b/node/expr/assign/n_shift_left.go @@ -9,7 +9,7 @@ import ( // ShiftLeft node type ShiftLeft struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Variable node.Node Expression node.Node @@ -33,12 +33,8 @@ func (n *ShiftLeft) GetPosition() *position.Position { return n.Position } -func (n *ShiftLeft) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *ShiftLeft) GetMeta() []meta.Meta { - return n.Meta +func (n *ShiftLeft) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/assign/n_shift_right.go b/node/expr/assign/n_shift_right.go index 728ccd3..3a1cd4c 100644 --- a/node/expr/assign/n_shift_right.go +++ b/node/expr/assign/n_shift_right.go @@ -9,7 +9,7 @@ import ( // ShiftRight node type ShiftRight struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Variable node.Node Expression node.Node @@ -33,12 +33,8 @@ func (n *ShiftRight) GetPosition() *position.Position { return n.Position } -func (n *ShiftRight) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *ShiftRight) GetMeta() []meta.Meta { - return n.Meta +func (n *ShiftRight) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/assign/t_meta_test.go b/node/expr/assign/t_meta_test.go index 0de3e2f..c9d7e0b 100644 --- a/node/expr/assign/t_meta_test.go +++ b/node/expr/assign/t_meta_test.go @@ -29,12 +29,20 @@ var nodes = []node.Node{ } func TestMeta(t *testing.T) { - expected := []meta.Meta{ - meta.NewComment("//comment\n", nil), - meta.NewWhiteSpace(" ", nil), + expected := &meta.Collection{ + &meta.Data{ + Value: "//comment\n", + Type: meta.CommentType, + Position: nil, + }, + &meta.Data{ + Value: " ", + Type: meta.WhiteSpaceType, + Position: nil, + }, } for _, n := range nodes { - n.AddMeta(expected) + n.GetMeta().Push(*expected...) actual := n.GetMeta() assertEqual(t, expected, actual) } diff --git a/node/expr/binary/n_bitwise_and.go b/node/expr/binary/n_bitwise_and.go index 667cf67..f10c1da 100644 --- a/node/expr/binary/n_bitwise_and.go +++ b/node/expr/binary/n_bitwise_and.go @@ -9,7 +9,7 @@ import ( // BitwiseAnd node type BitwiseAnd struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Left node.Node Right node.Node @@ -33,12 +33,8 @@ func (n *BitwiseAnd) GetPosition() *position.Position { return n.Position } -func (n *BitwiseAnd) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *BitwiseAnd) GetMeta() []meta.Meta { - return n.Meta +func (n *BitwiseAnd) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/binary/n_bitwise_or.go b/node/expr/binary/n_bitwise_or.go index 3acce02..31583c5 100644 --- a/node/expr/binary/n_bitwise_or.go +++ b/node/expr/binary/n_bitwise_or.go @@ -9,7 +9,7 @@ import ( // BitwiseOr node type BitwiseOr struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Left node.Node Right node.Node @@ -33,12 +33,8 @@ func (n *BitwiseOr) GetPosition() *position.Position { return n.Position } -func (n *BitwiseOr) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *BitwiseOr) GetMeta() []meta.Meta { - return n.Meta +func (n *BitwiseOr) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/binary/n_bitwise_xor.go b/node/expr/binary/n_bitwise_xor.go index 56885e3..567d434 100644 --- a/node/expr/binary/n_bitwise_xor.go +++ b/node/expr/binary/n_bitwise_xor.go @@ -9,7 +9,7 @@ import ( // BitwiseXor node type BitwiseXor struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Left node.Node Right node.Node @@ -33,12 +33,8 @@ func (n *BitwiseXor) GetPosition() *position.Position { return n.Position } -func (n *BitwiseXor) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *BitwiseXor) GetMeta() []meta.Meta { - return n.Meta +func (n *BitwiseXor) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/binary/n_boolean_and.go b/node/expr/binary/n_boolean_and.go index ef62f9d..80ac46e 100644 --- a/node/expr/binary/n_boolean_and.go +++ b/node/expr/binary/n_boolean_and.go @@ -9,7 +9,7 @@ import ( // BooleanAnd node type BooleanAnd struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Left node.Node Right node.Node @@ -33,12 +33,8 @@ func (n *BooleanAnd) GetPosition() *position.Position { return n.Position } -func (n *BooleanAnd) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *BooleanAnd) GetMeta() []meta.Meta { - return n.Meta +func (n *BooleanAnd) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/binary/n_boolean_or.go b/node/expr/binary/n_boolean_or.go index 6cc1aaa..08abce1 100644 --- a/node/expr/binary/n_boolean_or.go +++ b/node/expr/binary/n_boolean_or.go @@ -9,7 +9,7 @@ import ( // BooleanOr node type BooleanOr struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Left node.Node Right node.Node @@ -33,12 +33,8 @@ func (n *BooleanOr) GetPosition() *position.Position { return n.Position } -func (n *BooleanOr) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *BooleanOr) GetMeta() []meta.Meta { - return n.Meta +func (n *BooleanOr) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/binary/n_coalesce.go b/node/expr/binary/n_coalesce.go index f015108..a0b5094 100644 --- a/node/expr/binary/n_coalesce.go +++ b/node/expr/binary/n_coalesce.go @@ -9,7 +9,7 @@ import ( // Coalesce node type Coalesce struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Left node.Node Right node.Node @@ -33,12 +33,8 @@ func (n *Coalesce) GetPosition() *position.Position { return n.Position } -func (n *Coalesce) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *Coalesce) GetMeta() []meta.Meta { - return n.Meta +func (n *Coalesce) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/binary/n_concat.go b/node/expr/binary/n_concat.go index 2a35877..9761226 100644 --- a/node/expr/binary/n_concat.go +++ b/node/expr/binary/n_concat.go @@ -9,7 +9,7 @@ import ( // Concat node type Concat struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Left node.Node Right node.Node @@ -33,12 +33,8 @@ func (n *Concat) GetPosition() *position.Position { return n.Position } -func (n *Concat) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *Concat) GetMeta() []meta.Meta { - return n.Meta +func (n *Concat) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/binary/n_div.go b/node/expr/binary/n_div.go index 833ba44..0bd20d4 100644 --- a/node/expr/binary/n_div.go +++ b/node/expr/binary/n_div.go @@ -9,7 +9,7 @@ import ( // Div node type Div struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Left node.Node Right node.Node @@ -33,12 +33,8 @@ func (n *Div) GetPosition() *position.Position { return n.Position } -func (n *Div) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *Div) GetMeta() []meta.Meta { - return n.Meta +func (n *Div) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/binary/n_equal.go b/node/expr/binary/n_equal.go index d5ff654..fdb9d85 100644 --- a/node/expr/binary/n_equal.go +++ b/node/expr/binary/n_equal.go @@ -9,7 +9,7 @@ import ( // Equal node type Equal struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Left node.Node Right node.Node @@ -33,12 +33,8 @@ func (n *Equal) GetPosition() *position.Position { return n.Position } -func (n *Equal) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *Equal) GetMeta() []meta.Meta { - return n.Meta +func (n *Equal) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/binary/n_greater.go b/node/expr/binary/n_greater.go index d177855..d615051 100644 --- a/node/expr/binary/n_greater.go +++ b/node/expr/binary/n_greater.go @@ -9,7 +9,7 @@ import ( // Greater node type Greater struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Left node.Node Right node.Node @@ -33,12 +33,8 @@ func (n *Greater) GetPosition() *position.Position { return n.Position } -func (n *Greater) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *Greater) GetMeta() []meta.Meta { - return n.Meta +func (n *Greater) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/binary/n_greater_or_equal.go b/node/expr/binary/n_greater_or_equal.go index abf9bb6..59cd5e0 100644 --- a/node/expr/binary/n_greater_or_equal.go +++ b/node/expr/binary/n_greater_or_equal.go @@ -9,7 +9,7 @@ import ( // GreaterOrEqual node type GreaterOrEqual struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Left node.Node Right node.Node @@ -33,12 +33,8 @@ func (n *GreaterOrEqual) GetPosition() *position.Position { return n.Position } -func (n *GreaterOrEqual) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *GreaterOrEqual) GetMeta() []meta.Meta { - return n.Meta +func (n *GreaterOrEqual) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/binary/n_identical.go b/node/expr/binary/n_identical.go index 885f6d7..9a2f4aa 100644 --- a/node/expr/binary/n_identical.go +++ b/node/expr/binary/n_identical.go @@ -9,7 +9,7 @@ import ( // Identical node type Identical struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Left node.Node Right node.Node @@ -33,12 +33,8 @@ func (n *Identical) GetPosition() *position.Position { return n.Position } -func (n *Identical) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *Identical) GetMeta() []meta.Meta { - return n.Meta +func (n *Identical) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/binary/n_logical_and.go b/node/expr/binary/n_logical_and.go index 7296a1d..de907ca 100644 --- a/node/expr/binary/n_logical_and.go +++ b/node/expr/binary/n_logical_and.go @@ -9,7 +9,7 @@ import ( // LogicalAnd node type LogicalAnd struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Left node.Node Right node.Node @@ -33,12 +33,8 @@ func (n *LogicalAnd) GetPosition() *position.Position { return n.Position } -func (n *LogicalAnd) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *LogicalAnd) GetMeta() []meta.Meta { - return n.Meta +func (n *LogicalAnd) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/binary/n_logical_or.go b/node/expr/binary/n_logical_or.go index 35d1609..1102b03 100644 --- a/node/expr/binary/n_logical_or.go +++ b/node/expr/binary/n_logical_or.go @@ -9,7 +9,7 @@ import ( // LogicalOr node type LogicalOr struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Left node.Node Right node.Node @@ -33,12 +33,8 @@ func (n *LogicalOr) GetPosition() *position.Position { return n.Position } -func (n *LogicalOr) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *LogicalOr) GetMeta() []meta.Meta { - return n.Meta +func (n *LogicalOr) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/binary/n_logical_xor.go b/node/expr/binary/n_logical_xor.go index f986eb9..fd2373a 100644 --- a/node/expr/binary/n_logical_xor.go +++ b/node/expr/binary/n_logical_xor.go @@ -9,7 +9,7 @@ import ( // LogicalXor node type LogicalXor struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Left node.Node Right node.Node @@ -33,12 +33,8 @@ func (n *LogicalXor) GetPosition() *position.Position { return n.Position } -func (n *LogicalXor) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *LogicalXor) GetMeta() []meta.Meta { - return n.Meta +func (n *LogicalXor) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/binary/n_minus.go b/node/expr/binary/n_minus.go index 89909e8..c86be72 100644 --- a/node/expr/binary/n_minus.go +++ b/node/expr/binary/n_minus.go @@ -9,7 +9,7 @@ import ( // Minus node type Minus struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Left node.Node Right node.Node @@ -33,12 +33,8 @@ func (n *Minus) GetPosition() *position.Position { return n.Position } -func (n *Minus) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *Minus) GetMeta() []meta.Meta { - return n.Meta +func (n *Minus) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/binary/n_mod.go b/node/expr/binary/n_mod.go index aeaaa67..4bf928d 100644 --- a/node/expr/binary/n_mod.go +++ b/node/expr/binary/n_mod.go @@ -9,7 +9,7 @@ import ( // Mod node type Mod struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Left node.Node Right node.Node @@ -33,12 +33,8 @@ func (n *Mod) GetPosition() *position.Position { return n.Position } -func (n *Mod) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *Mod) GetMeta() []meta.Meta { - return n.Meta +func (n *Mod) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/binary/n_mul.go b/node/expr/binary/n_mul.go index 9f92791..98b9a7e 100644 --- a/node/expr/binary/n_mul.go +++ b/node/expr/binary/n_mul.go @@ -9,7 +9,7 @@ import ( // Mul node type Mul struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Left node.Node Right node.Node @@ -33,12 +33,8 @@ func (n *Mul) GetPosition() *position.Position { return n.Position } -func (n *Mul) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *Mul) GetMeta() []meta.Meta { - return n.Meta +func (n *Mul) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/binary/n_not_equal.go b/node/expr/binary/n_not_equal.go index 9a684c1..915fae3 100644 --- a/node/expr/binary/n_not_equal.go +++ b/node/expr/binary/n_not_equal.go @@ -9,7 +9,7 @@ import ( // NotEqual node type NotEqual struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Left node.Node Right node.Node @@ -33,12 +33,8 @@ func (n *NotEqual) GetPosition() *position.Position { return n.Position } -func (n *NotEqual) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *NotEqual) GetMeta() []meta.Meta { - return n.Meta +func (n *NotEqual) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/binary/n_not_identical.go b/node/expr/binary/n_not_identical.go index de510ba..629b491 100644 --- a/node/expr/binary/n_not_identical.go +++ b/node/expr/binary/n_not_identical.go @@ -9,7 +9,7 @@ import ( // NotIdentical node type NotIdentical struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Left node.Node Right node.Node @@ -33,12 +33,8 @@ func (n *NotIdentical) GetPosition() *position.Position { return n.Position } -func (n *NotIdentical) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *NotIdentical) GetMeta() []meta.Meta { - return n.Meta +func (n *NotIdentical) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/binary/n_plus.go b/node/expr/binary/n_plus.go index 1c2e9ec..ffb81ed 100644 --- a/node/expr/binary/n_plus.go +++ b/node/expr/binary/n_plus.go @@ -9,7 +9,7 @@ import ( // Plus node type Plus struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Left node.Node Right node.Node @@ -33,12 +33,8 @@ func (n *Plus) GetPosition() *position.Position { return n.Position } -func (n *Plus) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *Plus) GetMeta() []meta.Meta { - return n.Meta +func (n *Plus) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/binary/n_pow.go b/node/expr/binary/n_pow.go index 82a7993..e07820c 100644 --- a/node/expr/binary/n_pow.go +++ b/node/expr/binary/n_pow.go @@ -9,7 +9,7 @@ import ( // Pow node type Pow struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Left node.Node Right node.Node @@ -33,12 +33,8 @@ func (n *Pow) GetPosition() *position.Position { return n.Position } -func (n *Pow) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *Pow) GetMeta() []meta.Meta { - return n.Meta +func (n *Pow) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/binary/n_shift_left.go b/node/expr/binary/n_shift_left.go index 5cb657d..7d15f7c 100644 --- a/node/expr/binary/n_shift_left.go +++ b/node/expr/binary/n_shift_left.go @@ -9,7 +9,7 @@ import ( // ShiftLeft node type ShiftLeft struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Left node.Node Right node.Node @@ -33,12 +33,8 @@ func (n *ShiftLeft) GetPosition() *position.Position { return n.Position } -func (n *ShiftLeft) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *ShiftLeft) GetMeta() []meta.Meta { - return n.Meta +func (n *ShiftLeft) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/binary/n_shift_right.go b/node/expr/binary/n_shift_right.go index aa94382..8e6087d 100644 --- a/node/expr/binary/n_shift_right.go +++ b/node/expr/binary/n_shift_right.go @@ -9,7 +9,7 @@ import ( // ShiftRight node type ShiftRight struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Left node.Node Right node.Node @@ -33,12 +33,8 @@ func (n *ShiftRight) GetPosition() *position.Position { return n.Position } -func (n *ShiftRight) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *ShiftRight) GetMeta() []meta.Meta { - return n.Meta +func (n *ShiftRight) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/binary/n_smaller.go b/node/expr/binary/n_smaller.go index cdaeeba..e598b75 100644 --- a/node/expr/binary/n_smaller.go +++ b/node/expr/binary/n_smaller.go @@ -9,7 +9,7 @@ import ( // Smaller node type Smaller struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Left node.Node Right node.Node @@ -33,12 +33,8 @@ func (n *Smaller) GetPosition() *position.Position { return n.Position } -func (n *Smaller) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *Smaller) GetMeta() []meta.Meta { - return n.Meta +func (n *Smaller) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/binary/n_smaller_or_equal.go b/node/expr/binary/n_smaller_or_equal.go index c2b81e4..14b82c8 100644 --- a/node/expr/binary/n_smaller_or_equal.go +++ b/node/expr/binary/n_smaller_or_equal.go @@ -9,7 +9,7 @@ import ( // SmallerOrEqual node type SmallerOrEqual struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Left node.Node Right node.Node @@ -33,12 +33,8 @@ func (n *SmallerOrEqual) GetPosition() *position.Position { return n.Position } -func (n *SmallerOrEqual) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *SmallerOrEqual) GetMeta() []meta.Meta { - return n.Meta +func (n *SmallerOrEqual) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/binary/n_spaceship.go b/node/expr/binary/n_spaceship.go index 3c18715..d47aa06 100644 --- a/node/expr/binary/n_spaceship.go +++ b/node/expr/binary/n_spaceship.go @@ -9,7 +9,7 @@ import ( // Spaceship node type Spaceship struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Left node.Node Right node.Node @@ -33,12 +33,8 @@ func (n *Spaceship) GetPosition() *position.Position { return n.Position } -func (n *Spaceship) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *Spaceship) GetMeta() []meta.Meta { - return n.Meta +func (n *Spaceship) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/binary/t_meta_test.go b/node/expr/binary/t_meta_test.go index 5c29048..95caac7 100644 --- a/node/expr/binary/t_meta_test.go +++ b/node/expr/binary/t_meta_test.go @@ -41,12 +41,20 @@ var nodes = []node.Node{ } func TestMeta(t *testing.T) { - expected := []meta.Meta{ - meta.NewComment("//comment\n", nil), - meta.NewWhiteSpace(" ", nil), + expected := &meta.Collection{ + &meta.Data{ + Value: "//comment\n", + Type: meta.CommentType, + Position: nil, + }, + &meta.Data{ + Value: " ", + Type: meta.WhiteSpaceType, + Position: nil, + }, } for _, n := range nodes { - n.AddMeta(expected) + n.GetMeta().Push(*expected...) actual := n.GetMeta() assertEqual(t, expected, actual) } diff --git a/node/expr/cast/n_cast_array.go b/node/expr/cast/n_cast_array.go index 7d5c417..a9cdca6 100644 --- a/node/expr/cast/n_cast_array.go +++ b/node/expr/cast/n_cast_array.go @@ -9,7 +9,7 @@ import ( // Array node type Array struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Expr node.Node } @@ -31,12 +31,8 @@ func (n *Array) GetPosition() *position.Position { return n.Position } -func (n *Array) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *Array) GetMeta() []meta.Meta { - return n.Meta +func (n *Array) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/cast/n_cast_bool.go b/node/expr/cast/n_cast_bool.go index 00e807c..6ee1ab8 100644 --- a/node/expr/cast/n_cast_bool.go +++ b/node/expr/cast/n_cast_bool.go @@ -9,7 +9,7 @@ import ( // Bool node type Bool struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Expr node.Node } @@ -31,12 +31,8 @@ func (n *Bool) GetPosition() *position.Position { return n.Position } -func (n *Bool) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *Bool) GetMeta() []meta.Meta { - return n.Meta +func (n *Bool) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/cast/n_cast_double.go b/node/expr/cast/n_cast_double.go index 0abc582..621ae30 100644 --- a/node/expr/cast/n_cast_double.go +++ b/node/expr/cast/n_cast_double.go @@ -9,7 +9,7 @@ import ( // Double node type Double struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Expr node.Node } @@ -31,12 +31,8 @@ func (n *Double) GetPosition() *position.Position { return n.Position } -func (n *Double) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *Double) GetMeta() []meta.Meta { - return n.Meta +func (n *Double) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/cast/n_cast_int.go b/node/expr/cast/n_cast_int.go index d9247b2..f0ec5ef 100644 --- a/node/expr/cast/n_cast_int.go +++ b/node/expr/cast/n_cast_int.go @@ -9,7 +9,7 @@ import ( // Int node type Int struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Expr node.Node } @@ -31,12 +31,8 @@ func (n *Int) GetPosition() *position.Position { return n.Position } -func (n *Int) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *Int) GetMeta() []meta.Meta { - return n.Meta +func (n *Int) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/cast/n_cast_object.go b/node/expr/cast/n_cast_object.go index 02de408..35b2136 100644 --- a/node/expr/cast/n_cast_object.go +++ b/node/expr/cast/n_cast_object.go @@ -9,7 +9,7 @@ import ( // Object node type Object struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Expr node.Node } @@ -31,12 +31,8 @@ func (n *Object) GetPosition() *position.Position { return n.Position } -func (n *Object) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *Object) GetMeta() []meta.Meta { - return n.Meta +func (n *Object) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/cast/n_cast_string.go b/node/expr/cast/n_cast_string.go index e58fb5e..6e51ea6 100644 --- a/node/expr/cast/n_cast_string.go +++ b/node/expr/cast/n_cast_string.go @@ -9,7 +9,7 @@ import ( // String node type String struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Expr node.Node } @@ -31,12 +31,8 @@ func (n *String) GetPosition() *position.Position { return n.Position } -func (n *String) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *String) GetMeta() []meta.Meta { - return n.Meta +func (n *String) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/cast/n_cast_unset.go b/node/expr/cast/n_cast_unset.go index 8e52521..72c7ba6 100644 --- a/node/expr/cast/n_cast_unset.go +++ b/node/expr/cast/n_cast_unset.go @@ -9,7 +9,7 @@ import ( // Unset node type Unset struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Expr node.Node } @@ -31,12 +31,8 @@ func (n *Unset) GetPosition() *position.Position { return n.Position } -func (n *Unset) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *Unset) GetMeta() []meta.Meta { - return n.Meta +func (n *Unset) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/cast/t_meta_test.go b/node/expr/cast/t_meta_test.go index e2e4dbb..167b0ad 100644 --- a/node/expr/cast/t_meta_test.go +++ b/node/expr/cast/t_meta_test.go @@ -21,12 +21,20 @@ var nodes = []node.Node{ } func TestMeta(t *testing.T) { - expected := []meta.Meta{ - meta.NewComment("//comment\n", nil), - meta.NewWhiteSpace(" ", nil), + expected := &meta.Collection{ + &meta.Data{ + Value: "//comment\n", + Type: meta.CommentType, + Position: nil, + }, + &meta.Data{ + Value: " ", + Type: meta.WhiteSpaceType, + Position: nil, + }, } for _, n := range nodes { - n.AddMeta(expected) + n.GetMeta().Push(*expected...) actual := n.GetMeta() assertEqual(t, expected, actual) } diff --git a/node/expr/n_array.go b/node/expr/n_array.go index 986d070..a407fde 100644 --- a/node/expr/n_array.go +++ b/node/expr/n_array.go @@ -9,7 +9,7 @@ import ( // Array node type Array struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Items []node.Node } @@ -31,12 +31,8 @@ func (n *Array) GetPosition() *position.Position { return n.Position } -func (n *Array) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *Array) GetMeta() []meta.Meta { - return n.Meta +func (n *Array) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/n_array_dim_fetch.go b/node/expr/n_array_dim_fetch.go index 71e9bce..abe104e 100644 --- a/node/expr/n_array_dim_fetch.go +++ b/node/expr/n_array_dim_fetch.go @@ -9,7 +9,7 @@ import ( // ArrayDimFetch node type ArrayDimFetch struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Variable node.Node Dim node.Node @@ -33,12 +33,8 @@ func (n *ArrayDimFetch) GetPosition() *position.Position { return n.Position } -func (n *ArrayDimFetch) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *ArrayDimFetch) GetMeta() []meta.Meta { - return n.Meta +func (n *ArrayDimFetch) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/n_array_item.go b/node/expr/n_array_item.go index e41c6e7..6ab5574 100644 --- a/node/expr/n_array_item.go +++ b/node/expr/n_array_item.go @@ -9,7 +9,7 @@ import ( // ArrayItem node type ArrayItem struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Key node.Node Val node.Node @@ -33,12 +33,8 @@ func (n *ArrayItem) GetPosition() *position.Position { return n.Position } -func (n *ArrayItem) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *ArrayItem) GetMeta() []meta.Meta { - return n.Meta +func (n *ArrayItem) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/n_bitwise_not.go b/node/expr/n_bitwise_not.go index 102acbc..62065dc 100644 --- a/node/expr/n_bitwise_not.go +++ b/node/expr/n_bitwise_not.go @@ -9,7 +9,7 @@ import ( // BitwiseNot node type BitwiseNot struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Expr node.Node } @@ -31,12 +31,8 @@ func (n *BitwiseNot) GetPosition() *position.Position { return n.Position } -func (n *BitwiseNot) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *BitwiseNot) GetMeta() []meta.Meta { - return n.Meta +func (n *BitwiseNot) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/n_boolean_not.go b/node/expr/n_boolean_not.go index 7f688fa..85438dd 100644 --- a/node/expr/n_boolean_not.go +++ b/node/expr/n_boolean_not.go @@ -9,7 +9,7 @@ import ( // BooleanNot node type BooleanNot struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Expr node.Node } @@ -31,12 +31,8 @@ func (n *BooleanNot) GetPosition() *position.Position { return n.Position } -func (n *BooleanNot) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *BooleanNot) GetMeta() []meta.Meta { - return n.Meta +func (n *BooleanNot) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/n_class_const_fetch.go b/node/expr/n_class_const_fetch.go index 093a3b9..511d6b7 100644 --- a/node/expr/n_class_const_fetch.go +++ b/node/expr/n_class_const_fetch.go @@ -9,7 +9,7 @@ import ( // ClassConstFetch node type ClassConstFetch struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Class node.Node ConstantName node.Node @@ -33,12 +33,8 @@ func (n *ClassConstFetch) GetPosition() *position.Position { return n.Position } -func (n *ClassConstFetch) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *ClassConstFetch) GetMeta() []meta.Meta { - return n.Meta +func (n *ClassConstFetch) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/n_clone.go b/node/expr/n_clone.go index 09a4a1b..79688cc 100644 --- a/node/expr/n_clone.go +++ b/node/expr/n_clone.go @@ -9,7 +9,7 @@ import ( // Clone node type Clone struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Expr node.Node } @@ -31,12 +31,8 @@ func (n *Clone) GetPosition() *position.Position { return n.Position } -func (n *Clone) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *Clone) GetMeta() []meta.Meta { - return n.Meta +func (n *Clone) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/n_closure.go b/node/expr/n_closure.go index 57e455e..e863df9 100644 --- a/node/expr/n_closure.go +++ b/node/expr/n_closure.go @@ -9,7 +9,7 @@ import ( // Closure node type Closure struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position ReturnsRef bool Static bool @@ -43,12 +43,8 @@ func (n *Closure) GetPosition() *position.Position { return n.Position } -func (n *Closure) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *Closure) GetMeta() []meta.Meta { - return n.Meta +func (n *Closure) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/n_closure_use.go b/node/expr/n_closure_use.go index d17cbe7..24ab5fc 100644 --- a/node/expr/n_closure_use.go +++ b/node/expr/n_closure_use.go @@ -9,7 +9,7 @@ import ( // ClosureUse node type ClosureUse struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Uses []node.Node } @@ -31,12 +31,8 @@ func (n *ClosureUse) GetPosition() *position.Position { return n.Position } -func (n *ClosureUse) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *ClosureUse) GetMeta() []meta.Meta { - return n.Meta +func (n *ClosureUse) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/n_const_fetch.go b/node/expr/n_const_fetch.go index ef027da..f11ce1d 100644 --- a/node/expr/n_const_fetch.go +++ b/node/expr/n_const_fetch.go @@ -9,7 +9,7 @@ import ( // ConstFetch node type ConstFetch struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Constant node.Node } @@ -31,12 +31,8 @@ func (n *ConstFetch) GetPosition() *position.Position { return n.Position } -func (n *ConstFetch) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *ConstFetch) GetMeta() []meta.Meta { - return n.Meta +func (n *ConstFetch) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/n_empty.go b/node/expr/n_empty.go index a46f25e..47d57f5 100644 --- a/node/expr/n_empty.go +++ b/node/expr/n_empty.go @@ -9,7 +9,7 @@ import ( // Empty node type Empty struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Expr node.Node } @@ -31,12 +31,8 @@ func (n *Empty) GetPosition() *position.Position { return n.Position } -func (n *Empty) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *Empty) GetMeta() []meta.Meta { - return n.Meta +func (n *Empty) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/n_error_suppress.go b/node/expr/n_error_suppress.go index 8c61212..35179fc 100644 --- a/node/expr/n_error_suppress.go +++ b/node/expr/n_error_suppress.go @@ -9,7 +9,7 @@ import ( // ErrorSuppress node type ErrorSuppress struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Expr node.Node } @@ -31,12 +31,8 @@ func (n *ErrorSuppress) GetPosition() *position.Position { return n.Position } -func (n *ErrorSuppress) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *ErrorSuppress) GetMeta() []meta.Meta { - return n.Meta +func (n *ErrorSuppress) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/n_eval.go b/node/expr/n_eval.go index 4b6e32c..ee83c72 100644 --- a/node/expr/n_eval.go +++ b/node/expr/n_eval.go @@ -9,7 +9,7 @@ import ( // Eval node type Eval struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Expr node.Node } @@ -31,12 +31,8 @@ func (n *Eval) GetPosition() *position.Position { return n.Position } -func (n *Eval) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *Eval) GetMeta() []meta.Meta { - return n.Meta +func (n *Eval) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/n_exit.go b/node/expr/n_exit.go index 721f2f2..c64b123 100644 --- a/node/expr/n_exit.go +++ b/node/expr/n_exit.go @@ -9,7 +9,7 @@ import ( // Exit node type Exit struct { - Meta []meta.Meta + Meta meta.Collection Die bool Position *position.Position Expr node.Node @@ -32,12 +32,8 @@ func (n *Exit) GetPosition() *position.Position { return n.Position } -func (n *Exit) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *Exit) GetMeta() []meta.Meta { - return n.Meta +func (n *Exit) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/n_function_call.go b/node/expr/n_function_call.go index ef12d05..b10d331 100644 --- a/node/expr/n_function_call.go +++ b/node/expr/n_function_call.go @@ -9,7 +9,7 @@ import ( // FunctionCall node type FunctionCall struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Function node.Node ArgumentList *node.ArgumentList @@ -33,12 +33,8 @@ func (n *FunctionCall) GetPosition() *position.Position { return n.Position } -func (n *FunctionCall) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *FunctionCall) GetMeta() []meta.Meta { - return n.Meta +func (n *FunctionCall) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/n_include.go b/node/expr/n_include.go index ccae9be..0c9f76e 100644 --- a/node/expr/n_include.go +++ b/node/expr/n_include.go @@ -9,7 +9,7 @@ import ( // Include node type Include struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Expr node.Node } @@ -31,12 +31,8 @@ func (n *Include) GetPosition() *position.Position { return n.Position } -func (n *Include) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *Include) GetMeta() []meta.Meta { - return n.Meta +func (n *Include) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/n_include_once.go b/node/expr/n_include_once.go index 5e54048..b613453 100644 --- a/node/expr/n_include_once.go +++ b/node/expr/n_include_once.go @@ -9,7 +9,7 @@ import ( // IncludeOnce node type IncludeOnce struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Expr node.Node } @@ -31,12 +31,8 @@ func (n *IncludeOnce) GetPosition() *position.Position { return n.Position } -func (n *IncludeOnce) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *IncludeOnce) GetMeta() []meta.Meta { - return n.Meta +func (n *IncludeOnce) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/n_instance_of.go b/node/expr/n_instance_of.go index 1e2d6ce..15cd423 100644 --- a/node/expr/n_instance_of.go +++ b/node/expr/n_instance_of.go @@ -9,7 +9,7 @@ import ( // InstanceOf node type InstanceOf struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Expr node.Node Class node.Node @@ -33,12 +33,8 @@ func (n *InstanceOf) GetPosition() *position.Position { return n.Position } -func (n *InstanceOf) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *InstanceOf) GetMeta() []meta.Meta { - return n.Meta +func (n *InstanceOf) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/n_isset.go b/node/expr/n_isset.go index 6d556b2..c3064e7 100644 --- a/node/expr/n_isset.go +++ b/node/expr/n_isset.go @@ -9,7 +9,7 @@ import ( // Isset node type Isset struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Variables []node.Node } @@ -31,12 +31,8 @@ func (n *Isset) GetPosition() *position.Position { return n.Position } -func (n *Isset) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *Isset) GetMeta() []meta.Meta { - return n.Meta +func (n *Isset) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/n_list.go b/node/expr/n_list.go index d1862a3..cd691ef 100644 --- a/node/expr/n_list.go +++ b/node/expr/n_list.go @@ -9,7 +9,7 @@ import ( // List node type List struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Items []node.Node } @@ -31,12 +31,8 @@ func (n *List) GetPosition() *position.Position { return n.Position } -func (n *List) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *List) GetMeta() []meta.Meta { - return n.Meta +func (n *List) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/n_method_call.go b/node/expr/n_method_call.go index 6cd1b33..12c0284 100644 --- a/node/expr/n_method_call.go +++ b/node/expr/n_method_call.go @@ -9,7 +9,7 @@ import ( // MethodCall node type MethodCall struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Variable node.Node Method node.Node @@ -35,12 +35,8 @@ func (n *MethodCall) GetPosition() *position.Position { return n.Position } -func (n *MethodCall) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *MethodCall) GetMeta() []meta.Meta { - return n.Meta +func (n *MethodCall) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/n_new.go b/node/expr/n_new.go index 3ff14fb..0d7a1d1 100644 --- a/node/expr/n_new.go +++ b/node/expr/n_new.go @@ -9,7 +9,7 @@ import ( // New node type New struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Class node.Node ArgumentList *node.ArgumentList @@ -33,12 +33,8 @@ func (n *New) GetPosition() *position.Position { return n.Position } -func (n *New) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *New) GetMeta() []meta.Meta { - return n.Meta +func (n *New) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/n_post_dec.go b/node/expr/n_post_dec.go index ef5d0c2..fb8e732 100644 --- a/node/expr/n_post_dec.go +++ b/node/expr/n_post_dec.go @@ -9,7 +9,7 @@ import ( // PostDec node type PostDec struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Variable node.Node } @@ -31,12 +31,8 @@ func (n *PostDec) GetPosition() *position.Position { return n.Position } -func (n *PostDec) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *PostDec) GetMeta() []meta.Meta { - return n.Meta +func (n *PostDec) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/n_post_inc.go b/node/expr/n_post_inc.go index 2d1e917..eca9350 100644 --- a/node/expr/n_post_inc.go +++ b/node/expr/n_post_inc.go @@ -9,7 +9,7 @@ import ( // PostInc node type PostInc struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Variable node.Node } @@ -31,12 +31,8 @@ func (n *PostInc) GetPosition() *position.Position { return n.Position } -func (n *PostInc) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *PostInc) GetMeta() []meta.Meta { - return n.Meta +func (n *PostInc) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/n_pre_dec.go b/node/expr/n_pre_dec.go index f5bf0fb..26854dc 100644 --- a/node/expr/n_pre_dec.go +++ b/node/expr/n_pre_dec.go @@ -9,7 +9,7 @@ import ( // PreDec node type PreDec struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Variable node.Node } @@ -31,12 +31,8 @@ func (n *PreDec) GetPosition() *position.Position { return n.Position } -func (n *PreDec) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *PreDec) GetMeta() []meta.Meta { - return n.Meta +func (n *PreDec) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/n_pre_inc.go b/node/expr/n_pre_inc.go index 8b31e4e..072095b 100644 --- a/node/expr/n_pre_inc.go +++ b/node/expr/n_pre_inc.go @@ -9,7 +9,7 @@ import ( // PreInc node type PreInc struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Variable node.Node } @@ -31,12 +31,8 @@ func (n *PreInc) GetPosition() *position.Position { return n.Position } -func (n *PreInc) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *PreInc) GetMeta() []meta.Meta { - return n.Meta +func (n *PreInc) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/n_print.go b/node/expr/n_print.go index 52bef36..3cda268 100644 --- a/node/expr/n_print.go +++ b/node/expr/n_print.go @@ -9,7 +9,7 @@ import ( // Print node type Print struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Expr node.Node } @@ -31,12 +31,8 @@ func (n *Print) GetPosition() *position.Position { return n.Position } -func (n *Print) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *Print) GetMeta() []meta.Meta { - return n.Meta +func (n *Print) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/n_property_fetch.go b/node/expr/n_property_fetch.go index 4b7f56d..80ef03b 100644 --- a/node/expr/n_property_fetch.go +++ b/node/expr/n_property_fetch.go @@ -9,7 +9,7 @@ import ( // PropertyFetch node type PropertyFetch struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Variable node.Node Property node.Node @@ -33,12 +33,8 @@ func (n *PropertyFetch) GetPosition() *position.Position { return n.Position } -func (n *PropertyFetch) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *PropertyFetch) GetMeta() []meta.Meta { - return n.Meta +func (n *PropertyFetch) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/n_reference.go b/node/expr/n_reference.go index 22f305a..761d113 100644 --- a/node/expr/n_reference.go +++ b/node/expr/n_reference.go @@ -9,7 +9,7 @@ import ( // Reference node type Reference struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Variable node.Node } @@ -31,12 +31,8 @@ func (n *Reference) GetPosition() *position.Position { return n.Position } -func (n *Reference) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *Reference) GetMeta() []meta.Meta { - return n.Meta +func (n *Reference) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/n_require.go b/node/expr/n_require.go index 0a3144e..6252809 100644 --- a/node/expr/n_require.go +++ b/node/expr/n_require.go @@ -9,7 +9,7 @@ import ( // Require node type Require struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Expr node.Node } @@ -31,12 +31,8 @@ func (n *Require) GetPosition() *position.Position { return n.Position } -func (n *Require) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *Require) GetMeta() []meta.Meta { - return n.Meta +func (n *Require) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/n_require_once.go b/node/expr/n_require_once.go index 2dc6161..04f2722 100644 --- a/node/expr/n_require_once.go +++ b/node/expr/n_require_once.go @@ -9,7 +9,7 @@ import ( // RequireOnce node type RequireOnce struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Expr node.Node } @@ -31,12 +31,8 @@ func (n *RequireOnce) GetPosition() *position.Position { return n.Position } -func (n *RequireOnce) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *RequireOnce) GetMeta() []meta.Meta { - return n.Meta +func (n *RequireOnce) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/n_shell_exec.go b/node/expr/n_shell_exec.go index 749a51b..e426c7e 100644 --- a/node/expr/n_shell_exec.go +++ b/node/expr/n_shell_exec.go @@ -9,7 +9,7 @@ import ( // ShellExec node type ShellExec struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Parts []node.Node } @@ -31,12 +31,8 @@ func (n *ShellExec) GetPosition() *position.Position { return n.Position } -func (n *ShellExec) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *ShellExec) GetMeta() []meta.Meta { - return n.Meta +func (n *ShellExec) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/n_short_array.go b/node/expr/n_short_array.go index ab04658..8128cee 100644 --- a/node/expr/n_short_array.go +++ b/node/expr/n_short_array.go @@ -9,7 +9,7 @@ import ( // ShortArray node type ShortArray struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Items []node.Node } @@ -31,12 +31,8 @@ func (n *ShortArray) GetPosition() *position.Position { return n.Position } -func (n *ShortArray) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *ShortArray) GetMeta() []meta.Meta { - return n.Meta +func (n *ShortArray) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/n_short_list.go b/node/expr/n_short_list.go index c2ba2a7..f76c6ac 100644 --- a/node/expr/n_short_list.go +++ b/node/expr/n_short_list.go @@ -9,7 +9,7 @@ import ( // ShortList node type ShortList struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Items []node.Node } @@ -31,12 +31,8 @@ func (n *ShortList) GetPosition() *position.Position { return n.Position } -func (n *ShortList) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *ShortList) GetMeta() []meta.Meta { - return n.Meta +func (n *ShortList) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/n_static_call.go b/node/expr/n_static_call.go index 61ac3ff..cf0c0aa 100644 --- a/node/expr/n_static_call.go +++ b/node/expr/n_static_call.go @@ -9,7 +9,7 @@ import ( // StaticCall node type StaticCall struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Class node.Node Call node.Node @@ -35,12 +35,8 @@ func (n *StaticCall) GetPosition() *position.Position { return n.Position } -func (n *StaticCall) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *StaticCall) GetMeta() []meta.Meta { - return n.Meta +func (n *StaticCall) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/n_static_property_fetch.go b/node/expr/n_static_property_fetch.go index 58b2b96..351809c 100644 --- a/node/expr/n_static_property_fetch.go +++ b/node/expr/n_static_property_fetch.go @@ -9,7 +9,7 @@ import ( // StaticPropertyFetch node type StaticPropertyFetch struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Class node.Node Property node.Node @@ -33,12 +33,8 @@ func (n *StaticPropertyFetch) GetPosition() *position.Position { return n.Position } -func (n *StaticPropertyFetch) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *StaticPropertyFetch) GetMeta() []meta.Meta { - return n.Meta +func (n *StaticPropertyFetch) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/n_ternary.go b/node/expr/n_ternary.go index 99bbb50..b9c9b9d 100644 --- a/node/expr/n_ternary.go +++ b/node/expr/n_ternary.go @@ -9,7 +9,7 @@ import ( // Ternary node type Ternary struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Condition node.Node IfTrue node.Node @@ -35,12 +35,8 @@ func (n *Ternary) GetPosition() *position.Position { return n.Position } -func (n *Ternary) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *Ternary) GetMeta() []meta.Meta { - return n.Meta +func (n *Ternary) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/n_unary_minus.go b/node/expr/n_unary_minus.go index aa89cd8..ba5e774 100644 --- a/node/expr/n_unary_minus.go +++ b/node/expr/n_unary_minus.go @@ -9,7 +9,7 @@ import ( // UnaryMinus node type UnaryMinus struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Expr node.Node } @@ -31,12 +31,8 @@ func (n *UnaryMinus) GetPosition() *position.Position { return n.Position } -func (n *UnaryMinus) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *UnaryMinus) GetMeta() []meta.Meta { - return n.Meta +func (n *UnaryMinus) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/n_unary_plus.go b/node/expr/n_unary_plus.go index 4de08aa..54da742 100644 --- a/node/expr/n_unary_plus.go +++ b/node/expr/n_unary_plus.go @@ -9,7 +9,7 @@ import ( // UnaryPlus node type UnaryPlus struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Expr node.Node } @@ -31,12 +31,8 @@ func (n *UnaryPlus) GetPosition() *position.Position { return n.Position } -func (n *UnaryPlus) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *UnaryPlus) GetMeta() []meta.Meta { - return n.Meta +func (n *UnaryPlus) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/n_variable.go b/node/expr/n_variable.go index 5b29038..858e736 100644 --- a/node/expr/n_variable.go +++ b/node/expr/n_variable.go @@ -9,9 +9,10 @@ import ( // Variable node type Variable struct { - Meta []meta.Meta - Position *position.Position - VarName node.Node + Meta meta.Collection + StringVar bool + Position *position.Position + VarName node.Node } // NewVariable node constructor @@ -31,17 +32,15 @@ func (n *Variable) GetPosition() *position.Position { return n.Position } -func (n *Variable) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *Variable) GetMeta() []meta.Meta { - return n.Meta +func (n *Variable) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map func (n *Variable) Attributes() map[string]interface{} { - return nil + return map[string]interface{}{ + "StringVar": n.StringVar, + } } // SetVarName reset var name diff --git a/node/expr/n_yield.go b/node/expr/n_yield.go index 453b479..fd71f53 100644 --- a/node/expr/n_yield.go +++ b/node/expr/n_yield.go @@ -9,7 +9,7 @@ import ( // Yield node type Yield struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Key node.Node Value node.Node @@ -33,12 +33,8 @@ func (n *Yield) GetPosition() *position.Position { return n.Position } -func (n *Yield) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *Yield) GetMeta() []meta.Meta { - return n.Meta +func (n *Yield) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/n_yield_from.go b/node/expr/n_yield_from.go index 561cec1..758de2c 100644 --- a/node/expr/n_yield_from.go +++ b/node/expr/n_yield_from.go @@ -9,7 +9,7 @@ import ( // YieldFrom node type YieldFrom struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Expr node.Node } @@ -31,12 +31,8 @@ func (n *YieldFrom) GetPosition() *position.Position { return n.Position } -func (n *YieldFrom) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *YieldFrom) GetMeta() []meta.Meta { - return n.Meta +func (n *YieldFrom) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/expr/t_meta_test.go b/node/expr/t_meta_test.go index 4c95b99..fd80d3b 100644 --- a/node/expr/t_meta_test.go +++ b/node/expr/t_meta_test.go @@ -56,12 +56,20 @@ var nodes = []node.Node{ } func TestMeta(t *testing.T) { - expected := []meta.Meta{ - meta.NewComment("//comment\n", nil), - meta.NewWhiteSpace(" ", nil), + expected := &meta.Collection{ + &meta.Data{ + Value: "//comment\n", + Type: meta.CommentType, + Position: nil, + }, + &meta.Data{ + Value: " ", + Type: meta.WhiteSpaceType, + Position: nil, + }, } for _, n := range nodes { - n.AddMeta(expected) + n.GetMeta().Push(*expected...) actual := n.GetMeta() assertEqual(t, expected, actual) } diff --git a/node/expr/t_visitor_test.go b/node/expr/t_visitor_test.go index a8bc087..2087c81 100644 --- a/node/expr/t_visitor_test.go +++ b/node/expr/t_visitor_test.go @@ -333,7 +333,9 @@ var nodesToTest = []struct { { &expr.Variable{VarName: &node.Identifier{Value: "a"}}, []string{"VarName"}, - map[string]interface{}{}, + map[string]interface{}{ + "StringVar": false, + }, }, { &expr.YieldFrom{ diff --git a/node/n_argument.go b/node/n_argument.go index 5d42fb4..c88a4d6 100644 --- a/node/n_argument.go +++ b/node/n_argument.go @@ -8,7 +8,7 @@ import ( // Argument node type Argument struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Variadic bool // if ... before variable IsReference bool // if & before variable @@ -34,12 +34,8 @@ func (n *Argument) GetPosition() *position.Position { return n.Position } -func (n *Argument) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *Argument) GetMeta() []meta.Meta { - return n.Meta +func (n *Argument) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/n_argument_list.go b/node/n_argument_list.go index ef5563f..ecfa40e 100644 --- a/node/n_argument_list.go +++ b/node/n_argument_list.go @@ -8,7 +8,7 @@ import ( // ArgumentList node type ArgumentList struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Arguments []Node } @@ -30,12 +30,8 @@ func (n *ArgumentList) GetPosition() *position.Position { return n.Position } -func (n *ArgumentList) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *ArgumentList) GetMeta() []meta.Meta { - return n.Meta +func (n *ArgumentList) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/n_identifier.go b/node/n_identifier.go index 9604465..5d35674 100644 --- a/node/n_identifier.go +++ b/node/n_identifier.go @@ -8,7 +8,7 @@ import ( // Identifier node type Identifier struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Value string } @@ -30,12 +30,8 @@ func (n *Identifier) GetPosition() *position.Position { return n.Position } -func (n *Identifier) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *Identifier) GetMeta() []meta.Meta { - return n.Meta +func (n *Identifier) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/n_nullable.go b/node/n_nullable.go index aa1e745..f62a2b5 100644 --- a/node/n_nullable.go +++ b/node/n_nullable.go @@ -8,7 +8,7 @@ import ( // Nullable node type Nullable struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Expr Node } @@ -30,12 +30,8 @@ func (n *Nullable) GetPosition() *position.Position { return n.Position } -func (n *Nullable) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *Nullable) GetMeta() []meta.Meta { - return n.Meta +func (n *Nullable) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/n_parameter.go b/node/n_parameter.go index 6a571e3..e1def7b 100644 --- a/node/n_parameter.go +++ b/node/n_parameter.go @@ -8,7 +8,7 @@ import ( // Parameter node type Parameter struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position ByRef bool Variadic bool @@ -38,12 +38,8 @@ func (n *Parameter) GetPosition() *position.Position { return n.Position } -func (n *Parameter) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *Parameter) GetMeta() []meta.Meta { - return n.Meta +func (n *Parameter) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/n_root.go b/node/n_root.go index 1b14629..f95d301 100644 --- a/node/n_root.go +++ b/node/n_root.go @@ -8,7 +8,7 @@ import ( // Root node type Root struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Stmts []Node } @@ -30,12 +30,8 @@ func (n *Root) GetPosition() *position.Position { return n.Position } -func (n *Root) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *Root) GetMeta() []meta.Meta { - return n.Meta +func (n *Root) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/name/n_fully_qualified.go b/node/name/n_fully_qualified.go index ca936b9..7f632c8 100644 --- a/node/name/n_fully_qualified.go +++ b/node/name/n_fully_qualified.go @@ -9,7 +9,7 @@ import ( // FullyQualified node type FullyQualified struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Parts []node.Node } @@ -31,12 +31,8 @@ func (n *FullyQualified) GetPosition() *position.Position { return n.Position } -func (n *FullyQualified) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *FullyQualified) GetMeta() []meta.Meta { - return n.Meta +func (n *FullyQualified) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/name/n_name.go b/node/name/n_name.go index d6cc74d..4113c3e 100644 --- a/node/name/n_name.go +++ b/node/name/n_name.go @@ -9,7 +9,7 @@ import ( // Name node type Name struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Parts []node.Node } @@ -31,12 +31,8 @@ func (n *Name) GetPosition() *position.Position { return n.Position } -func (n *Name) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *Name) GetMeta() []meta.Meta { - return n.Meta +func (n *Name) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/name/n_name_part.go b/node/name/n_name_part.go index 3074009..9c371f2 100644 --- a/node/name/n_name_part.go +++ b/node/name/n_name_part.go @@ -8,7 +8,7 @@ import ( // NamePart node type NamePart struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Value string } @@ -30,12 +30,8 @@ func (n *NamePart) GetPosition() *position.Position { return n.Position } -func (n *NamePart) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *NamePart) GetMeta() []meta.Meta { - return n.Meta +func (n *NamePart) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/name/n_relative.go b/node/name/n_relative.go index 271110e..561dfb1 100644 --- a/node/name/n_relative.go +++ b/node/name/n_relative.go @@ -9,7 +9,7 @@ import ( // Relative node type Relative struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Parts []node.Node } @@ -31,12 +31,8 @@ func (n *Relative) GetPosition() *position.Position { return n.Position } -func (n *Relative) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *Relative) GetMeta() []meta.Meta { - return n.Meta +func (n *Relative) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/name/t_meta_test.go b/node/name/t_meta_test.go index 4b35fe2..3f4cc7a 100644 --- a/node/name/t_meta_test.go +++ b/node/name/t_meta_test.go @@ -18,12 +18,20 @@ var nodes = []node.Node{ } func TestMeta(t *testing.T) { - expected := []meta.Meta{ - meta.NewComment("//comment\n", nil), - meta.NewWhiteSpace(" ", nil), + expected := &meta.Collection{ + &meta.Data{ + Value: "//comment\n", + Type: meta.CommentType, + Position: nil, + }, + &meta.Data{ + Value: " ", + Type: meta.WhiteSpaceType, + Position: nil, + }, } for _, n := range nodes { - n.AddMeta(expected) + n.GetMeta().Push(*expected...) actual := n.GetMeta() assertEqual(t, expected, actual) } diff --git a/node/node.go b/node/node.go index c3c94e1..390374f 100644 --- a/node/node.go +++ b/node/node.go @@ -12,6 +12,5 @@ type Node interface { Attributes() map[string]interface{} // Attributes returns node attributes as map SetPosition(p *position.Position) GetPosition() *position.Position - AddMeta(m []meta.Meta) - GetMeta() []meta.Meta + GetMeta() *meta.Collection } diff --git a/node/scalar/node_dnumber.go b/node/scalar/node_dnumber.go index 06e1946..1368e7f 100644 --- a/node/scalar/node_dnumber.go +++ b/node/scalar/node_dnumber.go @@ -8,7 +8,7 @@ import ( // Dnumber node type Dnumber struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Value string } @@ -30,12 +30,8 @@ func (n *Dnumber) GetPosition() *position.Position { return n.Position } -func (n *Dnumber) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *Dnumber) GetMeta() []meta.Meta { - return n.Meta +func (n *Dnumber) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/scalar/node_encapsed.go b/node/scalar/node_encapsed.go index 1a971e5..44c61a1 100644 --- a/node/scalar/node_encapsed.go +++ b/node/scalar/node_encapsed.go @@ -9,7 +9,7 @@ import ( // Encapsed node type Encapsed struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Parts []node.Node } @@ -31,12 +31,8 @@ func (n *Encapsed) GetPosition() *position.Position { return n.Position } -func (n *Encapsed) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *Encapsed) GetMeta() []meta.Meta { - return n.Meta +func (n *Encapsed) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/scalar/node_encapsed_string_part.go b/node/scalar/node_encapsed_string_part.go index a0d6ab7..1b30c95 100644 --- a/node/scalar/node_encapsed_string_part.go +++ b/node/scalar/node_encapsed_string_part.go @@ -8,7 +8,7 @@ import ( // EncapsedStringPart node type EncapsedStringPart struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Value string } @@ -30,12 +30,8 @@ func (n *EncapsedStringPart) GetPosition() *position.Position { return n.Position } -func (n *EncapsedStringPart) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *EncapsedStringPart) GetMeta() []meta.Meta { - return n.Meta +func (n *EncapsedStringPart) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/scalar/node_heredoc.go b/node/scalar/node_heredoc.go index 6d49063..205d53d 100644 --- a/node/scalar/node_heredoc.go +++ b/node/scalar/node_heredoc.go @@ -9,7 +9,7 @@ import ( // Heredoc node type Heredoc struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Label string Parts []node.Node @@ -33,12 +33,8 @@ func (n *Heredoc) GetPosition() *position.Position { return n.Position } -func (n *Heredoc) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *Heredoc) GetMeta() []meta.Meta { - return n.Meta +func (n *Heredoc) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/scalar/node_lnumber.go b/node/scalar/node_lnumber.go index 96fd4d3..9d82183 100644 --- a/node/scalar/node_lnumber.go +++ b/node/scalar/node_lnumber.go @@ -8,7 +8,7 @@ import ( // Lnumber node type Lnumber struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Value string } @@ -30,12 +30,8 @@ func (n *Lnumber) GetPosition() *position.Position { return n.Position } -func (n *Lnumber) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *Lnumber) GetMeta() []meta.Meta { - return n.Meta +func (n *Lnumber) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/scalar/node_magic_constant.go b/node/scalar/node_magic_constant.go index 5edc129..a8f3f94 100644 --- a/node/scalar/node_magic_constant.go +++ b/node/scalar/node_magic_constant.go @@ -8,7 +8,7 @@ import ( // MagicConstant node type MagicConstant struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Value string } @@ -30,12 +30,8 @@ func (n *MagicConstant) GetPosition() *position.Position { return n.Position } -func (n *MagicConstant) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *MagicConstant) GetMeta() []meta.Meta { - return n.Meta +func (n *MagicConstant) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/scalar/node_string.go b/node/scalar/node_string.go index 8692098..6c42b73 100644 --- a/node/scalar/node_string.go +++ b/node/scalar/node_string.go @@ -8,7 +8,7 @@ import ( // String node type String struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Value string } @@ -30,12 +30,8 @@ func (n *String) GetPosition() *position.Position { return n.Position } -func (n *String) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *String) GetMeta() []meta.Meta { - return n.Meta +func (n *String) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/scalar/t_encapsed_test.go b/node/scalar/t_encapsed_test.go index c77cd8d..6669ecf 100644 --- a/node/scalar/t_encapsed_test.go +++ b/node/scalar/t_encapsed_test.go @@ -453,6 +453,7 @@ func TestDollarOpenCurlyBraces(t *testing.T) { StartPos: 10, EndPos: 15, }, + StringVar: true, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 1, @@ -529,6 +530,7 @@ func TestDollarOpenCurlyBracesDimNumber(t *testing.T) { StartPos: 12, EndPos: 14, }, + StringVar: true, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 1, diff --git a/node/scalar/t_meta_test.go b/node/scalar/t_meta_test.go index 449db8b..4040547 100644 --- a/node/scalar/t_meta_test.go +++ b/node/scalar/t_meta_test.go @@ -21,12 +21,20 @@ var nodes = []node.Node{ } func TestMeta(t *testing.T) { - expected := []meta.Meta{ - meta.NewComment("//comment\n", nil), - meta.NewWhiteSpace(" ", nil), + expected := &meta.Collection{ + &meta.Data{ + Value: "//comment\n", + Type: meta.CommentType, + Position: nil, + }, + &meta.Data{ + Value: " ", + Type: meta.WhiteSpaceType, + Position: nil, + }, } for _, n := range nodes { - n.AddMeta(expected) + n.GetMeta().Push(*expected...) actual := n.GetMeta() assertEqual(t, expected, actual) } diff --git a/node/stmt/n_alt_else.go b/node/stmt/n_alt_else.go index d3534e7..e9afe4a 100644 --- a/node/stmt/n_alt_else.go +++ b/node/stmt/n_alt_else.go @@ -9,7 +9,7 @@ import ( // AltElse node type AltElse struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Stmt node.Node } @@ -31,12 +31,8 @@ func (n *AltElse) GetPosition() *position.Position { return n.Position } -func (n *AltElse) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *AltElse) GetMeta() []meta.Meta { - return n.Meta +func (n *AltElse) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_alt_else_if.go b/node/stmt/n_alt_else_if.go index e42f4c3..b5b262f 100644 --- a/node/stmt/n_alt_else_if.go +++ b/node/stmt/n_alt_else_if.go @@ -9,7 +9,7 @@ import ( // AltElseIf node type AltElseIf struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Cond node.Node Stmt node.Node @@ -33,12 +33,8 @@ func (n *AltElseIf) GetPosition() *position.Position { return n.Position } -func (n *AltElseIf) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *AltElseIf) GetMeta() []meta.Meta { - return n.Meta +func (n *AltElseIf) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_alt_for.go b/node/stmt/n_alt_for.go index df75b75..55e7468 100644 --- a/node/stmt/n_alt_for.go +++ b/node/stmt/n_alt_for.go @@ -9,7 +9,7 @@ import ( // AltFor node type AltFor struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Init []node.Node Cond []node.Node @@ -37,12 +37,8 @@ func (n *AltFor) GetPosition() *position.Position { return n.Position } -func (n *AltFor) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *AltFor) GetMeta() []meta.Meta { - return n.Meta +func (n *AltFor) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_alt_foreach.go b/node/stmt/n_alt_foreach.go index d953524..fcc5193 100644 --- a/node/stmt/n_alt_foreach.go +++ b/node/stmt/n_alt_foreach.go @@ -9,7 +9,7 @@ import ( // AltForeach node type AltForeach struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Expr node.Node Key node.Node @@ -37,12 +37,8 @@ func (n *AltForeach) GetPosition() *position.Position { return n.Position } -func (n *AltForeach) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *AltForeach) GetMeta() []meta.Meta { - return n.Meta +func (n *AltForeach) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_alt_if.go b/node/stmt/n_alt_if.go index 928bc1b..4bc17f5 100644 --- a/node/stmt/n_alt_if.go +++ b/node/stmt/n_alt_if.go @@ -9,7 +9,7 @@ import ( // AltIf node type AltIf struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Cond node.Node Stmt node.Node @@ -37,12 +37,8 @@ func (n *AltIf) GetPosition() *position.Position { return n.Position } -func (n *AltIf) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *AltIf) GetMeta() []meta.Meta { - return n.Meta +func (n *AltIf) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_alt_switch.go b/node/stmt/n_alt_switch.go index 7156324..028f522 100644 --- a/node/stmt/n_alt_switch.go +++ b/node/stmt/n_alt_switch.go @@ -9,7 +9,7 @@ import ( // AltSwitch node type AltSwitch struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Cond node.Node CaseList *CaseList @@ -33,12 +33,8 @@ func (n *AltSwitch) GetPosition() *position.Position { return n.Position } -func (n *AltSwitch) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *AltSwitch) GetMeta() []meta.Meta { - return n.Meta +func (n *AltSwitch) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_alt_while.go b/node/stmt/n_alt_while.go index 563477c..1727fd9 100644 --- a/node/stmt/n_alt_while.go +++ b/node/stmt/n_alt_while.go @@ -9,7 +9,7 @@ import ( // AltWhile node type AltWhile struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Cond node.Node Stmt node.Node @@ -33,12 +33,8 @@ func (n *AltWhile) GetPosition() *position.Position { return n.Position } -func (n *AltWhile) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *AltWhile) GetMeta() []meta.Meta { - return n.Meta +func (n *AltWhile) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_break.go b/node/stmt/n_break.go index ef0edb0..b2937c5 100644 --- a/node/stmt/n_break.go +++ b/node/stmt/n_break.go @@ -9,7 +9,7 @@ import ( // Break node type Break struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Expr node.Node } @@ -31,12 +31,8 @@ func (n *Break) GetPosition() *position.Position { return n.Position } -func (n *Break) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *Break) GetMeta() []meta.Meta { - return n.Meta +func (n *Break) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_case.go b/node/stmt/n_case.go index 4e811fe..9c186a0 100644 --- a/node/stmt/n_case.go +++ b/node/stmt/n_case.go @@ -9,7 +9,7 @@ import ( // Case node type Case struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Cond node.Node Stmts []node.Node @@ -33,12 +33,8 @@ func (n *Case) GetPosition() *position.Position { return n.Position } -func (n *Case) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *Case) GetMeta() []meta.Meta { - return n.Meta +func (n *Case) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_case_list.go b/node/stmt/n_case_list.go index 11a4db3..7b86545 100644 --- a/node/stmt/n_case_list.go +++ b/node/stmt/n_case_list.go @@ -9,7 +9,7 @@ import ( // CaseList node type CaseList struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Cases []node.Node } @@ -31,12 +31,8 @@ func (n *CaseList) GetPosition() *position.Position { return n.Position } -func (n *CaseList) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *CaseList) GetMeta() []meta.Meta { - return n.Meta +func (n *CaseList) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_catch.go b/node/stmt/n_catch.go index 124660b..6e57e07 100644 --- a/node/stmt/n_catch.go +++ b/node/stmt/n_catch.go @@ -9,7 +9,7 @@ import ( // Catch node type Catch struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Types []node.Node Variable node.Node @@ -35,12 +35,8 @@ func (n *Catch) GetPosition() *position.Position { return n.Position } -func (n *Catch) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *Catch) GetMeta() []meta.Meta { - return n.Meta +func (n *Catch) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_class.go b/node/stmt/n_class.go index c47225b..0d3be18 100644 --- a/node/stmt/n_class.go +++ b/node/stmt/n_class.go @@ -9,7 +9,7 @@ import ( // Class node type Class struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position PhpDocComment string ClassName node.Node @@ -43,12 +43,8 @@ func (n *Class) GetPosition() *position.Position { return n.Position } -func (n *Class) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *Class) GetMeta() []meta.Meta { - return n.Meta +func (n *Class) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_class_const_list.go b/node/stmt/n_class_const_list.go index 5370239..13215dc 100644 --- a/node/stmt/n_class_const_list.go +++ b/node/stmt/n_class_const_list.go @@ -9,7 +9,7 @@ import ( // ClassConstList node type ClassConstList struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Modifiers []node.Node Consts []node.Node @@ -33,12 +33,8 @@ func (n *ClassConstList) GetPosition() *position.Position { return n.Position } -func (n *ClassConstList) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *ClassConstList) GetMeta() []meta.Meta { - return n.Meta +func (n *ClassConstList) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_class_extends.go b/node/stmt/n_class_extends.go index 5400b21..58400fd 100644 --- a/node/stmt/n_class_extends.go +++ b/node/stmt/n_class_extends.go @@ -9,7 +9,7 @@ import ( // ClassExtends node type ClassExtends struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position ClassName node.Node } @@ -31,12 +31,8 @@ func (n *ClassExtends) GetPosition() *position.Position { return n.Position } -func (n *ClassExtends) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *ClassExtends) GetMeta() []meta.Meta { - return n.Meta +func (n *ClassExtends) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_class_implements.go b/node/stmt/n_class_implements.go index e47a83f..0251cf0 100644 --- a/node/stmt/n_class_implements.go +++ b/node/stmt/n_class_implements.go @@ -9,7 +9,7 @@ import ( // ClassImplements node type ClassImplements struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position InterfaceNames []node.Node } @@ -31,12 +31,8 @@ func (n *ClassImplements) GetPosition() *position.Position { return n.Position } -func (n *ClassImplements) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *ClassImplements) GetMeta() []meta.Meta { - return n.Meta +func (n *ClassImplements) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_class_method.go b/node/stmt/n_class_method.go index 7d849f0..10c25d9 100644 --- a/node/stmt/n_class_method.go +++ b/node/stmt/n_class_method.go @@ -9,7 +9,7 @@ import ( // ClassMethod node type ClassMethod struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position ReturnsRef bool PhpDocComment string @@ -43,12 +43,8 @@ func (n *ClassMethod) GetPosition() *position.Position { return n.Position } -func (n *ClassMethod) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *ClassMethod) GetMeta() []meta.Meta { - return n.Meta +func (n *ClassMethod) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_const_list.go b/node/stmt/n_const_list.go index 3a284fe..69282bd 100644 --- a/node/stmt/n_const_list.go +++ b/node/stmt/n_const_list.go @@ -9,7 +9,7 @@ import ( // ConstList node type ConstList struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Consts []node.Node } @@ -31,12 +31,8 @@ func (n *ConstList) GetPosition() *position.Position { return n.Position } -func (n *ConstList) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *ConstList) GetMeta() []meta.Meta { - return n.Meta +func (n *ConstList) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_constant.go b/node/stmt/n_constant.go index c544cdc..aa4f49a 100644 --- a/node/stmt/n_constant.go +++ b/node/stmt/n_constant.go @@ -9,7 +9,7 @@ import ( // Constant node type Constant struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position PhpDocComment string ConstantName node.Node @@ -35,12 +35,8 @@ func (n *Constant) GetPosition() *position.Position { return n.Position } -func (n *Constant) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *Constant) GetMeta() []meta.Meta { - return n.Meta +func (n *Constant) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_continue.go b/node/stmt/n_continue.go index a155b0f..3db197f 100644 --- a/node/stmt/n_continue.go +++ b/node/stmt/n_continue.go @@ -9,7 +9,7 @@ import ( // Continue node type Continue struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Expr node.Node } @@ -31,12 +31,8 @@ func (n *Continue) GetPosition() *position.Position { return n.Position } -func (n *Continue) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *Continue) GetMeta() []meta.Meta { - return n.Meta +func (n *Continue) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_declare.go b/node/stmt/n_declare.go index e5a5805..a07a84d 100644 --- a/node/stmt/n_declare.go +++ b/node/stmt/n_declare.go @@ -9,17 +9,19 @@ import ( // Declare node type Declare struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Consts []node.Node Stmt node.Node + Alt bool } // NewDeclare node constructor -func NewDeclare(Consts []node.Node, Stmt node.Node) *Declare { +func NewDeclare(Consts []node.Node, Stmt node.Node, alt bool) *Declare { return &Declare{ Consts: Consts, Stmt: Stmt, + Alt: alt, } } @@ -33,12 +35,8 @@ func (n *Declare) GetPosition() *position.Position { return n.Position } -func (n *Declare) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *Declare) GetMeta() []meta.Meta { - return n.Meta +func (n *Declare) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_default.go b/node/stmt/n_default.go index 7197b44..8348b29 100644 --- a/node/stmt/n_default.go +++ b/node/stmt/n_default.go @@ -9,7 +9,7 @@ import ( // Default node type Default struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Stmts []node.Node } @@ -31,12 +31,8 @@ func (n *Default) GetPosition() *position.Position { return n.Position } -func (n *Default) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *Default) GetMeta() []meta.Meta { - return n.Meta +func (n *Default) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_do.go b/node/stmt/n_do.go index ebcd3d9..9a946ee 100644 --- a/node/stmt/n_do.go +++ b/node/stmt/n_do.go @@ -9,7 +9,7 @@ import ( // Do node type Do struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Stmt node.Node Cond node.Node @@ -33,12 +33,8 @@ func (n *Do) GetPosition() *position.Position { return n.Position } -func (n *Do) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *Do) GetMeta() []meta.Meta { - return n.Meta +func (n *Do) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_echo.go b/node/stmt/n_echo.go index 5770cdc..89bdb26 100644 --- a/node/stmt/n_echo.go +++ b/node/stmt/n_echo.go @@ -9,7 +9,7 @@ import ( // Echo node type Echo struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Exprs []node.Node } @@ -31,12 +31,8 @@ func (n *Echo) GetPosition() *position.Position { return n.Position } -func (n *Echo) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *Echo) GetMeta() []meta.Meta { - return n.Meta +func (n *Echo) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_else.go b/node/stmt/n_else.go index 209caa0..b8135b2 100644 --- a/node/stmt/n_else.go +++ b/node/stmt/n_else.go @@ -9,7 +9,7 @@ import ( // Else node type Else struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Stmt node.Node } @@ -31,12 +31,8 @@ func (n *Else) GetPosition() *position.Position { return n.Position } -func (n *Else) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *Else) GetMeta() []meta.Meta { - return n.Meta +func (n *Else) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_else_if.go b/node/stmt/n_else_if.go index 504a800..9dc3533 100644 --- a/node/stmt/n_else_if.go +++ b/node/stmt/n_else_if.go @@ -9,7 +9,7 @@ import ( // ElseIf node type ElseIf struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Cond node.Node Stmt node.Node @@ -33,12 +33,8 @@ func (n *ElseIf) GetPosition() *position.Position { return n.Position } -func (n *ElseIf) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *ElseIf) GetMeta() []meta.Meta { - return n.Meta +func (n *ElseIf) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_expression.go b/node/stmt/n_expression.go index 189f8f0..caf05ad 100644 --- a/node/stmt/n_expression.go +++ b/node/stmt/n_expression.go @@ -9,7 +9,7 @@ import ( // Expression node type Expression struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Expr node.Node } @@ -31,12 +31,8 @@ func (n *Expression) GetPosition() *position.Position { return n.Position } -func (n *Expression) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *Expression) GetMeta() []meta.Meta { - return n.Meta +func (n *Expression) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_finally.go b/node/stmt/n_finally.go index a5e2803..49a7892 100644 --- a/node/stmt/n_finally.go +++ b/node/stmt/n_finally.go @@ -9,7 +9,7 @@ import ( // Finally node type Finally struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Stmts []node.Node } @@ -31,12 +31,8 @@ func (n *Finally) GetPosition() *position.Position { return n.Position } -func (n *Finally) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *Finally) GetMeta() []meta.Meta { - return n.Meta +func (n *Finally) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_for.go b/node/stmt/n_for.go index e9c04d9..c3d9b6a 100644 --- a/node/stmt/n_for.go +++ b/node/stmt/n_for.go @@ -9,7 +9,7 @@ import ( // For node type For struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Init []node.Node Cond []node.Node @@ -37,12 +37,8 @@ func (n *For) GetPosition() *position.Position { return n.Position } -func (n *For) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *For) GetMeta() []meta.Meta { - return n.Meta +func (n *For) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_foreach.go b/node/stmt/n_foreach.go index 243618b..1065add 100644 --- a/node/stmt/n_foreach.go +++ b/node/stmt/n_foreach.go @@ -9,7 +9,7 @@ import ( // Foreach node type Foreach struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Expr node.Node Key node.Node @@ -37,12 +37,8 @@ func (n *Foreach) GetPosition() *position.Position { return n.Position } -func (n *Foreach) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *Foreach) GetMeta() []meta.Meta { - return n.Meta +func (n *Foreach) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_function.go b/node/stmt/n_function.go index 8138a37..3babf8f 100644 --- a/node/stmt/n_function.go +++ b/node/stmt/n_function.go @@ -9,7 +9,7 @@ import ( // Function node type Function struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position ReturnsRef bool PhpDocComment string @@ -41,12 +41,8 @@ func (n *Function) GetPosition() *position.Position { return n.Position } -func (n *Function) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *Function) GetMeta() []meta.Meta { - return n.Meta +func (n *Function) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_global.go b/node/stmt/n_global.go index 61e23a2..2b298a9 100644 --- a/node/stmt/n_global.go +++ b/node/stmt/n_global.go @@ -9,7 +9,7 @@ import ( // Global node type Global struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Vars []node.Node } @@ -31,12 +31,8 @@ func (n *Global) GetPosition() *position.Position { return n.Position } -func (n *Global) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *Global) GetMeta() []meta.Meta { - return n.Meta +func (n *Global) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_goto.go b/node/stmt/n_goto.go index b5531ec..4cd6ba2 100644 --- a/node/stmt/n_goto.go +++ b/node/stmt/n_goto.go @@ -9,7 +9,7 @@ import ( // Goto node type Goto struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Label node.Node } @@ -31,12 +31,8 @@ func (n *Goto) GetPosition() *position.Position { return n.Position } -func (n *Goto) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *Goto) GetMeta() []meta.Meta { - return n.Meta +func (n *Goto) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_group_use.go b/node/stmt/n_group_use.go index ad857de..565535a 100644 --- a/node/stmt/n_group_use.go +++ b/node/stmt/n_group_use.go @@ -9,7 +9,7 @@ import ( // GroupUse node type GroupUse struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position UseType node.Node Prefix node.Node @@ -35,12 +35,8 @@ func (n *GroupUse) GetPosition() *position.Position { return n.Position } -func (n *GroupUse) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *GroupUse) GetMeta() []meta.Meta { - return n.Meta +func (n *GroupUse) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_halt_compiler.go b/node/stmt/n_halt_compiler.go index 4e13216..001b977 100644 --- a/node/stmt/n_halt_compiler.go +++ b/node/stmt/n_halt_compiler.go @@ -8,7 +8,7 @@ import ( // HaltCompiler node type HaltCompiler struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position } @@ -27,12 +27,8 @@ func (n *HaltCompiler) GetPosition() *position.Position { return n.Position } -func (n *HaltCompiler) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *HaltCompiler) GetMeta() []meta.Meta { - return n.Meta +func (n *HaltCompiler) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_if.go b/node/stmt/n_if.go index b88f4db..67a2e38 100644 --- a/node/stmt/n_if.go +++ b/node/stmt/n_if.go @@ -9,7 +9,7 @@ import ( // If node type If struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Cond node.Node Stmt node.Node @@ -37,12 +37,8 @@ func (n *If) GetPosition() *position.Position { return n.Position } -func (n *If) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *If) GetMeta() []meta.Meta { - return n.Meta +func (n *If) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_inline_html.go b/node/stmt/n_inline_html.go index 0e0d073..3c7fd50 100644 --- a/node/stmt/n_inline_html.go +++ b/node/stmt/n_inline_html.go @@ -8,7 +8,7 @@ import ( // InlineHtml node type InlineHtml struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Value string } @@ -30,12 +30,8 @@ func (n *InlineHtml) GetPosition() *position.Position { return n.Position } -func (n *InlineHtml) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *InlineHtml) GetMeta() []meta.Meta { - return n.Meta +func (n *InlineHtml) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_interface.go b/node/stmt/n_interface.go index 4d69753..5064126 100644 --- a/node/stmt/n_interface.go +++ b/node/stmt/n_interface.go @@ -9,7 +9,7 @@ import ( // Interface node type Interface struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position PhpDocComment string InterfaceName node.Node @@ -37,12 +37,8 @@ func (n *Interface) GetPosition() *position.Position { return n.Position } -func (n *Interface) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *Interface) GetMeta() []meta.Meta { - return n.Meta +func (n *Interface) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_interface_extends.go b/node/stmt/n_interface_extends.go index 1e6950f..849c832 100644 --- a/node/stmt/n_interface_extends.go +++ b/node/stmt/n_interface_extends.go @@ -9,7 +9,7 @@ import ( // InterfaceExtends node type InterfaceExtends struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position InterfaceNames []node.Node } @@ -31,12 +31,8 @@ func (n *InterfaceExtends) GetPosition() *position.Position { return n.Position } -func (n *InterfaceExtends) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *InterfaceExtends) GetMeta() []meta.Meta { - return n.Meta +func (n *InterfaceExtends) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_label.go b/node/stmt/n_label.go index 06d850a..1b27d5d 100644 --- a/node/stmt/n_label.go +++ b/node/stmt/n_label.go @@ -9,7 +9,7 @@ import ( // Label node type Label struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position LabelName node.Node } @@ -31,12 +31,8 @@ func (n *Label) GetPosition() *position.Position { return n.Position } -func (n *Label) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *Label) GetMeta() []meta.Meta { - return n.Meta +func (n *Label) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_namespace.go b/node/stmt/n_namespace.go index 8680b0c..3d60882 100644 --- a/node/stmt/n_namespace.go +++ b/node/stmt/n_namespace.go @@ -9,7 +9,7 @@ import ( // Namespace node type Namespace struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position NamespaceName node.Node Stmts []node.Node @@ -33,12 +33,8 @@ func (n *Namespace) GetPosition() *position.Position { return n.Position } -func (n *Namespace) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *Namespace) GetMeta() []meta.Meta { - return n.Meta +func (n *Namespace) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_nop.go b/node/stmt/n_nop.go index 1b1282c..1f73a7e 100644 --- a/node/stmt/n_nop.go +++ b/node/stmt/n_nop.go @@ -8,7 +8,7 @@ import ( // Nop node type Nop struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position } @@ -27,12 +27,8 @@ func (n *Nop) GetPosition() *position.Position { return n.Position } -func (n *Nop) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *Nop) GetMeta() []meta.Meta { - return n.Meta +func (n *Nop) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_property.go b/node/stmt/n_property.go index 0e8d595..1af560d 100644 --- a/node/stmt/n_property.go +++ b/node/stmt/n_property.go @@ -9,7 +9,7 @@ import ( // Property node type Property struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position PhpDocComment string Variable node.Node @@ -35,12 +35,8 @@ func (n *Property) GetPosition() *position.Position { return n.Position } -func (n *Property) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *Property) GetMeta() []meta.Meta { - return n.Meta +func (n *Property) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_property_list.go b/node/stmt/n_property_list.go index 0819af5..06b04cf 100644 --- a/node/stmt/n_property_list.go +++ b/node/stmt/n_property_list.go @@ -9,7 +9,7 @@ import ( // PropertyList node type PropertyList struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Modifiers []node.Node Properties []node.Node @@ -33,12 +33,8 @@ func (n *PropertyList) GetPosition() *position.Position { return n.Position } -func (n *PropertyList) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *PropertyList) GetMeta() []meta.Meta { - return n.Meta +func (n *PropertyList) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_return.go b/node/stmt/n_return.go index 8a6fea2..b2781c3 100644 --- a/node/stmt/n_return.go +++ b/node/stmt/n_return.go @@ -9,7 +9,7 @@ import ( // Return node type Return struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Expr node.Node } @@ -31,12 +31,8 @@ func (n *Return) GetPosition() *position.Position { return n.Position } -func (n *Return) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *Return) GetMeta() []meta.Meta { - return n.Meta +func (n *Return) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_static.go b/node/stmt/n_static.go index f4486af..532aab0 100644 --- a/node/stmt/n_static.go +++ b/node/stmt/n_static.go @@ -9,7 +9,7 @@ import ( // Static node type Static struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Vars []node.Node } @@ -31,12 +31,8 @@ func (n *Static) GetPosition() *position.Position { return n.Position } -func (n *Static) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *Static) GetMeta() []meta.Meta { - return n.Meta +func (n *Static) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_static_var.go b/node/stmt/n_static_var.go index 8b25dbd..0e38d7a 100644 --- a/node/stmt/n_static_var.go +++ b/node/stmt/n_static_var.go @@ -9,7 +9,7 @@ import ( // StaticVar node type StaticVar struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Variable node.Node Expr node.Node @@ -33,12 +33,8 @@ func (n *StaticVar) GetPosition() *position.Position { return n.Position } -func (n *StaticVar) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *StaticVar) GetMeta() []meta.Meta { - return n.Meta +func (n *StaticVar) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_stmt_list.go b/node/stmt/n_stmt_list.go index 929765c..31f8371 100644 --- a/node/stmt/n_stmt_list.go +++ b/node/stmt/n_stmt_list.go @@ -9,7 +9,7 @@ import ( // StmtList node type StmtList struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Stmts []node.Node } @@ -31,12 +31,8 @@ func (n *StmtList) GetPosition() *position.Position { return n.Position } -func (n *StmtList) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *StmtList) GetMeta() []meta.Meta { - return n.Meta +func (n *StmtList) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_switch.go b/node/stmt/n_switch.go index 7db1b82..ce58b16 100644 --- a/node/stmt/n_switch.go +++ b/node/stmt/n_switch.go @@ -9,7 +9,7 @@ import ( // Switch node type Switch struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Cond node.Node CaseList *CaseList @@ -33,12 +33,8 @@ func (n *Switch) GetPosition() *position.Position { return n.Position } -func (n *Switch) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *Switch) GetMeta() []meta.Meta { - return n.Meta +func (n *Switch) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_throw.go b/node/stmt/n_throw.go index bc80c84..747fff0 100644 --- a/node/stmt/n_throw.go +++ b/node/stmt/n_throw.go @@ -9,7 +9,7 @@ import ( // Throw node type Throw struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Expr node.Node } @@ -31,12 +31,8 @@ func (n *Throw) GetPosition() *position.Position { return n.Position } -func (n *Throw) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *Throw) GetMeta() []meta.Meta { - return n.Meta +func (n *Throw) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_trait.go b/node/stmt/n_trait.go index 9b54109..b9c621a 100644 --- a/node/stmt/n_trait.go +++ b/node/stmt/n_trait.go @@ -9,7 +9,7 @@ import ( // Trait node type Trait struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position PhpDocComment string TraitName node.Node @@ -35,12 +35,8 @@ func (n *Trait) GetPosition() *position.Position { return n.Position } -func (n *Trait) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *Trait) GetMeta() []meta.Meta { - return n.Meta +func (n *Trait) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_trait_adaptation_list.go b/node/stmt/n_trait_adaptation_list.go index 0624c72..95db99a 100644 --- a/node/stmt/n_trait_adaptation_list.go +++ b/node/stmt/n_trait_adaptation_list.go @@ -9,7 +9,7 @@ import ( // TraitAdaptationList node type TraitAdaptationList struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Adaptations []node.Node } @@ -31,12 +31,8 @@ func (n *TraitAdaptationList) GetPosition() *position.Position { return n.Position } -func (n *TraitAdaptationList) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *TraitAdaptationList) GetMeta() []meta.Meta { - return n.Meta +func (n *TraitAdaptationList) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_trait_method_ref.go b/node/stmt/n_trait_method_ref.go index 7f90bbb..cb31e95 100644 --- a/node/stmt/n_trait_method_ref.go +++ b/node/stmt/n_trait_method_ref.go @@ -9,7 +9,7 @@ import ( // TraitMethodRef node type TraitMethodRef struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Trait node.Node Method node.Node @@ -33,12 +33,8 @@ func (n *TraitMethodRef) GetPosition() *position.Position { return n.Position } -func (n *TraitMethodRef) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *TraitMethodRef) GetMeta() []meta.Meta { - return n.Meta +func (n *TraitMethodRef) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_trait_use.go b/node/stmt/n_trait_use.go index b8c454f..7ae9775 100644 --- a/node/stmt/n_trait_use.go +++ b/node/stmt/n_trait_use.go @@ -9,7 +9,7 @@ import ( // TraitUse node type TraitUse struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Traits []node.Node TraitAdaptationList node.Node @@ -33,12 +33,8 @@ func (n *TraitUse) GetPosition() *position.Position { return n.Position } -func (n *TraitUse) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *TraitUse) GetMeta() []meta.Meta { - return n.Meta +func (n *TraitUse) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_trait_use_alias.go b/node/stmt/n_trait_use_alias.go index 0b23a20..cbe2dd3 100644 --- a/node/stmt/n_trait_use_alias.go +++ b/node/stmt/n_trait_use_alias.go @@ -9,7 +9,7 @@ import ( // TraitUseAlias node type TraitUseAlias struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Ref node.Node Modifier node.Node @@ -35,12 +35,8 @@ func (n *TraitUseAlias) GetPosition() *position.Position { return n.Position } -func (n *TraitUseAlias) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *TraitUseAlias) GetMeta() []meta.Meta { - return n.Meta +func (n *TraitUseAlias) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_trait_use_precedence.go b/node/stmt/n_trait_use_precedence.go index c6ae475..ff6e244 100644 --- a/node/stmt/n_trait_use_precedence.go +++ b/node/stmt/n_trait_use_precedence.go @@ -9,7 +9,7 @@ import ( // TraitUsePrecedence node type TraitUsePrecedence struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Ref node.Node Insteadof []node.Node @@ -33,12 +33,8 @@ func (n *TraitUsePrecedence) GetPosition() *position.Position { return n.Position } -func (n *TraitUsePrecedence) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *TraitUsePrecedence) GetMeta() []meta.Meta { - return n.Meta +func (n *TraitUsePrecedence) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_try.go b/node/stmt/n_try.go index 6a93cb3..8755892 100644 --- a/node/stmt/n_try.go +++ b/node/stmt/n_try.go @@ -9,7 +9,7 @@ import ( // Try node type Try struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Stmts []node.Node Catches []node.Node @@ -35,12 +35,8 @@ func (n *Try) GetPosition() *position.Position { return n.Position } -func (n *Try) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *Try) GetMeta() []meta.Meta { - return n.Meta +func (n *Try) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_unset.go b/node/stmt/n_unset.go index d787066..7704dab 100644 --- a/node/stmt/n_unset.go +++ b/node/stmt/n_unset.go @@ -9,7 +9,7 @@ import ( // Unset node type Unset struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Vars []node.Node } @@ -31,12 +31,8 @@ func (n *Unset) GetPosition() *position.Position { return n.Position } -func (n *Unset) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *Unset) GetMeta() []meta.Meta { - return n.Meta +func (n *Unset) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_use.go b/node/stmt/n_use.go index e5fb6f3..62d9b8e 100644 --- a/node/stmt/n_use.go +++ b/node/stmt/n_use.go @@ -9,7 +9,7 @@ import ( // Use node type Use struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position UseType node.Node Use node.Node @@ -35,12 +35,8 @@ func (n *Use) GetPosition() *position.Position { return n.Position } -func (n *Use) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *Use) GetMeta() []meta.Meta { - return n.Meta +func (n *Use) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_use_list.go b/node/stmt/n_use_list.go index 09ef434..989173a 100644 --- a/node/stmt/n_use_list.go +++ b/node/stmt/n_use_list.go @@ -9,7 +9,7 @@ import ( // UseList node type UseList struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position UseType node.Node Uses []node.Node @@ -33,12 +33,8 @@ func (n *UseList) GetPosition() *position.Position { return n.Position } -func (n *UseList) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *UseList) GetMeta() []meta.Meta { - return n.Meta +func (n *UseList) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/n_while.go b/node/stmt/n_while.go index 897425b..00702b8 100644 --- a/node/stmt/n_while.go +++ b/node/stmt/n_while.go @@ -9,7 +9,7 @@ import ( // While node type While struct { - Meta []meta.Meta + Meta meta.Collection Position *position.Position Cond node.Node Stmt node.Node @@ -33,12 +33,8 @@ func (n *While) GetPosition() *position.Position { return n.Position } -func (n *While) AddMeta(m []meta.Meta) { - n.Meta = append(n.Meta, m...) -} - -func (n *While) GetMeta() []meta.Meta { - return n.Meta +func (n *While) GetMeta() *meta.Collection { + return &n.Meta } // Attributes returns node attributes as map diff --git a/node/stmt/t_alt_if_test.go b/node/stmt/t_alt_if_test.go index 03ffff3..d70bd0c 100644 --- a/node/stmt/t_alt_if_test.go +++ b/node/stmt/t_alt_if_test.go @@ -5,6 +5,8 @@ import ( "reflect" "testing" + "github.com/davecgh/go-spew/spew" + "github.com/z7zmey/php-parser/node/expr" "github.com/z7zmey/php-parser/position" @@ -23,6 +25,7 @@ func assertEqual(t *testing.T, expected interface{}, actual interface{}) { t.Errorf("diff: (-expected +actual)\n%s", diff) } else { t.Errorf("expected and actual are not equal\nexpectd: %+v\nactual: %+v\n", expected, actual) + t.Log(spew.Sdump(expected, actual)) } } diff --git a/node/stmt/t_declare_test.go b/node/stmt/t_declare_test.go index a4348f5..4266b69 100644 --- a/node/stmt/t_declare_test.go +++ b/node/stmt/t_declare_test.go @@ -230,13 +230,14 @@ func TestAltDeclare(t *testing.T) { }, Stmt: &stmt.StmtList{ Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 20, - EndPos: 32, + StartLine: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, }, Stmts: []node.Node{}, }, + Alt: true, }, }, } diff --git a/node/stmt/t_meta_test.go b/node/stmt/t_meta_test.go index 6c0562d..a0b1bbc 100644 --- a/node/stmt/t_meta_test.go +++ b/node/stmt/t_meta_test.go @@ -74,12 +74,20 @@ var nodes = []node.Node{ } func TestMeta(t *testing.T) { - expected := []meta.Meta{ - meta.NewComment("//comment\n", nil), - meta.NewWhiteSpace(" ", nil), + expected := &meta.Collection{ + &meta.Data{ + Value: "//comment\n", + Type: meta.CommentType, + Position: nil, + }, + &meta.Data{ + Value: " ", + Type: meta.WhiteSpaceType, + Position: nil, + }, } for _, n := range nodes { - n.AddMeta(expected) + n.GetMeta().Push(*expected...) actual := n.GetMeta() assertEqual(t, expected, actual) } diff --git a/node/t_meta_test.go b/node/t_meta_test.go index 819693f..56e73eb 100644 --- a/node/t_meta_test.go +++ b/node/t_meta_test.go @@ -18,12 +18,20 @@ var nodes = []node.Node{ } func TestMeta(t *testing.T) { - expected := []meta.Meta{ - meta.NewComment("//comment\n", nil), - meta.NewWhiteSpace(" ", nil), + expected := &meta.Collection{ + &meta.Data{ + Value: "//comment\n", + Type: meta.CommentType, + Position: nil, + }, + &meta.Data{ + Value: " ", + Type: meta.WhiteSpaceType, + Position: nil, + }, } for _, n := range nodes { - n.AddMeta(expected) + n.GetMeta().Push(*expected...) actual := n.GetMeta() assertEqual(t, expected, actual) } diff --git a/php5/parser.go b/php5/parser.go index ee887f8..16596c2 100644 --- a/php5/parser.go +++ b/php5/parser.go @@ -65,7 +65,7 @@ func (l *Parser) Parse() int { return yyParse(l) } -func (l *Parser) listGetFirstNodeMeta(list []node.Node) []meta.Meta { +func (l *Parser) listGetFirstNodeMeta(list []node.Node) *meta.Collection { if len(list) == 0 { return nil } @@ -107,12 +107,34 @@ func isDollar(r rune) bool { return r == '$' } -func addMeta(n node.Node, mm []meta.Meta, tn meta.TokenName) { - for _, m := range mm { - m.SetTokenName(tn) +func (l *Parser) appendMetaToken(n node.Node, t *scanner.Token, tn meta.TokenName) { + if !l.Lexer.WithMeta { + return } - n.AddMeta(mm) + m := &meta.Data{ + Value: t.Value, + Type: meta.TokenType, + Position: l.positionBuilder.NewTokenPosition(t), + TokenName: tn, + } + + n.GetMeta().Push(m) +} + +func (l *Parser) prependMetaToken(n node.Node, t *scanner.Token, tn meta.TokenName) { + if !l.Lexer.WithMeta { + return + } + + m := &meta.Data{ + Value: t.Value, + Type: meta.TokenType, + Position: l.positionBuilder.NewTokenPosition(t), + TokenName: tn, + } + + n.GetMeta().Unshift(m) } func (p *Parser) returnTokenToPool(yyDollar []yySymType, yyVAL *yySymType) { diff --git a/php5/php5.go b/php5/php5.go index ec7b0b3..eae36b4 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -346,7 +346,7 @@ const yyEofCode = 1 const yyErrCode = 2 const yyInitialStackSize = 16 -//line php5/php5.y:6803 +//line php5/php5.y:6965 type simpleIndirectReference struct { all []*expr.Variable last *expr.Variable @@ -2333,7 +2333,7 @@ yydefault: yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) if yylex.(*Parser).currentToken.Value == "\xff" { - addMeta(yylex.(*Parser).rootNode, yylex.(*Parser).currentToken.Meta, meta.NodeEnd) + yylex.(*Parser).currentToken.Meta.SetTokenName(meta.NodeEnd).AppendTo(yylex.(*Parser).rootNode.GetMeta()) } } case 2: @@ -2365,7 +2365,7 @@ yydefault: namePart.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(namePart, yyDollar[1].token.Meta, meta.StringToken) + yyDollar[1].token.Meta.SetTokenName(meta.StringToken).AppendTo(namePart.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2380,8 +2380,8 @@ yydefault: namePart.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) // save comments - addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.NsSeparatorToken) - addMeta(namePart, yyDollar[3].token.Meta, meta.StringToken) + yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.StringToken).AppendTo(namePart.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2428,10 +2428,11 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.HaltCompilerToken) - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenParenthesisToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.CloseParenthesisToken) - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.SemiColonToken) + yyDollar[1].token.Meta.SetTokenName(meta.HaltCompilerToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -2439,7 +2440,7 @@ yydefault: } case 11: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:384 + //line php5/php5.y:385 { name := name.NewName(yyDollar[2].list) yyVAL.node = stmt.NewNamespace(name, nil) @@ -2449,14 +2450,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.NamespaceToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.SemiColonToken) + yyDollar[1].token.Meta.SetTokenName(meta.NamespaceToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 12: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:399 + //line php5/php5.y:401 { name := name.NewName(yyDollar[2].list) yyVAL.node = stmt.NewNamespace(name, yyDollar[4].list) @@ -2466,15 +2468,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[5].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.NamespaceToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.OpenCurlyBracesToken) - addMeta(yyVAL.node, yyDollar[5].token.Meta, meta.CloseCurlyBracesToken) + yyDollar[1].token.Meta.SetTokenName(meta.NamespaceToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[5].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 13: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:415 + //line php5/php5.y:417 { yyVAL.node = stmt.NewNamespace(nil, yyDollar[3].list) @@ -2482,15 +2484,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.NamespaceToken) - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenCurlyBracesToken) - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseCurlyBracesToken) + yyDollar[1].token.Meta.SetTokenName(meta.NamespaceToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 14: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:429 + //line php5/php5.y:431 { yyVAL.node = stmt.NewUseList(nil, yyDollar[2].list) @@ -2498,14 +2500,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.UseToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.SemiColonToken) + yyDollar[1].token.Meta.SetTokenName(meta.UseToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 15: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:442 + //line php5/php5.y:445 { useType := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewUseList(useType, yyDollar[3].list) @@ -2515,15 +2518,16 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.UseToken) - addMeta(useType, yyDollar[2].token.Meta, meta.IdentifierToken) - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.SemiColonToken) + yyDollar[1].token.Meta.SetTokenName(meta.UseToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(useType.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 16: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:458 + //line php5/php5.y:462 { useType := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewUseList(useType, yyDollar[3].list) @@ -2533,15 +2537,16 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.UseToken) - addMeta(useType, yyDollar[2].token.Meta, meta.IdentifierToken) - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.SemiColonToken) + yyDollar[1].token.Meta.SetTokenName(meta.UseToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(useType.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 17: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:474 + //line php5/php5.y:479 { yyVAL.node = yyDollar[1].node @@ -2549,24 +2554,25 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.SemiColonToken) + yyDollar[2].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 18: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:489 + //line php5/php5.y:495 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.NodeEnd) + yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 19: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:498 + //line php5/php5.y:504 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -2574,7 +2580,7 @@ yydefault: } case 20: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:507 + //line php5/php5.y:513 { name := name.NewName(yyDollar[1].list) yyVAL.node = stmt.NewUse(nil, name, nil) @@ -2587,7 +2593,7 @@ yydefault: } case 21: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:518 + //line php5/php5.y:524 { name := name.NewName(yyDollar[1].list) alias := node.NewIdentifier(yyDollar[3].token.Value) @@ -2599,14 +2605,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition(yyDollar[1].list, yyDollar[3].token)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.AsToken) - addMeta(alias, yyDollar[3].token.Meta, meta.IdentifierToken) + yyDollar[2].token.Meta.SetTokenName(meta.AsToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(alias.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 22: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:535 + //line php5/php5.y:541 { name := name.NewName(yyDollar[2].list) yyVAL.node = stmt.NewUse(nil, name, nil) @@ -2616,13 +2622,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.NsSeparatorToken) + yyDollar[1].token.Meta.SetTokenName(meta.UseLeadingNsSeparatorToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.UseLeadingNsSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 23: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:549 + //line php5/php5.y:556 { name := name.NewName(yyDollar[2].list) alias := node.NewIdentifier(yyDollar[4].token.Value) @@ -2634,26 +2641,27 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition(yyDollar[2].list, yyDollar[4].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.NsSeparatorToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.AsToken) - addMeta(alias, yyDollar[4].token.Meta, meta.IdentifierToken) + yyDollar[1].token.Meta.SetTokenName(meta.UseLeadingNsSeparatorToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.UseLeadingNsSeparatorToken) + yyDollar[3].token.Meta.SetTokenName(meta.AsToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(alias.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 24: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:570 + //line php5/php5.y:578 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.NodeEnd) + yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 25: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:579 + //line php5/php5.y:587 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -2661,7 +2669,7 @@ yydefault: } case 26: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:588 + //line php5/php5.y:596 { name := name.NewName(yyDollar[1].list) yyVAL.node = stmt.NewUse(nil, name, nil) @@ -2674,7 +2682,7 @@ yydefault: } case 27: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:599 + //line php5/php5.y:607 { name := name.NewName(yyDollar[1].list) alias := node.NewIdentifier(yyDollar[3].token.Value) @@ -2686,14 +2694,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition(yyDollar[1].list, yyDollar[3].token)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.AsToken) - addMeta(alias, yyDollar[3].token.Meta, meta.IdentifierToken) + yyDollar[2].token.Meta.SetTokenName(meta.AsToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(alias.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 28: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:616 + //line php5/php5.y:624 { name := name.NewName(yyDollar[2].list) yyVAL.node = stmt.NewUse(nil, name, nil) @@ -2703,13 +2711,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.NsSeparatorToken) + yyDollar[1].token.Meta.SetTokenName(meta.UseLeadingNsSeparatorToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.UseLeadingNsSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 29: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:630 + //line php5/php5.y:639 { name := name.NewName(yyDollar[2].list) alias := node.NewIdentifier(yyDollar[4].token.Value) @@ -2721,26 +2730,27 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition(yyDollar[2].list, yyDollar[4].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.NsSeparatorToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.AsToken) - addMeta(alias, yyDollar[4].token.Meta, meta.IdentifierToken) + yyDollar[1].token.Meta.SetTokenName(meta.UseLeadingNsSeparatorToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.UseLeadingNsSeparatorToken) + yyDollar[3].token.Meta.SetTokenName(meta.AsToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(alias.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 30: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:651 + //line php5/php5.y:661 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.NodeEnd) + yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 31: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:660 + //line php5/php5.y:670 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -2748,7 +2758,7 @@ yydefault: } case 32: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:669 + //line php5/php5.y:679 { name := name.NewName(yyDollar[1].list) yyVAL.node = stmt.NewUse(nil, name, nil) @@ -2761,7 +2771,7 @@ yydefault: } case 33: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:680 + //line php5/php5.y:690 { name := name.NewName(yyDollar[1].list) alias := node.NewIdentifier(yyDollar[3].token.Value) @@ -2773,14 +2783,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition(yyDollar[1].list, yyDollar[3].token)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.AsToken) - addMeta(alias, yyDollar[3].token.Meta, meta.IdentifierToken) + yyDollar[2].token.Meta.SetTokenName(meta.AsToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(alias.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 34: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:697 + //line php5/php5.y:707 { name := name.NewName(yyDollar[2].list) yyVAL.node = stmt.NewUse(nil, name, nil) @@ -2790,13 +2800,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.NsSeparatorToken) + yyDollar[1].token.Meta.SetTokenName(meta.UseLeadingNsSeparatorToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.UseLeadingNsSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 35: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:711 + //line php5/php5.y:722 { name := name.NewName(yyDollar[2].list) alias := node.NewIdentifier(yyDollar[4].token.Value) @@ -2808,19 +2819,21 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition(yyDollar[2].list, yyDollar[4].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.NsSeparatorToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.AsToken) - addMeta(alias, yyDollar[4].token.Meta, meta.IdentifierToken) + yyDollar[1].token.Meta.SetTokenName(meta.UseLeadingNsSeparatorToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.UseLeadingNsSeparatorToken) + yyDollar[3].token.Meta.SetTokenName(meta.AsToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(alias.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 36: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:732 + //line php5/php5.y:744 { name := node.NewIdentifier(yyDollar[3].token.Value) constant := stmt.NewConstant(name, yyDollar[5].node, "") constList := yyDollar[1].node.(*stmt.ConstList) + lastConst := lastNode(constList.Consts) constList.Consts = append(constList.Consts, constant) yyVAL.node = yyDollar[1].node @@ -2830,15 +2843,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeNodeListPosition(yyDollar[1].node, constList.Consts)) // save comments - addMeta(lastNode(constList.Consts), yyDollar[2].token.Meta, meta.CommaToken) - addMeta(name, yyDollar[3].token.Meta, meta.IdentifierToken) - addMeta(constant, yyDollar[4].token.Meta, meta.EqualToken) + yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastConst.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.EqualToken).AppendTo(constant.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 37: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:752 + //line php5/php5.y:765 { name := node.NewIdentifier(yyDollar[2].token.Value) constant := stmt.NewConstant(name, yyDollar[4].node, "") @@ -2851,15 +2864,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, constList)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ConstToken) - addMeta(name, yyDollar[2].token.Meta, meta.IdentifierToken) - addMeta(constant, yyDollar[3].token.Meta, meta.EqualToken) + yyDollar[1].token.Meta.SetTokenName(meta.ConstToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.EqualToken).AppendTo(constant.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 38: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:774 + //line php5/php5.y:787 { if yyDollar[2].node != nil { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -2869,7 +2882,7 @@ yydefault: } case 39: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:782 + //line php5/php5.y:795 { yyVAL.list = []node.Node{} @@ -2877,7 +2890,7 @@ yydefault: } case 40: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:792 + //line php5/php5.y:805 { // error yyVAL.node = nil @@ -2886,7 +2899,7 @@ yydefault: } case 41: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:799 + //line php5/php5.y:812 { yyVAL.node = yyDollar[1].node @@ -2894,7 +2907,7 @@ yydefault: } case 42: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:805 + //line php5/php5.y:818 { yyVAL.node = yyDollar[1].node @@ -2902,7 +2915,7 @@ yydefault: } case 43: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:811 + //line php5/php5.y:824 { yyVAL.node = yyDollar[1].node @@ -2910,7 +2923,7 @@ yydefault: } case 44: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:817 + //line php5/php5.y:830 { yyVAL.node = stmt.NewHaltCompiler() @@ -2918,16 +2931,17 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.HaltCompilerToken) - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenParenthesisToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.CloseParenthesisToken) - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.SemiColonToken) + yyDollar[1].token.Meta.SetTokenName(meta.HaltCompilerToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 45: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:836 + //line php5/php5.y:850 { yyVAL.node = yyDollar[1].node @@ -2935,7 +2949,7 @@ yydefault: } case 46: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:842 + //line php5/php5.y:856 { label := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewLabel(label) @@ -2945,14 +2959,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - addMeta(label, yyDollar[1].token.Meta, meta.IdentifierToken) - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.ColonToken) + yyDollar[1].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(label.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.ColonToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 47: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:860 + //line php5/php5.y:874 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) @@ -2960,14 +2974,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.OpenCurlyBracesToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.CloseCurlyBracesToken) + yyDollar[1].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 48: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:873 + //line php5/php5.y:887 { yyVAL.node = stmt.NewIf(yyDollar[2].node, yyDollar[3].node, yyDollar[4].list, yyDollar[5].node) @@ -2981,13 +2995,15 @@ yydefault: } // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.IfToken) + yyDollar[1].token.Meta.SetTokenName(meta.IfToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[2].node.GetMeta().Cut(meta.TokenNameFilter(meta.OpenParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo(yyVAL.node.GetMeta()) + yyDollar[2].node.GetMeta().Cut(meta.TokenNameFilter(meta.CloseParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 49: yyDollar = yyS[yypt-8 : yypt+1] - //line php5/php5.y:891 + //line php5/php5.y:907 { stmts := stmt.NewStmtList(yyDollar[4].list) yyVAL.node = stmt.NewAltIf(yyDollar[2].node, stmts, yyDollar[5].list, yyDollar[6].node) @@ -2997,16 +3013,19 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[8].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.IfToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.ColonToken) - addMeta(yyVAL.node, yyDollar[7].token.Meta, meta.EndifToken) - addMeta(yyVAL.node, yyDollar[8].token.Meta, meta.SemiColonToken) + yyDollar[1].token.Meta.SetTokenName(meta.IfToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[2].node.GetMeta().Cut(meta.TokenNameFilter(meta.OpenParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo(yyVAL.node.GetMeta()) + yyDollar[2].node.GetMeta().Cut(meta.TokenNameFilter(meta.CloseParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.ColonToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[7].token.Meta.SetTokenName(meta.EndifToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[8].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[8].token, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 50: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:908 + //line php5/php5.y:927 { switch n := yyDollar[3].node.(type) { case *stmt.While: @@ -3021,13 +3040,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.WhileToken) + yyDollar[1].token.Meta.SetTokenName(meta.WhileToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[2].node.GetMeta().Cut(meta.TokenNameFilter(meta.OpenParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo(yyVAL.node.GetMeta()) + yyDollar[2].node.GetMeta().Cut(meta.TokenNameFilter(meta.CloseParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 51: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:927 + //line php5/php5.y:948 { yyVAL.node = stmt.NewDo(yyDollar[2].node, yyDollar[4].node) @@ -3035,15 +3056,18 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[5].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.DoToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.WhileToken) - addMeta(yyVAL.node, yyDollar[5].token.Meta, meta.SemiColonToken) + yyDollar[1].token.Meta.SetTokenName(meta.DoToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.WhileToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[4].node.GetMeta().Cut(meta.TokenNameFilter(meta.OpenParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo(yyVAL.node.GetMeta()) + yyDollar[4].node.GetMeta().Cut(meta.TokenNameFilter(meta.CloseParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo(yyVAL.node.GetMeta()) + yyDollar[5].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[5].token, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 52: yyDollar = yyS[yypt-9 : yypt+1] - //line php5/php5.y:941 + //line php5/php5.y:965 { switch n := yyDollar[9].node.(type) { case *stmt.For: @@ -3062,17 +3086,17 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[9].node)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ForToken) - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenParenthesisToken) - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.ForInitSemicolonToken) - addMeta(yyVAL.node, yyDollar[6].token.Meta, meta.ForCondSemicolonToken) - addMeta(yyVAL.node, yyDollar[8].token.Meta, meta.CloseParenthesisToken) + yyDollar[1].token.Meta.SetTokenName(meta.ForToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.ForInitSemicolonToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[6].token.Meta.SetTokenName(meta.ForCondSemicolonToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[8].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 53: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:968 + //line php5/php5.y:992 { switch n := yyDollar[3].node.(type) { case *stmt.Switch: @@ -3089,13 +3113,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.SwitchToken) + yyDollar[1].token.Meta.SetTokenName(meta.SwitchToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[2].node.GetMeta().Cut(meta.TokenNameFilter(meta.OpenParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo(yyVAL.node.GetMeta()) + yyDollar[2].node.GetMeta().Cut(meta.TokenNameFilter(meta.CloseParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 54: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:989 + //line php5/php5.y:1015 { yyVAL.node = stmt.NewBreak(nil) @@ -3103,14 +3129,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.BreakToken) - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.SemiColonToken) + yyDollar[1].token.Meta.SetTokenName(meta.BreakToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 55: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1002 + //line php5/php5.y:1029 { yyVAL.node = stmt.NewBreak(yyDollar[2].node) @@ -3118,14 +3145,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.BreakToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.SemiColonToken) + yyDollar[1].token.Meta.SetTokenName(meta.BreakToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 56: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1015 + //line php5/php5.y:1043 { yyVAL.node = stmt.NewContinue(nil) @@ -3133,14 +3161,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ContinueToken) - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.SemiColonToken) + yyDollar[1].token.Meta.SetTokenName(meta.ContinueToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 57: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1028 + //line php5/php5.y:1057 { yyVAL.node = stmt.NewContinue(yyDollar[2].node) @@ -3148,14 +3177,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ContinueToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.SemiColonToken) + yyDollar[1].token.Meta.SetTokenName(meta.ContinueToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 58: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1041 + //line php5/php5.y:1071 { yyVAL.node = stmt.NewReturn(nil) @@ -3163,14 +3193,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ReturnToken) - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.SemiColonToken) + yyDollar[1].token.Meta.SetTokenName(meta.ReturnToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 59: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1054 + //line php5/php5.y:1085 { yyVAL.node = stmt.NewReturn(yyDollar[2].node) @@ -3178,14 +3209,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ReturnToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.SemiColonToken) + yyDollar[1].token.Meta.SetTokenName(meta.ReturnToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 60: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1067 + //line php5/php5.y:1099 { yyVAL.node = stmt.NewReturn(yyDollar[2].node) @@ -3193,14 +3225,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ReturnToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.SemiColonToken) + yyDollar[1].token.Meta.SetTokenName(meta.ReturnToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 61: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1080 + //line php5/php5.y:1113 { yyVAL.node = stmt.NewExpression(yyDollar[1].node) @@ -3208,13 +3241,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.SemiColonToken) + yyDollar[2].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 62: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1092 + //line php5/php5.y:1126 { yyVAL.node = stmt.NewGlobal(yyDollar[2].list) @@ -3222,14 +3256,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.GlobalToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.SemiColonToken) + yyDollar[1].token.Meta.SetTokenName(meta.GlobalToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 63: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1105 + //line php5/php5.y:1140 { yyVAL.node = stmt.NewStatic(yyDollar[2].list) @@ -3237,14 +3272,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.StaticToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.SemiColonToken) + yyDollar[1].token.Meta.SetTokenName(meta.StaticToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 64: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1118 + //line php5/php5.y:1154 { yyVAL.node = stmt.NewEcho(yyDollar[2].list) @@ -3252,14 +3288,16 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.EchoToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.SemiColonToken) + yyDollar[1].token.Meta.SetTokenName(meta.EchoToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.EchoToken) + yyDollar[3].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 65: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1131 + //line php5/php5.y:1169 { yyVAL.node = stmt.NewInlineHtml(yyDollar[1].token.Value) @@ -3267,13 +3305,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.InlineHTMLToken) + yyDollar[1].token.Meta.SetTokenName(meta.InlineHTMLToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 66: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1143 + //line php5/php5.y:1181 { yyVAL.node = stmt.NewExpression(yyDollar[1].node) @@ -3281,13 +3319,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.SemiColonToken) + yyDollar[2].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 67: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1155 + //line php5/php5.y:1194 { yyVAL.node = stmt.NewUnset(yyDollar[3].list) @@ -3295,16 +3334,17 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[5].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.UnsetToken) - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenParenthesisToken) - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseParenthesisToken) - addMeta(yyVAL.node, yyDollar[5].token.Meta, meta.SemiColonToken) + yyDollar[1].token.Meta.SetTokenName(meta.UnsetToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[5].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[5].token, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 68: yyDollar = yyS[yypt-8 : yypt+1] - //line php5/php5.y:1170 + //line php5/php5.y:1210 { if yyDollar[6].node == nil { switch n := yyDollar[8].node.(type) { @@ -3334,16 +3374,19 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[8].node)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ForeachToken) - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenParenthesisToken) - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.AsToken) - addMeta(yyVAL.node, yyDollar[7].token.Meta, meta.CloseParenthesisToken) + yyDollar[1].token.Meta.SetTokenName(meta.ForeachToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.AsToken).AppendTo(yyVAL.node.GetMeta()) + if yyDollar[6].node != nil { + yyDollar[6].node.GetMeta().Cut(meta.TokenNameFilter(meta.DoubleArrowToken)).AppendTo(yyVAL.node.GetMeta()) + } + yyDollar[7].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 69: yyDollar = yyS[yypt-8 : yypt+1] - //line php5/php5.y:1207 + //line php5/php5.y:1250 { if yyDollar[6].node == nil { switch n := yyDollar[8].node.(type) { @@ -3373,32 +3416,36 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[8].node)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ForeachToken) - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenParenthesisToken) - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.AsToken) - addMeta(yyVAL.node, yyDollar[7].token.Meta, meta.CloseParenthesisToken) + yyDollar[1].token.Meta.SetTokenName(meta.ForeachToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.AsToken).AppendTo(yyVAL.node.GetMeta()) + if yyDollar[6].node != nil { + yyDollar[6].node.GetMeta().Cut(meta.TokenNameFilter(meta.DoubleArrowToken)).AppendTo(yyVAL.node.GetMeta()) + } + yyDollar[7].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 70: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1244 + //line php5/php5.y:1290 { - yyVAL.node = stmt.NewDeclare(yyDollar[3].list, yyDollar[5].node) + yyVAL.node = yyDollar[5].node + yyVAL.node.(*stmt.Declare).Consts = yyDollar[3].list // save position yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[5].node)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.DeclareToken) - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenParenthesisToken) - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseParenthesisToken) + yyDollar[1].token.Meta.SetTokenName(meta.DeclareToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 71: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1258 + //line php5/php5.y:1305 { yyVAL.node = stmt.NewNop() @@ -3406,13 +3453,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.SemiColonToken) + yyDollar[1].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 72: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:1270 + //line php5/php5.y:1318 { yyVAL.node = stmt.NewTry(yyDollar[3].list, yyDollar[5].list, yyDollar[6].node) @@ -3424,15 +3472,15 @@ yydefault: } // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.TryToken) - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenCurlyBracesToken) - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseCurlyBracesToken) + yyDollar[1].token.Meta.SetTokenName(meta.TryToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 73: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1288 + //line php5/php5.y:1336 { yyVAL.node = stmt.NewThrow(yyDollar[2].node) @@ -3440,14 +3488,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ThrowToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.SemiColonToken) + yyDollar[1].token.Meta.SetTokenName(meta.ThrowToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 74: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1301 + //line php5/php5.y:1350 { label := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewGoto(label) @@ -3457,15 +3506,16 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.GotoToken) - addMeta(label, yyDollar[2].token.Meta, meta.IdentifierToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.SemiColonToken) + yyDollar[1].token.Meta.SetTokenName(meta.GotoToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(label.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 75: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1320 + //line php5/php5.y:1370 { yyVAL.list = []node.Node{} @@ -3473,7 +3523,7 @@ yydefault: } case 76: yyDollar = yyS[yypt-9 : yypt+1] - //line php5/php5.y:1326 + //line php5/php5.y:1376 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[4].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -3486,18 +3536,18 @@ yydefault: catch.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[8].token)) // save comments - addMeta(catch, yyDollar[1].token.Meta, meta.CatchToken) - addMeta(catch, yyDollar[2].token.Meta, meta.OpenParenthesisToken) - addMeta(variable, yyDollar[4].token.Meta, meta.VariableToken) - addMeta(catch, yyDollar[5].token.Meta, meta.CloseParenthesisToken) - addMeta(catch, yyDollar[6].token.Meta, meta.OpenCurlyBracesToken) - addMeta(catch, yyDollar[8].token.Meta, meta.CloseCurlyBracesToken) + yyDollar[1].token.Meta.SetTokenName(meta.CatchToken).AppendTo(catch.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(catch.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) + yyDollar[5].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(catch.GetMeta()) + yyDollar[6].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(catch.GetMeta()) + yyDollar[8].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(catch.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 77: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1351 + //line php5/php5.y:1401 { yyVAL.node = nil @@ -3505,7 +3555,7 @@ yydefault: } case 78: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1357 + //line php5/php5.y:1407 { yyVAL.node = stmt.NewFinally(yyDollar[3].list) @@ -3513,15 +3563,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.FinallyToken) - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenCurlyBracesToken) - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseCurlyBracesToken) + yyDollar[1].token.Meta.SetTokenName(meta.FinallyToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 79: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1374 + //line php5/php5.y:1424 { yyVAL.list = yyDollar[1].list @@ -3529,7 +3579,7 @@ yydefault: } case 80: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1380 + //line php5/php5.y:1430 { yyVAL.list = []node.Node{} @@ -3537,7 +3587,7 @@ yydefault: } case 81: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1389 + //line php5/php5.y:1439 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -3545,7 +3595,7 @@ yydefault: } case 82: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1395 + //line php5/php5.y:1445 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -3553,7 +3603,7 @@ yydefault: } case 83: yyDollar = yyS[yypt-8 : yypt+1] - //line php5/php5.y:1404 + //line php5/php5.y:1454 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[4].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -3565,18 +3615,18 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[8].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.CatchToken) - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenParenthesisToken) - addMeta(variable, yyDollar[4].token.Meta, meta.VariableToken) - addMeta(yyVAL.node, yyDollar[5].token.Meta, meta.CloseParenthesisToken) - addMeta(yyVAL.node, yyDollar[6].token.Meta, meta.OpenCurlyBracesToken) - addMeta(yyVAL.node, yyDollar[8].token.Meta, meta.CloseCurlyBracesToken) + yyDollar[1].token.Meta.SetTokenName(meta.CatchToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) + yyDollar[5].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[6].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[8].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 84: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1428 + //line php5/php5.y:1478 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -3584,18 +3634,18 @@ yydefault: } case 85: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1434 + //line php5/php5.y:1484 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.NodeEnd) + yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 86: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1446 + //line php5/php5.y:1496 { yyVAL.node = yyDollar[1].node @@ -3603,7 +3653,7 @@ yydefault: } case 87: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1455 + //line php5/php5.y:1505 { yyVAL.node = yyDollar[1].node @@ -3611,7 +3661,7 @@ yydefault: } case 88: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1464 + //line php5/php5.y:1514 { yyVAL.node = yyDollar[1].node @@ -3619,31 +3669,31 @@ yydefault: } case 89: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1473 + //line php5/php5.y:1523 { yyVAL.token = nil } case 90: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1477 + //line php5/php5.y:1527 { yyVAL.token = yyDollar[1].token } case 91: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1484 + //line php5/php5.y:1534 { yyVAL.token = nil } case 92: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1488 + //line php5/php5.y:1538 { yyVAL.token = yyDollar[1].token } case 93: yyDollar = yyS[yypt-9 : yypt+1] - //line php5/php5.y:1495 + //line php5/php5.y:1545 { name := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewFunction(name, yyDollar[2].token != nil, yyDollar[5].list, nil, yyDollar[8].list, "") @@ -3653,21 +3703,21 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[9].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.FunctionToken) + yyDollar[1].token.Meta.SetTokenName(meta.FunctionToken).AppendTo(yyVAL.node.GetMeta()) if yyDollar[2].token != nil { - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.AmpersandToken) + yyDollar[2].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(yyVAL.node.GetMeta()) } - addMeta(name, yyDollar[3].token.Meta, meta.IdentifierToken) - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.OpenParenthesisToken) - addMeta(yyVAL.node, yyDollar[6].token.Meta, meta.CloseParenthesisToken) - addMeta(yyVAL.node, yyDollar[7].token.Meta, meta.OpenCurlyBracesToken) - addMeta(yyVAL.node, yyDollar[9].token.Meta, meta.CloseCurlyBracesToken) + yyDollar[3].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[6].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[7].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[9].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 94: yyDollar = yyS[yypt-7 : yypt+1] - //line php5/php5.y:1520 + //line php5/php5.y:1570 { name := node.NewIdentifier(yyDollar[2].token.Value) switch n := yyDollar[1].node.(type) { @@ -3689,15 +3739,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[7].token)) // save comments - addMeta(name, yyDollar[2].token.Meta, meta.IdentifierToken) - addMeta(yyVAL.node, yyDollar[5].token.Meta, meta.OpenCurlyBracesToken) - addMeta(yyVAL.node, yyDollar[7].token.Meta, meta.CloseCurlyBracesToken) + yyDollar[2].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + yyDollar[5].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[7].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 95: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:1548 + //line php5/php5.y:1598 { name := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewInterface(name, yyDollar[3].InterfaceExtends, yyDollar[5].list, "") @@ -3707,15 +3757,16 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[6].token)) // save comments - addMeta(name, yyDollar[2].token.Meta, meta.IdentifierToken) - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.OpenCurlyBracesToken) - addMeta(yyVAL.node, yyDollar[6].token.Meta, meta.CloseCurlyBracesToken) + yyDollar[1].token.Meta.SetTokenName(meta.InterfaceToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[6].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 96: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1568 + //line php5/php5.y:1619 { yyVAL.node = stmt.NewClass(nil, nil, nil, nil, nil, nil, "") @@ -3723,13 +3774,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ClassToken) + yyDollar[1].token.Meta.SetTokenName(meta.ClassToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 97: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1580 + //line php5/php5.y:1631 { classModifier := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewClass(nil, []node.Node{classModifier}, nil, nil, nil, nil, "") @@ -3739,14 +3790,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - addMeta(classModifier, yyDollar[1].token.Meta, meta.IdentifierToken) - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.ClassToken) + yyDollar[1].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(classModifier.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.ClassToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 98: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1595 + //line php5/php5.y:1646 { yyVAL.node = stmt.NewTrait(nil, nil, "") @@ -3754,13 +3805,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.TraitToken) + yyDollar[1].token.Meta.SetTokenName(meta.TraitToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 99: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1607 + //line php5/php5.y:1658 { classModifier := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewClass(nil, []node.Node{classModifier}, nil, nil, nil, nil, "") @@ -3770,14 +3821,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - addMeta(classModifier, yyDollar[1].token.Meta, meta.IdentifierToken) - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.ClassToken) + yyDollar[1].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(classModifier.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.ClassToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 100: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1625 + //line php5/php5.y:1676 { yyVAL.ClassExtends = nil @@ -3785,7 +3836,7 @@ yydefault: } case 101: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1631 + //line php5/php5.y:1682 { yyVAL.ClassExtends = stmt.NewClassExtends(yyDollar[2].node) @@ -3793,19 +3844,19 @@ yydefault: yyVAL.ClassExtends.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - addMeta(yyVAL.ClassExtends, yyDollar[1].token.Meta, meta.ExtendsToken) + yyDollar[1].token.Meta.SetTokenName(meta.ExtendsToken).AppendTo(yyVAL.ClassExtends.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 102: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1646 + //line php5/php5.y:1697 { yyVAL.token = yyDollar[1].token } case 103: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1653 + //line php5/php5.y:1704 { yyVAL.InterfaceExtends = nil @@ -3813,7 +3864,7 @@ yydefault: } case 104: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1659 + //line php5/php5.y:1710 { yyVAL.InterfaceExtends = stmt.NewInterfaceExtends(yyDollar[2].list) @@ -3821,13 +3872,13 @@ yydefault: yyVAL.InterfaceExtends.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) // save comments - addMeta(yyVAL.InterfaceExtends, yyDollar[1].token.Meta, meta.ExtendsToken) + yyDollar[1].token.Meta.SetTokenName(meta.ExtendsToken).AppendTo(yyVAL.InterfaceExtends.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 105: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1674 + //line php5/php5.y:1725 { yyVAL.ClassImplements = nil @@ -3835,7 +3886,7 @@ yydefault: } case 106: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1680 + //line php5/php5.y:1731 { yyVAL.ClassImplements = stmt.NewClassImplements(yyDollar[2].list) @@ -3843,13 +3894,13 @@ yydefault: yyVAL.ClassImplements.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) // save comments - addMeta(yyVAL.ClassImplements, yyDollar[1].token.Meta, meta.ImplementsToken) + yyDollar[1].token.Meta.SetTokenName(meta.ImplementsToken).AppendTo(yyVAL.ClassImplements.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 107: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1695 + //line php5/php5.y:1746 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -3857,18 +3908,18 @@ yydefault: } case 108: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1701 + //line php5/php5.y:1752 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.NodeEnd) + yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 109: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1713 + //line php5/php5.y:1764 { yyVAL.node = nil @@ -3876,18 +3927,18 @@ yydefault: } case 110: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1719 + //line php5/php5.y:1770 { yyVAL.node = yyDollar[2].node // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.DoubleArrowToken) + yyDollar[1].token.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 111: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1731 + //line php5/php5.y:1782 { yyVAL.node = yyDollar[1].node @@ -3895,7 +3946,7 @@ yydefault: } case 112: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1737 + //line php5/php5.y:1788 { yyVAL.node = expr.NewReference(yyDollar[2].node) @@ -3903,13 +3954,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.AmpersandToken) + yyDollar[1].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 113: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1749 + //line php5/php5.y:1800 { yyVAL.node = expr.NewList(yyDollar[3].list) @@ -3917,15 +3968,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ListToken) - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenParenthesisToken) - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseParenthesisToken) + yyDollar[1].token.Meta.SetTokenName(meta.ListToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 114: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1766 + //line php5/php5.y:1817 { yyVAL.node = stmt.NewFor(nil, nil, nil, yyDollar[1].node) @@ -3936,7 +3987,7 @@ yydefault: } case 115: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1775 + //line php5/php5.y:1826 { stmtList := stmt.NewStmtList(yyDollar[2].list) yyVAL.node = stmt.NewAltFor(nil, nil, nil, stmtList) @@ -3946,15 +3997,16 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ColonToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.EndforToken) - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.SemiColonToken) + yyDollar[1].token.Meta.SetTokenName(meta.ColonToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.EndforToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 116: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1794 + //line php5/php5.y:1846 { yyVAL.node = stmt.NewForeach(nil, nil, nil, yyDollar[1].node) @@ -3965,7 +4017,7 @@ yydefault: } case 117: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1803 + //line php5/php5.y:1855 { stmtList := stmt.NewStmtList(yyDollar[2].list) yyVAL.node = stmt.NewAltForeach(nil, nil, nil, stmtList) @@ -3975,39 +4027,46 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ColonToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.EndforeachToken) - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.SemiColonToken) + yyDollar[1].token.Meta.SetTokenName(meta.ColonToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.EndforeachToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 118: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1823 + //line php5/php5.y:1876 { - yyVAL.node = yyDollar[1].node + yyVAL.node = stmt.NewDeclare(nil, yyDollar[1].node, false) + + // save position + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 119: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1829 + //line php5/php5.y:1885 { - yyVAL.node = stmt.NewStmtList(yyDollar[2].list) + stmtList := stmt.NewStmtList(yyDollar[2].list) + yyVAL.node = stmt.NewDeclare(nil, stmtList, true) // save position + stmtList.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ColonToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.EnddeclareToken) - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.SemiColonToken) + yyDollar[1].token.Meta.SetTokenName(meta.ColonToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.EnddeclareToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 120: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1847 + //line php5/php5.y:1906 { name := node.NewIdentifier(yyDollar[1].token.Value) constant := stmt.NewConstant(name, yyDollar[3].node, "") @@ -4018,14 +4077,14 @@ yydefault: constant.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) // save comments - addMeta(name, yyDollar[1].token.Meta, meta.IdentifierToken) - addMeta(constant, yyDollar[2].token.Meta, meta.EqualToken) + yyDollar[1].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.EqualToken).AppendTo(constant.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 121: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1863 + //line php5/php5.y:1922 { name := node.NewIdentifier(yyDollar[3].token.Value) constant := stmt.NewConstant(name, yyDollar[5].node, "") @@ -4036,15 +4095,15 @@ yydefault: constant.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[3].token, yyDollar[5].node)) // save comments - addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) - addMeta(name, yyDollar[3].token.Meta, meta.IdentifierToken) - addMeta(constant, yyDollar[4].token.Meta, meta.EqualToken) + yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.EqualToken).AppendTo(constant.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 122: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1884 + //line php5/php5.y:1943 { caseList := stmt.NewCaseList(yyDollar[2].list) yyVAL.node = stmt.NewSwitch(nil, caseList) @@ -4054,14 +4113,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - addMeta(caseList, yyDollar[1].token.Meta, meta.OpenCurlyBracesToken) - addMeta(caseList, yyDollar[3].token.Meta, meta.CloseCurlyBracesToken) + yyDollar[1].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(caseList.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(caseList.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 123: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1899 + //line php5/php5.y:1958 { caseList := stmt.NewCaseList(yyDollar[3].list) yyVAL.node = stmt.NewSwitch(nil, caseList) @@ -4071,15 +4130,16 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - addMeta(caseList, yyDollar[1].token.Meta, meta.OpenCurlyBracesToken) - addMeta(caseList, yyDollar[2].token.Meta, meta.SemiColonToken) - addMeta(caseList, yyDollar[4].token.Meta, meta.CloseCurlyBracesToken) + yyDollar[1].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(caseList.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.CaseSeparatorToken).AppendTo(caseList.GetMeta()) + yylex.(*Parser).appendMetaToken(caseList, yyDollar[2].token, meta.CaseSeparatorToken) + yyDollar[4].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(caseList.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 124: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1915 + //line php5/php5.y:1975 { caseList := stmt.NewCaseList(yyDollar[2].list) yyVAL.node = stmt.NewAltSwitch(nil, caseList) @@ -4089,15 +4149,16 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ColonToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.EndswitchToken) - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.SemiColonToken) + yyDollar[1].token.Meta.SetTokenName(meta.ColonToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.EndswitchToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 125: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1931 + //line php5/php5.y:1992 { caseList := stmt.NewCaseList(yyDollar[3].list) @@ -4108,16 +4169,18 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[5].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ColonToken) - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.SwitchSemicolonToken) - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.EndswitchToken) - addMeta(yyVAL.node, yyDollar[5].token.Meta, meta.SemiColonToken) + yyDollar[1].token.Meta.SetTokenName(meta.ColonToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.CaseSeparatorToken).AppendTo(caseList.GetMeta()) + yylex.(*Parser).appendMetaToken(caseList, yyDollar[2].token, meta.CaseSeparatorToken) + yyDollar[4].token.Meta.SetTokenName(meta.EndswitchToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[5].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[5].token, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 126: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1953 + //line php5/php5.y:2016 { yyVAL.list = []node.Node{} @@ -4125,7 +4188,7 @@ yydefault: } case 127: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1959 + //line php5/php5.y:2022 { _case := stmt.NewCase(yyDollar[3].node, yyDollar[5].list) yyVAL.list = append(yyDollar[1].list, _case) @@ -4134,14 +4197,15 @@ yydefault: _case.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[5].list)) // save comments - addMeta(_case, yyDollar[2].token.Meta, meta.CaseToken) - addMeta(_case, yyDollar[4].token.Meta, meta.CaseSeparatorToken) + yyDollar[2].token.Meta.SetTokenName(meta.CaseToken).AppendTo(_case.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.CaseSeparatorToken).AppendTo(_case.GetMeta()) + yylex.(*Parser).appendMetaToken(_case, yyDollar[4].token, meta.CaseSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 128: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1973 + //line php5/php5.y:2037 { _default := stmt.NewDefault(yyDollar[4].list) yyVAL.list = append(yyDollar[1].list, _default) @@ -4150,26 +4214,27 @@ yydefault: _default.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[4].list)) // save comments - addMeta(_default, yyDollar[2].token.Meta, meta.DefaultToken) - addMeta(_default, yyDollar[3].token.Meta, meta.CaseSeparatorToken) + yyDollar[2].token.Meta.SetTokenName(meta.DefaultToken).AppendTo(_default.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.CaseSeparatorToken).AppendTo(_default.GetMeta()) + yylex.(*Parser).appendMetaToken(_default, yyDollar[3].token, meta.CaseSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 129: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1991 + //line php5/php5.y:2056 { yyVAL.token = yyDollar[1].token } case 130: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1995 + //line php5/php5.y:2060 { yyVAL.token = yyDollar[1].token } case 131: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2003 + //line php5/php5.y:2068 { yyVAL.node = stmt.NewWhile(nil, yyDollar[1].node) @@ -4180,7 +4245,7 @@ yydefault: } case 132: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2012 + //line php5/php5.y:2077 { stmtList := stmt.NewStmtList(yyDollar[2].list) yyVAL.node = stmt.NewAltWhile(nil, stmtList) @@ -4190,15 +4255,16 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ColonToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.EndwhileToken) - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.SemiColonToken) + yyDollar[1].token.Meta.SetTokenName(meta.ColonToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.EndwhileToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 133: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2033 + //line php5/php5.y:2099 { yyVAL.list = nil @@ -4206,7 +4272,7 @@ yydefault: } case 134: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2039 + //line php5/php5.y:2105 { _elseIf := stmt.NewElseIf(yyDollar[3].node, yyDollar[4].node) yyVAL.list = append(yyDollar[1].list, _elseIf) @@ -4215,13 +4281,15 @@ yydefault: _elseIf.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[2].token, yyDollar[4].node)) // save comments - addMeta(_elseIf, yyDollar[2].token.Meta, meta.ElseifToken) + yyDollar[2].token.Meta.SetTokenName(meta.ElseifToken).AppendTo(_elseIf.GetMeta()) + yyDollar[3].node.GetMeta().Cut(meta.TokenNameFilter(meta.OpenParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo(_elseIf.GetMeta()) + yyDollar[3].node.GetMeta().Cut(meta.TokenNameFilter(meta.CloseParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo(_elseIf.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 135: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2056 + //line php5/php5.y:2124 { yyVAL.list = nil @@ -4229,7 +4297,7 @@ yydefault: } case 136: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:2062 + //line php5/php5.y:2130 { stmts := stmt.NewStmtList(yyDollar[5].list) _elseIf := stmt.NewAltElseIf(yyDollar[3].node, stmts) @@ -4240,14 +4308,16 @@ yydefault: _elseIf.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[5].list)) // save comments - addMeta(_elseIf, yyDollar[2].token.Meta, meta.ElseifToken) - addMeta(_elseIf, yyDollar[4].token.Meta, meta.ColonToken) + yyDollar[2].token.Meta.SetTokenName(meta.ElseifToken).AppendTo(_elseIf.GetMeta()) + yyDollar[3].node.GetMeta().Cut(meta.TokenNameFilter(meta.OpenParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo(_elseIf.GetMeta()) + yyDollar[3].node.GetMeta().Cut(meta.TokenNameFilter(meta.CloseParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo(_elseIf.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.ColonToken).AppendTo(_elseIf.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 137: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2082 + //line php5/php5.y:2152 { yyVAL.node = nil @@ -4255,7 +4325,7 @@ yydefault: } case 138: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2088 + //line php5/php5.y:2158 { yyVAL.node = stmt.NewElse(yyDollar[2].node) @@ -4263,13 +4333,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ElseToken) + yyDollar[1].token.Meta.SetTokenName(meta.ElseToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 139: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2104 + //line php5/php5.y:2174 { yyVAL.node = nil @@ -4277,7 +4347,7 @@ yydefault: } case 140: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2110 + //line php5/php5.y:2180 { stmts := stmt.NewStmtList(yyDollar[3].list) yyVAL.node = stmt.NewAltElse(stmts) @@ -4287,14 +4357,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ElseToken) - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.ColonToken) + yyDollar[1].token.Meta.SetTokenName(meta.ElseToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.ColonToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 141: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2129 + //line php5/php5.y:2199 { yyVAL.list = yyDollar[1].list @@ -4302,7 +4372,7 @@ yydefault: } case 142: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2135 + //line php5/php5.y:2205 { yyVAL.list = nil @@ -4310,7 +4380,7 @@ yydefault: } case 143: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2144 + //line php5/php5.y:2214 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4318,18 +4388,18 @@ yydefault: } case 144: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2150 + //line php5/php5.y:2220 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.NodeEnd) + yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 145: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2162 + //line php5/php5.y:2232 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[4].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -4350,18 +4420,18 @@ yydefault: // save comments if yyDollar[2].token != nil { - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.AmpersandToken) + yyDollar[2].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(yyVAL.node.GetMeta()) } if yyDollar[3].token != nil { - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.EllipsisToken) + yyDollar[3].token.Meta.SetTokenName(meta.EllipsisToken).AppendTo(yyVAL.node.GetMeta()) } - addMeta(variable, yyDollar[4].token.Meta, meta.VariableToken) + yyDollar[4].token.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 146: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:2192 + //line php5/php5.y:2262 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[4].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -4382,19 +4452,19 @@ yydefault: // save comments if yyDollar[2].token != nil { - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.AmpersandToken) + yyDollar[2].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(yyVAL.node.GetMeta()) } if yyDollar[3].token != nil { - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.EllipsisToken) + yyDollar[3].token.Meta.SetTokenName(meta.EllipsisToken).AppendTo(yyVAL.node.GetMeta()) } - addMeta(variable, yyDollar[4].token.Meta, meta.VariableToken) - addMeta(yyVAL.node, yyDollar[5].token.Meta, meta.EqualToken) + yyDollar[4].token.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) + yyDollar[5].token.Meta.SetTokenName(meta.EqualToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 147: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2227 + //line php5/php5.y:2297 { yyVAL.node = nil @@ -4402,7 +4472,7 @@ yydefault: } case 148: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2233 + //line php5/php5.y:2303 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4410,13 +4480,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.IdentifierToken) + yyDollar[1].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 149: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2245 + //line php5/php5.y:2315 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4424,13 +4494,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.IdentifierToken) + yyDollar[1].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 150: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2257 + //line php5/php5.y:2327 { yyVAL.node = yyDollar[1].node @@ -4438,7 +4508,7 @@ yydefault: } case 151: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2267 + //line php5/php5.y:2337 { yyVAL.node = node.NewArgumentList(nil) @@ -4446,14 +4516,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.OpenParenthesisToken) - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.CloseParenthesisToken) + yyDollar[1].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 152: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2280 + //line php5/php5.y:2350 { yyVAL.node = node.NewArgumentList(yyDollar[2].list) @@ -4461,14 +4531,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.OpenParenthesisToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.CloseParenthesisToken) + yyDollar[1].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 153: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2293 + //line php5/php5.y:2363 { arg := node.NewArgument(yyDollar[2].node, false, false) yyVAL.node = node.NewArgumentList([]node.Node{arg}) @@ -4478,14 +4548,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.OpenParenthesisToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.CloseParenthesisToken) + yyDollar[1].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 154: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2312 + //line php5/php5.y:2382 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4493,18 +4563,18 @@ yydefault: } case 155: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2318 + //line php5/php5.y:2388 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.NodeEnd) + yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 156: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2330 + //line php5/php5.y:2400 { yyVAL.node = node.NewArgument(yyDollar[1].node, false, false) @@ -4515,7 +4585,7 @@ yydefault: } case 157: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2339 + //line php5/php5.y:2409 { yyVAL.node = node.NewArgument(yyDollar[1].node, false, false) @@ -4526,7 +4596,7 @@ yydefault: } case 158: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2348 + //line php5/php5.y:2418 { yyVAL.node = node.NewArgument(yyDollar[2].node, false, true) @@ -4534,13 +4604,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[2].node)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.AmpersandToken) + yyDollar[1].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 159: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2360 + //line php5/php5.y:2430 { yyVAL.node = node.NewArgument(yyDollar[2].node, true, false) @@ -4548,24 +4618,24 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.EllipsisToken) + yyDollar[1].token.Meta.SetTokenName(meta.EllipsisToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 160: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2375 + //line php5/php5.y:2445 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.NodeEnd) + yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 161: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2384 + //line php5/php5.y:2454 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4573,7 +4643,7 @@ yydefault: } case 162: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2394 + //line php5/php5.y:2464 { name := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(name) @@ -4583,13 +4653,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.VariableToken) + yyDollar[1].token.Meta.SetTokenName(meta.VariableToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 163: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2408 + //line php5/php5.y:2478 { yyVAL.node = expr.NewVariable(yyDollar[2].node) @@ -4597,13 +4667,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.DollarToken) + yyDollar[1].token.Meta.SetTokenName(meta.DollarToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 164: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2420 + //line php5/php5.y:2490 { yyVAL.node = expr.NewVariable(yyDollar[3].node) @@ -4611,15 +4681,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.DollarToken) - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenCurlyBracesToken) - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseCurlyBracesToken) + yyDollar[1].token.Meta.SetTokenName(meta.DollarToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 165: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2438 + //line php5/php5.y:2508 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[3].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -4632,14 +4702,14 @@ yydefault: staticVar.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) // save comments - addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) - addMeta(variable, yyDollar[3].token.Meta, meta.VariableToken) + yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 166: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:2456 + //line php5/php5.y:2526 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[3].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -4652,15 +4722,15 @@ yydefault: staticVar.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[3].token, yyDollar[5].node)) // save comments - addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) - addMeta(variable, yyDollar[3].token.Meta, meta.VariableToken) - addMeta(staticVar, yyDollar[4].token.Meta, meta.EqualToken) + yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.EqualToken).AppendTo(staticVar.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 167: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2475 + //line php5/php5.y:2545 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -4673,13 +4743,13 @@ yydefault: staticVar.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(variable, yyDollar[1].token.Meta, meta.VariableToken) + yyDollar[1].token.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 168: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2492 + //line php5/php5.y:2562 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -4692,14 +4762,14 @@ yydefault: staticVar.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) // save comments - addMeta(variable, yyDollar[1].token.Meta, meta.VariableToken) - addMeta(staticVar, yyDollar[2].token.Meta, meta.EqualToken) + yyDollar[1].token.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.EqualToken).AppendTo(staticVar.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 169: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2514 + //line php5/php5.y:2584 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -4707,7 +4777,7 @@ yydefault: } case 170: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2520 + //line php5/php5.y:2590 { yyVAL.list = []node.Node{} @@ -4715,7 +4785,7 @@ yydefault: } case 171: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2530 + //line php5/php5.y:2600 { yyVAL.node = stmt.NewPropertyList(yyDollar[1].list, yyDollar[2].list) @@ -4723,13 +4793,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition(yyDollar[1].list, yyDollar[3].token)) // save comments - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.SemiColonToken) + yyDollar[3].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 172: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2542 + //line php5/php5.y:2613 { yyVAL.node = yyDollar[1].node @@ -4737,13 +4808,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.SemiColonToken) + yyDollar[2].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 173: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2554 + //line php5/php5.y:2626 { yyVAL.node = yyDollar[1].node @@ -4751,7 +4823,7 @@ yydefault: } case 174: yyDollar = yyS[yypt-8 : yypt+1] - //line php5/php5.y:2560 + //line php5/php5.y:2632 { name := node.NewIdentifier(yyDollar[4].token.Value) yyVAL.node = stmt.NewClassMethod(name, yyDollar[1].list, yyDollar[3].token != nil, yyDollar[6].list, nil, yyDollar[8].node, "") @@ -4765,19 +4837,19 @@ yydefault: } // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.FunctionToken) + yyDollar[2].token.Meta.SetTokenName(meta.FunctionToken).AppendTo(yyVAL.node.GetMeta()) if yyDollar[3].token != nil { - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.AmpersandToken) + yyDollar[3].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(yyVAL.node.GetMeta()) } - addMeta(name, yyDollar[4].token.Meta, meta.IdentifierToken) - addMeta(yyVAL.node, yyDollar[5].token.Meta, meta.OpenParenthesisToken) - addMeta(yyVAL.node, yyDollar[7].token.Meta, meta.CloseParenthesisToken) + yyDollar[4].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + yyDollar[5].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[7].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 175: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2587 + //line php5/php5.y:2659 { yyVAL.node = stmt.NewTraitUse(yyDollar[2].list, yyDollar[3].node) @@ -4785,13 +4857,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.UseToken) + yyDollar[1].token.Meta.SetTokenName(meta.UseToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 176: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2602 + //line php5/php5.y:2674 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4799,45 +4871,46 @@ yydefault: } case 177: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2608 + //line php5/php5.y:2680 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.NodeEnd) + yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 178: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2620 + //line php5/php5.y:2692 { yyVAL.node = stmt.NewNop() yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.SemiColonToken) + yyDollar[1].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 179: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2632 + //line php5/php5.y:2705 { yyVAL.node = stmt.NewTraitAdaptationList(yyDollar[2].list) yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.OpenCurlyBracesToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.CloseCurlyBracesToken) + yyDollar[1].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 180: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2647 + //line php5/php5.y:2720 { yyVAL.list = nil @@ -4845,7 +4918,7 @@ yydefault: } case 181: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2653 + //line php5/php5.y:2726 { yyVAL.list = yyDollar[1].list @@ -4853,7 +4926,7 @@ yydefault: } case 182: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2662 + //line php5/php5.y:2735 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4861,7 +4934,7 @@ yydefault: } case 183: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2668 + //line php5/php5.y:2741 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -4869,29 +4942,31 @@ yydefault: } case 184: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2677 + //line php5/php5.y:2750 { yyVAL.node = yyDollar[1].node // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.SemiColonToken) + yyDollar[2].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 185: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2686 + //line php5/php5.y:2760 { yyVAL.node = yyDollar[1].node // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.SemiColonToken) + yyDollar[2].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 186: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2698 + //line php5/php5.y:2773 { yyVAL.node = stmt.NewTraitUsePrecedence(yyDollar[1].node, yyDollar[3].list) @@ -4899,13 +4974,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeNodeListPosition(yyDollar[1].node, yyDollar[3].list)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.InsteadofToken) + yyDollar[2].token.Meta.SetTokenName(meta.InsteadofToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 187: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2713 + //line php5/php5.y:2788 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4913,18 +4988,18 @@ yydefault: } case 188: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2719 + //line php5/php5.y:2794 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.NodeEnd) + yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 189: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2731 + //line php5/php5.y:2806 { name := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewTraitMethodRef(nil, name) @@ -4934,13 +5009,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(name, yyDollar[1].token.Meta, meta.IdentifierToken) + yyDollar[1].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 190: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2745 + //line php5/php5.y:2820 { yyVAL.node = yyDollar[1].node @@ -4948,7 +5023,7 @@ yydefault: } case 191: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2754 + //line php5/php5.y:2829 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewTraitMethodRef(yyDollar[1].node, target) @@ -4958,14 +5033,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.PaamayimNekudotayimToken) - addMeta(target, yyDollar[3].token.Meta, meta.IdentifierToken) + yyDollar[2].token.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(target.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 192: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2772 + //line php5/php5.y:2847 { alias := node.NewIdentifier(yyDollar[4].token.Value) yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, yyDollar[3].node, alias) @@ -4975,14 +5050,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.AsToken) - addMeta(alias, yyDollar[4].token.Meta, meta.IdentifierToken) + yyDollar[2].token.Meta.SetTokenName(meta.AsToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(alias.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 193: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2787 + //line php5/php5.y:2862 { yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, yyDollar[3].node, nil) @@ -4990,13 +5065,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.AsToken) + yyDollar[2].token.Meta.SetTokenName(meta.AsToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 194: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2802 + //line php5/php5.y:2877 { yyVAL.node = nil @@ -5004,7 +5079,7 @@ yydefault: } case 195: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2808 + //line php5/php5.y:2883 { yyVAL.node = yyDollar[1].node @@ -5012,7 +5087,7 @@ yydefault: } case 196: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2817 + //line php5/php5.y:2892 { yyVAL.node = stmt.NewNop() @@ -5020,13 +5095,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.SemiColonToken) + yyDollar[1].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 197: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2829 + //line php5/php5.y:2905 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) @@ -5034,14 +5110,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.OpenCurlyBracesToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.CloseCurlyBracesToken) + yyDollar[1].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 198: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2845 + //line php5/php5.y:2921 { yyVAL.list = yyDollar[1].list @@ -5049,7 +5125,7 @@ yydefault: } case 199: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2851 + //line php5/php5.y:2927 { modifier := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.list = []node.Node{modifier} @@ -5058,13 +5134,13 @@ yydefault: modifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(modifier, yyDollar[1].token.Meta, meta.IdentifierToken) + yyDollar[1].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(modifier.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 200: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2867 + //line php5/php5.y:2943 { yyVAL.list = nil @@ -5072,7 +5148,7 @@ yydefault: } case 201: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2873 + //line php5/php5.y:2949 { yyVAL.list = yyDollar[1].list @@ -5080,7 +5156,7 @@ yydefault: } case 202: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2882 + //line php5/php5.y:2958 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -5088,7 +5164,7 @@ yydefault: } case 203: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2888 + //line php5/php5.y:2964 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -5096,7 +5172,7 @@ yydefault: } case 204: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2897 + //line php5/php5.y:2973 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5104,13 +5180,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.IdentifierToken) + yyDollar[1].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 205: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2909 + //line php5/php5.y:2985 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5118,13 +5194,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.IdentifierToken) + yyDollar[1].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 206: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2921 + //line php5/php5.y:2997 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5132,13 +5208,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.IdentifierToken) + yyDollar[1].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 207: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2933 + //line php5/php5.y:3009 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5146,13 +5222,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.IdentifierToken) + yyDollar[1].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 208: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2945 + //line php5/php5.y:3021 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5160,13 +5236,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.IdentifierToken) + yyDollar[1].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 209: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2957 + //line php5/php5.y:3033 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5174,13 +5250,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.IdentifierToken) + yyDollar[1].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 210: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2972 + //line php5/php5.y:3048 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[3].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -5193,14 +5269,14 @@ yydefault: property.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) // save comments - addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) - addMeta(variable, yyDollar[3].token.Meta, meta.VariableToken) + yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 211: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:2990 + //line php5/php5.y:3066 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[3].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -5213,15 +5289,15 @@ yydefault: property.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[3].token, yyDollar[5].node)) // save comments - addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) - addMeta(variable, yyDollar[3].token.Meta, meta.VariableToken) - addMeta(property, yyDollar[4].token.Meta, meta.EqualToken) + yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.EqualToken).AppendTo(property.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 212: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3009 + //line php5/php5.y:3085 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -5234,13 +5310,13 @@ yydefault: property.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(variable, yyDollar[1].token.Meta, meta.VariableToken) + yyDollar[1].token.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 213: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3026 + //line php5/php5.y:3102 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -5253,18 +5329,19 @@ yydefault: property.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) // save comments - addMeta(variable, yyDollar[1].token.Meta, meta.VariableToken) - addMeta(property, yyDollar[2].token.Meta, meta.EqualToken) + yyDollar[1].token.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.EqualToken).AppendTo(property.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 214: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:3047 + //line php5/php5.y:3123 { name := node.NewIdentifier(yyDollar[3].token.Value) constant := stmt.NewConstant(name, yyDollar[5].node, "") constList := yyDollar[1].node.(*stmt.ClassConstList) + lastConst := lastNode(constList.Consts) constList.Consts = append(constList.Consts, constant) yyVAL.node = yyDollar[1].node @@ -5274,15 +5351,15 @@ yydefault: yyDollar[1].node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[5].node)) // save comments - addMeta(lastNode(constList.Consts), yyDollar[2].token.Meta, meta.CommaToken) - addMeta(name, yyDollar[3].token.Meta, meta.IdentifierToken) - addMeta(constant, yyDollar[4].token.Meta, meta.EqualToken) + yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastConst.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.EqualToken).AppendTo(constant.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 215: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3067 + //line php5/php5.y:3144 { name := node.NewIdentifier(yyDollar[2].token.Value) constant := stmt.NewConstant(name, yyDollar[4].node, "") @@ -5294,26 +5371,26 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[4].node)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ConstToken) - addMeta(name, yyDollar[2].token.Meta, meta.IdentifierToken) - addMeta(constant, yyDollar[3].token.Meta, meta.EqualToken) + yyDollar[1].token.Meta.SetTokenName(meta.ConstToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.EqualToken).AppendTo(constant.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 216: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3088 + //line php5/php5.y:3165 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.NodeEnd) + yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 217: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3097 + //line php5/php5.y:3174 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -5321,7 +5398,7 @@ yydefault: } case 218: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3107 + //line php5/php5.y:3184 { yyVAL.list = nil @@ -5329,7 +5406,7 @@ yydefault: } case 219: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3113 + //line php5/php5.y:3190 { yyVAL.list = yyDollar[1].list @@ -5337,18 +5414,18 @@ yydefault: } case 220: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3122 + //line php5/php5.y:3199 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.NodeEnd) + yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 221: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3131 + //line php5/php5.y:3208 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -5356,7 +5433,7 @@ yydefault: } case 222: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3140 + //line php5/php5.y:3217 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) @@ -5364,7 +5441,7 @@ yydefault: } case 223: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3146 + //line php5/php5.y:3223 { yyVAL.list = yyDollar[1].list @@ -5372,7 +5449,7 @@ yydefault: } case 224: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3155 + //line php5/php5.y:3232 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yyVAL.list = append(yyDollar[1].list, fetch) @@ -5381,14 +5458,16 @@ yydefault: fetch.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) // save comments - addMeta(fetch, yyDollar[2].token.Meta, meta.OpenSquareBracket) - addMeta(fetch, yyDollar[4].token.Meta, meta.CloseSquareBracket) + yyDollar[2].token.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo(fetch.GetMeta()) + yylex.(*Parser).appendMetaToken(fetch, yyDollar[2].token, meta.OpenSquareBracket) + yyDollar[4].token.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(fetch.GetMeta()) + yylex.(*Parser).appendMetaToken(fetch, yyDollar[4].token, meta.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 225: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3169 + //line php5/php5.y:3248 { fetch := expr.NewArrayDimFetch(nil, yyDollar[2].node) yyVAL.list = []node.Node{fetch} @@ -5397,14 +5476,16 @@ yydefault: fetch.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[2].node)) // save comments - addMeta(fetch, yyDollar[1].token.Meta, meta.OpenSquareBracket) - addMeta(fetch, yyDollar[3].token.Meta, meta.CloseSquareBracket) + yyDollar[1].token.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo(fetch.GetMeta()) + yylex.(*Parser).appendMetaToken(fetch, yyDollar[1].token, meta.OpenSquareBracket) + yyDollar[3].token.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(fetch.GetMeta()) + yylex.(*Parser).appendMetaToken(fetch, yyDollar[3].token, meta.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 226: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3186 + //line php5/php5.y:3267 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) @@ -5412,7 +5493,7 @@ yydefault: } case 227: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3192 + //line php5/php5.y:3273 { yyVAL.list = yyDollar[1].list @@ -5420,7 +5501,7 @@ yydefault: } case 228: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3198 + //line php5/php5.y:3279 { yyVAL.list = yyDollar[1].list @@ -5428,7 +5509,7 @@ yydefault: } case 229: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3207 + //line php5/php5.y:3288 { yyVAL.list = nil @@ -5436,7 +5517,7 @@ yydefault: } case 230: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3213 + //line php5/php5.y:3294 { yyVAL.list = yyDollar[1].list @@ -5444,7 +5525,7 @@ yydefault: } case 231: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3222 + //line php5/php5.y:3303 { if yyDollar[3].node != nil { @@ -5456,13 +5537,13 @@ yydefault: } // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.NewToken) + yyDollar[1].token.Meta.SetTokenName(meta.NewAnchor).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 232: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:3241 + //line php5/php5.y:3322 { list := expr.NewList(yyDollar[3].list) yyVAL.node = assign.NewAssign(list, yyDollar[6].node) @@ -5472,16 +5553,16 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[6].node)) // save comments - addMeta(list, yyDollar[1].token.Meta, meta.ListToken) - addMeta(list, yyDollar[2].token.Meta, meta.OpenParenthesisToken) - addMeta(list, yyDollar[4].token.Meta, meta.CloseParenthesisToken) - addMeta(yyVAL.node, yyDollar[5].token.Meta, meta.EqualToken) + yyDollar[1].token.Meta.SetTokenName(meta.ListToken).AppendTo(list.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(list.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(list.GetMeta()) + yyDollar[5].token.Meta.SetTokenName(meta.EqualToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 233: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3258 + //line php5/php5.y:3339 { yyVAL.node = assign.NewAssign(yyDollar[1].node, yyDollar[3].node) @@ -5489,13 +5570,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.EqualToken) + yyDollar[2].token.Meta.SetTokenName(meta.EqualToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 234: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3270 + //line php5/php5.y:3351 { yyVAL.node = assign.NewReference(yyDollar[1].node, yyDollar[4].node) @@ -5503,14 +5584,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.EqualToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.AmpersandToken) + yyDollar[2].token.Meta.SetTokenName(meta.EqualToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 235: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:3283 + //line php5/php5.y:3364 { var _new *expr.New @@ -5530,15 +5611,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, _new)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.EqualToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.AmpersandToken) - addMeta(_new, yyDollar[4].token.Meta, meta.NewToken) + yyDollar[2].token.Meta.SetTokenName(meta.EqualToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.NewAnchor).AppendTo(_new.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 236: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3309 + //line php5/php5.y:3390 { yyVAL.node = expr.NewClone(yyDollar[2].node) @@ -5546,13 +5627,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.CloneToken) + yyDollar[1].token.Meta.SetTokenName(meta.CloneToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 237: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3321 + //line php5/php5.y:3402 { yyVAL.node = assign.NewPlus(yyDollar[1].node, yyDollar[3].node) @@ -5560,13 +5641,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.PlusEqualToken) + yyDollar[2].token.Meta.SetTokenName(meta.PlusEqualToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 238: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3333 + //line php5/php5.y:3414 { yyVAL.node = assign.NewMinus(yyDollar[1].node, yyDollar[3].node) @@ -5574,13 +5655,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.MinusEqualToken) + yyDollar[2].token.Meta.SetTokenName(meta.MinusEqualToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 239: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3345 + //line php5/php5.y:3426 { yyVAL.node = assign.NewMul(yyDollar[1].node, yyDollar[3].node) @@ -5588,13 +5669,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.MulEqualToken) + yyDollar[2].token.Meta.SetTokenName(meta.MulEqualToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 240: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3357 + //line php5/php5.y:3438 { yyVAL.node = assign.NewPow(yyDollar[1].node, yyDollar[3].node) @@ -5602,13 +5683,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.PowEqualToken) + yyDollar[2].token.Meta.SetTokenName(meta.PowEqualToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 241: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3369 + //line php5/php5.y:3450 { yyVAL.node = assign.NewDiv(yyDollar[1].node, yyDollar[3].node) @@ -5616,13 +5697,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.DivEqualToken) + yyDollar[2].token.Meta.SetTokenName(meta.DivEqualToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 242: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3381 + //line php5/php5.y:3462 { yyVAL.node = assign.NewConcat(yyDollar[1].node, yyDollar[3].node) @@ -5630,13 +5711,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.ConcatEqualToken) + yyDollar[2].token.Meta.SetTokenName(meta.ConcatEqualToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 243: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3393 + //line php5/php5.y:3474 { yyVAL.node = assign.NewMod(yyDollar[1].node, yyDollar[3].node) @@ -5644,13 +5725,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.ModEqualToken) + yyDollar[2].token.Meta.SetTokenName(meta.ModEqualToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 244: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3405 + //line php5/php5.y:3486 { yyVAL.node = assign.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) @@ -5658,13 +5739,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.AndEqualToken) + yyDollar[2].token.Meta.SetTokenName(meta.AndEqualToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 245: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3417 + //line php5/php5.y:3498 { yyVAL.node = assign.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) @@ -5672,13 +5753,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OrEqualToken) + yyDollar[2].token.Meta.SetTokenName(meta.OrEqualToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 246: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3429 + //line php5/php5.y:3510 { yyVAL.node = assign.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) @@ -5686,13 +5767,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.XorEqualToken) + yyDollar[2].token.Meta.SetTokenName(meta.XorEqualToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 247: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3441 + //line php5/php5.y:3522 { yyVAL.node = assign.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) @@ -5700,13 +5781,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.SlEqualToken) + yyDollar[2].token.Meta.SetTokenName(meta.SlEqualToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 248: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3453 + //line php5/php5.y:3534 { yyVAL.node = assign.NewShiftRight(yyDollar[1].node, yyDollar[3].node) @@ -5714,13 +5795,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.SrEqualToken) + yyDollar[2].token.Meta.SetTokenName(meta.SrEqualToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 249: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3465 + //line php5/php5.y:3546 { yyVAL.node = expr.NewPostInc(yyDollar[1].node) @@ -5728,13 +5809,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.IncToken) + yyDollar[2].token.Meta.SetTokenName(meta.IncToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 250: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3477 + //line php5/php5.y:3558 { yyVAL.node = expr.NewPreInc(yyDollar[2].node) @@ -5742,13 +5823,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.IncToken) + yyDollar[1].token.Meta.SetTokenName(meta.IncToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 251: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3489 + //line php5/php5.y:3570 { yyVAL.node = expr.NewPostDec(yyDollar[1].node) @@ -5756,13 +5837,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.DecToken) + yyDollar[2].token.Meta.SetTokenName(meta.DecToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 252: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3501 + //line php5/php5.y:3582 { yyVAL.node = expr.NewPreDec(yyDollar[2].node) @@ -5770,13 +5851,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.DecToken) + yyDollar[1].token.Meta.SetTokenName(meta.DecToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 253: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3513 + //line php5/php5.y:3594 { yyVAL.node = binary.NewBooleanOr(yyDollar[1].node, yyDollar[3].node) @@ -5784,13 +5865,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.BooleanOrToken) + yyDollar[2].token.Meta.SetTokenName(meta.BooleanOrToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 254: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3525 + //line php5/php5.y:3606 { yyVAL.node = binary.NewBooleanAnd(yyDollar[1].node, yyDollar[3].node) @@ -5798,13 +5879,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.BooleanAndToken) + yyDollar[2].token.Meta.SetTokenName(meta.BooleanAndToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 255: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3537 + //line php5/php5.y:3618 { yyVAL.node = binary.NewLogicalOr(yyDollar[1].node, yyDollar[3].node) @@ -5812,13 +5893,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.LogicalOrToken) + yyDollar[2].token.Meta.SetTokenName(meta.LogicalOrToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 256: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3549 + //line php5/php5.y:3630 { yyVAL.node = binary.NewLogicalAnd(yyDollar[1].node, yyDollar[3].node) @@ -5826,13 +5907,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.LogicalAndToken) + yyDollar[2].token.Meta.SetTokenName(meta.LogicalAndToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 257: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3561 + //line php5/php5.y:3642 { yyVAL.node = binary.NewLogicalXor(yyDollar[1].node, yyDollar[3].node) @@ -5840,13 +5921,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.LogicalXorToken) + yyDollar[2].token.Meta.SetTokenName(meta.LogicalXorToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 258: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3573 + //line php5/php5.y:3654 { yyVAL.node = binary.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) @@ -5854,13 +5935,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.VerticalBarToken) + yyDollar[2].token.Meta.SetTokenName(meta.VerticalBarToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 259: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3585 + //line php5/php5.y:3666 { yyVAL.node = binary.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) @@ -5868,13 +5949,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.AmpersandToken) + yyDollar[2].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 260: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3597 + //line php5/php5.y:3678 { yyVAL.node = binary.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) @@ -5882,13 +5963,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.CaretToken) + yyDollar[2].token.Meta.SetTokenName(meta.CaretToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 261: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3609 + //line php5/php5.y:3690 { yyVAL.node = binary.NewConcat(yyDollar[1].node, yyDollar[3].node) @@ -5896,13 +5977,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.DotToken) + yyDollar[2].token.Meta.SetTokenName(meta.DotToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 262: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3621 + //line php5/php5.y:3702 { yyVAL.node = binary.NewPlus(yyDollar[1].node, yyDollar[3].node) @@ -5910,13 +5991,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.PlusToken) + yyDollar[2].token.Meta.SetTokenName(meta.PlusToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 263: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3633 + //line php5/php5.y:3714 { yyVAL.node = binary.NewMinus(yyDollar[1].node, yyDollar[3].node) @@ -5924,13 +6005,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.MinusToken) + yyDollar[2].token.Meta.SetTokenName(meta.MinusToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 264: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3645 + //line php5/php5.y:3726 { yyVAL.node = binary.NewMul(yyDollar[1].node, yyDollar[3].node) @@ -5938,13 +6019,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.AsteriskToken) + yyDollar[2].token.Meta.SetTokenName(meta.AsteriskToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 265: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3657 + //line php5/php5.y:3738 { yyVAL.node = binary.NewPow(yyDollar[1].node, yyDollar[3].node) @@ -5952,13 +6033,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.PowToken) + yyDollar[2].token.Meta.SetTokenName(meta.PowToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 266: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3669 + //line php5/php5.y:3750 { yyVAL.node = binary.NewDiv(yyDollar[1].node, yyDollar[3].node) @@ -5966,13 +6047,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.SlashToken) + yyDollar[2].token.Meta.SetTokenName(meta.SlashToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 267: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3681 + //line php5/php5.y:3762 { yyVAL.node = binary.NewMod(yyDollar[1].node, yyDollar[3].node) @@ -5980,13 +6061,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.PercentToken) + yyDollar[2].token.Meta.SetTokenName(meta.PercentToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 268: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3693 + //line php5/php5.y:3774 { yyVAL.node = binary.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) @@ -5994,13 +6075,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.SlToken) + yyDollar[2].token.Meta.SetTokenName(meta.SlToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 269: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3705 + //line php5/php5.y:3786 { yyVAL.node = binary.NewShiftRight(yyDollar[1].node, yyDollar[3].node) @@ -6008,13 +6089,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.SrToken) + yyDollar[2].token.Meta.SetTokenName(meta.SrToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 270: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3717 + //line php5/php5.y:3798 { yyVAL.node = expr.NewUnaryPlus(yyDollar[2].node) @@ -6022,13 +6103,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.PlusToken) + yyDollar[1].token.Meta.SetTokenName(meta.PlusToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 271: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3729 + //line php5/php5.y:3810 { yyVAL.node = expr.NewUnaryMinus(yyDollar[2].node) @@ -6036,13 +6117,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.MinusToken) + yyDollar[1].token.Meta.SetTokenName(meta.MinusToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 272: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3741 + //line php5/php5.y:3822 { yyVAL.node = expr.NewBooleanNot(yyDollar[2].node) @@ -6050,13 +6131,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ExclamationMarkToken) + yyDollar[1].token.Meta.SetTokenName(meta.ExclamationMarkToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 273: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3753 + //line php5/php5.y:3834 { yyVAL.node = expr.NewBitwiseNot(yyDollar[2].node) @@ -6064,13 +6145,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.TildeToken) + yyDollar[1].token.Meta.SetTokenName(meta.TildeToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 274: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3765 + //line php5/php5.y:3846 { yyVAL.node = binary.NewIdentical(yyDollar[1].node, yyDollar[3].node) @@ -6078,13 +6159,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.IsIdenticalToken) + yyDollar[2].token.Meta.SetTokenName(meta.IsIdenticalToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 275: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3777 + //line php5/php5.y:3858 { yyVAL.node = binary.NewNotIdentical(yyDollar[1].node, yyDollar[3].node) @@ -6092,13 +6173,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.IsNotIdenticalToken) + yyDollar[2].token.Meta.SetTokenName(meta.IsNotIdenticalToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 276: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3789 + //line php5/php5.y:3870 { yyVAL.node = binary.NewEqual(yyDollar[1].node, yyDollar[3].node) @@ -6106,13 +6187,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.IsEqualToken) + yyDollar[2].token.Meta.SetTokenName(meta.IsEqualToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 277: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3801 + //line php5/php5.y:3882 { yyVAL.node = binary.NewNotEqual(yyDollar[1].node, yyDollar[3].node) @@ -6120,13 +6201,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.IsNotEqualToken) + yyDollar[2].token.Meta.SetTokenName(meta.IsNotEqualToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.IsNotEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 278: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3813 + //line php5/php5.y:3895 { yyVAL.node = binary.NewSmaller(yyDollar[1].node, yyDollar[3].node) @@ -6134,13 +6216,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.LessToken) + yyDollar[2].token.Meta.SetTokenName(meta.LessToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 279: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3825 + //line php5/php5.y:3907 { yyVAL.node = binary.NewSmallerOrEqual(yyDollar[1].node, yyDollar[3].node) @@ -6148,13 +6230,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.IsSmallerOrEqualToken) + yyDollar[2].token.Meta.SetTokenName(meta.IsSmallerOrEqualToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 280: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3837 + //line php5/php5.y:3919 { yyVAL.node = binary.NewGreater(yyDollar[1].node, yyDollar[3].node) @@ -6162,13 +6244,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.GreaterToken) + yyDollar[2].token.Meta.SetTokenName(meta.GreaterToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 281: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3849 + //line php5/php5.y:3931 { yyVAL.node = binary.NewGreaterOrEqual(yyDollar[1].node, yyDollar[3].node) @@ -6176,13 +6258,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.IsGreaterOrEqualToken) + yyDollar[2].token.Meta.SetTokenName(meta.IsGreaterOrEqualToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 282: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3861 + //line php5/php5.y:3943 { yyVAL.node = expr.NewInstanceOf(yyDollar[1].node, yyDollar[3].node) @@ -6190,21 +6272,24 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.InstanceofToken) + yyDollar[2].token.Meta.SetTokenName(meta.InstanceofToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 283: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3873 + //line php5/php5.y:3955 { yyVAL.node = yyDollar[1].node yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + + yyVAL.node.GetMeta().Cut(meta.TokenNameFilter(meta.OpenParenthesisToken)).SetTokenName(meta.NodeStart).PrependTo(yyVAL.node.GetMeta()) + yyVAL.node.GetMeta().Cut(meta.TokenNameFilter(meta.CloseParenthesisToken)).SetTokenName(meta.NodeEnd).AppendTo(yyVAL.node.GetMeta()) } case 284: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3879 + //line php5/php5.y:3964 { yyVAL.node = yyDollar[1].node @@ -6212,7 +6297,7 @@ yydefault: } case 285: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3885 + //line php5/php5.y:3970 { yyVAL.node = yyDollar[2].node @@ -6236,14 +6321,14 @@ yydefault: } // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.OpenParenthesisToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.CloseParenthesisToken) + yyDollar[1].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 286: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:3914 + //line php5/php5.y:3999 { yyVAL.node = expr.NewTernary(yyDollar[1].node, yyDollar[3].node, yyDollar[5].node) @@ -6251,14 +6336,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[5].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.QuestionMarkToken) - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.ColonToken) + yyDollar[2].token.Meta.SetTokenName(meta.QuestionMarkToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.ColonToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 287: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3927 + //line php5/php5.y:4012 { yyVAL.node = expr.NewTernary(yyDollar[1].node, nil, yyDollar[4].node) @@ -6266,14 +6351,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.QuestionMarkToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.ColonToken) + yyDollar[2].token.Meta.SetTokenName(meta.QuestionMarkToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.ColonToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 288: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3940 + //line php5/php5.y:4025 { yyVAL.node = yyDollar[1].node @@ -6281,7 +6366,7 @@ yydefault: } case 289: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3946 + //line php5/php5.y:4031 { yyVAL.node = cast.NewInt(yyDollar[2].node) @@ -6289,13 +6374,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.IntCastToken) + yyDollar[1].token.Meta.SetTokenName(meta.IntCastToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.IntCastToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 290: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3958 + //line php5/php5.y:4044 { yyVAL.node = cast.NewDouble(yyDollar[2].node) @@ -6303,13 +6389,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.DoubleCastToken) + yyDollar[1].token.Meta.SetTokenName(meta.DoubleCastToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.DoubleCastToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 291: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3970 + //line php5/php5.y:4057 { yyVAL.node = cast.NewString(yyDollar[2].node) @@ -6317,13 +6404,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.StringCastToken) + yyDollar[1].token.Meta.SetTokenName(meta.StringCastToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.StringCastToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 292: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3982 + //line php5/php5.y:4070 { yyVAL.node = cast.NewArray(yyDollar[2].node) @@ -6331,13 +6419,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ArrayCastToken) + yyDollar[1].token.Meta.SetTokenName(meta.ArrayCastToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.ArrayCastToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 293: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3994 + //line php5/php5.y:4083 { yyVAL.node = cast.NewObject(yyDollar[2].node) @@ -6345,13 +6434,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ObjectCastToken) + yyDollar[1].token.Meta.SetTokenName(meta.ObjectCastToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.ObjectCastToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 294: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4006 + //line php5/php5.y:4096 { yyVAL.node = cast.NewBool(yyDollar[2].node) @@ -6359,13 +6449,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.BoolCastToken) + yyDollar[1].token.Meta.SetTokenName(meta.BoolCastToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.BoolCastToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 295: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4018 + //line php5/php5.y:4109 { yyVAL.node = cast.NewUnset(yyDollar[2].node) @@ -6373,13 +6464,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.UnsetCastToken) + yyDollar[1].token.Meta.SetTokenName(meta.UnsetCastToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.UnsetCastToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 296: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4030 + //line php5/php5.y:4122 { var e *expr.Exit if yyDollar[2].node != nil { @@ -6402,13 +6494,13 @@ yydefault: } // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ExitToken) + yyDollar[1].token.Meta.SetTokenName(meta.ExitToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 297: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4057 + //line php5/php5.y:4149 { yyVAL.node = expr.NewErrorSuppress(yyDollar[2].node) @@ -6416,13 +6508,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.AtToken) + yyDollar[1].token.Meta.SetTokenName(meta.AtToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 298: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4069 + //line php5/php5.y:4161 { yyVAL.node = yyDollar[1].node @@ -6430,7 +6522,7 @@ yydefault: } case 299: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4075 + //line php5/php5.y:4167 { yyVAL.node = yyDollar[1].node @@ -6438,7 +6530,7 @@ yydefault: } case 300: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4081 + //line php5/php5.y:4173 { yyVAL.node = yyDollar[1].node @@ -6446,7 +6538,7 @@ yydefault: } case 301: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4087 + //line php5/php5.y:4179 { yyVAL.node = expr.NewShellExec(yyDollar[2].list) @@ -6454,14 +6546,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.BackquoteToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.BackquoteToken) + yyDollar[1].token.Meta.SetTokenName(meta.BackquoteToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.BackquoteToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 302: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4100 + //line php5/php5.y:4192 { yyVAL.node = expr.NewPrint(yyDollar[2].node) @@ -6469,13 +6561,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.PrintToken) + yyDollar[1].token.Meta.SetTokenName(meta.PrintToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 303: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4112 + //line php5/php5.y:4204 { yyVAL.node = expr.NewYield(nil, nil) @@ -6483,13 +6575,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.YieldToken) + yyDollar[1].token.Meta.SetTokenName(meta.YieldToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 304: yyDollar = yyS[yypt-9 : yypt+1] - //line php5/php5.y:4124 + //line php5/php5.y:4216 { yyVAL.node = expr.NewClosure(yyDollar[4].list, yyDollar[6].ClosureUse, nil, yyDollar[8].list, false, yyDollar[2].token != nil, "") @@ -6497,20 +6589,20 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[9].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.FunctionToken) + yyDollar[1].token.Meta.SetTokenName(meta.FunctionToken).AppendTo(yyVAL.node.GetMeta()) if yyDollar[2].token != nil { - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.AmpersandToken) + yyDollar[2].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(yyVAL.node.GetMeta()) } - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.OpenParenthesisToken) - addMeta(yyVAL.node, yyDollar[5].token.Meta, meta.CloseParenthesisToken) - addMeta(yyVAL.node, yyDollar[7].token.Meta, meta.OpenCurlyBracesToken) - addMeta(yyVAL.node, yyDollar[9].token.Meta, meta.CloseCurlyBracesToken) + yyDollar[3].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[5].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[7].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[9].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 305: yyDollar = yyS[yypt-10 : yypt+1] - //line php5/php5.y:4143 + //line php5/php5.y:4235 { yyVAL.node = expr.NewClosure(yyDollar[5].list, yyDollar[7].ClosureUse, nil, yyDollar[9].list, true, yyDollar[3].token != nil, "") @@ -6518,21 +6610,21 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[10].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.StaticToken) - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.FunctionToken) + yyDollar[1].token.Meta.SetTokenName(meta.StaticToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.FunctionToken).AppendTo(yyVAL.node.GetMeta()) if yyDollar[3].token != nil { - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.AmpersandToken) + yyDollar[3].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(yyVAL.node.GetMeta()) } - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.OpenParenthesisToken) - addMeta(yyVAL.node, yyDollar[6].token.Meta, meta.CloseParenthesisToken) - addMeta(yyVAL.node, yyDollar[8].token.Meta, meta.OpenCurlyBracesToken) - addMeta(yyVAL.node, yyDollar[10].token.Meta, meta.CloseCurlyBracesToken) + yyDollar[4].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[6].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[8].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[10].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 306: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4166 + //line php5/php5.y:4258 { yyVAL.node = expr.NewYield(nil, yyDollar[2].node) @@ -6540,13 +6632,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.YieldToken) + yyDollar[1].token.Meta.SetTokenName(meta.YieldToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 307: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4178 + //line php5/php5.y:4270 { yyVAL.node = expr.NewYield(nil, yyDollar[2].node) @@ -6554,13 +6646,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.YieldToken) + yyDollar[1].token.Meta.SetTokenName(meta.YieldToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 308: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4190 + //line php5/php5.y:4282 { yyVAL.node = expr.NewYield(yyDollar[2].node, yyDollar[4].node) @@ -6568,14 +6660,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[4].node)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.YieldToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.DoubleArrowToken) + yyDollar[1].token.Meta.SetTokenName(meta.YieldToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 309: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4203 + //line php5/php5.y:4295 { yyVAL.node = expr.NewYield(yyDollar[2].node, yyDollar[4].node) @@ -6583,14 +6675,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[4].node)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.YieldToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.DoubleArrowToken) + yyDollar[1].token.Meta.SetTokenName(meta.YieldToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 310: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4219 + //line php5/php5.y:4311 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -6598,14 +6690,16 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenSquareBracket) - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseSquareBracket) + yyDollar[2].token.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.OpenSquareBracket) + yyDollar[4].token.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 311: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4232 + //line php5/php5.y:4326 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -6613,14 +6707,16 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenSquareBracket) - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseSquareBracket) + yyDollar[2].token.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.OpenSquareBracket) + yyDollar[4].token.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 312: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4245 + //line php5/php5.y:4341 { str := scalar.NewString(yyDollar[1].token.Value) yyVAL.node = expr.NewArrayDimFetch(str, yyDollar[3].node) @@ -6630,14 +6726,16 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(str, yyDollar[4].token)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenSquareBracket) - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseSquareBracket) + yyDollar[2].token.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.OpenSquareBracket) + yyDollar[4].token.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 313: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4260 + //line php5/php5.y:4358 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -6645,14 +6743,16 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenSquareBracket) - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseSquareBracket) + yyDollar[2].token.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.OpenSquareBracket) + yyDollar[4].token.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 314: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4276 + //line php5/php5.y:4376 { yyVAL.node = expr.NewArray(yyDollar[3].list) @@ -6660,15 +6760,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ArrayToken) - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenParenthesisToken) - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseParenthesisToken) + yyDollar[1].token.Meta.SetTokenName(meta.ArrayToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 315: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4290 + //line php5/php5.y:4390 { yyVAL.node = expr.NewShortArray(yyDollar[2].list) @@ -6676,20 +6776,20 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.OpenSquareBracket) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.CloseSquareBracket) + yyDollar[1].token.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 316: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4306 + //line php5/php5.y:4406 { yyVAL.token = yyDollar[1].token } case 317: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:4313 + //line php5/php5.y:4413 { yyVAL.ClosureUse = nil @@ -6697,17 +6797,23 @@ yydefault: } case 318: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4319 + //line php5/php5.y:4419 { yyVAL.ClosureUse = expr.NewClosureUse(yyDollar[3].list) + // save position yyVAL.ClosureUse.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + // save comments + yyDollar[1].token.Meta.SetTokenName(meta.UseToken).AppendTo(yyVAL.ClosureUse.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.ClosureUse.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.ClosureUse.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 319: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4330 + //line php5/php5.y:4436 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[3].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -6718,14 +6824,14 @@ yydefault: variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) // save comments - addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) - addMeta(variable, yyDollar[3].token.Meta, meta.VariableToken) + yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 320: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4346 + //line php5/php5.y:4452 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[4].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -6738,15 +6844,15 @@ yydefault: reference.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[3].token, yyDollar[4].token)) // save comments - addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) - addMeta(reference, yyDollar[3].token.Meta, meta.VariableToken) - addMeta(variable, yyDollar[4].token.Meta, meta.VariableToken) + yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(reference.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 321: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4365 + //line php5/php5.y:4471 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -6757,13 +6863,13 @@ yydefault: variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(variable, yyDollar[1].token.Meta, meta.VariableToken) + yyDollar[1].token.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 322: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4380 + //line php5/php5.y:4486 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[2].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -6776,14 +6882,14 @@ yydefault: reference.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - addMeta(reference, yyDollar[1].token.Meta, meta.VariableToken) - addMeta(variable, yyDollar[2].token.Meta, meta.VariableToken) + yyDollar[1].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(reference.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 323: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4401 + //line php5/php5.y:4507 { name := name.NewName(yyDollar[1].list) yyVAL.node = expr.NewFunctionCall(name, yyDollar[2].node.(*node.ArgumentList)) @@ -6796,7 +6902,7 @@ yydefault: } case 324: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4412 + //line php5/php5.y:4518 { funcName := name.NewRelative(yyDollar[3].list) yyVAL.node = expr.NewFunctionCall(funcName, yyDollar[4].node.(*node.ArgumentList)) @@ -6806,14 +6912,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(funcName, yyDollar[4].node)) // save comments - addMeta(funcName, yyDollar[1].token.Meta, meta.NamespaceToken) - addMeta(funcName, yyDollar[2].token.Meta, meta.NsSeparatorToken) + yyDollar[1].token.Meta.SetTokenName(meta.NamespaceToken).AppendTo(funcName.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo(funcName.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 325: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4427 + //line php5/php5.y:4533 { funcName := name.NewFullyQualified(yyDollar[2].list) yyVAL.node = expr.NewFunctionCall(funcName, yyDollar[3].node.(*node.ArgumentList)) @@ -6823,13 +6929,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(funcName, yyDollar[3].node)) // save comments - addMeta(funcName, yyDollar[1].token.Meta, meta.NsSeparatorToken) + yyDollar[1].token.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo(funcName.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 326: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4441 + //line php5/php5.y:4547 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -6837,13 +6943,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.PaamayimNekudotayimToken) + yyDollar[2].token.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 327: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4453 + //line php5/php5.y:4559 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -6851,13 +6957,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.PaamayimNekudotayimToken) + yyDollar[2].token.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 328: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4465 + //line php5/php5.y:4571 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -6865,13 +6971,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.PaamayimNekudotayimToken) + yyDollar[2].token.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 329: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4477 + //line php5/php5.y:4583 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -6879,13 +6985,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.PaamayimNekudotayimToken) + yyDollar[2].token.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 330: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4489 + //line php5/php5.y:4595 { yyVAL.node = expr.NewFunctionCall(yyDollar[1].node, yyDollar[2].node.(*node.ArgumentList)) @@ -6896,7 +7002,7 @@ yydefault: } case 331: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4501 + //line php5/php5.y:4607 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -6904,13 +7010,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.IdentifierToken) + yyDollar[1].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 332: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4513 + //line php5/php5.y:4619 { yyVAL.node = name.NewName(yyDollar[1].list) @@ -6921,7 +7027,7 @@ yydefault: } case 333: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4522 + //line php5/php5.y:4628 { yyVAL.node = name.NewRelative(yyDollar[3].list) @@ -6929,14 +7035,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.NamespaceToken) - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.NsSeparatorToken) + yyDollar[1].token.Meta.SetTokenName(meta.NamespaceToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 334: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4535 + //line php5/php5.y:4641 { yyVAL.node = name.NewFullyQualified(yyDollar[2].list) @@ -6944,13 +7050,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.NsSeparatorToken) + yyDollar[1].token.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 335: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4550 + //line php5/php5.y:4656 { yyVAL.node = name.NewName(yyDollar[1].list) @@ -6961,7 +7067,7 @@ yydefault: } case 336: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4559 + //line php5/php5.y:4665 { yyVAL.node = name.NewRelative(yyDollar[3].list) @@ -6969,14 +7075,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.NamespaceToken) - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.NsSeparatorToken) + yyDollar[1].token.Meta.SetTokenName(meta.NamespaceToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 337: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4572 + //line php5/php5.y:4678 { yyVAL.node = name.NewFullyQualified(yyDollar[2].list) @@ -6984,13 +7090,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.NsSeparatorToken) + yyDollar[1].token.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 338: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4587 + //line php5/php5.y:4693 { yyVAL.node = yyDollar[1].node @@ -6998,7 +7104,7 @@ yydefault: } case 339: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4593 + //line php5/php5.y:4699 { yyVAL.node = yyDollar[1].node @@ -7006,12 +7112,12 @@ yydefault: } case 340: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4602 + //line php5/php5.y:4708 { yyVAL.node = yyDollar[1].node // save comments - addMeta(yyDollar[3].list[0], yyDollar[2].token.Meta, meta.ObjectOperatorToken) + yyDollar[2].token.Meta.SetTokenName(meta.ObjectOperatorToken).AppendTo(yyDollar[3].list[0].GetMeta()) for _, n := range yyDollar[3].list { switch nn := n.(type) { @@ -7045,7 +7151,7 @@ yydefault: } case 341: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4639 + //line php5/php5.y:4745 { yyVAL.node = yyDollar[1].node @@ -7053,7 +7159,7 @@ yydefault: } case 342: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4649 + //line php5/php5.y:4755 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) @@ -7061,7 +7167,7 @@ yydefault: } case 343: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:4655 + //line php5/php5.y:4761 { yyVAL.list = []node.Node{} @@ -7069,18 +7175,18 @@ yydefault: } case 344: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4665 + //line php5/php5.y:4771 { yyVAL.list = yyDollar[2].list // save comments - addMeta(yyDollar[2].list[0], yyDollar[1].token.Meta, meta.ObjectOperatorToken) + yyDollar[1].token.Meta.SetTokenName(meta.ObjectOperatorToken).AppendTo(yyDollar[2].list[0].GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 345: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:4677 + //line php5/php5.y:4783 { yyVAL.node = nil @@ -7088,7 +7194,7 @@ yydefault: } case 346: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4683 + //line php5/php5.y:4789 { yyVAL.node = expr.NewExit(nil) @@ -7096,14 +7202,16 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.OpenParenthesisToken) - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.CloseParenthesisToken) + yyDollar[1].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.OpenParenthesisToken) + yyDollar[2].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 347: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4696 + //line php5/php5.y:4804 { yyVAL.node = expr.NewExit(yyDollar[1].node) @@ -7115,10 +7223,14 @@ yydefault: } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + + // save comments + yyDollar[1].node.GetMeta().Cut(meta.TokenNameFilter(meta.OpenParenthesisToken)).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(meta.TokenNameFilter(meta.CloseParenthesisToken)).AppendTo(yyVAL.node.GetMeta()) } case 348: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:4712 + //line php5/php5.y:4824 { yyVAL.list = []node.Node{} @@ -7126,7 +7238,7 @@ yydefault: } case 349: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4718 + //line php5/php5.y:4830 { yyVAL.list = []node.Node{scalar.NewEncapsedStringPart(yyDollar[1].token.Value)} @@ -7134,7 +7246,7 @@ yydefault: } case 350: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4724 + //line php5/php5.y:4836 { yyVAL.list = yyDollar[1].list @@ -7142,7 +7254,7 @@ yydefault: } case 351: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:4733 + //line php5/php5.y:4845 { yyVAL.node = nil @@ -7150,7 +7262,7 @@ yydefault: } case 352: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4739 + //line php5/php5.y:4851 { yyVAL.node = yyDollar[1].node @@ -7158,7 +7270,7 @@ yydefault: } case 353: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4748 + //line php5/php5.y:4860 { yyVAL.node = scalar.NewLnumber(yyDollar[1].token.Value) @@ -7166,13 +7278,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.LnumberToken) + yyDollar[1].token.Meta.SetTokenName(meta.LnumberToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 354: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4760 + //line php5/php5.y:4872 { yyVAL.node = scalar.NewDnumber(yyDollar[1].token.Value) @@ -7180,13 +7292,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.DnumberToken) + yyDollar[1].token.Meta.SetTokenName(meta.DnumberToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 355: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4772 + //line php5/php5.y:4884 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) @@ -7194,13 +7306,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ConstantEncapsedStringToken) + yyDollar[1].token.Meta.SetTokenName(meta.ConstantEncapsedStringToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 356: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4784 + //line php5/php5.y:4896 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7208,13 +7320,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.MagicConstantToken) + yyDollar[1].token.Meta.SetTokenName(meta.MagicConstantToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 357: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4796 + //line php5/php5.y:4908 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7222,13 +7334,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.MagicConstantToken) + yyDollar[1].token.Meta.SetTokenName(meta.MagicConstantToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 358: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4808 + //line php5/php5.y:4920 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7236,13 +7348,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.MagicConstantToken) + yyDollar[1].token.Meta.SetTokenName(meta.MagicConstantToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 359: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4820 + //line php5/php5.y:4932 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7250,13 +7362,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.MagicConstantToken) + yyDollar[1].token.Meta.SetTokenName(meta.MagicConstantToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 360: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4832 + //line php5/php5.y:4944 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7264,13 +7376,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.MagicConstantToken) + yyDollar[1].token.Meta.SetTokenName(meta.MagicConstantToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 361: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4844 + //line php5/php5.y:4956 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7278,13 +7390,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.MagicConstantToken) + yyDollar[1].token.Meta.SetTokenName(meta.MagicConstantToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 362: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4856 + //line php5/php5.y:4968 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7292,13 +7404,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.MagicConstantToken) + yyDollar[1].token.Meta.SetTokenName(meta.MagicConstantToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 363: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4868 + //line php5/php5.y:4980 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, []node.Node{encapsed}) @@ -7308,13 +7420,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.StartHeredocToken) + yyDollar[1].token.Meta.SetTokenName(meta.StartHeredocToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 364: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4882 + //line php5/php5.y:4994 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, nil) @@ -7322,13 +7434,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.StartHeredocToken) + yyDollar[1].token.Meta.SetTokenName(meta.StartHeredocToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 365: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4897 + //line php5/php5.y:5009 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -7338,14 +7450,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.PaamayimNekudotayimToken) - addMeta(target, yyDollar[3].token.Meta, meta.IdentifierToken) + yyDollar[2].token.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(target.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 366: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4915 + //line php5/php5.y:5027 { yyVAL.node = yyDollar[1].node @@ -7353,7 +7465,7 @@ yydefault: } case 367: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4924 + //line php5/php5.y:5036 { yyVAL.node = yyDollar[1].node @@ -7361,7 +7473,7 @@ yydefault: } case 368: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4930 + //line php5/php5.y:5042 { yyVAL.node = yyDollar[1].node @@ -7369,7 +7481,7 @@ yydefault: } case 369: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4936 + //line php5/php5.y:5048 { name := name.NewName(yyDollar[1].list) yyVAL.node = expr.NewConstFetch(name) @@ -7382,7 +7494,7 @@ yydefault: } case 370: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4947 + //line php5/php5.y:5059 { name := name.NewRelative(yyDollar[3].list) yyVAL.node = expr.NewConstFetch(name) @@ -7392,14 +7504,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) // save comments - addMeta(name, yyDollar[1].token.Meta, meta.NamespaceToken) - addMeta(name, yyDollar[2].token.Meta, meta.NsSeparatorToken) + yyDollar[1].token.Meta.SetTokenName(meta.NamespaceToken).AppendTo(name.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo(name.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 371: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4962 + //line php5/php5.y:5074 { name := name.NewFullyQualified(yyDollar[2].list) yyVAL.node = expr.NewConstFetch(name) @@ -7409,13 +7521,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) // save comments - addMeta(name, yyDollar[1].token.Meta, meta.NsSeparatorToken) + yyDollar[1].token.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo(name.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 372: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4976 + //line php5/php5.y:5088 { yyVAL.node = expr.NewArray(yyDollar[3].list) @@ -7423,15 +7535,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ArrayToken) - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenParenthesisToken) - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseParenthesisToken) + yyDollar[1].token.Meta.SetTokenName(meta.ArrayToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 373: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4990 + //line php5/php5.y:5102 { yyVAL.node = expr.NewShortArray(yyDollar[2].list) @@ -7439,14 +7551,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.OpenSquareBracket) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.CloseSquareBracket) + yyDollar[1].token.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 374: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5003 + //line php5/php5.y:5115 { yyVAL.node = yyDollar[1].node @@ -7454,7 +7566,7 @@ yydefault: } case 375: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5009 + //line php5/php5.y:5121 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7462,13 +7574,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.MagicConstantToken) + yyDollar[1].token.Meta.SetTokenName(meta.MagicConstantToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 376: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5021 + //line php5/php5.y:5133 { yyVAL.node = yyDollar[1].node @@ -7476,7 +7588,7 @@ yydefault: } case 377: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:5030 + //line php5/php5.y:5142 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -7484,14 +7596,16 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenSquareBracket) - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseSquareBracket) + yyDollar[2].token.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.OpenSquareBracket) + yyDollar[4].token.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 378: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5043 + //line php5/php5.y:5157 { yyVAL.node = binary.NewPlus(yyDollar[1].node, yyDollar[3].node) @@ -7499,13 +7613,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.PlusToken) + yyDollar[2].token.Meta.SetTokenName(meta.PlusToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 379: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5055 + //line php5/php5.y:5169 { yyVAL.node = binary.NewMinus(yyDollar[1].node, yyDollar[3].node) @@ -7513,13 +7627,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.MinusToken) + yyDollar[2].token.Meta.SetTokenName(meta.MinusToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 380: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5067 + //line php5/php5.y:5181 { yyVAL.node = binary.NewMul(yyDollar[1].node, yyDollar[3].node) @@ -7527,13 +7641,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.AsteriskToken) + yyDollar[2].token.Meta.SetTokenName(meta.AsteriskToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 381: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5079 + //line php5/php5.y:5193 { yyVAL.node = binary.NewPow(yyDollar[1].node, yyDollar[3].node) @@ -7541,13 +7655,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.PowToken) + yyDollar[2].token.Meta.SetTokenName(meta.PowToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 382: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5091 + //line php5/php5.y:5205 { yyVAL.node = binary.NewDiv(yyDollar[1].node, yyDollar[3].node) @@ -7555,13 +7669,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.SlashToken) + yyDollar[2].token.Meta.SetTokenName(meta.SlashToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 383: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5103 + //line php5/php5.y:5217 { yyVAL.node = binary.NewMod(yyDollar[1].node, yyDollar[3].node) @@ -7569,13 +7683,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.PercentToken) + yyDollar[2].token.Meta.SetTokenName(meta.PercentToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 384: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5115 + //line php5/php5.y:5229 { yyVAL.node = expr.NewBooleanNot(yyDollar[2].node) @@ -7583,13 +7697,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ExclamationMarkToken) + yyDollar[1].token.Meta.SetTokenName(meta.ExclamationMarkToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 385: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5127 + //line php5/php5.y:5241 { yyVAL.node = expr.NewBitwiseNot(yyDollar[2].node) @@ -7597,13 +7711,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.TildeToken) + yyDollar[1].token.Meta.SetTokenName(meta.TildeToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 386: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5139 + //line php5/php5.y:5253 { yyVAL.node = binary.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) @@ -7611,13 +7725,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.VerticalBarToken) + yyDollar[2].token.Meta.SetTokenName(meta.VerticalBarToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 387: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5151 + //line php5/php5.y:5265 { yyVAL.node = binary.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) @@ -7625,13 +7739,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.AmpersandToken) + yyDollar[2].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 388: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5163 + //line php5/php5.y:5277 { yyVAL.node = binary.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) @@ -7639,13 +7753,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.CaretToken) + yyDollar[2].token.Meta.SetTokenName(meta.CaretToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 389: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5175 + //line php5/php5.y:5289 { yyVAL.node = binary.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) @@ -7653,13 +7767,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.SlToken) + yyDollar[2].token.Meta.SetTokenName(meta.SlToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 390: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5187 + //line php5/php5.y:5301 { yyVAL.node = binary.NewShiftRight(yyDollar[1].node, yyDollar[3].node) @@ -7667,13 +7781,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.SrToken) + yyDollar[2].token.Meta.SetTokenName(meta.SrToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 391: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5199 + //line php5/php5.y:5313 { yyVAL.node = binary.NewConcat(yyDollar[1].node, yyDollar[3].node) @@ -7681,13 +7795,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.DotToken) + yyDollar[2].token.Meta.SetTokenName(meta.DotToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 392: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5211 + //line php5/php5.y:5325 { yyVAL.node = binary.NewLogicalXor(yyDollar[1].node, yyDollar[3].node) @@ -7695,13 +7809,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.LogicalXorToken) + yyDollar[2].token.Meta.SetTokenName(meta.LogicalXorToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 393: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5223 + //line php5/php5.y:5337 { yyVAL.node = binary.NewLogicalAnd(yyDollar[1].node, yyDollar[3].node) @@ -7709,13 +7823,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.LogicalAndToken) + yyDollar[2].token.Meta.SetTokenName(meta.LogicalAndToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 394: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5235 + //line php5/php5.y:5349 { yyVAL.node = binary.NewLogicalOr(yyDollar[1].node, yyDollar[3].node) @@ -7723,13 +7837,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.LogicalOrToken) + yyDollar[2].token.Meta.SetTokenName(meta.LogicalOrToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 395: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5247 + //line php5/php5.y:5361 { yyVAL.node = binary.NewBooleanAnd(yyDollar[1].node, yyDollar[3].node) @@ -7737,13 +7851,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.BooleanAndToken) + yyDollar[2].token.Meta.SetTokenName(meta.BooleanAndToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 396: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5259 + //line php5/php5.y:5373 { yyVAL.node = binary.NewBooleanOr(yyDollar[1].node, yyDollar[3].node) @@ -7751,13 +7865,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.BooleanOrToken) + yyDollar[2].token.Meta.SetTokenName(meta.BooleanOrToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 397: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5271 + //line php5/php5.y:5385 { yyVAL.node = binary.NewIdentical(yyDollar[1].node, yyDollar[3].node) @@ -7765,13 +7879,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.IsIdenticalToken) + yyDollar[2].token.Meta.SetTokenName(meta.IsIdenticalToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 398: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5283 + //line php5/php5.y:5397 { yyVAL.node = binary.NewNotIdentical(yyDollar[1].node, yyDollar[3].node) @@ -7779,13 +7893,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.IsNotIdenticalToken) + yyDollar[2].token.Meta.SetTokenName(meta.IsNotIdenticalToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 399: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5295 + //line php5/php5.y:5409 { yyVAL.node = binary.NewEqual(yyDollar[1].node, yyDollar[3].node) @@ -7793,13 +7907,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.IsEqualToken) + yyDollar[2].token.Meta.SetTokenName(meta.IsEqualToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 400: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5307 + //line php5/php5.y:5421 { yyVAL.node = binary.NewNotEqual(yyDollar[1].node, yyDollar[3].node) @@ -7807,13 +7921,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.IsNotEqualToken) + yyDollar[2].token.Meta.SetTokenName(meta.IsNotEqualToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.IsNotEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 401: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5319 + //line php5/php5.y:5434 { yyVAL.node = binary.NewSmaller(yyDollar[1].node, yyDollar[3].node) @@ -7821,13 +7936,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.LessToken) + yyDollar[2].token.Meta.SetTokenName(meta.LessToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 402: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5331 + //line php5/php5.y:5446 { yyVAL.node = binary.NewGreater(yyDollar[1].node, yyDollar[3].node) @@ -7835,13 +7950,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.GreaterToken) + yyDollar[2].token.Meta.SetTokenName(meta.GreaterToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 403: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5343 + //line php5/php5.y:5458 { yyVAL.node = binary.NewSmallerOrEqual(yyDollar[1].node, yyDollar[3].node) @@ -7849,13 +7964,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.IsSmallerOrEqualToken) + yyDollar[2].token.Meta.SetTokenName(meta.IsSmallerOrEqualToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 404: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5355 + //line php5/php5.y:5470 { yyVAL.node = binary.NewGreaterOrEqual(yyDollar[1].node, yyDollar[3].node) @@ -7863,13 +7978,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.IsGreaterOrEqualToken) + yyDollar[2].token.Meta.SetTokenName(meta.IsGreaterOrEqualToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 405: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:5367 + //line php5/php5.y:5482 { yyVAL.node = expr.NewTernary(yyDollar[1].node, nil, yyDollar[4].node) @@ -7877,14 +7992,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.QuestionMarkToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.ColonToken) + yyDollar[2].token.Meta.SetTokenName(meta.QuestionMarkToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.ColonToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 406: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:5380 + //line php5/php5.y:5495 { yyVAL.node = expr.NewTernary(yyDollar[1].node, yyDollar[3].node, yyDollar[5].node) @@ -7892,14 +8007,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[5].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.QuestionMarkToken) - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.ColonToken) + yyDollar[2].token.Meta.SetTokenName(meta.QuestionMarkToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.ColonToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 407: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5393 + //line php5/php5.y:5508 { yyVAL.node = expr.NewUnaryPlus(yyDollar[2].node) @@ -7907,13 +8022,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.PlusToken) + yyDollar[1].token.Meta.SetTokenName(meta.PlusToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 408: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5405 + //line php5/php5.y:5520 { yyVAL.node = expr.NewUnaryMinus(yyDollar[2].node) @@ -7921,25 +8036,25 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.MinusToken) + yyDollar[1].token.Meta.SetTokenName(meta.MinusToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 409: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5417 + //line php5/php5.y:5532 { yyVAL.node = yyDollar[2].node // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.OpenParenthesisToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.CloseParenthesisToken) + yyDollar[1].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 410: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5430 + //line php5/php5.y:5545 { yyVAL.node = yyDollar[1].node @@ -7947,7 +8062,7 @@ yydefault: } case 411: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5436 + //line php5/php5.y:5551 { name := name.NewName(yyDollar[1].list) yyVAL.node = expr.NewConstFetch(name) @@ -7960,7 +8075,7 @@ yydefault: } case 412: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5447 + //line php5/php5.y:5562 { name := name.NewRelative(yyDollar[3].list) yyVAL.node = expr.NewConstFetch(name) @@ -7968,14 +8083,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(name)) // save comments - addMeta(name, yyDollar[1].token.Meta, meta.NamespaceToken) - addMeta(name, yyDollar[2].token.Meta, meta.NsSeparatorToken) + yyDollar[1].token.Meta.SetTokenName(meta.NamespaceToken).AppendTo(name.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo(name.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 413: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5460 + //line php5/php5.y:5575 { name := name.NewFullyQualified(yyDollar[2].list) yyVAL.node = expr.NewConstFetch(name) @@ -7985,13 +8100,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(name)) // save comments - addMeta(name, yyDollar[1].token.Meta, meta.NsSeparatorToken) + yyDollar[1].token.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo(name.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 414: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5477 + //line php5/php5.y:5592 { name := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = expr.NewVariable(name) @@ -8001,13 +8116,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(name, yyDollar[1].token.Meta, meta.IdentifierToken) + yyDollar[1].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 415: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5491 + //line php5/php5.y:5606 { yyVAL.node = yyDollar[1].node @@ -8015,7 +8130,7 @@ yydefault: } case 416: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5497 + //line php5/php5.y:5612 { yyVAL.node = yyDollar[1].node @@ -8023,7 +8138,7 @@ yydefault: } case 417: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5503 + //line php5/php5.y:5618 { yyVAL.node = yyDollar[1].node @@ -8031,7 +8146,7 @@ yydefault: } case 418: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5509 + //line php5/php5.y:5624 { yyVAL.node = scalar.NewEncapsed(yyDollar[2].list) @@ -8039,13 +8154,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.DoubleQuoteToken) + yyDollar[1].token.Meta.SetTokenName(meta.DoubleQuoteToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 419: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5521 + //line php5/php5.y:5636 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, yyDollar[2].list) @@ -8053,13 +8168,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.StartHeredocToken) + yyDollar[1].token.Meta.SetTokenName(meta.StartHeredocToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 420: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5533 + //line php5/php5.y:5648 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -8067,13 +8182,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.MagicConstantToken) + yyDollar[1].token.Meta.SetTokenName(meta.MagicConstantToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 421: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:5548 + //line php5/php5.y:5663 { yyVAL.list = nil @@ -8081,32 +8196,32 @@ yydefault: } case 422: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5554 + //line php5/php5.y:5669 { yyVAL.list = yyDollar[1].list // save comments if yyDollar[2].token != nil { - addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) + yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 423: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:5568 + //line php5/php5.y:5683 { yyVAL.token = nil } case 424: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5572 + //line php5/php5.y:5687 { yyVAL.token = yyDollar[1].token } case 425: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:5579 + //line php5/php5.y:5694 { arrayItem := expr.NewArrayItem(yyDollar[3].node, yyDollar[5].node) yyVAL.list = append(yyDollar[1].list, arrayItem) @@ -8115,14 +8230,14 @@ yydefault: arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[3].node, yyDollar[5].node)) // save comments - addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) - addMeta(arrayItem, yyDollar[4].token.Meta, meta.DoubleArrowToken) + yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo(arrayItem.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 426: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5593 + //line php5/php5.y:5708 { arrayItem := expr.NewArrayItem(nil, yyDollar[3].node) yyVAL.list = append(yyDollar[1].list, arrayItem) @@ -8131,13 +8246,13 @@ yydefault: arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) // save comments - addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) + yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 427: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5606 + //line php5/php5.y:5721 { arrayItem := expr.NewArrayItem(yyDollar[1].node, yyDollar[3].node) yyVAL.list = []node.Node{arrayItem} @@ -8146,13 +8261,13 @@ yydefault: arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(arrayItem, yyDollar[2].token.Meta, meta.DoubleArrowToken) + yyDollar[2].token.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo(arrayItem.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 428: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5619 + //line php5/php5.y:5734 { arrayItem := expr.NewArrayItem(nil, yyDollar[1].node) yyVAL.list = []node.Node{arrayItem} @@ -8164,7 +8279,7 @@ yydefault: } case 429: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5632 + //line php5/php5.y:5747 { yyVAL.node = yyDollar[1].node @@ -8172,7 +8287,7 @@ yydefault: } case 430: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5638 + //line php5/php5.y:5753 { yyVAL.node = yyDollar[1].node @@ -8180,31 +8295,35 @@ yydefault: } case 431: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5647 + //line php5/php5.y:5762 { yyVAL.node = yyDollar[2].node // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.OpenParenthesisToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.CloseParenthesisToken) + yyDollar[1].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.OpenParenthesisToken) + yyDollar[3].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 432: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5657 + //line php5/php5.y:5774 { yyVAL.node = yyDollar[2].node // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.OpenParenthesisToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.CloseParenthesisToken) + yyDollar[1].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.OpenParenthesisToken) + yyDollar[3].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 433: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5671 + //line php5/php5.y:5790 { yyVAL.node = yyDollar[1].node @@ -8212,7 +8331,7 @@ yydefault: } case 434: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5681 + //line php5/php5.y:5800 { yyVAL.node = yyDollar[1].node @@ -8220,7 +8339,7 @@ yydefault: } case 435: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5690 + //line php5/php5.y:5809 { yyVAL.node = yyDollar[1].node @@ -8228,7 +8347,7 @@ yydefault: } case 436: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:5699 + //line php5/php5.y:5818 { yyVAL.node = yyDollar[1].node @@ -8238,7 +8357,7 @@ yydefault: } // save comments - addMeta(yyDollar[3].list[0], yyDollar[2].token.Meta, meta.ObjectOperatorToken) + yyDollar[2].token.Meta.SetTokenName(meta.ObjectOperatorToken).AppendTo(yyDollar[3].list[0].GetMeta()) for _, n := range yyDollar[3].list { switch nn := n.(type) { @@ -8282,7 +8401,7 @@ yydefault: } case 437: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5751 + //line php5/php5.y:5870 { yyVAL.node = yyDollar[1].node @@ -8290,7 +8409,7 @@ yydefault: } case 438: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5760 + //line php5/php5.y:5879 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) @@ -8298,7 +8417,7 @@ yydefault: } case 439: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:5766 + //line php5/php5.y:5885 { yyVAL.list = []node.Node{} @@ -8306,7 +8425,7 @@ yydefault: } case 440: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5776 + //line php5/php5.y:5895 { if yyDollar[3].list != nil { yyDollar[3].list[0].(*expr.MethodCall).Method = yyDollar[2].list[len(yyDollar[2].list)-1].(*expr.PropertyFetch).Property @@ -8316,13 +8435,13 @@ yydefault: yyVAL.list = yyDollar[2].list // save comments - addMeta(yyDollar[2].list[0], yyDollar[1].token.Meta, meta.ObjectOperatorToken) + yyDollar[1].token.Meta.SetTokenName(meta.ObjectOperatorToken).AppendTo(yyDollar[2].list[0].GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 441: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:5793 + //line php5/php5.y:5912 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yyVAL.list = append(yyDollar[1].list, fetch) @@ -8331,14 +8450,16 @@ yydefault: fetch.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) // save comments - addMeta(fetch, yyDollar[2].token.Meta, meta.OpenSquareBracket) - addMeta(fetch, yyDollar[4].token.Meta, meta.CloseSquareBracket) + yyDollar[2].token.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo(fetch.GetMeta()) + yylex.(*Parser).appendMetaToken(fetch, yyDollar[2].token, meta.OpenSquareBracket) + yyDollar[4].token.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(fetch.GetMeta()) + yylex.(*Parser).appendMetaToken(fetch, yyDollar[4].token, meta.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 442: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:5807 + //line php5/php5.y:5928 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yyVAL.list = []node.Node{yyDollar[1].node, fetch} @@ -8347,14 +8468,16 @@ yydefault: fetch.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) // save comments - addMeta(fetch, yyDollar[2].token.Meta, meta.OpenSquareBracket) - addMeta(fetch, yyDollar[4].token.Meta, meta.CloseSquareBracket) + yyDollar[2].token.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo(fetch.GetMeta()) + yylex.(*Parser).appendMetaToken(fetch, yyDollar[2].token, meta.OpenSquareBracket) + yyDollar[4].token.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(fetch.GetMeta()) + yylex.(*Parser).appendMetaToken(fetch, yyDollar[4].token, meta.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 443: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5824 + //line php5/php5.y:5947 { yyVAL.node = expr.NewMethodCall(nil, nil, yyDollar[1].node.(*node.ArgumentList)) @@ -8365,7 +8488,7 @@ yydefault: } case 444: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5836 + //line php5/php5.y:5959 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -8373,7 +8496,7 @@ yydefault: } case 445: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5842 + //line php5/php5.y:5965 { yyVAL.list = yyDollar[1].list @@ -8381,7 +8504,7 @@ yydefault: } case 446: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:5848 + //line php5/php5.y:5971 { yyVAL.list = nil @@ -8389,7 +8512,7 @@ yydefault: } case 447: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5857 + //line php5/php5.y:5980 { yyVAL.node = yyDollar[1].node @@ -8397,7 +8520,7 @@ yydefault: } case 448: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5863 + //line php5/php5.y:5986 { yyDollar[1].simpleIndirectReference.last.SetVarName(yyDollar[2].node) @@ -8411,7 +8534,7 @@ yydefault: } case 449: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5878 + //line php5/php5.y:6001 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -8419,13 +8542,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.PaamayimNekudotayimToken) + yyDollar[2].token.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 450: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5890 + //line php5/php5.y:6013 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -8433,13 +8556,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.PaamayimNekudotayimToken) + yyDollar[2].token.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 451: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5905 + //line php5/php5.y:6028 { yyVAL.node = yyDollar[1].node @@ -8447,7 +8570,7 @@ yydefault: } case 452: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:5914 + //line php5/php5.y:6037 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -8455,14 +8578,16 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenSquareBracket) - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseSquareBracket) + yyDollar[2].token.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.OpenSquareBracket) + yyDollar[4].token.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 453: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:5927 + //line php5/php5.y:6052 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -8470,14 +8595,16 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenSquareBracket) - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseSquareBracket) + yyDollar[2].token.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.OpenSquareBracket) + yyDollar[4].token.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 454: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5943 + //line php5/php5.y:6070 { yyVAL.node = yyDollar[1].node @@ -8485,7 +8612,7 @@ yydefault: } case 455: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5949 + //line php5/php5.y:6076 { yyVAL.node = yyDollar[1].node @@ -8493,7 +8620,7 @@ yydefault: } case 456: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5955 + //line php5/php5.y:6082 { yyVAL.node = yyDollar[1].node @@ -8501,7 +8628,7 @@ yydefault: } case 457: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5965 + //line php5/php5.y:6092 { yyVAL.node = yyDollar[1].node @@ -8509,7 +8636,7 @@ yydefault: } case 458: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5971 + //line php5/php5.y:6098 { yyDollar[1].simpleIndirectReference.last.SetVarName(yyDollar[2].node) @@ -8523,7 +8650,7 @@ yydefault: } case 459: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5983 + //line php5/php5.y:6110 { yyVAL.node = yyDollar[1].node @@ -8531,7 +8658,7 @@ yydefault: } case 460: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:5992 + //line php5/php5.y:6119 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -8539,14 +8666,16 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenSquareBracket) - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseSquareBracket) + yyDollar[2].token.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.OpenSquareBracket) + yyDollar[4].token.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 461: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6005 + //line php5/php5.y:6134 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -8554,14 +8683,16 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenCurlyBracesToken) - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseCurlyBracesToken) + yyDollar[2].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.OpenCurlyBracesToken) + yyDollar[4].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 462: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6018 + //line php5/php5.y:6149 { yyVAL.node = yyDollar[1].node @@ -8569,7 +8700,7 @@ yydefault: } case 463: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6028 + //line php5/php5.y:6159 { name := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(name) @@ -8579,13 +8710,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.VariableToken) + yyDollar[1].token.Meta.SetTokenName(meta.VariableToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 464: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6042 + //line php5/php5.y:6173 { yyVAL.node = expr.NewVariable(yyDollar[3].node) @@ -8593,15 +8724,17 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.DollarToken) - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenCurlyBracesToken) - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseCurlyBracesToken) + yyDollar[1].token.Meta.SetTokenName(meta.DollarToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.OpenCurlyBracesToken) + yyDollar[4].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 465: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:6059 + //line php5/php5.y:6192 { yyVAL.node = nil @@ -8609,7 +8742,7 @@ yydefault: } case 466: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6065 + //line php5/php5.y:6198 { yyVAL.node = yyDollar[1].node @@ -8617,7 +8750,7 @@ yydefault: } case 467: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6075 + //line php5/php5.y:6208 { yyVAL.list = yyDollar[1].list @@ -8625,7 +8758,7 @@ yydefault: } case 468: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6081 + //line php5/php5.y:6214 { fetch := expr.NewPropertyFetch(nil, yyDollar[1].node) yyVAL.list = []node.Node{fetch} @@ -8637,7 +8770,7 @@ yydefault: } case 469: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6094 + //line php5/php5.y:6227 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yyVAL.list = append(yyDollar[1].list, fetch) @@ -8646,14 +8779,16 @@ yydefault: fetch.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) // save comments - addMeta(fetch, yyDollar[2].token.Meta, meta.OpenSquareBracket) - addMeta(fetch, yyDollar[4].token.Meta, meta.CloseSquareBracket) + yyDollar[2].token.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo(fetch.GetMeta()) + yylex.(*Parser).appendMetaToken(fetch, yyDollar[2].token, meta.OpenSquareBracket) + yyDollar[4].token.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(fetch.GetMeta()) + yylex.(*Parser).appendMetaToken(fetch, yyDollar[4].token, meta.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 470: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6108 + //line php5/php5.y:6243 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yyVAL.list = append(yyDollar[1].list, fetch) @@ -8662,14 +8797,16 @@ yydefault: fetch.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) // save comments - addMeta(fetch, yyDollar[2].token.Meta, meta.OpenCurlyBracesToken) - addMeta(fetch, yyDollar[4].token.Meta, meta.CloseCurlyBracesToken) + yyDollar[2].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(fetch.GetMeta()) + yylex.(*Parser).appendMetaToken(fetch, yyDollar[2].token, meta.OpenCurlyBracesToken) + yyDollar[4].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(fetch.GetMeta()) + yylex.(*Parser).appendMetaToken(fetch, yyDollar[4].token, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 471: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6122 + //line php5/php5.y:6259 { fetch := expr.NewPropertyFetch(nil, yyDollar[1].node) yyVAL.list = []node.Node{fetch} @@ -8681,7 +8818,7 @@ yydefault: } case 472: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6135 + //line php5/php5.y:6272 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -8689,13 +8826,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.IdentifierToken) + yyDollar[1].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 473: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6147 + //line php5/php5.y:6284 { yyVAL.node = yyDollar[2].node @@ -8703,14 +8840,16 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.OpenCurlyBracesToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.CloseCurlyBracesToken) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) + yyDollar[3].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 474: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6163 + //line php5/php5.y:6302 { n := expr.NewVariable(nil) yyVAL.simpleIndirectReference = simpleIndirectReference{[]*expr.Variable{n}, n} @@ -8719,13 +8858,13 @@ yydefault: n.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(n, yyDollar[1].token.Meta, meta.DollarToken) + yyDollar[1].token.Meta.SetTokenName(meta.DollarToken).AppendTo(n.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 475: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6176 + //line php5/php5.y:6315 { n := expr.NewVariable(nil) @@ -8738,13 +8877,13 @@ yydefault: n.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) // save comments - addMeta(n, yyDollar[2].token.Meta, meta.DollarToken) + yyDollar[2].token.Meta.SetTokenName(meta.DollarToken).AppendTo(n.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 476: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6196 + //line php5/php5.y:6335 { if len(yyDollar[1].list) == 0 { yyDollar[1].list = []node.Node{expr.NewArrayItem(nil, nil)} @@ -8753,13 +8892,13 @@ yydefault: yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.NodeEnd) + yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 477: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6209 + //line php5/php5.y:6348 { if yyDollar[1].node.(*expr.ArrayItem).Key == nil && yyDollar[1].node.(*expr.ArrayItem).Val == nil { yyVAL.list = []node.Node{} @@ -8771,7 +8910,7 @@ yydefault: } case 478: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6223 + //line php5/php5.y:6362 { yyVAL.node = expr.NewArrayItem(nil, yyDollar[1].node) @@ -8782,7 +8921,7 @@ yydefault: } case 479: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6232 + //line php5/php5.y:6371 { item := expr.NewList(yyDollar[3].list) yyVAL.node = expr.NewArrayItem(nil, item) @@ -8792,15 +8931,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(item)) // save comments - addMeta(item, yyDollar[1].token.Meta, meta.ListToken) - addMeta(item, yyDollar[2].token.Meta, meta.OpenParenthesisToken) - addMeta(item, yyDollar[4].token.Meta, meta.CloseParenthesisToken) + yyDollar[1].token.Meta.SetTokenName(meta.ListToken).AppendTo(item.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(item.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(item.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 480: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:6248 + //line php5/php5.y:6387 { yyVAL.node = expr.NewArrayItem(nil, nil) @@ -8808,7 +8947,7 @@ yydefault: } case 481: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:6258 + //line php5/php5.y:6397 { yyVAL.list = []node.Node{} @@ -8816,7 +8955,7 @@ yydefault: } case 482: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6264 + //line php5/php5.y:6403 { yyVAL.list = yyDollar[1].list @@ -8826,14 +8965,14 @@ yydefault: // save comments if yyDollar[2].token != nil { - addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) + yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 483: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:6282 + //line php5/php5.y:6421 { arrayItem := expr.NewArrayItem(yyDollar[3].node, yyDollar[5].node) yyVAL.list = append(yyDollar[1].list, arrayItem) @@ -8842,14 +8981,14 @@ yydefault: arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[3].node, yyDollar[5].node)) // save comments - addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) - addMeta(arrayItem, yyDollar[4].token.Meta, meta.DoubleArrowToken) + yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo(arrayItem.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 484: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6296 + //line php5/php5.y:6435 { arrayItem := expr.NewArrayItem(nil, yyDollar[3].node) yyVAL.list = append(yyDollar[1].list, arrayItem) @@ -8858,13 +8997,13 @@ yydefault: arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) // save comments - addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) + yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 485: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6309 + //line php5/php5.y:6448 { arrayItem := expr.NewArrayItem(yyDollar[1].node, yyDollar[3].node) yyVAL.list = []node.Node{arrayItem} @@ -8873,13 +9012,13 @@ yydefault: arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(arrayItem, yyDollar[2].token.Meta, meta.DoubleArrowToken) + yyDollar[2].token.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo(arrayItem.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 486: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6322 + //line php5/php5.y:6461 { arrayItem := expr.NewArrayItem(nil, yyDollar[1].node) yyVAL.list = []node.Node{arrayItem} @@ -8891,7 +9030,7 @@ yydefault: } case 487: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:6332 + //line php5/php5.y:6471 { reference := expr.NewReference(yyDollar[6].node) arrayItem := expr.NewArrayItem(yyDollar[3].node, reference) @@ -8902,15 +9041,15 @@ yydefault: arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[3].node, yyDollar[6].node)) // save comments - addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) - addMeta(arrayItem, yyDollar[4].token.Meta, meta.DoubleArrowToken) - addMeta(reference, yyDollar[5].token.Meta, meta.AmpersandToken) + yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo(arrayItem.GetMeta()) + yyDollar[5].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(reference.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 488: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6349 + //line php5/php5.y:6488 { reference := expr.NewReference(yyDollar[4].node) arrayItem := expr.NewArrayItem(nil, reference) @@ -8921,14 +9060,14 @@ yydefault: arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[3].token, yyDollar[4].node)) // save comments - addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.CommaToken) - addMeta(reference, yyDollar[3].token.Meta, meta.AmpersandToken) + yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(reference.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 489: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6365 + //line php5/php5.y:6504 { reference := expr.NewReference(yyDollar[4].node) arrayItem := expr.NewArrayItem(yyDollar[1].node, reference) @@ -8939,14 +9078,14 @@ yydefault: arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) // save comments - addMeta(arrayItem, yyDollar[2].token.Meta, meta.DoubleArrowToken) - addMeta(reference, yyDollar[3].token.Meta, meta.AmpersandToken) + yyDollar[2].token.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo(arrayItem.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(reference.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 490: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6381 + //line php5/php5.y:6520 { reference := expr.NewReference(yyDollar[2].node) arrayItem := expr.NewArrayItem(nil, reference) @@ -8957,13 +9096,13 @@ yydefault: arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - addMeta(reference, yyDollar[1].token.Meta, meta.AmpersandToken) + yyDollar[1].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(reference.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 491: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6399 + //line php5/php5.y:6538 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -8971,7 +9110,7 @@ yydefault: } case 492: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6405 + //line php5/php5.y:6544 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yyVAL.list = append(yyDollar[1].list, encapsed) @@ -8980,13 +9119,13 @@ yydefault: encapsed.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) // save comments - addMeta(encapsed, yyDollar[2].token.Meta, meta.EncapsedAndWhitespaceToken) + yyDollar[2].token.Meta.SetTokenName(meta.EncapsedAndWhitespaceToken).AppendTo(encapsed.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 493: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6418 + //line php5/php5.y:6557 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -8994,7 +9133,7 @@ yydefault: } case 494: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6424 + //line php5/php5.y:6563 { encapsed := scalar.NewEncapsedStringPart(yyDollar[1].token.Value) yyVAL.list = []node.Node{encapsed, yyDollar[2].node} @@ -9003,13 +9142,13 @@ yydefault: encapsed.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(encapsed, yyDollar[1].token.Meta, meta.EncapsedAndWhitespaceToken) + yyDollar[1].token.Meta.SetTokenName(meta.EncapsedAndWhitespaceToken).AppendTo(encapsed.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 495: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6440 + //line php5/php5.y:6579 { name := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(name) @@ -9019,13 +9158,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.VariableToken) + yyDollar[1].token.Meta.SetTokenName(meta.VariableToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 496: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6454 + //line php5/php5.y:6593 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -9037,15 +9176,17 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - addMeta(variable, yyDollar[1].token.Meta, meta.VariableToken) - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenSquareBracket) - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseSquareBracket) + yyDollar[1].token.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.OpenSquareBracket) + yyDollar[4].token.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 497: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6472 + //line php5/php5.y:6613 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -9059,51 +9200,62 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - addMeta(variable, yyDollar[1].token.Meta, meta.VariableToken) - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.ObjectOperatorToken) - addMeta(fetch, yyDollar[3].token.Meta, meta.IdentifierToken) + yyDollar[1].token.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.ObjectOperatorToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(fetch.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 498: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6492 + //line php5/php5.y:6633 { - yyVAL.node = expr.NewVariable(yyDollar[2].node) + variable := expr.NewVariable(yyDollar[2].node) + variable.StringVar = true + + yyVAL.node = variable // save position yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.DollarOpenCurlyBracesToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.CloseCurlyBracesToken) + yyDollar[1].token.Meta.SetTokenName(meta.DollarOpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.DollarOpenCurlyBracesToken) + yyDollar[3].token.Meta.SetTokenName(meta.DollarCloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.DollarCloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 499: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6505 + //line php5/php5.y:6651 { name := node.NewIdentifier(yyDollar[2].token.Value) - yyVAL.node = expr.NewVariable(name) + variable := expr.NewVariable(name) + variable.StringVar = true + + yyVAL.node = variable // save position name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.DollarOpenCurlyBracesToken) - addMeta(name, yyDollar[2].token.Meta, meta.IdentifierToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.CloseCurlyBracesToken) + yyDollar[1].token.Meta.SetTokenName(meta.DollarOpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.DollarOpenCurlyBracesToken) + yyDollar[2].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.DollarCloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.DollarCloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 500: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:6521 + //line php5/php5.y:6672 { identifier := node.NewIdentifier(yyDollar[2].token.Value) variable := expr.NewVariable(identifier) + variable.StringVar = true yyVAL.node = expr.NewArrayDimFetch(variable, yyDollar[4].node) // save position @@ -9112,25 +9264,35 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[6].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.DollarOpenCurlyBracesToken) - addMeta(variable, yyDollar[2].token.Meta, meta.StringVarnameToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.OpenSquareBracket) - addMeta(yyVAL.node, yyDollar[5].token.Meta, meta.CloseSquareBracket) - addMeta(yyVAL.node, yyDollar[6].token.Meta, meta.CloseCurlyBracesToken) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) + yyDollar[2].token.Meta.SetTokenName(meta.StringVarnameToken).AppendTo(variable.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.OpenSquareBracket) + yyDollar[5].token.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[5].token, meta.CloseSquareBracket) + yyDollar[6].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[6].token, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 501: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6541 + //line php5/php5.y:6697 { yyVAL.node = yyDollar[2].node + // save comments + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) + yyDollar[3].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.NodeEnd) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 502: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6550 + //line php5/php5.y:6712 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) @@ -9138,13 +9300,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.StringToken) + yyDollar[1].token.Meta.SetTokenName(meta.StringToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 503: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6562 + //line php5/php5.y:6724 { // TODO: add option to handle 64 bit integer if _, err := strconv.Atoi(yyDollar[1].token.Value); err == nil { @@ -9157,13 +9319,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.NumStringToken) + yyDollar[1].token.Meta.SetTokenName(meta.NumStringToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 504: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6579 + //line php5/php5.y:6741 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(identifier) @@ -9173,13 +9335,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.VariableToken) + yyDollar[1].token.Meta.SetTokenName(meta.VariableToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 505: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6596 + //line php5/php5.y:6758 { yyVAL.node = expr.NewIsset(yyDollar[3].list) @@ -9187,15 +9349,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.IssetToken) - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenParenthesisToken) - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseParenthesisToken) + yyDollar[1].token.Meta.SetTokenName(meta.IssetToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 506: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6610 + //line php5/php5.y:6772 { yyVAL.node = expr.NewEmpty(yyDollar[3].node) @@ -9203,15 +9365,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.EmptyToken) - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenParenthesisToken) - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseParenthesisToken) + yyDollar[1].token.Meta.SetTokenName(meta.EmptyToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 507: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6624 + //line php5/php5.y:6786 { yyVAL.node = expr.NewEmpty(yyDollar[3].node) @@ -9219,15 +9381,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.EmptyToken) - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenParenthesisToken) - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseParenthesisToken) + yyDollar[1].token.Meta.SetTokenName(meta.EmptyToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 508: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6638 + //line php5/php5.y:6800 { yyVAL.node = expr.NewInclude(yyDollar[2].node) @@ -9235,13 +9397,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.IncludeToken) + yyDollar[1].token.Meta.SetTokenName(meta.IncludeToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 509: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6650 + //line php5/php5.y:6812 { yyVAL.node = expr.NewIncludeOnce(yyDollar[2].node) @@ -9249,13 +9411,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.IncludeOnceToken) + yyDollar[1].token.Meta.SetTokenName(meta.IncludeOnceToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 510: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6662 + //line php5/php5.y:6824 { yyVAL.node = expr.NewEval(yyDollar[3].node) @@ -9263,15 +9425,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.EvalToken) - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenParenthesisToken) - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseParenthesisToken) + yyDollar[1].token.Meta.SetTokenName(meta.EvalToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 511: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6676 + //line php5/php5.y:6838 { yyVAL.node = expr.NewRequire(yyDollar[2].node) @@ -9279,13 +9441,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.RequireToken) + yyDollar[1].token.Meta.SetTokenName(meta.RequireToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 512: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6688 + //line php5/php5.y:6850 { yyVAL.node = expr.NewRequireOnce(yyDollar[2].node) @@ -9293,13 +9455,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.RequireOnceToken) + yyDollar[1].token.Meta.SetTokenName(meta.RequireOnceToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 513: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6703 + //line php5/php5.y:6865 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -9307,18 +9469,18 @@ yydefault: } case 514: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6709 + //line php5/php5.y:6871 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.NodeEnd) + yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 515: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6721 + //line php5/php5.y:6883 { yyVAL.node = yyDollar[1].node @@ -9326,7 +9488,7 @@ yydefault: } case 516: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6727 + //line php5/php5.y:6889 { yyVAL.node = yyDollar[1].node @@ -9334,7 +9496,7 @@ yydefault: } case 517: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6736 + //line php5/php5.y:6898 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -9344,14 +9506,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.PaamayimNekudotayimToken) - addMeta(target, yyDollar[3].token.Meta, meta.IdentifierToken) + yyDollar[2].token.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(target.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 518: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6751 + //line php5/php5.y:6913 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -9361,14 +9523,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.PaamayimNekudotayimToken) - addMeta(target, yyDollar[3].token.Meta, meta.IdentifierToken) + yyDollar[2].token.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(target.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 519: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6769 + //line php5/php5.y:6931 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -9378,14 +9540,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.PaamayimNekudotayimToken) - addMeta(target, yyDollar[3].token.Meta, meta.IdentifierToken) + yyDollar[2].token.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(target.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 520: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6787 + //line php5/php5.y:6949 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -9395,8 +9557,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.PaamayimNekudotayimToken) - addMeta(target, yyDollar[3].token.Meta, meta.IdentifierToken) + yyDollar[2].token.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(target.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php5/php5.y b/php5/php5.y index a3b4084..9d8e7ae 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -285,7 +285,7 @@ start: yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) if yylex.(*Parser).currentToken.Value == "\xff" { - addMeta(yylex.(*Parser).rootNode, yylex.(*Parser).currentToken.Meta, meta.NodeEnd) + yylex.(*Parser).currentToken.Meta.SetTokenName(meta.NodeEnd).AppendTo(yylex.(*Parser).rootNode.GetMeta()) } } ; @@ -317,7 +317,7 @@ namespace_name: namePart.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta(namePart, $1.Meta, meta.StringToken) + $1.Meta.SetTokenName(meta.StringToken).AppendTo(namePart.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -330,8 +330,8 @@ namespace_name: namePart.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) // save comments - addMeta(lastNode($1), $2.Meta, meta.NsSeparatorToken) - addMeta(namePart, $3.Meta, meta.StringToken) + $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) + $3.Meta.SetTokenName(meta.StringToken).AppendTo(namePart.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -371,10 +371,11 @@ top_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - addMeta($$, $1.Meta, meta.HaltCompilerToken) - addMeta($$, $2.Meta, meta.OpenParenthesisToken) - addMeta($$, $3.Meta, meta.CloseParenthesisToken) - addMeta($$, $4.Meta, meta.SemiColonToken) + $1.Meta.SetTokenName(meta.HaltCompilerToken).AppendTo($$.GetMeta()) + $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) + $4.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $4, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -390,8 +391,9 @@ top_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - addMeta($$, $1.Meta, meta.NamespaceToken) - addMeta($$, $3.Meta, meta.SemiColonToken) + $1.Meta.SetTokenName(meta.NamespaceToken).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -405,9 +407,9 @@ top_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5)) // save comments - addMeta($$, $1.Meta, meta.NamespaceToken) - addMeta($$, $3.Meta, meta.OpenCurlyBracesToken) - addMeta($$, $5.Meta, meta.CloseCurlyBracesToken) + $1.Meta.SetTokenName(meta.NamespaceToken).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) + $5.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -419,9 +421,9 @@ top_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - addMeta($$, $1.Meta, meta.NamespaceToken) - addMeta($$, $2.Meta, meta.OpenCurlyBracesToken) - addMeta($$, $4.Meta, meta.CloseCurlyBracesToken) + $1.Meta.SetTokenName(meta.NamespaceToken).AppendTo($$.GetMeta()) + $2.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) + $4.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -433,8 +435,9 @@ top_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - addMeta($$, $1.Meta, meta.UseToken) - addMeta($$, $3.Meta, meta.SemiColonToken) + $1.Meta.SetTokenName(meta.UseToken).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -448,9 +451,10 @@ top_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - addMeta($$, $1.Meta, meta.UseToken) - addMeta(useType, $2.Meta, meta.IdentifierToken) - addMeta($$, $4.Meta, meta.SemiColonToken) + $1.Meta.SetTokenName(meta.UseToken).AppendTo($$.GetMeta()) + $2.Meta.SetTokenName(meta.IdentifierToken).AppendTo(useType.GetMeta()) + $4.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $4, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -464,9 +468,10 @@ top_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - addMeta($$, $1.Meta, meta.UseToken) - addMeta(useType, $2.Meta, meta.IdentifierToken) - addMeta($$, $4.Meta, meta.SemiColonToken) + $1.Meta.SetTokenName(meta.UseToken).AppendTo($$.GetMeta()) + $2.Meta.SetTokenName(meta.IdentifierToken).AppendTo(useType.GetMeta()) + $4.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $4, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -478,7 +483,8 @@ top_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) // save comments - addMeta($$, $2.Meta, meta.SemiColonToken) + $2.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $2, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -490,7 +496,7 @@ use_declarations: $$ = append($1, $3) // save comments - addMeta(lastNode($1), $2.Meta, meta.NodeEnd) + $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -526,8 +532,8 @@ use_declaration: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.AsToken) - addMeta(alias, $3.Meta, meta.IdentifierToken) + $2.Meta.SetTokenName(meta.AsToken).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.IdentifierToken).AppendTo(alias.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -541,7 +547,8 @@ use_declaration: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) // save comments - addMeta($$, $1.Meta, meta.NsSeparatorToken) + $1.Meta.SetTokenName(meta.UseLeadingNsSeparatorToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $1, meta.UseLeadingNsSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -557,9 +564,10 @@ use_declaration: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($2, $4)) // save comments - addMeta($$, $1.Meta, meta.NsSeparatorToken) - addMeta($$, $3.Meta, meta.AsToken) - addMeta(alias, $4.Meta, meta.IdentifierToken) + $1.Meta.SetTokenName(meta.UseLeadingNsSeparatorToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $1, meta.UseLeadingNsSeparatorToken) + $3.Meta.SetTokenName(meta.AsToken).AppendTo($$.GetMeta()) + $4.Meta.SetTokenName(meta.IdentifierToken).AppendTo(alias.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -571,7 +579,7 @@ use_function_declarations: $$ = append($1, $3) // save comments - addMeta(lastNode($1), $2.Meta, meta.NodeEnd) + $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -607,8 +615,8 @@ use_function_declaration: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.AsToken) - addMeta(alias, $3.Meta, meta.IdentifierToken) + $2.Meta.SetTokenName(meta.AsToken).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.IdentifierToken).AppendTo(alias.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -622,7 +630,8 @@ use_function_declaration: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) // save comments - addMeta($$, $1.Meta, meta.NsSeparatorToken) + $1.Meta.SetTokenName(meta.UseLeadingNsSeparatorToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $1, meta.UseLeadingNsSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -638,9 +647,10 @@ use_function_declaration: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($2, $4)) // save comments - addMeta($$, $1.Meta, meta.NsSeparatorToken) - addMeta($$, $3.Meta, meta.AsToken) - addMeta(alias, $4.Meta, meta.IdentifierToken) + $1.Meta.SetTokenName(meta.UseLeadingNsSeparatorToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $1, meta.UseLeadingNsSeparatorToken) + $3.Meta.SetTokenName(meta.AsToken).AppendTo($$.GetMeta()) + $4.Meta.SetTokenName(meta.IdentifierToken).AppendTo(alias.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -652,7 +662,7 @@ use_const_declarations: $$ = append($1, $3) // save comments - addMeta(lastNode($1), $2.Meta, meta.NodeEnd) + $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -688,8 +698,8 @@ use_const_declaration: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.AsToken) - addMeta(alias, $3.Meta, meta.IdentifierToken) + $2.Meta.SetTokenName(meta.AsToken).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.IdentifierToken).AppendTo(alias.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -703,7 +713,8 @@ use_const_declaration: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) // save comments - addMeta($$, $1.Meta, meta.NsSeparatorToken) + $1.Meta.SetTokenName(meta.UseLeadingNsSeparatorToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $1, meta.UseLeadingNsSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -719,9 +730,10 @@ use_const_declaration: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($2, $4)) // save comments - addMeta($$, $1.Meta, meta.NsSeparatorToken) - addMeta($$, $3.Meta, meta.AsToken) - addMeta(alias, $4.Meta, meta.IdentifierToken) + $1.Meta.SetTokenName(meta.UseLeadingNsSeparatorToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $1, meta.UseLeadingNsSeparatorToken) + $3.Meta.SetTokenName(meta.AsToken).AppendTo($$.GetMeta()) + $4.Meta.SetTokenName(meta.IdentifierToken).AppendTo(alias.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -733,6 +745,7 @@ constant_declaration: name := node.NewIdentifier($3.Value) constant := stmt.NewConstant(name, $5, "") constList := $1.(*stmt.ConstList) + lastConst := lastNode(constList.Consts) constList.Consts = append(constList.Consts, constant) $$ = $1 @@ -742,9 +755,9 @@ constant_declaration: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeNodeListPosition($1, constList.Consts)) // save comments - addMeta(lastNode(constList.Consts), $2.Meta, meta.CommaToken) - addMeta(name, $3.Meta, meta.IdentifierToken) - addMeta(constant, $4.Meta, meta.EqualToken) + $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastConst.GetMeta()) + $3.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + $4.Meta.SetTokenName(meta.EqualToken).AppendTo(constant.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -761,9 +774,9 @@ constant_declaration: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, constList)) // save comments - addMeta($$, $1.Meta, meta.ConstToken) - addMeta(name, $2.Meta, meta.IdentifierToken) - addMeta(constant, $3.Meta, meta.EqualToken) + $1.Meta.SetTokenName(meta.ConstToken).AppendTo($$.GetMeta()) + $2.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + $3.Meta.SetTokenName(meta.EqualToken).AppendTo(constant.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -821,10 +834,11 @@ inner_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - addMeta($$, $1.Meta, meta.HaltCompilerToken) - addMeta($$, $2.Meta, meta.OpenParenthesisToken) - addMeta($$, $3.Meta, meta.CloseParenthesisToken) - addMeta($$, $4.Meta, meta.SemiColonToken) + $1.Meta.SetTokenName(meta.HaltCompilerToken).AppendTo($$.GetMeta()) + $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) + $4.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $4, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -848,8 +862,8 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - addMeta(label, $1.Meta, meta.IdentifierToken) - addMeta($$, $2.Meta, meta.ColonToken) + $1.Meta.SetTokenName(meta.IdentifierToken).AppendTo(label.GetMeta()) + $2.Meta.SetTokenName(meta.ColonToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -864,8 +878,8 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - addMeta($$, $1.Meta, meta.OpenCurlyBracesToken) - addMeta($$, $3.Meta, meta.CloseCurlyBracesToken) + $1.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -883,7 +897,9 @@ unticked_statement: } // save comments - addMeta($$, $1.Meta, meta.IfToken) + $1.Meta.SetTokenName(meta.IfToken).AppendTo($$.GetMeta()) + $2.GetMeta().Cut(meta.TokenNameFilter(meta.OpenParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo($$.GetMeta()) + $2.GetMeta().Cut(meta.TokenNameFilter(meta.CloseParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -897,10 +913,13 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $8)) // save comments - addMeta($$, $1.Meta, meta.IfToken) - addMeta($$, $3.Meta, meta.ColonToken) - addMeta($$, $7.Meta, meta.EndifToken) - addMeta($$, $8.Meta, meta.SemiColonToken) + $1.Meta.SetTokenName(meta.IfToken).AppendTo($$.GetMeta()) + $2.GetMeta().Cut(meta.TokenNameFilter(meta.OpenParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo($$.GetMeta()) + $2.GetMeta().Cut(meta.TokenNameFilter(meta.CloseParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.ColonToken).AppendTo($$.GetMeta()) + $7.Meta.SetTokenName(meta.EndifToken).AppendTo($$.GetMeta()) + $8.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $8, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -919,7 +938,9 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) // save comments - addMeta($$, $1.Meta, meta.WhileToken) + $1.Meta.SetTokenName(meta.WhileToken).AppendTo($$.GetMeta()) + $2.GetMeta().Cut(meta.TokenNameFilter(meta.OpenParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo($$.GetMeta()) + $2.GetMeta().Cut(meta.TokenNameFilter(meta.CloseParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -931,9 +952,12 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5)) // save comments - addMeta($$, $1.Meta, meta.DoToken) - addMeta($$, $3.Meta, meta.WhileToken) - addMeta($$, $5.Meta, meta.SemiColonToken) + $1.Meta.SetTokenName(meta.DoToken).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.WhileToken).AppendTo($$.GetMeta()) + $4.GetMeta().Cut(meta.TokenNameFilter(meta.OpenParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo($$.GetMeta()) + $4.GetMeta().Cut(meta.TokenNameFilter(meta.CloseParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo($$.GetMeta()) + $5.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $5, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -956,11 +980,11 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $9)) // save comments - addMeta($$, $1.Meta, meta.ForToken) - addMeta($$, $2.Meta, meta.OpenParenthesisToken) - addMeta($$, $4.Meta, meta.ForInitSemicolonToken) - addMeta($$, $6.Meta, meta.ForCondSemicolonToken) - addMeta($$, $8.Meta, meta.CloseParenthesisToken) + $1.Meta.SetTokenName(meta.ForToken).AppendTo($$.GetMeta()) + $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) + $4.Meta.SetTokenName(meta.ForInitSemicolonToken).AppendTo($$.GetMeta()) + $6.Meta.SetTokenName(meta.ForCondSemicolonToken).AppendTo($$.GetMeta()) + $8.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -981,7 +1005,9 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) // save comments - addMeta($$, $1.Meta, meta.SwitchToken) + $1.Meta.SetTokenName(meta.SwitchToken).AppendTo($$.GetMeta()) + $2.GetMeta().Cut(meta.TokenNameFilter(meta.OpenParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo($$.GetMeta()) + $2.GetMeta().Cut(meta.TokenNameFilter(meta.CloseParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -993,8 +1019,9 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - addMeta($$, $1.Meta, meta.BreakToken) - addMeta($$, $2.Meta, meta.SemiColonToken) + $1.Meta.SetTokenName(meta.BreakToken).AppendTo($$.GetMeta()) + $2.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $2, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1006,8 +1033,9 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - addMeta($$, $1.Meta, meta.BreakToken) - addMeta($$, $3.Meta, meta.SemiColonToken) + $1.Meta.SetTokenName(meta.BreakToken).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1019,8 +1047,9 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - addMeta($$, $1.Meta, meta.ContinueToken) - addMeta($$, $2.Meta, meta.SemiColonToken) + $1.Meta.SetTokenName(meta.ContinueToken).AppendTo($$.GetMeta()) + $2.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $2, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1032,8 +1061,9 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - addMeta($$, $1.Meta, meta.ContinueToken) - addMeta($$, $3.Meta, meta.SemiColonToken) + $1.Meta.SetTokenName(meta.ContinueToken).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1045,8 +1075,9 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - addMeta($$, $1.Meta, meta.ReturnToken) - addMeta($$, $2.Meta, meta.SemiColonToken) + $1.Meta.SetTokenName(meta.ReturnToken).AppendTo($$.GetMeta()) + $2.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $2, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1058,8 +1089,9 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - addMeta($$, $1.Meta, meta.ReturnToken) - addMeta($$, $3.Meta, meta.SemiColonToken) + $1.Meta.SetTokenName(meta.ReturnToken).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1071,8 +1103,9 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - addMeta($$, $1.Meta, meta.ReturnToken) - addMeta($$, $3.Meta, meta.SemiColonToken) + $1.Meta.SetTokenName(meta.ReturnToken).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1084,7 +1117,8 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) // save comments - addMeta($$, $2.Meta, meta.SemiColonToken) + $2.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $2, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1096,8 +1130,9 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - addMeta($$, $1.Meta, meta.GlobalToken) - addMeta($$, $3.Meta, meta.SemiColonToken) + $1.Meta.SetTokenName(meta.GlobalToken).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1109,8 +1144,9 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - addMeta($$, $1.Meta, meta.StaticToken) - addMeta($$, $3.Meta, meta.SemiColonToken) + $1.Meta.SetTokenName(meta.StaticToken).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1122,8 +1158,10 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - addMeta($$, $1.Meta, meta.EchoToken) - addMeta($$, $3.Meta, meta.SemiColonToken) + $1.Meta.SetTokenName(meta.EchoToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $1, meta.EchoToken) + $3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1135,7 +1173,7 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.InlineHTMLToken) + $1.Meta.SetTokenName(meta.InlineHTMLToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1147,7 +1185,8 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) // save comments - addMeta($$, $2.Meta, meta.SemiColonToken) + $2.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $2, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1159,10 +1198,11 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5)) // save comments - addMeta($$, $1.Meta, meta.UnsetToken) - addMeta($$, $2.Meta, meta.OpenParenthesisToken) - addMeta($$, $4.Meta, meta.CloseParenthesisToken) - addMeta($$, $5.Meta, meta.SemiColonToken) + $1.Meta.SetTokenName(meta.UnsetToken).AppendTo($$.GetMeta()) + $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) + $4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) + $5.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $5, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1196,10 +1236,13 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $8)) // save comments - addMeta($$, $1.Meta, meta.ForeachToken) - addMeta($$, $2.Meta, meta.OpenParenthesisToken) - addMeta($$, $4.Meta, meta.AsToken) - addMeta($$, $7.Meta, meta.CloseParenthesisToken) + $1.Meta.SetTokenName(meta.ForeachToken).AppendTo($$.GetMeta()) + $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) + $4.Meta.SetTokenName(meta.AsToken).AppendTo($$.GetMeta()) + if $6 != nil { + $6.GetMeta().Cut(meta.TokenNameFilter(meta.DoubleArrowToken)).AppendTo($$.GetMeta()) + } + $7.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1233,24 +1276,28 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $8)) // save comments - addMeta($$, $1.Meta, meta.ForeachToken) - addMeta($$, $2.Meta, meta.OpenParenthesisToken) - addMeta($$, $4.Meta, meta.AsToken) - addMeta($$, $7.Meta, meta.CloseParenthesisToken) + $1.Meta.SetTokenName(meta.ForeachToken).AppendTo($$.GetMeta()) + $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) + $4.Meta.SetTokenName(meta.AsToken).AppendTo($$.GetMeta()) + if $6 != nil { + $6.GetMeta().Cut(meta.TokenNameFilter(meta.DoubleArrowToken)).AppendTo($$.GetMeta()) + } + $7.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_DECLARE '(' declare_list ')' declare_statement { - $$ = stmt.NewDeclare($3, $5) + $$ = $5 + $$.(*stmt.Declare).Consts = $3 // save position $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5)) // save comments - addMeta($$, $1.Meta, meta.DeclareToken) - addMeta($$, $2.Meta, meta.OpenParenthesisToken) - addMeta($$, $4.Meta, meta.CloseParenthesisToken) + $1.Meta.SetTokenName(meta.DeclareToken).AppendTo($$.GetMeta()) + $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) + $4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1262,7 +1309,8 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.SemiColonToken) + $1.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $1, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1278,9 +1326,9 @@ unticked_statement: } // save comments - addMeta($$, $1.Meta, meta.TryToken) - addMeta($$, $2.Meta, meta.OpenCurlyBracesToken) - addMeta($$, $4.Meta, meta.CloseCurlyBracesToken) + $1.Meta.SetTokenName(meta.TryToken).AppendTo($$.GetMeta()) + $2.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) + $4.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1292,8 +1340,9 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - addMeta($$, $1.Meta, meta.ThrowToken) - addMeta($$, $3.Meta, meta.SemiColonToken) + $1.Meta.SetTokenName(meta.ThrowToken).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1307,9 +1356,10 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - addMeta($$, $1.Meta, meta.GotoToken) - addMeta(label, $2.Meta, meta.IdentifierToken) - addMeta($$, $3.Meta, meta.SemiColonToken) + $1.Meta.SetTokenName(meta.GotoToken).AppendTo($$.GetMeta()) + $2.Meta.SetTokenName(meta.IdentifierToken).AppendTo(label.GetMeta()) + $3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1335,12 +1385,12 @@ catch_statement: catch.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $8)) // save comments - addMeta(catch, $1.Meta, meta.CatchToken) - addMeta(catch, $2.Meta, meta.OpenParenthesisToken) - addMeta(variable, $4.Meta, meta.VariableToken) - addMeta(catch, $5.Meta, meta.CloseParenthesisToken) - addMeta(catch, $6.Meta, meta.OpenCurlyBracesToken) - addMeta(catch, $8.Meta, meta.CloseCurlyBracesToken) + $1.Meta.SetTokenName(meta.CatchToken).AppendTo(catch.GetMeta()) + $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(catch.GetMeta()) + $4.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) + $5.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(catch.GetMeta()) + $6.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(catch.GetMeta()) + $8.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(catch.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1361,9 +1411,9 @@ finally_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - addMeta($$, $1.Meta, meta.FinallyToken) - addMeta($$, $2.Meta, meta.OpenCurlyBracesToken) - addMeta($$, $4.Meta, meta.CloseCurlyBracesToken) + $1.Meta.SetTokenName(meta.FinallyToken).AppendTo($$.GetMeta()) + $2.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) + $4.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1412,12 +1462,12 @@ additional_catch: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $8)) // save comments - addMeta($$, $1.Meta, meta.CatchToken) - addMeta($$, $2.Meta, meta.OpenParenthesisToken) - addMeta(variable, $4.Meta, meta.VariableToken) - addMeta($$, $5.Meta, meta.CloseParenthesisToken) - addMeta($$, $6.Meta, meta.OpenCurlyBracesToken) - addMeta($$, $8.Meta, meta.CloseCurlyBracesToken) + $1.Meta.SetTokenName(meta.CatchToken).AppendTo($$.GetMeta()) + $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) + $4.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) + $5.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) + $6.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) + $8.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1435,7 +1485,7 @@ unset_variables: $$ = append($1, $3) // save comments - addMeta(lastNode($1), $2.Meta, meta.NodeEnd) + $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1501,15 +1551,15 @@ unticked_function_declaration_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $9)) // save comments - addMeta($$, $1.Meta, meta.FunctionToken) + $1.Meta.SetTokenName(meta.FunctionToken).AppendTo($$.GetMeta()) if $2 != nil { - addMeta($$, $2.Meta, meta.AmpersandToken) + $2.Meta.SetTokenName(meta.AmpersandToken).AppendTo($$.GetMeta()) } - addMeta(name, $3.Meta, meta.IdentifierToken) - addMeta($$, $4.Meta, meta.OpenParenthesisToken) - addMeta($$, $6.Meta, meta.CloseParenthesisToken) - addMeta($$, $7.Meta, meta.OpenCurlyBracesToken) - addMeta($$, $9.Meta, meta.CloseCurlyBracesToken) + $3.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + $4.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) + $6.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) + $7.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) + $9.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1538,9 +1588,9 @@ unticked_class_declaration_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $7)) // save comments - addMeta(name, $2.Meta, meta.IdentifierToken) - addMeta($$, $5.Meta, meta.OpenCurlyBracesToken) - addMeta($$, $7.Meta, meta.CloseCurlyBracesToken) + $2.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + $5.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) + $7.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1554,9 +1604,10 @@ unticked_class_declaration_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $6)) // save comments - addMeta(name, $2.Meta, meta.IdentifierToken) - addMeta($$, $4.Meta, meta.OpenCurlyBracesToken) - addMeta($$, $6.Meta, meta.CloseCurlyBracesToken) + $1.Meta.SetTokenName(meta.InterfaceToken).AppendTo($$.GetMeta()) + $2.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + $4.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) + $6.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1572,7 +1623,7 @@ class_entry_type: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.ClassToken) + $1.Meta.SetTokenName(meta.ClassToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1586,8 +1637,8 @@ class_entry_type: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - addMeta(classModifier, $1.Meta, meta.IdentifierToken) - addMeta($$, $2.Meta, meta.ClassToken) + $1.Meta.SetTokenName(meta.IdentifierToken).AppendTo(classModifier.GetMeta()) + $2.Meta.SetTokenName(meta.ClassToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1599,7 +1650,7 @@ class_entry_type: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.TraitToken) + $1.Meta.SetTokenName(meta.TraitToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1613,8 +1664,8 @@ class_entry_type: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - addMeta(classModifier, $1.Meta, meta.IdentifierToken) - addMeta($$, $2.Meta, meta.ClassToken) + $1.Meta.SetTokenName(meta.IdentifierToken).AppendTo(classModifier.GetMeta()) + $2.Meta.SetTokenName(meta.ClassToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1635,7 +1686,7 @@ extends_from: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - addMeta($$, $1.Meta, meta.ExtendsToken) + $1.Meta.SetTokenName(meta.ExtendsToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1663,7 +1714,7 @@ interface_extends_list: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) // save comments - addMeta($$, $1.Meta, meta.ExtendsToken) + $1.Meta.SetTokenName(meta.ExtendsToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1684,7 +1735,7 @@ implements_list: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) // save comments - addMeta($$, $1.Meta, meta.ImplementsToken) + $1.Meta.SetTokenName(meta.ImplementsToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1702,7 +1753,7 @@ interface_list: $$ = append($1, $3) // save comments - addMeta(lastNode($1), $2.Meta, meta.NodeEnd) + $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1720,7 +1771,7 @@ foreach_optional_arg: $$ = $2 // save comments - addMeta($$, $1.Meta, meta.DoubleArrowToken) + $1.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1741,7 +1792,7 @@ foreach_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - addMeta($$, $1.Meta, meta.AmpersandToken) + $1.Meta.SetTokenName(meta.AmpersandToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1753,9 +1804,9 @@ foreach_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - addMeta($$, $1.Meta, meta.ListToken) - addMeta($$, $2.Meta, meta.OpenParenthesisToken) - addMeta($$, $4.Meta, meta.CloseParenthesisToken) + $1.Meta.SetTokenName(meta.ListToken).AppendTo($$.GetMeta()) + $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) + $4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1781,9 +1832,10 @@ for_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - addMeta($$, $1.Meta, meta.ColonToken) - addMeta($$, $3.Meta, meta.EndforToken) - addMeta($$, $4.Meta, meta.SemiColonToken) + $1.Meta.SetTokenName(meta.ColonToken).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.EndforToken).AppendTo($$.GetMeta()) + $4.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $4, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1809,9 +1861,10 @@ foreach_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - addMeta($$, $1.Meta, meta.ColonToken) - addMeta($$, $3.Meta, meta.EndforeachToken) - addMeta($$, $4.Meta, meta.SemiColonToken) + $1.Meta.SetTokenName(meta.ColonToken).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.EndforeachToken).AppendTo($$.GetMeta()) + $4.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $4, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1821,21 +1874,27 @@ foreach_statement: declare_statement: statement { - $$ = $1; + $$ = stmt.NewDeclare(nil, $1, false) + + // save position + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | ':' inner_statement_list T_ENDDECLARE ';' { - $$ = stmt.NewStmtList($2) + stmtList := stmt.NewStmtList($2) + $$ = stmt.NewDeclare(nil, stmtList, true) // save position + stmtList.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - addMeta($$, $1.Meta, meta.ColonToken) - addMeta($$, $3.Meta, meta.EnddeclareToken) - addMeta($$, $4.Meta, meta.SemiColonToken) + $1.Meta.SetTokenName(meta.ColonToken).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.EnddeclareToken).AppendTo($$.GetMeta()) + $4.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $4, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1854,8 +1913,8 @@ declare_list: constant.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) // save comments - addMeta(name, $1.Meta, meta.IdentifierToken) - addMeta(constant, $2.Meta, meta.EqualToken) + $1.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + $2.Meta.SetTokenName(meta.EqualToken).AppendTo(constant.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1870,9 +1929,9 @@ declare_list: constant.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $5)) // save comments - addMeta(lastNode($1), $2.Meta, meta.CommaToken) - addMeta(name, $3.Meta, meta.IdentifierToken) - addMeta(constant, $4.Meta, meta.EqualToken) + $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) + $3.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + $4.Meta.SetTokenName(meta.EqualToken).AppendTo(constant.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1890,8 +1949,8 @@ switch_case_list: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - addMeta(caseList, $1.Meta, meta.OpenCurlyBracesToken) - addMeta(caseList, $3.Meta, meta.CloseCurlyBracesToken) + $1.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(caseList.GetMeta()) + $3.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(caseList.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1905,9 +1964,10 @@ switch_case_list: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - addMeta(caseList, $1.Meta, meta.OpenCurlyBracesToken) - addMeta(caseList, $2.Meta, meta.SemiColonToken) - addMeta(caseList, $4.Meta, meta.CloseCurlyBracesToken) + $1.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(caseList.GetMeta()) + $2.Meta.SetTokenName(meta.CaseSeparatorToken).AppendTo(caseList.GetMeta()) + yylex.(*Parser).appendMetaToken(caseList, $2, meta.CaseSeparatorToken) + $4.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(caseList.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1921,9 +1981,10 @@ switch_case_list: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - addMeta($$, $1.Meta, meta.ColonToken) - addMeta($$, $3.Meta, meta.EndswitchToken) - addMeta($$, $4.Meta, meta.SemiColonToken) + $1.Meta.SetTokenName(meta.ColonToken).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.EndswitchToken).AppendTo($$.GetMeta()) + $4.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $4, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1938,10 +1999,12 @@ switch_case_list: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5)) // save comments - addMeta($$, $1.Meta, meta.ColonToken) - addMeta($$, $2.Meta, meta.SwitchSemicolonToken) - addMeta($$, $4.Meta, meta.EndswitchToken) - addMeta($$, $5.Meta, meta.SemiColonToken) + $1.Meta.SetTokenName(meta.ColonToken).AppendTo($$.GetMeta()) + $2.Meta.SetTokenName(meta.CaseSeparatorToken).AppendTo(caseList.GetMeta()) + yylex.(*Parser).appendMetaToken(caseList, $2, meta.CaseSeparatorToken) + $4.Meta.SetTokenName(meta.EndswitchToken).AppendTo($$.GetMeta()) + $5.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $5, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1964,8 +2027,9 @@ case_list: _case.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $5)) // save comments - addMeta(_case, $2.Meta, meta.CaseToken) - addMeta(_case, $4.Meta, meta.CaseSeparatorToken) + $2.Meta.SetTokenName(meta.CaseToken).AppendTo(_case.GetMeta()) + $4.Meta.SetTokenName(meta.CaseSeparatorToken).AppendTo(_case.GetMeta()) + yylex.(*Parser).appendMetaToken(_case, $4, meta.CaseSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1978,8 +2042,9 @@ case_list: _default.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $4)) // save comments - addMeta(_default, $2.Meta, meta.DefaultToken) - addMeta(_default, $3.Meta, meta.CaseSeparatorToken) + $2.Meta.SetTokenName(meta.DefaultToken).AppendTo(_default.GetMeta()) + $3.Meta.SetTokenName(meta.CaseSeparatorToken).AppendTo(_default.GetMeta()) + yylex.(*Parser).appendMetaToken(_default, $3, meta.CaseSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2018,9 +2083,10 @@ while_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - addMeta($$, $1.Meta, meta.ColonToken) - addMeta($$, $3.Meta, meta.EndwhileToken) - addMeta($$, $4.Meta, meta.SemiColonToken) + $1.Meta.SetTokenName(meta.ColonToken).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.EndwhileToken).AppendTo($$.GetMeta()) + $4.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $4, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2044,7 +2110,9 @@ elseif_list: _elseIf.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $4)) // save comments - addMeta(_elseIf, $2.Meta, meta.ElseifToken) + $2.Meta.SetTokenName(meta.ElseifToken).AppendTo(_elseIf.GetMeta()) + $3.GetMeta().Cut(meta.TokenNameFilter(meta.OpenParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo(_elseIf.GetMeta()) + $3.GetMeta().Cut(meta.TokenNameFilter(meta.CloseParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo(_elseIf.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2069,8 +2137,10 @@ new_elseif_list: _elseIf.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $5)) // save comments - addMeta(_elseIf, $2.Meta, meta.ElseifToken) - addMeta(_elseIf, $4.Meta, meta.ColonToken) + $2.Meta.SetTokenName(meta.ElseifToken).AppendTo(_elseIf.GetMeta()) + $3.GetMeta().Cut(meta.TokenNameFilter(meta.OpenParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo(_elseIf.GetMeta()) + $3.GetMeta().Cut(meta.TokenNameFilter(meta.CloseParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo(_elseIf.GetMeta()) + $4.Meta.SetTokenName(meta.ColonToken).AppendTo(_elseIf.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2092,7 +2162,7 @@ else_single: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - addMeta($$, $1.Meta, meta.ElseToken) + $1.Meta.SetTokenName(meta.ElseToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2116,8 +2186,8 @@ new_else_single: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3)) // save comments - addMeta($$, $1.Meta, meta.ElseToken) - addMeta($$, $2.Meta, meta.ColonToken) + $1.Meta.SetTokenName(meta.ElseToken).AppendTo($$.GetMeta()) + $2.Meta.SetTokenName(meta.ColonToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2151,7 +2221,7 @@ non_empty_parameter_list: $$ = append($1, $3) // save comments - addMeta(lastNode($1), $2.Meta, meta.NodeEnd) + $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2179,12 +2249,12 @@ parameter: // save comments if $2 != nil { - addMeta($$, $2.Meta, meta.AmpersandToken) + $2.Meta.SetTokenName(meta.AmpersandToken).AppendTo($$.GetMeta()) } if $3 != nil { - addMeta($$, $3.Meta, meta.EllipsisToken) + $3.Meta.SetTokenName(meta.EllipsisToken).AppendTo($$.GetMeta()) } - addMeta(variable, $4.Meta, meta.VariableToken) + $4.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2209,13 +2279,13 @@ parameter: // save comments if $2 != nil { - addMeta($$, $2.Meta, meta.AmpersandToken) + $2.Meta.SetTokenName(meta.AmpersandToken).AppendTo($$.GetMeta()) } if $3 != nil { - addMeta($$, $3.Meta, meta.EllipsisToken) + $3.Meta.SetTokenName(meta.EllipsisToken).AppendTo($$.GetMeta()) } - addMeta(variable, $4.Meta, meta.VariableToken) - addMeta($$, $5.Meta, meta.EqualToken) + $4.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) + $5.Meta.SetTokenName(meta.EqualToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2237,7 +2307,7 @@ optional_class_type: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.IdentifierToken) + $1.Meta.SetTokenName(meta.IdentifierToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2249,7 +2319,7 @@ optional_class_type: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.IdentifierToken) + $1.Meta.SetTokenName(meta.IdentifierToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2271,8 +2341,8 @@ function_call_parameter_list: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - addMeta($$, $1.Meta, meta.OpenParenthesisToken) - addMeta($$, $2.Meta, meta.CloseParenthesisToken) + $1.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) + $2.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2284,8 +2354,8 @@ function_call_parameter_list: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - addMeta($$, $1.Meta, meta.OpenParenthesisToken) - addMeta($$, $3.Meta, meta.CloseParenthesisToken) + $1.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2299,8 +2369,8 @@ function_call_parameter_list: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - addMeta($$, $1.Meta, meta.OpenParenthesisToken) - addMeta($$, $3.Meta, meta.CloseParenthesisToken) + $1.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2319,7 +2389,7 @@ non_empty_function_call_parameter_list: $$ = append($1, $3) // save comments - addMeta(lastNode($1), $2.Meta, meta.NodeEnd) + $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2352,7 +2422,7 @@ function_call_parameter: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($2)) // save comments - addMeta($$, $1.Meta, meta.AmpersandToken) + $1.Meta.SetTokenName(meta.AmpersandToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2364,7 +2434,7 @@ function_call_parameter: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - addMeta($$, $1.Meta, meta.EllipsisToken) + $1.Meta.SetTokenName(meta.EllipsisToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2376,7 +2446,7 @@ global_var_list: $$ = append($1, $3) // save comments - addMeta(lastNode($1), $2.Meta, meta.NodeEnd) + $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2400,7 +2470,7 @@ global_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.VariableToken) + $1.Meta.SetTokenName(meta.VariableToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2412,7 +2482,7 @@ global_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - addMeta($$, $1.Meta, meta.DollarToken) + $1.Meta.SetTokenName(meta.DollarToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2424,9 +2494,9 @@ global_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - addMeta($$, $1.Meta, meta.DollarToken) - addMeta($$, $2.Meta, meta.OpenCurlyBracesToken) - addMeta($$, $4.Meta, meta.CloseCurlyBracesToken) + $1.Meta.SetTokenName(meta.DollarToken).AppendTo($$.GetMeta()) + $2.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) + $4.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2447,8 +2517,8 @@ static_var_list: staticVar.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) // save comments - addMeta(lastNode($1), $2.Meta, meta.CommaToken) - addMeta(variable, $3.Meta, meta.VariableToken) + $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) + $3.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2465,9 +2535,9 @@ static_var_list: staticVar.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $5)) // save comments - addMeta(lastNode($1), $2.Meta, meta.CommaToken) - addMeta(variable, $3.Meta, meta.VariableToken) - addMeta(staticVar, $4.Meta, meta.EqualToken) + $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) + $3.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) + $4.Meta.SetTokenName(meta.EqualToken).AppendTo(staticVar.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2484,7 +2554,7 @@ static_var_list: staticVar.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta(variable, $1.Meta, meta.VariableToken) + $1.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2501,8 +2571,8 @@ static_var_list: staticVar.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) // save comments - addMeta(variable, $1.Meta, meta.VariableToken) - addMeta(staticVar, $2.Meta, meta.EqualToken) + $1.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) + $2.Meta.SetTokenName(meta.EqualToken).AppendTo(staticVar.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2534,7 +2604,8 @@ class_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $3)) // save comments - addMeta($$, $3.Meta, meta.SemiColonToken) + $3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2546,7 +2617,8 @@ class_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) // save comments - addMeta($$, $2.Meta, meta.SemiColonToken) + $2.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $2, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2570,13 +2642,13 @@ class_statement: } // save comments - addMeta($$, $2.Meta, meta.FunctionToken) + $2.Meta.SetTokenName(meta.FunctionToken).AppendTo($$.GetMeta()) if $3 != nil { - addMeta($$, $3.Meta, meta.AmpersandToken) + $3.Meta.SetTokenName(meta.AmpersandToken).AppendTo($$.GetMeta()) } - addMeta(name, $4.Meta, meta.IdentifierToken) - addMeta($$, $5.Meta, meta.OpenParenthesisToken) - addMeta($$, $7.Meta, meta.CloseParenthesisToken) + $4.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + $5.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) + $7.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2591,7 +2663,7 @@ trait_use_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) // save comments - addMeta($$, $1.Meta, meta.UseToken) + $1.Meta.SetTokenName(meta.UseToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2609,7 +2681,7 @@ trait_list: $$ = append($1, $3) // save comments - addMeta(lastNode($1), $2.Meta, meta.NodeEnd) + $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2623,7 +2695,8 @@ trait_adaptations: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.SemiColonToken) + $1.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $1, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -2635,8 +2708,8 @@ trait_adaptations: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - addMeta($$, $1.Meta, meta.OpenCurlyBracesToken) - addMeta($$, $3.Meta, meta.CloseCurlyBracesToken) + $1.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2678,7 +2751,8 @@ trait_adaptation_statement: $$ = $1; // save comments - addMeta($$, $2.Meta, meta.SemiColonToken) + $2.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $2, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2687,7 +2761,8 @@ trait_adaptation_statement: $$ = $1; // save comments - addMeta($$, $2.Meta, meta.SemiColonToken) + $2.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $2, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2702,7 +2777,7 @@ trait_precedence: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeNodeListPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.InsteadofToken) + $2.Meta.SetTokenName(meta.InsteadofToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2720,7 +2795,7 @@ trait_reference_list: $$ = append($1, $3) // save comments - addMeta(lastNode($1), $2.Meta, meta.NodeEnd) + $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2737,7 +2812,7 @@ trait_method_reference: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta(name, $1.Meta, meta.IdentifierToken) + $1.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2760,8 +2835,8 @@ trait_method_reference_fully_qualified: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.PaamayimNekudotayimToken) - addMeta(target, $3.Meta, meta.IdentifierToken) + $2.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.IdentifierToken).AppendTo(target.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2778,8 +2853,8 @@ trait_alias: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments - addMeta($$, $2.Meta, meta.AsToken) - addMeta(alias, $4.Meta, meta.IdentifierToken) + $2.Meta.SetTokenName(meta.AsToken).AppendTo($$.GetMeta()) + $4.Meta.SetTokenName(meta.IdentifierToken).AppendTo(alias.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2791,7 +2866,7 @@ trait_alias: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.AsToken) + $2.Meta.SetTokenName(meta.AsToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2821,7 +2896,8 @@ method_body: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.SemiColonToken) + $1.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $1, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2833,8 +2909,8 @@ method_body: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - addMeta($$, $1.Meta, meta.OpenCurlyBracesToken) - addMeta($$, $3.Meta, meta.CloseCurlyBracesToken) + $1.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2856,7 +2932,7 @@ variable_modifiers: modifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta(modifier, $1.Meta, meta.IdentifierToken) + $1.Meta.SetTokenName(meta.IdentifierToken).AppendTo(modifier.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2901,7 +2977,7 @@ member_modifier: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.IdentifierToken) + $1.Meta.SetTokenName(meta.IdentifierToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2913,7 +2989,7 @@ member_modifier: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.IdentifierToken) + $1.Meta.SetTokenName(meta.IdentifierToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2925,7 +3001,7 @@ member_modifier: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.IdentifierToken) + $1.Meta.SetTokenName(meta.IdentifierToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2937,7 +3013,7 @@ member_modifier: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.IdentifierToken) + $1.Meta.SetTokenName(meta.IdentifierToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2949,7 +3025,7 @@ member_modifier: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.IdentifierToken) + $1.Meta.SetTokenName(meta.IdentifierToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2961,7 +3037,7 @@ member_modifier: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.IdentifierToken) + $1.Meta.SetTokenName(meta.IdentifierToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2981,8 +3057,8 @@ class_variable_declaration: property.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) // save comments - addMeta(lastNode($1), $2.Meta, meta.CommaToken) - addMeta(variable, $3.Meta, meta.VariableToken) + $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) + $3.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2999,9 +3075,9 @@ class_variable_declaration: property.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $5)) // save comments - addMeta(lastNode($1), $2.Meta, meta.CommaToken) - addMeta(variable, $3.Meta, meta.VariableToken) - addMeta(property, $4.Meta, meta.EqualToken) + $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) + $3.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) + $4.Meta.SetTokenName(meta.EqualToken).AppendTo(property.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3018,7 +3094,7 @@ class_variable_declaration: property.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta(variable, $1.Meta, meta.VariableToken) + $1.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3035,8 +3111,8 @@ class_variable_declaration: property.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) // save comments - addMeta(variable, $1.Meta, meta.VariableToken) - addMeta(property, $2.Meta, meta.EqualToken) + $1.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) + $2.Meta.SetTokenName(meta.EqualToken).AppendTo(property.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3048,6 +3124,7 @@ class_constant_declaration: name := node.NewIdentifier($3.Value) constant := stmt.NewConstant(name, $5, "") constList := $1.(*stmt.ClassConstList) + lastConst := lastNode(constList.Consts) constList.Consts = append(constList.Consts, constant) $$ = $1 @@ -3057,9 +3134,9 @@ class_constant_declaration: $1.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $5)) // save comments - addMeta(lastNode(constList.Consts), $2.Meta, meta.CommaToken) - addMeta(name, $3.Meta, meta.IdentifierToken) - addMeta(constant, $4.Meta, meta.EqualToken) + $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastConst.GetMeta()) + $3.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + $4.Meta.SetTokenName(meta.EqualToken).AppendTo(constant.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3075,9 +3152,9 @@ class_constant_declaration: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $4)) // save comments - addMeta($$, $1.Meta, meta.ConstToken) - addMeta(name, $2.Meta, meta.IdentifierToken) - addMeta(constant, $3.Meta, meta.EqualToken) + $1.Meta.SetTokenName(meta.ConstToken).AppendTo($$.GetMeta()) + $2.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + $3.Meta.SetTokenName(meta.EqualToken).AppendTo(constant.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3089,7 +3166,7 @@ echo_expr_list: $$ = append($1, $3) // save comments - addMeta(lastNode($1), $2.Meta, meta.NodeEnd) + $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3123,7 +3200,7 @@ non_empty_for_expr: $$ = append($1, $3) // save comments - addMeta(lastNode($1), $2.Meta, meta.NodeEnd) + $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3160,8 +3237,10 @@ chaining_dereference: fetch.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($3)) // save comments - addMeta(fetch, $2.Meta, meta.OpenSquareBracket) - addMeta(fetch, $4.Meta, meta.CloseSquareBracket) + $2.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo(fetch.GetMeta()) + yylex.(*Parser).appendMetaToken(fetch, $2, meta.OpenSquareBracket) + $4.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(fetch.GetMeta()) + yylex.(*Parser).appendMetaToken(fetch, $4, meta.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3174,8 +3253,10 @@ chaining_dereference: fetch.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($2)) // save comments - addMeta(fetch, $1.Meta, meta.OpenSquareBracket) - addMeta(fetch, $3.Meta, meta.CloseSquareBracket) + $1.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo(fetch.GetMeta()) + yylex.(*Parser).appendMetaToken(fetch, $1, meta.OpenSquareBracket) + $3.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(fetch.GetMeta()) + yylex.(*Parser).appendMetaToken(fetch, $3, meta.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3230,7 +3311,7 @@ new_expr: } // save comments - addMeta($$, $1.Meta, meta.NewToken) + $1.Meta.SetTokenName(meta.NewAnchor).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3247,10 +3328,10 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $6)) // save comments - addMeta(list, $1.Meta, meta.ListToken) - addMeta(list, $2.Meta, meta.OpenParenthesisToken) - addMeta(list, $4.Meta, meta.CloseParenthesisToken) - addMeta($$, $5.Meta, meta.EqualToken) + $1.Meta.SetTokenName(meta.ListToken).AppendTo(list.GetMeta()) + $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(list.GetMeta()) + $4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(list.GetMeta()) + $5.Meta.SetTokenName(meta.EqualToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3262,7 +3343,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.EqualToken) + $2.Meta.SetTokenName(meta.EqualToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3274,8 +3355,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) // save comments - addMeta($$, $2.Meta, meta.EqualToken) - addMeta($$, $3.Meta, meta.AmpersandToken) + $2.Meta.SetTokenName(meta.EqualToken).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.AmpersandToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3299,9 +3380,9 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, _new)) // save comments - addMeta($$, $2.Meta, meta.EqualToken) - addMeta($$, $3.Meta, meta.AmpersandToken) - addMeta(_new, $4.Meta, meta.NewToken) + $2.Meta.SetTokenName(meta.EqualToken).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.AmpersandToken).AppendTo($$.GetMeta()) + $4.Meta.SetTokenName(meta.NewAnchor).AppendTo(_new.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3313,7 +3394,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - addMeta($$, $1.Meta, meta.CloneToken) + $1.Meta.SetTokenName(meta.CloneToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3325,7 +3406,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.PlusEqualToken) + $2.Meta.SetTokenName(meta.PlusEqualToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3337,7 +3418,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.MinusEqualToken) + $2.Meta.SetTokenName(meta.MinusEqualToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3349,7 +3430,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.MulEqualToken) + $2.Meta.SetTokenName(meta.MulEqualToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3361,7 +3442,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.PowEqualToken) + $2.Meta.SetTokenName(meta.PowEqualToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3373,7 +3454,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.DivEqualToken) + $2.Meta.SetTokenName(meta.DivEqualToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3385,7 +3466,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.ConcatEqualToken) + $2.Meta.SetTokenName(meta.ConcatEqualToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3397,7 +3478,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.ModEqualToken) + $2.Meta.SetTokenName(meta.ModEqualToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3409,7 +3490,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.AndEqualToken) + $2.Meta.SetTokenName(meta.AndEqualToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3421,7 +3502,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.OrEqualToken) + $2.Meta.SetTokenName(meta.OrEqualToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3433,7 +3514,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.XorEqualToken) + $2.Meta.SetTokenName(meta.XorEqualToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3445,7 +3526,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.SlEqualToken) + $2.Meta.SetTokenName(meta.SlEqualToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3457,7 +3538,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.SrEqualToken) + $2.Meta.SetTokenName(meta.SrEqualToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3469,7 +3550,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) // save comments - addMeta($$, $2.Meta, meta.IncToken) + $2.Meta.SetTokenName(meta.IncToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3481,7 +3562,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - addMeta($$, $1.Meta, meta.IncToken) + $1.Meta.SetTokenName(meta.IncToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3493,7 +3574,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) // save comments - addMeta($$, $2.Meta, meta.DecToken) + $2.Meta.SetTokenName(meta.DecToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3505,7 +3586,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - addMeta($$, $1.Meta, meta.DecToken) + $1.Meta.SetTokenName(meta.DecToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3517,7 +3598,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.BooleanOrToken) + $2.Meta.SetTokenName(meta.BooleanOrToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3529,7 +3610,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.BooleanAndToken) + $2.Meta.SetTokenName(meta.BooleanAndToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3541,7 +3622,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.LogicalOrToken) + $2.Meta.SetTokenName(meta.LogicalOrToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3553,7 +3634,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.LogicalAndToken) + $2.Meta.SetTokenName(meta.LogicalAndToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3565,7 +3646,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.LogicalXorToken) + $2.Meta.SetTokenName(meta.LogicalXorToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3577,7 +3658,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.VerticalBarToken) + $2.Meta.SetTokenName(meta.VerticalBarToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3589,7 +3670,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.AmpersandToken) + $2.Meta.SetTokenName(meta.AmpersandToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3601,7 +3682,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.CaretToken) + $2.Meta.SetTokenName(meta.CaretToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3613,7 +3694,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.DotToken) + $2.Meta.SetTokenName(meta.DotToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3625,7 +3706,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.PlusToken) + $2.Meta.SetTokenName(meta.PlusToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3637,7 +3718,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.MinusToken) + $2.Meta.SetTokenName(meta.MinusToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3649,7 +3730,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.AsteriskToken) + $2.Meta.SetTokenName(meta.AsteriskToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3661,7 +3742,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.PowToken) + $2.Meta.SetTokenName(meta.PowToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3673,7 +3754,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.SlashToken) + $2.Meta.SetTokenName(meta.SlashToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3685,7 +3766,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.PercentToken) + $2.Meta.SetTokenName(meta.PercentToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3697,7 +3778,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.SlToken) + $2.Meta.SetTokenName(meta.SlToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3709,7 +3790,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.SrToken) + $2.Meta.SetTokenName(meta.SrToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3721,7 +3802,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - addMeta($$, $1.Meta, meta.PlusToken) + $1.Meta.SetTokenName(meta.PlusToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3733,7 +3814,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - addMeta($$, $1.Meta, meta.MinusToken) + $1.Meta.SetTokenName(meta.MinusToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3745,7 +3826,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - addMeta($$, $1.Meta, meta.ExclamationMarkToken) + $1.Meta.SetTokenName(meta.ExclamationMarkToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3757,7 +3838,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - addMeta($$, $1.Meta, meta.TildeToken) + $1.Meta.SetTokenName(meta.TildeToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3769,7 +3850,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.IsIdenticalToken) + $2.Meta.SetTokenName(meta.IsIdenticalToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3781,7 +3862,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.IsNotIdenticalToken) + $2.Meta.SetTokenName(meta.IsNotIdenticalToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3793,7 +3874,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.IsEqualToken) + $2.Meta.SetTokenName(meta.IsEqualToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3805,7 +3886,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.IsNotEqualToken) + $2.Meta.SetTokenName(meta.IsNotEqualToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $2, meta.IsNotEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3817,7 +3899,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.LessToken) + $2.Meta.SetTokenName(meta.LessToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3829,7 +3911,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.IsSmallerOrEqualToken) + $2.Meta.SetTokenName(meta.IsSmallerOrEqualToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3841,7 +3923,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.GreaterToken) + $2.Meta.SetTokenName(meta.GreaterToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3853,7 +3935,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.IsGreaterOrEqualToken) + $2.Meta.SetTokenName(meta.IsGreaterOrEqualToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3865,7 +3947,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.InstanceofToken) + $2.Meta.SetTokenName(meta.InstanceofToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3874,6 +3956,9 @@ expr_without_variable: $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + + $$.GetMeta().Cut(meta.TokenNameFilter(meta.OpenParenthesisToken)).SetTokenName(meta.NodeStart).PrependTo($$.GetMeta()) + $$.GetMeta().Cut(meta.TokenNameFilter(meta.CloseParenthesisToken)).SetTokenName(meta.NodeEnd).AppendTo($$.GetMeta()) } | new_expr { @@ -3905,8 +3990,8 @@ expr_without_variable: } // save comments - addMeta($$, $1.Meta, meta.OpenParenthesisToken) - addMeta($$, $3.Meta, meta.CloseParenthesisToken) + $1.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3918,8 +4003,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $5)) // save comments - addMeta($$, $2.Meta, meta.QuestionMarkToken) - addMeta($$, $4.Meta, meta.ColonToken) + $2.Meta.SetTokenName(meta.QuestionMarkToken).AppendTo($$.GetMeta()) + $4.Meta.SetTokenName(meta.ColonToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3931,8 +4016,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) // save comments - addMeta($$, $2.Meta, meta.QuestionMarkToken) - addMeta($$, $3.Meta, meta.ColonToken) + $2.Meta.SetTokenName(meta.QuestionMarkToken).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.ColonToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3950,7 +4035,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - addMeta($$, $1.Meta, meta.IntCastToken) + $1.Meta.SetTokenName(meta.IntCastToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $1, meta.IntCastToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3962,7 +4048,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - addMeta($$, $1.Meta, meta.DoubleCastToken) + $1.Meta.SetTokenName(meta.DoubleCastToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $1, meta.DoubleCastToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3974,7 +4061,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - addMeta($$, $1.Meta, meta.StringCastToken) + $1.Meta.SetTokenName(meta.StringCastToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $1, meta.StringCastToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3986,7 +4074,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - addMeta($$, $1.Meta, meta.ArrayCastToken) + $1.Meta.SetTokenName(meta.ArrayCastToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $1, meta.ArrayCastToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3998,7 +4087,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - addMeta($$, $1.Meta, meta.ObjectCastToken) + $1.Meta.SetTokenName(meta.ObjectCastToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $1, meta.ObjectCastToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4010,7 +4100,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - addMeta($$, $1.Meta, meta.BoolCastToken) + $1.Meta.SetTokenName(meta.BoolCastToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $1, meta.BoolCastToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4022,7 +4113,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - addMeta($$, $1.Meta, meta.UnsetCastToken) + $1.Meta.SetTokenName(meta.UnsetCastToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $1, meta.UnsetCastToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4049,7 +4141,7 @@ expr_without_variable: } // save comments - addMeta($$, $1.Meta, meta.ExitToken) + $1.Meta.SetTokenName(meta.ExitToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4061,7 +4153,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - addMeta($$, $1.Meta, meta.AtToken) + $1.Meta.SetTokenName(meta.AtToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4091,8 +4183,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - addMeta($$, $1.Meta, meta.BackquoteToken) - addMeta($$, $3.Meta, meta.BackquoteToken) + $1.Meta.SetTokenName(meta.BackquoteToken).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.BackquoteToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4104,7 +4196,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - addMeta($$, $1.Meta, meta.PrintToken) + $1.Meta.SetTokenName(meta.PrintToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4116,7 +4208,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.YieldToken) + $1.Meta.SetTokenName(meta.YieldToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4128,14 +4220,14 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $9)) // save comments - addMeta($$, $1.Meta, meta.FunctionToken) + $1.Meta.SetTokenName(meta.FunctionToken).AppendTo($$.GetMeta()) if $2 != nil { - addMeta($$, $2.Meta, meta.AmpersandToken) + $2.Meta.SetTokenName(meta.AmpersandToken).AppendTo($$.GetMeta()) } - addMeta($$, $3.Meta, meta.OpenParenthesisToken) - addMeta($$, $5.Meta, meta.CloseParenthesisToken) - addMeta($$, $7.Meta, meta.OpenCurlyBracesToken) - addMeta($$, $9.Meta, meta.CloseCurlyBracesToken) + $3.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) + $5.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) + $7.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) + $9.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4147,15 +4239,15 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $10)) // save comments - addMeta($$, $1.Meta, meta.StaticToken) - addMeta($$, $2.Meta, meta.FunctionToken) + $1.Meta.SetTokenName(meta.StaticToken).AppendTo($$.GetMeta()) + $2.Meta.SetTokenName(meta.FunctionToken).AppendTo($$.GetMeta()) if $3 != nil { - addMeta($$, $3.Meta, meta.AmpersandToken) + $3.Meta.SetTokenName(meta.AmpersandToken).AppendTo($$.GetMeta()) } - addMeta($$, $4.Meta, meta.OpenParenthesisToken) - addMeta($$, $6.Meta, meta.CloseParenthesisToken) - addMeta($$, $8.Meta, meta.OpenCurlyBracesToken) - addMeta($$, $10.Meta, meta.CloseCurlyBracesToken) + $4.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) + $6.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) + $8.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) + $10.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4170,7 +4262,7 @@ yield_expr: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - addMeta($$, $1.Meta, meta.YieldToken) + $1.Meta.SetTokenName(meta.YieldToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4182,7 +4274,7 @@ yield_expr: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - addMeta($$, $1.Meta, meta.YieldToken) + $1.Meta.SetTokenName(meta.YieldToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4194,8 +4286,8 @@ yield_expr: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $4)) // save comments - addMeta($$, $1.Meta, meta.YieldToken) - addMeta($$, $3.Meta, meta.DoubleArrowToken) + $1.Meta.SetTokenName(meta.YieldToken).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4207,8 +4299,8 @@ yield_expr: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $4)) // save comments - addMeta($$, $1.Meta, meta.YieldToken) - addMeta($$, $3.Meta, meta.DoubleArrowToken) + $1.Meta.SetTokenName(meta.YieldToken).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4223,8 +4315,10 @@ combined_scalar_offset: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments - addMeta($$, $2.Meta, meta.OpenSquareBracket) - addMeta($$, $4.Meta, meta.CloseSquareBracket) + $2.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $2, meta.OpenSquareBracket) + $4.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $4, meta.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4236,8 +4330,10 @@ combined_scalar_offset: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments - addMeta($$, $2.Meta, meta.OpenSquareBracket) - addMeta($$, $4.Meta, meta.CloseSquareBracket) + $2.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $2, meta.OpenSquareBracket) + $4.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $4, meta.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4251,8 +4347,10 @@ combined_scalar_offset: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(str, $4)) // save comments - addMeta($$, $2.Meta, meta.OpenSquareBracket) - addMeta($$, $4.Meta, meta.CloseSquareBracket) + $2.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $2, meta.OpenSquareBracket) + $4.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $4, meta.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4264,8 +4362,10 @@ combined_scalar_offset: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments - addMeta($$, $2.Meta, meta.OpenSquareBracket) - addMeta($$, $4.Meta, meta.CloseSquareBracket) + $2.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $2, meta.OpenSquareBracket) + $4.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $4, meta.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4280,9 +4380,9 @@ combined_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - addMeta($$, $1.Meta, meta.ArrayToken) - addMeta($$, $2.Meta, meta.OpenParenthesisToken) - addMeta($$, $4.Meta, meta.CloseParenthesisToken) + $1.Meta.SetTokenName(meta.ArrayToken).AppendTo($$.GetMeta()) + $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) + $4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4294,8 +4394,8 @@ combined_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - addMeta($$, $1.Meta, meta.OpenSquareBracket) - addMeta($$, $3.Meta, meta.CloseSquareBracket) + $1.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4319,8 +4419,14 @@ lexical_vars: { $$ = expr.NewClosureUse($3) + // save position $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + // save comments + $1.Meta.SetTokenName(meta.UseToken).AppendTo($$.GetMeta()) + $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) + $4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -4337,8 +4443,8 @@ lexical_var_list: variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) // save comments - addMeta(lastNode($1), $2.Meta, meta.CommaToken) - addMeta(variable, $3.Meta, meta.VariableToken) + $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) + $3.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4355,9 +4461,9 @@ lexical_var_list: reference.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($3, $4)) // save comments - addMeta(lastNode($1), $2.Meta, meta.CommaToken) - addMeta(reference, $3.Meta, meta.VariableToken) - addMeta(variable, $4.Meta, meta.VariableToken) + $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) + $3.Meta.SetTokenName(meta.AmpersandToken).AppendTo(reference.GetMeta()) + $4.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4372,7 +4478,7 @@ lexical_var_list: variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta(variable, $1.Meta, meta.VariableToken) + $1.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4389,8 +4495,8 @@ lexical_var_list: reference.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - addMeta(reference, $1.Meta, meta.VariableToken) - addMeta(variable, $2.Meta, meta.VariableToken) + $1.Meta.SetTokenName(meta.AmpersandToken).AppendTo(reference.GetMeta()) + $2.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4418,8 +4524,8 @@ function_call: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(funcName, $4)) // save comments - addMeta(funcName, $1.Meta, meta.NamespaceToken) - addMeta(funcName, $2.Meta, meta.NsSeparatorToken) + $1.Meta.SetTokenName(meta.NamespaceToken).AppendTo(funcName.GetMeta()) + $2.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo(funcName.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4433,7 +4539,7 @@ function_call: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(funcName, $3)) // save comments - addMeta(funcName, $1.Meta, meta.NsSeparatorToken) + $1.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo(funcName.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4445,7 +4551,7 @@ function_call: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) // save comments - addMeta($$, $2.Meta, meta.PaamayimNekudotayimToken) + $2.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4457,7 +4563,7 @@ function_call: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) // save comments - addMeta($$, $2.Meta, meta.PaamayimNekudotayimToken) + $2.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4469,7 +4575,7 @@ function_call: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) // save comments - addMeta($$, $2.Meta, meta.PaamayimNekudotayimToken) + $2.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4481,7 +4587,7 @@ function_call: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) // save comments - addMeta($$, $2.Meta, meta.PaamayimNekudotayimToken) + $2.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4505,7 +4611,7 @@ class_name: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.IdentifierToken) + $1.Meta.SetTokenName(meta.IdentifierToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4526,8 +4632,8 @@ class_name: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3)) // save comments - addMeta($$, $1.Meta, meta.NamespaceToken) - addMeta($$, $2.Meta, meta.NsSeparatorToken) + $1.Meta.SetTokenName(meta.NamespaceToken).AppendTo($$.GetMeta()) + $2.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4539,7 +4645,7 @@ class_name: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) // save comments - addMeta($$, $1.Meta, meta.NsSeparatorToken) + $1.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4563,8 +4669,8 @@ fully_qualified_class_name: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3)) // save comments - addMeta($$, $1.Meta, meta.NamespaceToken) - addMeta($$, $2.Meta, meta.NsSeparatorToken) + $1.Meta.SetTokenName(meta.NamespaceToken).AppendTo($$.GetMeta()) + $2.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4576,7 +4682,7 @@ fully_qualified_class_name: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) // save comments - addMeta($$, $1.Meta, meta.NsSeparatorToken) + $1.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4603,7 +4709,7 @@ dynamic_class_name_reference: $$ = $1 // save comments - addMeta($3[0], $2.Meta, meta.ObjectOperatorToken) + $2.Meta.SetTokenName(meta.ObjectOperatorToken).AppendTo($3[0].GetMeta()) for _, n := range($3) { switch nn := n.(type) { @@ -4666,7 +4772,7 @@ dynamic_class_name_variable_property: $$ = $2 // save comments - addMeta($2[0], $1.Meta, meta.ObjectOperatorToken) + $1.Meta.SetTokenName(meta.ObjectOperatorToken).AppendTo($2[0].GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4687,8 +4793,10 @@ exit_expr: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - addMeta($$, $1.Meta, meta.OpenParenthesisToken) - addMeta($$, $2.Meta, meta.CloseParenthesisToken) + $1.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $1, meta.OpenParenthesisToken) + $2.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $2, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4704,6 +4812,10 @@ exit_expr: } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + + // save comments + $1.GetMeta().Cut(meta.TokenNameFilter(meta.OpenParenthesisToken)).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(meta.TokenNameFilter(meta.CloseParenthesisToken)).AppendTo($$.GetMeta()) } ; @@ -4752,7 +4864,7 @@ common_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.LnumberToken) + $1.Meta.SetTokenName(meta.LnumberToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4764,7 +4876,7 @@ common_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.DnumberToken) + $1.Meta.SetTokenName(meta.DnumberToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4776,7 +4888,7 @@ common_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.ConstantEncapsedStringToken) + $1.Meta.SetTokenName(meta.ConstantEncapsedStringToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4788,7 +4900,7 @@ common_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.MagicConstantToken) + $1.Meta.SetTokenName(meta.MagicConstantToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4800,7 +4912,7 @@ common_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.MagicConstantToken) + $1.Meta.SetTokenName(meta.MagicConstantToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4812,7 +4924,7 @@ common_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.MagicConstantToken) + $1.Meta.SetTokenName(meta.MagicConstantToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4824,7 +4936,7 @@ common_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.MagicConstantToken) + $1.Meta.SetTokenName(meta.MagicConstantToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4836,7 +4948,7 @@ common_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.MagicConstantToken) + $1.Meta.SetTokenName(meta.MagicConstantToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4848,7 +4960,7 @@ common_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.MagicConstantToken) + $1.Meta.SetTokenName(meta.MagicConstantToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4860,7 +4972,7 @@ common_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.MagicConstantToken) + $1.Meta.SetTokenName(meta.MagicConstantToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4874,7 +4986,7 @@ common_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - addMeta($$, $1.Meta, meta.StartHeredocToken) + $1.Meta.SetTokenName(meta.StartHeredocToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4886,7 +4998,7 @@ common_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - addMeta($$, $1.Meta, meta.StartHeredocToken) + $1.Meta.SetTokenName(meta.StartHeredocToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4903,8 +5015,8 @@ static_class_constant: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.PaamayimNekudotayimToken) - addMeta(target, $3.Meta, meta.IdentifierToken) + $2.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.IdentifierToken).AppendTo(target.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4953,8 +5065,8 @@ static_scalar_value: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3)) // save comments - addMeta(name, $1.Meta, meta.NamespaceToken) - addMeta(name, $2.Meta, meta.NsSeparatorToken) + $1.Meta.SetTokenName(meta.NamespaceToken).AppendTo(name.GetMeta()) + $2.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo(name.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4968,7 +5080,7 @@ static_scalar_value: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) // save comments - addMeta(name, $1.Meta, meta.NsSeparatorToken) + $1.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo(name.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4980,9 +5092,9 @@ static_scalar_value: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - addMeta($$, $1.Meta, meta.ArrayToken) - addMeta($$, $2.Meta, meta.OpenParenthesisToken) - addMeta($$, $4.Meta, meta.CloseParenthesisToken) + $1.Meta.SetTokenName(meta.ArrayToken).AppendTo($$.GetMeta()) + $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) + $4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4994,8 +5106,8 @@ static_scalar_value: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - addMeta($$, $1.Meta, meta.OpenSquareBracket) - addMeta($$, $3.Meta, meta.CloseSquareBracket) + $1.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5013,7 +5125,7 @@ static_scalar_value: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.MagicConstantToken) + $1.Meta.SetTokenName(meta.MagicConstantToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5034,8 +5146,10 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments - addMeta($$, $2.Meta, meta.OpenSquareBracket) - addMeta($$, $4.Meta, meta.CloseSquareBracket) + $2.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $2, meta.OpenSquareBracket) + $4.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $4, meta.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5047,7 +5161,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.PlusToken) + $2.Meta.SetTokenName(meta.PlusToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5059,7 +5173,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.MinusToken) + $2.Meta.SetTokenName(meta.MinusToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5071,7 +5185,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.AsteriskToken) + $2.Meta.SetTokenName(meta.AsteriskToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5083,7 +5197,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.PowToken) + $2.Meta.SetTokenName(meta.PowToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5095,7 +5209,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.SlashToken) + $2.Meta.SetTokenName(meta.SlashToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5107,7 +5221,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.PercentToken) + $2.Meta.SetTokenName(meta.PercentToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5119,7 +5233,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - addMeta($$, $1.Meta, meta.ExclamationMarkToken) + $1.Meta.SetTokenName(meta.ExclamationMarkToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5131,7 +5245,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - addMeta($$, $1.Meta, meta.TildeToken) + $1.Meta.SetTokenName(meta.TildeToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5143,7 +5257,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.VerticalBarToken) + $2.Meta.SetTokenName(meta.VerticalBarToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5155,7 +5269,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.AmpersandToken) + $2.Meta.SetTokenName(meta.AmpersandToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5167,7 +5281,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.CaretToken) + $2.Meta.SetTokenName(meta.CaretToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5179,7 +5293,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.SlToken) + $2.Meta.SetTokenName(meta.SlToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5191,7 +5305,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.SrToken) + $2.Meta.SetTokenName(meta.SrToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5203,7 +5317,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.DotToken) + $2.Meta.SetTokenName(meta.DotToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5215,7 +5329,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.LogicalXorToken) + $2.Meta.SetTokenName(meta.LogicalXorToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5227,7 +5341,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.LogicalAndToken) + $2.Meta.SetTokenName(meta.LogicalAndToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5239,7 +5353,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.LogicalOrToken) + $2.Meta.SetTokenName(meta.LogicalOrToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5251,7 +5365,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.BooleanAndToken) + $2.Meta.SetTokenName(meta.BooleanAndToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5263,7 +5377,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.BooleanOrToken) + $2.Meta.SetTokenName(meta.BooleanOrToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5275,7 +5389,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.IsIdenticalToken) + $2.Meta.SetTokenName(meta.IsIdenticalToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5287,7 +5401,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.IsNotIdenticalToken) + $2.Meta.SetTokenName(meta.IsNotIdenticalToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5299,7 +5413,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.IsEqualToken) + $2.Meta.SetTokenName(meta.IsEqualToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5311,7 +5425,8 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.IsNotEqualToken) + $2.Meta.SetTokenName(meta.IsNotEqualToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $2, meta.IsNotEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5323,7 +5438,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.LessToken) + $2.Meta.SetTokenName(meta.LessToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5335,7 +5450,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.GreaterToken) + $2.Meta.SetTokenName(meta.GreaterToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5347,7 +5462,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.IsSmallerOrEqualToken) + $2.Meta.SetTokenName(meta.IsSmallerOrEqualToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5359,7 +5474,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.IsGreaterOrEqualToken) + $2.Meta.SetTokenName(meta.IsGreaterOrEqualToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5371,8 +5486,8 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) // save comments - addMeta($$, $2.Meta, meta.QuestionMarkToken) - addMeta($$, $3.Meta, meta.ColonToken) + $2.Meta.SetTokenName(meta.QuestionMarkToken).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.ColonToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5384,8 +5499,8 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $5)) // save comments - addMeta($$, $2.Meta, meta.QuestionMarkToken) - addMeta($$, $4.Meta, meta.ColonToken) + $2.Meta.SetTokenName(meta.QuestionMarkToken).AppendTo($$.GetMeta()) + $4.Meta.SetTokenName(meta.ColonToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5397,7 +5512,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - addMeta($$, $1.Meta, meta.PlusToken) + $1.Meta.SetTokenName(meta.PlusToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5409,7 +5524,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - addMeta($$, $1.Meta, meta.MinusToken) + $1.Meta.SetTokenName(meta.MinusToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5418,8 +5533,8 @@ static_operation: $$ = $2 // save comments - addMeta($$, $1.Meta, meta.OpenParenthesisToken) - addMeta($$, $3.Meta, meta.CloseParenthesisToken) + $1.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5451,8 +5566,8 @@ general_constant: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(name)) // save comments - addMeta(name, $1.Meta, meta.NamespaceToken) - addMeta(name, $2.Meta, meta.NsSeparatorToken) + $1.Meta.SetTokenName(meta.NamespaceToken).AppendTo(name.GetMeta()) + $2.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo(name.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5466,7 +5581,7 @@ general_constant: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(name)) // save comments - addMeta(name, $1.Meta, meta.NsSeparatorToken) + $1.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo(name.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5483,7 +5598,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta(name, $1.Meta, meta.IdentifierToken) + $1.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5513,7 +5628,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - addMeta($$, $1.Meta, meta.DoubleQuoteToken) + $1.Meta.SetTokenName(meta.DoubleQuoteToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5525,7 +5640,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - addMeta($$, $1.Meta, meta.StartHeredocToken) + $1.Meta.SetTokenName(meta.StartHeredocToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5537,7 +5652,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.MagicConstantToken) + $1.Meta.SetTokenName(meta.MagicConstantToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5556,7 +5671,7 @@ static_array_pair_list: // save comments if $2 != nil { - addMeta(lastNode($1), $2.Meta, meta.CommaToken) + $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -5584,8 +5699,8 @@ non_empty_static_array_pair_list: arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($3, $5)) // save comments - addMeta(lastNode($1), $2.Meta, meta.CommaToken) - addMeta(arrayItem, $4.Meta, meta.DoubleArrowToken) + $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) + $4.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo(arrayItem.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5598,7 +5713,7 @@ non_empty_static_array_pair_list: arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($3)) // save comments - addMeta(lastNode($1), $2.Meta, meta.CommaToken) + $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5611,7 +5726,7 @@ non_empty_static_array_pair_list: arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta(arrayItem, $2.Meta, meta.DoubleArrowToken) + $2.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo(arrayItem.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5648,8 +5763,10 @@ parenthesis_expr: $$ = $2 // save comments - addMeta($$, $1.Meta, meta.OpenParenthesisToken) - addMeta($$, $3.Meta, meta.CloseParenthesisToken) + $1.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $1, meta.OpenParenthesisToken) + $3.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $3, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5658,8 +5775,10 @@ parenthesis_expr: $$ = $2 // save comments - addMeta($$, $1.Meta, meta.OpenParenthesisToken) - addMeta($$, $3.Meta, meta.CloseParenthesisToken) + $1.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $1, meta.OpenParenthesisToken) + $3.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $3, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5705,7 +5824,7 @@ variable: } // save comments - addMeta($3[0], $2.Meta, meta.ObjectOperatorToken) + $2.Meta.SetTokenName(meta.ObjectOperatorToken).AppendTo($3[0].GetMeta()) for _, n := range($3) { switch nn := n.(type) { @@ -5782,7 +5901,7 @@ variable_property: $$ = $2 // save comments - addMeta($2[0], $1.Meta, meta.ObjectOperatorToken) + $1.Meta.SetTokenName(meta.ObjectOperatorToken).AppendTo($2[0].GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5798,8 +5917,10 @@ array_method_dereference: fetch.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($3)) // save comments - addMeta(fetch, $2.Meta, meta.OpenSquareBracket) - addMeta(fetch, $4.Meta, meta.CloseSquareBracket) + $2.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo(fetch.GetMeta()) + yylex.(*Parser).appendMetaToken(fetch, $2, meta.OpenSquareBracket) + $4.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(fetch.GetMeta()) + yylex.(*Parser).appendMetaToken(fetch, $4, meta.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5812,8 +5933,10 @@ array_method_dereference: fetch.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($3)) // save comments - addMeta(fetch, $2.Meta, meta.OpenSquareBracket) - addMeta(fetch, $4.Meta, meta.CloseSquareBracket) + $2.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo(fetch.GetMeta()) + yylex.(*Parser).appendMetaToken(fetch, $2, meta.OpenSquareBracket) + $4.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(fetch.GetMeta()) + yylex.(*Parser).appendMetaToken(fetch, $4, meta.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5882,7 +6005,7 @@ static_member: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.PaamayimNekudotayimToken) + $2.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5894,7 +6017,7 @@ static_member: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.PaamayimNekudotayimToken) + $2.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5918,8 +6041,10 @@ array_function_dereference: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments - addMeta($$, $2.Meta, meta.OpenSquareBracket) - addMeta($$, $4.Meta, meta.CloseSquareBracket) + $2.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $2, meta.OpenSquareBracket) + $4.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $4, meta.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5931,8 +6056,10 @@ array_function_dereference: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments - addMeta($$, $2.Meta, meta.OpenSquareBracket) - addMeta($$, $4.Meta, meta.CloseSquareBracket) + $2.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $2, meta.OpenSquareBracket) + $4.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $4, meta.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5996,8 +6123,10 @@ reference_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments - addMeta($$, $2.Meta, meta.OpenSquareBracket) - addMeta($$, $4.Meta, meta.CloseSquareBracket) + $2.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $2, meta.OpenSquareBracket) + $4.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $4, meta.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6009,8 +6138,10 @@ reference_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments - addMeta($$, $2.Meta, meta.OpenCurlyBracesToken) - addMeta($$, $4.Meta, meta.CloseCurlyBracesToken) + $2.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $2, meta.OpenCurlyBracesToken) + $4.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $4, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6034,7 +6165,7 @@ compound_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.VariableToken) + $1.Meta.SetTokenName(meta.VariableToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6046,9 +6177,11 @@ compound_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - addMeta($$, $1.Meta, meta.DollarToken) - addMeta($$, $2.Meta, meta.OpenCurlyBracesToken) - addMeta($$, $4.Meta, meta.CloseCurlyBracesToken) + $1.Meta.SetTokenName(meta.DollarToken).AppendTo($$.GetMeta()) + $2.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $2, meta.OpenCurlyBracesToken) + $4.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $4, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6099,8 +6232,10 @@ object_dim_list: fetch.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($3)) // save comments - addMeta(fetch, $2.Meta, meta.OpenSquareBracket) - addMeta(fetch, $4.Meta, meta.CloseSquareBracket) + $2.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo(fetch.GetMeta()) + yylex.(*Parser).appendMetaToken(fetch, $2, meta.OpenSquareBracket) + $4.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(fetch.GetMeta()) + yylex.(*Parser).appendMetaToken(fetch, $4, meta.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6113,8 +6248,10 @@ object_dim_list: fetch.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($3)) // save comments - addMeta(fetch, $2.Meta, meta.OpenCurlyBracesToken) - addMeta(fetch, $4.Meta, meta.CloseCurlyBracesToken) + $2.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(fetch.GetMeta()) + yylex.(*Parser).appendMetaToken(fetch, $2, meta.OpenCurlyBracesToken) + $4.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(fetch.GetMeta()) + yylex.(*Parser).appendMetaToken(fetch, $4, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6139,7 +6276,7 @@ variable_name: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.IdentifierToken) + $1.Meta.SetTokenName(meta.IdentifierToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6151,8 +6288,10 @@ variable_name: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - addMeta($$, $1.Meta, meta.OpenCurlyBracesToken) - addMeta($$, $3.Meta, meta.CloseCurlyBracesToken) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) + $3.Meta.SetTokenName(meta.NodeEnd).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $3, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6168,7 +6307,7 @@ simple_indirect_reference: n.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta(n, $1.Meta, meta.DollarToken) + $1.Meta.SetTokenName(meta.DollarToken).AppendTo(n.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6185,7 +6324,7 @@ simple_indirect_reference: n.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) // save comments - addMeta(n, $2.Meta, meta.DollarToken) + $2.Meta.SetTokenName(meta.DollarToken).AppendTo(n.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6201,7 +6340,7 @@ assignment_list: $$ = append($1, $3) // save comments - addMeta(lastNode($1), $2.Meta, meta.NodeEnd) + $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6238,9 +6377,9 @@ assignment_list_element: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(item)) // save comments - addMeta(item, $1.Meta, meta.ListToken) - addMeta(item, $2.Meta, meta.OpenParenthesisToken) - addMeta(item, $4.Meta, meta.CloseParenthesisToken) + $1.Meta.SetTokenName(meta.ListToken).AppendTo(item.GetMeta()) + $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(item.GetMeta()) + $4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(item.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6270,7 +6409,7 @@ array_pair_list: // save comments if $2 != nil { - addMeta(lastNode($1), $2.Meta, meta.CommaToken) + $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -6287,8 +6426,8 @@ non_empty_array_pair_list: arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($3, $5)) // save comments - addMeta(lastNode($1), $2.Meta, meta.CommaToken) - addMeta(arrayItem, $4.Meta, meta.DoubleArrowToken) + $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) + $4.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo(arrayItem.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6301,7 +6440,7 @@ non_empty_array_pair_list: arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($3)) // save comments - addMeta(lastNode($1), $2.Meta, meta.CommaToken) + $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6314,7 +6453,7 @@ non_empty_array_pair_list: arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta(arrayItem, $2.Meta, meta.DoubleArrowToken) + $2.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo(arrayItem.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6339,9 +6478,9 @@ non_empty_array_pair_list: arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($3, $6)) // save comments - addMeta(lastNode($1), $2.Meta, meta.CommaToken) - addMeta(arrayItem, $4.Meta, meta.DoubleArrowToken) - addMeta(reference, $5.Meta, meta.AmpersandToken) + $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) + $4.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo(arrayItem.GetMeta()) + $5.Meta.SetTokenName(meta.AmpersandToken).AppendTo(reference.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6356,8 +6495,8 @@ non_empty_array_pair_list: arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $4)) // save comments - addMeta(lastNode($1), $2.Meta, meta.CommaToken) - addMeta(reference, $3.Meta, meta.AmpersandToken) + $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) + $3.Meta.SetTokenName(meta.AmpersandToken).AppendTo(reference.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6372,8 +6511,8 @@ non_empty_array_pair_list: arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) // save comments - addMeta(arrayItem, $2.Meta, meta.DoubleArrowToken) - addMeta(reference, $3.Meta, meta.AmpersandToken) + $2.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo(arrayItem.GetMeta()) + $3.Meta.SetTokenName(meta.AmpersandToken).AppendTo(reference.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6388,7 +6527,7 @@ non_empty_array_pair_list: arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - addMeta(reference, $1.Meta, meta.AmpersandToken) + $1.Meta.SetTokenName(meta.AmpersandToken).AppendTo(reference.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6410,7 +6549,7 @@ encaps_list: encapsed.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) // save comments - addMeta(encapsed, $2.Meta, meta.EncapsedAndWhitespaceToken) + $2.Meta.SetTokenName(meta.EncapsedAndWhitespaceToken).AppendTo(encapsed.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6429,7 +6568,7 @@ encaps_list: encapsed.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta(encapsed, $1.Meta, meta.EncapsedAndWhitespaceToken) + $1.Meta.SetTokenName(meta.EncapsedAndWhitespaceToken).AppendTo(encapsed.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6446,7 +6585,7 @@ encaps_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.VariableToken) + $1.Meta.SetTokenName(meta.VariableToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6462,9 +6601,11 @@ encaps_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - addMeta(variable, $1.Meta, meta.VariableToken) - addMeta($$, $2.Meta, meta.OpenSquareBracket) - addMeta($$, $4.Meta, meta.CloseSquareBracket) + $1.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) + $2.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $2, meta.OpenSquareBracket) + $4.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $4, meta.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6482,38 +6623,48 @@ encaps_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - addMeta(variable, $1.Meta, meta.VariableToken) - addMeta($$, $2.Meta, meta.ObjectOperatorToken) - addMeta(fetch, $3.Meta, meta.IdentifierToken) + $1.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) + $2.Meta.SetTokenName(meta.ObjectOperatorToken).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.IdentifierToken).AppendTo(fetch.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_DOLLAR_OPEN_CURLY_BRACES expr '}' { - $$ = expr.NewVariable($2) + variable := expr.NewVariable($2) + variable.StringVar = true + + $$ = variable // save position $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - addMeta($$, $1.Meta, meta.DollarOpenCurlyBracesToken) - addMeta($$, $3.Meta, meta.CloseCurlyBracesToken) + $1.Meta.SetTokenName(meta.DollarOpenCurlyBracesToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $1, meta.DollarOpenCurlyBracesToken) + $3.Meta.SetTokenName(meta.DollarCloseCurlyBracesToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $3, meta.DollarCloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_DOLLAR_OPEN_CURLY_BRACES T_STRING_VARNAME '}' { name := node.NewIdentifier($2.Value) - $$ = expr.NewVariable(name) + variable := expr.NewVariable(name) + variable.StringVar = true + + $$ = variable // save position name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - addMeta($$, $1.Meta, meta.DollarOpenCurlyBracesToken) - addMeta(name, $2.Meta, meta.IdentifierToken) - addMeta($$, $3.Meta, meta.CloseCurlyBracesToken) + $1.Meta.SetTokenName(meta.DollarOpenCurlyBracesToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $1, meta.DollarOpenCurlyBracesToken) + $2.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + $3.Meta.SetTokenName(meta.DollarCloseCurlyBracesToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $3, meta.DollarCloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6521,6 +6672,7 @@ encaps_var: { identifier := node.NewIdentifier($2.Value) variable := expr.NewVariable(identifier) + variable.StringVar = true $$ = expr.NewArrayDimFetch(variable, $4) // save position @@ -6529,11 +6681,15 @@ encaps_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $6)) // save comments - addMeta($$, $1.Meta, meta.DollarOpenCurlyBracesToken) - addMeta(variable, $2.Meta, meta.StringVarnameToken) - addMeta($$, $3.Meta, meta.OpenSquareBracket) - addMeta($$, $5.Meta, meta.CloseSquareBracket) - addMeta($$, $6.Meta, meta.CloseCurlyBracesToken) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) + $2.Meta.SetTokenName(meta.StringVarnameToken).AppendTo(variable.GetMeta()) + $3.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $3, meta.OpenSquareBracket) + $5.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $5, meta.CloseSquareBracket) + $6.Meta.SetTokenName(meta.NodeEnd).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $6, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6541,6 +6697,12 @@ encaps_var: { $$ = $2; + // save comments + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) + $3.Meta.SetTokenName(meta.NodeEnd).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $3, meta.NodeEnd) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -6554,7 +6716,7 @@ encaps_var_offset: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.StringToken) + $1.Meta.SetTokenName(meta.StringToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6571,7 +6733,7 @@ encaps_var_offset: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.NumStringToken) + $1.Meta.SetTokenName(meta.NumStringToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6585,7 +6747,7 @@ encaps_var_offset: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.VariableToken) + $1.Meta.SetTokenName(meta.VariableToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6600,9 +6762,9 @@ internal_functions_in_yacc: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - addMeta($$, $1.Meta, meta.IssetToken) - addMeta($$, $2.Meta, meta.OpenParenthesisToken) - addMeta($$, $4.Meta, meta.CloseParenthesisToken) + $1.Meta.SetTokenName(meta.IssetToken).AppendTo($$.GetMeta()) + $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) + $4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6614,9 +6776,9 @@ internal_functions_in_yacc: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - addMeta($$, $1.Meta, meta.EmptyToken) - addMeta($$, $2.Meta, meta.OpenParenthesisToken) - addMeta($$, $4.Meta, meta.CloseParenthesisToken) + $1.Meta.SetTokenName(meta.EmptyToken).AppendTo($$.GetMeta()) + $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) + $4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6628,9 +6790,9 @@ internal_functions_in_yacc: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - addMeta($$, $1.Meta, meta.EmptyToken) - addMeta($$, $2.Meta, meta.OpenParenthesisToken) - addMeta($$, $4.Meta, meta.CloseParenthesisToken) + $1.Meta.SetTokenName(meta.EmptyToken).AppendTo($$.GetMeta()) + $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) + $4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6642,7 +6804,7 @@ internal_functions_in_yacc: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - addMeta($$, $1.Meta, meta.IncludeToken) + $1.Meta.SetTokenName(meta.IncludeToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6654,7 +6816,7 @@ internal_functions_in_yacc: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - addMeta($$, $1.Meta, meta.IncludeOnceToken) + $1.Meta.SetTokenName(meta.IncludeOnceToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6666,9 +6828,9 @@ internal_functions_in_yacc: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - addMeta($$, $1.Meta, meta.EvalToken) - addMeta($$, $2.Meta, meta.OpenParenthesisToken) - addMeta($$, $4.Meta, meta.CloseParenthesisToken) + $1.Meta.SetTokenName(meta.EvalToken).AppendTo($$.GetMeta()) + $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) + $4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6680,7 +6842,7 @@ internal_functions_in_yacc: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - addMeta($$, $1.Meta, meta.RequireToken) + $1.Meta.SetTokenName(meta.RequireToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6692,7 +6854,7 @@ internal_functions_in_yacc: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - addMeta($$, $1.Meta, meta.RequireOnceToken) + $1.Meta.SetTokenName(meta.RequireOnceToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6710,7 +6872,7 @@ isset_variables: $$ = append($1, $3) // save comments - addMeta(lastNode($1), $2.Meta, meta.NodeEnd) + $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6742,8 +6904,8 @@ class_constant: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.PaamayimNekudotayimToken) - addMeta(target, $3.Meta, meta.IdentifierToken) + $2.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.IdentifierToken).AppendTo(target.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6757,8 +6919,8 @@ class_constant: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.PaamayimNekudotayimToken) - addMeta(target, $3.Meta, meta.IdentifierToken) + $2.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.IdentifierToken).AppendTo(target.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6775,8 +6937,8 @@ static_class_name_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.PaamayimNekudotayimToken) - addMeta(target, $3.Meta, meta.IdentifierToken) + $2.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.IdentifierToken).AppendTo(target.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6793,8 +6955,8 @@ class_name_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.PaamayimNekudotayimToken) - addMeta(target, $3.Meta, meta.IdentifierToken) + $2.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.IdentifierToken).AppendTo(target.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php5/php5_test.go b/php5/php5_test.go index 1610058..33eebe8 100644 --- a/php5/php5_test.go +++ b/php5/php5_test.go @@ -481,6 +481,7 @@ func TestPhp5(t *testing.T) { StartPos: 10, EndPos: 11, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 2, @@ -508,6 +509,7 @@ func TestPhp5(t *testing.T) { StartPos: 17, EndPos: 18, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 2, @@ -544,6 +546,7 @@ func TestPhp5(t *testing.T) { StartPos: 24, EndPos: 27, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 3, @@ -578,6 +581,7 @@ func TestPhp5(t *testing.T) { StartPos: 29, EndPos: 30, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 3, @@ -605,6 +609,7 @@ func TestPhp5(t *testing.T) { StartPos: 36, EndPos: 37, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 3, @@ -641,6 +646,7 @@ func TestPhp5(t *testing.T) { StartPos: 43, EndPos: 46, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 4, @@ -684,6 +690,7 @@ func TestPhp5(t *testing.T) { StartPos: 53, EndPos: 54, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 4, @@ -711,6 +718,7 @@ func TestPhp5(t *testing.T) { StartPos: 60, EndPos: 61, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 4, @@ -792,6 +800,7 @@ func TestPhp5(t *testing.T) { StartPos: 76, EndPos: 77, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 5, @@ -819,6 +828,7 @@ func TestPhp5(t *testing.T) { StartPos: 83, EndPos: 84, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 5, @@ -855,6 +865,7 @@ func TestPhp5(t *testing.T) { StartPos: 90, EndPos: 93, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 6, @@ -898,6 +909,7 @@ func TestPhp5(t *testing.T) { StartPos: 100, EndPos: 101, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 6, @@ -925,6 +937,7 @@ func TestPhp5(t *testing.T) { StartPos: 107, EndPos: 108, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 6, @@ -997,6 +1010,7 @@ func TestPhp5(t *testing.T) { StartPos: 122, EndPos: 123, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 7, @@ -1024,6 +1038,7 @@ func TestPhp5(t *testing.T) { StartPos: 129, EndPos: 130, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 7, @@ -1046,8 +1061,8 @@ func TestPhp5(t *testing.T) { StartPos: 137, EndPos: 180, }, - ReturnsRef: false, PhpDocComment: "", + ReturnsRef: false, FunctionName: &node.Identifier{ Position: &position.Position{ StartLine: 9, @@ -1093,6 +1108,7 @@ func TestPhp5(t *testing.T) { StartPos: 154, EndPos: 157, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 9, @@ -1166,6 +1182,7 @@ func TestPhp5(t *testing.T) { StartPos: 173, EndPos: 176, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 9, @@ -1205,8 +1222,8 @@ func TestPhp5(t *testing.T) { StartPos: 195, EndPos: 245, }, - ReturnsRef: false, PhpDocComment: "", + ReturnsRef: false, MethodName: &node.Identifier{ Position: &position.Position{ StartLine: 10, @@ -1263,6 +1280,7 @@ func TestPhp5(t *testing.T) { StartPos: 219, EndPos: 222, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 10, @@ -1308,8 +1326,8 @@ func TestPhp5(t *testing.T) { StartPos: 230, EndPos: 241, }, - ByRef: true, Variadic: true, + ByRef: true, VariableType: &name.Name{ Position: &position.Position{ StartLine: 10, @@ -1336,6 +1354,7 @@ func TestPhp5(t *testing.T) { StartPos: 238, EndPos: 241, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 10, @@ -1374,9 +1393,9 @@ func TestPhp5(t *testing.T) { StartPos: 250, EndPos: 289, }, - ReturnsRef: false, Static: false, PhpDocComment: "", + ReturnsRef: false, Params: []node.Node{ &node.Parameter{ Position: &position.Position{ @@ -1413,6 +1432,7 @@ func TestPhp5(t *testing.T) { StartPos: 263, EndPos: 266, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 11, @@ -1486,6 +1506,7 @@ func TestPhp5(t *testing.T) { StartPos: 282, EndPos: 285, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 11, @@ -1515,9 +1536,9 @@ func TestPhp5(t *testing.T) { StartPos: 294, EndPos: 340, }, + PhpDocComment: "", ReturnsRef: false, Static: true, - PhpDocComment: "", Params: []node.Node{ &node.Parameter{ Position: &position.Position{ @@ -1526,8 +1547,8 @@ func TestPhp5(t *testing.T) { StartPos: 310, EndPos: 322, }, - ByRef: false, Variadic: false, + ByRef: false, VariableType: &name.Name{ Position: &position.Position{ StartLine: 12, @@ -1554,6 +1575,7 @@ func TestPhp5(t *testing.T) { StartPos: 314, EndPos: 317, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 12, @@ -1627,6 +1649,7 @@ func TestPhp5(t *testing.T) { StartPos: 333, EndPos: 336, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 12, @@ -1928,6 +1951,7 @@ func TestPhp5(t *testing.T) { StartPos: 700, EndPos: 703, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 30, @@ -1979,6 +2003,7 @@ func TestPhp5(t *testing.T) { StartPos: 715, EndPos: 718, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 31, @@ -2040,6 +2065,7 @@ func TestPhp5(t *testing.T) { StartPos: 733, EndPos: 736, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 32, @@ -2101,6 +2127,7 @@ func TestPhp5(t *testing.T) { StartPos: 790, EndPos: 793, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 33, @@ -2162,6 +2189,7 @@ func TestPhp5(t *testing.T) { StartPos: 810, EndPos: 813, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 34, @@ -2179,6 +2207,7 @@ func TestPhp5(t *testing.T) { StartPos: 815, EndPos: 818, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 34, @@ -2215,6 +2244,7 @@ func TestPhp5(t *testing.T) { StartPos: 826, EndPos: 829, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 35, @@ -2241,6 +2271,7 @@ func TestPhp5(t *testing.T) { StartPos: 831, EndPos: 834, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 35, @@ -2292,6 +2323,7 @@ func TestPhp5(t *testing.T) { StartPos: 846, EndPos: 849, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 36, @@ -2355,6 +2387,7 @@ func TestPhp5(t *testing.T) { StartPos: 868, EndPos: 873, }, + StringVar: true, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 37, @@ -2406,6 +2439,7 @@ func TestPhp5(t *testing.T) { StartPos: 887, EndPos: 889, }, + StringVar: true, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 38, @@ -2467,6 +2501,7 @@ func TestPhp5(t *testing.T) { StartPos: 906, EndPos: 909, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 39, @@ -2512,6 +2547,7 @@ func TestPhp5(t *testing.T) { StartPos: 928, EndPos: 929, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 41, @@ -2546,6 +2582,7 @@ func TestPhp5(t *testing.T) { StartPos: 949, EndPos: 950, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 43, @@ -2580,6 +2617,7 @@ func TestPhp5(t *testing.T) { StartPos: 965, EndPos: 966, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 44, @@ -2616,6 +2654,7 @@ func TestPhp5(t *testing.T) { StartPos: 985, EndPos: 986, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 46, @@ -2667,6 +2706,7 @@ func TestPhp5(t *testing.T) { StartPos: 1014, EndPos: 1015, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 49, @@ -2701,6 +2741,7 @@ func TestPhp5(t *testing.T) { StartPos: 1030, EndPos: 1031, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 50, @@ -2735,6 +2776,7 @@ func TestPhp5(t *testing.T) { StartPos: 1045, EndPos: 1046, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 51, @@ -3788,6 +3830,7 @@ func TestPhp5(t *testing.T) { StartPos: 1684, EndPos: 1712, }, + Alt: true, Consts: []node.Node{ &stmt.Constant{ Position: &position.Position{ @@ -3819,10 +3862,10 @@ func TestPhp5(t *testing.T) { }, Stmt: &stmt.StmtList{ Position: &position.Position{ - StartLine: 73, - EndLine: 73, - StartPos: 1700, - EndPos: 1712, + StartLine: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, }, Stmts: []node.Node{}, }, @@ -3868,6 +3911,7 @@ func TestPhp5(t *testing.T) { StartPos: 1739, EndPos: 1740, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 75, @@ -3904,6 +3948,7 @@ func TestPhp5(t *testing.T) { StartPos: 1753, EndPos: 1754, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 76, @@ -3938,6 +3983,7 @@ func TestPhp5(t *testing.T) { StartPos: 1764, EndPos: 1765, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 77, @@ -3974,6 +4020,7 @@ func TestPhp5(t *testing.T) { StartPos: 1772, EndPos: 1773, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 77, @@ -4010,6 +4057,7 @@ func TestPhp5(t *testing.T) { StartPos: 1781, EndPos: 1782, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 77, @@ -4035,6 +4083,7 @@ func TestPhp5(t *testing.T) { StartPos: 1787, EndPos: 1788, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 77, @@ -4079,6 +4128,7 @@ func TestPhp5(t *testing.T) { StartPos: 1804, EndPos: 1805, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 78, @@ -4115,6 +4165,7 @@ func TestPhp5(t *testing.T) { StartPos: 1813, EndPos: 1814, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 78, @@ -4151,6 +4202,7 @@ func TestPhp5(t *testing.T) { StartPos: 1840, EndPos: 1841, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 79, @@ -4168,6 +4220,7 @@ func TestPhp5(t *testing.T) { StartPos: 1846, EndPos: 1847, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 79, @@ -4211,6 +4264,7 @@ func TestPhp5(t *testing.T) { StartPos: 1870, EndPos: 1871, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 80, @@ -4245,6 +4299,7 @@ func TestPhp5(t *testing.T) { StartPos: 1888, EndPos: 1889, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 81, @@ -4262,6 +4317,7 @@ func TestPhp5(t *testing.T) { StartPos: 1894, EndPos: 1895, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 81, @@ -4296,6 +4352,7 @@ func TestPhp5(t *testing.T) { StartPos: 1923, EndPos: 1924, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 82, @@ -4313,6 +4370,7 @@ func TestPhp5(t *testing.T) { StartPos: 1929, EndPos: 1930, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 82, @@ -4330,6 +4388,7 @@ func TestPhp5(t *testing.T) { StartPos: 1935, EndPos: 1936, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 82, @@ -4373,6 +4432,7 @@ func TestPhp5(t *testing.T) { StartPos: 1959, EndPos: 1960, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 83, @@ -4390,6 +4450,7 @@ func TestPhp5(t *testing.T) { StartPos: 1965, EndPos: 1966, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 83, @@ -4424,6 +4485,7 @@ func TestPhp5(t *testing.T) { StartPos: 1983, EndPos: 1984, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 84, @@ -4441,6 +4503,7 @@ func TestPhp5(t *testing.T) { StartPos: 1989, EndPos: 1990, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 84, @@ -4465,6 +4528,7 @@ func TestPhp5(t *testing.T) { StartPos: 1996, EndPos: 1997, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 84, @@ -4500,6 +4564,7 @@ func TestPhp5(t *testing.T) { StartPos: 2014, EndPos: 2015, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 85, @@ -4517,6 +4582,7 @@ func TestPhp5(t *testing.T) { StartPos: 2020, EndPos: 2021, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 85, @@ -4549,6 +4615,7 @@ func TestPhp5(t *testing.T) { StartPos: 2031, EndPos: 2032, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 85, @@ -4599,8 +4666,8 @@ func TestPhp5(t *testing.T) { StartPos: 2062, EndPos: 2132, }, - ReturnsRef: false, PhpDocComment: "", + ReturnsRef: false, FunctionName: &node.Identifier{ Position: &position.Position{ StartLine: 88, @@ -4618,8 +4685,8 @@ func TestPhp5(t *testing.T) { StartPos: 2082, EndPos: 2098, }, - ReturnsRef: false, PhpDocComment: "", + ReturnsRef: false, FunctionName: &node.Identifier{ Position: &position.Position{ StartLine: 89, @@ -4664,6 +4731,7 @@ func TestPhp5(t *testing.T) { StartPos: 2126, EndPos: 2127, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 91, @@ -4721,6 +4789,7 @@ func TestPhp5(t *testing.T) { StartPos: 2158, EndPos: 2159, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 94, @@ -4757,6 +4826,7 @@ func TestPhp5(t *testing.T) { StartPos: 2171, EndPos: 2172, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 94, @@ -4825,8 +4895,8 @@ func TestPhp5(t *testing.T) { StartPos: 2217, EndPos: 2234, }, - ReturnsRef: true, PhpDocComment: "", + ReturnsRef: true, FunctionName: &node.Identifier{ Position: &position.Position{ StartLine: 96, @@ -4853,6 +4923,7 @@ func TestPhp5(t *testing.T) { StartPos: 2245, EndPos: 2246, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 97, @@ -4870,6 +4941,7 @@ func TestPhp5(t *testing.T) { StartPos: 2249, EndPos: 2250, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 97, @@ -4887,6 +4959,7 @@ func TestPhp5(t *testing.T) { StartPos: 2253, EndPos: 2255, }, + StringVar: false, VarName: &expr.Variable{ Position: &position.Position{ StartLine: 97, @@ -4894,6 +4967,7 @@ func TestPhp5(t *testing.T) { StartPos: 2254, EndPos: 2255, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 97, @@ -4912,6 +4986,7 @@ func TestPhp5(t *testing.T) { StartPos: 2258, EndPos: 2265, }, + StringVar: false, VarName: &expr.FunctionCall{ Position: &position.Position{ StartLine: 97, @@ -4998,6 +5073,7 @@ func TestPhp5(t *testing.T) { StartPos: 2290, EndPos: 2291, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 100, @@ -5032,6 +5108,7 @@ func TestPhp5(t *testing.T) { StartPos: 2303, EndPos: 2304, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 101, @@ -5066,6 +5143,7 @@ func TestPhp5(t *testing.T) { StartPos: 2318, EndPos: 2319, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 101, @@ -5102,6 +5180,7 @@ func TestPhp5(t *testing.T) { StartPos: 2331, EndPos: 2332, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 102, @@ -5153,6 +5232,7 @@ func TestPhp5(t *testing.T) { StartPos: 2352, EndPos: 2353, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 103, @@ -5187,6 +5267,7 @@ func TestPhp5(t *testing.T) { StartPos: 2367, EndPos: 2368, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 103, @@ -5221,6 +5302,7 @@ func TestPhp5(t *testing.T) { StartPos: 2382, EndPos: 2383, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 103, @@ -5274,6 +5356,7 @@ func TestPhp5(t *testing.T) { StartPos: 2403, EndPos: 2404, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 104, @@ -5308,6 +5391,7 @@ func TestPhp5(t *testing.T) { StartPos: 2418, EndPos: 2419, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 104, @@ -5350,6 +5434,7 @@ func TestPhp5(t *testing.T) { StartPos: 2434, EndPos: 2435, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 104, @@ -5665,6 +5750,7 @@ func TestPhp5(t *testing.T) { StartPos: 2627, EndPos: 2628, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 112, @@ -5741,6 +5827,7 @@ func TestPhp5(t *testing.T) { StartPos: 2659, EndPos: 2660, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 113, @@ -5767,6 +5854,7 @@ func TestPhp5(t *testing.T) { StartPos: 2663, EndPos: 2664, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 113, @@ -5852,6 +5940,7 @@ func TestPhp5(t *testing.T) { StartPos: 2699, EndPos: 2700, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 114, @@ -5887,6 +5976,7 @@ func TestPhp5(t *testing.T) { StartPos: 2707, EndPos: 2708, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 114, @@ -5924,6 +6014,7 @@ func TestPhp5(t *testing.T) { StartPos: 2721, EndPos: 2722, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 115, @@ -5949,6 +6040,7 @@ func TestPhp5(t *testing.T) { StartPos: 2725, EndPos: 2726, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 115, @@ -5993,6 +6085,7 @@ func TestPhp5(t *testing.T) { StartPos: 2742, EndPos: 2743, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 116, @@ -6027,6 +6120,7 @@ func TestPhp5(t *testing.T) { StartPos: 2750, EndPos: 2751, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 116, @@ -6351,6 +6445,7 @@ func TestPhp5(t *testing.T) { StartPos: 2994, EndPos: 2995, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 138, @@ -7016,6 +7111,7 @@ func TestPhp5(t *testing.T) { StartPos: 3286, EndPos: 3287, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 147, @@ -7074,6 +7170,7 @@ func TestPhp5(t *testing.T) { StartPos: 3319, EndPos: 3320, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 148, @@ -7121,6 +7218,7 @@ func TestPhp5(t *testing.T) { StartPos: 3350, EndPos: 3351, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 148, @@ -7179,6 +7277,7 @@ func TestPhp5(t *testing.T) { StartPos: 3383, EndPos: 3384, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 149, @@ -7226,6 +7325,7 @@ func TestPhp5(t *testing.T) { StartPos: 3415, EndPos: 3416, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 149, @@ -7273,6 +7373,7 @@ func TestPhp5(t *testing.T) { StartPos: 3457, EndPos: 3458, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 149, @@ -7331,6 +7432,7 @@ func TestPhp5(t *testing.T) { StartPos: 3490, EndPos: 3491, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 150, @@ -7369,6 +7471,7 @@ func TestPhp5(t *testing.T) { StartPos: 3517, EndPos: 3518, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 152, @@ -7386,6 +7489,7 @@ func TestPhp5(t *testing.T) { StartPos: 3521, EndPos: 3522, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 152, @@ -8004,6 +8108,7 @@ func TestPhp5(t *testing.T) { StartPos: 3737, EndPos: 3738, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 164, @@ -8053,6 +8158,7 @@ func TestPhp5(t *testing.T) { StartPos: 3746, EndPos: 3747, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 165, @@ -8198,6 +8304,7 @@ func TestPhp5(t *testing.T) { StartPos: 3794, EndPos: 3795, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 168, @@ -8259,6 +8366,7 @@ func TestPhp5(t *testing.T) { StartPos: 3813, EndPos: 3814, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 169, @@ -8310,6 +8418,7 @@ func TestPhp5(t *testing.T) { StartPos: 3827, EndPos: 3828, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 170, @@ -8395,6 +8504,7 @@ func TestPhp5(t *testing.T) { StartPos: 3845, EndPos: 3846, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 170, @@ -8431,6 +8541,7 @@ func TestPhp5(t *testing.T) { StartPos: 3853, EndPos: 3854, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 171, @@ -8464,6 +8575,7 @@ func TestPhp5(t *testing.T) { StartPos: 3860, EndPos: 3861, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 172, @@ -8541,6 +8653,7 @@ func TestPhp5(t *testing.T) { StartPos: 3885, EndPos: 3886, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 175, @@ -8574,6 +8687,7 @@ func TestPhp5(t *testing.T) { StartPos: 3898, EndPos: 3899, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 176, @@ -8600,9 +8714,9 @@ func TestPhp5(t *testing.T) { StartPos: 3904, EndPos: 3915, }, + PhpDocComment: "", ReturnsRef: false, Static: false, - PhpDocComment: "", Stmts: []node.Node{}, }, }, @@ -8631,8 +8745,8 @@ func TestPhp5(t *testing.T) { StartPos: 3929, EndPos: 3930, }, - Variadic: false, ByRef: false, + Variadic: false, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 178, @@ -8640,6 +8754,7 @@ func TestPhp5(t *testing.T) { StartPos: 3929, EndPos: 3930, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 178, @@ -8658,8 +8773,8 @@ func TestPhp5(t *testing.T) { StartPos: 3933, EndPos: 3934, }, - Variadic: false, ByRef: false, + Variadic: false, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 178, @@ -8667,6 +8782,7 @@ func TestPhp5(t *testing.T) { StartPos: 3933, EndPos: 3934, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 178, @@ -8694,6 +8810,7 @@ func TestPhp5(t *testing.T) { StartPos: 3942, EndPos: 3943, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 178, @@ -8718,6 +8835,7 @@ func TestPhp5(t *testing.T) { StartPos: 3947, EndPos: 3948, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 178, @@ -8768,6 +8886,7 @@ func TestPhp5(t *testing.T) { StartPos: 3966, EndPos: 3967, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 179, @@ -8795,6 +8914,7 @@ func TestPhp5(t *testing.T) { StartPos: 3970, EndPos: 3971, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 179, @@ -8829,6 +8949,7 @@ func TestPhp5(t *testing.T) { StartPos: 3980, EndPos: 3981, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 179, @@ -8847,6 +8968,7 @@ func TestPhp5(t *testing.T) { StartPos: 3984, EndPos: 3985, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 179, @@ -9008,6 +9130,7 @@ func TestPhp5(t *testing.T) { StartPos: 4050, EndPos: 4051, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 185, @@ -9084,6 +9207,7 @@ func TestPhp5(t *testing.T) { StartPos: 4072, EndPos: 4073, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 187, @@ -9117,6 +9241,7 @@ func TestPhp5(t *testing.T) { StartPos: 4083, EndPos: 4084, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 188, @@ -9168,6 +9293,7 @@ func TestPhp5(t *testing.T) { StartPos: 4103, EndPos: 4104, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 190, @@ -9219,6 +9345,7 @@ func TestPhp5(t *testing.T) { StartPos: 4123, EndPos: 4124, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 192, @@ -9331,6 +9458,7 @@ func TestPhp5(t *testing.T) { StartPos: 4154, EndPos: 4155, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 194, @@ -9431,6 +9559,7 @@ func TestPhp5(t *testing.T) { StartPos: 4173, EndPos: 4176, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 196, @@ -9472,6 +9601,7 @@ func TestPhp5(t *testing.T) { StartPos: 4184, EndPos: 4185, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 196, @@ -9509,6 +9639,7 @@ func TestPhp5(t *testing.T) { StartPos: 4192, EndPos: 4193, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 198, @@ -9542,6 +9673,7 @@ func TestPhp5(t *testing.T) { StartPos: 4200, EndPos: 4201, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 199, @@ -9575,6 +9707,7 @@ func TestPhp5(t *testing.T) { StartPos: 4210, EndPos: 4211, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 200, @@ -9608,6 +9741,7 @@ func TestPhp5(t *testing.T) { StartPos: 4218, EndPos: 4219, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 201, @@ -9641,6 +9775,7 @@ func TestPhp5(t *testing.T) { StartPos: 4233, EndPos: 4234, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 203, @@ -9674,6 +9809,7 @@ func TestPhp5(t *testing.T) { StartPos: 4252, EndPos: 4253, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 204, @@ -9707,6 +9843,7 @@ func TestPhp5(t *testing.T) { StartPos: 4266, EndPos: 4267, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 205, @@ -9740,6 +9877,7 @@ func TestPhp5(t *testing.T) { StartPos: 4285, EndPos: 4286, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 206, @@ -9773,6 +9911,7 @@ func TestPhp5(t *testing.T) { StartPos: 4292, EndPos: 4293, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 208, @@ -9825,6 +9964,7 @@ func TestPhp5(t *testing.T) { StartPos: 4313, EndPos: 4314, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 209, @@ -9877,6 +10017,7 @@ func TestPhp5(t *testing.T) { StartPos: 4344, EndPos: 4345, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 210, @@ -9930,6 +10071,7 @@ func TestPhp5(t *testing.T) { StartPos: 4373, EndPos: 4374, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 212, @@ -9947,6 +10089,7 @@ func TestPhp5(t *testing.T) { StartPos: 4377, EndPos: 4378, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 212, @@ -10035,6 +10178,7 @@ func TestPhp5(t *testing.T) { StartPos: 4407, EndPos: 4408, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 214, @@ -10083,6 +10227,7 @@ func TestPhp5(t *testing.T) { StartPos: 4418, EndPos: 4419, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 215, @@ -10108,6 +10253,7 @@ func TestPhp5(t *testing.T) { StartPos: 4422, EndPos: 4423, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 215, @@ -10128,6 +10274,7 @@ func TestPhp5(t *testing.T) { StartPos: 4428, EndPos: 4429, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 215, @@ -10183,6 +10330,7 @@ func TestPhp5(t *testing.T) { StartPos: 4439, EndPos: 4440, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 216, @@ -10204,6 +10352,7 @@ func TestPhp5(t *testing.T) { StartPos: 4447, EndPos: 4448, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 216, @@ -10267,6 +10416,7 @@ func TestPhp5(t *testing.T) { StartPos: 4463, EndPos: 4464, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 217, @@ -10290,6 +10440,7 @@ func TestPhp5(t *testing.T) { StartPos: 4470, EndPos: 4471, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 217, @@ -10323,6 +10474,7 @@ func TestPhp5(t *testing.T) { StartPos: 4477, EndPos: 4478, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 219, @@ -10494,6 +10646,7 @@ func TestPhp5(t *testing.T) { StartPos: 4544, EndPos: 4545, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 223, @@ -10527,6 +10680,7 @@ func TestPhp5(t *testing.T) { StartPos: 4551, EndPos: 4552, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 224, @@ -10576,6 +10730,7 @@ func TestPhp5(t *testing.T) { StartPos: 4562, EndPos: 4563, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 225, @@ -10656,6 +10811,7 @@ func TestPhp5(t *testing.T) { StartPos: 4576, EndPos: 4577, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 226, @@ -10760,6 +10916,7 @@ func TestPhp5(t *testing.T) { StartPos: 4608, EndPos: 4609, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 227, @@ -10840,6 +10997,7 @@ func TestPhp5(t *testing.T) { StartPos: 4632, EndPos: 4633, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 228, @@ -11005,6 +11163,7 @@ func TestPhp5(t *testing.T) { StartPos: 4675, EndPos: 4676, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 233, @@ -11217,6 +11376,7 @@ func TestPhp5(t *testing.T) { StartPos: 4742, EndPos: 4745, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 238, @@ -11258,6 +11418,7 @@ func TestPhp5(t *testing.T) { StartPos: 4752, EndPos: 4755, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 239, @@ -11275,6 +11436,7 @@ func TestPhp5(t *testing.T) { StartPos: 4758, EndPos: 4761, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 239, @@ -11335,6 +11497,7 @@ func TestPhp5(t *testing.T) { StartPos: 4773, EndPos: 4776, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 240, @@ -11387,6 +11550,7 @@ func TestPhp5(t *testing.T) { StartPos: 4796, EndPos: 4799, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 241, @@ -11439,6 +11603,7 @@ func TestPhp5(t *testing.T) { StartPos: 4810, EndPos: 4813, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 242, @@ -11472,6 +11637,7 @@ func TestPhp5(t *testing.T) { StartPos: 4818, EndPos: 4819, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 243, @@ -11489,6 +11655,7 @@ func TestPhp5(t *testing.T) { StartPos: 4823, EndPos: 4824, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 243, @@ -11506,6 +11673,7 @@ func TestPhp5(t *testing.T) { StartPos: 4828, EndPos: 4829, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 243, @@ -11539,6 +11707,7 @@ func TestPhp5(t *testing.T) { StartPos: 4834, EndPos: 4835, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 244, @@ -11556,6 +11725,7 @@ func TestPhp5(t *testing.T) { StartPos: 4841, EndPos: 4842, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 244, @@ -11589,6 +11759,7 @@ func TestPhp5(t *testing.T) { StartPos: 4847, EndPos: 4848, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 245, @@ -11613,6 +11784,7 @@ func TestPhp5(t *testing.T) { StartPos: 4852, EndPos: 4853, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 245, @@ -11630,6 +11802,7 @@ func TestPhp5(t *testing.T) { StartPos: 4857, EndPos: 4858, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 245, @@ -11647,6 +11820,7 @@ func TestPhp5(t *testing.T) { StartPos: 4862, EndPos: 4863, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 245, @@ -11665,6 +11839,7 @@ func TestPhp5(t *testing.T) { StartPos: 4867, EndPos: 4868, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 245, @@ -11705,6 +11880,7 @@ func TestPhp5(t *testing.T) { StartPos: 4873, EndPos: 4874, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 246, @@ -11722,6 +11898,7 @@ func TestPhp5(t *testing.T) { StartPos: 4878, EndPos: 4879, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 246, @@ -11739,6 +11916,7 @@ func TestPhp5(t *testing.T) { StartPos: 4883, EndPos: 4884, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 246, @@ -11757,6 +11935,7 @@ func TestPhp5(t *testing.T) { StartPos: 4888, EndPos: 4889, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 246, @@ -11774,6 +11953,7 @@ func TestPhp5(t *testing.T) { StartPos: 4893, EndPos: 4894, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 246, @@ -11807,6 +11987,7 @@ func TestPhp5(t *testing.T) { StartPos: 4900, EndPos: 4901, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 247, @@ -11840,6 +12021,7 @@ func TestPhp5(t *testing.T) { StartPos: 4907, EndPos: 4908, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 248, @@ -11866,6 +12048,7 @@ func TestPhp5(t *testing.T) { StartPos: 4913, EndPos: 4915, }, + StringVar: false, VarName: &expr.Variable{ Position: &position.Position{ StartLine: 249, @@ -11873,6 +12056,7 @@ func TestPhp5(t *testing.T) { StartPos: 4914, EndPos: 4915, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 249, @@ -11899,6 +12083,7 @@ func TestPhp5(t *testing.T) { StartPos: 4920, EndPos: 4923, }, + StringVar: false, VarName: &expr.Variable{ Position: &position.Position{ StartLine: 250, @@ -11906,6 +12091,7 @@ func TestPhp5(t *testing.T) { StartPos: 4921, EndPos: 4923, }, + StringVar: false, VarName: &expr.Variable{ Position: &position.Position{ StartLine: 250, @@ -11913,6 +12099,7 @@ func TestPhp5(t *testing.T) { StartPos: 4922, EndPos: 4923, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 250, @@ -11963,6 +12150,7 @@ func TestPhp5(t *testing.T) { StartPos: 4943, EndPos: 4944, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 252, @@ -11996,6 +12184,7 @@ func TestPhp5(t *testing.T) { StartPos: 4955, EndPos: 4956, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 253, @@ -12013,6 +12202,7 @@ func TestPhp5(t *testing.T) { StartPos: 4961, EndPos: 4962, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 253, @@ -12098,6 +12288,7 @@ func TestPhp5(t *testing.T) { StartPos: 4993, EndPos: 4994, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 255, @@ -12167,6 +12358,7 @@ func TestPhp5(t *testing.T) { StartPos: 5023, EndPos: 5024, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 257, @@ -12200,6 +12392,7 @@ func TestPhp5(t *testing.T) { StartPos: 5038, EndPos: 5039, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 258, @@ -12233,6 +12426,7 @@ func TestPhp5(t *testing.T) { StartPos: 5050, EndPos: 5051, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 259, @@ -12266,6 +12460,7 @@ func TestPhp5(t *testing.T) { StartPos: 5064, EndPos: 5065, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 260, @@ -12299,6 +12494,7 @@ func TestPhp5(t *testing.T) { StartPos: 5077, EndPos: 5078, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 261, @@ -12332,6 +12528,7 @@ func TestPhp5(t *testing.T) { StartPos: 5092, EndPos: 5093, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 262, @@ -12365,6 +12562,7 @@ func TestPhp5(t *testing.T) { StartPos: 5103, EndPos: 5104, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 263, @@ -12398,6 +12596,7 @@ func TestPhp5(t *testing.T) { StartPos: 5117, EndPos: 5118, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 264, @@ -12431,6 +12630,7 @@ func TestPhp5(t *testing.T) { StartPos: 5131, EndPos: 5132, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 265, @@ -12464,6 +12664,7 @@ func TestPhp5(t *testing.T) { StartPos: 5144, EndPos: 5145, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 266, @@ -12497,6 +12698,7 @@ func TestPhp5(t *testing.T) { StartPos: 5151, EndPos: 5152, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 268, @@ -12514,6 +12716,7 @@ func TestPhp5(t *testing.T) { StartPos: 5156, EndPos: 5157, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 268, @@ -12547,6 +12750,7 @@ func TestPhp5(t *testing.T) { StartPos: 5162, EndPos: 5163, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 269, @@ -12564,6 +12768,7 @@ func TestPhp5(t *testing.T) { StartPos: 5167, EndPos: 5168, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 269, @@ -12597,6 +12802,7 @@ func TestPhp5(t *testing.T) { StartPos: 5173, EndPos: 5174, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 270, @@ -12614,6 +12820,7 @@ func TestPhp5(t *testing.T) { StartPos: 5178, EndPos: 5179, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 270, @@ -12647,6 +12854,7 @@ func TestPhp5(t *testing.T) { StartPos: 5184, EndPos: 5185, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 271, @@ -12664,6 +12872,7 @@ func TestPhp5(t *testing.T) { StartPos: 5190, EndPos: 5191, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 271, @@ -12697,6 +12906,7 @@ func TestPhp5(t *testing.T) { StartPos: 5196, EndPos: 5197, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 272, @@ -12714,6 +12924,7 @@ func TestPhp5(t *testing.T) { StartPos: 5202, EndPos: 5203, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 272, @@ -12747,6 +12958,7 @@ func TestPhp5(t *testing.T) { StartPos: 5208, EndPos: 5209, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 273, @@ -12764,6 +12976,7 @@ func TestPhp5(t *testing.T) { StartPos: 5213, EndPos: 5214, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 273, @@ -12797,6 +13010,7 @@ func TestPhp5(t *testing.T) { StartPos: 5219, EndPos: 5220, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 274, @@ -12814,6 +13028,7 @@ func TestPhp5(t *testing.T) { StartPos: 5224, EndPos: 5225, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 274, @@ -12847,6 +13062,7 @@ func TestPhp5(t *testing.T) { StartPos: 5230, EndPos: 5231, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 275, @@ -12864,6 +13080,7 @@ func TestPhp5(t *testing.T) { StartPos: 5236, EndPos: 5237, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 275, @@ -12897,6 +13114,7 @@ func TestPhp5(t *testing.T) { StartPos: 5242, EndPos: 5243, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 276, @@ -12914,6 +13132,7 @@ func TestPhp5(t *testing.T) { StartPos: 5248, EndPos: 5249, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 276, @@ -12947,6 +13166,7 @@ func TestPhp5(t *testing.T) { StartPos: 5254, EndPos: 5255, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 277, @@ -12964,6 +13184,7 @@ func TestPhp5(t *testing.T) { StartPos: 5259, EndPos: 5260, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 277, @@ -12997,6 +13218,7 @@ func TestPhp5(t *testing.T) { StartPos: 5265, EndPos: 5266, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 278, @@ -13014,6 +13236,7 @@ func TestPhp5(t *testing.T) { StartPos: 5272, EndPos: 5273, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 278, @@ -13047,6 +13270,7 @@ func TestPhp5(t *testing.T) { StartPos: 5278, EndPos: 5279, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 279, @@ -13064,6 +13288,7 @@ func TestPhp5(t *testing.T) { StartPos: 5285, EndPos: 5286, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 279, @@ -13097,6 +13322,7 @@ func TestPhp5(t *testing.T) { StartPos: 5291, EndPos: 5292, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 280, @@ -13114,6 +13340,7 @@ func TestPhp5(t *testing.T) { StartPos: 5297, EndPos: 5298, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 280, @@ -13147,6 +13374,7 @@ func TestPhp5(t *testing.T) { StartPos: 5303, EndPos: 5304, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 281, @@ -13164,6 +13392,7 @@ func TestPhp5(t *testing.T) { StartPos: 5310, EndPos: 5311, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 281, @@ -13197,6 +13426,7 @@ func TestPhp5(t *testing.T) { StartPos: 5316, EndPos: 5317, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 282, @@ -13214,6 +13444,7 @@ func TestPhp5(t *testing.T) { StartPos: 5321, EndPos: 5322, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 282, @@ -13247,6 +13478,7 @@ func TestPhp5(t *testing.T) { StartPos: 5327, EndPos: 5328, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 283, @@ -13264,6 +13496,7 @@ func TestPhp5(t *testing.T) { StartPos: 5332, EndPos: 5333, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 283, @@ -13297,6 +13530,7 @@ func TestPhp5(t *testing.T) { StartPos: 5338, EndPos: 5339, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 284, @@ -13314,6 +13548,7 @@ func TestPhp5(t *testing.T) { StartPos: 5343, EndPos: 5344, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 284, @@ -13347,6 +13582,7 @@ func TestPhp5(t *testing.T) { StartPos: 5349, EndPos: 5350, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 285, @@ -13364,6 +13600,7 @@ func TestPhp5(t *testing.T) { StartPos: 5355, EndPos: 5356, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 285, @@ -13397,6 +13634,7 @@ func TestPhp5(t *testing.T) { StartPos: 5361, EndPos: 5362, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 286, @@ -13414,6 +13652,7 @@ func TestPhp5(t *testing.T) { StartPos: 5368, EndPos: 5369, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 286, @@ -13447,6 +13686,7 @@ func TestPhp5(t *testing.T) { StartPos: 5374, EndPos: 5375, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 287, @@ -13464,6 +13704,7 @@ func TestPhp5(t *testing.T) { StartPos: 5379, EndPos: 5380, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 287, @@ -13497,6 +13738,7 @@ func TestPhp5(t *testing.T) { StartPos: 5385, EndPos: 5386, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 288, @@ -13514,6 +13756,7 @@ func TestPhp5(t *testing.T) { StartPos: 5391, EndPos: 5392, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 288, @@ -13547,6 +13790,7 @@ func TestPhp5(t *testing.T) { StartPos: 5397, EndPos: 5398, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 289, @@ -13564,6 +13808,7 @@ func TestPhp5(t *testing.T) { StartPos: 5403, EndPos: 5404, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 289, @@ -13597,6 +13842,7 @@ func TestPhp5(t *testing.T) { StartPos: 5409, EndPos: 5410, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 290, @@ -13614,6 +13860,7 @@ func TestPhp5(t *testing.T) { StartPos: 5415, EndPos: 5416, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 290, @@ -13647,6 +13894,7 @@ func TestPhp5(t *testing.T) { StartPos: 5421, EndPos: 5422, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 291, @@ -13664,6 +13912,7 @@ func TestPhp5(t *testing.T) { StartPos: 5427, EndPos: 5428, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 291, @@ -13697,6 +13946,7 @@ func TestPhp5(t *testing.T) { StartPos: 5433, EndPos: 5434, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 292, @@ -13714,6 +13964,7 @@ func TestPhp5(t *testing.T) { StartPos: 5438, EndPos: 5439, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 292, @@ -13747,6 +13998,7 @@ func TestPhp5(t *testing.T) { StartPos: 5445, EndPos: 5446, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 294, @@ -13764,6 +14016,7 @@ func TestPhp5(t *testing.T) { StartPos: 5451, EndPos: 5452, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 294, @@ -13797,6 +14050,7 @@ func TestPhp5(t *testing.T) { StartPos: 5457, EndPos: 5458, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 295, @@ -13857,6 +14111,7 @@ func TestPhp5(t *testing.T) { StartPos: 5474, EndPos: 5475, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 296, @@ -13917,6 +14172,7 @@ func TestPhp5(t *testing.T) { StartPos: 5488, EndPos: 5489, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 296, @@ -13954,6 +14210,7 @@ func TestPhp5(t *testing.T) { StartPos: 5495, EndPos: 5496, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 297, @@ -13971,6 +14228,7 @@ func TestPhp5(t *testing.T) { StartPos: 5500, EndPos: 5501, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 297, @@ -14004,6 +14262,7 @@ func TestPhp5(t *testing.T) { StartPos: 5506, EndPos: 5507, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 298, @@ -14021,6 +14280,7 @@ func TestPhp5(t *testing.T) { StartPos: 5512, EndPos: 5513, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 298, @@ -14054,6 +14314,7 @@ func TestPhp5(t *testing.T) { StartPos: 5518, EndPos: 5519, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 299, @@ -14071,6 +14332,7 @@ func TestPhp5(t *testing.T) { StartPos: 5524, EndPos: 5525, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 299, @@ -14104,6 +14366,7 @@ func TestPhp5(t *testing.T) { StartPos: 5530, EndPos: 5531, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 300, @@ -14121,6 +14384,7 @@ func TestPhp5(t *testing.T) { StartPos: 5536, EndPos: 5537, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 300, @@ -14154,6 +14418,7 @@ func TestPhp5(t *testing.T) { StartPos: 5542, EndPos: 5543, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 301, @@ -14171,6 +14436,7 @@ func TestPhp5(t *testing.T) { StartPos: 5548, EndPos: 5549, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 301, @@ -14204,6 +14470,7 @@ func TestPhp5(t *testing.T) { StartPos: 5554, EndPos: 5555, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 302, @@ -14221,6 +14488,7 @@ func TestPhp5(t *testing.T) { StartPos: 5560, EndPos: 5561, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 302, @@ -14254,6 +14522,7 @@ func TestPhp5(t *testing.T) { StartPos: 5566, EndPos: 5567, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 303, @@ -14271,6 +14540,7 @@ func TestPhp5(t *testing.T) { StartPos: 5572, EndPos: 5573, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 303, @@ -14304,6 +14574,7 @@ func TestPhp5(t *testing.T) { StartPos: 5578, EndPos: 5579, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 304, @@ -14321,6 +14592,7 @@ func TestPhp5(t *testing.T) { StartPos: 5584, EndPos: 5585, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 304, @@ -14354,6 +14626,7 @@ func TestPhp5(t *testing.T) { StartPos: 5590, EndPos: 5591, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 305, @@ -14371,6 +14644,7 @@ func TestPhp5(t *testing.T) { StartPos: 5596, EndPos: 5597, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 305, @@ -14404,6 +14678,7 @@ func TestPhp5(t *testing.T) { StartPos: 5602, EndPos: 5603, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 306, @@ -14421,6 +14696,7 @@ func TestPhp5(t *testing.T) { StartPos: 5608, EndPos: 5609, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 306, @@ -14454,6 +14730,7 @@ func TestPhp5(t *testing.T) { StartPos: 5614, EndPos: 5615, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 307, @@ -14471,6 +14748,7 @@ func TestPhp5(t *testing.T) { StartPos: 5621, EndPos: 5622, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 307, @@ -14504,6 +14782,7 @@ func TestPhp5(t *testing.T) { StartPos: 5627, EndPos: 5628, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 308, @@ -14521,6 +14800,7 @@ func TestPhp5(t *testing.T) { StartPos: 5634, EndPos: 5635, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 308, @@ -14554,6 +14834,7 @@ func TestPhp5(t *testing.T) { StartPos: 5640, EndPos: 5641, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 309, @@ -14571,6 +14852,7 @@ func TestPhp5(t *testing.T) { StartPos: 5647, EndPos: 5648, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 309, @@ -15101,6 +15383,7 @@ func TestPhp5(t *testing.T) { StartPos: 5810, EndPos: 5813, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 322, @@ -15141,6 +15424,7 @@ func TestPhp5(t *testing.T) { StartPos: 5822, EndPos: 5825, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 323, @@ -15158,6 +15442,7 @@ func TestPhp5(t *testing.T) { StartPos: 5828, EndPos: 5831, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 323, @@ -15206,6 +15491,7 @@ func TestPhp5(t *testing.T) { StartPos: 5840, EndPos: 5844, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 324, @@ -15294,6 +15580,7 @@ func TestPhp5(t *testing.T) { StartPos: 5856, EndPos: 5860, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 325, @@ -15328,6 +15615,7 @@ func TestPhp5(t *testing.T) { StartPos: 5862, EndPos: 5863, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 325, @@ -15374,6 +15662,7 @@ func TestPhp5(t *testing.T) { StartPos: 5875, EndPos: 5876, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 325, @@ -15429,6 +15718,7 @@ func TestPhp5(t *testing.T) { StartPos: 5891, EndPos: 5892, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 325, @@ -15508,6 +15798,7 @@ func TestPhp5(t *testing.T) { StartPos: 5914, EndPos: 5915, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 327, @@ -15560,6 +15851,7 @@ func TestPhp5(t *testing.T) { StartPos: 5932, EndPos: 5933, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 328, @@ -15612,6 +15904,7 @@ func TestPhp5(t *testing.T) { StartPos: 5950, EndPos: 5951, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 329, @@ -15664,6 +15957,7 @@ func TestPhp5(t *testing.T) { StartPos: 5968, EndPos: 5969, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 330, @@ -15716,6 +16010,7 @@ func TestPhp5(t *testing.T) { StartPos: 5986, EndPos: 5987, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 331, @@ -15760,6 +16055,7 @@ func TestPhp5(t *testing.T) { StartPos: 6005, EndPos: 6006, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 332, @@ -15821,6 +16117,7 @@ func TestPhp5(t *testing.T) { StartPos: 6027, EndPos: 6028, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 333, @@ -15891,6 +16188,7 @@ func TestPhp5(t *testing.T) { StartPos: 6052, EndPos: 6053, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 334, @@ -15952,6 +16250,7 @@ func TestPhp5(t *testing.T) { StartPos: 6073, EndPos: 6074, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 335, @@ -16013,6 +16312,7 @@ func TestPhp5(t *testing.T) { StartPos: 6094, EndPos: 6095, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 336, @@ -16074,6 +16374,7 @@ func TestPhp5(t *testing.T) { StartPos: 6115, EndPos: 6116, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 337, @@ -16135,6 +16436,7 @@ func TestPhp5(t *testing.T) { StartPos: 6137, EndPos: 6138, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 338, @@ -16196,6 +16498,7 @@ func TestPhp5(t *testing.T) { StartPos: 6159, EndPos: 6160, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 339, @@ -16257,6 +16560,7 @@ func TestPhp5(t *testing.T) { StartPos: 6180, EndPos: 6181, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 340, @@ -16318,6 +16622,7 @@ func TestPhp5(t *testing.T) { StartPos: 6201, EndPos: 6202, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 341, @@ -16379,6 +16684,7 @@ func TestPhp5(t *testing.T) { StartPos: 6223, EndPos: 6224, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 342, @@ -16440,6 +16746,7 @@ func TestPhp5(t *testing.T) { StartPos: 6245, EndPos: 6246, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 343, @@ -16501,6 +16808,7 @@ func TestPhp5(t *testing.T) { StartPos: 6266, EndPos: 6267, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 344, @@ -16562,6 +16870,7 @@ func TestPhp5(t *testing.T) { StartPos: 6289, EndPos: 6290, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 345, @@ -16623,6 +16932,7 @@ func TestPhp5(t *testing.T) { StartPos: 6312, EndPos: 6313, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 346, @@ -16684,6 +16994,7 @@ func TestPhp5(t *testing.T) { StartPos: 6334, EndPos: 6335, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 347, @@ -16745,6 +17056,7 @@ func TestPhp5(t *testing.T) { StartPos: 6357, EndPos: 6358, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 348, @@ -16806,6 +17118,7 @@ func TestPhp5(t *testing.T) { StartPos: 6378, EndPos: 6379, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 349, @@ -16867,6 +17180,7 @@ func TestPhp5(t *testing.T) { StartPos: 6399, EndPos: 6400, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 350, @@ -16928,6 +17242,7 @@ func TestPhp5(t *testing.T) { StartPos: 6420, EndPos: 6421, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 351, @@ -16989,6 +17304,7 @@ func TestPhp5(t *testing.T) { StartPos: 6442, EndPos: 6443, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 352, @@ -17050,6 +17366,7 @@ func TestPhp5(t *testing.T) { StartPos: 6465, EndPos: 6466, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 353, @@ -17111,6 +17428,7 @@ func TestPhp5(t *testing.T) { StartPos: 6486, EndPos: 6487, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 354, @@ -17172,6 +17490,7 @@ func TestPhp5(t *testing.T) { StartPos: 6508, EndPos: 6509, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 355, @@ -17233,6 +17552,7 @@ func TestPhp5(t *testing.T) { StartPos: 6530, EndPos: 6531, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 356, @@ -17294,6 +17614,7 @@ func TestPhp5(t *testing.T) { StartPos: 6552, EndPos: 6553, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 357, @@ -17355,6 +17676,7 @@ func TestPhp5(t *testing.T) { StartPos: 6574, EndPos: 6575, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 358, @@ -17416,6 +17738,7 @@ func TestPhp5(t *testing.T) { StartPos: 6595, EndPos: 6596, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 359, @@ -17487,6 +17810,7 @@ func TestPhp5(t *testing.T) { StartPos: 6619, EndPos: 6620, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 360, @@ -17558,6 +17882,7 @@ func TestPhp5(t *testing.T) { StartPos: 6645, EndPos: 6646, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 361, @@ -17602,6 +17927,7 @@ func TestPhp5(t *testing.T) { StartPos: 6670, EndPos: 6671, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 362, @@ -17664,6 +17990,7 @@ func TestPhp5(t *testing.T) { StartPos: 6689, EndPos: 6690, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 363, @@ -17726,6 +18053,7 @@ func TestPhp5(t *testing.T) { StartPos: 6718, EndPos: 6719, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 364, @@ -17788,6 +18116,7 @@ func TestPhp5(t *testing.T) { StartPos: 6738, EndPos: 6739, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 365, @@ -17831,6 +18160,7 @@ func TestPhp5(t *testing.T) { StartPos: 6761, EndPos: 6762, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 366, @@ -17919,6 +18249,7 @@ func TestPhp5(t *testing.T) { StartPos: 6793, EndPos: 6794, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 367, @@ -18076,6 +18407,7 @@ func TestPhp5(t *testing.T) { StartPos: 6840, EndPos: 6844, }, + StringVar: false, VarName: &expr.Variable{ Position: &position.Position{ StartLine: 370, @@ -18083,6 +18415,7 @@ func TestPhp5(t *testing.T) { StartPos: 6841, EndPos: 6844, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 370, @@ -18117,6 +18450,7 @@ func TestPhp5(t *testing.T) { StartPos: 6850, EndPos: 6853, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 372, @@ -18172,6 +18506,7 @@ func TestPhp5(t *testing.T) { StartPos: 6860, EndPos: 6863, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 373, @@ -18233,6 +18568,7 @@ func TestPhp5(t *testing.T) { StartPos: 6876, EndPos: 6877, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 374, @@ -18250,6 +18586,7 @@ func TestPhp5(t *testing.T) { StartPos: 6879, EndPos: 6880, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 374, @@ -18276,6 +18613,7 @@ func TestPhp5(t *testing.T) { StartPos: 6886, EndPos: 6890, }, + StringVar: false, VarName: &expr.Variable{ Position: &position.Position{ StartLine: 375, @@ -18283,6 +18621,7 @@ func TestPhp5(t *testing.T) { StartPos: 6888, EndPos: 6889, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 375, @@ -18316,6 +18655,7 @@ func TestPhp5(t *testing.T) { StartPos: 6895, EndPos: 6898, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 376, @@ -18333,6 +18673,7 @@ func TestPhp5(t *testing.T) { StartPos: 6901, EndPos: 6906, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 376, @@ -18374,6 +18715,7 @@ func TestPhp5(t *testing.T) { StartPos: 6913, EndPos: 6916, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 377, diff --git a/php7/parser.go b/php7/parser.go index 0e24b0f..c850d0c 100644 --- a/php7/parser.go +++ b/php7/parser.go @@ -98,12 +98,34 @@ func isDollar(r rune) bool { return r == '$' } -func addMeta(n node.Node, mm []meta.Meta, tn meta.TokenName) { - for _, m := range mm { - m.SetTokenName(tn) +func (l *Parser) appendMetaToken(n node.Node, t *scanner.Token, tn meta.TokenName) { + if !l.Lexer.WithMeta { + return } - n.AddMeta(mm) + m := &meta.Data{ + Value: t.Value, + Type: meta.TokenType, + Position: l.positionBuilder.NewTokenPosition(t), + TokenName: tn, + } + + n.GetMeta().Push(m) +} + +func (l *Parser) prependMetaToken(n node.Node, t *scanner.Token, tn meta.TokenName) { + if !l.Lexer.WithMeta { + return + } + + m := &meta.Data{ + Value: t.Value, + Type: meta.TokenType, + Position: l.positionBuilder.NewTokenPosition(t), + TokenName: tn, + } + + n.GetMeta().Unshift(m) } func (p *Parser) returnTokenToPool(yyDollar []yySymType, yyVAL *yySymType) { diff --git a/php7/php7.go b/php7/php7.go index 0b25bc0..ebe666c 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -346,7 +346,7 @@ const yyEofCode = 1 const yyErrCode = 2 const yyInitialStackSize = 16 -//line php7/php7.y:5344 +//line php7/php7.y:5453 //line yacctab:1 var yyExca = [...]int{ @@ -2124,7 +2124,7 @@ yydefault: yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) if yylex.(*Parser).currentToken.Value == "\xff" { - addMeta(yylex.(*Parser).rootNode, yylex.(*Parser).currentToken.Meta, meta.NodeEnd) + yylex.(*Parser).currentToken.Meta.SetTokenName(meta.NodeEnd).AppendTo(yylex.(*Parser).rootNode.GetMeta()) } } case 2: @@ -2612,7 +2612,7 @@ yydefault: namePart.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(namePart, yyDollar[1].token.Meta, meta.StringToken) + yyDollar[1].token.Meta.SetTokenName(meta.StringToken).AppendTo(namePart.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2627,8 +2627,8 @@ yydefault: namePart.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) // save comments - addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.NsSeparatorToken) - addMeta(namePart, yyDollar[3].token.Meta, meta.StringToken) + yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.StringToken).AppendTo(namePart.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2653,8 +2653,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.NamespaceToken) - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.NsSeparatorToken) + yyDollar[1].token.Meta.SetTokenName(meta.NamespaceToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2668,7 +2668,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.NsSeparatorToken) + yyDollar[1].token.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2731,10 +2731,11 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.HaltCompilerToken) - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenParenthesisToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.CloseParenthesisToken) - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.SemiColonToken) + yyDollar[1].token.Meta.SetTokenName(meta.HaltCompilerToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -2742,7 +2743,7 @@ yydefault: } case 92: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:483 + //line php7/php7.y:484 { name := name.NewName(yyDollar[2].list) yyVAL.node = stmt.NewNamespace(name, nil) @@ -2752,14 +2753,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.NamespaceToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.SemiColonToken) + yyDollar[1].token.Meta.SetTokenName(meta.NamespaceToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 93: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:498 + //line php7/php7.y:500 { name := name.NewName(yyDollar[2].list) yyVAL.node = stmt.NewNamespace(name, yyDollar[4].list) @@ -2769,15 +2771,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[5].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.NamespaceToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.OpenCurlyBracesToken) - addMeta(yyVAL.node, yyDollar[5].token.Meta, meta.CloseCurlyBracesToken) + yyDollar[1].token.Meta.SetTokenName(meta.NamespaceToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[5].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 94: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:514 + //line php7/php7.y:516 { yyVAL.node = stmt.NewNamespace(nil, yyDollar[3].list) @@ -2785,15 +2787,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.NamespaceToken) - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenCurlyBracesToken) - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseCurlyBracesToken) + yyDollar[1].token.Meta.SetTokenName(meta.NamespaceToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 95: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:528 + //line php7/php7.y:530 { yyVAL.node = yyDollar[2].node @@ -2801,14 +2803,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.UseToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.SemiColonToken) + yyDollar[1].token.Meta.SetTokenName(meta.UseToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 96: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:541 + //line php7/php7.y:544 { yyVAL.node = yyDollar[3].node.(*stmt.GroupUse).SetUseType(yyDollar[2].node) @@ -2816,14 +2819,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.UseToken) - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.SemiColonToken) + yyDollar[1].token.Meta.SetTokenName(meta.UseToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 97: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:554 + //line php7/php7.y:558 { yyVAL.node = stmt.NewUseList(nil, yyDollar[2].list) @@ -2831,14 +2835,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.UseToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.SemiColonToken) + yyDollar[1].token.Meta.SetTokenName(meta.UseToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 98: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:567 + //line php7/php7.y:572 { yyVAL.node = stmt.NewUseList(yyDollar[2].node, yyDollar[3].list) @@ -2846,14 +2851,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.UseToken) - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.SemiColonToken) + yyDollar[1].token.Meta.SetTokenName(meta.UseToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 99: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:580 + //line php7/php7.y:586 { yyVAL.node = stmt.NewConstList(yyDollar[2].list) @@ -2861,14 +2867,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ConstToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.SemiColonToken) + yyDollar[1].token.Meta.SetTokenName(meta.ConstToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 100: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:596 + //line php7/php7.y:603 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -2876,13 +2883,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.IdentifierToken) + yyDollar[1].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 101: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:608 + //line php7/php7.y:615 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -2890,13 +2897,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.IdentifierToken) + yyDollar[1].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 102: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:623 + //line php7/php7.y:630 { name := name.NewName(yyDollar[1].list) yyVAL.node = stmt.NewGroupUse(nil, name, yyDollar[4].list) @@ -2906,18 +2913,19 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition(yyDollar[1].list, yyDollar[6].token)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.NsSeparatorToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.OpenCurlyBracesToken) + yyDollar[2].token.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) if yyDollar[5].token != nil { - addMeta(yyVAL.node, yyDollar[5].token.Meta, meta.CommaToken) + yyDollar[5].token.Meta.SetTokenName(meta.CommaToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[5].token, meta.CommaToken) } - addMeta(yyVAL.node, yyDollar[6].token.Meta, meta.CloseCurlyBracesToken) + yyDollar[6].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 103: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:642 + //line php7/php7.y:650 { name := name.NewName(yyDollar[2].list) yyVAL.node = stmt.NewGroupUse(nil, name, yyDollar[5].list) @@ -2927,19 +2935,21 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[7].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.NsSeparatorToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.NsSeparatorToken) - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.OpenCurlyBracesToken) + yyDollar[1].token.Meta.SetTokenName(meta.UseLeadingNsSeparatorToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.UseLeadingNsSeparatorToken) + yyDollar[3].token.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) if yyDollar[6].token != nil { - addMeta(yyVAL.node, yyDollar[6].token.Meta, meta.CommaToken) + yyDollar[6].token.Meta.SetTokenName(meta.CommaToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[6].token, meta.CommaToken) } - addMeta(yyVAL.node, yyDollar[7].token.Meta, meta.CloseCurlyBracesToken) + yyDollar[7].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 104: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:665 + //line php7/php7.y:675 { name := name.NewName(yyDollar[1].list) yyVAL.node = stmt.NewGroupUse(nil, name, yyDollar[4].list) @@ -2949,18 +2959,19 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition(yyDollar[1].list, yyDollar[6].token)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.NsSeparatorToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.OpenCurlyBracesToken) + yyDollar[2].token.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) if yyDollar[5].token != nil { - addMeta(yyVAL.node, yyDollar[5].token.Meta, meta.CommaToken) + yyDollar[5].token.Meta.SetTokenName(meta.CommaToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[5].token, meta.CommaToken) } - addMeta(yyVAL.node, yyDollar[6].token.Meta, meta.CloseCurlyBracesToken) + yyDollar[6].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 105: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:684 + //line php7/php7.y:695 { name := name.NewName(yyDollar[2].list) yyVAL.node = stmt.NewGroupUse(nil, name, yyDollar[5].list) @@ -2970,42 +2981,44 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[7].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.NsSeparatorToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.NsSeparatorToken) - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.OpenCurlyBracesToken) + yyDollar[1].token.Meta.SetTokenName(meta.UseLeadingNsSeparatorToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.UseLeadingNsSeparatorToken) + yyDollar[3].token.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) if yyDollar[6].token != nil { - addMeta(yyVAL.node, yyDollar[6].token.Meta, meta.CommaToken) + yyDollar[6].token.Meta.SetTokenName(meta.CommaToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[6].token, meta.CommaToken) } - addMeta(yyVAL.node, yyDollar[7].token.Meta, meta.CloseCurlyBracesToken) + yyDollar[7].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 106: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:707 + //line php7/php7.y:720 { yyVAL.token = nil } case 107: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:711 + //line php7/php7.y:724 { yyVAL.token = yyDollar[1].token } case 108: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:718 + //line php7/php7.y:731 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.NodeEnd) + yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 109: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:727 + //line php7/php7.y:740 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -3013,18 +3026,18 @@ yydefault: } case 110: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:736 + //line php7/php7.y:749 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.NodeEnd) + yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 111: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:745 + //line php7/php7.y:758 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -3032,18 +3045,18 @@ yydefault: } case 112: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:754 + //line php7/php7.y:767 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.NodeEnd) + yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 113: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:763 + //line php7/php7.y:776 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -3051,7 +3064,7 @@ yydefault: } case 114: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:772 + //line php7/php7.y:785 { yyVAL.node = yyDollar[1].node @@ -3059,7 +3072,7 @@ yydefault: } case 115: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:778 + //line php7/php7.y:791 { yyVAL.node = yyDollar[2].node.(*stmt.Use).SetUseType(yyDollar[1].node) @@ -3067,7 +3080,7 @@ yydefault: } case 116: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:787 + //line php7/php7.y:800 { name := name.NewName(yyDollar[1].list) yyVAL.node = stmt.NewUse(nil, name, nil) @@ -3080,7 +3093,7 @@ yydefault: } case 117: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:798 + //line php7/php7.y:811 { name := name.NewName(yyDollar[1].list) alias := node.NewIdentifier(yyDollar[3].token.Value) @@ -3092,14 +3105,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition(yyDollar[1].list, yyDollar[3].token)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.AsToken) - addMeta(alias, yyDollar[3].token.Meta, meta.IdentifierToken) + yyDollar[2].token.Meta.SetTokenName(meta.AsToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(alias.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 118: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:818 + //line php7/php7.y:831 { yyVAL.node = yyDollar[1].node @@ -3107,29 +3120,30 @@ yydefault: } case 119: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:824 + //line php7/php7.y:837 { yyVAL.node = yyDollar[2].node // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.NsSeparatorToken) + yyDollar[1].token.Meta.SetTokenName(meta.UseLeadingNsSeparatorToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.UseLeadingNsSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 120: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:836 + //line php7/php7.y:850 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.NodeEnd) + yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 121: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:845 + //line php7/php7.y:859 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -3137,7 +3151,7 @@ yydefault: } case 122: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:854 + //line php7/php7.y:868 { if yyDollar[2].node != nil { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -3147,7 +3161,7 @@ yydefault: } case 123: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:862 + //line php7/php7.y:876 { yyVAL.list = []node.Node{} @@ -3155,7 +3169,7 @@ yydefault: } case 124: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:871 + //line php7/php7.y:885 { // error yyVAL.node = nil @@ -3164,7 +3178,7 @@ yydefault: } case 125: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:878 + //line php7/php7.y:892 { yyVAL.node = yyDollar[1].node @@ -3172,7 +3186,7 @@ yydefault: } case 126: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:884 + //line php7/php7.y:898 { yyVAL.node = yyDollar[1].node @@ -3180,7 +3194,7 @@ yydefault: } case 127: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:890 + //line php7/php7.y:904 { yyVAL.node = yyDollar[1].node @@ -3188,7 +3202,7 @@ yydefault: } case 128: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:896 + //line php7/php7.y:910 { yyVAL.node = yyDollar[1].node @@ -3196,7 +3210,7 @@ yydefault: } case 129: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:902 + //line php7/php7.y:916 { yyVAL.node = yyDollar[1].node @@ -3204,7 +3218,7 @@ yydefault: } case 130: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:908 + //line php7/php7.y:922 { yyVAL.node = stmt.NewHaltCompiler() @@ -3212,16 +3226,17 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.HaltCompilerToken) - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenParenthesisToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.CloseParenthesisToken) - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.SemiColonToken) + yyDollar[1].token.Meta.SetTokenName(meta.HaltCompilerToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 131: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:925 + //line php7/php7.y:940 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) @@ -3229,14 +3244,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.OpenCurlyBracesToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.CloseCurlyBracesToken) + yyDollar[1].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 132: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:938 + //line php7/php7.y:953 { yyVAL.node = yyDollar[1].node @@ -3244,7 +3259,7 @@ yydefault: } case 133: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:944 + //line php7/php7.y:959 { yyVAL.node = yyDollar[1].node @@ -3252,7 +3267,7 @@ yydefault: } case 134: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:950 + //line php7/php7.y:965 { switch n := yyDollar[5].node.(type) { case *stmt.While: @@ -3267,15 +3282,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[5].node)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.WhileToken) - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenParenthesisToken) - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseParenthesisToken) + yyDollar[1].token.Meta.SetTokenName(meta.WhileToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 135: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:971 + //line php7/php7.y:986 { yyVAL.node = stmt.NewDo(yyDollar[2].node, yyDollar[5].node) @@ -3283,17 +3298,18 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[7].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.DoToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.WhileToken) - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.OpenParenthesisToken) - addMeta(yyVAL.node, yyDollar[6].token.Meta, meta.CloseParenthesisToken) - addMeta(yyVAL.node, yyDollar[7].token.Meta, meta.SemiColonToken) + yyDollar[1].token.Meta.SetTokenName(meta.DoToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.WhileToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[6].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[7].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[7].token, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 136: yyDollar = yyS[yypt-9 : yypt+1] - //line php7/php7.y:987 + //line php7/php7.y:1003 { switch n := yyDollar[9].node.(type) { case *stmt.For: @@ -3312,17 +3328,17 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[9].node)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ForToken) - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenParenthesisToken) - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.ForInitSemicolonToken) - addMeta(yyVAL.node, yyDollar[6].token.Meta, meta.ForCondSemicolonToken) - addMeta(yyVAL.node, yyDollar[8].token.Meta, meta.CloseParenthesisToken) + yyDollar[1].token.Meta.SetTokenName(meta.ForToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.ForInitSemicolonToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[6].token.Meta.SetTokenName(meta.ForCondSemicolonToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[8].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 137: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:1014 + //line php7/php7.y:1030 { switch n := yyDollar[5].node.(type) { case *stmt.Switch: @@ -3339,15 +3355,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[5].node)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.SwitchToken) - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenParenthesisToken) - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseParenthesisToken) + yyDollar[1].token.Meta.SetTokenName(meta.SwitchToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 138: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1037 + //line php7/php7.y:1053 { yyVAL.node = stmt.NewBreak(yyDollar[2].node) @@ -3355,14 +3371,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.BreakToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.SemiColonToken) + yyDollar[1].token.Meta.SetTokenName(meta.BreakToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 139: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1050 + //line php7/php7.y:1067 { yyVAL.node = stmt.NewContinue(yyDollar[2].node) @@ -3370,14 +3387,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ContinueToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.SemiColonToken) + yyDollar[1].token.Meta.SetTokenName(meta.ContinueToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 140: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1063 + //line php7/php7.y:1081 { yyVAL.node = stmt.NewReturn(yyDollar[2].node) @@ -3385,14 +3403,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ReturnToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.SemiColonToken) + yyDollar[1].token.Meta.SetTokenName(meta.ReturnToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 141: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1076 + //line php7/php7.y:1095 { yyVAL.node = stmt.NewGlobal(yyDollar[2].list) @@ -3400,14 +3419,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.GlobalToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.SemiColonToken) + yyDollar[1].token.Meta.SetTokenName(meta.GlobalToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 142: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1089 + //line php7/php7.y:1109 { yyVAL.node = stmt.NewStatic(yyDollar[2].list) @@ -3415,14 +3435,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.StaticToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.SemiColonToken) + yyDollar[1].token.Meta.SetTokenName(meta.StaticToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 143: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1102 + //line php7/php7.y:1123 { yyVAL.node = stmt.NewEcho(yyDollar[2].list) @@ -3430,14 +3451,16 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.EchoToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.SemiColonToken) + yyDollar[1].token.Meta.SetTokenName(meta.EchoToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.EchoToken) + yyDollar[3].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 144: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1115 + //line php7/php7.y:1138 { yyVAL.node = stmt.NewInlineHtml(yyDollar[1].token.Value) @@ -3445,13 +3468,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.InlineHTMLToken) + yyDollar[1].token.Meta.SetTokenName(meta.InlineHTMLToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 145: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1127 + //line php7/php7.y:1150 { yyVAL.node = stmt.NewExpression(yyDollar[1].node) @@ -3459,13 +3482,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.SemiColonToken) + yyDollar[2].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 146: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1139 + //line php7/php7.y:1163 { yyVAL.node = stmt.NewUnset(yyDollar[3].list) @@ -3473,19 +3497,21 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[6].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.UnsetToken) - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenParenthesisToken) + yyDollar[1].token.Meta.SetTokenName(meta.UnsetToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) if yyDollar[4].token != nil { - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CommaToken) + yyDollar[4].token.Meta.SetTokenName(meta.CommaToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.CommaToken) } - addMeta(yyVAL.node, yyDollar[5].token.Meta, meta.CloseParenthesisToken) - addMeta(yyVAL.node, yyDollar[6].token.Meta, meta.SemiColonToken) + yyDollar[5].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[6].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[6].token, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 147: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:1157 + //line php7/php7.y:1183 { switch n := yyDollar[7].node.(type) { case *stmt.Foreach: @@ -3502,16 +3528,16 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[7].node)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ForeachToken) - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenParenthesisToken) - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.AsToken) - addMeta(yyVAL.node, yyDollar[6].token.Meta, meta.CloseParenthesisToken) + yyDollar[1].token.Meta.SetTokenName(meta.ForeachToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.AsToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[6].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 148: yyDollar = yyS[yypt-9 : yypt+1] - //line php7/php7.y:1181 + //line php7/php7.y:1207 { switch n := yyDollar[9].node.(type) { case *stmt.Foreach: @@ -3530,33 +3556,34 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[9].node)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ForeachToken) - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenParenthesisToken) - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.AsToken) - addMeta(yyVAL.node, yyDollar[6].token.Meta, meta.DoubleArrowToken) - addMeta(yyVAL.node, yyDollar[8].token.Meta, meta.CloseParenthesisToken) + yyDollar[1].token.Meta.SetTokenName(meta.ForeachToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.AsToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[6].token.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[8].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 149: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:1208 + //line php7/php7.y:1234 { - yyVAL.node = stmt.NewDeclare(yyDollar[3].list, yyDollar[5].node) + yyVAL.node = yyDollar[5].node + yyVAL.node.(*stmt.Declare).Consts = yyDollar[3].list // save position yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[5].node)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.DeclareToken) - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenParenthesisToken) - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseParenthesisToken) + yyDollar[1].token.Meta.SetTokenName(meta.DeclareToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 150: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1222 + //line php7/php7.y:1249 { yyVAL.node = stmt.NewNop() @@ -3564,13 +3591,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.SemiColonToken) + yyDollar[1].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 151: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1234 + //line php7/php7.y:1262 { if yyDollar[6].node == nil { yyVAL.node = stmt.NewTry(yyDollar[3].list, yyDollar[5].list, yyDollar[6].node) @@ -3581,15 +3609,15 @@ yydefault: } // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.TryToken) - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenCurlyBracesToken) - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseCurlyBracesToken) + yyDollar[1].token.Meta.SetTokenName(meta.TryToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 152: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1251 + //line php7/php7.y:1279 { yyVAL.node = stmt.NewThrow(yyDollar[2].node) @@ -3597,14 +3625,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ThrowToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.SemiColonToken) + yyDollar[1].token.Meta.SetTokenName(meta.ThrowToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 153: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1264 + //line php7/php7.y:1293 { label := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewGoto(label) @@ -3614,15 +3643,16 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.GotoToken) - addMeta(label, yyDollar[2].token.Meta, meta.IdentifierToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.SemiColonToken) + yyDollar[1].token.Meta.SetTokenName(meta.GotoToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(label.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 154: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1280 + //line php7/php7.y:1310 { label := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewLabel(label) @@ -3632,14 +3662,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - addMeta(label, yyDollar[1].token.Meta, meta.IdentifierToken) - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.ColonToken) + yyDollar[1].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(label.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.ColonToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 155: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1297 + //line php7/php7.y:1327 { yyVAL.list = []node.Node{} @@ -3647,7 +3677,7 @@ yydefault: } case 156: yyDollar = yyS[yypt-9 : yypt+1] - //line php7/php7.y:1303 + //line php7/php7.y:1333 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[5].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -3660,18 +3690,18 @@ yydefault: catch.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[2].token, yyDollar[9].token)) // save comments - addMeta(catch, yyDollar[2].token.Meta, meta.CatchToken) - addMeta(catch, yyDollar[3].token.Meta, meta.OpenParenthesisToken) - addMeta(variable, yyDollar[5].token.Meta, meta.VariableToken) - addMeta(catch, yyDollar[6].token.Meta, meta.CloseParenthesisToken) - addMeta(catch, yyDollar[7].token.Meta, meta.OpenCurlyBracesToken) - addMeta(catch, yyDollar[9].token.Meta, meta.CloseCurlyBracesToken) + yyDollar[2].token.Meta.SetTokenName(meta.CatchToken).AppendTo(catch.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(catch.GetMeta()) + yyDollar[5].token.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) + yyDollar[6].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(catch.GetMeta()) + yyDollar[7].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(catch.GetMeta()) + yyDollar[9].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(catch.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 157: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1327 + //line php7/php7.y:1357 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -3679,18 +3709,18 @@ yydefault: } case 158: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1333 + //line php7/php7.y:1363 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.NodeEnd) + yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 159: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1345 + //line php7/php7.y:1375 { yyVAL.node = nil @@ -3698,7 +3728,7 @@ yydefault: } case 160: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1351 + //line php7/php7.y:1381 { yyVAL.node = stmt.NewFinally(yyDollar[3].list) @@ -3706,15 +3736,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.FinallyToken) - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenCurlyBracesToken) - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseCurlyBracesToken) + yyDollar[1].token.Meta.SetTokenName(meta.FinallyToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 161: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1368 + //line php7/php7.y:1398 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -3722,18 +3752,18 @@ yydefault: } case 162: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1374 + //line php7/php7.y:1404 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.NodeEnd) + yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 163: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1386 + //line php7/php7.y:1416 { yyVAL.node = yyDollar[1].node @@ -3741,7 +3771,7 @@ yydefault: } case 164: yyDollar = yyS[yypt-11 : yypt+1] - //line php7/php7.y:1395 + //line php7/php7.y:1425 { name := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewFunction(name, yyDollar[2].token != nil, yyDollar[6].list, yyDollar[8].node, yyDollar[10].list, yyDollar[4].str) @@ -3751,45 +3781,45 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[11].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.FunctionToken) + yyDollar[1].token.Meta.SetTokenName(meta.FunctionToken).AppendTo(yyVAL.node.GetMeta()) if yyDollar[2].token != nil { - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.AmpersandToken) + yyDollar[2].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(yyVAL.node.GetMeta()) } - addMeta(name, yyDollar[3].token.Meta, meta.IdentifierToken) - addMeta(yyVAL.node, yyDollar[5].token.Meta, meta.OpenParenthesisToken) - addMeta(yyVAL.node, yyDollar[7].token.Meta, meta.CloseParenthesisToken) - addMeta(yyVAL.node, yyDollar[9].token.Meta, meta.OpenCurlyBracesToken) - addMeta(yyVAL.node, yyDollar[11].token.Meta, meta.CloseCurlyBracesToken) + yyDollar[3].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + yyDollar[5].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[7].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[9].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[11].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 165: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1421 + //line php7/php7.y:1451 { yyVAL.token = nil } case 166: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1425 + //line php7/php7.y:1455 { yyVAL.token = yyDollar[1].token } case 167: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1432 + //line php7/php7.y:1462 { yyVAL.token = nil } case 168: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1436 + //line php7/php7.y:1466 { yyVAL.token = yyDollar[1].token } case 169: yyDollar = yyS[yypt-9 : yypt+1] - //line php7/php7.y:1443 + //line php7/php7.y:1473 { name := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewClass(name, yyDollar[1].list, nil, yyDollar[4].ClassExtends, yyDollar[5].ClassImplements, yyDollar[8].list, yyDollar[6].str) @@ -3799,16 +3829,16 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewOptionalListTokensPosition(yyDollar[1].list, yyDollar[2].token, yyDollar[9].token)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.ClassToken) - addMeta(name, yyDollar[3].token.Meta, meta.IdentifierToken) - addMeta(yyVAL.node, yyDollar[7].token.Meta, meta.OpenCurlyBracesToken) - addMeta(yyVAL.node, yyDollar[9].token.Meta, meta.CloseCurlyBracesToken) + yyDollar[2].token.Meta.SetTokenName(meta.ClassToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + yyDollar[7].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[9].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 170: yyDollar = yyS[yypt-8 : yypt+1] - //line php7/php7.y:1460 + //line php7/php7.y:1490 { name := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewClass(name, nil, nil, yyDollar[3].ClassExtends, yyDollar[4].ClassImplements, yyDollar[7].list, yyDollar[5].str) @@ -3818,16 +3848,16 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[8].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ClassToken) - addMeta(name, yyDollar[2].token.Meta, meta.IdentifierToken) - addMeta(yyVAL.node, yyDollar[6].token.Meta, meta.OpenCurlyBracesToken) - addMeta(yyVAL.node, yyDollar[8].token.Meta, meta.CloseCurlyBracesToken) + yyDollar[1].token.Meta.SetTokenName(meta.ClassToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + yyDollar[6].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[8].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 171: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1480 + //line php7/php7.y:1510 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -3835,7 +3865,7 @@ yydefault: } case 172: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1486 + //line php7/php7.y:1516 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -3843,7 +3873,7 @@ yydefault: } case 173: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1495 + //line php7/php7.y:1525 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -3851,13 +3881,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.IdentifierToken) + yyDollar[1].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 174: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1507 + //line php7/php7.y:1537 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -3865,13 +3895,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.IdentifierToken) + yyDollar[1].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 175: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1522 + //line php7/php7.y:1552 { name := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewTrait(name, yyDollar[5].list, yyDollar[3].str) @@ -3881,16 +3911,16 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[6].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.TraitToken) - addMeta(name, yyDollar[2].token.Meta, meta.IdentifierToken) - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.OpenCurlyBracesToken) - addMeta(yyVAL.node, yyDollar[6].token.Meta, meta.CloseCurlyBracesToken) + yyDollar[1].token.Meta.SetTokenName(meta.TraitToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[6].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 176: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:1542 + //line php7/php7.y:1572 { name := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewInterface(name, yyDollar[3].InterfaceExtends, yyDollar[6].list, yyDollar[4].str) @@ -3900,16 +3930,16 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[7].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.InterfaceToken) - addMeta(name, yyDollar[2].token.Meta, meta.IdentifierToken) - addMeta(yyVAL.node, yyDollar[5].token.Meta, meta.OpenCurlyBracesToken) - addMeta(yyVAL.node, yyDollar[7].token.Meta, meta.CloseCurlyBracesToken) + yyDollar[1].token.Meta.SetTokenName(meta.InterfaceToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + yyDollar[5].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[7].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 177: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1562 + //line php7/php7.y:1592 { yyVAL.ClassExtends = nil @@ -3917,7 +3947,7 @@ yydefault: } case 178: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1568 + //line php7/php7.y:1598 { yyVAL.ClassExtends = stmt.NewClassExtends(yyDollar[2].node) @@ -3925,13 +3955,13 @@ yydefault: yyVAL.ClassExtends.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - addMeta(yyVAL.ClassExtends, yyDollar[1].token.Meta, meta.ExtendsToken) + yyDollar[1].token.Meta.SetTokenName(meta.ExtendsToken).AppendTo(yyVAL.ClassExtends.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 179: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1583 + //line php7/php7.y:1613 { yyVAL.InterfaceExtends = nil @@ -3939,7 +3969,7 @@ yydefault: } case 180: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1589 + //line php7/php7.y:1619 { yyVAL.InterfaceExtends = stmt.NewInterfaceExtends(yyDollar[2].list) @@ -3947,13 +3977,13 @@ yydefault: yyVAL.InterfaceExtends.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) // save comments - addMeta(yyVAL.InterfaceExtends, yyDollar[1].token.Meta, meta.ExtendsToken) + yyDollar[1].token.Meta.SetTokenName(meta.ExtendsToken).AppendTo(yyVAL.InterfaceExtends.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 181: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1604 + //line php7/php7.y:1634 { yyVAL.ClassImplements = nil @@ -3961,7 +3991,7 @@ yydefault: } case 182: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1610 + //line php7/php7.y:1640 { yyVAL.ClassImplements = stmt.NewClassImplements(yyDollar[2].list) @@ -3969,13 +3999,13 @@ yydefault: yyVAL.ClassImplements.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) // save comments - addMeta(yyVAL.ClassImplements, yyDollar[1].token.Meta, meta.ImplementsToken) + yyDollar[1].token.Meta.SetTokenName(meta.ImplementsToken).AppendTo(yyVAL.ClassImplements.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 183: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1625 + //line php7/php7.y:1655 { yyVAL.node = yyDollar[1].node @@ -3983,7 +4013,7 @@ yydefault: } case 184: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1631 + //line php7/php7.y:1661 { yyVAL.node = expr.NewReference(yyDollar[2].node) @@ -3991,13 +4021,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.AmpersandToken) + yyDollar[1].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 185: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1643 + //line php7/php7.y:1673 { yyVAL.node = expr.NewList(yyDollar[3].list) @@ -4005,15 +4035,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ListToken) - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenParenthesisToken) - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseParenthesisToken) + yyDollar[1].token.Meta.SetTokenName(meta.ListToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 186: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1657 + //line php7/php7.y:1687 { yyVAL.node = expr.NewShortList(yyDollar[2].list) @@ -4021,14 +4051,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.OpenSquareBracket) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.CloseSquareBracket) + yyDollar[1].token.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 187: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1673 + //line php7/php7.y:1703 { yyVAL.node = stmt.NewFor(nil, nil, nil, yyDollar[1].node) @@ -4039,7 +4069,7 @@ yydefault: } case 188: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1682 + //line php7/php7.y:1712 { stmtList := stmt.NewStmtList(yyDollar[2].list) yyVAL.node = stmt.NewAltFor(nil, nil, nil, stmtList) @@ -4049,15 +4079,16 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ColonToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.EndforToken) - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.SemiColonToken) + yyDollar[1].token.Meta.SetTokenName(meta.ColonToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.EndforToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 189: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1701 + //line php7/php7.y:1732 { yyVAL.node = stmt.NewForeach(nil, nil, nil, yyDollar[1].node) @@ -4068,7 +4099,7 @@ yydefault: } case 190: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1710 + //line php7/php7.y:1741 { stmtList := stmt.NewStmtList(yyDollar[2].list) yyVAL.node = stmt.NewAltForeach(nil, nil, nil, stmtList) @@ -4078,39 +4109,46 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ColonToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.EndforeachToken) - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.SemiColonToken) + yyDollar[1].token.Meta.SetTokenName(meta.ColonToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.EndforeachToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 191: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1729 + //line php7/php7.y:1761 { - yyVAL.node = yyDollar[1].node + yyVAL.node = stmt.NewDeclare(nil, yyDollar[1].node, false) + + // save position + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 192: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1735 + //line php7/php7.y:1770 { - yyVAL.node = stmt.NewStmtList(yyDollar[2].list) + stmtList := stmt.NewStmtList(yyDollar[2].list) + yyVAL.node = stmt.NewDeclare(nil, stmtList, true) // save position + stmtList.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ColonToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.EnddeclareToken) - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.SemiColonToken) + yyDollar[1].token.Meta.SetTokenName(meta.ColonToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.EnddeclareToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 193: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1752 + //line php7/php7.y:1790 { caseList := stmt.NewCaseList(yyDollar[2].list) yyVAL.node = stmt.NewSwitch(nil, caseList) @@ -4120,14 +4158,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - addMeta(caseList, yyDollar[1].token.Meta, meta.OpenCurlyBracesToken) - addMeta(caseList, yyDollar[3].token.Meta, meta.CloseCurlyBracesToken) + yyDollar[1].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(caseList.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(caseList.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 194: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1767 + //line php7/php7.y:1805 { caseList := stmt.NewCaseList(yyDollar[3].list) yyVAL.node = stmt.NewSwitch(nil, caseList) @@ -4137,15 +4175,16 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - addMeta(caseList, yyDollar[1].token.Meta, meta.OpenCurlyBracesToken) - addMeta(caseList, yyDollar[2].token.Meta, meta.SemiColonToken) - addMeta(caseList, yyDollar[4].token.Meta, meta.CloseCurlyBracesToken) + yyDollar[1].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(caseList.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.CaseSeparatorToken).AppendTo(caseList.GetMeta()) + yylex.(*Parser).appendMetaToken(caseList, yyDollar[2].token, meta.CaseSeparatorToken) + yyDollar[4].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(caseList.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 195: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1783 + //line php7/php7.y:1822 { caseList := stmt.NewCaseList(yyDollar[2].list) yyVAL.node = stmt.NewAltSwitch(nil, caseList) @@ -4155,15 +4194,16 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ColonToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.EndswitchToken) - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.SemiColonToken) + yyDollar[1].token.Meta.SetTokenName(meta.ColonToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.EndswitchToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 196: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:1799 + //line php7/php7.y:1839 { caseList := stmt.NewCaseList(yyDollar[3].list) @@ -4174,16 +4214,18 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[5].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ColonToken) - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.SwitchSemicolonToken) - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.EndswitchToken) - addMeta(yyVAL.node, yyDollar[5].token.Meta, meta.SemiColonToken) + yyDollar[1].token.Meta.SetTokenName(meta.ColonToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.CaseSeparatorToken).AppendTo(caseList.GetMeta()) + yylex.(*Parser).appendMetaToken(caseList, yyDollar[2].token, meta.CaseSeparatorToken) + yyDollar[4].token.Meta.SetTokenName(meta.EndswitchToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[5].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[5].token, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 197: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1820 + //line php7/php7.y:1862 { yyVAL.list = []node.Node{} @@ -4191,7 +4233,7 @@ yydefault: } case 198: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:1826 + //line php7/php7.y:1868 { _case := stmt.NewCase(yyDollar[3].node, yyDollar[5].list) yyVAL.list = append(yyDollar[1].list, _case) @@ -4200,14 +4242,15 @@ yydefault: _case.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[5].list)) // save comments - addMeta(_case, yyDollar[2].token.Meta, meta.CaseToken) - addMeta(_case, yyDollar[4].token.Meta, meta.CaseSeparatorToken) + yyDollar[2].token.Meta.SetTokenName(meta.CaseToken).AppendTo(_case.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.CaseSeparatorToken).AppendTo(_case.GetMeta()) + yylex.(*Parser).appendMetaToken(_case, yyDollar[4].token, meta.CaseSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 199: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1840 + //line php7/php7.y:1883 { _default := stmt.NewDefault(yyDollar[4].list) yyVAL.list = append(yyDollar[1].list, _default) @@ -4216,26 +4259,27 @@ yydefault: _default.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[4].list)) // save comments - addMeta(_default, yyDollar[2].token.Meta, meta.DefaultToken) - addMeta(_default, yyDollar[3].token.Meta, meta.CaseSeparatorToken) + yyDollar[2].token.Meta.SetTokenName(meta.DefaultToken).AppendTo(_default.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.CaseSeparatorToken).AppendTo(_default.GetMeta()) + yylex.(*Parser).appendMetaToken(_default, yyDollar[3].token, meta.CaseSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 200: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1857 + //line php7/php7.y:1901 { yyVAL.token = yyDollar[1].token } case 201: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1861 + //line php7/php7.y:1905 { yyVAL.token = yyDollar[1].token } case 202: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1868 + //line php7/php7.y:1912 { yyVAL.node = stmt.NewWhile(nil, yyDollar[1].node) @@ -4246,7 +4290,7 @@ yydefault: } case 203: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1877 + //line php7/php7.y:1921 { stmtList := stmt.NewStmtList(yyDollar[2].list) yyVAL.node = stmt.NewAltWhile(nil, stmtList) @@ -4256,15 +4300,16 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ColonToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.EndwhileToken) - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.SemiColonToken) + yyDollar[1].token.Meta.SetTokenName(meta.ColonToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.EndwhileToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 204: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:1896 + //line php7/php7.y:1941 { yyVAL.node = stmt.NewIf(yyDollar[3].node, yyDollar[5].node, nil, nil) @@ -4272,15 +4317,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[5].node)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.IfToken) - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenParenthesisToken) - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseParenthesisToken) + yyDollar[1].token.Meta.SetTokenName(meta.IfToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 205: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1910 + //line php7/php7.y:1955 { _elseIf := stmt.NewElseIf(yyDollar[4].node, yyDollar[6].node) yyVAL.node = yyDollar[1].node.(*stmt.If).AddElseIf(_elseIf) @@ -4290,15 +4335,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[6].node)) // save comments - addMeta(_elseIf, yyDollar[2].token.Meta, meta.ElseifToken) - addMeta(_elseIf, yyDollar[3].token.Meta, meta.OpenParenthesisToken) - addMeta(_elseIf, yyDollar[5].token.Meta, meta.CloseParenthesisToken) + yyDollar[2].token.Meta.SetTokenName(meta.ElseifToken).AppendTo(_elseIf.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(_elseIf.GetMeta()) + yyDollar[5].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(_elseIf.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 206: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1929 + //line php7/php7.y:1974 { yyVAL.node = yyDollar[1].node @@ -4306,7 +4351,7 @@ yydefault: } case 207: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1935 + //line php7/php7.y:1980 { _else := stmt.NewElse(yyDollar[3].node) yyVAL.node = yyDollar[1].node.(*stmt.If).SetElse(_else) @@ -4316,13 +4361,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(_else, yyDollar[2].token.Meta, meta.ElseToken) + yyDollar[2].token.Meta.SetTokenName(meta.ElseToken).AppendTo(_else.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 208: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1952 + //line php7/php7.y:1997 { stmts := stmt.NewStmtList(yyDollar[6].list) yyVAL.node = stmt.NewAltIf(yyDollar[3].node, stmts, nil, nil) @@ -4332,16 +4377,16 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[6].list)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.IfToken) - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenParenthesisToken) - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseParenthesisToken) - addMeta(yyVAL.node, yyDollar[5].token.Meta, meta.ColonToken) + yyDollar[1].token.Meta.SetTokenName(meta.IfToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[5].token.Meta.SetTokenName(meta.ColonToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 209: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:1969 + //line php7/php7.y:2014 { stmts := stmt.NewStmtList(yyDollar[7].list) _elseIf := stmt.NewAltElseIf(yyDollar[4].node, stmts) @@ -4352,16 +4397,16 @@ yydefault: _elseIf.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[7].list)) // save comments - addMeta(_elseIf, yyDollar[2].token.Meta, meta.ElseifToken) - addMeta(_elseIf, yyDollar[3].token.Meta, meta.OpenParenthesisToken) - addMeta(_elseIf, yyDollar[5].token.Meta, meta.CloseParenthesisToken) - addMeta(_elseIf, yyDollar[6].token.Meta, meta.ColonToken) + yyDollar[2].token.Meta.SetTokenName(meta.ElseifToken).AppendTo(_elseIf.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(_elseIf.GetMeta()) + yyDollar[5].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(_elseIf.GetMeta()) + yyDollar[6].token.Meta.SetTokenName(meta.ColonToken).AppendTo(_elseIf.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 210: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1990 + //line php7/php7.y:2035 { yyVAL.node = yyDollar[1].node @@ -4369,14 +4414,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.EndifToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.SemiColonToken) + yyDollar[2].token.Meta.SetTokenName(meta.EndifToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 211: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:2003 + //line php7/php7.y:2049 { stmts := stmt.NewStmtList(yyDollar[4].list) _else := stmt.NewAltElse(stmts) @@ -4388,16 +4434,17 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[6].token)) // save comments - addMeta(_else, yyDollar[2].token.Meta, meta.ElseToken) - addMeta(_else, yyDollar[3].token.Meta, meta.ColonToken) - addMeta(yyVAL.node, yyDollar[5].token.Meta, meta.EndifToken) - addMeta(yyVAL.node, yyDollar[6].token.Meta, meta.SemiColonToken) + yyDollar[2].token.Meta.SetTokenName(meta.ElseToken).AppendTo(_else.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.ColonToken).AppendTo(_else.GetMeta()) + yyDollar[5].token.Meta.SetTokenName(meta.EndifToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[6].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[6].token, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 212: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2025 + //line php7/php7.y:2072 { yyVAL.list = yyDollar[1].list @@ -4405,7 +4452,7 @@ yydefault: } case 213: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:2031 + //line php7/php7.y:2078 { yyVAL.list = nil @@ -4413,7 +4460,7 @@ yydefault: } case 214: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2040 + //line php7/php7.y:2087 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4421,18 +4468,18 @@ yydefault: } case 215: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2046 + //line php7/php7.y:2093 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.NodeEnd) + yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 216: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2058 + //line php7/php7.y:2105 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[4].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -4453,18 +4500,18 @@ yydefault: // save comments if yyDollar[2].token != nil { - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.AmpersandToken) + yyDollar[2].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(yyVAL.node.GetMeta()) } if yyDollar[3].token != nil { - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.EllipsisToken) + yyDollar[3].token.Meta.SetTokenName(meta.EllipsisToken).AppendTo(yyVAL.node.GetMeta()) } - addMeta(variable, yyDollar[4].token.Meta, meta.VariableToken) + yyDollar[4].token.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 217: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:2088 + //line php7/php7.y:2135 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[4].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -4485,19 +4532,19 @@ yydefault: // save comments if yyDollar[2].token != nil { - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.AmpersandToken) + yyDollar[2].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(yyVAL.node.GetMeta()) } if yyDollar[3].token != nil { - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.EllipsisToken) + yyDollar[3].token.Meta.SetTokenName(meta.EllipsisToken).AppendTo(yyVAL.node.GetMeta()) } - addMeta(variable, yyDollar[4].token.Meta, meta.VariableToken) - addMeta(yyVAL.node, yyDollar[5].token.Meta, meta.EqualToken) + yyDollar[4].token.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) + yyDollar[5].token.Meta.SetTokenName(meta.EqualToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 218: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:2122 + //line php7/php7.y:2169 { yyVAL.node = nil @@ -4505,7 +4552,7 @@ yydefault: } case 219: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2128 + //line php7/php7.y:2175 { yyVAL.node = yyDollar[1].node @@ -4513,7 +4560,7 @@ yydefault: } case 220: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2137 + //line php7/php7.y:2184 { yyVAL.node = yyDollar[1].node @@ -4521,7 +4568,7 @@ yydefault: } case 221: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2143 + //line php7/php7.y:2190 { yyVAL.node = node.NewNullable(yyDollar[2].node) @@ -4529,13 +4576,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.QuestionMarkToken) + yyDollar[1].token.Meta.SetTokenName(meta.QuestionMarkToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 222: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2158 + //line php7/php7.y:2205 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4543,13 +4590,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.IdentifierToken) + yyDollar[1].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 223: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2170 + //line php7/php7.y:2217 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4557,13 +4604,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.IdentifierToken) + yyDollar[1].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 224: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2182 + //line php7/php7.y:2229 { yyVAL.node = yyDollar[1].node @@ -4571,7 +4618,7 @@ yydefault: } case 225: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:2191 + //line php7/php7.y:2238 { yyVAL.node = nil @@ -4579,18 +4626,18 @@ yydefault: } case 226: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2197 + //line php7/php7.y:2244 { yyVAL.node = yyDollar[2].node // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ColonToken) + yyDollar[1].token.Meta.SetTokenName(meta.ColonToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 227: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2209 + //line php7/php7.y:2256 { yyVAL.node = node.NewArgumentList(nil) @@ -4598,14 +4645,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.OpenParenthesisToken) - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.CloseParenthesisToken) + yyDollar[1].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 228: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2222 + //line php7/php7.y:2269 { yyVAL.node = node.NewArgumentList(yyDollar[2].list) @@ -4613,17 +4660,18 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.OpenParenthesisToken) + yyDollar[1].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) if yyDollar[3].token != nil { - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.CommaToken) + yyDollar[3].token.Meta.SetTokenName(meta.CommaToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.CommaToken) } - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseParenthesisToken) + yyDollar[4].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 229: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2241 + //line php7/php7.y:2289 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4631,18 +4679,18 @@ yydefault: } case 230: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2247 + //line php7/php7.y:2295 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.NodeEnd) + yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 231: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2259 + //line php7/php7.y:2307 { yyVAL.node = node.NewArgument(yyDollar[1].node, false, false) @@ -4653,7 +4701,7 @@ yydefault: } case 232: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2268 + //line php7/php7.y:2316 { yyVAL.node = node.NewArgument(yyDollar[2].node, true, false) @@ -4661,24 +4709,24 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.EllipsisToken) + yyDollar[1].token.Meta.SetTokenName(meta.EllipsisToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 233: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2283 + //line php7/php7.y:2331 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.NodeEnd) + yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 234: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2292 + //line php7/php7.y:2340 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4686,7 +4734,7 @@ yydefault: } case 235: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2301 + //line php7/php7.y:2349 { yyVAL.node = yyDollar[1].node @@ -4694,18 +4742,18 @@ yydefault: } case 236: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2310 + //line php7/php7.y:2358 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.NodeEnd) + yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 237: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2319 + //line php7/php7.y:2367 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4713,7 +4761,7 @@ yydefault: } case 238: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2328 + //line php7/php7.y:2376 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -4725,13 +4773,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(variable, yyDollar[1].token.Meta, meta.VariableToken) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 239: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2344 + //line php7/php7.y:2392 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -4743,14 +4791,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) // save comments - addMeta(variable, yyDollar[1].token.Meta, meta.VariableToken) - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.EqualToken) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.EqualToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 240: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2364 + //line php7/php7.y:2412 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -4758,7 +4806,7 @@ yydefault: } case 241: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:2370 + //line php7/php7.y:2418 { yyVAL.list = []node.Node{} @@ -4766,7 +4814,7 @@ yydefault: } case 242: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2379 + //line php7/php7.y:2427 { yyVAL.node = stmt.NewPropertyList(yyDollar[1].list, yyDollar[2].list) @@ -4774,13 +4822,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition(yyDollar[1].list, yyDollar[3].token)) // save comments - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.SemiColonToken) + yyDollar[3].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 243: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2391 + //line php7/php7.y:2440 { yyVAL.node = stmt.NewClassConstList(yyDollar[1].list, yyDollar[3].list) @@ -4788,14 +4837,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewOptionalListTokensPosition(yyDollar[1].list, yyDollar[2].token, yyDollar[4].token)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.ConstToken) - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.SemiColonToken) + yyDollar[2].token.Meta.SetTokenName(meta.ConstToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 244: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2404 + //line php7/php7.y:2454 { yyVAL.node = stmt.NewTraitUse(yyDollar[2].list, yyDollar[3].node) @@ -4803,13 +4853,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.UseToken) + yyDollar[1].token.Meta.SetTokenName(meta.UseToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 245: yyDollar = yyS[yypt-10 : yypt+1] - //line php7/php7.y:2416 + //line php7/php7.y:2466 { name := node.NewIdentifier(yyDollar[4].token.Value) yyVAL.node = stmt.NewClassMethod(name, yyDollar[1].list, yyDollar[3].token != nil, yyDollar[7].list, yyDollar[9].node, yyDollar[10].node, yyDollar[5].str) @@ -4823,19 +4873,19 @@ yydefault: } // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.FunctionToken) + yyDollar[2].token.Meta.SetTokenName(meta.FunctionToken).AppendTo(yyVAL.node.GetMeta()) if yyDollar[3].token != nil { - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.AmpersandToken) + yyDollar[3].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(yyVAL.node.GetMeta()) } - addMeta(name, yyDollar[4].token.Meta, meta.IdentifierToken) - addMeta(yyVAL.node, yyDollar[6].token.Meta, meta.OpenParenthesisToken) - addMeta(yyVAL.node, yyDollar[8].token.Meta, meta.CloseParenthesisToken) + yyDollar[4].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + yyDollar[6].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[8].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 246: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2443 + //line php7/php7.y:2493 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4843,59 +4893,60 @@ yydefault: } case 247: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2449 + //line php7/php7.y:2499 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.NodeEnd) + yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 248: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2461 + //line php7/php7.y:2511 { yyVAL.node = stmt.NewNop() yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.SemiColonToken) + yyDollar[1].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 249: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2473 + //line php7/php7.y:2524 { yyVAL.node = stmt.NewTraitAdaptationList(nil) yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.OpenCurlyBracesToken) - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.CloseCurlyBracesToken) + yyDollar[1].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 250: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2485 + //line php7/php7.y:2536 { yyVAL.node = stmt.NewTraitAdaptationList(yyDollar[2].list) yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.OpenCurlyBracesToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.CloseCurlyBracesToken) + yyDollar[1].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 251: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2500 + //line php7/php7.y:2551 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4903,7 +4954,7 @@ yydefault: } case 252: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2506 + //line php7/php7.y:2557 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -4911,29 +4962,31 @@ yydefault: } case 253: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2515 + //line php7/php7.y:2566 { yyVAL.node = yyDollar[1].node // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.SemiColonToken) + yyDollar[2].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 254: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2524 + //line php7/php7.y:2576 { yyVAL.node = yyDollar[1].node // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.SemiColonToken) + yyDollar[2].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 255: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2536 + //line php7/php7.y:2589 { yyVAL.node = stmt.NewTraitUsePrecedence(yyDollar[1].node, yyDollar[3].list) @@ -4941,13 +4994,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeNodeListPosition(yyDollar[1].node, yyDollar[3].list)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.InsteadofToken) + yyDollar[2].token.Meta.SetTokenName(meta.InsteadofToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 256: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2551 + //line php7/php7.y:2604 { alias := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, nil, alias) @@ -4957,14 +5010,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.AsToken) - addMeta(alias, yyDollar[3].token.Meta, meta.IdentifierToken) + yyDollar[2].token.Meta.SetTokenName(meta.AsToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(alias.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 257: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2566 + //line php7/php7.y:2619 { alias := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, nil, alias) @@ -4974,14 +5027,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.AsToken) - addMeta(alias, yyDollar[3].token.Meta, meta.IdentifierToken) + yyDollar[2].token.Meta.SetTokenName(meta.AsToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(alias.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 258: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2581 + //line php7/php7.y:2634 { alias := node.NewIdentifier(yyDollar[4].token.Value) yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, yyDollar[3].node, alias) @@ -4991,14 +5044,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.AsToken) - addMeta(alias, yyDollar[4].token.Meta, meta.IdentifierToken) + yyDollar[2].token.Meta.SetTokenName(meta.AsToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(alias.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 259: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2596 + //line php7/php7.y:2649 { yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, yyDollar[3].node, nil) @@ -5006,13 +5059,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.AsToken) + yyDollar[2].token.Meta.SetTokenName(meta.AsToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 260: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2612 + //line php7/php7.y:2664 { name := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewTraitMethodRef(nil, name) @@ -5022,13 +5075,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(name, yyDollar[1].token.Meta, meta.IdentifierToken) + yyDollar[1].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 261: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2626 + //line php7/php7.y:2678 { yyVAL.node = yyDollar[1].node @@ -5036,7 +5089,7 @@ yydefault: } case 262: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2635 + //line php7/php7.y:2687 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewTraitMethodRef(yyDollar[1].node, target) @@ -5046,14 +5099,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.PaamayimNekudotayimToken) - addMeta(target, yyDollar[3].token.Meta, meta.IdentifierToken) + yyDollar[2].token.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(target.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 263: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2653 + //line php7/php7.y:2705 { yyVAL.node = stmt.NewNop() @@ -5061,13 +5114,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.SemiColonToken) + yyDollar[1].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 264: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2665 + //line php7/php7.y:2718 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) @@ -5075,14 +5129,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.OpenCurlyBracesToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.CloseCurlyBracesToken) + yyDollar[1].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 265: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2681 + //line php7/php7.y:2734 { yyVAL.list = yyDollar[1].list @@ -5090,7 +5144,7 @@ yydefault: } case 266: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2687 + //line php7/php7.y:2740 { modifier := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.list = []node.Node{modifier} @@ -5099,13 +5153,13 @@ yydefault: modifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(modifier, yyDollar[1].token.Meta, meta.IdentifierToken) + yyDollar[1].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(modifier.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 267: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:2703 + //line php7/php7.y:2756 { yyVAL.list = nil @@ -5113,7 +5167,7 @@ yydefault: } case 268: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2709 + //line php7/php7.y:2762 { yyVAL.list = yyDollar[1].list @@ -5121,7 +5175,7 @@ yydefault: } case 269: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2718 + //line php7/php7.y:2771 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -5129,7 +5183,7 @@ yydefault: } case 270: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2724 + //line php7/php7.y:2777 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -5137,7 +5191,7 @@ yydefault: } case 271: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2733 + //line php7/php7.y:2786 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5145,13 +5199,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.IdentifierToken) + yyDollar[1].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 272: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2745 + //line php7/php7.y:2798 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5159,13 +5213,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.IdentifierToken) + yyDollar[1].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 273: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2757 + //line php7/php7.y:2810 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5173,13 +5227,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.IdentifierToken) + yyDollar[1].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 274: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2769 + //line php7/php7.y:2822 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5187,13 +5241,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.IdentifierToken) + yyDollar[1].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 275: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2781 + //line php7/php7.y:2834 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5201,13 +5255,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.IdentifierToken) + yyDollar[1].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 276: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2793 + //line php7/php7.y:2846 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5215,24 +5269,24 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.IdentifierToken) + yyDollar[1].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 277: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2808 + //line php7/php7.y:2861 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.NodeEnd) + yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 278: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2817 + //line php7/php7.y:2870 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -5240,7 +5294,7 @@ yydefault: } case 279: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2826 + //line php7/php7.y:2879 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -5252,13 +5306,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(variable, yyDollar[1].token.Meta, meta.VariableToken) + yyDollar[1].token.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 280: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2842 + //line php7/php7.y:2895 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -5270,25 +5324,25 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) // save comments - addMeta(variable, yyDollar[1].token.Meta, meta.VariableToken) - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.EqualToken) + yyDollar[1].token.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.EqualToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 281: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2862 + //line php7/php7.y:2915 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.NodeEnd) + yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 282: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2871 + //line php7/php7.y:2924 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -5296,7 +5350,7 @@ yydefault: } case 283: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2880 + //line php7/php7.y:2933 { name := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewConstant(name, yyDollar[3].node, yyDollar[4].str) @@ -5306,14 +5360,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) // save comments - addMeta(name, yyDollar[1].token.Meta, meta.IdentifierToken) - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.EqualToken) + yyDollar[1].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.EqualToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 284: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2898 + //line php7/php7.y:2951 { name := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewConstant(name, yyDollar[3].node, yyDollar[4].str) @@ -5323,25 +5377,25 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) // save comments - addMeta(name, yyDollar[1].token.Meta, meta.IdentifierToken) - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.EqualToken) + yyDollar[1].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.EqualToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 285: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2916 + //line php7/php7.y:2969 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.NodeEnd) + yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 286: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2925 + //line php7/php7.y:2978 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -5349,7 +5403,7 @@ yydefault: } case 287: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2934 + //line php7/php7.y:2987 { yyVAL.node = yyDollar[1].node @@ -5357,7 +5411,7 @@ yydefault: } case 288: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:2943 + //line php7/php7.y:2996 { yyVAL.list = nil @@ -5365,7 +5419,7 @@ yydefault: } case 289: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2949 + //line php7/php7.y:3002 { yyVAL.list = yyDollar[1].list @@ -5373,18 +5427,18 @@ yydefault: } case 290: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2958 + //line php7/php7.y:3011 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.NodeEnd) + yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 291: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2967 + //line php7/php7.y:3020 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -5392,7 +5446,7 @@ yydefault: } case 292: yyDollar = yyS[yypt-8 : yypt+1] - //line php7/php7.y:2976 + //line php7/php7.y:3029 { if yyDollar[2].node != nil { yyVAL.node = stmt.NewClass(nil, nil, yyDollar[2].node.(*node.ArgumentList), yyDollar[3].ClassExtends, yyDollar[4].ClassImplements, yyDollar[7].list, yyDollar[5].str) @@ -5404,15 +5458,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[8].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ClassToken) - addMeta(yyVAL.node, yyDollar[6].token.Meta, meta.OpenCurlyBracesToken) - addMeta(yyVAL.node, yyDollar[8].token.Meta, meta.CloseCurlyBracesToken) + yyDollar[1].token.Meta.SetTokenName(meta.ClassToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[6].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[8].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 293: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2997 + //line php7/php7.y:3050 { if yyDollar[3].node != nil { yyVAL.node = expr.NewNew(yyDollar[2].node, yyDollar[3].node.(*node.ArgumentList)) @@ -5423,13 +5477,13 @@ yydefault: } // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.NewToken) + yyDollar[1].token.Meta.SetTokenName(meta.NewAnchor).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 294: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3012 + //line php7/php7.y:3065 { yyVAL.node = expr.NewNew(yyDollar[2].node, nil) @@ -5437,13 +5491,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.NewToken) + yyDollar[1].token.Meta.SetTokenName(meta.NewAnchor).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 295: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:3027 + //line php7/php7.y:3080 { list := expr.NewList(yyDollar[3].list) yyVAL.node = assign.NewAssign(list, yyDollar[6].node) @@ -5453,16 +5507,16 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[6].node)) // save comments - addMeta(list, yyDollar[1].token.Meta, meta.ListToken) - addMeta(list, yyDollar[2].token.Meta, meta.OpenParenthesisToken) - addMeta(list, yyDollar[4].token.Meta, meta.CloseParenthesisToken) - addMeta(yyVAL.node, yyDollar[5].token.Meta, meta.EqualToken) + yyDollar[1].token.Meta.SetTokenName(meta.ListToken).AppendTo(list.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(list.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(list.GetMeta()) + yyDollar[5].token.Meta.SetTokenName(meta.EqualToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 296: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:3044 + //line php7/php7.y:3097 { shortList := expr.NewShortList(yyDollar[2].list) yyVAL.node = assign.NewAssign(shortList, yyDollar[5].node) @@ -5472,15 +5526,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[5].node)) // save comments - addMeta(shortList, yyDollar[1].token.Meta, meta.OpenSquareBracket) - addMeta(shortList, yyDollar[3].token.Meta, meta.CloseSquareBracket) - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.EqualToken) + yyDollar[1].token.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo(shortList.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(shortList.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.EqualToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 297: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3060 + //line php7/php7.y:3113 { yyVAL.node = assign.NewAssign(yyDollar[1].node, yyDollar[3].node) @@ -5488,13 +5542,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.EqualToken) + yyDollar[2].token.Meta.SetTokenName(meta.EqualToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 298: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3072 + //line php7/php7.y:3125 { yyVAL.node = assign.NewReference(yyDollar[1].node, yyDollar[4].node) @@ -5502,14 +5556,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.EqualToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.AmpersandToken) + yyDollar[2].token.Meta.SetTokenName(meta.EqualToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 299: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3085 + //line php7/php7.y:3138 { yyVAL.node = expr.NewClone(yyDollar[2].node) @@ -5517,13 +5571,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.CloneToken) + yyDollar[1].token.Meta.SetTokenName(meta.CloneToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 300: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3097 + //line php7/php7.y:3150 { yyVAL.node = assign.NewPlus(yyDollar[1].node, yyDollar[3].node) @@ -5531,13 +5585,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.PlusEqualToken) + yyDollar[2].token.Meta.SetTokenName(meta.PlusEqualToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 301: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3109 + //line php7/php7.y:3162 { yyVAL.node = assign.NewMinus(yyDollar[1].node, yyDollar[3].node) @@ -5545,13 +5599,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.MinusEqualToken) + yyDollar[2].token.Meta.SetTokenName(meta.MinusEqualToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 302: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3121 + //line php7/php7.y:3174 { yyVAL.node = assign.NewMul(yyDollar[1].node, yyDollar[3].node) @@ -5559,13 +5613,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.MulEqualToken) + yyDollar[2].token.Meta.SetTokenName(meta.MulEqualToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 303: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3133 + //line php7/php7.y:3186 { yyVAL.node = assign.NewPow(yyDollar[1].node, yyDollar[3].node) @@ -5573,13 +5627,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.PowEqualToken) + yyDollar[2].token.Meta.SetTokenName(meta.PowEqualToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 304: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3145 + //line php7/php7.y:3198 { yyVAL.node = assign.NewDiv(yyDollar[1].node, yyDollar[3].node) @@ -5587,13 +5641,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.DivEqualToken) + yyDollar[2].token.Meta.SetTokenName(meta.DivEqualToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 305: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3157 + //line php7/php7.y:3210 { yyVAL.node = assign.NewConcat(yyDollar[1].node, yyDollar[3].node) @@ -5601,13 +5655,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.ConcatEqualToken) + yyDollar[2].token.Meta.SetTokenName(meta.ConcatEqualToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 306: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3169 + //line php7/php7.y:3222 { yyVAL.node = assign.NewMod(yyDollar[1].node, yyDollar[3].node) @@ -5615,13 +5669,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.ModEqualToken) + yyDollar[2].token.Meta.SetTokenName(meta.ModEqualToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 307: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3181 + //line php7/php7.y:3234 { yyVAL.node = assign.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) @@ -5629,13 +5683,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.AndEqualToken) + yyDollar[2].token.Meta.SetTokenName(meta.AndEqualToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 308: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3193 + //line php7/php7.y:3246 { yyVAL.node = assign.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) @@ -5643,13 +5697,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OrEqualToken) + yyDollar[2].token.Meta.SetTokenName(meta.OrEqualToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 309: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3205 + //line php7/php7.y:3258 { yyVAL.node = assign.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) @@ -5657,13 +5711,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.XorEqualToken) + yyDollar[2].token.Meta.SetTokenName(meta.XorEqualToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 310: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3217 + //line php7/php7.y:3270 { yyVAL.node = assign.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) @@ -5671,13 +5725,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.SlEqualToken) + yyDollar[2].token.Meta.SetTokenName(meta.SlEqualToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 311: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3229 + //line php7/php7.y:3282 { yyVAL.node = assign.NewShiftRight(yyDollar[1].node, yyDollar[3].node) @@ -5685,13 +5739,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.SrEqualToken) + yyDollar[2].token.Meta.SetTokenName(meta.SrEqualToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 312: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3241 + //line php7/php7.y:3294 { yyVAL.node = expr.NewPostInc(yyDollar[1].node) @@ -5699,13 +5753,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.IncToken) + yyDollar[2].token.Meta.SetTokenName(meta.IncToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 313: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3253 + //line php7/php7.y:3306 { yyVAL.node = expr.NewPreInc(yyDollar[2].node) @@ -5713,13 +5767,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.IncToken) + yyDollar[1].token.Meta.SetTokenName(meta.IncToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 314: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3265 + //line php7/php7.y:3318 { yyVAL.node = expr.NewPostDec(yyDollar[1].node) @@ -5727,13 +5781,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.DecToken) + yyDollar[2].token.Meta.SetTokenName(meta.DecToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 315: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3277 + //line php7/php7.y:3330 { yyVAL.node = expr.NewPreDec(yyDollar[2].node) @@ -5741,13 +5795,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.DecToken) + yyDollar[1].token.Meta.SetTokenName(meta.DecToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 316: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3289 + //line php7/php7.y:3342 { yyVAL.node = binary.NewBooleanOr(yyDollar[1].node, yyDollar[3].node) @@ -5755,13 +5809,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.BooleanOrToken) + yyDollar[2].token.Meta.SetTokenName(meta.BooleanOrToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 317: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3301 + //line php7/php7.y:3354 { yyVAL.node = binary.NewBooleanAnd(yyDollar[1].node, yyDollar[3].node) @@ -5769,13 +5823,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.BooleanAndToken) + yyDollar[2].token.Meta.SetTokenName(meta.BooleanAndToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 318: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3313 + //line php7/php7.y:3366 { yyVAL.node = binary.NewLogicalOr(yyDollar[1].node, yyDollar[3].node) @@ -5783,13 +5837,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.LogicalOrToken) + yyDollar[2].token.Meta.SetTokenName(meta.LogicalOrToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 319: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3325 + //line php7/php7.y:3378 { yyVAL.node = binary.NewLogicalAnd(yyDollar[1].node, yyDollar[3].node) @@ -5797,13 +5851,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.LogicalAndToken) + yyDollar[2].token.Meta.SetTokenName(meta.LogicalAndToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 320: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3337 + //line php7/php7.y:3390 { yyVAL.node = binary.NewLogicalXor(yyDollar[1].node, yyDollar[3].node) @@ -5811,13 +5865,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.LogicalXorToken) + yyDollar[2].token.Meta.SetTokenName(meta.LogicalXorToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 321: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3349 + //line php7/php7.y:3402 { yyVAL.node = binary.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) @@ -5825,13 +5879,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.VerticalBarToken) + yyDollar[2].token.Meta.SetTokenName(meta.VerticalBarToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 322: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3361 + //line php7/php7.y:3414 { yyVAL.node = binary.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) @@ -5839,13 +5893,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.AmpersandToken) + yyDollar[2].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 323: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3373 + //line php7/php7.y:3426 { yyVAL.node = binary.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) @@ -5853,13 +5907,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.CaretToken) + yyDollar[2].token.Meta.SetTokenName(meta.CaretToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 324: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3385 + //line php7/php7.y:3438 { yyVAL.node = binary.NewConcat(yyDollar[1].node, yyDollar[3].node) @@ -5867,13 +5921,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.DotToken) + yyDollar[2].token.Meta.SetTokenName(meta.DotToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 325: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3397 + //line php7/php7.y:3450 { yyVAL.node = binary.NewPlus(yyDollar[1].node, yyDollar[3].node) @@ -5881,13 +5935,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.PlusToken) + yyDollar[2].token.Meta.SetTokenName(meta.PlusToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 326: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3409 + //line php7/php7.y:3462 { yyVAL.node = binary.NewMinus(yyDollar[1].node, yyDollar[3].node) @@ -5895,13 +5949,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.MinusToken) + yyDollar[2].token.Meta.SetTokenName(meta.MinusToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 327: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3421 + //line php7/php7.y:3474 { yyVAL.node = binary.NewMul(yyDollar[1].node, yyDollar[3].node) @@ -5909,13 +5963,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.AsteriskToken) + yyDollar[2].token.Meta.SetTokenName(meta.AsteriskToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 328: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3433 + //line php7/php7.y:3486 { yyVAL.node = binary.NewPow(yyDollar[1].node, yyDollar[3].node) @@ -5923,13 +5977,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.PowToken) + yyDollar[2].token.Meta.SetTokenName(meta.PowToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 329: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3445 + //line php7/php7.y:3498 { yyVAL.node = binary.NewDiv(yyDollar[1].node, yyDollar[3].node) @@ -5937,13 +5991,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.SlashToken) + yyDollar[2].token.Meta.SetTokenName(meta.SlashToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 330: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3457 + //line php7/php7.y:3510 { yyVAL.node = binary.NewMod(yyDollar[1].node, yyDollar[3].node) @@ -5951,13 +6005,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.PercentToken) + yyDollar[2].token.Meta.SetTokenName(meta.PercentToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 331: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3469 + //line php7/php7.y:3522 { yyVAL.node = binary.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) @@ -5965,13 +6019,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.SlToken) + yyDollar[2].token.Meta.SetTokenName(meta.SlToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 332: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3481 + //line php7/php7.y:3534 { yyVAL.node = binary.NewShiftRight(yyDollar[1].node, yyDollar[3].node) @@ -5979,13 +6033,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.SrToken) + yyDollar[2].token.Meta.SetTokenName(meta.SrToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 333: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3493 + //line php7/php7.y:3546 { yyVAL.node = expr.NewUnaryPlus(yyDollar[2].node) @@ -5993,13 +6047,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.PlusToken) + yyDollar[1].token.Meta.SetTokenName(meta.PlusToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 334: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3505 + //line php7/php7.y:3558 { yyVAL.node = expr.NewUnaryMinus(yyDollar[2].node) @@ -6007,13 +6061,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.MinusToken) + yyDollar[1].token.Meta.SetTokenName(meta.MinusToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 335: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3517 + //line php7/php7.y:3570 { yyVAL.node = expr.NewBooleanNot(yyDollar[2].node) @@ -6021,13 +6075,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ExclamationMarkToken) + yyDollar[1].token.Meta.SetTokenName(meta.ExclamationMarkToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 336: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3529 + //line php7/php7.y:3582 { yyVAL.node = expr.NewBitwiseNot(yyDollar[2].node) @@ -6035,13 +6089,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.TildeToken) + yyDollar[1].token.Meta.SetTokenName(meta.TildeToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 337: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3541 + //line php7/php7.y:3594 { yyVAL.node = binary.NewIdentical(yyDollar[1].node, yyDollar[3].node) @@ -6049,13 +6103,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.IsIdenticalToken) + yyDollar[2].token.Meta.SetTokenName(meta.IsIdenticalToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 338: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3553 + //line php7/php7.y:3606 { yyVAL.node = binary.NewNotIdentical(yyDollar[1].node, yyDollar[3].node) @@ -6063,13 +6117,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.IsNotIdenticalToken) + yyDollar[2].token.Meta.SetTokenName(meta.IsNotIdenticalToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 339: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3565 + //line php7/php7.y:3618 { yyVAL.node = binary.NewEqual(yyDollar[1].node, yyDollar[3].node) @@ -6077,13 +6131,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.IsEqualToken) + yyDollar[2].token.Meta.SetTokenName(meta.IsEqualToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 340: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3577 + //line php7/php7.y:3630 { yyVAL.node = binary.NewNotEqual(yyDollar[1].node, yyDollar[3].node) @@ -6091,13 +6145,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.IsNotEqualToken) + yyDollar[2].token.Meta.SetTokenName(meta.IsNotEqualToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.IsNotEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 341: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3589 + //line php7/php7.y:3643 { yyVAL.node = binary.NewSmaller(yyDollar[1].node, yyDollar[3].node) @@ -6105,13 +6160,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.LessToken) + yyDollar[2].token.Meta.SetTokenName(meta.LessToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 342: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3601 + //line php7/php7.y:3655 { yyVAL.node = binary.NewSmallerOrEqual(yyDollar[1].node, yyDollar[3].node) @@ -6119,13 +6174,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.IsSmallerOrEqualToken) + yyDollar[2].token.Meta.SetTokenName(meta.IsSmallerOrEqualToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 343: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3613 + //line php7/php7.y:3667 { yyVAL.node = binary.NewGreater(yyDollar[1].node, yyDollar[3].node) @@ -6133,13 +6188,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.GreaterToken) + yyDollar[2].token.Meta.SetTokenName(meta.GreaterToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 344: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3625 + //line php7/php7.y:3679 { yyVAL.node = binary.NewGreaterOrEqual(yyDollar[1].node, yyDollar[3].node) @@ -6147,13 +6202,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.IsGreaterOrEqualToken) + yyDollar[2].token.Meta.SetTokenName(meta.IsGreaterOrEqualToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 345: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3637 + //line php7/php7.y:3691 { yyVAL.node = binary.NewSpaceship(yyDollar[1].node, yyDollar[3].node) @@ -6161,13 +6216,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.SpaceshipToken) + yyDollar[2].token.Meta.SetTokenName(meta.SpaceshipToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 346: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3649 + //line php7/php7.y:3703 { yyVAL.node = expr.NewInstanceOf(yyDollar[1].node, yyDollar[3].node) @@ -6175,25 +6230,27 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.InstanceofToken) + yyDollar[2].token.Meta.SetTokenName(meta.InstanceofToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 347: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3661 + //line php7/php7.y:3715 { yyVAL.node = yyDollar[2].node // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.OpenParenthesisToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.CloseParenthesisToken) + yylex.(*Parser).prependMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).PrependTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 348: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3671 + //line php7/php7.y:3727 { yyVAL.node = yyDollar[1].node @@ -6201,7 +6258,7 @@ yydefault: } case 349: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:3677 + //line php7/php7.y:3733 { yyVAL.node = expr.NewTernary(yyDollar[1].node, yyDollar[3].node, yyDollar[5].node) @@ -6209,14 +6266,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[5].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.QuestionMarkToken) - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.ColonToken) + yyDollar[2].token.Meta.SetTokenName(meta.QuestionMarkToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.ColonToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 350: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3690 + //line php7/php7.y:3746 { yyVAL.node = expr.NewTernary(yyDollar[1].node, nil, yyDollar[4].node) @@ -6224,14 +6281,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.QuestionMarkToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.ColonToken) + yyDollar[2].token.Meta.SetTokenName(meta.QuestionMarkToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.ColonToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 351: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3703 + //line php7/php7.y:3759 { yyVAL.node = binary.NewCoalesce(yyDollar[1].node, yyDollar[3].node) @@ -6239,13 +6296,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.CoalesceToken) + yyDollar[2].token.Meta.SetTokenName(meta.CoalesceToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 352: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3715 + //line php7/php7.y:3771 { yyVAL.node = yyDollar[1].node @@ -6253,7 +6310,7 @@ yydefault: } case 353: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3721 + //line php7/php7.y:3777 { yyVAL.node = cast.NewInt(yyDollar[2].node) @@ -6261,13 +6318,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.IntCastToken) + yyDollar[1].token.Meta.SetTokenName(meta.IntCastToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.IntCastToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 354: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3733 + //line php7/php7.y:3790 { yyVAL.node = cast.NewDouble(yyDollar[2].node) @@ -6275,13 +6333,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.DoubleCastToken) + yyDollar[1].token.Meta.SetTokenName(meta.DoubleCastToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.DoubleCastToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 355: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3745 + //line php7/php7.y:3803 { yyVAL.node = cast.NewString(yyDollar[2].node) @@ -6289,13 +6348,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.StringCastToken) + yyDollar[1].token.Meta.SetTokenName(meta.StringCastToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.StringCastToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 356: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3757 + //line php7/php7.y:3816 { yyVAL.node = cast.NewArray(yyDollar[2].node) @@ -6303,13 +6363,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ArrayCastToken) + yyDollar[1].token.Meta.SetTokenName(meta.ArrayCastToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.ArrayCastToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 357: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3769 + //line php7/php7.y:3829 { yyVAL.node = cast.NewObject(yyDollar[2].node) @@ -6317,13 +6378,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ObjectCastToken) + yyDollar[1].token.Meta.SetTokenName(meta.ObjectCastToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.ObjectCastToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 358: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3781 + //line php7/php7.y:3842 { yyVAL.node = cast.NewBool(yyDollar[2].node) @@ -6331,13 +6393,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.BoolCastToken) + yyDollar[1].token.Meta.SetTokenName(meta.BoolCastToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.BoolCastToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 359: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3793 + //line php7/php7.y:3855 { yyVAL.node = cast.NewUnset(yyDollar[2].node) @@ -6345,13 +6408,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.UnsetCastToken) + yyDollar[1].token.Meta.SetTokenName(meta.UnsetCastToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.UnsetCastToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 360: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3805 + //line php7/php7.y:3868 { var e *expr.Exit if yyDollar[2].node != nil { @@ -6374,13 +6438,13 @@ yydefault: } // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ExitToken) + yyDollar[1].token.Meta.SetTokenName(meta.ExitToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 361: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3832 + //line php7/php7.y:3895 { yyVAL.node = expr.NewErrorSuppress(yyDollar[2].node) @@ -6388,13 +6452,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.AtToken) + yyDollar[1].token.Meta.SetTokenName(meta.AtToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 362: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3844 + //line php7/php7.y:3907 { yyVAL.node = yyDollar[1].node @@ -6402,7 +6466,7 @@ yydefault: } case 363: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3850 + //line php7/php7.y:3913 { yyVAL.node = expr.NewShellExec(yyDollar[2].list) @@ -6410,14 +6474,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.BackquoteToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.BackquoteToken) + yyDollar[1].token.Meta.SetTokenName(meta.BackquoteToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.BackquoteToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 364: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3863 + //line php7/php7.y:3926 { yyVAL.node = expr.NewPrint(yyDollar[2].node) @@ -6425,13 +6489,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.PrintToken) + yyDollar[1].token.Meta.SetTokenName(meta.PrintToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 365: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3875 + //line php7/php7.y:3938 { yyVAL.node = expr.NewYield(nil, nil) @@ -6439,13 +6503,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.YieldToken) + yyDollar[1].token.Meta.SetTokenName(meta.YieldToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 366: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3887 + //line php7/php7.y:3950 { yyVAL.node = expr.NewYield(nil, yyDollar[2].node) @@ -6453,13 +6517,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.YieldToken) + yyDollar[1].token.Meta.SetTokenName(meta.YieldToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 367: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3899 + //line php7/php7.y:3962 { yyVAL.node = expr.NewYield(yyDollar[2].node, yyDollar[4].node) @@ -6467,14 +6531,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[4].node)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.YieldToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.DoubleArrowToken) + yyDollar[1].token.Meta.SetTokenName(meta.YieldToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 368: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3912 + //line php7/php7.y:3975 { yyVAL.node = expr.NewYieldFrom(yyDollar[2].node) @@ -6482,13 +6546,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.YieldFromToken) + yyDollar[1].token.Meta.SetTokenName(meta.YieldFromToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 369: yyDollar = yyS[yypt-11 : yypt+1] - //line php7/php7.y:3924 + //line php7/php7.y:3987 { yyVAL.node = expr.NewClosure(yyDollar[5].list, yyDollar[7].ClosureUse, yyDollar[8].node, yyDollar[10].list, false, yyDollar[2].token != nil, yyDollar[3].str) @@ -6496,20 +6560,20 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[11].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.FunctionToken) + yyDollar[1].token.Meta.SetTokenName(meta.FunctionToken).AppendTo(yyVAL.node.GetMeta()) if yyDollar[2].token != nil { - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.AmpersandToken) + yyDollar[2].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(yyVAL.node.GetMeta()) } - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.OpenParenthesisToken) - addMeta(yyVAL.node, yyDollar[6].token.Meta, meta.CloseParenthesisToken) - addMeta(yyVAL.node, yyDollar[9].token.Meta, meta.OpenCurlyBracesToken) - addMeta(yyVAL.node, yyDollar[11].token.Meta, meta.CloseCurlyBracesToken) + yyDollar[4].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[6].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[9].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[11].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 370: yyDollar = yyS[yypt-12 : yypt+1] - //line php7/php7.y:3943 + //line php7/php7.y:4006 { yyVAL.node = expr.NewClosure(yyDollar[6].list, yyDollar[8].ClosureUse, yyDollar[9].node, yyDollar[11].list, true, yyDollar[3].token != nil, yyDollar[4].str) @@ -6517,21 +6581,21 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[12].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.StaticToken) - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.FunctionToken) + yyDollar[1].token.Meta.SetTokenName(meta.StaticToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.FunctionToken).AppendTo(yyVAL.node.GetMeta()) if yyDollar[3].token != nil { - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.AmpersandToken) + yyDollar[3].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(yyVAL.node.GetMeta()) } - addMeta(yyVAL.node, yyDollar[5].token.Meta, meta.OpenParenthesisToken) - addMeta(yyVAL.node, yyDollar[7].token.Meta, meta.CloseParenthesisToken) - addMeta(yyVAL.node, yyDollar[10].token.Meta, meta.OpenCurlyBracesToken) - addMeta(yyVAL.node, yyDollar[12].token.Meta, meta.CloseCurlyBracesToken) + yyDollar[5].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[7].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[10].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[12].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 371: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3966 + //line php7/php7.y:4029 { yyVAL.str = yylex.(*Parser).PhpDocComment yylex.(*Parser).PhpDocComment = "" @@ -6540,19 +6604,19 @@ yydefault: } case 372: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3976 + //line php7/php7.y:4039 { yyVAL.token = nil } case 373: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3980 + //line php7/php7.y:4043 { yyVAL.token = yyDollar[1].token } case 374: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3987 + //line php7/php7.y:4050 { yyVAL.ClosureUse = nil @@ -6560,7 +6624,7 @@ yydefault: } case 375: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3993 + //line php7/php7.y:4056 { yyVAL.ClosureUse = expr.NewClosureUse(yyDollar[3].list) @@ -6568,26 +6632,26 @@ yydefault: yyVAL.ClosureUse.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - addMeta(yyVAL.ClosureUse, yyDollar[1].token.Meta, meta.UseToken) - addMeta(yyVAL.ClosureUse, yyDollar[2].token.Meta, meta.OpenParenthesisToken) - addMeta(yyVAL.ClosureUse, yyDollar[4].token.Meta, meta.CloseParenthesisToken) + yyDollar[1].token.Meta.SetTokenName(meta.UseToken).AppendTo(yyVAL.ClosureUse.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.ClosureUse.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.ClosureUse.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 376: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4010 + //line php7/php7.y:4073 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.NodeEnd) + yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 377: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4019 + //line php7/php7.y:4082 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -6595,7 +6659,7 @@ yydefault: } case 378: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4028 + //line php7/php7.y:4091 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(identifier) @@ -6605,13 +6669,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.VariableToken) + yyDollar[1].token.Meta.SetTokenName(meta.VariableToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 379: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4042 + //line php7/php7.y:4105 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[2].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -6623,14 +6687,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.AmpersandToken) - addMeta(variable, yyDollar[2].token.Meta, meta.VariableToken) + yyDollar[1].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 380: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4062 + //line php7/php7.y:4125 { yyVAL.node = expr.NewFunctionCall(yyDollar[1].node, yyDollar[2].node.(*node.ArgumentList)) @@ -6641,7 +6705,7 @@ yydefault: } case 381: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4071 + //line php7/php7.y:4134 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -6649,13 +6713,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.PaamayimNekudotayimToken) + yyDollar[2].token.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 382: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4083 + //line php7/php7.y:4146 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -6663,13 +6727,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.PaamayimNekudotayimToken) + yyDollar[2].token.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 383: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4095 + //line php7/php7.y:4158 { yyVAL.node = expr.NewFunctionCall(yyDollar[1].node, yyDollar[2].node.(*node.ArgumentList)) @@ -6680,7 +6744,7 @@ yydefault: } case 384: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4107 + //line php7/php7.y:4170 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -6688,13 +6752,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.IdentifierToken) + yyDollar[1].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 385: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4119 + //line php7/php7.y:4182 { yyVAL.node = yyDollar[1].node @@ -6702,7 +6766,7 @@ yydefault: } case 386: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4128 + //line php7/php7.y:4191 { yyVAL.node = yyDollar[1].node @@ -6710,7 +6774,7 @@ yydefault: } case 387: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4134 + //line php7/php7.y:4197 { yyVAL.node = yyDollar[1].node @@ -6718,7 +6782,7 @@ yydefault: } case 388: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4143 + //line php7/php7.y:4206 { yyVAL.node = nil @@ -6726,7 +6790,7 @@ yydefault: } case 389: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4149 + //line php7/php7.y:4212 { yyVAL.node = expr.NewExit(yyDollar[2].node) @@ -6734,14 +6798,16 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.OpenParenthesisToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.CloseParenthesisToken) + yyDollar[1].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.OpenParenthesisToken) + yyDollar[3].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 390: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4165 + //line php7/php7.y:4230 { yyVAL.list = []node.Node{} @@ -6749,7 +6815,7 @@ yydefault: } case 391: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4171 + //line php7/php7.y:4236 { yyVAL.list = []node.Node{scalar.NewEncapsedStringPart(yyDollar[1].token.Value)} @@ -6757,7 +6823,7 @@ yydefault: } case 392: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4177 + //line php7/php7.y:4242 { yyVAL.list = yyDollar[1].list @@ -6765,7 +6831,7 @@ yydefault: } case 393: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4186 + //line php7/php7.y:4251 { yyVAL.node = nil @@ -6773,7 +6839,7 @@ yydefault: } case 394: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4192 + //line php7/php7.y:4257 { yyVAL.node = yyDollar[1].node @@ -6781,7 +6847,7 @@ yydefault: } case 395: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4201 + //line php7/php7.y:4266 { yyVAL.node = expr.NewArray(yyDollar[3].list) @@ -6789,15 +6855,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ArrayToken) - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenParenthesisToken) - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseParenthesisToken) + yyDollar[1].token.Meta.SetTokenName(meta.ArrayToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 396: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4215 + //line php7/php7.y:4280 { yyVAL.node = expr.NewShortArray(yyDollar[2].list) @@ -6805,14 +6871,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.OpenSquareBracket) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.CloseSquareBracket) + yyDollar[1].token.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 397: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4228 + //line php7/php7.y:4293 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) @@ -6820,13 +6886,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.ConstantEncapsedStringToken) + yyDollar[1].token.Meta.SetTokenName(meta.ConstantEncapsedStringToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 398: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4243 + //line php7/php7.y:4308 { yyVAL.node = scalar.NewLnumber(yyDollar[1].token.Value) @@ -6834,13 +6900,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.LnumberToken) + yyDollar[1].token.Meta.SetTokenName(meta.LnumberToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 399: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4255 + //line php7/php7.y:4320 { yyVAL.node = scalar.NewDnumber(yyDollar[1].token.Value) @@ -6848,13 +6914,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.DnumberToken) + yyDollar[1].token.Meta.SetTokenName(meta.DnumberToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 400: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4267 + //line php7/php7.y:4332 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6862,13 +6928,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.MagicConstantToken) + yyDollar[1].token.Meta.SetTokenName(meta.MagicConstantToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 401: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4279 + //line php7/php7.y:4344 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6876,13 +6942,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.MagicConstantToken) + yyDollar[1].token.Meta.SetTokenName(meta.MagicConstantToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 402: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4291 + //line php7/php7.y:4356 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6890,13 +6956,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.MagicConstantToken) + yyDollar[1].token.Meta.SetTokenName(meta.MagicConstantToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 403: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4303 + //line php7/php7.y:4368 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6904,13 +6970,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.MagicConstantToken) + yyDollar[1].token.Meta.SetTokenName(meta.MagicConstantToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 404: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4315 + //line php7/php7.y:4380 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6918,13 +6984,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.MagicConstantToken) + yyDollar[1].token.Meta.SetTokenName(meta.MagicConstantToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 405: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4327 + //line php7/php7.y:4392 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6932,13 +6998,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.MagicConstantToken) + yyDollar[1].token.Meta.SetTokenName(meta.MagicConstantToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 406: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4339 + //line php7/php7.y:4404 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6946,13 +7012,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.MagicConstantToken) + yyDollar[1].token.Meta.SetTokenName(meta.MagicConstantToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 407: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4351 + //line php7/php7.y:4416 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6960,13 +7026,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.MagicConstantToken) + yyDollar[1].token.Meta.SetTokenName(meta.MagicConstantToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 408: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4363 + //line php7/php7.y:4428 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, []node.Node{encapsed}) @@ -6976,13 +7042,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.StartHeredocToken) + yyDollar[1].token.Meta.SetTokenName(meta.StartHeredocToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 409: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4377 + //line php7/php7.y:4442 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, nil) @@ -6990,13 +7056,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.StartHeredocToken) + yyDollar[1].token.Meta.SetTokenName(meta.StartHeredocToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 410: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4389 + //line php7/php7.y:4454 { yyVAL.node = scalar.NewEncapsed(yyDollar[2].list) @@ -7004,13 +7070,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.DoubleQuoteToken) + yyDollar[1].token.Meta.SetTokenName(meta.DoubleQuoteToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 411: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4401 + //line php7/php7.y:4466 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, yyDollar[2].list) @@ -7018,13 +7084,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.StartHeredocToken) + yyDollar[1].token.Meta.SetTokenName(meta.StartHeredocToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 412: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4413 + //line php7/php7.y:4478 { yyVAL.node = yyDollar[1].node @@ -7032,7 +7098,7 @@ yydefault: } case 413: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4419 + //line php7/php7.y:4484 { yyVAL.node = yyDollar[1].node @@ -7040,7 +7106,7 @@ yydefault: } case 414: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4428 + //line php7/php7.y:4493 { yyVAL.node = expr.NewConstFetch(yyDollar[1].node) @@ -7051,7 +7117,7 @@ yydefault: } case 415: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4437 + //line php7/php7.y:4502 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -7061,14 +7127,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.PaamayimNekudotayimToken) - addMeta(target, yyDollar[3].token.Meta, meta.IdentifierToken) + yyDollar[2].token.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(target.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 416: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4452 + //line php7/php7.y:4517 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -7078,14 +7144,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.PaamayimNekudotayimToken) - addMeta(target, yyDollar[3].token.Meta, meta.IdentifierToken) + yyDollar[2].token.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(target.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 417: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4470 + //line php7/php7.y:4535 { yyVAL.node = yyDollar[1].node @@ -7093,7 +7159,7 @@ yydefault: } case 418: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4476 + //line php7/php7.y:4541 { yyVAL.node = yyDollar[1].node @@ -7101,7 +7167,7 @@ yydefault: } case 419: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4485 + //line php7/php7.y:4550 { yyVAL.node = nil @@ -7109,7 +7175,7 @@ yydefault: } case 420: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4491 + //line php7/php7.y:4556 { yyVAL.node = yyDollar[1].node @@ -7117,7 +7183,7 @@ yydefault: } case 421: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4500 + //line php7/php7.y:4565 { yyVAL.node = yyDollar[1].node @@ -7125,7 +7191,7 @@ yydefault: } case 422: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4509 + //line php7/php7.y:4574 { yyVAL.node = yyDollar[1].node @@ -7133,19 +7199,21 @@ yydefault: } case 423: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4515 + //line php7/php7.y:4580 { yyVAL.node = yyDollar[2].node // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.OpenParenthesisToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.CloseParenthesisToken) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) + yyDollar[3].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 424: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4525 + //line php7/php7.y:4592 { yyVAL.node = yyDollar[1].node @@ -7153,7 +7221,7 @@ yydefault: } case 425: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4534 + //line php7/php7.y:4601 { yyVAL.node = yyDollar[1].node @@ -7161,19 +7229,21 @@ yydefault: } case 426: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4540 + //line php7/php7.y:4607 { yyVAL.node = yyDollar[2].node // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.OpenParenthesisToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.CloseParenthesisToken) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) + yyDollar[3].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 427: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4550 + //line php7/php7.y:4619 { yyVAL.node = yyDollar[1].node @@ -7181,7 +7251,7 @@ yydefault: } case 428: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4559 + //line php7/php7.y:4628 { yyVAL.node = yyDollar[1].node @@ -7189,7 +7259,7 @@ yydefault: } case 429: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4565 + //line php7/php7.y:4634 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -7197,14 +7267,16 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenSquareBracket) - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseSquareBracket) + yyDollar[2].token.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.OpenSquareBracket) + yyDollar[4].token.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 430: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4578 + //line php7/php7.y:4649 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -7212,14 +7284,16 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenSquareBracket) - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseSquareBracket) + yyDollar[2].token.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.OpenSquareBracket) + yyDollar[4].token.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 431: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4591 + //line php7/php7.y:4664 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -7227,14 +7301,16 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenCurlyBracesToken) - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseCurlyBracesToken) + yyDollar[2].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.OpenCurlyBracesToken) + yyDollar[4].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 432: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4604 + //line php7/php7.y:4679 { yyVAL.node = expr.NewMethodCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -7242,13 +7318,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.ObjectOperatorToken) + yyDollar[2].token.Meta.SetTokenName(meta.ObjectOperatorToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 433: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4616 + //line php7/php7.y:4691 { yyVAL.node = yyDollar[1].node @@ -7256,7 +7332,7 @@ yydefault: } case 434: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4625 + //line php7/php7.y:4700 { yyVAL.node = yyDollar[1].node @@ -7264,7 +7340,7 @@ yydefault: } case 435: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4631 + //line php7/php7.y:4706 { yyVAL.node = yyDollar[1].node @@ -7272,7 +7348,7 @@ yydefault: } case 436: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4637 + //line php7/php7.y:4712 { yyVAL.node = expr.NewPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -7280,13 +7356,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.ObjectOperatorToken) + yyDollar[2].token.Meta.SetTokenName(meta.ObjectOperatorToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 437: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4652 + //line php7/php7.y:4727 { name := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(name) @@ -7296,13 +7372,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.VariableToken) + yyDollar[1].token.Meta.SetTokenName(meta.VariableToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 438: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4666 + //line php7/php7.y:4741 { yyVAL.node = expr.NewVariable(yyDollar[3].node) @@ -7310,15 +7386,17 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.DollarToken) - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenCurlyBracesToken) - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseCurlyBracesToken) + yyDollar[1].token.Meta.SetTokenName(meta.DollarToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.OpenCurlyBracesToken) + yyDollar[4].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 439: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4680 + //line php7/php7.y:4757 { yyVAL.node = expr.NewVariable(yyDollar[2].node) @@ -7326,13 +7404,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.DollarToken) + yyDollar[1].token.Meta.SetTokenName(meta.DollarToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 440: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4695 + //line php7/php7.y:4772 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -7340,13 +7418,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.PaamayimNekudotayimToken) + yyDollar[2].token.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 441: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4707 + //line php7/php7.y:4784 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -7354,13 +7432,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.PaamayimNekudotayimToken) + yyDollar[2].token.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 442: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4722 + //line php7/php7.y:4799 { yyVAL.node = yyDollar[1].node @@ -7368,7 +7446,7 @@ yydefault: } case 443: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4728 + //line php7/php7.y:4805 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -7376,14 +7454,16 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenSquareBracket) - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseSquareBracket) + yyDollar[2].token.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.OpenSquareBracket) + yyDollar[4].token.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 444: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4741 + //line php7/php7.y:4820 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -7391,14 +7471,16 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenCurlyBracesToken) - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseCurlyBracesToken) + yyDollar[2].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.OpenCurlyBracesToken) + yyDollar[4].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 445: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4754 + //line php7/php7.y:4835 { yyVAL.node = expr.NewPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -7406,13 +7488,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.ObjectOperatorToken) + yyDollar[2].token.Meta.SetTokenName(meta.ObjectOperatorToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 446: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4766 + //line php7/php7.y:4847 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -7420,13 +7502,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.PaamayimNekudotayimToken) + yyDollar[2].token.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 447: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4778 + //line php7/php7.y:4859 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -7434,13 +7516,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.PaamayimNekudotayimToken) + yyDollar[2].token.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 448: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4793 + //line php7/php7.y:4874 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -7448,25 +7530,27 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.IdentifierToken) + yyDollar[1].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 449: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4805 + //line php7/php7.y:4886 { yyVAL.node = yyDollar[2].node // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.OpenCurlyBracesToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.CloseCurlyBracesToken) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) + yyDollar[3].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 450: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4815 + //line php7/php7.y:4898 { yyVAL.node = yyDollar[1].node @@ -7474,7 +7558,7 @@ yydefault: } case 451: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4824 + //line php7/php7.y:4907 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -7482,25 +7566,27 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.IdentifierToken) + yyDollar[1].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 452: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4836 + //line php7/php7.y:4919 { yyVAL.node = yyDollar[2].node // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.OpenCurlyBracesToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.CloseCurlyBracesToken) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) + yyDollar[3].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 453: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4846 + //line php7/php7.y:4931 { yyVAL.node = yyDollar[1].node @@ -7508,7 +7594,7 @@ yydefault: } case 454: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4855 + //line php7/php7.y:4940 { yyVAL.list = yyDollar[1].list @@ -7516,7 +7602,7 @@ yydefault: } case 455: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4864 + //line php7/php7.y:4949 { yyVAL.node = expr.NewArrayItem(nil, nil) @@ -7524,7 +7610,7 @@ yydefault: } case 456: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4870 + //line php7/php7.y:4955 { yyVAL.node = yyDollar[1].node @@ -7532,7 +7618,7 @@ yydefault: } case 457: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4879 + //line php7/php7.y:4964 { if len(yyDollar[1].list) == 0 { yyDollar[1].list = []node.Node{expr.NewArrayItem(nil, nil)} @@ -7541,13 +7627,13 @@ yydefault: yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.NodeEnd) + yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 458: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4892 + //line php7/php7.y:4977 { if yyDollar[1].node.(*expr.ArrayItem).Key == nil && yyDollar[1].node.(*expr.ArrayItem).Val == nil { yyVAL.list = []node.Node{} @@ -7559,7 +7645,7 @@ yydefault: } case 459: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4905 + //line php7/php7.y:4990 { yyVAL.node = expr.NewArrayItem(yyDollar[1].node, yyDollar[3].node) @@ -7567,13 +7653,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.DoubleArrowToken) + yyDollar[2].token.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 460: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4917 + //line php7/php7.y:5002 { yyVAL.node = expr.NewArrayItem(nil, yyDollar[1].node) @@ -7584,7 +7670,7 @@ yydefault: } case 461: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4926 + //line php7/php7.y:5011 { reference := expr.NewReference(yyDollar[4].node) yyVAL.node = expr.NewArrayItem(yyDollar[1].node, reference) @@ -7594,14 +7680,14 @@ yydefault: reference.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[3].token, yyDollar[4].node)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.DoubleArrowToken) - addMeta(reference, yyDollar[3].token.Meta, meta.AmpersandToken) + yyDollar[2].token.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(reference.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 462: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4941 + //line php7/php7.y:5026 { reference := expr.NewReference(yyDollar[2].node) yyVAL.node = expr.NewArrayItem(nil, reference) @@ -7611,13 +7697,13 @@ yydefault: reference.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - addMeta(reference, yyDollar[1].token.Meta, meta.AmpersandToken) + yyDollar[1].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(reference.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 463: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:4955 + //line php7/php7.y:5040 { // TODO: Cannot use list() as standalone expression list := expr.NewList(yyDollar[5].list) @@ -7628,16 +7714,16 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[6].token)) // save comments - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.DoubleArrowToken) - addMeta(list, yyDollar[3].token.Meta, meta.ListToken) - addMeta(list, yyDollar[4].token.Meta, meta.OpenParenthesisToken) - addMeta(list, yyDollar[6].token.Meta, meta.CloseParenthesisToken) + yyDollar[2].token.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.ListToken).AppendTo(list.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(list.GetMeta()) + yyDollar[6].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(list.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 464: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4973 + //line php7/php7.y:5058 { // TODO: Cannot use list() as standalone expression list := expr.NewList(yyDollar[3].list) @@ -7648,15 +7734,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - addMeta(list, yyDollar[1].token.Meta, meta.ListToken) - addMeta(list, yyDollar[2].token.Meta, meta.OpenParenthesisToken) - addMeta(list, yyDollar[4].token.Meta, meta.CloseParenthesisToken) + yyDollar[1].token.Meta.SetTokenName(meta.ListToken).AppendTo(list.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(list.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(list.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 465: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4993 + //line php7/php7.y:5078 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -7664,7 +7750,7 @@ yydefault: } case 466: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4999 + //line php7/php7.y:5084 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yyVAL.list = append(yyDollar[1].list, encapsed) @@ -7673,13 +7759,13 @@ yydefault: encapsed.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) // save comments - addMeta(encapsed, yyDollar[2].token.Meta, meta.EncapsedAndWhitespaceToken) + yyDollar[2].token.Meta.SetTokenName(meta.EncapsedAndWhitespaceToken).AppendTo(encapsed.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 467: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5012 + //line php7/php7.y:5097 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -7687,7 +7773,7 @@ yydefault: } case 468: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5018 + //line php7/php7.y:5103 { encapsed := scalar.NewEncapsedStringPart(yyDollar[1].token.Value) yyVAL.list = []node.Node{encapsed, yyDollar[2].node} @@ -7696,13 +7782,13 @@ yydefault: encapsed.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(encapsed, yyDollar[1].token.Meta, meta.EncapsedAndWhitespaceToken) + yyDollar[1].token.Meta.SetTokenName(meta.EncapsedAndWhitespaceToken).AppendTo(encapsed.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 469: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5034 + //line php7/php7.y:5119 { name := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(name) @@ -7712,13 +7798,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.VariableToken) + yyDollar[1].token.Meta.SetTokenName(meta.VariableToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 470: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:5048 + //line php7/php7.y:5133 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -7730,15 +7816,17 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - addMeta(variable, yyDollar[1].token.Meta, meta.VariableToken) - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenSquareBracket) - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseSquareBracket) + yyDollar[1].token.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.OpenCurlyBracesToken) + yyDollar[4].token.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 471: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5066 + //line php7/php7.y:5153 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -7752,51 +7840,62 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - addMeta(variable, yyDollar[1].token.Meta, meta.VariableToken) - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.ObjectOperatorToken) - addMeta(fetch, yyDollar[3].token.Meta, meta.IdentifierToken) + yyDollar[1].token.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.ObjectOperatorToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(fetch.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 472: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5086 + //line php7/php7.y:5173 { - yyVAL.node = expr.NewVariable(yyDollar[2].node) + variable := expr.NewVariable(yyDollar[2].node) + variable.StringVar = true + + yyVAL.node = variable // save position yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.DollarOpenCurlyBracesToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.CloseCurlyBracesToken) + yyDollar[1].token.Meta.SetTokenName(meta.DollarOpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.DollarOpenCurlyBracesToken) + yyDollar[3].token.Meta.SetTokenName(meta.DollarCloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.DollarCloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 473: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5099 + //line php7/php7.y:5191 { name := node.NewIdentifier(yyDollar[2].token.Value) - yyVAL.node = expr.NewVariable(name) + variable := expr.NewVariable(name) + variable.StringVar = true + + yyVAL.node = variable // save position name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.DollarOpenCurlyBracesToken) - addMeta(name, yyDollar[2].token.Meta, meta.IdentifierToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.CloseCurlyBracesToken) + yyDollar[1].token.Meta.SetTokenName(meta.DollarOpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.DollarOpenCurlyBracesToken) + yyDollar[2].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.DollarCloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.DollarCloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 474: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:5115 + //line php7/php7.y:5212 { identifier := node.NewIdentifier(yyDollar[2].token.Value) variable := expr.NewVariable(identifier) + variable.StringVar = true yyVAL.node = expr.NewArrayDimFetch(variable, yyDollar[4].node) // save position @@ -7805,25 +7904,35 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[6].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.DollarOpenCurlyBracesToken) - addMeta(variable, yyDollar[2].token.Meta, meta.StringVarnameToken) - addMeta(yyVAL.node, yyDollar[3].token.Meta, meta.OpenSquareBracket) - addMeta(yyVAL.node, yyDollar[5].token.Meta, meta.CloseSquareBracket) - addMeta(yyVAL.node, yyDollar[6].token.Meta, meta.CloseCurlyBracesToken) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) + yyDollar[2].token.Meta.SetTokenName(meta.StringVarnameToken).AppendTo(variable.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.OpenSquareBracket) + yyDollar[5].token.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[5].token, meta.CloseSquareBracket) + yyDollar[6].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[6].token, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 475: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5135 + //line php7/php7.y:5237 { yyVAL.node = yyDollar[2].node + // save comments + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) + yyDollar[3].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.NodeEnd) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 476: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5144 + //line php7/php7.y:5252 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) @@ -7831,13 +7940,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.StringToken) + yyDollar[1].token.Meta.SetTokenName(meta.StringToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 477: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5156 + //line php7/php7.y:5264 { // TODO: add option to handle 64 bit integer if _, err := strconv.Atoi(yyDollar[1].token.Value); err == nil { @@ -7850,13 +7959,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.NumStringToken) + yyDollar[1].token.Meta.SetTokenName(meta.NumStringToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 478: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5173 + //line php7/php7.y:5281 { var lnumber *scalar.Lnumber // TODO: add option to handle 64 bit integer @@ -7878,18 +7987,18 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.MinusToken) + yyDollar[1].token.Meta.SetTokenName(meta.MinusToken).AppendTo(yyVAL.node.GetMeta()) if isInt { - addMeta(lnumber, yyDollar[2].token.Meta, meta.NumStringToken) + yyDollar[2].token.Meta.SetTokenName(meta.NumStringToken).AppendTo(lnumber.GetMeta()) } else { - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.NumStringToken) + yyDollar[2].token.Meta.SetTokenName(meta.NumStringToken).AppendTo(yyVAL.node.GetMeta()) } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 479: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5204 + //line php7/php7.y:5312 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(identifier) @@ -7899,13 +8008,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.VariableToken) + yyDollar[1].token.Meta.SetTokenName(meta.VariableToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 480: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:5221 + //line php7/php7.y:5329 { yyVAL.node = expr.NewIsset(yyDollar[3].list) @@ -7913,18 +8022,19 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[5].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.IssetToken) - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenParenthesisToken) + yyDollar[1].token.Meta.SetTokenName(meta.IssetToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) if yyDollar[4].token != nil { - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CommaToken) + yyDollar[4].token.Meta.SetTokenName(meta.CommaToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.CommaToken) } - addMeta(yyVAL.node, yyDollar[5].token.Meta, meta.CloseParenthesisToken) + yyDollar[5].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 481: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:5238 + //line php7/php7.y:5347 { yyVAL.node = expr.NewEmpty(yyDollar[3].node) @@ -7932,15 +8042,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.EmptyToken) - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenParenthesisToken) - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseParenthesisToken) + yyDollar[1].token.Meta.SetTokenName(meta.EmptyToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 482: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5252 + //line php7/php7.y:5361 { yyVAL.node = expr.NewInclude(yyDollar[2].node) @@ -7948,13 +8058,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.IncludeToken) + yyDollar[1].token.Meta.SetTokenName(meta.IncludeToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 483: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5264 + //line php7/php7.y:5373 { yyVAL.node = expr.NewIncludeOnce(yyDollar[2].node) @@ -7962,13 +8072,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.IncludeOnceToken) + yyDollar[1].token.Meta.SetTokenName(meta.IncludeOnceToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 484: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:5276 + //line php7/php7.y:5385 { yyVAL.node = expr.NewEval(yyDollar[3].node) @@ -7976,15 +8086,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.EvalToken) - addMeta(yyVAL.node, yyDollar[2].token.Meta, meta.OpenParenthesisToken) - addMeta(yyVAL.node, yyDollar[4].token.Meta, meta.CloseParenthesisToken) + yyDollar[1].token.Meta.SetTokenName(meta.EvalToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 485: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5290 + //line php7/php7.y:5399 { yyVAL.node = expr.NewRequire(yyDollar[2].node) @@ -7992,13 +8102,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.RequireToken) + yyDollar[1].token.Meta.SetTokenName(meta.RequireToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 486: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5302 + //line php7/php7.y:5411 { yyVAL.node = expr.NewRequireOnce(yyDollar[2].node) @@ -8006,13 +8116,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - addMeta(yyVAL.node, yyDollar[1].token.Meta, meta.RequireOnceToken) + yyDollar[1].token.Meta.SetTokenName(meta.RequireOnceToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 487: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5317 + //line php7/php7.y:5426 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -8020,18 +8130,18 @@ yydefault: } case 488: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5323 + //line php7/php7.y:5432 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - addMeta(lastNode(yyDollar[1].list), yyDollar[2].token.Meta, meta.NodeEnd) + yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 489: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5335 + //line php7/php7.y:5444 { yyVAL.node = yyDollar[1].node diff --git a/php7/php7.y b/php7/php7.y index e96ae93..1be9c53 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -306,7 +306,7 @@ start: yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) if yylex.(*Parser).currentToken.Value == "\xff" { - addMeta(yylex.(*Parser).rootNode, yylex.(*Parser).currentToken.Meta, meta.NodeEnd) + yylex.(*Parser).currentToken.Meta.SetTokenName(meta.NodeEnd).AppendTo(yylex.(*Parser).rootNode.GetMeta()) } } ; @@ -367,7 +367,7 @@ namespace_name: namePart.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta(namePart, $1.Meta, meta.StringToken) + $1.Meta.SetTokenName(meta.StringToken).AppendTo(namePart.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -380,8 +380,8 @@ namespace_name: namePart.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) // save comments - addMeta(lastNode($1), $2.Meta, meta.NsSeparatorToken) - addMeta(namePart, $3.Meta, meta.StringToken) + $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) + $3.Meta.SetTokenName(meta.StringToken).AppendTo(namePart.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -405,8 +405,8 @@ name: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3)) // save comments - addMeta($$, $1.Meta, meta.NamespaceToken) - addMeta($$, $2.Meta, meta.NsSeparatorToken) + $1.Meta.SetTokenName(meta.NamespaceToken).AppendTo($$.GetMeta()) + $2.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -418,7 +418,7 @@ name: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) // save comments - addMeta($$, $1.Meta, meta.NsSeparatorToken) + $1.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -470,10 +470,11 @@ top_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - addMeta($$, $1.Meta, meta.HaltCompilerToken) - addMeta($$, $2.Meta, meta.OpenParenthesisToken) - addMeta($$, $3.Meta, meta.CloseParenthesisToken) - addMeta($$, $4.Meta, meta.SemiColonToken) + $1.Meta.SetTokenName(meta.HaltCompilerToken).AppendTo($$.GetMeta()) + $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) + $4.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $4, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -489,8 +490,9 @@ top_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - addMeta($$, $1.Meta, meta.NamespaceToken) - addMeta($$, $3.Meta, meta.SemiColonToken) + $1.Meta.SetTokenName(meta.NamespaceToken).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -504,9 +506,9 @@ top_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5)) // save comments - addMeta($$, $1.Meta, meta.NamespaceToken) - addMeta($$, $3.Meta, meta.OpenCurlyBracesToken) - addMeta($$, $5.Meta, meta.CloseCurlyBracesToken) + $1.Meta.SetTokenName(meta.NamespaceToken).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) + $5.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -518,9 +520,9 @@ top_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - addMeta($$, $1.Meta, meta.NamespaceToken) - addMeta($$, $2.Meta, meta.OpenCurlyBracesToken) - addMeta($$, $4.Meta, meta.CloseCurlyBracesToken) + $1.Meta.SetTokenName(meta.NamespaceToken).AppendTo($$.GetMeta()) + $2.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) + $4.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -532,8 +534,9 @@ top_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - addMeta($$, $1.Meta, meta.UseToken) - addMeta($$, $3.Meta, meta.SemiColonToken) + $1.Meta.SetTokenName(meta.UseToken).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -545,8 +548,9 @@ top_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - addMeta($$, $1.Meta, meta.UseToken) - addMeta($$, $4.Meta, meta.SemiColonToken) + $1.Meta.SetTokenName(meta.UseToken).AppendTo($$.GetMeta()) + $4.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $4, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -558,8 +562,9 @@ top_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - addMeta($$, $1.Meta, meta.UseToken) - addMeta($$, $3.Meta, meta.SemiColonToken) + $1.Meta.SetTokenName(meta.UseToken).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -571,8 +576,9 @@ top_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - addMeta($$, $1.Meta, meta.UseToken) - addMeta($$, $4.Meta, meta.SemiColonToken) + $1.Meta.SetTokenName(meta.UseToken).AppendTo($$.GetMeta()) + $4.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $4, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -584,8 +590,9 @@ top_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - addMeta($$, $1.Meta, meta.ConstToken) - addMeta($$, $3.Meta, meta.SemiColonToken) + $1.Meta.SetTokenName(meta.ConstToken).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -600,7 +607,7 @@ use_type: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.IdentifierToken) + $1.Meta.SetTokenName(meta.IdentifierToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -612,7 +619,7 @@ use_type: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.IdentifierToken) + $1.Meta.SetTokenName(meta.IdentifierToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -629,12 +636,13 @@ group_use_declaration: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $6)) // save comments - addMeta($$, $2.Meta, meta.NsSeparatorToken) - addMeta($$, $3.Meta, meta.OpenCurlyBracesToken) + $2.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) if $5 != nil { - addMeta($$, $5.Meta, meta.CommaToken) + $5.Meta.SetTokenName(meta.CommaToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $5, meta.CommaToken) } - addMeta($$, $6.Meta, meta.CloseCurlyBracesToken) + $6.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -648,13 +656,15 @@ group_use_declaration: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $7)) // save comments - addMeta($$, $1.Meta, meta.NsSeparatorToken) - addMeta($$, $3.Meta, meta.NsSeparatorToken) - addMeta($$, $4.Meta, meta.OpenCurlyBracesToken) + $1.Meta.SetTokenName(meta.UseLeadingNsSeparatorToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $1, meta.UseLeadingNsSeparatorToken) + $3.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo($$.GetMeta()) + $4.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) if $6 != nil { - addMeta($$, $6.Meta, meta.CommaToken) + $6.Meta.SetTokenName(meta.CommaToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $6, meta.CommaToken) } - addMeta($$, $7.Meta, meta.CloseCurlyBracesToken) + $7.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -671,12 +681,13 @@ mixed_group_use_declaration: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $6)) // save comments - addMeta($$, $2.Meta, meta.NsSeparatorToken) - addMeta($$, $3.Meta, meta.OpenCurlyBracesToken) + $2.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) if $5 != nil { - addMeta($$, $5.Meta, meta.CommaToken) + $5.Meta.SetTokenName(meta.CommaToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $5, meta.CommaToken) } - addMeta($$, $6.Meta, meta.CloseCurlyBracesToken) + $6.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -690,13 +701,15 @@ mixed_group_use_declaration: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $7)) // save comments - addMeta($$, $1.Meta, meta.NsSeparatorToken) - addMeta($$, $3.Meta, meta.NsSeparatorToken) - addMeta($$, $4.Meta, meta.OpenCurlyBracesToken) + $1.Meta.SetTokenName(meta.UseLeadingNsSeparatorToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $1, meta.UseLeadingNsSeparatorToken) + $3.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo($$.GetMeta()) + $4.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) if $6 != nil { - addMeta($$, $6.Meta, meta.CommaToken) + $6.Meta.SetTokenName(meta.CommaToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $6, meta.CommaToken) } - addMeta($$, $7.Meta, meta.CloseCurlyBracesToken) + $7.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -719,7 +732,7 @@ inline_use_declarations: $$ = append($1, $3) // save comments - addMeta(lastNode($1), $2.Meta, meta.NodeEnd) + $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -737,7 +750,7 @@ unprefixed_use_declarations: $$ = append($1, $3) // save comments - addMeta(lastNode($1), $2.Meta, meta.NodeEnd) + $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -755,7 +768,7 @@ use_declarations: $$ = append($1, $3) // save comments - addMeta(lastNode($1), $2.Meta, meta.NodeEnd) + $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -806,8 +819,8 @@ unprefixed_use_declaration: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.AsToken) - addMeta(alias, $3.Meta, meta.IdentifierToken) + $2.Meta.SetTokenName(meta.AsToken).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.IdentifierToken).AppendTo(alias.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -825,7 +838,8 @@ use_declaration: $$ = $2; // save comments - addMeta($$, $1.Meta, meta.NsSeparatorToken) + $1.Meta.SetTokenName(meta.UseLeadingNsSeparatorToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $1, meta.UseLeadingNsSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -837,7 +851,7 @@ const_list: $$ = append($1, $3) // save comments - addMeta(lastNode($1), $2.Meta, meta.NodeEnd) + $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -912,10 +926,11 @@ inner_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - addMeta($$, $1.Meta, meta.HaltCompilerToken) - addMeta($$, $2.Meta, meta.OpenParenthesisToken) - addMeta($$, $3.Meta, meta.CloseParenthesisToken) - addMeta($$, $4.Meta, meta.SemiColonToken) + $1.Meta.SetTokenName(meta.HaltCompilerToken).AppendTo($$.GetMeta()) + $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) + $4.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $4, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -929,8 +944,8 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - addMeta($$, $1.Meta, meta.OpenCurlyBracesToken) - addMeta($$, $3.Meta, meta.CloseCurlyBracesToken) + $1.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -961,9 +976,9 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5)) // save comments - addMeta($$, $1.Meta, meta.WhileToken) - addMeta($$, $2.Meta, meta.OpenParenthesisToken) - addMeta($$, $4.Meta, meta.CloseParenthesisToken) + $1.Meta.SetTokenName(meta.WhileToken).AppendTo($$.GetMeta()) + $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) + $4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -975,11 +990,12 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $7)) // save comments - addMeta($$, $1.Meta, meta.DoToken) - addMeta($$, $3.Meta, meta.WhileToken) - addMeta($$, $4.Meta, meta.OpenParenthesisToken) - addMeta($$, $6.Meta, meta.CloseParenthesisToken) - addMeta($$, $7.Meta, meta.SemiColonToken) + $1.Meta.SetTokenName(meta.DoToken).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.WhileToken).AppendTo($$.GetMeta()) + $4.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) + $6.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) + $7.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $7, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1002,11 +1018,11 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $9)) // save comments - addMeta($$, $1.Meta, meta.ForToken) - addMeta($$, $2.Meta, meta.OpenParenthesisToken) - addMeta($$, $4.Meta, meta.ForInitSemicolonToken) - addMeta($$, $6.Meta, meta.ForCondSemicolonToken) - addMeta($$, $8.Meta, meta.CloseParenthesisToken) + $1.Meta.SetTokenName(meta.ForToken).AppendTo($$.GetMeta()) + $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) + $4.Meta.SetTokenName(meta.ForInitSemicolonToken).AppendTo($$.GetMeta()) + $6.Meta.SetTokenName(meta.ForCondSemicolonToken).AppendTo($$.GetMeta()) + $8.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1027,9 +1043,9 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5)) // save comments - addMeta($$, $1.Meta, meta.SwitchToken) - addMeta($$, $2.Meta, meta.OpenParenthesisToken) - addMeta($$, $4.Meta, meta.CloseParenthesisToken) + $1.Meta.SetTokenName(meta.SwitchToken).AppendTo($$.GetMeta()) + $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) + $4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1041,8 +1057,9 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - addMeta($$, $1.Meta, meta.BreakToken) - addMeta($$, $3.Meta, meta.SemiColonToken) + $1.Meta.SetTokenName(meta.BreakToken).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1054,8 +1071,9 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - addMeta($$, $1.Meta, meta.ContinueToken) - addMeta($$, $3.Meta, meta.SemiColonToken) + $1.Meta.SetTokenName(meta.ContinueToken).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1067,8 +1085,9 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - addMeta($$, $1.Meta, meta.ReturnToken) - addMeta($$, $3.Meta, meta.SemiColonToken) + $1.Meta.SetTokenName(meta.ReturnToken).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1080,8 +1099,9 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - addMeta($$, $1.Meta, meta.GlobalToken) - addMeta($$, $3.Meta, meta.SemiColonToken) + $1.Meta.SetTokenName(meta.GlobalToken).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1093,8 +1113,9 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - addMeta($$, $1.Meta, meta.StaticToken) - addMeta($$, $3.Meta, meta.SemiColonToken) + $1.Meta.SetTokenName(meta.StaticToken).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1106,8 +1127,10 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - addMeta($$, $1.Meta, meta.EchoToken) - addMeta($$, $3.Meta, meta.SemiColonToken) + $1.Meta.SetTokenName(meta.EchoToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $1, meta.EchoToken) + $3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1119,7 +1142,7 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.InlineHTMLToken) + $1.Meta.SetTokenName(meta.InlineHTMLToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1131,7 +1154,8 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) // save comments - addMeta($$, $2.Meta, meta.SemiColonToken) + $2.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $2, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1143,13 +1167,15 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $6)) // save comments - addMeta($$, $1.Meta, meta.UnsetToken) - addMeta($$, $2.Meta, meta.OpenParenthesisToken) + $1.Meta.SetTokenName(meta.UnsetToken).AppendTo($$.GetMeta()) + $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) if $4 != nil { - addMeta($$, $4.Meta, meta.CommaToken) + $4.Meta.SetTokenName(meta.CommaToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $4, meta.CommaToken) } - addMeta($$, $5.Meta, meta.CloseParenthesisToken) - addMeta($$, $6.Meta, meta.SemiColonToken) + $5.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) + $6.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $6, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1170,10 +1196,10 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $7)) // save comments - addMeta($$, $1.Meta, meta.ForeachToken) - addMeta($$, $2.Meta, meta.OpenParenthesisToken) - addMeta($$, $4.Meta, meta.AsToken) - addMeta($$, $6.Meta, meta.CloseParenthesisToken) + $1.Meta.SetTokenName(meta.ForeachToken).AppendTo($$.GetMeta()) + $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) + $4.Meta.SetTokenName(meta.AsToken).AppendTo($$.GetMeta()) + $6.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1196,25 +1222,26 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $9)) // save comments - addMeta($$, $1.Meta, meta.ForeachToken) - addMeta($$, $2.Meta, meta.OpenParenthesisToken) - addMeta($$, $4.Meta, meta.AsToken) - addMeta($$, $6.Meta, meta.DoubleArrowToken) - addMeta($$, $8.Meta, meta.CloseParenthesisToken) + $1.Meta.SetTokenName(meta.ForeachToken).AppendTo($$.GetMeta()) + $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) + $4.Meta.SetTokenName(meta.AsToken).AppendTo($$.GetMeta()) + $6.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo($$.GetMeta()) + $8.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_DECLARE '(' const_list ')' declare_statement { - $$ = stmt.NewDeclare($3, $5) + $$ = $5 + $$.(*stmt.Declare).Consts = $3 // save position $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5)) // save comments - addMeta($$, $1.Meta, meta.DeclareToken) - addMeta($$, $2.Meta, meta.OpenParenthesisToken) - addMeta($$, $4.Meta, meta.CloseParenthesisToken) + $1.Meta.SetTokenName(meta.DeclareToken).AppendTo($$.GetMeta()) + $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) + $4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1226,7 +1253,8 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.SemiColonToken) + $1.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $1, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1241,9 +1269,9 @@ statement: } // save comments - addMeta($$, $1.Meta, meta.TryToken) - addMeta($$, $2.Meta, meta.OpenCurlyBracesToken) - addMeta($$, $4.Meta, meta.CloseCurlyBracesToken) + $1.Meta.SetTokenName(meta.TryToken).AppendTo($$.GetMeta()) + $2.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) + $4.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1255,8 +1283,9 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - addMeta($$, $1.Meta, meta.ThrowToken) - addMeta($$, $3.Meta, meta.SemiColonToken) + $1.Meta.SetTokenName(meta.ThrowToken).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1270,9 +1299,10 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - addMeta($$, $1.Meta, meta.GotoToken) - addMeta(label, $2.Meta, meta.IdentifierToken) - addMeta($$, $3.Meta, meta.SemiColonToken) + $1.Meta.SetTokenName(meta.GotoToken).AppendTo($$.GetMeta()) + $2.Meta.SetTokenName(meta.IdentifierToken).AppendTo(label.GetMeta()) + $3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1286,8 +1316,8 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - addMeta(label, $1.Meta, meta.IdentifierToken) - addMeta($$, $2.Meta, meta.ColonToken) + $1.Meta.SetTokenName(meta.IdentifierToken).AppendTo(label.GetMeta()) + $2.Meta.SetTokenName(meta.ColonToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1312,12 +1342,12 @@ catch_list: catch.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($2, $9)) // save comments - addMeta(catch, $2.Meta, meta.CatchToken) - addMeta(catch, $3.Meta, meta.OpenParenthesisToken) - addMeta(variable, $5.Meta, meta.VariableToken) - addMeta(catch, $6.Meta, meta.CloseParenthesisToken) - addMeta(catch, $7.Meta, meta.OpenCurlyBracesToken) - addMeta(catch, $9.Meta, meta.CloseCurlyBracesToken) + $2.Meta.SetTokenName(meta.CatchToken).AppendTo(catch.GetMeta()) + $3.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(catch.GetMeta()) + $5.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) + $6.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(catch.GetMeta()) + $7.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(catch.GetMeta()) + $9.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(catch.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1334,7 +1364,7 @@ catch_name_list: $$ = append($1, $3) // save comments - addMeta(lastNode($1), $2.Meta, meta.NodeEnd) + $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1355,9 +1385,9 @@ finally_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - addMeta($$, $1.Meta, meta.FinallyToken) - addMeta($$, $2.Meta, meta.OpenCurlyBracesToken) - addMeta($$, $4.Meta, meta.CloseCurlyBracesToken) + $1.Meta.SetTokenName(meta.FinallyToken).AppendTo($$.GetMeta()) + $2.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) + $4.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1375,7 +1405,7 @@ unset_variables: $$ = append($1, $3) // save comments - addMeta(lastNode($1), $2.Meta, meta.NodeEnd) + $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1402,15 +1432,15 @@ function_declaration_statement: // save comments - addMeta($$, $1.Meta, meta.FunctionToken) + $1.Meta.SetTokenName(meta.FunctionToken).AppendTo($$.GetMeta()) if $2 != nil { - addMeta($$, $2.Meta, meta.AmpersandToken) + $2.Meta.SetTokenName(meta.AmpersandToken).AppendTo($$.GetMeta()) } - addMeta(name, $3.Meta, meta.IdentifierToken) - addMeta($$, $5.Meta, meta.OpenParenthesisToken) - addMeta($$, $7.Meta, meta.CloseParenthesisToken) - addMeta($$, $9.Meta, meta.OpenCurlyBracesToken) - addMeta($$, $11.Meta, meta.CloseCurlyBracesToken) + $3.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + $5.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) + $7.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) + $9.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) + $11.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1449,10 +1479,10 @@ class_declaration_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewOptionalListTokensPosition($1, $2, $9)) // save comments - addMeta($$, $2.Meta, meta.ClassToken) - addMeta(name, $3.Meta, meta.IdentifierToken) - addMeta($$, $7.Meta, meta.OpenCurlyBracesToken) - addMeta($$, $9.Meta, meta.CloseCurlyBracesToken) + $2.Meta.SetTokenName(meta.ClassToken).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + $7.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) + $9.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1466,10 +1496,10 @@ class_declaration_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $8)) // save comments - addMeta($$, $1.Meta, meta.ClassToken) - addMeta(name, $2.Meta, meta.IdentifierToken) - addMeta($$, $6.Meta, meta.OpenCurlyBracesToken) - addMeta($$, $8.Meta, meta.CloseCurlyBracesToken) + $1.Meta.SetTokenName(meta.ClassToken).AppendTo($$.GetMeta()) + $2.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + $6.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) + $8.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1499,7 +1529,7 @@ class_modifier: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.IdentifierToken) + $1.Meta.SetTokenName(meta.IdentifierToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1511,7 +1541,7 @@ class_modifier: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.IdentifierToken) + $1.Meta.SetTokenName(meta.IdentifierToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1528,10 +1558,10 @@ trait_declaration_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $6)) // save comments - addMeta($$, $1.Meta, meta.TraitToken) - addMeta(name, $2.Meta, meta.IdentifierToken) - addMeta($$, $4.Meta, meta.OpenCurlyBracesToken) - addMeta($$, $6.Meta, meta.CloseCurlyBracesToken) + $1.Meta.SetTokenName(meta.TraitToken).AppendTo($$.GetMeta()) + $2.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + $4.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) + $6.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1548,10 +1578,10 @@ interface_declaration_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $7)) // save comments - addMeta($$, $1.Meta, meta.InterfaceToken) - addMeta(name, $2.Meta, meta.IdentifierToken) - addMeta($$, $5.Meta, meta.OpenCurlyBracesToken) - addMeta($$, $7.Meta, meta.CloseCurlyBracesToken) + $1.Meta.SetTokenName(meta.InterfaceToken).AppendTo($$.GetMeta()) + $2.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + $5.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) + $7.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1572,7 +1602,7 @@ extends_from: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - addMeta($$, $1.Meta, meta.ExtendsToken) + $1.Meta.SetTokenName(meta.ExtendsToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1593,7 +1623,7 @@ interface_extends_list: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) // save comments - addMeta($$, $1.Meta, meta.ExtendsToken) + $1.Meta.SetTokenName(meta.ExtendsToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1614,7 +1644,7 @@ implements_list: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) // save comments - addMeta($$, $1.Meta, meta.ImplementsToken) + $1.Meta.SetTokenName(meta.ImplementsToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1635,7 +1665,7 @@ foreach_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - addMeta($$, $1.Meta, meta.AmpersandToken) + $1.Meta.SetTokenName(meta.AmpersandToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1647,9 +1677,9 @@ foreach_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - addMeta($$, $1.Meta, meta.ListToken) - addMeta($$, $2.Meta, meta.OpenParenthesisToken) - addMeta($$, $4.Meta, meta.CloseParenthesisToken) + $1.Meta.SetTokenName(meta.ListToken).AppendTo($$.GetMeta()) + $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) + $4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1661,8 +1691,8 @@ foreach_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - addMeta($$, $1.Meta, meta.OpenSquareBracket) - addMeta($$, $3.Meta, meta.CloseSquareBracket) + $1.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1688,9 +1718,10 @@ for_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - addMeta($$, $1.Meta, meta.ColonToken) - addMeta($$, $3.Meta, meta.EndforToken) - addMeta($$, $4.Meta, meta.SemiColonToken) + $1.Meta.SetTokenName(meta.ColonToken).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.EndforToken).AppendTo($$.GetMeta()) + $4.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $4, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1716,9 +1747,10 @@ foreach_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - addMeta($$, $1.Meta, meta.ColonToken) - addMeta($$, $3.Meta, meta.EndforeachToken) - addMeta($$, $4.Meta, meta.SemiColonToken) + $1.Meta.SetTokenName(meta.ColonToken).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.EndforeachToken).AppendTo($$.GetMeta()) + $4.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $4, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1727,21 +1759,27 @@ foreach_statement: declare_statement: statement { - $$ = $1 + $$ = stmt.NewDeclare(nil, $1, false) + + // save position + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | ':' inner_statement_list T_ENDDECLARE ';' { - $$ = stmt.NewStmtList($2) + stmtList := stmt.NewStmtList($2) + $$ = stmt.NewDeclare(nil, stmtList, true) // save position + stmtList.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - addMeta($$, $1.Meta, meta.ColonToken) - addMeta($$, $3.Meta, meta.EnddeclareToken) - addMeta($$, $4.Meta, meta.SemiColonToken) + $1.Meta.SetTokenName(meta.ColonToken).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.EnddeclareToken).AppendTo($$.GetMeta()) + $4.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $4, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1758,8 +1796,8 @@ switch_case_list: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - addMeta(caseList, $1.Meta, meta.OpenCurlyBracesToken) - addMeta(caseList, $3.Meta, meta.CloseCurlyBracesToken) + $1.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(caseList.GetMeta()) + $3.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(caseList.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1773,9 +1811,10 @@ switch_case_list: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - addMeta(caseList, $1.Meta, meta.OpenCurlyBracesToken) - addMeta(caseList, $2.Meta, meta.SemiColonToken) - addMeta(caseList, $4.Meta, meta.CloseCurlyBracesToken) + $1.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(caseList.GetMeta()) + $2.Meta.SetTokenName(meta.CaseSeparatorToken).AppendTo(caseList.GetMeta()) + yylex.(*Parser).appendMetaToken(caseList, $2, meta.CaseSeparatorToken) + $4.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(caseList.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1789,9 +1828,10 @@ switch_case_list: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - addMeta($$, $1.Meta, meta.ColonToken) - addMeta($$, $3.Meta, meta.EndswitchToken) - addMeta($$, $4.Meta, meta.SemiColonToken) + $1.Meta.SetTokenName(meta.ColonToken).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.EndswitchToken).AppendTo($$.GetMeta()) + $4.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $4, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1806,10 +1846,12 @@ switch_case_list: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5)) // save comments - addMeta($$, $1.Meta, meta.ColonToken) - addMeta($$, $2.Meta, meta.SwitchSemicolonToken) - addMeta($$, $4.Meta, meta.EndswitchToken) - addMeta($$, $5.Meta, meta.SemiColonToken) + $1.Meta.SetTokenName(meta.ColonToken).AppendTo($$.GetMeta()) + $2.Meta.SetTokenName(meta.CaseSeparatorToken).AppendTo(caseList.GetMeta()) + yylex.(*Parser).appendMetaToken(caseList, $2, meta.CaseSeparatorToken) + $4.Meta.SetTokenName(meta.EndswitchToken).AppendTo($$.GetMeta()) + $5.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $5, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1831,8 +1873,9 @@ case_list: _case.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $5)) // save comments - addMeta(_case, $2.Meta, meta.CaseToken) - addMeta(_case, $4.Meta, meta.CaseSeparatorToken) + $2.Meta.SetTokenName(meta.CaseToken).AppendTo(_case.GetMeta()) + $4.Meta.SetTokenName(meta.CaseSeparatorToken).AppendTo(_case.GetMeta()) + yylex.(*Parser).appendMetaToken(_case, $4, meta.CaseSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1845,8 +1888,9 @@ case_list: _default.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $4)) // save comments - addMeta(_default, $2.Meta, meta.DefaultToken) - addMeta(_default, $3.Meta, meta.CaseSeparatorToken) + $2.Meta.SetTokenName(meta.DefaultToken).AppendTo(_default.GetMeta()) + $3.Meta.SetTokenName(meta.CaseSeparatorToken).AppendTo(_default.GetMeta()) + yylex.(*Parser).appendMetaToken(_default, $3, meta.CaseSeparatorToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1883,9 +1927,10 @@ while_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - addMeta($$, $1.Meta, meta.ColonToken) - addMeta($$, $3.Meta, meta.EndwhileToken) - addMeta($$, $4.Meta, meta.SemiColonToken) + $1.Meta.SetTokenName(meta.ColonToken).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.EndwhileToken).AppendTo($$.GetMeta()) + $4.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $4, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1900,9 +1945,9 @@ if_stmt_without_else: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5)) // save comments - addMeta($$, $1.Meta, meta.IfToken) - addMeta($$, $2.Meta, meta.OpenParenthesisToken) - addMeta($$, $4.Meta, meta.CloseParenthesisToken) + $1.Meta.SetTokenName(meta.IfToken).AppendTo($$.GetMeta()) + $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) + $4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1916,9 +1961,9 @@ if_stmt_without_else: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $6)) // save comments - addMeta(_elseIf, $2.Meta, meta.ElseifToken) - addMeta(_elseIf, $3.Meta, meta.OpenParenthesisToken) - addMeta(_elseIf, $5.Meta, meta.CloseParenthesisToken) + $2.Meta.SetTokenName(meta.ElseifToken).AppendTo(_elseIf.GetMeta()) + $3.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(_elseIf.GetMeta()) + $5.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(_elseIf.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1941,7 +1986,7 @@ if_stmt: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta(_else, $2.Meta, meta.ElseToken) + $2.Meta.SetTokenName(meta.ElseToken).AppendTo(_else.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1958,10 +2003,10 @@ alt_if_stmt_without_else: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $6)) // save comments - addMeta($$, $1.Meta, meta.IfToken) - addMeta($$, $2.Meta, meta.OpenParenthesisToken) - addMeta($$, $4.Meta, meta.CloseParenthesisToken) - addMeta($$, $5.Meta, meta.ColonToken) + $1.Meta.SetTokenName(meta.IfToken).AppendTo($$.GetMeta()) + $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) + $4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) + $5.Meta.SetTokenName(meta.ColonToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1976,10 +2021,10 @@ alt_if_stmt_without_else: _elseIf.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $7)) // save comments - addMeta(_elseIf, $2.Meta, meta.ElseifToken) - addMeta(_elseIf, $3.Meta, meta.OpenParenthesisToken) - addMeta(_elseIf, $5.Meta, meta.CloseParenthesisToken) - addMeta(_elseIf, $6.Meta, meta.ColonToken) + $2.Meta.SetTokenName(meta.ElseifToken).AppendTo(_elseIf.GetMeta()) + $3.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(_elseIf.GetMeta()) + $5.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(_elseIf.GetMeta()) + $6.Meta.SetTokenName(meta.ColonToken).AppendTo(_elseIf.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1994,8 +2039,9 @@ alt_if_stmt: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.EndifToken) - addMeta($$, $3.Meta, meta.SemiColonToken) + $2.Meta.SetTokenName(meta.EndifToken).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2011,10 +2057,11 @@ alt_if_stmt: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $6)) // save comments - addMeta(_else, $2.Meta, meta.ElseToken) - addMeta(_else, $3.Meta, meta.ColonToken) - addMeta($$, $5.Meta, meta.EndifToken) - addMeta($$, $6.Meta, meta.SemiColonToken) + $2.Meta.SetTokenName(meta.ElseToken).AppendTo(_else.GetMeta()) + $3.Meta.SetTokenName(meta.ColonToken).AppendTo(_else.GetMeta()) + $5.Meta.SetTokenName(meta.EndifToken).AppendTo($$.GetMeta()) + $6.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $6, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2047,7 +2094,7 @@ non_empty_parameter_list: $$ = append($1, $3) // save comments - addMeta(lastNode($1), $2.Meta, meta.NodeEnd) + $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2075,12 +2122,12 @@ parameter: // save comments if $2 != nil { - addMeta($$, $2.Meta, meta.AmpersandToken) + $2.Meta.SetTokenName(meta.AmpersandToken).AppendTo($$.GetMeta()) } if $3 != nil { - addMeta($$, $3.Meta, meta.EllipsisToken) + $3.Meta.SetTokenName(meta.EllipsisToken).AppendTo($$.GetMeta()) } - addMeta(variable, $4.Meta, meta.VariableToken) + $4.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2105,13 +2152,13 @@ parameter: // save comments if $2 != nil { - addMeta($$, $2.Meta, meta.AmpersandToken) + $2.Meta.SetTokenName(meta.AmpersandToken).AppendTo($$.GetMeta()) } if $3 != nil { - addMeta($$, $3.Meta, meta.EllipsisToken) + $3.Meta.SetTokenName(meta.EllipsisToken).AppendTo($$.GetMeta()) } - addMeta(variable, $4.Meta, meta.VariableToken) - addMeta($$, $5.Meta, meta.EqualToken) + $4.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) + $5.Meta.SetTokenName(meta.EqualToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2147,7 +2194,7 @@ type_expr: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - addMeta($$, $1.Meta, meta.QuestionMarkToken) + $1.Meta.SetTokenName(meta.QuestionMarkToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2162,7 +2209,7 @@ type: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.IdentifierToken) + $1.Meta.SetTokenName(meta.IdentifierToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2174,7 +2221,7 @@ type: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.IdentifierToken) + $1.Meta.SetTokenName(meta.IdentifierToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2198,7 +2245,7 @@ return_type: $$ = $2; // save comments - addMeta($$, $1.Meta, meta.ColonToken) + $1.Meta.SetTokenName(meta.ColonToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2213,8 +2260,8 @@ argument_list: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - addMeta($$, $1.Meta, meta.OpenParenthesisToken) - addMeta($$, $2.Meta, meta.CloseParenthesisToken) + $1.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) + $2.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2226,11 +2273,12 @@ argument_list: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - addMeta($$, $1.Meta, meta.OpenParenthesisToken) + $1.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) if $3 != nil { - addMeta($$, $3.Meta, meta.CommaToken) + $3.Meta.SetTokenName(meta.CommaToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $3, meta.CommaToken) } - addMeta($$, $4.Meta, meta.CloseParenthesisToken) + $4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2248,7 +2296,7 @@ non_empty_argument_list: $$ = append($1, $3) // save comments - addMeta(lastNode($1), $2.Meta, meta.NodeEnd) + $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2272,7 +2320,7 @@ argument: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - addMeta($$, $1.Meta, meta.EllipsisToken) + $1.Meta.SetTokenName(meta.EllipsisToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2284,7 +2332,7 @@ global_var_list: $$ = append($1, $3) // save comments - addMeta(lastNode($1), $2.Meta, meta.NodeEnd) + $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2311,7 +2359,7 @@ static_var_list: $$ = append($1, $3) // save comments - addMeta(lastNode($1), $2.Meta, meta.NodeEnd) + $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2336,7 +2384,7 @@ static_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta(variable, $1.Meta, meta.VariableToken) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2352,8 +2400,8 @@ static_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) // save comments - addMeta(variable, $1.Meta, meta.VariableToken) - addMeta($$, $2.Meta, meta.EqualToken) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + $2.Meta.SetTokenName(meta.EqualToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2383,7 +2431,8 @@ class_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $3)) // save comments - addMeta($$, $3.Meta, meta.SemiColonToken) + $3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2395,8 +2444,9 @@ class_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewOptionalListTokensPosition($1, $2, $4)) // save comments - addMeta($$, $2.Meta, meta.ConstToken) - addMeta($$, $4.Meta, meta.SemiColonToken) + $2.Meta.SetTokenName(meta.ConstToken).AppendTo($$.GetMeta()) + $4.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $4, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2408,7 +2458,7 @@ class_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) // save comments - addMeta($$, $1.Meta, meta.UseToken) + $1.Meta.SetTokenName(meta.UseToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2426,13 +2476,13 @@ class_statement: } // save comments - addMeta($$, $2.Meta, meta.FunctionToken) + $2.Meta.SetTokenName(meta.FunctionToken).AppendTo($$.GetMeta()) if $3 != nil { - addMeta($$, $3.Meta, meta.AmpersandToken) + $3.Meta.SetTokenName(meta.AmpersandToken).AppendTo($$.GetMeta()) } - addMeta(name, $4.Meta, meta.IdentifierToken) - addMeta($$, $6.Meta, meta.OpenParenthesisToken) - addMeta($$, $8.Meta, meta.CloseParenthesisToken) + $4.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + $6.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) + $8.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2450,7 +2500,7 @@ name_list: $$ = append($1, $3) // save comments - addMeta(lastNode($1), $2.Meta, meta.NodeEnd) + $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2464,7 +2514,8 @@ trait_adaptations: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.SemiColonToken) + $1.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $1, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -2476,8 +2527,8 @@ trait_adaptations: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - addMeta($$, $1.Meta, meta.OpenCurlyBracesToken) - addMeta($$, $2.Meta, meta.CloseCurlyBracesToken) + $1.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) + $2.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2488,8 +2539,8 @@ trait_adaptations: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - addMeta($$, $1.Meta, meta.OpenCurlyBracesToken) - addMeta($$, $3.Meta, meta.CloseCurlyBracesToken) + $1.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2516,7 +2567,8 @@ trait_adaptation: $$ = $1; // save comments - addMeta($$, $2.Meta, meta.SemiColonToken) + $2.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $2, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2525,7 +2577,8 @@ trait_adaptation: $$ = $1; // save comments - addMeta($$, $2.Meta, meta.SemiColonToken) + $2.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $2, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2540,7 +2593,7 @@ trait_precedence: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeNodeListPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.InsteadofToken) + $2.Meta.SetTokenName(meta.InsteadofToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2557,8 +2610,8 @@ trait_alias: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.AsToken) - addMeta(alias, $3.Meta, meta.IdentifierToken) + $2.Meta.SetTokenName(meta.AsToken).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.IdentifierToken).AppendTo(alias.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2572,8 +2625,8 @@ trait_alias: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.AsToken) - addMeta(alias, $3.Meta, meta.IdentifierToken) + $2.Meta.SetTokenName(meta.AsToken).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.IdentifierToken).AppendTo(alias.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2587,8 +2640,8 @@ trait_alias: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments - addMeta($$, $2.Meta, meta.AsToken) - addMeta(alias, $4.Meta, meta.IdentifierToken) + $2.Meta.SetTokenName(meta.AsToken).AppendTo($$.GetMeta()) + $4.Meta.SetTokenName(meta.IdentifierToken).AppendTo(alias.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2600,7 +2653,7 @@ trait_alias: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.AsToken) + $2.Meta.SetTokenName(meta.AsToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2617,7 +2670,7 @@ trait_method_reference: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta(name, $1.Meta, meta.IdentifierToken) + $1.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2640,8 +2693,8 @@ absolute_trait_method_reference: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.PaamayimNekudotayimToken) - addMeta(target, $3.Meta, meta.IdentifierToken) + $2.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.IdentifierToken).AppendTo(target.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2656,7 +2709,8 @@ method_body: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.SemiColonToken) + $1.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $1, meta.SemiColonToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2668,8 +2722,8 @@ method_body: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - addMeta($$, $1.Meta, meta.OpenCurlyBracesToken) - addMeta($$, $3.Meta, meta.CloseCurlyBracesToken) + $1.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2691,7 +2745,7 @@ variable_modifiers: modifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta(modifier, $1.Meta, meta.IdentifierToken) + $1.Meta.SetTokenName(meta.IdentifierToken).AppendTo(modifier.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2736,7 +2790,7 @@ member_modifier: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.IdentifierToken) + $1.Meta.SetTokenName(meta.IdentifierToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2748,7 +2802,7 @@ member_modifier: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.IdentifierToken) + $1.Meta.SetTokenName(meta.IdentifierToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2760,7 +2814,7 @@ member_modifier: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.IdentifierToken) + $1.Meta.SetTokenName(meta.IdentifierToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2772,7 +2826,7 @@ member_modifier: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.IdentifierToken) + $1.Meta.SetTokenName(meta.IdentifierToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2784,7 +2838,7 @@ member_modifier: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.IdentifierToken) + $1.Meta.SetTokenName(meta.IdentifierToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2796,7 +2850,7 @@ member_modifier: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.IdentifierToken) + $1.Meta.SetTokenName(meta.IdentifierToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2808,7 +2862,7 @@ property_list: $$ = append($1, $3) // save comments - addMeta(lastNode($1), $2.Meta, meta.NodeEnd) + $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2833,7 +2887,7 @@ property: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta(variable, $1.Meta, meta.VariableToken) + $1.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2849,8 +2903,8 @@ property: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) // save comments - addMeta(variable, $1.Meta, meta.VariableToken) - addMeta($$, $2.Meta, meta.EqualToken) + $1.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) + $2.Meta.SetTokenName(meta.EqualToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2862,7 +2916,7 @@ class_const_list: $$ = append($1, $3) // save comments - addMeta(lastNode($1), $2.Meta, meta.NodeEnd) + $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2885,8 +2939,8 @@ class_const_decl: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) // save comments - addMeta(name, $1.Meta, meta.IdentifierToken) - addMeta($$, $2.Meta, meta.EqualToken) + $1.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + $2.Meta.SetTokenName(meta.EqualToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2903,8 +2957,8 @@ const_decl: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) // save comments - addMeta(name, $1.Meta, meta.IdentifierToken) - addMeta($$, $2.Meta, meta.EqualToken) + $1.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + $2.Meta.SetTokenName(meta.EqualToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2916,7 +2970,7 @@ echo_expr_list: $$ = append($1, $3) // save comments - addMeta(lastNode($1), $2.Meta, meta.NodeEnd) + $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2958,7 +3012,7 @@ non_empty_for_exprs: $$ = append($1, $3) // save comments - addMeta(lastNode($1), $2.Meta, meta.NodeEnd) + $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2983,9 +3037,9 @@ anonymous_class: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $8)) // save comments - addMeta($$, $1.Meta, meta.ClassToken) - addMeta($$, $6.Meta, meta.OpenCurlyBracesToken) - addMeta($$, $8.Meta, meta.CloseCurlyBracesToken) + $1.Meta.SetTokenName(meta.ClassToken).AppendTo($$.GetMeta()) + $6.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) + $8.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3003,7 +3057,7 @@ new_expr: } // save comments - addMeta($$, $1.Meta, meta.NewToken) + $1.Meta.SetTokenName(meta.NewAnchor).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3015,7 +3069,7 @@ new_expr: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - addMeta($$, $1.Meta, meta.NewToken) + $1.Meta.SetTokenName(meta.NewAnchor).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3032,10 +3086,10 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $6)) // save comments - addMeta(list, $1.Meta, meta.ListToken) - addMeta(list, $2.Meta, meta.OpenParenthesisToken) - addMeta(list, $4.Meta, meta.CloseParenthesisToken) - addMeta($$, $5.Meta, meta.EqualToken) + $1.Meta.SetTokenName(meta.ListToken).AppendTo(list.GetMeta()) + $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(list.GetMeta()) + $4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(list.GetMeta()) + $5.Meta.SetTokenName(meta.EqualToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3049,9 +3103,9 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5)) // save comments - addMeta(shortList, $1.Meta, meta.OpenSquareBracket) - addMeta(shortList, $3.Meta, meta.CloseSquareBracket) - addMeta($$, $4.Meta, meta.EqualToken) + $1.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo(shortList.GetMeta()) + $3.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(shortList.GetMeta()) + $4.Meta.SetTokenName(meta.EqualToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3063,7 +3117,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.EqualToken) + $2.Meta.SetTokenName(meta.EqualToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3075,8 +3129,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) // save comments - addMeta($$, $2.Meta, meta.EqualToken) - addMeta($$, $3.Meta, meta.AmpersandToken) + $2.Meta.SetTokenName(meta.EqualToken).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.AmpersandToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3088,7 +3142,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - addMeta($$, $1.Meta, meta.CloneToken) + $1.Meta.SetTokenName(meta.CloneToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3100,7 +3154,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.PlusEqualToken) + $2.Meta.SetTokenName(meta.PlusEqualToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3112,7 +3166,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.MinusEqualToken) + $2.Meta.SetTokenName(meta.MinusEqualToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3124,7 +3178,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.MulEqualToken) + $2.Meta.SetTokenName(meta.MulEqualToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3136,7 +3190,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.PowEqualToken) + $2.Meta.SetTokenName(meta.PowEqualToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3148,7 +3202,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.DivEqualToken) + $2.Meta.SetTokenName(meta.DivEqualToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3160,7 +3214,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.ConcatEqualToken) + $2.Meta.SetTokenName(meta.ConcatEqualToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3172,7 +3226,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.ModEqualToken) + $2.Meta.SetTokenName(meta.ModEqualToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3184,7 +3238,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.AndEqualToken) + $2.Meta.SetTokenName(meta.AndEqualToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3196,7 +3250,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.OrEqualToken) + $2.Meta.SetTokenName(meta.OrEqualToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3208,7 +3262,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.XorEqualToken) + $2.Meta.SetTokenName(meta.XorEqualToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3220,7 +3274,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.SlEqualToken) + $2.Meta.SetTokenName(meta.SlEqualToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3232,7 +3286,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.SrEqualToken) + $2.Meta.SetTokenName(meta.SrEqualToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3244,7 +3298,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) // save comments - addMeta($$, $2.Meta, meta.IncToken) + $2.Meta.SetTokenName(meta.IncToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3256,7 +3310,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - addMeta($$, $1.Meta, meta.IncToken) + $1.Meta.SetTokenName(meta.IncToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3268,7 +3322,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) // save comments - addMeta($$, $2.Meta, meta.DecToken) + $2.Meta.SetTokenName(meta.DecToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3280,7 +3334,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - addMeta($$, $1.Meta, meta.DecToken) + $1.Meta.SetTokenName(meta.DecToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3292,7 +3346,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.BooleanOrToken) + $2.Meta.SetTokenName(meta.BooleanOrToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3304,7 +3358,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.BooleanAndToken) + $2.Meta.SetTokenName(meta.BooleanAndToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3316,7 +3370,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.LogicalOrToken) + $2.Meta.SetTokenName(meta.LogicalOrToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3328,7 +3382,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.LogicalAndToken) + $2.Meta.SetTokenName(meta.LogicalAndToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3340,7 +3394,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.LogicalXorToken) + $2.Meta.SetTokenName(meta.LogicalXorToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3352,7 +3406,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.VerticalBarToken) + $2.Meta.SetTokenName(meta.VerticalBarToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3364,7 +3418,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.AmpersandToken) + $2.Meta.SetTokenName(meta.AmpersandToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3376,7 +3430,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.CaretToken) + $2.Meta.SetTokenName(meta.CaretToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3388,7 +3442,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.DotToken) + $2.Meta.SetTokenName(meta.DotToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3400,7 +3454,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.PlusToken) + $2.Meta.SetTokenName(meta.PlusToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3412,7 +3466,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.MinusToken) + $2.Meta.SetTokenName(meta.MinusToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3424,7 +3478,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.AsteriskToken) + $2.Meta.SetTokenName(meta.AsteriskToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3436,7 +3490,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.PowToken) + $2.Meta.SetTokenName(meta.PowToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3448,7 +3502,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.SlashToken) + $2.Meta.SetTokenName(meta.SlashToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3460,7 +3514,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.PercentToken) + $2.Meta.SetTokenName(meta.PercentToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3472,7 +3526,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.SlToken) + $2.Meta.SetTokenName(meta.SlToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3484,7 +3538,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.SrToken) + $2.Meta.SetTokenName(meta.SrToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3496,7 +3550,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - addMeta($$, $1.Meta, meta.PlusToken) + $1.Meta.SetTokenName(meta.PlusToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3508,7 +3562,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - addMeta($$, $1.Meta, meta.MinusToken) + $1.Meta.SetTokenName(meta.MinusToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3520,7 +3574,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - addMeta($$, $1.Meta, meta.ExclamationMarkToken) + $1.Meta.SetTokenName(meta.ExclamationMarkToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3532,7 +3586,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - addMeta($$, $1.Meta, meta.TildeToken) + $1.Meta.SetTokenName(meta.TildeToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3544,7 +3598,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.IsIdenticalToken) + $2.Meta.SetTokenName(meta.IsIdenticalToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3556,7 +3610,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.IsNotIdenticalToken) + $2.Meta.SetTokenName(meta.IsNotIdenticalToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3568,7 +3622,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.IsEqualToken) + $2.Meta.SetTokenName(meta.IsEqualToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3580,7 +3634,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.IsNotEqualToken) + $2.Meta.SetTokenName(meta.IsNotEqualToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $2, meta.IsNotEqualToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3592,7 +3647,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.LessToken) + $2.Meta.SetTokenName(meta.LessToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3604,7 +3659,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.IsSmallerOrEqualToken) + $2.Meta.SetTokenName(meta.IsSmallerOrEqualToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3616,7 +3671,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.GreaterToken) + $2.Meta.SetTokenName(meta.GreaterToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3628,7 +3683,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.IsGreaterOrEqualToken) + $2.Meta.SetTokenName(meta.IsGreaterOrEqualToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3640,7 +3695,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.SpaceshipToken) + $2.Meta.SetTokenName(meta.SpaceshipToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3652,7 +3707,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.InstanceofToken) + $2.Meta.SetTokenName(meta.InstanceofToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3661,8 +3716,10 @@ expr_without_variable: $$ = $2; // save comments - addMeta($$, $1.Meta, meta.OpenParenthesisToken) - addMeta($$, $3.Meta, meta.CloseParenthesisToken) + yylex.(*Parser).prependMetaToken($$, $1, meta.NodeStart) + $1.Meta.SetTokenName(meta.NodeStart).PrependTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.NodeEnd).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $3, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3680,8 +3737,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $5)) // save comments - addMeta($$, $2.Meta, meta.QuestionMarkToken) - addMeta($$, $4.Meta, meta.ColonToken) + $2.Meta.SetTokenName(meta.QuestionMarkToken).AppendTo($$.GetMeta()) + $4.Meta.SetTokenName(meta.ColonToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3693,8 +3750,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) // save comments - addMeta($$, $2.Meta, meta.QuestionMarkToken) - addMeta($$, $3.Meta, meta.ColonToken) + $2.Meta.SetTokenName(meta.QuestionMarkToken).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.ColonToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3706,7 +3763,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.CoalesceToken) + $2.Meta.SetTokenName(meta.CoalesceToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3724,7 +3781,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - addMeta($$, $1.Meta, meta.IntCastToken) + $1.Meta.SetTokenName(meta.IntCastToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $1, meta.IntCastToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3736,7 +3794,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - addMeta($$, $1.Meta, meta.DoubleCastToken) + $1.Meta.SetTokenName(meta.DoubleCastToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $1, meta.DoubleCastToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3748,7 +3807,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - addMeta($$, $1.Meta, meta.StringCastToken) + $1.Meta.SetTokenName(meta.StringCastToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $1, meta.StringCastToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3760,7 +3820,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - addMeta($$, $1.Meta, meta.ArrayCastToken) + $1.Meta.SetTokenName(meta.ArrayCastToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $1, meta.ArrayCastToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3772,7 +3833,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - addMeta($$, $1.Meta, meta.ObjectCastToken) + $1.Meta.SetTokenName(meta.ObjectCastToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $1, meta.ObjectCastToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3784,7 +3846,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - addMeta($$, $1.Meta, meta.BoolCastToken) + $1.Meta.SetTokenName(meta.BoolCastToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $1, meta.BoolCastToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3796,7 +3859,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - addMeta($$, $1.Meta, meta.UnsetCastToken) + $1.Meta.SetTokenName(meta.UnsetCastToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $1, meta.UnsetCastToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3823,7 +3887,7 @@ expr_without_variable: } // save comments - addMeta($$, $1.Meta, meta.ExitToken) + $1.Meta.SetTokenName(meta.ExitToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3835,7 +3899,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - addMeta($$, $1.Meta, meta.AtToken) + $1.Meta.SetTokenName(meta.AtToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3853,8 +3917,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - addMeta($$, $1.Meta, meta.BackquoteToken) - addMeta($$, $3.Meta, meta.BackquoteToken) + $1.Meta.SetTokenName(meta.BackquoteToken).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.BackquoteToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3866,7 +3930,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - addMeta($$, $1.Meta, meta.PrintToken) + $1.Meta.SetTokenName(meta.PrintToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3878,7 +3942,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.YieldToken) + $1.Meta.SetTokenName(meta.YieldToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3890,7 +3954,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - addMeta($$, $1.Meta, meta.YieldToken) + $1.Meta.SetTokenName(meta.YieldToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3902,8 +3966,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $4)) // save comments - addMeta($$, $1.Meta, meta.YieldToken) - addMeta($$, $3.Meta, meta.DoubleArrowToken) + $1.Meta.SetTokenName(meta.YieldToken).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3915,7 +3979,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - addMeta($$, $1.Meta, meta.YieldFromToken) + $1.Meta.SetTokenName(meta.YieldFromToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3927,14 +3991,14 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $11)) // save comments - addMeta($$, $1.Meta, meta.FunctionToken) + $1.Meta.SetTokenName(meta.FunctionToken).AppendTo($$.GetMeta()) if $2 != nil { - addMeta($$, $2.Meta, meta.AmpersandToken) + $2.Meta.SetTokenName(meta.AmpersandToken).AppendTo($$.GetMeta()) } - addMeta($$, $4.Meta, meta.OpenParenthesisToken) - addMeta($$, $6.Meta, meta.CloseParenthesisToken) - addMeta($$, $9.Meta, meta.OpenCurlyBracesToken) - addMeta($$, $11.Meta, meta.CloseCurlyBracesToken) + $4.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) + $6.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) + $9.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) + $11.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3946,15 +4010,15 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $12)) // save comments - addMeta($$, $1.Meta, meta.StaticToken) - addMeta($$, $2.Meta, meta.FunctionToken) + $1.Meta.SetTokenName(meta.StaticToken).AppendTo($$.GetMeta()) + $2.Meta.SetTokenName(meta.FunctionToken).AppendTo($$.GetMeta()) if $3 != nil { - addMeta($$, $3.Meta, meta.AmpersandToken) + $3.Meta.SetTokenName(meta.AmpersandToken).AppendTo($$.GetMeta()) } - addMeta($$, $5.Meta, meta.OpenParenthesisToken) - addMeta($$, $7.Meta, meta.CloseParenthesisToken) - addMeta($$, $10.Meta, meta.OpenCurlyBracesToken) - addMeta($$, $12.Meta, meta.CloseCurlyBracesToken) + $5.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) + $7.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) + $10.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) + $12.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3996,9 +4060,9 @@ lexical_vars: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - addMeta($$, $1.Meta, meta.UseToken) - addMeta($$, $2.Meta, meta.OpenParenthesisToken) - addMeta($$, $4.Meta, meta.CloseParenthesisToken) + $1.Meta.SetTokenName(meta.UseToken).AppendTo($$.GetMeta()) + $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) + $4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4010,7 +4074,7 @@ lexical_var_list: $$ = append($1, $3) // save comments - addMeta(lastNode($1), $2.Meta, meta.NodeEnd) + $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4033,7 +4097,7 @@ lexical_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.VariableToken) + $1.Meta.SetTokenName(meta.VariableToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4049,8 +4113,8 @@ lexical_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - addMeta($$, $1.Meta, meta.AmpersandToken) - addMeta(variable, $2.Meta, meta.VariableToken) + $1.Meta.SetTokenName(meta.AmpersandToken).AppendTo($$.GetMeta()) + $2.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4074,7 +4138,7 @@ function_call: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) // save comments - addMeta($$, $2.Meta, meta.PaamayimNekudotayimToken) + $2.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4086,7 +4150,7 @@ function_call: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) // save comments - addMeta($$, $2.Meta, meta.PaamayimNekudotayimToken) + $2.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4110,7 +4174,7 @@ class_name: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.IdentifierToken) + $1.Meta.SetTokenName(meta.IdentifierToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4152,8 +4216,10 @@ exit_expr: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - addMeta($$, $1.Meta, meta.OpenParenthesisToken) - addMeta($$, $3.Meta, meta.CloseParenthesisToken) + $1.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $1, meta.OpenParenthesisToken) + $3.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $3, meta.CloseParenthesisToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4204,9 +4270,9 @@ dereferencable_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - addMeta($$, $1.Meta, meta.ArrayToken) - addMeta($$, $2.Meta, meta.OpenParenthesisToken) - addMeta($$, $4.Meta, meta.CloseParenthesisToken) + $1.Meta.SetTokenName(meta.ArrayToken).AppendTo($$.GetMeta()) + $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) + $4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4218,8 +4284,8 @@ dereferencable_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - addMeta($$, $1.Meta, meta.OpenSquareBracket) - addMeta($$, $3.Meta, meta.CloseSquareBracket) + $1.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4231,7 +4297,7 @@ dereferencable_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.ConstantEncapsedStringToken) + $1.Meta.SetTokenName(meta.ConstantEncapsedStringToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4246,7 +4312,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.LnumberToken) + $1.Meta.SetTokenName(meta.LnumberToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4258,7 +4324,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.DnumberToken) + $1.Meta.SetTokenName(meta.DnumberToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4270,7 +4336,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.MagicConstantToken) + $1.Meta.SetTokenName(meta.MagicConstantToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4282,7 +4348,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.MagicConstantToken) + $1.Meta.SetTokenName(meta.MagicConstantToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4294,7 +4360,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.MagicConstantToken) + $1.Meta.SetTokenName(meta.MagicConstantToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4306,7 +4372,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.MagicConstantToken) + $1.Meta.SetTokenName(meta.MagicConstantToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4318,7 +4384,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.MagicConstantToken) + $1.Meta.SetTokenName(meta.MagicConstantToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4330,7 +4396,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.MagicConstantToken) + $1.Meta.SetTokenName(meta.MagicConstantToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4342,7 +4408,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.MagicConstantToken) + $1.Meta.SetTokenName(meta.MagicConstantToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4354,7 +4420,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.MagicConstantToken) + $1.Meta.SetTokenName(meta.MagicConstantToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4368,7 +4434,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - addMeta($$, $1.Meta, meta.StartHeredocToken) + $1.Meta.SetTokenName(meta.StartHeredocToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4380,7 +4446,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - addMeta($$, $1.Meta, meta.StartHeredocToken) + $1.Meta.SetTokenName(meta.StartHeredocToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4392,7 +4458,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - addMeta($$, $1.Meta, meta.DoubleQuoteToken) + $1.Meta.SetTokenName(meta.DoubleQuoteToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4404,7 +4470,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - addMeta($$, $1.Meta, meta.StartHeredocToken) + $1.Meta.SetTokenName(meta.StartHeredocToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4442,8 +4508,8 @@ constant: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.PaamayimNekudotayimToken) - addMeta(target, $3.Meta, meta.IdentifierToken) + $2.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.IdentifierToken).AppendTo(target.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4457,8 +4523,8 @@ constant: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.PaamayimNekudotayimToken) - addMeta(target, $3.Meta, meta.IdentifierToken) + $2.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.IdentifierToken).AppendTo(target.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4515,8 +4581,10 @@ dereferencable: $$ = $2; // save comments - addMeta($$, $1.Meta, meta.OpenParenthesisToken) - addMeta($$, $3.Meta, meta.CloseParenthesisToken) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) + $3.Meta.SetTokenName(meta.NodeEnd).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $3, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4540,8 +4608,10 @@ callable_expr: $$ = $2; // save comments - addMeta($$, $1.Meta, meta.OpenParenthesisToken) - addMeta($$, $3.Meta, meta.CloseParenthesisToken) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) + $3.Meta.SetTokenName(meta.NodeEnd).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $3, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4568,8 +4638,10 @@ callable_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments - addMeta($$, $2.Meta, meta.OpenSquareBracket) - addMeta($$, $4.Meta, meta.CloseSquareBracket) + $2.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $2, meta.OpenSquareBracket) + $4.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $4, meta.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4581,8 +4653,10 @@ callable_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments - addMeta($$, $2.Meta, meta.OpenSquareBracket) - addMeta($$, $4.Meta, meta.CloseSquareBracket) + $2.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $2, meta.OpenSquareBracket) + $4.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $4, meta.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4594,8 +4668,10 @@ callable_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments - addMeta($$, $2.Meta, meta.OpenCurlyBracesToken) - addMeta($$, $4.Meta, meta.CloseCurlyBracesToken) + $2.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $2, meta.OpenCurlyBracesToken) + $4.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $4, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4607,7 +4683,7 @@ callable_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) // save comments - addMeta($$, $2.Meta, meta.ObjectOperatorToken) + $2.Meta.SetTokenName(meta.ObjectOperatorToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4640,7 +4716,7 @@ variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.ObjectOperatorToken) + $2.Meta.SetTokenName(meta.ObjectOperatorToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4657,7 +4733,7 @@ simple_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.VariableToken) + $1.Meta.SetTokenName(meta.VariableToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4669,9 +4745,11 @@ simple_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - addMeta($$, $1.Meta, meta.DollarToken) - addMeta($$, $2.Meta, meta.OpenCurlyBracesToken) - addMeta($$, $4.Meta, meta.CloseCurlyBracesToken) + $1.Meta.SetTokenName(meta.DollarToken).AppendTo($$.GetMeta()) + $2.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $2, meta.OpenCurlyBracesToken) + $4.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $4, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4683,7 +4761,7 @@ simple_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - addMeta($$, $1.Meta, meta.DollarToken) + $1.Meta.SetTokenName(meta.DollarToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4698,7 +4776,7 @@ static_member: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.PaamayimNekudotayimToken) + $2.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4710,7 +4788,7 @@ static_member: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.PaamayimNekudotayimToken) + $2.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4731,8 +4809,10 @@ new_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments - addMeta($$, $2.Meta, meta.OpenSquareBracket) - addMeta($$, $4.Meta, meta.CloseSquareBracket) + $2.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $2, meta.OpenSquareBracket) + $4.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $4, meta.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4744,8 +4824,10 @@ new_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments - addMeta($$, $2.Meta, meta.OpenCurlyBracesToken) - addMeta($$, $4.Meta, meta.CloseCurlyBracesToken) + $2.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $2, meta.OpenCurlyBracesToken) + $4.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $4, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4757,7 +4839,7 @@ new_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.ObjectOperatorToken) + $2.Meta.SetTokenName(meta.ObjectOperatorToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4769,7 +4851,7 @@ new_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.PaamayimNekudotayimToken) + $2.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4781,7 +4863,7 @@ new_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.PaamayimNekudotayimToken) + $2.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4796,7 +4878,7 @@ member_name: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.IdentifierToken) + $1.Meta.SetTokenName(meta.IdentifierToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4805,8 +4887,10 @@ member_name: $$ = $2; // save comments - addMeta($$, $1.Meta, meta.OpenCurlyBracesToken) - addMeta($$, $3.Meta, meta.CloseCurlyBracesToken) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) + $3.Meta.SetTokenName(meta.NodeEnd).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $3, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4827,17 +4911,19 @@ property_name: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.IdentifierToken) + $1.Meta.SetTokenName(meta.IdentifierToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | '{' expr '}' { $$ = $2; - + // save comments - addMeta($$, $1.Meta, meta.OpenCurlyBracesToken) - addMeta($$, $3.Meta, meta.CloseCurlyBracesToken) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) + $3.Meta.SetTokenName(meta.NodeEnd).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $3, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4883,7 +4969,7 @@ non_empty_array_pair_list: $$ = append($1, $3) // save comments - addMeta(lastNode($1), $2.Meta, meta.NodeEnd) + $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4908,7 +4994,7 @@ array_pair: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - addMeta($$, $2.Meta, meta.DoubleArrowToken) + $2.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4931,8 +5017,8 @@ array_pair: reference.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $4)) // save comments - addMeta($$, $2.Meta, meta.DoubleArrowToken) - addMeta(reference, $3.Meta, meta.AmpersandToken) + $2.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.AmpersandToken).AppendTo(reference.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4946,7 +5032,7 @@ array_pair: reference.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - addMeta(reference, $1.Meta, meta.AmpersandToken) + $1.Meta.SetTokenName(meta.AmpersandToken).AppendTo(reference.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4961,10 +5047,10 @@ array_pair: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $6)) // save comments - addMeta($$, $2.Meta, meta.DoubleArrowToken) - addMeta(list, $3.Meta, meta.ListToken) - addMeta(list, $4.Meta, meta.OpenParenthesisToken) - addMeta(list, $6.Meta, meta.CloseParenthesisToken) + $2.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.ListToken).AppendTo(list.GetMeta()) + $4.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(list.GetMeta()) + $6.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(list.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4979,9 +5065,9 @@ array_pair: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - addMeta(list, $1.Meta, meta.ListToken) - addMeta(list, $2.Meta, meta.OpenParenthesisToken) - addMeta(list, $4.Meta, meta.CloseParenthesisToken) + $1.Meta.SetTokenName(meta.ListToken).AppendTo(list.GetMeta()) + $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(list.GetMeta()) + $4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(list.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5003,7 +5089,7 @@ encaps_list: encapsed.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) // save comments - addMeta(encapsed, $2.Meta, meta.EncapsedAndWhitespaceToken) + $2.Meta.SetTokenName(meta.EncapsedAndWhitespaceToken).AppendTo(encapsed.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5022,7 +5108,7 @@ encaps_list: encapsed.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta(encapsed, $1.Meta, meta.EncapsedAndWhitespaceToken) + $1.Meta.SetTokenName(meta.EncapsedAndWhitespaceToken).AppendTo(encapsed.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5039,7 +5125,7 @@ encaps_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.VariableToken) + $1.Meta.SetTokenName(meta.VariableToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5055,9 +5141,11 @@ encaps_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - addMeta(variable, $1.Meta, meta.VariableToken) - addMeta($$, $2.Meta, meta.OpenSquareBracket) - addMeta($$, $4.Meta, meta.CloseSquareBracket) + $1.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) + $2.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $2, meta.OpenCurlyBracesToken) + $4.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $4, meta.CloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5075,38 +5163,48 @@ encaps_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - addMeta(variable, $1.Meta, meta.VariableToken) - addMeta($$, $2.Meta, meta.ObjectOperatorToken) - addMeta(fetch, $3.Meta, meta.IdentifierToken) + $1.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) + $2.Meta.SetTokenName(meta.ObjectOperatorToken).AppendTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.IdentifierToken).AppendTo(fetch.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_DOLLAR_OPEN_CURLY_BRACES expr '}' { - $$ = expr.NewVariable($2) + variable := expr.NewVariable($2) + variable.StringVar = true + + $$ = variable // save position $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - addMeta($$, $1.Meta, meta.DollarOpenCurlyBracesToken) - addMeta($$, $3.Meta, meta.CloseCurlyBracesToken) + $1.Meta.SetTokenName(meta.DollarOpenCurlyBracesToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $1, meta.DollarOpenCurlyBracesToken) + $3.Meta.SetTokenName(meta.DollarCloseCurlyBracesToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $3, meta.DollarCloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_DOLLAR_OPEN_CURLY_BRACES T_STRING_VARNAME '}' { name := node.NewIdentifier($2.Value) - $$ = expr.NewVariable(name) + variable := expr.NewVariable(name) + variable.StringVar = true + + $$ = variable // save position name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - addMeta($$, $1.Meta, meta.DollarOpenCurlyBracesToken) - addMeta(name, $2.Meta, meta.IdentifierToken) - addMeta($$, $3.Meta, meta.CloseCurlyBracesToken) + $1.Meta.SetTokenName(meta.DollarOpenCurlyBracesToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $1, meta.DollarOpenCurlyBracesToken) + $2.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + $3.Meta.SetTokenName(meta.DollarCloseCurlyBracesToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $3, meta.DollarCloseCurlyBracesToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5114,6 +5212,7 @@ encaps_var: { identifier := node.NewIdentifier($2.Value) variable := expr.NewVariable(identifier) + variable.StringVar = true $$ = expr.NewArrayDimFetch(variable, $4) // save position @@ -5122,11 +5221,15 @@ encaps_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $6)) // save comments - addMeta($$, $1.Meta, meta.DollarOpenCurlyBracesToken) - addMeta(variable, $2.Meta, meta.StringVarnameToken) - addMeta($$, $3.Meta, meta.OpenSquareBracket) - addMeta($$, $5.Meta, meta.CloseSquareBracket) - addMeta($$, $6.Meta, meta.CloseCurlyBracesToken) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) + $2.Meta.SetTokenName(meta.StringVarnameToken).AppendTo(variable.GetMeta()) + $3.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $3, meta.OpenSquareBracket) + $5.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $5, meta.CloseSquareBracket) + $6.Meta.SetTokenName(meta.NodeEnd).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $6, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5134,6 +5237,12 @@ encaps_var: { $$ = $2; + // save comments + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) + $3.Meta.SetTokenName(meta.NodeEnd).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $3, meta.NodeEnd) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -5147,7 +5256,7 @@ encaps_var_offset: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.StringToken) + $1.Meta.SetTokenName(meta.StringToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5164,7 +5273,7 @@ encaps_var_offset: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.NumStringToken) + $1.Meta.SetTokenName(meta.NumStringToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5190,11 +5299,11 @@ encaps_var_offset: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - addMeta($$, $1.Meta, meta.MinusToken) + $1.Meta.SetTokenName(meta.MinusToken).AppendTo($$.GetMeta()) if isInt { - addMeta(lnumber, $2.Meta, meta.NumStringToken) + $2.Meta.SetTokenName(meta.NumStringToken).AppendTo(lnumber.GetMeta()) } else { - addMeta($$, $2.Meta, meta.NumStringToken) + $2.Meta.SetTokenName(meta.NumStringToken).AppendTo($$.GetMeta()) } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -5209,7 +5318,7 @@ encaps_var_offset: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - addMeta($$, $1.Meta, meta.VariableToken) + $1.Meta.SetTokenName(meta.VariableToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5224,12 +5333,13 @@ internal_functions_in_yacc: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5)) // save comments - addMeta($$, $1.Meta, meta.IssetToken) - addMeta($$, $2.Meta, meta.OpenParenthesisToken) + $1.Meta.SetTokenName(meta.IssetToken).AppendTo($$.GetMeta()) + $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) if $4 != nil { - addMeta($$, $4.Meta, meta.CommaToken) + $4.Meta.SetTokenName(meta.CommaToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $4, meta.CommaToken) } - addMeta($$, $5.Meta, meta.CloseParenthesisToken) + $5.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5241,9 +5351,9 @@ internal_functions_in_yacc: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - addMeta($$, $1.Meta, meta.EmptyToken) - addMeta($$, $2.Meta, meta.OpenParenthesisToken) - addMeta($$, $4.Meta, meta.CloseParenthesisToken) + $1.Meta.SetTokenName(meta.EmptyToken).AppendTo($$.GetMeta()) + $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) + $4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5255,7 +5365,7 @@ internal_functions_in_yacc: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - addMeta($$, $1.Meta, meta.IncludeToken) + $1.Meta.SetTokenName(meta.IncludeToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5267,7 +5377,7 @@ internal_functions_in_yacc: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - addMeta($$, $1.Meta, meta.IncludeOnceToken) + $1.Meta.SetTokenName(meta.IncludeOnceToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5279,9 +5389,9 @@ internal_functions_in_yacc: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - addMeta($$, $1.Meta, meta.EvalToken) - addMeta($$, $2.Meta, meta.OpenParenthesisToken) - addMeta($$, $4.Meta, meta.CloseParenthesisToken) + $1.Meta.SetTokenName(meta.EvalToken).AppendTo($$.GetMeta()) + $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) + $4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5293,7 +5403,7 @@ internal_functions_in_yacc: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - addMeta($$, $1.Meta, meta.RequireToken) + $1.Meta.SetTokenName(meta.RequireToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5305,7 +5415,7 @@ internal_functions_in_yacc: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - addMeta($$, $1.Meta, meta.RequireOnceToken) + $1.Meta.SetTokenName(meta.RequireOnceToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5323,7 +5433,7 @@ isset_variables: $$ = append($1, $3) // save comments - addMeta(lastNode($1), $2.Meta, meta.NodeEnd) + $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php7/php7_test.go b/php7/php7_test.go index 53875e1..3ebc9c3 100644 --- a/php7/php7_test.go +++ b/php7/php7_test.go @@ -449,6 +449,7 @@ func TestPhp7(t *testing.T) { StartPos: 10, EndPos: 11, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 2, @@ -476,6 +477,7 @@ func TestPhp7(t *testing.T) { StartPos: 17, EndPos: 18, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 2, @@ -512,6 +514,7 @@ func TestPhp7(t *testing.T) { StartPos: 24, EndPos: 27, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 3, @@ -546,6 +549,7 @@ func TestPhp7(t *testing.T) { StartPos: 29, EndPos: 30, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 3, @@ -573,6 +577,7 @@ func TestPhp7(t *testing.T) { StartPos: 36, EndPos: 37, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 3, @@ -609,6 +614,7 @@ func TestPhp7(t *testing.T) { StartPos: 43, EndPos: 46, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 4, @@ -652,6 +658,7 @@ func TestPhp7(t *testing.T) { StartPos: 53, EndPos: 54, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 4, @@ -670,8 +677,8 @@ func TestPhp7(t *testing.T) { StartPos: 57, EndPos: 61, }, - IsReference: false, Variadic: true, + IsReference: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 4, @@ -679,6 +686,7 @@ func TestPhp7(t *testing.T) { StartPos: 60, EndPos: 61, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 4, @@ -760,6 +768,7 @@ func TestPhp7(t *testing.T) { StartPos: 76, EndPos: 77, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 5, @@ -787,6 +796,7 @@ func TestPhp7(t *testing.T) { StartPos: 83, EndPos: 84, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 5, @@ -823,6 +833,7 @@ func TestPhp7(t *testing.T) { StartPos: 90, EndPos: 93, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 6, @@ -857,8 +868,8 @@ func TestPhp7(t *testing.T) { StartPos: 100, EndPos: 101, }, - Variadic: false, IsReference: false, + Variadic: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 6, @@ -866,6 +877,7 @@ func TestPhp7(t *testing.T) { StartPos: 100, EndPos: 101, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 6, @@ -884,8 +896,8 @@ func TestPhp7(t *testing.T) { StartPos: 104, EndPos: 108, }, - IsReference: false, Variadic: true, + IsReference: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 6, @@ -893,6 +905,7 @@ func TestPhp7(t *testing.T) { StartPos: 107, EndPos: 108, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 6, @@ -965,6 +978,7 @@ func TestPhp7(t *testing.T) { StartPos: 122, EndPos: 123, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 7, @@ -992,6 +1006,7 @@ func TestPhp7(t *testing.T) { StartPos: 129, EndPos: 130, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 7, @@ -1044,8 +1059,8 @@ func TestPhp7(t *testing.T) { StartPos: 172, EndPos: 173, }, - Variadic: false, IsReference: false, + Variadic: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 9, @@ -1053,6 +1068,7 @@ func TestPhp7(t *testing.T) { StartPos: 172, EndPos: 173, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 9, @@ -1071,8 +1087,8 @@ func TestPhp7(t *testing.T) { StartPos: 176, EndPos: 180, }, - IsReference: false, Variadic: true, + IsReference: false, Expr: &expr.Variable{ Position: &position.Position{ StartLine: 9, @@ -1080,6 +1096,7 @@ func TestPhp7(t *testing.T) { StartPos: 179, EndPos: 180, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 9, @@ -1144,6 +1161,7 @@ func TestPhp7(t *testing.T) { StartPos: 209, EndPos: 212, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 11, @@ -1184,6 +1202,7 @@ func TestPhp7(t *testing.T) { StartPos: 221, EndPos: 224, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 12, @@ -1234,6 +1253,7 @@ func TestPhp7(t *testing.T) { StartPos: 236, EndPos: 239, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 13, @@ -1251,6 +1271,7 @@ func TestPhp7(t *testing.T) { StartPos: 241, EndPos: 244, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 13, @@ -1292,6 +1313,7 @@ func TestPhp7(t *testing.T) { StartPos: 254, EndPos: 257, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 14, @@ -1342,6 +1364,7 @@ func TestPhp7(t *testing.T) { StartPos: 271, EndPos: 274, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 15, @@ -1359,6 +1382,7 @@ func TestPhp7(t *testing.T) { StartPos: 277, EndPos: 280, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 15, @@ -1409,6 +1433,7 @@ func TestPhp7(t *testing.T) { StartPos: 297, EndPos: 300, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 16, @@ -1429,8 +1454,8 @@ func TestPhp7(t *testing.T) { StartPos: 306, EndPos: 350, }, - ReturnsRef: false, PhpDocComment: "", + ReturnsRef: false, FunctionName: &node.Identifier{ Position: &position.Position{ StartLine: 18, @@ -1448,8 +1473,8 @@ func TestPhp7(t *testing.T) { StartPos: 319, EndPos: 332, }, - ByRef: false, Variadic: false, + ByRef: false, VariableType: &node.Nullable{ Position: &position.Position{ StartLine: 18, @@ -1484,6 +1509,7 @@ func TestPhp7(t *testing.T) { StartPos: 324, EndPos: 327, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 18, @@ -1557,6 +1583,7 @@ func TestPhp7(t *testing.T) { StartPos: 343, EndPos: 346, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 18, @@ -1626,8 +1653,8 @@ func TestPhp7(t *testing.T) { StartPos: 385, EndPos: 398, }, - Variadic: false, ByRef: false, + Variadic: false, VariableType: &node.Nullable{ Position: &position.Position{ StartLine: 19, @@ -1662,6 +1689,7 @@ func TestPhp7(t *testing.T) { StartPos: 390, EndPos: 393, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 19, @@ -1735,6 +1763,7 @@ func TestPhp7(t *testing.T) { StartPos: 409, EndPos: 412, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 19, @@ -1773,9 +1802,9 @@ func TestPhp7(t *testing.T) { StartPos: 421, EndPos: 461, }, - PhpDocComment: "", ReturnsRef: false, Static: false, + PhpDocComment: "", Params: []node.Node{ &node.Parameter{ Position: &position.Position{ @@ -1820,6 +1849,7 @@ func TestPhp7(t *testing.T) { StartPos: 435, EndPos: 438, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 20, @@ -1893,6 +1923,7 @@ func TestPhp7(t *testing.T) { StartPos: 454, EndPos: 457, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 20, @@ -1933,8 +1964,8 @@ func TestPhp7(t *testing.T) { StartPos: 482, EndPos: 495, }, - ByRef: false, Variadic: false, + ByRef: false, VariableType: &node.Nullable{ Position: &position.Position{ StartLine: 21, @@ -1969,6 +2000,7 @@ func TestPhp7(t *testing.T) { StartPos: 487, EndPos: 490, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 21, @@ -2042,6 +2074,7 @@ func TestPhp7(t *testing.T) { StartPos: 506, EndPos: 509, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 21, @@ -2343,6 +2376,7 @@ func TestPhp7(t *testing.T) { StartPos: 873, EndPos: 876, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 39, @@ -2394,6 +2428,7 @@ func TestPhp7(t *testing.T) { StartPos: 888, EndPos: 891, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 40, @@ -2455,6 +2490,7 @@ func TestPhp7(t *testing.T) { StartPos: 906, EndPos: 909, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 41, @@ -2524,6 +2560,7 @@ func TestPhp7(t *testing.T) { StartPos: 925, EndPos: 928, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 42, @@ -2585,6 +2622,7 @@ func TestPhp7(t *testing.T) { StartPos: 982, EndPos: 985, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 43, @@ -2646,6 +2684,7 @@ func TestPhp7(t *testing.T) { StartPos: 1040, EndPos: 1043, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 44, @@ -2707,6 +2746,7 @@ func TestPhp7(t *testing.T) { StartPos: 1060, EndPos: 1063, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 45, @@ -2724,6 +2764,7 @@ func TestPhp7(t *testing.T) { StartPos: 1065, EndPos: 1068, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 45, @@ -2760,6 +2801,7 @@ func TestPhp7(t *testing.T) { StartPos: 1076, EndPos: 1079, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 46, @@ -2786,6 +2828,7 @@ func TestPhp7(t *testing.T) { StartPos: 1081, EndPos: 1084, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 46, @@ -2837,6 +2880,7 @@ func TestPhp7(t *testing.T) { StartPos: 1096, EndPos: 1099, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 47, @@ -2900,6 +2944,7 @@ func TestPhp7(t *testing.T) { StartPos: 1118, EndPos: 1123, }, + StringVar: true, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 48, @@ -2951,6 +2996,7 @@ func TestPhp7(t *testing.T) { StartPos: 1137, EndPos: 1139, }, + StringVar: true, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 49, @@ -3005,6 +3051,7 @@ func TestPhp7(t *testing.T) { StartPos: 1155, EndPos: 1161, }, + StringVar: true, VarName: &expr.Variable{ Position: &position.Position{ StartLine: 50, @@ -3012,6 +3059,7 @@ func TestPhp7(t *testing.T) { StartPos: 1157, EndPos: 1160, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 50, @@ -3064,6 +3112,7 @@ func TestPhp7(t *testing.T) { StartPos: 1174, EndPos: 1177, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 51, @@ -3109,6 +3158,7 @@ func TestPhp7(t *testing.T) { StartPos: 1196, EndPos: 1197, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 53, @@ -3143,6 +3193,7 @@ func TestPhp7(t *testing.T) { StartPos: 1217, EndPos: 1218, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 55, @@ -3177,6 +3228,7 @@ func TestPhp7(t *testing.T) { StartPos: 1233, EndPos: 1234, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 56, @@ -3213,6 +3265,7 @@ func TestPhp7(t *testing.T) { StartPos: 1253, EndPos: 1254, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 58, @@ -3264,6 +3317,7 @@ func TestPhp7(t *testing.T) { StartPos: 1282, EndPos: 1283, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 61, @@ -3298,6 +3352,7 @@ func TestPhp7(t *testing.T) { StartPos: 1298, EndPos: 1299, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 62, @@ -3332,6 +3387,7 @@ func TestPhp7(t *testing.T) { StartPos: 1313, EndPos: 1314, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 63, @@ -3698,8 +3754,8 @@ func TestPhp7(t *testing.T) { StartPos: 1516, EndPos: 1532, }, - ReturnsRef: false, PhpDocComment: "", + ReturnsRef: false, MethodName: &node.Identifier{ Position: &position.Position{ StartLine: 72, @@ -4494,6 +4550,7 @@ func TestPhp7(t *testing.T) { StartPos: 1980, EndPos: 2008, }, + Alt: true, Consts: []node.Node{ &stmt.Constant{ Position: &position.Position{ @@ -4525,10 +4582,10 @@ func TestPhp7(t *testing.T) { }, Stmt: &stmt.StmtList{ Position: &position.Position{ - StartLine: 87, - EndLine: 87, - StartPos: 1996, - EndPos: 2008, + StartLine: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, }, Stmts: []node.Node{}, }, @@ -4574,6 +4631,7 @@ func TestPhp7(t *testing.T) { StartPos: 2035, EndPos: 2036, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 89, @@ -4610,6 +4668,7 @@ func TestPhp7(t *testing.T) { StartPos: 2049, EndPos: 2050, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 90, @@ -4644,6 +4703,7 @@ func TestPhp7(t *testing.T) { StartPos: 2060, EndPos: 2061, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 91, @@ -4680,6 +4740,7 @@ func TestPhp7(t *testing.T) { StartPos: 2068, EndPos: 2069, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 91, @@ -4716,6 +4777,7 @@ func TestPhp7(t *testing.T) { StartPos: 2077, EndPos: 2078, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 91, @@ -4741,6 +4803,7 @@ func TestPhp7(t *testing.T) { StartPos: 2083, EndPos: 2084, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 91, @@ -4785,6 +4848,7 @@ func TestPhp7(t *testing.T) { StartPos: 2100, EndPos: 2101, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 92, @@ -4821,6 +4885,7 @@ func TestPhp7(t *testing.T) { StartPos: 2109, EndPos: 2110, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 92, @@ -4846,6 +4911,7 @@ func TestPhp7(t *testing.T) { StartPos: 2115, EndPos: 2116, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 92, @@ -4882,6 +4948,7 @@ func TestPhp7(t *testing.T) { StartPos: 2142, EndPos: 2143, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 93, @@ -4899,6 +4966,7 @@ func TestPhp7(t *testing.T) { StartPos: 2148, EndPos: 2149, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 93, @@ -4933,6 +5001,7 @@ func TestPhp7(t *testing.T) { StartPos: 2166, EndPos: 2167, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 94, @@ -4950,6 +5019,7 @@ func TestPhp7(t *testing.T) { StartPos: 2172, EndPos: 2173, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 94, @@ -4984,6 +5054,7 @@ func TestPhp7(t *testing.T) { StartPos: 2201, EndPos: 2202, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 95, @@ -5001,6 +5072,7 @@ func TestPhp7(t *testing.T) { StartPos: 2207, EndPos: 2208, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 95, @@ -5018,6 +5090,7 @@ func TestPhp7(t *testing.T) { StartPos: 2213, EndPos: 2214, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 95, @@ -5052,6 +5125,7 @@ func TestPhp7(t *testing.T) { StartPos: 2231, EndPos: 2232, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 96, @@ -5069,6 +5143,7 @@ func TestPhp7(t *testing.T) { StartPos: 2237, EndPos: 2238, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 96, @@ -5093,6 +5168,7 @@ func TestPhp7(t *testing.T) { StartPos: 2244, EndPos: 2245, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 96, @@ -5128,6 +5204,7 @@ func TestPhp7(t *testing.T) { StartPos: 2262, EndPos: 2263, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 97, @@ -5145,6 +5222,7 @@ func TestPhp7(t *testing.T) { StartPos: 2268, EndPos: 2269, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 97, @@ -5177,6 +5255,7 @@ func TestPhp7(t *testing.T) { StartPos: 2279, EndPos: 2280, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 97, @@ -5214,6 +5293,7 @@ func TestPhp7(t *testing.T) { StartPos: 2298, EndPos: 2299, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 98, @@ -5231,6 +5311,7 @@ func TestPhp7(t *testing.T) { StartPos: 2304, EndPos: 2305, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 98, @@ -5263,6 +5344,7 @@ func TestPhp7(t *testing.T) { StartPos: 2311, EndPos: 2312, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 98, @@ -5380,8 +5462,8 @@ func TestPhp7(t *testing.T) { StartPos: 2398, EndPos: 2421, }, - PhpDocComment: "", ReturnsRef: true, + PhpDocComment: "", FunctionName: &node.Identifier{ Position: &position.Position{ StartLine: 102, @@ -5427,6 +5509,7 @@ func TestPhp7(t *testing.T) { StartPos: 2432, EndPos: 2433, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 103, @@ -5444,6 +5527,7 @@ func TestPhp7(t *testing.T) { StartPos: 2436, EndPos: 2437, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 103, @@ -5504,6 +5588,7 @@ func TestPhp7(t *testing.T) { StartPos: 2462, EndPos: 2463, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 106, @@ -5538,6 +5623,7 @@ func TestPhp7(t *testing.T) { StartPos: 2475, EndPos: 2476, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 107, @@ -5572,6 +5658,7 @@ func TestPhp7(t *testing.T) { StartPos: 2490, EndPos: 2491, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 107, @@ -5608,6 +5695,7 @@ func TestPhp7(t *testing.T) { StartPos: 2503, EndPos: 2504, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 108, @@ -5659,6 +5747,7 @@ func TestPhp7(t *testing.T) { StartPos: 2524, EndPos: 2525, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 109, @@ -5693,6 +5782,7 @@ func TestPhp7(t *testing.T) { StartPos: 2539, EndPos: 2540, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 109, @@ -5727,6 +5817,7 @@ func TestPhp7(t *testing.T) { StartPos: 2554, EndPos: 2555, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 109, @@ -5780,6 +5871,7 @@ func TestPhp7(t *testing.T) { StartPos: 2575, EndPos: 2576, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 110, @@ -5814,6 +5906,7 @@ func TestPhp7(t *testing.T) { StartPos: 2590, EndPos: 2591, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 110, @@ -5856,6 +5949,7 @@ func TestPhp7(t *testing.T) { StartPos: 2606, EndPos: 2607, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 110, @@ -6162,6 +6256,7 @@ func TestPhp7(t *testing.T) { StartPos: 2795, EndPos: 2796, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 118, @@ -6238,6 +6333,7 @@ func TestPhp7(t *testing.T) { StartPos: 2827, EndPos: 2828, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 119, @@ -6264,6 +6360,7 @@ func TestPhp7(t *testing.T) { StartPos: 2831, EndPos: 2832, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 119, @@ -6310,6 +6407,7 @@ func TestPhp7(t *testing.T) { StartPos: 2849, EndPos: 2850, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 120, @@ -6335,6 +6433,7 @@ func TestPhp7(t *testing.T) { StartPos: 2853, EndPos: 2854, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 120, @@ -6668,6 +6767,7 @@ func TestPhp7(t *testing.T) { StartPos: 3102, EndPos: 3103, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 143, @@ -7445,6 +7545,7 @@ func TestPhp7(t *testing.T) { StartPos: 3444, EndPos: 3445, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 154, @@ -7522,6 +7623,7 @@ func TestPhp7(t *testing.T) { StartPos: 3494, EndPos: 3495, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 155, @@ -7580,6 +7682,7 @@ func TestPhp7(t *testing.T) { StartPos: 3527, EndPos: 3528, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 156, @@ -7627,6 +7730,7 @@ func TestPhp7(t *testing.T) { StartPos: 3558, EndPos: 3559, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 156, @@ -7685,6 +7789,7 @@ func TestPhp7(t *testing.T) { StartPos: 3591, EndPos: 3592, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 157, @@ -7723,6 +7828,7 @@ func TestPhp7(t *testing.T) { StartPos: 3618, EndPos: 3619, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 159, @@ -7740,6 +7846,7 @@ func TestPhp7(t *testing.T) { StartPos: 3622, EndPos: 3623, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 159, @@ -8818,6 +8925,7 @@ func TestPhp7(t *testing.T) { StartPos: 3990, EndPos: 3991, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 177, @@ -8867,6 +8975,7 @@ func TestPhp7(t *testing.T) { StartPos: 3999, EndPos: 4000, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 178, @@ -9012,6 +9121,7 @@ func TestPhp7(t *testing.T) { StartPos: 4047, EndPos: 4048, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 181, @@ -9049,6 +9159,7 @@ func TestPhp7(t *testing.T) { StartPos: 4056, EndPos: 4057, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 182, @@ -9082,6 +9193,7 @@ func TestPhp7(t *testing.T) { StartPos: 4063, EndPos: 4064, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 183, @@ -9159,6 +9271,7 @@ func TestPhp7(t *testing.T) { StartPos: 4082, EndPos: 4085, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 186, @@ -9201,6 +9314,7 @@ func TestPhp7(t *testing.T) { StartPos: 4101, EndPos: 4102, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 187, @@ -9234,6 +9348,7 @@ func TestPhp7(t *testing.T) { StartPos: 4114, EndPos: 4115, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 188, @@ -9260,9 +9375,9 @@ func TestPhp7(t *testing.T) { StartPos: 4120, EndPos: 4131, }, + PhpDocComment: "", ReturnsRef: false, Static: false, - PhpDocComment: "", Stmts: []node.Node{}, }, }, @@ -9300,6 +9415,7 @@ func TestPhp7(t *testing.T) { StartPos: 4145, EndPos: 4146, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 190, @@ -9327,6 +9443,7 @@ func TestPhp7(t *testing.T) { StartPos: 4149, EndPos: 4150, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 190, @@ -9354,6 +9471,7 @@ func TestPhp7(t *testing.T) { StartPos: 4158, EndPos: 4159, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 190, @@ -9378,6 +9496,7 @@ func TestPhp7(t *testing.T) { StartPos: 4163, EndPos: 4164, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 190, @@ -9559,6 +9678,7 @@ func TestPhp7(t *testing.T) { StartPos: 4235, EndPos: 4236, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 196, @@ -9592,6 +9712,7 @@ func TestPhp7(t *testing.T) { StartPos: 4243, EndPos: 4244, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 197, @@ -9625,6 +9746,7 @@ func TestPhp7(t *testing.T) { StartPos: 4254, EndPos: 4255, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 198, @@ -9676,6 +9798,7 @@ func TestPhp7(t *testing.T) { StartPos: 4274, EndPos: 4275, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 200, @@ -9727,6 +9850,7 @@ func TestPhp7(t *testing.T) { StartPos: 4292, EndPos: 4293, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 202, @@ -9889,6 +10013,7 @@ func TestPhp7(t *testing.T) { StartPos: 4337, EndPos: 4340, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 206, @@ -9930,6 +10055,7 @@ func TestPhp7(t *testing.T) { StartPos: 4348, EndPos: 4349, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 208, @@ -9963,6 +10089,7 @@ func TestPhp7(t *testing.T) { StartPos: 4356, EndPos: 4357, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 209, @@ -9996,6 +10123,7 @@ func TestPhp7(t *testing.T) { StartPos: 4366, EndPos: 4367, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 210, @@ -10029,6 +10157,7 @@ func TestPhp7(t *testing.T) { StartPos: 4374, EndPos: 4375, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 211, @@ -10062,6 +10191,7 @@ func TestPhp7(t *testing.T) { StartPos: 4389, EndPos: 4390, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 213, @@ -10095,6 +10225,7 @@ func TestPhp7(t *testing.T) { StartPos: 4408, EndPos: 4409, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 214, @@ -10128,6 +10259,7 @@ func TestPhp7(t *testing.T) { StartPos: 4422, EndPos: 4423, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 215, @@ -10161,6 +10293,7 @@ func TestPhp7(t *testing.T) { StartPos: 4441, EndPos: 4442, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 216, @@ -10194,6 +10327,7 @@ func TestPhp7(t *testing.T) { StartPos: 4448, EndPos: 4449, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 218, @@ -10246,6 +10380,7 @@ func TestPhp7(t *testing.T) { StartPos: 4469, EndPos: 4470, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 219, @@ -10298,6 +10433,7 @@ func TestPhp7(t *testing.T) { StartPos: 4500, EndPos: 4501, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 220, @@ -10351,6 +10487,7 @@ func TestPhp7(t *testing.T) { StartPos: 4529, EndPos: 4530, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 222, @@ -10368,6 +10505,7 @@ func TestPhp7(t *testing.T) { StartPos: 4533, EndPos: 4534, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 222, @@ -10417,6 +10555,7 @@ func TestPhp7(t *testing.T) { StartPos: 4545, EndPos: 4546, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 223, @@ -10437,6 +10576,7 @@ func TestPhp7(t *testing.T) { StartPos: 4551, EndPos: 4552, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 223, @@ -10492,6 +10632,7 @@ func TestPhp7(t *testing.T) { StartPos: 4562, EndPos: 4563, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 224, @@ -10513,6 +10654,7 @@ func TestPhp7(t *testing.T) { StartPos: 4570, EndPos: 4571, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 224, @@ -10576,6 +10718,7 @@ func TestPhp7(t *testing.T) { StartPos: 4586, EndPos: 4587, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 225, @@ -10599,6 +10742,7 @@ func TestPhp7(t *testing.T) { StartPos: 4593, EndPos: 4594, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 225, @@ -10632,6 +10776,7 @@ func TestPhp7(t *testing.T) { StartPos: 4600, EndPos: 4601, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 227, @@ -10836,6 +10981,7 @@ func TestPhp7(t *testing.T) { StartPos: 4674, EndPos: 4675, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 231, @@ -10863,6 +11009,7 @@ func TestPhp7(t *testing.T) { StartPos: 4681, EndPos: 4682, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 231, @@ -10901,6 +11048,7 @@ func TestPhp7(t *testing.T) { StartPos: 4697, EndPos: 4698, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 232, @@ -10934,6 +11082,7 @@ func TestPhp7(t *testing.T) { StartPos: 4704, EndPos: 4705, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 233, @@ -10986,6 +11135,7 @@ func TestPhp7(t *testing.T) { StartPos: 4720, EndPos: 4721, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 234, @@ -11151,6 +11301,7 @@ func TestPhp7(t *testing.T) { StartPos: 4763, EndPos: 4764, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 239, @@ -11203,6 +11354,7 @@ func TestPhp7(t *testing.T) { StartPos: 4773, EndPos: 4774, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 241, @@ -11223,6 +11375,7 @@ func TestPhp7(t *testing.T) { StartPos: 4779, EndPos: 4780, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 241, @@ -11278,6 +11431,7 @@ func TestPhp7(t *testing.T) { StartPos: 4786, EndPos: 4787, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 242, @@ -11299,6 +11453,7 @@ func TestPhp7(t *testing.T) { StartPos: 4794, EndPos: 4795, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 242, @@ -11362,6 +11517,7 @@ func TestPhp7(t *testing.T) { StartPos: 4806, EndPos: 4807, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 243, @@ -11385,6 +11541,7 @@ func TestPhp7(t *testing.T) { StartPos: 4813, EndPos: 4814, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 243, @@ -11593,6 +11750,7 @@ func TestPhp7(t *testing.T) { StartPos: 4877, EndPos: 4880, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 247, @@ -11626,6 +11784,7 @@ func TestPhp7(t *testing.T) { StartPos: 4885, EndPos: 4888, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 248, @@ -11643,6 +11802,7 @@ func TestPhp7(t *testing.T) { StartPos: 4891, EndPos: 4894, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 248, @@ -11695,6 +11855,7 @@ func TestPhp7(t *testing.T) { StartPos: 4914, EndPos: 4917, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 249, @@ -11747,6 +11908,7 @@ func TestPhp7(t *testing.T) { StartPos: 4928, EndPos: 4931, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 250, @@ -11780,6 +11942,7 @@ func TestPhp7(t *testing.T) { StartPos: 4936, EndPos: 4937, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 251, @@ -11797,6 +11960,7 @@ func TestPhp7(t *testing.T) { StartPos: 4941, EndPos: 4942, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 251, @@ -11814,6 +11978,7 @@ func TestPhp7(t *testing.T) { StartPos: 4946, EndPos: 4947, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 251, @@ -11847,6 +12012,7 @@ func TestPhp7(t *testing.T) { StartPos: 4952, EndPos: 4953, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 252, @@ -11864,6 +12030,7 @@ func TestPhp7(t *testing.T) { StartPos: 4959, EndPos: 4960, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 252, @@ -11897,6 +12064,7 @@ func TestPhp7(t *testing.T) { StartPos: 4965, EndPos: 4966, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 253, @@ -11921,6 +12089,7 @@ func TestPhp7(t *testing.T) { StartPos: 4970, EndPos: 4971, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 253, @@ -11938,6 +12107,7 @@ func TestPhp7(t *testing.T) { StartPos: 4975, EndPos: 4976, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 253, @@ -11955,6 +12125,7 @@ func TestPhp7(t *testing.T) { StartPos: 4980, EndPos: 4981, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 253, @@ -11973,6 +12144,7 @@ func TestPhp7(t *testing.T) { StartPos: 4985, EndPos: 4986, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 253, @@ -12013,6 +12185,7 @@ func TestPhp7(t *testing.T) { StartPos: 4991, EndPos: 4992, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 254, @@ -12030,6 +12203,7 @@ func TestPhp7(t *testing.T) { StartPos: 4996, EndPos: 4997, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 254, @@ -12047,6 +12221,7 @@ func TestPhp7(t *testing.T) { StartPos: 5001, EndPos: 5002, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 254, @@ -12065,6 +12240,7 @@ func TestPhp7(t *testing.T) { StartPos: 5006, EndPos: 5007, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 254, @@ -12082,6 +12258,7 @@ func TestPhp7(t *testing.T) { StartPos: 5011, EndPos: 5012, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 254, @@ -12115,6 +12292,7 @@ func TestPhp7(t *testing.T) { StartPos: 5018, EndPos: 5019, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 255, @@ -12148,6 +12326,7 @@ func TestPhp7(t *testing.T) { StartPos: 5025, EndPos: 5026, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 256, @@ -12174,6 +12353,7 @@ func TestPhp7(t *testing.T) { StartPos: 5031, EndPos: 5033, }, + StringVar: false, VarName: &expr.Variable{ Position: &position.Position{ StartLine: 257, @@ -12181,6 +12361,7 @@ func TestPhp7(t *testing.T) { StartPos: 5032, EndPos: 5033, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 257, @@ -12230,6 +12411,7 @@ func TestPhp7(t *testing.T) { StartPos: 5053, EndPos: 5054, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 259, @@ -12263,6 +12445,7 @@ func TestPhp7(t *testing.T) { StartPos: 5065, EndPos: 5066, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 260, @@ -12280,6 +12463,7 @@ func TestPhp7(t *testing.T) { StartPos: 5071, EndPos: 5072, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 260, @@ -12313,6 +12497,7 @@ func TestPhp7(t *testing.T) { StartPos: 5088, EndPos: 5089, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 261, @@ -12346,6 +12531,7 @@ func TestPhp7(t *testing.T) { StartPos: 5104, EndPos: 5105, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 263, @@ -12379,6 +12565,7 @@ func TestPhp7(t *testing.T) { StartPos: 5119, EndPos: 5120, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 264, @@ -12412,6 +12599,7 @@ func TestPhp7(t *testing.T) { StartPos: 5131, EndPos: 5132, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 265, @@ -12445,6 +12633,7 @@ func TestPhp7(t *testing.T) { StartPos: 5145, EndPos: 5146, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 266, @@ -12478,6 +12667,7 @@ func TestPhp7(t *testing.T) { StartPos: 5158, EndPos: 5159, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 267, @@ -12511,6 +12701,7 @@ func TestPhp7(t *testing.T) { StartPos: 5173, EndPos: 5174, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 268, @@ -12544,6 +12735,7 @@ func TestPhp7(t *testing.T) { StartPos: 5184, EndPos: 5185, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 269, @@ -12577,6 +12769,7 @@ func TestPhp7(t *testing.T) { StartPos: 5198, EndPos: 5199, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 270, @@ -12610,6 +12803,7 @@ func TestPhp7(t *testing.T) { StartPos: 5212, EndPos: 5213, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 271, @@ -12643,6 +12837,7 @@ func TestPhp7(t *testing.T) { StartPos: 5225, EndPos: 5226, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 272, @@ -12676,6 +12871,7 @@ func TestPhp7(t *testing.T) { StartPos: 5232, EndPos: 5233, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 274, @@ -12693,6 +12889,7 @@ func TestPhp7(t *testing.T) { StartPos: 5237, EndPos: 5238, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 274, @@ -12726,6 +12923,7 @@ func TestPhp7(t *testing.T) { StartPos: 5243, EndPos: 5244, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 275, @@ -12743,6 +12941,7 @@ func TestPhp7(t *testing.T) { StartPos: 5248, EndPos: 5249, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 275, @@ -12776,6 +12975,7 @@ func TestPhp7(t *testing.T) { StartPos: 5254, EndPos: 5255, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 276, @@ -12793,6 +12993,7 @@ func TestPhp7(t *testing.T) { StartPos: 5259, EndPos: 5260, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 276, @@ -12826,6 +13027,7 @@ func TestPhp7(t *testing.T) { StartPos: 5265, EndPos: 5266, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 277, @@ -12843,6 +13045,7 @@ func TestPhp7(t *testing.T) { StartPos: 5271, EndPos: 5272, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 277, @@ -12876,6 +13079,7 @@ func TestPhp7(t *testing.T) { StartPos: 5277, EndPos: 5278, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 278, @@ -12893,6 +13097,7 @@ func TestPhp7(t *testing.T) { StartPos: 5283, EndPos: 5284, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 278, @@ -12926,6 +13131,7 @@ func TestPhp7(t *testing.T) { StartPos: 5289, EndPos: 5290, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 279, @@ -12943,6 +13149,7 @@ func TestPhp7(t *testing.T) { StartPos: 5295, EndPos: 5296, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 279, @@ -12976,6 +13183,7 @@ func TestPhp7(t *testing.T) { StartPos: 5301, EndPos: 5302, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 280, @@ -12993,6 +13201,7 @@ func TestPhp7(t *testing.T) { StartPos: 5306, EndPos: 5307, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 280, @@ -13026,6 +13235,7 @@ func TestPhp7(t *testing.T) { StartPos: 5312, EndPos: 5313, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 281, @@ -13043,6 +13253,7 @@ func TestPhp7(t *testing.T) { StartPos: 5317, EndPos: 5318, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 281, @@ -13076,6 +13287,7 @@ func TestPhp7(t *testing.T) { StartPos: 5323, EndPos: 5324, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 282, @@ -13093,6 +13305,7 @@ func TestPhp7(t *testing.T) { StartPos: 5329, EndPos: 5330, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 282, @@ -13126,6 +13339,7 @@ func TestPhp7(t *testing.T) { StartPos: 5335, EndPos: 5336, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 283, @@ -13143,6 +13357,7 @@ func TestPhp7(t *testing.T) { StartPos: 5341, EndPos: 5342, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 283, @@ -13176,6 +13391,7 @@ func TestPhp7(t *testing.T) { StartPos: 5347, EndPos: 5348, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 284, @@ -13193,6 +13409,7 @@ func TestPhp7(t *testing.T) { StartPos: 5352, EndPos: 5353, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 284, @@ -13226,6 +13443,7 @@ func TestPhp7(t *testing.T) { StartPos: 5358, EndPos: 5359, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 285, @@ -13243,6 +13461,7 @@ func TestPhp7(t *testing.T) { StartPos: 5365, EndPos: 5366, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 285, @@ -13276,6 +13495,7 @@ func TestPhp7(t *testing.T) { StartPos: 5371, EndPos: 5372, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 286, @@ -13293,6 +13513,7 @@ func TestPhp7(t *testing.T) { StartPos: 5378, EndPos: 5379, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 286, @@ -13326,6 +13547,7 @@ func TestPhp7(t *testing.T) { StartPos: 5384, EndPos: 5385, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 287, @@ -13343,6 +13565,7 @@ func TestPhp7(t *testing.T) { StartPos: 5390, EndPos: 5391, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 287, @@ -13376,6 +13599,7 @@ func TestPhp7(t *testing.T) { StartPos: 5396, EndPos: 5397, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 288, @@ -13393,6 +13617,7 @@ func TestPhp7(t *testing.T) { StartPos: 5403, EndPos: 5404, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 288, @@ -13426,6 +13651,7 @@ func TestPhp7(t *testing.T) { StartPos: 5409, EndPos: 5410, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 289, @@ -13443,6 +13669,7 @@ func TestPhp7(t *testing.T) { StartPos: 5414, EndPos: 5415, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 289, @@ -13476,6 +13703,7 @@ func TestPhp7(t *testing.T) { StartPos: 5420, EndPos: 5421, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 290, @@ -13493,6 +13721,7 @@ func TestPhp7(t *testing.T) { StartPos: 5425, EndPos: 5426, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 290, @@ -13526,6 +13755,7 @@ func TestPhp7(t *testing.T) { StartPos: 5431, EndPos: 5432, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 291, @@ -13543,6 +13773,7 @@ func TestPhp7(t *testing.T) { StartPos: 5436, EndPos: 5437, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 291, @@ -13576,6 +13807,7 @@ func TestPhp7(t *testing.T) { StartPos: 5442, EndPos: 5443, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 292, @@ -13593,6 +13825,7 @@ func TestPhp7(t *testing.T) { StartPos: 5448, EndPos: 5449, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 292, @@ -13626,6 +13859,7 @@ func TestPhp7(t *testing.T) { StartPos: 5454, EndPos: 5455, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 293, @@ -13643,6 +13877,7 @@ func TestPhp7(t *testing.T) { StartPos: 5461, EndPos: 5462, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 293, @@ -13676,6 +13911,7 @@ func TestPhp7(t *testing.T) { StartPos: 5467, EndPos: 5468, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 294, @@ -13693,6 +13929,7 @@ func TestPhp7(t *testing.T) { StartPos: 5472, EndPos: 5473, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 294, @@ -13726,6 +13963,7 @@ func TestPhp7(t *testing.T) { StartPos: 5478, EndPos: 5479, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 295, @@ -13743,6 +13981,7 @@ func TestPhp7(t *testing.T) { StartPos: 5484, EndPos: 5485, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 295, @@ -13776,6 +14015,7 @@ func TestPhp7(t *testing.T) { StartPos: 5490, EndPos: 5491, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 296, @@ -13793,6 +14033,7 @@ func TestPhp7(t *testing.T) { StartPos: 5496, EndPos: 5497, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 296, @@ -13826,6 +14067,7 @@ func TestPhp7(t *testing.T) { StartPos: 5502, EndPos: 5503, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 297, @@ -13843,6 +14085,7 @@ func TestPhp7(t *testing.T) { StartPos: 5508, EndPos: 5509, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 297, @@ -13876,6 +14119,7 @@ func TestPhp7(t *testing.T) { StartPos: 5514, EndPos: 5515, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 298, @@ -13893,6 +14137,7 @@ func TestPhp7(t *testing.T) { StartPos: 5520, EndPos: 5521, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 298, @@ -13926,6 +14171,7 @@ func TestPhp7(t *testing.T) { StartPos: 5526, EndPos: 5527, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 299, @@ -13943,6 +14189,7 @@ func TestPhp7(t *testing.T) { StartPos: 5531, EndPos: 5532, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 299, @@ -13976,6 +14223,7 @@ func TestPhp7(t *testing.T) { StartPos: 5537, EndPos: 5538, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 300, @@ -13993,6 +14241,7 @@ func TestPhp7(t *testing.T) { StartPos: 5544, EndPos: 5545, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 300, @@ -14026,6 +14275,7 @@ func TestPhp7(t *testing.T) { StartPos: 5551, EndPos: 5552, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 302, @@ -14043,6 +14293,7 @@ func TestPhp7(t *testing.T) { StartPos: 5557, EndPos: 5558, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 302, @@ -14076,6 +14327,7 @@ func TestPhp7(t *testing.T) { StartPos: 5563, EndPos: 5564, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 303, @@ -14093,6 +14345,7 @@ func TestPhp7(t *testing.T) { StartPos: 5568, EndPos: 5569, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 303, @@ -14126,6 +14379,7 @@ func TestPhp7(t *testing.T) { StartPos: 5574, EndPos: 5575, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 304, @@ -14143,6 +14397,7 @@ func TestPhp7(t *testing.T) { StartPos: 5580, EndPos: 5581, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 304, @@ -14176,6 +14431,7 @@ func TestPhp7(t *testing.T) { StartPos: 5586, EndPos: 5587, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 305, @@ -14193,6 +14449,7 @@ func TestPhp7(t *testing.T) { StartPos: 5592, EndPos: 5593, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 305, @@ -14226,6 +14483,7 @@ func TestPhp7(t *testing.T) { StartPos: 5598, EndPos: 5599, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 306, @@ -14243,6 +14501,7 @@ func TestPhp7(t *testing.T) { StartPos: 5604, EndPos: 5605, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 306, @@ -14276,6 +14535,7 @@ func TestPhp7(t *testing.T) { StartPos: 5610, EndPos: 5611, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 307, @@ -14293,6 +14553,7 @@ func TestPhp7(t *testing.T) { StartPos: 5616, EndPos: 5617, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 307, @@ -14326,6 +14587,7 @@ func TestPhp7(t *testing.T) { StartPos: 5622, EndPos: 5623, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 308, @@ -14343,6 +14605,7 @@ func TestPhp7(t *testing.T) { StartPos: 5628, EndPos: 5629, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 308, @@ -14376,6 +14639,7 @@ func TestPhp7(t *testing.T) { StartPos: 5634, EndPos: 5635, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 309, @@ -14393,6 +14657,7 @@ func TestPhp7(t *testing.T) { StartPos: 5640, EndPos: 5641, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 309, @@ -14426,6 +14691,7 @@ func TestPhp7(t *testing.T) { StartPos: 5646, EndPos: 5647, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 310, @@ -14443,6 +14709,7 @@ func TestPhp7(t *testing.T) { StartPos: 5652, EndPos: 5653, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 310, @@ -14476,6 +14743,7 @@ func TestPhp7(t *testing.T) { StartPos: 5658, EndPos: 5659, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 311, @@ -14493,6 +14761,7 @@ func TestPhp7(t *testing.T) { StartPos: 5664, EndPos: 5665, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 311, @@ -14526,6 +14795,7 @@ func TestPhp7(t *testing.T) { StartPos: 5670, EndPos: 5671, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 312, @@ -14543,6 +14813,7 @@ func TestPhp7(t *testing.T) { StartPos: 5676, EndPos: 5677, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 312, @@ -14576,6 +14847,7 @@ func TestPhp7(t *testing.T) { StartPos: 5682, EndPos: 5683, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 313, @@ -14593,6 +14865,7 @@ func TestPhp7(t *testing.T) { StartPos: 5689, EndPos: 5690, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 313, @@ -14626,6 +14899,7 @@ func TestPhp7(t *testing.T) { StartPos: 5695, EndPos: 5696, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 314, @@ -14643,6 +14917,7 @@ func TestPhp7(t *testing.T) { StartPos: 5702, EndPos: 5703, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 314, @@ -14676,6 +14951,7 @@ func TestPhp7(t *testing.T) { StartPos: 5708, EndPos: 5709, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 315, @@ -14693,6 +14969,7 @@ func TestPhp7(t *testing.T) { StartPos: 5715, EndPos: 5716, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 315, @@ -14730,8 +15007,8 @@ func TestPhp7(t *testing.T) { StartPos: 5733, EndPos: 5758, }, - PhpDocComment: "", ReturnsRef: false, + PhpDocComment: "", MethodName: &node.Identifier{ Position: &position.Position{ StartLine: 317, @@ -14823,8 +15100,8 @@ func TestPhp7(t *testing.T) { StartPos: 5779, EndPos: 5905, }, - PhpDocComment: "", ReturnsRef: false, + PhpDocComment: "", FunctionName: &node.Identifier{ Position: &position.Position{ StartLine: 320, @@ -14842,8 +15119,8 @@ func TestPhp7(t *testing.T) { StartPos: 5792, EndPos: 5794, }, - Variadic: false, ByRef: true, + Variadic: false, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 320, @@ -14851,6 +15128,7 @@ func TestPhp7(t *testing.T) { StartPos: 5793, EndPos: 5794, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 320, @@ -14869,8 +15147,8 @@ func TestPhp7(t *testing.T) { StartPos: 5797, EndPos: 5801, }, - ByRef: false, Variadic: true, + ByRef: false, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 320, @@ -14878,6 +15156,7 @@ func TestPhp7(t *testing.T) { StartPos: 5800, EndPos: 5801, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 320, @@ -14906,8 +15185,8 @@ func TestPhp7(t *testing.T) { StartPos: 5831, EndPos: 5847, }, - PhpDocComment: "", ReturnsRef: false, + PhpDocComment: "", FunctionName: &node.Identifier{ Position: &position.Position{ StartLine: 322, @@ -15013,6 +15292,7 @@ func TestPhp7(t *testing.T) { StartPos: 5926, EndPos: 5927, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 328, @@ -15049,6 +15329,7 @@ func TestPhp7(t *testing.T) { StartPos: 5937, EndPos: 5938, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 328, @@ -15076,8 +15357,8 @@ func TestPhp7(t *testing.T) { StartPos: 5945, EndPos: 5950, }, - ByRef: false, Variadic: false, + ByRef: false, Variable: &expr.Variable{ Position: &position.Position{ StartLine: 328, @@ -15085,6 +15366,7 @@ func TestPhp7(t *testing.T) { StartPos: 5945, EndPos: 5946, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 328, @@ -15115,8 +15397,8 @@ func TestPhp7(t *testing.T) { StartPos: 5958, EndPos: 5995, }, - ReturnsRef: false, PhpDocComment: "", + ReturnsRef: false, FunctionName: &node.Identifier{ Position: &position.Position{ StartLine: 329, @@ -15152,6 +15434,7 @@ func TestPhp7(t *testing.T) { StartPos: 5977, EndPos: 5978, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 329, @@ -15188,6 +15471,7 @@ func TestPhp7(t *testing.T) { StartPos: 5990, EndPos: 5991, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 329, @@ -15247,8 +15531,8 @@ func TestPhp7(t *testing.T) { StartPos: 6026, EndPos: 6066, }, - PhpDocComment: "", ReturnsRef: false, + PhpDocComment: "", MethodName: &node.Identifier{ Position: &position.Position{ StartLine: 330, @@ -15492,6 +15776,7 @@ func TestPhp7(t *testing.T) { StartPos: 6139, EndPos: 6142, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 334, @@ -15681,6 +15966,7 @@ func TestPhp7(t *testing.T) { StartPos: 6180, EndPos: 6183, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 337, @@ -15716,6 +16002,7 @@ func TestPhp7(t *testing.T) { StartPos: 6191, EndPos: 6198, }, + StringVar: false, VarName: &expr.FunctionCall{ Position: &position.Position{ StartLine: 338, @@ -15793,6 +16080,7 @@ func TestPhp7(t *testing.T) { StartPos: 6209, EndPos: 6212, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 340, @@ -15860,6 +16148,7 @@ func TestPhp7(t *testing.T) { StartPos: 6225, EndPos: 6228, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 341, @@ -15911,6 +16200,7 @@ func TestPhp7(t *testing.T) { StartPos: 6242, EndPos: 6245, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 343, @@ -15928,6 +16218,7 @@ func TestPhp7(t *testing.T) { StartPos: 6248, EndPos: 6251, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 343, @@ -15961,6 +16252,7 @@ func TestPhp7(t *testing.T) { StartPos: 6256, EndPos: 6259, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 344, @@ -15985,6 +16277,7 @@ func TestPhp7(t *testing.T) { StartPos: 6263, EndPos: 6266, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 344, @@ -16052,6 +16345,7 @@ func TestPhp7(t *testing.T) { StartPos: 6281, EndPos: 6282, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 346, @@ -16102,6 +16396,7 @@ func TestPhp7(t *testing.T) { StartPos: 6293, EndPos: 6294, }, + StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 346, diff --git a/printer/pretty_printer.go b/printer/pretty_printer.go index 9331b74..b8f0d29 100644 --- a/printer/pretty_printer.go +++ b/printer/pretty_printer.go @@ -1319,8 +1319,9 @@ func (p *PrettyPrinter) printExprUnaryPlus(n node.Node) { } func (p *PrettyPrinter) printExprVariable(n node.Node) { + nn := n.(*expr.Variable) io.WriteString(p.w, "$") - p.Print(n.(*expr.Variable).VarName) + p.Print(nn.VarName) } func (p *PrettyPrinter) printExprYieldFrom(n node.Node) { diff --git a/printer/printer.go b/printer/printer.go index 26febed..9fe4ec9 100644 --- a/printer/printer.go +++ b/printer/printer.go @@ -48,16 +48,21 @@ func (p *Printer) printNodes(nn []node.Node) { } } -func (p *Printer) printMeta(n node.Node, tn meta.TokenName) { +func (p *Printer) printMeta(n node.Node, tn meta.TokenName) bool { if n == nil { - return + return false } - for _, m := range n.GetMeta() { - if m.GetTokenName() == tn { + r := false + + for _, m := range *n.GetMeta() { + if m.TokenName == tn { io.WriteString(p.w, m.String()) + r = true } } + + return r } func (p *Printer) printNode(n node.Node) { @@ -76,7 +81,7 @@ func (p *Printer) printNode(n node.Node) { case *node.Argument: p.printNodeArgument(n) - // name + // name case *name.NamePart: p.printNameNamePart(n) @@ -87,7 +92,7 @@ func (p *Printer) printNode(n node.Node) { case *name.Relative: p.printNameRelative(n) - // scalar + // scalar case *scalar.Lnumber: p.printScalarLNumber(n) @@ -104,7 +109,7 @@ func (p *Printer) printNode(n node.Node) { case *scalar.MagicConstant: p.printScalarMagicConstant(n) - // assign + // assign case *assign.Assign: p.printAssign(n) @@ -135,7 +140,7 @@ func (p *Printer) printNode(n node.Node) { case *assign.ShiftRight: p.printAssignShiftRight(n) - // binary + // binary case *binary.BitwiseAnd: p.printBinaryBitwiseAnd(n) @@ -192,7 +197,7 @@ func (p *Printer) printNode(n node.Node) { case *binary.Spaceship: p.printBinarySpaceship(n) - // cast + // cast case *cast.Array: p.printArray(n) @@ -209,7 +214,7 @@ func (p *Printer) printNode(n node.Node) { case *cast.Unset: p.printUnset(n) - // expr + // expr case *expr.ArrayDimFetch: p.printExprArrayDimFetch(n) @@ -296,7 +301,7 @@ func (p *Printer) printNode(n node.Node) { case *expr.Yield: p.printExprYield(n) - // stmt + // stmt case *stmt.AltElseIf: p.printStmtAltElseIf(n) @@ -324,6 +329,8 @@ func (p *Printer) printNode(n node.Node) { p.printStmtClass(n) case *stmt.ClassConstList: p.printStmtClassConstList(n) + case *stmt.ConstList: + p.printStmtConstList(n) case *stmt.Constant: p.printStmtConstant(n) case *stmt.Continue: @@ -415,22 +422,23 @@ func (p *Printer) printNodeRoot(n node.Node) { nn := n.(*node.Root) p.printMeta(nn, meta.NodeStart) - var stmts []node.Node + // var stmts []node.Node - if len(nn.Stmts) > 0 { - firstStmt := nn.Stmts[0] - stmts = nn.Stmts[1:] + // if len(nn.Stmts) > 0 { + // firstStmt := nn.Stmts[0] + // stmts = nn.Stmts[1:] - switch fs := firstStmt.(type) { - case *stmt.InlineHtml: - io.WriteString(p.w, fs.Value) - io.WriteString(p.w, " 0 { p.printNodes(nn.Stmts) @@ -2135,17 +2123,20 @@ func (p *Printer) printStmtClass(n node.Node) { p.printMeta(nn.ArgumentList, meta.OpenParenthesisToken) io.WriteString(p.w, "(") p.joinPrint(",", nn.ArgumentList.Arguments) + p.printMeta(nn.ArgumentList, meta.CommaToken) p.printMeta(nn.ArgumentList, meta.CloseParenthesisToken) io.WriteString(p.w, ")") } if nn.Extends != nil { + p.printMeta(nn.Extends, meta.NodeStart) p.printMeta(nn.Extends, meta.ExtendsToken) io.WriteString(p.w, "extends") p.Print(nn.Extends.ClassName) } if nn.Implements != nil { + p.printMeta(nn.Implements, meta.NodeStart) p.printMeta(nn.Implements, meta.ImplementsToken) io.WriteString(p.w, "implements") p.joinPrint(",", nn.Implements.InterfaceNames) @@ -2173,7 +2164,20 @@ func (p *Printer) printStmtClassConstList(n node.Node) { p.joinPrint(",", nn.Consts) p.printMeta(nn, meta.SemiColonToken) - io.WriteString(p.w, ";") + + p.printMeta(nn, meta.NodeEnd) +} + +func (p *Printer) printStmtConstList(n node.Node) { + nn := n.(*stmt.ConstList) + p.printMeta(nn, meta.NodeStart) + + p.printMeta(nn, meta.ConstToken) + io.WriteString(p.w, "const") + + p.joinPrint(",", nn.Consts) + + p.printMeta(nn, meta.SemiColonToken) p.printMeta(nn, meta.NodeEnd) } @@ -2198,15 +2202,10 @@ func (p *Printer) printStmtContinue(n node.Node) { io.WriteString(p.w, "continue") if nn.Expr != nil { - p.printMeta(nn.Expr, meta.OpenParenthesisToken) - io.WriteString(p.w, "(") p.Print(nn.Expr) - p.printMeta(nn.Expr, meta.CloseParenthesisToken) - io.WriteString(p.w, ")") } p.printMeta(nn, meta.SemiColonToken) - io.WriteString(p.w, ";") p.printMeta(nn, meta.NodeEnd) } @@ -2223,7 +2222,20 @@ func (p *Printer) printStmtDeclare(n node.Node) { p.printMeta(nn, meta.CloseParenthesisToken) io.WriteString(p.w, ")") - p.Print(nn.Stmt) + if nn.Alt { + p.printMeta(nn, meta.ColonToken) + io.WriteString(p.w, ":") + + s := nn.Stmt.(*stmt.StmtList) + p.printNodes(s.Stmts) + + p.printMeta(nn, meta.EnddeclareToken) + io.WriteString(p.w, "enddeclare") + p.printMeta(nn, meta.SemiColonToken) + + } else { + p.Print(nn.Stmt) + } p.printMeta(nn, meta.NodeEnd) } @@ -2234,8 +2246,10 @@ func (p *Printer) printStmtDefault(n node.Node) { p.printMeta(nn, meta.DefaultToken) io.WriteString(p.w, "default") - p.printMeta(nn, meta.CaseSeparatorToken) - io.WriteString(p.w, ":") + r := p.printMeta(nn, meta.CaseSeparatorToken) + if !r { + io.WriteString(p.w, ":") + } if len(nn.Stmts) > 0 { p.printNodes(nn.Stmts) @@ -2261,7 +2275,6 @@ func (p *Printer) printStmtDo(n node.Node) { p.printMeta(nn, meta.CloseParenthesisToken) io.WriteString(p.w, ")") p.printMeta(nn, meta.SemiColonToken) - io.WriteString(p.w, ";") p.printMeta(nn, meta.NodeEnd) } @@ -2271,10 +2284,8 @@ func (p *Printer) printStmtEcho(n node.Node) { p.printMeta(nn, meta.NodeStart) p.printMeta(nn, meta.EchoToken) - io.WriteString(p.w, "echo") p.joinPrint(",", nn.Exprs) p.printMeta(nn, meta.SemiColonToken) - io.WriteString(p.w, ";") p.printMeta(nn, meta.NodeEnd) } @@ -2315,7 +2326,6 @@ func (p *Printer) printStmtExpression(n node.Node) { p.Print(nn.Expr) p.printMeta(nn, meta.SemiColonToken) - io.WriteString(p.w, ";") p.printMeta(nn, meta.NodeEnd) } @@ -2428,7 +2438,6 @@ func (p *Printer) printStmtGlobal(n node.Node) { io.WriteString(p.w, "global") p.joinPrint(",", nn.Vars) p.printMeta(nn, meta.SemiColonToken) - io.WriteString(p.w, ";") p.printMeta(nn, meta.NodeEnd) } @@ -2441,7 +2450,6 @@ func (p *Printer) printStmtGoto(n node.Node) { io.WriteString(p.w, "goto") p.Print(nn.Label) p.printMeta(nn, meta.SemiColonToken) - io.WriteString(p.w, ";") p.printMeta(nn, meta.NodeEnd) } @@ -2457,16 +2465,17 @@ func (p *Printer) printStmtGroupUse(n node.Node) { p.Print(nn.UseType) } + p.printMeta(nn, meta.UseLeadingNsSeparatorToken) p.Print(nn.Prefix) p.printMeta(nn, meta.NsSeparatorToken) io.WriteString(p.w, "\\") p.printMeta(nn, meta.OpenCurlyBracesToken) io.WriteString(p.w, "{") p.joinPrint(",", nn.UseList) + p.printMeta(nn, meta.CommaToken) p.printMeta(nn, meta.CloseCurlyBracesToken) io.WriteString(p.w, "}") p.printMeta(nn, meta.SemiColonToken) - io.WriteString(p.w, ";") p.printMeta(nn, meta.NodeEnd) } @@ -2482,7 +2491,6 @@ func (p *Printer) printStmtHaltCompiler(n node.Node) { p.printMeta(n, meta.CloseParenthesisToken) io.WriteString(p.w, ")") p.printMeta(n, meta.SemiColonToken) - io.WriteString(p.w, ";") p.printMeta(nn, meta.NodeEnd) } @@ -2517,9 +2525,9 @@ func (p *Printer) printStmtInlineHTML(n node.Node) { p.printMeta(nn, meta.NodeStart) p.printMeta(n, meta.InlineHTMLToken) - io.WriteString(p.w, "?>") + // io.WriteString(p.w, "?>") io.WriteString(p.w, nn.Value) - io.WriteString(p.w, "Hello + >= $b ; + ` + + actual := printPhp5(parsePhp5(src)) + + if src != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", src, actual) + } +} + +// test binary + +func TestParseAndPrintPhp5Binary(t *testing.T) { + src := `= $b ; + $a > $b ; + $a === $b ; + $a and $b ; + $a or $b ; + $a xor $b ; + $a - $b ; + $a % $b ; + $a * $b ; + $a != $b ; + $a <> $b ; + $a !== $b ; + $a + $b ; + $a ** $b ; + $a << $b ; + $a >> $b ; + $a <= $b ; + $a < $b ; + ` + + actual := printPhp5(parsePhp5(src)) + + if src != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", src, actual) + } +} + +// test cast + +func TestParseAndPrintPhp5Cast(t *testing.T) { + src := ` $world , + ] ; + ` + + actual := printPhp5(parsePhp5(src)) + + if src != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", src, actual) + } +} + +func TestParseAndPrintPhp5Array(t *testing.T) { + src := ` 2 ) ; + ` + + actual := printPhp5(parsePhp5(src)) + + if src != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", src, actual) + } +} + +func TestParseAndPrintPhp5BitwiseNot(t *testing.T) { + src := ` bar ( $arg ) ;` + + actual := printPhp5(parsePhp5(src)) + + if src != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", src, actual) + } +} + +func TestParseAndPrintPhp5New(t *testing.T) { + src := ` b ;` + + actual := printPhp5(parsePhp5(src)) + + if src != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", src, actual) + } +} + +func TestParseAndPrintPhp5Reference(t *testing.T) { + src := ` & $c ] ; + + $a = function ( ) use ( & $b ) { + // do nothing + } ; + + foreach ( $a as & $b ) { + // do nothing + }` + + actual := printPhp5(parsePhp5(src)) + + if src != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", src, actual) + } +} + +func TestParseAndPrintPhp5Require(t *testing.T) { + + src := ` & $b , // one + $c , /* two */ + ] ; + $a = [0, 1, 2] ;` + + actual := printPhp5(parsePhp5(src)) + + if src != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", src, actual) + } +} + +func TestParseAndPrintPhp5StaticCall(t *testing.T) { + src := ` $v ;` + + actual := printPhp5(parsePhp5(src)) + + if src != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", src, actual) + } +} + +// test stmt + +func TestParseAndPrintPhp5AltIf(t *testing.T) { + src := ` & $v ) : + echo $v ; + endforeach ;` + + actual := printPhp5(parsePhp5(src)) + + if src != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", src, actual) + } +} + +func TestParseAndPrintPhp5AltSwitch(t *testing.T) { + src := ` + + + & $v ) { + ; + }` + + actual := printPhp5(parsePhp5(src)) + + if src != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", src, actual) + } +} + +func TestParseAndPrintPhp5Function(t *testing.T) { + + src := `test call ( ) ; + $a -> { $b . 'b' } ; + $a -> $b ( ) -> { $c . 'c' } ; + ` + + actual := printPhp5(parsePhp5(src)) + + if src != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", src, actual) + } +} + +func TestParseAndPrintPhp5ComplexString1(t *testing.T) { + src := `bar" ; + ` + + actual := printPhp5(parsePhp5(src)) + + if src != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", src, actual) + } +} + +func TestParseAndPrintPhp5ComplexString2(t *testing.T) { + src := ` bar }" ; + "test ${ $foo -> bar ( ) }" ; + "test ${ $a . '' }" ; + ` + + actual := printPhp5(parsePhp5(src)) + + if src != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", src, actual) + } +} + +func TestParseAndPrintPhp5ComplexString3(t *testing.T) { + src := ` bar }" ; + "test {$foo -> bar ( ) }" ; + ` + + actual := printPhp5(parsePhp5(src)) + + if src != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", src, actual) + } +} diff --git a/printer/printer_parsed_test.go b/printer/printer_parsed_php7_test.go similarity index 54% rename from printer/printer_parsed_test.go rename to printer/printer_parsed_php7_test.go index 5e7858c..06bd502 100644 --- a/printer/printer_parsed_test.go +++ b/printer/printer_parsed_php7_test.go @@ -35,7 +35,7 @@ abstract class Bar extends Baz rootNode := php7parser.GetRootNode() - // change + // change namespace parts := &rootNode.(*node.Root).Stmts[0].(*stmt.Namespace).NamespaceName.(*name.Name).Parts *parts = append(*parts, &name.NamePart{Value: "Quuz"}) @@ -77,40 +77,13 @@ func print(n node.Node) string { return o.String() } +// test node + func TestParseAndPrintRoot(t *testing.T) { - src := `Hello + Hello - bar ( ' ' ) ; - } elseif ( isset ( $b [ 2 ] ) ) - list( , $c , ) = $b; - else if ( 1 ); - else { - echo '' ; - }` + __CLASS__ ; + __DIR__ ; + __FILE__ ; + __FUNCTION__ ; + __LINE__ ; + __NAMESPACE__ ; + __METHOD__ ; + __TRAIT__ ; + ` + + actual := print(parse(src)) + + if src != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", src, actual) + } +} + +func TestParseAndPrintNumber(t *testing.T) { + src := `>= $b ; + ` + + actual := print(parse(src)) + + if src != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", src, actual) + } +} + +// test binary + +func TestParseAndPrintBinary(t *testing.T) { + src := `= $b ; + $a > $b ; + $a === $b ; + $a and $b ; + $a or $b ; + $a xor $b ; + $a - $b ; + $a % $b ; + $a * $b ; + $a != $b ; + $a <> $b ; + $a !== $b ; + $a + $b ; + $a ** $b ; + $a << $b ; + $a >> $b ; + $a <= $b ; + $a < $b ; + $a <=> $b ; + ` + + actual := print(parse(src)) + + if src != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", src, actual) + } +} + +// test cast + +func TestParseAndPrintCast(t *testing.T) { + src := ` $world , + ] ; + ` + + actual := print(parse(src)) + + if src != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", src, actual) + } +} + +func TestParseAndPrintArray(t *testing.T) { + src := ` 2 ) ; + ` + + actual := print(parse(src)) + + if src != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", src, actual) + } +} + +func TestParseAndPrintBitwiseNot(t *testing.T) { + src := ` bar ( $arg , ) ;` actual := print(parse(src)) @@ -231,9 +648,9 @@ func TestParseAndPrintIncDec(t *testing.T) { } } -func TestParseAndPrintPropertyFetchPrint(t *testing.T) { +func TestParseAndPrintPrint(t *testing.T) { src := ` b ; + print $a ; print ( $a ) ;` actual := print(parse(src)) @@ -243,10 +660,29 @@ func TestParseAndPrintPropertyFetchPrint(t *testing.T) { } } -func TestParseAndPrintForeachReferenceShellExec(t *testing.T) { +func TestParseAndPrintPropertyFetch(t *testing.T) { src := ` & $v ) { - ` + "` {$v} cmd `" + ` ; + $a -> b ;` + + actual := print(parse(src)) + + if src != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", src, actual) + } +} + +func TestParseAndPrintReference(t *testing.T) { + src := ` & $c ] ; + + $a = function ( ) use ( & $b ) { + // do nothing + } ; + + foreach ( $a as & $b ) { + // do nothing }` actual := print(parse(src)) @@ -256,10 +692,11 @@ func TestParseAndPrintForeachReferenceShellExec(t *testing.T) { } } -func TestParseAndPrintShortListShortArray(t *testing.T) { +func TestParseAndPrintRequire(t *testing.T) { + src := ` & $b , // one + $c , /* two */ + ] ; + $a = [0, 1, 2] ;` + + actual := print(parse(src)) + + if src != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", src, actual) + } +} + +func TestParseAndPrintShortList(t *testing.T) { + src := ` + + + & $v ) { + ; + }` + + actual := print(parse(src)) + + if src != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", src, actual) + } +} + +func TestParseAndPrintFunction(t *testing.T) { + + src := `testtest call ( ) ; + $a -> { $b . 'b' } ; ` actual := print(parse(src)) @@ -709,11 +1445,13 @@ func TestParseAndPrintDoWhile(t *testing.T) { } } -func TestParseAndPrintNames(t *testing.T) { +func TestParseAndPrintComplexString1(t *testing.T) { src := `bar" ; ` actual := print(parse(src)) @@ -723,13 +1461,19 @@ func TestParseAndPrintNames(t *testing.T) { } } -func TestParseAndPrintScalar(t *testing.T) { +func TestParseAndPrintComplexString2(t *testing.T) { src := ` bar }" ; + "test ${ $foo -> bar ( ) }" ; + "test ${ $a . '' }" ; ` actual := print(parse(src)) @@ -739,227 +1483,13 @@ func TestParseAndPrintScalar(t *testing.T) { } } -func TestParseAndPrintHeredoc(t *testing.T) { +func TestParseAndPrintComplexString3(t *testing.T) { src := `>= $b ; - ` - - actual := print(parse(src)) - - if src != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", src, actual) - } -} - -func TestParseAndPrintBinary(t *testing.T) { - src := `= $b ; - $a > $b ; - $a === $b ; - $a and $b ; - $a or $b ; - $a xor $b ; - $a - $b ; - $a % $b ; - $a * $b ; - $a != $b ; - $a !== $b ; - $a + $b ; - $a ** $b ; - $a << $b ; - $a >> $b ; - $a <= $b ; - $a < $b ; - $a <=> $b ; - ` - - actual := print(parse(src)) - - if src != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", src, actual) - } -} - -func TestParseAndPrintUnary(t *testing.T) { - src := ` 2 ] ; - $a = array( 0 , 2 => 2 ) ; - ` - - actual := print(parse(src)) - - if src != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", src, actual) - } -} - -func TestParseAndPrintClassConstFetch(t *testing.T) { - src := ` bar }" ; + "test {$foo -> bar ( ) }" ; ` actual := print(parse(src)) diff --git a/printer/printer_test.go b/printer/printer_test.go index 2f3e097..6c55f34 100644 --- a/printer/printer_test.go +++ b/printer/printer_test.go @@ -63,7 +63,7 @@ func TestPrinterPrintFile(t *testing.T) { }, }) - expected := `HTML"}, &stmt.Expression{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "HTMLHTML&$val ) :$d; endforeach ;` + expected := ` foreach ($var as$key =>&$val ) :$d endforeach ` actual := o.String() if expected != actual { @@ -3367,31 +3634,42 @@ func TestPrinterPrintAltIf(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.AltIf{ - Meta: []meta.Meta{ - &meta.WhiteSpace{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.IfToken, }, - &meta.WhiteSpace{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.OpenParenthesisToken, }, - &meta.WhiteSpace{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.CloseParenthesisToken, }, - &meta.WhiteSpace{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.ColonToken, }, - &meta.WhiteSpace{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.EndifToken, }, - &meta.WhiteSpace{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.SemiColonToken, }, + &meta.Data{ + Type: meta.TokenType, + Value: "", + TokenName: meta.SemiColonToken, + }, }, Cond: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, Stmt: &stmt.StmtList{ @@ -3422,7 +3700,7 @@ func TestPrinterPrintAltIf(t *testing.T) { }, }) - expected := ` if ($a ) :$d;elseif($b):$b;elseif($c):else:$b; endif ;` + expected := ` if ($a ) :$delseif($b):$belseif($c):else:$b endif ` actual := o.String() if expected != actual { @@ -3435,35 +3713,42 @@ func TestPrinterPrintStmtAltSwitch(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.AltSwitch{ - Meta: []meta.Meta{ - &meta.WhiteSpace{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.SwitchToken, }, - &meta.WhiteSpace{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.OpenParenthesisToken, }, - &meta.WhiteSpace{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.CloseParenthesisToken, }, - &meta.WhiteSpace{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.ColonToken, }, - &meta.WhiteSpace{ - Value: " ", - TokenName: meta.SwitchSemicolonToken, - }, - &meta.WhiteSpace{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.EndswitchToken, }, - &meta.WhiteSpace{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.SemiColonToken, }, + &meta.Data{ + Type: meta.TokenType, + Value: "", + TokenName: meta.SemiColonToken, + }, }, Cond: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, CaseList: &stmt.CaseList{ @@ -3484,7 +3769,7 @@ func TestPrinterPrintStmtAltSwitch(t *testing.T) { }, }) - expected := ` switch ($var ) : ;case'a':$a;case'b':$b; endswitch ;` + expected := ` switch ($var ) :case'a':$acase'b':$b endswitch ` actual := o.String() if expected != actual { @@ -3497,31 +3782,42 @@ func TestPrinterPrintAltWhile(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.AltWhile{ - Meta: []meta.Meta{ - &meta.WhiteSpace{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.WhileToken, }, - &meta.WhiteSpace{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.OpenParenthesisToken, }, - &meta.WhiteSpace{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.CloseParenthesisToken, }, - &meta.WhiteSpace{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.ColonToken, }, - &meta.WhiteSpace{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.EndwhileToken, }, - &meta.WhiteSpace{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.SemiColonToken, }, + &meta.Data{ + Type: meta.TokenType, + Value: "", + TokenName: meta.SemiColonToken, + }, }, Cond: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, Stmt: &stmt.StmtList{ @@ -3531,7 +3827,7 @@ func TestPrinterPrintAltWhile(t *testing.T) { }, }) - expected := ` while ($a ) :$b; endwhile ;` + expected := ` while ($a ) :$b endwhile ` actual := o.String() if expected != actual { @@ -3544,32 +3840,36 @@ func TestPrinterPrintStmtBreak(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.Break{ - Meta: []meta.Meta{ - &meta.WhiteSpace{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.BreakToken, }, - &meta.WhiteSpace{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.SemiColonToken, }, + &meta.Data{ + Type: meta.TokenType, + Value: "", + TokenName: meta.SemiColonToken, + }, }, Expr: &scalar.Lnumber{ - Meta: []meta.Meta{ - &meta.WhiteSpace{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.OpenParenthesisToken, - }, - &meta.WhiteSpace{ - Value: " ", - TokenName: meta.CloseParenthesisToken, + TokenName: meta.NodeStart, }, }, Value: "1", }, }) - expected := " break (1 ) ;" + expected := " break 1 " actual := o.String() if expected != actual { @@ -3582,15 +3882,12 @@ func TestPrinterPrintStmtCase(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.Case{ - Meta: []meta.Meta{ - &meta.WhiteSpace{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.CaseToken, }, - &meta.WhiteSpace{ - Value: " ", - TokenName: meta.CaseSeparatorToken, - }, }, Cond: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, Stmts: []node.Node{ @@ -3598,7 +3895,7 @@ func TestPrinterPrintStmtCase(t *testing.T) { }, }) - expected := ` case$a :$a;` + expected := ` case$a:$a` actual := o.String() if expected != actual { @@ -3611,21 +3908,18 @@ func TestPrinterPrintStmtCaseEmpty(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.Case{ - Meta: []meta.Meta{ - &meta.WhiteSpace{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.CaseToken, }, - &meta.WhiteSpace{ - Value: " ", - TokenName: meta.CaseSeparatorToken, - }, }, Cond: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, Stmts: []node.Node{}, }) - expected := " case$a :" + expected := " case$a:" actual := o.String() if expected != actual { @@ -3638,24 +3932,29 @@ func TestPrinterPrintStmtCatch(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.Catch{ - Meta: []meta.Meta{ - &meta.WhiteSpace{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.CatchToken, }, - &meta.WhiteSpace{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.OpenParenthesisToken, }, - &meta.WhiteSpace{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.CloseParenthesisToken, }, - &meta.WhiteSpace{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.OpenCurlyBracesToken, }, - &meta.WhiteSpace{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.CloseCurlyBracesToken, }, @@ -3670,7 +3969,7 @@ func TestPrinterPrintStmtCatch(t *testing.T) { }, }) - expected := ` catch (Exception|\RuntimeException$e ) {$a; }` + expected := ` catch (Exception|\RuntimeException$e ) {$a }` actual := o.String() if expected != actual { @@ -3683,20 +3982,24 @@ func TestPrinterPrintStmtClassMethod(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.ClassMethod{ - Meta: []meta.Meta{ - &meta.WhiteSpace{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.FunctionToken, }, - &meta.WhiteSpace{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.AmpersandToken, }, - &meta.WhiteSpace{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.OpenParenthesisToken, }, - &meta.WhiteSpace{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.CloseParenthesisToken, }, @@ -3717,8 +4020,9 @@ func TestPrinterPrintStmtClassMethod(t *testing.T) { }, }, ReturnType: &name.Name{ - Meta: []meta.Meta{ - &meta.WhiteSpace{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.ColonToken, }, @@ -3726,12 +4030,14 @@ func TestPrinterPrintStmtClassMethod(t *testing.T) { Parts: []node.Node{&name.NamePart{Value: "void"}}, }, Stmt: &stmt.StmtList{ - Meta: []meta.Meta{ - &meta.WhiteSpace{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.OpenCurlyBracesToken, }, - &meta.WhiteSpace{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.CloseCurlyBracesToken, }, @@ -3742,32 +4048,37 @@ func TestPrinterPrintStmtClassMethod(t *testing.T) { }, }) - expected := `public function &foo (?int&$a=null,...$b ) :void {$a; }` + expected := `public function &foo (?int&$a=null,...$b ) :void {$a }` actual := o.String() if expected != actual { t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) } } + func TestPrinterPrintStmtAbstractClassMethod(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) p.Print(&stmt.ClassMethod{ - Meta: []meta.Meta{ - &meta.WhiteSpace{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.FunctionToken, }, - &meta.WhiteSpace{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.AmpersandToken, }, - &meta.WhiteSpace{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.OpenParenthesisToken, }, - &meta.WhiteSpace{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.CloseParenthesisToken, }, @@ -3788,8 +4099,9 @@ func TestPrinterPrintStmtAbstractClassMethod(t *testing.T) { }, }, ReturnType: &name.Name{ - Meta: []meta.Meta{ - &meta.WhiteSpace{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.ColonToken, }, @@ -3799,7 +4111,7 @@ func TestPrinterPrintStmtAbstractClassMethod(t *testing.T) { Stmt: &stmt.Nop{}, }) - expected := `public function &foo (?int&$a=null,...$b ) :void;` + expected := `public function &foo (?int&$a=null,...$b ) :void` actual := o.String() if expected != actual { @@ -3812,16 +4124,19 @@ func TestPrinterPrintStmtClass(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.Class{ - Meta: []meta.Meta{ - &meta.WhiteSpace{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.ClassToken, }, - &meta.WhiteSpace{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.OpenCurlyBracesToken, }, - &meta.WhiteSpace{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.CloseCurlyBracesToken, }, @@ -3829,8 +4144,9 @@ func TestPrinterPrintStmtClass(t *testing.T) { Modifiers: []node.Node{&node.Identifier{Value: "abstract"}}, ClassName: &node.Identifier{Value: "Foo"}, Extends: &stmt.ClassExtends{ - Meta: []meta.Meta{ - &meta.WhiteSpace{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.ExtendsToken, }, @@ -3838,8 +4154,9 @@ func TestPrinterPrintStmtClass(t *testing.T) { ClassName: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Bar"}}}, }, Implements: &stmt.ClassImplements{ - Meta: []meta.Meta{ - &meta.WhiteSpace{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.ImplementsToken, }, @@ -3862,7 +4179,7 @@ func TestPrinterPrintStmtClass(t *testing.T) { }, }) - expected := `abstract classFoo extendsBar implementsBaz,Quuz {publicconstFOO='bar'; }` + expected := `abstract classFoo extendsBar implementsBaz,Quuz {publicconstFOO='bar' }` actual := o.String() if expected != actual { @@ -3875,28 +4192,33 @@ func TestPrinterPrintStmtAnonymousClass(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.Class{ - Meta: []meta.Meta{ - &meta.WhiteSpace{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.ClassToken, }, - &meta.WhiteSpace{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.OpenCurlyBracesToken, }, - &meta.WhiteSpace{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.CloseCurlyBracesToken, }, }, Modifiers: []node.Node{&node.Identifier{Value: "abstract"}}, ArgumentList: &node.ArgumentList{ - Meta: []meta.Meta{ - &meta.WhiteSpace{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.OpenParenthesisToken, }, - &meta.WhiteSpace{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.CloseParenthesisToken, }, @@ -3911,8 +4233,9 @@ func TestPrinterPrintStmtAnonymousClass(t *testing.T) { }, }, Extends: &stmt.ClassExtends{ - Meta: []meta.Meta{ - &meta.WhiteSpace{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.ExtendsToken, }, @@ -3920,8 +4243,9 @@ func TestPrinterPrintStmtAnonymousClass(t *testing.T) { ClassName: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Bar"}}}, }, Implements: &stmt.ClassImplements{ - Meta: []meta.Meta{ - &meta.WhiteSpace{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.ImplementsToken, }, @@ -3944,7 +4268,7 @@ func TestPrinterPrintStmtAnonymousClass(t *testing.T) { }, }) - expected := `abstract class ($a,$b ) extendsBar implementsBaz,Quuz {publicconstFOO='bar'; }` + expected := `abstract class ($a,$b ) extendsBar implementsBaz,Quuz {publicconstFOO='bar' }` actual := o.String() if expected != actual { @@ -3957,15 +4281,22 @@ func TestPrinterPrintStmtClassConstList(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.ClassConstList{ - Meta: []meta.Meta{ - &meta.WhiteSpace{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.ConstToken, }, - &meta.WhiteSpace{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.SemiColonToken, }, + &meta.Data{ + Type: meta.TokenType, + Value: "", + TokenName: meta.SemiColonToken, + }, }, Modifiers: []node.Node{&node.Identifier{Value: "public"}}, Consts: []node.Node{ @@ -3980,7 +4311,49 @@ func TestPrinterPrintStmtClassConstList(t *testing.T) { }, }) - expected := `public constFOO='a',BAR='b' ;` + expected := `public constFOO='a',BAR='b' ` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrinterPrintStmtConstList(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrinter(o) + p.Print(&stmt.ConstList{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.WhiteSpaceType, + Value: " ", + TokenName: meta.ConstToken, + }, + &meta.Data{ + Type: meta.WhiteSpaceType, + Value: " ", + TokenName: meta.SemiColonToken, + }, + &meta.Data{ + Type: meta.TokenType, + Value: "", + TokenName: meta.SemiColonToken, + }, + }, + Consts: []node.Node{ + &stmt.Constant{ + ConstantName: &node.Identifier{Value: "FOO"}, + Expr: &scalar.String{Value: "'a'"}, + }, + &stmt.Constant{ + ConstantName: &node.Identifier{Value: "BAR"}, + Expr: &scalar.String{Value: "'b'"}, + }, + }, + }) + + expected := ` constFOO='a',BAR='b' ` actual := o.String() if expected != actual { @@ -3993,8 +4366,9 @@ func TestPrinterPrintStmtConstant(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.Constant{ - Meta: []meta.Meta{ - &meta.WhiteSpace{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.EqualToken, }, @@ -4016,32 +4390,36 @@ func TestPrinterPrintStmtContinue(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.Continue{ - Meta: []meta.Meta{ - &meta.WhiteSpace{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.ContinueToken, }, - &meta.WhiteSpace{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.SemiColonToken, }, + &meta.Data{ + Type: meta.TokenType, + Value: "", + TokenName: meta.SemiColonToken, + }, }, Expr: &scalar.Lnumber{ - Meta: []meta.Meta{ - &meta.WhiteSpace{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.OpenParenthesisToken, - }, - &meta.WhiteSpace{ - Value: " ", - TokenName: meta.CloseParenthesisToken, + TokenName: meta.NodeStart, }, }, Value: "1", }, }) - expected := ` continue (1 ) ;` + expected := ` continue 1 ` actual := o.String() if expected != actual { @@ -4054,16 +4432,19 @@ func TestPrinterPrintStmtDeclareStmts(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.Declare{ - Meta: []meta.Meta{ - &meta.WhiteSpace{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.DeclareToken, }, - &meta.WhiteSpace{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.OpenParenthesisToken, }, - &meta.WhiteSpace{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.CloseParenthesisToken, }, @@ -4081,7 +4462,7 @@ func TestPrinterPrintStmtDeclareStmts(t *testing.T) { }, }) - expected := ` declare (FOO='bar' ){;}` + expected := ` declare (FOO='bar' ){}` actual := o.String() if expected != actual { @@ -4094,16 +4475,19 @@ func TestPrinterPrintStmtDeclareExpr(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.Declare{ - Meta: []meta.Meta{ - &meta.WhiteSpace{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.DeclareToken, }, - &meta.WhiteSpace{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.OpenParenthesisToken, }, - &meta.WhiteSpace{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.CloseParenthesisToken, }, @@ -4117,7 +4501,7 @@ func TestPrinterPrintStmtDeclareExpr(t *testing.T) { Stmt: &stmt.Expression{Expr: &scalar.String{Value: "'bar'"}}, }) - expected := ` declare (FOO='bar' )'bar';` + expected := ` declare (FOO='bar' )'bar'` actual := o.String() if expected != actual { @@ -4139,7 +4523,7 @@ func TestPrinterPrintStmtDeclareNop(t *testing.T) { Stmt: &stmt.Nop{}, }) - expected := `declare(FOO='bar');` + expected := `declare(FOO='bar')` actual := o.String() if expected != actual { @@ -4152,22 +4536,19 @@ func TestPrinterPrintStmtDefalut(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.Default{ - Meta: []meta.Meta{ - &meta.WhiteSpace{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.DefaultToken, }, - &meta.WhiteSpace{ - Value: " ", - TokenName: meta.CaseSeparatorToken, - }, }, Stmts: []node.Node{ &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, }, }) - expected := ` default :$a;` + expected := ` default:$a` actual := o.String() if expected != actual { @@ -4180,20 +4561,17 @@ func TestPrinterPrintStmtDefalutEmpty(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.Default{ - Meta: []meta.Meta{ - &meta.WhiteSpace{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.DefaultToken, }, - &meta.WhiteSpace{ - Value: " ", - TokenName: meta.CaseSeparatorToken, - }, }, Stmts: []node.Node{}, }) - expected := ` default :` + expected := ` default:` actual := o.String() if expected != actual { @@ -4206,27 +4584,37 @@ func TestPrinterPrintStmtDo_Expression(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.Do{ - Meta: []meta.Meta{ - &meta.WhiteSpace{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.DoToken, }, - &meta.WhiteSpace{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.WhileToken, }, - &meta.WhiteSpace{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.OpenParenthesisToken, }, - &meta.WhiteSpace{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.CloseParenthesisToken, }, - &meta.WhiteSpace{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.SemiColonToken, }, + &meta.Data{ + Type: meta.TokenType, + Value: "", + TokenName: meta.SemiColonToken, + }, }, Cond: &scalar.Lnumber{Value: "1"}, Stmt: &stmt.Expression{ @@ -4234,7 +4622,7 @@ func TestPrinterPrintStmtDo_Expression(t *testing.T) { }, }) - expected := ` do$a; while (1 ) ;` + expected := ` do$a while (1 ) ` actual := o.String() if expected != actual { @@ -4247,27 +4635,37 @@ func TestPrinterPrintStmtDo_StmtList(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.Do{ - Meta: []meta.Meta{ - &meta.WhiteSpace{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.DoToken, }, - &meta.WhiteSpace{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.WhileToken, }, - &meta.WhiteSpace{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.OpenParenthesisToken, }, - &meta.WhiteSpace{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.CloseParenthesisToken, }, - &meta.WhiteSpace{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.SemiColonToken, }, + &meta.Data{ + Type: meta.TokenType, + Value: "", + TokenName: meta.SemiColonToken, + }, }, Cond: &scalar.Lnumber{Value: "1"}, Stmt: &stmt.StmtList{ @@ -4277,7 +4675,7 @@ func TestPrinterPrintStmtDo_StmtList(t *testing.T) { }, }) - expected := ` do{$a;} while (1 ) ;` + expected := ` do{$a} while (1 ) ` actual := o.String() if expected != actual { @@ -4290,15 +4688,27 @@ func TestPrinterPrintStmtEcho(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.Echo{ - Meta: []meta.Meta{ - &meta.WhiteSpace{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "echo", + TokenName: meta.EchoToken, + }, + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.EchoToken, }, - &meta.WhiteSpace{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.SemiColonToken, }, + &meta.Data{ + Type: meta.TokenType, + Value: "", + TokenName: meta.SemiColonToken, + }, }, Exprs: []node.Node{ &expr.Variable{VarName: &node.Identifier{Value: "a"}}, @@ -4306,7 +4716,7 @@ func TestPrinterPrintStmtEcho(t *testing.T) { }, }) - expected := ` echo$a,$b ;` + expected := `echo $a,$b ` actual := o.String() if expected != actual { @@ -4319,16 +4729,19 @@ func TestPrinterPrintStmtElseIfStmts(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.ElseIf{ - Meta: []meta.Meta{ - &meta.WhiteSpace{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.ElseifToken, }, - &meta.WhiteSpace{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.OpenParenthesisToken, }, - &meta.WhiteSpace{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.CloseParenthesisToken, }, @@ -4341,7 +4754,7 @@ func TestPrinterPrintStmtElseIfStmts(t *testing.T) { }, }) - expected := ` elseif ($a ){;}` + expected := ` elseif ($a ){}` actual := o.String() if expected != actual { @@ -4354,16 +4767,19 @@ func TestPrinterPrintStmtElseIfExpr(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.ElseIf{ - Meta: []meta.Meta{ - &meta.WhiteSpace{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.ElseifToken, }, - &meta.WhiteSpace{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.OpenParenthesisToken, }, - &meta.WhiteSpace{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.CloseParenthesisToken, }, @@ -4372,7 +4788,7 @@ func TestPrinterPrintStmtElseIfExpr(t *testing.T) { Stmt: &stmt.Expression{Expr: &scalar.String{Value: "'bar'"}}, }) - expected := ` elseif ($a )'bar';` + expected := ` elseif ($a )'bar'` actual := o.String() if expected != actual { @@ -4389,7 +4805,7 @@ func TestPrinterPrintStmtElseIfNop(t *testing.T) { Stmt: &stmt.Nop{}, }) - expected := `elseif($a);` + expected := `elseif($a)` actual := o.String() if expected != actual { @@ -4402,8 +4818,9 @@ func TestPrinterPrintStmtElseStmts(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.Else{ - Meta: []meta.Meta{ - &meta.WhiteSpace{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.ElseToken, }, @@ -4415,7 +4832,7 @@ func TestPrinterPrintStmtElseStmts(t *testing.T) { }, }) - expected := ` else{;}` + expected := ` else{}` actual := o.String() if expected != actual { @@ -4428,8 +4845,9 @@ func TestPrinterPrintStmtElseExpr(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.Else{ - Meta: []meta.Meta{ - &meta.WhiteSpace{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.ElseToken, }, @@ -4437,7 +4855,7 @@ func TestPrinterPrintStmtElseExpr(t *testing.T) { Stmt: &stmt.Expression{Expr: &scalar.String{Value: "'bar'"}}, }) - expected := ` else'bar';` + expected := ` else'bar'` actual := o.String() if expected != actual { @@ -4453,7 +4871,7 @@ func TestPrinterPrintStmtElseNop(t *testing.T) { Stmt: &stmt.Nop{}, }) - expected := `else;` + expected := `else` actual := o.String() if expected != actual { @@ -4466,16 +4884,22 @@ func TestPrinterPrintExpression(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.Expression{ - Meta: []meta.Meta{ - &meta.WhiteSpace{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.SemiColonToken, }, + &meta.Data{ + Type: meta.TokenType, + Value: "", + TokenName: meta.SemiColonToken, + }, }, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, }) - expected := `$a ;` + expected := `$a ` actual := o.String() if expected != actual { @@ -4488,16 +4912,19 @@ func TestPrinterPrintStmtFinally(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.Finally{ - Meta: []meta.Meta{ - &meta.WhiteSpace{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.FinallyToken, }, - &meta.WhiteSpace{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.OpenCurlyBracesToken, }, - &meta.WhiteSpace{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.CloseCurlyBracesToken, }, @@ -4507,7 +4934,7 @@ func TestPrinterPrintStmtFinally(t *testing.T) { }, }) - expected := ` finally {; }` + expected := ` finally { }` actual := o.String() if expected != actual { @@ -4520,24 +4947,29 @@ func TestPrinterPrintStmtFor(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.For{ - Meta: []meta.Meta{ - &meta.WhiteSpace{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.ForToken, }, - &meta.WhiteSpace{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.OpenParenthesisToken, }, - &meta.WhiteSpace{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.ForInitSemicolonToken, }, - &meta.WhiteSpace{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.ForCondSemicolonToken, }, - &meta.WhiteSpace{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.CloseParenthesisToken, }, @@ -4561,7 +4993,7 @@ func TestPrinterPrintStmtFor(t *testing.T) { }, }) - expected := ` for ($a,$b ;$c,$d ;$e,$f ){;}` + expected := ` for ($a,$b ;$c,$d ;$e,$f ){}` actual := o.String() if expected != actual { @@ -4574,24 +5006,29 @@ func TestPrinterPrintStmtForeach(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.Foreach{ - Meta: []meta.Meta{ - &meta.WhiteSpace{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.ForeachToken, }, - &meta.WhiteSpace{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.OpenParenthesisToken, }, - &meta.WhiteSpace{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.AsToken, }, - &meta.WhiteSpace{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.DoubleArrowToken, }, - &meta.WhiteSpace{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.CloseParenthesisToken, }, @@ -4606,7 +5043,7 @@ func TestPrinterPrintStmtForeach(t *testing.T) { }, }) - expected := ` foreach ($a as$k =>$v ){;}` + expected := ` foreach ($a as$k =>$v ){}` actual := o.String() if expected != actual { @@ -4619,28 +5056,34 @@ func TestPrinterPrintStmtFunction(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.Function{ - Meta: []meta.Meta{ - &meta.WhiteSpace{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.FunctionToken, }, - &meta.WhiteSpace{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.AmpersandToken, }, - &meta.WhiteSpace{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.OpenParenthesisToken, }, - &meta.WhiteSpace{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.CloseParenthesisToken, }, - &meta.WhiteSpace{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.OpenCurlyBracesToken, }, - &meta.WhiteSpace{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.CloseCurlyBracesToken, }, @@ -4655,8 +5098,9 @@ func TestPrinterPrintStmtFunction(t *testing.T) { }, }, ReturnType: &name.FullyQualified{ - Meta: []meta.Meta{ - &meta.WhiteSpace{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.ColonToken, }, @@ -4668,7 +5112,7 @@ func TestPrinterPrintStmtFunction(t *testing.T) { }, }) - expected := ` function &foo (&$var ) :\Foo {; }` + expected := ` function &foo (&$var ) :\Foo { }` actual := o.String() if expected != actual { @@ -4681,15 +5125,22 @@ func TestPrinterPrintStmtGlobal(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.Global{ - Meta: []meta.Meta{ - &meta.WhiteSpace{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.GlobalToken, }, - &meta.WhiteSpace{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.SemiColonToken, }, + &meta.Data{ + Type: meta.TokenType, + Value: "", + TokenName: meta.SemiColonToken, + }, }, Vars: []node.Node{ &expr.Variable{VarName: &node.Identifier{Value: "a"}}, @@ -4697,7 +5148,7 @@ func TestPrinterPrintStmtGlobal(t *testing.T) { }, }) - expected := ` global$a,$b ;` + expected := ` global$a,$b ` actual := o.String() if expected != actual { @@ -4710,20 +5161,27 @@ func TestPrinterPrintStmtGoto(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.Goto{ - Meta: []meta.Meta{ - &meta.WhiteSpace{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.GotoToken, }, - &meta.WhiteSpace{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.SemiColonToken, }, + &meta.Data{ + Type: meta.TokenType, + Value: "", + TokenName: meta.SemiColonToken, + }, }, Label: &node.Identifier{Value: "FOO"}, }) - expected := ` gotoFOO ;` + expected := ` gotoFOO ` actual := o.String() if expected != actual { @@ -4736,27 +5194,37 @@ func TestPrinterPrintStmtGroupUse(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.GroupUse{ - Meta: []meta.Meta{ - &meta.WhiteSpace{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.UseToken, }, - &meta.WhiteSpace{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.NsSeparatorToken, }, - &meta.WhiteSpace{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.OpenCurlyBracesToken, }, - &meta.WhiteSpace{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.CloseCurlyBracesToken, }, - &meta.WhiteSpace{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.SemiColonToken, }, + &meta.Data{ + Type: meta.TokenType, + Value: "", + TokenName: meta.SemiColonToken, + }, }, UseType: &node.Identifier{Value: "function"}, Prefix: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Foo"}}}, @@ -4771,7 +5239,7 @@ func TestPrinterPrintStmtGroupUse(t *testing.T) { }, }) - expected := ` usefunctionFoo \ {BarasBaz,Quuz } ;` + expected := ` usefunctionFoo \ {BarasBaz,Quuz } ` actual := o.String() if expected != actual { @@ -4784,27 +5252,36 @@ func TestPrinterPrintHaltCompiler(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.HaltCompiler{ - Meta: []meta.Meta{ - &meta.WhiteSpace{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.HaltCompilerToken, }, - &meta.WhiteSpace{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.OpenParenthesisToken, }, - &meta.WhiteSpace{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.CloseParenthesisToken, }, - &meta.WhiteSpace{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.SemiColonToken, }, + &meta.Data{ + Type: meta.TokenType, + Value: "", + TokenName: meta.SemiColonToken, + }, }, }) - expected := ` __halt_compiler ( ) ;` + expected := ` __halt_compiler ( ) ` actual := o.String() if expected != actual { @@ -4817,16 +5294,19 @@ func TestPrinterPrintIfExpression(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.If{ - Meta: []meta.Meta{ - &meta.WhiteSpace{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.IfToken, }, - &meta.WhiteSpace{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.OpenParenthesisToken, }, - &meta.WhiteSpace{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.CloseParenthesisToken, }, @@ -4858,7 +5338,7 @@ func TestPrinterPrintIfExpression(t *testing.T) { }, }) - expected := ` if ($a )$b;elseif($c){$d;}elseif($e);else$f;` + expected := ` if ($a )$belseif($c){$d}elseif($e)else$f` actual := o.String() if expected != actual { @@ -4871,16 +5351,19 @@ func TestPrinterPrintIfStmtList(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.If{ - Meta: []meta.Meta{ - &meta.WhiteSpace{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.IfToken, }, - &meta.WhiteSpace{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.OpenParenthesisToken, }, - &meta.WhiteSpace{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.CloseParenthesisToken, }, @@ -4895,7 +5378,7 @@ func TestPrinterPrintIfStmtList(t *testing.T) { }, }) - expected := ` if ($a ){$b;}` + expected := ` if ($a ){$b}` actual := o.String() if expected != actual { @@ -4912,7 +5395,7 @@ func TestPrinterPrintIfNop(t *testing.T) { Stmt: &stmt.Nop{}, }) - expected := `if($a);` + expected := `if($a)` actual := o.String() if expected != actual { @@ -4925,8 +5408,9 @@ func TestPrinterPrintInlineHtml(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.InlineHtml{ - Meta: []meta.Meta{ - &meta.WhiteSpace{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.WhiteSpaceType, Value: " ", TokenName: meta.InlineHTMLToken, }, @@ -4934,7 +5418,7 @@ func TestPrinterPrintInlineHtml(t *testing.T) { Value: "test", }) - expected := ` ?>test{NEW_LINE}? @@ -8397,13 +8402,13 @@ yyrule126: // (#|[/][/]) } break } - l.addComments(tb) + l.addMeta(meta.CommentType, tb) goto yystate0 } yyrule127: // [/][*][*][/] { - l.addComments(l.Token()) + l.addMeta(meta.CommentType, l.Token()) goto yystate0 } yyrule128: // ([/][*])|([/][*][*]) @@ -8428,9 +8433,9 @@ yyrule128: // ([/][*])|([/][*][*]) } if is_doc_comment { l.PhpDocComment = string(l.TokenBytes(nil)) - l.addComments(l.Token()) + l.addMeta(meta.CommentType, l.Token()) } else { - l.addComments(l.Token()) + l.addMeta(meta.CommentType, l.Token()) } goto yystate0 } @@ -8476,7 +8481,7 @@ yyrule134: // -> } yyrule135: // [ \t\n\r]+ { - l.addWhiteSpace(l.Token()) + l.addMeta(meta.WhiteSpaceType, l.Token()) goto yystate0 } yyrule136: // -> diff --git a/scanner/scanner.l b/scanner/scanner.l index dd7d756..4fbaae3 100644 --- a/scanner/scanner.l +++ b/scanner/scanner.l @@ -9,6 +9,7 @@ package scanner import ( "fmt" + "github.com/z7zmey/php-parser/meta" "github.com/cznic/golex/lex" ) @@ -58,7 +59,7 @@ NEW_LINE (\r|\n|\r\n) %% c = l.Rule0() -[ \t\n\r]+ +[ \t\n\r]+ l.addMeta(meta.WhiteSpaceType, l.Token()) . tb := []lex.Char{} @@ -85,11 +86,12 @@ NEW_LINE (\r|\n|\r\n) lval.Token(l.createToken(tb)) return int(T_INLINE_HTML) -\<\?php([ \t]|{NEW_LINE}) l.Begin(PHP);l.ungetChars(len(l.Token())-5) -\<\? l.Begin(PHP); +\<\?php([ \t]|{NEW_LINE}) l.addMeta(meta.TokenType, l.Token()[:5]);l.Begin(PHP);l.ungetChars(len(l.Token())-5) +\<\? l.addMeta(meta.TokenType, l.Token());l.Begin(PHP); \<\?= l.Begin(PHP);lval.Token(l.createToken(l.Token())); return int(T_ECHO); -[ \t\n\r]+ l.addWhiteSpace(l.Token()) + +[ \t\n\r]+ l.addMeta(meta.WhiteSpaceType, l.Token()) [;][ \t\n\r]*\?\>{NEW_LINE}? l.Begin(INITIAL);lval.Token(l.createToken(l.Token())); return Rune2Class(';'); \?\>{NEW_LINE}? l.Begin(INITIAL);lval.Token(l.createToken(l.Token())); return Rune2Class(';'); @@ -286,10 +288,10 @@ NEW_LINE (\r|\n|\r\n) break; } - l.addComments(tb) + l.addMeta(meta.CommentType, tb) [/][*][*][/] - l.addComments(l.Token()) + l.addMeta(meta.CommentType, l.Token()) ([/][*])|([/][*][*]) tb := l.Token() is_doc_comment := false @@ -314,9 +316,9 @@ NEW_LINE (\r|\n|\r\n) if is_doc_comment { l.PhpDocComment = string(l.TokenBytes(nil)) - l.addComments(l.Token()) + l.addMeta(meta.CommentType, l.Token()) } else { - l.addComments(l.Token()) + l.addMeta(meta.CommentType, l.Token()) } {OPERATORS} lval.Token(l.createToken(l.Token())); return Rune2Class(rune(l.TokenBytes(nil)[0])) @@ -327,7 +329,7 @@ NEW_LINE (\r|\n|\r\n) {VAR_NAME} lval.Token(l.createToken(l.Token())); return int(T_STRING) -> l.Begin(PROPERTY);lval.Token(l.createToken(l.Token())); return int(T_OBJECT_OPERATOR); -[ \t\n\r]+ l.addWhiteSpace(l.Token()) +[ \t\n\r]+ l.addMeta(meta.WhiteSpaceType, l.Token()) -> lval.Token(l.createToken(l.Token())); return int(T_OBJECT_OPERATOR); {VAR_NAME} l.Begin(PHP);lval.Token(l.createToken(l.Token())); return int(T_STRING); . l.ungetChars(1);l.Begin(PHP) diff --git a/scanner/scanner_test.go b/scanner/scanner_test.go index 0cc599c..8988b55 100644 --- a/scanner/scanner_test.go +++ b/scanner/scanner_test.go @@ -967,9 +967,22 @@ func TestSlashAfterVariable(t *testing.T) { func TestCommentEnd(t *testing.T) { src := ` test` - expected := []meta.Meta{ - meta.NewWhiteSpace("\n\t", position.NewPosition(1, 2, 6, 7)), - meta.NewComment("//test", position.NewPosition(2, 2, 8, 13)), + expected := meta.Collection{ + &meta.Data{ + Value: " 0 { + if mm := n.GetMeta(); len(*mm) > 0 { fmt.Fprintf(d.Writer, "%v\"Meta\":\n", d.Indent+" ") - for _, m := range mm { - fmt.Fprintf(d.Writer, "%v%q before %q\n", d.Indent+" ", m, m.GetTokenName().String()) + for _, m := range *mm { + fmt.Fprintf(d.Writer, "%v%q before %q\n", d.Indent+" ", m, m.TokenName.String()) } } diff --git a/visitor/dumper_test.go b/visitor/dumper_test.go index 73ac034..8866ac4 100644 --- a/visitor/dumper_test.go +++ b/visitor/dumper_test.go @@ -43,6 +43,7 @@ func ExampleDumper() { // | [*stmt.Namespace] // | "Position": Pos{Line: 3-11 Pos: 10-143} // | "Meta": + // | " 0 { + if mm := n.GetMeta(); len(*mm) > 0 { printIndent(d.Writer, d.depth) fmt.Fprint(d.Writer, "Meta: []meta.Meta{\n") d.depth++ - for _, m := range mm { + for _, m := range *mm { printIndent(d.Writer, d.depth) - switch m.(type) { - case *meta.Comment: - fmt.Fprint(d.Writer, "&meta.Comment{\n") - case *meta.WhiteSpace: - fmt.Fprint(d.Writer, "&meta.WhiteSpace{\n") + switch m.Type { + case meta.CommentType: + fmt.Fprint(d.Writer, "&meta.CommentType{\n") + case meta.WhiteSpaceType: + fmt.Fprint(d.Writer, "&meta.WhiteSpaceType{\n") + case meta.TokenType: + fmt.Fprint(d.Writer, "&meta.TokenType{\n") } d.depth++ @@ -79,13 +81,13 @@ func (d *GoDumper) EnterNode(w walker.Walkable) bool { fmt.Fprint(d.Writer, "Position: &position.Position{\n") d.depth++ printIndent(d.Writer, d.depth) - fmt.Fprintf(d.Writer, "StartLine: %d,\n", m.GetPosition().StartLine) + fmt.Fprintf(d.Writer, "StartLine: %d,\n", m.Position.StartLine) printIndent(d.Writer, d.depth) - fmt.Fprintf(d.Writer, "EndLine: %d,\n", m.GetPosition().EndLine) + fmt.Fprintf(d.Writer, "EndLine: %d,\n", m.Position.EndLine) printIndent(d.Writer, d.depth) - fmt.Fprintf(d.Writer, "StartPos: %d,\n", m.GetPosition().StartPos) + fmt.Fprintf(d.Writer, "StartPos: %d,\n", m.Position.StartPos) printIndent(d.Writer, d.depth) - fmt.Fprintf(d.Writer, "EndPos: %d,\n", m.GetPosition().EndPos) + fmt.Fprintf(d.Writer, "EndPos: %d,\n", m.Position.EndPos) d.depth-- printIndent(d.Writer, d.depth) fmt.Fprint(d.Writer, "},\n") @@ -93,7 +95,7 @@ func (d *GoDumper) EnterNode(w walker.Walkable) bool { printIndent(d.Writer, d.depth) fmt.Fprintf(d.Writer, "Value: %q,\n", m.String()) printIndent(d.Writer, d.depth) - fmt.Fprintf(d.Writer, "TokenName: %d,\n", m.GetTokenName()) + fmt.Fprintf(d.Writer, "TokenName: %d,\n", m.TokenName) d.depth-- printIndent(d.Writer, d.depth) diff --git a/visitor/go_dumper_test.go b/visitor/go_dumper_test.go index c2c012d..33e9805 100644 --- a/visitor/go_dumper_test.go +++ b/visitor/go_dumper_test.go @@ -15,7 +15,7 @@ func ExampleGoDumper() { class Bar { public function FunctionName(Type $var = null) { - //some comment + // some comment $var; } } @@ -40,7 +40,7 @@ func ExampleGoDumper() { // StartLine: 3, // EndLine: 11, // StartPos: 10, - // EndPos: 142, + // EndPos: 143, // }, // Stmts: []node.Node{ // &stmt.Namespace{ @@ -48,10 +48,20 @@ func ExampleGoDumper() { // StartLine: 3, // EndLine: 11, // StartPos: 10, - // EndPos: 142, + // EndPos: 143, // }, // Meta: []meta.Meta{ - // &meta.WhiteSpace{ + // &meta.TokenType{ + // Position: &position.Position{ + // StartLine: 1, + // EndLine: 1, + // StartPos: 1, + // EndPos: 5, + // }, + // Value: " 0 { + if mm := n.GetMeta(); len(*mm) > 0 { fmt.Fprintf(d.Writer, ",%q:[", "meta") - for k, m := range mm { + for k, m := range *mm { if k != 0 { fmt.Fprint(d.Writer, ",") } - switch m.(type) { - case *meta.Comment: - fmt.Fprintf(d.Writer, "{%q:%q,%q:%q,%q:%q}", "type", "*meta.Comment", "value", m.String(), "tokenName", m.GetTokenName().String()) - case *meta.WhiteSpace: - fmt.Fprintf(d.Writer, "{%q:%q,%q:%q,%q:%q}", "type", "*meta.WhiteSpace", "value", m.String(), "tokenName", m.GetTokenName().String()) + switch m.Type { + case meta.CommentType: + fmt.Fprintf(d.Writer, "{%q:%q,%q:%q,%q:%q}", "type", "*meta.CommentType", "value", m.String(), "tokenName", m.TokenName.String()) + case meta.WhiteSpaceType: + fmt.Fprintf(d.Writer, "{%q:%q,%q:%q,%q:%q}", "type", "*meta.WhiteSpaceType", "value", m.String(), "tokenName", m.TokenName.String()) + case meta.TokenType: + fmt.Fprintf(d.Writer, "{%q:%q,%q:%q,%q:%q}", "type", "*meta.TokenType", "value", m.String(), "tokenName", m.TokenName.String()) } } diff --git a/visitor/json_dumper_test.go b/visitor/json_dumper_test.go index b3baebc..51f8219 100644 --- a/visitor/json_dumper_test.go +++ b/visitor/json_dumper_test.go @@ -37,5 +37,5 @@ func ExampleJsonDumper() { nodes.Walk(dumper) // Output: - // {"type":"*node.Root","position":{"startPos":10,"endPos":166,"startLine":3,"endLine":12},"Stmts":[{"type":"*stmt.Namespace","position":{"startPos":10,"endPos":166,"startLine":3,"endLine":12},"meta":[{"type":"*meta.WhiteSpace","value":"\n\n\t\t","tokenName":"NamespaceToken"},{"type":"*meta.WhiteSpace","value":" ","tokenName":"OpenCurlyBracesToken"},{"type":"*meta.WhiteSpace","value":"\n\t\t","tokenName":"CloseCurlyBracesToken"}],"NamespaceName":{"type":"*name.Name","position":{"startPos":20,"endPos":22,"startLine":3,"endLine":3},"Parts":[{"type":"*name.NamePart","position":{"startPos":20,"endPos":22,"startLine":3,"endLine":3},"meta":[{"type":"*meta.WhiteSpace","value":" ","tokenName":"StringToken"}],"Value":"Foo"}]},"Stmts":[{"type":"*stmt.Class","position":{"startPos":29,"endPos":162,"startLine":4,"endLine":11},"namespacedName":"Foo\\Bar","meta":[{"type":"*meta.WhiteSpace","value":"\n\t\t\t","tokenName":"ClassToken"},{"type":"*meta.WhiteSpace","value":" ","tokenName":"OpenCurlyBracesToken"},{"type":"*meta.WhiteSpace","value":"\n\t\t\t","tokenName":"CloseCurlyBracesToken"}],"PhpDocComment":"","ClassName":{"type":"*node.Identifier","position":{"startPos":35,"endPos":37,"startLine":4,"endLine":4},"meta":[{"type":"*meta.WhiteSpace","value":" ","tokenName":"IdentifierToken"}],"Value":"Bar"},"Stmts":[{"type":"*stmt.ClassMethod","position":{"startPos":45,"endPos":157,"startLine":5,"endLine":10},"meta":[{"type":"*meta.WhiteSpace","value":" ","tokenName":"FunctionToken"}],"PhpDocComment":"","ReturnsRef":false,"MethodName":{"type":"*node.Identifier","position":{"startPos":61,"endPos":72,"startLine":5,"endLine":5},"meta":[{"type":"*meta.WhiteSpace","value":" ","tokenName":"IdentifierToken"}],"Value":"FunctionName"},"Modifiers":[{"type":"*node.Identifier","position":{"startPos":45,"endPos":50,"startLine":5,"endLine":5},"meta":[{"type":"*meta.WhiteSpace","value":"\n\t\t\t\t","tokenName":"IdentifierToken"}],"Value":"public"}],"Params":[{"type":"*node.Parameter","position":{"startPos":74,"endPos":89,"startLine":5,"endLine":5},"meta":[{"type":"*meta.WhiteSpace","value":" ","tokenName":"EqualToken"}],"ByRef":false,"Variadic":false,"VariableType":{"type":"*name.Name","position":{"startPos":74,"endPos":77,"startLine":5,"endLine":5},"namespacedName":"Foo\\Type","Parts":[{"type":"*name.NamePart","position":{"startPos":74,"endPos":77,"startLine":5,"endLine":5},"Value":"Type"}]},"Variable":{"type":"*expr.Variable","position":{"startPos":79,"endPos":82,"startLine":5,"endLine":5},"meta":[{"type":"*meta.WhiteSpace","value":" ","tokenName":"VariableToken"}],"VarName":{"type":"*node.Identifier","position":{"startPos":79,"endPos":82,"startLine":5,"endLine":5},"Value":"var"}},"DefaultValue":{"type":"*expr.ConstFetch","position":{"startPos":86,"endPos":89,"startLine":5,"endLine":5},"Constant":{"type":"*name.Name","position":{"startPos":86,"endPos":89,"startLine":5,"endLine":5},"namespacedName":"null","Parts":[{"type":"*name.NamePart","position":{"startPos":86,"endPos":89,"startLine":5,"endLine":5},"meta":[{"type":"*meta.WhiteSpace","value":" ","tokenName":"StringToken"}],"Value":"null"}]}}}],"Stmt":{"type":"*stmt.StmtList","position":{"startPos":96,"endPos":157,"startLine":6,"endLine":10},"meta":[{"type":"*meta.WhiteSpace","value":"\n\t\t\t\t","tokenName":"OpenCurlyBracesToken"},{"type":"*meta.WhiteSpace","value":"\n\t\t\t\t","tokenName":"CloseCurlyBracesToken"}],"Stmts":[{"type":"*stmt.Expression","position":{"startPos":147,"endPos":151,"startLine":9,"endLine":9},"Expr":{"type":"*expr.Variable","position":{"startPos":147,"endPos":150,"startLine":9,"endLine":9},"meta":[{"type":"*meta.WhiteSpace","value":"\n\t\t\t\t\t","tokenName":"VariableToken"},{"type":"*meta.Comment","value":"// some comment\n","tokenName":"VariableToken"},{"type":"*meta.WhiteSpace","value":"\t\t\t\t\t","tokenName":"VariableToken"},{"type":"*meta.Comment","value":"// second comment\n","tokenName":"VariableToken"},{"type":"*meta.WhiteSpace","value":"\t\t\t\t\t","tokenName":"VariableToken"}],"VarName":{"type":"*node.Identifier","position":{"startPos":147,"endPos":150,"startLine":9,"endLine":9},"Value":"var"}}}]}}]}]}]} + // {"type":"*node.Root","position":{"startPos":10,"endPos":166,"startLine":3,"endLine":12},"Stmts":[{"type":"*stmt.Namespace","position":{"startPos":10,"endPos":166,"startLine":3,"endLine":12},"meta":[{"type":"*meta.TokenType","value":" 0 { + if mm := n.GetMeta(); len(*mm) > 0 { fmt.Fprint(d.Writer, ",\n") d.printIndent(d.Writer) fmt.Fprint(d.Writer, "\"meta\": [\n") d.depth++ - for k, m := range mm { + for k, m := range *mm { if k != 0 { fmt.Fprint(d.Writer, ",\n") } @@ -96,16 +96,18 @@ func (d *PrettyJsonDumper) EnterNode(w walker.Walkable) bool { fmt.Fprint(d.Writer, "{\n") d.depth++ d.printIndent(d.Writer) - switch m.(type) { - case *meta.Comment: - fmt.Fprintf(d.Writer, "%q: %q,\n", "type", "*meta.Comment") - case *meta.WhiteSpace: - fmt.Fprintf(d.Writer, "%q: %q,\n", "type", "*meta.WhiteSpace") + switch m.Type { + case meta.CommentType: + fmt.Fprintf(d.Writer, "%q: %q,\n", "type", "*meta.CommentType") + case meta.WhiteSpaceType: + fmt.Fprintf(d.Writer, "%q: %q,\n", "type", "*meta.WhiteSpaceType") + case meta.TokenType: + fmt.Fprintf(d.Writer, "%q: %q,\n", "type", "*meta.TokenType") } d.printIndent(d.Writer) fmt.Fprintf(d.Writer, "%q: %q,\n", "value", m.String()) d.printIndent(d.Writer) - fmt.Fprintf(d.Writer, "%q: %q\n", "tokenName", m.GetTokenName().String()) + fmt.Fprintf(d.Writer, "%q: %q\n", "tokenName", m.TokenName.String()) d.depth-- d.printIndent(d.Writer) fmt.Fprint(d.Writer, "}") diff --git a/visitor/pretty_json_dumper_test.go b/visitor/pretty_json_dumper_test.go index 16a1e22..3992a4a 100644 --- a/visitor/pretty_json_dumper_test.go +++ b/visitor/pretty_json_dumper_test.go @@ -21,7 +21,9 @@ func ExamplePrettyJsonDumper() { } } - function foo() {} + function foo() { + ; + } } ` @@ -41,13 +43,13 @@ func ExamplePrettyJsonDumper() { // "type": "*node.Root", // "position": { // "startPos": 10, - // "endPos": 188, + // "endPos": 198, // "startLine": 3, - // "endLine": 14 + // "endLine": 16 // }, // "meta": [ // { - // "type": "*meta.WhiteSpace", + // "type": "*meta.WhiteSpaceType", // "value": "\n\t\t", // "tokenName": "NodeEnd" // } @@ -57,23 +59,28 @@ func ExamplePrettyJsonDumper() { // "type": "*stmt.Namespace", // "position": { // "startPos": 10, - // "endPos": 188, + // "endPos": 198, // "startLine": 3, - // "endLine": 14 + // "endLine": 16 // }, // "meta": [ // { - // "type": "*meta.WhiteSpace", + // "type": "*meta.TokenType", + // "value": " Date: Thu, 13 Sep 2018 20:07:50 +0300 Subject: [PATCH 023/117] #62: save the all text after __halt_compiler(); as Meta --- printer/printer_parsed_php5_test.go | 4 +++- printer/printer_parsed_php7_test.go | 4 +++- scanner/scanner.go | 2 +- scanner/scanner.l | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/printer/printer_parsed_php5_test.go b/printer/printer_parsed_php5_test.go index 09153b9..61b5a15 100644 --- a/printer/printer_parsed_php5_test.go +++ b/printer/printer_parsed_php5_test.go @@ -1037,7 +1037,9 @@ func TestParseAndPrintPhp5Goto(t *testing.T) { func TestParseAndPrintPhp5HaltCompiler(t *testing.T) { src := `{VAR_NAME}[\[\}] l.popState();l.pushState(PHP);lval.Token(l.createToken(l.ungetChars(1))); return int(T_STRING_VARNAME) . l.ungetChars(1);l.popState();l.pushState(PHP) -.|[ \t\n\r] // do nothing +.|[ \t\n\r] l.addMeta(meta.TokenType, l.Token()) %% if _, ok := l.Abort(); ok { From fd87c9cc3413d01801dee9d7c39b2667be5e600d Mon Sep 17 00:00:00 2001 From: z7zmey Date: Wed, 24 Oct 2018 17:04:13 +0300 Subject: [PATCH 024/117] remove StringVar attribute from expr.Variable --- node/expr/n_variable.go | 11 +- node/expr/t_visitor_test.go | 4 +- node/scalar/t_encapsed_test.go | 2 - php5/parser.go | 8 + php5/php5.go | 948 +++++----- php5/php5.y | 32 +- php5/php5_test.go | 341 ---- php7/parser.go | 8 + php7/php7.go | 713 ++++---- php7/php7.y | 19 +- php7/php7_test.go | 294 --- printer/printer.go | 4 - printer/printer_test.go | 2712 +++++++++++++++++++++++++--- visitor/dumper_test.go | 4 +- visitor/go_dumper.go | 30 +- visitor/go_dumper_test.go | 12 +- visitor/json_dumper_test.go | 2 +- visitor/pretty_json_dumper_test.go | 12 +- 18 files changed, 3426 insertions(+), 1730 deletions(-) diff --git a/node/expr/n_variable.go b/node/expr/n_variable.go index 858e736..f0c269d 100644 --- a/node/expr/n_variable.go +++ b/node/expr/n_variable.go @@ -9,10 +9,9 @@ import ( // Variable node type Variable struct { - Meta meta.Collection - StringVar bool - Position *position.Position - VarName node.Node + Meta meta.Collection + Position *position.Position + VarName node.Node } // NewVariable node constructor @@ -38,9 +37,7 @@ func (n *Variable) GetMeta() *meta.Collection { // Attributes returns node attributes as map func (n *Variable) Attributes() map[string]interface{} { - return map[string]interface{}{ - "StringVar": n.StringVar, - } + return nil } // SetVarName reset var name diff --git a/node/expr/t_visitor_test.go b/node/expr/t_visitor_test.go index 2087c81..a8bc087 100644 --- a/node/expr/t_visitor_test.go +++ b/node/expr/t_visitor_test.go @@ -333,9 +333,7 @@ var nodesToTest = []struct { { &expr.Variable{VarName: &node.Identifier{Value: "a"}}, []string{"VarName"}, - map[string]interface{}{ - "StringVar": false, - }, + map[string]interface{}{}, }, { &expr.YieldFrom{ diff --git a/node/scalar/t_encapsed_test.go b/node/scalar/t_encapsed_test.go index 6669ecf..c77cd8d 100644 --- a/node/scalar/t_encapsed_test.go +++ b/node/scalar/t_encapsed_test.go @@ -453,7 +453,6 @@ func TestDollarOpenCurlyBraces(t *testing.T) { StartPos: 10, EndPos: 15, }, - StringVar: true, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 1, @@ -530,7 +529,6 @@ func TestDollarOpenCurlyBracesDimNumber(t *testing.T) { StartPos: 12, EndPos: 14, }, - StringVar: true, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 1, diff --git a/php5/parser.go b/php5/parser.go index 16596c2..079bf4e 100644 --- a/php5/parser.go +++ b/php5/parser.go @@ -122,6 +122,14 @@ func (l *Parser) appendMetaToken(n node.Node, t *scanner.Token, tn meta.TokenNam n.GetMeta().Push(m) } +func (l *Parser) appendMeta(n node.Node, m *meta.Data, tn meta.TokenName) { + if !l.Lexer.WithMeta { + return + } + + n.GetMeta().Push(m) +} + func (l *Parser) prependMetaToken(n node.Node, t *scanner.Token, tn meta.TokenName) { if !l.Lexer.WithMeta { return diff --git a/php5/php5.go b/php5/php5.go index eae36b4..e98e183 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -1,3 +1,5 @@ +// Code generated by goyacc -o php5/php5.go php5/php5.y. DO NOT EDIT. + //line php5/php5.y:2 package php5 @@ -346,7 +348,7 @@ const yyEofCode = 1 const yyErrCode = 2 const yyInitialStackSize = 16 -//line php5/php5.y:6965 +//line php5/php5.y:6991 type simpleIndirectReference struct { all []*expr.Variable last *expr.Variable @@ -3539,6 +3541,7 @@ yydefault: yyDollar[1].token.Meta.SetTokenName(meta.CatchToken).AppendTo(catch.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(catch.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) yyDollar[5].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(catch.GetMeta()) yyDollar[6].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(catch.GetMeta()) yyDollar[8].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(catch.GetMeta()) @@ -3547,7 +3550,7 @@ yydefault: } case 77: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1401 + //line php5/php5.y:1402 { yyVAL.node = nil @@ -3555,7 +3558,7 @@ yydefault: } case 78: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1407 + //line php5/php5.y:1408 { yyVAL.node = stmt.NewFinally(yyDollar[3].list) @@ -3571,7 +3574,7 @@ yydefault: } case 79: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1424 + //line php5/php5.y:1425 { yyVAL.list = yyDollar[1].list @@ -3579,7 +3582,7 @@ yydefault: } case 80: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1430 + //line php5/php5.y:1431 { yyVAL.list = []node.Node{} @@ -3587,7 +3590,7 @@ yydefault: } case 81: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1439 + //line php5/php5.y:1440 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -3595,7 +3598,7 @@ yydefault: } case 82: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1445 + //line php5/php5.y:1446 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -3603,7 +3606,7 @@ yydefault: } case 83: yyDollar = yyS[yypt-8 : yypt+1] - //line php5/php5.y:1454 + //line php5/php5.y:1455 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[4].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -3618,6 +3621,7 @@ yydefault: yyDollar[1].token.Meta.SetTokenName(meta.CatchToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) yyDollar[5].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[6].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[8].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) @@ -3626,7 +3630,7 @@ yydefault: } case 84: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1478 + //line php5/php5.y:1480 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -3634,7 +3638,7 @@ yydefault: } case 85: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1484 + //line php5/php5.y:1486 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -3645,7 +3649,7 @@ yydefault: } case 86: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1496 + //line php5/php5.y:1498 { yyVAL.node = yyDollar[1].node @@ -3653,7 +3657,7 @@ yydefault: } case 87: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1505 + //line php5/php5.y:1507 { yyVAL.node = yyDollar[1].node @@ -3661,7 +3665,7 @@ yydefault: } case 88: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1514 + //line php5/php5.y:1516 { yyVAL.node = yyDollar[1].node @@ -3669,31 +3673,31 @@ yydefault: } case 89: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1523 + //line php5/php5.y:1525 { yyVAL.token = nil } case 90: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1527 + //line php5/php5.y:1529 { yyVAL.token = yyDollar[1].token } case 91: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1534 + //line php5/php5.y:1536 { yyVAL.token = nil } case 92: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1538 + //line php5/php5.y:1540 { yyVAL.token = yyDollar[1].token } case 93: yyDollar = yyS[yypt-9 : yypt+1] - //line php5/php5.y:1545 + //line php5/php5.y:1547 { name := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewFunction(name, yyDollar[2].token != nil, yyDollar[5].list, nil, yyDollar[8].list, "") @@ -3717,7 +3721,7 @@ yydefault: } case 94: yyDollar = yyS[yypt-7 : yypt+1] - //line php5/php5.y:1570 + //line php5/php5.y:1572 { name := node.NewIdentifier(yyDollar[2].token.Value) switch n := yyDollar[1].node.(type) { @@ -3747,7 +3751,7 @@ yydefault: } case 95: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:1598 + //line php5/php5.y:1600 { name := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewInterface(name, yyDollar[3].InterfaceExtends, yyDollar[5].list, "") @@ -3766,7 +3770,7 @@ yydefault: } case 96: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1619 + //line php5/php5.y:1621 { yyVAL.node = stmt.NewClass(nil, nil, nil, nil, nil, nil, "") @@ -3780,7 +3784,7 @@ yydefault: } case 97: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1631 + //line php5/php5.y:1633 { classModifier := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewClass(nil, []node.Node{classModifier}, nil, nil, nil, nil, "") @@ -3797,7 +3801,7 @@ yydefault: } case 98: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1646 + //line php5/php5.y:1648 { yyVAL.node = stmt.NewTrait(nil, nil, "") @@ -3811,7 +3815,7 @@ yydefault: } case 99: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1658 + //line php5/php5.y:1660 { classModifier := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewClass(nil, []node.Node{classModifier}, nil, nil, nil, nil, "") @@ -3828,7 +3832,7 @@ yydefault: } case 100: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1676 + //line php5/php5.y:1678 { yyVAL.ClassExtends = nil @@ -3836,7 +3840,7 @@ yydefault: } case 101: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1682 + //line php5/php5.y:1684 { yyVAL.ClassExtends = stmt.NewClassExtends(yyDollar[2].node) @@ -3850,13 +3854,13 @@ yydefault: } case 102: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1697 + //line php5/php5.y:1699 { yyVAL.token = yyDollar[1].token } case 103: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1704 + //line php5/php5.y:1706 { yyVAL.InterfaceExtends = nil @@ -3864,7 +3868,7 @@ yydefault: } case 104: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1710 + //line php5/php5.y:1712 { yyVAL.InterfaceExtends = stmt.NewInterfaceExtends(yyDollar[2].list) @@ -3878,7 +3882,7 @@ yydefault: } case 105: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1725 + //line php5/php5.y:1727 { yyVAL.ClassImplements = nil @@ -3886,7 +3890,7 @@ yydefault: } case 106: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1731 + //line php5/php5.y:1733 { yyVAL.ClassImplements = stmt.NewClassImplements(yyDollar[2].list) @@ -3900,7 +3904,7 @@ yydefault: } case 107: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1746 + //line php5/php5.y:1748 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -3908,7 +3912,7 @@ yydefault: } case 108: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1752 + //line php5/php5.y:1754 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -3919,7 +3923,7 @@ yydefault: } case 109: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1764 + //line php5/php5.y:1766 { yyVAL.node = nil @@ -3927,7 +3931,7 @@ yydefault: } case 110: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1770 + //line php5/php5.y:1772 { yyVAL.node = yyDollar[2].node @@ -3938,7 +3942,7 @@ yydefault: } case 111: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1782 + //line php5/php5.y:1784 { yyVAL.node = yyDollar[1].node @@ -3946,7 +3950,7 @@ yydefault: } case 112: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1788 + //line php5/php5.y:1790 { yyVAL.node = expr.NewReference(yyDollar[2].node) @@ -3960,7 +3964,7 @@ yydefault: } case 113: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1800 + //line php5/php5.y:1802 { yyVAL.node = expr.NewList(yyDollar[3].list) @@ -3976,7 +3980,7 @@ yydefault: } case 114: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1817 + //line php5/php5.y:1819 { yyVAL.node = stmt.NewFor(nil, nil, nil, yyDollar[1].node) @@ -3987,7 +3991,7 @@ yydefault: } case 115: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1826 + //line php5/php5.y:1828 { stmtList := stmt.NewStmtList(yyDollar[2].list) yyVAL.node = stmt.NewAltFor(nil, nil, nil, stmtList) @@ -4006,7 +4010,7 @@ yydefault: } case 116: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1846 + //line php5/php5.y:1848 { yyVAL.node = stmt.NewForeach(nil, nil, nil, yyDollar[1].node) @@ -4017,7 +4021,7 @@ yydefault: } case 117: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1855 + //line php5/php5.y:1857 { stmtList := stmt.NewStmtList(yyDollar[2].list) yyVAL.node = stmt.NewAltForeach(nil, nil, nil, stmtList) @@ -4036,7 +4040,7 @@ yydefault: } case 118: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1876 + //line php5/php5.y:1878 { yyVAL.node = stmt.NewDeclare(nil, yyDollar[1].node, false) @@ -4047,7 +4051,7 @@ yydefault: } case 119: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1885 + //line php5/php5.y:1887 { stmtList := stmt.NewStmtList(yyDollar[2].list) yyVAL.node = stmt.NewDeclare(nil, stmtList, true) @@ -4066,7 +4070,7 @@ yydefault: } case 120: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1906 + //line php5/php5.y:1908 { name := node.NewIdentifier(yyDollar[1].token.Value) constant := stmt.NewConstant(name, yyDollar[3].node, "") @@ -4084,7 +4088,7 @@ yydefault: } case 121: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1922 + //line php5/php5.y:1924 { name := node.NewIdentifier(yyDollar[3].token.Value) constant := stmt.NewConstant(name, yyDollar[5].node, "") @@ -4103,7 +4107,7 @@ yydefault: } case 122: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1943 + //line php5/php5.y:1945 { caseList := stmt.NewCaseList(yyDollar[2].list) yyVAL.node = stmt.NewSwitch(nil, caseList) @@ -4120,7 +4124,7 @@ yydefault: } case 123: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1958 + //line php5/php5.y:1960 { caseList := stmt.NewCaseList(yyDollar[3].list) yyVAL.node = stmt.NewSwitch(nil, caseList) @@ -4139,7 +4143,7 @@ yydefault: } case 124: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1975 + //line php5/php5.y:1977 { caseList := stmt.NewCaseList(yyDollar[2].list) yyVAL.node = stmt.NewAltSwitch(nil, caseList) @@ -4158,7 +4162,7 @@ yydefault: } case 125: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1992 + //line php5/php5.y:1994 { caseList := stmt.NewCaseList(yyDollar[3].list) @@ -4180,7 +4184,7 @@ yydefault: } case 126: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2016 + //line php5/php5.y:2018 { yyVAL.list = []node.Node{} @@ -4188,7 +4192,7 @@ yydefault: } case 127: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:2022 + //line php5/php5.y:2024 { _case := stmt.NewCase(yyDollar[3].node, yyDollar[5].list) yyVAL.list = append(yyDollar[1].list, _case) @@ -4205,7 +4209,7 @@ yydefault: } case 128: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2037 + //line php5/php5.y:2039 { _default := stmt.NewDefault(yyDollar[4].list) yyVAL.list = append(yyDollar[1].list, _default) @@ -4222,19 +4226,19 @@ yydefault: } case 129: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2056 + //line php5/php5.y:2058 { yyVAL.token = yyDollar[1].token } case 130: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2060 + //line php5/php5.y:2062 { yyVAL.token = yyDollar[1].token } case 131: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2068 + //line php5/php5.y:2070 { yyVAL.node = stmt.NewWhile(nil, yyDollar[1].node) @@ -4245,7 +4249,7 @@ yydefault: } case 132: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2077 + //line php5/php5.y:2079 { stmtList := stmt.NewStmtList(yyDollar[2].list) yyVAL.node = stmt.NewAltWhile(nil, stmtList) @@ -4264,7 +4268,7 @@ yydefault: } case 133: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2099 + //line php5/php5.y:2101 { yyVAL.list = nil @@ -4272,7 +4276,7 @@ yydefault: } case 134: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2105 + //line php5/php5.y:2107 { _elseIf := stmt.NewElseIf(yyDollar[3].node, yyDollar[4].node) yyVAL.list = append(yyDollar[1].list, _elseIf) @@ -4289,7 +4293,7 @@ yydefault: } case 135: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2124 + //line php5/php5.y:2126 { yyVAL.list = nil @@ -4297,7 +4301,7 @@ yydefault: } case 136: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:2130 + //line php5/php5.y:2132 { stmts := stmt.NewStmtList(yyDollar[5].list) _elseIf := stmt.NewAltElseIf(yyDollar[3].node, stmts) @@ -4317,7 +4321,7 @@ yydefault: } case 137: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2152 + //line php5/php5.y:2154 { yyVAL.node = nil @@ -4325,7 +4329,7 @@ yydefault: } case 138: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2158 + //line php5/php5.y:2160 { yyVAL.node = stmt.NewElse(yyDollar[2].node) @@ -4339,7 +4343,7 @@ yydefault: } case 139: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2174 + //line php5/php5.y:2176 { yyVAL.node = nil @@ -4347,7 +4351,7 @@ yydefault: } case 140: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2180 + //line php5/php5.y:2182 { stmts := stmt.NewStmtList(yyDollar[3].list) yyVAL.node = stmt.NewAltElse(stmts) @@ -4364,7 +4368,7 @@ yydefault: } case 141: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2199 + //line php5/php5.y:2201 { yyVAL.list = yyDollar[1].list @@ -4372,7 +4376,7 @@ yydefault: } case 142: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2205 + //line php5/php5.y:2207 { yyVAL.list = nil @@ -4380,7 +4384,7 @@ yydefault: } case 143: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2214 + //line php5/php5.y:2216 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4388,7 +4392,7 @@ yydefault: } case 144: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2220 + //line php5/php5.y:2222 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4399,7 +4403,7 @@ yydefault: } case 145: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2232 + //line php5/php5.y:2234 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[4].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -4426,12 +4430,13 @@ yydefault: yyDollar[3].token.Meta.SetTokenName(meta.EllipsisToken).AppendTo(yyVAL.node.GetMeta()) } yyDollar[4].token.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 146: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:2262 + //line php5/php5.y:2265 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[4].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -4458,13 +4463,14 @@ yydefault: yyDollar[3].token.Meta.SetTokenName(meta.EllipsisToken).AppendTo(yyVAL.node.GetMeta()) } yyDollar[4].token.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) yyDollar[5].token.Meta.SetTokenName(meta.EqualToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 147: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2297 + //line php5/php5.y:2301 { yyVAL.node = nil @@ -4472,7 +4478,7 @@ yydefault: } case 148: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2303 + //line php5/php5.y:2307 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4486,7 +4492,7 @@ yydefault: } case 149: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2315 + //line php5/php5.y:2319 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4500,7 +4506,7 @@ yydefault: } case 150: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2327 + //line php5/php5.y:2331 { yyVAL.node = yyDollar[1].node @@ -4508,7 +4514,7 @@ yydefault: } case 151: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2337 + //line php5/php5.y:2341 { yyVAL.node = node.NewArgumentList(nil) @@ -4523,7 +4529,7 @@ yydefault: } case 152: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2350 + //line php5/php5.y:2354 { yyVAL.node = node.NewArgumentList(yyDollar[2].list) @@ -4538,7 +4544,7 @@ yydefault: } case 153: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2363 + //line php5/php5.y:2367 { arg := node.NewArgument(yyDollar[2].node, false, false) yyVAL.node = node.NewArgumentList([]node.Node{arg}) @@ -4555,7 +4561,7 @@ yydefault: } case 154: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2382 + //line php5/php5.y:2386 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4563,7 +4569,7 @@ yydefault: } case 155: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2388 + //line php5/php5.y:2392 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4574,7 +4580,7 @@ yydefault: } case 156: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2400 + //line php5/php5.y:2404 { yyVAL.node = node.NewArgument(yyDollar[1].node, false, false) @@ -4585,7 +4591,7 @@ yydefault: } case 157: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2409 + //line php5/php5.y:2413 { yyVAL.node = node.NewArgument(yyDollar[1].node, false, false) @@ -4596,7 +4602,7 @@ yydefault: } case 158: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2418 + //line php5/php5.y:2422 { yyVAL.node = node.NewArgument(yyDollar[2].node, false, true) @@ -4610,7 +4616,7 @@ yydefault: } case 159: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2430 + //line php5/php5.y:2434 { yyVAL.node = node.NewArgument(yyDollar[2].node, true, false) @@ -4624,7 +4630,7 @@ yydefault: } case 160: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2445 + //line php5/php5.y:2449 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4635,7 +4641,7 @@ yydefault: } case 161: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2454 + //line php5/php5.y:2458 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4643,7 +4649,7 @@ yydefault: } case 162: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2464 + //line php5/php5.y:2468 { name := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(name) @@ -4654,12 +4660,13 @@ yydefault: // save comments yyDollar[1].token.Meta.SetTokenName(meta.VariableToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMeta(yyVAL.node, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 163: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2478 + //line php5/php5.y:2483 { yyVAL.node = expr.NewVariable(yyDollar[2].node) @@ -4668,12 +4675,14 @@ yydefault: // save comments yyDollar[1].token.Meta.SetTokenName(meta.DollarToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.DollarToken) + yylex.(*Parser).appendMeta(yyVAL.node, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 164: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2490 + //line php5/php5.y:2497 { yyVAL.node = expr.NewVariable(yyDollar[3].node) @@ -4682,6 +4691,7 @@ yydefault: // save comments yyDollar[1].token.Meta.SetTokenName(meta.DollarToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.DollarToken) yyDollar[2].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) @@ -4689,7 +4699,7 @@ yydefault: } case 165: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2508 + //line php5/php5.y:2516 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[3].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -4704,12 +4714,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 166: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:2526 + //line php5/php5.y:2535 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[3].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -4724,13 +4735,14 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) yyDollar[4].token.Meta.SetTokenName(meta.EqualToken).AppendTo(staticVar.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 167: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2545 + //line php5/php5.y:2555 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -4744,12 +4756,13 @@ yydefault: // save comments yyDollar[1].token.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 168: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2562 + //line php5/php5.y:2573 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -4763,13 +4776,14 @@ yydefault: // save comments yyDollar[1].token.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) yyDollar[2].token.Meta.SetTokenName(meta.EqualToken).AppendTo(staticVar.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 169: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2584 + //line php5/php5.y:2596 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -4777,7 +4791,7 @@ yydefault: } case 170: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2590 + //line php5/php5.y:2602 { yyVAL.list = []node.Node{} @@ -4785,7 +4799,7 @@ yydefault: } case 171: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2600 + //line php5/php5.y:2612 { yyVAL.node = stmt.NewPropertyList(yyDollar[1].list, yyDollar[2].list) @@ -4800,7 +4814,7 @@ yydefault: } case 172: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2613 + //line php5/php5.y:2625 { yyVAL.node = yyDollar[1].node @@ -4815,7 +4829,7 @@ yydefault: } case 173: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2626 + //line php5/php5.y:2638 { yyVAL.node = yyDollar[1].node @@ -4823,7 +4837,7 @@ yydefault: } case 174: yyDollar = yyS[yypt-8 : yypt+1] - //line php5/php5.y:2632 + //line php5/php5.y:2644 { name := node.NewIdentifier(yyDollar[4].token.Value) yyVAL.node = stmt.NewClassMethod(name, yyDollar[1].list, yyDollar[3].token != nil, yyDollar[6].list, nil, yyDollar[8].node, "") @@ -4849,7 +4863,7 @@ yydefault: } case 175: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2659 + //line php5/php5.y:2671 { yyVAL.node = stmt.NewTraitUse(yyDollar[2].list, yyDollar[3].node) @@ -4863,7 +4877,7 @@ yydefault: } case 176: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2674 + //line php5/php5.y:2686 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4871,7 +4885,7 @@ yydefault: } case 177: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2680 + //line php5/php5.y:2692 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4882,7 +4896,7 @@ yydefault: } case 178: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2692 + //line php5/php5.y:2704 { yyVAL.node = stmt.NewNop() @@ -4896,7 +4910,7 @@ yydefault: } case 179: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2705 + //line php5/php5.y:2717 { yyVAL.node = stmt.NewTraitAdaptationList(yyDollar[2].list) @@ -4910,7 +4924,7 @@ yydefault: } case 180: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2720 + //line php5/php5.y:2732 { yyVAL.list = nil @@ -4918,7 +4932,7 @@ yydefault: } case 181: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2726 + //line php5/php5.y:2738 { yyVAL.list = yyDollar[1].list @@ -4926,7 +4940,7 @@ yydefault: } case 182: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2735 + //line php5/php5.y:2747 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4934,7 +4948,7 @@ yydefault: } case 183: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2741 + //line php5/php5.y:2753 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -4942,7 +4956,7 @@ yydefault: } case 184: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2750 + //line php5/php5.y:2762 { yyVAL.node = yyDollar[1].node @@ -4954,7 +4968,7 @@ yydefault: } case 185: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2760 + //line php5/php5.y:2772 { yyVAL.node = yyDollar[1].node @@ -4966,7 +4980,7 @@ yydefault: } case 186: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2773 + //line php5/php5.y:2785 { yyVAL.node = stmt.NewTraitUsePrecedence(yyDollar[1].node, yyDollar[3].list) @@ -4980,7 +4994,7 @@ yydefault: } case 187: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2788 + //line php5/php5.y:2800 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4988,7 +5002,7 @@ yydefault: } case 188: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2794 + //line php5/php5.y:2806 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4999,7 +5013,7 @@ yydefault: } case 189: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2806 + //line php5/php5.y:2818 { name := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewTraitMethodRef(nil, name) @@ -5015,7 +5029,7 @@ yydefault: } case 190: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2820 + //line php5/php5.y:2832 { yyVAL.node = yyDollar[1].node @@ -5023,7 +5037,7 @@ yydefault: } case 191: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2829 + //line php5/php5.y:2841 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewTraitMethodRef(yyDollar[1].node, target) @@ -5040,7 +5054,7 @@ yydefault: } case 192: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2847 + //line php5/php5.y:2859 { alias := node.NewIdentifier(yyDollar[4].token.Value) yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, yyDollar[3].node, alias) @@ -5057,7 +5071,7 @@ yydefault: } case 193: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2862 + //line php5/php5.y:2874 { yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, yyDollar[3].node, nil) @@ -5071,7 +5085,7 @@ yydefault: } case 194: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2877 + //line php5/php5.y:2889 { yyVAL.node = nil @@ -5079,7 +5093,7 @@ yydefault: } case 195: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2883 + //line php5/php5.y:2895 { yyVAL.node = yyDollar[1].node @@ -5087,7 +5101,7 @@ yydefault: } case 196: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2892 + //line php5/php5.y:2904 { yyVAL.node = stmt.NewNop() @@ -5102,7 +5116,7 @@ yydefault: } case 197: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2905 + //line php5/php5.y:2917 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) @@ -5117,7 +5131,7 @@ yydefault: } case 198: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2921 + //line php5/php5.y:2933 { yyVAL.list = yyDollar[1].list @@ -5125,7 +5139,7 @@ yydefault: } case 199: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2927 + //line php5/php5.y:2939 { modifier := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.list = []node.Node{modifier} @@ -5140,7 +5154,7 @@ yydefault: } case 200: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2943 + //line php5/php5.y:2955 { yyVAL.list = nil @@ -5148,7 +5162,7 @@ yydefault: } case 201: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2949 + //line php5/php5.y:2961 { yyVAL.list = yyDollar[1].list @@ -5156,7 +5170,7 @@ yydefault: } case 202: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2958 + //line php5/php5.y:2970 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -5164,27 +5178,13 @@ yydefault: } case 203: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2964 + //line php5/php5.y:2976 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 204: - yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2973 - { - yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) - - // save position - yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - - // save comments - yyDollar[1].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(yyVAL.node.GetMeta()) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - case 205: yyDollar = yyS[yypt-1 : yypt+1] //line php5/php5.y:2985 { @@ -5198,7 +5198,7 @@ yydefault: yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } - case 206: + case 205: yyDollar = yyS[yypt-1 : yypt+1] //line php5/php5.y:2997 { @@ -5212,7 +5212,7 @@ yydefault: yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } - case 207: + case 206: yyDollar = yyS[yypt-1 : yypt+1] //line php5/php5.y:3009 { @@ -5226,7 +5226,7 @@ yydefault: yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } - case 208: + case 207: yyDollar = yyS[yypt-1 : yypt+1] //line php5/php5.y:3021 { @@ -5240,7 +5240,7 @@ yydefault: yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } - case 209: + case 208: yyDollar = yyS[yypt-1 : yypt+1] //line php5/php5.y:3033 { @@ -5252,11 +5252,25 @@ yydefault: // save comments yyDollar[1].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + case 209: + yyDollar = yyS[yypt-1 : yypt+1] + //line php5/php5.y:3045 + { + yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) + + // save position + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + + // save comments + yyDollar[1].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 210: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3048 + //line php5/php5.y:3060 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[3].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -5271,12 +5285,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 211: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:3066 + //line php5/php5.y:3079 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[3].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -5291,13 +5306,14 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) yyDollar[4].token.Meta.SetTokenName(meta.EqualToken).AppendTo(property.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 212: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3085 + //line php5/php5.y:3099 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -5311,12 +5327,13 @@ yydefault: // save comments yyDollar[1].token.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 213: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3102 + //line php5/php5.y:3117 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -5330,13 +5347,14 @@ yydefault: // save comments yyDollar[1].token.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) yyDollar[2].token.Meta.SetTokenName(meta.EqualToken).AppendTo(property.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 214: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:3123 + //line php5/php5.y:3139 { name := node.NewIdentifier(yyDollar[3].token.Value) constant := stmt.NewConstant(name, yyDollar[5].node, "") @@ -5359,7 +5377,7 @@ yydefault: } case 215: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3144 + //line php5/php5.y:3160 { name := node.NewIdentifier(yyDollar[2].token.Value) constant := stmt.NewConstant(name, yyDollar[4].node, "") @@ -5379,7 +5397,7 @@ yydefault: } case 216: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3165 + //line php5/php5.y:3181 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -5390,7 +5408,7 @@ yydefault: } case 217: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3174 + //line php5/php5.y:3190 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -5398,7 +5416,7 @@ yydefault: } case 218: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3184 + //line php5/php5.y:3200 { yyVAL.list = nil @@ -5406,7 +5424,7 @@ yydefault: } case 219: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3190 + //line php5/php5.y:3206 { yyVAL.list = yyDollar[1].list @@ -5414,7 +5432,7 @@ yydefault: } case 220: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3199 + //line php5/php5.y:3215 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -5425,7 +5443,7 @@ yydefault: } case 221: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3208 + //line php5/php5.y:3224 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -5433,7 +5451,7 @@ yydefault: } case 222: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3217 + //line php5/php5.y:3233 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) @@ -5441,7 +5459,7 @@ yydefault: } case 223: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3223 + //line php5/php5.y:3239 { yyVAL.list = yyDollar[1].list @@ -5449,7 +5467,7 @@ yydefault: } case 224: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3232 + //line php5/php5.y:3248 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yyVAL.list = append(yyDollar[1].list, fetch) @@ -5467,7 +5485,7 @@ yydefault: } case 225: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3248 + //line php5/php5.y:3264 { fetch := expr.NewArrayDimFetch(nil, yyDollar[2].node) yyVAL.list = []node.Node{fetch} @@ -5485,7 +5503,7 @@ yydefault: } case 226: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3267 + //line php5/php5.y:3283 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) @@ -5493,7 +5511,7 @@ yydefault: } case 227: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3273 + //line php5/php5.y:3289 { yyVAL.list = yyDollar[1].list @@ -5501,7 +5519,7 @@ yydefault: } case 228: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3279 + //line php5/php5.y:3295 { yyVAL.list = yyDollar[1].list @@ -5509,7 +5527,7 @@ yydefault: } case 229: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3288 + //line php5/php5.y:3304 { yyVAL.list = nil @@ -5517,7 +5535,7 @@ yydefault: } case 230: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3294 + //line php5/php5.y:3310 { yyVAL.list = yyDollar[1].list @@ -5525,7 +5543,7 @@ yydefault: } case 231: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3303 + //line php5/php5.y:3319 { if yyDollar[3].node != nil { @@ -5543,7 +5561,7 @@ yydefault: } case 232: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:3322 + //line php5/php5.y:3338 { list := expr.NewList(yyDollar[3].list) yyVAL.node = assign.NewAssign(list, yyDollar[6].node) @@ -5562,7 +5580,7 @@ yydefault: } case 233: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3339 + //line php5/php5.y:3355 { yyVAL.node = assign.NewAssign(yyDollar[1].node, yyDollar[3].node) @@ -5576,7 +5594,7 @@ yydefault: } case 234: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3351 + //line php5/php5.y:3367 { yyVAL.node = assign.NewReference(yyDollar[1].node, yyDollar[4].node) @@ -5591,7 +5609,7 @@ yydefault: } case 235: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:3364 + //line php5/php5.y:3380 { var _new *expr.New @@ -5619,7 +5637,7 @@ yydefault: } case 236: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3390 + //line php5/php5.y:3406 { yyVAL.node = expr.NewClone(yyDollar[2].node) @@ -5633,7 +5651,7 @@ yydefault: } case 237: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3402 + //line php5/php5.y:3418 { yyVAL.node = assign.NewPlus(yyDollar[1].node, yyDollar[3].node) @@ -5647,7 +5665,7 @@ yydefault: } case 238: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3414 + //line php5/php5.y:3430 { yyVAL.node = assign.NewMinus(yyDollar[1].node, yyDollar[3].node) @@ -5661,7 +5679,7 @@ yydefault: } case 239: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3426 + //line php5/php5.y:3442 { yyVAL.node = assign.NewMul(yyDollar[1].node, yyDollar[3].node) @@ -5675,7 +5693,7 @@ yydefault: } case 240: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3438 + //line php5/php5.y:3454 { yyVAL.node = assign.NewPow(yyDollar[1].node, yyDollar[3].node) @@ -5689,7 +5707,7 @@ yydefault: } case 241: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3450 + //line php5/php5.y:3466 { yyVAL.node = assign.NewDiv(yyDollar[1].node, yyDollar[3].node) @@ -5703,7 +5721,7 @@ yydefault: } case 242: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3462 + //line php5/php5.y:3478 { yyVAL.node = assign.NewConcat(yyDollar[1].node, yyDollar[3].node) @@ -5717,7 +5735,7 @@ yydefault: } case 243: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3474 + //line php5/php5.y:3490 { yyVAL.node = assign.NewMod(yyDollar[1].node, yyDollar[3].node) @@ -5731,7 +5749,7 @@ yydefault: } case 244: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3486 + //line php5/php5.y:3502 { yyVAL.node = assign.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) @@ -5745,7 +5763,7 @@ yydefault: } case 245: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3498 + //line php5/php5.y:3514 { yyVAL.node = assign.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) @@ -5759,7 +5777,7 @@ yydefault: } case 246: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3510 + //line php5/php5.y:3526 { yyVAL.node = assign.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) @@ -5773,7 +5791,7 @@ yydefault: } case 247: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3522 + //line php5/php5.y:3538 { yyVAL.node = assign.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) @@ -5787,7 +5805,7 @@ yydefault: } case 248: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3534 + //line php5/php5.y:3550 { yyVAL.node = assign.NewShiftRight(yyDollar[1].node, yyDollar[3].node) @@ -5801,7 +5819,7 @@ yydefault: } case 249: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3546 + //line php5/php5.y:3562 { yyVAL.node = expr.NewPostInc(yyDollar[1].node) @@ -5815,7 +5833,7 @@ yydefault: } case 250: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3558 + //line php5/php5.y:3574 { yyVAL.node = expr.NewPreInc(yyDollar[2].node) @@ -5829,7 +5847,7 @@ yydefault: } case 251: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3570 + //line php5/php5.y:3586 { yyVAL.node = expr.NewPostDec(yyDollar[1].node) @@ -5843,7 +5861,7 @@ yydefault: } case 252: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3582 + //line php5/php5.y:3598 { yyVAL.node = expr.NewPreDec(yyDollar[2].node) @@ -5857,7 +5875,7 @@ yydefault: } case 253: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3594 + //line php5/php5.y:3610 { yyVAL.node = binary.NewBooleanOr(yyDollar[1].node, yyDollar[3].node) @@ -5871,7 +5889,7 @@ yydefault: } case 254: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3606 + //line php5/php5.y:3622 { yyVAL.node = binary.NewBooleanAnd(yyDollar[1].node, yyDollar[3].node) @@ -5885,7 +5903,7 @@ yydefault: } case 255: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3618 + //line php5/php5.y:3634 { yyVAL.node = binary.NewLogicalOr(yyDollar[1].node, yyDollar[3].node) @@ -5899,7 +5917,7 @@ yydefault: } case 256: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3630 + //line php5/php5.y:3646 { yyVAL.node = binary.NewLogicalAnd(yyDollar[1].node, yyDollar[3].node) @@ -5913,7 +5931,7 @@ yydefault: } case 257: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3642 + //line php5/php5.y:3658 { yyVAL.node = binary.NewLogicalXor(yyDollar[1].node, yyDollar[3].node) @@ -5927,7 +5945,7 @@ yydefault: } case 258: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3654 + //line php5/php5.y:3670 { yyVAL.node = binary.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) @@ -5941,7 +5959,7 @@ yydefault: } case 259: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3666 + //line php5/php5.y:3682 { yyVAL.node = binary.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) @@ -5955,7 +5973,7 @@ yydefault: } case 260: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3678 + //line php5/php5.y:3694 { yyVAL.node = binary.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) @@ -5969,7 +5987,7 @@ yydefault: } case 261: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3690 + //line php5/php5.y:3706 { yyVAL.node = binary.NewConcat(yyDollar[1].node, yyDollar[3].node) @@ -5983,7 +6001,7 @@ yydefault: } case 262: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3702 + //line php5/php5.y:3718 { yyVAL.node = binary.NewPlus(yyDollar[1].node, yyDollar[3].node) @@ -5997,7 +6015,7 @@ yydefault: } case 263: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3714 + //line php5/php5.y:3730 { yyVAL.node = binary.NewMinus(yyDollar[1].node, yyDollar[3].node) @@ -6011,7 +6029,7 @@ yydefault: } case 264: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3726 + //line php5/php5.y:3742 { yyVAL.node = binary.NewMul(yyDollar[1].node, yyDollar[3].node) @@ -6025,7 +6043,7 @@ yydefault: } case 265: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3738 + //line php5/php5.y:3754 { yyVAL.node = binary.NewPow(yyDollar[1].node, yyDollar[3].node) @@ -6039,7 +6057,7 @@ yydefault: } case 266: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3750 + //line php5/php5.y:3766 { yyVAL.node = binary.NewDiv(yyDollar[1].node, yyDollar[3].node) @@ -6053,7 +6071,7 @@ yydefault: } case 267: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3762 + //line php5/php5.y:3778 { yyVAL.node = binary.NewMod(yyDollar[1].node, yyDollar[3].node) @@ -6067,7 +6085,7 @@ yydefault: } case 268: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3774 + //line php5/php5.y:3790 { yyVAL.node = binary.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) @@ -6081,7 +6099,7 @@ yydefault: } case 269: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3786 + //line php5/php5.y:3802 { yyVAL.node = binary.NewShiftRight(yyDollar[1].node, yyDollar[3].node) @@ -6095,7 +6113,7 @@ yydefault: } case 270: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3798 + //line php5/php5.y:3814 { yyVAL.node = expr.NewUnaryPlus(yyDollar[2].node) @@ -6109,7 +6127,7 @@ yydefault: } case 271: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3810 + //line php5/php5.y:3826 { yyVAL.node = expr.NewUnaryMinus(yyDollar[2].node) @@ -6123,7 +6141,7 @@ yydefault: } case 272: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3822 + //line php5/php5.y:3838 { yyVAL.node = expr.NewBooleanNot(yyDollar[2].node) @@ -6137,7 +6155,7 @@ yydefault: } case 273: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3834 + //line php5/php5.y:3850 { yyVAL.node = expr.NewBitwiseNot(yyDollar[2].node) @@ -6151,7 +6169,7 @@ yydefault: } case 274: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3846 + //line php5/php5.y:3862 { yyVAL.node = binary.NewIdentical(yyDollar[1].node, yyDollar[3].node) @@ -6165,7 +6183,7 @@ yydefault: } case 275: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3858 + //line php5/php5.y:3874 { yyVAL.node = binary.NewNotIdentical(yyDollar[1].node, yyDollar[3].node) @@ -6179,7 +6197,7 @@ yydefault: } case 276: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3870 + //line php5/php5.y:3886 { yyVAL.node = binary.NewEqual(yyDollar[1].node, yyDollar[3].node) @@ -6193,7 +6211,7 @@ yydefault: } case 277: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3882 + //line php5/php5.y:3898 { yyVAL.node = binary.NewNotEqual(yyDollar[1].node, yyDollar[3].node) @@ -6208,7 +6226,7 @@ yydefault: } case 278: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3895 + //line php5/php5.y:3911 { yyVAL.node = binary.NewSmaller(yyDollar[1].node, yyDollar[3].node) @@ -6222,7 +6240,7 @@ yydefault: } case 279: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3907 + //line php5/php5.y:3923 { yyVAL.node = binary.NewSmallerOrEqual(yyDollar[1].node, yyDollar[3].node) @@ -6236,7 +6254,7 @@ yydefault: } case 280: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3919 + //line php5/php5.y:3935 { yyVAL.node = binary.NewGreater(yyDollar[1].node, yyDollar[3].node) @@ -6250,7 +6268,7 @@ yydefault: } case 281: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3931 + //line php5/php5.y:3947 { yyVAL.node = binary.NewGreaterOrEqual(yyDollar[1].node, yyDollar[3].node) @@ -6264,7 +6282,7 @@ yydefault: } case 282: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3943 + //line php5/php5.y:3959 { yyVAL.node = expr.NewInstanceOf(yyDollar[1].node, yyDollar[3].node) @@ -6278,7 +6296,7 @@ yydefault: } case 283: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3955 + //line php5/php5.y:3971 { yyVAL.node = yyDollar[1].node @@ -6289,7 +6307,7 @@ yydefault: } case 284: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3964 + //line php5/php5.y:3980 { yyVAL.node = yyDollar[1].node @@ -6297,7 +6315,7 @@ yydefault: } case 285: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3970 + //line php5/php5.y:3986 { yyVAL.node = yyDollar[2].node @@ -6328,7 +6346,7 @@ yydefault: } case 286: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:3999 + //line php5/php5.y:4015 { yyVAL.node = expr.NewTernary(yyDollar[1].node, yyDollar[3].node, yyDollar[5].node) @@ -6343,7 +6361,7 @@ yydefault: } case 287: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4012 + //line php5/php5.y:4028 { yyVAL.node = expr.NewTernary(yyDollar[1].node, nil, yyDollar[4].node) @@ -6358,7 +6376,7 @@ yydefault: } case 288: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4025 + //line php5/php5.y:4041 { yyVAL.node = yyDollar[1].node @@ -6366,7 +6384,7 @@ yydefault: } case 289: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4031 + //line php5/php5.y:4047 { yyVAL.node = cast.NewInt(yyDollar[2].node) @@ -6381,7 +6399,7 @@ yydefault: } case 290: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4044 + //line php5/php5.y:4060 { yyVAL.node = cast.NewDouble(yyDollar[2].node) @@ -6396,7 +6414,7 @@ yydefault: } case 291: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4057 + //line php5/php5.y:4073 { yyVAL.node = cast.NewString(yyDollar[2].node) @@ -6411,7 +6429,7 @@ yydefault: } case 292: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4070 + //line php5/php5.y:4086 { yyVAL.node = cast.NewArray(yyDollar[2].node) @@ -6426,7 +6444,7 @@ yydefault: } case 293: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4083 + //line php5/php5.y:4099 { yyVAL.node = cast.NewObject(yyDollar[2].node) @@ -6441,7 +6459,7 @@ yydefault: } case 294: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4096 + //line php5/php5.y:4112 { yyVAL.node = cast.NewBool(yyDollar[2].node) @@ -6456,7 +6474,7 @@ yydefault: } case 295: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4109 + //line php5/php5.y:4125 { yyVAL.node = cast.NewUnset(yyDollar[2].node) @@ -6471,7 +6489,7 @@ yydefault: } case 296: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4122 + //line php5/php5.y:4138 { var e *expr.Exit if yyDollar[2].node != nil { @@ -6500,7 +6518,7 @@ yydefault: } case 297: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4149 + //line php5/php5.y:4165 { yyVAL.node = expr.NewErrorSuppress(yyDollar[2].node) @@ -6514,7 +6532,7 @@ yydefault: } case 298: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4161 + //line php5/php5.y:4177 { yyVAL.node = yyDollar[1].node @@ -6522,7 +6540,7 @@ yydefault: } case 299: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4167 + //line php5/php5.y:4183 { yyVAL.node = yyDollar[1].node @@ -6530,7 +6548,7 @@ yydefault: } case 300: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4173 + //line php5/php5.y:4189 { yyVAL.node = yyDollar[1].node @@ -6538,7 +6556,7 @@ yydefault: } case 301: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4179 + //line php5/php5.y:4195 { yyVAL.node = expr.NewShellExec(yyDollar[2].list) @@ -6553,7 +6571,7 @@ yydefault: } case 302: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4192 + //line php5/php5.y:4208 { yyVAL.node = expr.NewPrint(yyDollar[2].node) @@ -6567,7 +6585,7 @@ yydefault: } case 303: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4204 + //line php5/php5.y:4220 { yyVAL.node = expr.NewYield(nil, nil) @@ -6581,7 +6599,7 @@ yydefault: } case 304: yyDollar = yyS[yypt-9 : yypt+1] - //line php5/php5.y:4216 + //line php5/php5.y:4232 { yyVAL.node = expr.NewClosure(yyDollar[4].list, yyDollar[6].ClosureUse, nil, yyDollar[8].list, false, yyDollar[2].token != nil, "") @@ -6602,7 +6620,7 @@ yydefault: } case 305: yyDollar = yyS[yypt-10 : yypt+1] - //line php5/php5.y:4235 + //line php5/php5.y:4251 { yyVAL.node = expr.NewClosure(yyDollar[5].list, yyDollar[7].ClosureUse, nil, yyDollar[9].list, true, yyDollar[3].token != nil, "") @@ -6624,7 +6642,7 @@ yydefault: } case 306: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4258 + //line php5/php5.y:4274 { yyVAL.node = expr.NewYield(nil, yyDollar[2].node) @@ -6638,7 +6656,7 @@ yydefault: } case 307: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4270 + //line php5/php5.y:4286 { yyVAL.node = expr.NewYield(nil, yyDollar[2].node) @@ -6652,7 +6670,7 @@ yydefault: } case 308: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4282 + //line php5/php5.y:4298 { yyVAL.node = expr.NewYield(yyDollar[2].node, yyDollar[4].node) @@ -6667,7 +6685,7 @@ yydefault: } case 309: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4295 + //line php5/php5.y:4311 { yyVAL.node = expr.NewYield(yyDollar[2].node, yyDollar[4].node) @@ -6682,7 +6700,7 @@ yydefault: } case 310: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4311 + //line php5/php5.y:4327 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -6699,7 +6717,7 @@ yydefault: } case 311: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4326 + //line php5/php5.y:4342 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -6716,7 +6734,7 @@ yydefault: } case 312: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4341 + //line php5/php5.y:4357 { str := scalar.NewString(yyDollar[1].token.Value) yyVAL.node = expr.NewArrayDimFetch(str, yyDollar[3].node) @@ -6735,7 +6753,7 @@ yydefault: } case 313: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4358 + //line php5/php5.y:4374 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -6752,7 +6770,7 @@ yydefault: } case 314: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4376 + //line php5/php5.y:4392 { yyVAL.node = expr.NewArray(yyDollar[3].list) @@ -6768,7 +6786,7 @@ yydefault: } case 315: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4390 + //line php5/php5.y:4406 { yyVAL.node = expr.NewShortArray(yyDollar[2].list) @@ -6783,13 +6801,13 @@ yydefault: } case 316: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4406 + //line php5/php5.y:4422 { yyVAL.token = yyDollar[1].token } case 317: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:4413 + //line php5/php5.y:4429 { yyVAL.ClosureUse = nil @@ -6797,7 +6815,7 @@ yydefault: } case 318: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4419 + //line php5/php5.y:4435 { yyVAL.ClosureUse = expr.NewClosureUse(yyDollar[3].list) @@ -6813,7 +6831,7 @@ yydefault: } case 319: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4436 + //line php5/php5.y:4452 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[3].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -6826,12 +6844,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 320: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4452 + //line php5/php5.y:4469 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[4].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -6847,12 +6866,13 @@ yydefault: yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(reference.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 321: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4471 + //line php5/php5.y:4489 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -6864,12 +6884,13 @@ yydefault: // save comments yyDollar[1].token.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 322: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4486 + //line php5/php5.y:4505 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[2].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -6884,12 +6905,13 @@ yydefault: // save comments yyDollar[1].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(reference.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 323: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4507 + //line php5/php5.y:4527 { name := name.NewName(yyDollar[1].list) yyVAL.node = expr.NewFunctionCall(name, yyDollar[2].node.(*node.ArgumentList)) @@ -6902,7 +6924,7 @@ yydefault: } case 324: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4518 + //line php5/php5.y:4538 { funcName := name.NewRelative(yyDollar[3].list) yyVAL.node = expr.NewFunctionCall(funcName, yyDollar[4].node.(*node.ArgumentList)) @@ -6919,7 +6941,7 @@ yydefault: } case 325: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4533 + //line php5/php5.y:4553 { funcName := name.NewFullyQualified(yyDollar[2].list) yyVAL.node = expr.NewFunctionCall(funcName, yyDollar[3].node.(*node.ArgumentList)) @@ -6935,7 +6957,7 @@ yydefault: } case 326: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4547 + //line php5/php5.y:4567 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -6949,7 +6971,7 @@ yydefault: } case 327: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4559 + //line php5/php5.y:4579 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -6963,7 +6985,7 @@ yydefault: } case 328: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4571 + //line php5/php5.y:4591 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -6977,7 +6999,7 @@ yydefault: } case 329: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4583 + //line php5/php5.y:4603 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -6991,7 +7013,7 @@ yydefault: } case 330: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4595 + //line php5/php5.y:4615 { yyVAL.node = expr.NewFunctionCall(yyDollar[1].node, yyDollar[2].node.(*node.ArgumentList)) @@ -7002,7 +7024,7 @@ yydefault: } case 331: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4607 + //line php5/php5.y:4627 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -7016,7 +7038,7 @@ yydefault: } case 332: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4619 + //line php5/php5.y:4639 { yyVAL.node = name.NewName(yyDollar[1].list) @@ -7027,7 +7049,7 @@ yydefault: } case 333: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4628 + //line php5/php5.y:4648 { yyVAL.node = name.NewRelative(yyDollar[3].list) @@ -7042,7 +7064,7 @@ yydefault: } case 334: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4641 + //line php5/php5.y:4661 { yyVAL.node = name.NewFullyQualified(yyDollar[2].list) @@ -7056,7 +7078,7 @@ yydefault: } case 335: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4656 + //line php5/php5.y:4676 { yyVAL.node = name.NewName(yyDollar[1].list) @@ -7067,7 +7089,7 @@ yydefault: } case 336: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4665 + //line php5/php5.y:4685 { yyVAL.node = name.NewRelative(yyDollar[3].list) @@ -7082,7 +7104,7 @@ yydefault: } case 337: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4678 + //line php5/php5.y:4698 { yyVAL.node = name.NewFullyQualified(yyDollar[2].list) @@ -7096,7 +7118,7 @@ yydefault: } case 338: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4693 + //line php5/php5.y:4713 { yyVAL.node = yyDollar[1].node @@ -7104,7 +7126,7 @@ yydefault: } case 339: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4699 + //line php5/php5.y:4719 { yyVAL.node = yyDollar[1].node @@ -7112,7 +7134,7 @@ yydefault: } case 340: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4708 + //line php5/php5.y:4728 { yyVAL.node = yyDollar[1].node @@ -7151,7 +7173,7 @@ yydefault: } case 341: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4745 + //line php5/php5.y:4765 { yyVAL.node = yyDollar[1].node @@ -7159,7 +7181,7 @@ yydefault: } case 342: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4755 + //line php5/php5.y:4775 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) @@ -7167,7 +7189,7 @@ yydefault: } case 343: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:4761 + //line php5/php5.y:4781 { yyVAL.list = []node.Node{} @@ -7175,7 +7197,7 @@ yydefault: } case 344: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4771 + //line php5/php5.y:4791 { yyVAL.list = yyDollar[2].list @@ -7186,7 +7208,7 @@ yydefault: } case 345: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:4783 + //line php5/php5.y:4803 { yyVAL.node = nil @@ -7194,7 +7216,7 @@ yydefault: } case 346: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4789 + //line php5/php5.y:4809 { yyVAL.node = expr.NewExit(nil) @@ -7211,7 +7233,7 @@ yydefault: } case 347: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4804 + //line php5/php5.y:4824 { yyVAL.node = expr.NewExit(yyDollar[1].node) @@ -7230,7 +7252,7 @@ yydefault: } case 348: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:4824 + //line php5/php5.y:4844 { yyVAL.list = []node.Node{} @@ -7238,7 +7260,7 @@ yydefault: } case 349: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4830 + //line php5/php5.y:4850 { yyVAL.list = []node.Node{scalar.NewEncapsedStringPart(yyDollar[1].token.Value)} @@ -7246,7 +7268,7 @@ yydefault: } case 350: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4836 + //line php5/php5.y:4856 { yyVAL.list = yyDollar[1].list @@ -7254,7 +7276,7 @@ yydefault: } case 351: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:4845 + //line php5/php5.y:4865 { yyVAL.node = nil @@ -7262,7 +7284,7 @@ yydefault: } case 352: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4851 + //line php5/php5.y:4871 { yyVAL.node = yyDollar[1].node @@ -7270,7 +7292,7 @@ yydefault: } case 353: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4860 + //line php5/php5.y:4880 { yyVAL.node = scalar.NewLnumber(yyDollar[1].token.Value) @@ -7284,7 +7306,7 @@ yydefault: } case 354: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4872 + //line php5/php5.y:4892 { yyVAL.node = scalar.NewDnumber(yyDollar[1].token.Value) @@ -7298,7 +7320,7 @@ yydefault: } case 355: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4884 + //line php5/php5.y:4904 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) @@ -7312,7 +7334,7 @@ yydefault: } case 356: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4896 + //line php5/php5.y:4916 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7326,7 +7348,7 @@ yydefault: } case 357: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4908 + //line php5/php5.y:4928 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7340,7 +7362,7 @@ yydefault: } case 358: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4920 + //line php5/php5.y:4940 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7354,7 +7376,7 @@ yydefault: } case 359: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4932 + //line php5/php5.y:4952 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7368,7 +7390,7 @@ yydefault: } case 360: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4944 + //line php5/php5.y:4964 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7382,7 +7404,7 @@ yydefault: } case 361: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4956 + //line php5/php5.y:4976 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7396,7 +7418,7 @@ yydefault: } case 362: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4968 + //line php5/php5.y:4988 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7410,7 +7432,7 @@ yydefault: } case 363: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4980 + //line php5/php5.y:5000 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, []node.Node{encapsed}) @@ -7426,7 +7448,7 @@ yydefault: } case 364: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4994 + //line php5/php5.y:5014 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, nil) @@ -7440,7 +7462,7 @@ yydefault: } case 365: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5009 + //line php5/php5.y:5029 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -7457,7 +7479,7 @@ yydefault: } case 366: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5027 + //line php5/php5.y:5047 { yyVAL.node = yyDollar[1].node @@ -7465,7 +7487,7 @@ yydefault: } case 367: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5036 + //line php5/php5.y:5056 { yyVAL.node = yyDollar[1].node @@ -7473,7 +7495,7 @@ yydefault: } case 368: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5042 + //line php5/php5.y:5062 { yyVAL.node = yyDollar[1].node @@ -7481,7 +7503,7 @@ yydefault: } case 369: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5048 + //line php5/php5.y:5068 { name := name.NewName(yyDollar[1].list) yyVAL.node = expr.NewConstFetch(name) @@ -7494,7 +7516,7 @@ yydefault: } case 370: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5059 + //line php5/php5.y:5079 { name := name.NewRelative(yyDollar[3].list) yyVAL.node = expr.NewConstFetch(name) @@ -7511,7 +7533,7 @@ yydefault: } case 371: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5074 + //line php5/php5.y:5094 { name := name.NewFullyQualified(yyDollar[2].list) yyVAL.node = expr.NewConstFetch(name) @@ -7527,7 +7549,7 @@ yydefault: } case 372: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:5088 + //line php5/php5.y:5108 { yyVAL.node = expr.NewArray(yyDollar[3].list) @@ -7543,7 +7565,7 @@ yydefault: } case 373: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5102 + //line php5/php5.y:5122 { yyVAL.node = expr.NewShortArray(yyDollar[2].list) @@ -7558,7 +7580,7 @@ yydefault: } case 374: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5115 + //line php5/php5.y:5135 { yyVAL.node = yyDollar[1].node @@ -7566,7 +7588,7 @@ yydefault: } case 375: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5121 + //line php5/php5.y:5141 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7580,7 +7602,7 @@ yydefault: } case 376: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5133 + //line php5/php5.y:5153 { yyVAL.node = yyDollar[1].node @@ -7588,7 +7610,7 @@ yydefault: } case 377: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:5142 + //line php5/php5.y:5162 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -7605,7 +7627,7 @@ yydefault: } case 378: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5157 + //line php5/php5.y:5177 { yyVAL.node = binary.NewPlus(yyDollar[1].node, yyDollar[3].node) @@ -7619,7 +7641,7 @@ yydefault: } case 379: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5169 + //line php5/php5.y:5189 { yyVAL.node = binary.NewMinus(yyDollar[1].node, yyDollar[3].node) @@ -7633,7 +7655,7 @@ yydefault: } case 380: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5181 + //line php5/php5.y:5201 { yyVAL.node = binary.NewMul(yyDollar[1].node, yyDollar[3].node) @@ -7647,7 +7669,7 @@ yydefault: } case 381: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5193 + //line php5/php5.y:5213 { yyVAL.node = binary.NewPow(yyDollar[1].node, yyDollar[3].node) @@ -7661,7 +7683,7 @@ yydefault: } case 382: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5205 + //line php5/php5.y:5225 { yyVAL.node = binary.NewDiv(yyDollar[1].node, yyDollar[3].node) @@ -7675,7 +7697,7 @@ yydefault: } case 383: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5217 + //line php5/php5.y:5237 { yyVAL.node = binary.NewMod(yyDollar[1].node, yyDollar[3].node) @@ -7689,7 +7711,7 @@ yydefault: } case 384: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5229 + //line php5/php5.y:5249 { yyVAL.node = expr.NewBooleanNot(yyDollar[2].node) @@ -7703,7 +7725,7 @@ yydefault: } case 385: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5241 + //line php5/php5.y:5261 { yyVAL.node = expr.NewBitwiseNot(yyDollar[2].node) @@ -7717,7 +7739,7 @@ yydefault: } case 386: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5253 + //line php5/php5.y:5273 { yyVAL.node = binary.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) @@ -7731,7 +7753,7 @@ yydefault: } case 387: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5265 + //line php5/php5.y:5285 { yyVAL.node = binary.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) @@ -7745,7 +7767,7 @@ yydefault: } case 388: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5277 + //line php5/php5.y:5297 { yyVAL.node = binary.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) @@ -7759,7 +7781,7 @@ yydefault: } case 389: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5289 + //line php5/php5.y:5309 { yyVAL.node = binary.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) @@ -7773,7 +7795,7 @@ yydefault: } case 390: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5301 + //line php5/php5.y:5321 { yyVAL.node = binary.NewShiftRight(yyDollar[1].node, yyDollar[3].node) @@ -7787,7 +7809,7 @@ yydefault: } case 391: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5313 + //line php5/php5.y:5333 { yyVAL.node = binary.NewConcat(yyDollar[1].node, yyDollar[3].node) @@ -7801,7 +7823,7 @@ yydefault: } case 392: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5325 + //line php5/php5.y:5345 { yyVAL.node = binary.NewLogicalXor(yyDollar[1].node, yyDollar[3].node) @@ -7815,7 +7837,7 @@ yydefault: } case 393: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5337 + //line php5/php5.y:5357 { yyVAL.node = binary.NewLogicalAnd(yyDollar[1].node, yyDollar[3].node) @@ -7829,7 +7851,7 @@ yydefault: } case 394: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5349 + //line php5/php5.y:5369 { yyVAL.node = binary.NewLogicalOr(yyDollar[1].node, yyDollar[3].node) @@ -7843,7 +7865,7 @@ yydefault: } case 395: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5361 + //line php5/php5.y:5381 { yyVAL.node = binary.NewBooleanAnd(yyDollar[1].node, yyDollar[3].node) @@ -7857,7 +7879,7 @@ yydefault: } case 396: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5373 + //line php5/php5.y:5393 { yyVAL.node = binary.NewBooleanOr(yyDollar[1].node, yyDollar[3].node) @@ -7871,7 +7893,7 @@ yydefault: } case 397: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5385 + //line php5/php5.y:5405 { yyVAL.node = binary.NewIdentical(yyDollar[1].node, yyDollar[3].node) @@ -7885,7 +7907,7 @@ yydefault: } case 398: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5397 + //line php5/php5.y:5417 { yyVAL.node = binary.NewNotIdentical(yyDollar[1].node, yyDollar[3].node) @@ -7899,7 +7921,7 @@ yydefault: } case 399: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5409 + //line php5/php5.y:5429 { yyVAL.node = binary.NewEqual(yyDollar[1].node, yyDollar[3].node) @@ -7913,7 +7935,7 @@ yydefault: } case 400: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5421 + //line php5/php5.y:5441 { yyVAL.node = binary.NewNotEqual(yyDollar[1].node, yyDollar[3].node) @@ -7928,7 +7950,7 @@ yydefault: } case 401: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5434 + //line php5/php5.y:5454 { yyVAL.node = binary.NewSmaller(yyDollar[1].node, yyDollar[3].node) @@ -7942,7 +7964,7 @@ yydefault: } case 402: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5446 + //line php5/php5.y:5466 { yyVAL.node = binary.NewGreater(yyDollar[1].node, yyDollar[3].node) @@ -7956,7 +7978,7 @@ yydefault: } case 403: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5458 + //line php5/php5.y:5478 { yyVAL.node = binary.NewSmallerOrEqual(yyDollar[1].node, yyDollar[3].node) @@ -7970,7 +7992,7 @@ yydefault: } case 404: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5470 + //line php5/php5.y:5490 { yyVAL.node = binary.NewGreaterOrEqual(yyDollar[1].node, yyDollar[3].node) @@ -7984,7 +8006,7 @@ yydefault: } case 405: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:5482 + //line php5/php5.y:5502 { yyVAL.node = expr.NewTernary(yyDollar[1].node, nil, yyDollar[4].node) @@ -7999,7 +8021,7 @@ yydefault: } case 406: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:5495 + //line php5/php5.y:5515 { yyVAL.node = expr.NewTernary(yyDollar[1].node, yyDollar[3].node, yyDollar[5].node) @@ -8014,7 +8036,7 @@ yydefault: } case 407: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5508 + //line php5/php5.y:5528 { yyVAL.node = expr.NewUnaryPlus(yyDollar[2].node) @@ -8028,7 +8050,7 @@ yydefault: } case 408: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5520 + //line php5/php5.y:5540 { yyVAL.node = expr.NewUnaryMinus(yyDollar[2].node) @@ -8042,7 +8064,7 @@ yydefault: } case 409: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5532 + //line php5/php5.y:5552 { yyVAL.node = yyDollar[2].node @@ -8054,7 +8076,7 @@ yydefault: } case 410: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5545 + //line php5/php5.y:5565 { yyVAL.node = yyDollar[1].node @@ -8062,7 +8084,7 @@ yydefault: } case 411: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5551 + //line php5/php5.y:5571 { name := name.NewName(yyDollar[1].list) yyVAL.node = expr.NewConstFetch(name) @@ -8075,7 +8097,7 @@ yydefault: } case 412: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5562 + //line php5/php5.y:5582 { name := name.NewRelative(yyDollar[3].list) yyVAL.node = expr.NewConstFetch(name) @@ -8090,7 +8112,7 @@ yydefault: } case 413: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5575 + //line php5/php5.y:5595 { name := name.NewFullyQualified(yyDollar[2].list) yyVAL.node = expr.NewConstFetch(name) @@ -8106,7 +8128,7 @@ yydefault: } case 414: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5592 + //line php5/php5.y:5612 { name := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = expr.NewVariable(name) @@ -8117,12 +8139,13 @@ yydefault: // save comments yyDollar[1].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + yylex.(*Parser).appendMeta(yyVAL.node, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 415: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5606 + //line php5/php5.y:5627 { yyVAL.node = yyDollar[1].node @@ -8130,7 +8153,7 @@ yydefault: } case 416: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5612 + //line php5/php5.y:5633 { yyVAL.node = yyDollar[1].node @@ -8138,7 +8161,7 @@ yydefault: } case 417: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5618 + //line php5/php5.y:5639 { yyVAL.node = yyDollar[1].node @@ -8146,7 +8169,7 @@ yydefault: } case 418: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5624 + //line php5/php5.y:5645 { yyVAL.node = scalar.NewEncapsed(yyDollar[2].list) @@ -8160,7 +8183,7 @@ yydefault: } case 419: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5636 + //line php5/php5.y:5657 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, yyDollar[2].list) @@ -8174,7 +8197,7 @@ yydefault: } case 420: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5648 + //line php5/php5.y:5669 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -8188,7 +8211,7 @@ yydefault: } case 421: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:5663 + //line php5/php5.y:5684 { yyVAL.list = nil @@ -8196,7 +8219,7 @@ yydefault: } case 422: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5669 + //line php5/php5.y:5690 { yyVAL.list = yyDollar[1].list @@ -8209,19 +8232,19 @@ yydefault: } case 423: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:5683 + //line php5/php5.y:5704 { yyVAL.token = nil } case 424: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5687 + //line php5/php5.y:5708 { yyVAL.token = yyDollar[1].token } case 425: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:5694 + //line php5/php5.y:5715 { arrayItem := expr.NewArrayItem(yyDollar[3].node, yyDollar[5].node) yyVAL.list = append(yyDollar[1].list, arrayItem) @@ -8237,7 +8260,7 @@ yydefault: } case 426: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5708 + //line php5/php5.y:5729 { arrayItem := expr.NewArrayItem(nil, yyDollar[3].node) yyVAL.list = append(yyDollar[1].list, arrayItem) @@ -8252,7 +8275,7 @@ yydefault: } case 427: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5721 + //line php5/php5.y:5742 { arrayItem := expr.NewArrayItem(yyDollar[1].node, yyDollar[3].node) yyVAL.list = []node.Node{arrayItem} @@ -8267,7 +8290,7 @@ yydefault: } case 428: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5734 + //line php5/php5.y:5755 { arrayItem := expr.NewArrayItem(nil, yyDollar[1].node) yyVAL.list = []node.Node{arrayItem} @@ -8279,7 +8302,7 @@ yydefault: } case 429: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5747 + //line php5/php5.y:5768 { yyVAL.node = yyDollar[1].node @@ -8287,7 +8310,7 @@ yydefault: } case 430: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5753 + //line php5/php5.y:5774 { yyVAL.node = yyDollar[1].node @@ -8295,7 +8318,7 @@ yydefault: } case 431: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5762 + //line php5/php5.y:5783 { yyVAL.node = yyDollar[2].node @@ -8309,7 +8332,7 @@ yydefault: } case 432: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5774 + //line php5/php5.y:5795 { yyVAL.node = yyDollar[2].node @@ -8323,7 +8346,7 @@ yydefault: } case 433: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5790 + //line php5/php5.y:5811 { yyVAL.node = yyDollar[1].node @@ -8331,7 +8354,7 @@ yydefault: } case 434: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5800 + //line php5/php5.y:5821 { yyVAL.node = yyDollar[1].node @@ -8339,7 +8362,7 @@ yydefault: } case 435: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5809 + //line php5/php5.y:5830 { yyVAL.node = yyDollar[1].node @@ -8347,7 +8370,7 @@ yydefault: } case 436: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:5818 + //line php5/php5.y:5839 { yyVAL.node = yyDollar[1].node @@ -8401,7 +8424,7 @@ yydefault: } case 437: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5870 + //line php5/php5.y:5891 { yyVAL.node = yyDollar[1].node @@ -8409,7 +8432,7 @@ yydefault: } case 438: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5879 + //line php5/php5.y:5900 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) @@ -8417,7 +8440,7 @@ yydefault: } case 439: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:5885 + //line php5/php5.y:5906 { yyVAL.list = []node.Node{} @@ -8425,7 +8448,7 @@ yydefault: } case 440: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5895 + //line php5/php5.y:5916 { if yyDollar[3].list != nil { yyDollar[3].list[0].(*expr.MethodCall).Method = yyDollar[2].list[len(yyDollar[2].list)-1].(*expr.PropertyFetch).Property @@ -8441,7 +8464,7 @@ yydefault: } case 441: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:5912 + //line php5/php5.y:5933 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yyVAL.list = append(yyDollar[1].list, fetch) @@ -8459,7 +8482,7 @@ yydefault: } case 442: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:5928 + //line php5/php5.y:5949 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yyVAL.list = []node.Node{yyDollar[1].node, fetch} @@ -8477,7 +8500,7 @@ yydefault: } case 443: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5947 + //line php5/php5.y:5968 { yyVAL.node = expr.NewMethodCall(nil, nil, yyDollar[1].node.(*node.ArgumentList)) @@ -8488,7 +8511,7 @@ yydefault: } case 444: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5959 + //line php5/php5.y:5980 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -8496,7 +8519,7 @@ yydefault: } case 445: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5965 + //line php5/php5.y:5986 { yyVAL.list = yyDollar[1].list @@ -8504,7 +8527,7 @@ yydefault: } case 446: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:5971 + //line php5/php5.y:5992 { yyVAL.list = nil @@ -8512,7 +8535,7 @@ yydefault: } case 447: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5980 + //line php5/php5.y:6001 { yyVAL.node = yyDollar[1].node @@ -8520,7 +8543,7 @@ yydefault: } case 448: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5986 + //line php5/php5.y:6007 { yyDollar[1].simpleIndirectReference.last.SetVarName(yyDollar[2].node) @@ -8534,7 +8557,7 @@ yydefault: } case 449: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6001 + //line php5/php5.y:6022 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -8548,7 +8571,7 @@ yydefault: } case 450: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6013 + //line php5/php5.y:6034 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -8562,7 +8585,7 @@ yydefault: } case 451: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6028 + //line php5/php5.y:6049 { yyVAL.node = yyDollar[1].node @@ -8570,7 +8593,7 @@ yydefault: } case 452: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6037 + //line php5/php5.y:6058 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -8587,7 +8610,7 @@ yydefault: } case 453: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6052 + //line php5/php5.y:6073 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -8604,7 +8627,7 @@ yydefault: } case 454: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6070 + //line php5/php5.y:6091 { yyVAL.node = yyDollar[1].node @@ -8612,7 +8635,7 @@ yydefault: } case 455: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6076 + //line php5/php5.y:6097 { yyVAL.node = yyDollar[1].node @@ -8620,7 +8643,7 @@ yydefault: } case 456: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6082 + //line php5/php5.y:6103 { yyVAL.node = yyDollar[1].node @@ -8628,7 +8651,7 @@ yydefault: } case 457: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6092 + //line php5/php5.y:6113 { yyVAL.node = yyDollar[1].node @@ -8636,7 +8659,7 @@ yydefault: } case 458: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6098 + //line php5/php5.y:6119 { yyDollar[1].simpleIndirectReference.last.SetVarName(yyDollar[2].node) @@ -8650,7 +8673,7 @@ yydefault: } case 459: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6110 + //line php5/php5.y:6131 { yyVAL.node = yyDollar[1].node @@ -8658,7 +8681,7 @@ yydefault: } case 460: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6119 + //line php5/php5.y:6140 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -8675,7 +8698,7 @@ yydefault: } case 461: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6134 + //line php5/php5.y:6155 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -8692,7 +8715,7 @@ yydefault: } case 462: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6149 + //line php5/php5.y:6170 { yyVAL.node = yyDollar[1].node @@ -8700,7 +8723,7 @@ yydefault: } case 463: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6159 + //line php5/php5.y:6180 { name := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(name) @@ -8711,12 +8734,13 @@ yydefault: // save comments yyDollar[1].token.Meta.SetTokenName(meta.VariableToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMeta(yyVAL.node, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 464: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6173 + //line php5/php5.y:6195 { yyVAL.node = expr.NewVariable(yyDollar[3].node) @@ -8725,6 +8749,7 @@ yydefault: // save comments yyDollar[1].token.Meta.SetTokenName(meta.DollarToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.DollarToken) yyDollar[2].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.OpenCurlyBracesToken) yyDollar[4].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) @@ -8734,7 +8759,7 @@ yydefault: } case 465: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:6192 + //line php5/php5.y:6215 { yyVAL.node = nil @@ -8742,7 +8767,7 @@ yydefault: } case 466: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6198 + //line php5/php5.y:6221 { yyVAL.node = yyDollar[1].node @@ -8750,7 +8775,7 @@ yydefault: } case 467: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6208 + //line php5/php5.y:6231 { yyVAL.list = yyDollar[1].list @@ -8758,7 +8783,7 @@ yydefault: } case 468: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6214 + //line php5/php5.y:6237 { fetch := expr.NewPropertyFetch(nil, yyDollar[1].node) yyVAL.list = []node.Node{fetch} @@ -8770,7 +8795,7 @@ yydefault: } case 469: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6227 + //line php5/php5.y:6250 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yyVAL.list = append(yyDollar[1].list, fetch) @@ -8788,7 +8813,7 @@ yydefault: } case 470: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6243 + //line php5/php5.y:6266 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yyVAL.list = append(yyDollar[1].list, fetch) @@ -8806,7 +8831,7 @@ yydefault: } case 471: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6259 + //line php5/php5.y:6282 { fetch := expr.NewPropertyFetch(nil, yyDollar[1].node) yyVAL.list = []node.Node{fetch} @@ -8818,7 +8843,7 @@ yydefault: } case 472: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6272 + //line php5/php5.y:6295 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -8832,7 +8857,7 @@ yydefault: } case 473: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6284 + //line php5/php5.y:6307 { yyVAL.node = yyDollar[2].node @@ -8849,7 +8874,7 @@ yydefault: } case 474: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6302 + //line php5/php5.y:6325 { n := expr.NewVariable(nil) yyVAL.simpleIndirectReference = simpleIndirectReference{[]*expr.Variable{n}, n} @@ -8859,12 +8884,13 @@ yydefault: // save comments yyDollar[1].token.Meta.SetTokenName(meta.DollarToken).AppendTo(n.GetMeta()) + yylex.(*Parser).appendMetaToken(n, yyDollar[1].token, meta.DollarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 475: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6315 + //line php5/php5.y:6339 { n := expr.NewVariable(nil) @@ -8878,12 +8904,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.DollarToken).AppendTo(n.GetMeta()) + yylex.(*Parser).appendMetaToken(n, yyDollar[2].token, meta.DollarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 476: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6335 + //line php5/php5.y:6360 { if len(yyDollar[1].list) == 0 { yyDollar[1].list = []node.Node{expr.NewArrayItem(nil, nil)} @@ -8898,7 +8925,7 @@ yydefault: } case 477: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6348 + //line php5/php5.y:6373 { if yyDollar[1].node.(*expr.ArrayItem).Key == nil && yyDollar[1].node.(*expr.ArrayItem).Val == nil { yyVAL.list = []node.Node{} @@ -8910,7 +8937,7 @@ yydefault: } case 478: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6362 + //line php5/php5.y:6387 { yyVAL.node = expr.NewArrayItem(nil, yyDollar[1].node) @@ -8921,7 +8948,7 @@ yydefault: } case 479: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6371 + //line php5/php5.y:6396 { item := expr.NewList(yyDollar[3].list) yyVAL.node = expr.NewArrayItem(nil, item) @@ -8939,7 +8966,7 @@ yydefault: } case 480: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:6387 + //line php5/php5.y:6412 { yyVAL.node = expr.NewArrayItem(nil, nil) @@ -8947,7 +8974,7 @@ yydefault: } case 481: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:6397 + //line php5/php5.y:6422 { yyVAL.list = []node.Node{} @@ -8955,7 +8982,7 @@ yydefault: } case 482: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6403 + //line php5/php5.y:6428 { yyVAL.list = yyDollar[1].list @@ -8972,7 +8999,7 @@ yydefault: } case 483: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:6421 + //line php5/php5.y:6446 { arrayItem := expr.NewArrayItem(yyDollar[3].node, yyDollar[5].node) yyVAL.list = append(yyDollar[1].list, arrayItem) @@ -8988,7 +9015,7 @@ yydefault: } case 484: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6435 + //line php5/php5.y:6460 { arrayItem := expr.NewArrayItem(nil, yyDollar[3].node) yyVAL.list = append(yyDollar[1].list, arrayItem) @@ -9003,7 +9030,7 @@ yydefault: } case 485: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6448 + //line php5/php5.y:6473 { arrayItem := expr.NewArrayItem(yyDollar[1].node, yyDollar[3].node) yyVAL.list = []node.Node{arrayItem} @@ -9018,7 +9045,7 @@ yydefault: } case 486: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6461 + //line php5/php5.y:6486 { arrayItem := expr.NewArrayItem(nil, yyDollar[1].node) yyVAL.list = []node.Node{arrayItem} @@ -9030,7 +9057,7 @@ yydefault: } case 487: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:6471 + //line php5/php5.y:6496 { reference := expr.NewReference(yyDollar[6].node) arrayItem := expr.NewArrayItem(yyDollar[3].node, reference) @@ -9049,7 +9076,7 @@ yydefault: } case 488: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6488 + //line php5/php5.y:6513 { reference := expr.NewReference(yyDollar[4].node) arrayItem := expr.NewArrayItem(nil, reference) @@ -9067,7 +9094,7 @@ yydefault: } case 489: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6504 + //line php5/php5.y:6529 { reference := expr.NewReference(yyDollar[4].node) arrayItem := expr.NewArrayItem(yyDollar[1].node, reference) @@ -9085,7 +9112,7 @@ yydefault: } case 490: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6520 + //line php5/php5.y:6545 { reference := expr.NewReference(yyDollar[2].node) arrayItem := expr.NewArrayItem(nil, reference) @@ -9102,7 +9129,7 @@ yydefault: } case 491: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6538 + //line php5/php5.y:6563 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -9110,7 +9137,7 @@ yydefault: } case 492: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6544 + //line php5/php5.y:6569 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yyVAL.list = append(yyDollar[1].list, encapsed) @@ -9125,7 +9152,7 @@ yydefault: } case 493: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6557 + //line php5/php5.y:6582 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -9133,7 +9160,7 @@ yydefault: } case 494: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6563 + //line php5/php5.y:6588 { encapsed := scalar.NewEncapsedStringPart(yyDollar[1].token.Value) yyVAL.list = []node.Node{encapsed, yyDollar[2].node} @@ -9148,7 +9175,7 @@ yydefault: } case 495: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6579 + //line php5/php5.y:6604 { name := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(name) @@ -9159,12 +9186,13 @@ yydefault: // save comments yyDollar[1].token.Meta.SetTokenName(meta.VariableToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMeta(yyVAL.node, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 496: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6593 + //line php5/php5.y:6619 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -9177,6 +9205,7 @@ yydefault: // save comments yyDollar[1].token.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) yyDollar[2].token.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.OpenSquareBracket) yyDollar[4].token.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(yyVAL.node.GetMeta()) @@ -9186,7 +9215,7 @@ yydefault: } case 497: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6613 + //line php5/php5.y:6640 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -9201,6 +9230,7 @@ yydefault: // save comments yyDollar[1].token.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) yyDollar[2].token.Meta.SetTokenName(meta.ObjectOperatorToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(fetch.GetMeta()) @@ -9208,10 +9238,9 @@ yydefault: } case 498: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6633 + //line php5/php5.y:6661 { variable := expr.NewVariable(yyDollar[2].node) - variable.StringVar = true yyVAL.node = variable @@ -9228,11 +9257,10 @@ yydefault: } case 499: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6651 + //line php5/php5.y:6678 { name := node.NewIdentifier(yyDollar[2].token.Value) variable := expr.NewVariable(name) - variable.StringVar = true yyVAL.node = variable @@ -9251,11 +9279,10 @@ yydefault: } case 500: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:6672 + //line php5/php5.y:6698 { identifier := node.NewIdentifier(yyDollar[2].token.Value) variable := expr.NewVariable(identifier) - variable.StringVar = true yyVAL.node = expr.NewArrayDimFetch(variable, yyDollar[4].node) // save position @@ -9278,7 +9305,7 @@ yydefault: } case 501: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6697 + //line php5/php5.y:6722 { yyVAL.node = yyDollar[2].node @@ -9292,7 +9319,7 @@ yydefault: } case 502: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6712 + //line php5/php5.y:6737 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) @@ -9306,7 +9333,7 @@ yydefault: } case 503: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6724 + //line php5/php5.y:6749 { // TODO: add option to handle 64 bit integer if _, err := strconv.Atoi(yyDollar[1].token.Value); err == nil { @@ -9325,7 +9352,7 @@ yydefault: } case 504: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6741 + //line php5/php5.y:6766 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(identifier) @@ -9336,12 +9363,13 @@ yydefault: // save comments yyDollar[1].token.Meta.SetTokenName(meta.VariableToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMeta(yyVAL.node, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 505: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6758 + //line php5/php5.y:6784 { yyVAL.node = expr.NewIsset(yyDollar[3].list) @@ -9357,7 +9385,7 @@ yydefault: } case 506: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6772 + //line php5/php5.y:6798 { yyVAL.node = expr.NewEmpty(yyDollar[3].node) @@ -9373,7 +9401,7 @@ yydefault: } case 507: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6786 + //line php5/php5.y:6812 { yyVAL.node = expr.NewEmpty(yyDollar[3].node) @@ -9389,7 +9417,7 @@ yydefault: } case 508: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6800 + //line php5/php5.y:6826 { yyVAL.node = expr.NewInclude(yyDollar[2].node) @@ -9403,7 +9431,7 @@ yydefault: } case 509: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6812 + //line php5/php5.y:6838 { yyVAL.node = expr.NewIncludeOnce(yyDollar[2].node) @@ -9417,7 +9445,7 @@ yydefault: } case 510: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6824 + //line php5/php5.y:6850 { yyVAL.node = expr.NewEval(yyDollar[3].node) @@ -9433,7 +9461,7 @@ yydefault: } case 511: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6838 + //line php5/php5.y:6864 { yyVAL.node = expr.NewRequire(yyDollar[2].node) @@ -9447,7 +9475,7 @@ yydefault: } case 512: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6850 + //line php5/php5.y:6876 { yyVAL.node = expr.NewRequireOnce(yyDollar[2].node) @@ -9461,7 +9489,7 @@ yydefault: } case 513: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6865 + //line php5/php5.y:6891 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -9469,7 +9497,7 @@ yydefault: } case 514: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6871 + //line php5/php5.y:6897 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -9480,7 +9508,7 @@ yydefault: } case 515: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6883 + //line php5/php5.y:6909 { yyVAL.node = yyDollar[1].node @@ -9488,7 +9516,7 @@ yydefault: } case 516: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6889 + //line php5/php5.y:6915 { yyVAL.node = yyDollar[1].node @@ -9496,7 +9524,7 @@ yydefault: } case 517: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6898 + //line php5/php5.y:6924 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -9513,7 +9541,7 @@ yydefault: } case 518: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6913 + //line php5/php5.y:6939 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -9530,7 +9558,7 @@ yydefault: } case 519: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6931 + //line php5/php5.y:6957 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -9547,7 +9575,7 @@ yydefault: } case 520: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6949 + //line php5/php5.y:6975 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) diff --git a/php5/php5.y b/php5/php5.y index 9d8e7ae..49fe6c4 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -1388,6 +1388,7 @@ catch_statement: $1.Meta.SetTokenName(meta.CatchToken).AppendTo(catch.GetMeta()) $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(catch.GetMeta()) $4.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) $5.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(catch.GetMeta()) $6.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(catch.GetMeta()) $8.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(catch.GetMeta()) @@ -1465,6 +1466,7 @@ additional_catch: $1.Meta.SetTokenName(meta.CatchToken).AppendTo($$.GetMeta()) $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) $4.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) $5.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) $6.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) $8.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) @@ -2255,6 +2257,7 @@ parameter: $3.Meta.SetTokenName(meta.EllipsisToken).AppendTo($$.GetMeta()) } $4.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2285,6 +2288,7 @@ parameter: $3.Meta.SetTokenName(meta.EllipsisToken).AppendTo($$.GetMeta()) } $4.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) $5.Meta.SetTokenName(meta.EqualToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -2471,6 +2475,7 @@ global_var: // save comments $1.Meta.SetTokenName(meta.VariableToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMeta($$, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2483,6 +2488,8 @@ global_var: // save comments $1.Meta.SetTokenName(meta.DollarToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $1, meta.DollarToken) + yylex.(*Parser).appendMeta($$, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2495,6 +2502,7 @@ global_var: // save comments $1.Meta.SetTokenName(meta.DollarToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $1, meta.DollarToken) $2.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) $4.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) @@ -2519,6 +2527,7 @@ static_var_list: // save comments $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) $3.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2537,6 +2546,7 @@ static_var_list: // save comments $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) $3.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) $4.Meta.SetTokenName(meta.EqualToken).AppendTo(staticVar.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -2555,6 +2565,7 @@ static_var_list: // save comments $1.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2572,6 +2583,7 @@ static_var_list: // save comments $1.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) $2.Meta.SetTokenName(meta.EqualToken).AppendTo(staticVar.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -3059,6 +3071,7 @@ class_variable_declaration: // save comments $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) $3.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3077,6 +3090,7 @@ class_variable_declaration: // save comments $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) $3.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) $4.Meta.SetTokenName(meta.EqualToken).AppendTo(property.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -3095,6 +3109,7 @@ class_variable_declaration: // save comments $1.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3112,6 +3127,7 @@ class_variable_declaration: // save comments $1.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) $2.Meta.SetTokenName(meta.EqualToken).AppendTo(property.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -4445,6 +4461,7 @@ lexical_var_list: // save comments $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) $3.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4464,6 +4481,7 @@ lexical_var_list: $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) $3.Meta.SetTokenName(meta.AmpersandToken).AppendTo(reference.GetMeta()) $4.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4479,6 +4497,7 @@ lexical_var_list: // save comments $1.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4497,6 +4516,7 @@ lexical_var_list: // save comments $1.Meta.SetTokenName(meta.AmpersandToken).AppendTo(reference.GetMeta()) $2.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5599,6 +5619,7 @@ scalar: // save comments $1.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + yylex.(*Parser).appendMeta($$, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6166,6 +6187,7 @@ compound_variable: // save comments $1.Meta.SetTokenName(meta.VariableToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMeta($$, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6178,6 +6200,7 @@ compound_variable: // save comments $1.Meta.SetTokenName(meta.DollarToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $1, meta.DollarToken) $2.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $2, meta.OpenCurlyBracesToken) $4.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) @@ -6308,6 +6331,7 @@ simple_indirect_reference: // save comments $1.Meta.SetTokenName(meta.DollarToken).AppendTo(n.GetMeta()) + yylex.(*Parser).appendMetaToken(n, $1, meta.DollarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6325,6 +6349,7 @@ simple_indirect_reference: // save comments $2.Meta.SetTokenName(meta.DollarToken).AppendTo(n.GetMeta()) + yylex.(*Parser).appendMetaToken(n, $2, meta.DollarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6586,6 +6611,7 @@ encaps_var: // save comments $1.Meta.SetTokenName(meta.VariableToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMeta($$, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6602,6 +6628,7 @@ encaps_var: // save comments $1.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) $2.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $2, meta.OpenSquareBracket) $4.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo($$.GetMeta()) @@ -6624,6 +6651,7 @@ encaps_var: // save comments $1.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) $2.Meta.SetTokenName(meta.ObjectOperatorToken).AppendTo($$.GetMeta()) $3.Meta.SetTokenName(meta.IdentifierToken).AppendTo(fetch.GetMeta()) @@ -6632,7 +6660,6 @@ encaps_var: | T_DOLLAR_OPEN_CURLY_BRACES expr '}' { variable := expr.NewVariable($2) - variable.StringVar = true $$ = variable @@ -6651,7 +6678,6 @@ encaps_var: { name := node.NewIdentifier($2.Value) variable := expr.NewVariable(name) - variable.StringVar = true $$ = variable @@ -6672,7 +6698,6 @@ encaps_var: { identifier := node.NewIdentifier($2.Value) variable := expr.NewVariable(identifier) - variable.StringVar = true $$ = expr.NewArrayDimFetch(variable, $4) // save position @@ -6748,6 +6773,7 @@ encaps_var_offset: // save comments $1.Meta.SetTokenName(meta.VariableToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMeta($$, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php5/php5_test.go b/php5/php5_test.go index 33eebe8..6296881 100644 --- a/php5/php5_test.go +++ b/php5/php5_test.go @@ -481,7 +481,6 @@ func TestPhp5(t *testing.T) { StartPos: 10, EndPos: 11, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 2, @@ -509,7 +508,6 @@ func TestPhp5(t *testing.T) { StartPos: 17, EndPos: 18, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 2, @@ -546,7 +544,6 @@ func TestPhp5(t *testing.T) { StartPos: 24, EndPos: 27, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 3, @@ -581,7 +578,6 @@ func TestPhp5(t *testing.T) { StartPos: 29, EndPos: 30, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 3, @@ -609,7 +605,6 @@ func TestPhp5(t *testing.T) { StartPos: 36, EndPos: 37, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 3, @@ -646,7 +641,6 @@ func TestPhp5(t *testing.T) { StartPos: 43, EndPos: 46, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 4, @@ -690,7 +684,6 @@ func TestPhp5(t *testing.T) { StartPos: 53, EndPos: 54, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 4, @@ -718,7 +711,6 @@ func TestPhp5(t *testing.T) { StartPos: 60, EndPos: 61, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 4, @@ -800,7 +792,6 @@ func TestPhp5(t *testing.T) { StartPos: 76, EndPos: 77, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 5, @@ -828,7 +819,6 @@ func TestPhp5(t *testing.T) { StartPos: 83, EndPos: 84, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 5, @@ -865,7 +855,6 @@ func TestPhp5(t *testing.T) { StartPos: 90, EndPos: 93, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 6, @@ -909,7 +898,6 @@ func TestPhp5(t *testing.T) { StartPos: 100, EndPos: 101, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 6, @@ -937,7 +925,6 @@ func TestPhp5(t *testing.T) { StartPos: 107, EndPos: 108, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 6, @@ -1010,7 +997,6 @@ func TestPhp5(t *testing.T) { StartPos: 122, EndPos: 123, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 7, @@ -1038,7 +1024,6 @@ func TestPhp5(t *testing.T) { StartPos: 129, EndPos: 130, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 7, @@ -1108,7 +1093,6 @@ func TestPhp5(t *testing.T) { StartPos: 154, EndPos: 157, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 9, @@ -1182,7 +1166,6 @@ func TestPhp5(t *testing.T) { StartPos: 173, EndPos: 176, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 9, @@ -1280,7 +1263,6 @@ func TestPhp5(t *testing.T) { StartPos: 219, EndPos: 222, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 10, @@ -1354,7 +1336,6 @@ func TestPhp5(t *testing.T) { StartPos: 238, EndPos: 241, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 10, @@ -1432,7 +1413,6 @@ func TestPhp5(t *testing.T) { StartPos: 263, EndPos: 266, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 11, @@ -1506,7 +1486,6 @@ func TestPhp5(t *testing.T) { StartPos: 282, EndPos: 285, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 11, @@ -1575,7 +1554,6 @@ func TestPhp5(t *testing.T) { StartPos: 314, EndPos: 317, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 12, @@ -1649,7 +1627,6 @@ func TestPhp5(t *testing.T) { StartPos: 333, EndPos: 336, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 12, @@ -1951,7 +1928,6 @@ func TestPhp5(t *testing.T) { StartPos: 700, EndPos: 703, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 30, @@ -2003,7 +1979,6 @@ func TestPhp5(t *testing.T) { StartPos: 715, EndPos: 718, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 31, @@ -2065,7 +2040,6 @@ func TestPhp5(t *testing.T) { StartPos: 733, EndPos: 736, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 32, @@ -2127,7 +2101,6 @@ func TestPhp5(t *testing.T) { StartPos: 790, EndPos: 793, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 33, @@ -2189,7 +2162,6 @@ func TestPhp5(t *testing.T) { StartPos: 810, EndPos: 813, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 34, @@ -2207,7 +2179,6 @@ func TestPhp5(t *testing.T) { StartPos: 815, EndPos: 818, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 34, @@ -2244,7 +2215,6 @@ func TestPhp5(t *testing.T) { StartPos: 826, EndPos: 829, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 35, @@ -2271,7 +2241,6 @@ func TestPhp5(t *testing.T) { StartPos: 831, EndPos: 834, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 35, @@ -2323,7 +2292,6 @@ func TestPhp5(t *testing.T) { StartPos: 846, EndPos: 849, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 36, @@ -2387,7 +2355,6 @@ func TestPhp5(t *testing.T) { StartPos: 868, EndPos: 873, }, - StringVar: true, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 37, @@ -2439,7 +2406,6 @@ func TestPhp5(t *testing.T) { StartPos: 887, EndPos: 889, }, - StringVar: true, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 38, @@ -2501,7 +2467,6 @@ func TestPhp5(t *testing.T) { StartPos: 906, EndPos: 909, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 39, @@ -2547,7 +2512,6 @@ func TestPhp5(t *testing.T) { StartPos: 928, EndPos: 929, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 41, @@ -2582,7 +2546,6 @@ func TestPhp5(t *testing.T) { StartPos: 949, EndPos: 950, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 43, @@ -2617,7 +2580,6 @@ func TestPhp5(t *testing.T) { StartPos: 965, EndPos: 966, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 44, @@ -2654,7 +2616,6 @@ func TestPhp5(t *testing.T) { StartPos: 985, EndPos: 986, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 46, @@ -2706,7 +2667,6 @@ func TestPhp5(t *testing.T) { StartPos: 1014, EndPos: 1015, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 49, @@ -2741,7 +2701,6 @@ func TestPhp5(t *testing.T) { StartPos: 1030, EndPos: 1031, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 50, @@ -2776,7 +2735,6 @@ func TestPhp5(t *testing.T) { StartPos: 1045, EndPos: 1046, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 51, @@ -3911,7 +3869,6 @@ func TestPhp5(t *testing.T) { StartPos: 1739, EndPos: 1740, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 75, @@ -3948,7 +3905,6 @@ func TestPhp5(t *testing.T) { StartPos: 1753, EndPos: 1754, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 76, @@ -3983,7 +3939,6 @@ func TestPhp5(t *testing.T) { StartPos: 1764, EndPos: 1765, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 77, @@ -4020,7 +3975,6 @@ func TestPhp5(t *testing.T) { StartPos: 1772, EndPos: 1773, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 77, @@ -4057,7 +4011,6 @@ func TestPhp5(t *testing.T) { StartPos: 1781, EndPos: 1782, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 77, @@ -4083,7 +4036,6 @@ func TestPhp5(t *testing.T) { StartPos: 1787, EndPos: 1788, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 77, @@ -4128,7 +4080,6 @@ func TestPhp5(t *testing.T) { StartPos: 1804, EndPos: 1805, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 78, @@ -4165,7 +4116,6 @@ func TestPhp5(t *testing.T) { StartPos: 1813, EndPos: 1814, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 78, @@ -4202,7 +4152,6 @@ func TestPhp5(t *testing.T) { StartPos: 1840, EndPos: 1841, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 79, @@ -4220,7 +4169,6 @@ func TestPhp5(t *testing.T) { StartPos: 1846, EndPos: 1847, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 79, @@ -4264,7 +4212,6 @@ func TestPhp5(t *testing.T) { StartPos: 1870, EndPos: 1871, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 80, @@ -4299,7 +4246,6 @@ func TestPhp5(t *testing.T) { StartPos: 1888, EndPos: 1889, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 81, @@ -4317,7 +4263,6 @@ func TestPhp5(t *testing.T) { StartPos: 1894, EndPos: 1895, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 81, @@ -4352,7 +4297,6 @@ func TestPhp5(t *testing.T) { StartPos: 1923, EndPos: 1924, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 82, @@ -4370,7 +4314,6 @@ func TestPhp5(t *testing.T) { StartPos: 1929, EndPos: 1930, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 82, @@ -4388,7 +4331,6 @@ func TestPhp5(t *testing.T) { StartPos: 1935, EndPos: 1936, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 82, @@ -4432,7 +4374,6 @@ func TestPhp5(t *testing.T) { StartPos: 1959, EndPos: 1960, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 83, @@ -4450,7 +4391,6 @@ func TestPhp5(t *testing.T) { StartPos: 1965, EndPos: 1966, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 83, @@ -4485,7 +4425,6 @@ func TestPhp5(t *testing.T) { StartPos: 1983, EndPos: 1984, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 84, @@ -4503,7 +4442,6 @@ func TestPhp5(t *testing.T) { StartPos: 1989, EndPos: 1990, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 84, @@ -4528,7 +4466,6 @@ func TestPhp5(t *testing.T) { StartPos: 1996, EndPos: 1997, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 84, @@ -4564,7 +4501,6 @@ func TestPhp5(t *testing.T) { StartPos: 2014, EndPos: 2015, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 85, @@ -4582,7 +4518,6 @@ func TestPhp5(t *testing.T) { StartPos: 2020, EndPos: 2021, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 85, @@ -4615,7 +4550,6 @@ func TestPhp5(t *testing.T) { StartPos: 2031, EndPos: 2032, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 85, @@ -4731,7 +4665,6 @@ func TestPhp5(t *testing.T) { StartPos: 2126, EndPos: 2127, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 91, @@ -4789,7 +4722,6 @@ func TestPhp5(t *testing.T) { StartPos: 2158, EndPos: 2159, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 94, @@ -4826,7 +4758,6 @@ func TestPhp5(t *testing.T) { StartPos: 2171, EndPos: 2172, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 94, @@ -4923,7 +4854,6 @@ func TestPhp5(t *testing.T) { StartPos: 2245, EndPos: 2246, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 97, @@ -4941,7 +4871,6 @@ func TestPhp5(t *testing.T) { StartPos: 2249, EndPos: 2250, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 97, @@ -4959,7 +4888,6 @@ func TestPhp5(t *testing.T) { StartPos: 2253, EndPos: 2255, }, - StringVar: false, VarName: &expr.Variable{ Position: &position.Position{ StartLine: 97, @@ -4967,7 +4895,6 @@ func TestPhp5(t *testing.T) { StartPos: 2254, EndPos: 2255, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 97, @@ -4986,7 +4913,6 @@ func TestPhp5(t *testing.T) { StartPos: 2258, EndPos: 2265, }, - StringVar: false, VarName: &expr.FunctionCall{ Position: &position.Position{ StartLine: 97, @@ -5073,7 +4999,6 @@ func TestPhp5(t *testing.T) { StartPos: 2290, EndPos: 2291, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 100, @@ -5108,7 +5033,6 @@ func TestPhp5(t *testing.T) { StartPos: 2303, EndPos: 2304, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 101, @@ -5143,7 +5067,6 @@ func TestPhp5(t *testing.T) { StartPos: 2318, EndPos: 2319, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 101, @@ -5180,7 +5103,6 @@ func TestPhp5(t *testing.T) { StartPos: 2331, EndPos: 2332, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 102, @@ -5232,7 +5154,6 @@ func TestPhp5(t *testing.T) { StartPos: 2352, EndPos: 2353, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 103, @@ -5267,7 +5188,6 @@ func TestPhp5(t *testing.T) { StartPos: 2367, EndPos: 2368, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 103, @@ -5302,7 +5222,6 @@ func TestPhp5(t *testing.T) { StartPos: 2382, EndPos: 2383, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 103, @@ -5356,7 +5275,6 @@ func TestPhp5(t *testing.T) { StartPos: 2403, EndPos: 2404, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 104, @@ -5391,7 +5309,6 @@ func TestPhp5(t *testing.T) { StartPos: 2418, EndPos: 2419, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 104, @@ -5434,7 +5351,6 @@ func TestPhp5(t *testing.T) { StartPos: 2434, EndPos: 2435, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 104, @@ -5750,7 +5666,6 @@ func TestPhp5(t *testing.T) { StartPos: 2627, EndPos: 2628, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 112, @@ -5827,7 +5742,6 @@ func TestPhp5(t *testing.T) { StartPos: 2659, EndPos: 2660, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 113, @@ -5854,7 +5768,6 @@ func TestPhp5(t *testing.T) { StartPos: 2663, EndPos: 2664, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 113, @@ -5940,7 +5853,6 @@ func TestPhp5(t *testing.T) { StartPos: 2699, EndPos: 2700, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 114, @@ -5976,7 +5888,6 @@ func TestPhp5(t *testing.T) { StartPos: 2707, EndPos: 2708, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 114, @@ -6014,7 +5925,6 @@ func TestPhp5(t *testing.T) { StartPos: 2721, EndPos: 2722, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 115, @@ -6040,7 +5950,6 @@ func TestPhp5(t *testing.T) { StartPos: 2725, EndPos: 2726, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 115, @@ -6085,7 +5994,6 @@ func TestPhp5(t *testing.T) { StartPos: 2742, EndPos: 2743, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 116, @@ -6120,7 +6028,6 @@ func TestPhp5(t *testing.T) { StartPos: 2750, EndPos: 2751, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 116, @@ -6445,7 +6352,6 @@ func TestPhp5(t *testing.T) { StartPos: 2994, EndPos: 2995, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 138, @@ -7111,7 +7017,6 @@ func TestPhp5(t *testing.T) { StartPos: 3286, EndPos: 3287, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 147, @@ -7170,7 +7075,6 @@ func TestPhp5(t *testing.T) { StartPos: 3319, EndPos: 3320, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 148, @@ -7218,7 +7122,6 @@ func TestPhp5(t *testing.T) { StartPos: 3350, EndPos: 3351, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 148, @@ -7277,7 +7180,6 @@ func TestPhp5(t *testing.T) { StartPos: 3383, EndPos: 3384, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 149, @@ -7325,7 +7227,6 @@ func TestPhp5(t *testing.T) { StartPos: 3415, EndPos: 3416, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 149, @@ -7373,7 +7274,6 @@ func TestPhp5(t *testing.T) { StartPos: 3457, EndPos: 3458, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 149, @@ -7432,7 +7332,6 @@ func TestPhp5(t *testing.T) { StartPos: 3490, EndPos: 3491, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 150, @@ -7471,7 +7370,6 @@ func TestPhp5(t *testing.T) { StartPos: 3517, EndPos: 3518, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 152, @@ -7489,7 +7387,6 @@ func TestPhp5(t *testing.T) { StartPos: 3521, EndPos: 3522, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 152, @@ -8108,7 +8005,6 @@ func TestPhp5(t *testing.T) { StartPos: 3737, EndPos: 3738, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 164, @@ -8158,7 +8054,6 @@ func TestPhp5(t *testing.T) { StartPos: 3746, EndPos: 3747, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 165, @@ -8304,7 +8199,6 @@ func TestPhp5(t *testing.T) { StartPos: 3794, EndPos: 3795, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 168, @@ -8366,7 +8260,6 @@ func TestPhp5(t *testing.T) { StartPos: 3813, EndPos: 3814, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 169, @@ -8418,7 +8311,6 @@ func TestPhp5(t *testing.T) { StartPos: 3827, EndPos: 3828, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 170, @@ -8504,7 +8396,6 @@ func TestPhp5(t *testing.T) { StartPos: 3845, EndPos: 3846, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 170, @@ -8541,7 +8432,6 @@ func TestPhp5(t *testing.T) { StartPos: 3853, EndPos: 3854, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 171, @@ -8575,7 +8465,6 @@ func TestPhp5(t *testing.T) { StartPos: 3860, EndPos: 3861, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 172, @@ -8653,7 +8542,6 @@ func TestPhp5(t *testing.T) { StartPos: 3885, EndPos: 3886, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 175, @@ -8687,7 +8575,6 @@ func TestPhp5(t *testing.T) { StartPos: 3898, EndPos: 3899, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 176, @@ -8754,7 +8641,6 @@ func TestPhp5(t *testing.T) { StartPos: 3929, EndPos: 3930, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 178, @@ -8782,7 +8668,6 @@ func TestPhp5(t *testing.T) { StartPos: 3933, EndPos: 3934, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 178, @@ -8810,7 +8695,6 @@ func TestPhp5(t *testing.T) { StartPos: 3942, EndPos: 3943, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 178, @@ -8835,7 +8719,6 @@ func TestPhp5(t *testing.T) { StartPos: 3947, EndPos: 3948, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 178, @@ -8886,7 +8769,6 @@ func TestPhp5(t *testing.T) { StartPos: 3966, EndPos: 3967, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 179, @@ -8914,7 +8796,6 @@ func TestPhp5(t *testing.T) { StartPos: 3970, EndPos: 3971, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 179, @@ -8949,7 +8830,6 @@ func TestPhp5(t *testing.T) { StartPos: 3980, EndPos: 3981, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 179, @@ -8968,7 +8848,6 @@ func TestPhp5(t *testing.T) { StartPos: 3984, EndPos: 3985, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 179, @@ -9130,7 +9009,6 @@ func TestPhp5(t *testing.T) { StartPos: 4050, EndPos: 4051, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 185, @@ -9207,7 +9085,6 @@ func TestPhp5(t *testing.T) { StartPos: 4072, EndPos: 4073, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 187, @@ -9241,7 +9118,6 @@ func TestPhp5(t *testing.T) { StartPos: 4083, EndPos: 4084, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 188, @@ -9293,7 +9169,6 @@ func TestPhp5(t *testing.T) { StartPos: 4103, EndPos: 4104, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 190, @@ -9345,7 +9220,6 @@ func TestPhp5(t *testing.T) { StartPos: 4123, EndPos: 4124, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 192, @@ -9458,7 +9332,6 @@ func TestPhp5(t *testing.T) { StartPos: 4154, EndPos: 4155, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 194, @@ -9559,7 +9432,6 @@ func TestPhp5(t *testing.T) { StartPos: 4173, EndPos: 4176, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 196, @@ -9601,7 +9473,6 @@ func TestPhp5(t *testing.T) { StartPos: 4184, EndPos: 4185, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 196, @@ -9639,7 +9510,6 @@ func TestPhp5(t *testing.T) { StartPos: 4192, EndPos: 4193, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 198, @@ -9673,7 +9543,6 @@ func TestPhp5(t *testing.T) { StartPos: 4200, EndPos: 4201, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 199, @@ -9707,7 +9576,6 @@ func TestPhp5(t *testing.T) { StartPos: 4210, EndPos: 4211, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 200, @@ -9741,7 +9609,6 @@ func TestPhp5(t *testing.T) { StartPos: 4218, EndPos: 4219, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 201, @@ -9775,7 +9642,6 @@ func TestPhp5(t *testing.T) { StartPos: 4233, EndPos: 4234, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 203, @@ -9809,7 +9675,6 @@ func TestPhp5(t *testing.T) { StartPos: 4252, EndPos: 4253, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 204, @@ -9843,7 +9708,6 @@ func TestPhp5(t *testing.T) { StartPos: 4266, EndPos: 4267, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 205, @@ -9877,7 +9741,6 @@ func TestPhp5(t *testing.T) { StartPos: 4285, EndPos: 4286, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 206, @@ -9911,7 +9774,6 @@ func TestPhp5(t *testing.T) { StartPos: 4292, EndPos: 4293, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 208, @@ -9964,7 +9826,6 @@ func TestPhp5(t *testing.T) { StartPos: 4313, EndPos: 4314, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 209, @@ -10017,7 +9878,6 @@ func TestPhp5(t *testing.T) { StartPos: 4344, EndPos: 4345, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 210, @@ -10071,7 +9931,6 @@ func TestPhp5(t *testing.T) { StartPos: 4373, EndPos: 4374, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 212, @@ -10089,7 +9948,6 @@ func TestPhp5(t *testing.T) { StartPos: 4377, EndPos: 4378, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 212, @@ -10178,7 +10036,6 @@ func TestPhp5(t *testing.T) { StartPos: 4407, EndPos: 4408, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 214, @@ -10227,7 +10084,6 @@ func TestPhp5(t *testing.T) { StartPos: 4418, EndPos: 4419, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 215, @@ -10253,7 +10109,6 @@ func TestPhp5(t *testing.T) { StartPos: 4422, EndPos: 4423, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 215, @@ -10274,7 +10129,6 @@ func TestPhp5(t *testing.T) { StartPos: 4428, EndPos: 4429, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 215, @@ -10330,7 +10184,6 @@ func TestPhp5(t *testing.T) { StartPos: 4439, EndPos: 4440, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 216, @@ -10352,7 +10205,6 @@ func TestPhp5(t *testing.T) { StartPos: 4447, EndPos: 4448, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 216, @@ -10416,7 +10268,6 @@ func TestPhp5(t *testing.T) { StartPos: 4463, EndPos: 4464, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 217, @@ -10440,7 +10291,6 @@ func TestPhp5(t *testing.T) { StartPos: 4470, EndPos: 4471, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 217, @@ -10474,7 +10324,6 @@ func TestPhp5(t *testing.T) { StartPos: 4477, EndPos: 4478, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 219, @@ -10646,7 +10495,6 @@ func TestPhp5(t *testing.T) { StartPos: 4544, EndPos: 4545, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 223, @@ -10680,7 +10528,6 @@ func TestPhp5(t *testing.T) { StartPos: 4551, EndPos: 4552, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 224, @@ -10730,7 +10577,6 @@ func TestPhp5(t *testing.T) { StartPos: 4562, EndPos: 4563, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 225, @@ -10811,7 +10657,6 @@ func TestPhp5(t *testing.T) { StartPos: 4576, EndPos: 4577, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 226, @@ -10916,7 +10761,6 @@ func TestPhp5(t *testing.T) { StartPos: 4608, EndPos: 4609, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 227, @@ -10997,7 +10841,6 @@ func TestPhp5(t *testing.T) { StartPos: 4632, EndPos: 4633, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 228, @@ -11163,7 +11006,6 @@ func TestPhp5(t *testing.T) { StartPos: 4675, EndPos: 4676, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 233, @@ -11376,7 +11218,6 @@ func TestPhp5(t *testing.T) { StartPos: 4742, EndPos: 4745, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 238, @@ -11418,7 +11259,6 @@ func TestPhp5(t *testing.T) { StartPos: 4752, EndPos: 4755, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 239, @@ -11436,7 +11276,6 @@ func TestPhp5(t *testing.T) { StartPos: 4758, EndPos: 4761, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 239, @@ -11497,7 +11336,6 @@ func TestPhp5(t *testing.T) { StartPos: 4773, EndPos: 4776, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 240, @@ -11550,7 +11388,6 @@ func TestPhp5(t *testing.T) { StartPos: 4796, EndPos: 4799, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 241, @@ -11603,7 +11440,6 @@ func TestPhp5(t *testing.T) { StartPos: 4810, EndPos: 4813, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 242, @@ -11637,7 +11473,6 @@ func TestPhp5(t *testing.T) { StartPos: 4818, EndPos: 4819, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 243, @@ -11655,7 +11490,6 @@ func TestPhp5(t *testing.T) { StartPos: 4823, EndPos: 4824, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 243, @@ -11673,7 +11507,6 @@ func TestPhp5(t *testing.T) { StartPos: 4828, EndPos: 4829, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 243, @@ -11707,7 +11540,6 @@ func TestPhp5(t *testing.T) { StartPos: 4834, EndPos: 4835, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 244, @@ -11725,7 +11557,6 @@ func TestPhp5(t *testing.T) { StartPos: 4841, EndPos: 4842, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 244, @@ -11759,7 +11590,6 @@ func TestPhp5(t *testing.T) { StartPos: 4847, EndPos: 4848, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 245, @@ -11784,7 +11614,6 @@ func TestPhp5(t *testing.T) { StartPos: 4852, EndPos: 4853, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 245, @@ -11802,7 +11631,6 @@ func TestPhp5(t *testing.T) { StartPos: 4857, EndPos: 4858, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 245, @@ -11820,7 +11648,6 @@ func TestPhp5(t *testing.T) { StartPos: 4862, EndPos: 4863, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 245, @@ -11839,7 +11666,6 @@ func TestPhp5(t *testing.T) { StartPos: 4867, EndPos: 4868, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 245, @@ -11880,7 +11706,6 @@ func TestPhp5(t *testing.T) { StartPos: 4873, EndPos: 4874, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 246, @@ -11898,7 +11723,6 @@ func TestPhp5(t *testing.T) { StartPos: 4878, EndPos: 4879, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 246, @@ -11916,7 +11740,6 @@ func TestPhp5(t *testing.T) { StartPos: 4883, EndPos: 4884, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 246, @@ -11935,7 +11758,6 @@ func TestPhp5(t *testing.T) { StartPos: 4888, EndPos: 4889, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 246, @@ -11953,7 +11775,6 @@ func TestPhp5(t *testing.T) { StartPos: 4893, EndPos: 4894, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 246, @@ -11987,7 +11808,6 @@ func TestPhp5(t *testing.T) { StartPos: 4900, EndPos: 4901, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 247, @@ -12021,7 +11841,6 @@ func TestPhp5(t *testing.T) { StartPos: 4907, EndPos: 4908, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 248, @@ -12048,7 +11867,6 @@ func TestPhp5(t *testing.T) { StartPos: 4913, EndPos: 4915, }, - StringVar: false, VarName: &expr.Variable{ Position: &position.Position{ StartLine: 249, @@ -12056,7 +11874,6 @@ func TestPhp5(t *testing.T) { StartPos: 4914, EndPos: 4915, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 249, @@ -12083,7 +11900,6 @@ func TestPhp5(t *testing.T) { StartPos: 4920, EndPos: 4923, }, - StringVar: false, VarName: &expr.Variable{ Position: &position.Position{ StartLine: 250, @@ -12091,7 +11907,6 @@ func TestPhp5(t *testing.T) { StartPos: 4921, EndPos: 4923, }, - StringVar: false, VarName: &expr.Variable{ Position: &position.Position{ StartLine: 250, @@ -12099,7 +11914,6 @@ func TestPhp5(t *testing.T) { StartPos: 4922, EndPos: 4923, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 250, @@ -12150,7 +11964,6 @@ func TestPhp5(t *testing.T) { StartPos: 4943, EndPos: 4944, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 252, @@ -12184,7 +11997,6 @@ func TestPhp5(t *testing.T) { StartPos: 4955, EndPos: 4956, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 253, @@ -12202,7 +12014,6 @@ func TestPhp5(t *testing.T) { StartPos: 4961, EndPos: 4962, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 253, @@ -12288,7 +12099,6 @@ func TestPhp5(t *testing.T) { StartPos: 4993, EndPos: 4994, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 255, @@ -12358,7 +12168,6 @@ func TestPhp5(t *testing.T) { StartPos: 5023, EndPos: 5024, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 257, @@ -12392,7 +12201,6 @@ func TestPhp5(t *testing.T) { StartPos: 5038, EndPos: 5039, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 258, @@ -12426,7 +12234,6 @@ func TestPhp5(t *testing.T) { StartPos: 5050, EndPos: 5051, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 259, @@ -12460,7 +12267,6 @@ func TestPhp5(t *testing.T) { StartPos: 5064, EndPos: 5065, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 260, @@ -12494,7 +12300,6 @@ func TestPhp5(t *testing.T) { StartPos: 5077, EndPos: 5078, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 261, @@ -12528,7 +12333,6 @@ func TestPhp5(t *testing.T) { StartPos: 5092, EndPos: 5093, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 262, @@ -12562,7 +12366,6 @@ func TestPhp5(t *testing.T) { StartPos: 5103, EndPos: 5104, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 263, @@ -12596,7 +12399,6 @@ func TestPhp5(t *testing.T) { StartPos: 5117, EndPos: 5118, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 264, @@ -12630,7 +12432,6 @@ func TestPhp5(t *testing.T) { StartPos: 5131, EndPos: 5132, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 265, @@ -12664,7 +12465,6 @@ func TestPhp5(t *testing.T) { StartPos: 5144, EndPos: 5145, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 266, @@ -12698,7 +12498,6 @@ func TestPhp5(t *testing.T) { StartPos: 5151, EndPos: 5152, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 268, @@ -12716,7 +12515,6 @@ func TestPhp5(t *testing.T) { StartPos: 5156, EndPos: 5157, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 268, @@ -12750,7 +12548,6 @@ func TestPhp5(t *testing.T) { StartPos: 5162, EndPos: 5163, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 269, @@ -12768,7 +12565,6 @@ func TestPhp5(t *testing.T) { StartPos: 5167, EndPos: 5168, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 269, @@ -12802,7 +12598,6 @@ func TestPhp5(t *testing.T) { StartPos: 5173, EndPos: 5174, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 270, @@ -12820,7 +12615,6 @@ func TestPhp5(t *testing.T) { StartPos: 5178, EndPos: 5179, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 270, @@ -12854,7 +12648,6 @@ func TestPhp5(t *testing.T) { StartPos: 5184, EndPos: 5185, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 271, @@ -12872,7 +12665,6 @@ func TestPhp5(t *testing.T) { StartPos: 5190, EndPos: 5191, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 271, @@ -12906,7 +12698,6 @@ func TestPhp5(t *testing.T) { StartPos: 5196, EndPos: 5197, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 272, @@ -12924,7 +12715,6 @@ func TestPhp5(t *testing.T) { StartPos: 5202, EndPos: 5203, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 272, @@ -12958,7 +12748,6 @@ func TestPhp5(t *testing.T) { StartPos: 5208, EndPos: 5209, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 273, @@ -12976,7 +12765,6 @@ func TestPhp5(t *testing.T) { StartPos: 5213, EndPos: 5214, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 273, @@ -13010,7 +12798,6 @@ func TestPhp5(t *testing.T) { StartPos: 5219, EndPos: 5220, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 274, @@ -13028,7 +12815,6 @@ func TestPhp5(t *testing.T) { StartPos: 5224, EndPos: 5225, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 274, @@ -13062,7 +12848,6 @@ func TestPhp5(t *testing.T) { StartPos: 5230, EndPos: 5231, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 275, @@ -13080,7 +12865,6 @@ func TestPhp5(t *testing.T) { StartPos: 5236, EndPos: 5237, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 275, @@ -13114,7 +12898,6 @@ func TestPhp5(t *testing.T) { StartPos: 5242, EndPos: 5243, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 276, @@ -13132,7 +12915,6 @@ func TestPhp5(t *testing.T) { StartPos: 5248, EndPos: 5249, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 276, @@ -13166,7 +12948,6 @@ func TestPhp5(t *testing.T) { StartPos: 5254, EndPos: 5255, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 277, @@ -13184,7 +12965,6 @@ func TestPhp5(t *testing.T) { StartPos: 5259, EndPos: 5260, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 277, @@ -13218,7 +12998,6 @@ func TestPhp5(t *testing.T) { StartPos: 5265, EndPos: 5266, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 278, @@ -13236,7 +13015,6 @@ func TestPhp5(t *testing.T) { StartPos: 5272, EndPos: 5273, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 278, @@ -13270,7 +13048,6 @@ func TestPhp5(t *testing.T) { StartPos: 5278, EndPos: 5279, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 279, @@ -13288,7 +13065,6 @@ func TestPhp5(t *testing.T) { StartPos: 5285, EndPos: 5286, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 279, @@ -13322,7 +13098,6 @@ func TestPhp5(t *testing.T) { StartPos: 5291, EndPos: 5292, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 280, @@ -13340,7 +13115,6 @@ func TestPhp5(t *testing.T) { StartPos: 5297, EndPos: 5298, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 280, @@ -13374,7 +13148,6 @@ func TestPhp5(t *testing.T) { StartPos: 5303, EndPos: 5304, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 281, @@ -13392,7 +13165,6 @@ func TestPhp5(t *testing.T) { StartPos: 5310, EndPos: 5311, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 281, @@ -13426,7 +13198,6 @@ func TestPhp5(t *testing.T) { StartPos: 5316, EndPos: 5317, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 282, @@ -13444,7 +13215,6 @@ func TestPhp5(t *testing.T) { StartPos: 5321, EndPos: 5322, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 282, @@ -13478,7 +13248,6 @@ func TestPhp5(t *testing.T) { StartPos: 5327, EndPos: 5328, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 283, @@ -13496,7 +13265,6 @@ func TestPhp5(t *testing.T) { StartPos: 5332, EndPos: 5333, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 283, @@ -13530,7 +13298,6 @@ func TestPhp5(t *testing.T) { StartPos: 5338, EndPos: 5339, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 284, @@ -13548,7 +13315,6 @@ func TestPhp5(t *testing.T) { StartPos: 5343, EndPos: 5344, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 284, @@ -13582,7 +13348,6 @@ func TestPhp5(t *testing.T) { StartPos: 5349, EndPos: 5350, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 285, @@ -13600,7 +13365,6 @@ func TestPhp5(t *testing.T) { StartPos: 5355, EndPos: 5356, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 285, @@ -13634,7 +13398,6 @@ func TestPhp5(t *testing.T) { StartPos: 5361, EndPos: 5362, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 286, @@ -13652,7 +13415,6 @@ func TestPhp5(t *testing.T) { StartPos: 5368, EndPos: 5369, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 286, @@ -13686,7 +13448,6 @@ func TestPhp5(t *testing.T) { StartPos: 5374, EndPos: 5375, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 287, @@ -13704,7 +13465,6 @@ func TestPhp5(t *testing.T) { StartPos: 5379, EndPos: 5380, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 287, @@ -13738,7 +13498,6 @@ func TestPhp5(t *testing.T) { StartPos: 5385, EndPos: 5386, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 288, @@ -13756,7 +13515,6 @@ func TestPhp5(t *testing.T) { StartPos: 5391, EndPos: 5392, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 288, @@ -13790,7 +13548,6 @@ func TestPhp5(t *testing.T) { StartPos: 5397, EndPos: 5398, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 289, @@ -13808,7 +13565,6 @@ func TestPhp5(t *testing.T) { StartPos: 5403, EndPos: 5404, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 289, @@ -13842,7 +13598,6 @@ func TestPhp5(t *testing.T) { StartPos: 5409, EndPos: 5410, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 290, @@ -13860,7 +13615,6 @@ func TestPhp5(t *testing.T) { StartPos: 5415, EndPos: 5416, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 290, @@ -13894,7 +13648,6 @@ func TestPhp5(t *testing.T) { StartPos: 5421, EndPos: 5422, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 291, @@ -13912,7 +13665,6 @@ func TestPhp5(t *testing.T) { StartPos: 5427, EndPos: 5428, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 291, @@ -13946,7 +13698,6 @@ func TestPhp5(t *testing.T) { StartPos: 5433, EndPos: 5434, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 292, @@ -13964,7 +13715,6 @@ func TestPhp5(t *testing.T) { StartPos: 5438, EndPos: 5439, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 292, @@ -13998,7 +13748,6 @@ func TestPhp5(t *testing.T) { StartPos: 5445, EndPos: 5446, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 294, @@ -14016,7 +13765,6 @@ func TestPhp5(t *testing.T) { StartPos: 5451, EndPos: 5452, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 294, @@ -14050,7 +13798,6 @@ func TestPhp5(t *testing.T) { StartPos: 5457, EndPos: 5458, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 295, @@ -14111,7 +13858,6 @@ func TestPhp5(t *testing.T) { StartPos: 5474, EndPos: 5475, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 296, @@ -14172,7 +13918,6 @@ func TestPhp5(t *testing.T) { StartPos: 5488, EndPos: 5489, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 296, @@ -14210,7 +13955,6 @@ func TestPhp5(t *testing.T) { StartPos: 5495, EndPos: 5496, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 297, @@ -14228,7 +13972,6 @@ func TestPhp5(t *testing.T) { StartPos: 5500, EndPos: 5501, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 297, @@ -14262,7 +14005,6 @@ func TestPhp5(t *testing.T) { StartPos: 5506, EndPos: 5507, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 298, @@ -14280,7 +14022,6 @@ func TestPhp5(t *testing.T) { StartPos: 5512, EndPos: 5513, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 298, @@ -14314,7 +14055,6 @@ func TestPhp5(t *testing.T) { StartPos: 5518, EndPos: 5519, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 299, @@ -14332,7 +14072,6 @@ func TestPhp5(t *testing.T) { StartPos: 5524, EndPos: 5525, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 299, @@ -14366,7 +14105,6 @@ func TestPhp5(t *testing.T) { StartPos: 5530, EndPos: 5531, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 300, @@ -14384,7 +14122,6 @@ func TestPhp5(t *testing.T) { StartPos: 5536, EndPos: 5537, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 300, @@ -14418,7 +14155,6 @@ func TestPhp5(t *testing.T) { StartPos: 5542, EndPos: 5543, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 301, @@ -14436,7 +14172,6 @@ func TestPhp5(t *testing.T) { StartPos: 5548, EndPos: 5549, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 301, @@ -14470,7 +14205,6 @@ func TestPhp5(t *testing.T) { StartPos: 5554, EndPos: 5555, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 302, @@ -14488,7 +14222,6 @@ func TestPhp5(t *testing.T) { StartPos: 5560, EndPos: 5561, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 302, @@ -14522,7 +14255,6 @@ func TestPhp5(t *testing.T) { StartPos: 5566, EndPos: 5567, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 303, @@ -14540,7 +14272,6 @@ func TestPhp5(t *testing.T) { StartPos: 5572, EndPos: 5573, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 303, @@ -14574,7 +14305,6 @@ func TestPhp5(t *testing.T) { StartPos: 5578, EndPos: 5579, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 304, @@ -14592,7 +14322,6 @@ func TestPhp5(t *testing.T) { StartPos: 5584, EndPos: 5585, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 304, @@ -14626,7 +14355,6 @@ func TestPhp5(t *testing.T) { StartPos: 5590, EndPos: 5591, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 305, @@ -14644,7 +14372,6 @@ func TestPhp5(t *testing.T) { StartPos: 5596, EndPos: 5597, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 305, @@ -14678,7 +14405,6 @@ func TestPhp5(t *testing.T) { StartPos: 5602, EndPos: 5603, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 306, @@ -14696,7 +14422,6 @@ func TestPhp5(t *testing.T) { StartPos: 5608, EndPos: 5609, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 306, @@ -14730,7 +14455,6 @@ func TestPhp5(t *testing.T) { StartPos: 5614, EndPos: 5615, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 307, @@ -14748,7 +14472,6 @@ func TestPhp5(t *testing.T) { StartPos: 5621, EndPos: 5622, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 307, @@ -14782,7 +14505,6 @@ func TestPhp5(t *testing.T) { StartPos: 5627, EndPos: 5628, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 308, @@ -14800,7 +14522,6 @@ func TestPhp5(t *testing.T) { StartPos: 5634, EndPos: 5635, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 308, @@ -14834,7 +14555,6 @@ func TestPhp5(t *testing.T) { StartPos: 5640, EndPos: 5641, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 309, @@ -14852,7 +14572,6 @@ func TestPhp5(t *testing.T) { StartPos: 5647, EndPos: 5648, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 309, @@ -15383,7 +15102,6 @@ func TestPhp5(t *testing.T) { StartPos: 5810, EndPos: 5813, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 322, @@ -15424,7 +15142,6 @@ func TestPhp5(t *testing.T) { StartPos: 5822, EndPos: 5825, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 323, @@ -15442,7 +15159,6 @@ func TestPhp5(t *testing.T) { StartPos: 5828, EndPos: 5831, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 323, @@ -15491,7 +15207,6 @@ func TestPhp5(t *testing.T) { StartPos: 5840, EndPos: 5844, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 324, @@ -15580,7 +15295,6 @@ func TestPhp5(t *testing.T) { StartPos: 5856, EndPos: 5860, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 325, @@ -15615,7 +15329,6 @@ func TestPhp5(t *testing.T) { StartPos: 5862, EndPos: 5863, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 325, @@ -15662,7 +15375,6 @@ func TestPhp5(t *testing.T) { StartPos: 5875, EndPos: 5876, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 325, @@ -15718,7 +15430,6 @@ func TestPhp5(t *testing.T) { StartPos: 5891, EndPos: 5892, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 325, @@ -15798,7 +15509,6 @@ func TestPhp5(t *testing.T) { StartPos: 5914, EndPos: 5915, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 327, @@ -15851,7 +15561,6 @@ func TestPhp5(t *testing.T) { StartPos: 5932, EndPos: 5933, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 328, @@ -15904,7 +15613,6 @@ func TestPhp5(t *testing.T) { StartPos: 5950, EndPos: 5951, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 329, @@ -15957,7 +15665,6 @@ func TestPhp5(t *testing.T) { StartPos: 5968, EndPos: 5969, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 330, @@ -16010,7 +15717,6 @@ func TestPhp5(t *testing.T) { StartPos: 5986, EndPos: 5987, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 331, @@ -16055,7 +15761,6 @@ func TestPhp5(t *testing.T) { StartPos: 6005, EndPos: 6006, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 332, @@ -16117,7 +15822,6 @@ func TestPhp5(t *testing.T) { StartPos: 6027, EndPos: 6028, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 333, @@ -16188,7 +15892,6 @@ func TestPhp5(t *testing.T) { StartPos: 6052, EndPos: 6053, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 334, @@ -16250,7 +15953,6 @@ func TestPhp5(t *testing.T) { StartPos: 6073, EndPos: 6074, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 335, @@ -16312,7 +16014,6 @@ func TestPhp5(t *testing.T) { StartPos: 6094, EndPos: 6095, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 336, @@ -16374,7 +16075,6 @@ func TestPhp5(t *testing.T) { StartPos: 6115, EndPos: 6116, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 337, @@ -16436,7 +16136,6 @@ func TestPhp5(t *testing.T) { StartPos: 6137, EndPos: 6138, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 338, @@ -16498,7 +16197,6 @@ func TestPhp5(t *testing.T) { StartPos: 6159, EndPos: 6160, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 339, @@ -16560,7 +16258,6 @@ func TestPhp5(t *testing.T) { StartPos: 6180, EndPos: 6181, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 340, @@ -16622,7 +16319,6 @@ func TestPhp5(t *testing.T) { StartPos: 6201, EndPos: 6202, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 341, @@ -16684,7 +16380,6 @@ func TestPhp5(t *testing.T) { StartPos: 6223, EndPos: 6224, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 342, @@ -16746,7 +16441,6 @@ func TestPhp5(t *testing.T) { StartPos: 6245, EndPos: 6246, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 343, @@ -16808,7 +16502,6 @@ func TestPhp5(t *testing.T) { StartPos: 6266, EndPos: 6267, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 344, @@ -16870,7 +16563,6 @@ func TestPhp5(t *testing.T) { StartPos: 6289, EndPos: 6290, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 345, @@ -16932,7 +16624,6 @@ func TestPhp5(t *testing.T) { StartPos: 6312, EndPos: 6313, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 346, @@ -16994,7 +16685,6 @@ func TestPhp5(t *testing.T) { StartPos: 6334, EndPos: 6335, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 347, @@ -17056,7 +16746,6 @@ func TestPhp5(t *testing.T) { StartPos: 6357, EndPos: 6358, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 348, @@ -17118,7 +16807,6 @@ func TestPhp5(t *testing.T) { StartPos: 6378, EndPos: 6379, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 349, @@ -17180,7 +16868,6 @@ func TestPhp5(t *testing.T) { StartPos: 6399, EndPos: 6400, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 350, @@ -17242,7 +16929,6 @@ func TestPhp5(t *testing.T) { StartPos: 6420, EndPos: 6421, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 351, @@ -17304,7 +16990,6 @@ func TestPhp5(t *testing.T) { StartPos: 6442, EndPos: 6443, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 352, @@ -17366,7 +17051,6 @@ func TestPhp5(t *testing.T) { StartPos: 6465, EndPos: 6466, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 353, @@ -17428,7 +17112,6 @@ func TestPhp5(t *testing.T) { StartPos: 6486, EndPos: 6487, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 354, @@ -17490,7 +17173,6 @@ func TestPhp5(t *testing.T) { StartPos: 6508, EndPos: 6509, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 355, @@ -17552,7 +17234,6 @@ func TestPhp5(t *testing.T) { StartPos: 6530, EndPos: 6531, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 356, @@ -17614,7 +17295,6 @@ func TestPhp5(t *testing.T) { StartPos: 6552, EndPos: 6553, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 357, @@ -17676,7 +17356,6 @@ func TestPhp5(t *testing.T) { StartPos: 6574, EndPos: 6575, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 358, @@ -17738,7 +17417,6 @@ func TestPhp5(t *testing.T) { StartPos: 6595, EndPos: 6596, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 359, @@ -17810,7 +17488,6 @@ func TestPhp5(t *testing.T) { StartPos: 6619, EndPos: 6620, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 360, @@ -17882,7 +17559,6 @@ func TestPhp5(t *testing.T) { StartPos: 6645, EndPos: 6646, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 361, @@ -17927,7 +17603,6 @@ func TestPhp5(t *testing.T) { StartPos: 6670, EndPos: 6671, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 362, @@ -17990,7 +17665,6 @@ func TestPhp5(t *testing.T) { StartPos: 6689, EndPos: 6690, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 363, @@ -18053,7 +17727,6 @@ func TestPhp5(t *testing.T) { StartPos: 6718, EndPos: 6719, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 364, @@ -18116,7 +17789,6 @@ func TestPhp5(t *testing.T) { StartPos: 6738, EndPos: 6739, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 365, @@ -18160,7 +17832,6 @@ func TestPhp5(t *testing.T) { StartPos: 6761, EndPos: 6762, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 366, @@ -18249,7 +17920,6 @@ func TestPhp5(t *testing.T) { StartPos: 6793, EndPos: 6794, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 367, @@ -18407,7 +18077,6 @@ func TestPhp5(t *testing.T) { StartPos: 6840, EndPos: 6844, }, - StringVar: false, VarName: &expr.Variable{ Position: &position.Position{ StartLine: 370, @@ -18415,7 +18084,6 @@ func TestPhp5(t *testing.T) { StartPos: 6841, EndPos: 6844, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 370, @@ -18450,7 +18118,6 @@ func TestPhp5(t *testing.T) { StartPos: 6850, EndPos: 6853, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 372, @@ -18506,7 +18173,6 @@ func TestPhp5(t *testing.T) { StartPos: 6860, EndPos: 6863, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 373, @@ -18568,7 +18234,6 @@ func TestPhp5(t *testing.T) { StartPos: 6876, EndPos: 6877, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 374, @@ -18586,7 +18251,6 @@ func TestPhp5(t *testing.T) { StartPos: 6879, EndPos: 6880, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 374, @@ -18613,7 +18277,6 @@ func TestPhp5(t *testing.T) { StartPos: 6886, EndPos: 6890, }, - StringVar: false, VarName: &expr.Variable{ Position: &position.Position{ StartLine: 375, @@ -18621,7 +18284,6 @@ func TestPhp5(t *testing.T) { StartPos: 6888, EndPos: 6889, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 375, @@ -18655,7 +18317,6 @@ func TestPhp5(t *testing.T) { StartPos: 6895, EndPos: 6898, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 376, @@ -18673,7 +18334,6 @@ func TestPhp5(t *testing.T) { StartPos: 6901, EndPos: 6906, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 376, @@ -18715,7 +18375,6 @@ func TestPhp5(t *testing.T) { StartPos: 6913, EndPos: 6916, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 377, diff --git a/php7/parser.go b/php7/parser.go index c850d0c..329eba6 100644 --- a/php7/parser.go +++ b/php7/parser.go @@ -113,6 +113,14 @@ func (l *Parser) appendMetaToken(n node.Node, t *scanner.Token, tn meta.TokenNam n.GetMeta().Push(m) } +func (l *Parser) appendMeta(n node.Node, m *meta.Data, tn meta.TokenName) { + if !l.Lexer.WithMeta { + return + } + + n.GetMeta().Push(m) +} + func (l *Parser) prependMetaToken(n node.Node, t *scanner.Token, tn meta.TokenName) { if !l.Lexer.WithMeta { return diff --git a/php7/php7.go b/php7/php7.go index ebe666c..3bc23af 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -1,3 +1,5 @@ +// Code generated by goyacc -o php7/php7.go php7/php7.y. DO NOT EDIT. + //line php7/php7.y:2 package php7 @@ -346,7 +348,7 @@ const yyEofCode = 1 const yyErrCode = 2 const yyInitialStackSize = 16 -//line php7/php7.y:5453 +//line php7/php7.y:5466 //line yacctab:1 var yyExca = [...]int{ @@ -3693,6 +3695,7 @@ yydefault: yyDollar[2].token.Meta.SetTokenName(meta.CatchToken).AppendTo(catch.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(catch.GetMeta()) yyDollar[5].token.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) yyDollar[6].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(catch.GetMeta()) yyDollar[7].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(catch.GetMeta()) yyDollar[9].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(catch.GetMeta()) @@ -3701,7 +3704,7 @@ yydefault: } case 157: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1357 + //line php7/php7.y:1358 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -3709,7 +3712,7 @@ yydefault: } case 158: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1363 + //line php7/php7.y:1364 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -3720,7 +3723,7 @@ yydefault: } case 159: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1375 + //line php7/php7.y:1376 { yyVAL.node = nil @@ -3728,7 +3731,7 @@ yydefault: } case 160: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1381 + //line php7/php7.y:1382 { yyVAL.node = stmt.NewFinally(yyDollar[3].list) @@ -3744,7 +3747,7 @@ yydefault: } case 161: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1398 + //line php7/php7.y:1399 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -3752,7 +3755,7 @@ yydefault: } case 162: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1404 + //line php7/php7.y:1405 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -3763,7 +3766,7 @@ yydefault: } case 163: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1416 + //line php7/php7.y:1417 { yyVAL.node = yyDollar[1].node @@ -3771,7 +3774,7 @@ yydefault: } case 164: yyDollar = yyS[yypt-11 : yypt+1] - //line php7/php7.y:1425 + //line php7/php7.y:1426 { name := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewFunction(name, yyDollar[2].token != nil, yyDollar[6].list, yyDollar[8].node, yyDollar[10].list, yyDollar[4].str) @@ -3795,31 +3798,31 @@ yydefault: } case 165: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1451 + //line php7/php7.y:1452 { yyVAL.token = nil } case 166: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1455 + //line php7/php7.y:1456 { yyVAL.token = yyDollar[1].token } case 167: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1462 + //line php7/php7.y:1463 { yyVAL.token = nil } case 168: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1466 + //line php7/php7.y:1467 { yyVAL.token = yyDollar[1].token } case 169: yyDollar = yyS[yypt-9 : yypt+1] - //line php7/php7.y:1473 + //line php7/php7.y:1474 { name := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewClass(name, yyDollar[1].list, nil, yyDollar[4].ClassExtends, yyDollar[5].ClassImplements, yyDollar[8].list, yyDollar[6].str) @@ -3838,7 +3841,7 @@ yydefault: } case 170: yyDollar = yyS[yypt-8 : yypt+1] - //line php7/php7.y:1490 + //line php7/php7.y:1491 { name := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewClass(name, nil, nil, yyDollar[3].ClassExtends, yyDollar[4].ClassImplements, yyDollar[7].list, yyDollar[5].str) @@ -3857,7 +3860,7 @@ yydefault: } case 171: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1510 + //line php7/php7.y:1511 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -3865,7 +3868,7 @@ yydefault: } case 172: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1516 + //line php7/php7.y:1517 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -3873,7 +3876,7 @@ yydefault: } case 173: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1525 + //line php7/php7.y:1526 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -3887,7 +3890,7 @@ yydefault: } case 174: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1537 + //line php7/php7.y:1538 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -3901,7 +3904,7 @@ yydefault: } case 175: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1552 + //line php7/php7.y:1553 { name := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewTrait(name, yyDollar[5].list, yyDollar[3].str) @@ -3920,7 +3923,7 @@ yydefault: } case 176: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:1572 + //line php7/php7.y:1573 { name := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewInterface(name, yyDollar[3].InterfaceExtends, yyDollar[6].list, yyDollar[4].str) @@ -3939,7 +3942,7 @@ yydefault: } case 177: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1592 + //line php7/php7.y:1593 { yyVAL.ClassExtends = nil @@ -3947,7 +3950,7 @@ yydefault: } case 178: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1598 + //line php7/php7.y:1599 { yyVAL.ClassExtends = stmt.NewClassExtends(yyDollar[2].node) @@ -3961,7 +3964,7 @@ yydefault: } case 179: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1613 + //line php7/php7.y:1614 { yyVAL.InterfaceExtends = nil @@ -3969,7 +3972,7 @@ yydefault: } case 180: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1619 + //line php7/php7.y:1620 { yyVAL.InterfaceExtends = stmt.NewInterfaceExtends(yyDollar[2].list) @@ -3983,7 +3986,7 @@ yydefault: } case 181: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1634 + //line php7/php7.y:1635 { yyVAL.ClassImplements = nil @@ -3991,7 +3994,7 @@ yydefault: } case 182: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1640 + //line php7/php7.y:1641 { yyVAL.ClassImplements = stmt.NewClassImplements(yyDollar[2].list) @@ -4005,7 +4008,7 @@ yydefault: } case 183: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1655 + //line php7/php7.y:1656 { yyVAL.node = yyDollar[1].node @@ -4013,7 +4016,7 @@ yydefault: } case 184: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1661 + //line php7/php7.y:1662 { yyVAL.node = expr.NewReference(yyDollar[2].node) @@ -4027,7 +4030,7 @@ yydefault: } case 185: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1673 + //line php7/php7.y:1674 { yyVAL.node = expr.NewList(yyDollar[3].list) @@ -4043,7 +4046,7 @@ yydefault: } case 186: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1687 + //line php7/php7.y:1688 { yyVAL.node = expr.NewShortList(yyDollar[2].list) @@ -4058,7 +4061,7 @@ yydefault: } case 187: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1703 + //line php7/php7.y:1704 { yyVAL.node = stmt.NewFor(nil, nil, nil, yyDollar[1].node) @@ -4069,7 +4072,7 @@ yydefault: } case 188: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1712 + //line php7/php7.y:1713 { stmtList := stmt.NewStmtList(yyDollar[2].list) yyVAL.node = stmt.NewAltFor(nil, nil, nil, stmtList) @@ -4088,7 +4091,7 @@ yydefault: } case 189: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1732 + //line php7/php7.y:1733 { yyVAL.node = stmt.NewForeach(nil, nil, nil, yyDollar[1].node) @@ -4099,7 +4102,7 @@ yydefault: } case 190: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1741 + //line php7/php7.y:1742 { stmtList := stmt.NewStmtList(yyDollar[2].list) yyVAL.node = stmt.NewAltForeach(nil, nil, nil, stmtList) @@ -4118,7 +4121,7 @@ yydefault: } case 191: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1761 + //line php7/php7.y:1762 { yyVAL.node = stmt.NewDeclare(nil, yyDollar[1].node, false) @@ -4129,7 +4132,7 @@ yydefault: } case 192: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1770 + //line php7/php7.y:1771 { stmtList := stmt.NewStmtList(yyDollar[2].list) yyVAL.node = stmt.NewDeclare(nil, stmtList, true) @@ -4148,7 +4151,7 @@ yydefault: } case 193: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1790 + //line php7/php7.y:1791 { caseList := stmt.NewCaseList(yyDollar[2].list) yyVAL.node = stmt.NewSwitch(nil, caseList) @@ -4165,7 +4168,7 @@ yydefault: } case 194: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1805 + //line php7/php7.y:1806 { caseList := stmt.NewCaseList(yyDollar[3].list) yyVAL.node = stmt.NewSwitch(nil, caseList) @@ -4184,7 +4187,7 @@ yydefault: } case 195: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1822 + //line php7/php7.y:1823 { caseList := stmt.NewCaseList(yyDollar[2].list) yyVAL.node = stmt.NewAltSwitch(nil, caseList) @@ -4203,7 +4206,7 @@ yydefault: } case 196: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:1839 + //line php7/php7.y:1840 { caseList := stmt.NewCaseList(yyDollar[3].list) @@ -4225,7 +4228,7 @@ yydefault: } case 197: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1862 + //line php7/php7.y:1863 { yyVAL.list = []node.Node{} @@ -4233,7 +4236,7 @@ yydefault: } case 198: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:1868 + //line php7/php7.y:1869 { _case := stmt.NewCase(yyDollar[3].node, yyDollar[5].list) yyVAL.list = append(yyDollar[1].list, _case) @@ -4250,7 +4253,7 @@ yydefault: } case 199: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1883 + //line php7/php7.y:1884 { _default := stmt.NewDefault(yyDollar[4].list) yyVAL.list = append(yyDollar[1].list, _default) @@ -4267,19 +4270,19 @@ yydefault: } case 200: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1901 + //line php7/php7.y:1902 { yyVAL.token = yyDollar[1].token } case 201: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1905 + //line php7/php7.y:1906 { yyVAL.token = yyDollar[1].token } case 202: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1912 + //line php7/php7.y:1913 { yyVAL.node = stmt.NewWhile(nil, yyDollar[1].node) @@ -4290,7 +4293,7 @@ yydefault: } case 203: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1921 + //line php7/php7.y:1922 { stmtList := stmt.NewStmtList(yyDollar[2].list) yyVAL.node = stmt.NewAltWhile(nil, stmtList) @@ -4309,7 +4312,7 @@ yydefault: } case 204: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:1941 + //line php7/php7.y:1942 { yyVAL.node = stmt.NewIf(yyDollar[3].node, yyDollar[5].node, nil, nil) @@ -4325,7 +4328,7 @@ yydefault: } case 205: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1955 + //line php7/php7.y:1956 { _elseIf := stmt.NewElseIf(yyDollar[4].node, yyDollar[6].node) yyVAL.node = yyDollar[1].node.(*stmt.If).AddElseIf(_elseIf) @@ -4343,7 +4346,7 @@ yydefault: } case 206: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1974 + //line php7/php7.y:1975 { yyVAL.node = yyDollar[1].node @@ -4351,7 +4354,7 @@ yydefault: } case 207: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1980 + //line php7/php7.y:1981 { _else := stmt.NewElse(yyDollar[3].node) yyVAL.node = yyDollar[1].node.(*stmt.If).SetElse(_else) @@ -4367,7 +4370,7 @@ yydefault: } case 208: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1997 + //line php7/php7.y:1998 { stmts := stmt.NewStmtList(yyDollar[6].list) yyVAL.node = stmt.NewAltIf(yyDollar[3].node, stmts, nil, nil) @@ -4386,7 +4389,7 @@ yydefault: } case 209: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:2014 + //line php7/php7.y:2015 { stmts := stmt.NewStmtList(yyDollar[7].list) _elseIf := stmt.NewAltElseIf(yyDollar[4].node, stmts) @@ -4406,7 +4409,7 @@ yydefault: } case 210: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2035 + //line php7/php7.y:2036 { yyVAL.node = yyDollar[1].node @@ -4422,7 +4425,7 @@ yydefault: } case 211: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:2049 + //line php7/php7.y:2050 { stmts := stmt.NewStmtList(yyDollar[4].list) _else := stmt.NewAltElse(stmts) @@ -4444,7 +4447,7 @@ yydefault: } case 212: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2072 + //line php7/php7.y:2073 { yyVAL.list = yyDollar[1].list @@ -4452,7 +4455,7 @@ yydefault: } case 213: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:2078 + //line php7/php7.y:2079 { yyVAL.list = nil @@ -4460,7 +4463,7 @@ yydefault: } case 214: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2087 + //line php7/php7.y:2088 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4468,7 +4471,7 @@ yydefault: } case 215: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2093 + //line php7/php7.y:2094 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4479,7 +4482,7 @@ yydefault: } case 216: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2105 + //line php7/php7.y:2106 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[4].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -4506,12 +4509,13 @@ yydefault: yyDollar[3].token.Meta.SetTokenName(meta.EllipsisToken).AppendTo(yyVAL.node.GetMeta()) } yyDollar[4].token.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 217: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:2135 + //line php7/php7.y:2137 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[4].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -4538,13 +4542,14 @@ yydefault: yyDollar[3].token.Meta.SetTokenName(meta.EllipsisToken).AppendTo(yyVAL.node.GetMeta()) } yyDollar[4].token.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) yyDollar[5].token.Meta.SetTokenName(meta.EqualToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 218: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:2169 + //line php7/php7.y:2172 { yyVAL.node = nil @@ -4552,7 +4557,7 @@ yydefault: } case 219: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2175 + //line php7/php7.y:2178 { yyVAL.node = yyDollar[1].node @@ -4560,7 +4565,7 @@ yydefault: } case 220: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2184 + //line php7/php7.y:2187 { yyVAL.node = yyDollar[1].node @@ -4568,7 +4573,7 @@ yydefault: } case 221: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2190 + //line php7/php7.y:2193 { yyVAL.node = node.NewNullable(yyDollar[2].node) @@ -4582,7 +4587,7 @@ yydefault: } case 222: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2205 + //line php7/php7.y:2208 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4596,7 +4601,7 @@ yydefault: } case 223: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2217 + //line php7/php7.y:2220 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4610,7 +4615,7 @@ yydefault: } case 224: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2229 + //line php7/php7.y:2232 { yyVAL.node = yyDollar[1].node @@ -4618,7 +4623,7 @@ yydefault: } case 225: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:2238 + //line php7/php7.y:2241 { yyVAL.node = nil @@ -4626,7 +4631,7 @@ yydefault: } case 226: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2244 + //line php7/php7.y:2247 { yyVAL.node = yyDollar[2].node @@ -4637,7 +4642,7 @@ yydefault: } case 227: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2256 + //line php7/php7.y:2259 { yyVAL.node = node.NewArgumentList(nil) @@ -4652,7 +4657,7 @@ yydefault: } case 228: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2269 + //line php7/php7.y:2272 { yyVAL.node = node.NewArgumentList(yyDollar[2].list) @@ -4671,7 +4676,7 @@ yydefault: } case 229: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2289 + //line php7/php7.y:2292 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4679,7 +4684,7 @@ yydefault: } case 230: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2295 + //line php7/php7.y:2298 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4690,7 +4695,7 @@ yydefault: } case 231: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2307 + //line php7/php7.y:2310 { yyVAL.node = node.NewArgument(yyDollar[1].node, false, false) @@ -4701,7 +4706,7 @@ yydefault: } case 232: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2316 + //line php7/php7.y:2319 { yyVAL.node = node.NewArgument(yyDollar[2].node, true, false) @@ -4715,7 +4720,7 @@ yydefault: } case 233: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2331 + //line php7/php7.y:2334 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4726,7 +4731,7 @@ yydefault: } case 234: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2340 + //line php7/php7.y:2343 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4734,7 +4739,7 @@ yydefault: } case 235: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2349 + //line php7/php7.y:2352 { yyVAL.node = yyDollar[1].node @@ -4742,7 +4747,7 @@ yydefault: } case 236: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2358 + //line php7/php7.y:2361 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4753,7 +4758,7 @@ yydefault: } case 237: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2367 + //line php7/php7.y:2370 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4761,7 +4766,7 @@ yydefault: } case 238: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2376 + //line php7/php7.y:2379 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -4774,12 +4779,13 @@ yydefault: // save comments yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 239: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2392 + //line php7/php7.y:2396 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -4792,13 +4798,14 @@ yydefault: // save comments yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) yyDollar[2].token.Meta.SetTokenName(meta.EqualToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 240: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2412 + //line php7/php7.y:2417 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -4806,7 +4813,7 @@ yydefault: } case 241: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:2418 + //line php7/php7.y:2423 { yyVAL.list = []node.Node{} @@ -4814,7 +4821,7 @@ yydefault: } case 242: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2427 + //line php7/php7.y:2432 { yyVAL.node = stmt.NewPropertyList(yyDollar[1].list, yyDollar[2].list) @@ -4829,7 +4836,7 @@ yydefault: } case 243: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2440 + //line php7/php7.y:2445 { yyVAL.node = stmt.NewClassConstList(yyDollar[1].list, yyDollar[3].list) @@ -4845,7 +4852,7 @@ yydefault: } case 244: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2454 + //line php7/php7.y:2459 { yyVAL.node = stmt.NewTraitUse(yyDollar[2].list, yyDollar[3].node) @@ -4859,7 +4866,7 @@ yydefault: } case 245: yyDollar = yyS[yypt-10 : yypt+1] - //line php7/php7.y:2466 + //line php7/php7.y:2471 { name := node.NewIdentifier(yyDollar[4].token.Value) yyVAL.node = stmt.NewClassMethod(name, yyDollar[1].list, yyDollar[3].token != nil, yyDollar[7].list, yyDollar[9].node, yyDollar[10].node, yyDollar[5].str) @@ -4885,7 +4892,7 @@ yydefault: } case 246: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2493 + //line php7/php7.y:2498 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4893,7 +4900,7 @@ yydefault: } case 247: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2499 + //line php7/php7.y:2504 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4904,7 +4911,7 @@ yydefault: } case 248: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2511 + //line php7/php7.y:2516 { yyVAL.node = stmt.NewNop() @@ -4918,7 +4925,7 @@ yydefault: } case 249: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2524 + //line php7/php7.y:2529 { yyVAL.node = stmt.NewTraitAdaptationList(nil) @@ -4932,7 +4939,7 @@ yydefault: } case 250: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2536 + //line php7/php7.y:2541 { yyVAL.node = stmt.NewTraitAdaptationList(yyDollar[2].list) @@ -4946,7 +4953,7 @@ yydefault: } case 251: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2551 + //line php7/php7.y:2556 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4954,7 +4961,7 @@ yydefault: } case 252: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2557 + //line php7/php7.y:2562 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -4962,7 +4969,7 @@ yydefault: } case 253: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2566 + //line php7/php7.y:2571 { yyVAL.node = yyDollar[1].node @@ -4974,7 +4981,7 @@ yydefault: } case 254: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2576 + //line php7/php7.y:2581 { yyVAL.node = yyDollar[1].node @@ -4986,7 +4993,7 @@ yydefault: } case 255: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2589 + //line php7/php7.y:2594 { yyVAL.node = stmt.NewTraitUsePrecedence(yyDollar[1].node, yyDollar[3].list) @@ -5000,7 +5007,7 @@ yydefault: } case 256: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2604 + //line php7/php7.y:2609 { alias := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, nil, alias) @@ -5017,7 +5024,7 @@ yydefault: } case 257: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2619 + //line php7/php7.y:2624 { alias := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, nil, alias) @@ -5034,7 +5041,7 @@ yydefault: } case 258: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2634 + //line php7/php7.y:2639 { alias := node.NewIdentifier(yyDollar[4].token.Value) yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, yyDollar[3].node, alias) @@ -5051,7 +5058,7 @@ yydefault: } case 259: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2649 + //line php7/php7.y:2654 { yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, yyDollar[3].node, nil) @@ -5065,7 +5072,7 @@ yydefault: } case 260: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2664 + //line php7/php7.y:2669 { name := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewTraitMethodRef(nil, name) @@ -5081,7 +5088,7 @@ yydefault: } case 261: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2678 + //line php7/php7.y:2683 { yyVAL.node = yyDollar[1].node @@ -5089,7 +5096,7 @@ yydefault: } case 262: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2687 + //line php7/php7.y:2692 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewTraitMethodRef(yyDollar[1].node, target) @@ -5106,7 +5113,7 @@ yydefault: } case 263: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2705 + //line php7/php7.y:2710 { yyVAL.node = stmt.NewNop() @@ -5121,7 +5128,7 @@ yydefault: } case 264: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2718 + //line php7/php7.y:2723 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) @@ -5136,7 +5143,7 @@ yydefault: } case 265: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2734 + //line php7/php7.y:2739 { yyVAL.list = yyDollar[1].list @@ -5144,7 +5151,7 @@ yydefault: } case 266: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2740 + //line php7/php7.y:2745 { modifier := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.list = []node.Node{modifier} @@ -5159,7 +5166,7 @@ yydefault: } case 267: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:2756 + //line php7/php7.y:2761 { yyVAL.list = nil @@ -5167,7 +5174,7 @@ yydefault: } case 268: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2762 + //line php7/php7.y:2767 { yyVAL.list = yyDollar[1].list @@ -5175,7 +5182,7 @@ yydefault: } case 269: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2771 + //line php7/php7.y:2776 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -5183,7 +5190,7 @@ yydefault: } case 270: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2777 + //line php7/php7.y:2782 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -5191,7 +5198,7 @@ yydefault: } case 271: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2786 + //line php7/php7.y:2791 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5205,7 +5212,7 @@ yydefault: } case 272: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2798 + //line php7/php7.y:2803 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5219,7 +5226,7 @@ yydefault: } case 273: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2810 + //line php7/php7.y:2815 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5233,7 +5240,7 @@ yydefault: } case 274: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2822 + //line php7/php7.y:2827 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5247,7 +5254,7 @@ yydefault: } case 275: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2834 + //line php7/php7.y:2839 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5261,7 +5268,7 @@ yydefault: } case 276: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2846 + //line php7/php7.y:2851 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5275,7 +5282,7 @@ yydefault: } case 277: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2861 + //line php7/php7.y:2866 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -5286,7 +5293,7 @@ yydefault: } case 278: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2870 + //line php7/php7.y:2875 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -5294,7 +5301,7 @@ yydefault: } case 279: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2879 + //line php7/php7.y:2884 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -5307,12 +5314,13 @@ yydefault: // save comments yyDollar[1].token.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 280: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2895 + //line php7/php7.y:2901 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -5325,13 +5333,14 @@ yydefault: // save comments yyDollar[1].token.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) yyDollar[2].token.Meta.SetTokenName(meta.EqualToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 281: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2915 + //line php7/php7.y:2922 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -5342,7 +5351,7 @@ yydefault: } case 282: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2924 + //line php7/php7.y:2931 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -5350,7 +5359,7 @@ yydefault: } case 283: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2933 + //line php7/php7.y:2940 { name := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewConstant(name, yyDollar[3].node, yyDollar[4].str) @@ -5367,7 +5376,7 @@ yydefault: } case 284: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2951 + //line php7/php7.y:2958 { name := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewConstant(name, yyDollar[3].node, yyDollar[4].str) @@ -5384,7 +5393,7 @@ yydefault: } case 285: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2969 + //line php7/php7.y:2976 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -5395,7 +5404,7 @@ yydefault: } case 286: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2978 + //line php7/php7.y:2985 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -5403,7 +5412,7 @@ yydefault: } case 287: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2987 + //line php7/php7.y:2994 { yyVAL.node = yyDollar[1].node @@ -5411,7 +5420,7 @@ yydefault: } case 288: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:2996 + //line php7/php7.y:3003 { yyVAL.list = nil @@ -5419,7 +5428,7 @@ yydefault: } case 289: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3002 + //line php7/php7.y:3009 { yyVAL.list = yyDollar[1].list @@ -5427,7 +5436,7 @@ yydefault: } case 290: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3011 + //line php7/php7.y:3018 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -5438,7 +5447,7 @@ yydefault: } case 291: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3020 + //line php7/php7.y:3027 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -5446,7 +5455,7 @@ yydefault: } case 292: yyDollar = yyS[yypt-8 : yypt+1] - //line php7/php7.y:3029 + //line php7/php7.y:3036 { if yyDollar[2].node != nil { yyVAL.node = stmt.NewClass(nil, nil, yyDollar[2].node.(*node.ArgumentList), yyDollar[3].ClassExtends, yyDollar[4].ClassImplements, yyDollar[7].list, yyDollar[5].str) @@ -5466,7 +5475,7 @@ yydefault: } case 293: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3050 + //line php7/php7.y:3057 { if yyDollar[3].node != nil { yyVAL.node = expr.NewNew(yyDollar[2].node, yyDollar[3].node.(*node.ArgumentList)) @@ -5483,7 +5492,7 @@ yydefault: } case 294: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3065 + //line php7/php7.y:3072 { yyVAL.node = expr.NewNew(yyDollar[2].node, nil) @@ -5497,7 +5506,7 @@ yydefault: } case 295: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:3080 + //line php7/php7.y:3087 { list := expr.NewList(yyDollar[3].list) yyVAL.node = assign.NewAssign(list, yyDollar[6].node) @@ -5516,7 +5525,7 @@ yydefault: } case 296: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:3097 + //line php7/php7.y:3104 { shortList := expr.NewShortList(yyDollar[2].list) yyVAL.node = assign.NewAssign(shortList, yyDollar[5].node) @@ -5534,7 +5543,7 @@ yydefault: } case 297: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3113 + //line php7/php7.y:3120 { yyVAL.node = assign.NewAssign(yyDollar[1].node, yyDollar[3].node) @@ -5548,7 +5557,7 @@ yydefault: } case 298: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3125 + //line php7/php7.y:3132 { yyVAL.node = assign.NewReference(yyDollar[1].node, yyDollar[4].node) @@ -5563,7 +5572,7 @@ yydefault: } case 299: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3138 + //line php7/php7.y:3145 { yyVAL.node = expr.NewClone(yyDollar[2].node) @@ -5577,7 +5586,7 @@ yydefault: } case 300: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3150 + //line php7/php7.y:3157 { yyVAL.node = assign.NewPlus(yyDollar[1].node, yyDollar[3].node) @@ -5591,7 +5600,7 @@ yydefault: } case 301: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3162 + //line php7/php7.y:3169 { yyVAL.node = assign.NewMinus(yyDollar[1].node, yyDollar[3].node) @@ -5605,7 +5614,7 @@ yydefault: } case 302: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3174 + //line php7/php7.y:3181 { yyVAL.node = assign.NewMul(yyDollar[1].node, yyDollar[3].node) @@ -5619,7 +5628,7 @@ yydefault: } case 303: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3186 + //line php7/php7.y:3193 { yyVAL.node = assign.NewPow(yyDollar[1].node, yyDollar[3].node) @@ -5633,7 +5642,7 @@ yydefault: } case 304: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3198 + //line php7/php7.y:3205 { yyVAL.node = assign.NewDiv(yyDollar[1].node, yyDollar[3].node) @@ -5647,7 +5656,7 @@ yydefault: } case 305: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3210 + //line php7/php7.y:3217 { yyVAL.node = assign.NewConcat(yyDollar[1].node, yyDollar[3].node) @@ -5661,7 +5670,7 @@ yydefault: } case 306: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3222 + //line php7/php7.y:3229 { yyVAL.node = assign.NewMod(yyDollar[1].node, yyDollar[3].node) @@ -5675,7 +5684,7 @@ yydefault: } case 307: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3234 + //line php7/php7.y:3241 { yyVAL.node = assign.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) @@ -5689,7 +5698,7 @@ yydefault: } case 308: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3246 + //line php7/php7.y:3253 { yyVAL.node = assign.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) @@ -5703,7 +5712,7 @@ yydefault: } case 309: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3258 + //line php7/php7.y:3265 { yyVAL.node = assign.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) @@ -5717,7 +5726,7 @@ yydefault: } case 310: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3270 + //line php7/php7.y:3277 { yyVAL.node = assign.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) @@ -5731,7 +5740,7 @@ yydefault: } case 311: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3282 + //line php7/php7.y:3289 { yyVAL.node = assign.NewShiftRight(yyDollar[1].node, yyDollar[3].node) @@ -5745,7 +5754,7 @@ yydefault: } case 312: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3294 + //line php7/php7.y:3301 { yyVAL.node = expr.NewPostInc(yyDollar[1].node) @@ -5759,7 +5768,7 @@ yydefault: } case 313: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3306 + //line php7/php7.y:3313 { yyVAL.node = expr.NewPreInc(yyDollar[2].node) @@ -5773,7 +5782,7 @@ yydefault: } case 314: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3318 + //line php7/php7.y:3325 { yyVAL.node = expr.NewPostDec(yyDollar[1].node) @@ -5787,7 +5796,7 @@ yydefault: } case 315: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3330 + //line php7/php7.y:3337 { yyVAL.node = expr.NewPreDec(yyDollar[2].node) @@ -5801,7 +5810,7 @@ yydefault: } case 316: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3342 + //line php7/php7.y:3349 { yyVAL.node = binary.NewBooleanOr(yyDollar[1].node, yyDollar[3].node) @@ -5815,7 +5824,7 @@ yydefault: } case 317: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3354 + //line php7/php7.y:3361 { yyVAL.node = binary.NewBooleanAnd(yyDollar[1].node, yyDollar[3].node) @@ -5829,7 +5838,7 @@ yydefault: } case 318: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3366 + //line php7/php7.y:3373 { yyVAL.node = binary.NewLogicalOr(yyDollar[1].node, yyDollar[3].node) @@ -5843,7 +5852,7 @@ yydefault: } case 319: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3378 + //line php7/php7.y:3385 { yyVAL.node = binary.NewLogicalAnd(yyDollar[1].node, yyDollar[3].node) @@ -5857,7 +5866,7 @@ yydefault: } case 320: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3390 + //line php7/php7.y:3397 { yyVAL.node = binary.NewLogicalXor(yyDollar[1].node, yyDollar[3].node) @@ -5871,7 +5880,7 @@ yydefault: } case 321: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3402 + //line php7/php7.y:3409 { yyVAL.node = binary.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) @@ -5885,7 +5894,7 @@ yydefault: } case 322: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3414 + //line php7/php7.y:3421 { yyVAL.node = binary.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) @@ -5899,7 +5908,7 @@ yydefault: } case 323: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3426 + //line php7/php7.y:3433 { yyVAL.node = binary.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) @@ -5913,7 +5922,7 @@ yydefault: } case 324: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3438 + //line php7/php7.y:3445 { yyVAL.node = binary.NewConcat(yyDollar[1].node, yyDollar[3].node) @@ -5927,7 +5936,7 @@ yydefault: } case 325: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3450 + //line php7/php7.y:3457 { yyVAL.node = binary.NewPlus(yyDollar[1].node, yyDollar[3].node) @@ -5941,7 +5950,7 @@ yydefault: } case 326: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3462 + //line php7/php7.y:3469 { yyVAL.node = binary.NewMinus(yyDollar[1].node, yyDollar[3].node) @@ -5955,7 +5964,7 @@ yydefault: } case 327: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3474 + //line php7/php7.y:3481 { yyVAL.node = binary.NewMul(yyDollar[1].node, yyDollar[3].node) @@ -5969,7 +5978,7 @@ yydefault: } case 328: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3486 + //line php7/php7.y:3493 { yyVAL.node = binary.NewPow(yyDollar[1].node, yyDollar[3].node) @@ -5983,7 +5992,7 @@ yydefault: } case 329: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3498 + //line php7/php7.y:3505 { yyVAL.node = binary.NewDiv(yyDollar[1].node, yyDollar[3].node) @@ -5997,7 +6006,7 @@ yydefault: } case 330: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3510 + //line php7/php7.y:3517 { yyVAL.node = binary.NewMod(yyDollar[1].node, yyDollar[3].node) @@ -6011,7 +6020,7 @@ yydefault: } case 331: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3522 + //line php7/php7.y:3529 { yyVAL.node = binary.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) @@ -6025,7 +6034,7 @@ yydefault: } case 332: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3534 + //line php7/php7.y:3541 { yyVAL.node = binary.NewShiftRight(yyDollar[1].node, yyDollar[3].node) @@ -6039,7 +6048,7 @@ yydefault: } case 333: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3546 + //line php7/php7.y:3553 { yyVAL.node = expr.NewUnaryPlus(yyDollar[2].node) @@ -6053,7 +6062,7 @@ yydefault: } case 334: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3558 + //line php7/php7.y:3565 { yyVAL.node = expr.NewUnaryMinus(yyDollar[2].node) @@ -6067,7 +6076,7 @@ yydefault: } case 335: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3570 + //line php7/php7.y:3577 { yyVAL.node = expr.NewBooleanNot(yyDollar[2].node) @@ -6081,7 +6090,7 @@ yydefault: } case 336: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3582 + //line php7/php7.y:3589 { yyVAL.node = expr.NewBitwiseNot(yyDollar[2].node) @@ -6095,7 +6104,7 @@ yydefault: } case 337: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3594 + //line php7/php7.y:3601 { yyVAL.node = binary.NewIdentical(yyDollar[1].node, yyDollar[3].node) @@ -6109,7 +6118,7 @@ yydefault: } case 338: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3606 + //line php7/php7.y:3613 { yyVAL.node = binary.NewNotIdentical(yyDollar[1].node, yyDollar[3].node) @@ -6123,7 +6132,7 @@ yydefault: } case 339: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3618 + //line php7/php7.y:3625 { yyVAL.node = binary.NewEqual(yyDollar[1].node, yyDollar[3].node) @@ -6137,7 +6146,7 @@ yydefault: } case 340: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3630 + //line php7/php7.y:3637 { yyVAL.node = binary.NewNotEqual(yyDollar[1].node, yyDollar[3].node) @@ -6152,7 +6161,7 @@ yydefault: } case 341: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3643 + //line php7/php7.y:3650 { yyVAL.node = binary.NewSmaller(yyDollar[1].node, yyDollar[3].node) @@ -6166,7 +6175,7 @@ yydefault: } case 342: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3655 + //line php7/php7.y:3662 { yyVAL.node = binary.NewSmallerOrEqual(yyDollar[1].node, yyDollar[3].node) @@ -6180,7 +6189,7 @@ yydefault: } case 343: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3667 + //line php7/php7.y:3674 { yyVAL.node = binary.NewGreater(yyDollar[1].node, yyDollar[3].node) @@ -6194,7 +6203,7 @@ yydefault: } case 344: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3679 + //line php7/php7.y:3686 { yyVAL.node = binary.NewGreaterOrEqual(yyDollar[1].node, yyDollar[3].node) @@ -6208,7 +6217,7 @@ yydefault: } case 345: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3691 + //line php7/php7.y:3698 { yyVAL.node = binary.NewSpaceship(yyDollar[1].node, yyDollar[3].node) @@ -6222,7 +6231,7 @@ yydefault: } case 346: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3703 + //line php7/php7.y:3710 { yyVAL.node = expr.NewInstanceOf(yyDollar[1].node, yyDollar[3].node) @@ -6236,7 +6245,7 @@ yydefault: } case 347: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3715 + //line php7/php7.y:3722 { yyVAL.node = yyDollar[2].node @@ -6250,7 +6259,7 @@ yydefault: } case 348: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3727 + //line php7/php7.y:3734 { yyVAL.node = yyDollar[1].node @@ -6258,7 +6267,7 @@ yydefault: } case 349: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:3733 + //line php7/php7.y:3740 { yyVAL.node = expr.NewTernary(yyDollar[1].node, yyDollar[3].node, yyDollar[5].node) @@ -6273,7 +6282,7 @@ yydefault: } case 350: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3746 + //line php7/php7.y:3753 { yyVAL.node = expr.NewTernary(yyDollar[1].node, nil, yyDollar[4].node) @@ -6288,7 +6297,7 @@ yydefault: } case 351: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3759 + //line php7/php7.y:3766 { yyVAL.node = binary.NewCoalesce(yyDollar[1].node, yyDollar[3].node) @@ -6302,7 +6311,7 @@ yydefault: } case 352: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3771 + //line php7/php7.y:3778 { yyVAL.node = yyDollar[1].node @@ -6310,7 +6319,7 @@ yydefault: } case 353: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3777 + //line php7/php7.y:3784 { yyVAL.node = cast.NewInt(yyDollar[2].node) @@ -6325,7 +6334,7 @@ yydefault: } case 354: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3790 + //line php7/php7.y:3797 { yyVAL.node = cast.NewDouble(yyDollar[2].node) @@ -6340,7 +6349,7 @@ yydefault: } case 355: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3803 + //line php7/php7.y:3810 { yyVAL.node = cast.NewString(yyDollar[2].node) @@ -6355,7 +6364,7 @@ yydefault: } case 356: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3816 + //line php7/php7.y:3823 { yyVAL.node = cast.NewArray(yyDollar[2].node) @@ -6370,7 +6379,7 @@ yydefault: } case 357: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3829 + //line php7/php7.y:3836 { yyVAL.node = cast.NewObject(yyDollar[2].node) @@ -6385,7 +6394,7 @@ yydefault: } case 358: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3842 + //line php7/php7.y:3849 { yyVAL.node = cast.NewBool(yyDollar[2].node) @@ -6400,7 +6409,7 @@ yydefault: } case 359: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3855 + //line php7/php7.y:3862 { yyVAL.node = cast.NewUnset(yyDollar[2].node) @@ -6415,7 +6424,7 @@ yydefault: } case 360: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3868 + //line php7/php7.y:3875 { var e *expr.Exit if yyDollar[2].node != nil { @@ -6444,7 +6453,7 @@ yydefault: } case 361: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3895 + //line php7/php7.y:3902 { yyVAL.node = expr.NewErrorSuppress(yyDollar[2].node) @@ -6458,7 +6467,7 @@ yydefault: } case 362: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3907 + //line php7/php7.y:3914 { yyVAL.node = yyDollar[1].node @@ -6466,7 +6475,7 @@ yydefault: } case 363: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3913 + //line php7/php7.y:3920 { yyVAL.node = expr.NewShellExec(yyDollar[2].list) @@ -6481,7 +6490,7 @@ yydefault: } case 364: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3926 + //line php7/php7.y:3933 { yyVAL.node = expr.NewPrint(yyDollar[2].node) @@ -6495,7 +6504,7 @@ yydefault: } case 365: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3938 + //line php7/php7.y:3945 { yyVAL.node = expr.NewYield(nil, nil) @@ -6509,7 +6518,7 @@ yydefault: } case 366: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3950 + //line php7/php7.y:3957 { yyVAL.node = expr.NewYield(nil, yyDollar[2].node) @@ -6523,7 +6532,7 @@ yydefault: } case 367: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3962 + //line php7/php7.y:3969 { yyVAL.node = expr.NewYield(yyDollar[2].node, yyDollar[4].node) @@ -6538,7 +6547,7 @@ yydefault: } case 368: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3975 + //line php7/php7.y:3982 { yyVAL.node = expr.NewYieldFrom(yyDollar[2].node) @@ -6552,7 +6561,7 @@ yydefault: } case 369: yyDollar = yyS[yypt-11 : yypt+1] - //line php7/php7.y:3987 + //line php7/php7.y:3994 { yyVAL.node = expr.NewClosure(yyDollar[5].list, yyDollar[7].ClosureUse, yyDollar[8].node, yyDollar[10].list, false, yyDollar[2].token != nil, yyDollar[3].str) @@ -6573,7 +6582,7 @@ yydefault: } case 370: yyDollar = yyS[yypt-12 : yypt+1] - //line php7/php7.y:4006 + //line php7/php7.y:4013 { yyVAL.node = expr.NewClosure(yyDollar[6].list, yyDollar[8].ClosureUse, yyDollar[9].node, yyDollar[11].list, true, yyDollar[3].token != nil, yyDollar[4].str) @@ -6595,7 +6604,7 @@ yydefault: } case 371: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4029 + //line php7/php7.y:4036 { yyVAL.str = yylex.(*Parser).PhpDocComment yylex.(*Parser).PhpDocComment = "" @@ -6604,19 +6613,19 @@ yydefault: } case 372: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4039 + //line php7/php7.y:4046 { yyVAL.token = nil } case 373: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4043 + //line php7/php7.y:4050 { yyVAL.token = yyDollar[1].token } case 374: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4050 + //line php7/php7.y:4057 { yyVAL.ClosureUse = nil @@ -6624,7 +6633,7 @@ yydefault: } case 375: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4056 + //line php7/php7.y:4063 { yyVAL.ClosureUse = expr.NewClosureUse(yyDollar[3].list) @@ -6640,7 +6649,7 @@ yydefault: } case 376: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4073 + //line php7/php7.y:4080 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -6651,7 +6660,7 @@ yydefault: } case 377: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4082 + //line php7/php7.y:4089 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -6659,7 +6668,7 @@ yydefault: } case 378: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4091 + //line php7/php7.y:4098 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(identifier) @@ -6670,12 +6679,13 @@ yydefault: // save comments yyDollar[1].token.Meta.SetTokenName(meta.VariableToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMeta(yyVAL.node, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 379: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4105 + //line php7/php7.y:4113 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[2].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -6689,12 +6699,13 @@ yydefault: // save comments yyDollar[1].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 380: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4125 + //line php7/php7.y:4134 { yyVAL.node = expr.NewFunctionCall(yyDollar[1].node, yyDollar[2].node.(*node.ArgumentList)) @@ -6705,7 +6716,7 @@ yydefault: } case 381: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4134 + //line php7/php7.y:4143 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -6719,7 +6730,7 @@ yydefault: } case 382: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4146 + //line php7/php7.y:4155 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -6733,7 +6744,7 @@ yydefault: } case 383: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4158 + //line php7/php7.y:4167 { yyVAL.node = expr.NewFunctionCall(yyDollar[1].node, yyDollar[2].node.(*node.ArgumentList)) @@ -6744,7 +6755,7 @@ yydefault: } case 384: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4170 + //line php7/php7.y:4179 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -6758,7 +6769,7 @@ yydefault: } case 385: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4182 + //line php7/php7.y:4191 { yyVAL.node = yyDollar[1].node @@ -6766,7 +6777,7 @@ yydefault: } case 386: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4191 + //line php7/php7.y:4200 { yyVAL.node = yyDollar[1].node @@ -6774,7 +6785,7 @@ yydefault: } case 387: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4197 + //line php7/php7.y:4206 { yyVAL.node = yyDollar[1].node @@ -6782,7 +6793,7 @@ yydefault: } case 388: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4206 + //line php7/php7.y:4215 { yyVAL.node = nil @@ -6790,7 +6801,7 @@ yydefault: } case 389: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4212 + //line php7/php7.y:4221 { yyVAL.node = expr.NewExit(yyDollar[2].node) @@ -6807,7 +6818,7 @@ yydefault: } case 390: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4230 + //line php7/php7.y:4239 { yyVAL.list = []node.Node{} @@ -6815,7 +6826,7 @@ yydefault: } case 391: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4236 + //line php7/php7.y:4245 { yyVAL.list = []node.Node{scalar.NewEncapsedStringPart(yyDollar[1].token.Value)} @@ -6823,7 +6834,7 @@ yydefault: } case 392: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4242 + //line php7/php7.y:4251 { yyVAL.list = yyDollar[1].list @@ -6831,7 +6842,7 @@ yydefault: } case 393: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4251 + //line php7/php7.y:4260 { yyVAL.node = nil @@ -6839,7 +6850,7 @@ yydefault: } case 394: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4257 + //line php7/php7.y:4266 { yyVAL.node = yyDollar[1].node @@ -6847,7 +6858,7 @@ yydefault: } case 395: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4266 + //line php7/php7.y:4275 { yyVAL.node = expr.NewArray(yyDollar[3].list) @@ -6863,7 +6874,7 @@ yydefault: } case 396: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4280 + //line php7/php7.y:4289 { yyVAL.node = expr.NewShortArray(yyDollar[2].list) @@ -6878,7 +6889,7 @@ yydefault: } case 397: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4293 + //line php7/php7.y:4302 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) @@ -6892,7 +6903,7 @@ yydefault: } case 398: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4308 + //line php7/php7.y:4317 { yyVAL.node = scalar.NewLnumber(yyDollar[1].token.Value) @@ -6906,7 +6917,7 @@ yydefault: } case 399: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4320 + //line php7/php7.y:4329 { yyVAL.node = scalar.NewDnumber(yyDollar[1].token.Value) @@ -6920,7 +6931,7 @@ yydefault: } case 400: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4332 + //line php7/php7.y:4341 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6934,7 +6945,7 @@ yydefault: } case 401: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4344 + //line php7/php7.y:4353 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6948,7 +6959,7 @@ yydefault: } case 402: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4356 + //line php7/php7.y:4365 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6962,7 +6973,7 @@ yydefault: } case 403: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4368 + //line php7/php7.y:4377 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6976,7 +6987,7 @@ yydefault: } case 404: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4380 + //line php7/php7.y:4389 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6990,7 +7001,7 @@ yydefault: } case 405: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4392 + //line php7/php7.y:4401 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7004,7 +7015,7 @@ yydefault: } case 406: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4404 + //line php7/php7.y:4413 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7018,7 +7029,7 @@ yydefault: } case 407: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4416 + //line php7/php7.y:4425 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7032,7 +7043,7 @@ yydefault: } case 408: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4428 + //line php7/php7.y:4437 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, []node.Node{encapsed}) @@ -7048,7 +7059,7 @@ yydefault: } case 409: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4442 + //line php7/php7.y:4451 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, nil) @@ -7062,7 +7073,7 @@ yydefault: } case 410: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4454 + //line php7/php7.y:4463 { yyVAL.node = scalar.NewEncapsed(yyDollar[2].list) @@ -7076,7 +7087,7 @@ yydefault: } case 411: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4466 + //line php7/php7.y:4475 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, yyDollar[2].list) @@ -7090,7 +7101,7 @@ yydefault: } case 412: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4478 + //line php7/php7.y:4487 { yyVAL.node = yyDollar[1].node @@ -7098,7 +7109,7 @@ yydefault: } case 413: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4484 + //line php7/php7.y:4493 { yyVAL.node = yyDollar[1].node @@ -7106,7 +7117,7 @@ yydefault: } case 414: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4493 + //line php7/php7.y:4502 { yyVAL.node = expr.NewConstFetch(yyDollar[1].node) @@ -7117,7 +7128,7 @@ yydefault: } case 415: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4502 + //line php7/php7.y:4511 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -7134,7 +7145,7 @@ yydefault: } case 416: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4517 + //line php7/php7.y:4526 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -7151,7 +7162,7 @@ yydefault: } case 417: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4535 + //line php7/php7.y:4544 { yyVAL.node = yyDollar[1].node @@ -7159,7 +7170,7 @@ yydefault: } case 418: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4541 + //line php7/php7.y:4550 { yyVAL.node = yyDollar[1].node @@ -7167,7 +7178,7 @@ yydefault: } case 419: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4550 + //line php7/php7.y:4559 { yyVAL.node = nil @@ -7175,7 +7186,7 @@ yydefault: } case 420: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4556 + //line php7/php7.y:4565 { yyVAL.node = yyDollar[1].node @@ -7183,7 +7194,7 @@ yydefault: } case 421: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4565 + //line php7/php7.y:4574 { yyVAL.node = yyDollar[1].node @@ -7191,7 +7202,7 @@ yydefault: } case 422: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4574 + //line php7/php7.y:4583 { yyVAL.node = yyDollar[1].node @@ -7199,7 +7210,7 @@ yydefault: } case 423: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4580 + //line php7/php7.y:4589 { yyVAL.node = yyDollar[2].node @@ -7213,7 +7224,7 @@ yydefault: } case 424: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4592 + //line php7/php7.y:4601 { yyVAL.node = yyDollar[1].node @@ -7221,7 +7232,7 @@ yydefault: } case 425: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4601 + //line php7/php7.y:4610 { yyVAL.node = yyDollar[1].node @@ -7229,7 +7240,7 @@ yydefault: } case 426: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4607 + //line php7/php7.y:4616 { yyVAL.node = yyDollar[2].node @@ -7243,7 +7254,7 @@ yydefault: } case 427: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4619 + //line php7/php7.y:4628 { yyVAL.node = yyDollar[1].node @@ -7251,7 +7262,7 @@ yydefault: } case 428: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4628 + //line php7/php7.y:4637 { yyVAL.node = yyDollar[1].node @@ -7259,7 +7270,7 @@ yydefault: } case 429: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4634 + //line php7/php7.y:4643 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -7276,7 +7287,7 @@ yydefault: } case 430: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4649 + //line php7/php7.y:4658 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -7293,7 +7304,7 @@ yydefault: } case 431: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4664 + //line php7/php7.y:4673 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -7310,7 +7321,7 @@ yydefault: } case 432: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4679 + //line php7/php7.y:4688 { yyVAL.node = expr.NewMethodCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -7324,7 +7335,7 @@ yydefault: } case 433: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4691 + //line php7/php7.y:4700 { yyVAL.node = yyDollar[1].node @@ -7332,7 +7343,7 @@ yydefault: } case 434: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4700 + //line php7/php7.y:4709 { yyVAL.node = yyDollar[1].node @@ -7340,7 +7351,7 @@ yydefault: } case 435: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4706 + //line php7/php7.y:4715 { yyVAL.node = yyDollar[1].node @@ -7348,7 +7359,7 @@ yydefault: } case 436: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4712 + //line php7/php7.y:4721 { yyVAL.node = expr.NewPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -7362,7 +7373,7 @@ yydefault: } case 437: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4727 + //line php7/php7.y:4736 { name := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(name) @@ -7373,12 +7384,13 @@ yydefault: // save comments yyDollar[1].token.Meta.SetTokenName(meta.VariableToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMeta(yyVAL.node, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 438: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4741 + //line php7/php7.y:4751 { yyVAL.node = expr.NewVariable(yyDollar[3].node) @@ -7387,6 +7399,7 @@ yydefault: // save comments yyDollar[1].token.Meta.SetTokenName(meta.DollarToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.DollarToken) yyDollar[2].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.OpenCurlyBracesToken) yyDollar[4].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) @@ -7396,7 +7409,7 @@ yydefault: } case 439: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4757 + //line php7/php7.y:4768 { yyVAL.node = expr.NewVariable(yyDollar[2].node) @@ -7405,24 +7418,11 @@ yydefault: // save comments yyDollar[1].token.Meta.SetTokenName(meta.DollarToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.DollarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 440: - yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4772 - { - yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) - - // save position - yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - - // save comments - yyDollar[2].token.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo(yyVAL.node.GetMeta()) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - case 441: yyDollar = yyS[yypt-3 : yypt+1] //line php7/php7.y:4784 { @@ -7434,11 +7434,25 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + case 441: + yyDollar = yyS[yypt-3 : yypt+1] + //line php7/php7.y:4796 + { + yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) + + // save position + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + + // save comments + yyDollar[2].token.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 442: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4799 + //line php7/php7.y:4811 { yyVAL.node = yyDollar[1].node @@ -7446,7 +7460,7 @@ yydefault: } case 443: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4805 + //line php7/php7.y:4817 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -7463,7 +7477,7 @@ yydefault: } case 444: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4820 + //line php7/php7.y:4832 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -7480,7 +7494,7 @@ yydefault: } case 445: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4835 + //line php7/php7.y:4847 { yyVAL.node = expr.NewPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -7494,7 +7508,7 @@ yydefault: } case 446: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4847 + //line php7/php7.y:4859 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -7508,7 +7522,7 @@ yydefault: } case 447: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4859 + //line php7/php7.y:4871 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -7522,7 +7536,7 @@ yydefault: } case 448: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4874 + //line php7/php7.y:4886 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -7536,7 +7550,7 @@ yydefault: } case 449: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4886 + //line php7/php7.y:4898 { yyVAL.node = yyDollar[2].node @@ -7550,7 +7564,7 @@ yydefault: } case 450: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4898 + //line php7/php7.y:4910 { yyVAL.node = yyDollar[1].node @@ -7558,7 +7572,7 @@ yydefault: } case 451: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4907 + //line php7/php7.y:4919 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -7572,7 +7586,7 @@ yydefault: } case 452: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4919 + //line php7/php7.y:4931 { yyVAL.node = yyDollar[2].node @@ -7586,7 +7600,7 @@ yydefault: } case 453: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4931 + //line php7/php7.y:4943 { yyVAL.node = yyDollar[1].node @@ -7594,7 +7608,7 @@ yydefault: } case 454: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4940 + //line php7/php7.y:4952 { yyVAL.list = yyDollar[1].list @@ -7602,7 +7616,7 @@ yydefault: } case 455: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4949 + //line php7/php7.y:4961 { yyVAL.node = expr.NewArrayItem(nil, nil) @@ -7610,7 +7624,7 @@ yydefault: } case 456: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4955 + //line php7/php7.y:4967 { yyVAL.node = yyDollar[1].node @@ -7618,7 +7632,7 @@ yydefault: } case 457: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4964 + //line php7/php7.y:4976 { if len(yyDollar[1].list) == 0 { yyDollar[1].list = []node.Node{expr.NewArrayItem(nil, nil)} @@ -7633,7 +7647,7 @@ yydefault: } case 458: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4977 + //line php7/php7.y:4989 { if yyDollar[1].node.(*expr.ArrayItem).Key == nil && yyDollar[1].node.(*expr.ArrayItem).Val == nil { yyVAL.list = []node.Node{} @@ -7645,7 +7659,7 @@ yydefault: } case 459: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4990 + //line php7/php7.y:5002 { yyVAL.node = expr.NewArrayItem(yyDollar[1].node, yyDollar[3].node) @@ -7659,7 +7673,7 @@ yydefault: } case 460: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5002 + //line php7/php7.y:5014 { yyVAL.node = expr.NewArrayItem(nil, yyDollar[1].node) @@ -7670,7 +7684,7 @@ yydefault: } case 461: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:5011 + //line php7/php7.y:5023 { reference := expr.NewReference(yyDollar[4].node) yyVAL.node = expr.NewArrayItem(yyDollar[1].node, reference) @@ -7687,7 +7701,7 @@ yydefault: } case 462: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5026 + //line php7/php7.y:5038 { reference := expr.NewReference(yyDollar[2].node) yyVAL.node = expr.NewArrayItem(nil, reference) @@ -7703,7 +7717,7 @@ yydefault: } case 463: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:5040 + //line php7/php7.y:5052 { // TODO: Cannot use list() as standalone expression list := expr.NewList(yyDollar[5].list) @@ -7723,7 +7737,7 @@ yydefault: } case 464: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:5058 + //line php7/php7.y:5070 { // TODO: Cannot use list() as standalone expression list := expr.NewList(yyDollar[3].list) @@ -7742,7 +7756,7 @@ yydefault: } case 465: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5078 + //line php7/php7.y:5090 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -7750,7 +7764,7 @@ yydefault: } case 466: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5084 + //line php7/php7.y:5096 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yyVAL.list = append(yyDollar[1].list, encapsed) @@ -7765,7 +7779,7 @@ yydefault: } case 467: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5097 + //line php7/php7.y:5109 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -7773,7 +7787,7 @@ yydefault: } case 468: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5103 + //line php7/php7.y:5115 { encapsed := scalar.NewEncapsedStringPart(yyDollar[1].token.Value) yyVAL.list = []node.Node{encapsed, yyDollar[2].node} @@ -7788,7 +7802,7 @@ yydefault: } case 469: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5119 + //line php7/php7.y:5131 { name := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(name) @@ -7799,12 +7813,13 @@ yydefault: // save comments yyDollar[1].token.Meta.SetTokenName(meta.VariableToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMeta(yyVAL.node, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 470: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:5133 + //line php7/php7.y:5146 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -7817,6 +7832,7 @@ yydefault: // save comments yyDollar[1].token.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) yyDollar[2].token.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.OpenCurlyBracesToken) yyDollar[4].token.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(yyVAL.node.GetMeta()) @@ -7826,7 +7842,7 @@ yydefault: } case 471: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5153 + //line php7/php7.y:5167 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -7841,6 +7857,7 @@ yydefault: // save comments yyDollar[1].token.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) yyDollar[2].token.Meta.SetTokenName(meta.ObjectOperatorToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(fetch.GetMeta()) @@ -7848,10 +7865,9 @@ yydefault: } case 472: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5173 + //line php7/php7.y:5188 { variable := expr.NewVariable(yyDollar[2].node) - variable.StringVar = true yyVAL.node = variable @@ -7868,11 +7884,10 @@ yydefault: } case 473: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5191 + //line php7/php7.y:5205 { name := node.NewIdentifier(yyDollar[2].token.Value) variable := expr.NewVariable(name) - variable.StringVar = true yyVAL.node = variable @@ -7891,11 +7906,10 @@ yydefault: } case 474: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:5212 + //line php7/php7.y:5225 { identifier := node.NewIdentifier(yyDollar[2].token.Value) variable := expr.NewVariable(identifier) - variable.StringVar = true yyVAL.node = expr.NewArrayDimFetch(variable, yyDollar[4].node) // save position @@ -7918,7 +7932,7 @@ yydefault: } case 475: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5237 + //line php7/php7.y:5249 { yyVAL.node = yyDollar[2].node @@ -7932,7 +7946,7 @@ yydefault: } case 476: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5252 + //line php7/php7.y:5264 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) @@ -7946,7 +7960,7 @@ yydefault: } case 477: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5264 + //line php7/php7.y:5276 { // TODO: add option to handle 64 bit integer if _, err := strconv.Atoi(yyDollar[1].token.Value); err == nil { @@ -7965,7 +7979,7 @@ yydefault: } case 478: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5281 + //line php7/php7.y:5293 { var lnumber *scalar.Lnumber // TODO: add option to handle 64 bit integer @@ -7998,7 +8012,7 @@ yydefault: } case 479: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5312 + //line php7/php7.y:5324 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(identifier) @@ -8009,12 +8023,13 @@ yydefault: // save comments yyDollar[1].token.Meta.SetTokenName(meta.VariableToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMeta(yyVAL.node, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 480: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:5329 + //line php7/php7.y:5342 { yyVAL.node = expr.NewIsset(yyDollar[3].list) @@ -8034,7 +8049,7 @@ yydefault: } case 481: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:5347 + //line php7/php7.y:5360 { yyVAL.node = expr.NewEmpty(yyDollar[3].node) @@ -8050,7 +8065,7 @@ yydefault: } case 482: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5361 + //line php7/php7.y:5374 { yyVAL.node = expr.NewInclude(yyDollar[2].node) @@ -8064,7 +8079,7 @@ yydefault: } case 483: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5373 + //line php7/php7.y:5386 { yyVAL.node = expr.NewIncludeOnce(yyDollar[2].node) @@ -8078,7 +8093,7 @@ yydefault: } case 484: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:5385 + //line php7/php7.y:5398 { yyVAL.node = expr.NewEval(yyDollar[3].node) @@ -8094,7 +8109,7 @@ yydefault: } case 485: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5399 + //line php7/php7.y:5412 { yyVAL.node = expr.NewRequire(yyDollar[2].node) @@ -8108,7 +8123,7 @@ yydefault: } case 486: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5411 + //line php7/php7.y:5424 { yyVAL.node = expr.NewRequireOnce(yyDollar[2].node) @@ -8122,7 +8137,7 @@ yydefault: } case 487: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5426 + //line php7/php7.y:5439 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -8130,7 +8145,7 @@ yydefault: } case 488: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5432 + //line php7/php7.y:5445 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -8141,7 +8156,7 @@ yydefault: } case 489: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5444 + //line php7/php7.y:5457 { yyVAL.node = yyDollar[1].node diff --git a/php7/php7.y b/php7/php7.y index 1be9c53..3c8dd08 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -1345,6 +1345,7 @@ catch_list: $2.Meta.SetTokenName(meta.CatchToken).AppendTo(catch.GetMeta()) $3.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(catch.GetMeta()) $5.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) $6.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(catch.GetMeta()) $7.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(catch.GetMeta()) $9.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(catch.GetMeta()) @@ -2128,6 +2129,7 @@ parameter: $3.Meta.SetTokenName(meta.EllipsisToken).AppendTo($$.GetMeta()) } $4.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2158,6 +2160,7 @@ parameter: $3.Meta.SetTokenName(meta.EllipsisToken).AppendTo($$.GetMeta()) } $4.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) $5.Meta.SetTokenName(meta.EqualToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -2385,6 +2388,7 @@ static_var: // save comments $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2401,6 +2405,7 @@ static_var: // save comments $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) $2.Meta.SetTokenName(meta.EqualToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -2888,6 +2893,7 @@ property: // save comments $1.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2904,6 +2910,7 @@ property: // save comments $1.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) $2.Meta.SetTokenName(meta.EqualToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -4098,6 +4105,7 @@ lexical_var: // save comments $1.Meta.SetTokenName(meta.VariableToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMeta($$, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4115,6 +4123,7 @@ lexical_var: // save comments $1.Meta.SetTokenName(meta.AmpersandToken).AppendTo($$.GetMeta()) $2.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4734,6 +4743,7 @@ simple_variable: // save comments $1.Meta.SetTokenName(meta.VariableToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMeta($$, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4746,6 +4756,7 @@ simple_variable: // save comments $1.Meta.SetTokenName(meta.DollarToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $1, meta.DollarToken) $2.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $2, meta.OpenCurlyBracesToken) $4.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) @@ -4762,6 +4773,7 @@ simple_variable: // save comments $1.Meta.SetTokenName(meta.DollarToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $1, meta.DollarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5126,6 +5138,7 @@ encaps_var: // save comments $1.Meta.SetTokenName(meta.VariableToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMeta($$, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5142,6 +5155,7 @@ encaps_var: // save comments $1.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) $2.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $2, meta.OpenCurlyBracesToken) $4.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo($$.GetMeta()) @@ -5164,6 +5178,7 @@ encaps_var: // save comments $1.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) $2.Meta.SetTokenName(meta.ObjectOperatorToken).AppendTo($$.GetMeta()) $3.Meta.SetTokenName(meta.IdentifierToken).AppendTo(fetch.GetMeta()) @@ -5172,7 +5187,6 @@ encaps_var: | T_DOLLAR_OPEN_CURLY_BRACES expr '}' { variable := expr.NewVariable($2) - variable.StringVar = true $$ = variable @@ -5191,7 +5205,6 @@ encaps_var: { name := node.NewIdentifier($2.Value) variable := expr.NewVariable(name) - variable.StringVar = true $$ = variable @@ -5212,7 +5225,6 @@ encaps_var: { identifier := node.NewIdentifier($2.Value) variable := expr.NewVariable(identifier) - variable.StringVar = true $$ = expr.NewArrayDimFetch(variable, $4) // save position @@ -5319,6 +5331,7 @@ encaps_var_offset: // save comments $1.Meta.SetTokenName(meta.VariableToken).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMeta($$, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php7/php7_test.go b/php7/php7_test.go index 3ebc9c3..1b6592b 100644 --- a/php7/php7_test.go +++ b/php7/php7_test.go @@ -449,7 +449,6 @@ func TestPhp7(t *testing.T) { StartPos: 10, EndPos: 11, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 2, @@ -477,7 +476,6 @@ func TestPhp7(t *testing.T) { StartPos: 17, EndPos: 18, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 2, @@ -514,7 +512,6 @@ func TestPhp7(t *testing.T) { StartPos: 24, EndPos: 27, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 3, @@ -549,7 +546,6 @@ func TestPhp7(t *testing.T) { StartPos: 29, EndPos: 30, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 3, @@ -577,7 +573,6 @@ func TestPhp7(t *testing.T) { StartPos: 36, EndPos: 37, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 3, @@ -614,7 +609,6 @@ func TestPhp7(t *testing.T) { StartPos: 43, EndPos: 46, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 4, @@ -658,7 +652,6 @@ func TestPhp7(t *testing.T) { StartPos: 53, EndPos: 54, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 4, @@ -686,7 +679,6 @@ func TestPhp7(t *testing.T) { StartPos: 60, EndPos: 61, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 4, @@ -768,7 +760,6 @@ func TestPhp7(t *testing.T) { StartPos: 76, EndPos: 77, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 5, @@ -796,7 +787,6 @@ func TestPhp7(t *testing.T) { StartPos: 83, EndPos: 84, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 5, @@ -833,7 +823,6 @@ func TestPhp7(t *testing.T) { StartPos: 90, EndPos: 93, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 6, @@ -877,7 +866,6 @@ func TestPhp7(t *testing.T) { StartPos: 100, EndPos: 101, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 6, @@ -905,7 +893,6 @@ func TestPhp7(t *testing.T) { StartPos: 107, EndPos: 108, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 6, @@ -978,7 +965,6 @@ func TestPhp7(t *testing.T) { StartPos: 122, EndPos: 123, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 7, @@ -1006,7 +992,6 @@ func TestPhp7(t *testing.T) { StartPos: 129, EndPos: 130, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 7, @@ -1068,7 +1053,6 @@ func TestPhp7(t *testing.T) { StartPos: 172, EndPos: 173, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 9, @@ -1096,7 +1080,6 @@ func TestPhp7(t *testing.T) { StartPos: 179, EndPos: 180, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 9, @@ -1161,7 +1144,6 @@ func TestPhp7(t *testing.T) { StartPos: 209, EndPos: 212, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 11, @@ -1202,7 +1184,6 @@ func TestPhp7(t *testing.T) { StartPos: 221, EndPos: 224, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 12, @@ -1253,7 +1234,6 @@ func TestPhp7(t *testing.T) { StartPos: 236, EndPos: 239, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 13, @@ -1271,7 +1251,6 @@ func TestPhp7(t *testing.T) { StartPos: 241, EndPos: 244, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 13, @@ -1313,7 +1292,6 @@ func TestPhp7(t *testing.T) { StartPos: 254, EndPos: 257, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 14, @@ -1364,7 +1342,6 @@ func TestPhp7(t *testing.T) { StartPos: 271, EndPos: 274, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 15, @@ -1382,7 +1359,6 @@ func TestPhp7(t *testing.T) { StartPos: 277, EndPos: 280, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 15, @@ -1433,7 +1409,6 @@ func TestPhp7(t *testing.T) { StartPos: 297, EndPos: 300, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 16, @@ -1509,7 +1484,6 @@ func TestPhp7(t *testing.T) { StartPos: 324, EndPos: 327, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 18, @@ -1583,7 +1557,6 @@ func TestPhp7(t *testing.T) { StartPos: 343, EndPos: 346, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 18, @@ -1689,7 +1662,6 @@ func TestPhp7(t *testing.T) { StartPos: 390, EndPos: 393, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 19, @@ -1763,7 +1735,6 @@ func TestPhp7(t *testing.T) { StartPos: 409, EndPos: 412, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 19, @@ -1849,7 +1820,6 @@ func TestPhp7(t *testing.T) { StartPos: 435, EndPos: 438, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 20, @@ -1923,7 +1893,6 @@ func TestPhp7(t *testing.T) { StartPos: 454, EndPos: 457, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 20, @@ -2000,7 +1969,6 @@ func TestPhp7(t *testing.T) { StartPos: 487, EndPos: 490, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 21, @@ -2074,7 +2042,6 @@ func TestPhp7(t *testing.T) { StartPos: 506, EndPos: 509, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 21, @@ -2376,7 +2343,6 @@ func TestPhp7(t *testing.T) { StartPos: 873, EndPos: 876, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 39, @@ -2428,7 +2394,6 @@ func TestPhp7(t *testing.T) { StartPos: 888, EndPos: 891, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 40, @@ -2490,7 +2455,6 @@ func TestPhp7(t *testing.T) { StartPos: 906, EndPos: 909, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 41, @@ -2560,7 +2524,6 @@ func TestPhp7(t *testing.T) { StartPos: 925, EndPos: 928, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 42, @@ -2622,7 +2585,6 @@ func TestPhp7(t *testing.T) { StartPos: 982, EndPos: 985, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 43, @@ -2684,7 +2646,6 @@ func TestPhp7(t *testing.T) { StartPos: 1040, EndPos: 1043, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 44, @@ -2746,7 +2707,6 @@ func TestPhp7(t *testing.T) { StartPos: 1060, EndPos: 1063, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 45, @@ -2764,7 +2724,6 @@ func TestPhp7(t *testing.T) { StartPos: 1065, EndPos: 1068, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 45, @@ -2801,7 +2760,6 @@ func TestPhp7(t *testing.T) { StartPos: 1076, EndPos: 1079, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 46, @@ -2828,7 +2786,6 @@ func TestPhp7(t *testing.T) { StartPos: 1081, EndPos: 1084, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 46, @@ -2880,7 +2837,6 @@ func TestPhp7(t *testing.T) { StartPos: 1096, EndPos: 1099, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 47, @@ -2944,7 +2900,6 @@ func TestPhp7(t *testing.T) { StartPos: 1118, EndPos: 1123, }, - StringVar: true, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 48, @@ -2996,7 +2951,6 @@ func TestPhp7(t *testing.T) { StartPos: 1137, EndPos: 1139, }, - StringVar: true, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 49, @@ -3051,7 +3005,6 @@ func TestPhp7(t *testing.T) { StartPos: 1155, EndPos: 1161, }, - StringVar: true, VarName: &expr.Variable{ Position: &position.Position{ StartLine: 50, @@ -3059,7 +3012,6 @@ func TestPhp7(t *testing.T) { StartPos: 1157, EndPos: 1160, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 50, @@ -3112,7 +3064,6 @@ func TestPhp7(t *testing.T) { StartPos: 1174, EndPos: 1177, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 51, @@ -3158,7 +3109,6 @@ func TestPhp7(t *testing.T) { StartPos: 1196, EndPos: 1197, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 53, @@ -3193,7 +3143,6 @@ func TestPhp7(t *testing.T) { StartPos: 1217, EndPos: 1218, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 55, @@ -3228,7 +3177,6 @@ func TestPhp7(t *testing.T) { StartPos: 1233, EndPos: 1234, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 56, @@ -3265,7 +3213,6 @@ func TestPhp7(t *testing.T) { StartPos: 1253, EndPos: 1254, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 58, @@ -3317,7 +3264,6 @@ func TestPhp7(t *testing.T) { StartPos: 1282, EndPos: 1283, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 61, @@ -3352,7 +3298,6 @@ func TestPhp7(t *testing.T) { StartPos: 1298, EndPos: 1299, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 62, @@ -3387,7 +3332,6 @@ func TestPhp7(t *testing.T) { StartPos: 1313, EndPos: 1314, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 63, @@ -4631,7 +4575,6 @@ func TestPhp7(t *testing.T) { StartPos: 2035, EndPos: 2036, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 89, @@ -4668,7 +4611,6 @@ func TestPhp7(t *testing.T) { StartPos: 2049, EndPos: 2050, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 90, @@ -4703,7 +4645,6 @@ func TestPhp7(t *testing.T) { StartPos: 2060, EndPos: 2061, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 91, @@ -4740,7 +4681,6 @@ func TestPhp7(t *testing.T) { StartPos: 2068, EndPos: 2069, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 91, @@ -4777,7 +4717,6 @@ func TestPhp7(t *testing.T) { StartPos: 2077, EndPos: 2078, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 91, @@ -4803,7 +4742,6 @@ func TestPhp7(t *testing.T) { StartPos: 2083, EndPos: 2084, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 91, @@ -4848,7 +4786,6 @@ func TestPhp7(t *testing.T) { StartPos: 2100, EndPos: 2101, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 92, @@ -4885,7 +4822,6 @@ func TestPhp7(t *testing.T) { StartPos: 2109, EndPos: 2110, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 92, @@ -4911,7 +4847,6 @@ func TestPhp7(t *testing.T) { StartPos: 2115, EndPos: 2116, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 92, @@ -4948,7 +4883,6 @@ func TestPhp7(t *testing.T) { StartPos: 2142, EndPos: 2143, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 93, @@ -4966,7 +4900,6 @@ func TestPhp7(t *testing.T) { StartPos: 2148, EndPos: 2149, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 93, @@ -5001,7 +4934,6 @@ func TestPhp7(t *testing.T) { StartPos: 2166, EndPos: 2167, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 94, @@ -5019,7 +4951,6 @@ func TestPhp7(t *testing.T) { StartPos: 2172, EndPos: 2173, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 94, @@ -5054,7 +4985,6 @@ func TestPhp7(t *testing.T) { StartPos: 2201, EndPos: 2202, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 95, @@ -5072,7 +5002,6 @@ func TestPhp7(t *testing.T) { StartPos: 2207, EndPos: 2208, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 95, @@ -5090,7 +5019,6 @@ func TestPhp7(t *testing.T) { StartPos: 2213, EndPos: 2214, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 95, @@ -5125,7 +5053,6 @@ func TestPhp7(t *testing.T) { StartPos: 2231, EndPos: 2232, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 96, @@ -5143,7 +5070,6 @@ func TestPhp7(t *testing.T) { StartPos: 2237, EndPos: 2238, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 96, @@ -5168,7 +5094,6 @@ func TestPhp7(t *testing.T) { StartPos: 2244, EndPos: 2245, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 96, @@ -5204,7 +5129,6 @@ func TestPhp7(t *testing.T) { StartPos: 2262, EndPos: 2263, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 97, @@ -5222,7 +5146,6 @@ func TestPhp7(t *testing.T) { StartPos: 2268, EndPos: 2269, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 97, @@ -5255,7 +5178,6 @@ func TestPhp7(t *testing.T) { StartPos: 2279, EndPos: 2280, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 97, @@ -5293,7 +5215,6 @@ func TestPhp7(t *testing.T) { StartPos: 2298, EndPos: 2299, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 98, @@ -5311,7 +5232,6 @@ func TestPhp7(t *testing.T) { StartPos: 2304, EndPos: 2305, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 98, @@ -5344,7 +5264,6 @@ func TestPhp7(t *testing.T) { StartPos: 2311, EndPos: 2312, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 98, @@ -5509,7 +5428,6 @@ func TestPhp7(t *testing.T) { StartPos: 2432, EndPos: 2433, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 103, @@ -5527,7 +5445,6 @@ func TestPhp7(t *testing.T) { StartPos: 2436, EndPos: 2437, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 103, @@ -5588,7 +5505,6 @@ func TestPhp7(t *testing.T) { StartPos: 2462, EndPos: 2463, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 106, @@ -5623,7 +5539,6 @@ func TestPhp7(t *testing.T) { StartPos: 2475, EndPos: 2476, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 107, @@ -5658,7 +5573,6 @@ func TestPhp7(t *testing.T) { StartPos: 2490, EndPos: 2491, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 107, @@ -5695,7 +5609,6 @@ func TestPhp7(t *testing.T) { StartPos: 2503, EndPos: 2504, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 108, @@ -5747,7 +5660,6 @@ func TestPhp7(t *testing.T) { StartPos: 2524, EndPos: 2525, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 109, @@ -5782,7 +5694,6 @@ func TestPhp7(t *testing.T) { StartPos: 2539, EndPos: 2540, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 109, @@ -5817,7 +5728,6 @@ func TestPhp7(t *testing.T) { StartPos: 2554, EndPos: 2555, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 109, @@ -5871,7 +5781,6 @@ func TestPhp7(t *testing.T) { StartPos: 2575, EndPos: 2576, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 110, @@ -5906,7 +5815,6 @@ func TestPhp7(t *testing.T) { StartPos: 2590, EndPos: 2591, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 110, @@ -5949,7 +5857,6 @@ func TestPhp7(t *testing.T) { StartPos: 2606, EndPos: 2607, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 110, @@ -6256,7 +6163,6 @@ func TestPhp7(t *testing.T) { StartPos: 2795, EndPos: 2796, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 118, @@ -6333,7 +6239,6 @@ func TestPhp7(t *testing.T) { StartPos: 2827, EndPos: 2828, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 119, @@ -6360,7 +6265,6 @@ func TestPhp7(t *testing.T) { StartPos: 2831, EndPos: 2832, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 119, @@ -6407,7 +6311,6 @@ func TestPhp7(t *testing.T) { StartPos: 2849, EndPos: 2850, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 120, @@ -6433,7 +6336,6 @@ func TestPhp7(t *testing.T) { StartPos: 2853, EndPos: 2854, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 120, @@ -6767,7 +6669,6 @@ func TestPhp7(t *testing.T) { StartPos: 3102, EndPos: 3103, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 143, @@ -7545,7 +7446,6 @@ func TestPhp7(t *testing.T) { StartPos: 3444, EndPos: 3445, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 154, @@ -7623,7 +7523,6 @@ func TestPhp7(t *testing.T) { StartPos: 3494, EndPos: 3495, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 155, @@ -7682,7 +7581,6 @@ func TestPhp7(t *testing.T) { StartPos: 3527, EndPos: 3528, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 156, @@ -7730,7 +7628,6 @@ func TestPhp7(t *testing.T) { StartPos: 3558, EndPos: 3559, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 156, @@ -7789,7 +7686,6 @@ func TestPhp7(t *testing.T) { StartPos: 3591, EndPos: 3592, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 157, @@ -7828,7 +7724,6 @@ func TestPhp7(t *testing.T) { StartPos: 3618, EndPos: 3619, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 159, @@ -7846,7 +7741,6 @@ func TestPhp7(t *testing.T) { StartPos: 3622, EndPos: 3623, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 159, @@ -8925,7 +8819,6 @@ func TestPhp7(t *testing.T) { StartPos: 3990, EndPos: 3991, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 177, @@ -8975,7 +8868,6 @@ func TestPhp7(t *testing.T) { StartPos: 3999, EndPos: 4000, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 178, @@ -9121,7 +9013,6 @@ func TestPhp7(t *testing.T) { StartPos: 4047, EndPos: 4048, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 181, @@ -9159,7 +9050,6 @@ func TestPhp7(t *testing.T) { StartPos: 4056, EndPos: 4057, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 182, @@ -9193,7 +9083,6 @@ func TestPhp7(t *testing.T) { StartPos: 4063, EndPos: 4064, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 183, @@ -9271,7 +9160,6 @@ func TestPhp7(t *testing.T) { StartPos: 4082, EndPos: 4085, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 186, @@ -9314,7 +9202,6 @@ func TestPhp7(t *testing.T) { StartPos: 4101, EndPos: 4102, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 187, @@ -9348,7 +9235,6 @@ func TestPhp7(t *testing.T) { StartPos: 4114, EndPos: 4115, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 188, @@ -9415,7 +9301,6 @@ func TestPhp7(t *testing.T) { StartPos: 4145, EndPos: 4146, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 190, @@ -9443,7 +9328,6 @@ func TestPhp7(t *testing.T) { StartPos: 4149, EndPos: 4150, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 190, @@ -9471,7 +9355,6 @@ func TestPhp7(t *testing.T) { StartPos: 4158, EndPos: 4159, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 190, @@ -9496,7 +9379,6 @@ func TestPhp7(t *testing.T) { StartPos: 4163, EndPos: 4164, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 190, @@ -9678,7 +9560,6 @@ func TestPhp7(t *testing.T) { StartPos: 4235, EndPos: 4236, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 196, @@ -9712,7 +9593,6 @@ func TestPhp7(t *testing.T) { StartPos: 4243, EndPos: 4244, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 197, @@ -9746,7 +9626,6 @@ func TestPhp7(t *testing.T) { StartPos: 4254, EndPos: 4255, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 198, @@ -9798,7 +9677,6 @@ func TestPhp7(t *testing.T) { StartPos: 4274, EndPos: 4275, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 200, @@ -9850,7 +9728,6 @@ func TestPhp7(t *testing.T) { StartPos: 4292, EndPos: 4293, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 202, @@ -10013,7 +9890,6 @@ func TestPhp7(t *testing.T) { StartPos: 4337, EndPos: 4340, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 206, @@ -10055,7 +9931,6 @@ func TestPhp7(t *testing.T) { StartPos: 4348, EndPos: 4349, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 208, @@ -10089,7 +9964,6 @@ func TestPhp7(t *testing.T) { StartPos: 4356, EndPos: 4357, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 209, @@ -10123,7 +9997,6 @@ func TestPhp7(t *testing.T) { StartPos: 4366, EndPos: 4367, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 210, @@ -10157,7 +10030,6 @@ func TestPhp7(t *testing.T) { StartPos: 4374, EndPos: 4375, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 211, @@ -10191,7 +10063,6 @@ func TestPhp7(t *testing.T) { StartPos: 4389, EndPos: 4390, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 213, @@ -10225,7 +10096,6 @@ func TestPhp7(t *testing.T) { StartPos: 4408, EndPos: 4409, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 214, @@ -10259,7 +10129,6 @@ func TestPhp7(t *testing.T) { StartPos: 4422, EndPos: 4423, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 215, @@ -10293,7 +10162,6 @@ func TestPhp7(t *testing.T) { StartPos: 4441, EndPos: 4442, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 216, @@ -10327,7 +10195,6 @@ func TestPhp7(t *testing.T) { StartPos: 4448, EndPos: 4449, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 218, @@ -10380,7 +10247,6 @@ func TestPhp7(t *testing.T) { StartPos: 4469, EndPos: 4470, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 219, @@ -10433,7 +10299,6 @@ func TestPhp7(t *testing.T) { StartPos: 4500, EndPos: 4501, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 220, @@ -10487,7 +10352,6 @@ func TestPhp7(t *testing.T) { StartPos: 4529, EndPos: 4530, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 222, @@ -10505,7 +10369,6 @@ func TestPhp7(t *testing.T) { StartPos: 4533, EndPos: 4534, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 222, @@ -10555,7 +10418,6 @@ func TestPhp7(t *testing.T) { StartPos: 4545, EndPos: 4546, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 223, @@ -10576,7 +10438,6 @@ func TestPhp7(t *testing.T) { StartPos: 4551, EndPos: 4552, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 223, @@ -10632,7 +10493,6 @@ func TestPhp7(t *testing.T) { StartPos: 4562, EndPos: 4563, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 224, @@ -10654,7 +10514,6 @@ func TestPhp7(t *testing.T) { StartPos: 4570, EndPos: 4571, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 224, @@ -10718,7 +10577,6 @@ func TestPhp7(t *testing.T) { StartPos: 4586, EndPos: 4587, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 225, @@ -10742,7 +10600,6 @@ func TestPhp7(t *testing.T) { StartPos: 4593, EndPos: 4594, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 225, @@ -10776,7 +10633,6 @@ func TestPhp7(t *testing.T) { StartPos: 4600, EndPos: 4601, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 227, @@ -10981,7 +10837,6 @@ func TestPhp7(t *testing.T) { StartPos: 4674, EndPos: 4675, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 231, @@ -11009,7 +10864,6 @@ func TestPhp7(t *testing.T) { StartPos: 4681, EndPos: 4682, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 231, @@ -11048,7 +10902,6 @@ func TestPhp7(t *testing.T) { StartPos: 4697, EndPos: 4698, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 232, @@ -11082,7 +10935,6 @@ func TestPhp7(t *testing.T) { StartPos: 4704, EndPos: 4705, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 233, @@ -11135,7 +10987,6 @@ func TestPhp7(t *testing.T) { StartPos: 4720, EndPos: 4721, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 234, @@ -11301,7 +11152,6 @@ func TestPhp7(t *testing.T) { StartPos: 4763, EndPos: 4764, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 239, @@ -11354,7 +11204,6 @@ func TestPhp7(t *testing.T) { StartPos: 4773, EndPos: 4774, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 241, @@ -11375,7 +11224,6 @@ func TestPhp7(t *testing.T) { StartPos: 4779, EndPos: 4780, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 241, @@ -11431,7 +11279,6 @@ func TestPhp7(t *testing.T) { StartPos: 4786, EndPos: 4787, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 242, @@ -11453,7 +11300,6 @@ func TestPhp7(t *testing.T) { StartPos: 4794, EndPos: 4795, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 242, @@ -11517,7 +11363,6 @@ func TestPhp7(t *testing.T) { StartPos: 4806, EndPos: 4807, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 243, @@ -11541,7 +11386,6 @@ func TestPhp7(t *testing.T) { StartPos: 4813, EndPos: 4814, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 243, @@ -11750,7 +11594,6 @@ func TestPhp7(t *testing.T) { StartPos: 4877, EndPos: 4880, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 247, @@ -11784,7 +11627,6 @@ func TestPhp7(t *testing.T) { StartPos: 4885, EndPos: 4888, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 248, @@ -11802,7 +11644,6 @@ func TestPhp7(t *testing.T) { StartPos: 4891, EndPos: 4894, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 248, @@ -11855,7 +11696,6 @@ func TestPhp7(t *testing.T) { StartPos: 4914, EndPos: 4917, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 249, @@ -11908,7 +11748,6 @@ func TestPhp7(t *testing.T) { StartPos: 4928, EndPos: 4931, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 250, @@ -11942,7 +11781,6 @@ func TestPhp7(t *testing.T) { StartPos: 4936, EndPos: 4937, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 251, @@ -11960,7 +11798,6 @@ func TestPhp7(t *testing.T) { StartPos: 4941, EndPos: 4942, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 251, @@ -11978,7 +11815,6 @@ func TestPhp7(t *testing.T) { StartPos: 4946, EndPos: 4947, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 251, @@ -12012,7 +11848,6 @@ func TestPhp7(t *testing.T) { StartPos: 4952, EndPos: 4953, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 252, @@ -12030,7 +11865,6 @@ func TestPhp7(t *testing.T) { StartPos: 4959, EndPos: 4960, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 252, @@ -12064,7 +11898,6 @@ func TestPhp7(t *testing.T) { StartPos: 4965, EndPos: 4966, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 253, @@ -12089,7 +11922,6 @@ func TestPhp7(t *testing.T) { StartPos: 4970, EndPos: 4971, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 253, @@ -12107,7 +11939,6 @@ func TestPhp7(t *testing.T) { StartPos: 4975, EndPos: 4976, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 253, @@ -12125,7 +11956,6 @@ func TestPhp7(t *testing.T) { StartPos: 4980, EndPos: 4981, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 253, @@ -12144,7 +11974,6 @@ func TestPhp7(t *testing.T) { StartPos: 4985, EndPos: 4986, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 253, @@ -12185,7 +12014,6 @@ func TestPhp7(t *testing.T) { StartPos: 4991, EndPos: 4992, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 254, @@ -12203,7 +12031,6 @@ func TestPhp7(t *testing.T) { StartPos: 4996, EndPos: 4997, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 254, @@ -12221,7 +12048,6 @@ func TestPhp7(t *testing.T) { StartPos: 5001, EndPos: 5002, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 254, @@ -12240,7 +12066,6 @@ func TestPhp7(t *testing.T) { StartPos: 5006, EndPos: 5007, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 254, @@ -12258,7 +12083,6 @@ func TestPhp7(t *testing.T) { StartPos: 5011, EndPos: 5012, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 254, @@ -12292,7 +12116,6 @@ func TestPhp7(t *testing.T) { StartPos: 5018, EndPos: 5019, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 255, @@ -12326,7 +12149,6 @@ func TestPhp7(t *testing.T) { StartPos: 5025, EndPos: 5026, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 256, @@ -12353,7 +12175,6 @@ func TestPhp7(t *testing.T) { StartPos: 5031, EndPos: 5033, }, - StringVar: false, VarName: &expr.Variable{ Position: &position.Position{ StartLine: 257, @@ -12361,7 +12182,6 @@ func TestPhp7(t *testing.T) { StartPos: 5032, EndPos: 5033, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 257, @@ -12411,7 +12231,6 @@ func TestPhp7(t *testing.T) { StartPos: 5053, EndPos: 5054, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 259, @@ -12445,7 +12264,6 @@ func TestPhp7(t *testing.T) { StartPos: 5065, EndPos: 5066, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 260, @@ -12463,7 +12281,6 @@ func TestPhp7(t *testing.T) { StartPos: 5071, EndPos: 5072, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 260, @@ -12497,7 +12314,6 @@ func TestPhp7(t *testing.T) { StartPos: 5088, EndPos: 5089, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 261, @@ -12531,7 +12347,6 @@ func TestPhp7(t *testing.T) { StartPos: 5104, EndPos: 5105, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 263, @@ -12565,7 +12380,6 @@ func TestPhp7(t *testing.T) { StartPos: 5119, EndPos: 5120, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 264, @@ -12599,7 +12413,6 @@ func TestPhp7(t *testing.T) { StartPos: 5131, EndPos: 5132, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 265, @@ -12633,7 +12446,6 @@ func TestPhp7(t *testing.T) { StartPos: 5145, EndPos: 5146, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 266, @@ -12667,7 +12479,6 @@ func TestPhp7(t *testing.T) { StartPos: 5158, EndPos: 5159, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 267, @@ -12701,7 +12512,6 @@ func TestPhp7(t *testing.T) { StartPos: 5173, EndPos: 5174, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 268, @@ -12735,7 +12545,6 @@ func TestPhp7(t *testing.T) { StartPos: 5184, EndPos: 5185, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 269, @@ -12769,7 +12578,6 @@ func TestPhp7(t *testing.T) { StartPos: 5198, EndPos: 5199, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 270, @@ -12803,7 +12611,6 @@ func TestPhp7(t *testing.T) { StartPos: 5212, EndPos: 5213, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 271, @@ -12837,7 +12644,6 @@ func TestPhp7(t *testing.T) { StartPos: 5225, EndPos: 5226, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 272, @@ -12871,7 +12677,6 @@ func TestPhp7(t *testing.T) { StartPos: 5232, EndPos: 5233, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 274, @@ -12889,7 +12694,6 @@ func TestPhp7(t *testing.T) { StartPos: 5237, EndPos: 5238, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 274, @@ -12923,7 +12727,6 @@ func TestPhp7(t *testing.T) { StartPos: 5243, EndPos: 5244, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 275, @@ -12941,7 +12744,6 @@ func TestPhp7(t *testing.T) { StartPos: 5248, EndPos: 5249, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 275, @@ -12975,7 +12777,6 @@ func TestPhp7(t *testing.T) { StartPos: 5254, EndPos: 5255, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 276, @@ -12993,7 +12794,6 @@ func TestPhp7(t *testing.T) { StartPos: 5259, EndPos: 5260, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 276, @@ -13027,7 +12827,6 @@ func TestPhp7(t *testing.T) { StartPos: 5265, EndPos: 5266, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 277, @@ -13045,7 +12844,6 @@ func TestPhp7(t *testing.T) { StartPos: 5271, EndPos: 5272, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 277, @@ -13079,7 +12877,6 @@ func TestPhp7(t *testing.T) { StartPos: 5277, EndPos: 5278, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 278, @@ -13097,7 +12894,6 @@ func TestPhp7(t *testing.T) { StartPos: 5283, EndPos: 5284, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 278, @@ -13131,7 +12927,6 @@ func TestPhp7(t *testing.T) { StartPos: 5289, EndPos: 5290, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 279, @@ -13149,7 +12944,6 @@ func TestPhp7(t *testing.T) { StartPos: 5295, EndPos: 5296, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 279, @@ -13183,7 +12977,6 @@ func TestPhp7(t *testing.T) { StartPos: 5301, EndPos: 5302, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 280, @@ -13201,7 +12994,6 @@ func TestPhp7(t *testing.T) { StartPos: 5306, EndPos: 5307, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 280, @@ -13235,7 +13027,6 @@ func TestPhp7(t *testing.T) { StartPos: 5312, EndPos: 5313, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 281, @@ -13253,7 +13044,6 @@ func TestPhp7(t *testing.T) { StartPos: 5317, EndPos: 5318, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 281, @@ -13287,7 +13077,6 @@ func TestPhp7(t *testing.T) { StartPos: 5323, EndPos: 5324, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 282, @@ -13305,7 +13094,6 @@ func TestPhp7(t *testing.T) { StartPos: 5329, EndPos: 5330, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 282, @@ -13339,7 +13127,6 @@ func TestPhp7(t *testing.T) { StartPos: 5335, EndPos: 5336, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 283, @@ -13357,7 +13144,6 @@ func TestPhp7(t *testing.T) { StartPos: 5341, EndPos: 5342, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 283, @@ -13391,7 +13177,6 @@ func TestPhp7(t *testing.T) { StartPos: 5347, EndPos: 5348, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 284, @@ -13409,7 +13194,6 @@ func TestPhp7(t *testing.T) { StartPos: 5352, EndPos: 5353, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 284, @@ -13443,7 +13227,6 @@ func TestPhp7(t *testing.T) { StartPos: 5358, EndPos: 5359, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 285, @@ -13461,7 +13244,6 @@ func TestPhp7(t *testing.T) { StartPos: 5365, EndPos: 5366, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 285, @@ -13495,7 +13277,6 @@ func TestPhp7(t *testing.T) { StartPos: 5371, EndPos: 5372, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 286, @@ -13513,7 +13294,6 @@ func TestPhp7(t *testing.T) { StartPos: 5378, EndPos: 5379, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 286, @@ -13547,7 +13327,6 @@ func TestPhp7(t *testing.T) { StartPos: 5384, EndPos: 5385, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 287, @@ -13565,7 +13344,6 @@ func TestPhp7(t *testing.T) { StartPos: 5390, EndPos: 5391, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 287, @@ -13599,7 +13377,6 @@ func TestPhp7(t *testing.T) { StartPos: 5396, EndPos: 5397, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 288, @@ -13617,7 +13394,6 @@ func TestPhp7(t *testing.T) { StartPos: 5403, EndPos: 5404, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 288, @@ -13651,7 +13427,6 @@ func TestPhp7(t *testing.T) { StartPos: 5409, EndPos: 5410, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 289, @@ -13669,7 +13444,6 @@ func TestPhp7(t *testing.T) { StartPos: 5414, EndPos: 5415, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 289, @@ -13703,7 +13477,6 @@ func TestPhp7(t *testing.T) { StartPos: 5420, EndPos: 5421, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 290, @@ -13721,7 +13494,6 @@ func TestPhp7(t *testing.T) { StartPos: 5425, EndPos: 5426, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 290, @@ -13755,7 +13527,6 @@ func TestPhp7(t *testing.T) { StartPos: 5431, EndPos: 5432, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 291, @@ -13773,7 +13544,6 @@ func TestPhp7(t *testing.T) { StartPos: 5436, EndPos: 5437, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 291, @@ -13807,7 +13577,6 @@ func TestPhp7(t *testing.T) { StartPos: 5442, EndPos: 5443, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 292, @@ -13825,7 +13594,6 @@ func TestPhp7(t *testing.T) { StartPos: 5448, EndPos: 5449, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 292, @@ -13859,7 +13627,6 @@ func TestPhp7(t *testing.T) { StartPos: 5454, EndPos: 5455, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 293, @@ -13877,7 +13644,6 @@ func TestPhp7(t *testing.T) { StartPos: 5461, EndPos: 5462, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 293, @@ -13911,7 +13677,6 @@ func TestPhp7(t *testing.T) { StartPos: 5467, EndPos: 5468, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 294, @@ -13929,7 +13694,6 @@ func TestPhp7(t *testing.T) { StartPos: 5472, EndPos: 5473, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 294, @@ -13963,7 +13727,6 @@ func TestPhp7(t *testing.T) { StartPos: 5478, EndPos: 5479, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 295, @@ -13981,7 +13744,6 @@ func TestPhp7(t *testing.T) { StartPos: 5484, EndPos: 5485, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 295, @@ -14015,7 +13777,6 @@ func TestPhp7(t *testing.T) { StartPos: 5490, EndPos: 5491, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 296, @@ -14033,7 +13794,6 @@ func TestPhp7(t *testing.T) { StartPos: 5496, EndPos: 5497, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 296, @@ -14067,7 +13827,6 @@ func TestPhp7(t *testing.T) { StartPos: 5502, EndPos: 5503, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 297, @@ -14085,7 +13844,6 @@ func TestPhp7(t *testing.T) { StartPos: 5508, EndPos: 5509, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 297, @@ -14119,7 +13877,6 @@ func TestPhp7(t *testing.T) { StartPos: 5514, EndPos: 5515, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 298, @@ -14137,7 +13894,6 @@ func TestPhp7(t *testing.T) { StartPos: 5520, EndPos: 5521, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 298, @@ -14171,7 +13927,6 @@ func TestPhp7(t *testing.T) { StartPos: 5526, EndPos: 5527, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 299, @@ -14189,7 +13944,6 @@ func TestPhp7(t *testing.T) { StartPos: 5531, EndPos: 5532, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 299, @@ -14223,7 +13977,6 @@ func TestPhp7(t *testing.T) { StartPos: 5537, EndPos: 5538, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 300, @@ -14241,7 +13994,6 @@ func TestPhp7(t *testing.T) { StartPos: 5544, EndPos: 5545, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 300, @@ -14275,7 +14027,6 @@ func TestPhp7(t *testing.T) { StartPos: 5551, EndPos: 5552, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 302, @@ -14293,7 +14044,6 @@ func TestPhp7(t *testing.T) { StartPos: 5557, EndPos: 5558, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 302, @@ -14327,7 +14077,6 @@ func TestPhp7(t *testing.T) { StartPos: 5563, EndPos: 5564, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 303, @@ -14345,7 +14094,6 @@ func TestPhp7(t *testing.T) { StartPos: 5568, EndPos: 5569, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 303, @@ -14379,7 +14127,6 @@ func TestPhp7(t *testing.T) { StartPos: 5574, EndPos: 5575, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 304, @@ -14397,7 +14144,6 @@ func TestPhp7(t *testing.T) { StartPos: 5580, EndPos: 5581, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 304, @@ -14431,7 +14177,6 @@ func TestPhp7(t *testing.T) { StartPos: 5586, EndPos: 5587, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 305, @@ -14449,7 +14194,6 @@ func TestPhp7(t *testing.T) { StartPos: 5592, EndPos: 5593, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 305, @@ -14483,7 +14227,6 @@ func TestPhp7(t *testing.T) { StartPos: 5598, EndPos: 5599, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 306, @@ -14501,7 +14244,6 @@ func TestPhp7(t *testing.T) { StartPos: 5604, EndPos: 5605, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 306, @@ -14535,7 +14277,6 @@ func TestPhp7(t *testing.T) { StartPos: 5610, EndPos: 5611, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 307, @@ -14553,7 +14294,6 @@ func TestPhp7(t *testing.T) { StartPos: 5616, EndPos: 5617, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 307, @@ -14587,7 +14327,6 @@ func TestPhp7(t *testing.T) { StartPos: 5622, EndPos: 5623, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 308, @@ -14605,7 +14344,6 @@ func TestPhp7(t *testing.T) { StartPos: 5628, EndPos: 5629, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 308, @@ -14639,7 +14377,6 @@ func TestPhp7(t *testing.T) { StartPos: 5634, EndPos: 5635, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 309, @@ -14657,7 +14394,6 @@ func TestPhp7(t *testing.T) { StartPos: 5640, EndPos: 5641, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 309, @@ -14691,7 +14427,6 @@ func TestPhp7(t *testing.T) { StartPos: 5646, EndPos: 5647, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 310, @@ -14709,7 +14444,6 @@ func TestPhp7(t *testing.T) { StartPos: 5652, EndPos: 5653, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 310, @@ -14743,7 +14477,6 @@ func TestPhp7(t *testing.T) { StartPos: 5658, EndPos: 5659, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 311, @@ -14761,7 +14494,6 @@ func TestPhp7(t *testing.T) { StartPos: 5664, EndPos: 5665, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 311, @@ -14795,7 +14527,6 @@ func TestPhp7(t *testing.T) { StartPos: 5670, EndPos: 5671, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 312, @@ -14813,7 +14544,6 @@ func TestPhp7(t *testing.T) { StartPos: 5676, EndPos: 5677, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 312, @@ -14847,7 +14577,6 @@ func TestPhp7(t *testing.T) { StartPos: 5682, EndPos: 5683, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 313, @@ -14865,7 +14594,6 @@ func TestPhp7(t *testing.T) { StartPos: 5689, EndPos: 5690, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 313, @@ -14899,7 +14627,6 @@ func TestPhp7(t *testing.T) { StartPos: 5695, EndPos: 5696, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 314, @@ -14917,7 +14644,6 @@ func TestPhp7(t *testing.T) { StartPos: 5702, EndPos: 5703, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 314, @@ -14951,7 +14677,6 @@ func TestPhp7(t *testing.T) { StartPos: 5708, EndPos: 5709, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 315, @@ -14969,7 +14694,6 @@ func TestPhp7(t *testing.T) { StartPos: 5715, EndPos: 5716, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 315, @@ -15128,7 +14852,6 @@ func TestPhp7(t *testing.T) { StartPos: 5793, EndPos: 5794, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 320, @@ -15156,7 +14879,6 @@ func TestPhp7(t *testing.T) { StartPos: 5800, EndPos: 5801, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 320, @@ -15292,7 +15014,6 @@ func TestPhp7(t *testing.T) { StartPos: 5926, EndPos: 5927, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 328, @@ -15329,7 +15050,6 @@ func TestPhp7(t *testing.T) { StartPos: 5937, EndPos: 5938, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 328, @@ -15366,7 +15086,6 @@ func TestPhp7(t *testing.T) { StartPos: 5945, EndPos: 5946, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 328, @@ -15434,7 +15153,6 @@ func TestPhp7(t *testing.T) { StartPos: 5977, EndPos: 5978, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 329, @@ -15471,7 +15189,6 @@ func TestPhp7(t *testing.T) { StartPos: 5990, EndPos: 5991, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 329, @@ -15776,7 +15493,6 @@ func TestPhp7(t *testing.T) { StartPos: 6139, EndPos: 6142, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 334, @@ -15966,7 +15682,6 @@ func TestPhp7(t *testing.T) { StartPos: 6180, EndPos: 6183, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 337, @@ -16002,7 +15717,6 @@ func TestPhp7(t *testing.T) { StartPos: 6191, EndPos: 6198, }, - StringVar: false, VarName: &expr.FunctionCall{ Position: &position.Position{ StartLine: 338, @@ -16080,7 +15794,6 @@ func TestPhp7(t *testing.T) { StartPos: 6209, EndPos: 6212, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 340, @@ -16148,7 +15861,6 @@ func TestPhp7(t *testing.T) { StartPos: 6225, EndPos: 6228, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 341, @@ -16200,7 +15912,6 @@ func TestPhp7(t *testing.T) { StartPos: 6242, EndPos: 6245, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 343, @@ -16218,7 +15929,6 @@ func TestPhp7(t *testing.T) { StartPos: 6248, EndPos: 6251, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 343, @@ -16252,7 +15962,6 @@ func TestPhp7(t *testing.T) { StartPos: 6256, EndPos: 6259, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 344, @@ -16277,7 +15986,6 @@ func TestPhp7(t *testing.T) { StartPos: 6263, EndPos: 6266, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 344, @@ -16345,7 +16053,6 @@ func TestPhp7(t *testing.T) { StartPos: 6281, EndPos: 6282, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 346, @@ -16396,7 +16103,6 @@ func TestPhp7(t *testing.T) { StartPos: 6293, EndPos: 6294, }, - StringVar: false, VarName: &node.Identifier{ Position: &position.Position{ StartLine: 346, diff --git a/printer/printer.go b/printer/printer.go index 9fe4ec9..648a4b5 100644 --- a/printer/printer.go +++ b/printer/printer.go @@ -1791,10 +1791,6 @@ func (p *Printer) printExprVariable(n node.Node) { p.printMeta(nn, meta.DollarOpenCurlyBracesToken) p.printMeta(nn, meta.DollarToken) - if !nn.StringVar { - io.WriteString(p.w, "$") - } - p.printMeta(nn, meta.OpenCurlyBracesToken) p.Print(nn.VarName) p.printMeta(nn, meta.DollarCloseCurlyBracesToken) diff --git a/printer/printer_test.go b/printer/printer_test.go index 6c55f34..5a2ae67 100644 --- a/printer/printer_test.go +++ b/printer/printer_test.go @@ -92,6 +92,13 @@ func TestPrinterPrintFileInlineHtml(t *testing.T) { }, }, Expr: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, VarName: &node.Identifier{ Value: "a", }, @@ -171,7 +178,16 @@ func TestPrinterPrintParameter(t *testing.T) { }, }, }, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + Variable: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "var"}, + }, DefaultValue: &scalar.String{ Meta: meta.Collection{ &meta.Data{ @@ -240,6 +256,11 @@ func TestPrinterPrintNullable(t *testing.T) { Value: " ", TokenName: meta.VariableToken, }, + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, }, VarName: &node.Identifier{ Value: "var", @@ -287,6 +308,11 @@ func TestPrinterPrintArgument(t *testing.T) { Value: " ", TokenName: meta.VariableToken, }, + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, }, VarName: &node.Identifier{ Value: "var", @@ -322,6 +348,11 @@ func TestPrinterPrintArgumentByRef(t *testing.T) { Value: " ", TokenName: meta.VariableToken, }, + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, }, VarName: &node.Identifier{ Value: "var", @@ -594,7 +625,16 @@ func TestPrinterPrintScalarEncapsed(t *testing.T) { }, Parts: []node.Node{ &scalar.EncapsedStringPart{Value: "hello "}, - &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "var"}, + }, &scalar.EncapsedStringPart{Value: " world"}, }, }) @@ -619,7 +659,16 @@ func TestPrinterPrintScalarHeredoc(t *testing.T) { Label: "LBL", Parts: []node.Node{ &scalar.EncapsedStringPart{Value: "hello "}, - &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "var"}, + }, &scalar.EncapsedStringPart{Value: " world"}, }, }) @@ -696,7 +745,16 @@ func TestPrinterPrintAssign(t *testing.T) { TokenName: meta.EqualToken, }, }, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Variable: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }, Expression: &expr.Variable{ Meta: meta.Collection{ &meta.Data{ @@ -704,6 +762,11 @@ func TestPrinterPrintAssign(t *testing.T) { Value: " ", TokenName: meta.VariableToken, }, + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, }, VarName: &node.Identifier{Value: "b"}, }, @@ -734,7 +797,16 @@ func TestPrinterPrintReference(t *testing.T) { TokenName: meta.AmpersandToken, }, }, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Variable: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }, Expression: &expr.Variable{ Meta: meta.Collection{ &meta.Data{ @@ -742,6 +814,11 @@ func TestPrinterPrintReference(t *testing.T) { Value: " ", TokenName: meta.VariableToken, }, + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, }, VarName: &node.Identifier{Value: "b"}, }, @@ -767,7 +844,16 @@ func TestPrinterPrintAssignBitwiseAnd(t *testing.T) { TokenName: meta.AndEqualToken, }, }, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Variable: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }, Expression: &expr.Variable{ Meta: meta.Collection{ &meta.Data{ @@ -775,6 +861,11 @@ func TestPrinterPrintAssignBitwiseAnd(t *testing.T) { Value: " ", TokenName: meta.VariableToken, }, + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, }, VarName: &node.Identifier{Value: "b"}, }, @@ -800,8 +891,26 @@ func TestPrinterPrintAssignBitwiseOr(t *testing.T) { TokenName: meta.OrEqualToken, }, }, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expression: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Variable: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }, + Expression: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "b"}, + }, }) expected := `$a |=$b` @@ -824,8 +933,26 @@ func TestPrinterPrintAssignBitwiseXor(t *testing.T) { TokenName: meta.XorEqualToken, }, }, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expression: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Variable: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }, + Expression: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "b"}, + }, }) expected := `$a ^=$b` @@ -848,8 +975,26 @@ func TestPrinterPrintAssignConcat(t *testing.T) { TokenName: meta.ConcatEqualToken, }, }, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expression: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Variable: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }, + Expression: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "b"}, + }, }) expected := `$a .=$b` @@ -872,8 +1017,26 @@ func TestPrinterPrintAssignDiv(t *testing.T) { TokenName: meta.DivEqualToken, }, }, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expression: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Variable: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }, + Expression: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "b"}, + }, }) expected := `$a /=$b` @@ -896,8 +1059,26 @@ func TestPrinterPrintAssignMinus(t *testing.T) { TokenName: meta.MinusEqualToken, }, }, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expression: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Variable: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }, + Expression: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "b"}, + }, }) expected := `$a -=$b` @@ -920,8 +1101,26 @@ func TestPrinterPrintAssignMod(t *testing.T) { TokenName: meta.ModEqualToken, }, }, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expression: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Variable: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }, + Expression: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "b"}, + }, }) expected := `$a %=$b` @@ -944,8 +1143,26 @@ func TestPrinterPrintAssignMul(t *testing.T) { TokenName: meta.MulEqualToken, }, }, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expression: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Variable: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }, + Expression: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "b"}, + }, }) expected := `$a *=$b` @@ -968,8 +1185,26 @@ func TestPrinterPrintAssignPlus(t *testing.T) { TokenName: meta.PlusEqualToken, }, }, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expression: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Variable: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }, + Expression: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "b"}, + }, }) expected := `$a +=$b` @@ -992,8 +1227,26 @@ func TestPrinterPrintAssignPow(t *testing.T) { TokenName: meta.PowEqualToken, }, }, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expression: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Variable: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }, + Expression: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "b"}, + }, }) expected := `$a **=$b` @@ -1016,8 +1269,26 @@ func TestPrinterPrintAssignShiftLeft(t *testing.T) { TokenName: meta.SlEqualToken, }, }, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expression: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Variable: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }, + Expression: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "b"}, + }, }) expected := `$a <<=$b` @@ -1040,8 +1311,26 @@ func TestPrinterPrintAssignShiftRight(t *testing.T) { TokenName: meta.SrEqualToken, }, }, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expression: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Variable: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }, + Expression: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "b"}, + }, }) expected := `$a >>=$b` @@ -1066,8 +1355,26 @@ func TestPrinterPrintBinaryBitwiseAnd(t *testing.T) { TokenName: meta.AmpersandToken, }, }, - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Left: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }, + Right: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "b"}, + }, }) expected := `$a &$b` @@ -1090,8 +1397,26 @@ func TestPrinterPrintBinaryBitwiseOr(t *testing.T) { TokenName: meta.VerticalBarToken, }, }, - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Left: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }, + Right: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "b"}, + }, }) expected := `$a |$b` @@ -1114,8 +1439,26 @@ func TestPrinterPrintBinaryBitwiseXor(t *testing.T) { TokenName: meta.CaretToken, }, }, - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Left: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }, + Right: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "b"}, + }, }) expected := `$a ^$b` @@ -1138,8 +1481,26 @@ func TestPrinterPrintBinaryBooleanAnd(t *testing.T) { TokenName: meta.BooleanAndToken, }, }, - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Left: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }, + Right: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "b"}, + }, }) expected := `$a &&$b` @@ -1162,8 +1523,26 @@ func TestPrinterPrintBinaryBooleanOr(t *testing.T) { TokenName: meta.BooleanOrToken, }, }, - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Left: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }, + Right: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "b"}, + }, }) expected := `$a ||$b` @@ -1186,8 +1565,26 @@ func TestPrinterPrintBinaryCoalesce(t *testing.T) { TokenName: meta.CoalesceToken, }, }, - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Left: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }, + Right: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "b"}, + }, }) expected := `$a ??$b` @@ -1210,8 +1607,26 @@ func TestPrinterPrintBinaryConcat(t *testing.T) { TokenName: meta.DotToken, }, }, - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Left: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }, + Right: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "b"}, + }, }) expected := `$a .$b` @@ -1234,8 +1649,26 @@ func TestPrinterPrintBinaryDiv(t *testing.T) { TokenName: meta.SlashToken, }, }, - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Left: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }, + Right: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "b"}, + }, }) expected := `$a /$b` @@ -1258,8 +1691,26 @@ func TestPrinterPrintBinaryEqual(t *testing.T) { TokenName: meta.IsEqualToken, }, }, - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Left: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }, + Right: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "b"}, + }, }) expected := `$a ==$b` @@ -1282,8 +1733,26 @@ func TestPrinterPrintBinaryGreaterOrEqual(t *testing.T) { TokenName: meta.IsGreaterOrEqualToken, }, }, - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Left: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }, + Right: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "b"}, + }, }) expected := `$a >=$b` @@ -1306,8 +1775,26 @@ func TestPrinterPrintBinaryGreater(t *testing.T) { TokenName: meta.GreaterToken, }, }, - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Left: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }, + Right: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "b"}, + }, }) expected := `$a >$b` @@ -1330,8 +1817,26 @@ func TestPrinterPrintBinaryIdentical(t *testing.T) { TokenName: meta.IsIdenticalToken, }, }, - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Left: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }, + Right: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "b"}, + }, }) expected := `$a ===$b` @@ -1354,8 +1859,26 @@ func TestPrinterPrintBinaryLogicalAnd(t *testing.T) { TokenName: meta.LogicalAndToken, }, }, - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Left: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }, + Right: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "b"}, + }, }) expected := `$a and$b` @@ -1378,8 +1901,26 @@ func TestPrinterPrintBinaryLogicalOr(t *testing.T) { TokenName: meta.LogicalOrToken, }, }, - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Left: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }, + Right: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "b"}, + }, }) expected := `$a or$b` @@ -1402,8 +1943,26 @@ func TestPrinterPrintBinaryLogicalXor(t *testing.T) { TokenName: meta.LogicalXorToken, }, }, - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Left: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }, + Right: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "b"}, + }, }) expected := `$a xor$b` @@ -1426,8 +1985,26 @@ func TestPrinterPrintBinaryMinus(t *testing.T) { TokenName: meta.MinusToken, }, }, - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Left: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }, + Right: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "b"}, + }, }) expected := `$a -$b` @@ -1450,8 +2027,26 @@ func TestPrinterPrintBinaryMod(t *testing.T) { TokenName: meta.PercentToken, }, }, - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Left: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }, + Right: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "b"}, + }, }) expected := `$a %$b` @@ -1474,8 +2069,26 @@ func TestPrinterPrintBinaryMul(t *testing.T) { TokenName: meta.AsteriskToken, }, }, - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Left: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }, + Right: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "b"}, + }, }) expected := `$a *$b` @@ -1503,8 +2116,26 @@ func TestPrinterPrintBinaryNotEqual(t *testing.T) { TokenName: meta.IsNotEqualToken, }, }, - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Left: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }, + Right: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "b"}, + }, }) expected := `$a !=$b` @@ -1527,8 +2158,26 @@ func TestPrinterPrintBinaryNotIdentical(t *testing.T) { TokenName: meta.IsNotIdenticalToken, }, }, - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Left: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }, + Right: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "b"}, + }, }) expected := `$a !==$b` @@ -1551,8 +2200,26 @@ func TestPrinterPrintBinaryPlus(t *testing.T) { TokenName: meta.PlusToken, }, }, - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Left: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }, + Right: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "b"}, + }, }) expected := `$a +$b` @@ -1575,8 +2242,26 @@ func TestPrinterPrintBinaryPow(t *testing.T) { TokenName: meta.PowToken, }, }, - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Left: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }, + Right: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "b"}, + }, }) expected := `$a **$b` @@ -1599,8 +2284,26 @@ func TestPrinterPrintBinaryShiftLeft(t *testing.T) { TokenName: meta.SlToken, }, }, - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Left: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }, + Right: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "b"}, + }, }) expected := `$a <<$b` @@ -1623,8 +2326,26 @@ func TestPrinterPrintBinaryShiftRight(t *testing.T) { TokenName: meta.SrToken, }, }, - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Left: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }, + Right: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "b"}, + }, }) expected := `$a >>$b` @@ -1647,8 +2368,26 @@ func TestPrinterPrintBinarySmallerOrEqual(t *testing.T) { TokenName: meta.IsSmallerOrEqualToken, }, }, - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Left: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }, + Right: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "b"}, + }, }) expected := `$a <=$b` @@ -1671,8 +2410,26 @@ func TestPrinterPrintBinarySmaller(t *testing.T) { TokenName: meta.LessToken, }, }, - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Left: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }, + Right: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "b"}, + }, }) expected := `$a <$b` @@ -1695,8 +2452,26 @@ func TestPrinterPrintBinarySpaceship(t *testing.T) { TokenName: meta.SpaceshipToken, }, }, - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Left: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }, + Right: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "b"}, + }, }) expected := `$a <=>$b` @@ -1726,7 +2501,16 @@ func TestPrinterPrintArray(t *testing.T) { TokenName: meta.ArrayCastToken, }, }, - Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + Expr: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "var"}, + }, }) expected := ` (array)$var` @@ -1754,7 +2538,16 @@ func TestPrinterPrintBool(t *testing.T) { TokenName: meta.BoolCastToken, }, }, - Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + Expr: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "var"}, + }, }) expected := ` (bool)$var` @@ -1782,7 +2575,16 @@ func TestPrinterPrintDouble(t *testing.T) { TokenName: meta.DoubleCastToken, }, }, - Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + Expr: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "var"}, + }, }) expected := ` (float)$var` @@ -1810,7 +2612,16 @@ func TestPrinterPrintInt(t *testing.T) { TokenName: meta.IntCastToken, }, }, - Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + Expr: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "var"}, + }, }) expected := ` (int)$var` @@ -1838,7 +2649,16 @@ func TestPrinterPrintObject(t *testing.T) { TokenName: meta.ObjectCastToken, }, }, - Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + Expr: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "var"}, + }, }) expected := ` (object)$var` @@ -1866,7 +2686,16 @@ func TestPrinterPrintString(t *testing.T) { TokenName: meta.StringCastToken, }, }, - Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + Expr: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "var"}, + }, }) expected := ` (string)$var` @@ -1894,7 +2723,16 @@ func TestPrinterPrintUnset(t *testing.T) { TokenName: meta.UnsetCastToken, }, }, - Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + Expr: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "var"}, + }, }) expected := ` (unset)$var` @@ -1934,8 +2772,17 @@ func TestPrinterPrintExprArrayDimFetch(t *testing.T) { TokenName: meta.CloseSquareBracket, }, }, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, - Dim: &scalar.Lnumber{Value: "1"}, + Variable: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "var"}, + }, + Dim: &scalar.Lnumber{Value: "1"}, }) expected := `$var [1 ]` @@ -1966,6 +2813,11 @@ func TestPrinterPrintExprArrayItemWithKey(t *testing.T) { Value: " ", TokenName: meta.VariableToken, }, + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, }, VarName: &node.Identifier{Value: "world"}, }, @@ -1984,7 +2836,16 @@ func TestPrinterPrintExprArrayItem(t *testing.T) { p := printer.NewPrinter(o) p.Print(&expr.ArrayItem{ - Val: &expr.Reference{Variable: &expr.Variable{VarName: &node.Identifier{Value: "world"}}}, + Val: &expr.Reference{Variable: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "world"}, + }}, }) expected := `&$world` @@ -2020,14 +2881,41 @@ func TestPrinterPrintExprArray(t *testing.T) { Items: []node.Node{ &expr.ArrayItem{ Key: &scalar.String{Value: "'Hello'"}, - Val: &expr.Variable{VarName: &node.Identifier{Value: "world"}}, + Val: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "world"}, + }, }, &expr.ArrayItem{ Key: &scalar.Lnumber{Value: "2"}, - Val: &expr.Reference{Variable: &expr.Variable{VarName: &node.Identifier{Value: "var"}}}, + Val: &expr.Reference{Variable: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "var"}, + }}, }, &expr.ArrayItem{ - Val: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + Val: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "var"}, + }, }, }, }) @@ -2052,7 +2940,16 @@ func TestPrinterPrintExprBitwiseNot(t *testing.T) { TokenName: meta.TildeToken, }, }, - Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + Expr: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "var"}, + }, }) expected := ` ~$var` @@ -2075,7 +2972,16 @@ func TestPrinterPrintExprBooleanNot(t *testing.T) { TokenName: meta.ExclamationMarkToken, }, }, - Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + Expr: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "var"}, + }, }) expected := ` !$var` @@ -2098,7 +3004,16 @@ func TestPrinterPrintExprClassConstFetch(t *testing.T) { TokenName: meta.PaamayimNekudotayimToken, }, }, - Class: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + Class: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "var"}, + }, ConstantName: &node.Identifier{ Meta: meta.Collection{ &meta.Data{ @@ -2131,7 +3046,16 @@ func TestPrinterPrintExprClone(t *testing.T) { TokenName: meta.CloneToken, }, }, - Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + Expr: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "var"}, + }, }) expected := ` clone$var` @@ -2165,8 +3089,26 @@ func TestPrinterPrintExprClosureUse(t *testing.T) { }, }, Uses: []node.Node{ - &expr.Reference{Variable: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}}, - &expr.Variable{VarName: &node.Identifier{Value: "bar"}}, + &expr.Reference{Variable: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "foo"}, + }}, + &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "bar"}, + }, }, }) @@ -2226,13 +3168,40 @@ func TestPrinterPrintExprClosure(t *testing.T) { &node.Parameter{ ByRef: true, Variadic: false, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + Variable: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "var"}, + }, }, }, ClosureUse: &expr.ClosureUse{ Uses: []node.Node{ - &expr.Reference{Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, - &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + &expr.Reference{Variable: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }}, + &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "b"}, + }, }, }, ReturnType: &name.FullyQualified{ @@ -2246,7 +3215,16 @@ func TestPrinterPrintExprClosure(t *testing.T) { Parts: []node.Node{&name.NamePart{Value: "Foo"}}, }, Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, + &stmt.Expression{Expr: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }}, }, }) @@ -2296,7 +3274,16 @@ func TestPrinterPrintEmpty(t *testing.T) { TokenName: meta.CloseParenthesisToken, }, }, - Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + Expr: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "var"}, + }, }) expected := ` empty ($var )` @@ -2319,7 +3306,16 @@ func TestPrinterPrettyPrinterrorSuppress(t *testing.T) { TokenName: meta.AtToken, }, }, - Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + Expr: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "var"}, + }, }) expected := ` @$var` @@ -2352,7 +3348,16 @@ func TestPrinterPrintEval(t *testing.T) { TokenName: meta.CloseParenthesisToken, }, }, - Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + Expr: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "var"}, + }, }) expected := ` eval ($var )` @@ -2387,6 +3392,13 @@ func TestPrinterPrintExit(t *testing.T) { }, Die: false, Expr: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, VarName: &node.Identifier{Value: "var"}, }, }) @@ -2423,6 +3435,13 @@ func TestPrinterPrintDie(t *testing.T) { }, }, Expr: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, VarName: &node.Identifier{Value: "var"}, }, }) @@ -2440,7 +3459,16 @@ func TestPrinterPrintFunctionCall(t *testing.T) { p := printer.NewPrinter(o) p.Print(&expr.FunctionCall{ - Function: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + Function: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "var"}, + }, ArgumentList: &node.ArgumentList{ Meta: meta.Collection{ &meta.Data{ @@ -2457,14 +3485,41 @@ func TestPrinterPrintFunctionCall(t *testing.T) { Arguments: []node.Node{ &node.Argument{ IsReference: true, - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Expr: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }, }, &node.Argument{ Variadic: true, - Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Expr: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "b"}, + }, }, &node.Argument{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "c"}}, + Expr: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "c"}, + }, }, }, }, @@ -2535,7 +3590,16 @@ func TestPrinterPrintInstanceOf(t *testing.T) { TokenName: meta.InstanceofToken, }, }, - Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + Expr: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "var"}, + }, Class: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Foo"}}}, }) @@ -2570,8 +3634,26 @@ func TestPrinterPrintIsset(t *testing.T) { }, }, Variables: []node.Node{ - &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }, + &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "b"}, + }, }, }) @@ -2607,16 +3689,43 @@ func TestPrinterPrintList(t *testing.T) { }, Items: []node.Node{ &expr.ArrayItem{ - Val: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Val: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }, }, &expr.ArrayItem{ Val: &expr.List{ Items: []node.Node{ &expr.ArrayItem{ - Val: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Val: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "b"}, + }, }, &expr.ArrayItem{ - Val: &expr.Variable{VarName: &node.Identifier{Value: "c"}}, + Val: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "c"}, + }, }, }, }, @@ -2644,8 +3753,17 @@ func TestPrinterPrintMethodCall(t *testing.T) { TokenName: meta.ObjectOperatorToken, }, }, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, - Method: &node.Identifier{Value: "bar"}, + Variable: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "foo"}, + }, + Method: &node.Identifier{Value: "bar"}, ArgumentList: &node.ArgumentList{ Meta: meta.Collection{ &meta.Data{ @@ -2661,10 +3779,28 @@ func TestPrinterPrintMethodCall(t *testing.T) { }, Arguments: []node.Node{ &node.Argument{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Expr: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }, }, &node.Argument{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Expr: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "b"}, + }, }, }, }, @@ -2719,10 +3855,28 @@ func TestPrinterPrintNew(t *testing.T) { }, Arguments: []node.Node{ &node.Argument{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Expr: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }, }, &node.Argument{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Expr: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "b"}, + }, }, }, }, @@ -2748,7 +3902,16 @@ func TestPrinterPrintPostDec(t *testing.T) { TokenName: meta.DecToken, }, }, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + Variable: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "var"}, + }, }) expected := `$var --` @@ -2771,7 +3934,16 @@ func TestPrinterPrintPostInc(t *testing.T) { TokenName: meta.IncToken, }, }, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + Variable: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "var"}, + }, }) expected := `$var ++` @@ -2794,7 +3966,16 @@ func TestPrinterPrintPreDec(t *testing.T) { TokenName: meta.DecToken, }, }, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + Variable: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "var"}, + }, }) expected := ` --$var` @@ -2817,7 +3998,16 @@ func TestPrinterPrintPreInc(t *testing.T) { TokenName: meta.IncToken, }, }, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + Variable: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "var"}, + }, }) expected := ` ++$var` @@ -2847,6 +4037,11 @@ func TestPrinterPrintPrint(t *testing.T) { Value: " ", TokenName: meta.NodeStart, }, + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, }, VarName: &node.Identifier{Value: "var"}, }, @@ -2872,7 +4067,16 @@ func TestPrinterPrintPropertyFetch(t *testing.T) { TokenName: meta.ObjectOperatorToken, }, }, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, + Variable: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "foo"}, + }, Property: &node.Identifier{Value: "bar"}, }) @@ -2896,7 +4100,16 @@ func TestPrinterPrintExprReference(t *testing.T) { TokenName: meta.AmpersandToken, }, }, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, + Variable: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "foo"}, + }, }) expected := ` &$foo` @@ -2967,7 +4180,16 @@ func TestPrinterPrintShellExec(t *testing.T) { }, Parts: []node.Node{ &scalar.EncapsedStringPart{Value: "hello "}, - &expr.Variable{VarName: &node.Identifier{Value: "world"}}, + &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "world"}, + }, &scalar.EncapsedStringPart{Value: "!"}, }, }) @@ -3000,14 +4222,41 @@ func TestPrinterPrintExprShortArray(t *testing.T) { Items: []node.Node{ &expr.ArrayItem{ Key: &scalar.String{Value: "'Hello'"}, - Val: &expr.Variable{VarName: &node.Identifier{Value: "world"}}, + Val: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "world"}, + }, }, &expr.ArrayItem{ Key: &scalar.Lnumber{Value: "2"}, - Val: &expr.Reference{Variable: &expr.Variable{VarName: &node.Identifier{Value: "var"}}}, + Val: &expr.Reference{Variable: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "var"}, + }}, }, &expr.ArrayItem{ - Val: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + Val: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "var"}, + }, }, }, }) @@ -3039,16 +4288,43 @@ func TestPrinterPrintShortList(t *testing.T) { }, Items: []node.Node{ &expr.ArrayItem{ - Val: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Val: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }, }, &expr.ArrayItem{ Val: &expr.List{ Items: []node.Node{ &expr.ArrayItem{ - Val: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Val: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "b"}, + }, }, &expr.ArrayItem{ - Val: &expr.Variable{VarName: &node.Identifier{Value: "c"}}, + Val: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "c"}, + }, }, }, }, @@ -3093,10 +4369,28 @@ func TestPrinterPrintStaticCall(t *testing.T) { }, Arguments: []node.Node{ &node.Argument{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Expr: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }, }, &node.Argument{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Expr: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "b"}, + }, }, }, }, @@ -3122,8 +4416,17 @@ func TestPrinterPrintStaticPropertyFetch(t *testing.T) { TokenName: meta.PaamayimNekudotayimToken, }, }, - Class: &node.Identifier{Value: "Foo"}, - Property: &expr.Variable{VarName: &node.Identifier{Value: "bar"}}, + Class: &node.Identifier{Value: "Foo"}, + Property: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "bar"}, + }, }) expected := `Foo ::$bar` @@ -3151,8 +4454,26 @@ func TestPrinterPrintTernary(t *testing.T) { TokenName: meta.ColonToken, }, }, - Condition: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - IfFalse: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Condition: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }, + IfFalse: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "b"}, + }, }) expected := `$a ? :$b` @@ -3180,9 +4501,36 @@ func TestPrinterPrintTernaryFull(t *testing.T) { TokenName: meta.ColonToken, }, }, - Condition: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - IfTrue: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - IfFalse: &expr.Variable{VarName: &node.Identifier{Value: "c"}}, + Condition: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }, + IfTrue: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "b"}, + }, + IfFalse: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "c"}, + }, }) expected := `$a ?$b :$c` @@ -3205,7 +4553,16 @@ func TestPrinterPrintUnaryMinus(t *testing.T) { TokenName: meta.MinusToken, }, }, - Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + Expr: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "var"}, + }, }) expected := ` -$var` @@ -3228,7 +4585,16 @@ func TestPrinterPrintUnaryPlus(t *testing.T) { TokenName: meta.PlusToken, }, }, - Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + Expr: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "var"}, + }, }) expected := ` +$var` @@ -3250,8 +4616,20 @@ func TestPrinterPrintVariable(t *testing.T) { Value: " ", TokenName: meta.DollarToken, }, + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, }, VarName: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, VarName: &node.Identifier{Value: "var"}, }, }) @@ -3276,7 +4654,16 @@ func TestPrinterPrintYieldFrom(t *testing.T) { TokenName: meta.YieldFromToken, }, }, - Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + Expr: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "var"}, + }, }) expected := ` yield from$var` @@ -3299,7 +4686,16 @@ func TestPrinterPrintYield(t *testing.T) { TokenName: meta.YieldToken, }, }, - Value: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + Value: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "var"}, + }, }) expected := ` yield$var` @@ -3327,8 +4723,26 @@ func TestPrinterPrintYieldFull(t *testing.T) { TokenName: meta.DoubleArrowToken, }, }, - Key: &expr.Variable{VarName: &node.Identifier{Value: "k"}}, - Value: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + Key: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "k"}, + }, + Value: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "var"}, + }, }) expected := ` yield$k =>$var` @@ -3368,10 +4782,28 @@ func TestPrinterPrintAltElseIf(t *testing.T) { TokenName: meta.ColonToken, }, }, - Cond: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Cond: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }, Stmt: &stmt.StmtList{ Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + &stmt.Expression{Expr: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "b"}, + }}, }, }, }) @@ -3411,7 +4843,16 @@ func TestPrinterPrintAltElseIfEmpty(t *testing.T) { TokenName: meta.ColonToken, }, }, - Cond: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Cond: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }, Stmt: &stmt.StmtList{}, }) @@ -3442,7 +4883,16 @@ func TestPrinterPrintAltElse(t *testing.T) { }, Stmt: &stmt.StmtList{ Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + &stmt.Expression{Expr: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "b"}, + }}, }, }, }) @@ -3536,17 +4986,53 @@ func TestPrinterPrintAltFor(t *testing.T) { }, }, Init: []node.Node{ - &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }, }, Cond: []node.Node{ - &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "b"}, + }, }, Loop: []node.Node{ - &expr.Variable{VarName: &node.Identifier{Value: "c"}}, + &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "c"}, + }, }, Stmt: &stmt.StmtList{ Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "d"}}}, + &stmt.Expression{Expr: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "d"}, + }}, }, }, }) @@ -3611,12 +5097,48 @@ func TestPrinterPrintAltForeach(t *testing.T) { TokenName: meta.SemiColonToken, }, }, - Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, - Key: &expr.Variable{VarName: &node.Identifier{Value: "key"}}, - Variable: &expr.Reference{Variable: &expr.Variable{VarName: &node.Identifier{Value: "val"}}}, + Expr: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "var"}, + }, + Key: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "key"}, + }, + Variable: &expr.Reference{Variable: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "val"}, + }}, Stmt: &stmt.StmtList{ Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "d"}}}, + &stmt.Expression{Expr: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "d"}, + }}, }, }, }) @@ -3671,30 +5193,84 @@ func TestPrinterPrintAltIf(t *testing.T) { TokenName: meta.SemiColonToken, }, }, - Cond: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Cond: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }, Stmt: &stmt.StmtList{ Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "d"}}}, + &stmt.Expression{Expr: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "d"}, + }}, }, }, ElseIf: []node.Node{ &stmt.AltElseIf{ - Cond: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Cond: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "b"}, + }, Stmt: &stmt.StmtList{ Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + &stmt.Expression{Expr: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "b"}, + }}, }, }, }, &stmt.AltElseIf{ - Cond: &expr.Variable{VarName: &node.Identifier{Value: "c"}}, + Cond: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "c"}, + }, Stmt: &stmt.StmtList{}, }, }, Else: &stmt.AltElse{ Stmt: &stmt.StmtList{ Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + &stmt.Expression{Expr: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "b"}, + }}, }, }, }, @@ -3750,19 +5326,46 @@ func TestPrinterPrintStmtAltSwitch(t *testing.T) { TokenName: meta.SemiColonToken, }, }, - Cond: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + Cond: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "var"}, + }, CaseList: &stmt.CaseList{ Cases: []node.Node{ &stmt.Case{ Cond: &scalar.String{Value: "'a'"}, Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, + &stmt.Expression{Expr: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }}, }, }, &stmt.Case{ Cond: &scalar.String{Value: "'b'"}, Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + &stmt.Expression{Expr: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "b"}, + }}, }, }, }, @@ -3819,10 +5422,28 @@ func TestPrinterPrintAltWhile(t *testing.T) { TokenName: meta.SemiColonToken, }, }, - Cond: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Cond: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }, Stmt: &stmt.StmtList{ Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + &stmt.Expression{Expr: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "b"}, + }}, }, }, }) @@ -3889,9 +5510,27 @@ func TestPrinterPrintStmtCase(t *testing.T) { TokenName: meta.CaseToken, }, }, - Cond: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Cond: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }, Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, + &stmt.Expression{Expr: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }}, }, }) @@ -3915,7 +5554,16 @@ func TestPrinterPrintStmtCaseEmpty(t *testing.T) { TokenName: meta.CaseToken, }, }, - Cond: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Cond: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }, Stmts: []node.Node{}, }) @@ -3963,9 +5611,27 @@ func TestPrinterPrintStmtCatch(t *testing.T) { &name.Name{Parts: []node.Node{&name.NamePart{Value: "Exception"}}}, &name.FullyQualified{Parts: []node.Node{&name.NamePart{Value: "RuntimeException"}}}, }, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "e"}}, + Variable: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "e"}, + }, Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, + &stmt.Expression{Expr: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }}, }, }) @@ -4011,12 +5677,30 @@ func TestPrinterPrintStmtClassMethod(t *testing.T) { &node.Parameter{ ByRef: true, VariableType: &node.Nullable{Expr: &name.Name{Parts: []node.Node{&name.NamePart{Value: "int"}}}}, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Variable: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }, DefaultValue: &expr.ConstFetch{Constant: &name.Name{Parts: []node.Node{&name.NamePart{Value: "null"}}}}, }, &node.Parameter{ Variadic: true, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Variable: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "b"}, + }, }, }, ReturnType: &name.Name{ @@ -4043,7 +5727,16 @@ func TestPrinterPrintStmtClassMethod(t *testing.T) { }, }, Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, + &stmt.Expression{Expr: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }}, }, }, }) @@ -4090,12 +5783,30 @@ func TestPrinterPrintStmtAbstractClassMethod(t *testing.T) { &node.Parameter{ ByRef: true, VariableType: &node.Nullable{Expr: &name.Name{Parts: []node.Node{&name.NamePart{Value: "int"}}}}, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Variable: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }, DefaultValue: &expr.ConstFetch{Constant: &name.Name{Parts: []node.Node{&name.NamePart{Value: "null"}}}}, }, &node.Parameter{ Variadic: true, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Variable: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "b"}, + }, }, }, ReturnType: &name.Name{ @@ -4225,10 +5936,28 @@ func TestPrinterPrintStmtAnonymousClass(t *testing.T) { }, Arguments: []node.Node{ &node.Argument{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Expr: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }, }, &node.Argument{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Expr: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "b"}, + }, }, }, }, @@ -4544,7 +6273,16 @@ func TestPrinterPrintStmtDefalut(t *testing.T) { }, }, Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, + &stmt.Expression{Expr: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }}, }, }) @@ -4618,7 +6356,16 @@ func TestPrinterPrintStmtDo_Expression(t *testing.T) { }, Cond: &scalar.Lnumber{Value: "1"}, Stmt: &stmt.Expression{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Expr: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }, }, }) @@ -4670,7 +6417,16 @@ func TestPrinterPrintStmtDo_StmtList(t *testing.T) { Cond: &scalar.Lnumber{Value: "1"}, Stmt: &stmt.StmtList{ Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, + &stmt.Expression{Expr: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }}, }, }, }) @@ -4711,8 +6467,26 @@ func TestPrinterPrintStmtEcho(t *testing.T) { }, }, Exprs: []node.Node{ - &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }, + &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "b"}, + }, }, }) @@ -4746,7 +6520,16 @@ func TestPrinterPrintStmtElseIfStmts(t *testing.T) { TokenName: meta.CloseParenthesisToken, }, }, - Cond: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Cond: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }, Stmt: &stmt.StmtList{ Stmts: []node.Node{ &stmt.Nop{}, @@ -4784,7 +6567,16 @@ func TestPrinterPrintStmtElseIfExpr(t *testing.T) { TokenName: meta.CloseParenthesisToken, }, }, - Cond: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Cond: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }, Stmt: &stmt.Expression{Expr: &scalar.String{Value: "'bar'"}}, }) @@ -4801,7 +6593,16 @@ func TestPrinterPrintStmtElseIfNop(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.ElseIf{ - Cond: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Cond: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }, Stmt: &stmt.Nop{}, }) @@ -4896,7 +6697,16 @@ func TestPrinterPrintExpression(t *testing.T) { TokenName: meta.SemiColonToken, }, }, - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Expr: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }, }) expected := `$a ` @@ -4975,16 +6785,70 @@ func TestPrinterPrintStmtFor(t *testing.T) { }, }, Init: []node.Node{ - &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }, + &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "b"}, + }, }, Cond: []node.Node{ - &expr.Variable{VarName: &node.Identifier{Value: "c"}}, - &expr.Variable{VarName: &node.Identifier{Value: "d"}}, + &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "c"}, + }, + &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "d"}, + }, }, Loop: []node.Node{ - &expr.Variable{VarName: &node.Identifier{Value: "e"}}, - &expr.Variable{VarName: &node.Identifier{Value: "f"}}, + &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "e"}, + }, + &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "f"}, + }, }, Stmt: &stmt.StmtList{ Stmts: []node.Node{ @@ -5033,9 +6897,36 @@ func TestPrinterPrintStmtForeach(t *testing.T) { TokenName: meta.CloseParenthesisToken, }, }, - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Key: &expr.Variable{VarName: &node.Identifier{Value: "k"}}, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "v"}}, + Expr: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }, + Key: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "k"}, + }, + Variable: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "v"}, + }, Stmt: &stmt.StmtList{ Stmts: []node.Node{ &stmt.Nop{}, @@ -5094,7 +6985,16 @@ func TestPrinterPrintStmtFunction(t *testing.T) { &node.Parameter{ ByRef: true, Variadic: false, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + Variable: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "var"}, + }, }, }, ReturnType: &name.FullyQualified{ @@ -5143,8 +7043,26 @@ func TestPrinterPrintStmtGlobal(t *testing.T) { }, }, Vars: []node.Node{ - &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }, + &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "b"}, + }, }, }) @@ -5311,29 +7229,83 @@ func TestPrinterPrintIfExpression(t *testing.T) { TokenName: meta.CloseParenthesisToken, }, }, - Cond: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Cond: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }, Stmt: &stmt.Expression{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Expr: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "b"}, + }, }, ElseIf: []node.Node{ &stmt.ElseIf{ - Cond: &expr.Variable{VarName: &node.Identifier{Value: "c"}}, + Cond: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "c"}, + }, Stmt: &stmt.StmtList{ Stmts: []node.Node{ &stmt.Expression{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "d"}}, + Expr: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "d"}, + }, }, }, }, }, &stmt.ElseIf{ - Cond: &expr.Variable{VarName: &node.Identifier{Value: "e"}}, + Cond: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "e"}, + }, Stmt: &stmt.Nop{}, }, }, Else: &stmt.Else{ Stmt: &stmt.Expression{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "f"}}, + Expr: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "f"}, + }, }, }, }) @@ -5368,11 +7340,29 @@ func TestPrinterPrintIfStmtList(t *testing.T) { TokenName: meta.CloseParenthesisToken, }, }, - Cond: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Cond: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }, Stmt: &stmt.StmtList{ Stmts: []node.Node{ &stmt.Expression{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Expr: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "b"}, + }, }, }, }, @@ -5391,7 +7381,16 @@ func TestPrinterPrintIfNop(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.If{ - Cond: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Cond: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }, Stmt: &stmt.Nop{}, }) @@ -5469,7 +7468,16 @@ func TestPrinterPrintInterface(t *testing.T) { Params: []node.Node{}, Stmt: &stmt.StmtList{ Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, + &stmt.Expression{Expr: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }}, }, }, }, @@ -5564,7 +7572,16 @@ func TestPrinterPrintNamespaceWithStmts(t *testing.T) { }, NamespaceName: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Foo"}}}, Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, + &stmt.Expression{Expr: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }}, }, }) @@ -5621,10 +7638,28 @@ func TestPrinterPrintPropertyList(t *testing.T) { }, Properties: []node.Node{ &stmt.Property{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Variable: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }, }, &stmt.Property{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Variable: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "b"}, + }, }, }, }) @@ -5649,8 +7684,17 @@ func TestPrinterPrintProperty(t *testing.T) { TokenName: meta.EqualToken, }, }, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expr: &scalar.Lnumber{Value: "1"}, + Variable: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }, + Expr: &scalar.Lnumber{Value: "1"}, }) expected := `$a =1` @@ -5706,8 +7750,17 @@ func TestPrinterPrintStaticVar(t *testing.T) { TokenName: meta.EqualToken, }, }, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Expr: &scalar.Lnumber{Value: "1"}, + Variable: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }, + Expr: &scalar.Lnumber{Value: "1"}, }) expected := `$a =1` @@ -5742,10 +7795,28 @@ func TestPrinterPrintStatic(t *testing.T) { }, Vars: []node.Node{ &stmt.StaticVar{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Variable: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }, }, &stmt.StaticVar{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Variable: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "b"}, + }, }, }, }) @@ -5776,8 +7847,26 @@ func TestPrinterPrintStmtList(t *testing.T) { }, }, Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, - &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + &stmt.Expression{Expr: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }}, + &stmt.Expression{Expr: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "b"}, + }}, }, }) @@ -5807,13 +7896,40 @@ func TestPrinterPrintStmtListNested(t *testing.T) { }, }, Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, + &stmt.Expression{Expr: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }}, &stmt.StmtList{ Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + &stmt.Expression{Expr: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "b"}, + }}, &stmt.StmtList{ Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "c"}}}, + &stmt.Expression{Expr: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "c"}, + }}, }, }, }, @@ -5851,7 +7967,16 @@ func TestPrinterPrintStmtSwitch(t *testing.T) { TokenName: meta.CloseParenthesisToken, }, }, - Cond: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + Cond: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "var"}, + }, CaseList: &stmt.CaseList{ Meta: meta.Collection{ &meta.Data{ @@ -5869,13 +7994,31 @@ func TestPrinterPrintStmtSwitch(t *testing.T) { &stmt.Case{ Cond: &scalar.String{Value: "'a'"}, Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, + &stmt.Expression{Expr: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }}, }, }, &stmt.Case{ Cond: &scalar.String{Value: "'b'"}, Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + &stmt.Expression{Expr: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "b"}, + }}, }, }, }, @@ -5912,7 +8055,16 @@ func TestPrinterPrintStmtThrow(t *testing.T) { TokenName: meta.SemiColonToken, }, }, - Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + Expr: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "var"}, + }, }) expected := ` throw$var ` @@ -6160,7 +8312,16 @@ func TestPrinterPrintTrait(t *testing.T) { Params: []node.Node{}, Stmt: &stmt.StmtList{ Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, + &stmt.Expression{Expr: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }}, }, }, }, @@ -6198,7 +8359,16 @@ func TestPrinterPrintStmtTry(t *testing.T) { }, }, Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, + &stmt.Expression{Expr: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }}, }, Catches: []node.Node{ &stmt.Catch{ @@ -6206,9 +8376,27 @@ func TestPrinterPrintStmtTry(t *testing.T) { &name.Name{Parts: []node.Node{&name.NamePart{Value: "Exception"}}}, &name.FullyQualified{Parts: []node.Node{&name.NamePart{Value: "RuntimeException"}}}, }, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "e"}}, + Variable: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "e"}, + }, Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + &stmt.Expression{Expr: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "b"}, + }}, }, }, }, @@ -6260,8 +8448,26 @@ func TestPrinterPrintStmtUnset(t *testing.T) { }, }, Vars: []node.Node{ - &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }, + &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "b"}, + }, }, }) @@ -6362,10 +8568,28 @@ func TestPrinterPrintWhileStmtList(t *testing.T) { TokenName: meta.CloseParenthesisToken, }, }, - Cond: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Cond: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }, Stmt: &stmt.StmtList{ Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, + &stmt.Expression{Expr: &expr.Variable{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.TokenType, + Value: "$", + TokenName: meta.DollarToken, + }, + }, + VarName: &node.Identifier{Value: "a"}, + }}, }, }, }) diff --git a/visitor/dumper_test.go b/visitor/dumper_test.go index 8866ac4..290082c 100644 --- a/visitor/dumper_test.go +++ b/visitor/dumper_test.go @@ -110,7 +110,7 @@ func ExampleDumper() { // | "Position": Pos{Line: 5-5 Pos: 79-82} // | "Meta": // | " " before "VariableToken" - // | "StringVar": false + // | "$" before "DollarToken" // | "VarName": // | [*node.Identifier] // | "Position": Pos{Line: 5-5 Pos: 79-82} @@ -146,7 +146,7 @@ func ExampleDumper() { // | "\n\t\t\t\t\t" before "VariableToken" // | "// some comment\n" before "VariableToken" // | "\t\t\t\t\t" before "VariableToken" - // | "StringVar": false + // | "$" before "DollarToken" // | "VarName": // | [*node.Identifier] // | "Position": Pos{Line: 8-8 Pos: 124-127} diff --git a/visitor/go_dumper.go b/visitor/go_dumper.go index 2798243..78dd1be 100644 --- a/visitor/go_dumper.go +++ b/visitor/go_dumper.go @@ -78,19 +78,23 @@ func (d *GoDumper) EnterNode(w walker.Walkable) bool { d.depth++ printIndent(d.Writer, d.depth) - fmt.Fprint(d.Writer, "Position: &position.Position{\n") - d.depth++ - printIndent(d.Writer, d.depth) - fmt.Fprintf(d.Writer, "StartLine: %d,\n", m.Position.StartLine) - printIndent(d.Writer, d.depth) - fmt.Fprintf(d.Writer, "EndLine: %d,\n", m.Position.EndLine) - printIndent(d.Writer, d.depth) - fmt.Fprintf(d.Writer, "StartPos: %d,\n", m.Position.StartPos) - printIndent(d.Writer, d.depth) - fmt.Fprintf(d.Writer, "EndPos: %d,\n", m.Position.EndPos) - d.depth-- - printIndent(d.Writer, d.depth) - fmt.Fprint(d.Writer, "},\n") + if m.Position != nil { + fmt.Fprint(d.Writer, "Position: &position.Position{\n") + d.depth++ + printIndent(d.Writer, d.depth) + fmt.Fprintf(d.Writer, "StartLine: %d,\n", m.Position.StartLine) + printIndent(d.Writer, d.depth) + fmt.Fprintf(d.Writer, "EndLine: %d,\n", m.Position.EndLine) + printIndent(d.Writer, d.depth) + fmt.Fprintf(d.Writer, "StartPos: %d,\n", m.Position.StartPos) + printIndent(d.Writer, d.depth) + fmt.Fprintf(d.Writer, "EndPos: %d,\n", m.Position.EndPos) + d.depth-- + printIndent(d.Writer, d.depth) + fmt.Fprint(d.Writer, "},\n") + } else { + fmt.Fprint(d.Writer, "Position: nil,\n") + } printIndent(d.Writer, d.depth) fmt.Fprintf(d.Writer, "Value: %q,\n", m.String()) diff --git a/visitor/go_dumper_test.go b/visitor/go_dumper_test.go index 33e9805..dc87a47 100644 --- a/visitor/go_dumper_test.go +++ b/visitor/go_dumper_test.go @@ -310,8 +310,12 @@ func ExampleGoDumper() { // Value: " ", // TokenName: 12, // }, + // &meta.TokenType{ + // Position: nil, + // Value: "$", + // TokenName: 145, + // }, // }, - // StringVar: false, // VarName: &node.Identifier{ // Position: &position.Position{ // StartLine: 5, @@ -450,8 +454,12 @@ func ExampleGoDumper() { // Value: "\t\t\t\t\t", // TokenName: 12, // }, + // &meta.TokenType{ + // Position: nil, + // Value: "$", + // TokenName: 145, + // }, // }, - // StringVar: false, // VarName: &node.Identifier{ // Position: &position.Position{ // StartLine: 8, diff --git a/visitor/json_dumper_test.go b/visitor/json_dumper_test.go index 51f8219..63b908d 100644 --- a/visitor/json_dumper_test.go +++ b/visitor/json_dumper_test.go @@ -37,5 +37,5 @@ func ExampleJsonDumper() { nodes.Walk(dumper) // Output: - // {"type":"*node.Root","position":{"startPos":10,"endPos":166,"startLine":3,"endLine":12},"Stmts":[{"type":"*stmt.Namespace","position":{"startPos":10,"endPos":166,"startLine":3,"endLine":12},"meta":[{"type":"*meta.TokenType","value":" Date: Wed, 24 Oct 2018 22:32:35 +0300 Subject: [PATCH 025/117] remove meta.VariableToken meta.DollarOpenCurlyBracesToken meta.DollarToken and fix go_dumper --- meta/tokenName.go | 4 - meta/tokenName_string.go | 4 +- php5/php5.go | 863 ++++++++++++++-------------- php5/php5.y | 146 ++--- php7/php7.go | 94 ++- php7/php7.y | 92 +-- printer/printer.go | 24 +- printer/printer_parsed_php5_test.go | 1 + printer/printer_test.go | 520 ++++++++--------- visitor/dumper_test.go | 12 +- visitor/go_dumper.go | 25 +- visitor/go_dumper_test.go | 141 +++-- visitor/json_dumper_test.go | 2 +- visitor/pretty_json_dumper_test.go | 16 +- 14 files changed, 975 insertions(+), 969 deletions(-) diff --git a/meta/tokenName.go b/meta/tokenName.go index 05a08f0..c1f9ba0 100644 --- a/meta/tokenName.go +++ b/meta/tokenName.go @@ -17,7 +17,6 @@ const ( DnumberToken StringToken StringVarnameToken - VariableToken NumStringToken InlineHTMLToken EncapsedAndWhitespaceToken @@ -66,8 +65,6 @@ const ( ArrayToken CallableToken StartHeredocToken - DollarOpenCurlyBracesToken - DollarCloseCurlyBracesToken CurlyOpenToken PaamayimNekudotayimToken NamespaceToken @@ -150,7 +147,6 @@ const ( ExclamationMarkToken // '!' TildeToken // '~' AtToken // '@' - DollarToken // '$' CommaToken // ',' VerticalBarToken // '|' EqualToken // '=' diff --git a/meta/tokenName_string.go b/meta/tokenName_string.go index 819f7f0..4af347c 100644 --- a/meta/tokenName_string.go +++ b/meta/tokenName_string.go @@ -4,9 +4,9 @@ package meta import "strconv" -const _TokenName_name = "UnknownTokenNodeStartNodeEndMagicConstantTokenIncludeTokenIncludeOnceTokenExitTokenIfTokenLnumberTokenDnumberTokenStringTokenStringVarnameTokenVariableTokenNumStringTokenInlineHTMLTokenEncapsedAndWhitespaceTokenConstantEncapsedStringTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenUseTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenIssetTokenEmptyTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenListTokenArrayTokenCallableTokenStartHeredocTokenDollarOpenCurlyBracesTokenDollarCloseCurlyBracesTokenCurlyOpenTokenPaamayimNekudotayimTokenNamespaceTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenEvalTokenRequireTokenRequireOnceTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenNewAnchorCloneTokenElseifTokenElseTokenEndifTokenPrintTokenYieldTokenStaticTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenYieldFromTokenObjectOperatorTokenIntCastTokenDoubleCastTokenStringCastTokenArrayCastTokenObjectCastTokenBoolCastTokenUnsetCastTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenIdentifierTokenCaseSeparatorTokenDoubleQuoteTokenBackquoteTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenExclamationMarkTokenTildeTokenAtTokenDollarTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" +const _TokenName_name = "UnknownTokenNodeStartNodeEndMagicConstantTokenIncludeTokenIncludeOnceTokenExitTokenIfTokenLnumberTokenDnumberTokenStringTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEncapsedAndWhitespaceTokenConstantEncapsedStringTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenUseTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenIssetTokenEmptyTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenListTokenArrayTokenCallableTokenStartHeredocTokenCurlyOpenTokenPaamayimNekudotayimTokenNamespaceTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenEvalTokenRequireTokenRequireOnceTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenNewAnchorCloneTokenElseifTokenElseTokenEndifTokenPrintTokenYieldTokenStaticTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenYieldFromTokenObjectOperatorTokenIntCastTokenDoubleCastTokenStringCastTokenArrayCastTokenObjectCastTokenBoolCastTokenUnsetCastTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenIdentifierTokenCaseSeparatorTokenDoubleQuoteTokenBackquoteTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenExclamationMarkTokenTildeTokenAtTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" -var _TokenName_index = [...]uint16{0, 12, 21, 28, 46, 58, 74, 83, 90, 102, 114, 125, 143, 156, 170, 185, 211, 238, 247, 254, 264, 277, 298, 319, 327, 338, 350, 365, 377, 392, 399, 410, 424, 433, 445, 455, 468, 477, 490, 500, 511, 519, 529, 541, 551, 559, 573, 584, 592, 602, 612, 622, 632, 642, 656, 668, 683, 699, 708, 718, 731, 748, 774, 801, 815, 839, 853, 879, 895, 908, 917, 929, 945, 959, 974, 989, 1004, 1013, 1023, 1034, 1043, 1053, 1063, 1073, 1084, 1097, 1107, 1119, 1133, 1144, 1152, 1160, 1174, 1193, 1205, 1220, 1235, 1249, 1264, 1277, 1291, 1304, 1318, 1332, 1347, 1360, 1373, 1386, 1402, 1415, 1428, 1440, 1453, 1465, 1477, 1491, 1506, 1514, 1521, 1528, 1544, 1563, 1575, 1590, 1611, 1632, 1649, 1664, 1682, 1698, 1712, 1732, 1753, 1767, 1777, 1797, 1818, 1835, 1853, 1870, 1884, 1894, 1903, 1923, 1933, 1940, 1951, 1961, 1977, 1987, 1997, 2010, 2020, 2032, 2041, 2053, 2061} +var _TokenName_index = [...]uint16{0, 12, 21, 28, 46, 58, 74, 83, 90, 102, 114, 125, 143, 157, 172, 198, 225, 234, 241, 251, 264, 285, 306, 314, 325, 337, 352, 364, 379, 386, 397, 411, 420, 432, 442, 455, 464, 477, 487, 498, 506, 516, 528, 538, 546, 560, 571, 579, 589, 599, 609, 619, 629, 643, 655, 670, 686, 695, 705, 718, 735, 749, 773, 787, 813, 829, 842, 851, 863, 879, 893, 908, 923, 938, 947, 957, 968, 977, 987, 997, 1007, 1018, 1031, 1041, 1053, 1067, 1078, 1086, 1094, 1108, 1127, 1139, 1154, 1169, 1183, 1198, 1211, 1225, 1238, 1252, 1266, 1281, 1294, 1307, 1320, 1336, 1349, 1362, 1374, 1387, 1399, 1411, 1425, 1440, 1448, 1455, 1462, 1478, 1497, 1509, 1524, 1545, 1566, 1583, 1598, 1616, 1632, 1646, 1666, 1687, 1701, 1711, 1731, 1752, 1769, 1787, 1804, 1818, 1828, 1837, 1857, 1867, 1874, 1884, 1900, 1910, 1920, 1933, 1943, 1955, 1964, 1976, 1984} func (i TokenName) String() string { if i < 0 || i >= TokenName(len(_TokenName_index)-1) { diff --git a/php5/php5.go b/php5/php5.go index e98e183..331e056 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -1,5 +1,3 @@ -// Code generated by goyacc -o php5/php5.go php5/php5.y. DO NOT EDIT. - //line php5/php5.y:2 package php5 @@ -348,7 +346,8 @@ const yyEofCode = 1 const yyErrCode = 2 const yyInitialStackSize = 16 -//line php5/php5.y:6991 +//line php5/php5.y:6993 + type simpleIndirectReference struct { all []*expr.Variable last *expr.Variable @@ -3540,8 +3539,8 @@ yydefault: // save comments yyDollar[1].token.Meta.SetTokenName(meta.CatchToken).AppendTo(catch.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(catch.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) + yyDollar[4].token.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yyDollar[5].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(catch.GetMeta()) yyDollar[6].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(catch.GetMeta()) yyDollar[8].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(catch.GetMeta()) @@ -3620,8 +3619,8 @@ yydefault: // save comments yyDollar[1].token.Meta.SetTokenName(meta.CatchToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) + yyDollar[4].token.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yyDollar[5].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[6].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[8].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) @@ -4429,8 +4428,8 @@ yydefault: if yyDollar[3].token != nil { yyDollar[3].token.Meta.SetTokenName(meta.EllipsisToken).AppendTo(yyVAL.node.GetMeta()) } - yyDollar[4].token.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) + yyDollar[4].token.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4462,8 +4461,8 @@ yydefault: if yyDollar[3].token != nil { yyDollar[3].token.Meta.SetTokenName(meta.EllipsisToken).AppendTo(yyVAL.node.GetMeta()) } - yyDollar[4].token.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) + yyDollar[4].token.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yyDollar[5].token.Meta.SetTokenName(meta.EqualToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -4659,8 +4658,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.VariableToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMeta(yyVAL.node, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMeta(yyVAL.node, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4674,9 +4673,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.DollarToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.DollarToken) - yylex.(*Parser).appendMeta(yyVAL.node, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) + yylex.(*Parser).appendMeta(yyVAL.node, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4690,16 +4689,18 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.DollarToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.DollarToken) - yyDollar[2].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) + yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.NodeStart) + yyDollar[4].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 165: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2516 + //line php5/php5.y:2518 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[3].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -4713,14 +4714,14 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) + yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 166: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:2535 + //line php5/php5.y:2537 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[3].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -4734,15 +4735,15 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) + yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yyDollar[4].token.Meta.SetTokenName(meta.EqualToken).AppendTo(staticVar.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 167: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2555 + //line php5/php5.y:2557 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -4755,14 +4756,14 @@ yydefault: staticVar.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 168: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2573 + //line php5/php5.y:2575 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -4775,15 +4776,15 @@ yydefault: staticVar.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yyDollar[2].token.Meta.SetTokenName(meta.EqualToken).AppendTo(staticVar.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 169: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2596 + //line php5/php5.y:2598 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -4791,7 +4792,7 @@ yydefault: } case 170: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2602 + //line php5/php5.y:2604 { yyVAL.list = []node.Node{} @@ -4799,7 +4800,7 @@ yydefault: } case 171: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2612 + //line php5/php5.y:2614 { yyVAL.node = stmt.NewPropertyList(yyDollar[1].list, yyDollar[2].list) @@ -4814,7 +4815,7 @@ yydefault: } case 172: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2625 + //line php5/php5.y:2627 { yyVAL.node = yyDollar[1].node @@ -4829,7 +4830,7 @@ yydefault: } case 173: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2638 + //line php5/php5.y:2640 { yyVAL.node = yyDollar[1].node @@ -4837,7 +4838,7 @@ yydefault: } case 174: yyDollar = yyS[yypt-8 : yypt+1] - //line php5/php5.y:2644 + //line php5/php5.y:2646 { name := node.NewIdentifier(yyDollar[4].token.Value) yyVAL.node = stmt.NewClassMethod(name, yyDollar[1].list, yyDollar[3].token != nil, yyDollar[6].list, nil, yyDollar[8].node, "") @@ -4863,7 +4864,7 @@ yydefault: } case 175: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2671 + //line php5/php5.y:2673 { yyVAL.node = stmt.NewTraitUse(yyDollar[2].list, yyDollar[3].node) @@ -4877,7 +4878,7 @@ yydefault: } case 176: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2686 + //line php5/php5.y:2688 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4885,7 +4886,7 @@ yydefault: } case 177: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2692 + //line php5/php5.y:2694 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4896,7 +4897,7 @@ yydefault: } case 178: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2704 + //line php5/php5.y:2706 { yyVAL.node = stmt.NewNop() @@ -4910,7 +4911,7 @@ yydefault: } case 179: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2717 + //line php5/php5.y:2719 { yyVAL.node = stmt.NewTraitAdaptationList(yyDollar[2].list) @@ -4924,7 +4925,7 @@ yydefault: } case 180: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2732 + //line php5/php5.y:2734 { yyVAL.list = nil @@ -4932,7 +4933,7 @@ yydefault: } case 181: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2738 + //line php5/php5.y:2740 { yyVAL.list = yyDollar[1].list @@ -4940,7 +4941,7 @@ yydefault: } case 182: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2747 + //line php5/php5.y:2749 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4948,7 +4949,7 @@ yydefault: } case 183: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2753 + //line php5/php5.y:2755 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -4956,7 +4957,7 @@ yydefault: } case 184: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2762 + //line php5/php5.y:2764 { yyVAL.node = yyDollar[1].node @@ -4968,7 +4969,7 @@ yydefault: } case 185: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2772 + //line php5/php5.y:2774 { yyVAL.node = yyDollar[1].node @@ -4980,7 +4981,7 @@ yydefault: } case 186: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2785 + //line php5/php5.y:2787 { yyVAL.node = stmt.NewTraitUsePrecedence(yyDollar[1].node, yyDollar[3].list) @@ -4994,7 +4995,7 @@ yydefault: } case 187: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2800 + //line php5/php5.y:2802 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -5002,7 +5003,7 @@ yydefault: } case 188: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2806 + //line php5/php5.y:2808 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -5013,7 +5014,7 @@ yydefault: } case 189: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2818 + //line php5/php5.y:2820 { name := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewTraitMethodRef(nil, name) @@ -5029,7 +5030,7 @@ yydefault: } case 190: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2832 + //line php5/php5.y:2834 { yyVAL.node = yyDollar[1].node @@ -5037,7 +5038,7 @@ yydefault: } case 191: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2841 + //line php5/php5.y:2843 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewTraitMethodRef(yyDollar[1].node, target) @@ -5054,7 +5055,7 @@ yydefault: } case 192: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2859 + //line php5/php5.y:2861 { alias := node.NewIdentifier(yyDollar[4].token.Value) yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, yyDollar[3].node, alias) @@ -5071,7 +5072,7 @@ yydefault: } case 193: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2874 + //line php5/php5.y:2876 { yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, yyDollar[3].node, nil) @@ -5085,7 +5086,7 @@ yydefault: } case 194: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2889 + //line php5/php5.y:2891 { yyVAL.node = nil @@ -5093,7 +5094,7 @@ yydefault: } case 195: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2895 + //line php5/php5.y:2897 { yyVAL.node = yyDollar[1].node @@ -5101,7 +5102,7 @@ yydefault: } case 196: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2904 + //line php5/php5.y:2906 { yyVAL.node = stmt.NewNop() @@ -5116,7 +5117,7 @@ yydefault: } case 197: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2917 + //line php5/php5.y:2919 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) @@ -5131,7 +5132,7 @@ yydefault: } case 198: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2933 + //line php5/php5.y:2935 { yyVAL.list = yyDollar[1].list @@ -5139,7 +5140,7 @@ yydefault: } case 199: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2939 + //line php5/php5.y:2941 { modifier := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.list = []node.Node{modifier} @@ -5154,7 +5155,7 @@ yydefault: } case 200: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2955 + //line php5/php5.y:2957 { yyVAL.list = nil @@ -5162,7 +5163,7 @@ yydefault: } case 201: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2961 + //line php5/php5.y:2963 { yyVAL.list = yyDollar[1].list @@ -5170,7 +5171,7 @@ yydefault: } case 202: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2970 + //line php5/php5.y:2972 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -5178,7 +5179,7 @@ yydefault: } case 203: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2976 + //line php5/php5.y:2978 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -5186,7 +5187,7 @@ yydefault: } case 204: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2985 + //line php5/php5.y:2987 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5200,7 +5201,7 @@ yydefault: } case 205: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2997 + //line php5/php5.y:2999 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5214,7 +5215,7 @@ yydefault: } case 206: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3009 + //line php5/php5.y:3011 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5228,7 +5229,7 @@ yydefault: } case 207: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3021 + //line php5/php5.y:3023 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5242,7 +5243,7 @@ yydefault: } case 208: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3033 + //line php5/php5.y:3035 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5256,7 +5257,7 @@ yydefault: } case 209: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3045 + //line php5/php5.y:3047 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5270,7 +5271,7 @@ yydefault: } case 210: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3060 + //line php5/php5.y:3062 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[3].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -5284,14 +5285,14 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) + yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 211: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:3079 + //line php5/php5.y:3081 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[3].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -5305,15 +5306,15 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) + yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yyDollar[4].token.Meta.SetTokenName(meta.EqualToken).AppendTo(property.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 212: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3099 + //line php5/php5.y:3101 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -5326,14 +5327,14 @@ yydefault: property.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 213: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3117 + //line php5/php5.y:3119 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -5346,15 +5347,15 @@ yydefault: property.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yyDollar[2].token.Meta.SetTokenName(meta.EqualToken).AppendTo(property.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 214: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:3139 + //line php5/php5.y:3141 { name := node.NewIdentifier(yyDollar[3].token.Value) constant := stmt.NewConstant(name, yyDollar[5].node, "") @@ -5377,7 +5378,7 @@ yydefault: } case 215: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3160 + //line php5/php5.y:3162 { name := node.NewIdentifier(yyDollar[2].token.Value) constant := stmt.NewConstant(name, yyDollar[4].node, "") @@ -5397,7 +5398,7 @@ yydefault: } case 216: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3181 + //line php5/php5.y:3183 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -5408,7 +5409,7 @@ yydefault: } case 217: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3190 + //line php5/php5.y:3192 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -5416,7 +5417,7 @@ yydefault: } case 218: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3200 + //line php5/php5.y:3202 { yyVAL.list = nil @@ -5424,7 +5425,7 @@ yydefault: } case 219: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3206 + //line php5/php5.y:3208 { yyVAL.list = yyDollar[1].list @@ -5432,7 +5433,7 @@ yydefault: } case 220: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3215 + //line php5/php5.y:3217 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -5443,7 +5444,7 @@ yydefault: } case 221: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3224 + //line php5/php5.y:3226 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -5451,7 +5452,7 @@ yydefault: } case 222: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3233 + //line php5/php5.y:3235 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) @@ -5459,7 +5460,7 @@ yydefault: } case 223: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3239 + //line php5/php5.y:3241 { yyVAL.list = yyDollar[1].list @@ -5467,7 +5468,7 @@ yydefault: } case 224: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3248 + //line php5/php5.y:3250 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yyVAL.list = append(yyDollar[1].list, fetch) @@ -5485,7 +5486,7 @@ yydefault: } case 225: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3264 + //line php5/php5.y:3266 { fetch := expr.NewArrayDimFetch(nil, yyDollar[2].node) yyVAL.list = []node.Node{fetch} @@ -5503,7 +5504,7 @@ yydefault: } case 226: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3283 + //line php5/php5.y:3285 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) @@ -5511,7 +5512,7 @@ yydefault: } case 227: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3289 + //line php5/php5.y:3291 { yyVAL.list = yyDollar[1].list @@ -5519,7 +5520,7 @@ yydefault: } case 228: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3295 + //line php5/php5.y:3297 { yyVAL.list = yyDollar[1].list @@ -5527,7 +5528,7 @@ yydefault: } case 229: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3304 + //line php5/php5.y:3306 { yyVAL.list = nil @@ -5535,7 +5536,7 @@ yydefault: } case 230: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3310 + //line php5/php5.y:3312 { yyVAL.list = yyDollar[1].list @@ -5543,7 +5544,7 @@ yydefault: } case 231: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3319 + //line php5/php5.y:3321 { if yyDollar[3].node != nil { @@ -5561,7 +5562,7 @@ yydefault: } case 232: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:3338 + //line php5/php5.y:3340 { list := expr.NewList(yyDollar[3].list) yyVAL.node = assign.NewAssign(list, yyDollar[6].node) @@ -5580,7 +5581,7 @@ yydefault: } case 233: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3355 + //line php5/php5.y:3357 { yyVAL.node = assign.NewAssign(yyDollar[1].node, yyDollar[3].node) @@ -5594,7 +5595,7 @@ yydefault: } case 234: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3367 + //line php5/php5.y:3369 { yyVAL.node = assign.NewReference(yyDollar[1].node, yyDollar[4].node) @@ -5609,7 +5610,7 @@ yydefault: } case 235: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:3380 + //line php5/php5.y:3382 { var _new *expr.New @@ -5637,7 +5638,7 @@ yydefault: } case 236: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3406 + //line php5/php5.y:3408 { yyVAL.node = expr.NewClone(yyDollar[2].node) @@ -5651,7 +5652,7 @@ yydefault: } case 237: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3418 + //line php5/php5.y:3420 { yyVAL.node = assign.NewPlus(yyDollar[1].node, yyDollar[3].node) @@ -5665,7 +5666,7 @@ yydefault: } case 238: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3430 + //line php5/php5.y:3432 { yyVAL.node = assign.NewMinus(yyDollar[1].node, yyDollar[3].node) @@ -5679,7 +5680,7 @@ yydefault: } case 239: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3442 + //line php5/php5.y:3444 { yyVAL.node = assign.NewMul(yyDollar[1].node, yyDollar[3].node) @@ -5693,7 +5694,7 @@ yydefault: } case 240: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3454 + //line php5/php5.y:3456 { yyVAL.node = assign.NewPow(yyDollar[1].node, yyDollar[3].node) @@ -5707,7 +5708,7 @@ yydefault: } case 241: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3466 + //line php5/php5.y:3468 { yyVAL.node = assign.NewDiv(yyDollar[1].node, yyDollar[3].node) @@ -5721,7 +5722,7 @@ yydefault: } case 242: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3478 + //line php5/php5.y:3480 { yyVAL.node = assign.NewConcat(yyDollar[1].node, yyDollar[3].node) @@ -5735,7 +5736,7 @@ yydefault: } case 243: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3490 + //line php5/php5.y:3492 { yyVAL.node = assign.NewMod(yyDollar[1].node, yyDollar[3].node) @@ -5749,7 +5750,7 @@ yydefault: } case 244: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3502 + //line php5/php5.y:3504 { yyVAL.node = assign.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) @@ -5763,7 +5764,7 @@ yydefault: } case 245: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3514 + //line php5/php5.y:3516 { yyVAL.node = assign.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) @@ -5777,7 +5778,7 @@ yydefault: } case 246: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3526 + //line php5/php5.y:3528 { yyVAL.node = assign.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) @@ -5791,7 +5792,7 @@ yydefault: } case 247: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3538 + //line php5/php5.y:3540 { yyVAL.node = assign.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) @@ -5805,7 +5806,7 @@ yydefault: } case 248: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3550 + //line php5/php5.y:3552 { yyVAL.node = assign.NewShiftRight(yyDollar[1].node, yyDollar[3].node) @@ -5819,7 +5820,7 @@ yydefault: } case 249: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3562 + //line php5/php5.y:3564 { yyVAL.node = expr.NewPostInc(yyDollar[1].node) @@ -5833,7 +5834,7 @@ yydefault: } case 250: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3574 + //line php5/php5.y:3576 { yyVAL.node = expr.NewPreInc(yyDollar[2].node) @@ -5847,7 +5848,7 @@ yydefault: } case 251: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3586 + //line php5/php5.y:3588 { yyVAL.node = expr.NewPostDec(yyDollar[1].node) @@ -5861,7 +5862,7 @@ yydefault: } case 252: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3598 + //line php5/php5.y:3600 { yyVAL.node = expr.NewPreDec(yyDollar[2].node) @@ -5875,7 +5876,7 @@ yydefault: } case 253: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3610 + //line php5/php5.y:3612 { yyVAL.node = binary.NewBooleanOr(yyDollar[1].node, yyDollar[3].node) @@ -5889,7 +5890,7 @@ yydefault: } case 254: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3622 + //line php5/php5.y:3624 { yyVAL.node = binary.NewBooleanAnd(yyDollar[1].node, yyDollar[3].node) @@ -5903,7 +5904,7 @@ yydefault: } case 255: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3634 + //line php5/php5.y:3636 { yyVAL.node = binary.NewLogicalOr(yyDollar[1].node, yyDollar[3].node) @@ -5917,7 +5918,7 @@ yydefault: } case 256: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3646 + //line php5/php5.y:3648 { yyVAL.node = binary.NewLogicalAnd(yyDollar[1].node, yyDollar[3].node) @@ -5931,7 +5932,7 @@ yydefault: } case 257: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3658 + //line php5/php5.y:3660 { yyVAL.node = binary.NewLogicalXor(yyDollar[1].node, yyDollar[3].node) @@ -5945,7 +5946,7 @@ yydefault: } case 258: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3670 + //line php5/php5.y:3672 { yyVAL.node = binary.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) @@ -5959,7 +5960,7 @@ yydefault: } case 259: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3682 + //line php5/php5.y:3684 { yyVAL.node = binary.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) @@ -5973,7 +5974,7 @@ yydefault: } case 260: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3694 + //line php5/php5.y:3696 { yyVAL.node = binary.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) @@ -5987,7 +5988,7 @@ yydefault: } case 261: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3706 + //line php5/php5.y:3708 { yyVAL.node = binary.NewConcat(yyDollar[1].node, yyDollar[3].node) @@ -6001,7 +6002,7 @@ yydefault: } case 262: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3718 + //line php5/php5.y:3720 { yyVAL.node = binary.NewPlus(yyDollar[1].node, yyDollar[3].node) @@ -6015,7 +6016,7 @@ yydefault: } case 263: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3730 + //line php5/php5.y:3732 { yyVAL.node = binary.NewMinus(yyDollar[1].node, yyDollar[3].node) @@ -6029,7 +6030,7 @@ yydefault: } case 264: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3742 + //line php5/php5.y:3744 { yyVAL.node = binary.NewMul(yyDollar[1].node, yyDollar[3].node) @@ -6043,7 +6044,7 @@ yydefault: } case 265: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3754 + //line php5/php5.y:3756 { yyVAL.node = binary.NewPow(yyDollar[1].node, yyDollar[3].node) @@ -6057,7 +6058,7 @@ yydefault: } case 266: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3766 + //line php5/php5.y:3768 { yyVAL.node = binary.NewDiv(yyDollar[1].node, yyDollar[3].node) @@ -6071,7 +6072,7 @@ yydefault: } case 267: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3778 + //line php5/php5.y:3780 { yyVAL.node = binary.NewMod(yyDollar[1].node, yyDollar[3].node) @@ -6085,7 +6086,7 @@ yydefault: } case 268: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3790 + //line php5/php5.y:3792 { yyVAL.node = binary.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) @@ -6099,7 +6100,7 @@ yydefault: } case 269: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3802 + //line php5/php5.y:3804 { yyVAL.node = binary.NewShiftRight(yyDollar[1].node, yyDollar[3].node) @@ -6113,7 +6114,7 @@ yydefault: } case 270: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3814 + //line php5/php5.y:3816 { yyVAL.node = expr.NewUnaryPlus(yyDollar[2].node) @@ -6127,7 +6128,7 @@ yydefault: } case 271: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3826 + //line php5/php5.y:3828 { yyVAL.node = expr.NewUnaryMinus(yyDollar[2].node) @@ -6141,7 +6142,7 @@ yydefault: } case 272: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3838 + //line php5/php5.y:3840 { yyVAL.node = expr.NewBooleanNot(yyDollar[2].node) @@ -6155,7 +6156,7 @@ yydefault: } case 273: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3850 + //line php5/php5.y:3852 { yyVAL.node = expr.NewBitwiseNot(yyDollar[2].node) @@ -6169,7 +6170,7 @@ yydefault: } case 274: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3862 + //line php5/php5.y:3864 { yyVAL.node = binary.NewIdentical(yyDollar[1].node, yyDollar[3].node) @@ -6183,7 +6184,7 @@ yydefault: } case 275: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3874 + //line php5/php5.y:3876 { yyVAL.node = binary.NewNotIdentical(yyDollar[1].node, yyDollar[3].node) @@ -6197,7 +6198,7 @@ yydefault: } case 276: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3886 + //line php5/php5.y:3888 { yyVAL.node = binary.NewEqual(yyDollar[1].node, yyDollar[3].node) @@ -6211,7 +6212,7 @@ yydefault: } case 277: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3898 + //line php5/php5.y:3900 { yyVAL.node = binary.NewNotEqual(yyDollar[1].node, yyDollar[3].node) @@ -6226,7 +6227,7 @@ yydefault: } case 278: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3911 + //line php5/php5.y:3913 { yyVAL.node = binary.NewSmaller(yyDollar[1].node, yyDollar[3].node) @@ -6240,7 +6241,7 @@ yydefault: } case 279: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3923 + //line php5/php5.y:3925 { yyVAL.node = binary.NewSmallerOrEqual(yyDollar[1].node, yyDollar[3].node) @@ -6254,7 +6255,7 @@ yydefault: } case 280: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3935 + //line php5/php5.y:3937 { yyVAL.node = binary.NewGreater(yyDollar[1].node, yyDollar[3].node) @@ -6268,7 +6269,7 @@ yydefault: } case 281: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3947 + //line php5/php5.y:3949 { yyVAL.node = binary.NewGreaterOrEqual(yyDollar[1].node, yyDollar[3].node) @@ -6282,7 +6283,7 @@ yydefault: } case 282: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3959 + //line php5/php5.y:3961 { yyVAL.node = expr.NewInstanceOf(yyDollar[1].node, yyDollar[3].node) @@ -6296,7 +6297,7 @@ yydefault: } case 283: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3971 + //line php5/php5.y:3973 { yyVAL.node = yyDollar[1].node @@ -6307,7 +6308,7 @@ yydefault: } case 284: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3980 + //line php5/php5.y:3982 { yyVAL.node = yyDollar[1].node @@ -6315,7 +6316,7 @@ yydefault: } case 285: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3986 + //line php5/php5.y:3988 { yyVAL.node = yyDollar[2].node @@ -6346,7 +6347,7 @@ yydefault: } case 286: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:4015 + //line php5/php5.y:4017 { yyVAL.node = expr.NewTernary(yyDollar[1].node, yyDollar[3].node, yyDollar[5].node) @@ -6361,7 +6362,7 @@ yydefault: } case 287: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4028 + //line php5/php5.y:4030 { yyVAL.node = expr.NewTernary(yyDollar[1].node, nil, yyDollar[4].node) @@ -6376,7 +6377,7 @@ yydefault: } case 288: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4041 + //line php5/php5.y:4043 { yyVAL.node = yyDollar[1].node @@ -6384,7 +6385,7 @@ yydefault: } case 289: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4047 + //line php5/php5.y:4049 { yyVAL.node = cast.NewInt(yyDollar[2].node) @@ -6399,7 +6400,7 @@ yydefault: } case 290: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4060 + //line php5/php5.y:4062 { yyVAL.node = cast.NewDouble(yyDollar[2].node) @@ -6414,7 +6415,7 @@ yydefault: } case 291: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4073 + //line php5/php5.y:4075 { yyVAL.node = cast.NewString(yyDollar[2].node) @@ -6429,7 +6430,7 @@ yydefault: } case 292: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4086 + //line php5/php5.y:4088 { yyVAL.node = cast.NewArray(yyDollar[2].node) @@ -6444,7 +6445,7 @@ yydefault: } case 293: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4099 + //line php5/php5.y:4101 { yyVAL.node = cast.NewObject(yyDollar[2].node) @@ -6459,7 +6460,7 @@ yydefault: } case 294: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4112 + //line php5/php5.y:4114 { yyVAL.node = cast.NewBool(yyDollar[2].node) @@ -6474,7 +6475,7 @@ yydefault: } case 295: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4125 + //line php5/php5.y:4127 { yyVAL.node = cast.NewUnset(yyDollar[2].node) @@ -6489,7 +6490,7 @@ yydefault: } case 296: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4138 + //line php5/php5.y:4140 { var e *expr.Exit if yyDollar[2].node != nil { @@ -6518,7 +6519,7 @@ yydefault: } case 297: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4165 + //line php5/php5.y:4167 { yyVAL.node = expr.NewErrorSuppress(yyDollar[2].node) @@ -6532,7 +6533,7 @@ yydefault: } case 298: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4177 + //line php5/php5.y:4179 { yyVAL.node = yyDollar[1].node @@ -6540,7 +6541,7 @@ yydefault: } case 299: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4183 + //line php5/php5.y:4185 { yyVAL.node = yyDollar[1].node @@ -6548,7 +6549,7 @@ yydefault: } case 300: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4189 + //line php5/php5.y:4191 { yyVAL.node = yyDollar[1].node @@ -6556,7 +6557,7 @@ yydefault: } case 301: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4195 + //line php5/php5.y:4197 { yyVAL.node = expr.NewShellExec(yyDollar[2].list) @@ -6571,7 +6572,7 @@ yydefault: } case 302: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4208 + //line php5/php5.y:4210 { yyVAL.node = expr.NewPrint(yyDollar[2].node) @@ -6585,7 +6586,7 @@ yydefault: } case 303: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4220 + //line php5/php5.y:4222 { yyVAL.node = expr.NewYield(nil, nil) @@ -6599,7 +6600,7 @@ yydefault: } case 304: yyDollar = yyS[yypt-9 : yypt+1] - //line php5/php5.y:4232 + //line php5/php5.y:4234 { yyVAL.node = expr.NewClosure(yyDollar[4].list, yyDollar[6].ClosureUse, nil, yyDollar[8].list, false, yyDollar[2].token != nil, "") @@ -6620,7 +6621,7 @@ yydefault: } case 305: yyDollar = yyS[yypt-10 : yypt+1] - //line php5/php5.y:4251 + //line php5/php5.y:4253 { yyVAL.node = expr.NewClosure(yyDollar[5].list, yyDollar[7].ClosureUse, nil, yyDollar[9].list, true, yyDollar[3].token != nil, "") @@ -6642,7 +6643,7 @@ yydefault: } case 306: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4274 + //line php5/php5.y:4276 { yyVAL.node = expr.NewYield(nil, yyDollar[2].node) @@ -6656,7 +6657,7 @@ yydefault: } case 307: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4286 + //line php5/php5.y:4288 { yyVAL.node = expr.NewYield(nil, yyDollar[2].node) @@ -6670,7 +6671,7 @@ yydefault: } case 308: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4298 + //line php5/php5.y:4300 { yyVAL.node = expr.NewYield(yyDollar[2].node, yyDollar[4].node) @@ -6685,7 +6686,7 @@ yydefault: } case 309: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4311 + //line php5/php5.y:4313 { yyVAL.node = expr.NewYield(yyDollar[2].node, yyDollar[4].node) @@ -6700,7 +6701,7 @@ yydefault: } case 310: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4327 + //line php5/php5.y:4329 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -6717,7 +6718,7 @@ yydefault: } case 311: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4342 + //line php5/php5.y:4344 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -6734,7 +6735,7 @@ yydefault: } case 312: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4357 + //line php5/php5.y:4359 { str := scalar.NewString(yyDollar[1].token.Value) yyVAL.node = expr.NewArrayDimFetch(str, yyDollar[3].node) @@ -6753,7 +6754,7 @@ yydefault: } case 313: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4374 + //line php5/php5.y:4376 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -6770,7 +6771,7 @@ yydefault: } case 314: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4392 + //line php5/php5.y:4394 { yyVAL.node = expr.NewArray(yyDollar[3].list) @@ -6786,7 +6787,7 @@ yydefault: } case 315: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4406 + //line php5/php5.y:4408 { yyVAL.node = expr.NewShortArray(yyDollar[2].list) @@ -6801,13 +6802,13 @@ yydefault: } case 316: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4422 + //line php5/php5.y:4424 { yyVAL.token = yyDollar[1].token } case 317: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:4429 + //line php5/php5.y:4431 { yyVAL.ClosureUse = nil @@ -6815,7 +6816,7 @@ yydefault: } case 318: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4435 + //line php5/php5.y:4437 { yyVAL.ClosureUse = expr.NewClosureUse(yyDollar[3].list) @@ -6831,7 +6832,7 @@ yydefault: } case 319: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4452 + //line php5/php5.y:4454 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[3].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -6843,14 +6844,14 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) + yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 320: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4469 + //line php5/php5.y:4471 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[4].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -6865,14 +6866,14 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(reference.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) + yyDollar[4].token.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 321: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4489 + //line php5/php5.y:4491 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -6883,14 +6884,14 @@ yydefault: variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 322: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4505 + //line php5/php5.y:4507 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[2].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -6904,14 +6905,14 @@ yydefault: // save comments yyDollar[1].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(reference.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) + yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 323: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4527 + //line php5/php5.y:4529 { name := name.NewName(yyDollar[1].list) yyVAL.node = expr.NewFunctionCall(name, yyDollar[2].node.(*node.ArgumentList)) @@ -6924,7 +6925,7 @@ yydefault: } case 324: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4538 + //line php5/php5.y:4540 { funcName := name.NewRelative(yyDollar[3].list) yyVAL.node = expr.NewFunctionCall(funcName, yyDollar[4].node.(*node.ArgumentList)) @@ -6941,7 +6942,7 @@ yydefault: } case 325: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4553 + //line php5/php5.y:4555 { funcName := name.NewFullyQualified(yyDollar[2].list) yyVAL.node = expr.NewFunctionCall(funcName, yyDollar[3].node.(*node.ArgumentList)) @@ -6957,7 +6958,7 @@ yydefault: } case 326: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4567 + //line php5/php5.y:4569 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -6971,7 +6972,7 @@ yydefault: } case 327: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4579 + //line php5/php5.y:4581 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -6985,7 +6986,7 @@ yydefault: } case 328: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4591 + //line php5/php5.y:4593 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -6999,7 +7000,7 @@ yydefault: } case 329: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4603 + //line php5/php5.y:4605 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -7013,7 +7014,7 @@ yydefault: } case 330: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4615 + //line php5/php5.y:4617 { yyVAL.node = expr.NewFunctionCall(yyDollar[1].node, yyDollar[2].node.(*node.ArgumentList)) @@ -7024,7 +7025,7 @@ yydefault: } case 331: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4627 + //line php5/php5.y:4629 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -7038,7 +7039,7 @@ yydefault: } case 332: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4639 + //line php5/php5.y:4641 { yyVAL.node = name.NewName(yyDollar[1].list) @@ -7049,7 +7050,7 @@ yydefault: } case 333: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4648 + //line php5/php5.y:4650 { yyVAL.node = name.NewRelative(yyDollar[3].list) @@ -7064,7 +7065,7 @@ yydefault: } case 334: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4661 + //line php5/php5.y:4663 { yyVAL.node = name.NewFullyQualified(yyDollar[2].list) @@ -7078,7 +7079,7 @@ yydefault: } case 335: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4676 + //line php5/php5.y:4678 { yyVAL.node = name.NewName(yyDollar[1].list) @@ -7089,7 +7090,7 @@ yydefault: } case 336: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4685 + //line php5/php5.y:4687 { yyVAL.node = name.NewRelative(yyDollar[3].list) @@ -7104,7 +7105,7 @@ yydefault: } case 337: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4698 + //line php5/php5.y:4700 { yyVAL.node = name.NewFullyQualified(yyDollar[2].list) @@ -7118,7 +7119,7 @@ yydefault: } case 338: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4713 + //line php5/php5.y:4715 { yyVAL.node = yyDollar[1].node @@ -7126,7 +7127,7 @@ yydefault: } case 339: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4719 + //line php5/php5.y:4721 { yyVAL.node = yyDollar[1].node @@ -7134,7 +7135,7 @@ yydefault: } case 340: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4728 + //line php5/php5.y:4730 { yyVAL.node = yyDollar[1].node @@ -7173,7 +7174,7 @@ yydefault: } case 341: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4765 + //line php5/php5.y:4767 { yyVAL.node = yyDollar[1].node @@ -7181,7 +7182,7 @@ yydefault: } case 342: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4775 + //line php5/php5.y:4777 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) @@ -7189,7 +7190,7 @@ yydefault: } case 343: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:4781 + //line php5/php5.y:4783 { yyVAL.list = []node.Node{} @@ -7197,7 +7198,7 @@ yydefault: } case 344: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4791 + //line php5/php5.y:4793 { yyVAL.list = yyDollar[2].list @@ -7208,7 +7209,7 @@ yydefault: } case 345: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:4803 + //line php5/php5.y:4805 { yyVAL.node = nil @@ -7216,7 +7217,7 @@ yydefault: } case 346: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4809 + //line php5/php5.y:4811 { yyVAL.node = expr.NewExit(nil) @@ -7233,7 +7234,7 @@ yydefault: } case 347: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4824 + //line php5/php5.y:4826 { yyVAL.node = expr.NewExit(yyDollar[1].node) @@ -7252,7 +7253,7 @@ yydefault: } case 348: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:4844 + //line php5/php5.y:4846 { yyVAL.list = []node.Node{} @@ -7260,7 +7261,7 @@ yydefault: } case 349: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4850 + //line php5/php5.y:4852 { yyVAL.list = []node.Node{scalar.NewEncapsedStringPart(yyDollar[1].token.Value)} @@ -7268,7 +7269,7 @@ yydefault: } case 350: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4856 + //line php5/php5.y:4858 { yyVAL.list = yyDollar[1].list @@ -7276,7 +7277,7 @@ yydefault: } case 351: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:4865 + //line php5/php5.y:4867 { yyVAL.node = nil @@ -7284,7 +7285,7 @@ yydefault: } case 352: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4871 + //line php5/php5.y:4873 { yyVAL.node = yyDollar[1].node @@ -7292,7 +7293,7 @@ yydefault: } case 353: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4880 + //line php5/php5.y:4882 { yyVAL.node = scalar.NewLnumber(yyDollar[1].token.Value) @@ -7306,7 +7307,7 @@ yydefault: } case 354: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4892 + //line php5/php5.y:4894 { yyVAL.node = scalar.NewDnumber(yyDollar[1].token.Value) @@ -7320,7 +7321,7 @@ yydefault: } case 355: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4904 + //line php5/php5.y:4906 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) @@ -7334,7 +7335,7 @@ yydefault: } case 356: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4916 + //line php5/php5.y:4918 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7348,7 +7349,7 @@ yydefault: } case 357: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4928 + //line php5/php5.y:4930 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7362,7 +7363,7 @@ yydefault: } case 358: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4940 + //line php5/php5.y:4942 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7376,7 +7377,7 @@ yydefault: } case 359: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4952 + //line php5/php5.y:4954 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7390,7 +7391,7 @@ yydefault: } case 360: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4964 + //line php5/php5.y:4966 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7404,7 +7405,7 @@ yydefault: } case 361: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4976 + //line php5/php5.y:4978 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7418,7 +7419,7 @@ yydefault: } case 362: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4988 + //line php5/php5.y:4990 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7432,7 +7433,7 @@ yydefault: } case 363: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5000 + //line php5/php5.y:5002 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, []node.Node{encapsed}) @@ -7448,7 +7449,7 @@ yydefault: } case 364: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5014 + //line php5/php5.y:5016 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, nil) @@ -7462,7 +7463,7 @@ yydefault: } case 365: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5029 + //line php5/php5.y:5031 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -7479,7 +7480,7 @@ yydefault: } case 366: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5047 + //line php5/php5.y:5049 { yyVAL.node = yyDollar[1].node @@ -7487,7 +7488,7 @@ yydefault: } case 367: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5056 + //line php5/php5.y:5058 { yyVAL.node = yyDollar[1].node @@ -7495,7 +7496,7 @@ yydefault: } case 368: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5062 + //line php5/php5.y:5064 { yyVAL.node = yyDollar[1].node @@ -7503,7 +7504,7 @@ yydefault: } case 369: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5068 + //line php5/php5.y:5070 { name := name.NewName(yyDollar[1].list) yyVAL.node = expr.NewConstFetch(name) @@ -7516,7 +7517,7 @@ yydefault: } case 370: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5079 + //line php5/php5.y:5081 { name := name.NewRelative(yyDollar[3].list) yyVAL.node = expr.NewConstFetch(name) @@ -7533,7 +7534,7 @@ yydefault: } case 371: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5094 + //line php5/php5.y:5096 { name := name.NewFullyQualified(yyDollar[2].list) yyVAL.node = expr.NewConstFetch(name) @@ -7549,7 +7550,7 @@ yydefault: } case 372: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:5108 + //line php5/php5.y:5110 { yyVAL.node = expr.NewArray(yyDollar[3].list) @@ -7565,7 +7566,7 @@ yydefault: } case 373: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5122 + //line php5/php5.y:5124 { yyVAL.node = expr.NewShortArray(yyDollar[2].list) @@ -7580,7 +7581,7 @@ yydefault: } case 374: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5135 + //line php5/php5.y:5137 { yyVAL.node = yyDollar[1].node @@ -7588,7 +7589,7 @@ yydefault: } case 375: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5141 + //line php5/php5.y:5143 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7602,7 +7603,7 @@ yydefault: } case 376: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5153 + //line php5/php5.y:5155 { yyVAL.node = yyDollar[1].node @@ -7610,7 +7611,7 @@ yydefault: } case 377: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:5162 + //line php5/php5.y:5164 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -7627,7 +7628,7 @@ yydefault: } case 378: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5177 + //line php5/php5.y:5179 { yyVAL.node = binary.NewPlus(yyDollar[1].node, yyDollar[3].node) @@ -7641,7 +7642,7 @@ yydefault: } case 379: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5189 + //line php5/php5.y:5191 { yyVAL.node = binary.NewMinus(yyDollar[1].node, yyDollar[3].node) @@ -7655,7 +7656,7 @@ yydefault: } case 380: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5201 + //line php5/php5.y:5203 { yyVAL.node = binary.NewMul(yyDollar[1].node, yyDollar[3].node) @@ -7669,7 +7670,7 @@ yydefault: } case 381: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5213 + //line php5/php5.y:5215 { yyVAL.node = binary.NewPow(yyDollar[1].node, yyDollar[3].node) @@ -7683,7 +7684,7 @@ yydefault: } case 382: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5225 + //line php5/php5.y:5227 { yyVAL.node = binary.NewDiv(yyDollar[1].node, yyDollar[3].node) @@ -7697,7 +7698,7 @@ yydefault: } case 383: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5237 + //line php5/php5.y:5239 { yyVAL.node = binary.NewMod(yyDollar[1].node, yyDollar[3].node) @@ -7711,7 +7712,7 @@ yydefault: } case 384: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5249 + //line php5/php5.y:5251 { yyVAL.node = expr.NewBooleanNot(yyDollar[2].node) @@ -7725,7 +7726,7 @@ yydefault: } case 385: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5261 + //line php5/php5.y:5263 { yyVAL.node = expr.NewBitwiseNot(yyDollar[2].node) @@ -7739,7 +7740,7 @@ yydefault: } case 386: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5273 + //line php5/php5.y:5275 { yyVAL.node = binary.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) @@ -7753,7 +7754,7 @@ yydefault: } case 387: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5285 + //line php5/php5.y:5287 { yyVAL.node = binary.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) @@ -7767,7 +7768,7 @@ yydefault: } case 388: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5297 + //line php5/php5.y:5299 { yyVAL.node = binary.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) @@ -7781,7 +7782,7 @@ yydefault: } case 389: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5309 + //line php5/php5.y:5311 { yyVAL.node = binary.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) @@ -7795,7 +7796,7 @@ yydefault: } case 390: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5321 + //line php5/php5.y:5323 { yyVAL.node = binary.NewShiftRight(yyDollar[1].node, yyDollar[3].node) @@ -7809,7 +7810,7 @@ yydefault: } case 391: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5333 + //line php5/php5.y:5335 { yyVAL.node = binary.NewConcat(yyDollar[1].node, yyDollar[3].node) @@ -7823,7 +7824,7 @@ yydefault: } case 392: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5345 + //line php5/php5.y:5347 { yyVAL.node = binary.NewLogicalXor(yyDollar[1].node, yyDollar[3].node) @@ -7837,7 +7838,7 @@ yydefault: } case 393: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5357 + //line php5/php5.y:5359 { yyVAL.node = binary.NewLogicalAnd(yyDollar[1].node, yyDollar[3].node) @@ -7851,7 +7852,7 @@ yydefault: } case 394: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5369 + //line php5/php5.y:5371 { yyVAL.node = binary.NewLogicalOr(yyDollar[1].node, yyDollar[3].node) @@ -7865,7 +7866,7 @@ yydefault: } case 395: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5381 + //line php5/php5.y:5383 { yyVAL.node = binary.NewBooleanAnd(yyDollar[1].node, yyDollar[3].node) @@ -7879,7 +7880,7 @@ yydefault: } case 396: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5393 + //line php5/php5.y:5395 { yyVAL.node = binary.NewBooleanOr(yyDollar[1].node, yyDollar[3].node) @@ -7893,7 +7894,7 @@ yydefault: } case 397: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5405 + //line php5/php5.y:5407 { yyVAL.node = binary.NewIdentical(yyDollar[1].node, yyDollar[3].node) @@ -7907,7 +7908,7 @@ yydefault: } case 398: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5417 + //line php5/php5.y:5419 { yyVAL.node = binary.NewNotIdentical(yyDollar[1].node, yyDollar[3].node) @@ -7921,7 +7922,7 @@ yydefault: } case 399: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5429 + //line php5/php5.y:5431 { yyVAL.node = binary.NewEqual(yyDollar[1].node, yyDollar[3].node) @@ -7935,7 +7936,7 @@ yydefault: } case 400: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5441 + //line php5/php5.y:5443 { yyVAL.node = binary.NewNotEqual(yyDollar[1].node, yyDollar[3].node) @@ -7950,7 +7951,7 @@ yydefault: } case 401: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5454 + //line php5/php5.y:5456 { yyVAL.node = binary.NewSmaller(yyDollar[1].node, yyDollar[3].node) @@ -7964,7 +7965,7 @@ yydefault: } case 402: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5466 + //line php5/php5.y:5468 { yyVAL.node = binary.NewGreater(yyDollar[1].node, yyDollar[3].node) @@ -7978,7 +7979,7 @@ yydefault: } case 403: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5478 + //line php5/php5.y:5480 { yyVAL.node = binary.NewSmallerOrEqual(yyDollar[1].node, yyDollar[3].node) @@ -7992,7 +7993,7 @@ yydefault: } case 404: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5490 + //line php5/php5.y:5492 { yyVAL.node = binary.NewGreaterOrEqual(yyDollar[1].node, yyDollar[3].node) @@ -8006,7 +8007,7 @@ yydefault: } case 405: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:5502 + //line php5/php5.y:5504 { yyVAL.node = expr.NewTernary(yyDollar[1].node, nil, yyDollar[4].node) @@ -8021,7 +8022,7 @@ yydefault: } case 406: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:5515 + //line php5/php5.y:5517 { yyVAL.node = expr.NewTernary(yyDollar[1].node, yyDollar[3].node, yyDollar[5].node) @@ -8036,7 +8037,7 @@ yydefault: } case 407: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5528 + //line php5/php5.y:5530 { yyVAL.node = expr.NewUnaryPlus(yyDollar[2].node) @@ -8050,7 +8051,7 @@ yydefault: } case 408: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5540 + //line php5/php5.y:5542 { yyVAL.node = expr.NewUnaryMinus(yyDollar[2].node) @@ -8064,7 +8065,7 @@ yydefault: } case 409: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5552 + //line php5/php5.y:5554 { yyVAL.node = yyDollar[2].node @@ -8076,7 +8077,7 @@ yydefault: } case 410: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5565 + //line php5/php5.y:5567 { yyVAL.node = yyDollar[1].node @@ -8084,7 +8085,7 @@ yydefault: } case 411: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5571 + //line php5/php5.y:5573 { name := name.NewName(yyDollar[1].list) yyVAL.node = expr.NewConstFetch(name) @@ -8097,7 +8098,7 @@ yydefault: } case 412: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5582 + //line php5/php5.y:5584 { name := name.NewRelative(yyDollar[3].list) yyVAL.node = expr.NewConstFetch(name) @@ -8112,7 +8113,7 @@ yydefault: } case 413: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5595 + //line php5/php5.y:5597 { name := name.NewFullyQualified(yyDollar[2].list) yyVAL.node = expr.NewConstFetch(name) @@ -8128,7 +8129,7 @@ yydefault: } case 414: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5612 + //line php5/php5.y:5614 { name := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = expr.NewVariable(name) @@ -8139,13 +8140,13 @@ yydefault: // save comments yyDollar[1].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) - yylex.(*Parser).appendMeta(yyVAL.node, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) + yylex.(*Parser).appendMeta(yyVAL.node, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 415: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5627 + //line php5/php5.y:5629 { yyVAL.node = yyDollar[1].node @@ -8153,7 +8154,7 @@ yydefault: } case 416: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5633 + //line php5/php5.y:5635 { yyVAL.node = yyDollar[1].node @@ -8161,7 +8162,7 @@ yydefault: } case 417: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5639 + //line php5/php5.y:5641 { yyVAL.node = yyDollar[1].node @@ -8169,7 +8170,7 @@ yydefault: } case 418: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5645 + //line php5/php5.y:5647 { yyVAL.node = scalar.NewEncapsed(yyDollar[2].list) @@ -8183,7 +8184,7 @@ yydefault: } case 419: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5657 + //line php5/php5.y:5659 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, yyDollar[2].list) @@ -8197,7 +8198,7 @@ yydefault: } case 420: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5669 + //line php5/php5.y:5671 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -8211,7 +8212,7 @@ yydefault: } case 421: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:5684 + //line php5/php5.y:5686 { yyVAL.list = nil @@ -8219,7 +8220,7 @@ yydefault: } case 422: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5690 + //line php5/php5.y:5692 { yyVAL.list = yyDollar[1].list @@ -8232,19 +8233,19 @@ yydefault: } case 423: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:5704 + //line php5/php5.y:5706 { yyVAL.token = nil } case 424: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5708 + //line php5/php5.y:5710 { yyVAL.token = yyDollar[1].token } case 425: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:5715 + //line php5/php5.y:5717 { arrayItem := expr.NewArrayItem(yyDollar[3].node, yyDollar[5].node) yyVAL.list = append(yyDollar[1].list, arrayItem) @@ -8260,7 +8261,7 @@ yydefault: } case 426: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5729 + //line php5/php5.y:5731 { arrayItem := expr.NewArrayItem(nil, yyDollar[3].node) yyVAL.list = append(yyDollar[1].list, arrayItem) @@ -8275,7 +8276,7 @@ yydefault: } case 427: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5742 + //line php5/php5.y:5744 { arrayItem := expr.NewArrayItem(yyDollar[1].node, yyDollar[3].node) yyVAL.list = []node.Node{arrayItem} @@ -8290,7 +8291,7 @@ yydefault: } case 428: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5755 + //line php5/php5.y:5757 { arrayItem := expr.NewArrayItem(nil, yyDollar[1].node) yyVAL.list = []node.Node{arrayItem} @@ -8302,7 +8303,7 @@ yydefault: } case 429: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5768 + //line php5/php5.y:5770 { yyVAL.node = yyDollar[1].node @@ -8310,7 +8311,7 @@ yydefault: } case 430: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5774 + //line php5/php5.y:5776 { yyVAL.node = yyDollar[1].node @@ -8318,7 +8319,7 @@ yydefault: } case 431: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5783 + //line php5/php5.y:5785 { yyVAL.node = yyDollar[2].node @@ -8332,7 +8333,7 @@ yydefault: } case 432: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5795 + //line php5/php5.y:5797 { yyVAL.node = yyDollar[2].node @@ -8346,7 +8347,7 @@ yydefault: } case 433: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5811 + //line php5/php5.y:5813 { yyVAL.node = yyDollar[1].node @@ -8354,7 +8355,7 @@ yydefault: } case 434: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5821 + //line php5/php5.y:5823 { yyVAL.node = yyDollar[1].node @@ -8362,7 +8363,7 @@ yydefault: } case 435: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5830 + //line php5/php5.y:5832 { yyVAL.node = yyDollar[1].node @@ -8370,7 +8371,7 @@ yydefault: } case 436: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:5839 + //line php5/php5.y:5841 { yyVAL.node = yyDollar[1].node @@ -8424,7 +8425,7 @@ yydefault: } case 437: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5891 + //line php5/php5.y:5893 { yyVAL.node = yyDollar[1].node @@ -8432,7 +8433,7 @@ yydefault: } case 438: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5900 + //line php5/php5.y:5902 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) @@ -8440,7 +8441,7 @@ yydefault: } case 439: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:5906 + //line php5/php5.y:5908 { yyVAL.list = []node.Node{} @@ -8448,7 +8449,7 @@ yydefault: } case 440: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5916 + //line php5/php5.y:5918 { if yyDollar[3].list != nil { yyDollar[3].list[0].(*expr.MethodCall).Method = yyDollar[2].list[len(yyDollar[2].list)-1].(*expr.PropertyFetch).Property @@ -8464,7 +8465,7 @@ yydefault: } case 441: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:5933 + //line php5/php5.y:5935 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yyVAL.list = append(yyDollar[1].list, fetch) @@ -8482,7 +8483,7 @@ yydefault: } case 442: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:5949 + //line php5/php5.y:5951 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yyVAL.list = []node.Node{yyDollar[1].node, fetch} @@ -8500,7 +8501,7 @@ yydefault: } case 443: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5968 + //line php5/php5.y:5970 { yyVAL.node = expr.NewMethodCall(nil, nil, yyDollar[1].node.(*node.ArgumentList)) @@ -8511,7 +8512,7 @@ yydefault: } case 444: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5980 + //line php5/php5.y:5982 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -8519,7 +8520,7 @@ yydefault: } case 445: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5986 + //line php5/php5.y:5988 { yyVAL.list = yyDollar[1].list @@ -8527,7 +8528,7 @@ yydefault: } case 446: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:5992 + //line php5/php5.y:5994 { yyVAL.list = nil @@ -8535,7 +8536,7 @@ yydefault: } case 447: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6001 + //line php5/php5.y:6003 { yyVAL.node = yyDollar[1].node @@ -8543,7 +8544,7 @@ yydefault: } case 448: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6007 + //line php5/php5.y:6009 { yyDollar[1].simpleIndirectReference.last.SetVarName(yyDollar[2].node) @@ -8557,7 +8558,7 @@ yydefault: } case 449: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6022 + //line php5/php5.y:6024 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -8571,7 +8572,7 @@ yydefault: } case 450: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6034 + //line php5/php5.y:6036 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -8585,7 +8586,7 @@ yydefault: } case 451: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6049 + //line php5/php5.y:6051 { yyVAL.node = yyDollar[1].node @@ -8593,7 +8594,7 @@ yydefault: } case 452: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6058 + //line php5/php5.y:6060 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -8610,7 +8611,7 @@ yydefault: } case 453: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6073 + //line php5/php5.y:6075 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -8627,7 +8628,7 @@ yydefault: } case 454: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6091 + //line php5/php5.y:6093 { yyVAL.node = yyDollar[1].node @@ -8635,7 +8636,7 @@ yydefault: } case 455: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6097 + //line php5/php5.y:6099 { yyVAL.node = yyDollar[1].node @@ -8643,7 +8644,7 @@ yydefault: } case 456: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6103 + //line php5/php5.y:6105 { yyVAL.node = yyDollar[1].node @@ -8651,7 +8652,7 @@ yydefault: } case 457: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6113 + //line php5/php5.y:6115 { yyVAL.node = yyDollar[1].node @@ -8659,7 +8660,7 @@ yydefault: } case 458: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6119 + //line php5/php5.y:6121 { yyDollar[1].simpleIndirectReference.last.SetVarName(yyDollar[2].node) @@ -8673,7 +8674,7 @@ yydefault: } case 459: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6131 + //line php5/php5.y:6133 { yyVAL.node = yyDollar[1].node @@ -8681,7 +8682,7 @@ yydefault: } case 460: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6140 + //line php5/php5.y:6142 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -8698,7 +8699,7 @@ yydefault: } case 461: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6155 + //line php5/php5.y:6157 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -8715,7 +8716,7 @@ yydefault: } case 462: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6170 + //line php5/php5.y:6172 { yyVAL.node = yyDollar[1].node @@ -8723,7 +8724,7 @@ yydefault: } case 463: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6180 + //line php5/php5.y:6182 { name := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(name) @@ -8733,14 +8734,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.VariableToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMeta(yyVAL.node, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMeta(yyVAL.node, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 464: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6195 + //line php5/php5.y:6197 { yyVAL.node = expr.NewVariable(yyDollar[3].node) @@ -8748,18 +8749,18 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.DollarToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.DollarToken) - yyDollar[2].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.OpenCurlyBracesToken) - yyDollar[4].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.CloseCurlyBracesToken) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) + yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.NodeStart) + yyDollar[4].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 465: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:6215 + //line php5/php5.y:6217 { yyVAL.node = nil @@ -8767,7 +8768,7 @@ yydefault: } case 466: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6221 + //line php5/php5.y:6223 { yyVAL.node = yyDollar[1].node @@ -8775,7 +8776,7 @@ yydefault: } case 467: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6231 + //line php5/php5.y:6233 { yyVAL.list = yyDollar[1].list @@ -8783,7 +8784,7 @@ yydefault: } case 468: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6237 + //line php5/php5.y:6239 { fetch := expr.NewPropertyFetch(nil, yyDollar[1].node) yyVAL.list = []node.Node{fetch} @@ -8795,7 +8796,7 @@ yydefault: } case 469: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6250 + //line php5/php5.y:6252 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yyVAL.list = append(yyDollar[1].list, fetch) @@ -8813,7 +8814,7 @@ yydefault: } case 470: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6266 + //line php5/php5.y:6268 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yyVAL.list = append(yyDollar[1].list, fetch) @@ -8831,7 +8832,7 @@ yydefault: } case 471: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6282 + //line php5/php5.y:6284 { fetch := expr.NewPropertyFetch(nil, yyDollar[1].node) yyVAL.list = []node.Node{fetch} @@ -8843,7 +8844,7 @@ yydefault: } case 472: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6295 + //line php5/php5.y:6297 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -8857,7 +8858,7 @@ yydefault: } case 473: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6307 + //line php5/php5.y:6309 { yyVAL.node = yyDollar[2].node @@ -8874,7 +8875,7 @@ yydefault: } case 474: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6325 + //line php5/php5.y:6327 { n := expr.NewVariable(nil) yyVAL.simpleIndirectReference = simpleIndirectReference{[]*expr.Variable{n}, n} @@ -8883,14 +8884,14 @@ yydefault: n.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.DollarToken).AppendTo(n.GetMeta()) - yylex.(*Parser).appendMetaToken(n, yyDollar[1].token, meta.DollarToken) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(n.GetMeta()) + yylex.(*Parser).appendMetaToken(n, yyDollar[1].token, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 475: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6339 + //line php5/php5.y:6341 { n := expr.NewVariable(nil) @@ -8903,14 +8904,14 @@ yydefault: n.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.DollarToken).AppendTo(n.GetMeta()) - yylex.(*Parser).appendMetaToken(n, yyDollar[2].token, meta.DollarToken) + yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(n.GetMeta()) + yylex.(*Parser).appendMetaToken(n, yyDollar[2].token, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 476: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6360 + //line php5/php5.y:6362 { if len(yyDollar[1].list) == 0 { yyDollar[1].list = []node.Node{expr.NewArrayItem(nil, nil)} @@ -8925,7 +8926,7 @@ yydefault: } case 477: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6373 + //line php5/php5.y:6375 { if yyDollar[1].node.(*expr.ArrayItem).Key == nil && yyDollar[1].node.(*expr.ArrayItem).Val == nil { yyVAL.list = []node.Node{} @@ -8937,7 +8938,7 @@ yydefault: } case 478: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6387 + //line php5/php5.y:6389 { yyVAL.node = expr.NewArrayItem(nil, yyDollar[1].node) @@ -8948,7 +8949,7 @@ yydefault: } case 479: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6396 + //line php5/php5.y:6398 { item := expr.NewList(yyDollar[3].list) yyVAL.node = expr.NewArrayItem(nil, item) @@ -8966,7 +8967,7 @@ yydefault: } case 480: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:6412 + //line php5/php5.y:6414 { yyVAL.node = expr.NewArrayItem(nil, nil) @@ -8974,7 +8975,7 @@ yydefault: } case 481: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:6422 + //line php5/php5.y:6424 { yyVAL.list = []node.Node{} @@ -8982,7 +8983,7 @@ yydefault: } case 482: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6428 + //line php5/php5.y:6430 { yyVAL.list = yyDollar[1].list @@ -8999,7 +9000,7 @@ yydefault: } case 483: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:6446 + //line php5/php5.y:6448 { arrayItem := expr.NewArrayItem(yyDollar[3].node, yyDollar[5].node) yyVAL.list = append(yyDollar[1].list, arrayItem) @@ -9015,7 +9016,7 @@ yydefault: } case 484: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6460 + //line php5/php5.y:6462 { arrayItem := expr.NewArrayItem(nil, yyDollar[3].node) yyVAL.list = append(yyDollar[1].list, arrayItem) @@ -9030,7 +9031,7 @@ yydefault: } case 485: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6473 + //line php5/php5.y:6475 { arrayItem := expr.NewArrayItem(yyDollar[1].node, yyDollar[3].node) yyVAL.list = []node.Node{arrayItem} @@ -9045,7 +9046,7 @@ yydefault: } case 486: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6486 + //line php5/php5.y:6488 { arrayItem := expr.NewArrayItem(nil, yyDollar[1].node) yyVAL.list = []node.Node{arrayItem} @@ -9057,7 +9058,7 @@ yydefault: } case 487: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:6496 + //line php5/php5.y:6498 { reference := expr.NewReference(yyDollar[6].node) arrayItem := expr.NewArrayItem(yyDollar[3].node, reference) @@ -9076,7 +9077,7 @@ yydefault: } case 488: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6513 + //line php5/php5.y:6515 { reference := expr.NewReference(yyDollar[4].node) arrayItem := expr.NewArrayItem(nil, reference) @@ -9094,7 +9095,7 @@ yydefault: } case 489: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6529 + //line php5/php5.y:6531 { reference := expr.NewReference(yyDollar[4].node) arrayItem := expr.NewArrayItem(yyDollar[1].node, reference) @@ -9112,7 +9113,7 @@ yydefault: } case 490: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6545 + //line php5/php5.y:6547 { reference := expr.NewReference(yyDollar[2].node) arrayItem := expr.NewArrayItem(nil, reference) @@ -9129,7 +9130,7 @@ yydefault: } case 491: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6563 + //line php5/php5.y:6565 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -9137,7 +9138,7 @@ yydefault: } case 492: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6569 + //line php5/php5.y:6571 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yyVAL.list = append(yyDollar[1].list, encapsed) @@ -9152,7 +9153,7 @@ yydefault: } case 493: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6582 + //line php5/php5.y:6584 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -9160,7 +9161,7 @@ yydefault: } case 494: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6588 + //line php5/php5.y:6590 { encapsed := scalar.NewEncapsedStringPart(yyDollar[1].token.Value) yyVAL.list = []node.Node{encapsed, yyDollar[2].node} @@ -9175,7 +9176,7 @@ yydefault: } case 495: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6604 + //line php5/php5.y:6606 { name := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(name) @@ -9185,14 +9186,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.VariableToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMeta(yyVAL.node, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMeta(yyVAL.node, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 496: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6619 + //line php5/php5.y:6621 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -9204,8 +9205,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yyDollar[2].token.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.OpenSquareBracket) yyDollar[4].token.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(yyVAL.node.GetMeta()) @@ -9215,7 +9216,7 @@ yydefault: } case 497: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6640 + //line php5/php5.y:6642 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -9229,8 +9230,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yyDollar[2].token.Meta.SetTokenName(meta.ObjectOperatorToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(fetch.GetMeta()) @@ -9238,7 +9239,7 @@ yydefault: } case 498: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6661 + //line php5/php5.y:6663 { variable := expr.NewVariable(yyDollar[2].node) @@ -9248,16 +9249,16 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.DollarOpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.DollarOpenCurlyBracesToken) - yyDollar[3].token.Meta.SetTokenName(meta.DollarCloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.DollarCloseCurlyBracesToken) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) + yyDollar[3].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 499: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6678 + //line php5/php5.y:6680 { name := node.NewIdentifier(yyDollar[2].token.Value) variable := expr.NewVariable(name) @@ -9269,17 +9270,17 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.DollarOpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.DollarOpenCurlyBracesToken) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) yyDollar[2].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.DollarCloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.DollarCloseCurlyBracesToken) + yyDollar[3].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 500: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:6698 + //line php5/php5.y:6700 { identifier := node.NewIdentifier(yyDollar[2].token.Value) variable := expr.NewVariable(identifier) @@ -9305,13 +9306,13 @@ yydefault: } case 501: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6722 + //line php5/php5.y:6724 { yyVAL.node = yyDollar[2].node // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).prependMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) yyDollar[3].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.NodeEnd) @@ -9319,7 +9320,7 @@ yydefault: } case 502: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6737 + //line php5/php5.y:6739 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) @@ -9333,7 +9334,7 @@ yydefault: } case 503: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6749 + //line php5/php5.y:6751 { // TODO: add option to handle 64 bit integer if _, err := strconv.Atoi(yyDollar[1].token.Value); err == nil { @@ -9352,7 +9353,7 @@ yydefault: } case 504: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6766 + //line php5/php5.y:6768 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(identifier) @@ -9362,14 +9363,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.VariableToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMeta(yyVAL.node, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMeta(yyVAL.node, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 505: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6784 + //line php5/php5.y:6786 { yyVAL.node = expr.NewIsset(yyDollar[3].list) @@ -9385,7 +9386,7 @@ yydefault: } case 506: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6798 + //line php5/php5.y:6800 { yyVAL.node = expr.NewEmpty(yyDollar[3].node) @@ -9401,7 +9402,7 @@ yydefault: } case 507: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6812 + //line php5/php5.y:6814 { yyVAL.node = expr.NewEmpty(yyDollar[3].node) @@ -9417,7 +9418,7 @@ yydefault: } case 508: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6826 + //line php5/php5.y:6828 { yyVAL.node = expr.NewInclude(yyDollar[2].node) @@ -9431,7 +9432,7 @@ yydefault: } case 509: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6838 + //line php5/php5.y:6840 { yyVAL.node = expr.NewIncludeOnce(yyDollar[2].node) @@ -9445,7 +9446,7 @@ yydefault: } case 510: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6850 + //line php5/php5.y:6852 { yyVAL.node = expr.NewEval(yyDollar[3].node) @@ -9461,7 +9462,7 @@ yydefault: } case 511: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6864 + //line php5/php5.y:6866 { yyVAL.node = expr.NewRequire(yyDollar[2].node) @@ -9475,7 +9476,7 @@ yydefault: } case 512: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6876 + //line php5/php5.y:6878 { yyVAL.node = expr.NewRequireOnce(yyDollar[2].node) @@ -9489,7 +9490,7 @@ yydefault: } case 513: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6891 + //line php5/php5.y:6893 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -9497,7 +9498,7 @@ yydefault: } case 514: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6897 + //line php5/php5.y:6899 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -9508,7 +9509,7 @@ yydefault: } case 515: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6909 + //line php5/php5.y:6911 { yyVAL.node = yyDollar[1].node @@ -9516,7 +9517,7 @@ yydefault: } case 516: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6915 + //line php5/php5.y:6917 { yyVAL.node = yyDollar[1].node @@ -9524,7 +9525,7 @@ yydefault: } case 517: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6924 + //line php5/php5.y:6926 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -9541,7 +9542,7 @@ yydefault: } case 518: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6939 + //line php5/php5.y:6941 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -9558,7 +9559,7 @@ yydefault: } case 519: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6957 + //line php5/php5.y:6959 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -9575,7 +9576,7 @@ yydefault: } case 520: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6975 + //line php5/php5.y:6977 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) diff --git a/php5/php5.y b/php5/php5.y index 49fe6c4..63dc8cb 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -1387,8 +1387,8 @@ catch_statement: // save comments $1.Meta.SetTokenName(meta.CatchToken).AppendTo(catch.GetMeta()) $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(catch.GetMeta()) - $4.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) + $4.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) $5.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(catch.GetMeta()) $6.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(catch.GetMeta()) $8.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(catch.GetMeta()) @@ -1465,8 +1465,8 @@ additional_catch: // save comments $1.Meta.SetTokenName(meta.CatchToken).AppendTo($$.GetMeta()) $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) - $4.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) + $4.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) $5.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) $6.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) $8.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) @@ -2256,8 +2256,8 @@ parameter: if $3 != nil { $3.Meta.SetTokenName(meta.EllipsisToken).AppendTo($$.GetMeta()) } - $4.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) + $4.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2287,8 +2287,8 @@ parameter: if $3 != nil { $3.Meta.SetTokenName(meta.EllipsisToken).AppendTo($$.GetMeta()) } - $4.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) + $4.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) $5.Meta.SetTokenName(meta.EqualToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -2474,8 +2474,8 @@ global_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.VariableToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMeta($$, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMeta($$, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2487,9 +2487,9 @@ global_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.DollarToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $1, meta.DollarToken) - yylex.(*Parser).appendMeta($$, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) + yylex.(*Parser).appendMeta($$, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2501,10 +2501,12 @@ global_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $1.Meta.SetTokenName(meta.DollarToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $1, meta.DollarToken) - $2.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) - $4.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) + $2.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $2, meta.NodeStart) + $4.Meta.SetTokenName(meta.NodeEnd).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $4, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2526,8 +2528,8 @@ static_var_list: // save comments $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) - $3.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) + $3.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2545,8 +2547,8 @@ static_var_list: // save comments $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) - $3.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) + $3.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) $4.Meta.SetTokenName(meta.EqualToken).AppendTo(staticVar.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -2564,8 +2566,8 @@ static_var_list: staticVar.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2582,8 +2584,8 @@ static_var_list: staticVar.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) $2.Meta.SetTokenName(meta.EqualToken).AppendTo(staticVar.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -3070,8 +3072,8 @@ class_variable_declaration: // save comments $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) - $3.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) + $3.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3089,8 +3091,8 @@ class_variable_declaration: // save comments $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) - $3.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) + $3.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) $4.Meta.SetTokenName(meta.EqualToken).AppendTo(property.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -3108,8 +3110,8 @@ class_variable_declaration: property.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3126,8 +3128,8 @@ class_variable_declaration: property.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) $2.Meta.SetTokenName(meta.EqualToken).AppendTo(property.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -4460,8 +4462,8 @@ lexical_var_list: // save comments $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) - $3.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) + $3.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4480,8 +4482,8 @@ lexical_var_list: // save comments $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) $3.Meta.SetTokenName(meta.AmpersandToken).AppendTo(reference.GetMeta()) - $4.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) + $4.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4496,8 +4498,8 @@ lexical_var_list: variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4515,8 +4517,8 @@ lexical_var_list: // save comments $1.Meta.SetTokenName(meta.AmpersandToken).AppendTo(reference.GetMeta()) - $2.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) + $2.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5619,7 +5621,7 @@ scalar: // save comments $1.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) - yylex.(*Parser).appendMeta($$, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) + yylex.(*Parser).appendMeta($$, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6186,8 +6188,8 @@ compound_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.VariableToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMeta($$, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMeta($$, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6199,12 +6201,12 @@ compound_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $1.Meta.SetTokenName(meta.DollarToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $1, meta.DollarToken) - $2.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $2, meta.OpenCurlyBracesToken) - $4.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $4, meta.CloseCurlyBracesToken) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) + $2.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $2, meta.NodeStart) + $4.Meta.SetTokenName(meta.NodeEnd).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $4, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6330,8 +6332,8 @@ simple_indirect_reference: n.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.DollarToken).AppendTo(n.GetMeta()) - yylex.(*Parser).appendMetaToken(n, $1, meta.DollarToken) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo(n.GetMeta()) + yylex.(*Parser).appendMetaToken(n, $1, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6348,8 +6350,8 @@ simple_indirect_reference: n.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) // save comments - $2.Meta.SetTokenName(meta.DollarToken).AppendTo(n.GetMeta()) - yylex.(*Parser).appendMetaToken(n, $2, meta.DollarToken) + $2.Meta.SetTokenName(meta.NodeStart).AppendTo(n.GetMeta()) + yylex.(*Parser).appendMetaToken(n, $2, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6610,8 +6612,8 @@ encaps_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.VariableToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMeta($$, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMeta($$, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6627,8 +6629,8 @@ encaps_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $1.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) $2.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $2, meta.OpenSquareBracket) $4.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo($$.GetMeta()) @@ -6650,8 +6652,8 @@ encaps_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) $2.Meta.SetTokenName(meta.ObjectOperatorToken).AppendTo($$.GetMeta()) $3.Meta.SetTokenName(meta.IdentifierToken).AppendTo(fetch.GetMeta()) @@ -6667,10 +6669,10 @@ encaps_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.DollarOpenCurlyBracesToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $1, meta.DollarOpenCurlyBracesToken) - $3.Meta.SetTokenName(meta.DollarCloseCurlyBracesToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $3, meta.DollarCloseCurlyBracesToken) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) + $3.Meta.SetTokenName(meta.NodeEnd).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $3, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6686,11 +6688,11 @@ encaps_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.DollarOpenCurlyBracesToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $1, meta.DollarOpenCurlyBracesToken) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) $2.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) - $3.Meta.SetTokenName(meta.DollarCloseCurlyBracesToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $3, meta.DollarCloseCurlyBracesToken) + $3.Meta.SetTokenName(meta.NodeEnd).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $3, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6723,8 +6725,8 @@ encaps_var: $$ = $2; // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) + $1.Meta.SetTokenName(meta.NodeStart).PrependTo($$.GetMeta()) + yylex.(*Parser).prependMetaToken($$, $1, meta.NodeStart) $3.Meta.SetTokenName(meta.NodeEnd).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $3, meta.NodeEnd) @@ -6772,8 +6774,8 @@ encaps_var_offset: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.VariableToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMeta($$, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMeta($$, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php7/php7.go b/php7/php7.go index 3bc23af..2af9f58 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -1,5 +1,3 @@ -// Code generated by goyacc -o php7/php7.go php7/php7.y. DO NOT EDIT. - //line php7/php7.y:2 package php7 @@ -3694,8 +3692,8 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.CatchToken).AppendTo(catch.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(catch.GetMeta()) - yyDollar[5].token.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) + yyDollar[5].token.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yyDollar[6].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(catch.GetMeta()) yyDollar[7].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(catch.GetMeta()) yyDollar[9].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(catch.GetMeta()) @@ -4508,8 +4506,8 @@ yydefault: if yyDollar[3].token != nil { yyDollar[3].token.Meta.SetTokenName(meta.EllipsisToken).AppendTo(yyVAL.node.GetMeta()) } - yyDollar[4].token.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) + yyDollar[4].token.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4541,8 +4539,8 @@ yydefault: if yyDollar[3].token != nil { yyDollar[3].token.Meta.SetTokenName(meta.EllipsisToken).AppendTo(yyVAL.node.GetMeta()) } - yyDollar[4].token.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) + yyDollar[4].token.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yyDollar[5].token.Meta.SetTokenName(meta.EqualToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -4779,7 +4777,7 @@ yydefault: // save comments yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4798,7 +4796,7 @@ yydefault: // save comments yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yyDollar[2].token.Meta.SetTokenName(meta.EqualToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -5313,8 +5311,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5332,8 +5330,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yyDollar[2].token.Meta.SetTokenName(meta.EqualToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -6678,8 +6676,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.VariableToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMeta(yyVAL.node, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMeta(yyVAL.node, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6698,8 +6696,8 @@ yydefault: // save comments yyDollar[1].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) + yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7215,8 +7213,8 @@ yydefault: yyVAL.node = yyDollar[2].node // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) + yylex.(*Parser).prependMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).PrependTo(yyVAL.node.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.NodeEnd) @@ -7383,8 +7381,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.VariableToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMeta(yyVAL.node, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMeta(yyVAL.node, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7398,12 +7396,12 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.DollarToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.DollarToken) - yyDollar[2].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.OpenCurlyBracesToken) - yyDollar[4].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.CloseCurlyBracesToken) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) + yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.NodeStart) + yyDollar[4].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7417,8 +7415,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.DollarToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.DollarToken) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7812,8 +7810,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.VariableToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMeta(yyVAL.node, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMeta(yyVAL.node, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7831,8 +7829,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yyDollar[2].token.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.OpenCurlyBracesToken) yyDollar[4].token.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(yyVAL.node.GetMeta()) @@ -7856,8 +7854,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yyDollar[2].token.Meta.SetTokenName(meta.ObjectOperatorToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(fetch.GetMeta()) @@ -7875,10 +7873,10 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.DollarOpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.DollarOpenCurlyBracesToken) - yyDollar[3].token.Meta.SetTokenName(meta.DollarCloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.DollarCloseCurlyBracesToken) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) + yyDollar[3].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7896,11 +7894,11 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.DollarOpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.DollarOpenCurlyBracesToken) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) yyDollar[2].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.DollarCloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.DollarCloseCurlyBracesToken) + yyDollar[3].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7937,8 +7935,8 @@ yydefault: yyVAL.node = yyDollar[2].node // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).prependMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) yyDollar[3].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.NodeEnd) @@ -8022,8 +8020,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.VariableToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMeta(yyVAL.node, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMeta(yyVAL.node, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php7/php7.y b/php7/php7.y index 3c8dd08..06e370c 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -1344,8 +1344,8 @@ catch_list: // save comments $2.Meta.SetTokenName(meta.CatchToken).AppendTo(catch.GetMeta()) $3.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(catch.GetMeta()) - $5.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) + $5.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) $6.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(catch.GetMeta()) $7.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(catch.GetMeta()) $9.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(catch.GetMeta()) @@ -2128,8 +2128,8 @@ parameter: if $3 != nil { $3.Meta.SetTokenName(meta.EllipsisToken).AppendTo($$.GetMeta()) } - $4.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) + $4.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2159,8 +2159,8 @@ parameter: if $3 != nil { $3.Meta.SetTokenName(meta.EllipsisToken).AppendTo($$.GetMeta()) } - $4.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) + $4.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) $5.Meta.SetTokenName(meta.EqualToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -2388,7 +2388,7 @@ static_var: // save comments $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2405,7 +2405,7 @@ static_var: // save comments $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) $2.Meta.SetTokenName(meta.EqualToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -2892,8 +2892,8 @@ property: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2909,8 +2909,8 @@ property: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) $2.Meta.SetTokenName(meta.EqualToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -4104,8 +4104,8 @@ lexical_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.VariableToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMeta($$, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMeta($$, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4122,8 +4122,8 @@ lexical_var: // save comments $1.Meta.SetTokenName(meta.AmpersandToken).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) + $2.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4590,8 +4590,8 @@ dereferencable: $$ = $2; // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) + yylex.(*Parser).prependMetaToken($$, $1, meta.NodeStart) + $1.Meta.SetTokenName(meta.NodeStart).PrependTo($$.GetMeta()) $3.Meta.SetTokenName(meta.NodeEnd).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $3, meta.NodeEnd) @@ -4742,8 +4742,8 @@ simple_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.VariableToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMeta($$, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMeta($$, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4755,12 +4755,12 @@ simple_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $1.Meta.SetTokenName(meta.DollarToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $1, meta.DollarToken) - $2.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $2, meta.OpenCurlyBracesToken) - $4.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $4, meta.CloseCurlyBracesToken) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) + $2.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $2, meta.NodeStart) + $4.Meta.SetTokenName(meta.NodeEnd).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $4, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4772,8 +4772,8 @@ simple_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.DollarToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $1, meta.DollarToken) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5137,8 +5137,8 @@ encaps_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.VariableToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMeta($$, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMeta($$, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5154,8 +5154,8 @@ encaps_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $1.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) $2.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $2, meta.OpenCurlyBracesToken) $4.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo($$.GetMeta()) @@ -5177,8 +5177,8 @@ encaps_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.VariableToken).AppendTo(variable.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) $2.Meta.SetTokenName(meta.ObjectOperatorToken).AppendTo($$.GetMeta()) $3.Meta.SetTokenName(meta.IdentifierToken).AppendTo(fetch.GetMeta()) @@ -5194,10 +5194,10 @@ encaps_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.DollarOpenCurlyBracesToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $1, meta.DollarOpenCurlyBracesToken) - $3.Meta.SetTokenName(meta.DollarCloseCurlyBracesToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $3, meta.DollarCloseCurlyBracesToken) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) + $3.Meta.SetTokenName(meta.NodeEnd).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $3, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5213,11 +5213,11 @@ encaps_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.DollarOpenCurlyBracesToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $1, meta.DollarOpenCurlyBracesToken) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) $2.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) - $3.Meta.SetTokenName(meta.DollarCloseCurlyBracesToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $3, meta.DollarCloseCurlyBracesToken) + $3.Meta.SetTokenName(meta.NodeEnd).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $3, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5250,8 +5250,8 @@ encaps_var: $$ = $2; // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) + $1.Meta.SetTokenName(meta.NodeStart).PrependTo($$.GetMeta()) + yylex.(*Parser).prependMetaToken($$, $1, meta.NodeStart) $3.Meta.SetTokenName(meta.NodeEnd).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $3, meta.NodeEnd) @@ -5330,8 +5330,8 @@ encaps_var_offset: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.VariableToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMeta($$, &meta.Data{"$", meta.TokenType, nil, meta.DollarToken}, meta.DollarToken) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMeta($$, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/printer/printer.go b/printer/printer.go index 648a4b5..cdd578a 100644 --- a/printer/printer.go +++ b/printer/printer.go @@ -654,14 +654,7 @@ func (p *Printer) printScalarHeredoc(n node.Node) { io.WriteString(p.w, "\n") for _, part := range nn.Parts { - switch part.(type) { - case *scalar.EncapsedStringPart: - p.Print(part) - default: - p.printMeta(part, meta.DollarOpenCurlyBracesToken) - p.Print(part) - p.printMeta(part, meta.DollarCloseCurlyBracesToken) - } + p.Print(part) } io.WriteString(p.w, "\n") @@ -1673,14 +1666,7 @@ func (p *Printer) printExprShellExec(n node.Node) { p.printMeta(nn, meta.BackquoteToken) io.WriteString(p.w, "`") for _, part := range nn.Parts { - switch part.(type) { - case *scalar.EncapsedStringPart: - p.Print(part) - default: - p.printMeta(part, meta.DollarOpenCurlyBracesToken) - p.Print(part) - p.printMeta(part, meta.DollarCloseCurlyBracesToken) - } + p.Print(part) } io.WriteString(p.w, "`") @@ -1787,14 +1773,8 @@ func (p *Printer) printExprUnaryPlus(n node.Node) { func (p *Printer) printExprVariable(n node.Node) { nn := n.(*expr.Variable) p.printMeta(nn, meta.NodeStart) - p.printMeta(nn, meta.VariableToken) - p.printMeta(nn, meta.DollarOpenCurlyBracesToken) - p.printMeta(nn, meta.DollarToken) - p.printMeta(nn, meta.OpenCurlyBracesToken) p.Print(nn.VarName) - p.printMeta(nn, meta.DollarCloseCurlyBracesToken) - p.printMeta(nn, meta.CloseCurlyBracesToken) p.printMeta(nn, meta.NodeEnd) } diff --git a/printer/printer_parsed_php5_test.go b/printer/printer_parsed_php5_test.go index 61b5a15..a6cfff8 100644 --- a/printer/printer_parsed_php5_test.go +++ b/printer/printer_parsed_php5_test.go @@ -1318,6 +1318,7 @@ func TestParseAndPrintPhp5While(t *testing.T) { func TestParseAndPrintPhp5Parentheses(t *testing.T) { src := ` 0 { printIndent(d.Writer, d.depth) - fmt.Fprint(d.Writer, "Meta: []meta.Meta{\n") + fmt.Fprint(d.Writer, "Meta: meta.Collection{\n") d.depth++ for _, m := range *mm { printIndent(d.Writer, d.depth) - switch m.Type { - case meta.CommentType: - fmt.Fprint(d.Writer, "&meta.CommentType{\n") - case meta.WhiteSpaceType: - fmt.Fprint(d.Writer, "&meta.WhiteSpaceType{\n") - case meta.TokenType: - fmt.Fprint(d.Writer, "&meta.TokenType{\n") - } + fmt.Fprint(d.Writer, "&meta.Data{\n") d.depth++ printIndent(d.Writer, d.depth) + + switch m.Type { + case meta.CommentType: + fmt.Fprint(d.Writer, "Type: meta.CommentType,\n") + case meta.WhiteSpaceType: + fmt.Fprint(d.Writer, "Type: meta.WhiteSpaceType,\n") + case meta.TokenType: + fmt.Fprint(d.Writer, "Type: meta.TokenType,\n") + } + + printIndent(d.Writer, d.depth) + if m.Position != nil { fmt.Fprint(d.Writer, "Position: &position.Position{\n") d.depth++ @@ -99,7 +104,7 @@ func (d *GoDumper) EnterNode(w walker.Walkable) bool { printIndent(d.Writer, d.depth) fmt.Fprintf(d.Writer, "Value: %q,\n", m.String()) printIndent(d.Writer, d.depth) - fmt.Fprintf(d.Writer, "TokenName: %d,\n", m.TokenName) + fmt.Fprintf(d.Writer, "TokenName: meta.%s,\n", m.TokenName.String()) d.depth-- printIndent(d.Writer, d.depth) diff --git a/visitor/go_dumper_test.go b/visitor/go_dumper_test.go index dc87a47..759ee3c 100644 --- a/visitor/go_dumper_test.go +++ b/visitor/go_dumper_test.go @@ -50,8 +50,9 @@ func ExampleGoDumper() { // StartPos: 10, // EndPos: 143, // }, - // Meta: []meta.Meta{ - // &meta.TokenType{ + // Meta: meta.Collection{ + // &meta.Data{ + // Type: meta.TokenType, // Position: &position.Position{ // StartLine: 1, // EndLine: 1, @@ -59,9 +60,10 @@ func ExampleGoDumper() { // EndPos: 5, // }, // Value: " Date: Mon, 10 Dec 2018 11:51:56 +0200 Subject: [PATCH 026/117] feat: add StopOnFailureFilter for meta.Collection --- meta/collection.go | 52 ++++++++++-- meta/collection_test.go | 184 ++++++++++++++++++++++++++++++++++++---- 2 files changed, 212 insertions(+), 24 deletions(-) diff --git a/meta/collection.go b/meta/collection.go index c0500a0..8d47385 100644 --- a/meta/collection.go +++ b/meta/collection.go @@ -64,18 +64,41 @@ func (mc *Collection) Cut(f Filter) *Collection { type Filter func(d *Data) bool // TokenNameFilter generates filter function that returns true -// if data.TokenName exactly same as given -func TokenNameFilter(tn TokenName) Filter { +// if data.TokenName has in the arguments list +func TokenNameFilter(tokenNames ...TokenName) Filter { return func(d *Data) bool { - return d.TokenName == tn + for _, tn := range tokenNames { + if d.TokenName == tn { + return true + } + } + return false } } // TypeFilter generates filter function that returns true -// if data.Type exactly same as given -func TypeFilter(t Type) Filter { +// if data.Type has in the arguments list +func TypeFilter(types ...Type) Filter { return func(d *Data) bool { - return d.Type == t + for _, t := range types { + if d.Type == t { + return true + } + } + return false + } +} + +// ValueFilter generates filter function that returns true +// if data.Value has in the arguments list +func ValueFilter(values ...string) Filter { + return func(d *Data) bool { + for _, v := range values { + if d.Value == v { + return true + } + } + return false } } @@ -113,3 +136,20 @@ func NotFilter(f Filter) Filter { return !f(d) } } + +// StopOnFailureFilter always returns false after first failure +func StopOnFailureFilter(f Filter) Filter { + stopFlag := false + return func(d *Data) bool { + if stopFlag == true { + return false + } + + if !f(d) { + stopFlag = true + return false + } + + return true + } +} diff --git a/meta/collection_test.go b/meta/collection_test.go index 652b001..d14d738 100644 --- a/meta/collection_test.go +++ b/meta/collection_test.go @@ -261,11 +261,11 @@ func TestCollectionCutByTokenName(t *testing.T) { actualCollection := meta.Collection{whiteSpace, OpenParenthesisComment, OpenParenthesisToken, CloseParenthesisToken} expectedCollection := meta.Collection{whiteSpace, CloseParenthesisToken} - expectedCuttedCollection := &meta.Collection{OpenParenthesisComment, OpenParenthesisToken} + expectedCutCollection := &meta.Collection{OpenParenthesisComment, OpenParenthesisToken} // action - actualCuttedCollection := actualCollection.Cut( + actualCutCollection := actualCollection.Cut( meta.TokenNameFilter(meta.OpenParenthesisToken), ) @@ -281,13 +281,13 @@ func TestCollectionCutByTokenName(t *testing.T) { } } - if !reflect.DeepEqual(expectedCuttedCollection, actualCuttedCollection) { - diff := pretty.Compare(expectedCuttedCollection, actualCuttedCollection) + if !reflect.DeepEqual(expectedCutCollection, actualCutCollection) { + diff := pretty.Compare(expectedCutCollection, actualCutCollection) if diff != "" { - t.Errorf("\nexpected and actual cutted collections are not equal\ndiff: (-expected +actual)\n%s", diff) + t.Errorf("\nexpected and actual Cut collections are not equal\ndiff: (-expected +actual)\n%s", diff) } else { - t.Errorf("\nexpected and actual cutted collections are not equal\n") + t.Errorf("\nexpected and actual Cut collections are not equal\n") } } } @@ -319,11 +319,11 @@ func TestCollectionCutByTokenTypes(t *testing.T) { actualCollection := meta.Collection{whiteSpace, OpenParenthesisComment, OpenParenthesisToken, CloseParenthesisToken} expectedCollection := meta.Collection{OpenParenthesisToken, CloseParenthesisToken} - expectedCuttedCollection := &meta.Collection{whiteSpace, OpenParenthesisComment} + expectedCutCollection := &meta.Collection{whiteSpace, OpenParenthesisComment} // action - actualCuttedCollection := actualCollection.Cut(meta.OrFilter( + actualCutCollection := actualCollection.Cut(meta.OrFilter( meta.TypeFilter(meta.CommentType), meta.TypeFilter(meta.WhiteSpaceType)), ) @@ -340,13 +340,13 @@ func TestCollectionCutByTokenTypes(t *testing.T) { } } - if !reflect.DeepEqual(expectedCuttedCollection, actualCuttedCollection) { - diff := pretty.Compare(expectedCuttedCollection, actualCuttedCollection) + if !reflect.DeepEqual(expectedCutCollection, actualCutCollection) { + diff := pretty.Compare(expectedCutCollection, actualCutCollection) if diff != "" { - t.Errorf("\nexpected and actual cutted collections are not equal\ndiff: (-expected +actual)\n%s", diff) + t.Errorf("\nexpected and actual Cut collections are not equal\ndiff: (-expected +actual)\n%s", diff) } else { - t.Errorf("\nexpected and actual cutted collections are not equal\n") + t.Errorf("\nexpected and actual Cut collections are not equal\n") } } } @@ -387,13 +387,13 @@ func TestCollectionCutByTokenNameButNotType(t *testing.T) { OpenParenthesisToken, CloseParenthesisToken, } - expectedCuttedCollection := &meta.Collection{ + expectedCutCollection := &meta.Collection{ OpenParenthesisComment, } // action - actualCuttedCollection := actualCollection.Cut(meta.AndFilter( + actualCutCollection := actualCollection.Cut(meta.AndFilter( meta.TokenNameFilter(meta.OpenParenthesisToken), meta.NotFilter(meta.TypeFilter(meta.TokenType))), ) @@ -410,13 +410,161 @@ func TestCollectionCutByTokenNameButNotType(t *testing.T) { } } - if !reflect.DeepEqual(expectedCuttedCollection, actualCuttedCollection) { - diff := pretty.Compare(expectedCuttedCollection, actualCuttedCollection) + if !reflect.DeepEqual(expectedCutCollection, actualCutCollection) { + diff := pretty.Compare(expectedCutCollection, actualCutCollection) if diff != "" { - t.Errorf("\nexpected and actual cutted collections are not equal\ndiff: (-expected +actual)\n%s", diff) + t.Errorf("\nexpected and actual Cut collections are not equal\ndiff: (-expected +actual)\n%s", diff) } else { - t.Errorf("\nexpected and actual cutted collections are not equal\n") + t.Errorf("\nexpected and actual Cut collections are not equal\n") + } + } +} + +func TestCollectionCutByValue(t *testing.T) { + + // prepare + + whiteSpace := &meta.Data{ + Type: meta.WhiteSpaceType, + Value: "\n", + } + OpenParenthesisComment := &meta.Data{ + Type: meta.CommentType, + Value: "// some comment", + TokenName: meta.OpenParenthesisToken, + } + OpenParenthesisToken := &meta.Data{ + Type: meta.TokenType, + Value: "(", + TokenName: meta.OpenParenthesisToken, + } + CloseParenthesisToken := &meta.Data{ + Type: meta.TokenType, + Value: ")", + TokenName: meta.CloseParenthesisToken, + } + + actualCollection := meta.Collection{ + whiteSpace, + OpenParenthesisComment, + OpenParenthesisToken, + CloseParenthesisToken, + } + + expectedCollection := meta.Collection{ + whiteSpace, + OpenParenthesisComment, + } + expectedCutCollection := &meta.Collection{ + OpenParenthesisToken, + CloseParenthesisToken, + } + + // action + + actualCutCollection := actualCollection.Cut(meta.ValueFilter("(", ")")) + + // check + + if !reflect.DeepEqual(expectedCollection, actualCollection) { + diff := pretty.Compare(expectedCollection, actualCollection) + + if diff != "" { + t.Errorf("\nexpected and actual collections are not equal\ndiff: (-expected +actual)\n%s", diff) + } else { + t.Errorf("\nexpected and actual collections are not equal\n") + } + } + + if !reflect.DeepEqual(expectedCutCollection, actualCutCollection) { + diff := pretty.Compare(expectedCutCollection, actualCutCollection) + + if diff != "" { + t.Errorf("\nexpected and actual Cut collections are not equal\ndiff: (-expected +actual)\n%s", diff) + } else { + t.Errorf("\nexpected and actual Cut collections are not equal\n") + } + } +} + +func TestCollectionCutUntilFirstToken(t *testing.T) { + + // prepare + + whiteSpace := &meta.Data{ + Type: meta.WhiteSpaceType, + Value: "\n", + TokenName: meta.NodeStart, + } + OpenParenthesisComment := &meta.Data{ + Type: meta.CommentType, + Value: "// some comment", + TokenName: meta.NodeStart, + } + OpenParenthesisToken := &meta.Data{ + Type: meta.TokenType, + Value: "(", + TokenName: meta.OpenParenthesisToken, + } + CloseParenthesisComment := &meta.Data{ + Type: meta.WhiteSpaceType, + Value: "// some comment", + TokenName: meta.OpenParenthesisToken, + } + CloseParenthesisToken := &meta.Data{ + Type: meta.TokenType, + Value: ")", + TokenName: meta.CloseParenthesisToken, + } + + actualCollection := meta.Collection{ + whiteSpace, + OpenParenthesisComment, + OpenParenthesisToken, + CloseParenthesisComment, + CloseParenthesisToken, + } + + expectedCutCollection := &meta.Collection{ + whiteSpace, + OpenParenthesisComment, + } + expectedCollection := meta.Collection{ + OpenParenthesisToken, + CloseParenthesisComment, // must not be cut + CloseParenthesisToken, + } + + // action + + actualCutCollection := actualCollection.Cut( + meta.StopOnFailureFilter( + meta.NotFilter( + meta.TypeFilter(meta.TokenType), + ), + ), + ) + + // check + + if !reflect.DeepEqual(expectedCollection, actualCollection) { + diff := pretty.Compare(expectedCollection, actualCollection) + + if diff != "" { + t.Errorf("\nexpected and actual collections are not equal\ndiff: (-expected +actual)\n%s", diff) + } else { + t.Errorf("\nexpected and actual collections are not equal\n") + } + } + + if !reflect.DeepEqual(expectedCutCollection, actualCutCollection) { + diff := pretty.Compare(expectedCutCollection, actualCutCollection) + + if diff != "" { + t.Errorf("\nexpected and actual Cut collections are not equal\ndiff: (-expected +actual)\n%s", diff) + } else { + t.Errorf("\nexpected and actual Cut collections are not equal\n") } } } From 2efb4dc4cf3559394f702bae74b8e1b8bf0260ac Mon Sep 17 00:00:00 2001 From: z7zmey Date: Thu, 25 Oct 2018 12:31:17 +0300 Subject: [PATCH 027/117] remove meta.IdentifierToken --- meta/tokenName.go | 1 - meta/tokenName_string.go | 4 +- php5/php5.go | 88 +++++++++++++++--------------- php5/php5.y | 88 +++++++++++++++--------------- php7/php7.go | 72 ++++++++++++------------ php7/php7.y | 72 ++++++++++++------------ printer/printer.go | 22 -------- printer/printer_test.go | 4 +- visitor/dumper_test.go | 6 +- visitor/go_dumper_test.go | 6 +- visitor/json_dumper_test.go | 2 +- visitor/pretty_json_dumper_test.go | 8 +-- 12 files changed, 175 insertions(+), 198 deletions(-) diff --git a/meta/tokenName.go b/meta/tokenName.go index c1f9ba0..20105ec 100644 --- a/meta/tokenName.go +++ b/meta/tokenName.go @@ -128,7 +128,6 @@ const ( IsSmallerOrEqualToken IsGreaterOrEqualToken HaltCompilerToken - IdentifierToken CaseSeparatorToken // ';' or ':' DoubleQuoteToken // '"' BackquoteToken // '`' diff --git a/meta/tokenName_string.go b/meta/tokenName_string.go index 4af347c..09f82f2 100644 --- a/meta/tokenName_string.go +++ b/meta/tokenName_string.go @@ -4,9 +4,9 @@ package meta import "strconv" -const _TokenName_name = "UnknownTokenNodeStartNodeEndMagicConstantTokenIncludeTokenIncludeOnceTokenExitTokenIfTokenLnumberTokenDnumberTokenStringTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEncapsedAndWhitespaceTokenConstantEncapsedStringTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenUseTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenIssetTokenEmptyTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenListTokenArrayTokenCallableTokenStartHeredocTokenCurlyOpenTokenPaamayimNekudotayimTokenNamespaceTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenEvalTokenRequireTokenRequireOnceTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenNewAnchorCloneTokenElseifTokenElseTokenEndifTokenPrintTokenYieldTokenStaticTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenYieldFromTokenObjectOperatorTokenIntCastTokenDoubleCastTokenStringCastTokenArrayCastTokenObjectCastTokenBoolCastTokenUnsetCastTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenIdentifierTokenCaseSeparatorTokenDoubleQuoteTokenBackquoteTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenExclamationMarkTokenTildeTokenAtTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" +const _TokenName_name = "UnknownTokenNodeStartNodeEndMagicConstantTokenIncludeTokenIncludeOnceTokenExitTokenIfTokenLnumberTokenDnumberTokenStringTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEncapsedAndWhitespaceTokenConstantEncapsedStringTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenUseTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenIssetTokenEmptyTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenListTokenArrayTokenCallableTokenStartHeredocTokenCurlyOpenTokenPaamayimNekudotayimTokenNamespaceTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenEvalTokenRequireTokenRequireOnceTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenNewAnchorCloneTokenElseifTokenElseTokenEndifTokenPrintTokenYieldTokenStaticTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenYieldFromTokenObjectOperatorTokenIntCastTokenDoubleCastTokenStringCastTokenArrayCastTokenObjectCastTokenBoolCastTokenUnsetCastTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenDoubleQuoteTokenBackquoteTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenExclamationMarkTokenTildeTokenAtTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" -var _TokenName_index = [...]uint16{0, 12, 21, 28, 46, 58, 74, 83, 90, 102, 114, 125, 143, 157, 172, 198, 225, 234, 241, 251, 264, 285, 306, 314, 325, 337, 352, 364, 379, 386, 397, 411, 420, 432, 442, 455, 464, 477, 487, 498, 506, 516, 528, 538, 546, 560, 571, 579, 589, 599, 609, 619, 629, 643, 655, 670, 686, 695, 705, 718, 735, 749, 773, 787, 813, 829, 842, 851, 863, 879, 893, 908, 923, 938, 947, 957, 968, 977, 987, 997, 1007, 1018, 1031, 1041, 1053, 1067, 1078, 1086, 1094, 1108, 1127, 1139, 1154, 1169, 1183, 1198, 1211, 1225, 1238, 1252, 1266, 1281, 1294, 1307, 1320, 1336, 1349, 1362, 1374, 1387, 1399, 1411, 1425, 1440, 1448, 1455, 1462, 1478, 1497, 1509, 1524, 1545, 1566, 1583, 1598, 1616, 1632, 1646, 1666, 1687, 1701, 1711, 1731, 1752, 1769, 1787, 1804, 1818, 1828, 1837, 1857, 1867, 1874, 1884, 1900, 1910, 1920, 1933, 1943, 1955, 1964, 1976, 1984} +var _TokenName_index = [...]uint16{0, 12, 21, 28, 46, 58, 74, 83, 90, 102, 114, 125, 143, 157, 172, 198, 225, 234, 241, 251, 264, 285, 306, 314, 325, 337, 352, 364, 379, 386, 397, 411, 420, 432, 442, 455, 464, 477, 487, 498, 506, 516, 528, 538, 546, 560, 571, 579, 589, 599, 609, 619, 629, 643, 655, 670, 686, 695, 705, 718, 735, 749, 773, 787, 813, 829, 842, 851, 863, 879, 893, 908, 923, 938, 947, 957, 968, 977, 987, 997, 1007, 1018, 1031, 1041, 1053, 1067, 1078, 1086, 1094, 1108, 1127, 1139, 1154, 1169, 1183, 1198, 1211, 1225, 1238, 1252, 1266, 1281, 1294, 1307, 1320, 1336, 1349, 1362, 1374, 1387, 1399, 1411, 1425, 1440, 1448, 1455, 1462, 1478, 1497, 1509, 1524, 1545, 1566, 1583, 1601, 1617, 1631, 1651, 1672, 1686, 1696, 1716, 1737, 1754, 1772, 1789, 1803, 1813, 1822, 1842, 1852, 1859, 1869, 1885, 1895, 1905, 1918, 1928, 1940, 1949, 1961, 1969} func (i TokenName) String() string { if i < 0 || i >= TokenName(len(_TokenName_index)-1) { diff --git a/php5/php5.go b/php5/php5.go index 2241f52..537b826 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -2521,7 +2521,7 @@ yydefault: // save comments yyDollar[1].token.Meta.SetTokenName(meta.UseToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(useType.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(useType.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.SemiColonToken) @@ -2540,7 +2540,7 @@ yydefault: // save comments yyDollar[1].token.Meta.SetTokenName(meta.UseToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(useType.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(useType.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.SemiColonToken) @@ -2608,7 +2608,7 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.AsToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(alias.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(alias.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2646,7 +2646,7 @@ yydefault: yyDollar[1].token.Meta.SetTokenName(meta.UseLeadingNsSeparatorToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.UseLeadingNsSeparatorToken) yyDollar[3].token.Meta.SetTokenName(meta.AsToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(alias.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.NodeStart).AppendTo(alias.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2697,7 +2697,7 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.AsToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(alias.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(alias.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2735,7 +2735,7 @@ yydefault: yyDollar[1].token.Meta.SetTokenName(meta.UseLeadingNsSeparatorToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.UseLeadingNsSeparatorToken) yyDollar[3].token.Meta.SetTokenName(meta.AsToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(alias.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.NodeStart).AppendTo(alias.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2786,7 +2786,7 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.AsToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(alias.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(alias.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2824,7 +2824,7 @@ yydefault: yyDollar[1].token.Meta.SetTokenName(meta.UseLeadingNsSeparatorToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.UseLeadingNsSeparatorToken) yyDollar[3].token.Meta.SetTokenName(meta.AsToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(alias.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.NodeStart).AppendTo(alias.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2846,7 +2846,7 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastConst.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.EqualToken).AppendTo(constant.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -2867,7 +2867,7 @@ yydefault: // save comments yyDollar[1].token.Meta.SetTokenName(meta.ConstToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.EqualToken).AppendTo(constant.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -2961,7 +2961,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(label.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(label.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.ColonToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -3509,7 +3509,7 @@ yydefault: // save comments yyDollar[1].token.Meta.SetTokenName(meta.GotoToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(label.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(label.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.SemiColonToken) @@ -3711,7 +3711,7 @@ yydefault: if yyDollar[2].token != nil { yyDollar[2].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(yyVAL.node.GetMeta()) } - yyDollar[3].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[6].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[7].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) @@ -3743,7 +3743,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[7].token)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) yyDollar[5].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[7].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) @@ -3762,7 +3762,7 @@ yydefault: // save comments yyDollar[1].token.Meta.SetTokenName(meta.InterfaceToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[6].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) @@ -3794,7 +3794,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(classModifier.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(classModifier.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.ClassToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -3825,7 +3825,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(classModifier.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(classModifier.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.ClassToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -4081,7 +4081,7 @@ yydefault: constant.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.EqualToken).AppendTo(constant.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -4100,7 +4100,7 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.EqualToken).AppendTo(constant.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -4486,7 +4486,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4500,7 +4500,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4857,7 +4857,7 @@ yydefault: if yyDollar[3].token != nil { yyDollar[3].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(yyVAL.node.GetMeta()) } - yyDollar[4].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) yyDollar[5].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[7].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) @@ -5025,7 +5025,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5050,7 +5050,7 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(target.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(target.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5067,7 +5067,7 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.AsToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(alias.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.NodeStart).AppendTo(alias.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5150,7 +5150,7 @@ yydefault: modifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(modifier.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(modifier.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5196,7 +5196,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5210,7 +5210,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5224,7 +5224,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5238,7 +5238,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5252,7 +5252,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5266,7 +5266,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5372,7 +5372,7 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastConst.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.EqualToken).AppendTo(constant.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -5392,7 +5392,7 @@ yydefault: // save comments yyDollar[1].token.Meta.SetTokenName(meta.ConstToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.EqualToken).AppendTo(constant.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -7034,7 +7034,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7475,7 +7475,7 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(target.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(target.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -8140,7 +8140,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) yylex.(*Parser).appendMeta(yyVAL.node, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -8853,7 +8853,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -9234,7 +9234,7 @@ yydefault: yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yyDollar[2].token.Meta.SetTokenName(meta.ObjectOperatorToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(fetch.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(fetch.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -9273,7 +9273,7 @@ yydefault: // save comments yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) - yyDollar[2].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.NodeEnd) @@ -9537,7 +9537,7 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(target.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(target.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -9554,7 +9554,7 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(target.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(target.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -9571,7 +9571,7 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(target.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(target.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -9588,7 +9588,7 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(target.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(target.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php5/php5.y b/php5/php5.y index 63dc8cb..2e25f08 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -452,7 +452,7 @@ top_statement: // save comments $1.Meta.SetTokenName(meta.UseToken).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.IdentifierToken).AppendTo(useType.GetMeta()) + $2.Meta.SetTokenName(meta.NodeStart).AppendTo(useType.GetMeta()) $4.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $4, meta.SemiColonToken) @@ -469,7 +469,7 @@ top_statement: // save comments $1.Meta.SetTokenName(meta.UseToken).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.IdentifierToken).AppendTo(useType.GetMeta()) + $2.Meta.SetTokenName(meta.NodeStart).AppendTo(useType.GetMeta()) $4.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $4, meta.SemiColonToken) @@ -533,7 +533,7 @@ use_declaration: // save comments $2.Meta.SetTokenName(meta.AsToken).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.IdentifierToken).AppendTo(alias.GetMeta()) + $3.Meta.SetTokenName(meta.NodeStart).AppendTo(alias.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -567,7 +567,7 @@ use_declaration: $1.Meta.SetTokenName(meta.UseLeadingNsSeparatorToken).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $1, meta.UseLeadingNsSeparatorToken) $3.Meta.SetTokenName(meta.AsToken).AppendTo($$.GetMeta()) - $4.Meta.SetTokenName(meta.IdentifierToken).AppendTo(alias.GetMeta()) + $4.Meta.SetTokenName(meta.NodeStart).AppendTo(alias.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -616,7 +616,7 @@ use_function_declaration: // save comments $2.Meta.SetTokenName(meta.AsToken).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.IdentifierToken).AppendTo(alias.GetMeta()) + $3.Meta.SetTokenName(meta.NodeStart).AppendTo(alias.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -650,7 +650,7 @@ use_function_declaration: $1.Meta.SetTokenName(meta.UseLeadingNsSeparatorToken).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $1, meta.UseLeadingNsSeparatorToken) $3.Meta.SetTokenName(meta.AsToken).AppendTo($$.GetMeta()) - $4.Meta.SetTokenName(meta.IdentifierToken).AppendTo(alias.GetMeta()) + $4.Meta.SetTokenName(meta.NodeStart).AppendTo(alias.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -699,7 +699,7 @@ use_const_declaration: // save comments $2.Meta.SetTokenName(meta.AsToken).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.IdentifierToken).AppendTo(alias.GetMeta()) + $3.Meta.SetTokenName(meta.NodeStart).AppendTo(alias.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -733,7 +733,7 @@ use_const_declaration: $1.Meta.SetTokenName(meta.UseLeadingNsSeparatorToken).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $1, meta.UseLeadingNsSeparatorToken) $3.Meta.SetTokenName(meta.AsToken).AppendTo($$.GetMeta()) - $4.Meta.SetTokenName(meta.IdentifierToken).AppendTo(alias.GetMeta()) + $4.Meta.SetTokenName(meta.NodeStart).AppendTo(alias.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -756,7 +756,7 @@ constant_declaration: // save comments $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastConst.GetMeta()) - $3.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + $3.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) $4.Meta.SetTokenName(meta.EqualToken).AppendTo(constant.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -775,7 +775,7 @@ constant_declaration: // save comments $1.Meta.SetTokenName(meta.ConstToken).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + $2.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) $3.Meta.SetTokenName(meta.EqualToken).AppendTo(constant.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -862,7 +862,7 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.IdentifierToken).AppendTo(label.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo(label.GetMeta()) $2.Meta.SetTokenName(meta.ColonToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -1357,7 +1357,7 @@ unticked_statement: // save comments $1.Meta.SetTokenName(meta.GotoToken).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.IdentifierToken).AppendTo(label.GetMeta()) + $2.Meta.SetTokenName(meta.NodeStart).AppendTo(label.GetMeta()) $3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken) @@ -1557,7 +1557,7 @@ unticked_function_declaration_statement: if $2 != nil { $2.Meta.SetTokenName(meta.AmpersandToken).AppendTo($$.GetMeta()) } - $3.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + $3.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) $4.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) $6.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) $7.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) @@ -1590,7 +1590,7 @@ unticked_class_declaration_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $7)) // save comments - $2.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + $2.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) $5.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) $7.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) @@ -1607,7 +1607,7 @@ unticked_class_declaration_statement: // save comments $1.Meta.SetTokenName(meta.InterfaceToken).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + $2.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) $4.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) $6.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) @@ -1639,7 +1639,7 @@ class_entry_type: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.IdentifierToken).AppendTo(classModifier.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo(classModifier.GetMeta()) $2.Meta.SetTokenName(meta.ClassToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -1666,7 +1666,7 @@ class_entry_type: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.IdentifierToken).AppendTo(classModifier.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo(classModifier.GetMeta()) $2.Meta.SetTokenName(meta.ClassToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -1915,7 +1915,7 @@ declare_list: constant.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) $2.Meta.SetTokenName(meta.EqualToken).AppendTo(constant.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -1932,7 +1932,7 @@ declare_list: // save comments $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) - $3.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + $3.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) $4.Meta.SetTokenName(meta.EqualToken).AppendTo(constant.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -2311,7 +2311,7 @@ optional_class_type: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.IdentifierToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2323,7 +2323,7 @@ optional_class_type: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.IdentifierToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2660,7 +2660,7 @@ class_statement: if $3 != nil { $3.Meta.SetTokenName(meta.AmpersandToken).AppendTo($$.GetMeta()) } - $4.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + $4.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) $5.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) $7.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) @@ -2826,7 +2826,7 @@ trait_method_reference: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2850,7 +2850,7 @@ trait_method_reference_fully_qualified: // save comments $2.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.IdentifierToken).AppendTo(target.GetMeta()) + $3.Meta.SetTokenName(meta.NodeStart).AppendTo(target.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2868,7 +2868,7 @@ trait_alias: // save comments $2.Meta.SetTokenName(meta.AsToken).AppendTo($$.GetMeta()) - $4.Meta.SetTokenName(meta.IdentifierToken).AppendTo(alias.GetMeta()) + $4.Meta.SetTokenName(meta.NodeStart).AppendTo(alias.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2946,7 +2946,7 @@ variable_modifiers: modifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.IdentifierToken).AppendTo(modifier.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo(modifier.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2991,7 +2991,7 @@ member_modifier: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.IdentifierToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3003,7 +3003,7 @@ member_modifier: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.IdentifierToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3015,7 +3015,7 @@ member_modifier: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.IdentifierToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3027,7 +3027,7 @@ member_modifier: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.IdentifierToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3039,7 +3039,7 @@ member_modifier: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.IdentifierToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3051,7 +3051,7 @@ member_modifier: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.IdentifierToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3153,7 +3153,7 @@ class_constant_declaration: // save comments $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastConst.GetMeta()) - $3.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + $3.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) $4.Meta.SetTokenName(meta.EqualToken).AppendTo(constant.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -3171,7 +3171,7 @@ class_constant_declaration: // save comments $1.Meta.SetTokenName(meta.ConstToken).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + $2.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) $3.Meta.SetTokenName(meta.EqualToken).AppendTo(constant.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -4633,7 +4633,7 @@ class_name: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.IdentifierToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5038,7 +5038,7 @@ static_class_constant: // save comments $2.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.IdentifierToken).AppendTo(target.GetMeta()) + $3.Meta.SetTokenName(meta.NodeStart).AppendTo(target.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5620,7 +5620,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) yylex.(*Parser).appendMeta($$, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -6301,7 +6301,7 @@ variable_name: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.IdentifierToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6655,7 +6655,7 @@ encaps_var: $1.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) $2.Meta.SetTokenName(meta.ObjectOperatorToken).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.IdentifierToken).AppendTo(fetch.GetMeta()) + $3.Meta.SetTokenName(meta.NodeStart).AppendTo(fetch.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6690,7 +6690,7 @@ encaps_var: // save comments $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) - $2.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + $2.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) $3.Meta.SetTokenName(meta.NodeEnd).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $3, meta.NodeEnd) @@ -6933,7 +6933,7 @@ class_constant: // save comments $2.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.IdentifierToken).AppendTo(target.GetMeta()) + $3.Meta.SetTokenName(meta.NodeStart).AppendTo(target.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6948,7 +6948,7 @@ class_constant: // save comments $2.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.IdentifierToken).AppendTo(target.GetMeta()) + $3.Meta.SetTokenName(meta.NodeStart).AppendTo(target.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6966,7 +6966,7 @@ static_class_name_scalar: // save comments $2.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.IdentifierToken).AppendTo(target.GetMeta()) + $3.Meta.SetTokenName(meta.NodeStart).AppendTo(target.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6984,7 +6984,7 @@ class_name_scalar: // save comments $2.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.IdentifierToken).AppendTo(target.GetMeta()) + $3.Meta.SetTokenName(meta.NodeStart).AppendTo(target.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php7/php7.go b/php7/php7.go index 38972cb..a79537e 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -2885,7 +2885,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2899,7 +2899,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3108,7 +3108,7 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.AsToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(alias.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(alias.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3646,7 +3646,7 @@ yydefault: // save comments yyDollar[1].token.Meta.SetTokenName(meta.GotoToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(label.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(label.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.SemiColonToken) @@ -3664,7 +3664,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(label.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(label.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.ColonToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -3788,7 +3788,7 @@ yydefault: if yyDollar[2].token != nil { yyDollar[2].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(yyVAL.node.GetMeta()) } - yyDollar[3].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) yyDollar[5].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[7].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[9].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) @@ -3833,7 +3833,7 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.ClassToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) yyDollar[7].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[9].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) @@ -3852,7 +3852,7 @@ yydefault: // save comments yyDollar[1].token.Meta.SetTokenName(meta.ClassToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) yyDollar[6].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[8].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) @@ -3884,7 +3884,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3898,7 +3898,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3915,7 +3915,7 @@ yydefault: // save comments yyDollar[1].token.Meta.SetTokenName(meta.TraitToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[6].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) @@ -3934,7 +3934,7 @@ yydefault: // save comments yyDollar[1].token.Meta.SetTokenName(meta.InterfaceToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) yyDollar[5].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[7].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) @@ -4595,7 +4595,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4609,7 +4609,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4884,7 +4884,7 @@ yydefault: if yyDollar[3].token != nil { yyDollar[3].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(yyVAL.node.GetMeta()) } - yyDollar[4].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) yyDollar[6].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[8].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) @@ -5018,7 +5018,7 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.AsToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(alias.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(alias.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5035,7 +5035,7 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.AsToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(alias.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(alias.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5052,7 +5052,7 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.AsToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(alias.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.NodeStart).AppendTo(alias.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5082,7 +5082,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5107,7 +5107,7 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(target.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(target.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5160,7 +5160,7 @@ yydefault: modifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(modifier.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(modifier.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5206,7 +5206,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5220,7 +5220,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5234,7 +5234,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5248,7 +5248,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5262,7 +5262,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5276,7 +5276,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5369,7 +5369,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.EqualToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -5386,7 +5386,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.EqualToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -6763,7 +6763,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7139,7 +7139,7 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(target.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(target.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7156,7 +7156,7 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(target.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(target.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7544,7 +7544,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7580,7 +7580,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7859,7 +7859,7 @@ yydefault: yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yyDollar[2].token.Meta.SetTokenName(meta.ObjectOperatorToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(fetch.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(fetch.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7898,7 +7898,7 @@ yydefault: // save comments yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) - yyDollar[2].token.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.NodeEnd) diff --git a/php7/php7.y b/php7/php7.y index 06e370c..aef8ee0 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -607,7 +607,7 @@ use_type: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.IdentifierToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -619,7 +619,7 @@ use_type: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.IdentifierToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -820,7 +820,7 @@ unprefixed_use_declaration: // save comments $2.Meta.SetTokenName(meta.AsToken).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.IdentifierToken).AppendTo(alias.GetMeta()) + $3.Meta.SetTokenName(meta.NodeStart).AppendTo(alias.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1300,7 +1300,7 @@ statement: // save comments $1.Meta.SetTokenName(meta.GotoToken).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.IdentifierToken).AppendTo(label.GetMeta()) + $2.Meta.SetTokenName(meta.NodeStart).AppendTo(label.GetMeta()) $3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken) @@ -1316,7 +1316,7 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.IdentifierToken).AppendTo(label.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo(label.GetMeta()) $2.Meta.SetTokenName(meta.ColonToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -1437,7 +1437,7 @@ function_declaration_statement: if $2 != nil { $2.Meta.SetTokenName(meta.AmpersandToken).AppendTo($$.GetMeta()) } - $3.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + $3.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) $5.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) $7.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) $9.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) @@ -1481,7 +1481,7 @@ class_declaration_statement: // save comments $2.Meta.SetTokenName(meta.ClassToken).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + $3.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) $7.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) $9.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) @@ -1498,7 +1498,7 @@ class_declaration_statement: // save comments $1.Meta.SetTokenName(meta.ClassToken).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + $2.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) $6.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) $8.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) @@ -1530,7 +1530,7 @@ class_modifier: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.IdentifierToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1542,7 +1542,7 @@ class_modifier: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.IdentifierToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1560,7 +1560,7 @@ trait_declaration_statement: // save comments $1.Meta.SetTokenName(meta.TraitToken).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + $2.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) $4.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) $6.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) @@ -1580,7 +1580,7 @@ interface_declaration_statement: // save comments $1.Meta.SetTokenName(meta.InterfaceToken).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + $2.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) $5.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) $7.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) @@ -2212,7 +2212,7 @@ type: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.IdentifierToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2224,7 +2224,7 @@ type: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.IdentifierToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2485,7 +2485,7 @@ class_statement: if $3 != nil { $3.Meta.SetTokenName(meta.AmpersandToken).AppendTo($$.GetMeta()) } - $4.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + $4.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) $6.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) $8.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) @@ -2616,7 +2616,7 @@ trait_alias: // save comments $2.Meta.SetTokenName(meta.AsToken).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.IdentifierToken).AppendTo(alias.GetMeta()) + $3.Meta.SetTokenName(meta.NodeStart).AppendTo(alias.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2631,7 +2631,7 @@ trait_alias: // save comments $2.Meta.SetTokenName(meta.AsToken).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.IdentifierToken).AppendTo(alias.GetMeta()) + $3.Meta.SetTokenName(meta.NodeStart).AppendTo(alias.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2646,7 +2646,7 @@ trait_alias: // save comments $2.Meta.SetTokenName(meta.AsToken).AppendTo($$.GetMeta()) - $4.Meta.SetTokenName(meta.IdentifierToken).AppendTo(alias.GetMeta()) + $4.Meta.SetTokenName(meta.NodeStart).AppendTo(alias.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2675,7 +2675,7 @@ trait_method_reference: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2699,7 +2699,7 @@ absolute_trait_method_reference: // save comments $2.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.IdentifierToken).AppendTo(target.GetMeta()) + $3.Meta.SetTokenName(meta.NodeStart).AppendTo(target.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2750,7 +2750,7 @@ variable_modifiers: modifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.IdentifierToken).AppendTo(modifier.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo(modifier.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2795,7 +2795,7 @@ member_modifier: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.IdentifierToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2807,7 +2807,7 @@ member_modifier: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.IdentifierToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2819,7 +2819,7 @@ member_modifier: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.IdentifierToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2831,7 +2831,7 @@ member_modifier: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.IdentifierToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2843,7 +2843,7 @@ member_modifier: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.IdentifierToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2855,7 +2855,7 @@ member_modifier: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.IdentifierToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2946,7 +2946,7 @@ class_const_decl: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) $2.Meta.SetTokenName(meta.EqualToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -2964,7 +2964,7 @@ const_decl: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) $2.Meta.SetTokenName(meta.EqualToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -4183,7 +4183,7 @@ class_name: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.IdentifierToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4518,7 +4518,7 @@ constant: // save comments $2.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.IdentifierToken).AppendTo(target.GetMeta()) + $3.Meta.SetTokenName(meta.NodeStart).AppendTo(target.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4533,7 +4533,7 @@ constant: // save comments $2.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.IdentifierToken).AppendTo(target.GetMeta()) + $3.Meta.SetTokenName(meta.NodeStart).AppendTo(target.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4890,7 +4890,7 @@ member_name: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.IdentifierToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4923,7 +4923,7 @@ property_name: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.IdentifierToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5180,7 +5180,7 @@ encaps_var: $1.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) $2.Meta.SetTokenName(meta.ObjectOperatorToken).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.IdentifierToken).AppendTo(fetch.GetMeta()) + $3.Meta.SetTokenName(meta.NodeStart).AppendTo(fetch.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5215,7 +5215,7 @@ encaps_var: // save comments $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) - $2.Meta.SetTokenName(meta.IdentifierToken).AppendTo(name.GetMeta()) + $2.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) $3.Meta.SetTokenName(meta.NodeEnd).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $3, meta.NodeEnd) diff --git a/printer/printer.go b/printer/printer.go index cdd578a..6f5a937 100644 --- a/printer/printer.go +++ b/printer/printer.go @@ -421,36 +421,14 @@ func (p *Printer) printNode(n node.Node) { func (p *Printer) printNodeRoot(n node.Node) { nn := n.(*node.Root) p.printMeta(nn, meta.NodeStart) - - // var stmts []node.Node - - // if len(nn.Stmts) > 0 { - // firstStmt := nn.Stmts[0] - // stmts = nn.Stmts[1:] - - // switch fs := firstStmt.(type) { - // case *stmt.InlineHtml: - // io.WriteString(p.w, fs.Value) - // io.WriteString(p.w, " Date: Thu, 25 Oct 2018 12:37:31 +0300 Subject: [PATCH 028/117] remove meta.UnknownToken --- meta/tokenName.go | 3 +-- meta/tokenName_string.go | 4 ++-- printer/printer.go | 4 ---- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/meta/tokenName.go b/meta/tokenName.go index 20105ec..c5d9348 100644 --- a/meta/tokenName.go +++ b/meta/tokenName.go @@ -5,8 +5,7 @@ type TokenName int //go:generate stringer -type=TokenName -output ./tokenName_string.go const ( - UnknownToken TokenName = iota - NodeStart + NodeStart TokenName = iota NodeEnd MagicConstantToken IncludeToken diff --git a/meta/tokenName_string.go b/meta/tokenName_string.go index 09f82f2..47acefe 100644 --- a/meta/tokenName_string.go +++ b/meta/tokenName_string.go @@ -4,9 +4,9 @@ package meta import "strconv" -const _TokenName_name = "UnknownTokenNodeStartNodeEndMagicConstantTokenIncludeTokenIncludeOnceTokenExitTokenIfTokenLnumberTokenDnumberTokenStringTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEncapsedAndWhitespaceTokenConstantEncapsedStringTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenUseTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenIssetTokenEmptyTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenListTokenArrayTokenCallableTokenStartHeredocTokenCurlyOpenTokenPaamayimNekudotayimTokenNamespaceTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenEvalTokenRequireTokenRequireOnceTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenNewAnchorCloneTokenElseifTokenElseTokenEndifTokenPrintTokenYieldTokenStaticTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenYieldFromTokenObjectOperatorTokenIntCastTokenDoubleCastTokenStringCastTokenArrayCastTokenObjectCastTokenBoolCastTokenUnsetCastTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenDoubleQuoteTokenBackquoteTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenExclamationMarkTokenTildeTokenAtTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" +const _TokenName_name = "NodeStartNodeEndMagicConstantTokenIncludeTokenIncludeOnceTokenExitTokenIfTokenLnumberTokenDnumberTokenStringTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEncapsedAndWhitespaceTokenConstantEncapsedStringTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenUseTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenIssetTokenEmptyTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenListTokenArrayTokenCallableTokenStartHeredocTokenCurlyOpenTokenPaamayimNekudotayimTokenNamespaceTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenEvalTokenRequireTokenRequireOnceTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenNewAnchorCloneTokenElseifTokenElseTokenEndifTokenPrintTokenYieldTokenStaticTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenYieldFromTokenObjectOperatorTokenIntCastTokenDoubleCastTokenStringCastTokenArrayCastTokenObjectCastTokenBoolCastTokenUnsetCastTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenDoubleQuoteTokenBackquoteTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenExclamationMarkTokenTildeTokenAtTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" -var _TokenName_index = [...]uint16{0, 12, 21, 28, 46, 58, 74, 83, 90, 102, 114, 125, 143, 157, 172, 198, 225, 234, 241, 251, 264, 285, 306, 314, 325, 337, 352, 364, 379, 386, 397, 411, 420, 432, 442, 455, 464, 477, 487, 498, 506, 516, 528, 538, 546, 560, 571, 579, 589, 599, 609, 619, 629, 643, 655, 670, 686, 695, 705, 718, 735, 749, 773, 787, 813, 829, 842, 851, 863, 879, 893, 908, 923, 938, 947, 957, 968, 977, 987, 997, 1007, 1018, 1031, 1041, 1053, 1067, 1078, 1086, 1094, 1108, 1127, 1139, 1154, 1169, 1183, 1198, 1211, 1225, 1238, 1252, 1266, 1281, 1294, 1307, 1320, 1336, 1349, 1362, 1374, 1387, 1399, 1411, 1425, 1440, 1448, 1455, 1462, 1478, 1497, 1509, 1524, 1545, 1566, 1583, 1601, 1617, 1631, 1651, 1672, 1686, 1696, 1716, 1737, 1754, 1772, 1789, 1803, 1813, 1822, 1842, 1852, 1859, 1869, 1885, 1895, 1905, 1918, 1928, 1940, 1949, 1961, 1969} +var _TokenName_index = [...]uint16{0, 9, 16, 34, 46, 62, 71, 78, 90, 102, 113, 131, 145, 160, 186, 213, 222, 229, 239, 252, 273, 294, 302, 313, 325, 340, 352, 367, 374, 385, 399, 408, 420, 430, 443, 452, 465, 475, 486, 494, 504, 516, 526, 534, 548, 559, 567, 577, 587, 597, 607, 617, 631, 643, 658, 674, 683, 693, 706, 723, 737, 761, 775, 801, 817, 830, 839, 851, 867, 881, 896, 911, 926, 935, 945, 956, 965, 975, 985, 995, 1006, 1019, 1029, 1041, 1055, 1066, 1074, 1082, 1096, 1115, 1127, 1142, 1157, 1171, 1186, 1199, 1213, 1226, 1240, 1254, 1269, 1282, 1295, 1308, 1324, 1337, 1350, 1362, 1375, 1387, 1399, 1413, 1428, 1436, 1443, 1450, 1466, 1485, 1497, 1512, 1533, 1554, 1571, 1589, 1605, 1619, 1639, 1660, 1674, 1684, 1704, 1725, 1742, 1760, 1777, 1791, 1801, 1810, 1830, 1840, 1847, 1857, 1873, 1883, 1893, 1906, 1916, 1928, 1937, 1949, 1957} func (i TokenName) String() string { if i < 0 || i >= TokenName(len(_TokenName_index)-1) { diff --git a/printer/printer.go b/printer/printer.go index 6f5a937..e0734c4 100644 --- a/printer/printer.go +++ b/printer/printer.go @@ -436,8 +436,6 @@ func (p *Printer) printNodeParameter(n node.Node) { nn := n.(*node.Parameter) p.printMeta(nn, meta.NodeStart) - p.printMeta(nn, meta.UnknownToken) - if nn.VariableType != nil { p.Print(nn.VariableType) } @@ -479,8 +477,6 @@ func (p *Printer) printNodeArgument(n node.Node) { nn := n.(*node.Argument) p.printMeta(nn, meta.NodeStart) - p.printMeta(nn, meta.UnknownToken) - if nn.IsReference { p.printMeta(nn, meta.AmpersandToken) io.WriteString(p.w, "&") From aa9fb90138a36ed33b9804eb0dae7a6c8ef6bf6d Mon Sep 17 00:00:00 2001 From: z7zmey Date: Thu, 25 Oct 2018 12:56:50 +0300 Subject: [PATCH 029/117] remove meta.QuestionMarkToken from node.Nullable --- php7/php7.go | 2 +- php7/php7.y | 2 +- printer/printer.go | 2 -- printer/printer_test.go | 2 +- 4 files changed, 3 insertions(+), 5 deletions(-) diff --git a/php7/php7.go b/php7/php7.go index a79537e..8543407 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -4581,7 +4581,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.QuestionMarkToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php7/php7.y b/php7/php7.y index aef8ee0..c685711 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -2197,7 +2197,7 @@ type_expr: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.QuestionMarkToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/printer/printer.go b/printer/printer.go index e0734c4..6082ce1 100644 --- a/printer/printer.go +++ b/printer/printer.go @@ -465,8 +465,6 @@ func (p *Printer) printNodeNullable(n node.Node) { nn := n.(*node.Nullable) p.printMeta(nn, meta.NodeStart) - p.printMeta(nn, meta.QuestionMarkToken) - io.WriteString(p.w, "?") p.Print(nn.Expr) diff --git a/printer/printer_test.go b/printer/printer_test.go index 2e0b8c9..8c12ae2 100644 --- a/printer/printer_test.go +++ b/printer/printer_test.go @@ -217,7 +217,7 @@ func TestPrinterPrintNullable(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.QuestionMarkToken, + TokenName: meta.NodeStart, }, }, Expr: &node.Parameter{ From 16de29a2a3da8c86b26b2c922c57805bca54de83 Mon Sep 17 00:00:00 2001 From: z7zmey Date: Thu, 25 Oct 2018 13:08:39 +0300 Subject: [PATCH 030/117] remove meta.ConstantEncapsedStringToken and meta.StringToken --- meta/tokenName.go | 2 -- meta/tokenName_string.go | 4 ++-- php5/php5.go | 8 ++++---- php5/php5.y | 8 ++++---- php7/php7.go | 8 ++++---- php7/php7.y | 8 ++++---- printer/printer.go | 6 ------ printer/printer_test.go | 22 +++++++++++----------- visitor/dumper_test.go | 4 ++-- visitor/go_dumper_test.go | 4 ++-- visitor/json_dumper_test.go | 2 +- visitor/pretty_json_dumper_test.go | 4 ++-- 12 files changed, 36 insertions(+), 44 deletions(-) diff --git a/meta/tokenName.go b/meta/tokenName.go index c5d9348..6a63c5f 100644 --- a/meta/tokenName.go +++ b/meta/tokenName.go @@ -14,12 +14,10 @@ const ( IfToken LnumberToken DnumberToken - StringToken StringVarnameToken NumStringToken InlineHTMLToken EncapsedAndWhitespaceToken - ConstantEncapsedStringToken EchoToken DoToken WhileToken diff --git a/meta/tokenName_string.go b/meta/tokenName_string.go index 47acefe..0e504a7 100644 --- a/meta/tokenName_string.go +++ b/meta/tokenName_string.go @@ -4,9 +4,9 @@ package meta import "strconv" -const _TokenName_name = "NodeStartNodeEndMagicConstantTokenIncludeTokenIncludeOnceTokenExitTokenIfTokenLnumberTokenDnumberTokenStringTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEncapsedAndWhitespaceTokenConstantEncapsedStringTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenUseTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenIssetTokenEmptyTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenListTokenArrayTokenCallableTokenStartHeredocTokenCurlyOpenTokenPaamayimNekudotayimTokenNamespaceTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenEvalTokenRequireTokenRequireOnceTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenNewAnchorCloneTokenElseifTokenElseTokenEndifTokenPrintTokenYieldTokenStaticTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenYieldFromTokenObjectOperatorTokenIntCastTokenDoubleCastTokenStringCastTokenArrayCastTokenObjectCastTokenBoolCastTokenUnsetCastTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenDoubleQuoteTokenBackquoteTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenExclamationMarkTokenTildeTokenAtTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" +const _TokenName_name = "NodeStartNodeEndMagicConstantTokenIncludeTokenIncludeOnceTokenExitTokenIfTokenLnumberTokenDnumberTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEncapsedAndWhitespaceTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenUseTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenIssetTokenEmptyTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenListTokenArrayTokenCallableTokenStartHeredocTokenCurlyOpenTokenPaamayimNekudotayimTokenNamespaceTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenEvalTokenRequireTokenRequireOnceTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenNewAnchorCloneTokenElseifTokenElseTokenEndifTokenPrintTokenYieldTokenStaticTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenYieldFromTokenObjectOperatorTokenIntCastTokenDoubleCastTokenStringCastTokenArrayCastTokenObjectCastTokenBoolCastTokenUnsetCastTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenDoubleQuoteTokenBackquoteTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenExclamationMarkTokenTildeTokenAtTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" -var _TokenName_index = [...]uint16{0, 9, 16, 34, 46, 62, 71, 78, 90, 102, 113, 131, 145, 160, 186, 213, 222, 229, 239, 252, 273, 294, 302, 313, 325, 340, 352, 367, 374, 385, 399, 408, 420, 430, 443, 452, 465, 475, 486, 494, 504, 516, 526, 534, 548, 559, 567, 577, 587, 597, 607, 617, 631, 643, 658, 674, 683, 693, 706, 723, 737, 761, 775, 801, 817, 830, 839, 851, 867, 881, 896, 911, 926, 935, 945, 956, 965, 975, 985, 995, 1006, 1019, 1029, 1041, 1055, 1066, 1074, 1082, 1096, 1115, 1127, 1142, 1157, 1171, 1186, 1199, 1213, 1226, 1240, 1254, 1269, 1282, 1295, 1308, 1324, 1337, 1350, 1362, 1375, 1387, 1399, 1413, 1428, 1436, 1443, 1450, 1466, 1485, 1497, 1512, 1533, 1554, 1571, 1589, 1605, 1619, 1639, 1660, 1674, 1684, 1704, 1725, 1742, 1760, 1777, 1791, 1801, 1810, 1830, 1840, 1847, 1857, 1873, 1883, 1893, 1906, 1916, 1928, 1937, 1949, 1957} +var _TokenName_index = [...]uint16{0, 9, 16, 34, 46, 62, 71, 78, 90, 102, 120, 134, 149, 175, 184, 191, 201, 214, 235, 256, 264, 275, 287, 302, 314, 329, 336, 347, 361, 370, 382, 392, 405, 414, 427, 437, 448, 456, 466, 478, 488, 496, 510, 521, 529, 539, 549, 559, 569, 579, 593, 605, 620, 636, 645, 655, 668, 685, 699, 723, 737, 763, 779, 792, 801, 813, 829, 843, 858, 873, 888, 897, 907, 918, 927, 937, 947, 957, 968, 981, 991, 1003, 1017, 1028, 1036, 1044, 1058, 1077, 1089, 1104, 1119, 1133, 1148, 1161, 1175, 1188, 1202, 1216, 1231, 1244, 1257, 1270, 1286, 1299, 1312, 1324, 1337, 1349, 1361, 1375, 1390, 1398, 1405, 1412, 1428, 1447, 1459, 1474, 1495, 1516, 1533, 1551, 1567, 1581, 1601, 1622, 1636, 1646, 1666, 1687, 1704, 1722, 1739, 1753, 1763, 1772, 1792, 1802, 1809, 1819, 1835, 1845, 1855, 1868, 1878, 1890, 1899, 1911, 1919} func (i TokenName) String() string { if i < 0 || i >= TokenName(len(_TokenName_index)-1) { diff --git a/php5/php5.go b/php5/php5.go index 537b826..f1b66fa 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -2367,7 +2367,7 @@ yydefault: namePart.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.StringToken).AppendTo(namePart.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(namePart.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2383,7 +2383,7 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.StringToken).AppendTo(namePart.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(namePart.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7330,7 +7330,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.ConstantEncapsedStringToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -9329,7 +9329,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.StringToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php5/php5.y b/php5/php5.y index 2e25f08..3283cac 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -317,7 +317,7 @@ namespace_name: namePart.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.StringToken).AppendTo(namePart.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo(namePart.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -331,7 +331,7 @@ namespace_name: // save comments $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) - $3.Meta.SetTokenName(meta.StringToken).AppendTo(namePart.GetMeta()) + $3.Meta.SetTokenName(meta.NodeStart).AppendTo(namePart.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4910,7 +4910,7 @@ common_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.ConstantEncapsedStringToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6743,7 +6743,7 @@ encaps_var_offset: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.StringToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php7/php7.go b/php7/php7.go index 8543407..f4b717a 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -2614,7 +2614,7 @@ yydefault: namePart.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.StringToken).AppendTo(namePart.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(namePart.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2630,7 +2630,7 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.StringToken).AppendTo(namePart.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(namePart.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6897,7 +6897,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.ConstantEncapsedStringToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7954,7 +7954,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.StringToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php7/php7.y b/php7/php7.y index c685711..c530fb2 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -367,7 +367,7 @@ namespace_name: namePart.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.StringToken).AppendTo(namePart.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo(namePart.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -381,7 +381,7 @@ namespace_name: // save comments $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) - $3.Meta.SetTokenName(meta.StringToken).AppendTo(namePart.GetMeta()) + $3.Meta.SetTokenName(meta.NodeStart).AppendTo(namePart.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4306,7 +4306,7 @@ dereferencable_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.ConstantEncapsedStringToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5268,7 +5268,7 @@ encaps_var_offset: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.StringToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/printer/printer.go b/printer/printer.go index 6082ce1..aa2291f 100644 --- a/printer/printer.go +++ b/printer/printer.go @@ -496,8 +496,6 @@ func (p *Printer) printNameNamePart(n node.Node) { nn := n.(*name.NamePart) p.printMeta(nn, meta.NodeStart) - p.printMeta(nn, meta.StringToken) - io.WriteString(p.w, nn.Value) p.printMeta(nn, meta.NsSeparatorToken) @@ -509,8 +507,6 @@ func (p *Printer) printNameName(n node.Node) { nn := n.(*name.Name) p.printMeta(nn, meta.NodeStart) - p.printMeta(nn, meta.StringToken) - for k, part := range nn.Parts { if k > 0 { io.WriteString(p.w, "\\") @@ -581,8 +577,6 @@ func (p *Printer) printScalarString(n node.Node) { nn := n.(*scalar.String) p.printMeta(nn, meta.NodeStart) - p.printMeta(nn, meta.ConstantEncapsedStringToken) - io.WriteString(p.w, nn.Value) p.printMeta(nn, meta.NodeEnd) diff --git a/printer/printer_test.go b/printer/printer_test.go index 8c12ae2..4cef869 100644 --- a/printer/printer_test.go +++ b/printer/printer_test.go @@ -171,7 +171,7 @@ func TestPrinterPrintParameter(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.StringToken, + TokenName: meta.NodeStart, }, }, Value: "Foo", @@ -193,7 +193,7 @@ func TestPrinterPrintParameter(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.ConstantEncapsedStringToken, + TokenName: meta.NodeStart, }, }, Value: "'default'", @@ -271,7 +271,7 @@ func TestPrinterPrintNullable(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.ConstantEncapsedStringToken, + TokenName: meta.NodeStart, }, }, Value: "'default'", @@ -379,17 +379,17 @@ func TestPrinterPrintNameNamePart(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.StringToken, + TokenName: meta.NodeStart, }, &meta.Data{ Type: meta.CommentType, Value: "/*comment*/", - TokenName: meta.StringToken, + TokenName: meta.NodeStart, }, &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.StringToken, + TokenName: meta.NodeStart, }, &meta.Data{ Type: meta.WhiteSpaceType, @@ -417,7 +417,7 @@ func TestPrinterPrintNameName(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.StringToken, + TokenName: meta.NodeStart, }, }, Parts: []node.Node{ @@ -426,12 +426,12 @@ func TestPrinterPrintNameName(t *testing.T) { &meta.Data{ Type: meta.CommentType, Value: "/*comment*/", - TokenName: meta.StringToken, + TokenName: meta.NodeStart, }, &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.StringToken, + TokenName: meta.NodeStart, }, &meta.Data{ Type: meta.WhiteSpaceType, @@ -577,7 +577,7 @@ func TestPrinterPrintScalarString(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.ConstantEncapsedStringToken, + TokenName: meta.NodeStart, }, }, Value: "'hello world'", @@ -3833,7 +3833,7 @@ func TestPrinterPrintNew(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.StringToken, + TokenName: meta.NodeStart, }, }, Value: "Foo", diff --git a/visitor/dumper_test.go b/visitor/dumper_test.go index e6b11f4..188c61a 100644 --- a/visitor/dumper_test.go +++ b/visitor/dumper_test.go @@ -54,7 +54,7 @@ func ExampleDumper() { // | [*name.NamePart] // | "Position": Pos{Line: 3-3 Pos: 20-22} // | "Meta": - // | " " before "StringToken" + // | " " before "NodeStart" // | "Value": "Foo" // | "Stmts": // | [*stmt.Class] @@ -126,7 +126,7 @@ func ExampleDumper() { // | [*name.NamePart] // | "Position": Pos{Line: 5-5 Pos: 86-89} // | "Meta": - // | " " before "StringToken" + // | " " before "NodeStart" // | "Value": "null" // | "Stmt": // | [*stmt.StmtList] diff --git a/visitor/go_dumper_test.go b/visitor/go_dumper_test.go index ed40d31..5c4f66e 100644 --- a/visitor/go_dumper_test.go +++ b/visitor/go_dumper_test.go @@ -121,7 +121,7 @@ func ExampleGoDumper() { // EndPos: 19, // }, // Value: " ", - // TokenName: meta.StringToken, + // TokenName: meta.NodeStart, // }, // }, // Value: "Foo", @@ -373,7 +373,7 @@ func ExampleGoDumper() { // EndPos: 85, // }, // Value: " ", - // TokenName: meta.StringToken, + // TokenName: meta.NodeStart, // }, // }, // Value: "null", diff --git a/visitor/json_dumper_test.go b/visitor/json_dumper_test.go index 59ec49e..9ea6d51 100644 --- a/visitor/json_dumper_test.go +++ b/visitor/json_dumper_test.go @@ -37,5 +37,5 @@ func ExampleJsonDumper() { nodes.Walk(dumper) // Output: - // {"type":"*node.Root","position":{"startPos":10,"endPos":166,"startLine":3,"endLine":12},"Stmts":[{"type":"*stmt.Namespace","position":{"startPos":10,"endPos":166,"startLine":3,"endLine":12},"meta":[{"type":"*meta.TokenType","value":" Date: Thu, 25 Oct 2018 13:32:18 +0300 Subject: [PATCH 031/117] remove meta.NamespaceToken --- meta/tokenName.go | 1 - meta/tokenName_string.go | 4 ++-- php5/php5.go | 26 +++++++++++++------------- php5/php5.y | 26 +++++++++++++------------- php7/php7.go | 10 +++++----- php7/php7.y | 10 +++++----- printer/printer.go | 13 +++---------- printer/printer_parsed_php7_test.go | 2 +- printer/printer_test.go | 12 ++++++------ visitor/dumper_test.go | 4 ++-- visitor/go_dumper_test.go | 4 ++-- visitor/json_dumper_test.go | 2 +- visitor/pretty_json_dumper_test.go | 4 ++-- 13 files changed, 55 insertions(+), 63 deletions(-) diff --git a/meta/tokenName.go b/meta/tokenName.go index 6a63c5f..946b69e 100644 --- a/meta/tokenName.go +++ b/meta/tokenName.go @@ -64,7 +64,6 @@ const ( StartHeredocToken CurlyOpenToken PaamayimNekudotayimToken - NamespaceToken UseLeadingNsSeparatorToken NsSeparatorToken EllipsisToken diff --git a/meta/tokenName_string.go b/meta/tokenName_string.go index 0e504a7..e69d91f 100644 --- a/meta/tokenName_string.go +++ b/meta/tokenName_string.go @@ -4,9 +4,9 @@ package meta import "strconv" -const _TokenName_name = "NodeStartNodeEndMagicConstantTokenIncludeTokenIncludeOnceTokenExitTokenIfTokenLnumberTokenDnumberTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEncapsedAndWhitespaceTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenUseTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenIssetTokenEmptyTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenListTokenArrayTokenCallableTokenStartHeredocTokenCurlyOpenTokenPaamayimNekudotayimTokenNamespaceTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenEvalTokenRequireTokenRequireOnceTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenNewAnchorCloneTokenElseifTokenElseTokenEndifTokenPrintTokenYieldTokenStaticTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenYieldFromTokenObjectOperatorTokenIntCastTokenDoubleCastTokenStringCastTokenArrayCastTokenObjectCastTokenBoolCastTokenUnsetCastTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenDoubleQuoteTokenBackquoteTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenExclamationMarkTokenTildeTokenAtTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" +const _TokenName_name = "NodeStartNodeEndMagicConstantTokenIncludeTokenIncludeOnceTokenExitTokenIfTokenLnumberTokenDnumberTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEncapsedAndWhitespaceTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenUseTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenIssetTokenEmptyTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenListTokenArrayTokenCallableTokenStartHeredocTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenEvalTokenRequireTokenRequireOnceTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenNewAnchorCloneTokenElseifTokenElseTokenEndifTokenPrintTokenYieldTokenStaticTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenYieldFromTokenObjectOperatorTokenIntCastTokenDoubleCastTokenStringCastTokenArrayCastTokenObjectCastTokenBoolCastTokenUnsetCastTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenDoubleQuoteTokenBackquoteTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenExclamationMarkTokenTildeTokenAtTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" -var _TokenName_index = [...]uint16{0, 9, 16, 34, 46, 62, 71, 78, 90, 102, 120, 134, 149, 175, 184, 191, 201, 214, 235, 256, 264, 275, 287, 302, 314, 329, 336, 347, 361, 370, 382, 392, 405, 414, 427, 437, 448, 456, 466, 478, 488, 496, 510, 521, 529, 539, 549, 559, 569, 579, 593, 605, 620, 636, 645, 655, 668, 685, 699, 723, 737, 763, 779, 792, 801, 813, 829, 843, 858, 873, 888, 897, 907, 918, 927, 937, 947, 957, 968, 981, 991, 1003, 1017, 1028, 1036, 1044, 1058, 1077, 1089, 1104, 1119, 1133, 1148, 1161, 1175, 1188, 1202, 1216, 1231, 1244, 1257, 1270, 1286, 1299, 1312, 1324, 1337, 1349, 1361, 1375, 1390, 1398, 1405, 1412, 1428, 1447, 1459, 1474, 1495, 1516, 1533, 1551, 1567, 1581, 1601, 1622, 1636, 1646, 1666, 1687, 1704, 1722, 1739, 1753, 1763, 1772, 1792, 1802, 1809, 1819, 1835, 1845, 1855, 1868, 1878, 1890, 1899, 1911, 1919} +var _TokenName_index = [...]uint16{0, 9, 16, 34, 46, 62, 71, 78, 90, 102, 120, 134, 149, 175, 184, 191, 201, 214, 235, 256, 264, 275, 287, 302, 314, 329, 336, 347, 361, 370, 382, 392, 405, 414, 427, 437, 448, 456, 466, 478, 488, 496, 510, 521, 529, 539, 549, 559, 569, 579, 593, 605, 620, 636, 645, 655, 668, 685, 699, 723, 749, 765, 778, 787, 799, 815, 829, 844, 859, 874, 883, 893, 904, 913, 923, 933, 943, 954, 967, 977, 989, 1003, 1014, 1022, 1030, 1044, 1063, 1075, 1090, 1105, 1119, 1134, 1147, 1161, 1174, 1188, 1202, 1217, 1230, 1243, 1256, 1272, 1285, 1298, 1310, 1323, 1335, 1347, 1361, 1376, 1384, 1391, 1398, 1414, 1433, 1445, 1460, 1481, 1502, 1519, 1537, 1553, 1567, 1587, 1608, 1622, 1632, 1652, 1673, 1690, 1708, 1725, 1739, 1749, 1758, 1778, 1788, 1795, 1805, 1821, 1831, 1841, 1854, 1864, 1876, 1885, 1897, 1905} func (i TokenName) String() string { if i < 0 || i >= TokenName(len(_TokenName_index)-1) { diff --git a/php5/php5.go b/php5/php5.go index f1b66fa..18851a3 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -2452,7 +2452,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NamespaceToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.SemiColonToken) @@ -2470,7 +2470,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[5].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NamespaceToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[5].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) @@ -2486,7 +2486,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NamespaceToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) @@ -6936,7 +6936,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(funcName, yyDollar[4].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NamespaceToken).AppendTo(funcName.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(funcName.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo(funcName.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -6953,7 +6953,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(funcName, yyDollar[3].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo(funcName.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(funcName.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7059,7 +7059,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NamespaceToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -7074,7 +7074,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7099,7 +7099,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NamespaceToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -7114,7 +7114,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7528,7 +7528,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NamespaceToken).AppendTo(name.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo(name.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -7545,7 +7545,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo(name.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -8107,7 +8107,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(name)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NamespaceToken).AppendTo(name.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo(name.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -8124,7 +8124,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(name)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo(name.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php5/php5.y b/php5/php5.y index 3283cac..6199b49 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -391,7 +391,7 @@ top_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.NamespaceToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken) @@ -407,7 +407,7 @@ top_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5)) // save comments - $1.Meta.SetTokenName(meta.NamespaceToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $3.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) $5.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) @@ -421,7 +421,7 @@ top_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $1.Meta.SetTokenName(meta.NamespaceToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $2.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) $4.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) @@ -4546,7 +4546,7 @@ function_call: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(funcName, $4)) // save comments - $1.Meta.SetTokenName(meta.NamespaceToken).AppendTo(funcName.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo(funcName.GetMeta()) $2.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo(funcName.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -4561,7 +4561,7 @@ function_call: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(funcName, $3)) // save comments - $1.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo(funcName.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo(funcName.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4654,7 +4654,7 @@ class_name: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.NamespaceToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $2.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -4667,7 +4667,7 @@ class_name: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4691,7 +4691,7 @@ fully_qualified_class_name: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.NamespaceToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $2.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -4704,7 +4704,7 @@ fully_qualified_class_name: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5087,7 +5087,7 @@ static_scalar_value: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.NamespaceToken).AppendTo(name.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) $2.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo(name.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -5102,7 +5102,7 @@ static_scalar_value: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo(name.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5588,7 +5588,7 @@ general_constant: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(name)) // save comments - $1.Meta.SetTokenName(meta.NamespaceToken).AppendTo(name.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) $2.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo(name.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -5603,7 +5603,7 @@ general_constant: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(name)) // save comments - $1.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo(name.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php7/php7.go b/php7/php7.go index f4b717a..21fce64 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -2655,7 +2655,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NamespaceToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -2670,7 +2670,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2755,7 +2755,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NamespaceToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.SemiColonToken) @@ -2773,7 +2773,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[5].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NamespaceToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[5].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) @@ -2789,7 +2789,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NamespaceToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) diff --git a/php7/php7.y b/php7/php7.y index c530fb2..09106c1 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -405,7 +405,7 @@ name: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.NamespaceToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $2.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -418,7 +418,7 @@ name: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -490,7 +490,7 @@ top_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.NamespaceToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken) @@ -506,7 +506,7 @@ top_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5)) // save comments - $1.Meta.SetTokenName(meta.NamespaceToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $3.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) $5.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) @@ -520,7 +520,7 @@ top_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $1.Meta.SetTokenName(meta.NamespaceToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $2.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) $4.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) diff --git a/printer/printer.go b/printer/printer.go index aa2291f..2ab5fa6 100644 --- a/printer/printer.go +++ b/printer/printer.go @@ -522,8 +522,6 @@ func (p *Printer) printNameFullyQualified(n node.Node) { nn := n.(*name.FullyQualified) p.printMeta(nn, meta.NodeStart) - p.printMeta(nn, meta.NsSeparatorToken) - for _, part := range nn.Parts { io.WriteString(p.w, "\\") p.Print(part) @@ -535,13 +533,10 @@ func (p *Printer) printNameFullyQualified(n node.Node) { func (p *Printer) printNameRelative(n node.Node) { nn := n.(*name.Relative) p.printMeta(nn, meta.NodeStart) - - p.printMeta(nn, meta.NamespaceToken) io.WriteString(p.w, "namespace") - for k, part := range nn.Parts { - if k == 0 { - p.printMeta(nn, meta.NsSeparatorToken) - } + p.printMeta(nn, meta.NsSeparatorToken) + + for _, part := range nn.Parts { io.WriteString(p.w, "\\") p.Print(part) } @@ -2515,8 +2510,6 @@ func (p *Printer) printStmtLabel(n node.Node) { func (p *Printer) printStmtNamespace(n node.Node) { nn := n.(*stmt.Namespace) p.printMeta(nn, meta.NodeStart) - - p.printMeta(n, meta.NamespaceToken) io.WriteString(p.w, "namespace") if nn.NamespaceName != nil { diff --git a/printer/printer_parsed_php7_test.go b/printer/printer_parsed_php7_test.go index 9f07ef8..d83ff60 100644 --- a/printer/printer_parsed_php7_test.go +++ b/printer/printer_parsed_php7_test.go @@ -113,7 +113,7 @@ func TestParseAndPrintParameter(t *testing.T) { function & foo ( ? int $a , & $b = null , \ Foo ...$c - ) : namespace \ Bar { + ) : namespace \ Bar \ baz \ quuz{ ; }` diff --git a/printer/printer_test.go b/printer/printer_test.go index 4cef869..b633ffd 100644 --- a/printer/printer_test.go +++ b/printer/printer_test.go @@ -162,7 +162,7 @@ func TestPrinterPrintParameter(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.NsSeparatorToken, + TokenName: meta.NodeStart, }, }, Parts: []node.Node{ @@ -240,7 +240,7 @@ func TestPrinterPrintNullable(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.NsSeparatorToken, + TokenName: meta.NodeStart, }, }, Parts: []node.Node{ @@ -464,7 +464,7 @@ func TestPrinterPrintNameFullyQualified(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.NsSeparatorToken, + TokenName: meta.NodeStart, }, }, Parts: []node.Node{ @@ -494,7 +494,7 @@ func TestPrinterPrintNameRelative(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.NamespaceToken, + TokenName: meta.NodeStart, }, &meta.Data{ Type: meta.WhiteSpaceType, @@ -7524,7 +7524,7 @@ func TestPrinterPrintNamespace(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.NamespaceToken, + TokenName: meta.NodeStart, }, &meta.Data{ Type: meta.WhiteSpaceType, @@ -7557,7 +7557,7 @@ func TestPrinterPrintNamespaceWithStmts(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.NamespaceToken, + TokenName: meta.NodeStart, }, &meta.Data{ Type: meta.WhiteSpaceType, diff --git a/visitor/dumper_test.go b/visitor/dumper_test.go index 188c61a..192b6b2 100644 --- a/visitor/dumper_test.go +++ b/visitor/dumper_test.go @@ -43,8 +43,8 @@ func ExampleDumper() { // | [*stmt.Namespace] // | "Position": Pos{Line: 3-11 Pos: 10-143} // | "Meta": - // | " Date: Thu, 25 Oct 2018 13:43:04 +0300 Subject: [PATCH 032/117] remove meta.LnumberToken and meta.DnumberToken --- meta/tokenName.go | 2 -- meta/tokenName_string.go | 4 ++-- php5/php5.go | 4 ++-- php5/php5.y | 4 ++-- php7/php7.go | 4 ++-- php7/php7.y | 4 ++-- printer/printer.go | 8 -------- printer/printer_test.go | 4 ++-- 8 files changed, 12 insertions(+), 22 deletions(-) diff --git a/meta/tokenName.go b/meta/tokenName.go index 946b69e..4aaf729 100644 --- a/meta/tokenName.go +++ b/meta/tokenName.go @@ -12,8 +12,6 @@ const ( IncludeOnceToken ExitToken IfToken - LnumberToken - DnumberToken StringVarnameToken NumStringToken InlineHTMLToken diff --git a/meta/tokenName_string.go b/meta/tokenName_string.go index e69d91f..64919e5 100644 --- a/meta/tokenName_string.go +++ b/meta/tokenName_string.go @@ -4,9 +4,9 @@ package meta import "strconv" -const _TokenName_name = "NodeStartNodeEndMagicConstantTokenIncludeTokenIncludeOnceTokenExitTokenIfTokenLnumberTokenDnumberTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEncapsedAndWhitespaceTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenUseTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenIssetTokenEmptyTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenListTokenArrayTokenCallableTokenStartHeredocTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenEvalTokenRequireTokenRequireOnceTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenNewAnchorCloneTokenElseifTokenElseTokenEndifTokenPrintTokenYieldTokenStaticTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenYieldFromTokenObjectOperatorTokenIntCastTokenDoubleCastTokenStringCastTokenArrayCastTokenObjectCastTokenBoolCastTokenUnsetCastTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenDoubleQuoteTokenBackquoteTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenExclamationMarkTokenTildeTokenAtTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" +const _TokenName_name = "NodeStartNodeEndMagicConstantTokenIncludeTokenIncludeOnceTokenExitTokenIfTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEncapsedAndWhitespaceTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenUseTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenIssetTokenEmptyTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenListTokenArrayTokenCallableTokenStartHeredocTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenEvalTokenRequireTokenRequireOnceTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenNewAnchorCloneTokenElseifTokenElseTokenEndifTokenPrintTokenYieldTokenStaticTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenYieldFromTokenObjectOperatorTokenIntCastTokenDoubleCastTokenStringCastTokenArrayCastTokenObjectCastTokenBoolCastTokenUnsetCastTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenDoubleQuoteTokenBackquoteTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenExclamationMarkTokenTildeTokenAtTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" -var _TokenName_index = [...]uint16{0, 9, 16, 34, 46, 62, 71, 78, 90, 102, 120, 134, 149, 175, 184, 191, 201, 214, 235, 256, 264, 275, 287, 302, 314, 329, 336, 347, 361, 370, 382, 392, 405, 414, 427, 437, 448, 456, 466, 478, 488, 496, 510, 521, 529, 539, 549, 559, 569, 579, 593, 605, 620, 636, 645, 655, 668, 685, 699, 723, 749, 765, 778, 787, 799, 815, 829, 844, 859, 874, 883, 893, 904, 913, 923, 933, 943, 954, 967, 977, 989, 1003, 1014, 1022, 1030, 1044, 1063, 1075, 1090, 1105, 1119, 1134, 1147, 1161, 1174, 1188, 1202, 1217, 1230, 1243, 1256, 1272, 1285, 1298, 1310, 1323, 1335, 1347, 1361, 1376, 1384, 1391, 1398, 1414, 1433, 1445, 1460, 1481, 1502, 1519, 1537, 1553, 1567, 1587, 1608, 1622, 1632, 1652, 1673, 1690, 1708, 1725, 1739, 1749, 1758, 1778, 1788, 1795, 1805, 1821, 1831, 1841, 1854, 1864, 1876, 1885, 1897, 1905} +var _TokenName_index = [...]uint16{0, 9, 16, 34, 46, 62, 71, 78, 96, 110, 125, 151, 160, 167, 177, 190, 211, 232, 240, 251, 263, 278, 290, 305, 312, 323, 337, 346, 358, 368, 381, 390, 403, 413, 424, 432, 442, 454, 464, 472, 486, 497, 505, 515, 525, 535, 545, 555, 569, 581, 596, 612, 621, 631, 644, 661, 675, 699, 725, 741, 754, 763, 775, 791, 805, 820, 835, 850, 859, 869, 880, 889, 899, 909, 919, 930, 943, 953, 965, 979, 990, 998, 1006, 1020, 1039, 1051, 1066, 1081, 1095, 1110, 1123, 1137, 1150, 1164, 1178, 1193, 1206, 1219, 1232, 1248, 1261, 1274, 1286, 1299, 1311, 1323, 1337, 1352, 1360, 1367, 1374, 1390, 1409, 1421, 1436, 1457, 1478, 1495, 1513, 1529, 1543, 1563, 1584, 1598, 1608, 1628, 1649, 1666, 1684, 1701, 1715, 1725, 1734, 1754, 1764, 1771, 1781, 1797, 1807, 1817, 1830, 1840, 1852, 1861, 1873, 1881} func (i TokenName) String() string { if i < 0 || i >= TokenName(len(_TokenName_index)-1) { diff --git a/php5/php5.go b/php5/php5.go index 18851a3..ae60f85 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -7302,7 +7302,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.LnumberToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7316,7 +7316,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.DnumberToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php5/php5.y b/php5/php5.y index 6199b49..51bd7e1 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -4886,7 +4886,7 @@ common_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.LnumberToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4898,7 +4898,7 @@ common_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.DnumberToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php7/php7.go b/php7/php7.go index 21fce64..fc020e7 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -6911,7 +6911,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.LnumberToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6925,7 +6925,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.DnumberToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php7/php7.y b/php7/php7.y index 09106c1..e7d3829 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -4321,7 +4321,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.LnumberToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4333,7 +4333,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.DnumberToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/printer/printer.go b/printer/printer.go index 2ab5fa6..9df3fc2 100644 --- a/printer/printer.go +++ b/printer/printer.go @@ -549,22 +549,14 @@ func (p *Printer) printNameRelative(n node.Node) { func (p *Printer) printScalarLNumber(n node.Node) { nn := n.(*scalar.Lnumber) p.printMeta(nn, meta.NodeStart) - - p.printMeta(nn, meta.LnumberToken) - io.WriteString(p.w, nn.Value) - p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printScalarDNumber(n node.Node) { nn := n.(*scalar.Dnumber) p.printMeta(nn, meta.NodeStart) - - p.printMeta(nn, meta.DnumberToken) - io.WriteString(p.w, nn.Value) - p.printMeta(nn, meta.NodeEnd) } diff --git a/printer/printer_test.go b/printer/printer_test.go index b633ffd..6bcafb0 100644 --- a/printer/printer_test.go +++ b/printer/printer_test.go @@ -531,7 +531,7 @@ func TestPrinterPrintScalarLNumber(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.LnumberToken, + TokenName: meta.NodeStart, }, }, Value: "1", @@ -554,7 +554,7 @@ func TestPrinterPrintScalarDNumber(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.DnumberToken, + TokenName: meta.NodeStart, }, }, Value: ".1", From 3aa4406a9535c480fac44d7bb06beda28ca3aaf5 Mon Sep 17 00:00:00 2001 From: z7zmey Date: Thu, 25 Oct 2018 13:46:41 +0300 Subject: [PATCH 033/117] remove meta.EncapsedAndWhitespaceToken --- meta/tokenName.go | 1 - meta/tokenName_string.go | 4 ++-- php5/php5.go | 4 ++-- php5/php5.y | 4 ++-- php7/php7.go | 4 ++-- php7/php7.y | 4 ++-- printer/printer.go | 6 ------ printer/printer_test.go | 2 +- 8 files changed, 11 insertions(+), 18 deletions(-) diff --git a/meta/tokenName.go b/meta/tokenName.go index 4aaf729..99b1682 100644 --- a/meta/tokenName.go +++ b/meta/tokenName.go @@ -15,7 +15,6 @@ const ( StringVarnameToken NumStringToken InlineHTMLToken - EncapsedAndWhitespaceToken EchoToken DoToken WhileToken diff --git a/meta/tokenName_string.go b/meta/tokenName_string.go index 64919e5..0cbb834 100644 --- a/meta/tokenName_string.go +++ b/meta/tokenName_string.go @@ -4,9 +4,9 @@ package meta import "strconv" -const _TokenName_name = "NodeStartNodeEndMagicConstantTokenIncludeTokenIncludeOnceTokenExitTokenIfTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEncapsedAndWhitespaceTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenUseTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenIssetTokenEmptyTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenListTokenArrayTokenCallableTokenStartHeredocTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenEvalTokenRequireTokenRequireOnceTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenNewAnchorCloneTokenElseifTokenElseTokenEndifTokenPrintTokenYieldTokenStaticTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenYieldFromTokenObjectOperatorTokenIntCastTokenDoubleCastTokenStringCastTokenArrayCastTokenObjectCastTokenBoolCastTokenUnsetCastTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenDoubleQuoteTokenBackquoteTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenExclamationMarkTokenTildeTokenAtTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" +const _TokenName_name = "NodeStartNodeEndMagicConstantTokenIncludeTokenIncludeOnceTokenExitTokenIfTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenUseTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenIssetTokenEmptyTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenListTokenArrayTokenCallableTokenStartHeredocTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenEvalTokenRequireTokenRequireOnceTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenNewAnchorCloneTokenElseifTokenElseTokenEndifTokenPrintTokenYieldTokenStaticTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenYieldFromTokenObjectOperatorTokenIntCastTokenDoubleCastTokenStringCastTokenArrayCastTokenObjectCastTokenBoolCastTokenUnsetCastTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenDoubleQuoteTokenBackquoteTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenExclamationMarkTokenTildeTokenAtTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" -var _TokenName_index = [...]uint16{0, 9, 16, 34, 46, 62, 71, 78, 96, 110, 125, 151, 160, 167, 177, 190, 211, 232, 240, 251, 263, 278, 290, 305, 312, 323, 337, 346, 358, 368, 381, 390, 403, 413, 424, 432, 442, 454, 464, 472, 486, 497, 505, 515, 525, 535, 545, 555, 569, 581, 596, 612, 621, 631, 644, 661, 675, 699, 725, 741, 754, 763, 775, 791, 805, 820, 835, 850, 859, 869, 880, 889, 899, 909, 919, 930, 943, 953, 965, 979, 990, 998, 1006, 1020, 1039, 1051, 1066, 1081, 1095, 1110, 1123, 1137, 1150, 1164, 1178, 1193, 1206, 1219, 1232, 1248, 1261, 1274, 1286, 1299, 1311, 1323, 1337, 1352, 1360, 1367, 1374, 1390, 1409, 1421, 1436, 1457, 1478, 1495, 1513, 1529, 1543, 1563, 1584, 1598, 1608, 1628, 1649, 1666, 1684, 1701, 1715, 1725, 1734, 1754, 1764, 1771, 1781, 1797, 1807, 1817, 1830, 1840, 1852, 1861, 1873, 1881} +var _TokenName_index = [...]uint16{0, 9, 16, 34, 46, 62, 71, 78, 96, 110, 125, 134, 141, 151, 164, 185, 206, 214, 225, 237, 252, 264, 279, 286, 297, 311, 320, 332, 342, 355, 364, 377, 387, 398, 406, 416, 428, 438, 446, 460, 471, 479, 489, 499, 509, 519, 529, 543, 555, 570, 586, 595, 605, 618, 635, 649, 673, 699, 715, 728, 737, 749, 765, 779, 794, 809, 824, 833, 843, 854, 863, 873, 883, 893, 904, 917, 927, 939, 953, 964, 972, 980, 994, 1013, 1025, 1040, 1055, 1069, 1084, 1097, 1111, 1124, 1138, 1152, 1167, 1180, 1193, 1206, 1222, 1235, 1248, 1260, 1273, 1285, 1297, 1311, 1326, 1334, 1341, 1348, 1364, 1383, 1395, 1410, 1431, 1452, 1469, 1487, 1503, 1517, 1537, 1558, 1572, 1582, 1602, 1623, 1640, 1658, 1675, 1689, 1699, 1708, 1728, 1738, 1745, 1755, 1771, 1781, 1791, 1804, 1814, 1826, 1835, 1847, 1855} func (i TokenName) String() string { if i < 0 || i >= TokenName(len(_TokenName_index)-1) { diff --git a/php5/php5.go b/php5/php5.go index ae60f85..59160f0 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -9148,7 +9148,7 @@ yydefault: encapsed.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.EncapsedAndWhitespaceToken).AppendTo(encapsed.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(encapsed.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -9171,7 +9171,7 @@ yydefault: encapsed.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.EncapsedAndWhitespaceToken).AppendTo(encapsed.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(encapsed.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php5/php5.y b/php5/php5.y index 51bd7e1..3bbbe6d 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -6576,7 +6576,7 @@ encaps_list: encapsed.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) // save comments - $2.Meta.SetTokenName(meta.EncapsedAndWhitespaceToken).AppendTo(encapsed.GetMeta()) + $2.Meta.SetTokenName(meta.NodeStart).AppendTo(encapsed.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6595,7 +6595,7 @@ encaps_list: encapsed.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.EncapsedAndWhitespaceToken).AppendTo(encapsed.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo(encapsed.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php7/php7.go b/php7/php7.go index fc020e7..9b7cf91 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -7773,7 +7773,7 @@ yydefault: encapsed.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.EncapsedAndWhitespaceToken).AppendTo(encapsed.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(encapsed.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7796,7 +7796,7 @@ yydefault: encapsed.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.EncapsedAndWhitespaceToken).AppendTo(encapsed.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(encapsed.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php7/php7.y b/php7/php7.y index e7d3829..a2ac5bd 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -5101,7 +5101,7 @@ encaps_list: encapsed.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) // save comments - $2.Meta.SetTokenName(meta.EncapsedAndWhitespaceToken).AppendTo(encapsed.GetMeta()) + $2.Meta.SetTokenName(meta.NodeStart).AppendTo(encapsed.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5120,7 +5120,7 @@ encaps_list: encapsed.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.EncapsedAndWhitespaceToken).AppendTo(encapsed.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo(encapsed.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/printer/printer.go b/printer/printer.go index 9df3fc2..3616bac 100644 --- a/printer/printer.go +++ b/printer/printer.go @@ -563,20 +563,14 @@ func (p *Printer) printScalarDNumber(n node.Node) { func (p *Printer) printScalarString(n node.Node) { nn := n.(*scalar.String) p.printMeta(nn, meta.NodeStart) - io.WriteString(p.w, nn.Value) - p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printScalarEncapsedStringPart(n node.Node) { nn := n.(*scalar.EncapsedStringPart) p.printMeta(nn, meta.NodeStart) - - p.printMeta(nn, meta.EncapsedAndWhitespaceToken) - io.WriteString(p.w, nn.Value) - p.printMeta(nn, meta.NodeEnd) } diff --git a/printer/printer_test.go b/printer/printer_test.go index 6bcafb0..b2f2646 100644 --- a/printer/printer_test.go +++ b/printer/printer_test.go @@ -600,7 +600,7 @@ func TestPrinterPrintScalarEncapsedStringPart(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.EncapsedAndWhitespaceToken, + TokenName: meta.NodeStart, }, }, Value: "hello world", From 11882949a7a3eaea8110a5b3cb3f5a9851249eda Mon Sep 17 00:00:00 2001 From: z7zmey Date: Thu, 25 Oct 2018 13:50:40 +0300 Subject: [PATCH 034/117] remove meta.DoubleQuoteToken --- meta/tokenName.go | 1 - meta/tokenName_string.go | 4 ++-- php5/php5.go | 2 +- php5/php5.y | 2 +- php7/php7.go | 2 +- php7/php7.y | 2 +- printer/printer.go | 3 --- printer/printer_test.go | 2 +- 8 files changed, 7 insertions(+), 11 deletions(-) diff --git a/meta/tokenName.go b/meta/tokenName.go index 99b1682..e65bef7 100644 --- a/meta/tokenName.go +++ b/meta/tokenName.go @@ -122,7 +122,6 @@ const ( IsGreaterOrEqualToken HaltCompilerToken CaseSeparatorToken // ';' or ':' - DoubleQuoteToken // '"' BackquoteToken // '`' OpenCurlyBracesToken // '{' CloseCurlyBracesToken // '}' diff --git a/meta/tokenName_string.go b/meta/tokenName_string.go index 0cbb834..8443c41 100644 --- a/meta/tokenName_string.go +++ b/meta/tokenName_string.go @@ -4,9 +4,9 @@ package meta import "strconv" -const _TokenName_name = "NodeStartNodeEndMagicConstantTokenIncludeTokenIncludeOnceTokenExitTokenIfTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenUseTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenIssetTokenEmptyTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenListTokenArrayTokenCallableTokenStartHeredocTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenEvalTokenRequireTokenRequireOnceTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenNewAnchorCloneTokenElseifTokenElseTokenEndifTokenPrintTokenYieldTokenStaticTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenYieldFromTokenObjectOperatorTokenIntCastTokenDoubleCastTokenStringCastTokenArrayCastTokenObjectCastTokenBoolCastTokenUnsetCastTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenDoubleQuoteTokenBackquoteTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenExclamationMarkTokenTildeTokenAtTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" +const _TokenName_name = "NodeStartNodeEndMagicConstantTokenIncludeTokenIncludeOnceTokenExitTokenIfTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenUseTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenIssetTokenEmptyTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenListTokenArrayTokenCallableTokenStartHeredocTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenEvalTokenRequireTokenRequireOnceTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenNewAnchorCloneTokenElseifTokenElseTokenEndifTokenPrintTokenYieldTokenStaticTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenYieldFromTokenObjectOperatorTokenIntCastTokenDoubleCastTokenStringCastTokenArrayCastTokenObjectCastTokenBoolCastTokenUnsetCastTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenBackquoteTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenExclamationMarkTokenTildeTokenAtTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" -var _TokenName_index = [...]uint16{0, 9, 16, 34, 46, 62, 71, 78, 96, 110, 125, 134, 141, 151, 164, 185, 206, 214, 225, 237, 252, 264, 279, 286, 297, 311, 320, 332, 342, 355, 364, 377, 387, 398, 406, 416, 428, 438, 446, 460, 471, 479, 489, 499, 509, 519, 529, 543, 555, 570, 586, 595, 605, 618, 635, 649, 673, 699, 715, 728, 737, 749, 765, 779, 794, 809, 824, 833, 843, 854, 863, 873, 883, 893, 904, 917, 927, 939, 953, 964, 972, 980, 994, 1013, 1025, 1040, 1055, 1069, 1084, 1097, 1111, 1124, 1138, 1152, 1167, 1180, 1193, 1206, 1222, 1235, 1248, 1260, 1273, 1285, 1297, 1311, 1326, 1334, 1341, 1348, 1364, 1383, 1395, 1410, 1431, 1452, 1469, 1487, 1503, 1517, 1537, 1558, 1572, 1582, 1602, 1623, 1640, 1658, 1675, 1689, 1699, 1708, 1728, 1738, 1745, 1755, 1771, 1781, 1791, 1804, 1814, 1826, 1835, 1847, 1855} +var _TokenName_index = [...]uint16{0, 9, 16, 34, 46, 62, 71, 78, 96, 110, 125, 134, 141, 151, 164, 185, 206, 214, 225, 237, 252, 264, 279, 286, 297, 311, 320, 332, 342, 355, 364, 377, 387, 398, 406, 416, 428, 438, 446, 460, 471, 479, 489, 499, 509, 519, 529, 543, 555, 570, 586, 595, 605, 618, 635, 649, 673, 699, 715, 728, 737, 749, 765, 779, 794, 809, 824, 833, 843, 854, 863, 873, 883, 893, 904, 917, 927, 939, 953, 964, 972, 980, 994, 1013, 1025, 1040, 1055, 1069, 1084, 1097, 1111, 1124, 1138, 1152, 1167, 1180, 1193, 1206, 1222, 1235, 1248, 1260, 1273, 1285, 1297, 1311, 1326, 1334, 1341, 1348, 1364, 1383, 1395, 1410, 1431, 1452, 1469, 1487, 1501, 1521, 1542, 1556, 1566, 1586, 1607, 1624, 1642, 1659, 1673, 1683, 1692, 1712, 1722, 1729, 1739, 1755, 1765, 1775, 1788, 1798, 1810, 1819, 1831, 1839} func (i TokenName) String() string { if i < 0 || i >= TokenName(len(_TokenName_index)-1) { diff --git a/php5/php5.go b/php5/php5.go index 59160f0..cc66539 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -8179,7 +8179,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.DoubleQuoteToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php5/php5.y b/php5/php5.y index 3bbbe6d..19a8688 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -5651,7 +5651,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.DoubleQuoteToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php7/php7.go b/php7/php7.go index 9b7cf91..dca4e2d 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -7081,7 +7081,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.DoubleQuoteToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php7/php7.y b/php7/php7.y index a2ac5bd..4bed762 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -4467,7 +4467,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.DoubleQuoteToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/printer/printer.go b/printer/printer.go index 3616bac..ca963df 100644 --- a/printer/printer.go +++ b/printer/printer.go @@ -578,13 +578,10 @@ func (p *Printer) printScalarEncapsed(n node.Node) { nn := n.(*scalar.Encapsed) p.printMeta(nn, meta.NodeStart) - p.printMeta(nn, meta.DoubleQuoteToken) io.WriteString(p.w, "\"") - for _, part := range nn.Parts { p.Print(part) } - io.WriteString(p.w, "\"") p.printMeta(nn, meta.NodeEnd) diff --git a/printer/printer_test.go b/printer/printer_test.go index b2f2646..66565d6 100644 --- a/printer/printer_test.go +++ b/printer/printer_test.go @@ -620,7 +620,7 @@ func TestPrinterPrintScalarEncapsed(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.DoubleQuoteToken, + TokenName: meta.NodeStart, }, }, Parts: []node.Node{ From 5144644d92f4a56d87cd9e70f963b23aaa1410e7 Mon Sep 17 00:00:00 2001 From: z7zmey Date: Thu, 25 Oct 2018 13:52:44 +0300 Subject: [PATCH 035/117] remove meta.StartHeredocToken --- meta/tokenName.go | 1 - meta/tokenName_string.go | 4 ++-- php5/php5.go | 6 +++--- php5/php5.y | 6 +++--- php7/php7.go | 6 +++--- php7/php7.y | 6 +++--- printer/printer.go | 2 -- printer/printer_test.go | 4 ++-- 8 files changed, 16 insertions(+), 19 deletions(-) diff --git a/meta/tokenName.go b/meta/tokenName.go index e65bef7..1bf5839 100644 --- a/meta/tokenName.go +++ b/meta/tokenName.go @@ -58,7 +58,6 @@ const ( ListToken ArrayToken CallableToken - StartHeredocToken CurlyOpenToken PaamayimNekudotayimToken UseLeadingNsSeparatorToken diff --git a/meta/tokenName_string.go b/meta/tokenName_string.go index 8443c41..3ff5411 100644 --- a/meta/tokenName_string.go +++ b/meta/tokenName_string.go @@ -4,9 +4,9 @@ package meta import "strconv" -const _TokenName_name = "NodeStartNodeEndMagicConstantTokenIncludeTokenIncludeOnceTokenExitTokenIfTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenUseTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenIssetTokenEmptyTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenListTokenArrayTokenCallableTokenStartHeredocTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenEvalTokenRequireTokenRequireOnceTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenNewAnchorCloneTokenElseifTokenElseTokenEndifTokenPrintTokenYieldTokenStaticTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenYieldFromTokenObjectOperatorTokenIntCastTokenDoubleCastTokenStringCastTokenArrayCastTokenObjectCastTokenBoolCastTokenUnsetCastTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenBackquoteTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenExclamationMarkTokenTildeTokenAtTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" +const _TokenName_name = "NodeStartNodeEndMagicConstantTokenIncludeTokenIncludeOnceTokenExitTokenIfTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenUseTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenIssetTokenEmptyTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenListTokenArrayTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenEvalTokenRequireTokenRequireOnceTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenNewAnchorCloneTokenElseifTokenElseTokenEndifTokenPrintTokenYieldTokenStaticTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenYieldFromTokenObjectOperatorTokenIntCastTokenDoubleCastTokenStringCastTokenArrayCastTokenObjectCastTokenBoolCastTokenUnsetCastTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenBackquoteTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenExclamationMarkTokenTildeTokenAtTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" -var _TokenName_index = [...]uint16{0, 9, 16, 34, 46, 62, 71, 78, 96, 110, 125, 134, 141, 151, 164, 185, 206, 214, 225, 237, 252, 264, 279, 286, 297, 311, 320, 332, 342, 355, 364, 377, 387, 398, 406, 416, 428, 438, 446, 460, 471, 479, 489, 499, 509, 519, 529, 543, 555, 570, 586, 595, 605, 618, 635, 649, 673, 699, 715, 728, 737, 749, 765, 779, 794, 809, 824, 833, 843, 854, 863, 873, 883, 893, 904, 917, 927, 939, 953, 964, 972, 980, 994, 1013, 1025, 1040, 1055, 1069, 1084, 1097, 1111, 1124, 1138, 1152, 1167, 1180, 1193, 1206, 1222, 1235, 1248, 1260, 1273, 1285, 1297, 1311, 1326, 1334, 1341, 1348, 1364, 1383, 1395, 1410, 1431, 1452, 1469, 1487, 1501, 1521, 1542, 1556, 1566, 1586, 1607, 1624, 1642, 1659, 1673, 1683, 1692, 1712, 1722, 1729, 1739, 1755, 1765, 1775, 1788, 1798, 1810, 1819, 1831, 1839} +var _TokenName_index = [...]uint16{0, 9, 16, 34, 46, 62, 71, 78, 96, 110, 125, 134, 141, 151, 164, 185, 206, 214, 225, 237, 252, 264, 279, 286, 297, 311, 320, 332, 342, 355, 364, 377, 387, 398, 406, 416, 428, 438, 446, 460, 471, 479, 489, 499, 509, 519, 529, 543, 555, 570, 586, 595, 605, 618, 632, 656, 682, 698, 711, 720, 732, 748, 762, 777, 792, 807, 816, 826, 837, 846, 856, 866, 876, 887, 900, 910, 922, 936, 947, 955, 963, 977, 996, 1008, 1023, 1038, 1052, 1067, 1080, 1094, 1107, 1121, 1135, 1150, 1163, 1176, 1189, 1205, 1218, 1231, 1243, 1256, 1268, 1280, 1294, 1309, 1317, 1324, 1331, 1347, 1366, 1378, 1393, 1414, 1435, 1452, 1470, 1484, 1504, 1525, 1539, 1549, 1569, 1590, 1607, 1625, 1642, 1656, 1666, 1675, 1695, 1705, 1712, 1722, 1738, 1748, 1758, 1771, 1781, 1793, 1802, 1814, 1822} func (i TokenName) String() string { if i < 0 || i >= TokenName(len(_TokenName_index)-1) { diff --git a/php5/php5.go b/php5/php5.go index cc66539..96df0f5 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -7444,7 +7444,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.StartHeredocToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7458,7 +7458,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.StartHeredocToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -8193,7 +8193,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.StartHeredocToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php5/php5.y b/php5/php5.y index 19a8688..ef9b4a4 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -5008,7 +5008,7 @@ common_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.StartHeredocToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5020,7 +5020,7 @@ common_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.StartHeredocToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5663,7 +5663,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.StartHeredocToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php7/php7.go b/php7/php7.go index dca4e2d..37127e6 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -7053,7 +7053,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.StartHeredocToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7067,7 +7067,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.StartHeredocToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7095,7 +7095,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.StartHeredocToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php7/php7.y b/php7/php7.y index 4bed762..db9a0d1 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -4443,7 +4443,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.StartHeredocToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4455,7 +4455,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.StartHeredocToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4479,7 +4479,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.StartHeredocToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/printer/printer.go b/printer/printer.go index ca963df..5333fa9 100644 --- a/printer/printer.go +++ b/printer/printer.go @@ -591,8 +591,6 @@ func (p *Printer) printScalarHeredoc(n node.Node) { nn := n.(*scalar.Heredoc) p.printMeta(nn, meta.NodeStart) - p.printMeta(nn, meta.StartHeredocToken) - io.WriteString(p.w, "<<<") io.WriteString(p.w, nn.Label) io.WriteString(p.w, "\n") diff --git a/printer/printer_test.go b/printer/printer_test.go index 66565d6..1cb868a 100644 --- a/printer/printer_test.go +++ b/printer/printer_test.go @@ -653,7 +653,7 @@ func TestPrinterPrintScalarHeredoc(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.StartHeredocToken, + TokenName: meta.NodeStart, }, }, Label: "LBL", @@ -692,7 +692,7 @@ func TestPrinterPrintScalarNowdoc(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.StartHeredocToken, + TokenName: meta.NodeStart, }, }, Label: "'LBL'", From 33a935c628adddb520293d2279513342ca8d24f6 Mon Sep 17 00:00:00 2001 From: z7zmey Date: Thu, 25 Oct 2018 13:54:42 +0300 Subject: [PATCH 036/117] remove meta.MagicConstantToken --- meta/tokenName.go | 1 - meta/tokenName_string.go | 4 ++-- php5/php5.go | 18 +++++++++--------- php5/php5.y | 18 +++++++++--------- php7/php7.go | 16 ++++++++-------- php7/php7.y | 16 ++++++++-------- printer/printer.go | 4 ---- printer/printer_test.go | 2 +- 8 files changed, 37 insertions(+), 42 deletions(-) diff --git a/meta/tokenName.go b/meta/tokenName.go index 1bf5839..5408db3 100644 --- a/meta/tokenName.go +++ b/meta/tokenName.go @@ -7,7 +7,6 @@ type TokenName int const ( NodeStart TokenName = iota NodeEnd - MagicConstantToken IncludeToken IncludeOnceToken ExitToken diff --git a/meta/tokenName_string.go b/meta/tokenName_string.go index 3ff5411..8ce4b77 100644 --- a/meta/tokenName_string.go +++ b/meta/tokenName_string.go @@ -4,9 +4,9 @@ package meta import "strconv" -const _TokenName_name = "NodeStartNodeEndMagicConstantTokenIncludeTokenIncludeOnceTokenExitTokenIfTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenUseTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenIssetTokenEmptyTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenListTokenArrayTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenEvalTokenRequireTokenRequireOnceTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenNewAnchorCloneTokenElseifTokenElseTokenEndifTokenPrintTokenYieldTokenStaticTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenYieldFromTokenObjectOperatorTokenIntCastTokenDoubleCastTokenStringCastTokenArrayCastTokenObjectCastTokenBoolCastTokenUnsetCastTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenBackquoteTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenExclamationMarkTokenTildeTokenAtTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" +const _TokenName_name = "NodeStartNodeEndIncludeTokenIncludeOnceTokenExitTokenIfTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenUseTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenIssetTokenEmptyTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenListTokenArrayTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenEvalTokenRequireTokenRequireOnceTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenNewAnchorCloneTokenElseifTokenElseTokenEndifTokenPrintTokenYieldTokenStaticTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenYieldFromTokenObjectOperatorTokenIntCastTokenDoubleCastTokenStringCastTokenArrayCastTokenObjectCastTokenBoolCastTokenUnsetCastTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenBackquoteTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenExclamationMarkTokenTildeTokenAtTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" -var _TokenName_index = [...]uint16{0, 9, 16, 34, 46, 62, 71, 78, 96, 110, 125, 134, 141, 151, 164, 185, 206, 214, 225, 237, 252, 264, 279, 286, 297, 311, 320, 332, 342, 355, 364, 377, 387, 398, 406, 416, 428, 438, 446, 460, 471, 479, 489, 499, 509, 519, 529, 543, 555, 570, 586, 595, 605, 618, 632, 656, 682, 698, 711, 720, 732, 748, 762, 777, 792, 807, 816, 826, 837, 846, 856, 866, 876, 887, 900, 910, 922, 936, 947, 955, 963, 977, 996, 1008, 1023, 1038, 1052, 1067, 1080, 1094, 1107, 1121, 1135, 1150, 1163, 1176, 1189, 1205, 1218, 1231, 1243, 1256, 1268, 1280, 1294, 1309, 1317, 1324, 1331, 1347, 1366, 1378, 1393, 1414, 1435, 1452, 1470, 1484, 1504, 1525, 1539, 1549, 1569, 1590, 1607, 1625, 1642, 1656, 1666, 1675, 1695, 1705, 1712, 1722, 1738, 1748, 1758, 1771, 1781, 1793, 1802, 1814, 1822} +var _TokenName_index = [...]uint16{0, 9, 16, 28, 44, 53, 60, 78, 92, 107, 116, 123, 133, 146, 167, 188, 196, 207, 219, 234, 246, 261, 268, 279, 293, 302, 314, 324, 337, 346, 359, 369, 380, 388, 398, 410, 420, 428, 442, 453, 461, 471, 481, 491, 501, 511, 525, 537, 552, 568, 577, 587, 600, 614, 638, 664, 680, 693, 702, 714, 730, 744, 759, 774, 789, 798, 808, 819, 828, 838, 848, 858, 869, 882, 892, 904, 918, 929, 937, 945, 959, 978, 990, 1005, 1020, 1034, 1049, 1062, 1076, 1089, 1103, 1117, 1132, 1145, 1158, 1171, 1187, 1200, 1213, 1225, 1238, 1250, 1262, 1276, 1291, 1299, 1306, 1313, 1329, 1348, 1360, 1375, 1396, 1417, 1434, 1452, 1466, 1486, 1507, 1521, 1531, 1551, 1572, 1589, 1607, 1624, 1638, 1648, 1657, 1677, 1687, 1694, 1704, 1720, 1730, 1740, 1753, 1763, 1775, 1784, 1796, 1804} func (i TokenName) String() string { if i < 0 || i >= TokenName(len(_TokenName_index)-1) { diff --git a/php5/php5.go b/php5/php5.go index 96df0f5..d541e27 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -7344,7 +7344,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.MagicConstantToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7358,7 +7358,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.MagicConstantToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7372,7 +7372,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.MagicConstantToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7386,7 +7386,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.MagicConstantToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7400,7 +7400,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.MagicConstantToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7414,7 +7414,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.MagicConstantToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7428,7 +7428,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.MagicConstantToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7598,7 +7598,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.MagicConstantToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -8207,7 +8207,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.MagicConstantToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php5/php5.y b/php5/php5.y index ef9b4a4..474b7fd 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -4922,7 +4922,7 @@ common_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.MagicConstantToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4934,7 +4934,7 @@ common_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.MagicConstantToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4946,7 +4946,7 @@ common_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.MagicConstantToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4958,7 +4958,7 @@ common_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.MagicConstantToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4970,7 +4970,7 @@ common_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.MagicConstantToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4982,7 +4982,7 @@ common_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.MagicConstantToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4994,7 +4994,7 @@ common_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.MagicConstantToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5147,7 +5147,7 @@ static_scalar_value: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.MagicConstantToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5675,7 +5675,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.MagicConstantToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php7/php7.go b/php7/php7.go index 37127e6..e4e4102 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -6939,7 +6939,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.MagicConstantToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6953,7 +6953,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.MagicConstantToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6967,7 +6967,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.MagicConstantToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6981,7 +6981,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.MagicConstantToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6995,7 +6995,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.MagicConstantToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7009,7 +7009,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.MagicConstantToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7023,7 +7023,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.MagicConstantToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7037,7 +7037,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.MagicConstantToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php7/php7.y b/php7/php7.y index db9a0d1..c6cef15 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -4345,7 +4345,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.MagicConstantToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4357,7 +4357,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.MagicConstantToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4369,7 +4369,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.MagicConstantToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4381,7 +4381,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.MagicConstantToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4393,7 +4393,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.MagicConstantToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4405,7 +4405,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.MagicConstantToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4417,7 +4417,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.MagicConstantToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4429,7 +4429,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.MagicConstantToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/printer/printer.go b/printer/printer.go index 5333fa9..a958c31 100644 --- a/printer/printer.go +++ b/printer/printer.go @@ -608,11 +608,7 @@ func (p *Printer) printScalarHeredoc(n node.Node) { func (p *Printer) printScalarMagicConstant(n node.Node) { nn := n.(*scalar.MagicConstant) p.printMeta(nn, meta.NodeStart) - - p.printMeta(nn, meta.MagicConstantToken) - io.WriteString(p.w, nn.Value) - p.printMeta(nn, meta.NodeEnd) } diff --git a/printer/printer_test.go b/printer/printer_test.go index 1cb868a..47ce4e2 100644 --- a/printer/printer_test.go +++ b/printer/printer_test.go @@ -720,7 +720,7 @@ func TestPrinterPrintScalarMagicConstant(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.MagicConstantToken, + TokenName: meta.NodeStart, }, }, Value: "__DIR__", From 837e6a5addb9b644b64b2439716f4e651868490e Mon Sep 17 00:00:00 2001 From: z7zmey Date: Thu, 25 Oct 2018 14:04:18 +0300 Subject: [PATCH 037/117] remove meta.*CastToken --- meta/tokenName.go | 7 ------- meta/tokenName_string.go | 4 ++-- php5/php5.go | 28 ++++++++++++++-------------- php5/php5.y | 28 ++++++++++++++-------------- php7/php7.go | 28 ++++++++++++++-------------- php7/php7.y | 28 ++++++++++++++-------------- printer/printer.go | 21 --------------------- printer/printer_test.go | 28 ++++++++++++++-------------- 8 files changed, 72 insertions(+), 100 deletions(-) diff --git a/meta/tokenName.go b/meta/tokenName.go index 5408db3..9d2724e 100644 --- a/meta/tokenName.go +++ b/meta/tokenName.go @@ -86,13 +86,6 @@ const ( DecToken YieldFromToken ObjectOperatorToken - IntCastToken - DoubleCastToken - StringCastToken - ArrayCastToken - ObjectCastToken - BoolCastToken - UnsetCastToken CoalesceToken SpaceshipToken PlusEqualToken diff --git a/meta/tokenName_string.go b/meta/tokenName_string.go index 8ce4b77..54ce623 100644 --- a/meta/tokenName_string.go +++ b/meta/tokenName_string.go @@ -4,9 +4,9 @@ package meta import "strconv" -const _TokenName_name = "NodeStartNodeEndIncludeTokenIncludeOnceTokenExitTokenIfTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenUseTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenIssetTokenEmptyTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenListTokenArrayTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenEvalTokenRequireTokenRequireOnceTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenNewAnchorCloneTokenElseifTokenElseTokenEndifTokenPrintTokenYieldTokenStaticTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenYieldFromTokenObjectOperatorTokenIntCastTokenDoubleCastTokenStringCastTokenArrayCastTokenObjectCastTokenBoolCastTokenUnsetCastTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenBackquoteTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenExclamationMarkTokenTildeTokenAtTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" +const _TokenName_name = "NodeStartNodeEndIncludeTokenIncludeOnceTokenExitTokenIfTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenUseTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenIssetTokenEmptyTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenListTokenArrayTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenEvalTokenRequireTokenRequireOnceTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenNewAnchorCloneTokenElseifTokenElseTokenEndifTokenPrintTokenYieldTokenStaticTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenYieldFromTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenBackquoteTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenExclamationMarkTokenTildeTokenAtTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" -var _TokenName_index = [...]uint16{0, 9, 16, 28, 44, 53, 60, 78, 92, 107, 116, 123, 133, 146, 167, 188, 196, 207, 219, 234, 246, 261, 268, 279, 293, 302, 314, 324, 337, 346, 359, 369, 380, 388, 398, 410, 420, 428, 442, 453, 461, 471, 481, 491, 501, 511, 525, 537, 552, 568, 577, 587, 600, 614, 638, 664, 680, 693, 702, 714, 730, 744, 759, 774, 789, 798, 808, 819, 828, 838, 848, 858, 869, 882, 892, 904, 918, 929, 937, 945, 959, 978, 990, 1005, 1020, 1034, 1049, 1062, 1076, 1089, 1103, 1117, 1132, 1145, 1158, 1171, 1187, 1200, 1213, 1225, 1238, 1250, 1262, 1276, 1291, 1299, 1306, 1313, 1329, 1348, 1360, 1375, 1396, 1417, 1434, 1452, 1466, 1486, 1507, 1521, 1531, 1551, 1572, 1589, 1607, 1624, 1638, 1648, 1657, 1677, 1687, 1694, 1704, 1720, 1730, 1740, 1753, 1763, 1775, 1784, 1796, 1804} +var _TokenName_index = [...]uint16{0, 9, 16, 28, 44, 53, 60, 78, 92, 107, 116, 123, 133, 146, 167, 188, 196, 207, 219, 234, 246, 261, 268, 279, 293, 302, 314, 324, 337, 346, 359, 369, 380, 388, 398, 410, 420, 428, 442, 453, 461, 471, 481, 491, 501, 511, 525, 537, 552, 568, 577, 587, 600, 614, 638, 664, 680, 693, 702, 714, 730, 744, 759, 774, 789, 798, 808, 819, 828, 838, 848, 858, 869, 882, 892, 904, 918, 929, 937, 945, 959, 978, 991, 1005, 1019, 1034, 1047, 1060, 1073, 1089, 1102, 1115, 1127, 1140, 1152, 1164, 1178, 1193, 1201, 1208, 1215, 1231, 1250, 1262, 1277, 1298, 1319, 1336, 1354, 1368, 1388, 1409, 1423, 1433, 1453, 1474, 1491, 1509, 1526, 1540, 1550, 1559, 1579, 1589, 1596, 1606, 1622, 1632, 1642, 1655, 1665, 1677, 1686, 1698, 1706} func (i TokenName) String() string { if i < 0 || i >= TokenName(len(_TokenName_index)-1) { diff --git a/php5/php5.go b/php5/php5.go index d541e27..4d09b6f 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -6394,8 +6394,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.IntCastToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.IntCastToken) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6409,8 +6409,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.DoubleCastToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.DoubleCastToken) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6424,8 +6424,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.StringCastToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.StringCastToken) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6439,8 +6439,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.ArrayCastToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.ArrayCastToken) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6454,8 +6454,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.ObjectCastToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.ObjectCastToken) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6469,8 +6469,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.BoolCastToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.BoolCastToken) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6484,8 +6484,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.UnsetCastToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.UnsetCastToken) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php5/php5.y b/php5/php5.y index 474b7fd..7ab8f69 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -4053,8 +4053,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.IntCastToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $1, meta.IntCastToken) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4066,8 +4066,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.DoubleCastToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $1, meta.DoubleCastToken) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4079,8 +4079,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.StringCastToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $1, meta.StringCastToken) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4092,8 +4092,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.ArrayCastToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $1, meta.ArrayCastToken) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4105,8 +4105,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.ObjectCastToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $1, meta.ObjectCastToken) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4118,8 +4118,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.BoolCastToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $1, meta.BoolCastToken) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4131,8 +4131,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.UnsetCastToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $1, meta.UnsetCastToken) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php7/php7.go b/php7/php7.go index e4e4102..90665e0 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -6327,8 +6327,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.IntCastToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.IntCastToken) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6342,8 +6342,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.DoubleCastToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.DoubleCastToken) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6357,8 +6357,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.StringCastToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.StringCastToken) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6372,8 +6372,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.ArrayCastToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.ArrayCastToken) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6387,8 +6387,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.ObjectCastToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.ObjectCastToken) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6402,8 +6402,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.BoolCastToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.BoolCastToken) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6417,8 +6417,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.UnsetCastToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.UnsetCastToken) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php7/php7.y b/php7/php7.y index c6cef15..665c2dd 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -3788,8 +3788,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.IntCastToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $1, meta.IntCastToken) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3801,8 +3801,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.DoubleCastToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $1, meta.DoubleCastToken) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3814,8 +3814,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.StringCastToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $1, meta.StringCastToken) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3827,8 +3827,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.ArrayCastToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $1, meta.ArrayCastToken) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3840,8 +3840,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.ObjectCastToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $1, meta.ObjectCastToken) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3853,8 +3853,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.BoolCastToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $1, meta.BoolCastToken) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3866,8 +3866,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.UnsetCastToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $1, meta.UnsetCastToken) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/printer/printer.go b/printer/printer.go index a958c31..1eda79e 100644 --- a/printer/printer.go +++ b/printer/printer.go @@ -1101,70 +1101,49 @@ func (p *Printer) printBinarySpaceship(n node.Node) { func (p *Printer) printArray(n node.Node) { nn := n.(*cast.Array) p.printMeta(nn, meta.NodeStart) - - p.printMeta(nn, meta.ArrayCastToken) p.Print(nn.Expr) - p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printBool(n node.Node) { nn := n.(*cast.Bool) p.printMeta(nn, meta.NodeStart) - - p.printMeta(nn, meta.BoolCastToken) p.Print(nn.Expr) - p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printDouble(n node.Node) { nn := n.(*cast.Double) p.printMeta(nn, meta.NodeStart) - - p.printMeta(nn, meta.DoubleCastToken) p.Print(nn.Expr) - p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printInt(n node.Node) { nn := n.(*cast.Int) p.printMeta(nn, meta.NodeStart) - - p.printMeta(nn, meta.IntCastToken) p.Print(nn.Expr) - p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printObject(n node.Node) { nn := n.(*cast.Object) p.printMeta(nn, meta.NodeStart) - - p.printMeta(nn, meta.ObjectCastToken) p.Print(nn.Expr) - p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printString(n node.Node) { nn := n.(*cast.String) p.printMeta(nn, meta.NodeStart) - - p.printMeta(nn, meta.StringCastToken) p.Print(nn.Expr) - p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printUnset(n node.Node) { nn := n.(*cast.Unset) p.printMeta(nn, meta.NodeStart) - - p.printMeta(nn, meta.UnsetCastToken) p.Print(nn.Expr) - p.printMeta(nn, meta.NodeEnd) } diff --git a/printer/printer_test.go b/printer/printer_test.go index 47ce4e2..9aedcfd 100644 --- a/printer/printer_test.go +++ b/printer/printer_test.go @@ -2493,12 +2493,12 @@ func TestPrinterPrintArray(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.ArrayCastToken, + TokenName: meta.NodeStart, }, &meta.Data{ Type: meta.TokenType, Value: "(array)", - TokenName: meta.ArrayCastToken, + TokenName: meta.NodeStart, }, }, Expr: &expr.Variable{ @@ -2530,12 +2530,12 @@ func TestPrinterPrintBool(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.BoolCastToken, + TokenName: meta.NodeStart, }, &meta.Data{ Type: meta.TokenType, Value: "(bool)", - TokenName: meta.BoolCastToken, + TokenName: meta.NodeStart, }, }, Expr: &expr.Variable{ @@ -2567,12 +2567,12 @@ func TestPrinterPrintDouble(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.DoubleCastToken, + TokenName: meta.NodeStart, }, &meta.Data{ Type: meta.TokenType, Value: "(float)", - TokenName: meta.DoubleCastToken, + TokenName: meta.NodeStart, }, }, Expr: &expr.Variable{ @@ -2604,12 +2604,12 @@ func TestPrinterPrintInt(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.IntCastToken, + TokenName: meta.NodeStart, }, &meta.Data{ Type: meta.TokenType, Value: "(int)", - TokenName: meta.IntCastToken, + TokenName: meta.NodeStart, }, }, Expr: &expr.Variable{ @@ -2641,12 +2641,12 @@ func TestPrinterPrintObject(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.ObjectCastToken, + TokenName: meta.NodeStart, }, &meta.Data{ Type: meta.TokenType, Value: "(object)", - TokenName: meta.ObjectCastToken, + TokenName: meta.NodeStart, }, }, Expr: &expr.Variable{ @@ -2678,12 +2678,12 @@ func TestPrinterPrintString(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.StringCastToken, + TokenName: meta.NodeStart, }, &meta.Data{ Type: meta.TokenType, Value: "(string)", - TokenName: meta.StringCastToken, + TokenName: meta.NodeStart, }, }, Expr: &expr.Variable{ @@ -2715,12 +2715,12 @@ func TestPrinterPrintUnset(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.UnsetCastToken, + TokenName: meta.NodeStart, }, &meta.Data{ Type: meta.TokenType, Value: "(unset)", - TokenName: meta.UnsetCastToken, + TokenName: meta.NodeStart, }, }, Expr: &expr.Variable{ From aa7a86257379dd39c37bc64944ecad7913ada228 Mon Sep 17 00:00:00 2001 From: z7zmey Date: Thu, 25 Oct 2018 14:13:36 +0300 Subject: [PATCH 038/117] remove meta.ArrayToken --- meta/tokenName.go | 1 - meta/tokenName_string.go | 4 ++-- php5/php5.go | 4 ++-- php5/php5.y | 4 ++-- php7/php7.go | 2 +- php7/php7.y | 2 +- printer/printer.go | 2 -- printer/printer_test.go | 2 +- 8 files changed, 9 insertions(+), 12 deletions(-) diff --git a/meta/tokenName.go b/meta/tokenName.go index 9d2724e..6377449 100644 --- a/meta/tokenName.go +++ b/meta/tokenName.go @@ -55,7 +55,6 @@ const ( ImplementsToken DoubleArrowToken ListToken - ArrayToken CallableToken CurlyOpenToken PaamayimNekudotayimToken diff --git a/meta/tokenName_string.go b/meta/tokenName_string.go index 54ce623..98c9e18 100644 --- a/meta/tokenName_string.go +++ b/meta/tokenName_string.go @@ -4,9 +4,9 @@ package meta import "strconv" -const _TokenName_name = "NodeStartNodeEndIncludeTokenIncludeOnceTokenExitTokenIfTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenUseTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenIssetTokenEmptyTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenListTokenArrayTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenEvalTokenRequireTokenRequireOnceTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenNewAnchorCloneTokenElseifTokenElseTokenEndifTokenPrintTokenYieldTokenStaticTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenYieldFromTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenBackquoteTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenExclamationMarkTokenTildeTokenAtTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" +const _TokenName_name = "NodeStartNodeEndIncludeTokenIncludeOnceTokenExitTokenIfTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenUseTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenIssetTokenEmptyTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenListTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenEvalTokenRequireTokenRequireOnceTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenNewAnchorCloneTokenElseifTokenElseTokenEndifTokenPrintTokenYieldTokenStaticTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenYieldFromTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenBackquoteTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenExclamationMarkTokenTildeTokenAtTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" -var _TokenName_index = [...]uint16{0, 9, 16, 28, 44, 53, 60, 78, 92, 107, 116, 123, 133, 146, 167, 188, 196, 207, 219, 234, 246, 261, 268, 279, 293, 302, 314, 324, 337, 346, 359, 369, 380, 388, 398, 410, 420, 428, 442, 453, 461, 471, 481, 491, 501, 511, 525, 537, 552, 568, 577, 587, 600, 614, 638, 664, 680, 693, 702, 714, 730, 744, 759, 774, 789, 798, 808, 819, 828, 838, 848, 858, 869, 882, 892, 904, 918, 929, 937, 945, 959, 978, 991, 1005, 1019, 1034, 1047, 1060, 1073, 1089, 1102, 1115, 1127, 1140, 1152, 1164, 1178, 1193, 1201, 1208, 1215, 1231, 1250, 1262, 1277, 1298, 1319, 1336, 1354, 1368, 1388, 1409, 1423, 1433, 1453, 1474, 1491, 1509, 1526, 1540, 1550, 1559, 1579, 1589, 1596, 1606, 1622, 1632, 1642, 1655, 1665, 1677, 1686, 1698, 1706} +var _TokenName_index = [...]uint16{0, 9, 16, 28, 44, 53, 60, 78, 92, 107, 116, 123, 133, 146, 167, 188, 196, 207, 219, 234, 246, 261, 268, 279, 293, 302, 314, 324, 337, 346, 359, 369, 380, 388, 398, 410, 420, 428, 442, 453, 461, 471, 481, 491, 501, 511, 525, 537, 552, 568, 577, 590, 604, 628, 654, 670, 683, 692, 704, 720, 734, 749, 764, 779, 788, 798, 809, 818, 828, 838, 848, 859, 872, 882, 894, 908, 919, 927, 935, 949, 968, 981, 995, 1009, 1024, 1037, 1050, 1063, 1079, 1092, 1105, 1117, 1130, 1142, 1154, 1168, 1183, 1191, 1198, 1205, 1221, 1240, 1252, 1267, 1288, 1309, 1326, 1344, 1358, 1378, 1399, 1413, 1423, 1443, 1464, 1481, 1499, 1516, 1530, 1540, 1549, 1569, 1579, 1586, 1596, 1612, 1622, 1632, 1645, 1655, 1667, 1676, 1688, 1696} func (i TokenName) String() string { if i < 0 || i >= TokenName(len(_TokenName_index)-1) { diff --git a/php5/php5.go b/php5/php5.go index 4d09b6f..c6596b7 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -6780,7 +6780,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.ArrayToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) @@ -7559,7 +7559,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.ArrayToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) diff --git a/php5/php5.y b/php5/php5.y index 7ab8f69..304628b 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -4398,7 +4398,7 @@ combined_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $1.Meta.SetTokenName(meta.ArrayToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) $4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) @@ -5114,7 +5114,7 @@ static_scalar_value: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $1.Meta.SetTokenName(meta.ArrayToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) $4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) diff --git a/php7/php7.go b/php7/php7.go index 90665e0..1cf32dd 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -6866,7 +6866,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.ArrayToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) diff --git a/php7/php7.y b/php7/php7.y index 665c2dd..e809aa6 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -4279,7 +4279,7 @@ dereferencable_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $1.Meta.SetTokenName(meta.ArrayToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) $4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) diff --git a/printer/printer.go b/printer/printer.go index 1eda79e..b451253 100644 --- a/printer/printer.go +++ b/printer/printer.go @@ -1179,8 +1179,6 @@ func (p *Printer) printExprArrayItem(n node.Node) { func (p *Printer) printExprArray(n node.Node) { nn := n.(*expr.Array) p.printMeta(nn, meta.NodeStart) - - p.printMeta(nn, meta.ArrayToken) io.WriteString(p.w, "array") p.printMeta(nn, meta.OpenParenthesisToken) io.WriteString(p.w, "(") diff --git a/printer/printer_test.go b/printer/printer_test.go index 9aedcfd..c7c0f90 100644 --- a/printer/printer_test.go +++ b/printer/printer_test.go @@ -2865,7 +2865,7 @@ func TestPrinterPrintExprArray(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.ArrayToken, + TokenName: meta.NodeStart, }, &meta.Data{ Type: meta.WhiteSpaceType, From 6bb51493e0af117fa6e1027c69adf6074be378b9 Mon Sep 17 00:00:00 2001 From: z7zmey Date: Thu, 25 Oct 2018 14:15:54 +0300 Subject: [PATCH 039/117] remove meta.TildeToken --- meta/tokenName.go | 1 - meta/tokenName_string.go | 4 ++-- php5/php5.go | 4 ++-- php5/php5.y | 4 ++-- php7/php7.go | 2 +- php7/php7.y | 2 +- printer/printer.go | 2 -- printer/printer_test.go | 2 +- 8 files changed, 9 insertions(+), 12 deletions(-) diff --git a/meta/tokenName.go b/meta/tokenName.go index 6377449..5496fc9 100644 --- a/meta/tokenName.go +++ b/meta/tokenName.go @@ -126,7 +126,6 @@ const ( MinusToken // '-' PlusToken // '+' ExclamationMarkToken // '!' - TildeToken // '~' AtToken // '@' CommaToken // ',' VerticalBarToken // '|' diff --git a/meta/tokenName_string.go b/meta/tokenName_string.go index 98c9e18..e227265 100644 --- a/meta/tokenName_string.go +++ b/meta/tokenName_string.go @@ -4,9 +4,9 @@ package meta import "strconv" -const _TokenName_name = "NodeStartNodeEndIncludeTokenIncludeOnceTokenExitTokenIfTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenUseTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenIssetTokenEmptyTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenListTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenEvalTokenRequireTokenRequireOnceTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenNewAnchorCloneTokenElseifTokenElseTokenEndifTokenPrintTokenYieldTokenStaticTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenYieldFromTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenBackquoteTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenExclamationMarkTokenTildeTokenAtTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" +const _TokenName_name = "NodeStartNodeEndIncludeTokenIncludeOnceTokenExitTokenIfTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenUseTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenIssetTokenEmptyTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenListTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenEvalTokenRequireTokenRequireOnceTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenNewAnchorCloneTokenElseifTokenElseTokenEndifTokenPrintTokenYieldTokenStaticTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenYieldFromTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenBackquoteTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenExclamationMarkTokenAtTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" -var _TokenName_index = [...]uint16{0, 9, 16, 28, 44, 53, 60, 78, 92, 107, 116, 123, 133, 146, 167, 188, 196, 207, 219, 234, 246, 261, 268, 279, 293, 302, 314, 324, 337, 346, 359, 369, 380, 388, 398, 410, 420, 428, 442, 453, 461, 471, 481, 491, 501, 511, 525, 537, 552, 568, 577, 590, 604, 628, 654, 670, 683, 692, 704, 720, 734, 749, 764, 779, 788, 798, 809, 818, 828, 838, 848, 859, 872, 882, 894, 908, 919, 927, 935, 949, 968, 981, 995, 1009, 1024, 1037, 1050, 1063, 1079, 1092, 1105, 1117, 1130, 1142, 1154, 1168, 1183, 1191, 1198, 1205, 1221, 1240, 1252, 1267, 1288, 1309, 1326, 1344, 1358, 1378, 1399, 1413, 1423, 1443, 1464, 1481, 1499, 1516, 1530, 1540, 1549, 1569, 1579, 1586, 1596, 1612, 1622, 1632, 1645, 1655, 1667, 1676, 1688, 1696} +var _TokenName_index = [...]uint16{0, 9, 16, 28, 44, 53, 60, 78, 92, 107, 116, 123, 133, 146, 167, 188, 196, 207, 219, 234, 246, 261, 268, 279, 293, 302, 314, 324, 337, 346, 359, 369, 380, 388, 398, 410, 420, 428, 442, 453, 461, 471, 481, 491, 501, 511, 525, 537, 552, 568, 577, 590, 604, 628, 654, 670, 683, 692, 704, 720, 734, 749, 764, 779, 788, 798, 809, 818, 828, 838, 848, 859, 872, 882, 894, 908, 919, 927, 935, 949, 968, 981, 995, 1009, 1024, 1037, 1050, 1063, 1079, 1092, 1105, 1117, 1130, 1142, 1154, 1168, 1183, 1191, 1198, 1205, 1221, 1240, 1252, 1267, 1288, 1309, 1326, 1344, 1358, 1378, 1399, 1413, 1423, 1443, 1464, 1481, 1499, 1516, 1530, 1540, 1549, 1569, 1576, 1586, 1602, 1612, 1622, 1635, 1645, 1657, 1666, 1678, 1686} func (i TokenName) String() string { if i < 0 || i >= TokenName(len(_TokenName_index)-1) { diff --git a/php5/php5.go b/php5/php5.go index c6596b7..654ade4 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -6165,7 +6165,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.TildeToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7735,7 +7735,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.TildeToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php5/php5.y b/php5/php5.y index 304628b..2312d42 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -3856,7 +3856,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.TildeToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5267,7 +5267,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.TildeToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php7/php7.go b/php7/php7.go index 1cf32dd..57826bf 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -6098,7 +6098,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.TildeToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php7/php7.y b/php7/php7.y index e809aa6..0b698d5 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -3593,7 +3593,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.TildeToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/printer/printer.go b/printer/printer.go index b451253..8c925fe 100644 --- a/printer/printer.go +++ b/printer/printer.go @@ -1192,10 +1192,8 @@ func (p *Printer) printExprArray(n node.Node) { func (p *Printer) printExprBitwiseNot(n node.Node) { nn := n.(*expr.BitwiseNot) p.printMeta(nn, meta.NodeStart) - p.printMeta(nn, meta.TildeToken) io.WriteString(p.w, "~") p.Print(nn.Expr) - p.printMeta(nn, meta.NodeEnd) } diff --git a/printer/printer_test.go b/printer/printer_test.go index c7c0f90..f584f08 100644 --- a/printer/printer_test.go +++ b/printer/printer_test.go @@ -2937,7 +2937,7 @@ func TestPrinterPrintExprBitwiseNot(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.TildeToken, + TokenName: meta.NodeStart, }, }, Expr: &expr.Variable{ From eb88f8a11e99dcb5acd7dd92922112392891a797 Mon Sep 17 00:00:00 2001 From: z7zmey Date: Thu, 25 Oct 2018 14:16:46 +0300 Subject: [PATCH 040/117] remove meta.ExclamationMarkToken --- meta/tokenName.go | 1 - meta/tokenName_string.go | 4 ++-- php5/php5.go | 4 ++-- php5/php5.y | 4 ++-- php7/php7.go | 2 +- php7/php7.y | 2 +- printer/printer.go | 2 -- printer/printer_test.go | 2 +- 8 files changed, 9 insertions(+), 12 deletions(-) diff --git a/meta/tokenName.go b/meta/tokenName.go index 5496fc9..a53ab54 100644 --- a/meta/tokenName.go +++ b/meta/tokenName.go @@ -125,7 +125,6 @@ const ( AmpersandToken // '&' MinusToken // '-' PlusToken // '+' - ExclamationMarkToken // '!' AtToken // '@' CommaToken // ',' VerticalBarToken // '|' diff --git a/meta/tokenName_string.go b/meta/tokenName_string.go index e227265..024d1db 100644 --- a/meta/tokenName_string.go +++ b/meta/tokenName_string.go @@ -4,9 +4,9 @@ package meta import "strconv" -const _TokenName_name = "NodeStartNodeEndIncludeTokenIncludeOnceTokenExitTokenIfTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenUseTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenIssetTokenEmptyTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenListTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenEvalTokenRequireTokenRequireOnceTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenNewAnchorCloneTokenElseifTokenElseTokenEndifTokenPrintTokenYieldTokenStaticTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenYieldFromTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenBackquoteTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenExclamationMarkTokenAtTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" +const _TokenName_name = "NodeStartNodeEndIncludeTokenIncludeOnceTokenExitTokenIfTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenUseTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenIssetTokenEmptyTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenListTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenEvalTokenRequireTokenRequireOnceTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenNewAnchorCloneTokenElseifTokenElseTokenEndifTokenPrintTokenYieldTokenStaticTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenYieldFromTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenBackquoteTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenAtTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" -var _TokenName_index = [...]uint16{0, 9, 16, 28, 44, 53, 60, 78, 92, 107, 116, 123, 133, 146, 167, 188, 196, 207, 219, 234, 246, 261, 268, 279, 293, 302, 314, 324, 337, 346, 359, 369, 380, 388, 398, 410, 420, 428, 442, 453, 461, 471, 481, 491, 501, 511, 525, 537, 552, 568, 577, 590, 604, 628, 654, 670, 683, 692, 704, 720, 734, 749, 764, 779, 788, 798, 809, 818, 828, 838, 848, 859, 872, 882, 894, 908, 919, 927, 935, 949, 968, 981, 995, 1009, 1024, 1037, 1050, 1063, 1079, 1092, 1105, 1117, 1130, 1142, 1154, 1168, 1183, 1191, 1198, 1205, 1221, 1240, 1252, 1267, 1288, 1309, 1326, 1344, 1358, 1378, 1399, 1413, 1423, 1443, 1464, 1481, 1499, 1516, 1530, 1540, 1549, 1569, 1576, 1586, 1602, 1612, 1622, 1635, 1645, 1657, 1666, 1678, 1686} +var _TokenName_index = [...]uint16{0, 9, 16, 28, 44, 53, 60, 78, 92, 107, 116, 123, 133, 146, 167, 188, 196, 207, 219, 234, 246, 261, 268, 279, 293, 302, 314, 324, 337, 346, 359, 369, 380, 388, 398, 410, 420, 428, 442, 453, 461, 471, 481, 491, 501, 511, 525, 537, 552, 568, 577, 590, 604, 628, 654, 670, 683, 692, 704, 720, 734, 749, 764, 779, 788, 798, 809, 818, 828, 838, 848, 859, 872, 882, 894, 908, 919, 927, 935, 949, 968, 981, 995, 1009, 1024, 1037, 1050, 1063, 1079, 1092, 1105, 1117, 1130, 1142, 1154, 1168, 1183, 1191, 1198, 1205, 1221, 1240, 1252, 1267, 1288, 1309, 1326, 1344, 1358, 1378, 1399, 1413, 1423, 1443, 1464, 1481, 1499, 1516, 1530, 1540, 1549, 1556, 1566, 1582, 1592, 1602, 1615, 1625, 1637, 1646, 1658, 1666} func (i TokenName) String() string { if i < 0 || i >= TokenName(len(_TokenName_index)-1) { diff --git a/php5/php5.go b/php5/php5.go index 654ade4..bf4a505 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -6151,7 +6151,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.ExclamationMarkToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7721,7 +7721,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.ExclamationMarkToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php5/php5.y b/php5/php5.y index 2312d42..a915e01 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -3844,7 +3844,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.ExclamationMarkToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5255,7 +5255,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.ExclamationMarkToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php7/php7.go b/php7/php7.go index 57826bf..4a0d02f 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -6084,7 +6084,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.ExclamationMarkToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php7/php7.y b/php7/php7.y index 0b698d5..50b04eb 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -3581,7 +3581,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.ExclamationMarkToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/printer/printer.go b/printer/printer.go index 8c925fe..38c2583 100644 --- a/printer/printer.go +++ b/printer/printer.go @@ -1200,10 +1200,8 @@ func (p *Printer) printExprBitwiseNot(n node.Node) { func (p *Printer) printExprBooleanNot(n node.Node) { nn := n.(*expr.BooleanNot) p.printMeta(nn, meta.NodeStart) - p.printMeta(nn, meta.ExclamationMarkToken) io.WriteString(p.w, "!") p.Print(nn.Expr) - p.printMeta(nn, meta.NodeEnd) } diff --git a/printer/printer_test.go b/printer/printer_test.go index f584f08..846aaf4 100644 --- a/printer/printer_test.go +++ b/printer/printer_test.go @@ -2969,7 +2969,7 @@ func TestPrinterPrintExprBooleanNot(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.ExclamationMarkToken, + TokenName: meta.NodeStart, }, }, Expr: &expr.Variable{ From c7d595df5c859dbaba325f836fb49f5fdf1e568e Mon Sep 17 00:00:00 2001 From: z7zmey Date: Thu, 25 Oct 2018 14:19:45 +0300 Subject: [PATCH 041/117] remove meta.CloneToken --- meta/tokenName.go | 1 - meta/tokenName_string.go | 4 ++-- php5/php5.go | 2 +- php5/php5.y | 2 +- php7/php7.go | 2 +- php7/php7.y | 2 +- printer/printer.go | 3 --- printer/printer_test.go | 2 +- 8 files changed, 7 insertions(+), 11 deletions(-) diff --git a/meta/tokenName.go b/meta/tokenName.go index a53ab54..415cd43 100644 --- a/meta/tokenName.go +++ b/meta/tokenName.go @@ -69,7 +69,6 @@ const ( LogicalAndToken InstanceofToken NewAnchor - CloneToken ElseifToken ElseToken EndifToken diff --git a/meta/tokenName_string.go b/meta/tokenName_string.go index 024d1db..6e51389 100644 --- a/meta/tokenName_string.go +++ b/meta/tokenName_string.go @@ -4,9 +4,9 @@ package meta import "strconv" -const _TokenName_name = "NodeStartNodeEndIncludeTokenIncludeOnceTokenExitTokenIfTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenUseTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenIssetTokenEmptyTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenListTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenEvalTokenRequireTokenRequireOnceTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenNewAnchorCloneTokenElseifTokenElseTokenEndifTokenPrintTokenYieldTokenStaticTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenYieldFromTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenBackquoteTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenAtTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" +const _TokenName_name = "NodeStartNodeEndIncludeTokenIncludeOnceTokenExitTokenIfTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenUseTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenIssetTokenEmptyTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenListTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenEvalTokenRequireTokenRequireOnceTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenNewAnchorElseifTokenElseTokenEndifTokenPrintTokenYieldTokenStaticTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenYieldFromTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenBackquoteTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenAtTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" -var _TokenName_index = [...]uint16{0, 9, 16, 28, 44, 53, 60, 78, 92, 107, 116, 123, 133, 146, 167, 188, 196, 207, 219, 234, 246, 261, 268, 279, 293, 302, 314, 324, 337, 346, 359, 369, 380, 388, 398, 410, 420, 428, 442, 453, 461, 471, 481, 491, 501, 511, 525, 537, 552, 568, 577, 590, 604, 628, 654, 670, 683, 692, 704, 720, 734, 749, 764, 779, 788, 798, 809, 818, 828, 838, 848, 859, 872, 882, 894, 908, 919, 927, 935, 949, 968, 981, 995, 1009, 1024, 1037, 1050, 1063, 1079, 1092, 1105, 1117, 1130, 1142, 1154, 1168, 1183, 1191, 1198, 1205, 1221, 1240, 1252, 1267, 1288, 1309, 1326, 1344, 1358, 1378, 1399, 1413, 1423, 1443, 1464, 1481, 1499, 1516, 1530, 1540, 1549, 1556, 1566, 1582, 1592, 1602, 1615, 1625, 1637, 1646, 1658, 1666} +var _TokenName_index = [...]uint16{0, 9, 16, 28, 44, 53, 60, 78, 92, 107, 116, 123, 133, 146, 167, 188, 196, 207, 219, 234, 246, 261, 268, 279, 293, 302, 314, 324, 337, 346, 359, 369, 380, 388, 398, 410, 420, 428, 442, 453, 461, 471, 481, 491, 501, 511, 525, 537, 552, 568, 577, 590, 604, 628, 654, 670, 683, 692, 704, 720, 734, 749, 764, 779, 788, 799, 808, 818, 828, 838, 849, 862, 872, 884, 898, 909, 917, 925, 939, 958, 971, 985, 999, 1014, 1027, 1040, 1053, 1069, 1082, 1095, 1107, 1120, 1132, 1144, 1158, 1173, 1181, 1188, 1195, 1211, 1230, 1242, 1257, 1278, 1299, 1316, 1334, 1348, 1368, 1389, 1403, 1413, 1433, 1454, 1471, 1489, 1506, 1520, 1530, 1539, 1546, 1556, 1572, 1582, 1592, 1605, 1615, 1627, 1636, 1648, 1656} func (i TokenName) String() string { if i < 0 || i >= TokenName(len(_TokenName_index)-1) { diff --git a/php5/php5.go b/php5/php5.go index bf4a505..14f75f2 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -5647,7 +5647,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.CloneToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php5/php5.y b/php5/php5.y index a915e01..e11889f 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -3412,7 +3412,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.CloneToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php7/php7.go b/php7/php7.go index 4a0d02f..11730da 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -5580,7 +5580,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.CloneToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php7/php7.y b/php7/php7.y index 50b04eb..b7031c6 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -3149,7 +3149,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.CloneToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/printer/printer.go b/printer/printer.go index 38c2583..8b18196 100644 --- a/printer/printer.go +++ b/printer/printer.go @@ -1220,11 +1220,8 @@ func (p *Printer) printExprClassConstFetch(n node.Node) { func (p *Printer) printExprClone(n node.Node) { nn := n.(*expr.Clone) p.printMeta(nn, meta.NodeStart) - - p.printMeta(nn, meta.CloneToken) io.WriteString(p.w, "clone") p.Print(nn.Expr) - p.printMeta(nn, meta.NodeEnd) } diff --git a/printer/printer_test.go b/printer/printer_test.go index 846aaf4..def8afc 100644 --- a/printer/printer_test.go +++ b/printer/printer_test.go @@ -3043,7 +3043,7 @@ func TestPrinterPrintExprClone(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.CloneToken, + TokenName: meta.NodeStart, }, }, Expr: &expr.Variable{ From 58f706fa0d58671f17b64321ff0bb86a6fd2ff2f Mon Sep 17 00:00:00 2001 From: z7zmey Date: Thu, 25 Oct 2018 14:22:34 +0300 Subject: [PATCH 042/117] remove meta.UseToken --- meta/tokenName.go | 1 - meta/tokenName_string.go | 4 ++-- php5/php5.go | 10 +++++----- php5/php5.y | 10 +++++----- php7/php7.go | 12 ++++++------ php7/php7.y | 12 ++++++------ printer/printer.go | 5 ----- printer/printer_test.go | 10 +++++----- 8 files changed, 29 insertions(+), 35 deletions(-) diff --git a/meta/tokenName.go b/meta/tokenName.go index 415cd43..9c797f5 100644 --- a/meta/tokenName.go +++ b/meta/tokenName.go @@ -41,7 +41,6 @@ const ( CatchToken FinallyToken ThrowToken - UseToken InsteadofToken GlobalToken VarToken diff --git a/meta/tokenName_string.go b/meta/tokenName_string.go index 6e51389..16c2bfb 100644 --- a/meta/tokenName_string.go +++ b/meta/tokenName_string.go @@ -4,9 +4,9 @@ package meta import "strconv" -const _TokenName_name = "NodeStartNodeEndIncludeTokenIncludeOnceTokenExitTokenIfTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenUseTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenIssetTokenEmptyTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenListTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenEvalTokenRequireTokenRequireOnceTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenNewAnchorElseifTokenElseTokenEndifTokenPrintTokenYieldTokenStaticTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenYieldFromTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenBackquoteTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenAtTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" +const _TokenName_name = "NodeStartNodeEndIncludeTokenIncludeOnceTokenExitTokenIfTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenIssetTokenEmptyTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenListTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenEvalTokenRequireTokenRequireOnceTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenNewAnchorElseifTokenElseTokenEndifTokenPrintTokenYieldTokenStaticTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenYieldFromTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenBackquoteTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenAtTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" -var _TokenName_index = [...]uint16{0, 9, 16, 28, 44, 53, 60, 78, 92, 107, 116, 123, 133, 146, 167, 188, 196, 207, 219, 234, 246, 261, 268, 279, 293, 302, 314, 324, 337, 346, 359, 369, 380, 388, 398, 410, 420, 428, 442, 453, 461, 471, 481, 491, 501, 511, 525, 537, 552, 568, 577, 590, 604, 628, 654, 670, 683, 692, 704, 720, 734, 749, 764, 779, 788, 799, 808, 818, 828, 838, 849, 862, 872, 884, 898, 909, 917, 925, 939, 958, 971, 985, 999, 1014, 1027, 1040, 1053, 1069, 1082, 1095, 1107, 1120, 1132, 1144, 1158, 1173, 1181, 1188, 1195, 1211, 1230, 1242, 1257, 1278, 1299, 1316, 1334, 1348, 1368, 1389, 1403, 1413, 1433, 1454, 1471, 1489, 1506, 1520, 1530, 1539, 1546, 1556, 1572, 1582, 1592, 1605, 1615, 1627, 1636, 1648, 1656} +var _TokenName_index = [...]uint16{0, 9, 16, 28, 44, 53, 60, 78, 92, 107, 116, 123, 133, 146, 167, 188, 196, 207, 219, 234, 246, 261, 268, 279, 293, 302, 314, 324, 337, 346, 359, 369, 380, 388, 398, 410, 420, 434, 445, 453, 463, 473, 483, 493, 503, 517, 529, 544, 560, 569, 582, 596, 620, 646, 662, 675, 684, 696, 712, 726, 741, 756, 771, 780, 791, 800, 810, 820, 830, 841, 854, 864, 876, 890, 901, 909, 917, 931, 950, 963, 977, 991, 1006, 1019, 1032, 1045, 1061, 1074, 1087, 1099, 1112, 1124, 1136, 1150, 1165, 1173, 1180, 1187, 1203, 1222, 1234, 1249, 1270, 1291, 1308, 1326, 1340, 1360, 1381, 1395, 1405, 1425, 1446, 1463, 1481, 1498, 1512, 1522, 1531, 1538, 1548, 1564, 1574, 1584, 1597, 1607, 1619, 1628, 1640, 1648} func (i TokenName) String() string { if i < 0 || i >= TokenName(len(_TokenName_index)-1) { diff --git a/php5/php5.go b/php5/php5.go index 14f75f2..db3d50a 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -2502,7 +2502,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.UseToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.SemiColonToken) @@ -2520,7 +2520,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.UseToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(useType.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.SemiColonToken) @@ -2539,7 +2539,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.UseToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(useType.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.SemiColonToken) @@ -4873,7 +4873,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.UseToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6825,7 +6825,7 @@ yydefault: yyVAL.ClosureUse.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.UseToken).AppendTo(yyVAL.ClosureUse.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.ClosureUse.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.ClosureUse.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.ClosureUse.GetMeta()) diff --git a/php5/php5.y b/php5/php5.y index e11889f..069eacc 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -435,7 +435,7 @@ top_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.UseToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken) @@ -451,7 +451,7 @@ top_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $1.Meta.SetTokenName(meta.UseToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $2.Meta.SetTokenName(meta.NodeStart).AppendTo(useType.GetMeta()) $4.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $4, meta.SemiColonToken) @@ -468,7 +468,7 @@ top_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $1.Meta.SetTokenName(meta.UseToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $2.Meta.SetTokenName(meta.NodeStart).AppendTo(useType.GetMeta()) $4.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $4, meta.SemiColonToken) @@ -2677,7 +2677,7 @@ trait_use_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.UseToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4441,7 +4441,7 @@ lexical_vars: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $1.Meta.SetTokenName(meta.UseToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) $4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) diff --git a/php7/php7.go b/php7/php7.go index 11730da..0001081 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -2805,7 +2805,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.UseToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.SemiColonToken) @@ -2821,7 +2821,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.UseToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.SemiColonToken) @@ -2837,7 +2837,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.UseToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.SemiColonToken) @@ -2853,7 +2853,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.UseToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.SemiColonToken) @@ -4860,7 +4860,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.UseToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6641,7 +6641,7 @@ yydefault: yyVAL.ClosureUse.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.UseToken).AppendTo(yyVAL.ClosureUse.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.ClosureUse.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.ClosureUse.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.ClosureUse.GetMeta()) diff --git a/php7/php7.y b/php7/php7.y index b7031c6..ba48827 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -534,7 +534,7 @@ top_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.UseToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken) @@ -548,7 +548,7 @@ top_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $1.Meta.SetTokenName(meta.UseToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $4.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $4, meta.SemiColonToken) @@ -562,7 +562,7 @@ top_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.UseToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken) @@ -576,7 +576,7 @@ top_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $1.Meta.SetTokenName(meta.UseToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $4.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $4, meta.SemiColonToken) @@ -2463,7 +2463,7 @@ class_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.UseToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4067,7 +4067,7 @@ lexical_vars: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $1.Meta.SetTokenName(meta.UseToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) $4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) diff --git a/printer/printer.go b/printer/printer.go index 8b18196..c1ba063 100644 --- a/printer/printer.go +++ b/printer/printer.go @@ -1228,8 +1228,6 @@ func (p *Printer) printExprClone(n node.Node) { func (p *Printer) printExprClosureUse(n node.Node) { nn := n.(*expr.ClosureUse) p.printMeta(nn, meta.NodeStart) - - p.printMeta(nn, meta.UseToken) io.WriteString(p.w, "use") p.printMeta(nn, meta.OpenParenthesisToken) io.WriteString(p.w, "(") @@ -2342,7 +2340,6 @@ func (p *Printer) printStmtGroupUse(n node.Node) { nn := n.(*stmt.GroupUse) p.printMeta(nn, meta.NodeStart) - p.printMeta(nn, meta.UseToken) io.WriteString(p.w, "use") if nn.UseType != nil { @@ -2647,7 +2644,6 @@ func (p *Printer) printStmtTraitUse(n node.Node) { nn := n.(*stmt.TraitUse) p.printMeta(nn, meta.NodeStart) - p.printMeta(nn, meta.UseToken) io.WriteString(p.w, "use") p.joinPrint(",", nn.Traits) @@ -2725,7 +2721,6 @@ func (p *Printer) printStmtUseList(n node.Node) { nn := n.(*stmt.UseList) p.printMeta(nn, meta.NodeStart) - p.printMeta(nn, meta.UseToken) io.WriteString(p.w, "use") if nn.UseType != nil { diff --git a/printer/printer_test.go b/printer/printer_test.go index def8afc..99ad31a 100644 --- a/printer/printer_test.go +++ b/printer/printer_test.go @@ -3075,7 +3075,7 @@ func TestPrinterPrintExprClosureUse(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.UseToken, + TokenName: meta.NodeStart, }, &meta.Data{ Type: meta.WhiteSpaceType, @@ -7116,7 +7116,7 @@ func TestPrinterPrintStmtGroupUse(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.UseToken, + TokenName: meta.NodeStart, }, &meta.Data{ Type: meta.WhiteSpaceType, @@ -8202,7 +8202,7 @@ func TestPrinterPrintStmtTraitUse(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.UseToken, + TokenName: meta.NodeStart, }, }, Traits: []node.Node{ @@ -8242,7 +8242,7 @@ func TestPrinterPrintStmtTraitAdaptations(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.UseToken, + TokenName: meta.NodeStart, }, }, Traits: []node.Node{ @@ -8488,7 +8488,7 @@ func TestPrinterPrintStmtUseList(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.UseToken, + TokenName: meta.NodeStart, }, &meta.Data{ Type: meta.WhiteSpaceType, From 221129e9591af8c96e4f4fb3be31ac2ec70a38fe Mon Sep 17 00:00:00 2001 From: z7zmey Date: Thu, 25 Oct 2018 14:29:27 +0300 Subject: [PATCH 043/117] remove meta.StaticToken --- meta/tokenName.go | 1 - meta/tokenName_string.go | 4 ++-- php5/php5.go | 6 +++--- php5/php5.y | 6 +++--- php7/php7.go | 6 +++--- php7/php7.y | 6 +++--- printer/printer.go | 4 ---- printer/printer_test.go | 4 ++-- 8 files changed, 16 insertions(+), 21 deletions(-) diff --git a/meta/tokenName.go b/meta/tokenName.go index 9c797f5..9d1539e 100644 --- a/meta/tokenName.go +++ b/meta/tokenName.go @@ -73,7 +73,6 @@ const ( EndifToken PrintToken YieldToken - StaticToken AbstractToken FinalToken PrivateToken diff --git a/meta/tokenName_string.go b/meta/tokenName_string.go index 16c2bfb..16e3cd5 100644 --- a/meta/tokenName_string.go +++ b/meta/tokenName_string.go @@ -4,9 +4,9 @@ package meta import "strconv" -const _TokenName_name = "NodeStartNodeEndIncludeTokenIncludeOnceTokenExitTokenIfTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenIssetTokenEmptyTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenListTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenEvalTokenRequireTokenRequireOnceTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenNewAnchorElseifTokenElseTokenEndifTokenPrintTokenYieldTokenStaticTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenYieldFromTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenBackquoteTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenAtTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" +const _TokenName_name = "NodeStartNodeEndIncludeTokenIncludeOnceTokenExitTokenIfTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenIssetTokenEmptyTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenListTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenEvalTokenRequireTokenRequireOnceTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenNewAnchorElseifTokenElseTokenEndifTokenPrintTokenYieldTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenYieldFromTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenBackquoteTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenAtTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" -var _TokenName_index = [...]uint16{0, 9, 16, 28, 44, 53, 60, 78, 92, 107, 116, 123, 133, 146, 167, 188, 196, 207, 219, 234, 246, 261, 268, 279, 293, 302, 314, 324, 337, 346, 359, 369, 380, 388, 398, 410, 420, 434, 445, 453, 463, 473, 483, 493, 503, 517, 529, 544, 560, 569, 582, 596, 620, 646, 662, 675, 684, 696, 712, 726, 741, 756, 771, 780, 791, 800, 810, 820, 830, 841, 854, 864, 876, 890, 901, 909, 917, 931, 950, 963, 977, 991, 1006, 1019, 1032, 1045, 1061, 1074, 1087, 1099, 1112, 1124, 1136, 1150, 1165, 1173, 1180, 1187, 1203, 1222, 1234, 1249, 1270, 1291, 1308, 1326, 1340, 1360, 1381, 1395, 1405, 1425, 1446, 1463, 1481, 1498, 1512, 1522, 1531, 1538, 1548, 1564, 1574, 1584, 1597, 1607, 1619, 1628, 1640, 1648} +var _TokenName_index = [...]uint16{0, 9, 16, 28, 44, 53, 60, 78, 92, 107, 116, 123, 133, 146, 167, 188, 196, 207, 219, 234, 246, 261, 268, 279, 293, 302, 314, 324, 337, 346, 359, 369, 380, 388, 398, 410, 420, 434, 445, 453, 463, 473, 483, 493, 503, 517, 529, 544, 560, 569, 582, 596, 620, 646, 662, 675, 684, 696, 712, 726, 741, 756, 771, 780, 791, 800, 810, 820, 830, 843, 853, 865, 879, 890, 898, 906, 920, 939, 952, 966, 980, 995, 1008, 1021, 1034, 1050, 1063, 1076, 1088, 1101, 1113, 1125, 1139, 1154, 1162, 1169, 1176, 1192, 1211, 1223, 1238, 1259, 1280, 1297, 1315, 1329, 1349, 1370, 1384, 1394, 1414, 1435, 1452, 1470, 1487, 1501, 1511, 1520, 1527, 1537, 1553, 1563, 1573, 1586, 1596, 1608, 1617, 1629, 1637} func (i TokenName) String() string { if i < 0 || i >= TokenName(len(_TokenName_index)-1) { diff --git a/php5/php5.go b/php5/php5.go index db3d50a..5fe8f68 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -3274,7 +3274,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.StaticToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.SemiColonToken) @@ -6609,7 +6609,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[9].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.FunctionToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) if yyDollar[2].token != nil { yyDollar[2].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(yyVAL.node.GetMeta()) } @@ -6630,7 +6630,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[10].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.StaticToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.FunctionToken).AppendTo(yyVAL.node.GetMeta()) if yyDollar[3].token != nil { yyDollar[3].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(yyVAL.node.GetMeta()) diff --git a/php5/php5.y b/php5/php5.y index 069eacc..6978922 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -1144,7 +1144,7 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.StaticToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken) @@ -4238,7 +4238,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $9)) // save comments - $1.Meta.SetTokenName(meta.FunctionToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) if $2 != nil { $2.Meta.SetTokenName(meta.AmpersandToken).AppendTo($$.GetMeta()) } @@ -4257,7 +4257,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $10)) // save comments - $1.Meta.SetTokenName(meta.StaticToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $2.Meta.SetTokenName(meta.FunctionToken).AppendTo($$.GetMeta()) if $3 != nil { $3.Meta.SetTokenName(meta.AmpersandToken).AppendTo($$.GetMeta()) diff --git a/php7/php7.go b/php7/php7.go index 0001081..1e1f67b 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -3437,7 +3437,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.StaticToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.SemiColonToken) @@ -6569,7 +6569,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[11].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.FunctionToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) if yyDollar[2].token != nil { yyDollar[2].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(yyVAL.node.GetMeta()) } @@ -6590,7 +6590,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[12].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.StaticToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.FunctionToken).AppendTo(yyVAL.node.GetMeta()) if yyDollar[3].token != nil { yyDollar[3].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(yyVAL.node.GetMeta()) diff --git a/php7/php7.y b/php7/php7.y index ba48827..ebf1a83 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -1113,7 +1113,7 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.StaticToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken) @@ -3998,7 +3998,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $11)) // save comments - $1.Meta.SetTokenName(meta.FunctionToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) if $2 != nil { $2.Meta.SetTokenName(meta.AmpersandToken).AppendTo($$.GetMeta()) } @@ -4017,7 +4017,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $12)) // save comments - $1.Meta.SetTokenName(meta.StaticToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $2.Meta.SetTokenName(meta.FunctionToken).AppendTo($$.GetMeta()) if $3 != nil { $3.Meta.SetTokenName(meta.AmpersandToken).AppendTo($$.GetMeta()) diff --git a/printer/printer.go b/printer/printer.go index c1ba063..46d87e9 100644 --- a/printer/printer.go +++ b/printer/printer.go @@ -1243,7 +1243,6 @@ func (p *Printer) printExprClosure(n node.Node) { p.printMeta(nn, meta.NodeStart) if nn.Static { - p.printMeta(nn, meta.StaticToken) io.WriteString(p.w, "static") } @@ -2535,12 +2534,9 @@ func (p *Printer) printStmtStaticVar(n node.Node) { func (p *Printer) printStmtStatic(n node.Node) { nn := n.(*stmt.Static) p.printMeta(nn, meta.NodeStart) - - p.printMeta(nn, meta.StaticToken) io.WriteString(p.w, "static") p.joinPrint(",", nn.Vars) p.printMeta(nn, meta.SemiColonToken) - p.printMeta(nn, meta.NodeEnd) } diff --git a/printer/printer_test.go b/printer/printer_test.go index 99ad31a..87fee15 100644 --- a/printer/printer_test.go +++ b/printer/printer_test.go @@ -3129,7 +3129,7 @@ func TestPrinterPrintExprClosure(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.StaticToken, + TokenName: meta.NodeStart, }, &meta.Data{ Type: meta.WhiteSpaceType, @@ -7780,7 +7780,7 @@ func TestPrinterPrintStatic(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.StaticToken, + TokenName: meta.NodeStart, }, &meta.Data{ Type: meta.WhiteSpaceType, From 3b5fd0874369eaf3c48fd5dbc9e03a495e3b33ab Mon Sep 17 00:00:00 2001 From: z7zmey Date: Fri, 26 Oct 2018 11:50:21 +0300 Subject: [PATCH 044/117] remove meta.EmptyToken --- meta/tokenName.go | 1 - php5/php5.go | 4 ++-- php5/php5.y | 4 ++-- php7/php7.go | 2 +- php7/php7.y | 2 +- printer/printer.go | 4 ---- printer/printer_test.go | 2 +- 7 files changed, 7 insertions(+), 12 deletions(-) diff --git a/meta/tokenName.go b/meta/tokenName.go index 9d1539e..043893d 100644 --- a/meta/tokenName.go +++ b/meta/tokenName.go @@ -46,7 +46,6 @@ const ( VarToken UnsetToken IssetToken - EmptyToken ClassToken TraitToken InterfaceToken diff --git a/php5/php5.go b/php5/php5.go index 5fe8f68..932758d 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -9395,7 +9395,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.EmptyToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) @@ -9411,7 +9411,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.EmptyToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) diff --git a/php5/php5.y b/php5/php5.y index 6978922..0225363 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -6804,7 +6804,7 @@ internal_functions_in_yacc: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $1.Meta.SetTokenName(meta.EmptyToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) $4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) @@ -6818,7 +6818,7 @@ internal_functions_in_yacc: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $1.Meta.SetTokenName(meta.EmptyToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) $4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) diff --git a/php7/php7.go b/php7/php7.go index 1e1f67b..9f75d4c 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -8057,7 +8057,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.EmptyToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) diff --git a/php7/php7.y b/php7/php7.y index ebf1a83..a642a0a 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -5364,7 +5364,7 @@ internal_functions_in_yacc: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $1.Meta.SetTokenName(meta.EmptyToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) $4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) diff --git a/printer/printer.go b/printer/printer.go index 46d87e9..86485f4 100644 --- a/printer/printer.go +++ b/printer/printer.go @@ -1282,17 +1282,13 @@ func (p *Printer) printExprClosure(n node.Node) { func (p *Printer) printExprConstFetch(n node.Node) { nn := n.(*expr.ConstFetch) p.printMeta(nn, meta.NodeStart) - p.Print(nn.Constant) - p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printExprEmpty(n node.Node) { nn := n.(*expr.Empty) p.printMeta(nn, meta.NodeStart) - - p.printMeta(nn, meta.EmptyToken) io.WriteString(p.w, "empty") p.printMeta(nn, meta.OpenParenthesisToken) io.WriteString(p.w, "(") diff --git a/printer/printer_test.go b/printer/printer_test.go index 87fee15..53a832f 100644 --- a/printer/printer_test.go +++ b/printer/printer_test.go @@ -3261,7 +3261,7 @@ func TestPrinterPrintEmpty(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.EmptyToken, + TokenName: meta.NodeStart, }, &meta.Data{ Type: meta.WhiteSpaceType, From 24293377b651ec6fab8c14a72d4bab82bde28ad1 Mon Sep 17 00:00:00 2001 From: z7zmey Date: Fri, 26 Oct 2018 11:53:54 +0300 Subject: [PATCH 045/117] remove meta.AtToken --- meta/tokenName.go | 1 - meta/tokenName_string.go | 4 ++-- php5/php5.go | 2 +- php5/php5.y | 2 +- php7/php7.go | 2 +- php7/php7.y | 2 +- printer/printer.go | 2 -- printer/printer_test.go | 2 +- 8 files changed, 7 insertions(+), 10 deletions(-) diff --git a/meta/tokenName.go b/meta/tokenName.go index 043893d..a426cf2 100644 --- a/meta/tokenName.go +++ b/meta/tokenName.go @@ -121,7 +121,6 @@ const ( AmpersandToken // '&' MinusToken // '-' PlusToken // '+' - AtToken // '@' CommaToken // ',' VerticalBarToken // '|' EqualToken // '=' diff --git a/meta/tokenName_string.go b/meta/tokenName_string.go index 16e3cd5..1724ff9 100644 --- a/meta/tokenName_string.go +++ b/meta/tokenName_string.go @@ -4,9 +4,9 @@ package meta import "strconv" -const _TokenName_name = "NodeStartNodeEndIncludeTokenIncludeOnceTokenExitTokenIfTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenIssetTokenEmptyTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenListTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenEvalTokenRequireTokenRequireOnceTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenNewAnchorElseifTokenElseTokenEndifTokenPrintTokenYieldTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenYieldFromTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenBackquoteTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenAtTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" +const _TokenName_name = "NodeStartNodeEndIncludeTokenIncludeOnceTokenExitTokenIfTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenIssetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenListTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenEvalTokenRequireTokenRequireOnceTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenNewAnchorElseifTokenElseTokenEndifTokenPrintTokenYieldTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenYieldFromTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenBackquoteTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" -var _TokenName_index = [...]uint16{0, 9, 16, 28, 44, 53, 60, 78, 92, 107, 116, 123, 133, 146, 167, 188, 196, 207, 219, 234, 246, 261, 268, 279, 293, 302, 314, 324, 337, 346, 359, 369, 380, 388, 398, 410, 420, 434, 445, 453, 463, 473, 483, 493, 503, 517, 529, 544, 560, 569, 582, 596, 620, 646, 662, 675, 684, 696, 712, 726, 741, 756, 771, 780, 791, 800, 810, 820, 830, 843, 853, 865, 879, 890, 898, 906, 920, 939, 952, 966, 980, 995, 1008, 1021, 1034, 1050, 1063, 1076, 1088, 1101, 1113, 1125, 1139, 1154, 1162, 1169, 1176, 1192, 1211, 1223, 1238, 1259, 1280, 1297, 1315, 1329, 1349, 1370, 1384, 1394, 1414, 1435, 1452, 1470, 1487, 1501, 1511, 1520, 1527, 1537, 1553, 1563, 1573, 1586, 1596, 1608, 1617, 1629, 1637} +var _TokenName_index = [...]uint16{0, 9, 16, 28, 44, 53, 60, 78, 92, 107, 116, 123, 133, 146, 167, 188, 196, 207, 219, 234, 246, 261, 268, 279, 293, 302, 314, 324, 337, 346, 359, 369, 380, 388, 398, 410, 420, 434, 445, 453, 463, 473, 483, 493, 507, 519, 534, 550, 559, 572, 586, 610, 636, 652, 665, 674, 686, 702, 716, 731, 746, 761, 770, 781, 790, 800, 810, 820, 833, 843, 855, 869, 880, 888, 896, 910, 929, 942, 956, 970, 985, 998, 1011, 1024, 1040, 1053, 1066, 1078, 1091, 1103, 1115, 1129, 1144, 1152, 1159, 1166, 1182, 1201, 1213, 1228, 1249, 1270, 1287, 1305, 1319, 1339, 1360, 1374, 1384, 1404, 1425, 1442, 1460, 1477, 1491, 1501, 1510, 1520, 1536, 1546, 1556, 1569, 1579, 1591, 1600, 1612, 1620} func (i TokenName) String() string { if i < 0 || i >= TokenName(len(_TokenName_index)-1) { diff --git a/php5/php5.go b/php5/php5.go index 932758d..520de19 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -6528,7 +6528,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.AtToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php5/php5.y b/php5/php5.y index 0225363..57ee1e9 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -4171,7 +4171,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.AtToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php7/php7.go b/php7/php7.go index 9f75d4c..d8e1ca7 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -6461,7 +6461,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.AtToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php7/php7.y b/php7/php7.y index a642a0a..c3c8b27 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -3906,7 +3906,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.AtToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/printer/printer.go b/printer/printer.go index 86485f4..a183625 100644 --- a/printer/printer.go +++ b/printer/printer.go @@ -1302,8 +1302,6 @@ func (p *Printer) printExprEmpty(n node.Node) { func (p *Printer) printExprErrorSuppress(n node.Node) { nn := n.(*expr.ErrorSuppress) p.printMeta(nn, meta.NodeStart) - - p.printMeta(nn, meta.AtToken) io.WriteString(p.w, "@") p.Print(nn.Expr) diff --git a/printer/printer_test.go b/printer/printer_test.go index 53a832f..99820f6 100644 --- a/printer/printer_test.go +++ b/printer/printer_test.go @@ -3303,7 +3303,7 @@ func TestPrinterPrettyPrinterrorSuppress(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.AtToken, + TokenName: meta.NodeStart, }, }, Expr: &expr.Variable{ From 89064d4530c301adaa41d067e41de6e9f0050fdf Mon Sep 17 00:00:00 2001 From: z7zmey Date: Fri, 26 Oct 2018 11:55:59 +0300 Subject: [PATCH 046/117] remove meta.EvalToken --- meta/tokenName.go | 1 - meta/tokenName_string.go | 4 ++-- php5/php5.go | 2 +- php5/php5.y | 2 +- php7/php7.go | 2 +- php7/php7.y | 2 +- printer/printer.go | 2 -- printer/printer_test.go | 2 +- 8 files changed, 7 insertions(+), 10 deletions(-) diff --git a/meta/tokenName.go b/meta/tokenName.go index a426cf2..ab801f3 100644 --- a/meta/tokenName.go +++ b/meta/tokenName.go @@ -59,7 +59,6 @@ const ( UseLeadingNsSeparatorToken NsSeparatorToken EllipsisToken - EvalToken RequireToken RequireOnceToken LogicalOrToken diff --git a/meta/tokenName_string.go b/meta/tokenName_string.go index 1724ff9..67db002 100644 --- a/meta/tokenName_string.go +++ b/meta/tokenName_string.go @@ -4,9 +4,9 @@ package meta import "strconv" -const _TokenName_name = "NodeStartNodeEndIncludeTokenIncludeOnceTokenExitTokenIfTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenIssetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenListTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenEvalTokenRequireTokenRequireOnceTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenNewAnchorElseifTokenElseTokenEndifTokenPrintTokenYieldTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenYieldFromTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenBackquoteTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" +const _TokenName_name = "NodeStartNodeEndIncludeTokenIncludeOnceTokenExitTokenIfTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenIssetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenListTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenRequireTokenRequireOnceTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenNewAnchorElseifTokenElseTokenEndifTokenPrintTokenYieldTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenYieldFromTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenBackquoteTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" -var _TokenName_index = [...]uint16{0, 9, 16, 28, 44, 53, 60, 78, 92, 107, 116, 123, 133, 146, 167, 188, 196, 207, 219, 234, 246, 261, 268, 279, 293, 302, 314, 324, 337, 346, 359, 369, 380, 388, 398, 410, 420, 434, 445, 453, 463, 473, 483, 493, 507, 519, 534, 550, 559, 572, 586, 610, 636, 652, 665, 674, 686, 702, 716, 731, 746, 761, 770, 781, 790, 800, 810, 820, 833, 843, 855, 869, 880, 888, 896, 910, 929, 942, 956, 970, 985, 998, 1011, 1024, 1040, 1053, 1066, 1078, 1091, 1103, 1115, 1129, 1144, 1152, 1159, 1166, 1182, 1201, 1213, 1228, 1249, 1270, 1287, 1305, 1319, 1339, 1360, 1374, 1384, 1404, 1425, 1442, 1460, 1477, 1491, 1501, 1510, 1520, 1536, 1546, 1556, 1569, 1579, 1591, 1600, 1612, 1620} +var _TokenName_index = [...]uint16{0, 9, 16, 28, 44, 53, 60, 78, 92, 107, 116, 123, 133, 146, 167, 188, 196, 207, 219, 234, 246, 261, 268, 279, 293, 302, 314, 324, 337, 346, 359, 369, 380, 388, 398, 410, 420, 434, 445, 453, 463, 473, 483, 493, 507, 519, 534, 550, 559, 572, 586, 610, 636, 652, 665, 677, 693, 707, 722, 737, 752, 761, 772, 781, 791, 801, 811, 824, 834, 846, 860, 871, 879, 887, 901, 920, 933, 947, 961, 976, 989, 1002, 1015, 1031, 1044, 1057, 1069, 1082, 1094, 1106, 1120, 1135, 1143, 1150, 1157, 1173, 1192, 1204, 1219, 1240, 1261, 1278, 1296, 1310, 1330, 1351, 1365, 1375, 1395, 1416, 1433, 1451, 1468, 1482, 1492, 1501, 1511, 1527, 1537, 1547, 1560, 1570, 1582, 1591, 1603, 1611} func (i TokenName) String() string { if i < 0 || i >= TokenName(len(_TokenName_index)-1) { diff --git a/php5/php5.go b/php5/php5.go index 520de19..6fd6414 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -9455,7 +9455,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.EvalToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) diff --git a/php5/php5.y b/php5/php5.y index 57ee1e9..80d5fe0 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -6856,7 +6856,7 @@ internal_functions_in_yacc: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $1.Meta.SetTokenName(meta.EvalToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) $4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) diff --git a/php7/php7.go b/php7/php7.go index d8e1ca7..bb919e2 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -8101,7 +8101,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.EvalToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) diff --git a/php7/php7.y b/php7/php7.y index c3c8b27..5899c26 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -5402,7 +5402,7 @@ internal_functions_in_yacc: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $1.Meta.SetTokenName(meta.EvalToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) $4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) diff --git a/printer/printer.go b/printer/printer.go index a183625..9971a36 100644 --- a/printer/printer.go +++ b/printer/printer.go @@ -1311,8 +1311,6 @@ func (p *Printer) printExprErrorSuppress(n node.Node) { func (p *Printer) printExprEval(n node.Node) { nn := n.(*expr.Eval) p.printMeta(nn, meta.NodeStart) - - p.printMeta(nn, meta.EvalToken) io.WriteString(p.w, "eval") p.printMeta(nn, meta.OpenParenthesisToken) io.WriteString(p.w, "(") diff --git a/printer/printer_test.go b/printer/printer_test.go index 99820f6..498754c 100644 --- a/printer/printer_test.go +++ b/printer/printer_test.go @@ -3335,7 +3335,7 @@ func TestPrinterPrintEval(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.EvalToken, + TokenName: meta.NodeStart, }, &meta.Data{ Type: meta.WhiteSpaceType, From 5159b0f473ee2ef155bb1b5bee2873936bfb40f3 Mon Sep 17 00:00:00 2001 From: z7zmey Date: Fri, 26 Oct 2018 11:58:21 +0300 Subject: [PATCH 047/117] remove meta.ExitToken --- meta/tokenName.go | 1 - meta/tokenName_string.go | 4 ++-- php5/php5.go | 2 +- php5/php5.y | 2 +- php7/php7.go | 2 +- php7/php7.y | 2 +- printer/printer.go | 2 +- printer/printer_test.go | 4 ++-- 8 files changed, 9 insertions(+), 10 deletions(-) diff --git a/meta/tokenName.go b/meta/tokenName.go index ab801f3..a00cf97 100644 --- a/meta/tokenName.go +++ b/meta/tokenName.go @@ -9,7 +9,6 @@ const ( NodeEnd IncludeToken IncludeOnceToken - ExitToken IfToken StringVarnameToken NumStringToken diff --git a/meta/tokenName_string.go b/meta/tokenName_string.go index 67db002..146482e 100644 --- a/meta/tokenName_string.go +++ b/meta/tokenName_string.go @@ -4,9 +4,9 @@ package meta import "strconv" -const _TokenName_name = "NodeStartNodeEndIncludeTokenIncludeOnceTokenExitTokenIfTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenIssetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenListTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenRequireTokenRequireOnceTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenNewAnchorElseifTokenElseTokenEndifTokenPrintTokenYieldTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenYieldFromTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenBackquoteTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" +const _TokenName_name = "NodeStartNodeEndIncludeTokenIncludeOnceTokenIfTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenIssetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenListTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenRequireTokenRequireOnceTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenNewAnchorElseifTokenElseTokenEndifTokenPrintTokenYieldTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenYieldFromTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenBackquoteTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" -var _TokenName_index = [...]uint16{0, 9, 16, 28, 44, 53, 60, 78, 92, 107, 116, 123, 133, 146, 167, 188, 196, 207, 219, 234, 246, 261, 268, 279, 293, 302, 314, 324, 337, 346, 359, 369, 380, 388, 398, 410, 420, 434, 445, 453, 463, 473, 483, 493, 507, 519, 534, 550, 559, 572, 586, 610, 636, 652, 665, 677, 693, 707, 722, 737, 752, 761, 772, 781, 791, 801, 811, 824, 834, 846, 860, 871, 879, 887, 901, 920, 933, 947, 961, 976, 989, 1002, 1015, 1031, 1044, 1057, 1069, 1082, 1094, 1106, 1120, 1135, 1143, 1150, 1157, 1173, 1192, 1204, 1219, 1240, 1261, 1278, 1296, 1310, 1330, 1351, 1365, 1375, 1395, 1416, 1433, 1451, 1468, 1482, 1492, 1501, 1511, 1527, 1537, 1547, 1560, 1570, 1582, 1591, 1603, 1611} +var _TokenName_index = [...]uint16{0, 9, 16, 28, 44, 51, 69, 83, 98, 107, 114, 124, 137, 158, 179, 187, 198, 210, 225, 237, 252, 259, 270, 284, 293, 305, 315, 328, 337, 350, 360, 371, 379, 389, 401, 411, 425, 436, 444, 454, 464, 474, 484, 498, 510, 525, 541, 550, 563, 577, 601, 627, 643, 656, 668, 684, 698, 713, 728, 743, 752, 763, 772, 782, 792, 802, 815, 825, 837, 851, 862, 870, 878, 892, 911, 924, 938, 952, 967, 980, 993, 1006, 1022, 1035, 1048, 1060, 1073, 1085, 1097, 1111, 1126, 1134, 1141, 1148, 1164, 1183, 1195, 1210, 1231, 1252, 1269, 1287, 1301, 1321, 1342, 1356, 1366, 1386, 1407, 1424, 1442, 1459, 1473, 1483, 1492, 1502, 1518, 1528, 1538, 1551, 1561, 1573, 1582, 1594, 1602} func (i TokenName) String() string { if i < 0 || i >= TokenName(len(_TokenName_index)-1) { diff --git a/php5/php5.go b/php5/php5.go index 6fd6414..9211ac4 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -6514,7 +6514,7 @@ yydefault: } // save comments - yyDollar[1].token.Meta.SetTokenName(meta.ExitToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php5/php5.y b/php5/php5.y index 80d5fe0..cb9ad3f 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -4159,7 +4159,7 @@ expr_without_variable: } // save comments - $1.Meta.SetTokenName(meta.ExitToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php7/php7.go b/php7/php7.go index bb919e2..480dfeb 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -6447,7 +6447,7 @@ yydefault: } // save comments - yyDollar[1].token.Meta.SetTokenName(meta.ExitToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php7/php7.y b/php7/php7.y index 5899c26..18c5653 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -3894,7 +3894,7 @@ expr_without_variable: } // save comments - $1.Meta.SetTokenName(meta.ExitToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/printer/printer.go b/printer/printer.go index 9971a36..f11d1bf 100644 --- a/printer/printer.go +++ b/printer/printer.go @@ -1325,12 +1325,12 @@ func (p *Printer) printExprExit(n node.Node) { nn := n.(*expr.Exit) p.printMeta(nn, meta.NodeStart) - p.printMeta(nn, meta.ExitToken) if nn.Die { io.WriteString(p.w, "die") } else { io.WriteString(p.w, "exit") } + p.printMeta(nn, meta.OpenParenthesisToken) p.Print(nn.Expr) p.printMeta(nn, meta.CloseParenthesisToken) diff --git a/printer/printer_test.go b/printer/printer_test.go index 498754c..fe507b1 100644 --- a/printer/printer_test.go +++ b/printer/printer_test.go @@ -3377,7 +3377,7 @@ func TestPrinterPrintExit(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.ExitToken, + TokenName: meta.NodeStart, }, &meta.Data{ Type: meta.WhiteSpaceType, @@ -3421,7 +3421,7 @@ func TestPrinterPrintDie(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.ExitToken, + TokenName: meta.NodeStart, }, &meta.Data{ Type: meta.WhiteSpaceType, From fb6d21fe6e32dabc9da536638f191279f0df69fb Mon Sep 17 00:00:00 2001 From: z7zmey Date: Fri, 26 Oct 2018 12:01:47 +0300 Subject: [PATCH 048/117] remove meta.IncludeToken --- meta/tokenName.go | 1 - meta/tokenName_string.go | 4 ++-- php5/php5.go | 2 +- php5/php5.y | 2 +- php7/php7.go | 2 +- php7/php7.y | 2 +- printer/printer.go | 3 --- printer/printer_test.go | 2 +- 8 files changed, 7 insertions(+), 11 deletions(-) diff --git a/meta/tokenName.go b/meta/tokenName.go index a00cf97..8b574d9 100644 --- a/meta/tokenName.go +++ b/meta/tokenName.go @@ -7,7 +7,6 @@ type TokenName int const ( NodeStart TokenName = iota NodeEnd - IncludeToken IncludeOnceToken IfToken StringVarnameToken diff --git a/meta/tokenName_string.go b/meta/tokenName_string.go index 146482e..e4bc753 100644 --- a/meta/tokenName_string.go +++ b/meta/tokenName_string.go @@ -4,9 +4,9 @@ package meta import "strconv" -const _TokenName_name = "NodeStartNodeEndIncludeTokenIncludeOnceTokenIfTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenIssetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenListTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenRequireTokenRequireOnceTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenNewAnchorElseifTokenElseTokenEndifTokenPrintTokenYieldTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenYieldFromTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenBackquoteTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" +const _TokenName_name = "NodeStartNodeEndIncludeOnceTokenIfTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenIssetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenListTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenRequireTokenRequireOnceTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenNewAnchorElseifTokenElseTokenEndifTokenPrintTokenYieldTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenYieldFromTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenBackquoteTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" -var _TokenName_index = [...]uint16{0, 9, 16, 28, 44, 51, 69, 83, 98, 107, 114, 124, 137, 158, 179, 187, 198, 210, 225, 237, 252, 259, 270, 284, 293, 305, 315, 328, 337, 350, 360, 371, 379, 389, 401, 411, 425, 436, 444, 454, 464, 474, 484, 498, 510, 525, 541, 550, 563, 577, 601, 627, 643, 656, 668, 684, 698, 713, 728, 743, 752, 763, 772, 782, 792, 802, 815, 825, 837, 851, 862, 870, 878, 892, 911, 924, 938, 952, 967, 980, 993, 1006, 1022, 1035, 1048, 1060, 1073, 1085, 1097, 1111, 1126, 1134, 1141, 1148, 1164, 1183, 1195, 1210, 1231, 1252, 1269, 1287, 1301, 1321, 1342, 1356, 1366, 1386, 1407, 1424, 1442, 1459, 1473, 1483, 1492, 1502, 1518, 1528, 1538, 1551, 1561, 1573, 1582, 1594, 1602} +var _TokenName_index = [...]uint16{0, 9, 16, 32, 39, 57, 71, 86, 95, 102, 112, 125, 146, 167, 175, 186, 198, 213, 225, 240, 247, 258, 272, 281, 293, 303, 316, 325, 338, 348, 359, 367, 377, 389, 399, 413, 424, 432, 442, 452, 462, 472, 486, 498, 513, 529, 538, 551, 565, 589, 615, 631, 644, 656, 672, 686, 701, 716, 731, 740, 751, 760, 770, 780, 790, 803, 813, 825, 839, 850, 858, 866, 880, 899, 912, 926, 940, 955, 968, 981, 994, 1010, 1023, 1036, 1048, 1061, 1073, 1085, 1099, 1114, 1122, 1129, 1136, 1152, 1171, 1183, 1198, 1219, 1240, 1257, 1275, 1289, 1309, 1330, 1344, 1354, 1374, 1395, 1412, 1430, 1447, 1461, 1471, 1480, 1490, 1506, 1516, 1526, 1539, 1549, 1561, 1570, 1582, 1590} func (i TokenName) String() string { if i < 0 || i >= TokenName(len(_TokenName_index)-1) { diff --git a/php5/php5.go b/php5/php5.go index 9211ac4..9f6ba42 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -9427,7 +9427,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.IncludeToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php5/php5.y b/php5/php5.y index cb9ad3f..8d601c1 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -6832,7 +6832,7 @@ internal_functions_in_yacc: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.IncludeToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php7/php7.go b/php7/php7.go index 480dfeb..cce0ebb 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -8073,7 +8073,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.IncludeToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php7/php7.y b/php7/php7.y index 18c5653..452e608 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -5378,7 +5378,7 @@ internal_functions_in_yacc: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.IncludeToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/printer/printer.go b/printer/printer.go index f11d1bf..6850b94 100644 --- a/printer/printer.go +++ b/printer/printer.go @@ -1356,11 +1356,8 @@ func (p *Printer) printExprFunctionCall(n node.Node) { func (p *Printer) printExprInclude(n node.Node) { nn := n.(*expr.Include) p.printMeta(nn, meta.NodeStart) - - p.printMeta(nn, meta.IncludeToken) io.WriteString(p.w, "include") p.Print(nn.Expr) - p.printMeta(nn, meta.NodeEnd) } diff --git a/printer/printer_test.go b/printer/printer_test.go index fe507b1..fff8fbb 100644 --- a/printer/printer_test.go +++ b/printer/printer_test.go @@ -3542,7 +3542,7 @@ func TestPrinterPrintInclude(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.IncludeToken, + TokenName: meta.NodeStart, }, }, Expr: &scalar.String{Value: "'path'"}, From 6995b20aef2ca53b8177ca8b5705c76182335a14 Mon Sep 17 00:00:00 2001 From: z7zmey Date: Fri, 26 Oct 2018 12:02:41 +0300 Subject: [PATCH 049/117] remove meta.IncludeOnceToken --- meta/tokenName.go | 1 - meta/tokenName_string.go | 4 ++-- php5/php5.go | 2 +- php5/php5.y | 2 +- php7/php7.go | 2 +- php7/php7.y | 2 +- printer/printer.go | 3 --- printer/printer_test.go | 2 +- 8 files changed, 7 insertions(+), 11 deletions(-) diff --git a/meta/tokenName.go b/meta/tokenName.go index 8b574d9..29e82e3 100644 --- a/meta/tokenName.go +++ b/meta/tokenName.go @@ -7,7 +7,6 @@ type TokenName int const ( NodeStart TokenName = iota NodeEnd - IncludeOnceToken IfToken StringVarnameToken NumStringToken diff --git a/meta/tokenName_string.go b/meta/tokenName_string.go index e4bc753..893cf02 100644 --- a/meta/tokenName_string.go +++ b/meta/tokenName_string.go @@ -4,9 +4,9 @@ package meta import "strconv" -const _TokenName_name = "NodeStartNodeEndIncludeOnceTokenIfTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenIssetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenListTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenRequireTokenRequireOnceTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenNewAnchorElseifTokenElseTokenEndifTokenPrintTokenYieldTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenYieldFromTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenBackquoteTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" +const _TokenName_name = "NodeStartNodeEndIfTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenIssetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenListTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenRequireTokenRequireOnceTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenNewAnchorElseifTokenElseTokenEndifTokenPrintTokenYieldTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenYieldFromTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenBackquoteTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" -var _TokenName_index = [...]uint16{0, 9, 16, 32, 39, 57, 71, 86, 95, 102, 112, 125, 146, 167, 175, 186, 198, 213, 225, 240, 247, 258, 272, 281, 293, 303, 316, 325, 338, 348, 359, 367, 377, 389, 399, 413, 424, 432, 442, 452, 462, 472, 486, 498, 513, 529, 538, 551, 565, 589, 615, 631, 644, 656, 672, 686, 701, 716, 731, 740, 751, 760, 770, 780, 790, 803, 813, 825, 839, 850, 858, 866, 880, 899, 912, 926, 940, 955, 968, 981, 994, 1010, 1023, 1036, 1048, 1061, 1073, 1085, 1099, 1114, 1122, 1129, 1136, 1152, 1171, 1183, 1198, 1219, 1240, 1257, 1275, 1289, 1309, 1330, 1344, 1354, 1374, 1395, 1412, 1430, 1447, 1461, 1471, 1480, 1490, 1506, 1516, 1526, 1539, 1549, 1561, 1570, 1582, 1590} +var _TokenName_index = [...]uint16{0, 9, 16, 23, 41, 55, 70, 79, 86, 96, 109, 130, 151, 159, 170, 182, 197, 209, 224, 231, 242, 256, 265, 277, 287, 300, 309, 322, 332, 343, 351, 361, 373, 383, 397, 408, 416, 426, 436, 446, 456, 470, 482, 497, 513, 522, 535, 549, 573, 599, 615, 628, 640, 656, 670, 685, 700, 715, 724, 735, 744, 754, 764, 774, 787, 797, 809, 823, 834, 842, 850, 864, 883, 896, 910, 924, 939, 952, 965, 978, 994, 1007, 1020, 1032, 1045, 1057, 1069, 1083, 1098, 1106, 1113, 1120, 1136, 1155, 1167, 1182, 1203, 1224, 1241, 1259, 1273, 1293, 1314, 1328, 1338, 1358, 1379, 1396, 1414, 1431, 1445, 1455, 1464, 1474, 1490, 1500, 1510, 1523, 1533, 1545, 1554, 1566, 1574} func (i TokenName) String() string { if i < 0 || i >= TokenName(len(_TokenName_index)-1) { diff --git a/php5/php5.go b/php5/php5.go index 9f6ba42..14a40a6 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -9441,7 +9441,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.IncludeOnceToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php5/php5.y b/php5/php5.y index 8d601c1..3a11de3 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -6844,7 +6844,7 @@ internal_functions_in_yacc: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.IncludeOnceToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php7/php7.go b/php7/php7.go index cce0ebb..720d204 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -8087,7 +8087,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.IncludeOnceToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php7/php7.y b/php7/php7.y index 452e608..4bfaf87 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -5390,7 +5390,7 @@ internal_functions_in_yacc: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.IncludeOnceToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/printer/printer.go b/printer/printer.go index 6850b94..0f9080e 100644 --- a/printer/printer.go +++ b/printer/printer.go @@ -1364,11 +1364,8 @@ func (p *Printer) printExprInclude(n node.Node) { func (p *Printer) printExprIncludeOnce(n node.Node) { nn := n.(*expr.IncludeOnce) p.printMeta(nn, meta.NodeStart) - - p.printMeta(nn, meta.IncludeOnceToken) io.WriteString(p.w, "include_once") p.Print(nn.Expr) - p.printMeta(nn, meta.NodeEnd) } diff --git a/printer/printer_test.go b/printer/printer_test.go index fff8fbb..baf4f7d 100644 --- a/printer/printer_test.go +++ b/printer/printer_test.go @@ -3565,7 +3565,7 @@ func TestPrinterPrintIncludeOnce(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.IncludeOnceToken, + TokenName: meta.NodeStart, }, }, Expr: &scalar.String{Value: "'path'"}, }) From ff0732a360b5a4c5867ed2131e1cacb9528ca182 Mon Sep 17 00:00:00 2001 From: z7zmey Date: Fri, 26 Oct 2018 12:03:45 +0300 Subject: [PATCH 050/117] remove meta.IssetToken --- meta/tokenName.go | 1 - meta/tokenName_string.go | 4 ++-- php5/php5.go | 2 +- php5/php5.y | 2 +- php7/php7.go | 2 +- php7/php7.y | 2 +- printer/printer.go | 1 - printer/printer_test.go | 2 +- 8 files changed, 7 insertions(+), 9 deletions(-) diff --git a/meta/tokenName.go b/meta/tokenName.go index 29e82e3..0ac8ae7 100644 --- a/meta/tokenName.go +++ b/meta/tokenName.go @@ -42,7 +42,6 @@ const ( GlobalToken VarToken UnsetToken - IssetToken ClassToken TraitToken InterfaceToken diff --git a/meta/tokenName_string.go b/meta/tokenName_string.go index 893cf02..9e09632 100644 --- a/meta/tokenName_string.go +++ b/meta/tokenName_string.go @@ -4,9 +4,9 @@ package meta import "strconv" -const _TokenName_name = "NodeStartNodeEndIfTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenIssetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenListTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenRequireTokenRequireOnceTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenNewAnchorElseifTokenElseTokenEndifTokenPrintTokenYieldTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenYieldFromTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenBackquoteTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" +const _TokenName_name = "NodeStartNodeEndIfTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenListTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenRequireTokenRequireOnceTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenNewAnchorElseifTokenElseTokenEndifTokenPrintTokenYieldTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenYieldFromTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenBackquoteTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" -var _TokenName_index = [...]uint16{0, 9, 16, 23, 41, 55, 70, 79, 86, 96, 109, 130, 151, 159, 170, 182, 197, 209, 224, 231, 242, 256, 265, 277, 287, 300, 309, 322, 332, 343, 351, 361, 373, 383, 397, 408, 416, 426, 436, 446, 456, 470, 482, 497, 513, 522, 535, 549, 573, 599, 615, 628, 640, 656, 670, 685, 700, 715, 724, 735, 744, 754, 764, 774, 787, 797, 809, 823, 834, 842, 850, 864, 883, 896, 910, 924, 939, 952, 965, 978, 994, 1007, 1020, 1032, 1045, 1057, 1069, 1083, 1098, 1106, 1113, 1120, 1136, 1155, 1167, 1182, 1203, 1224, 1241, 1259, 1273, 1293, 1314, 1328, 1338, 1358, 1379, 1396, 1414, 1431, 1445, 1455, 1464, 1474, 1490, 1500, 1510, 1523, 1533, 1545, 1554, 1566, 1574} +var _TokenName_index = [...]uint16{0, 9, 16, 23, 41, 55, 70, 79, 86, 96, 109, 130, 151, 159, 170, 182, 197, 209, 224, 231, 242, 256, 265, 277, 287, 300, 309, 322, 332, 343, 351, 361, 373, 383, 397, 408, 416, 426, 436, 446, 460, 472, 487, 503, 512, 525, 539, 563, 589, 605, 618, 630, 646, 660, 675, 690, 705, 714, 725, 734, 744, 754, 764, 777, 787, 799, 813, 824, 832, 840, 854, 873, 886, 900, 914, 929, 942, 955, 968, 984, 997, 1010, 1022, 1035, 1047, 1059, 1073, 1088, 1096, 1103, 1110, 1126, 1145, 1157, 1172, 1193, 1214, 1231, 1249, 1263, 1283, 1304, 1318, 1328, 1348, 1369, 1386, 1404, 1421, 1435, 1445, 1454, 1464, 1480, 1490, 1500, 1513, 1523, 1535, 1544, 1556, 1564} func (i TokenName) String() string { if i < 0 || i >= TokenName(len(_TokenName_index)-1) { diff --git a/php5/php5.go b/php5/php5.go index 14a40a6..7f79583 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -9379,7 +9379,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.IssetToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) diff --git a/php5/php5.y b/php5/php5.y index 3a11de3..ca1b0e6 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -6790,7 +6790,7 @@ internal_functions_in_yacc: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $1.Meta.SetTokenName(meta.IssetToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) $4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) diff --git a/php7/php7.go b/php7/php7.go index 720d204..4872c1a 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -8037,7 +8037,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[5].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.IssetToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) if yyDollar[4].token != nil { yyDollar[4].token.Meta.SetTokenName(meta.CommaToken).AppendTo(yyVAL.node.GetMeta()) diff --git a/php7/php7.y b/php7/php7.y index 4bfaf87..1ea4930 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -5346,7 +5346,7 @@ internal_functions_in_yacc: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5)) // save comments - $1.Meta.SetTokenName(meta.IssetToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) if $4 != nil { $4.Meta.SetTokenName(meta.CommaToken).AppendTo($$.GetMeta()) diff --git a/printer/printer.go b/printer/printer.go index 0f9080e..07e5b8f 100644 --- a/printer/printer.go +++ b/printer/printer.go @@ -1385,7 +1385,6 @@ func (p *Printer) printExprIsset(n node.Node) { nn := n.(*expr.Isset) p.printMeta(nn, meta.NodeStart) - p.printMeta(nn, meta.IssetToken) io.WriteString(p.w, "isset") p.printMeta(nn, meta.OpenParenthesisToken) io.WriteString(p.w, "(") diff --git a/printer/printer_test.go b/printer/printer_test.go index baf4f7d..2cd5811 100644 --- a/printer/printer_test.go +++ b/printer/printer_test.go @@ -3620,7 +3620,7 @@ func TestPrinterPrintIsset(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.IssetToken, + TokenName: meta.NodeStart, }, &meta.Data{ Type: meta.WhiteSpaceType, From 67dfb0773cd1db94b486cea0468eadf28eca1ac2 Mon Sep 17 00:00:00 2001 From: z7zmey Date: Fri, 26 Oct 2018 12:06:16 +0300 Subject: [PATCH 051/117] remove meta.ListToken --- meta/tokenName.go | 1 - meta/tokenName_string.go | 4 ++-- php5/php5.go | 6 +++--- php5/php5.y | 6 +++--- php7/php7.go | 8 ++++---- php7/php7.y | 8 ++++---- printer/printer.go | 1 - printer/printer_test.go | 2 +- 8 files changed, 17 insertions(+), 19 deletions(-) diff --git a/meta/tokenName.go b/meta/tokenName.go index 0ac8ae7..6e1c0d4 100644 --- a/meta/tokenName.go +++ b/meta/tokenName.go @@ -48,7 +48,6 @@ const ( ExtendsToken ImplementsToken DoubleArrowToken - ListToken CallableToken CurlyOpenToken PaamayimNekudotayimToken diff --git a/meta/tokenName_string.go b/meta/tokenName_string.go index 9e09632..ef2b6c9 100644 --- a/meta/tokenName_string.go +++ b/meta/tokenName_string.go @@ -4,9 +4,9 @@ package meta import "strconv" -const _TokenName_name = "NodeStartNodeEndIfTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenListTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenRequireTokenRequireOnceTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenNewAnchorElseifTokenElseTokenEndifTokenPrintTokenYieldTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenYieldFromTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenBackquoteTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" +const _TokenName_name = "NodeStartNodeEndIfTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenRequireTokenRequireOnceTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenNewAnchorElseifTokenElseTokenEndifTokenPrintTokenYieldTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenYieldFromTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenBackquoteTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" -var _TokenName_index = [...]uint16{0, 9, 16, 23, 41, 55, 70, 79, 86, 96, 109, 130, 151, 159, 170, 182, 197, 209, 224, 231, 242, 256, 265, 277, 287, 300, 309, 322, 332, 343, 351, 361, 373, 383, 397, 408, 416, 426, 436, 446, 460, 472, 487, 503, 512, 525, 539, 563, 589, 605, 618, 630, 646, 660, 675, 690, 705, 714, 725, 734, 744, 754, 764, 777, 787, 799, 813, 824, 832, 840, 854, 873, 886, 900, 914, 929, 942, 955, 968, 984, 997, 1010, 1022, 1035, 1047, 1059, 1073, 1088, 1096, 1103, 1110, 1126, 1145, 1157, 1172, 1193, 1214, 1231, 1249, 1263, 1283, 1304, 1318, 1328, 1348, 1369, 1386, 1404, 1421, 1435, 1445, 1454, 1464, 1480, 1490, 1500, 1513, 1523, 1535, 1544, 1556, 1564} +var _TokenName_index = [...]uint16{0, 9, 16, 23, 41, 55, 70, 79, 86, 96, 109, 130, 151, 159, 170, 182, 197, 209, 224, 231, 242, 256, 265, 277, 287, 300, 309, 322, 332, 343, 351, 361, 373, 383, 397, 408, 416, 426, 436, 446, 460, 472, 487, 503, 516, 530, 554, 580, 596, 609, 621, 637, 651, 666, 681, 696, 705, 716, 725, 735, 745, 755, 768, 778, 790, 804, 815, 823, 831, 845, 864, 877, 891, 905, 920, 933, 946, 959, 975, 988, 1001, 1013, 1026, 1038, 1050, 1064, 1079, 1087, 1094, 1101, 1117, 1136, 1148, 1163, 1184, 1205, 1222, 1240, 1254, 1274, 1295, 1309, 1319, 1339, 1360, 1377, 1395, 1412, 1426, 1436, 1445, 1455, 1471, 1481, 1491, 1504, 1514, 1526, 1535, 1547, 1555} func (i TokenName) String() string { if i < 0 || i >= TokenName(len(_TokenName_index)-1) { diff --git a/php5/php5.go b/php5/php5.go index 7f79583..ee86c94 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -3972,7 +3972,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.ListToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) @@ -5573,7 +5573,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[6].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.ListToken).AppendTo(list.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(list.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(list.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(list.GetMeta()) yyDollar[5].token.Meta.SetTokenName(meta.EqualToken).AppendTo(yyVAL.node.GetMeta()) @@ -8960,7 +8960,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(item)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.ListToken).AppendTo(item.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(item.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(item.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(item.GetMeta()) diff --git a/php5/php5.y b/php5/php5.y index ca1b0e6..eabdb90 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -1806,7 +1806,7 @@ foreach_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $1.Meta.SetTokenName(meta.ListToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) $4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) @@ -3346,7 +3346,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $6)) // save comments - $1.Meta.SetTokenName(meta.ListToken).AppendTo(list.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo(list.GetMeta()) $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(list.GetMeta()) $4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(list.GetMeta()) $5.Meta.SetTokenName(meta.EqualToken).AppendTo($$.GetMeta()) @@ -6404,7 +6404,7 @@ assignment_list_element: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(item)) // save comments - $1.Meta.SetTokenName(meta.ListToken).AppendTo(item.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo(item.GetMeta()) $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(item.GetMeta()) $4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(item.GetMeta()) diff --git a/php7/php7.go b/php7/php7.go index 4872c1a..79b2775 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -4038,7 +4038,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.ListToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) @@ -5516,7 +5516,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[6].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.ListToken).AppendTo(list.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(list.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(list.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(list.GetMeta()) yyDollar[5].token.Meta.SetTokenName(meta.EqualToken).AppendTo(yyVAL.node.GetMeta()) @@ -7729,7 +7729,7 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.ListToken).AppendTo(list.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(list.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(list.GetMeta()) yyDollar[6].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(list.GetMeta()) @@ -7748,7 +7748,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.ListToken).AppendTo(list.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(list.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(list.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(list.GetMeta()) diff --git a/php7/php7.y b/php7/php7.y index 1ea4930..bcf4e18 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -1678,7 +1678,7 @@ foreach_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $1.Meta.SetTokenName(meta.ListToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) $4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) @@ -3093,7 +3093,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $6)) // save comments - $1.Meta.SetTokenName(meta.ListToken).AppendTo(list.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo(list.GetMeta()) $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(list.GetMeta()) $4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(list.GetMeta()) $5.Meta.SetTokenName(meta.EqualToken).AppendTo($$.GetMeta()) @@ -5060,7 +5060,7 @@ array_pair: // save comments $2.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.ListToken).AppendTo(list.GetMeta()) + $3.Meta.SetTokenName(meta.NodeStart).AppendTo(list.GetMeta()) $4.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(list.GetMeta()) $6.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(list.GetMeta()) @@ -5077,7 +5077,7 @@ array_pair: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $1.Meta.SetTokenName(meta.ListToken).AppendTo(list.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo(list.GetMeta()) $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(list.GetMeta()) $4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(list.GetMeta()) diff --git a/printer/printer.go b/printer/printer.go index 07e5b8f..d61f86c 100644 --- a/printer/printer.go +++ b/printer/printer.go @@ -1400,7 +1400,6 @@ func (p *Printer) printExprList(n node.Node) { nn := n.(*expr.List) p.printMeta(nn, meta.NodeStart) - p.printMeta(nn, meta.ListToken) io.WriteString(p.w, "list") p.printMeta(nn, meta.OpenParenthesisToken) io.WriteString(p.w, "(") diff --git a/printer/printer_test.go b/printer/printer_test.go index 2cd5811..0bb0465 100644 --- a/printer/printer_test.go +++ b/printer/printer_test.go @@ -3674,7 +3674,7 @@ func TestPrinterPrintList(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.ListToken, + TokenName: meta.NodeStart, }, &meta.Data{ Type: meta.WhiteSpaceType, From fb8ec01280c3780a51a291ba93b363b758075d3f Mon Sep 17 00:00:00 2001 From: z7zmey Date: Fri, 26 Oct 2018 12:08:07 +0300 Subject: [PATCH 052/117] remove meta.NewAnchor --- meta/tokenName.go | 1 - meta/tokenName_string.go | 4 ++-- php5/php5.go | 4 ++-- php5/php5.y | 4 ++-- php7/php7.go | 4 ++-- php7/php7.y | 4 ++-- printer/printer.go | 1 - printer/printer_test.go | 2 +- 8 files changed, 11 insertions(+), 13 deletions(-) diff --git a/meta/tokenName.go b/meta/tokenName.go index 6e1c0d4..f8434d6 100644 --- a/meta/tokenName.go +++ b/meta/tokenName.go @@ -60,7 +60,6 @@ const ( LogicalXorToken LogicalAndToken InstanceofToken - NewAnchor ElseifToken ElseToken EndifToken diff --git a/meta/tokenName_string.go b/meta/tokenName_string.go index ef2b6c9..a8d8873 100644 --- a/meta/tokenName_string.go +++ b/meta/tokenName_string.go @@ -4,9 +4,9 @@ package meta import "strconv" -const _TokenName_name = "NodeStartNodeEndIfTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenRequireTokenRequireOnceTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenNewAnchorElseifTokenElseTokenEndifTokenPrintTokenYieldTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenYieldFromTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenBackquoteTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" +const _TokenName_name = "NodeStartNodeEndIfTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenRequireTokenRequireOnceTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenElseifTokenElseTokenEndifTokenPrintTokenYieldTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenYieldFromTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenBackquoteTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" -var _TokenName_index = [...]uint16{0, 9, 16, 23, 41, 55, 70, 79, 86, 96, 109, 130, 151, 159, 170, 182, 197, 209, 224, 231, 242, 256, 265, 277, 287, 300, 309, 322, 332, 343, 351, 361, 373, 383, 397, 408, 416, 426, 436, 446, 460, 472, 487, 503, 516, 530, 554, 580, 596, 609, 621, 637, 651, 666, 681, 696, 705, 716, 725, 735, 745, 755, 768, 778, 790, 804, 815, 823, 831, 845, 864, 877, 891, 905, 920, 933, 946, 959, 975, 988, 1001, 1013, 1026, 1038, 1050, 1064, 1079, 1087, 1094, 1101, 1117, 1136, 1148, 1163, 1184, 1205, 1222, 1240, 1254, 1274, 1295, 1309, 1319, 1339, 1360, 1377, 1395, 1412, 1426, 1436, 1445, 1455, 1471, 1481, 1491, 1504, 1514, 1526, 1535, 1547, 1555} +var _TokenName_index = [...]uint16{0, 9, 16, 23, 41, 55, 70, 79, 86, 96, 109, 130, 151, 159, 170, 182, 197, 209, 224, 231, 242, 256, 265, 277, 287, 300, 309, 322, 332, 343, 351, 361, 373, 383, 397, 408, 416, 426, 436, 446, 460, 472, 487, 503, 516, 530, 554, 580, 596, 609, 621, 637, 651, 666, 681, 696, 707, 716, 726, 736, 746, 759, 769, 781, 795, 806, 814, 822, 836, 855, 868, 882, 896, 911, 924, 937, 950, 966, 979, 992, 1004, 1017, 1029, 1041, 1055, 1070, 1078, 1085, 1092, 1108, 1127, 1139, 1154, 1175, 1196, 1213, 1231, 1245, 1265, 1286, 1300, 1310, 1330, 1351, 1368, 1386, 1403, 1417, 1427, 1436, 1446, 1462, 1472, 1482, 1495, 1505, 1517, 1526, 1538, 1546} func (i TokenName) String() string { if i < 0 || i >= TokenName(len(_TokenName_index)-1) { diff --git a/php5/php5.go b/php5/php5.go index ee86c94..c2d8692 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -5557,7 +5557,7 @@ yydefault: } // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NewAnchor).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5633,7 +5633,7 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.EqualToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.NewAnchor).AppendTo(_new.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.NodeStart).AppendTo(_new.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php5/php5.y b/php5/php5.y index eabdb90..b92ea68 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -3329,7 +3329,7 @@ new_expr: } // save comments - $1.Meta.SetTokenName(meta.NewAnchor).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3400,7 +3400,7 @@ expr_without_variable: // save comments $2.Meta.SetTokenName(meta.EqualToken).AppendTo($$.GetMeta()) $3.Meta.SetTokenName(meta.AmpersandToken).AppendTo($$.GetMeta()) - $4.Meta.SetTokenName(meta.NewAnchor).AppendTo(_new.GetMeta()) + $4.Meta.SetTokenName(meta.NodeStart).AppendTo(_new.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php7/php7.go b/php7/php7.go index 79b2775..aae19a2 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -5486,7 +5486,7 @@ yydefault: } // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NewAnchor).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5500,7 +5500,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NewAnchor).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php7/php7.y b/php7/php7.y index bcf4e18..83f6fc6 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -3064,7 +3064,7 @@ new_expr: } // save comments - $1.Meta.SetTokenName(meta.NewAnchor).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3076,7 +3076,7 @@ new_expr: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NewAnchor).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/printer/printer.go b/printer/printer.go index d61f86c..aebcecf 100644 --- a/printer/printer.go +++ b/printer/printer.go @@ -1432,7 +1432,6 @@ func (p *Printer) printExprNew(n node.Node) { nn := n.(*expr.New) p.printMeta(nn, meta.NodeStart) - p.printMeta(nn, meta.NewAnchor) io.WriteString(p.w, "new") p.Print(nn.Class) diff --git a/printer/printer_test.go b/printer/printer_test.go index 0bb0465..e755fec 100644 --- a/printer/printer_test.go +++ b/printer/printer_test.go @@ -3823,7 +3823,7 @@ func TestPrinterPrintNew(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.NewAnchor, + TokenName: meta.NodeStart, }, }, Class: &name.Name{ From 7995d41139f76b8459dd55a18670002b1a82445a Mon Sep 17 00:00:00 2001 From: z7zmey Date: Fri, 26 Oct 2018 12:11:37 +0300 Subject: [PATCH 053/117] replace meta.DecToken and meta.IncToken --- php5/php5.go | 4 ++-- php5/php5.y | 4 ++-- php7/php7.go | 4 ++-- php7/php7.y | 4 ++-- printer/printer.go | 2 -- printer/printer_test.go | 4 ++-- 6 files changed, 10 insertions(+), 12 deletions(-) diff --git a/php5/php5.go b/php5/php5.go index c2d8692..cb1d454 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -5843,7 +5843,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.IncToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5871,7 +5871,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.DecToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php5/php5.y b/php5/php5.y index b92ea68..7bbfead 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -3580,7 +3580,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.IncToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3604,7 +3604,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.DecToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php7/php7.go b/php7/php7.go index aae19a2..d6824cd 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -5776,7 +5776,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.IncToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5804,7 +5804,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.DecToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php7/php7.y b/php7/php7.y index 83f6fc6..40abcf3 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -3317,7 +3317,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.IncToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3341,7 +3341,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.DecToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/printer/printer.go b/printer/printer.go index aebcecf..594259b 100644 --- a/printer/printer.go +++ b/printer/printer.go @@ -1473,7 +1473,6 @@ func (p *Printer) printExprPreDec(n node.Node) { nn := n.(*expr.PreDec) p.printMeta(nn, meta.NodeStart) - p.printMeta(nn, meta.DecToken) io.WriteString(p.w, "--") p.Print(nn.Variable) @@ -1484,7 +1483,6 @@ func (p *Printer) printExprPreInc(n node.Node) { nn := n.(*expr.PreInc) p.printMeta(nn, meta.NodeStart) - p.printMeta(nn, meta.IncToken) io.WriteString(p.w, "++") p.Print(nn.Variable) diff --git a/printer/printer_test.go b/printer/printer_test.go index e755fec..8e469b7 100644 --- a/printer/printer_test.go +++ b/printer/printer_test.go @@ -3963,7 +3963,7 @@ func TestPrinterPrintPreDec(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.DecToken, + TokenName: meta.NodeStart, }, }, Variable: &expr.Variable{ @@ -3995,7 +3995,7 @@ func TestPrinterPrintPreInc(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.IncToken, + TokenName: meta.NodeStart, }, }, Variable: &expr.Variable{ From 41a9409cbe89a9adc6ce42c583765558d166fad1 Mon Sep 17 00:00:00 2001 From: z7zmey Date: Fri, 26 Oct 2018 12:31:30 +0300 Subject: [PATCH 054/117] remove meta.PrintToken --- meta/tokenName.go | 1 - meta/tokenName_string.go | 4 ++-- php5/php5.go | 2 +- php5/php5.y | 2 +- php7/php7.go | 2 +- php7/php7.y | 2 +- printer/printer.go | 1 - printer/printer_test.go | 2 +- 8 files changed, 7 insertions(+), 9 deletions(-) diff --git a/meta/tokenName.go b/meta/tokenName.go index f8434d6..3835d47 100644 --- a/meta/tokenName.go +++ b/meta/tokenName.go @@ -63,7 +63,6 @@ const ( ElseifToken ElseToken EndifToken - PrintToken YieldToken AbstractToken FinalToken diff --git a/meta/tokenName_string.go b/meta/tokenName_string.go index a8d8873..d15052e 100644 --- a/meta/tokenName_string.go +++ b/meta/tokenName_string.go @@ -4,9 +4,9 @@ package meta import "strconv" -const _TokenName_name = "NodeStartNodeEndIfTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenRequireTokenRequireOnceTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenElseifTokenElseTokenEndifTokenPrintTokenYieldTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenYieldFromTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenBackquoteTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" +const _TokenName_name = "NodeStartNodeEndIfTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenRequireTokenRequireOnceTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenElseifTokenElseTokenEndifTokenYieldTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenYieldFromTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenBackquoteTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" -var _TokenName_index = [...]uint16{0, 9, 16, 23, 41, 55, 70, 79, 86, 96, 109, 130, 151, 159, 170, 182, 197, 209, 224, 231, 242, 256, 265, 277, 287, 300, 309, 322, 332, 343, 351, 361, 373, 383, 397, 408, 416, 426, 436, 446, 460, 472, 487, 503, 516, 530, 554, 580, 596, 609, 621, 637, 651, 666, 681, 696, 707, 716, 726, 736, 746, 759, 769, 781, 795, 806, 814, 822, 836, 855, 868, 882, 896, 911, 924, 937, 950, 966, 979, 992, 1004, 1017, 1029, 1041, 1055, 1070, 1078, 1085, 1092, 1108, 1127, 1139, 1154, 1175, 1196, 1213, 1231, 1245, 1265, 1286, 1300, 1310, 1330, 1351, 1368, 1386, 1403, 1417, 1427, 1436, 1446, 1462, 1472, 1482, 1495, 1505, 1517, 1526, 1538, 1546} +var _TokenName_index = [...]uint16{0, 9, 16, 23, 41, 55, 70, 79, 86, 96, 109, 130, 151, 159, 170, 182, 197, 209, 224, 231, 242, 256, 265, 277, 287, 300, 309, 322, 332, 343, 351, 361, 373, 383, 397, 408, 416, 426, 436, 446, 460, 472, 487, 503, 516, 530, 554, 580, 596, 609, 621, 637, 651, 666, 681, 696, 707, 716, 726, 736, 749, 759, 771, 785, 796, 804, 812, 826, 845, 858, 872, 886, 901, 914, 927, 940, 956, 969, 982, 994, 1007, 1019, 1031, 1045, 1060, 1068, 1075, 1082, 1098, 1117, 1129, 1144, 1165, 1186, 1203, 1221, 1235, 1255, 1276, 1290, 1300, 1320, 1341, 1358, 1376, 1393, 1407, 1417, 1426, 1436, 1452, 1462, 1472, 1485, 1495, 1507, 1516, 1528, 1536} func (i TokenName) String() string { if i < 0 || i >= TokenName(len(_TokenName_index)-1) { diff --git a/php5/php5.go b/php5/php5.go index cb1d454..9b43b64 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -6581,7 +6581,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.PrintToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php5/php5.y b/php5/php5.y index 7bbfead..ed09b22 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -4214,7 +4214,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.PrintToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php7/php7.go b/php7/php7.go index d6824cd..4a2a5ad 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -6498,7 +6498,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.PrintToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php7/php7.y b/php7/php7.y index 40abcf3..0eabf04 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -3937,7 +3937,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.PrintToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/printer/printer.go b/printer/printer.go index 594259b..675f5a4 100644 --- a/printer/printer.go +++ b/printer/printer.go @@ -1493,7 +1493,6 @@ func (p *Printer) printExprPrint(n node.Node) { nn := n.(*expr.Print) p.printMeta(nn, meta.NodeStart) - p.printMeta(nn, meta.PrintToken) io.WriteString(p.w, "print") p.Print(nn.Expr) diff --git a/printer/printer_test.go b/printer/printer_test.go index 8e469b7..4dc582f 100644 --- a/printer/printer_test.go +++ b/printer/printer_test.go @@ -4027,7 +4027,7 @@ func TestPrinterPrintPrint(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.PrintToken, + TokenName: meta.NodeStart, }, }, Expr: &expr.Variable{ From 5c09a98413155dc5aceac079d65e5af22dfee02f Mon Sep 17 00:00:00 2001 From: z7zmey Date: Mon, 29 Oct 2018 12:28:18 +0200 Subject: [PATCH 055/117] replace meta.AmpersandToken --- php5/php5.go | 14 +++++++------- php5/php5.y | 14 +++++++------- php7/php7.go | 8 ++++---- php7/php7.y | 8 ++++---- printer/printer.go | 1 - printer/printer_test.go | 2 +- 6 files changed, 23 insertions(+), 24 deletions(-) diff --git a/php5/php5.go b/php5/php5.go index 9b43b64..6eb9a2c 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -3958,7 +3958,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6866,7 +6866,7 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(reference.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(reference.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) @@ -6905,7 +6905,7 @@ yydefault: reference.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(reference.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(reference.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) @@ -9072,7 +9072,7 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo(arrayItem.GetMeta()) - yyDollar[5].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(reference.GetMeta()) + yyDollar[5].token.Meta.SetTokenName(meta.NodeStart).AppendTo(reference.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -9090,7 +9090,7 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(reference.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(reference.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -9108,7 +9108,7 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo(arrayItem.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(reference.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(reference.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -9125,7 +9125,7 @@ yydefault: arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(reference.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(reference.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php5/php5.y b/php5/php5.y index ed09b22..4b9c61e 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -1794,7 +1794,7 @@ foreach_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.AmpersandToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4481,7 +4481,7 @@ lexical_var_list: // save comments $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) - $3.Meta.SetTokenName(meta.AmpersandToken).AppendTo(reference.GetMeta()) + $3.Meta.SetTokenName(meta.NodeStart).AppendTo(reference.GetMeta()) $4.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) @@ -4516,7 +4516,7 @@ lexical_var_list: reference.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.AmpersandToken).AppendTo(reference.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo(reference.GetMeta()) $2.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) @@ -6507,7 +6507,7 @@ non_empty_array_pair_list: // save comments $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) $4.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo(arrayItem.GetMeta()) - $5.Meta.SetTokenName(meta.AmpersandToken).AppendTo(reference.GetMeta()) + $5.Meta.SetTokenName(meta.NodeStart).AppendTo(reference.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6523,7 +6523,7 @@ non_empty_array_pair_list: // save comments $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) - $3.Meta.SetTokenName(meta.AmpersandToken).AppendTo(reference.GetMeta()) + $3.Meta.SetTokenName(meta.NodeStart).AppendTo(reference.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6539,7 +6539,7 @@ non_empty_array_pair_list: // save comments $2.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo(arrayItem.GetMeta()) - $3.Meta.SetTokenName(meta.AmpersandToken).AppendTo(reference.GetMeta()) + $3.Meta.SetTokenName(meta.NodeStart).AppendTo(reference.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6554,7 +6554,7 @@ non_empty_array_pair_list: arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.AmpersandToken).AppendTo(reference.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo(reference.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php7/php7.go b/php7/php7.go index 4a2a5ad..8bdb376 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -4024,7 +4024,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6697,7 +6697,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) @@ -7695,7 +7695,7 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(reference.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(reference.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7711,7 +7711,7 @@ yydefault: reference.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(reference.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(reference.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php7/php7.y b/php7/php7.y index 0eabf04..fe1717c 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -1666,7 +1666,7 @@ foreach_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.AmpersandToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4121,7 +4121,7 @@ lexical_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.AmpersandToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $2.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) @@ -5030,7 +5030,7 @@ array_pair: // save comments $2.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.AmpersandToken).AppendTo(reference.GetMeta()) + $3.Meta.SetTokenName(meta.NodeStart).AppendTo(reference.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5044,7 +5044,7 @@ array_pair: reference.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.AmpersandToken).AppendTo(reference.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo(reference.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/printer/printer.go b/printer/printer.go index 675f5a4..5b4cbfc 100644 --- a/printer/printer.go +++ b/printer/printer.go @@ -1515,7 +1515,6 @@ func (p *Printer) printExprReference(n node.Node) { nn := n.(*expr.Reference) p.printMeta(nn, meta.NodeStart) - p.printMeta(nn, meta.AmpersandToken) io.WriteString(p.w, "&") p.Print(nn.Variable) diff --git a/printer/printer_test.go b/printer/printer_test.go index 4dc582f..b9ecef5 100644 --- a/printer/printer_test.go +++ b/printer/printer_test.go @@ -4097,7 +4097,7 @@ func TestPrinterPrintExprReference(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.AmpersandToken, + TokenName: meta.NodeStart, }, }, Variable: &expr.Variable{ From e036135fab980f2e1673d3cd97940635d0106f9b Mon Sep 17 00:00:00 2001 From: z7zmey Date: Mon, 29 Oct 2018 12:30:32 +0200 Subject: [PATCH 056/117] remove meta.RequireToken and meta.RequireOnceToken --- meta/tokenName.go | 2 -- meta/tokenName_string.go | 4 ++-- php5/php5.go | 4 ++-- php5/php5.y | 4 ++-- php7/php7.go | 4 ++-- php7/php7.y | 4 ++-- printer/printer.go | 2 -- printer/printer_test.go | 4 ++-- 8 files changed, 12 insertions(+), 16 deletions(-) diff --git a/meta/tokenName.go b/meta/tokenName.go index 3835d47..e0dc56f 100644 --- a/meta/tokenName.go +++ b/meta/tokenName.go @@ -54,8 +54,6 @@ const ( UseLeadingNsSeparatorToken NsSeparatorToken EllipsisToken - RequireToken - RequireOnceToken LogicalOrToken LogicalXorToken LogicalAndToken diff --git a/meta/tokenName_string.go b/meta/tokenName_string.go index d15052e..2783c1a 100644 --- a/meta/tokenName_string.go +++ b/meta/tokenName_string.go @@ -4,9 +4,9 @@ package meta import "strconv" -const _TokenName_name = "NodeStartNodeEndIfTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenRequireTokenRequireOnceTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenElseifTokenElseTokenEndifTokenYieldTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenYieldFromTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenBackquoteTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" +const _TokenName_name = "NodeStartNodeEndIfTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenElseifTokenElseTokenEndifTokenYieldTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenYieldFromTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenBackquoteTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" -var _TokenName_index = [...]uint16{0, 9, 16, 23, 41, 55, 70, 79, 86, 96, 109, 130, 151, 159, 170, 182, 197, 209, 224, 231, 242, 256, 265, 277, 287, 300, 309, 322, 332, 343, 351, 361, 373, 383, 397, 408, 416, 426, 436, 446, 460, 472, 487, 503, 516, 530, 554, 580, 596, 609, 621, 637, 651, 666, 681, 696, 707, 716, 726, 736, 749, 759, 771, 785, 796, 804, 812, 826, 845, 858, 872, 886, 901, 914, 927, 940, 956, 969, 982, 994, 1007, 1019, 1031, 1045, 1060, 1068, 1075, 1082, 1098, 1117, 1129, 1144, 1165, 1186, 1203, 1221, 1235, 1255, 1276, 1290, 1300, 1320, 1341, 1358, 1376, 1393, 1407, 1417, 1426, 1436, 1452, 1462, 1472, 1485, 1495, 1507, 1516, 1528, 1536} +var _TokenName_index = [...]uint16{0, 9, 16, 23, 41, 55, 70, 79, 86, 96, 109, 130, 151, 159, 170, 182, 197, 209, 224, 231, 242, 256, 265, 277, 287, 300, 309, 322, 332, 343, 351, 361, 373, 383, 397, 408, 416, 426, 436, 446, 460, 472, 487, 503, 516, 530, 554, 580, 596, 609, 623, 638, 653, 668, 679, 688, 698, 708, 721, 731, 743, 757, 768, 776, 784, 798, 817, 830, 844, 858, 873, 886, 899, 912, 928, 941, 954, 966, 979, 991, 1003, 1017, 1032, 1040, 1047, 1054, 1070, 1089, 1101, 1116, 1137, 1158, 1175, 1193, 1207, 1227, 1248, 1262, 1272, 1292, 1313, 1330, 1348, 1365, 1379, 1389, 1398, 1408, 1424, 1434, 1444, 1457, 1467, 1479, 1488, 1500, 1508} func (i TokenName) String() string { if i < 0 || i >= TokenName(len(_TokenName_index)-1) { diff --git a/php5/php5.go b/php5/php5.go index 6eb9a2c..3792eb8 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -9471,7 +9471,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.RequireToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -9485,7 +9485,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.RequireOnceToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php5/php5.y b/php5/php5.y index 4b9c61e..f8cd314 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -6870,7 +6870,7 @@ internal_functions_in_yacc: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.RequireToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6882,7 +6882,7 @@ internal_functions_in_yacc: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.RequireOnceToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php7/php7.go b/php7/php7.go index 8bdb376..f37095c 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -8117,7 +8117,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.RequireToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -8131,7 +8131,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.RequireOnceToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php7/php7.y b/php7/php7.y index fe1717c..80ef257 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -5416,7 +5416,7 @@ internal_functions_in_yacc: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.RequireToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5428,7 +5428,7 @@ internal_functions_in_yacc: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.RequireOnceToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/printer/printer.go b/printer/printer.go index 5b4cbfc..2fde06b 100644 --- a/printer/printer.go +++ b/printer/printer.go @@ -1525,7 +1525,6 @@ func (p *Printer) printExprRequire(n node.Node) { nn := n.(*expr.Require) p.printMeta(nn, meta.NodeStart) - p.printMeta(nn, meta.RequireToken) io.WriteString(p.w, "require") p.Print(nn.Expr) @@ -1536,7 +1535,6 @@ func (p *Printer) printExprRequireOnce(n node.Node) { nn := n.(*expr.RequireOnce) p.printMeta(nn, meta.NodeStart) - p.printMeta(nn, meta.RequireOnceToken) io.WriteString(p.w, "require_once") p.Print(nn.Expr) diff --git a/printer/printer_test.go b/printer/printer_test.go index b9ecef5..8365e56 100644 --- a/printer/printer_test.go +++ b/printer/printer_test.go @@ -4129,7 +4129,7 @@ func TestPrinterPrintRequire(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.RequireToken, + TokenName: meta.NodeStart, }, }, Expr: &scalar.String{Value: "'path'"}, @@ -4152,7 +4152,7 @@ func TestPrinterPrintRequireOnce(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.RequireOnceToken, + TokenName: meta.NodeStart, }, }, Expr: &scalar.String{Value: "'path'"}, From 6dde9ef0525e5ea9dd882ac85eb36915c5ff5bf7 Mon Sep 17 00:00:00 2001 From: z7zmey Date: Mon, 29 Oct 2018 12:32:54 +0200 Subject: [PATCH 057/117] remove meta.BackquoteToken --- meta/tokenName.go | 1 - meta/tokenName_string.go | 4 +- php5/php5.go | 443 +++++++++++++++++++-------------------- php5/php5.y | 3 +- php7/php7.go | 257 +++++++++++------------ php7/php7.y | 3 +- printer/printer.go | 1 - printer/printer_test.go | 2 +- 8 files changed, 354 insertions(+), 360 deletions(-) diff --git a/meta/tokenName.go b/meta/tokenName.go index e0dc56f..25f74c4 100644 --- a/meta/tokenName.go +++ b/meta/tokenName.go @@ -98,7 +98,6 @@ const ( IsGreaterOrEqualToken HaltCompilerToken CaseSeparatorToken // ';' or ':' - BackquoteToken // '`' OpenCurlyBracesToken // '{' CloseCurlyBracesToken // '}' SemiColonToken // ';' diff --git a/meta/tokenName_string.go b/meta/tokenName_string.go index 2783c1a..9345fe9 100644 --- a/meta/tokenName_string.go +++ b/meta/tokenName_string.go @@ -4,9 +4,9 @@ package meta import "strconv" -const _TokenName_name = "NodeStartNodeEndIfTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenElseifTokenElseTokenEndifTokenYieldTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenYieldFromTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenBackquoteTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" +const _TokenName_name = "NodeStartNodeEndIfTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenElseifTokenElseTokenEndifTokenYieldTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenYieldFromTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" -var _TokenName_index = [...]uint16{0, 9, 16, 23, 41, 55, 70, 79, 86, 96, 109, 130, 151, 159, 170, 182, 197, 209, 224, 231, 242, 256, 265, 277, 287, 300, 309, 322, 332, 343, 351, 361, 373, 383, 397, 408, 416, 426, 436, 446, 460, 472, 487, 503, 516, 530, 554, 580, 596, 609, 623, 638, 653, 668, 679, 688, 698, 708, 721, 731, 743, 757, 768, 776, 784, 798, 817, 830, 844, 858, 873, 886, 899, 912, 928, 941, 954, 966, 979, 991, 1003, 1017, 1032, 1040, 1047, 1054, 1070, 1089, 1101, 1116, 1137, 1158, 1175, 1193, 1207, 1227, 1248, 1262, 1272, 1292, 1313, 1330, 1348, 1365, 1379, 1389, 1398, 1408, 1424, 1434, 1444, 1457, 1467, 1479, 1488, 1500, 1508} +var _TokenName_index = [...]uint16{0, 9, 16, 23, 41, 55, 70, 79, 86, 96, 109, 130, 151, 159, 170, 182, 197, 209, 224, 231, 242, 256, 265, 277, 287, 300, 309, 322, 332, 343, 351, 361, 373, 383, 397, 408, 416, 426, 436, 446, 460, 472, 487, 503, 516, 530, 554, 580, 596, 609, 623, 638, 653, 668, 679, 688, 698, 708, 721, 731, 743, 757, 768, 776, 784, 798, 817, 830, 844, 858, 873, 886, 899, 912, 928, 941, 954, 966, 979, 991, 1003, 1017, 1032, 1040, 1047, 1054, 1070, 1089, 1101, 1116, 1137, 1158, 1175, 1193, 1213, 1234, 1248, 1258, 1278, 1299, 1316, 1334, 1351, 1365, 1375, 1384, 1394, 1410, 1420, 1430, 1443, 1453, 1465, 1474, 1486, 1494} func (i TokenName) String() string { if i < 0 || i >= TokenName(len(_TokenName_index)-1) { diff --git a/php5/php5.go b/php5/php5.go index 3792eb8..ff5bb54 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -348,7 +348,7 @@ const yyEofCode = 1 const yyErrCode = 2 const yyInitialStackSize = 16 -//line php5/php5.y:6993 +//line php5/php5.y:6992 type simpleIndirectReference struct { all []*expr.Variable last *expr.Variable @@ -6566,14 +6566,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.BackquoteToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.BackquoteToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 302: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4210 + //line php5/php5.y:4209 { yyVAL.node = expr.NewPrint(yyDollar[2].node) @@ -6587,7 +6586,7 @@ yydefault: } case 303: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4222 + //line php5/php5.y:4221 { yyVAL.node = expr.NewYield(nil, nil) @@ -6601,7 +6600,7 @@ yydefault: } case 304: yyDollar = yyS[yypt-9 : yypt+1] - //line php5/php5.y:4234 + //line php5/php5.y:4233 { yyVAL.node = expr.NewClosure(yyDollar[4].list, yyDollar[6].ClosureUse, nil, yyDollar[8].list, false, yyDollar[2].token != nil, "") @@ -6622,7 +6621,7 @@ yydefault: } case 305: yyDollar = yyS[yypt-10 : yypt+1] - //line php5/php5.y:4253 + //line php5/php5.y:4252 { yyVAL.node = expr.NewClosure(yyDollar[5].list, yyDollar[7].ClosureUse, nil, yyDollar[9].list, true, yyDollar[3].token != nil, "") @@ -6644,7 +6643,7 @@ yydefault: } case 306: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4276 + //line php5/php5.y:4275 { yyVAL.node = expr.NewYield(nil, yyDollar[2].node) @@ -6658,7 +6657,7 @@ yydefault: } case 307: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4288 + //line php5/php5.y:4287 { yyVAL.node = expr.NewYield(nil, yyDollar[2].node) @@ -6672,7 +6671,7 @@ yydefault: } case 308: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4300 + //line php5/php5.y:4299 { yyVAL.node = expr.NewYield(yyDollar[2].node, yyDollar[4].node) @@ -6687,7 +6686,7 @@ yydefault: } case 309: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4313 + //line php5/php5.y:4312 { yyVAL.node = expr.NewYield(yyDollar[2].node, yyDollar[4].node) @@ -6702,7 +6701,7 @@ yydefault: } case 310: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4329 + //line php5/php5.y:4328 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -6719,7 +6718,7 @@ yydefault: } case 311: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4344 + //line php5/php5.y:4343 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -6736,7 +6735,7 @@ yydefault: } case 312: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4359 + //line php5/php5.y:4358 { str := scalar.NewString(yyDollar[1].token.Value) yyVAL.node = expr.NewArrayDimFetch(str, yyDollar[3].node) @@ -6755,7 +6754,7 @@ yydefault: } case 313: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4376 + //line php5/php5.y:4375 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -6772,7 +6771,7 @@ yydefault: } case 314: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4394 + //line php5/php5.y:4393 { yyVAL.node = expr.NewArray(yyDollar[3].list) @@ -6788,7 +6787,7 @@ yydefault: } case 315: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4408 + //line php5/php5.y:4407 { yyVAL.node = expr.NewShortArray(yyDollar[2].list) @@ -6803,13 +6802,13 @@ yydefault: } case 316: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4424 + //line php5/php5.y:4423 { yyVAL.token = yyDollar[1].token } case 317: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:4431 + //line php5/php5.y:4430 { yyVAL.ClosureUse = nil @@ -6817,7 +6816,7 @@ yydefault: } case 318: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4437 + //line php5/php5.y:4436 { yyVAL.ClosureUse = expr.NewClosureUse(yyDollar[3].list) @@ -6833,7 +6832,7 @@ yydefault: } case 319: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4454 + //line php5/php5.y:4453 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[3].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -6852,7 +6851,7 @@ yydefault: } case 320: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4471 + //line php5/php5.y:4470 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[4].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -6874,7 +6873,7 @@ yydefault: } case 321: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4491 + //line php5/php5.y:4490 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -6892,7 +6891,7 @@ yydefault: } case 322: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4507 + //line php5/php5.y:4506 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[2].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -6913,7 +6912,7 @@ yydefault: } case 323: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4529 + //line php5/php5.y:4528 { name := name.NewName(yyDollar[1].list) yyVAL.node = expr.NewFunctionCall(name, yyDollar[2].node.(*node.ArgumentList)) @@ -6926,7 +6925,7 @@ yydefault: } case 324: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4540 + //line php5/php5.y:4539 { funcName := name.NewRelative(yyDollar[3].list) yyVAL.node = expr.NewFunctionCall(funcName, yyDollar[4].node.(*node.ArgumentList)) @@ -6943,7 +6942,7 @@ yydefault: } case 325: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4555 + //line php5/php5.y:4554 { funcName := name.NewFullyQualified(yyDollar[2].list) yyVAL.node = expr.NewFunctionCall(funcName, yyDollar[3].node.(*node.ArgumentList)) @@ -6959,7 +6958,7 @@ yydefault: } case 326: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4569 + //line php5/php5.y:4568 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -6973,7 +6972,7 @@ yydefault: } case 327: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4581 + //line php5/php5.y:4580 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -6987,7 +6986,7 @@ yydefault: } case 328: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4593 + //line php5/php5.y:4592 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -7001,7 +7000,7 @@ yydefault: } case 329: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4605 + //line php5/php5.y:4604 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -7015,7 +7014,7 @@ yydefault: } case 330: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4617 + //line php5/php5.y:4616 { yyVAL.node = expr.NewFunctionCall(yyDollar[1].node, yyDollar[2].node.(*node.ArgumentList)) @@ -7026,7 +7025,7 @@ yydefault: } case 331: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4629 + //line php5/php5.y:4628 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -7040,7 +7039,7 @@ yydefault: } case 332: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4641 + //line php5/php5.y:4640 { yyVAL.node = name.NewName(yyDollar[1].list) @@ -7051,7 +7050,7 @@ yydefault: } case 333: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4650 + //line php5/php5.y:4649 { yyVAL.node = name.NewRelative(yyDollar[3].list) @@ -7066,7 +7065,7 @@ yydefault: } case 334: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4663 + //line php5/php5.y:4662 { yyVAL.node = name.NewFullyQualified(yyDollar[2].list) @@ -7080,7 +7079,7 @@ yydefault: } case 335: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4678 + //line php5/php5.y:4677 { yyVAL.node = name.NewName(yyDollar[1].list) @@ -7091,7 +7090,7 @@ yydefault: } case 336: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4687 + //line php5/php5.y:4686 { yyVAL.node = name.NewRelative(yyDollar[3].list) @@ -7106,7 +7105,7 @@ yydefault: } case 337: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4700 + //line php5/php5.y:4699 { yyVAL.node = name.NewFullyQualified(yyDollar[2].list) @@ -7120,7 +7119,7 @@ yydefault: } case 338: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4715 + //line php5/php5.y:4714 { yyVAL.node = yyDollar[1].node @@ -7128,7 +7127,7 @@ yydefault: } case 339: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4721 + //line php5/php5.y:4720 { yyVAL.node = yyDollar[1].node @@ -7136,7 +7135,7 @@ yydefault: } case 340: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4730 + //line php5/php5.y:4729 { yyVAL.node = yyDollar[1].node @@ -7175,7 +7174,7 @@ yydefault: } case 341: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4767 + //line php5/php5.y:4766 { yyVAL.node = yyDollar[1].node @@ -7183,7 +7182,7 @@ yydefault: } case 342: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4777 + //line php5/php5.y:4776 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) @@ -7191,7 +7190,7 @@ yydefault: } case 343: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:4783 + //line php5/php5.y:4782 { yyVAL.list = []node.Node{} @@ -7199,7 +7198,7 @@ yydefault: } case 344: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4793 + //line php5/php5.y:4792 { yyVAL.list = yyDollar[2].list @@ -7210,7 +7209,7 @@ yydefault: } case 345: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:4805 + //line php5/php5.y:4804 { yyVAL.node = nil @@ -7218,7 +7217,7 @@ yydefault: } case 346: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4811 + //line php5/php5.y:4810 { yyVAL.node = expr.NewExit(nil) @@ -7235,7 +7234,7 @@ yydefault: } case 347: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4826 + //line php5/php5.y:4825 { yyVAL.node = expr.NewExit(yyDollar[1].node) @@ -7254,7 +7253,7 @@ yydefault: } case 348: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:4846 + //line php5/php5.y:4845 { yyVAL.list = []node.Node{} @@ -7262,7 +7261,7 @@ yydefault: } case 349: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4852 + //line php5/php5.y:4851 { yyVAL.list = []node.Node{scalar.NewEncapsedStringPart(yyDollar[1].token.Value)} @@ -7270,7 +7269,7 @@ yydefault: } case 350: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4858 + //line php5/php5.y:4857 { yyVAL.list = yyDollar[1].list @@ -7278,7 +7277,7 @@ yydefault: } case 351: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:4867 + //line php5/php5.y:4866 { yyVAL.node = nil @@ -7286,7 +7285,7 @@ yydefault: } case 352: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4873 + //line php5/php5.y:4872 { yyVAL.node = yyDollar[1].node @@ -7294,7 +7293,7 @@ yydefault: } case 353: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4882 + //line php5/php5.y:4881 { yyVAL.node = scalar.NewLnumber(yyDollar[1].token.Value) @@ -7308,7 +7307,7 @@ yydefault: } case 354: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4894 + //line php5/php5.y:4893 { yyVAL.node = scalar.NewDnumber(yyDollar[1].token.Value) @@ -7322,7 +7321,7 @@ yydefault: } case 355: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4906 + //line php5/php5.y:4905 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) @@ -7336,7 +7335,7 @@ yydefault: } case 356: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4918 + //line php5/php5.y:4917 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7350,7 +7349,7 @@ yydefault: } case 357: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4930 + //line php5/php5.y:4929 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7364,7 +7363,7 @@ yydefault: } case 358: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4942 + //line php5/php5.y:4941 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7378,7 +7377,7 @@ yydefault: } case 359: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4954 + //line php5/php5.y:4953 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7392,7 +7391,7 @@ yydefault: } case 360: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4966 + //line php5/php5.y:4965 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7406,7 +7405,7 @@ yydefault: } case 361: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4978 + //line php5/php5.y:4977 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7420,7 +7419,7 @@ yydefault: } case 362: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4990 + //line php5/php5.y:4989 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7434,7 +7433,7 @@ yydefault: } case 363: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5002 + //line php5/php5.y:5001 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, []node.Node{encapsed}) @@ -7450,7 +7449,7 @@ yydefault: } case 364: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5016 + //line php5/php5.y:5015 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, nil) @@ -7464,7 +7463,7 @@ yydefault: } case 365: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5031 + //line php5/php5.y:5030 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -7481,7 +7480,7 @@ yydefault: } case 366: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5049 + //line php5/php5.y:5048 { yyVAL.node = yyDollar[1].node @@ -7489,7 +7488,7 @@ yydefault: } case 367: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5058 + //line php5/php5.y:5057 { yyVAL.node = yyDollar[1].node @@ -7497,7 +7496,7 @@ yydefault: } case 368: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5064 + //line php5/php5.y:5063 { yyVAL.node = yyDollar[1].node @@ -7505,7 +7504,7 @@ yydefault: } case 369: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5070 + //line php5/php5.y:5069 { name := name.NewName(yyDollar[1].list) yyVAL.node = expr.NewConstFetch(name) @@ -7518,7 +7517,7 @@ yydefault: } case 370: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5081 + //line php5/php5.y:5080 { name := name.NewRelative(yyDollar[3].list) yyVAL.node = expr.NewConstFetch(name) @@ -7535,7 +7534,7 @@ yydefault: } case 371: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5096 + //line php5/php5.y:5095 { name := name.NewFullyQualified(yyDollar[2].list) yyVAL.node = expr.NewConstFetch(name) @@ -7551,7 +7550,7 @@ yydefault: } case 372: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:5110 + //line php5/php5.y:5109 { yyVAL.node = expr.NewArray(yyDollar[3].list) @@ -7567,7 +7566,7 @@ yydefault: } case 373: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5124 + //line php5/php5.y:5123 { yyVAL.node = expr.NewShortArray(yyDollar[2].list) @@ -7582,7 +7581,7 @@ yydefault: } case 374: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5137 + //line php5/php5.y:5136 { yyVAL.node = yyDollar[1].node @@ -7590,7 +7589,7 @@ yydefault: } case 375: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5143 + //line php5/php5.y:5142 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7604,7 +7603,7 @@ yydefault: } case 376: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5155 + //line php5/php5.y:5154 { yyVAL.node = yyDollar[1].node @@ -7612,7 +7611,7 @@ yydefault: } case 377: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:5164 + //line php5/php5.y:5163 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -7629,7 +7628,7 @@ yydefault: } case 378: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5179 + //line php5/php5.y:5178 { yyVAL.node = binary.NewPlus(yyDollar[1].node, yyDollar[3].node) @@ -7643,7 +7642,7 @@ yydefault: } case 379: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5191 + //line php5/php5.y:5190 { yyVAL.node = binary.NewMinus(yyDollar[1].node, yyDollar[3].node) @@ -7657,7 +7656,7 @@ yydefault: } case 380: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5203 + //line php5/php5.y:5202 { yyVAL.node = binary.NewMul(yyDollar[1].node, yyDollar[3].node) @@ -7671,7 +7670,7 @@ yydefault: } case 381: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5215 + //line php5/php5.y:5214 { yyVAL.node = binary.NewPow(yyDollar[1].node, yyDollar[3].node) @@ -7685,7 +7684,7 @@ yydefault: } case 382: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5227 + //line php5/php5.y:5226 { yyVAL.node = binary.NewDiv(yyDollar[1].node, yyDollar[3].node) @@ -7699,7 +7698,7 @@ yydefault: } case 383: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5239 + //line php5/php5.y:5238 { yyVAL.node = binary.NewMod(yyDollar[1].node, yyDollar[3].node) @@ -7713,7 +7712,7 @@ yydefault: } case 384: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5251 + //line php5/php5.y:5250 { yyVAL.node = expr.NewBooleanNot(yyDollar[2].node) @@ -7727,7 +7726,7 @@ yydefault: } case 385: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5263 + //line php5/php5.y:5262 { yyVAL.node = expr.NewBitwiseNot(yyDollar[2].node) @@ -7741,7 +7740,7 @@ yydefault: } case 386: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5275 + //line php5/php5.y:5274 { yyVAL.node = binary.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) @@ -7755,7 +7754,7 @@ yydefault: } case 387: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5287 + //line php5/php5.y:5286 { yyVAL.node = binary.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) @@ -7769,7 +7768,7 @@ yydefault: } case 388: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5299 + //line php5/php5.y:5298 { yyVAL.node = binary.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) @@ -7783,7 +7782,7 @@ yydefault: } case 389: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5311 + //line php5/php5.y:5310 { yyVAL.node = binary.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) @@ -7797,7 +7796,7 @@ yydefault: } case 390: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5323 + //line php5/php5.y:5322 { yyVAL.node = binary.NewShiftRight(yyDollar[1].node, yyDollar[3].node) @@ -7811,7 +7810,7 @@ yydefault: } case 391: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5335 + //line php5/php5.y:5334 { yyVAL.node = binary.NewConcat(yyDollar[1].node, yyDollar[3].node) @@ -7825,7 +7824,7 @@ yydefault: } case 392: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5347 + //line php5/php5.y:5346 { yyVAL.node = binary.NewLogicalXor(yyDollar[1].node, yyDollar[3].node) @@ -7839,7 +7838,7 @@ yydefault: } case 393: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5359 + //line php5/php5.y:5358 { yyVAL.node = binary.NewLogicalAnd(yyDollar[1].node, yyDollar[3].node) @@ -7853,7 +7852,7 @@ yydefault: } case 394: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5371 + //line php5/php5.y:5370 { yyVAL.node = binary.NewLogicalOr(yyDollar[1].node, yyDollar[3].node) @@ -7867,7 +7866,7 @@ yydefault: } case 395: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5383 + //line php5/php5.y:5382 { yyVAL.node = binary.NewBooleanAnd(yyDollar[1].node, yyDollar[3].node) @@ -7881,7 +7880,7 @@ yydefault: } case 396: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5395 + //line php5/php5.y:5394 { yyVAL.node = binary.NewBooleanOr(yyDollar[1].node, yyDollar[3].node) @@ -7895,7 +7894,7 @@ yydefault: } case 397: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5407 + //line php5/php5.y:5406 { yyVAL.node = binary.NewIdentical(yyDollar[1].node, yyDollar[3].node) @@ -7909,7 +7908,7 @@ yydefault: } case 398: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5419 + //line php5/php5.y:5418 { yyVAL.node = binary.NewNotIdentical(yyDollar[1].node, yyDollar[3].node) @@ -7923,7 +7922,7 @@ yydefault: } case 399: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5431 + //line php5/php5.y:5430 { yyVAL.node = binary.NewEqual(yyDollar[1].node, yyDollar[3].node) @@ -7937,7 +7936,7 @@ yydefault: } case 400: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5443 + //line php5/php5.y:5442 { yyVAL.node = binary.NewNotEqual(yyDollar[1].node, yyDollar[3].node) @@ -7952,7 +7951,7 @@ yydefault: } case 401: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5456 + //line php5/php5.y:5455 { yyVAL.node = binary.NewSmaller(yyDollar[1].node, yyDollar[3].node) @@ -7966,7 +7965,7 @@ yydefault: } case 402: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5468 + //line php5/php5.y:5467 { yyVAL.node = binary.NewGreater(yyDollar[1].node, yyDollar[3].node) @@ -7980,7 +7979,7 @@ yydefault: } case 403: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5480 + //line php5/php5.y:5479 { yyVAL.node = binary.NewSmallerOrEqual(yyDollar[1].node, yyDollar[3].node) @@ -7994,7 +7993,7 @@ yydefault: } case 404: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5492 + //line php5/php5.y:5491 { yyVAL.node = binary.NewGreaterOrEqual(yyDollar[1].node, yyDollar[3].node) @@ -8008,7 +8007,7 @@ yydefault: } case 405: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:5504 + //line php5/php5.y:5503 { yyVAL.node = expr.NewTernary(yyDollar[1].node, nil, yyDollar[4].node) @@ -8023,7 +8022,7 @@ yydefault: } case 406: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:5517 + //line php5/php5.y:5516 { yyVAL.node = expr.NewTernary(yyDollar[1].node, yyDollar[3].node, yyDollar[5].node) @@ -8038,7 +8037,7 @@ yydefault: } case 407: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5530 + //line php5/php5.y:5529 { yyVAL.node = expr.NewUnaryPlus(yyDollar[2].node) @@ -8052,7 +8051,7 @@ yydefault: } case 408: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5542 + //line php5/php5.y:5541 { yyVAL.node = expr.NewUnaryMinus(yyDollar[2].node) @@ -8066,7 +8065,7 @@ yydefault: } case 409: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5554 + //line php5/php5.y:5553 { yyVAL.node = yyDollar[2].node @@ -8078,7 +8077,7 @@ yydefault: } case 410: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5567 + //line php5/php5.y:5566 { yyVAL.node = yyDollar[1].node @@ -8086,7 +8085,7 @@ yydefault: } case 411: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5573 + //line php5/php5.y:5572 { name := name.NewName(yyDollar[1].list) yyVAL.node = expr.NewConstFetch(name) @@ -8099,7 +8098,7 @@ yydefault: } case 412: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5584 + //line php5/php5.y:5583 { name := name.NewRelative(yyDollar[3].list) yyVAL.node = expr.NewConstFetch(name) @@ -8114,7 +8113,7 @@ yydefault: } case 413: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5597 + //line php5/php5.y:5596 { name := name.NewFullyQualified(yyDollar[2].list) yyVAL.node = expr.NewConstFetch(name) @@ -8130,7 +8129,7 @@ yydefault: } case 414: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5614 + //line php5/php5.y:5613 { name := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = expr.NewVariable(name) @@ -8147,7 +8146,7 @@ yydefault: } case 415: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5629 + //line php5/php5.y:5628 { yyVAL.node = yyDollar[1].node @@ -8155,7 +8154,7 @@ yydefault: } case 416: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5635 + //line php5/php5.y:5634 { yyVAL.node = yyDollar[1].node @@ -8163,7 +8162,7 @@ yydefault: } case 417: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5641 + //line php5/php5.y:5640 { yyVAL.node = yyDollar[1].node @@ -8171,7 +8170,7 @@ yydefault: } case 418: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5647 + //line php5/php5.y:5646 { yyVAL.node = scalar.NewEncapsed(yyDollar[2].list) @@ -8185,7 +8184,7 @@ yydefault: } case 419: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5659 + //line php5/php5.y:5658 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, yyDollar[2].list) @@ -8199,7 +8198,7 @@ yydefault: } case 420: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5671 + //line php5/php5.y:5670 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -8213,7 +8212,7 @@ yydefault: } case 421: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:5686 + //line php5/php5.y:5685 { yyVAL.list = nil @@ -8221,7 +8220,7 @@ yydefault: } case 422: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5692 + //line php5/php5.y:5691 { yyVAL.list = yyDollar[1].list @@ -8234,19 +8233,19 @@ yydefault: } case 423: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:5706 + //line php5/php5.y:5705 { yyVAL.token = nil } case 424: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5710 + //line php5/php5.y:5709 { yyVAL.token = yyDollar[1].token } case 425: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:5717 + //line php5/php5.y:5716 { arrayItem := expr.NewArrayItem(yyDollar[3].node, yyDollar[5].node) yyVAL.list = append(yyDollar[1].list, arrayItem) @@ -8262,7 +8261,7 @@ yydefault: } case 426: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5731 + //line php5/php5.y:5730 { arrayItem := expr.NewArrayItem(nil, yyDollar[3].node) yyVAL.list = append(yyDollar[1].list, arrayItem) @@ -8277,7 +8276,7 @@ yydefault: } case 427: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5744 + //line php5/php5.y:5743 { arrayItem := expr.NewArrayItem(yyDollar[1].node, yyDollar[3].node) yyVAL.list = []node.Node{arrayItem} @@ -8292,7 +8291,7 @@ yydefault: } case 428: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5757 + //line php5/php5.y:5756 { arrayItem := expr.NewArrayItem(nil, yyDollar[1].node) yyVAL.list = []node.Node{arrayItem} @@ -8304,7 +8303,7 @@ yydefault: } case 429: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5770 + //line php5/php5.y:5769 { yyVAL.node = yyDollar[1].node @@ -8312,7 +8311,7 @@ yydefault: } case 430: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5776 + //line php5/php5.y:5775 { yyVAL.node = yyDollar[1].node @@ -8320,7 +8319,7 @@ yydefault: } case 431: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5785 + //line php5/php5.y:5784 { yyVAL.node = yyDollar[2].node @@ -8334,7 +8333,7 @@ yydefault: } case 432: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5797 + //line php5/php5.y:5796 { yyVAL.node = yyDollar[2].node @@ -8348,7 +8347,7 @@ yydefault: } case 433: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5813 + //line php5/php5.y:5812 { yyVAL.node = yyDollar[1].node @@ -8356,7 +8355,7 @@ yydefault: } case 434: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5823 + //line php5/php5.y:5822 { yyVAL.node = yyDollar[1].node @@ -8364,7 +8363,7 @@ yydefault: } case 435: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5832 + //line php5/php5.y:5831 { yyVAL.node = yyDollar[1].node @@ -8372,7 +8371,7 @@ yydefault: } case 436: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:5841 + //line php5/php5.y:5840 { yyVAL.node = yyDollar[1].node @@ -8426,7 +8425,7 @@ yydefault: } case 437: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5893 + //line php5/php5.y:5892 { yyVAL.node = yyDollar[1].node @@ -8434,7 +8433,7 @@ yydefault: } case 438: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5902 + //line php5/php5.y:5901 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) @@ -8442,7 +8441,7 @@ yydefault: } case 439: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:5908 + //line php5/php5.y:5907 { yyVAL.list = []node.Node{} @@ -8450,7 +8449,7 @@ yydefault: } case 440: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5918 + //line php5/php5.y:5917 { if yyDollar[3].list != nil { yyDollar[3].list[0].(*expr.MethodCall).Method = yyDollar[2].list[len(yyDollar[2].list)-1].(*expr.PropertyFetch).Property @@ -8466,7 +8465,7 @@ yydefault: } case 441: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:5935 + //line php5/php5.y:5934 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yyVAL.list = append(yyDollar[1].list, fetch) @@ -8484,7 +8483,7 @@ yydefault: } case 442: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:5951 + //line php5/php5.y:5950 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yyVAL.list = []node.Node{yyDollar[1].node, fetch} @@ -8502,7 +8501,7 @@ yydefault: } case 443: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5970 + //line php5/php5.y:5969 { yyVAL.node = expr.NewMethodCall(nil, nil, yyDollar[1].node.(*node.ArgumentList)) @@ -8513,7 +8512,7 @@ yydefault: } case 444: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5982 + //line php5/php5.y:5981 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -8521,7 +8520,7 @@ yydefault: } case 445: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5988 + //line php5/php5.y:5987 { yyVAL.list = yyDollar[1].list @@ -8529,7 +8528,7 @@ yydefault: } case 446: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:5994 + //line php5/php5.y:5993 { yyVAL.list = nil @@ -8537,7 +8536,7 @@ yydefault: } case 447: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6003 + //line php5/php5.y:6002 { yyVAL.node = yyDollar[1].node @@ -8545,7 +8544,7 @@ yydefault: } case 448: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6009 + //line php5/php5.y:6008 { yyDollar[1].simpleIndirectReference.last.SetVarName(yyDollar[2].node) @@ -8559,7 +8558,7 @@ yydefault: } case 449: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6024 + //line php5/php5.y:6023 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -8573,7 +8572,7 @@ yydefault: } case 450: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6036 + //line php5/php5.y:6035 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -8587,7 +8586,7 @@ yydefault: } case 451: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6051 + //line php5/php5.y:6050 { yyVAL.node = yyDollar[1].node @@ -8595,7 +8594,7 @@ yydefault: } case 452: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6060 + //line php5/php5.y:6059 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -8612,7 +8611,7 @@ yydefault: } case 453: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6075 + //line php5/php5.y:6074 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -8629,7 +8628,7 @@ yydefault: } case 454: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6093 + //line php5/php5.y:6092 { yyVAL.node = yyDollar[1].node @@ -8637,7 +8636,7 @@ yydefault: } case 455: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6099 + //line php5/php5.y:6098 { yyVAL.node = yyDollar[1].node @@ -8645,7 +8644,7 @@ yydefault: } case 456: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6105 + //line php5/php5.y:6104 { yyVAL.node = yyDollar[1].node @@ -8653,7 +8652,7 @@ yydefault: } case 457: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6115 + //line php5/php5.y:6114 { yyVAL.node = yyDollar[1].node @@ -8661,7 +8660,7 @@ yydefault: } case 458: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6121 + //line php5/php5.y:6120 { yyDollar[1].simpleIndirectReference.last.SetVarName(yyDollar[2].node) @@ -8675,7 +8674,7 @@ yydefault: } case 459: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6133 + //line php5/php5.y:6132 { yyVAL.node = yyDollar[1].node @@ -8683,7 +8682,7 @@ yydefault: } case 460: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6142 + //line php5/php5.y:6141 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -8700,7 +8699,7 @@ yydefault: } case 461: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6157 + //line php5/php5.y:6156 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -8717,7 +8716,7 @@ yydefault: } case 462: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6172 + //line php5/php5.y:6171 { yyVAL.node = yyDollar[1].node @@ -8725,7 +8724,7 @@ yydefault: } case 463: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6182 + //line php5/php5.y:6181 { name := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(name) @@ -8742,7 +8741,7 @@ yydefault: } case 464: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6197 + //line php5/php5.y:6196 { yyVAL.node = expr.NewVariable(yyDollar[3].node) @@ -8761,7 +8760,7 @@ yydefault: } case 465: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:6217 + //line php5/php5.y:6216 { yyVAL.node = nil @@ -8769,7 +8768,7 @@ yydefault: } case 466: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6223 + //line php5/php5.y:6222 { yyVAL.node = yyDollar[1].node @@ -8777,7 +8776,7 @@ yydefault: } case 467: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6233 + //line php5/php5.y:6232 { yyVAL.list = yyDollar[1].list @@ -8785,7 +8784,7 @@ yydefault: } case 468: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6239 + //line php5/php5.y:6238 { fetch := expr.NewPropertyFetch(nil, yyDollar[1].node) yyVAL.list = []node.Node{fetch} @@ -8797,7 +8796,7 @@ yydefault: } case 469: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6252 + //line php5/php5.y:6251 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yyVAL.list = append(yyDollar[1].list, fetch) @@ -8815,7 +8814,7 @@ yydefault: } case 470: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6268 + //line php5/php5.y:6267 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yyVAL.list = append(yyDollar[1].list, fetch) @@ -8833,7 +8832,7 @@ yydefault: } case 471: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6284 + //line php5/php5.y:6283 { fetch := expr.NewPropertyFetch(nil, yyDollar[1].node) yyVAL.list = []node.Node{fetch} @@ -8845,7 +8844,7 @@ yydefault: } case 472: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6297 + //line php5/php5.y:6296 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -8859,7 +8858,7 @@ yydefault: } case 473: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6309 + //line php5/php5.y:6308 { yyVAL.node = yyDollar[2].node @@ -8876,7 +8875,7 @@ yydefault: } case 474: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6327 + //line php5/php5.y:6326 { n := expr.NewVariable(nil) yyVAL.simpleIndirectReference = simpleIndirectReference{[]*expr.Variable{n}, n} @@ -8892,7 +8891,7 @@ yydefault: } case 475: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6341 + //line php5/php5.y:6340 { n := expr.NewVariable(nil) @@ -8912,7 +8911,7 @@ yydefault: } case 476: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6362 + //line php5/php5.y:6361 { if len(yyDollar[1].list) == 0 { yyDollar[1].list = []node.Node{expr.NewArrayItem(nil, nil)} @@ -8927,7 +8926,7 @@ yydefault: } case 477: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6375 + //line php5/php5.y:6374 { if yyDollar[1].node.(*expr.ArrayItem).Key == nil && yyDollar[1].node.(*expr.ArrayItem).Val == nil { yyVAL.list = []node.Node{} @@ -8939,7 +8938,7 @@ yydefault: } case 478: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6389 + //line php5/php5.y:6388 { yyVAL.node = expr.NewArrayItem(nil, yyDollar[1].node) @@ -8950,7 +8949,7 @@ yydefault: } case 479: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6398 + //line php5/php5.y:6397 { item := expr.NewList(yyDollar[3].list) yyVAL.node = expr.NewArrayItem(nil, item) @@ -8968,7 +8967,7 @@ yydefault: } case 480: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:6414 + //line php5/php5.y:6413 { yyVAL.node = expr.NewArrayItem(nil, nil) @@ -8976,7 +8975,7 @@ yydefault: } case 481: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:6424 + //line php5/php5.y:6423 { yyVAL.list = []node.Node{} @@ -8984,7 +8983,7 @@ yydefault: } case 482: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6430 + //line php5/php5.y:6429 { yyVAL.list = yyDollar[1].list @@ -9001,7 +9000,7 @@ yydefault: } case 483: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:6448 + //line php5/php5.y:6447 { arrayItem := expr.NewArrayItem(yyDollar[3].node, yyDollar[5].node) yyVAL.list = append(yyDollar[1].list, arrayItem) @@ -9017,7 +9016,7 @@ yydefault: } case 484: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6462 + //line php5/php5.y:6461 { arrayItem := expr.NewArrayItem(nil, yyDollar[3].node) yyVAL.list = append(yyDollar[1].list, arrayItem) @@ -9032,7 +9031,7 @@ yydefault: } case 485: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6475 + //line php5/php5.y:6474 { arrayItem := expr.NewArrayItem(yyDollar[1].node, yyDollar[3].node) yyVAL.list = []node.Node{arrayItem} @@ -9047,7 +9046,7 @@ yydefault: } case 486: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6488 + //line php5/php5.y:6487 { arrayItem := expr.NewArrayItem(nil, yyDollar[1].node) yyVAL.list = []node.Node{arrayItem} @@ -9059,7 +9058,7 @@ yydefault: } case 487: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:6498 + //line php5/php5.y:6497 { reference := expr.NewReference(yyDollar[6].node) arrayItem := expr.NewArrayItem(yyDollar[3].node, reference) @@ -9078,7 +9077,7 @@ yydefault: } case 488: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6515 + //line php5/php5.y:6514 { reference := expr.NewReference(yyDollar[4].node) arrayItem := expr.NewArrayItem(nil, reference) @@ -9096,7 +9095,7 @@ yydefault: } case 489: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6531 + //line php5/php5.y:6530 { reference := expr.NewReference(yyDollar[4].node) arrayItem := expr.NewArrayItem(yyDollar[1].node, reference) @@ -9114,7 +9113,7 @@ yydefault: } case 490: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6547 + //line php5/php5.y:6546 { reference := expr.NewReference(yyDollar[2].node) arrayItem := expr.NewArrayItem(nil, reference) @@ -9131,7 +9130,7 @@ yydefault: } case 491: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6565 + //line php5/php5.y:6564 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -9139,7 +9138,7 @@ yydefault: } case 492: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6571 + //line php5/php5.y:6570 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yyVAL.list = append(yyDollar[1].list, encapsed) @@ -9154,7 +9153,7 @@ yydefault: } case 493: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6584 + //line php5/php5.y:6583 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -9162,7 +9161,7 @@ yydefault: } case 494: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6590 + //line php5/php5.y:6589 { encapsed := scalar.NewEncapsedStringPart(yyDollar[1].token.Value) yyVAL.list = []node.Node{encapsed, yyDollar[2].node} @@ -9177,7 +9176,7 @@ yydefault: } case 495: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6606 + //line php5/php5.y:6605 { name := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(name) @@ -9194,7 +9193,7 @@ yydefault: } case 496: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6621 + //line php5/php5.y:6620 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -9217,7 +9216,7 @@ yydefault: } case 497: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6642 + //line php5/php5.y:6641 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -9240,7 +9239,7 @@ yydefault: } case 498: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6663 + //line php5/php5.y:6662 { variable := expr.NewVariable(yyDollar[2].node) @@ -9259,7 +9258,7 @@ yydefault: } case 499: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6680 + //line php5/php5.y:6679 { name := node.NewIdentifier(yyDollar[2].token.Value) variable := expr.NewVariable(name) @@ -9281,7 +9280,7 @@ yydefault: } case 500: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:6700 + //line php5/php5.y:6699 { identifier := node.NewIdentifier(yyDollar[2].token.Value) variable := expr.NewVariable(identifier) @@ -9307,7 +9306,7 @@ yydefault: } case 501: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6724 + //line php5/php5.y:6723 { yyVAL.node = yyDollar[2].node @@ -9321,7 +9320,7 @@ yydefault: } case 502: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6739 + //line php5/php5.y:6738 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) @@ -9335,7 +9334,7 @@ yydefault: } case 503: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6751 + //line php5/php5.y:6750 { // TODO: add option to handle 64 bit integer if _, err := strconv.Atoi(yyDollar[1].token.Value); err == nil { @@ -9354,7 +9353,7 @@ yydefault: } case 504: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6768 + //line php5/php5.y:6767 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(identifier) @@ -9371,7 +9370,7 @@ yydefault: } case 505: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6786 + //line php5/php5.y:6785 { yyVAL.node = expr.NewIsset(yyDollar[3].list) @@ -9387,7 +9386,7 @@ yydefault: } case 506: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6800 + //line php5/php5.y:6799 { yyVAL.node = expr.NewEmpty(yyDollar[3].node) @@ -9403,7 +9402,7 @@ yydefault: } case 507: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6814 + //line php5/php5.y:6813 { yyVAL.node = expr.NewEmpty(yyDollar[3].node) @@ -9419,7 +9418,7 @@ yydefault: } case 508: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6828 + //line php5/php5.y:6827 { yyVAL.node = expr.NewInclude(yyDollar[2].node) @@ -9433,7 +9432,7 @@ yydefault: } case 509: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6840 + //line php5/php5.y:6839 { yyVAL.node = expr.NewIncludeOnce(yyDollar[2].node) @@ -9447,7 +9446,7 @@ yydefault: } case 510: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6852 + //line php5/php5.y:6851 { yyVAL.node = expr.NewEval(yyDollar[3].node) @@ -9463,7 +9462,7 @@ yydefault: } case 511: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6866 + //line php5/php5.y:6865 { yyVAL.node = expr.NewRequire(yyDollar[2].node) @@ -9477,7 +9476,7 @@ yydefault: } case 512: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6878 + //line php5/php5.y:6877 { yyVAL.node = expr.NewRequireOnce(yyDollar[2].node) @@ -9491,7 +9490,7 @@ yydefault: } case 513: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6893 + //line php5/php5.y:6892 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -9499,7 +9498,7 @@ yydefault: } case 514: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6899 + //line php5/php5.y:6898 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -9510,7 +9509,7 @@ yydefault: } case 515: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6911 + //line php5/php5.y:6910 { yyVAL.node = yyDollar[1].node @@ -9518,7 +9517,7 @@ yydefault: } case 516: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6917 + //line php5/php5.y:6916 { yyVAL.node = yyDollar[1].node @@ -9526,7 +9525,7 @@ yydefault: } case 517: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6926 + //line php5/php5.y:6925 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -9543,7 +9542,7 @@ yydefault: } case 518: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6941 + //line php5/php5.y:6940 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -9560,7 +9559,7 @@ yydefault: } case 519: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6959 + //line php5/php5.y:6958 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -9577,7 +9576,7 @@ yydefault: } case 520: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6977 + //line php5/php5.y:6976 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) diff --git a/php5/php5.y b/php5/php5.y index f8cd314..94128cd 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -4201,8 +4201,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.BackquoteToken).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.BackquoteToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php7/php7.go b/php7/php7.go index f37095c..8277382 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -348,7 +348,7 @@ const yyEofCode = 1 const yyErrCode = 2 const yyInitialStackSize = 16 -//line php7/php7.y:5466 +//line php7/php7.y:5465 //line yacctab:1 var yyExca = [...]int{ @@ -6483,14 +6483,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.BackquoteToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.BackquoteToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 364: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3933 + //line php7/php7.y:3932 { yyVAL.node = expr.NewPrint(yyDollar[2].node) @@ -6504,7 +6503,7 @@ yydefault: } case 365: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3945 + //line php7/php7.y:3944 { yyVAL.node = expr.NewYield(nil, nil) @@ -6518,7 +6517,7 @@ yydefault: } case 366: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3957 + //line php7/php7.y:3956 { yyVAL.node = expr.NewYield(nil, yyDollar[2].node) @@ -6532,7 +6531,7 @@ yydefault: } case 367: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3969 + //line php7/php7.y:3968 { yyVAL.node = expr.NewYield(yyDollar[2].node, yyDollar[4].node) @@ -6547,7 +6546,7 @@ yydefault: } case 368: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3982 + //line php7/php7.y:3981 { yyVAL.node = expr.NewYieldFrom(yyDollar[2].node) @@ -6561,7 +6560,7 @@ yydefault: } case 369: yyDollar = yyS[yypt-11 : yypt+1] - //line php7/php7.y:3994 + //line php7/php7.y:3993 { yyVAL.node = expr.NewClosure(yyDollar[5].list, yyDollar[7].ClosureUse, yyDollar[8].node, yyDollar[10].list, false, yyDollar[2].token != nil, yyDollar[3].str) @@ -6582,7 +6581,7 @@ yydefault: } case 370: yyDollar = yyS[yypt-12 : yypt+1] - //line php7/php7.y:4013 + //line php7/php7.y:4012 { yyVAL.node = expr.NewClosure(yyDollar[6].list, yyDollar[8].ClosureUse, yyDollar[9].node, yyDollar[11].list, true, yyDollar[3].token != nil, yyDollar[4].str) @@ -6604,7 +6603,7 @@ yydefault: } case 371: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4036 + //line php7/php7.y:4035 { yyVAL.str = yylex.(*Parser).PhpDocComment yylex.(*Parser).PhpDocComment = "" @@ -6613,19 +6612,19 @@ yydefault: } case 372: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4046 + //line php7/php7.y:4045 { yyVAL.token = nil } case 373: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4050 + //line php7/php7.y:4049 { yyVAL.token = yyDollar[1].token } case 374: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4057 + //line php7/php7.y:4056 { yyVAL.ClosureUse = nil @@ -6633,7 +6632,7 @@ yydefault: } case 375: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4063 + //line php7/php7.y:4062 { yyVAL.ClosureUse = expr.NewClosureUse(yyDollar[3].list) @@ -6649,7 +6648,7 @@ yydefault: } case 376: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4080 + //line php7/php7.y:4079 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -6660,7 +6659,7 @@ yydefault: } case 377: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4089 + //line php7/php7.y:4088 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -6668,7 +6667,7 @@ yydefault: } case 378: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4098 + //line php7/php7.y:4097 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(identifier) @@ -6685,7 +6684,7 @@ yydefault: } case 379: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4113 + //line php7/php7.y:4112 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[2].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -6705,7 +6704,7 @@ yydefault: } case 380: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4134 + //line php7/php7.y:4133 { yyVAL.node = expr.NewFunctionCall(yyDollar[1].node, yyDollar[2].node.(*node.ArgumentList)) @@ -6716,7 +6715,7 @@ yydefault: } case 381: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4143 + //line php7/php7.y:4142 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -6730,7 +6729,7 @@ yydefault: } case 382: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4155 + //line php7/php7.y:4154 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -6744,7 +6743,7 @@ yydefault: } case 383: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4167 + //line php7/php7.y:4166 { yyVAL.node = expr.NewFunctionCall(yyDollar[1].node, yyDollar[2].node.(*node.ArgumentList)) @@ -6755,7 +6754,7 @@ yydefault: } case 384: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4179 + //line php7/php7.y:4178 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -6769,7 +6768,7 @@ yydefault: } case 385: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4191 + //line php7/php7.y:4190 { yyVAL.node = yyDollar[1].node @@ -6777,7 +6776,7 @@ yydefault: } case 386: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4200 + //line php7/php7.y:4199 { yyVAL.node = yyDollar[1].node @@ -6785,7 +6784,7 @@ yydefault: } case 387: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4206 + //line php7/php7.y:4205 { yyVAL.node = yyDollar[1].node @@ -6793,7 +6792,7 @@ yydefault: } case 388: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4215 + //line php7/php7.y:4214 { yyVAL.node = nil @@ -6801,7 +6800,7 @@ yydefault: } case 389: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4221 + //line php7/php7.y:4220 { yyVAL.node = expr.NewExit(yyDollar[2].node) @@ -6818,7 +6817,7 @@ yydefault: } case 390: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4239 + //line php7/php7.y:4238 { yyVAL.list = []node.Node{} @@ -6826,7 +6825,7 @@ yydefault: } case 391: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4245 + //line php7/php7.y:4244 { yyVAL.list = []node.Node{scalar.NewEncapsedStringPart(yyDollar[1].token.Value)} @@ -6834,7 +6833,7 @@ yydefault: } case 392: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4251 + //line php7/php7.y:4250 { yyVAL.list = yyDollar[1].list @@ -6842,7 +6841,7 @@ yydefault: } case 393: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4260 + //line php7/php7.y:4259 { yyVAL.node = nil @@ -6850,7 +6849,7 @@ yydefault: } case 394: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4266 + //line php7/php7.y:4265 { yyVAL.node = yyDollar[1].node @@ -6858,7 +6857,7 @@ yydefault: } case 395: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4275 + //line php7/php7.y:4274 { yyVAL.node = expr.NewArray(yyDollar[3].list) @@ -6874,7 +6873,7 @@ yydefault: } case 396: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4289 + //line php7/php7.y:4288 { yyVAL.node = expr.NewShortArray(yyDollar[2].list) @@ -6889,7 +6888,7 @@ yydefault: } case 397: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4302 + //line php7/php7.y:4301 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) @@ -6903,7 +6902,7 @@ yydefault: } case 398: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4317 + //line php7/php7.y:4316 { yyVAL.node = scalar.NewLnumber(yyDollar[1].token.Value) @@ -6917,7 +6916,7 @@ yydefault: } case 399: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4329 + //line php7/php7.y:4328 { yyVAL.node = scalar.NewDnumber(yyDollar[1].token.Value) @@ -6931,7 +6930,7 @@ yydefault: } case 400: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4341 + //line php7/php7.y:4340 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6945,7 +6944,7 @@ yydefault: } case 401: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4353 + //line php7/php7.y:4352 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6959,7 +6958,7 @@ yydefault: } case 402: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4365 + //line php7/php7.y:4364 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6973,7 +6972,7 @@ yydefault: } case 403: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4377 + //line php7/php7.y:4376 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6987,7 +6986,7 @@ yydefault: } case 404: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4389 + //line php7/php7.y:4388 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7001,7 +7000,7 @@ yydefault: } case 405: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4401 + //line php7/php7.y:4400 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7015,7 +7014,7 @@ yydefault: } case 406: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4413 + //line php7/php7.y:4412 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7029,7 +7028,7 @@ yydefault: } case 407: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4425 + //line php7/php7.y:4424 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7043,7 +7042,7 @@ yydefault: } case 408: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4437 + //line php7/php7.y:4436 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, []node.Node{encapsed}) @@ -7059,7 +7058,7 @@ yydefault: } case 409: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4451 + //line php7/php7.y:4450 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, nil) @@ -7073,7 +7072,7 @@ yydefault: } case 410: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4463 + //line php7/php7.y:4462 { yyVAL.node = scalar.NewEncapsed(yyDollar[2].list) @@ -7087,7 +7086,7 @@ yydefault: } case 411: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4475 + //line php7/php7.y:4474 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, yyDollar[2].list) @@ -7101,7 +7100,7 @@ yydefault: } case 412: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4487 + //line php7/php7.y:4486 { yyVAL.node = yyDollar[1].node @@ -7109,7 +7108,7 @@ yydefault: } case 413: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4493 + //line php7/php7.y:4492 { yyVAL.node = yyDollar[1].node @@ -7117,7 +7116,7 @@ yydefault: } case 414: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4502 + //line php7/php7.y:4501 { yyVAL.node = expr.NewConstFetch(yyDollar[1].node) @@ -7128,7 +7127,7 @@ yydefault: } case 415: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4511 + //line php7/php7.y:4510 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -7145,7 +7144,7 @@ yydefault: } case 416: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4526 + //line php7/php7.y:4525 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -7162,7 +7161,7 @@ yydefault: } case 417: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4544 + //line php7/php7.y:4543 { yyVAL.node = yyDollar[1].node @@ -7170,7 +7169,7 @@ yydefault: } case 418: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4550 + //line php7/php7.y:4549 { yyVAL.node = yyDollar[1].node @@ -7178,7 +7177,7 @@ yydefault: } case 419: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4559 + //line php7/php7.y:4558 { yyVAL.node = nil @@ -7186,7 +7185,7 @@ yydefault: } case 420: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4565 + //line php7/php7.y:4564 { yyVAL.node = yyDollar[1].node @@ -7194,7 +7193,7 @@ yydefault: } case 421: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4574 + //line php7/php7.y:4573 { yyVAL.node = yyDollar[1].node @@ -7202,7 +7201,7 @@ yydefault: } case 422: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4583 + //line php7/php7.y:4582 { yyVAL.node = yyDollar[1].node @@ -7210,7 +7209,7 @@ yydefault: } case 423: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4589 + //line php7/php7.y:4588 { yyVAL.node = yyDollar[2].node @@ -7224,7 +7223,7 @@ yydefault: } case 424: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4601 + //line php7/php7.y:4600 { yyVAL.node = yyDollar[1].node @@ -7232,7 +7231,7 @@ yydefault: } case 425: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4610 + //line php7/php7.y:4609 { yyVAL.node = yyDollar[1].node @@ -7240,7 +7239,7 @@ yydefault: } case 426: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4616 + //line php7/php7.y:4615 { yyVAL.node = yyDollar[2].node @@ -7254,7 +7253,7 @@ yydefault: } case 427: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4628 + //line php7/php7.y:4627 { yyVAL.node = yyDollar[1].node @@ -7262,7 +7261,7 @@ yydefault: } case 428: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4637 + //line php7/php7.y:4636 { yyVAL.node = yyDollar[1].node @@ -7270,7 +7269,7 @@ yydefault: } case 429: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4643 + //line php7/php7.y:4642 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -7287,7 +7286,7 @@ yydefault: } case 430: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4658 + //line php7/php7.y:4657 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -7304,7 +7303,7 @@ yydefault: } case 431: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4673 + //line php7/php7.y:4672 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -7321,7 +7320,7 @@ yydefault: } case 432: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4688 + //line php7/php7.y:4687 { yyVAL.node = expr.NewMethodCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -7335,7 +7334,7 @@ yydefault: } case 433: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4700 + //line php7/php7.y:4699 { yyVAL.node = yyDollar[1].node @@ -7343,7 +7342,7 @@ yydefault: } case 434: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4709 + //line php7/php7.y:4708 { yyVAL.node = yyDollar[1].node @@ -7351,7 +7350,7 @@ yydefault: } case 435: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4715 + //line php7/php7.y:4714 { yyVAL.node = yyDollar[1].node @@ -7359,7 +7358,7 @@ yydefault: } case 436: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4721 + //line php7/php7.y:4720 { yyVAL.node = expr.NewPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -7373,7 +7372,7 @@ yydefault: } case 437: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4736 + //line php7/php7.y:4735 { name := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(name) @@ -7390,7 +7389,7 @@ yydefault: } case 438: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4751 + //line php7/php7.y:4750 { yyVAL.node = expr.NewVariable(yyDollar[3].node) @@ -7409,7 +7408,7 @@ yydefault: } case 439: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4768 + //line php7/php7.y:4767 { yyVAL.node = expr.NewVariable(yyDollar[2].node) @@ -7424,7 +7423,7 @@ yydefault: } case 440: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4784 + //line php7/php7.y:4783 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -7438,7 +7437,7 @@ yydefault: } case 441: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4796 + //line php7/php7.y:4795 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -7452,7 +7451,7 @@ yydefault: } case 442: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4811 + //line php7/php7.y:4810 { yyVAL.node = yyDollar[1].node @@ -7460,7 +7459,7 @@ yydefault: } case 443: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4817 + //line php7/php7.y:4816 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -7477,7 +7476,7 @@ yydefault: } case 444: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4832 + //line php7/php7.y:4831 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -7494,7 +7493,7 @@ yydefault: } case 445: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4847 + //line php7/php7.y:4846 { yyVAL.node = expr.NewPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -7508,7 +7507,7 @@ yydefault: } case 446: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4859 + //line php7/php7.y:4858 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -7522,7 +7521,7 @@ yydefault: } case 447: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4871 + //line php7/php7.y:4870 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -7536,7 +7535,7 @@ yydefault: } case 448: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4886 + //line php7/php7.y:4885 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -7550,7 +7549,7 @@ yydefault: } case 449: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4898 + //line php7/php7.y:4897 { yyVAL.node = yyDollar[2].node @@ -7564,7 +7563,7 @@ yydefault: } case 450: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4910 + //line php7/php7.y:4909 { yyVAL.node = yyDollar[1].node @@ -7572,7 +7571,7 @@ yydefault: } case 451: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4919 + //line php7/php7.y:4918 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -7586,7 +7585,7 @@ yydefault: } case 452: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4931 + //line php7/php7.y:4930 { yyVAL.node = yyDollar[2].node @@ -7600,7 +7599,7 @@ yydefault: } case 453: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4943 + //line php7/php7.y:4942 { yyVAL.node = yyDollar[1].node @@ -7608,7 +7607,7 @@ yydefault: } case 454: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4952 + //line php7/php7.y:4951 { yyVAL.list = yyDollar[1].list @@ -7616,7 +7615,7 @@ yydefault: } case 455: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4961 + //line php7/php7.y:4960 { yyVAL.node = expr.NewArrayItem(nil, nil) @@ -7624,7 +7623,7 @@ yydefault: } case 456: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4967 + //line php7/php7.y:4966 { yyVAL.node = yyDollar[1].node @@ -7632,7 +7631,7 @@ yydefault: } case 457: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4976 + //line php7/php7.y:4975 { if len(yyDollar[1].list) == 0 { yyDollar[1].list = []node.Node{expr.NewArrayItem(nil, nil)} @@ -7647,7 +7646,7 @@ yydefault: } case 458: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4989 + //line php7/php7.y:4988 { if yyDollar[1].node.(*expr.ArrayItem).Key == nil && yyDollar[1].node.(*expr.ArrayItem).Val == nil { yyVAL.list = []node.Node{} @@ -7659,7 +7658,7 @@ yydefault: } case 459: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5002 + //line php7/php7.y:5001 { yyVAL.node = expr.NewArrayItem(yyDollar[1].node, yyDollar[3].node) @@ -7673,7 +7672,7 @@ yydefault: } case 460: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5014 + //line php7/php7.y:5013 { yyVAL.node = expr.NewArrayItem(nil, yyDollar[1].node) @@ -7684,7 +7683,7 @@ yydefault: } case 461: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:5023 + //line php7/php7.y:5022 { reference := expr.NewReference(yyDollar[4].node) yyVAL.node = expr.NewArrayItem(yyDollar[1].node, reference) @@ -7701,7 +7700,7 @@ yydefault: } case 462: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5038 + //line php7/php7.y:5037 { reference := expr.NewReference(yyDollar[2].node) yyVAL.node = expr.NewArrayItem(nil, reference) @@ -7717,7 +7716,7 @@ yydefault: } case 463: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:5052 + //line php7/php7.y:5051 { // TODO: Cannot use list() as standalone expression list := expr.NewList(yyDollar[5].list) @@ -7737,7 +7736,7 @@ yydefault: } case 464: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:5070 + //line php7/php7.y:5069 { // TODO: Cannot use list() as standalone expression list := expr.NewList(yyDollar[3].list) @@ -7756,7 +7755,7 @@ yydefault: } case 465: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5090 + //line php7/php7.y:5089 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -7764,7 +7763,7 @@ yydefault: } case 466: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5096 + //line php7/php7.y:5095 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yyVAL.list = append(yyDollar[1].list, encapsed) @@ -7779,7 +7778,7 @@ yydefault: } case 467: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5109 + //line php7/php7.y:5108 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -7787,7 +7786,7 @@ yydefault: } case 468: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5115 + //line php7/php7.y:5114 { encapsed := scalar.NewEncapsedStringPart(yyDollar[1].token.Value) yyVAL.list = []node.Node{encapsed, yyDollar[2].node} @@ -7802,7 +7801,7 @@ yydefault: } case 469: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5131 + //line php7/php7.y:5130 { name := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(name) @@ -7819,7 +7818,7 @@ yydefault: } case 470: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:5146 + //line php7/php7.y:5145 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -7842,7 +7841,7 @@ yydefault: } case 471: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5167 + //line php7/php7.y:5166 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -7865,7 +7864,7 @@ yydefault: } case 472: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5188 + //line php7/php7.y:5187 { variable := expr.NewVariable(yyDollar[2].node) @@ -7884,7 +7883,7 @@ yydefault: } case 473: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5205 + //line php7/php7.y:5204 { name := node.NewIdentifier(yyDollar[2].token.Value) variable := expr.NewVariable(name) @@ -7906,7 +7905,7 @@ yydefault: } case 474: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:5225 + //line php7/php7.y:5224 { identifier := node.NewIdentifier(yyDollar[2].token.Value) variable := expr.NewVariable(identifier) @@ -7932,7 +7931,7 @@ yydefault: } case 475: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5249 + //line php7/php7.y:5248 { yyVAL.node = yyDollar[2].node @@ -7946,7 +7945,7 @@ yydefault: } case 476: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5264 + //line php7/php7.y:5263 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) @@ -7960,7 +7959,7 @@ yydefault: } case 477: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5276 + //line php7/php7.y:5275 { // TODO: add option to handle 64 bit integer if _, err := strconv.Atoi(yyDollar[1].token.Value); err == nil { @@ -7979,7 +7978,7 @@ yydefault: } case 478: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5293 + //line php7/php7.y:5292 { var lnumber *scalar.Lnumber // TODO: add option to handle 64 bit integer @@ -8012,7 +8011,7 @@ yydefault: } case 479: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5324 + //line php7/php7.y:5323 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(identifier) @@ -8029,7 +8028,7 @@ yydefault: } case 480: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:5342 + //line php7/php7.y:5341 { yyVAL.node = expr.NewIsset(yyDollar[3].list) @@ -8049,7 +8048,7 @@ yydefault: } case 481: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:5360 + //line php7/php7.y:5359 { yyVAL.node = expr.NewEmpty(yyDollar[3].node) @@ -8065,7 +8064,7 @@ yydefault: } case 482: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5374 + //line php7/php7.y:5373 { yyVAL.node = expr.NewInclude(yyDollar[2].node) @@ -8079,7 +8078,7 @@ yydefault: } case 483: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5386 + //line php7/php7.y:5385 { yyVAL.node = expr.NewIncludeOnce(yyDollar[2].node) @@ -8093,7 +8092,7 @@ yydefault: } case 484: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:5398 + //line php7/php7.y:5397 { yyVAL.node = expr.NewEval(yyDollar[3].node) @@ -8109,7 +8108,7 @@ yydefault: } case 485: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5412 + //line php7/php7.y:5411 { yyVAL.node = expr.NewRequire(yyDollar[2].node) @@ -8123,7 +8122,7 @@ yydefault: } case 486: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5424 + //line php7/php7.y:5423 { yyVAL.node = expr.NewRequireOnce(yyDollar[2].node) @@ -8137,7 +8136,7 @@ yydefault: } case 487: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5439 + //line php7/php7.y:5438 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -8145,7 +8144,7 @@ yydefault: } case 488: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5445 + //line php7/php7.y:5444 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -8156,7 +8155,7 @@ yydefault: } case 489: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5457 + //line php7/php7.y:5456 { yyVAL.node = yyDollar[1].node diff --git a/php7/php7.y b/php7/php7.y index 80ef257..52212f8 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -3924,8 +3924,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.BackquoteToken).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.BackquoteToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/printer/printer.go b/printer/printer.go index 2fde06b..b7d6c44 100644 --- a/printer/printer.go +++ b/printer/printer.go @@ -1545,7 +1545,6 @@ func (p *Printer) printExprShellExec(n node.Node) { nn := n.(*expr.ShellExec) p.printMeta(nn, meta.NodeStart) - p.printMeta(nn, meta.BackquoteToken) io.WriteString(p.w, "`") for _, part := range nn.Parts { p.Print(part) diff --git a/printer/printer_test.go b/printer/printer_test.go index 8365e56..b67d824 100644 --- a/printer/printer_test.go +++ b/printer/printer_test.go @@ -4175,7 +4175,7 @@ func TestPrinterPrintShellExec(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.BackquoteToken, + TokenName: meta.NodeStart, }, }, Parts: []node.Node{ From 82a06f5b106bc24bba85421f292e2a2274043fe0 Mon Sep 17 00:00:00 2001 From: z7zmey Date: Mon, 29 Oct 2018 12:38:06 +0200 Subject: [PATCH 058/117] replace meta.OpenSquareBracket --- php5/php5.go | 4 ++-- php5/php5.y | 4 ++-- php7/php7.go | 6 +++--- php7/php7.y | 6 +++--- printer/printer.go | 2 -- printer/printer_test.go | 4 ++-- 6 files changed, 12 insertions(+), 14 deletions(-) diff --git a/php5/php5.go b/php5/php5.go index ff5bb54..c831c81 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -6795,7 +6795,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -7574,7 +7574,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) diff --git a/php5/php5.y b/php5/php5.y index 94128cd..70b8dfc 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -4411,7 +4411,7 @@ combined_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $3.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -5127,7 +5127,7 @@ static_scalar_value: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $3.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) diff --git a/php7/php7.go b/php7/php7.go index 8277382..8384847 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -4054,7 +4054,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -5535,7 +5535,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[5].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo(shortList.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(shortList.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(shortList.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.EqualToken).AppendTo(yyVAL.node.GetMeta()) @@ -6881,7 +6881,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) diff --git a/php7/php7.y b/php7/php7.y index 52212f8..d9931c2 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -1692,7 +1692,7 @@ foreach_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $3.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -3110,7 +3110,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5)) // save comments - $1.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo(shortList.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo(shortList.GetMeta()) $3.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(shortList.GetMeta()) $4.Meta.SetTokenName(meta.EqualToken).AppendTo($$.GetMeta()) @@ -4292,7 +4292,7 @@ dereferencable_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $3.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) diff --git a/printer/printer.go b/printer/printer.go index b7d6c44..c221cc7 100644 --- a/printer/printer.go +++ b/printer/printer.go @@ -1558,7 +1558,6 @@ func (p *Printer) printExprShortArray(n node.Node) { nn := n.(*expr.ShortArray) p.printMeta(nn, meta.NodeStart) - p.printMeta(nn, meta.OpenSquareBracket) io.WriteString(p.w, "[") p.joinPrint(",", nn.Items) p.printMeta(nn, meta.CloseSquareBracket) @@ -1571,7 +1570,6 @@ func (p *Printer) printExprShortList(n node.Node) { nn := n.(*expr.ShortList) p.printMeta(nn, meta.NodeStart) - p.printMeta(nn, meta.OpenSquareBracket) io.WriteString(p.w, "[") p.joinPrint(",", nn.Items) p.printMeta(nn, meta.CloseSquareBracket) diff --git a/printer/printer_test.go b/printer/printer_test.go index b67d824..e04056d 100644 --- a/printer/printer_test.go +++ b/printer/printer_test.go @@ -4211,7 +4211,7 @@ func TestPrinterPrintExprShortArray(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.OpenSquareBracket, + TokenName: meta.NodeStart, }, &meta.Data{ Type: meta.WhiteSpaceType, @@ -4278,7 +4278,7 @@ func TestPrinterPrintShortList(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.OpenSquareBracket, + TokenName: meta.NodeStart, }, &meta.Data{ Type: meta.WhiteSpaceType, From 9373b24ce7d5512b6e1bb36344a89fdf173b2cee Mon Sep 17 00:00:00 2001 From: z7zmey Date: Mon, 29 Oct 2018 12:41:52 +0200 Subject: [PATCH 059/117] replace meta.MinusToken --- php5/php5.go | 4 ++-- php5/php5.y | 4 ++-- php7/php7.go | 4 ++-- php7/php7.y | 4 ++-- printer/printer.go | 1 - printer/printer_test.go | 2 +- 6 files changed, 9 insertions(+), 10 deletions(-) diff --git a/php5/php5.go b/php5/php5.go index c831c81..e99a2fe 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -6137,7 +6137,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.MinusToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -8059,7 +8059,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.MinusToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php5/php5.y b/php5/php5.y index 70b8dfc..571fafb 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -3832,7 +3832,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.MinusToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5545,7 +5545,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.MinusToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php7/php7.go b/php7/php7.go index 8384847..b173936 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -6070,7 +6070,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.MinusToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -8000,7 +8000,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.MinusToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) if isInt { yyDollar[2].token.Meta.SetTokenName(meta.NumStringToken).AppendTo(lnumber.GetMeta()) } else { diff --git a/php7/php7.y b/php7/php7.y index d9931c2..257c909 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -3569,7 +3569,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.MinusToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5310,7 +5310,7 @@ encaps_var_offset: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.MinusToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) if isInt { $2.Meta.SetTokenName(meta.NumStringToken).AppendTo(lnumber.GetMeta()) } else { diff --git a/printer/printer.go b/printer/printer.go index c221cc7..7652e05 100644 --- a/printer/printer.go +++ b/printer/printer.go @@ -1631,7 +1631,6 @@ func (p *Printer) printExprUnaryMinus(n node.Node) { nn := n.(*expr.UnaryMinus) p.printMeta(nn, meta.NodeStart) - p.printMeta(nn, meta.MinusToken) io.WriteString(p.w, "-") p.Print(nn.Expr) diff --git a/printer/printer_test.go b/printer/printer_test.go index e04056d..aafdc95 100644 --- a/printer/printer_test.go +++ b/printer/printer_test.go @@ -4550,7 +4550,7 @@ func TestPrinterPrintUnaryMinus(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.MinusToken, + TokenName: meta.NodeStart, }, }, Expr: &expr.Variable{ From 00b1f659df318d3da311af07a5eeec4a7946865b Mon Sep 17 00:00:00 2001 From: z7zmey Date: Mon, 29 Oct 2018 12:43:55 +0200 Subject: [PATCH 060/117] replace meta.PlusToken --- php5/php5.go | 4 ++-- php5/php5.y | 4 ++-- php7/php7.go | 2 +- php7/php7.y | 2 +- printer/printer.go | 1 - printer/printer_test.go | 2 +- 6 files changed, 7 insertions(+), 8 deletions(-) diff --git a/php5/php5.go b/php5/php5.go index e99a2fe..a702c3e 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -6123,7 +6123,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.PlusToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -8045,7 +8045,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.PlusToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php5/php5.y b/php5/php5.y index 571fafb..d1fb950 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -3820,7 +3820,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.PlusToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5533,7 +5533,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.PlusToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php7/php7.go b/php7/php7.go index b173936..6484dad 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -6056,7 +6056,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.PlusToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php7/php7.y b/php7/php7.y index 257c909..ca90896 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -3557,7 +3557,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.PlusToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/printer/printer.go b/printer/printer.go index 7652e05..c38a416 100644 --- a/printer/printer.go +++ b/printer/printer.go @@ -1641,7 +1641,6 @@ func (p *Printer) printExprUnaryPlus(n node.Node) { nn := n.(*expr.UnaryPlus) p.printMeta(nn, meta.NodeStart) - p.printMeta(nn, meta.PlusToken) io.WriteString(p.w, "+") p.Print(nn.Expr) diff --git a/printer/printer_test.go b/printer/printer_test.go index aafdc95..a6a6271 100644 --- a/printer/printer_test.go +++ b/printer/printer_test.go @@ -4582,7 +4582,7 @@ func TestPrinterPrintUnaryPlus(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.PlusToken, + TokenName: meta.NodeStart, }, }, Expr: &expr.Variable{ From 6d7c5d5d2bd4364f87c77c56f7f69211cc143442 Mon Sep 17 00:00:00 2001 From: z7zmey Date: Mon, 29 Oct 2018 12:45:47 +0200 Subject: [PATCH 061/117] remove meta.YieldFromToken --- meta/tokenName.go | 1 - meta/tokenName_string.go | 4 ++-- php7/php7.go | 2 +- php7/php7.y | 2 +- printer/printer.go | 1 - printer/printer_test.go | 2 +- 6 files changed, 5 insertions(+), 7 deletions(-) diff --git a/meta/tokenName.go b/meta/tokenName.go index 25f74c4..e4e8cd9 100644 --- a/meta/tokenName.go +++ b/meta/tokenName.go @@ -69,7 +69,6 @@ const ( PublicToken IncToken DecToken - YieldFromToken ObjectOperatorToken CoalesceToken SpaceshipToken diff --git a/meta/tokenName_string.go b/meta/tokenName_string.go index 9345fe9..7557bb1 100644 --- a/meta/tokenName_string.go +++ b/meta/tokenName_string.go @@ -4,9 +4,9 @@ package meta import "strconv" -const _TokenName_name = "NodeStartNodeEndIfTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenElseifTokenElseTokenEndifTokenYieldTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenYieldFromTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" +const _TokenName_name = "NodeStartNodeEndIfTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenElseifTokenElseTokenEndifTokenYieldTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" -var _TokenName_index = [...]uint16{0, 9, 16, 23, 41, 55, 70, 79, 86, 96, 109, 130, 151, 159, 170, 182, 197, 209, 224, 231, 242, 256, 265, 277, 287, 300, 309, 322, 332, 343, 351, 361, 373, 383, 397, 408, 416, 426, 436, 446, 460, 472, 487, 503, 516, 530, 554, 580, 596, 609, 623, 638, 653, 668, 679, 688, 698, 708, 721, 731, 743, 757, 768, 776, 784, 798, 817, 830, 844, 858, 873, 886, 899, 912, 928, 941, 954, 966, 979, 991, 1003, 1017, 1032, 1040, 1047, 1054, 1070, 1089, 1101, 1116, 1137, 1158, 1175, 1193, 1213, 1234, 1248, 1258, 1278, 1299, 1316, 1334, 1351, 1365, 1375, 1384, 1394, 1410, 1420, 1430, 1443, 1453, 1465, 1474, 1486, 1494} +var _TokenName_index = [...]uint16{0, 9, 16, 23, 41, 55, 70, 79, 86, 96, 109, 130, 151, 159, 170, 182, 197, 209, 224, 231, 242, 256, 265, 277, 287, 300, 309, 322, 332, 343, 351, 361, 373, 383, 397, 408, 416, 426, 436, 446, 460, 472, 487, 503, 516, 530, 554, 580, 596, 609, 623, 638, 653, 668, 679, 688, 698, 708, 721, 731, 743, 757, 768, 776, 784, 803, 816, 830, 844, 859, 872, 885, 898, 914, 927, 940, 952, 965, 977, 989, 1003, 1018, 1026, 1033, 1040, 1056, 1075, 1087, 1102, 1123, 1144, 1161, 1179, 1199, 1220, 1234, 1244, 1264, 1285, 1302, 1320, 1337, 1351, 1361, 1370, 1380, 1396, 1406, 1416, 1429, 1439, 1451, 1460, 1472, 1480} func (i TokenName) String() string { if i < 0 || i >= TokenName(len(_TokenName_index)-1) { diff --git a/php7/php7.go b/php7/php7.go index 6484dad..3009a87 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -6554,7 +6554,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.YieldFromToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php7/php7.y b/php7/php7.y index ca90896..79d3a98 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -3985,7 +3985,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.YieldFromToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/printer/printer.go b/printer/printer.go index c38a416..29c59af 100644 --- a/printer/printer.go +++ b/printer/printer.go @@ -1660,7 +1660,6 @@ func (p *Printer) printExprYieldFrom(n node.Node) { nn := n.(*expr.YieldFrom) p.printMeta(nn, meta.NodeStart) - p.printMeta(nn, meta.YieldFromToken) io.WriteString(p.w, "yield from") p.Print(nn.Expr) diff --git a/printer/printer_test.go b/printer/printer_test.go index a6a6271..b39ece8 100644 --- a/printer/printer_test.go +++ b/printer/printer_test.go @@ -4651,7 +4651,7 @@ func TestPrinterPrintYieldFrom(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.YieldFromToken, + TokenName: meta.NodeStart, }, }, Expr: &expr.Variable{ From fee05946445848b5b5a74f900cd5a8e9aa35031e Mon Sep 17 00:00:00 2001 From: z7zmey Date: Mon, 29 Oct 2018 12:47:32 +0200 Subject: [PATCH 062/117] remove meta.YieldToken --- meta/tokenName.go | 1 - meta/tokenName_string.go | 4 ++-- php5/php5.go | 10 +++++----- php5/php5.y | 10 +++++----- php7/php7.go | 6 +++--- php7/php7.y | 6 +++--- printer/printer.go | 1 - printer/printer_test.go | 4 ++-- 8 files changed, 20 insertions(+), 22 deletions(-) diff --git a/meta/tokenName.go b/meta/tokenName.go index e4e8cd9..82041e0 100644 --- a/meta/tokenName.go +++ b/meta/tokenName.go @@ -61,7 +61,6 @@ const ( ElseifToken ElseToken EndifToken - YieldToken AbstractToken FinalToken PrivateToken diff --git a/meta/tokenName_string.go b/meta/tokenName_string.go index 7557bb1..3c6c85b 100644 --- a/meta/tokenName_string.go +++ b/meta/tokenName_string.go @@ -4,9 +4,9 @@ package meta import "strconv" -const _TokenName_name = "NodeStartNodeEndIfTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenElseifTokenElseTokenEndifTokenYieldTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" +const _TokenName_name = "NodeStartNodeEndIfTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenElseifTokenElseTokenEndifTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" -var _TokenName_index = [...]uint16{0, 9, 16, 23, 41, 55, 70, 79, 86, 96, 109, 130, 151, 159, 170, 182, 197, 209, 224, 231, 242, 256, 265, 277, 287, 300, 309, 322, 332, 343, 351, 361, 373, 383, 397, 408, 416, 426, 436, 446, 460, 472, 487, 503, 516, 530, 554, 580, 596, 609, 623, 638, 653, 668, 679, 688, 698, 708, 721, 731, 743, 757, 768, 776, 784, 803, 816, 830, 844, 859, 872, 885, 898, 914, 927, 940, 952, 965, 977, 989, 1003, 1018, 1026, 1033, 1040, 1056, 1075, 1087, 1102, 1123, 1144, 1161, 1179, 1199, 1220, 1234, 1244, 1264, 1285, 1302, 1320, 1337, 1351, 1361, 1370, 1380, 1396, 1406, 1416, 1429, 1439, 1451, 1460, 1472, 1480} +var _TokenName_index = [...]uint16{0, 9, 16, 23, 41, 55, 70, 79, 86, 96, 109, 130, 151, 159, 170, 182, 197, 209, 224, 231, 242, 256, 265, 277, 287, 300, 309, 322, 332, 343, 351, 361, 373, 383, 397, 408, 416, 426, 436, 446, 460, 472, 487, 503, 516, 530, 554, 580, 596, 609, 623, 638, 653, 668, 679, 688, 698, 711, 721, 733, 747, 758, 766, 774, 793, 806, 820, 834, 849, 862, 875, 888, 904, 917, 930, 942, 955, 967, 979, 993, 1008, 1016, 1023, 1030, 1046, 1065, 1077, 1092, 1113, 1134, 1151, 1169, 1189, 1210, 1224, 1234, 1254, 1275, 1292, 1310, 1327, 1341, 1351, 1360, 1370, 1386, 1396, 1406, 1419, 1429, 1441, 1450, 1462, 1470} func (i TokenName) String() string { if i < 0 || i >= TokenName(len(_TokenName_index)-1) { diff --git a/php5/php5.go b/php5/php5.go index a702c3e..a2c5512 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -6594,7 +6594,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.YieldToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6651,7 +6651,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.YieldToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6665,7 +6665,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.YieldToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6679,7 +6679,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[4].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.YieldToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -6694,7 +6694,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[4].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.YieldToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) diff --git a/php5/php5.y b/php5/php5.y index d1fb950..59ce705 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -4225,7 +4225,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.YieldToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4279,7 +4279,7 @@ yield_expr: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.YieldToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4291,7 +4291,7 @@ yield_expr: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.YieldToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4303,7 +4303,7 @@ yield_expr: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $4)) // save comments - $1.Meta.SetTokenName(meta.YieldToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $3.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -4316,7 +4316,7 @@ yield_expr: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $4)) // save comments - $1.Meta.SetTokenName(meta.YieldToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $3.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) diff --git a/php7/php7.go b/php7/php7.go index 3009a87..ce518fa 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -6511,7 +6511,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.YieldToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6525,7 +6525,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.YieldToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6539,7 +6539,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[4].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.YieldToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) diff --git a/php7/php7.y b/php7/php7.y index 79d3a98..54a9a73 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -3948,7 +3948,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.YieldToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3960,7 +3960,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.YieldToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3972,7 +3972,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $4)) // save comments - $1.Meta.SetTokenName(meta.YieldToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $3.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) diff --git a/printer/printer.go b/printer/printer.go index 29c59af..c822060 100644 --- a/printer/printer.go +++ b/printer/printer.go @@ -1670,7 +1670,6 @@ func (p *Printer) printExprYield(n node.Node) { nn := n.(*expr.Yield) p.printMeta(nn, meta.NodeStart) - p.printMeta(nn, meta.YieldToken) io.WriteString(p.w, "yield") if nn.Key != nil { diff --git a/printer/printer_test.go b/printer/printer_test.go index b39ece8..cdd4977 100644 --- a/printer/printer_test.go +++ b/printer/printer_test.go @@ -4683,7 +4683,7 @@ func TestPrinterPrintYield(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.YieldToken, + TokenName: meta.NodeStart, }, }, Value: &expr.Variable{ @@ -4715,7 +4715,7 @@ func TestPrinterPrintYieldFull(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.YieldToken, + TokenName: meta.NodeStart, }, &meta.Data{ Type: meta.WhiteSpaceType, From 35e66d35d5b0ef97862f6346aba2ae1485cd2252 Mon Sep 17 00:00:00 2001 From: z7zmey Date: Mon, 29 Oct 2018 12:50:48 +0200 Subject: [PATCH 063/117] remove meta.ElseifToken --- meta/tokenName.go | 1 - meta/tokenName_string.go | 4 ++-- php5/php5.go | 4 ++-- php5/php5.y | 4 ++-- php7/php7.go | 4 ++-- php7/php7.y | 4 ++-- printer/printer.go | 2 -- printer/printer_test.go | 8 ++++---- 8 files changed, 14 insertions(+), 17 deletions(-) diff --git a/meta/tokenName.go b/meta/tokenName.go index 82041e0..960cc02 100644 --- a/meta/tokenName.go +++ b/meta/tokenName.go @@ -58,7 +58,6 @@ const ( LogicalXorToken LogicalAndToken InstanceofToken - ElseifToken ElseToken EndifToken AbstractToken diff --git a/meta/tokenName_string.go b/meta/tokenName_string.go index 3c6c85b..e303c9b 100644 --- a/meta/tokenName_string.go +++ b/meta/tokenName_string.go @@ -4,9 +4,9 @@ package meta import "strconv" -const _TokenName_name = "NodeStartNodeEndIfTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenElseifTokenElseTokenEndifTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" +const _TokenName_name = "NodeStartNodeEndIfTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenElseTokenEndifTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" -var _TokenName_index = [...]uint16{0, 9, 16, 23, 41, 55, 70, 79, 86, 96, 109, 130, 151, 159, 170, 182, 197, 209, 224, 231, 242, 256, 265, 277, 287, 300, 309, 322, 332, 343, 351, 361, 373, 383, 397, 408, 416, 426, 436, 446, 460, 472, 487, 503, 516, 530, 554, 580, 596, 609, 623, 638, 653, 668, 679, 688, 698, 711, 721, 733, 747, 758, 766, 774, 793, 806, 820, 834, 849, 862, 875, 888, 904, 917, 930, 942, 955, 967, 979, 993, 1008, 1016, 1023, 1030, 1046, 1065, 1077, 1092, 1113, 1134, 1151, 1169, 1189, 1210, 1224, 1234, 1254, 1275, 1292, 1310, 1327, 1341, 1351, 1360, 1370, 1386, 1396, 1406, 1419, 1429, 1441, 1450, 1462, 1470} +var _TokenName_index = [...]uint16{0, 9, 16, 23, 41, 55, 70, 79, 86, 96, 109, 130, 151, 159, 170, 182, 197, 209, 224, 231, 242, 256, 265, 277, 287, 300, 309, 322, 332, 343, 351, 361, 373, 383, 397, 408, 416, 426, 436, 446, 460, 472, 487, 503, 516, 530, 554, 580, 596, 609, 623, 638, 653, 668, 677, 687, 700, 710, 722, 736, 747, 755, 763, 782, 795, 809, 823, 838, 851, 864, 877, 893, 906, 919, 931, 944, 956, 968, 982, 997, 1005, 1012, 1019, 1035, 1054, 1066, 1081, 1102, 1123, 1140, 1158, 1178, 1199, 1213, 1223, 1243, 1264, 1281, 1299, 1316, 1330, 1340, 1349, 1359, 1375, 1385, 1395, 1408, 1418, 1430, 1439, 1451, 1459} func (i TokenName) String() string { if i < 0 || i >= TokenName(len(_TokenName_index)-1) { diff --git a/php5/php5.go b/php5/php5.go index a2c5512..b8c7199 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -4285,7 +4285,7 @@ yydefault: _elseIf.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[2].token, yyDollar[4].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.ElseifToken).AppendTo(_elseIf.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(_elseIf.GetMeta()) yyDollar[3].node.GetMeta().Cut(meta.TokenNameFilter(meta.OpenParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo(_elseIf.GetMeta()) yyDollar[3].node.GetMeta().Cut(meta.TokenNameFilter(meta.CloseParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo(_elseIf.GetMeta()) @@ -4312,7 +4312,7 @@ yydefault: _elseIf.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[5].list)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.ElseifToken).AppendTo(_elseIf.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(_elseIf.GetMeta()) yyDollar[3].node.GetMeta().Cut(meta.TokenNameFilter(meta.OpenParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo(_elseIf.GetMeta()) yyDollar[3].node.GetMeta().Cut(meta.TokenNameFilter(meta.CloseParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo(_elseIf.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.ColonToken).AppendTo(_elseIf.GetMeta()) diff --git a/php5/php5.y b/php5/php5.y index 59ce705..de045fb 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -2112,7 +2112,7 @@ elseif_list: _elseIf.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $4)) // save comments - $2.Meta.SetTokenName(meta.ElseifToken).AppendTo(_elseIf.GetMeta()) + $2.Meta.SetTokenName(meta.NodeStart).AppendTo(_elseIf.GetMeta()) $3.GetMeta().Cut(meta.TokenNameFilter(meta.OpenParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo(_elseIf.GetMeta()) $3.GetMeta().Cut(meta.TokenNameFilter(meta.CloseParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo(_elseIf.GetMeta()) @@ -2139,7 +2139,7 @@ new_elseif_list: _elseIf.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $5)) // save comments - $2.Meta.SetTokenName(meta.ElseifToken).AppendTo(_elseIf.GetMeta()) + $2.Meta.SetTokenName(meta.NodeStart).AppendTo(_elseIf.GetMeta()) $3.GetMeta().Cut(meta.TokenNameFilter(meta.OpenParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo(_elseIf.GetMeta()) $3.GetMeta().Cut(meta.TokenNameFilter(meta.CloseParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo(_elseIf.GetMeta()) $4.Meta.SetTokenName(meta.ColonToken).AppendTo(_elseIf.GetMeta()) diff --git a/php7/php7.go b/php7/php7.go index ce518fa..9152d0c 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -4338,7 +4338,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[6].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.ElseifToken).AppendTo(_elseIf.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(_elseIf.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(_elseIf.GetMeta()) yyDollar[5].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(_elseIf.GetMeta()) @@ -4400,7 +4400,7 @@ yydefault: _elseIf.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[7].list)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.ElseifToken).AppendTo(_elseIf.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(_elseIf.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(_elseIf.GetMeta()) yyDollar[5].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(_elseIf.GetMeta()) yyDollar[6].token.Meta.SetTokenName(meta.ColonToken).AppendTo(_elseIf.GetMeta()) diff --git a/php7/php7.y b/php7/php7.y index 54a9a73..a8a592c 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -1962,7 +1962,7 @@ if_stmt_without_else: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $6)) // save comments - $2.Meta.SetTokenName(meta.ElseifToken).AppendTo(_elseIf.GetMeta()) + $2.Meta.SetTokenName(meta.NodeStart).AppendTo(_elseIf.GetMeta()) $3.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(_elseIf.GetMeta()) $5.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(_elseIf.GetMeta()) @@ -2022,7 +2022,7 @@ alt_if_stmt_without_else: _elseIf.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $7)) // save comments - $2.Meta.SetTokenName(meta.ElseifToken).AppendTo(_elseIf.GetMeta()) + $2.Meta.SetTokenName(meta.NodeStart).AppendTo(_elseIf.GetMeta()) $3.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(_elseIf.GetMeta()) $5.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(_elseIf.GetMeta()) $6.Meta.SetTokenName(meta.ColonToken).AppendTo(_elseIf.GetMeta()) diff --git a/printer/printer.go b/printer/printer.go index c822060..0fe4915 100644 --- a/printer/printer.go +++ b/printer/printer.go @@ -1689,7 +1689,6 @@ func (p *Printer) printStmtAltElseIf(n node.Node) { nn := n.(*stmt.AltElseIf) p.printMeta(nn, meta.NodeStart) - p.printMeta(nn, meta.ElseifToken) io.WriteString(p.w, "elseif") p.printMeta(nn, meta.OpenParenthesisToken) io.WriteString(p.w, "(") @@ -2145,7 +2144,6 @@ func (p *Printer) printStmtElseif(n node.Node) { nn := n.(*stmt.ElseIf) p.printMeta(nn, meta.NodeStart) - p.printMeta(nn, meta.ElseifToken) io.WriteString(p.w, "elseif") p.printMeta(nn, meta.OpenParenthesisToken) io.WriteString(p.w, "(") diff --git a/printer/printer_test.go b/printer/printer_test.go index cdd4977..fde9c6e 100644 --- a/printer/printer_test.go +++ b/printer/printer_test.go @@ -4764,7 +4764,7 @@ func TestPrinterPrintAltElseIf(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.ElseifToken, + TokenName: meta.NodeStart, }, &meta.Data{ Type: meta.WhiteSpaceType, @@ -4825,7 +4825,7 @@ func TestPrinterPrintAltElseIfEmpty(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.ElseifToken, + TokenName: meta.NodeStart, }, &meta.Data{ Type: meta.WhiteSpaceType, @@ -6507,7 +6507,7 @@ func TestPrinterPrintStmtElseIfStmts(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.ElseifToken, + TokenName: meta.NodeStart, }, &meta.Data{ Type: meta.WhiteSpaceType, @@ -6554,7 +6554,7 @@ func TestPrinterPrintStmtElseIfExpr(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.ElseifToken, + TokenName: meta.NodeStart, }, &meta.Data{ Type: meta.WhiteSpaceType, From a1e96dbbf21f1c943b4cfc7dbb0314ed18aa4429 Mon Sep 17 00:00:00 2001 From: z7zmey Date: Mon, 29 Oct 2018 12:52:27 +0200 Subject: [PATCH 064/117] remove meta.ElseToken --- meta/tokenName.go | 1 - meta/tokenName_string.go | 4 ++-- php5/php5.go | 4 ++-- php5/php5.y | 4 ++-- php7/php7.go | 4 ++-- php7/php7.y | 4 ++-- printer/printer.go | 2 -- printer/printer_test.go | 8 ++++---- 8 files changed, 14 insertions(+), 17 deletions(-) diff --git a/meta/tokenName.go b/meta/tokenName.go index 960cc02..83f89ae 100644 --- a/meta/tokenName.go +++ b/meta/tokenName.go @@ -58,7 +58,6 @@ const ( LogicalXorToken LogicalAndToken InstanceofToken - ElseToken EndifToken AbstractToken FinalToken diff --git a/meta/tokenName_string.go b/meta/tokenName_string.go index e303c9b..b194cdc 100644 --- a/meta/tokenName_string.go +++ b/meta/tokenName_string.go @@ -4,9 +4,9 @@ package meta import "strconv" -const _TokenName_name = "NodeStartNodeEndIfTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenElseTokenEndifTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" +const _TokenName_name = "NodeStartNodeEndIfTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenEndifTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" -var _TokenName_index = [...]uint16{0, 9, 16, 23, 41, 55, 70, 79, 86, 96, 109, 130, 151, 159, 170, 182, 197, 209, 224, 231, 242, 256, 265, 277, 287, 300, 309, 322, 332, 343, 351, 361, 373, 383, 397, 408, 416, 426, 436, 446, 460, 472, 487, 503, 516, 530, 554, 580, 596, 609, 623, 638, 653, 668, 677, 687, 700, 710, 722, 736, 747, 755, 763, 782, 795, 809, 823, 838, 851, 864, 877, 893, 906, 919, 931, 944, 956, 968, 982, 997, 1005, 1012, 1019, 1035, 1054, 1066, 1081, 1102, 1123, 1140, 1158, 1178, 1199, 1213, 1223, 1243, 1264, 1281, 1299, 1316, 1330, 1340, 1349, 1359, 1375, 1385, 1395, 1408, 1418, 1430, 1439, 1451, 1459} +var _TokenName_index = [...]uint16{0, 9, 16, 23, 41, 55, 70, 79, 86, 96, 109, 130, 151, 159, 170, 182, 197, 209, 224, 231, 242, 256, 265, 277, 287, 300, 309, 322, 332, 343, 351, 361, 373, 383, 397, 408, 416, 426, 436, 446, 460, 472, 487, 503, 516, 530, 554, 580, 596, 609, 623, 638, 653, 668, 678, 691, 701, 713, 727, 738, 746, 754, 773, 786, 800, 814, 829, 842, 855, 868, 884, 897, 910, 922, 935, 947, 959, 973, 988, 996, 1003, 1010, 1026, 1045, 1057, 1072, 1093, 1114, 1131, 1149, 1169, 1190, 1204, 1214, 1234, 1255, 1272, 1290, 1307, 1321, 1331, 1340, 1350, 1366, 1376, 1386, 1399, 1409, 1421, 1430, 1442, 1450} func (i TokenName) String() string { if i < 0 || i >= TokenName(len(_TokenName_index)-1) { diff --git a/php5/php5.go b/php5/php5.go index b8c7199..746091a 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -4337,7 +4337,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.ElseToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4361,7 +4361,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.ElseToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.ColonToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) diff --git a/php5/php5.y b/php5/php5.y index de045fb..7841cc3 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -2164,7 +2164,7 @@ else_single: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.ElseToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2188,7 +2188,7 @@ new_else_single: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.ElseToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $2.Meta.SetTokenName(meta.ColonToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) diff --git a/php7/php7.go b/php7/php7.go index 9152d0c..c69e293 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -4364,7 +4364,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.ElseToken).AppendTo(_else.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(_else.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4437,7 +4437,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[6].token)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.ElseToken).AppendTo(_else.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(_else.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.ColonToken).AppendTo(_else.GetMeta()) yyDollar[5].token.Meta.SetTokenName(meta.EndifToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[6].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) diff --git a/php7/php7.y b/php7/php7.y index a8a592c..8b89f7a 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -1987,7 +1987,7 @@ if_stmt: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.ElseToken).AppendTo(_else.GetMeta()) + $2.Meta.SetTokenName(meta.NodeStart).AppendTo(_else.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2058,7 +2058,7 @@ alt_if_stmt: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $6)) // save comments - $2.Meta.SetTokenName(meta.ElseToken).AppendTo(_else.GetMeta()) + $2.Meta.SetTokenName(meta.NodeStart).AppendTo(_else.GetMeta()) $3.Meta.SetTokenName(meta.ColonToken).AppendTo(_else.GetMeta()) $5.Meta.SetTokenName(meta.EndifToken).AppendTo($$.GetMeta()) $6.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) diff --git a/printer/printer.go b/printer/printer.go index 0fe4915..241e5e6 100644 --- a/printer/printer.go +++ b/printer/printer.go @@ -1709,7 +1709,6 @@ func (p *Printer) printStmtAltElse(n node.Node) { nn := n.(*stmt.AltElse) p.printMeta(nn, meta.NodeStart) - p.printMeta(nn, meta.ElseToken) io.WriteString(p.w, "else") p.printMeta(nn, meta.ColonToken) io.WriteString(p.w, ":") @@ -2160,7 +2159,6 @@ func (p *Printer) printStmtElse(n node.Node) { nn := n.(*stmt.Else) p.printMeta(nn, meta.NodeStart) - p.printMeta(nn, meta.ElseToken) io.WriteString(p.w, "else") p.Print(nn.Stmt) diff --git a/printer/printer_test.go b/printer/printer_test.go index fde9c6e..ea5bd62 100644 --- a/printer/printer_test.go +++ b/printer/printer_test.go @@ -4873,7 +4873,7 @@ func TestPrinterPrintAltElse(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.ElseToken, + TokenName: meta.NodeStart, }, &meta.Data{ Type: meta.WhiteSpaceType, @@ -4914,7 +4914,7 @@ func TestPrinterPrintAltElseEmpty(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.ElseToken, + TokenName: meta.NodeStart, }, &meta.Data{ Type: meta.WhiteSpaceType, @@ -6623,7 +6623,7 @@ func TestPrinterPrintStmtElseStmts(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.ElseToken, + TokenName: meta.NodeStart, }, }, Stmt: &stmt.StmtList{ @@ -6650,7 +6650,7 @@ func TestPrinterPrintStmtElseExpr(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.ElseToken, + TokenName: meta.NodeStart, }, }, Stmt: &stmt.Expression{Expr: &scalar.String{Value: "'bar'"}}, From 5d4b592a8b40a77aeb5cc20e9956d379fed8a90b Mon Sep 17 00:00:00 2001 From: z7zmey Date: Mon, 29 Oct 2018 12:54:59 +0200 Subject: [PATCH 065/117] remove meta.ForToken --- meta/tokenName.go | 1 - meta/tokenName_string.go | 4 ++-- php5/php5.go | 2 +- php5/php5.y | 2 +- php7/php7.go | 2 +- php7/php7.y | 2 +- printer/printer.go | 2 -- printer/printer_test.go | 4 ++-- 8 files changed, 8 insertions(+), 11 deletions(-) diff --git a/meta/tokenName.go b/meta/tokenName.go index 83f89ae..4c57ec8 100644 --- a/meta/tokenName.go +++ b/meta/tokenName.go @@ -17,7 +17,6 @@ const ( EndwhileToken ForInitSemicolonToken ForCondSemicolonToken - ForToken EndforToken ForeachToken EndforeachToken diff --git a/meta/tokenName_string.go b/meta/tokenName_string.go index b194cdc..dd4fe96 100644 --- a/meta/tokenName_string.go +++ b/meta/tokenName_string.go @@ -4,9 +4,9 @@ package meta import "strconv" -const _TokenName_name = "NodeStartNodeEndIfTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenEndifTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" +const _TokenName_name = "NodeStartNodeEndIfTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenEndifTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" -var _TokenName_index = [...]uint16{0, 9, 16, 23, 41, 55, 70, 79, 86, 96, 109, 130, 151, 159, 170, 182, 197, 209, 224, 231, 242, 256, 265, 277, 287, 300, 309, 322, 332, 343, 351, 361, 373, 383, 397, 408, 416, 426, 436, 446, 460, 472, 487, 503, 516, 530, 554, 580, 596, 609, 623, 638, 653, 668, 678, 691, 701, 713, 727, 738, 746, 754, 773, 786, 800, 814, 829, 842, 855, 868, 884, 897, 910, 922, 935, 947, 959, 973, 988, 996, 1003, 1010, 1026, 1045, 1057, 1072, 1093, 1114, 1131, 1149, 1169, 1190, 1204, 1214, 1234, 1255, 1272, 1290, 1307, 1321, 1331, 1340, 1350, 1366, 1376, 1386, 1399, 1409, 1421, 1430, 1442, 1450} +var _TokenName_index = [...]uint16{0, 9, 16, 23, 41, 55, 70, 79, 86, 96, 109, 130, 151, 162, 174, 189, 201, 216, 223, 234, 248, 257, 269, 279, 292, 301, 314, 324, 335, 343, 353, 365, 375, 389, 400, 408, 418, 428, 438, 452, 464, 479, 495, 508, 522, 546, 572, 588, 601, 615, 630, 645, 660, 670, 683, 693, 705, 719, 730, 738, 746, 765, 778, 792, 806, 821, 834, 847, 860, 876, 889, 902, 914, 927, 939, 951, 965, 980, 988, 995, 1002, 1018, 1037, 1049, 1064, 1085, 1106, 1123, 1141, 1161, 1182, 1196, 1206, 1226, 1247, 1264, 1282, 1299, 1313, 1323, 1332, 1342, 1358, 1368, 1378, 1391, 1401, 1413, 1422, 1434, 1442} func (i TokenName) String() string { if i < 0 || i >= TokenName(len(_TokenName_index)-1) { diff --git a/php5/php5.go b/php5/php5.go index 746091a..48cc6f0 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -3088,7 +3088,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[9].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.ForToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.ForInitSemicolonToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[6].token.Meta.SetTokenName(meta.ForCondSemicolonToken).AppendTo(yyVAL.node.GetMeta()) diff --git a/php5/php5.y b/php5/php5.y index 7841cc3..73c73ef 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -980,7 +980,7 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $9)) // save comments - $1.Meta.SetTokenName(meta.ForToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) $4.Meta.SetTokenName(meta.ForInitSemicolonToken).AppendTo($$.GetMeta()) $6.Meta.SetTokenName(meta.ForCondSemicolonToken).AppendTo($$.GetMeta()) diff --git a/php7/php7.go b/php7/php7.go index c69e293..c8d0450 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -3330,7 +3330,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[9].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.ForToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.ForInitSemicolonToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[6].token.Meta.SetTokenName(meta.ForCondSemicolonToken).AppendTo(yyVAL.node.GetMeta()) diff --git a/php7/php7.y b/php7/php7.y index 8b89f7a..ef5e09e 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -1018,7 +1018,7 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $9)) // save comments - $1.Meta.SetTokenName(meta.ForToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) $4.Meta.SetTokenName(meta.ForInitSemicolonToken).AppendTo($$.GetMeta()) $6.Meta.SetTokenName(meta.ForCondSemicolonToken).AppendTo($$.GetMeta()) diff --git a/printer/printer.go b/printer/printer.go index 241e5e6..a3f91f4 100644 --- a/printer/printer.go +++ b/printer/printer.go @@ -1724,7 +1724,6 @@ func (p *Printer) printStmtAltFor(n node.Node) { nn := n.(*stmt.AltFor) p.printMeta(nn, meta.NodeStart) - p.printMeta(nn, meta.ForToken) io.WriteString(p.w, "for") p.printMeta(nn, meta.OpenParenthesisToken) io.WriteString(p.w, "(") @@ -2196,7 +2195,6 @@ func (p *Printer) printStmtFor(n node.Node) { nn := n.(*stmt.For) p.printMeta(nn, meta.NodeStart) - p.printMeta(nn, meta.ForToken) io.WriteString(p.w, "for") p.printMeta(nn, meta.OpenParenthesisToken) io.WriteString(p.w, "(") diff --git a/printer/printer_test.go b/printer/printer_test.go index ea5bd62..5cd813e 100644 --- a/printer/printer_test.go +++ b/printer/printer_test.go @@ -4942,7 +4942,7 @@ func TestPrinterPrintAltFor(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.ForToken, + TokenName: meta.NodeStart, }, &meta.Data{ Type: meta.WhiteSpaceType, @@ -6761,7 +6761,7 @@ func TestPrinterPrintStmtFor(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.ForToken, + TokenName: meta.NodeStart, }, &meta.Data{ Type: meta.WhiteSpaceType, From 1c7b4cf3986752b2220554f984ed9f8afcc3bcc1 Mon Sep 17 00:00:00 2001 From: z7zmey Date: Mon, 29 Oct 2018 12:57:15 +0200 Subject: [PATCH 066/117] remove meta.ForeachToken --- meta/tokenName.go | 1 - meta/tokenName_string.go | 4 ++-- php5/php5.go | 4 ++-- php5/php5.y | 4 ++-- php7/php7.go | 4 ++-- php7/php7.y | 4 ++-- printer/printer.go | 2 -- printer/printer_test.go | 4 ++-- 8 files changed, 12 insertions(+), 15 deletions(-) diff --git a/meta/tokenName.go b/meta/tokenName.go index 4c57ec8..432265b 100644 --- a/meta/tokenName.go +++ b/meta/tokenName.go @@ -18,7 +18,6 @@ const ( ForInitSemicolonToken ForCondSemicolonToken EndforToken - ForeachToken EndforeachToken DeclareToken EnddeclareToken diff --git a/meta/tokenName_string.go b/meta/tokenName_string.go index dd4fe96..d624083 100644 --- a/meta/tokenName_string.go +++ b/meta/tokenName_string.go @@ -4,9 +4,9 @@ package meta import "strconv" -const _TokenName_name = "NodeStartNodeEndIfTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenEndifTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" +const _TokenName_name = "NodeStartNodeEndIfTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenEndforTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenEndifTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" -var _TokenName_index = [...]uint16{0, 9, 16, 23, 41, 55, 70, 79, 86, 96, 109, 130, 151, 162, 174, 189, 201, 216, 223, 234, 248, 257, 269, 279, 292, 301, 314, 324, 335, 343, 353, 365, 375, 389, 400, 408, 418, 428, 438, 452, 464, 479, 495, 508, 522, 546, 572, 588, 601, 615, 630, 645, 660, 670, 683, 693, 705, 719, 730, 738, 746, 765, 778, 792, 806, 821, 834, 847, 860, 876, 889, 902, 914, 927, 939, 951, 965, 980, 988, 995, 1002, 1018, 1037, 1049, 1064, 1085, 1106, 1123, 1141, 1161, 1182, 1196, 1206, 1226, 1247, 1264, 1282, 1299, 1313, 1323, 1332, 1342, 1358, 1368, 1378, 1391, 1401, 1413, 1422, 1434, 1442} +var _TokenName_index = [...]uint16{0, 9, 16, 23, 41, 55, 70, 79, 86, 96, 109, 130, 151, 162, 177, 189, 204, 211, 222, 236, 245, 257, 267, 280, 289, 302, 312, 323, 331, 341, 353, 363, 377, 388, 396, 406, 416, 426, 440, 452, 467, 483, 496, 510, 534, 560, 576, 589, 603, 618, 633, 648, 658, 671, 681, 693, 707, 718, 726, 734, 753, 766, 780, 794, 809, 822, 835, 848, 864, 877, 890, 902, 915, 927, 939, 953, 968, 976, 983, 990, 1006, 1025, 1037, 1052, 1073, 1094, 1111, 1129, 1149, 1170, 1184, 1194, 1214, 1235, 1252, 1270, 1287, 1301, 1311, 1320, 1330, 1346, 1356, 1366, 1379, 1389, 1401, 1410, 1422, 1430} func (i TokenName) String() string { if i < 0 || i >= TokenName(len(_TokenName_index)-1) { diff --git a/php5/php5.go b/php5/php5.go index 48cc6f0..66e26b3 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -3376,7 +3376,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[8].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.ForeachToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.AsToken).AppendTo(yyVAL.node.GetMeta()) if yyDollar[6].node != nil { @@ -3418,7 +3418,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[8].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.ForeachToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.AsToken).AppendTo(yyVAL.node.GetMeta()) if yyDollar[6].node != nil { diff --git a/php5/php5.y b/php5/php5.y index 73c73ef..19b7ea7 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -1236,7 +1236,7 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $8)) // save comments - $1.Meta.SetTokenName(meta.ForeachToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) $4.Meta.SetTokenName(meta.AsToken).AppendTo($$.GetMeta()) if $6 != nil { @@ -1276,7 +1276,7 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $8)) // save comments - $1.Meta.SetTokenName(meta.ForeachToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) $4.Meta.SetTokenName(meta.AsToken).AppendTo($$.GetMeta()) if $6 != nil { diff --git a/php7/php7.go b/php7/php7.go index c8d0450..1bb7322 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -3530,7 +3530,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[7].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.ForeachToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.AsToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[6].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) @@ -3558,7 +3558,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[9].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.ForeachToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.AsToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[6].token.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo(yyVAL.node.GetMeta()) diff --git a/php7/php7.y b/php7/php7.y index ef5e09e..a1f302e 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -1196,7 +1196,7 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $7)) // save comments - $1.Meta.SetTokenName(meta.ForeachToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) $4.Meta.SetTokenName(meta.AsToken).AppendTo($$.GetMeta()) $6.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) @@ -1222,7 +1222,7 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $9)) // save comments - $1.Meta.SetTokenName(meta.ForeachToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) $4.Meta.SetTokenName(meta.AsToken).AppendTo($$.GetMeta()) $6.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo($$.GetMeta()) diff --git a/printer/printer.go b/printer/printer.go index a3f91f4..4076cc8 100644 --- a/printer/printer.go +++ b/printer/printer.go @@ -1753,7 +1753,6 @@ func (p *Printer) printStmtAltForeach(n node.Node) { nn := n.(*stmt.AltForeach) p.printMeta(nn, meta.NodeStart) - p.printMeta(nn, meta.ForeachToken) io.WriteString(p.w, "foreach") p.printMeta(nn, meta.OpenParenthesisToken) io.WriteString(p.w, "(") @@ -2217,7 +2216,6 @@ func (p *Printer) printStmtForeach(n node.Node) { nn := n.(*stmt.Foreach) p.printMeta(nn, meta.NodeStart) - p.printMeta(nn, meta.ForeachToken) io.WriteString(p.w, "foreach") p.printMeta(nn, meta.OpenParenthesisToken) io.WriteString(p.w, "(") diff --git a/printer/printer_test.go b/printer/printer_test.go index 5cd813e..be6c200 100644 --- a/printer/printer_test.go +++ b/printer/printer_test.go @@ -5054,7 +5054,7 @@ func TestPrinterPrintAltForeach(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.ForeachToken, + TokenName: meta.NodeStart, }, &meta.Data{ Type: meta.WhiteSpaceType, @@ -6874,7 +6874,7 @@ func TestPrinterPrintStmtForeach(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.ForeachToken, + TokenName: meta.NodeStart, }, &meta.Data{ Type: meta.WhiteSpaceType, From cb04c4a92a62833ba3c3ac30670099f29aa7d3d1 Mon Sep 17 00:00:00 2001 From: z7zmey Date: Mon, 29 Oct 2018 13:01:41 +0200 Subject: [PATCH 067/117] remove meta.SwitchToken --- meta/tokenName.go | 2 -- meta/tokenName_string.go | 4 ++-- php5/php5.go | 6 +++--- php5/php5.y | 6 +++--- php7/php7.go | 6 +++--- php7/php7.y | 6 +++--- printer/printer.go | 4 ---- printer/printer_test.go | 10 +++++----- 8 files changed, 19 insertions(+), 25 deletions(-) diff --git a/meta/tokenName.go b/meta/tokenName.go index 432265b..05c1600 100644 --- a/meta/tokenName.go +++ b/meta/tokenName.go @@ -7,7 +7,6 @@ type TokenName int const ( NodeStart TokenName = iota NodeEnd - IfToken StringVarnameToken NumStringToken InlineHTMLToken @@ -22,7 +21,6 @@ const ( DeclareToken EnddeclareToken AsToken - SwitchToken EndswitchToken CaseToken DefaultToken diff --git a/meta/tokenName_string.go b/meta/tokenName_string.go index d624083..946cffa 100644 --- a/meta/tokenName_string.go +++ b/meta/tokenName_string.go @@ -4,9 +4,9 @@ package meta import "strconv" -const _TokenName_name = "NodeStartNodeEndIfTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenEndforTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenEndifTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" +const _TokenName_name = "NodeStartNodeEndStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenEndforTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenEndifTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" -var _TokenName_index = [...]uint16{0, 9, 16, 23, 41, 55, 70, 79, 86, 96, 109, 130, 151, 162, 177, 189, 204, 211, 222, 236, 245, 257, 267, 280, 289, 302, 312, 323, 331, 341, 353, 363, 377, 388, 396, 406, 416, 426, 440, 452, 467, 483, 496, 510, 534, 560, 576, 589, 603, 618, 633, 648, 658, 671, 681, 693, 707, 718, 726, 734, 753, 766, 780, 794, 809, 822, 835, 848, 864, 877, 890, 902, 915, 927, 939, 953, 968, 976, 983, 990, 1006, 1025, 1037, 1052, 1073, 1094, 1111, 1129, 1149, 1170, 1184, 1194, 1214, 1235, 1252, 1270, 1287, 1301, 1311, 1320, 1330, 1346, 1356, 1366, 1379, 1389, 1401, 1410, 1422, 1430} +var _TokenName_index = [...]uint16{0, 9, 16, 34, 48, 63, 72, 79, 89, 102, 123, 144, 155, 170, 182, 197, 204, 218, 227, 239, 249, 262, 271, 284, 294, 305, 313, 323, 335, 345, 359, 370, 378, 388, 398, 408, 422, 434, 449, 465, 478, 492, 516, 542, 558, 571, 585, 600, 615, 630, 640, 653, 663, 675, 689, 700, 708, 716, 735, 748, 762, 776, 791, 804, 817, 830, 846, 859, 872, 884, 897, 909, 921, 935, 950, 958, 965, 972, 988, 1007, 1019, 1034, 1055, 1076, 1093, 1111, 1131, 1152, 1166, 1176, 1196, 1217, 1234, 1252, 1269, 1283, 1293, 1302, 1312, 1328, 1338, 1348, 1361, 1371, 1383, 1392, 1404, 1412} func (i TokenName) String() string { if i < 0 || i >= TokenName(len(_TokenName_index)-1) { diff --git a/php5/php5.go b/php5/php5.go index 66e26b3..0faa207 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -2997,7 +2997,7 @@ yydefault: } // save comments - yyDollar[1].token.Meta.SetTokenName(meta.IfToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[2].node.GetMeta().Cut(meta.TokenNameFilter(meta.OpenParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo(yyVAL.node.GetMeta()) yyDollar[2].node.GetMeta().Cut(meta.TokenNameFilter(meta.CloseParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo(yyVAL.node.GetMeta()) @@ -3015,7 +3015,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[8].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.IfToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[2].node.GetMeta().Cut(meta.TokenNameFilter(meta.OpenParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo(yyVAL.node.GetMeta()) yyDollar[2].node.GetMeta().Cut(meta.TokenNameFilter(meta.CloseParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo(yyVAL.node.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.ColonToken).AppendTo(yyVAL.node.GetMeta()) @@ -3115,7 +3115,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.SwitchToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[2].node.GetMeta().Cut(meta.TokenNameFilter(meta.OpenParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo(yyVAL.node.GetMeta()) yyDollar[2].node.GetMeta().Cut(meta.TokenNameFilter(meta.CloseParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo(yyVAL.node.GetMeta()) diff --git a/php5/php5.y b/php5/php5.y index 19b7ea7..ae1bd83 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -897,7 +897,7 @@ unticked_statement: } // save comments - $1.Meta.SetTokenName(meta.IfToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $2.GetMeta().Cut(meta.TokenNameFilter(meta.OpenParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo($$.GetMeta()) $2.GetMeta().Cut(meta.TokenNameFilter(meta.CloseParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo($$.GetMeta()) @@ -913,7 +913,7 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $8)) // save comments - $1.Meta.SetTokenName(meta.IfToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $2.GetMeta().Cut(meta.TokenNameFilter(meta.OpenParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo($$.GetMeta()) $2.GetMeta().Cut(meta.TokenNameFilter(meta.CloseParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo($$.GetMeta()) $3.Meta.SetTokenName(meta.ColonToken).AppendTo($$.GetMeta()) @@ -1005,7 +1005,7 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.SwitchToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $2.GetMeta().Cut(meta.TokenNameFilter(meta.OpenParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo($$.GetMeta()) $2.GetMeta().Cut(meta.TokenNameFilter(meta.CloseParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo($$.GetMeta()) diff --git a/php7/php7.go b/php7/php7.go index 1bb7322..75cbd05 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -3357,7 +3357,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[5].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.SwitchToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) @@ -4320,7 +4320,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[5].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.IfToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) @@ -4380,7 +4380,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[6].list)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.IfToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[5].token.Meta.SetTokenName(meta.ColonToken).AppendTo(yyVAL.node.GetMeta()) diff --git a/php7/php7.y b/php7/php7.y index a1f302e..4f87780 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -1043,7 +1043,7 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5)) // save comments - $1.Meta.SetTokenName(meta.SwitchToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) $4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) @@ -1946,7 +1946,7 @@ if_stmt_without_else: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5)) // save comments - $1.Meta.SetTokenName(meta.IfToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) $4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) @@ -2004,7 +2004,7 @@ alt_if_stmt_without_else: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $6)) // save comments - $1.Meta.SetTokenName(meta.IfToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) $4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) $5.Meta.SetTokenName(meta.ColonToken).AppendTo($$.GetMeta()) diff --git a/printer/printer.go b/printer/printer.go index 4076cc8..ba4310f 100644 --- a/printer/printer.go +++ b/printer/printer.go @@ -1787,7 +1787,6 @@ func (p *Printer) printStmtAltIf(n node.Node) { nn := n.(*stmt.AltIf) p.printMeta(nn, meta.NodeStart) - p.printMeta(nn, meta.IfToken) io.WriteString(p.w, "if") p.printMeta(nn, meta.OpenParenthesisToken) io.WriteString(p.w, "(") @@ -1819,7 +1818,6 @@ func (p *Printer) printStmtAltSwitch(n node.Node) { nn := n.(*stmt.AltSwitch) p.printMeta(nn, meta.NodeStart) - p.printMeta(nn, meta.SwitchToken) io.WriteString(p.w, "switch") p.printMeta(nn, meta.OpenParenthesisToken) io.WriteString(p.w, "(") @@ -2341,7 +2339,6 @@ func (p *Printer) printStmtIf(n node.Node) { nn := n.(*stmt.If) p.printMeta(nn, meta.NodeStart) - p.printMeta(n, meta.IfToken) io.WriteString(p.w, "if") p.printMeta(n, meta.OpenParenthesisToken) io.WriteString(p.w, "(") @@ -2519,7 +2516,6 @@ func (p *Printer) printStmtSwitch(n node.Node) { nn := n.(*stmt.Switch) p.printMeta(nn, meta.NodeStart) - p.printMeta(nn, meta.SwitchToken) io.WriteString(p.w, "switch") p.printMeta(nn, meta.OpenParenthesisToken) io.WriteString(p.w, "(") diff --git a/printer/printer_test.go b/printer/printer_test.go index be6c200..52bdd87 100644 --- a/printer/printer_test.go +++ b/printer/printer_test.go @@ -5160,7 +5160,7 @@ func TestPrinterPrintAltIf(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.IfToken, + TokenName: meta.NodeStart, }, &meta.Data{ Type: meta.WhiteSpaceType, @@ -5293,7 +5293,7 @@ func TestPrinterPrintStmtAltSwitch(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.SwitchToken, + TokenName: meta.NodeStart, }, &meta.Data{ Type: meta.WhiteSpaceType, @@ -7216,7 +7216,7 @@ func TestPrinterPrintIfExpression(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.IfToken, + TokenName: meta.NodeStart, }, &meta.Data{ Type: meta.WhiteSpaceType, @@ -7327,7 +7327,7 @@ func TestPrinterPrintIfStmtList(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.IfToken, + TokenName: meta.NodeStart, }, &meta.Data{ Type: meta.WhiteSpaceType, @@ -7954,7 +7954,7 @@ func TestPrinterPrintStmtSwitch(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.SwitchToken, + TokenName: meta.NodeStart, }, &meta.Data{ Type: meta.WhiteSpaceType, From e19956b3034d0d6424a1e4d67a09df64d0a0a84f Mon Sep 17 00:00:00 2001 From: z7zmey Date: Mon, 29 Oct 2018 13:04:44 +0200 Subject: [PATCH 068/117] replace meta.WhileToken --- php5/php5.go | 2 +- php5/php5.y | 2 +- php7/php7.go | 2 +- php7/php7.y | 2 +- printer/printer.go | 2 -- printer/printer_test.go | 4 ++-- 6 files changed, 6 insertions(+), 8 deletions(-) diff --git a/php5/php5.go b/php5/php5.go index 0faa207..e83a22b 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -3042,7 +3042,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.WhileToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[2].node.GetMeta().Cut(meta.TokenNameFilter(meta.OpenParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo(yyVAL.node.GetMeta()) yyDollar[2].node.GetMeta().Cut(meta.TokenNameFilter(meta.CloseParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo(yyVAL.node.GetMeta()) diff --git a/php5/php5.y b/php5/php5.y index ae1bd83..1e9f167 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -938,7 +938,7 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.WhileToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $2.GetMeta().Cut(meta.TokenNameFilter(meta.OpenParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo($$.GetMeta()) $2.GetMeta().Cut(meta.TokenNameFilter(meta.CloseParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo($$.GetMeta()) diff --git a/php7/php7.go b/php7/php7.go index 75cbd05..cb2ac98 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -3284,7 +3284,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[5].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.WhileToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) diff --git a/php7/php7.y b/php7/php7.y index 4f87780..c65eee4 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -976,7 +976,7 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5)) // save comments - $1.Meta.SetTokenName(meta.WhileToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) $4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) diff --git a/printer/printer.go b/printer/printer.go index ba4310f..a1b07bb 100644 --- a/printer/printer.go +++ b/printer/printer.go @@ -1842,7 +1842,6 @@ func (p *Printer) printStmtAltWhile(n node.Node) { nn := n.(*stmt.AltWhile) p.printMeta(nn, meta.NodeStart) - p.printMeta(nn, meta.WhileToken) io.WriteString(p.w, "while") p.printMeta(nn, meta.OpenParenthesisToken) io.WriteString(p.w, "(") @@ -2712,7 +2711,6 @@ func (p *Printer) printStmtWhile(n node.Node) { nn := n.(*stmt.While) p.printMeta(nn, meta.NodeStart) - p.printMeta(nn, meta.WhileToken) io.WriteString(p.w, "while") p.printMeta(nn, meta.OpenParenthesisToken) io.WriteString(p.w, "(") diff --git a/printer/printer_test.go b/printer/printer_test.go index 52bdd87..426bd6a 100644 --- a/printer/printer_test.go +++ b/printer/printer_test.go @@ -5389,7 +5389,7 @@ func TestPrinterPrintAltWhile(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.WhileToken, + TokenName: meta.NodeStart, }, &meta.Data{ Type: meta.WhiteSpaceType, @@ -8555,7 +8555,7 @@ func TestPrinterPrintWhileStmtList(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.WhileToken, + TokenName: meta.NodeStart, }, &meta.Data{ Type: meta.WhiteSpaceType, From 72136ee853d5f47e8942488e592c34af371f0f55 Mon Sep 17 00:00:00 2001 From: z7zmey Date: Mon, 29 Oct 2018 13:06:34 +0200 Subject: [PATCH 069/117] remove meta.BreakToken --- meta/tokenName.go | 1 - meta/tokenName_string.go | 4 ++-- php5/php5.go | 4 ++-- php5/php5.y | 4 ++-- php7/php7.go | 2 +- php7/php7.y | 2 +- printer/printer.go | 1 - printer/printer_test.go | 2 +- 8 files changed, 9 insertions(+), 11 deletions(-) diff --git a/meta/tokenName.go b/meta/tokenName.go index 05c1600..f5ec9d6 100644 --- a/meta/tokenName.go +++ b/meta/tokenName.go @@ -24,7 +24,6 @@ const ( EndswitchToken CaseToken DefaultToken - BreakToken ContinueToken GotoToken FunctionToken diff --git a/meta/tokenName_string.go b/meta/tokenName_string.go index 946cffa..7351225 100644 --- a/meta/tokenName_string.go +++ b/meta/tokenName_string.go @@ -4,9 +4,9 @@ package meta import "strconv" -const _TokenName_name = "NodeStartNodeEndStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenEndforTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenEndifTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" +const _TokenName_name = "NodeStartNodeEndStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenEndforTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenEndswitchTokenCaseTokenDefaultTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenEndifTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" -var _TokenName_index = [...]uint16{0, 9, 16, 34, 48, 63, 72, 79, 89, 102, 123, 144, 155, 170, 182, 197, 204, 218, 227, 239, 249, 262, 271, 284, 294, 305, 313, 323, 335, 345, 359, 370, 378, 388, 398, 408, 422, 434, 449, 465, 478, 492, 516, 542, 558, 571, 585, 600, 615, 630, 640, 653, 663, 675, 689, 700, 708, 716, 735, 748, 762, 776, 791, 804, 817, 830, 846, 859, 872, 884, 897, 909, 921, 935, 950, 958, 965, 972, 988, 1007, 1019, 1034, 1055, 1076, 1093, 1111, 1131, 1152, 1166, 1176, 1196, 1217, 1234, 1252, 1269, 1283, 1293, 1302, 1312, 1328, 1338, 1348, 1361, 1371, 1383, 1392, 1404, 1412} +var _TokenName_index = [...]uint16{0, 9, 16, 34, 48, 63, 72, 79, 89, 102, 123, 144, 155, 170, 182, 197, 204, 218, 227, 239, 252, 261, 274, 284, 295, 303, 313, 325, 335, 349, 360, 368, 378, 388, 398, 412, 424, 439, 455, 468, 482, 506, 532, 548, 561, 575, 590, 605, 620, 630, 643, 653, 665, 679, 690, 698, 706, 725, 738, 752, 766, 781, 794, 807, 820, 836, 849, 862, 874, 887, 899, 911, 925, 940, 948, 955, 962, 978, 997, 1009, 1024, 1045, 1066, 1083, 1101, 1121, 1142, 1156, 1166, 1186, 1207, 1224, 1242, 1259, 1273, 1283, 1292, 1302, 1318, 1328, 1338, 1351, 1361, 1373, 1382, 1394, 1402} func (i TokenName) String() string { if i < 0 || i >= TokenName(len(_TokenName_index)-1) { diff --git a/php5/php5.go b/php5/php5.go index e83a22b..3319209 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -3131,7 +3131,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.BreakToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.SemiColonToken) @@ -3147,7 +3147,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.BreakToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.SemiColonToken) diff --git a/php5/php5.y b/php5/php5.y index 1e9f167..df7e58c 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -1019,7 +1019,7 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.BreakToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $2.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $2, meta.SemiColonToken) @@ -1033,7 +1033,7 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.BreakToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken) diff --git a/php7/php7.go b/php7/php7.go index cb2ac98..fc72fa6 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -3373,7 +3373,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.BreakToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.SemiColonToken) diff --git a/php7/php7.y b/php7/php7.y index c65eee4..7514767 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -1057,7 +1057,7 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.BreakToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken) diff --git a/printer/printer.go b/printer/printer.go index a1b07bb..cf24850 100644 --- a/printer/printer.go +++ b/printer/printer.go @@ -1865,7 +1865,6 @@ func (p *Printer) printStmtBreak(n node.Node) { nn := n.(*stmt.Break) p.printMeta(nn, meta.NodeStart) - p.printMeta(nn, meta.BreakToken) io.WriteString(p.w, "break") if nn.Expr != nil { p.Print(nn.Expr) diff --git a/printer/printer_test.go b/printer/printer_test.go index 426bd6a..3fd6386 100644 --- a/printer/printer_test.go +++ b/printer/printer_test.go @@ -5465,7 +5465,7 @@ func TestPrinterPrintStmtBreak(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.BreakToken, + TokenName: meta.NodeStart, }, &meta.Data{ Type: meta.WhiteSpaceType, From 2c1c25de58199aafb1579647457904519c4474fc Mon Sep 17 00:00:00 2001 From: z7zmey Date: Mon, 29 Oct 2018 13:08:09 +0200 Subject: [PATCH 070/117] remove meta.CaseToken --- meta/tokenName.go | 1 - meta/tokenName_string.go | 4 ++-- php5/php5.go | 2 +- php5/php5.y | 2 +- php7/php7.go | 2 +- php7/php7.y | 2 +- printer/printer.go | 1 - printer/printer_test.go | 4 ++-- 8 files changed, 8 insertions(+), 10 deletions(-) diff --git a/meta/tokenName.go b/meta/tokenName.go index f5ec9d6..8f4f47e 100644 --- a/meta/tokenName.go +++ b/meta/tokenName.go @@ -22,7 +22,6 @@ const ( EnddeclareToken AsToken EndswitchToken - CaseToken DefaultToken ContinueToken GotoToken diff --git a/meta/tokenName_string.go b/meta/tokenName_string.go index 7351225..c648795 100644 --- a/meta/tokenName_string.go +++ b/meta/tokenName_string.go @@ -4,9 +4,9 @@ package meta import "strconv" -const _TokenName_name = "NodeStartNodeEndStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenEndforTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenEndswitchTokenCaseTokenDefaultTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenEndifTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" +const _TokenName_name = "NodeStartNodeEndStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenEndforTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenEndswitchTokenDefaultTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenEndifTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" -var _TokenName_index = [...]uint16{0, 9, 16, 34, 48, 63, 72, 79, 89, 102, 123, 144, 155, 170, 182, 197, 204, 218, 227, 239, 252, 261, 274, 284, 295, 303, 313, 325, 335, 349, 360, 368, 378, 388, 398, 412, 424, 439, 455, 468, 482, 506, 532, 548, 561, 575, 590, 605, 620, 630, 643, 653, 665, 679, 690, 698, 706, 725, 738, 752, 766, 781, 794, 807, 820, 836, 849, 862, 874, 887, 899, 911, 925, 940, 948, 955, 962, 978, 997, 1009, 1024, 1045, 1066, 1083, 1101, 1121, 1142, 1156, 1166, 1186, 1207, 1224, 1242, 1259, 1273, 1283, 1292, 1302, 1318, 1328, 1338, 1351, 1361, 1373, 1382, 1394, 1402} +var _TokenName_index = [...]uint16{0, 9, 16, 34, 48, 63, 72, 79, 89, 102, 123, 144, 155, 170, 182, 197, 204, 218, 230, 243, 252, 265, 275, 286, 294, 304, 316, 326, 340, 351, 359, 369, 379, 389, 403, 415, 430, 446, 459, 473, 497, 523, 539, 552, 566, 581, 596, 611, 621, 634, 644, 656, 670, 681, 689, 697, 716, 729, 743, 757, 772, 785, 798, 811, 827, 840, 853, 865, 878, 890, 902, 916, 931, 939, 946, 953, 969, 988, 1000, 1015, 1036, 1057, 1074, 1092, 1112, 1133, 1147, 1157, 1177, 1198, 1215, 1233, 1250, 1264, 1274, 1283, 1293, 1309, 1319, 1329, 1342, 1352, 1364, 1373, 1385, 1393} func (i TokenName) String() string { if i < 0 || i >= TokenName(len(_TokenName_index)-1) { diff --git a/php5/php5.go b/php5/php5.go index 3319209..b4914f7 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -4201,7 +4201,7 @@ yydefault: _case.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[5].list)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.CaseToken).AppendTo(_case.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(_case.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.CaseSeparatorToken).AppendTo(_case.GetMeta()) yylex.(*Parser).appendMetaToken(_case, yyDollar[4].token, meta.CaseSeparatorToken) diff --git a/php5/php5.y b/php5/php5.y index df7e58c..9e81e5a 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -2029,7 +2029,7 @@ case_list: _case.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $5)) // save comments - $2.Meta.SetTokenName(meta.CaseToken).AppendTo(_case.GetMeta()) + $2.Meta.SetTokenName(meta.NodeStart).AppendTo(_case.GetMeta()) $4.Meta.SetTokenName(meta.CaseSeparatorToken).AppendTo(_case.GetMeta()) yylex.(*Parser).appendMetaToken(_case, $4, meta.CaseSeparatorToken) diff --git a/php7/php7.go b/php7/php7.go index fc72fa6..671d13b 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -4245,7 +4245,7 @@ yydefault: _case.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[5].list)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.CaseToken).AppendTo(_case.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(_case.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.CaseSeparatorToken).AppendTo(_case.GetMeta()) yylex.(*Parser).appendMetaToken(_case, yyDollar[4].token, meta.CaseSeparatorToken) diff --git a/php7/php7.y b/php7/php7.y index 7514767..6aa4669 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -1874,7 +1874,7 @@ case_list: _case.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $5)) // save comments - $2.Meta.SetTokenName(meta.CaseToken).AppendTo(_case.GetMeta()) + $2.Meta.SetTokenName(meta.NodeStart).AppendTo(_case.GetMeta()) $4.Meta.SetTokenName(meta.CaseSeparatorToken).AppendTo(_case.GetMeta()) yylex.(*Parser).appendMetaToken(_case, $4, meta.CaseSeparatorToken) diff --git a/printer/printer.go b/printer/printer.go index cf24850..c2df8bd 100644 --- a/printer/printer.go +++ b/printer/printer.go @@ -1879,7 +1879,6 @@ func (p *Printer) printStmtCase(n node.Node) { nn := n.(*stmt.Case) p.printMeta(nn, meta.NodeStart) - p.printMeta(nn, meta.CaseToken) io.WriteString(p.w, "case") p.Print(nn.Cond) r := p.printMeta(nn, meta.CaseSeparatorToken) diff --git a/printer/printer_test.go b/printer/printer_test.go index 3fd6386..733d63d 100644 --- a/printer/printer_test.go +++ b/printer/printer_test.go @@ -5507,7 +5507,7 @@ func TestPrinterPrintStmtCase(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.CaseToken, + TokenName: meta.NodeStart, }, }, Cond: &expr.Variable{ @@ -5551,7 +5551,7 @@ func TestPrinterPrintStmtCaseEmpty(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.CaseToken, + TokenName: meta.NodeStart, }, }, Cond: &expr.Variable{ From db3058a72f037a6b9fc956811c9cf498ad09feb4 Mon Sep 17 00:00:00 2001 From: z7zmey Date: Mon, 29 Oct 2018 13:10:41 +0200 Subject: [PATCH 071/117] remove meta.CatchToken --- meta/tokenName.go | 1 - meta/tokenName_string.go | 4 ++-- php5/php5.go | 4 ++-- php5/php5.y | 4 ++-- php7/php7.go | 2 +- php7/php7.y | 2 +- printer/printer.go | 1 - printer/printer_test.go | 2 +- 8 files changed, 9 insertions(+), 11 deletions(-) diff --git a/meta/tokenName.go b/meta/tokenName.go index 8f4f47e..f5cd48a 100644 --- a/meta/tokenName.go +++ b/meta/tokenName.go @@ -29,7 +29,6 @@ const ( ConstToken ReturnToken TryToken - CatchToken FinallyToken ThrowToken InsteadofToken diff --git a/meta/tokenName_string.go b/meta/tokenName_string.go index c648795..aa2b45c 100644 --- a/meta/tokenName_string.go +++ b/meta/tokenName_string.go @@ -4,9 +4,9 @@ package meta import "strconv" -const _TokenName_name = "NodeStartNodeEndStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenEndforTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenEndswitchTokenDefaultTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenEndifTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" +const _TokenName_name = "NodeStartNodeEndStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenEndforTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenEndswitchTokenDefaultTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenFinallyTokenThrowTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenEndifTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" -var _TokenName_index = [...]uint16{0, 9, 16, 34, 48, 63, 72, 79, 89, 102, 123, 144, 155, 170, 182, 197, 204, 218, 230, 243, 252, 265, 275, 286, 294, 304, 316, 326, 340, 351, 359, 369, 379, 389, 403, 415, 430, 446, 459, 473, 497, 523, 539, 552, 566, 581, 596, 611, 621, 634, 644, 656, 670, 681, 689, 697, 716, 729, 743, 757, 772, 785, 798, 811, 827, 840, 853, 865, 878, 890, 902, 916, 931, 939, 946, 953, 969, 988, 1000, 1015, 1036, 1057, 1074, 1092, 1112, 1133, 1147, 1157, 1177, 1198, 1215, 1233, 1250, 1264, 1274, 1283, 1293, 1309, 1319, 1329, 1342, 1352, 1364, 1373, 1385, 1393} +var _TokenName_index = [...]uint16{0, 9, 16, 34, 48, 63, 72, 79, 89, 102, 123, 144, 155, 170, 182, 197, 204, 218, 230, 243, 252, 265, 275, 286, 294, 306, 316, 330, 341, 349, 359, 369, 379, 393, 405, 420, 436, 449, 463, 487, 513, 529, 542, 556, 571, 586, 601, 611, 624, 634, 646, 660, 671, 679, 687, 706, 719, 733, 747, 762, 775, 788, 801, 817, 830, 843, 855, 868, 880, 892, 906, 921, 929, 936, 943, 959, 978, 990, 1005, 1026, 1047, 1064, 1082, 1102, 1123, 1137, 1147, 1167, 1188, 1205, 1223, 1240, 1254, 1264, 1273, 1283, 1299, 1309, 1319, 1332, 1342, 1354, 1363, 1375, 1383} func (i TokenName) String() string { if i < 0 || i >= TokenName(len(_TokenName_index)-1) { diff --git a/php5/php5.go b/php5/php5.go index b4914f7..9b655ff 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -3538,7 +3538,7 @@ yydefault: catch.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[8].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.CatchToken).AppendTo(catch.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(catch.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(catch.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) @@ -3618,7 +3618,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[8].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.CatchToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) diff --git a/php5/php5.y b/php5/php5.y index 9e81e5a..7b02cb8 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -1385,7 +1385,7 @@ catch_statement: catch.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $8)) // save comments - $1.Meta.SetTokenName(meta.CatchToken).AppendTo(catch.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo(catch.GetMeta()) $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(catch.GetMeta()) $4.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) @@ -1463,7 +1463,7 @@ additional_catch: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $8)) // save comments - $1.Meta.SetTokenName(meta.CatchToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) $4.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) diff --git a/php7/php7.go b/php7/php7.go index 671d13b..263c31d 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -3692,7 +3692,7 @@ yydefault: catch.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[2].token, yyDollar[9].token)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.CatchToken).AppendTo(catch.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(catch.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(catch.GetMeta()) yyDollar[5].token.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) diff --git a/php7/php7.y b/php7/php7.y index 6aa4669..3f1dff3 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -1342,7 +1342,7 @@ catch_list: catch.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($2, $9)) // save comments - $2.Meta.SetTokenName(meta.CatchToken).AppendTo(catch.GetMeta()) + $2.Meta.SetTokenName(meta.NodeStart).AppendTo(catch.GetMeta()) $3.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(catch.GetMeta()) $5.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) diff --git a/printer/printer.go b/printer/printer.go index c2df8bd..2a494f9 100644 --- a/printer/printer.go +++ b/printer/printer.go @@ -1897,7 +1897,6 @@ func (p *Printer) printStmtCatch(n node.Node) { nn := n.(*stmt.Catch) p.printMeta(nn, meta.NodeStart) - p.printMeta(nn, meta.CatchToken) io.WriteString(p.w, "catch") p.printMeta(nn, meta.OpenParenthesisToken) io.WriteString(p.w, "(") diff --git a/printer/printer_test.go b/printer/printer_test.go index 733d63d..619a8db 100644 --- a/printer/printer_test.go +++ b/printer/printer_test.go @@ -5584,7 +5584,7 @@ func TestPrinterPrintStmtCatch(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.CatchToken, + TokenName: meta.NodeStart, }, &meta.Data{ Type: meta.WhiteSpaceType, From d99c11c889202770bd00433e20bfbad29466da10 Mon Sep 17 00:00:00 2001 From: z7zmey Date: Mon, 29 Oct 2018 13:25:46 +0200 Subject: [PATCH 072/117] replace meta.ConstToken --- php5/php5.go | 2 +- php5/php5.y | 2 +- php7/php7.go | 2 +- php7/php7.y | 2 +- printer/printer.go | 1 - printer/printer_test.go | 2 +- 6 files changed, 5 insertions(+), 6 deletions(-) diff --git a/php5/php5.go b/php5/php5.go index 9b655ff..f326c23 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -2866,7 +2866,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, constList)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.ConstToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.EqualToken).AppendTo(constant.GetMeta()) diff --git a/php5/php5.y b/php5/php5.y index 7b02cb8..ed34ae2 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -774,7 +774,7 @@ constant_declaration: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, constList)) // save comments - $1.Meta.SetTokenName(meta.ConstToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $2.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) $3.Meta.SetTokenName(meta.EqualToken).AppendTo(constant.GetMeta()) diff --git a/php7/php7.go b/php7/php7.go index 263c31d..e3c04ef 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -2869,7 +2869,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.ConstToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.SemiColonToken) diff --git a/php7/php7.y b/php7/php7.y index 3f1dff3..9965ddc 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -590,7 +590,7 @@ top_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.ConstToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken) diff --git a/printer/printer.go b/printer/printer.go index 2a494f9..3c4a475 100644 --- a/printer/printer.go +++ b/printer/printer.go @@ -2013,7 +2013,6 @@ func (p *Printer) printStmtConstList(n node.Node) { nn := n.(*stmt.ConstList) p.printMeta(nn, meta.NodeStart) - p.printMeta(nn, meta.ConstToken) io.WriteString(p.w, "const") p.joinPrint(",", nn.Consts) diff --git a/printer/printer_test.go b/printer/printer_test.go index 619a8db..f918ff8 100644 --- a/printer/printer_test.go +++ b/printer/printer_test.go @@ -6057,7 +6057,7 @@ func TestPrinterPrintStmtConstList(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.ConstToken, + TokenName: meta.NodeStart, }, &meta.Data{ Type: meta.WhiteSpaceType, From ba387f909ad1e89370e9da2172eb25db45e2f372 Mon Sep 17 00:00:00 2001 From: z7zmey Date: Mon, 29 Oct 2018 13:27:30 +0200 Subject: [PATCH 073/117] remove meta.ContinueToken --- meta/tokenName.go | 1 - meta/tokenName_string.go | 4 ++-- php5/php5.go | 4 ++-- php5/php5.y | 4 ++-- php7/php7.go | 2 +- php7/php7.y | 2 +- printer/printer.go | 1 - printer/printer_test.go | 2 +- 8 files changed, 9 insertions(+), 11 deletions(-) diff --git a/meta/tokenName.go b/meta/tokenName.go index f5cd48a..86ac2a8 100644 --- a/meta/tokenName.go +++ b/meta/tokenName.go @@ -23,7 +23,6 @@ const ( AsToken EndswitchToken DefaultToken - ContinueToken GotoToken FunctionToken ConstToken diff --git a/meta/tokenName_string.go b/meta/tokenName_string.go index aa2b45c..6c03c4b 100644 --- a/meta/tokenName_string.go +++ b/meta/tokenName_string.go @@ -4,9 +4,9 @@ package meta import "strconv" -const _TokenName_name = "NodeStartNodeEndStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenEndforTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenEndswitchTokenDefaultTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenFinallyTokenThrowTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenEndifTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" +const _TokenName_name = "NodeStartNodeEndStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenEndforTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenEndswitchTokenDefaultTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenFinallyTokenThrowTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenEndifTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" -var _TokenName_index = [...]uint16{0, 9, 16, 34, 48, 63, 72, 79, 89, 102, 123, 144, 155, 170, 182, 197, 204, 218, 230, 243, 252, 265, 275, 286, 294, 306, 316, 330, 341, 349, 359, 369, 379, 393, 405, 420, 436, 449, 463, 487, 513, 529, 542, 556, 571, 586, 601, 611, 624, 634, 646, 660, 671, 679, 687, 706, 719, 733, 747, 762, 775, 788, 801, 817, 830, 843, 855, 868, 880, 892, 906, 921, 929, 936, 943, 959, 978, 990, 1005, 1026, 1047, 1064, 1082, 1102, 1123, 1137, 1147, 1167, 1188, 1205, 1223, 1240, 1254, 1264, 1273, 1283, 1299, 1309, 1319, 1332, 1342, 1354, 1363, 1375, 1383} +var _TokenName_index = [...]uint16{0, 9, 16, 34, 48, 63, 72, 79, 89, 102, 123, 144, 155, 170, 182, 197, 204, 218, 230, 239, 252, 262, 273, 281, 293, 303, 317, 328, 336, 346, 356, 366, 380, 392, 407, 423, 436, 450, 474, 500, 516, 529, 543, 558, 573, 588, 598, 611, 621, 633, 647, 658, 666, 674, 693, 706, 720, 734, 749, 762, 775, 788, 804, 817, 830, 842, 855, 867, 879, 893, 908, 916, 923, 930, 946, 965, 977, 992, 1013, 1034, 1051, 1069, 1089, 1110, 1124, 1134, 1154, 1175, 1192, 1210, 1227, 1241, 1251, 1260, 1270, 1286, 1296, 1306, 1319, 1329, 1341, 1350, 1362, 1370} func (i TokenName) String() string { if i < 0 || i >= TokenName(len(_TokenName_index)-1) { diff --git a/php5/php5.go b/php5/php5.go index f326c23..81da976 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -3163,7 +3163,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.ContinueToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.SemiColonToken) @@ -3179,7 +3179,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.ContinueToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.SemiColonToken) diff --git a/php5/php5.y b/php5/php5.y index ed34ae2..e042131 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -1047,7 +1047,7 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.ContinueToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $2.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $2, meta.SemiColonToken) @@ -1061,7 +1061,7 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.ContinueToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken) diff --git a/php7/php7.go b/php7/php7.go index e3c04ef..85688eb 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -3389,7 +3389,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.ContinueToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.SemiColonToken) diff --git a/php7/php7.y b/php7/php7.y index 9965ddc..6262234 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -1071,7 +1071,7 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.ContinueToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken) diff --git a/printer/printer.go b/printer/printer.go index 3c4a475..146cff2 100644 --- a/printer/printer.go +++ b/printer/printer.go @@ -2038,7 +2038,6 @@ func (p *Printer) printStmtContinue(n node.Node) { nn := n.(*stmt.Continue) p.printMeta(nn, meta.NodeStart) - p.printMeta(nn, meta.ContinueToken) io.WriteString(p.w, "continue") if nn.Expr != nil { diff --git a/printer/printer_test.go b/printer/printer_test.go index f918ff8..e7be692 100644 --- a/printer/printer_test.go +++ b/printer/printer_test.go @@ -6123,7 +6123,7 @@ func TestPrinterPrintStmtContinue(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.ContinueToken, + TokenName: meta.NodeStart, }, &meta.Data{ Type: meta.WhiteSpaceType, From bc4e070d575cff755dd16c735d320b30dfb1747d Mon Sep 17 00:00:00 2001 From: z7zmey Date: Mon, 29 Oct 2018 13:29:04 +0200 Subject: [PATCH 074/117] remove meta.DeclareToken --- meta/tokenName.go | 1 - meta/tokenName_string.go | 4 ++-- php5/php5.go | 2 +- php5/php5.y | 2 +- php7/php7.go | 2 +- php7/php7.y | 2 +- printer/printer.go | 1 - printer/printer_test.go | 4 ++-- 8 files changed, 8 insertions(+), 10 deletions(-) diff --git a/meta/tokenName.go b/meta/tokenName.go index 86ac2a8..d73a1c1 100644 --- a/meta/tokenName.go +++ b/meta/tokenName.go @@ -18,7 +18,6 @@ const ( ForCondSemicolonToken EndforToken EndforeachToken - DeclareToken EnddeclareToken AsToken EndswitchToken diff --git a/meta/tokenName_string.go b/meta/tokenName_string.go index 6c03c4b..18de816 100644 --- a/meta/tokenName_string.go +++ b/meta/tokenName_string.go @@ -4,9 +4,9 @@ package meta import "strconv" -const _TokenName_name = "NodeStartNodeEndStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenEndforTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenEndswitchTokenDefaultTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenFinallyTokenThrowTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenEndifTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" +const _TokenName_name = "NodeStartNodeEndStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenEndforTokenEndforeachTokenEnddeclareTokenAsTokenEndswitchTokenDefaultTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenFinallyTokenThrowTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenEndifTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" -var _TokenName_index = [...]uint16{0, 9, 16, 34, 48, 63, 72, 79, 89, 102, 123, 144, 155, 170, 182, 197, 204, 218, 230, 239, 252, 262, 273, 281, 293, 303, 317, 328, 336, 346, 356, 366, 380, 392, 407, 423, 436, 450, 474, 500, 516, 529, 543, 558, 573, 588, 598, 611, 621, 633, 647, 658, 666, 674, 693, 706, 720, 734, 749, 762, 775, 788, 804, 817, 830, 842, 855, 867, 879, 893, 908, 916, 923, 930, 946, 965, 977, 992, 1013, 1034, 1051, 1069, 1089, 1110, 1124, 1134, 1154, 1175, 1192, 1210, 1227, 1241, 1251, 1260, 1270, 1286, 1296, 1306, 1319, 1329, 1341, 1350, 1362, 1370} +var _TokenName_index = [...]uint16{0, 9, 16, 34, 48, 63, 72, 79, 89, 102, 123, 144, 155, 170, 185, 192, 206, 218, 227, 240, 250, 261, 269, 281, 291, 305, 316, 324, 334, 344, 354, 368, 380, 395, 411, 424, 438, 462, 488, 504, 517, 531, 546, 561, 576, 586, 599, 609, 621, 635, 646, 654, 662, 681, 694, 708, 722, 737, 750, 763, 776, 792, 805, 818, 830, 843, 855, 867, 881, 896, 904, 911, 918, 934, 953, 965, 980, 1001, 1022, 1039, 1057, 1077, 1098, 1112, 1122, 1142, 1163, 1180, 1198, 1215, 1229, 1239, 1248, 1258, 1274, 1284, 1294, 1307, 1317, 1329, 1338, 1350, 1358} func (i TokenName) String() string { if i < 0 || i >= TokenName(len(_TokenName_index)-1) { diff --git a/php5/php5.go b/php5/php5.go index 81da976..c8e4043 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -3439,7 +3439,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[5].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.DeclareToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) diff --git a/php5/php5.y b/php5/php5.y index e042131..ba3f46e 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -1295,7 +1295,7 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5)) // save comments - $1.Meta.SetTokenName(meta.DeclareToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) $4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) diff --git a/php7/php7.go b/php7/php7.go index 85688eb..0f2c05f 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -3577,7 +3577,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[5].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.DeclareToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) diff --git a/php7/php7.y b/php7/php7.y index 6262234..4e8e781 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -1239,7 +1239,7 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5)) // save comments - $1.Meta.SetTokenName(meta.DeclareToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) $4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) diff --git a/printer/printer.go b/printer/printer.go index 146cff2..eb23b09 100644 --- a/printer/printer.go +++ b/printer/printer.go @@ -2053,7 +2053,6 @@ func (p *Printer) printStmtDeclare(n node.Node) { nn := n.(*stmt.Declare) p.printMeta(nn, meta.NodeStart) - p.printMeta(nn, meta.DeclareToken) io.WriteString(p.w, "declare") p.printMeta(nn, meta.OpenParenthesisToken) io.WriteString(p.w, "(") diff --git a/printer/printer_test.go b/printer/printer_test.go index e7be692..2a5f98d 100644 --- a/printer/printer_test.go +++ b/printer/printer_test.go @@ -6165,7 +6165,7 @@ func TestPrinterPrintStmtDeclareStmts(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.DeclareToken, + TokenName: meta.NodeStart, }, &meta.Data{ Type: meta.WhiteSpaceType, @@ -6208,7 +6208,7 @@ func TestPrinterPrintStmtDeclareExpr(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.DeclareToken, + TokenName: meta.NodeStart, }, &meta.Data{ Type: meta.WhiteSpaceType, From fc20b19df31efa4974646fdf0ac9af5cef085b51 Mon Sep 17 00:00:00 2001 From: z7zmey Date: Mon, 29 Oct 2018 13:30:35 +0200 Subject: [PATCH 075/117] remove meta.DefaultToken --- meta/tokenName.go | 1 - meta/tokenName_string.go | 4 ++-- php5/php5.go | 2 +- php5/php5.y | 2 +- php7/php7.go | 2 +- php7/php7.y | 2 +- printer/printer.go | 1 - printer/printer_test.go | 4 ++-- 8 files changed, 8 insertions(+), 10 deletions(-) diff --git a/meta/tokenName.go b/meta/tokenName.go index d73a1c1..8dbb98b 100644 --- a/meta/tokenName.go +++ b/meta/tokenName.go @@ -21,7 +21,6 @@ const ( EnddeclareToken AsToken EndswitchToken - DefaultToken GotoToken FunctionToken ConstToken diff --git a/meta/tokenName_string.go b/meta/tokenName_string.go index 18de816..f4632d4 100644 --- a/meta/tokenName_string.go +++ b/meta/tokenName_string.go @@ -4,9 +4,9 @@ package meta import "strconv" -const _TokenName_name = "NodeStartNodeEndStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenEndforTokenEndforeachTokenEnddeclareTokenAsTokenEndswitchTokenDefaultTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenFinallyTokenThrowTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenEndifTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" +const _TokenName_name = "NodeStartNodeEndStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenEndforTokenEndforeachTokenEnddeclareTokenAsTokenEndswitchTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenFinallyTokenThrowTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenEndifTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" -var _TokenName_index = [...]uint16{0, 9, 16, 34, 48, 63, 72, 79, 89, 102, 123, 144, 155, 170, 185, 192, 206, 218, 227, 240, 250, 261, 269, 281, 291, 305, 316, 324, 334, 344, 354, 368, 380, 395, 411, 424, 438, 462, 488, 504, 517, 531, 546, 561, 576, 586, 599, 609, 621, 635, 646, 654, 662, 681, 694, 708, 722, 737, 750, 763, 776, 792, 805, 818, 830, 843, 855, 867, 881, 896, 904, 911, 918, 934, 953, 965, 980, 1001, 1022, 1039, 1057, 1077, 1098, 1112, 1122, 1142, 1163, 1180, 1198, 1215, 1229, 1239, 1248, 1258, 1274, 1284, 1294, 1307, 1317, 1329, 1338, 1350, 1358} +var _TokenName_index = [...]uint16{0, 9, 16, 34, 48, 63, 72, 79, 89, 102, 123, 144, 155, 170, 185, 192, 206, 215, 228, 238, 249, 257, 269, 279, 293, 304, 312, 322, 332, 342, 356, 368, 383, 399, 412, 426, 450, 476, 492, 505, 519, 534, 549, 564, 574, 587, 597, 609, 623, 634, 642, 650, 669, 682, 696, 710, 725, 738, 751, 764, 780, 793, 806, 818, 831, 843, 855, 869, 884, 892, 899, 906, 922, 941, 953, 968, 989, 1010, 1027, 1045, 1065, 1086, 1100, 1110, 1130, 1151, 1168, 1186, 1203, 1217, 1227, 1236, 1246, 1262, 1272, 1282, 1295, 1305, 1317, 1326, 1338, 1346} func (i TokenName) String() string { if i < 0 || i >= TokenName(len(_TokenName_index)-1) { diff --git a/php5/php5.go b/php5/php5.go index c8e4043..0862ab2 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -4218,7 +4218,7 @@ yydefault: _default.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[4].list)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.DefaultToken).AppendTo(_default.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(_default.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.CaseSeparatorToken).AppendTo(_default.GetMeta()) yylex.(*Parser).appendMetaToken(_default, yyDollar[3].token, meta.CaseSeparatorToken) diff --git a/php5/php5.y b/php5/php5.y index ba3f46e..6f9662a 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -2044,7 +2044,7 @@ case_list: _default.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $4)) // save comments - $2.Meta.SetTokenName(meta.DefaultToken).AppendTo(_default.GetMeta()) + $2.Meta.SetTokenName(meta.NodeStart).AppendTo(_default.GetMeta()) $3.Meta.SetTokenName(meta.CaseSeparatorToken).AppendTo(_default.GetMeta()) yylex.(*Parser).appendMetaToken(_default, $3, meta.CaseSeparatorToken) diff --git a/php7/php7.go b/php7/php7.go index 0f2c05f..01dcd53 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -4262,7 +4262,7 @@ yydefault: _default.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[4].list)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.DefaultToken).AppendTo(_default.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(_default.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.CaseSeparatorToken).AppendTo(_default.GetMeta()) yylex.(*Parser).appendMetaToken(_default, yyDollar[3].token, meta.CaseSeparatorToken) diff --git a/php7/php7.y b/php7/php7.y index 4e8e781..5ccf913 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -1889,7 +1889,7 @@ case_list: _default.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $4)) // save comments - $2.Meta.SetTokenName(meta.DefaultToken).AppendTo(_default.GetMeta()) + $2.Meta.SetTokenName(meta.NodeStart).AppendTo(_default.GetMeta()) $3.Meta.SetTokenName(meta.CaseSeparatorToken).AppendTo(_default.GetMeta()) yylex.(*Parser).appendMetaToken(_default, $3, meta.CaseSeparatorToken) diff --git a/printer/printer.go b/printer/printer.go index eb23b09..eaf4efc 100644 --- a/printer/printer.go +++ b/printer/printer.go @@ -2082,7 +2082,6 @@ func (p *Printer) printStmtDefault(n node.Node) { nn := n.(*stmt.Default) p.printMeta(nn, meta.NodeStart) - p.printMeta(nn, meta.DefaultToken) io.WriteString(p.w, "default") r := p.printMeta(nn, meta.CaseSeparatorToken) if !r { diff --git a/printer/printer_test.go b/printer/printer_test.go index 2a5f98d..ce659ee 100644 --- a/printer/printer_test.go +++ b/printer/printer_test.go @@ -6269,7 +6269,7 @@ func TestPrinterPrintStmtDefalut(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.DefaultToken, + TokenName: meta.NodeStart, }, }, Stmts: []node.Node{ @@ -6303,7 +6303,7 @@ func TestPrinterPrintStmtDefalutEmpty(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.DefaultToken, + TokenName: meta.NodeStart, }, }, Stmts: []node.Node{}, From 378830df76ddd98bb23e819d6e32baf42f9bd863 Mon Sep 17 00:00:00 2001 From: z7zmey Date: Mon, 29 Oct 2018 13:31:44 +0200 Subject: [PATCH 076/117] remove meta.DoToken --- meta/tokenName.go | 1 - meta/tokenName_string.go | 4 ++-- php5/php5.go | 2 +- php5/php5.y | 2 +- php7/php7.go | 2 +- php7/php7.y | 2 +- printer/printer.go | 1 - printer/printer_test.go | 4 ++-- 8 files changed, 8 insertions(+), 10 deletions(-) diff --git a/meta/tokenName.go b/meta/tokenName.go index 8dbb98b..972af98 100644 --- a/meta/tokenName.go +++ b/meta/tokenName.go @@ -11,7 +11,6 @@ const ( NumStringToken InlineHTMLToken EchoToken - DoToken WhileToken EndwhileToken ForInitSemicolonToken diff --git a/meta/tokenName_string.go b/meta/tokenName_string.go index f4632d4..07cd3a8 100644 --- a/meta/tokenName_string.go +++ b/meta/tokenName_string.go @@ -4,9 +4,9 @@ package meta import "strconv" -const _TokenName_name = "NodeStartNodeEndStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenEndforTokenEndforeachTokenEnddeclareTokenAsTokenEndswitchTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenFinallyTokenThrowTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenEndifTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" +const _TokenName_name = "NodeStartNodeEndStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenEndforTokenEndforeachTokenEnddeclareTokenAsTokenEndswitchTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenFinallyTokenThrowTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenEndifTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" -var _TokenName_index = [...]uint16{0, 9, 16, 34, 48, 63, 72, 79, 89, 102, 123, 144, 155, 170, 185, 192, 206, 215, 228, 238, 249, 257, 269, 279, 293, 304, 312, 322, 332, 342, 356, 368, 383, 399, 412, 426, 450, 476, 492, 505, 519, 534, 549, 564, 574, 587, 597, 609, 623, 634, 642, 650, 669, 682, 696, 710, 725, 738, 751, 764, 780, 793, 806, 818, 831, 843, 855, 869, 884, 892, 899, 906, 922, 941, 953, 968, 989, 1010, 1027, 1045, 1065, 1086, 1100, 1110, 1130, 1151, 1168, 1186, 1203, 1217, 1227, 1236, 1246, 1262, 1272, 1282, 1295, 1305, 1317, 1326, 1338, 1346} +var _TokenName_index = [...]uint16{0, 9, 16, 34, 48, 63, 72, 82, 95, 116, 137, 148, 163, 178, 185, 199, 208, 221, 231, 242, 250, 262, 272, 286, 297, 305, 315, 325, 335, 349, 361, 376, 392, 405, 419, 443, 469, 485, 498, 512, 527, 542, 557, 567, 580, 590, 602, 616, 627, 635, 643, 662, 675, 689, 703, 718, 731, 744, 757, 773, 786, 799, 811, 824, 836, 848, 862, 877, 885, 892, 899, 915, 934, 946, 961, 982, 1003, 1020, 1038, 1058, 1079, 1093, 1103, 1123, 1144, 1161, 1179, 1196, 1210, 1220, 1229, 1239, 1255, 1265, 1275, 1288, 1298, 1310, 1319, 1331, 1339} func (i TokenName) String() string { if i < 0 || i >= TokenName(len(_TokenName_index)-1) { diff --git a/php5/php5.go b/php5/php5.go index 0862ab2..bb39edc 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -3058,7 +3058,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[5].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.DoToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.WhileToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[4].node.GetMeta().Cut(meta.TokenNameFilter(meta.OpenParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo(yyVAL.node.GetMeta()) yyDollar[4].node.GetMeta().Cut(meta.TokenNameFilter(meta.CloseParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo(yyVAL.node.GetMeta()) diff --git a/php5/php5.y b/php5/php5.y index 6f9662a..07987a8 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -952,7 +952,7 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5)) // save comments - $1.Meta.SetTokenName(meta.DoToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $3.Meta.SetTokenName(meta.WhileToken).AppendTo($$.GetMeta()) $4.GetMeta().Cut(meta.TokenNameFilter(meta.OpenParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo($$.GetMeta()) $4.GetMeta().Cut(meta.TokenNameFilter(meta.CloseParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo($$.GetMeta()) diff --git a/php7/php7.go b/php7/php7.go index 01dcd53..8a72b92 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -3300,7 +3300,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[7].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.DoToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.WhileToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[6].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) diff --git a/php7/php7.y b/php7/php7.y index 5ccf913..4a15207 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -990,7 +990,7 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $7)) // save comments - $1.Meta.SetTokenName(meta.DoToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $3.Meta.SetTokenName(meta.WhileToken).AppendTo($$.GetMeta()) $4.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) $6.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) diff --git a/printer/printer.go b/printer/printer.go index eaf4efc..58dbf94 100644 --- a/printer/printer.go +++ b/printer/printer.go @@ -2099,7 +2099,6 @@ func (p *Printer) printStmtDo(n node.Node) { nn := n.(*stmt.Do) p.printMeta(nn, meta.NodeStart) - p.printMeta(nn, meta.DoToken) io.WriteString(p.w, "do") p.Print(nn.Stmt) diff --git a/printer/printer_test.go b/printer/printer_test.go index ce659ee..bc6c747 100644 --- a/printer/printer_test.go +++ b/printer/printer_test.go @@ -6326,7 +6326,7 @@ func TestPrinterPrintStmtDo_Expression(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.DoToken, + TokenName: meta.NodeStart, }, &meta.Data{ Type: meta.WhiteSpaceType, @@ -6386,7 +6386,7 @@ func TestPrinterPrintStmtDo_StmtList(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.DoToken, + TokenName: meta.NodeStart, }, &meta.Data{ Type: meta.WhiteSpaceType, From 819a6d7f46df81b02336225da7911d3aff65f246 Mon Sep 17 00:00:00 2001 From: z7zmey Date: Mon, 29 Oct 2018 13:36:03 +0200 Subject: [PATCH 077/117] remove meta.EchoToken --- meta/tokenName.go | 1 - meta/tokenName_string.go | 4 ++-- php5/php5.go | 4 ++-- php5/php5.y | 4 ++-- php7/php7.go | 4 ++-- php7/php7.y | 4 ++-- printer/printer.go | 1 - printer/printer_test.go | 4 ++-- 8 files changed, 12 insertions(+), 14 deletions(-) diff --git a/meta/tokenName.go b/meta/tokenName.go index 972af98..b7f438a 100644 --- a/meta/tokenName.go +++ b/meta/tokenName.go @@ -10,7 +10,6 @@ const ( StringVarnameToken NumStringToken InlineHTMLToken - EchoToken WhileToken EndwhileToken ForInitSemicolonToken diff --git a/meta/tokenName_string.go b/meta/tokenName_string.go index 07cd3a8..801f9bc 100644 --- a/meta/tokenName_string.go +++ b/meta/tokenName_string.go @@ -4,9 +4,9 @@ package meta import "strconv" -const _TokenName_name = "NodeStartNodeEndStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenEndforTokenEndforeachTokenEnddeclareTokenAsTokenEndswitchTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenFinallyTokenThrowTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenEndifTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" +const _TokenName_name = "NodeStartNodeEndStringVarnameTokenNumStringTokenInlineHTMLTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenEndforTokenEndforeachTokenEnddeclareTokenAsTokenEndswitchTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenFinallyTokenThrowTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenEndifTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" -var _TokenName_index = [...]uint16{0, 9, 16, 34, 48, 63, 72, 82, 95, 116, 137, 148, 163, 178, 185, 199, 208, 221, 231, 242, 250, 262, 272, 286, 297, 305, 315, 325, 335, 349, 361, 376, 392, 405, 419, 443, 469, 485, 498, 512, 527, 542, 557, 567, 580, 590, 602, 616, 627, 635, 643, 662, 675, 689, 703, 718, 731, 744, 757, 773, 786, 799, 811, 824, 836, 848, 862, 877, 885, 892, 899, 915, 934, 946, 961, 982, 1003, 1020, 1038, 1058, 1079, 1093, 1103, 1123, 1144, 1161, 1179, 1196, 1210, 1220, 1229, 1239, 1255, 1265, 1275, 1288, 1298, 1310, 1319, 1331, 1339} +var _TokenName_index = [...]uint16{0, 9, 16, 34, 48, 63, 73, 86, 107, 128, 139, 154, 169, 176, 190, 199, 212, 222, 233, 241, 253, 263, 277, 288, 296, 306, 316, 326, 340, 352, 367, 383, 396, 410, 434, 460, 476, 489, 503, 518, 533, 548, 558, 571, 581, 593, 607, 618, 626, 634, 653, 666, 680, 694, 709, 722, 735, 748, 764, 777, 790, 802, 815, 827, 839, 853, 868, 876, 883, 890, 906, 925, 937, 952, 973, 994, 1011, 1029, 1049, 1070, 1084, 1094, 1114, 1135, 1152, 1170, 1187, 1201, 1211, 1220, 1230, 1246, 1256, 1266, 1279, 1289, 1301, 1310, 1322, 1330} func (i TokenName) String() string { if i < 0 || i >= TokenName(len(_TokenName_index)-1) { diff --git a/php5/php5.go b/php5/php5.go index bb39edc..909924c 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -3290,8 +3290,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.EchoToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.EchoToken) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) yyDollar[3].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.SemiColonToken) diff --git a/php5/php5.y b/php5/php5.y index 07987a8..96ea0d3 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -1158,8 +1158,8 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.EchoToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $1, meta.EchoToken) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) $3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken) diff --git a/php7/php7.go b/php7/php7.go index 8a72b92..183392a 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -3453,8 +3453,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.EchoToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.EchoToken) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) yyDollar[3].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.SemiColonToken) diff --git a/php7/php7.y b/php7/php7.y index 4a15207..9d1cc51 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -1127,8 +1127,8 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.EchoToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $1, meta.EchoToken) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) $3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken) diff --git a/printer/printer.go b/printer/printer.go index 58dbf94..233d92f 100644 --- a/printer/printer.go +++ b/printer/printer.go @@ -2119,7 +2119,6 @@ func (p *Printer) printStmtEcho(n node.Node) { nn := n.(*stmt.Echo) p.printMeta(nn, meta.NodeStart) - p.printMeta(nn, meta.EchoToken) p.joinPrint(",", nn.Exprs) p.printMeta(nn, meta.SemiColonToken) diff --git a/printer/printer_test.go b/printer/printer_test.go index bc6c747..2c1ca63 100644 --- a/printer/printer_test.go +++ b/printer/printer_test.go @@ -6448,12 +6448,12 @@ func TestPrinterPrintStmtEcho(t *testing.T) { &meta.Data{ Type: meta.TokenType, Value: "echo", - TokenName: meta.EchoToken, + TokenName: meta.NodeStart, }, &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.EchoToken, + TokenName: meta.NodeStart, }, &meta.Data{ Type: meta.WhiteSpaceType, From 8dc0845d631f041d7b8650e457786b98d3987de6 Mon Sep 17 00:00:00 2001 From: z7zmey Date: Mon, 29 Oct 2018 13:38:02 +0200 Subject: [PATCH 078/117] remove meta.FinallyToken --- meta/tokenName.go | 1 - meta/tokenName_string.go | 4 ++-- php5/php5.go | 2 +- php5/php5.y | 2 +- php7/php7.go | 2 +- php7/php7.y | 2 +- printer/printer.go | 1 - printer/printer_test.go | 2 +- 8 files changed, 7 insertions(+), 9 deletions(-) diff --git a/meta/tokenName.go b/meta/tokenName.go index b7f438a..aed90d5 100644 --- a/meta/tokenName.go +++ b/meta/tokenName.go @@ -24,7 +24,6 @@ const ( ConstToken ReturnToken TryToken - FinallyToken ThrowToken InsteadofToken GlobalToken diff --git a/meta/tokenName_string.go b/meta/tokenName_string.go index 801f9bc..8523422 100644 --- a/meta/tokenName_string.go +++ b/meta/tokenName_string.go @@ -4,9 +4,9 @@ package meta import "strconv" -const _TokenName_name = "NodeStartNodeEndStringVarnameTokenNumStringTokenInlineHTMLTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenEndforTokenEndforeachTokenEnddeclareTokenAsTokenEndswitchTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenFinallyTokenThrowTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenEndifTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" +const _TokenName_name = "NodeStartNodeEndStringVarnameTokenNumStringTokenInlineHTMLTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenEndforTokenEndforeachTokenEnddeclareTokenAsTokenEndswitchTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenThrowTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenEndifTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" -var _TokenName_index = [...]uint16{0, 9, 16, 34, 48, 63, 73, 86, 107, 128, 139, 154, 169, 176, 190, 199, 212, 222, 233, 241, 253, 263, 277, 288, 296, 306, 316, 326, 340, 352, 367, 383, 396, 410, 434, 460, 476, 489, 503, 518, 533, 548, 558, 571, 581, 593, 607, 618, 626, 634, 653, 666, 680, 694, 709, 722, 735, 748, 764, 777, 790, 802, 815, 827, 839, 853, 868, 876, 883, 890, 906, 925, 937, 952, 973, 994, 1011, 1029, 1049, 1070, 1084, 1094, 1114, 1135, 1152, 1170, 1187, 1201, 1211, 1220, 1230, 1246, 1256, 1266, 1279, 1289, 1301, 1310, 1322, 1330} +var _TokenName_index = [...]uint16{0, 9, 16, 34, 48, 63, 73, 86, 107, 128, 139, 154, 169, 176, 190, 199, 212, 222, 233, 241, 251, 265, 276, 284, 294, 304, 314, 328, 340, 355, 371, 384, 398, 422, 448, 464, 477, 491, 506, 521, 536, 546, 559, 569, 581, 595, 606, 614, 622, 641, 654, 668, 682, 697, 710, 723, 736, 752, 765, 778, 790, 803, 815, 827, 841, 856, 864, 871, 878, 894, 913, 925, 940, 961, 982, 999, 1017, 1037, 1058, 1072, 1082, 1102, 1123, 1140, 1158, 1175, 1189, 1199, 1208, 1218, 1234, 1244, 1254, 1267, 1277, 1289, 1298, 1310, 1318} func (i TokenName) String() string { if i < 0 || i >= TokenName(len(_TokenName_index)-1) { diff --git a/php5/php5.go b/php5/php5.go index 909924c..8db2d7f 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -3566,7 +3566,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.FinallyToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) diff --git a/php5/php5.y b/php5/php5.y index 96ea0d3..89cc9eb 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -1412,7 +1412,7 @@ finally_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $1.Meta.SetTokenName(meta.FinallyToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $2.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) $4.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) diff --git a/php7/php7.go b/php7/php7.go index 183392a..c607c9c 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -3739,7 +3739,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.FinallyToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) diff --git a/php7/php7.y b/php7/php7.y index 9d1cc51..46356ff 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -1386,7 +1386,7 @@ finally_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $1.Meta.SetTokenName(meta.FinallyToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $2.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) $4.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) diff --git a/printer/printer.go b/printer/printer.go index 233d92f..58cd406 100644 --- a/printer/printer.go +++ b/printer/printer.go @@ -2167,7 +2167,6 @@ func (p *Printer) printStmtFinally(n node.Node) { nn := n.(*stmt.Finally) p.printMeta(nn, meta.NodeStart) - p.printMeta(nn, meta.FinallyToken) io.WriteString(p.w, "finally") p.printMeta(nn, meta.OpenCurlyBracesToken) io.WriteString(p.w, "{") diff --git a/printer/printer_test.go b/printer/printer_test.go index 2c1ca63..3119b58 100644 --- a/printer/printer_test.go +++ b/printer/printer_test.go @@ -6726,7 +6726,7 @@ func TestPrinterPrintStmtFinally(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.FinallyToken, + TokenName: meta.NodeStart, }, &meta.Data{ Type: meta.WhiteSpaceType, From 2866018474c1af5e98510540ef836bafe6a6a090 Mon Sep 17 00:00:00 2001 From: z7zmey Date: Mon, 29 Oct 2018 13:42:50 +0200 Subject: [PATCH 079/117] replace meta.FunctionToken --- php5/php5.go | 2 +- php5/php5.y | 2 +- php7/php7.go | 2 +- php7/php7.y | 2 +- printer/printer.go | 1 - printer/printer_test.go | 2 +- visitor/pretty_json_dumper_test.go | 2 +- 7 files changed, 6 insertions(+), 7 deletions(-) diff --git a/php5/php5.go b/php5/php5.go index 8db2d7f..d2805ba 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -3707,7 +3707,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[9].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.FunctionToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) if yyDollar[2].token != nil { yyDollar[2].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(yyVAL.node.GetMeta()) } diff --git a/php5/php5.y b/php5/php5.y index 89cc9eb..bfc677c 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -1553,7 +1553,7 @@ unticked_function_declaration_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $9)) // save comments - $1.Meta.SetTokenName(meta.FunctionToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) if $2 != nil { $2.Meta.SetTokenName(meta.AmpersandToken).AppendTo($$.GetMeta()) } diff --git a/php7/php7.go b/php7/php7.go index c607c9c..3661560 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -3784,7 +3784,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[11].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.FunctionToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) if yyDollar[2].token != nil { yyDollar[2].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(yyVAL.node.GetMeta()) } diff --git a/php7/php7.y b/php7/php7.y index 46356ff..b87d91c 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -1433,7 +1433,7 @@ function_declaration_statement: // save comments - $1.Meta.SetTokenName(meta.FunctionToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) if $2 != nil { $2.Meta.SetTokenName(meta.AmpersandToken).AppendTo($$.GetMeta()) } diff --git a/printer/printer.go b/printer/printer.go index 58cd406..14679a7 100644 --- a/printer/printer.go +++ b/printer/printer.go @@ -2229,7 +2229,6 @@ func (p *Printer) printStmtFunction(n node.Node) { nn := n.(*stmt.Function) p.printMeta(nn, meta.NodeStart) - p.printMeta(nn, meta.FunctionToken) io.WriteString(p.w, "function") if nn.ReturnsRef { diff --git a/printer/printer_test.go b/printer/printer_test.go index 3119b58..dd1e6f4 100644 --- a/printer/printer_test.go +++ b/printer/printer_test.go @@ -6951,7 +6951,7 @@ func TestPrinterPrintStmtFunction(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.FunctionToken, + TokenName: meta.NodeStart, }, &meta.Data{ Type: meta.WhiteSpaceType, diff --git a/visitor/pretty_json_dumper_test.go b/visitor/pretty_json_dumper_test.go index cc63f5a..16e2164 100644 --- a/visitor/pretty_json_dumper_test.go +++ b/visitor/pretty_json_dumper_test.go @@ -429,7 +429,7 @@ func ExamplePrettyJsonDumper() { // { // "type": "*meta.WhiteSpaceType", // "value": "\n\n\t\t\t", - // "tokenName": "FunctionToken" + // "tokenName": "NodeStart" // }, // { // "type": "*meta.WhiteSpaceType", From 9c6a756545352b215fad30fb632ee030b24e6c1b Mon Sep 17 00:00:00 2001 From: z7zmey Date: Mon, 29 Oct 2018 13:44:46 +0200 Subject: [PATCH 080/117] remove meta.GlobalToken --- meta/tokenName.go | 1 - meta/tokenName_string.go | 4 ++-- php5/php5.go | 2 +- php5/php5.y | 2 +- php7/php7.go | 2 +- php7/php7.y | 2 +- printer/printer.go | 1 - printer/printer_test.go | 2 +- 8 files changed, 7 insertions(+), 9 deletions(-) diff --git a/meta/tokenName.go b/meta/tokenName.go index aed90d5..b31f733 100644 --- a/meta/tokenName.go +++ b/meta/tokenName.go @@ -26,7 +26,6 @@ const ( TryToken ThrowToken InsteadofToken - GlobalToken VarToken UnsetToken ClassToken diff --git a/meta/tokenName_string.go b/meta/tokenName_string.go index 8523422..3774e1b 100644 --- a/meta/tokenName_string.go +++ b/meta/tokenName_string.go @@ -4,9 +4,9 @@ package meta import "strconv" -const _TokenName_name = "NodeStartNodeEndStringVarnameTokenNumStringTokenInlineHTMLTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenEndforTokenEndforeachTokenEnddeclareTokenAsTokenEndswitchTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenThrowTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenEndifTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" +const _TokenName_name = "NodeStartNodeEndStringVarnameTokenNumStringTokenInlineHTMLTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenEndforTokenEndforeachTokenEnddeclareTokenAsTokenEndswitchTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenThrowTokenInsteadofTokenVarTokenUnsetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenEndifTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" -var _TokenName_index = [...]uint16{0, 9, 16, 34, 48, 63, 73, 86, 107, 128, 139, 154, 169, 176, 190, 199, 212, 222, 233, 241, 251, 265, 276, 284, 294, 304, 314, 328, 340, 355, 371, 384, 398, 422, 448, 464, 477, 491, 506, 521, 536, 546, 559, 569, 581, 595, 606, 614, 622, 641, 654, 668, 682, 697, 710, 723, 736, 752, 765, 778, 790, 803, 815, 827, 841, 856, 864, 871, 878, 894, 913, 925, 940, 961, 982, 999, 1017, 1037, 1058, 1072, 1082, 1102, 1123, 1140, 1158, 1175, 1189, 1199, 1208, 1218, 1234, 1244, 1254, 1267, 1277, 1289, 1298, 1310, 1318} +var _TokenName_index = [...]uint16{0, 9, 16, 34, 48, 63, 73, 86, 107, 128, 139, 154, 169, 176, 190, 199, 212, 222, 233, 241, 251, 265, 273, 283, 293, 303, 317, 329, 344, 360, 373, 387, 411, 437, 453, 466, 480, 495, 510, 525, 535, 548, 558, 570, 584, 595, 603, 611, 630, 643, 657, 671, 686, 699, 712, 725, 741, 754, 767, 779, 792, 804, 816, 830, 845, 853, 860, 867, 883, 902, 914, 929, 950, 971, 988, 1006, 1026, 1047, 1061, 1071, 1091, 1112, 1129, 1147, 1164, 1178, 1188, 1197, 1207, 1223, 1233, 1243, 1256, 1266, 1278, 1287, 1299, 1307} func (i TokenName) String() string { if i < 0 || i >= TokenName(len(_TokenName_index)-1) { diff --git a/php5/php5.go b/php5/php5.go index d2805ba..3d291d4 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -3258,7 +3258,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.GlobalToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.SemiColonToken) diff --git a/php5/php5.y b/php5/php5.y index bfc677c..f6c8a77 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -1130,7 +1130,7 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.GlobalToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken) diff --git a/php7/php7.go b/php7/php7.go index 3661560..35c9c03 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -3421,7 +3421,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.GlobalToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.SemiColonToken) diff --git a/php7/php7.y b/php7/php7.y index b87d91c..17a8aeb 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -1099,7 +1099,7 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.GlobalToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken) diff --git a/printer/printer.go b/printer/printer.go index 14679a7..4667263 100644 --- a/printer/printer.go +++ b/printer/printer.go @@ -2263,7 +2263,6 @@ func (p *Printer) printStmtGlobal(n node.Node) { nn := n.(*stmt.Global) p.printMeta(nn, meta.NodeStart) - p.printMeta(nn, meta.GlobalToken) io.WriteString(p.w, "global") p.joinPrint(",", nn.Vars) p.printMeta(nn, meta.SemiColonToken) diff --git a/printer/printer_test.go b/printer/printer_test.go index dd1e6f4..586931b 100644 --- a/printer/printer_test.go +++ b/printer/printer_test.go @@ -7029,7 +7029,7 @@ func TestPrinterPrintStmtGlobal(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.GlobalToken, + TokenName: meta.NodeStart, }, &meta.Data{ Type: meta.WhiteSpaceType, From 4ec92f57ee97dbe19d6ee713b170dd5c685019dd Mon Sep 17 00:00:00 2001 From: z7zmey Date: Mon, 29 Oct 2018 13:45:50 +0200 Subject: [PATCH 081/117] remove meta.GotoToken --- meta/tokenName.go | 1 - meta/tokenName_string.go | 4 ++-- php5/php5.go | 2 +- php5/php5.y | 2 +- php7/php7.go | 2 +- php7/php7.y | 2 +- printer/printer.go | 1 - printer/printer_test.go | 2 +- 8 files changed, 7 insertions(+), 9 deletions(-) diff --git a/meta/tokenName.go b/meta/tokenName.go index b31f733..704c990 100644 --- a/meta/tokenName.go +++ b/meta/tokenName.go @@ -19,7 +19,6 @@ const ( EnddeclareToken AsToken EndswitchToken - GotoToken FunctionToken ConstToken ReturnToken diff --git a/meta/tokenName_string.go b/meta/tokenName_string.go index 3774e1b..630c577 100644 --- a/meta/tokenName_string.go +++ b/meta/tokenName_string.go @@ -4,9 +4,9 @@ package meta import "strconv" -const _TokenName_name = "NodeStartNodeEndStringVarnameTokenNumStringTokenInlineHTMLTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenEndforTokenEndforeachTokenEnddeclareTokenAsTokenEndswitchTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenThrowTokenInsteadofTokenVarTokenUnsetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenEndifTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" +const _TokenName_name = "NodeStartNodeEndStringVarnameTokenNumStringTokenInlineHTMLTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenEndforTokenEndforeachTokenEnddeclareTokenAsTokenEndswitchTokenFunctionTokenConstTokenReturnTokenTryTokenThrowTokenInsteadofTokenVarTokenUnsetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenEndifTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" -var _TokenName_index = [...]uint16{0, 9, 16, 34, 48, 63, 73, 86, 107, 128, 139, 154, 169, 176, 190, 199, 212, 222, 233, 241, 251, 265, 273, 283, 293, 303, 317, 329, 344, 360, 373, 387, 411, 437, 453, 466, 480, 495, 510, 525, 535, 548, 558, 570, 584, 595, 603, 611, 630, 643, 657, 671, 686, 699, 712, 725, 741, 754, 767, 779, 792, 804, 816, 830, 845, 853, 860, 867, 883, 902, 914, 929, 950, 971, 988, 1006, 1026, 1047, 1061, 1071, 1091, 1112, 1129, 1147, 1164, 1178, 1188, 1197, 1207, 1223, 1233, 1243, 1256, 1266, 1278, 1287, 1299, 1307} +var _TokenName_index = [...]uint16{0, 9, 16, 34, 48, 63, 73, 86, 107, 128, 139, 154, 169, 176, 190, 203, 213, 224, 232, 242, 256, 264, 274, 284, 294, 308, 320, 335, 351, 364, 378, 402, 428, 444, 457, 471, 486, 501, 516, 526, 539, 549, 561, 575, 586, 594, 602, 621, 634, 648, 662, 677, 690, 703, 716, 732, 745, 758, 770, 783, 795, 807, 821, 836, 844, 851, 858, 874, 893, 905, 920, 941, 962, 979, 997, 1017, 1038, 1052, 1062, 1082, 1103, 1120, 1138, 1155, 1169, 1179, 1188, 1198, 1214, 1224, 1234, 1247, 1257, 1269, 1278, 1290, 1298} func (i TokenName) String() string { if i < 0 || i >= TokenName(len(_TokenName_index)-1) { diff --git a/php5/php5.go b/php5/php5.go index 3d291d4..90f73d8 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -3508,7 +3508,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.GotoToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(label.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.SemiColonToken) diff --git a/php5/php5.y b/php5/php5.y index f6c8a77..d02df8e 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -1356,7 +1356,7 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.GotoToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $2.Meta.SetTokenName(meta.NodeStart).AppendTo(label.GetMeta()) $3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken) diff --git a/php7/php7.go b/php7/php7.go index 35c9c03..2c091df 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -3645,7 +3645,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.GotoToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(label.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.SemiColonToken) diff --git a/php7/php7.y b/php7/php7.y index 17a8aeb..267fe43 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -1299,7 +1299,7 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.GotoToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $2.Meta.SetTokenName(meta.NodeStart).AppendTo(label.GetMeta()) $3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken) diff --git a/printer/printer.go b/printer/printer.go index 4667263..ed767c8 100644 --- a/printer/printer.go +++ b/printer/printer.go @@ -2274,7 +2274,6 @@ func (p *Printer) printStmtGoto(n node.Node) { nn := n.(*stmt.Goto) p.printMeta(nn, meta.NodeStart) - p.printMeta(nn, meta.GotoToken) io.WriteString(p.w, "goto") p.Print(nn.Label) p.printMeta(nn, meta.SemiColonToken) diff --git a/printer/printer_test.go b/printer/printer_test.go index 586931b..a039bc6 100644 --- a/printer/printer_test.go +++ b/printer/printer_test.go @@ -7083,7 +7083,7 @@ func TestPrinterPrintStmtGoto(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.GotoToken, + TokenName: meta.NodeStart, }, &meta.Data{ Type: meta.WhiteSpaceType, From a8295f8f7280978adf00b353a136ef4f84571b40 Mon Sep 17 00:00:00 2001 From: z7zmey Date: Mon, 29 Oct 2018 14:16:29 +0200 Subject: [PATCH 082/117] remove meta.HaltCompilerToken --- meta/tokenName.go | 1 - meta/tokenName_string.go | 4 ++-- php5/php5.go | 4 ++-- php5/php5.y | 4 ++-- php7/php7.go | 4 ++-- php7/php7.y | 4 ++-- printer/printer.go | 1 - printer/printer_test.go | 2 +- 8 files changed, 11 insertions(+), 13 deletions(-) diff --git a/meta/tokenName.go b/meta/tokenName.go index 704c990..cf9e44a 100644 --- a/meta/tokenName.go +++ b/meta/tokenName.go @@ -77,7 +77,6 @@ const ( IsNotEqualToken IsSmallerOrEqualToken IsGreaterOrEqualToken - HaltCompilerToken CaseSeparatorToken // ';' or ':' OpenCurlyBracesToken // '{' CloseCurlyBracesToken // '}' diff --git a/meta/tokenName_string.go b/meta/tokenName_string.go index 630c577..114f19b 100644 --- a/meta/tokenName_string.go +++ b/meta/tokenName_string.go @@ -4,9 +4,9 @@ package meta import "strconv" -const _TokenName_name = "NodeStartNodeEndStringVarnameTokenNumStringTokenInlineHTMLTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenEndforTokenEndforeachTokenEnddeclareTokenAsTokenEndswitchTokenFunctionTokenConstTokenReturnTokenTryTokenThrowTokenInsteadofTokenVarTokenUnsetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenEndifTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" +const _TokenName_name = "NodeStartNodeEndStringVarnameTokenNumStringTokenInlineHTMLTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenEndforTokenEndforeachTokenEnddeclareTokenAsTokenEndswitchTokenFunctionTokenConstTokenReturnTokenTryTokenThrowTokenInsteadofTokenVarTokenUnsetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenEndifTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" -var _TokenName_index = [...]uint16{0, 9, 16, 34, 48, 63, 73, 86, 107, 128, 139, 154, 169, 176, 190, 203, 213, 224, 232, 242, 256, 264, 274, 284, 294, 308, 320, 335, 351, 364, 378, 402, 428, 444, 457, 471, 486, 501, 516, 526, 539, 549, 561, 575, 586, 594, 602, 621, 634, 648, 662, 677, 690, 703, 716, 732, 745, 758, 770, 783, 795, 807, 821, 836, 844, 851, 858, 874, 893, 905, 920, 941, 962, 979, 997, 1017, 1038, 1052, 1062, 1082, 1103, 1120, 1138, 1155, 1169, 1179, 1188, 1198, 1214, 1224, 1234, 1247, 1257, 1269, 1278, 1290, 1298} +var _TokenName_index = [...]uint16{0, 9, 16, 34, 48, 63, 73, 86, 107, 128, 139, 154, 169, 176, 190, 203, 213, 224, 232, 242, 256, 264, 274, 284, 294, 308, 320, 335, 351, 364, 378, 402, 428, 444, 457, 471, 486, 501, 516, 526, 539, 549, 561, 575, 586, 594, 602, 621, 634, 648, 662, 677, 690, 703, 716, 732, 745, 758, 770, 783, 795, 807, 821, 836, 844, 851, 858, 874, 893, 905, 920, 941, 962, 980, 1000, 1021, 1035, 1045, 1065, 1086, 1103, 1121, 1138, 1152, 1162, 1171, 1181, 1197, 1207, 1217, 1230, 1240, 1252, 1261, 1273, 1281} func (i TokenName) String() string { if i < 0 || i >= TokenName(len(_TokenName_index)-1) { diff --git a/php5/php5.go b/php5/php5.go index 90f73d8..4c4ff2d 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -2430,7 +2430,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.HaltCompilerToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) @@ -2933,7 +2933,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.HaltCompilerToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) diff --git a/php5/php5.y b/php5/php5.y index d02df8e..ef24eb9 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -371,7 +371,7 @@ top_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $1.Meta.SetTokenName(meta.HaltCompilerToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) $3.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) $4.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) @@ -834,7 +834,7 @@ inner_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $1.Meta.SetTokenName(meta.HaltCompilerToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) $3.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) $4.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) diff --git a/php7/php7.go b/php7/php7.go index 2c091df..bf9eb51 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -2733,7 +2733,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.HaltCompilerToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) @@ -3228,7 +3228,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.HaltCompilerToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) diff --git a/php7/php7.y b/php7/php7.y index 267fe43..235e6fd 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -470,7 +470,7 @@ top_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $1.Meta.SetTokenName(meta.HaltCompilerToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) $3.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) $4.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) @@ -926,7 +926,7 @@ inner_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $1.Meta.SetTokenName(meta.HaltCompilerToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) $3.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) $4.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) diff --git a/printer/printer.go b/printer/printer.go index ed767c8..2c84df1 100644 --- a/printer/printer.go +++ b/printer/printer.go @@ -2310,7 +2310,6 @@ func (p *Printer) printStmtHaltCompiler(n node.Node) { nn := n.(*stmt.HaltCompiler) p.printMeta(nn, meta.NodeStart) - p.printMeta(n, meta.HaltCompilerToken) io.WriteString(p.w, "__halt_compiler") p.printMeta(n, meta.OpenParenthesisToken) io.WriteString(p.w, "(") diff --git a/printer/printer_test.go b/printer/printer_test.go index a039bc6..e9d2c67 100644 --- a/printer/printer_test.go +++ b/printer/printer_test.go @@ -7174,7 +7174,7 @@ func TestPrinterPrintHaltCompiler(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.HaltCompilerToken, + TokenName: meta.NodeStart, }, &meta.Data{ Type: meta.WhiteSpaceType, From 67e222a88fea95651c5b2ed022f0aff36ca48e12 Mon Sep 17 00:00:00 2001 From: z7zmey Date: Mon, 29 Oct 2018 14:18:43 +0200 Subject: [PATCH 083/117] remove meta.InlineHTMLToken --- meta/tokenName.go | 1 - meta/tokenName_string.go | 4 ++-- php5/php5.go | 2 +- php5/php5.y | 2 +- php7/php7.go | 2 +- php7/php7.y | 2 +- printer/printer.go | 3 --- printer/printer_test.go | 2 +- 8 files changed, 7 insertions(+), 11 deletions(-) diff --git a/meta/tokenName.go b/meta/tokenName.go index cf9e44a..b8a20cb 100644 --- a/meta/tokenName.go +++ b/meta/tokenName.go @@ -9,7 +9,6 @@ const ( NodeEnd StringVarnameToken NumStringToken - InlineHTMLToken WhileToken EndwhileToken ForInitSemicolonToken diff --git a/meta/tokenName_string.go b/meta/tokenName_string.go index 114f19b..214c878 100644 --- a/meta/tokenName_string.go +++ b/meta/tokenName_string.go @@ -4,9 +4,9 @@ package meta import "strconv" -const _TokenName_name = "NodeStartNodeEndStringVarnameTokenNumStringTokenInlineHTMLTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenEndforTokenEndforeachTokenEnddeclareTokenAsTokenEndswitchTokenFunctionTokenConstTokenReturnTokenTryTokenThrowTokenInsteadofTokenVarTokenUnsetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenEndifTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" +const _TokenName_name = "NodeStartNodeEndStringVarnameTokenNumStringTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenEndforTokenEndforeachTokenEnddeclareTokenAsTokenEndswitchTokenFunctionTokenConstTokenReturnTokenTryTokenThrowTokenInsteadofTokenVarTokenUnsetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenEndifTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" -var _TokenName_index = [...]uint16{0, 9, 16, 34, 48, 63, 73, 86, 107, 128, 139, 154, 169, 176, 190, 203, 213, 224, 232, 242, 256, 264, 274, 284, 294, 308, 320, 335, 351, 364, 378, 402, 428, 444, 457, 471, 486, 501, 516, 526, 539, 549, 561, 575, 586, 594, 602, 621, 634, 648, 662, 677, 690, 703, 716, 732, 745, 758, 770, 783, 795, 807, 821, 836, 844, 851, 858, 874, 893, 905, 920, 941, 962, 980, 1000, 1021, 1035, 1045, 1065, 1086, 1103, 1121, 1138, 1152, 1162, 1171, 1181, 1197, 1207, 1217, 1230, 1240, 1252, 1261, 1273, 1281} +var _TokenName_index = [...]uint16{0, 9, 16, 34, 48, 58, 71, 92, 113, 124, 139, 154, 161, 175, 188, 198, 209, 217, 227, 241, 249, 259, 269, 279, 293, 305, 320, 336, 349, 363, 387, 413, 429, 442, 456, 471, 486, 501, 511, 524, 534, 546, 560, 571, 579, 587, 606, 619, 633, 647, 662, 675, 688, 701, 717, 730, 743, 755, 768, 780, 792, 806, 821, 829, 836, 843, 859, 878, 890, 905, 926, 947, 965, 985, 1006, 1020, 1030, 1050, 1071, 1088, 1106, 1123, 1137, 1147, 1156, 1166, 1182, 1192, 1202, 1215, 1225, 1237, 1246, 1258, 1266} func (i TokenName) String() string { if i < 0 || i >= TokenName(len(_TokenName_index)-1) { diff --git a/php5/php5.go b/php5/php5.go index 4c4ff2d..ba34f98 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -3307,7 +3307,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.InlineHTMLToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php5/php5.y b/php5/php5.y index ef24eb9..75d2a2a 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -1173,7 +1173,7 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.InlineHTMLToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php7/php7.go b/php7/php7.go index bf9eb51..1c18e59 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -3470,7 +3470,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.InlineHTMLToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php7/php7.y b/php7/php7.y index 235e6fd..74bee98 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -1142,7 +1142,7 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.InlineHTMLToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/printer/printer.go b/printer/printer.go index 2c84df1..bb07a3f 100644 --- a/printer/printer.go +++ b/printer/printer.go @@ -2348,10 +2348,7 @@ func (p *Printer) printStmtInlineHTML(n node.Node) { nn := n.(*stmt.InlineHtml) p.printMeta(nn, meta.NodeStart) - p.printMeta(n, meta.InlineHTMLToken) - // io.WriteString(p.w, "?>") io.WriteString(p.w, nn.Value) - // io.WriteString(p.w, " Date: Mon, 29 Oct 2018 14:20:29 +0200 Subject: [PATCH 084/117] remove meta.InterfaceToken --- meta/tokenName.go | 1 - meta/tokenName_string.go | 4 ++-- php5/php5.go | 2 +- php5/php5.y | 2 +- php7/php7.go | 2 +- php7/php7.y | 2 +- printer/printer.go | 1 - printer/printer_test.go | 2 +- 8 files changed, 7 insertions(+), 9 deletions(-) diff --git a/meta/tokenName.go b/meta/tokenName.go index b8a20cb..99a4f63 100644 --- a/meta/tokenName.go +++ b/meta/tokenName.go @@ -28,7 +28,6 @@ const ( UnsetToken ClassToken TraitToken - InterfaceToken ExtendsToken ImplementsToken DoubleArrowToken diff --git a/meta/tokenName_string.go b/meta/tokenName_string.go index 214c878..361091c 100644 --- a/meta/tokenName_string.go +++ b/meta/tokenName_string.go @@ -4,9 +4,9 @@ package meta import "strconv" -const _TokenName_name = "NodeStartNodeEndStringVarnameTokenNumStringTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenEndforTokenEndforeachTokenEnddeclareTokenAsTokenEndswitchTokenFunctionTokenConstTokenReturnTokenTryTokenThrowTokenInsteadofTokenVarTokenUnsetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenEndifTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" +const _TokenName_name = "NodeStartNodeEndStringVarnameTokenNumStringTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenEndforTokenEndforeachTokenEnddeclareTokenAsTokenEndswitchTokenFunctionTokenConstTokenReturnTokenTryTokenThrowTokenInsteadofTokenVarTokenUnsetTokenClassTokenTraitTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenEndifTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" -var _TokenName_index = [...]uint16{0, 9, 16, 34, 48, 58, 71, 92, 113, 124, 139, 154, 161, 175, 188, 198, 209, 217, 227, 241, 249, 259, 269, 279, 293, 305, 320, 336, 349, 363, 387, 413, 429, 442, 456, 471, 486, 501, 511, 524, 534, 546, 560, 571, 579, 587, 606, 619, 633, 647, 662, 675, 688, 701, 717, 730, 743, 755, 768, 780, 792, 806, 821, 829, 836, 843, 859, 878, 890, 905, 926, 947, 965, 985, 1006, 1020, 1030, 1050, 1071, 1088, 1106, 1123, 1137, 1147, 1156, 1166, 1182, 1192, 1202, 1215, 1225, 1237, 1246, 1258, 1266} +var _TokenName_index = [...]uint16{0, 9, 16, 34, 48, 58, 71, 92, 113, 124, 139, 154, 161, 175, 188, 198, 209, 217, 227, 241, 249, 259, 269, 279, 291, 306, 322, 335, 349, 373, 399, 415, 428, 442, 457, 472, 487, 497, 510, 520, 532, 546, 557, 565, 573, 592, 605, 619, 633, 648, 661, 674, 687, 703, 716, 729, 741, 754, 766, 778, 792, 807, 815, 822, 829, 845, 864, 876, 891, 912, 933, 951, 971, 992, 1006, 1016, 1036, 1057, 1074, 1092, 1109, 1123, 1133, 1142, 1152, 1168, 1178, 1188, 1201, 1211, 1223, 1232, 1244, 1252} func (i TokenName) String() string { if i < 0 || i >= TokenName(len(_TokenName_index)-1) { diff --git a/php5/php5.go b/php5/php5.go index ba34f98..c29e14b 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -3761,7 +3761,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[6].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.InterfaceToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[6].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) diff --git a/php5/php5.y b/php5/php5.y index 75d2a2a..5422b1a 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -1606,7 +1606,7 @@ unticked_class_declaration_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $6)) // save comments - $1.Meta.SetTokenName(meta.InterfaceToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $2.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) $4.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) $6.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) diff --git a/php7/php7.go b/php7/php7.go index 1c18e59..1adfe4c 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -3933,7 +3933,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[7].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.InterfaceToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) yyDollar[5].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[7].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) diff --git a/php7/php7.y b/php7/php7.y index 74bee98..f011cf4 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -1579,7 +1579,7 @@ interface_declaration_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $7)) // save comments - $1.Meta.SetTokenName(meta.InterfaceToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $2.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) $5.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) $7.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) diff --git a/printer/printer.go b/printer/printer.go index bb07a3f..2ad6804 100644 --- a/printer/printer.go +++ b/printer/printer.go @@ -2357,7 +2357,6 @@ func (p *Printer) printStmtInterface(n node.Node) { nn := n.(*stmt.Interface) p.printMeta(nn, meta.NodeStart) - p.printMeta(n, meta.InterfaceToken) io.WriteString(p.w, "interface") if nn.InterfaceName != nil { diff --git a/printer/printer_test.go b/printer/printer_test.go index 4398f82..b8f6ed2 100644 --- a/printer/printer_test.go +++ b/printer/printer_test.go @@ -7434,7 +7434,7 @@ func TestPrinterPrintInterface(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.InterfaceToken, + TokenName: meta.NodeStart, }, &meta.Data{ Type: meta.WhiteSpaceType, From 33c2a5b5c600d8b4e2b8b5fce004b37b0277709e Mon Sep 17 00:00:00 2001 From: z7zmey Date: Mon, 29 Oct 2018 14:47:29 +0200 Subject: [PATCH 085/117] replace meta.SemiColonToken; fix printing stmt.TraitAdaptationList --- php5/php5.go | 14 ++++----- php5/php5.y | 14 ++++----- php7/php7.go | 16 +++++----- php7/php7.y | 16 +++++----- printer/printer.go | 25 +++++++++------ printer/printer_test.go | 49 +++++++++++++++++++++++++++--- visitor/pretty_json_dumper_test.go | 4 +-- 7 files changed, 92 insertions(+), 46 deletions(-) diff --git a/php5/php5.go b/php5/php5.go index c29e14b..ff73170 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -3455,8 +3455,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.SemiColonToken) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4905,8 +4905,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.SemiColonToken) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4919,7 +4919,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -5111,8 +5111,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.SemiColonToken) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php5/php5.y b/php5/php5.y index 5422b1a..60d3c27 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -1309,8 +1309,8 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $1, meta.SemiColonToken) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2709,8 +2709,8 @@ trait_adaptations: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $1, meta.SemiColonToken) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -2722,7 +2722,7 @@ trait_adaptations: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $3.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -2910,8 +2910,8 @@ method_body: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $1, meta.SemiColonToken) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php7/php7.go b/php7/php7.go index 1adfe4c..ac61cc7 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -3593,8 +3593,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.SemiColonToken) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4918,8 +4918,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.SemiColonToken) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4932,7 +4932,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -4946,7 +4946,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -5121,8 +5121,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.SemiColonToken) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php7/php7.y b/php7/php7.y index f011cf4..653519d 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -1253,8 +1253,8 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $1, meta.SemiColonToken) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2519,8 +2519,8 @@ trait_adaptations: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $1, meta.SemiColonToken) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -2532,7 +2532,7 @@ trait_adaptations: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $2.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -2544,7 +2544,7 @@ trait_adaptations: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $3.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -2714,8 +2714,8 @@ method_body: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $1, meta.SemiColonToken) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/printer/printer.go b/printer/printer.go index 2ad6804..db9010c 100644 --- a/printer/printer.go +++ b/printer/printer.go @@ -393,6 +393,8 @@ func (p *Printer) printNode(n node.Node) { p.printStmtSwitch(n) case *stmt.Throw: p.printStmtThrow(n) + case *stmt.TraitAdaptationList: + p.printStmtTraitAdaptationList(n) case *stmt.TraitMethodRef: p.printStmtTraitMethodRef(n) case *stmt.TraitUseAlias: @@ -2414,7 +2416,6 @@ func (p *Printer) printStmtNamespace(n node.Node) { func (p *Printer) printStmtNop(n node.Node) { p.printMeta(n, meta.NodeStart) - p.printMeta(n, meta.SemiColonToken) p.printMeta(n, meta.NodeEnd) } @@ -2526,6 +2527,18 @@ func (p *Printer) printStmtThrow(n node.Node) { p.printMeta(nn, meta.NodeEnd) } +func (p *Printer) printStmtTraitAdaptationList(n node.Node) { + nn := n.(*stmt.TraitAdaptationList) + p.printMeta(nn, meta.NodeStart) + + io.WriteString(p.w, "{") + p.printNodes(nn.Adaptations) + p.printMeta(nn, meta.CloseCurlyBracesToken) + io.WriteString(p.w, "}") + + p.printMeta(nn, meta.NodeEnd) +} + func (p *Printer) printStmtTraitMethodRef(n node.Node) { nn := n.(*stmt.TraitMethodRef) p.printMeta(nn, meta.NodeStart) @@ -2582,15 +2595,7 @@ func (p *Printer) printStmtTraitUse(n node.Node) { io.WriteString(p.w, "use") p.joinPrint(",", nn.Traits) - if adaptationList, ok := nn.TraitAdaptationList.(*stmt.TraitAdaptationList); ok { - p.printMeta(adaptationList, meta.OpenCurlyBracesToken) - io.WriteString(p.w, "{") - p.printNodes(adaptationList.Adaptations) - p.printMeta(adaptationList, meta.CloseCurlyBracesToken) - io.WriteString(p.w, "}") - } else { - p.printMeta(nn.TraitAdaptationList, meta.SemiColonToken) - } + p.Print(nn.TraitAdaptationList) p.printMeta(nn, meta.NodeEnd) } diff --git a/printer/printer_test.go b/printer/printer_test.go index b8f6ed2..5b8717b 100644 --- a/printer/printer_test.go +++ b/printer/printer_test.go @@ -7604,10 +7604,15 @@ func TestPrinterPrintNop(t *testing.T) { Value: " ", TokenName: meta.NodeStart, }, + &meta.Data{ + Type: meta.TokenType, + Value: ";", + TokenName: meta.NodeStart, + }, }, }) - expected := ` ` + expected := ` ;` actual := o.String() if expected != actual { @@ -8075,6 +8080,42 @@ func TestPrinterPrintStmtThrow(t *testing.T) { } } +func TestPrinterPrintStmtTraitAdaptationList(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrinter(o) + p.Print(&stmt.TraitAdaptationList{ + Meta: meta.Collection{ + &meta.Data{ + Type: meta.WhiteSpaceType, + Value: " ", + TokenName: meta.NodeStart, + }, + &meta.Data{ + Type: meta.WhiteSpaceType, + Value: " ", + TokenName: meta.CloseCurlyBracesToken, + }, + }, + Adaptations: []node.Node{ + &stmt.TraitUseAlias{ + Ref: &stmt.TraitMethodRef{ + Trait: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Foo"}}}, + Method: &node.Identifier{Value: "a"}, + }, + Alias: &node.Identifier{Value: "b"}, + }, + }, + }) + + expected := ` {Foo::aasb }` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + func TestPrinterPrintStmtTraitMethodRef(t *testing.T) { o := bytes.NewBufferString("") @@ -8214,12 +8255,12 @@ func TestPrinterPrintStmtTraitUse(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.SemiColonToken, + TokenName: meta.NodeStart, }, &meta.Data{ Type: meta.TokenType, Value: "", - TokenName: meta.SemiColonToken, + TokenName: meta.NodeStart, }, }, }, @@ -8254,7 +8295,7 @@ func TestPrinterPrintStmtTraitAdaptations(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.OpenCurlyBracesToken, + TokenName: meta.NodeStart, }, &meta.Data{ Type: meta.WhiteSpaceType, diff --git a/visitor/pretty_json_dumper_test.go b/visitor/pretty_json_dumper_test.go index 16e2164..47d8464 100644 --- a/visitor/pretty_json_dumper_test.go +++ b/visitor/pretty_json_dumper_test.go @@ -474,12 +474,12 @@ func ExamplePrettyJsonDumper() { // { // "type": "*meta.WhiteSpaceType", // "value": "\n\t\t\t\t", - // "tokenName": "SemiColonToken" + // "tokenName": "NodeStart" // }, // { // "type": "*meta.TokenType", // "value": ";", - // "tokenName": "SemiColonToken" + // "tokenName": "NodeStart" // } // ] // } From 4bb9aada9e199880b073fa346ff5ef3406bbc9f3 Mon Sep 17 00:00:00 2001 From: z7zmey Date: Mon, 29 Oct 2018 14:50:08 +0200 Subject: [PATCH 086/117] remove meta.ReturnToken --- meta/tokenName.go | 1 - meta/tokenName_string.go | 4 ++-- php5/php5.go | 6 +++--- php5/php5.y | 6 +++--- php7/php7.go | 2 +- php7/php7.y | 2 +- printer/printer.go | 1 - printer/printer_test.go | 2 +- 8 files changed, 11 insertions(+), 13 deletions(-) diff --git a/meta/tokenName.go b/meta/tokenName.go index 99a4f63..5ef5f0c 100644 --- a/meta/tokenName.go +++ b/meta/tokenName.go @@ -20,7 +20,6 @@ const ( EndswitchToken FunctionToken ConstToken - ReturnToken TryToken ThrowToken InsteadofToken diff --git a/meta/tokenName_string.go b/meta/tokenName_string.go index 361091c..efc0fee 100644 --- a/meta/tokenName_string.go +++ b/meta/tokenName_string.go @@ -4,9 +4,9 @@ package meta import "strconv" -const _TokenName_name = "NodeStartNodeEndStringVarnameTokenNumStringTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenEndforTokenEndforeachTokenEnddeclareTokenAsTokenEndswitchTokenFunctionTokenConstTokenReturnTokenTryTokenThrowTokenInsteadofTokenVarTokenUnsetTokenClassTokenTraitTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenEndifTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" +const _TokenName_name = "NodeStartNodeEndStringVarnameTokenNumStringTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenEndforTokenEndforeachTokenEnddeclareTokenAsTokenEndswitchTokenFunctionTokenConstTokenTryTokenThrowTokenInsteadofTokenVarTokenUnsetTokenClassTokenTraitTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenEndifTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" -var _TokenName_index = [...]uint16{0, 9, 16, 34, 48, 58, 71, 92, 113, 124, 139, 154, 161, 175, 188, 198, 209, 217, 227, 241, 249, 259, 269, 279, 291, 306, 322, 335, 349, 373, 399, 415, 428, 442, 457, 472, 487, 497, 510, 520, 532, 546, 557, 565, 573, 592, 605, 619, 633, 648, 661, 674, 687, 703, 716, 729, 741, 754, 766, 778, 792, 807, 815, 822, 829, 845, 864, 876, 891, 912, 933, 951, 971, 992, 1006, 1016, 1036, 1057, 1074, 1092, 1109, 1123, 1133, 1142, 1152, 1168, 1178, 1188, 1201, 1211, 1223, 1232, 1244, 1252} +var _TokenName_index = [...]uint16{0, 9, 16, 34, 48, 58, 71, 92, 113, 124, 139, 154, 161, 175, 188, 198, 206, 216, 230, 238, 248, 258, 268, 280, 295, 311, 324, 338, 362, 388, 404, 417, 431, 446, 461, 476, 486, 499, 509, 521, 535, 546, 554, 562, 581, 594, 608, 622, 637, 650, 663, 676, 692, 705, 718, 730, 743, 755, 767, 781, 796, 804, 811, 818, 834, 853, 865, 880, 901, 922, 940, 960, 981, 995, 1005, 1025, 1046, 1063, 1081, 1098, 1112, 1122, 1131, 1141, 1157, 1167, 1177, 1190, 1200, 1212, 1221, 1233, 1241} func (i TokenName) String() string { if i < 0 || i >= TokenName(len(_TokenName_index)-1) { diff --git a/php5/php5.go b/php5/php5.go index ff73170..4b63731 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -3195,7 +3195,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.ReturnToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.SemiColonToken) @@ -3211,7 +3211,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.ReturnToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.SemiColonToken) @@ -3227,7 +3227,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.ReturnToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.SemiColonToken) diff --git a/php5/php5.y b/php5/php5.y index 60d3c27..dfe45ca 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -1075,7 +1075,7 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.ReturnToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $2.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $2, meta.SemiColonToken) @@ -1089,7 +1089,7 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.ReturnToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken) @@ -1103,7 +1103,7 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.ReturnToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken) diff --git a/php7/php7.go b/php7/php7.go index ac61cc7..f48e8bf 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -3405,7 +3405,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.ReturnToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.SemiColonToken) diff --git a/php7/php7.y b/php7/php7.y index 653519d..3898fd8 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -1085,7 +1085,7 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.ReturnToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken) diff --git a/printer/printer.go b/printer/printer.go index db9010c..02b3980 100644 --- a/printer/printer.go +++ b/printer/printer.go @@ -2449,7 +2449,6 @@ func (p *Printer) printStmtReturn(n node.Node) { nn := n.(*stmt.Return) p.printMeta(nn, meta.NodeStart) - p.printMeta(nn, meta.ReturnToken) io.WriteString(p.w, "return") p.Print(nn.Expr) p.printMeta(nn, meta.SemiColonToken) diff --git a/printer/printer_test.go b/printer/printer_test.go index 5b8717b..e20d795 100644 --- a/printer/printer_test.go +++ b/printer/printer_test.go @@ -7719,7 +7719,7 @@ func TestPrinterPrintReturn(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.ReturnToken, + TokenName: meta.NodeStart, }, &meta.Data{ Type: meta.WhiteSpaceType, From 14cfed2e03aff9ba4dc89833ca68d35415eb9657 Mon Sep 17 00:00:00 2001 From: z7zmey Date: Mon, 29 Oct 2018 14:59:57 +0200 Subject: [PATCH 087/117] replace meta.OpenCurlyBracesToken from stmt.StmtList --- php5/php5.go | 4 ++-- php5/php5.y | 4 ++-- php7/php7.go | 4 ++-- php7/php7.y | 4 ++-- printer/printer.go | 1 - printer/printer_test.go | 6 +++--- visitor/dumper_test.go | 2 +- visitor/go_dumper_test.go | 4 ++-- visitor/json_dumper_test.go | 2 +- visitor/pretty_json_dumper_test.go | 2 +- 10 files changed, 16 insertions(+), 17 deletions(-) diff --git a/php5/php5.go b/php5/php5.go index 4b63731..ad18833 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -2976,7 +2976,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -5126,7 +5126,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) diff --git a/php5/php5.y b/php5/php5.y index dfe45ca..e7f7fc4 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -878,7 +878,7 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $3.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -2923,7 +2923,7 @@ method_body: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $3.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) diff --git a/php7/php7.go b/php7/php7.go index f48e8bf..e42385b 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -3246,7 +3246,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -5136,7 +5136,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) diff --git a/php7/php7.y b/php7/php7.y index 3898fd8..c4227dc 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -944,7 +944,7 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $3.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -2727,7 +2727,7 @@ method_body: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $3.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) diff --git a/printer/printer.go b/printer/printer.go index 02b3980..2ea6dfb 100644 --- a/printer/printer.go +++ b/printer/printer.go @@ -2484,7 +2484,6 @@ func (p *Printer) printStmtStmtList(n node.Node) { nn := n.(*stmt.StmtList) p.printMeta(nn, meta.NodeStart) - p.printMeta(nn, meta.OpenCurlyBracesToken) io.WriteString(p.w, "{") p.printNodes(nn.Stmts) p.printMeta(nn, meta.CloseCurlyBracesToken) diff --git a/printer/printer_test.go b/printer/printer_test.go index e20d795..788b665 100644 --- a/printer/printer_test.go +++ b/printer/printer_test.go @@ -5718,7 +5718,7 @@ func TestPrinterPrintStmtClassMethod(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.OpenCurlyBracesToken, + TokenName: meta.NodeStart, }, &meta.Data{ Type: meta.WhiteSpaceType, @@ -7843,7 +7843,7 @@ func TestPrinterPrintStmtList(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.OpenCurlyBracesToken, + TokenName: meta.NodeStart, }, &meta.Data{ Type: meta.WhiteSpaceType, @@ -7892,7 +7892,7 @@ func TestPrinterPrintStmtListNested(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.OpenCurlyBracesToken, + TokenName: meta.NodeStart, }, &meta.Data{ Type: meta.WhiteSpaceType, diff --git a/visitor/dumper_test.go b/visitor/dumper_test.go index 192b6b2..f69b879 100644 --- a/visitor/dumper_test.go +++ b/visitor/dumper_test.go @@ -132,7 +132,7 @@ func ExampleDumper() { // | [*stmt.StmtList] // | "Position": Pos{Line: 6-9 Pos: 96-134} // | "Meta": - // | "\n\t\t\t\t" before "OpenCurlyBracesToken" + // | "\n\t\t\t\t" before "NodeStart" // | "\n\t\t\t\t" before "CloseCurlyBracesToken" // | "Stmts": // | [*stmt.Expression] diff --git a/visitor/go_dumper_test.go b/visitor/go_dumper_test.go index 215dcd8..e06a3a1 100644 --- a/visitor/go_dumper_test.go +++ b/visitor/go_dumper_test.go @@ -215,8 +215,8 @@ func ExampleGoDumper() { // TokenName: meta.FunctionToken, // }, // }, - // ReturnsRef: false, // PhpDocComment: "", + // ReturnsRef: false, // MethodName: &node.Identifier{ // Position: &position.Position{ // StartLine: 5, @@ -400,7 +400,7 @@ func ExampleGoDumper() { // EndPos: 95, // }, // Value: "\n\t\t\t\t", - // TokenName: meta.OpenCurlyBracesToken, + // TokenName: meta.NodeStart, // }, // &meta.Data{ // Type: meta.WhiteSpaceType, diff --git a/visitor/json_dumper_test.go b/visitor/json_dumper_test.go index e9f4037..9d91c7a 100644 --- a/visitor/json_dumper_test.go +++ b/visitor/json_dumper_test.go @@ -37,5 +37,5 @@ func ExampleJsonDumper() { nodes.Walk(dumper) // Output: - // {"type":"*node.Root","position":{"startPos":10,"endPos":166,"startLine":3,"endLine":12},"Stmts":[{"type":"*stmt.Namespace","position":{"startPos":10,"endPos":166,"startLine":3,"endLine":12},"meta":[{"type":"*meta.TokenType","value":" Date: Mon, 29 Oct 2018 15:01:32 +0200 Subject: [PATCH 088/117] remove meta.ThrowToken --- meta/tokenName.go | 1 - meta/tokenName_string.go | 4 ++-- php5/php5.go | 2 +- php5/php5.y | 2 +- php7/php7.go | 2 +- php7/php7.y | 2 +- printer/printer.go | 1 - printer/printer_test.go | 2 +- 8 files changed, 7 insertions(+), 9 deletions(-) diff --git a/meta/tokenName.go b/meta/tokenName.go index 5ef5f0c..12c8222 100644 --- a/meta/tokenName.go +++ b/meta/tokenName.go @@ -21,7 +21,6 @@ const ( FunctionToken ConstToken TryToken - ThrowToken InsteadofToken VarToken UnsetToken diff --git a/meta/tokenName_string.go b/meta/tokenName_string.go index efc0fee..87240a2 100644 --- a/meta/tokenName_string.go +++ b/meta/tokenName_string.go @@ -4,9 +4,9 @@ package meta import "strconv" -const _TokenName_name = "NodeStartNodeEndStringVarnameTokenNumStringTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenEndforTokenEndforeachTokenEnddeclareTokenAsTokenEndswitchTokenFunctionTokenConstTokenTryTokenThrowTokenInsteadofTokenVarTokenUnsetTokenClassTokenTraitTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenEndifTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" +const _TokenName_name = "NodeStartNodeEndStringVarnameTokenNumStringTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenEndforTokenEndforeachTokenEnddeclareTokenAsTokenEndswitchTokenFunctionTokenConstTokenTryTokenInsteadofTokenVarTokenUnsetTokenClassTokenTraitTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenEndifTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" -var _TokenName_index = [...]uint16{0, 9, 16, 34, 48, 58, 71, 92, 113, 124, 139, 154, 161, 175, 188, 198, 206, 216, 230, 238, 248, 258, 268, 280, 295, 311, 324, 338, 362, 388, 404, 417, 431, 446, 461, 476, 486, 499, 509, 521, 535, 546, 554, 562, 581, 594, 608, 622, 637, 650, 663, 676, 692, 705, 718, 730, 743, 755, 767, 781, 796, 804, 811, 818, 834, 853, 865, 880, 901, 922, 940, 960, 981, 995, 1005, 1025, 1046, 1063, 1081, 1098, 1112, 1122, 1131, 1141, 1157, 1167, 1177, 1190, 1200, 1212, 1221, 1233, 1241} +var _TokenName_index = [...]uint16{0, 9, 16, 34, 48, 58, 71, 92, 113, 124, 139, 154, 161, 175, 188, 198, 206, 220, 228, 238, 248, 258, 270, 285, 301, 314, 328, 352, 378, 394, 407, 421, 436, 451, 466, 476, 489, 499, 511, 525, 536, 544, 552, 571, 584, 598, 612, 627, 640, 653, 666, 682, 695, 708, 720, 733, 745, 757, 771, 786, 794, 801, 808, 824, 843, 855, 870, 891, 912, 930, 950, 971, 985, 995, 1015, 1036, 1053, 1071, 1088, 1102, 1112, 1121, 1131, 1147, 1157, 1167, 1180, 1190, 1202, 1211, 1223, 1231} func (i TokenName) String() string { if i < 0 || i >= TokenName(len(_TokenName_index)-1) { diff --git a/php5/php5.go b/php5/php5.go index ad18833..9123971 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -3490,7 +3490,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.ThrowToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.SemiColonToken) diff --git a/php5/php5.y b/php5/php5.y index e7f7fc4..01b3cbf 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -1340,7 +1340,7 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.ThrowToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken) diff --git a/php7/php7.go b/php7/php7.go index e42385b..b1afe39 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -3627,7 +3627,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.ThrowToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.SemiColonToken) diff --git a/php7/php7.y b/php7/php7.y index c4227dc..ce78e33 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -1283,7 +1283,7 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.ThrowToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken) diff --git a/printer/printer.go b/printer/printer.go index 2ea6dfb..920773f 100644 --- a/printer/printer.go +++ b/printer/printer.go @@ -2517,7 +2517,6 @@ func (p *Printer) printStmtThrow(n node.Node) { nn := n.(*stmt.Throw) p.printMeta(nn, meta.NodeStart) - p.printMeta(nn, meta.ThrowToken) io.WriteString(p.w, "throw") p.Print(nn.Expr) p.printMeta(nn, meta.SemiColonToken) diff --git a/printer/printer_test.go b/printer/printer_test.go index 788b665..ba99a08 100644 --- a/printer/printer_test.go +++ b/printer/printer_test.go @@ -8047,7 +8047,7 @@ func TestPrinterPrintStmtThrow(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.ThrowToken, + TokenName: meta.NodeStart, }, &meta.Data{ Type: meta.WhiteSpaceType, From f7a0038307499acade29667d372a0c99df502308 Mon Sep 17 00:00:00 2001 From: z7zmey Date: Mon, 29 Oct 2018 15:03:41 +0200 Subject: [PATCH 089/117] remove meta.TraitToken --- meta/tokenName.go | 1 - meta/tokenName_string.go | 4 ++-- php5/php5.go | 2 +- php5/php5.y | 2 +- php7/php7.go | 2 +- php7/php7.y | 2 +- printer/printer.go | 1 - printer/printer_test.go | 2 +- 8 files changed, 7 insertions(+), 9 deletions(-) diff --git a/meta/tokenName.go b/meta/tokenName.go index 12c8222..feb31b2 100644 --- a/meta/tokenName.go +++ b/meta/tokenName.go @@ -25,7 +25,6 @@ const ( VarToken UnsetToken ClassToken - TraitToken ExtendsToken ImplementsToken DoubleArrowToken diff --git a/meta/tokenName_string.go b/meta/tokenName_string.go index 87240a2..f85aa7d 100644 --- a/meta/tokenName_string.go +++ b/meta/tokenName_string.go @@ -4,9 +4,9 @@ package meta import "strconv" -const _TokenName_name = "NodeStartNodeEndStringVarnameTokenNumStringTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenEndforTokenEndforeachTokenEnddeclareTokenAsTokenEndswitchTokenFunctionTokenConstTokenTryTokenInsteadofTokenVarTokenUnsetTokenClassTokenTraitTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenEndifTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" +const _TokenName_name = "NodeStartNodeEndStringVarnameTokenNumStringTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenEndforTokenEndforeachTokenEnddeclareTokenAsTokenEndswitchTokenFunctionTokenConstTokenTryTokenInsteadofTokenVarTokenUnsetTokenClassTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenEndifTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" -var _TokenName_index = [...]uint16{0, 9, 16, 34, 48, 58, 71, 92, 113, 124, 139, 154, 161, 175, 188, 198, 206, 220, 228, 238, 248, 258, 270, 285, 301, 314, 328, 352, 378, 394, 407, 421, 436, 451, 466, 476, 489, 499, 511, 525, 536, 544, 552, 571, 584, 598, 612, 627, 640, 653, 666, 682, 695, 708, 720, 733, 745, 757, 771, 786, 794, 801, 808, 824, 843, 855, 870, 891, 912, 930, 950, 971, 985, 995, 1015, 1036, 1053, 1071, 1088, 1102, 1112, 1121, 1131, 1147, 1157, 1167, 1180, 1190, 1202, 1211, 1223, 1231} +var _TokenName_index = [...]uint16{0, 9, 16, 34, 48, 58, 71, 92, 113, 124, 139, 154, 161, 175, 188, 198, 206, 220, 228, 238, 248, 260, 275, 291, 304, 318, 342, 368, 384, 397, 411, 426, 441, 456, 466, 479, 489, 501, 515, 526, 534, 542, 561, 574, 588, 602, 617, 630, 643, 656, 672, 685, 698, 710, 723, 735, 747, 761, 776, 784, 791, 798, 814, 833, 845, 860, 881, 902, 920, 940, 961, 975, 985, 1005, 1026, 1043, 1061, 1078, 1092, 1102, 1111, 1121, 1137, 1147, 1157, 1170, 1180, 1192, 1201, 1213, 1221} func (i TokenName) String() string { if i < 0 || i >= TokenName(len(_TokenName_index)-1) { diff --git a/php5/php5.go b/php5/php5.go index 9123971..a042f77 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -3809,7 +3809,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.TraitToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php5/php5.y b/php5/php5.y index 01b3cbf..cb530fa 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -1652,7 +1652,7 @@ class_entry_type: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.TraitToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php7/php7.go b/php7/php7.go index b1afe39..f2c3b86 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -3914,7 +3914,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[6].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.TraitToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[6].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) diff --git a/php7/php7.y b/php7/php7.y index ce78e33..46d5434 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -1559,7 +1559,7 @@ trait_declaration_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $6)) // save comments - $1.Meta.SetTokenName(meta.TraitToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $2.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) $4.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) $6.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) diff --git a/printer/printer.go b/printer/printer.go index 920773f..c93f0d3 100644 --- a/printer/printer.go +++ b/printer/printer.go @@ -2601,7 +2601,6 @@ func (p *Printer) printStmtTrait(n node.Node) { nn := n.(*stmt.Trait) p.printMeta(nn, meta.NodeStart) - p.printMeta(nn, meta.TraitToken) io.WriteString(p.w, "trait") p.Print(nn.TraitName) diff --git a/printer/printer_test.go b/printer/printer_test.go index ba99a08..8122972 100644 --- a/printer/printer_test.go +++ b/printer/printer_test.go @@ -8332,7 +8332,7 @@ func TestPrinterPrintTrait(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.TraitToken, + TokenName: meta.NodeStart, }, &meta.Data{ Type: meta.WhiteSpaceType, From 8d976d31527d20ee902f165c7c774985cfe301b1 Mon Sep 17 00:00:00 2001 From: z7zmey Date: Mon, 29 Oct 2018 15:04:54 +0200 Subject: [PATCH 090/117] remove meta.TryToken --- meta/tokenName.go | 1 - meta/tokenName_string.go | 4 ++-- php5/php5.go | 2 +- php5/php5.y | 2 +- php7/php7.go | 2 +- php7/php7.y | 2 +- printer/printer.go | 1 - printer/printer_test.go | 2 +- 8 files changed, 7 insertions(+), 9 deletions(-) diff --git a/meta/tokenName.go b/meta/tokenName.go index feb31b2..c780f95 100644 --- a/meta/tokenName.go +++ b/meta/tokenName.go @@ -20,7 +20,6 @@ const ( EndswitchToken FunctionToken ConstToken - TryToken InsteadofToken VarToken UnsetToken diff --git a/meta/tokenName_string.go b/meta/tokenName_string.go index f85aa7d..9a7ab97 100644 --- a/meta/tokenName_string.go +++ b/meta/tokenName_string.go @@ -4,9 +4,9 @@ package meta import "strconv" -const _TokenName_name = "NodeStartNodeEndStringVarnameTokenNumStringTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenEndforTokenEndforeachTokenEnddeclareTokenAsTokenEndswitchTokenFunctionTokenConstTokenTryTokenInsteadofTokenVarTokenUnsetTokenClassTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenEndifTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" +const _TokenName_name = "NodeStartNodeEndStringVarnameTokenNumStringTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenEndforTokenEndforeachTokenEnddeclareTokenAsTokenEndswitchTokenFunctionTokenConstTokenInsteadofTokenVarTokenUnsetTokenClassTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenEndifTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" -var _TokenName_index = [...]uint16{0, 9, 16, 34, 48, 58, 71, 92, 113, 124, 139, 154, 161, 175, 188, 198, 206, 220, 228, 238, 248, 260, 275, 291, 304, 318, 342, 368, 384, 397, 411, 426, 441, 456, 466, 479, 489, 501, 515, 526, 534, 542, 561, 574, 588, 602, 617, 630, 643, 656, 672, 685, 698, 710, 723, 735, 747, 761, 776, 784, 791, 798, 814, 833, 845, 860, 881, 902, 920, 940, 961, 975, 985, 1005, 1026, 1043, 1061, 1078, 1092, 1102, 1111, 1121, 1137, 1147, 1157, 1170, 1180, 1192, 1201, 1213, 1221} +var _TokenName_index = [...]uint16{0, 9, 16, 34, 48, 58, 71, 92, 113, 124, 139, 154, 161, 175, 188, 198, 212, 220, 230, 240, 252, 267, 283, 296, 310, 334, 360, 376, 389, 403, 418, 433, 448, 458, 471, 481, 493, 507, 518, 526, 534, 553, 566, 580, 594, 609, 622, 635, 648, 664, 677, 690, 702, 715, 727, 739, 753, 768, 776, 783, 790, 806, 825, 837, 852, 873, 894, 912, 932, 953, 967, 977, 997, 1018, 1035, 1053, 1070, 1084, 1094, 1103, 1113, 1129, 1139, 1149, 1162, 1172, 1184, 1193, 1205, 1213} func (i TokenName) String() string { if i < 0 || i >= TokenName(len(_TokenName_index)-1) { diff --git a/php5/php5.go b/php5/php5.go index a042f77..f787ae9 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -3474,7 +3474,7 @@ yydefault: } // save comments - yyDollar[1].token.Meta.SetTokenName(meta.TryToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) diff --git a/php5/php5.y b/php5/php5.y index cb530fa..6bbc984 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -1326,7 +1326,7 @@ unticked_statement: } // save comments - $1.Meta.SetTokenName(meta.TryToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $2.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) $4.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) diff --git a/php7/php7.go b/php7/php7.go index f2c3b86..e794f97 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -3611,7 +3611,7 @@ yydefault: } // save comments - yyDollar[1].token.Meta.SetTokenName(meta.TryToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) diff --git a/php7/php7.y b/php7/php7.y index 46d5434..e757334 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -1269,7 +1269,7 @@ statement: } // save comments - $1.Meta.SetTokenName(meta.TryToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $2.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) $4.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) diff --git a/printer/printer.go b/printer/printer.go index c93f0d3..a19e18c 100644 --- a/printer/printer.go +++ b/printer/printer.go @@ -2617,7 +2617,6 @@ func (p *Printer) printStmtTry(n node.Node) { nn := n.(*stmt.Try) p.printMeta(nn, meta.NodeStart) - p.printMeta(nn, meta.TryToken) io.WriteString(p.w, "try") p.printMeta(nn, meta.OpenCurlyBracesToken) io.WriteString(p.w, "{") diff --git a/printer/printer_test.go b/printer/printer_test.go index 8122972..dda0226 100644 --- a/printer/printer_test.go +++ b/printer/printer_test.go @@ -8386,7 +8386,7 @@ func TestPrinterPrintStmtTry(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.TryToken, + TokenName: meta.NodeStart, }, &meta.Data{ Type: meta.WhiteSpaceType, From a06dc2293464eb34d2a3ff4d00d14d235e0328af Mon Sep 17 00:00:00 2001 From: z7zmey Date: Mon, 29 Oct 2018 15:06:03 +0200 Subject: [PATCH 091/117] remove meta.UnsetToken --- meta/tokenName.go | 1 - meta/tokenName_string.go | 4 ++-- php5/php5.go | 2 +- php5/php5.y | 2 +- php7/php7.go | 2 +- php7/php7.y | 2 +- printer/printer.go | 1 - printer/printer_test.go | 2 +- 8 files changed, 7 insertions(+), 9 deletions(-) diff --git a/meta/tokenName.go b/meta/tokenName.go index c780f95..1e10ca7 100644 --- a/meta/tokenName.go +++ b/meta/tokenName.go @@ -22,7 +22,6 @@ const ( ConstToken InsteadofToken VarToken - UnsetToken ClassToken ExtendsToken ImplementsToken diff --git a/meta/tokenName_string.go b/meta/tokenName_string.go index 9a7ab97..6fe76be 100644 --- a/meta/tokenName_string.go +++ b/meta/tokenName_string.go @@ -4,9 +4,9 @@ package meta import "strconv" -const _TokenName_name = "NodeStartNodeEndStringVarnameTokenNumStringTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenEndforTokenEndforeachTokenEnddeclareTokenAsTokenEndswitchTokenFunctionTokenConstTokenInsteadofTokenVarTokenUnsetTokenClassTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenEndifTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" +const _TokenName_name = "NodeStartNodeEndStringVarnameTokenNumStringTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenEndforTokenEndforeachTokenEnddeclareTokenAsTokenEndswitchTokenFunctionTokenConstTokenInsteadofTokenVarTokenClassTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenEndifTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" -var _TokenName_index = [...]uint16{0, 9, 16, 34, 48, 58, 71, 92, 113, 124, 139, 154, 161, 175, 188, 198, 212, 220, 230, 240, 252, 267, 283, 296, 310, 334, 360, 376, 389, 403, 418, 433, 448, 458, 471, 481, 493, 507, 518, 526, 534, 553, 566, 580, 594, 609, 622, 635, 648, 664, 677, 690, 702, 715, 727, 739, 753, 768, 776, 783, 790, 806, 825, 837, 852, 873, 894, 912, 932, 953, 967, 977, 997, 1018, 1035, 1053, 1070, 1084, 1094, 1103, 1113, 1129, 1139, 1149, 1162, 1172, 1184, 1193, 1205, 1213} +var _TokenName_index = [...]uint16{0, 9, 16, 34, 48, 58, 71, 92, 113, 124, 139, 154, 161, 175, 188, 198, 212, 220, 230, 242, 257, 273, 286, 300, 324, 350, 366, 379, 393, 408, 423, 438, 448, 461, 471, 483, 497, 508, 516, 524, 543, 556, 570, 584, 599, 612, 625, 638, 654, 667, 680, 692, 705, 717, 729, 743, 758, 766, 773, 780, 796, 815, 827, 842, 863, 884, 902, 922, 943, 957, 967, 987, 1008, 1025, 1043, 1060, 1074, 1084, 1093, 1103, 1119, 1129, 1139, 1152, 1162, 1174, 1183, 1195, 1203} func (i TokenName) String() string { if i < 0 || i >= TokenName(len(_TokenName_index)-1) { diff --git a/php5/php5.go b/php5/php5.go index f787ae9..d61fb80 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -3336,7 +3336,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[5].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.UnsetToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[5].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) diff --git a/php5/php5.y b/php5/php5.y index 6bbc984..51c5ee8 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -1198,7 +1198,7 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5)) // save comments - $1.Meta.SetTokenName(meta.UnsetToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) $4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) $5.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) diff --git a/php7/php7.go b/php7/php7.go index e794f97..043d3f5 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -3499,7 +3499,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[6].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.UnsetToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) if yyDollar[4].token != nil { yyDollar[4].token.Meta.SetTokenName(meta.CommaToken).AppendTo(yyVAL.node.GetMeta()) diff --git a/php7/php7.y b/php7/php7.y index e757334..43f30b8 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -1167,7 +1167,7 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $6)) // save comments - $1.Meta.SetTokenName(meta.UnsetToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) if $4 != nil { $4.Meta.SetTokenName(meta.CommaToken).AppendTo($$.GetMeta()) diff --git a/printer/printer.go b/printer/printer.go index a19e18c..24b2bbb 100644 --- a/printer/printer.go +++ b/printer/printer.go @@ -2639,7 +2639,6 @@ func (p *Printer) printStmtUnset(n node.Node) { nn := n.(*stmt.Unset) p.printMeta(nn, meta.NodeStart) - p.printMeta(nn, meta.UnsetToken) io.WriteString(p.w, "unset") p.printMeta(nn, meta.OpenParenthesisToken) io.WriteString(p.w, "(") diff --git a/printer/printer_test.go b/printer/printer_test.go index dda0226..d6a16c6 100644 --- a/printer/printer_test.go +++ b/printer/printer_test.go @@ -8465,7 +8465,7 @@ func TestPrinterPrintStmtUnset(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.UnsetToken, + TokenName: meta.NodeStart, }, &meta.Data{ Type: meta.WhiteSpaceType, From b7e8a686faa74834d3865912cdbb5aa0fa5d767c Mon Sep 17 00:00:00 2001 From: z7zmey Date: Mon, 29 Oct 2018 15:20:37 +0200 Subject: [PATCH 092/117] remove meta.VarToken --- meta/tokenName.go | 1 - meta/tokenName_string.go | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/meta/tokenName.go b/meta/tokenName.go index 1e10ca7..12a019e 100644 --- a/meta/tokenName.go +++ b/meta/tokenName.go @@ -21,7 +21,6 @@ const ( FunctionToken ConstToken InsteadofToken - VarToken ClassToken ExtendsToken ImplementsToken diff --git a/meta/tokenName_string.go b/meta/tokenName_string.go index 6fe76be..1ae6485 100644 --- a/meta/tokenName_string.go +++ b/meta/tokenName_string.go @@ -4,9 +4,9 @@ package meta import "strconv" -const _TokenName_name = "NodeStartNodeEndStringVarnameTokenNumStringTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenEndforTokenEndforeachTokenEnddeclareTokenAsTokenEndswitchTokenFunctionTokenConstTokenInsteadofTokenVarTokenClassTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenEndifTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" +const _TokenName_name = "NodeStartNodeEndStringVarnameTokenNumStringTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenEndforTokenEndforeachTokenEnddeclareTokenAsTokenEndswitchTokenFunctionTokenConstTokenInsteadofTokenClassTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenEndifTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" -var _TokenName_index = [...]uint16{0, 9, 16, 34, 48, 58, 71, 92, 113, 124, 139, 154, 161, 175, 188, 198, 212, 220, 230, 242, 257, 273, 286, 300, 324, 350, 366, 379, 393, 408, 423, 438, 448, 461, 471, 483, 497, 508, 516, 524, 543, 556, 570, 584, 599, 612, 625, 638, 654, 667, 680, 692, 705, 717, 729, 743, 758, 766, 773, 780, 796, 815, 827, 842, 863, 884, 902, 922, 943, 957, 967, 987, 1008, 1025, 1043, 1060, 1074, 1084, 1093, 1103, 1119, 1129, 1139, 1152, 1162, 1174, 1183, 1195, 1203} +var _TokenName_index = [...]uint16{0, 9, 16, 34, 48, 58, 71, 92, 113, 124, 139, 154, 161, 175, 188, 198, 212, 222, 234, 249, 265, 278, 292, 316, 342, 358, 371, 385, 400, 415, 430, 440, 453, 463, 475, 489, 500, 508, 516, 535, 548, 562, 576, 591, 604, 617, 630, 646, 659, 672, 684, 697, 709, 721, 735, 750, 758, 765, 772, 788, 807, 819, 834, 855, 876, 894, 914, 935, 949, 959, 979, 1000, 1017, 1035, 1052, 1066, 1076, 1085, 1095, 1111, 1121, 1131, 1144, 1154, 1166, 1175, 1187, 1195} func (i TokenName) String() string { if i < 0 || i >= TokenName(len(_TokenName_index)-1) { From 3a95e7638bf4bd993f5e4a0557c2f9d0e71503ae Mon Sep 17 00:00:00 2001 From: z7zmey Date: Mon, 29 Oct 2018 15:21:41 +0200 Subject: [PATCH 093/117] remove meta.CallableToken --- meta/tokenName.go | 1 - meta/tokenName_string.go | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/meta/tokenName.go b/meta/tokenName.go index 12a019e..2f1a31b 100644 --- a/meta/tokenName.go +++ b/meta/tokenName.go @@ -25,7 +25,6 @@ const ( ExtendsToken ImplementsToken DoubleArrowToken - CallableToken CurlyOpenToken PaamayimNekudotayimToken UseLeadingNsSeparatorToken diff --git a/meta/tokenName_string.go b/meta/tokenName_string.go index 1ae6485..bdbb822 100644 --- a/meta/tokenName_string.go +++ b/meta/tokenName_string.go @@ -4,9 +4,9 @@ package meta import "strconv" -const _TokenName_name = "NodeStartNodeEndStringVarnameTokenNumStringTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenEndforTokenEndforeachTokenEnddeclareTokenAsTokenEndswitchTokenFunctionTokenConstTokenInsteadofTokenClassTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenEndifTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" +const _TokenName_name = "NodeStartNodeEndStringVarnameTokenNumStringTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenEndforTokenEndforeachTokenEnddeclareTokenAsTokenEndswitchTokenFunctionTokenConstTokenInsteadofTokenClassTokenExtendsTokenImplementsTokenDoubleArrowTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenEndifTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" -var _TokenName_index = [...]uint16{0, 9, 16, 34, 48, 58, 71, 92, 113, 124, 139, 154, 161, 175, 188, 198, 212, 222, 234, 249, 265, 278, 292, 316, 342, 358, 371, 385, 400, 415, 430, 440, 453, 463, 475, 489, 500, 508, 516, 535, 548, 562, 576, 591, 604, 617, 630, 646, 659, 672, 684, 697, 709, 721, 735, 750, 758, 765, 772, 788, 807, 819, 834, 855, 876, 894, 914, 935, 949, 959, 979, 1000, 1017, 1035, 1052, 1066, 1076, 1085, 1095, 1111, 1121, 1131, 1144, 1154, 1166, 1175, 1187, 1195} +var _TokenName_index = [...]uint16{0, 9, 16, 34, 48, 58, 71, 92, 113, 124, 139, 154, 161, 175, 188, 198, 212, 222, 234, 249, 265, 279, 303, 329, 345, 358, 372, 387, 402, 417, 427, 440, 450, 462, 476, 487, 495, 503, 522, 535, 549, 563, 578, 591, 604, 617, 633, 646, 659, 671, 684, 696, 708, 722, 737, 745, 752, 759, 775, 794, 806, 821, 842, 863, 881, 901, 922, 936, 946, 966, 987, 1004, 1022, 1039, 1053, 1063, 1072, 1082, 1098, 1108, 1118, 1131, 1141, 1153, 1162, 1174, 1182} func (i TokenName) String() string { if i < 0 || i >= TokenName(len(_TokenName_index)-1) { From 03f6b9e419f746b400fb60bbf64f27ae6832339d Mon Sep 17 00:00:00 2001 From: z7zmey Date: Mon, 29 Oct 2018 15:26:52 +0200 Subject: [PATCH 094/117] remove meta.CurlyOpenToken, meta.AbstractToken, meta.FinalToken, meta.PrivateToken, meta.ProtectedToken, meta.PublicToken --- meta/tokenName.go | 6 ------ meta/tokenName_string.go | 4 ++-- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/meta/tokenName.go b/meta/tokenName.go index 2f1a31b..0596cfa 100644 --- a/meta/tokenName.go +++ b/meta/tokenName.go @@ -25,7 +25,6 @@ const ( ExtendsToken ImplementsToken DoubleArrowToken - CurlyOpenToken PaamayimNekudotayimToken UseLeadingNsSeparatorToken NsSeparatorToken @@ -35,11 +34,6 @@ const ( LogicalAndToken InstanceofToken EndifToken - AbstractToken - FinalToken - PrivateToken - ProtectedToken - PublicToken IncToken DecToken ObjectOperatorToken diff --git a/meta/tokenName_string.go b/meta/tokenName_string.go index bdbb822..0ba33a0 100644 --- a/meta/tokenName_string.go +++ b/meta/tokenName_string.go @@ -4,9 +4,9 @@ package meta import "strconv" -const _TokenName_name = "NodeStartNodeEndStringVarnameTokenNumStringTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenEndforTokenEndforeachTokenEnddeclareTokenAsTokenEndswitchTokenFunctionTokenConstTokenInsteadofTokenClassTokenExtendsTokenImplementsTokenDoubleArrowTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenEndifTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" +const _TokenName_name = "NodeStartNodeEndStringVarnameTokenNumStringTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenEndforTokenEndforeachTokenEnddeclareTokenAsTokenEndswitchTokenFunctionTokenConstTokenInsteadofTokenClassTokenExtendsTokenImplementsTokenDoubleArrowTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenEndifTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" -var _TokenName_index = [...]uint16{0, 9, 16, 34, 48, 58, 71, 92, 113, 124, 139, 154, 161, 175, 188, 198, 212, 222, 234, 249, 265, 279, 303, 329, 345, 358, 372, 387, 402, 417, 427, 440, 450, 462, 476, 487, 495, 503, 522, 535, 549, 563, 578, 591, 604, 617, 633, 646, 659, 671, 684, 696, 708, 722, 737, 745, 752, 759, 775, 794, 806, 821, 842, 863, 881, 901, 922, 936, 946, 966, 987, 1004, 1022, 1039, 1053, 1063, 1072, 1082, 1098, 1108, 1118, 1131, 1141, 1153, 1162, 1174, 1182} +var _TokenName_index = [...]uint16{0, 9, 16, 34, 48, 58, 71, 92, 113, 124, 139, 154, 161, 175, 188, 198, 212, 222, 234, 249, 265, 289, 315, 331, 344, 358, 373, 388, 403, 413, 421, 429, 448, 461, 475, 489, 504, 517, 530, 543, 559, 572, 585, 597, 610, 622, 634, 648, 663, 671, 678, 685, 701, 720, 732, 747, 768, 789, 807, 827, 848, 862, 872, 892, 913, 930, 948, 965, 979, 989, 998, 1008, 1024, 1034, 1044, 1057, 1067, 1079, 1088, 1100, 1108} func (i TokenName) String() string { if i < 0 || i >= TokenName(len(_TokenName_index)-1) { From ef14a6c56b6e56ce36778922198dd47fb91723d7 Mon Sep 17 00:00:00 2001 From: z7zmey Date: Mon, 29 Oct 2018 15:39:15 +0200 Subject: [PATCH 095/117] remove meta.StringVarnameToken --- meta/tokenName.go | 1 - meta/tokenName_string.go | 4 +-- php5/php5.go | 43 ++++++++++++++--------------- php5/php5.y | 1 - php7/php7.go | 33 +++++++++++----------- php7/php7.y | 1 - printer/printer_parsed_php5_test.go | 22 +++++++++++++-- printer/printer_parsed_php7_test.go | 26 +++++++++++++++-- 8 files changed, 83 insertions(+), 48 deletions(-) diff --git a/meta/tokenName.go b/meta/tokenName.go index 0596cfa..1bbe192 100644 --- a/meta/tokenName.go +++ b/meta/tokenName.go @@ -7,7 +7,6 @@ type TokenName int const ( NodeStart TokenName = iota NodeEnd - StringVarnameToken NumStringToken WhileToken EndwhileToken diff --git a/meta/tokenName_string.go b/meta/tokenName_string.go index 0ba33a0..4562e92 100644 --- a/meta/tokenName_string.go +++ b/meta/tokenName_string.go @@ -4,9 +4,9 @@ package meta import "strconv" -const _TokenName_name = "NodeStartNodeEndStringVarnameTokenNumStringTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenEndforTokenEndforeachTokenEnddeclareTokenAsTokenEndswitchTokenFunctionTokenConstTokenInsteadofTokenClassTokenExtendsTokenImplementsTokenDoubleArrowTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenEndifTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" +const _TokenName_name = "NodeStartNodeEndNumStringTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenEndforTokenEndforeachTokenEnddeclareTokenAsTokenEndswitchTokenFunctionTokenConstTokenInsteadofTokenClassTokenExtendsTokenImplementsTokenDoubleArrowTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenEndifTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" -var _TokenName_index = [...]uint16{0, 9, 16, 34, 48, 58, 71, 92, 113, 124, 139, 154, 161, 175, 188, 198, 212, 222, 234, 249, 265, 289, 315, 331, 344, 358, 373, 388, 403, 413, 421, 429, 448, 461, 475, 489, 504, 517, 530, 543, 559, 572, 585, 597, 610, 622, 634, 648, 663, 671, 678, 685, 701, 720, 732, 747, 768, 789, 807, 827, 848, 862, 872, 892, 913, 930, 948, 965, 979, 989, 998, 1008, 1024, 1034, 1044, 1057, 1067, 1079, 1088, 1100, 1108} +var _TokenName_index = [...]uint16{0, 9, 16, 30, 40, 53, 74, 95, 106, 121, 136, 143, 157, 170, 180, 194, 204, 216, 231, 247, 271, 297, 313, 326, 340, 355, 370, 385, 395, 403, 411, 430, 443, 457, 471, 486, 499, 512, 525, 541, 554, 567, 579, 592, 604, 616, 630, 645, 653, 660, 667, 683, 702, 714, 729, 750, 771, 789, 809, 830, 844, 854, 874, 895, 912, 930, 947, 961, 971, 980, 990, 1006, 1016, 1026, 1039, 1049, 1061, 1070, 1082, 1090} func (i TokenName) String() string { if i < 0 || i >= TokenName(len(_TokenName_index)-1) { diff --git a/php5/php5.go b/php5/php5.go index d61fb80..43960dd 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -348,7 +348,7 @@ const yyEofCode = 1 const yyErrCode = 2 const yyInitialStackSize = 16 -//line php5/php5.y:6992 +//line php5/php5.y:6991 type simpleIndirectReference struct { all []*expr.Variable last *expr.Variable @@ -9294,7 +9294,6 @@ yydefault: // save comments yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) - yyDollar[2].token.Meta.SetTokenName(meta.StringVarnameToken).AppendTo(variable.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.OpenSquareBracket) yyDollar[5].token.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(yyVAL.node.GetMeta()) @@ -9306,7 +9305,7 @@ yydefault: } case 501: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6723 + //line php5/php5.y:6722 { yyVAL.node = yyDollar[2].node @@ -9320,7 +9319,7 @@ yydefault: } case 502: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6738 + //line php5/php5.y:6737 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) @@ -9334,7 +9333,7 @@ yydefault: } case 503: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6750 + //line php5/php5.y:6749 { // TODO: add option to handle 64 bit integer if _, err := strconv.Atoi(yyDollar[1].token.Value); err == nil { @@ -9353,7 +9352,7 @@ yydefault: } case 504: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6767 + //line php5/php5.y:6766 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(identifier) @@ -9370,7 +9369,7 @@ yydefault: } case 505: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6785 + //line php5/php5.y:6784 { yyVAL.node = expr.NewIsset(yyDollar[3].list) @@ -9386,7 +9385,7 @@ yydefault: } case 506: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6799 + //line php5/php5.y:6798 { yyVAL.node = expr.NewEmpty(yyDollar[3].node) @@ -9402,7 +9401,7 @@ yydefault: } case 507: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6813 + //line php5/php5.y:6812 { yyVAL.node = expr.NewEmpty(yyDollar[3].node) @@ -9418,7 +9417,7 @@ yydefault: } case 508: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6827 + //line php5/php5.y:6826 { yyVAL.node = expr.NewInclude(yyDollar[2].node) @@ -9432,7 +9431,7 @@ yydefault: } case 509: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6839 + //line php5/php5.y:6838 { yyVAL.node = expr.NewIncludeOnce(yyDollar[2].node) @@ -9446,7 +9445,7 @@ yydefault: } case 510: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6851 + //line php5/php5.y:6850 { yyVAL.node = expr.NewEval(yyDollar[3].node) @@ -9462,7 +9461,7 @@ yydefault: } case 511: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6865 + //line php5/php5.y:6864 { yyVAL.node = expr.NewRequire(yyDollar[2].node) @@ -9476,7 +9475,7 @@ yydefault: } case 512: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6877 + //line php5/php5.y:6876 { yyVAL.node = expr.NewRequireOnce(yyDollar[2].node) @@ -9490,7 +9489,7 @@ yydefault: } case 513: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6892 + //line php5/php5.y:6891 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -9498,7 +9497,7 @@ yydefault: } case 514: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6898 + //line php5/php5.y:6897 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -9509,7 +9508,7 @@ yydefault: } case 515: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6910 + //line php5/php5.y:6909 { yyVAL.node = yyDollar[1].node @@ -9517,7 +9516,7 @@ yydefault: } case 516: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6916 + //line php5/php5.y:6915 { yyVAL.node = yyDollar[1].node @@ -9525,7 +9524,7 @@ yydefault: } case 517: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6925 + //line php5/php5.y:6924 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -9542,7 +9541,7 @@ yydefault: } case 518: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6940 + //line php5/php5.y:6939 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -9559,7 +9558,7 @@ yydefault: } case 519: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6958 + //line php5/php5.y:6957 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -9576,7 +9575,7 @@ yydefault: } case 520: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6976 + //line php5/php5.y:6975 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) diff --git a/php5/php5.y b/php5/php5.y index 51c5ee8..e45611f 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -6709,7 +6709,6 @@ encaps_var: // save comments $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) - $2.Meta.SetTokenName(meta.StringVarnameToken).AppendTo(variable.GetMeta()) $3.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $3, meta.OpenSquareBracket) $5.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo($$.GetMeta()) diff --git a/php7/php7.go b/php7/php7.go index 043d3f5..9c18680 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -348,7 +348,7 @@ const yyEofCode = 1 const yyErrCode = 2 const yyInitialStackSize = 16 -//line php7/php7.y:5465 +//line php7/php7.y:5464 //line yacctab:1 var yyExca = [...]int{ @@ -7919,7 +7919,6 @@ yydefault: // save comments yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) - yyDollar[2].token.Meta.SetTokenName(meta.StringVarnameToken).AppendTo(variable.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.OpenSquareBracket) yyDollar[5].token.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(yyVAL.node.GetMeta()) @@ -7931,7 +7930,7 @@ yydefault: } case 475: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5248 + //line php7/php7.y:5247 { yyVAL.node = yyDollar[2].node @@ -7945,7 +7944,7 @@ yydefault: } case 476: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5263 + //line php7/php7.y:5262 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) @@ -7959,7 +7958,7 @@ yydefault: } case 477: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5275 + //line php7/php7.y:5274 { // TODO: add option to handle 64 bit integer if _, err := strconv.Atoi(yyDollar[1].token.Value); err == nil { @@ -7978,7 +7977,7 @@ yydefault: } case 478: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5292 + //line php7/php7.y:5291 { var lnumber *scalar.Lnumber // TODO: add option to handle 64 bit integer @@ -8011,7 +8010,7 @@ yydefault: } case 479: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5323 + //line php7/php7.y:5322 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(identifier) @@ -8028,7 +8027,7 @@ yydefault: } case 480: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:5341 + //line php7/php7.y:5340 { yyVAL.node = expr.NewIsset(yyDollar[3].list) @@ -8048,7 +8047,7 @@ yydefault: } case 481: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:5359 + //line php7/php7.y:5358 { yyVAL.node = expr.NewEmpty(yyDollar[3].node) @@ -8064,7 +8063,7 @@ yydefault: } case 482: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5373 + //line php7/php7.y:5372 { yyVAL.node = expr.NewInclude(yyDollar[2].node) @@ -8078,7 +8077,7 @@ yydefault: } case 483: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5385 + //line php7/php7.y:5384 { yyVAL.node = expr.NewIncludeOnce(yyDollar[2].node) @@ -8092,7 +8091,7 @@ yydefault: } case 484: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:5397 + //line php7/php7.y:5396 { yyVAL.node = expr.NewEval(yyDollar[3].node) @@ -8108,7 +8107,7 @@ yydefault: } case 485: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5411 + //line php7/php7.y:5410 { yyVAL.node = expr.NewRequire(yyDollar[2].node) @@ -8122,7 +8121,7 @@ yydefault: } case 486: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5423 + //line php7/php7.y:5422 { yyVAL.node = expr.NewRequireOnce(yyDollar[2].node) @@ -8136,7 +8135,7 @@ yydefault: } case 487: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5438 + //line php7/php7.y:5437 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -8144,7 +8143,7 @@ yydefault: } case 488: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5444 + //line php7/php7.y:5443 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -8155,7 +8154,7 @@ yydefault: } case 489: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5456 + //line php7/php7.y:5455 { yyVAL.node = yyDollar[1].node diff --git a/php7/php7.y b/php7/php7.y index 43f30b8..3118407 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -5234,7 +5234,6 @@ encaps_var: // save comments $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) - $2.Meta.SetTokenName(meta.StringVarnameToken).AppendTo(variable.GetMeta()) $3.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $3, meta.OpenSquareBracket) $5.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo($$.GetMeta()) diff --git a/printer/printer_parsed_php5_test.go b/printer/printer_parsed_php5_test.go index a6cfff8..ad79654 100644 --- a/printer/printer_parsed_php5_test.go +++ b/printer/printer_parsed_php5_test.go @@ -1356,8 +1356,6 @@ func TestParseAndPrintPhp5ComplexString1(t *testing.T) { func TestParseAndPrintPhp5ComplexString2(t *testing.T) { src := ` bar }" ; + "test ${$foo -> bar ( ) }" ; + "test ${$a . '' }" ; + ` + + actual := printPhp5(parsePhp5(src)) + + if src != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", src, actual) + } +} + +func TestParseAndPrintPhp5ComplexString4(t *testing.T) { src := ` bar }" ; + "test ${$foo -> bar ( ) }" ; + "test ${$a . '' }" ; + ` + + actual := print(parse(src)) + + if src != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", src, actual) + } +} + +func TestParseAndPrintComplexString4(t *testing.T) { src := ` Date: Mon, 29 Oct 2018 15:54:04 +0200 Subject: [PATCH 096/117] remove meta.NumStringToken --- meta/tokenName.go | 1 - meta/tokenName_string.go | 4 +-- php5/php5.go | 39 +++++++++++++---------------- php5/php5.y | 3 --- php7/php7.go | 34 ++++++++++--------------- php7/php7.y | 8 ------ printer/printer_parsed_php5_test.go | 1 + printer/printer_parsed_php7_test.go | 3 +++ 8 files changed, 37 insertions(+), 56 deletions(-) diff --git a/meta/tokenName.go b/meta/tokenName.go index 1bbe192..e1018d1 100644 --- a/meta/tokenName.go +++ b/meta/tokenName.go @@ -7,7 +7,6 @@ type TokenName int const ( NodeStart TokenName = iota NodeEnd - NumStringToken WhileToken EndwhileToken ForInitSemicolonToken diff --git a/meta/tokenName_string.go b/meta/tokenName_string.go index 4562e92..10d56de 100644 --- a/meta/tokenName_string.go +++ b/meta/tokenName_string.go @@ -4,9 +4,9 @@ package meta import "strconv" -const _TokenName_name = "NodeStartNodeEndNumStringTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenEndforTokenEndforeachTokenEnddeclareTokenAsTokenEndswitchTokenFunctionTokenConstTokenInsteadofTokenClassTokenExtendsTokenImplementsTokenDoubleArrowTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenEndifTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" +const _TokenName_name = "NodeStartNodeEndWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenEndforTokenEndforeachTokenEnddeclareTokenAsTokenEndswitchTokenFunctionTokenConstTokenInsteadofTokenClassTokenExtendsTokenImplementsTokenDoubleArrowTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenEndifTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" -var _TokenName_index = [...]uint16{0, 9, 16, 30, 40, 53, 74, 95, 106, 121, 136, 143, 157, 170, 180, 194, 204, 216, 231, 247, 271, 297, 313, 326, 340, 355, 370, 385, 395, 403, 411, 430, 443, 457, 471, 486, 499, 512, 525, 541, 554, 567, 579, 592, 604, 616, 630, 645, 653, 660, 667, 683, 702, 714, 729, 750, 771, 789, 809, 830, 844, 854, 874, 895, 912, 930, 947, 961, 971, 980, 990, 1006, 1016, 1026, 1039, 1049, 1061, 1070, 1082, 1090} +var _TokenName_index = [...]uint16{0, 9, 16, 26, 39, 60, 81, 92, 107, 122, 129, 143, 156, 166, 180, 190, 202, 217, 233, 257, 283, 299, 312, 326, 341, 356, 371, 381, 389, 397, 416, 429, 443, 457, 472, 485, 498, 511, 527, 540, 553, 565, 578, 590, 602, 616, 631, 639, 646, 653, 669, 688, 700, 715, 736, 757, 775, 795, 816, 830, 840, 860, 881, 898, 916, 933, 947, 957, 966, 976, 992, 1002, 1012, 1025, 1035, 1047, 1056, 1068, 1076} func (i TokenName) String() string { if i < 0 || i >= TokenName(len(_TokenName_index)-1) { diff --git a/php5/php5.go b/php5/php5.go index 43960dd..f704ada 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -348,7 +348,7 @@ const yyEofCode = 1 const yyErrCode = 2 const yyInitialStackSize = 16 -//line php5/php5.y:6991 +//line php5/php5.y:6988 type simpleIndirectReference struct { all []*expr.Variable last *expr.Variable @@ -9345,14 +9345,11 @@ yydefault: // save position yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NumStringToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 504: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6766 + //line php5/php5.y:6763 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(identifier) @@ -9369,7 +9366,7 @@ yydefault: } case 505: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6784 + //line php5/php5.y:6781 { yyVAL.node = expr.NewIsset(yyDollar[3].list) @@ -9385,7 +9382,7 @@ yydefault: } case 506: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6798 + //line php5/php5.y:6795 { yyVAL.node = expr.NewEmpty(yyDollar[3].node) @@ -9401,7 +9398,7 @@ yydefault: } case 507: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6812 + //line php5/php5.y:6809 { yyVAL.node = expr.NewEmpty(yyDollar[3].node) @@ -9417,7 +9414,7 @@ yydefault: } case 508: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6826 + //line php5/php5.y:6823 { yyVAL.node = expr.NewInclude(yyDollar[2].node) @@ -9431,7 +9428,7 @@ yydefault: } case 509: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6838 + //line php5/php5.y:6835 { yyVAL.node = expr.NewIncludeOnce(yyDollar[2].node) @@ -9445,7 +9442,7 @@ yydefault: } case 510: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6850 + //line php5/php5.y:6847 { yyVAL.node = expr.NewEval(yyDollar[3].node) @@ -9461,7 +9458,7 @@ yydefault: } case 511: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6864 + //line php5/php5.y:6861 { yyVAL.node = expr.NewRequire(yyDollar[2].node) @@ -9475,7 +9472,7 @@ yydefault: } case 512: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6876 + //line php5/php5.y:6873 { yyVAL.node = expr.NewRequireOnce(yyDollar[2].node) @@ -9489,7 +9486,7 @@ yydefault: } case 513: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6891 + //line php5/php5.y:6888 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -9497,7 +9494,7 @@ yydefault: } case 514: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6897 + //line php5/php5.y:6894 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -9508,7 +9505,7 @@ yydefault: } case 515: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6909 + //line php5/php5.y:6906 { yyVAL.node = yyDollar[1].node @@ -9516,7 +9513,7 @@ yydefault: } case 516: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6915 + //line php5/php5.y:6912 { yyVAL.node = yyDollar[1].node @@ -9524,7 +9521,7 @@ yydefault: } case 517: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6924 + //line php5/php5.y:6921 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -9541,7 +9538,7 @@ yydefault: } case 518: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6939 + //line php5/php5.y:6936 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -9558,7 +9555,7 @@ yydefault: } case 519: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6957 + //line php5/php5.y:6954 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -9575,7 +9572,7 @@ yydefault: } case 520: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6975 + //line php5/php5.y:6972 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) diff --git a/php5/php5.y b/php5/php5.y index e45611f..106fb41 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -6757,9 +6757,6 @@ encaps_var_offset: // save position $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - // save comments - $1.Meta.SetTokenName(meta.NumStringToken).AppendTo($$.GetMeta()) - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_VARIABLE diff --git a/php7/php7.go b/php7/php7.go index 9c18680..4fb4498 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -348,7 +348,7 @@ const yyEofCode = 1 const yyErrCode = 2 const yyInitialStackSize = 16 -//line php7/php7.y:5464 +//line php7/php7.y:5456 //line yacctab:1 var yyExca = [...]int{ @@ -7970,14 +7970,11 @@ yydefault: // save position yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NumStringToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 478: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5291 + //line php7/php7.y:5288 { var lnumber *scalar.Lnumber // TODO: add option to handle 64 bit integer @@ -8000,17 +7997,12 @@ yydefault: // save comments yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - if isInt { - yyDollar[2].token.Meta.SetTokenName(meta.NumStringToken).AppendTo(lnumber.GetMeta()) - } else { - yyDollar[2].token.Meta.SetTokenName(meta.NumStringToken).AppendTo(yyVAL.node.GetMeta()) - } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 479: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5322 + //line php7/php7.y:5314 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(identifier) @@ -8027,7 +8019,7 @@ yydefault: } case 480: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:5340 + //line php7/php7.y:5332 { yyVAL.node = expr.NewIsset(yyDollar[3].list) @@ -8047,7 +8039,7 @@ yydefault: } case 481: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:5358 + //line php7/php7.y:5350 { yyVAL.node = expr.NewEmpty(yyDollar[3].node) @@ -8063,7 +8055,7 @@ yydefault: } case 482: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5372 + //line php7/php7.y:5364 { yyVAL.node = expr.NewInclude(yyDollar[2].node) @@ -8077,7 +8069,7 @@ yydefault: } case 483: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5384 + //line php7/php7.y:5376 { yyVAL.node = expr.NewIncludeOnce(yyDollar[2].node) @@ -8091,7 +8083,7 @@ yydefault: } case 484: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:5396 + //line php7/php7.y:5388 { yyVAL.node = expr.NewEval(yyDollar[3].node) @@ -8107,7 +8099,7 @@ yydefault: } case 485: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5410 + //line php7/php7.y:5402 { yyVAL.node = expr.NewRequire(yyDollar[2].node) @@ -8121,7 +8113,7 @@ yydefault: } case 486: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5422 + //line php7/php7.y:5414 { yyVAL.node = expr.NewRequireOnce(yyDollar[2].node) @@ -8135,7 +8127,7 @@ yydefault: } case 487: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5437 + //line php7/php7.y:5429 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -8143,7 +8135,7 @@ yydefault: } case 488: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5443 + //line php7/php7.y:5435 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -8154,7 +8146,7 @@ yydefault: } case 489: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5455 + //line php7/php7.y:5447 { yyVAL.node = yyDollar[1].node diff --git a/php7/php7.y b/php7/php7.y index 3118407..7e6529f 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -5282,9 +5282,6 @@ encaps_var_offset: // save position $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - // save comments - $1.Meta.SetTokenName(meta.NumStringToken).AppendTo($$.GetMeta()) - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | '-' T_NUM_STRING @@ -5310,11 +5307,6 @@ encaps_var_offset: // save comments $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - if isInt { - $2.Meta.SetTokenName(meta.NumStringToken).AppendTo(lnumber.GetMeta()) - } else { - $2.Meta.SetTokenName(meta.NumStringToken).AppendTo($$.GetMeta()) - } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/printer/printer_parsed_php5_test.go b/printer/printer_parsed_php5_test.go index ad79654..8f8b958 100644 --- a/printer/printer_parsed_php5_test.go +++ b/printer/printer_parsed_php5_test.go @@ -1342,6 +1342,7 @@ func TestParseAndPrintPhp5ComplexString1(t *testing.T) { src := `bar" ; diff --git a/printer/printer_parsed_php7_test.go b/printer/printer_parsed_php7_test.go index dd38a12..84a3e72 100644 --- a/printer/printer_parsed_php7_test.go +++ b/printer/printer_parsed_php7_test.go @@ -1451,6 +1451,9 @@ func TestParseAndPrintComplexString1(t *testing.T) { src := `bar" ; From 11d621cb90dc21036be60935983132dbbfb5123f Mon Sep 17 00:00:00 2001 From: z7zmey Date: Fri, 14 Dec 2018 11:59:42 +0200 Subject: [PATCH 097/117] feat: add meta.Collection.FindBy method --- meta/collection.go | 13 +++++++ meta/collection_test.go | 78 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 91 insertions(+) diff --git a/meta/collection.go b/meta/collection.go index 8d47385..0264283 100644 --- a/meta/collection.go +++ b/meta/collection.go @@ -60,6 +60,19 @@ func (mc *Collection) Cut(f Filter) *Collection { return &cutted } +// FindBy filter +func (mc *Collection) FindBy(f Filter) Collection { + found := Collection{} + + for _, m := range *mc { + if fr := f(m); fr { + found = append(found, m) + } + } + + return found +} + // Filter function signature type Filter func(d *Data) bool diff --git a/meta/collection_test.go b/meta/collection_test.go index d14d738..99248ec 100644 --- a/meta/collection_test.go +++ b/meta/collection_test.go @@ -568,3 +568,81 @@ func TestCollectionCutUntilFirstToken(t *testing.T) { } } } + +func TestCollectionFindByType(t *testing.T) { + + // prepare + + whiteSpace := &meta.Data{ + Type: meta.WhiteSpaceType, + Value: "\n", + TokenName: meta.NodeStart, + } + OpenParenthesisComment := &meta.Data{ + Type: meta.CommentType, + Value: "// some comment", + TokenName: meta.NodeStart, + } + OpenParenthesisToken := &meta.Data{ + Type: meta.TokenType, + Value: "(", + TokenName: meta.OpenParenthesisToken, + } + CloseParenthesisComment := &meta.Data{ + Type: meta.WhiteSpaceType, + Value: "// some comment", + TokenName: meta.OpenParenthesisToken, + } + CloseParenthesisToken := &meta.Data{ + Type: meta.TokenType, + Value: ")", + TokenName: meta.CloseParenthesisToken, + } + + actualCollection := meta.Collection{ + whiteSpace, + OpenParenthesisComment, + OpenParenthesisToken, + CloseParenthesisComment, + CloseParenthesisToken, + } + + expectedCollection := meta.Collection{ + whiteSpace, + OpenParenthesisComment, + OpenParenthesisToken, + CloseParenthesisComment, + CloseParenthesisToken, + } + + expectedFoundCollection := meta.Collection{ + OpenParenthesisToken, + CloseParenthesisToken, + } + + // action + + actualFoundCollection := actualCollection.FindBy(meta.TypeFilter(meta.TokenType)) + + // check + + if !reflect.DeepEqual(expectedCollection, actualCollection) { + diff := pretty.Compare(expectedCollection, actualCollection) + + if diff != "" { + t.Errorf("\nexpected and actual collections are not equal\ndiff: (-expected +actual)\n%s", diff) + } else { + t.Errorf("\nexpected and actual collections are not equal\n") + } + } + + if !reflect.DeepEqual(expectedFoundCollection, actualFoundCollection) { + diff := pretty.Compare(expectedFoundCollection, actualFoundCollection) + + if diff != "" { + t.Errorf("\nexpected and actual Cut collections are not equal\ndiff: (-expected +actual)\n%s", diff) + } else { + t.Errorf("\nexpected and actual Cut collections are not equal\n") + } + } +} From 86afa319f3ad5d8cb8a88371d74c8c1a7260e34e Mon Sep 17 00:00:00 2001 From: z7zmey Date: Tue, 25 Dec 2018 10:49:44 +0200 Subject: [PATCH 098/117] #70: [php7] inherit meta.Data at stmt.Use, stmt.GroupUse, stmt.UseList, name.Name --- php7/php7.go | 841 +++++++++++++++-------------- php7/php7.y | 25 +- visitor/dumper_test.go | 4 +- visitor/go_dumper_test.go | 26 +- visitor/json_dumper_test.go | 2 +- visitor/pretty_json_dumper_test.go | 14 +- 6 files changed, 477 insertions(+), 435 deletions(-) diff --git a/php7/php7.go b/php7/php7.go index 4fb4498..6718883 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -348,7 +348,7 @@ const yyEofCode = 1 const yyErrCode = 2 const yyInitialStackSize = 16 -//line php7/php7.y:5456 +//line php7/php7.y:5477 //line yacctab:1 var yyExca = [...]int{ @@ -2643,11 +2643,14 @@ yydefault: // save position yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) + // save comments + yyDollar[1].list[0].GetMeta().Cut(meta.TokenNameFilter(meta.NodeStart)).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 83: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:401 + //line php7/php7.y:404 { yyVAL.node = name.NewRelative(yyDollar[3].list) @@ -2662,7 +2665,7 @@ yydefault: } case 84: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:414 + //line php7/php7.y:417 { yyVAL.node = name.NewFullyQualified(yyDollar[2].list) @@ -2676,7 +2679,7 @@ yydefault: } case 85: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:429 + //line php7/php7.y:432 { // error yyVAL.node = nil @@ -2685,7 +2688,7 @@ yydefault: } case 86: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:436 + //line php7/php7.y:439 { yyVAL.node = yyDollar[1].node @@ -2693,7 +2696,7 @@ yydefault: } case 87: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:442 + //line php7/php7.y:445 { yyVAL.node = yyDollar[1].node @@ -2701,7 +2704,7 @@ yydefault: } case 88: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:448 + //line php7/php7.y:451 { yyVAL.node = yyDollar[1].node @@ -2709,7 +2712,7 @@ yydefault: } case 89: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:454 + //line php7/php7.y:457 { yyVAL.node = yyDollar[1].node @@ -2717,7 +2720,7 @@ yydefault: } case 90: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:460 + //line php7/php7.y:463 { yyVAL.node = yyDollar[1].node @@ -2725,7 +2728,7 @@ yydefault: } case 91: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:466 + //line php7/php7.y:469 { yyVAL.node = stmt.NewHaltCompiler() @@ -2745,7 +2748,7 @@ yydefault: } case 92: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:484 + //line php7/php7.y:487 { name := name.NewName(yyDollar[2].list) yyVAL.node = stmt.NewNamespace(name, nil) @@ -2763,7 +2766,7 @@ yydefault: } case 93: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:500 + //line php7/php7.y:503 { name := name.NewName(yyDollar[2].list) yyVAL.node = stmt.NewNamespace(name, yyDollar[4].list) @@ -2781,7 +2784,7 @@ yydefault: } case 94: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:516 + //line php7/php7.y:519 { yyVAL.node = stmt.NewNamespace(nil, yyDollar[3].list) @@ -2797,7 +2800,7 @@ yydefault: } case 95: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:530 + //line php7/php7.y:533 { yyVAL.node = yyDollar[2].node @@ -2813,7 +2816,7 @@ yydefault: } case 96: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:544 + //line php7/php7.y:547 { yyVAL.node = yyDollar[3].node.(*stmt.GroupUse).SetUseType(yyDollar[2].node) @@ -2829,7 +2832,7 @@ yydefault: } case 97: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:558 + //line php7/php7.y:561 { yyVAL.node = stmt.NewUseList(nil, yyDollar[2].list) @@ -2845,7 +2848,7 @@ yydefault: } case 98: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:572 + //line php7/php7.y:575 { yyVAL.node = stmt.NewUseList(yyDollar[2].node, yyDollar[3].list) @@ -2861,7 +2864,7 @@ yydefault: } case 99: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:586 + //line php7/php7.y:589 { yyVAL.node = stmt.NewConstList(yyDollar[2].list) @@ -2877,7 +2880,7 @@ yydefault: } case 100: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:603 + //line php7/php7.y:606 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -2891,7 +2894,7 @@ yydefault: } case 101: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:615 + //line php7/php7.y:618 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -2905,7 +2908,7 @@ yydefault: } case 102: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:630 + //line php7/php7.y:633 { name := name.NewName(yyDollar[1].list) yyVAL.node = stmt.NewGroupUse(nil, name, yyDollar[4].list) @@ -2923,11 +2926,13 @@ yydefault: } yyDollar[6].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].list[0].GetMeta().Cut(meta.TokenNameFilter(meta.NodeStart)).AppendTo(name.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 103: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:650 + //line php7/php7.y:655 { name := name.NewName(yyDollar[2].list) yyVAL.node = stmt.NewGroupUse(nil, name, yyDollar[5].list) @@ -2947,11 +2952,13 @@ yydefault: } yyDollar[7].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[2].list[0].GetMeta().Cut(meta.TokenNameFilter(meta.NodeStart)).AppendTo(name.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 104: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:675 + //line php7/php7.y:682 { name := name.NewName(yyDollar[1].list) yyVAL.node = stmt.NewGroupUse(nil, name, yyDollar[4].list) @@ -2969,11 +2976,13 @@ yydefault: } yyDollar[6].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].list[0].GetMeta().Cut(meta.TokenNameFilter(meta.NodeStart)).AppendTo(name.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 105: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:695 + //line php7/php7.y:704 { name := name.NewName(yyDollar[2].list) yyVAL.node = stmt.NewGroupUse(nil, name, yyDollar[5].list) @@ -2993,23 +3002,25 @@ yydefault: } yyDollar[7].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[2].list[0].GetMeta().Cut(meta.TokenNameFilter(meta.NodeStart)).AppendTo(name.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 106: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:720 + //line php7/php7.y:731 { yyVAL.token = nil } case 107: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:724 + //line php7/php7.y:735 { yyVAL.token = yyDollar[1].token } case 108: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:731 + //line php7/php7.y:742 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -3020,7 +3031,7 @@ yydefault: } case 109: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:740 + //line php7/php7.y:751 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -3028,7 +3039,7 @@ yydefault: } case 110: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:749 + //line php7/php7.y:760 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -3039,7 +3050,7 @@ yydefault: } case 111: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:758 + //line php7/php7.y:769 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -3047,7 +3058,7 @@ yydefault: } case 112: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:767 + //line php7/php7.y:778 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -3058,7 +3069,7 @@ yydefault: } case 113: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:776 + //line php7/php7.y:787 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -3066,23 +3077,27 @@ yydefault: } case 114: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:785 + //line php7/php7.y:796 { yyVAL.node = yyDollar[1].node + yyDollar[1].node.(*stmt.Use).Use.GetMeta().Cut(meta.TokenNameFilter(meta.NodeStart)).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 115: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:791 + //line php7/php7.y:804 { yyVAL.node = yyDollar[2].node.(*stmt.Use).SetUseType(yyDollar[1].node) + yyDollar[1].node.GetMeta().Cut(meta.TokenNameFilter(meta.NodeStart)).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 116: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:800 + //line php7/php7.y:815 { name := name.NewName(yyDollar[1].list) yyVAL.node = stmt.NewUse(nil, name, nil) @@ -3091,11 +3106,13 @@ yydefault: name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) + yyDollar[1].list[0].GetMeta().Cut(meta.TokenNameFilter(meta.NodeStart)).AppendTo(name.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 117: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:811 + //line php7/php7.y:828 { name := name.NewName(yyDollar[1].list) alias := node.NewIdentifier(yyDollar[3].token.Value) @@ -3110,31 +3127,35 @@ yydefault: yyDollar[2].token.Meta.SetTokenName(meta.AsToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(alias.GetMeta()) + yyDollar[1].list[0].GetMeta().Cut(meta.TokenNameFilter(meta.NodeStart)).AppendTo(name.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 118: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:831 + //line php7/php7.y:850 { yyVAL.node = yyDollar[1].node + yyDollar[1].node.(*stmt.Use).Use.GetMeta().Cut(meta.TokenNameFilter(meta.NodeStart)).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 119: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:837 + //line php7/php7.y:858 { yyVAL.node = yyDollar[2].node // save comments - yyDollar[1].token.Meta.SetTokenName(meta.UseLeadingNsSeparatorToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.UseLeadingNsSeparatorToken) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 120: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:850 + //line php7/php7.y:871 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -3145,7 +3166,7 @@ yydefault: } case 121: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:859 + //line php7/php7.y:880 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -3153,7 +3174,7 @@ yydefault: } case 122: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:868 + //line php7/php7.y:889 { if yyDollar[2].node != nil { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -3163,7 +3184,7 @@ yydefault: } case 123: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:876 + //line php7/php7.y:897 { yyVAL.list = []node.Node{} @@ -3171,7 +3192,7 @@ yydefault: } case 124: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:885 + //line php7/php7.y:906 { // error yyVAL.node = nil @@ -3180,7 +3201,7 @@ yydefault: } case 125: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:892 + //line php7/php7.y:913 { yyVAL.node = yyDollar[1].node @@ -3188,7 +3209,7 @@ yydefault: } case 126: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:898 + //line php7/php7.y:919 { yyVAL.node = yyDollar[1].node @@ -3196,7 +3217,7 @@ yydefault: } case 127: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:904 + //line php7/php7.y:925 { yyVAL.node = yyDollar[1].node @@ -3204,7 +3225,7 @@ yydefault: } case 128: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:910 + //line php7/php7.y:931 { yyVAL.node = yyDollar[1].node @@ -3212,7 +3233,7 @@ yydefault: } case 129: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:916 + //line php7/php7.y:937 { yyVAL.node = yyDollar[1].node @@ -3220,7 +3241,7 @@ yydefault: } case 130: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:922 + //line php7/php7.y:943 { yyVAL.node = stmt.NewHaltCompiler() @@ -3238,7 +3259,7 @@ yydefault: } case 131: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:940 + //line php7/php7.y:961 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) @@ -3253,7 +3274,7 @@ yydefault: } case 132: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:953 + //line php7/php7.y:974 { yyVAL.node = yyDollar[1].node @@ -3261,7 +3282,7 @@ yydefault: } case 133: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:959 + //line php7/php7.y:980 { yyVAL.node = yyDollar[1].node @@ -3269,7 +3290,7 @@ yydefault: } case 134: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:965 + //line php7/php7.y:986 { switch n := yyDollar[5].node.(type) { case *stmt.While: @@ -3292,7 +3313,7 @@ yydefault: } case 135: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:986 + //line php7/php7.y:1007 { yyVAL.node = stmt.NewDo(yyDollar[2].node, yyDollar[5].node) @@ -3311,7 +3332,7 @@ yydefault: } case 136: yyDollar = yyS[yypt-9 : yypt+1] - //line php7/php7.y:1003 + //line php7/php7.y:1024 { switch n := yyDollar[9].node.(type) { case *stmt.For: @@ -3340,7 +3361,7 @@ yydefault: } case 137: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:1030 + //line php7/php7.y:1051 { switch n := yyDollar[5].node.(type) { case *stmt.Switch: @@ -3365,7 +3386,7 @@ yydefault: } case 138: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1053 + //line php7/php7.y:1074 { yyVAL.node = stmt.NewBreak(yyDollar[2].node) @@ -3381,7 +3402,7 @@ yydefault: } case 139: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1067 + //line php7/php7.y:1088 { yyVAL.node = stmt.NewContinue(yyDollar[2].node) @@ -3397,7 +3418,7 @@ yydefault: } case 140: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1081 + //line php7/php7.y:1102 { yyVAL.node = stmt.NewReturn(yyDollar[2].node) @@ -3413,7 +3434,7 @@ yydefault: } case 141: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1095 + //line php7/php7.y:1116 { yyVAL.node = stmt.NewGlobal(yyDollar[2].list) @@ -3429,7 +3450,7 @@ yydefault: } case 142: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1109 + //line php7/php7.y:1130 { yyVAL.node = stmt.NewStatic(yyDollar[2].list) @@ -3445,7 +3466,7 @@ yydefault: } case 143: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1123 + //line php7/php7.y:1144 { yyVAL.node = stmt.NewEcho(yyDollar[2].list) @@ -3462,7 +3483,7 @@ yydefault: } case 144: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1138 + //line php7/php7.y:1159 { yyVAL.node = stmt.NewInlineHtml(yyDollar[1].token.Value) @@ -3476,7 +3497,7 @@ yydefault: } case 145: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1150 + //line php7/php7.y:1171 { yyVAL.node = stmt.NewExpression(yyDollar[1].node) @@ -3491,7 +3512,7 @@ yydefault: } case 146: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1163 + //line php7/php7.y:1184 { yyVAL.node = stmt.NewUnset(yyDollar[3].list) @@ -3513,7 +3534,7 @@ yydefault: } case 147: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:1183 + //line php7/php7.y:1204 { switch n := yyDollar[7].node.(type) { case *stmt.Foreach: @@ -3539,7 +3560,7 @@ yydefault: } case 148: yyDollar = yyS[yypt-9 : yypt+1] - //line php7/php7.y:1207 + //line php7/php7.y:1228 { switch n := yyDollar[9].node.(type) { case *stmt.Foreach: @@ -3568,7 +3589,7 @@ yydefault: } case 149: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:1234 + //line php7/php7.y:1255 { yyVAL.node = yyDollar[5].node yyVAL.node.(*stmt.Declare).Consts = yyDollar[3].list @@ -3585,7 +3606,7 @@ yydefault: } case 150: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1249 + //line php7/php7.y:1270 { yyVAL.node = stmt.NewNop() @@ -3600,7 +3621,7 @@ yydefault: } case 151: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1262 + //line php7/php7.y:1283 { if yyDollar[6].node == nil { yyVAL.node = stmt.NewTry(yyDollar[3].list, yyDollar[5].list, yyDollar[6].node) @@ -3619,7 +3640,7 @@ yydefault: } case 152: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1279 + //line php7/php7.y:1300 { yyVAL.node = stmt.NewThrow(yyDollar[2].node) @@ -3635,7 +3656,7 @@ yydefault: } case 153: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1293 + //line php7/php7.y:1314 { label := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewGoto(label) @@ -3654,7 +3675,7 @@ yydefault: } case 154: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1310 + //line php7/php7.y:1331 { label := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewLabel(label) @@ -3671,7 +3692,7 @@ yydefault: } case 155: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1327 + //line php7/php7.y:1348 { yyVAL.list = []node.Node{} @@ -3679,7 +3700,7 @@ yydefault: } case 156: yyDollar = yyS[yypt-9 : yypt+1] - //line php7/php7.y:1333 + //line php7/php7.y:1354 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[5].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -3704,7 +3725,7 @@ yydefault: } case 157: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1358 + //line php7/php7.y:1379 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -3712,7 +3733,7 @@ yydefault: } case 158: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1364 + //line php7/php7.y:1385 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -3723,7 +3744,7 @@ yydefault: } case 159: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1376 + //line php7/php7.y:1397 { yyVAL.node = nil @@ -3731,7 +3752,7 @@ yydefault: } case 160: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1382 + //line php7/php7.y:1403 { yyVAL.node = stmt.NewFinally(yyDollar[3].list) @@ -3747,7 +3768,7 @@ yydefault: } case 161: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1399 + //line php7/php7.y:1420 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -3755,7 +3776,7 @@ yydefault: } case 162: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1405 + //line php7/php7.y:1426 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -3766,7 +3787,7 @@ yydefault: } case 163: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1417 + //line php7/php7.y:1438 { yyVAL.node = yyDollar[1].node @@ -3774,7 +3795,7 @@ yydefault: } case 164: yyDollar = yyS[yypt-11 : yypt+1] - //line php7/php7.y:1426 + //line php7/php7.y:1447 { name := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewFunction(name, yyDollar[2].token != nil, yyDollar[6].list, yyDollar[8].node, yyDollar[10].list, yyDollar[4].str) @@ -3798,31 +3819,31 @@ yydefault: } case 165: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1452 + //line php7/php7.y:1473 { yyVAL.token = nil } case 166: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1456 + //line php7/php7.y:1477 { yyVAL.token = yyDollar[1].token } case 167: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1463 + //line php7/php7.y:1484 { yyVAL.token = nil } case 168: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1467 + //line php7/php7.y:1488 { yyVAL.token = yyDollar[1].token } case 169: yyDollar = yyS[yypt-9 : yypt+1] - //line php7/php7.y:1474 + //line php7/php7.y:1495 { name := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewClass(name, yyDollar[1].list, nil, yyDollar[4].ClassExtends, yyDollar[5].ClassImplements, yyDollar[8].list, yyDollar[6].str) @@ -3841,7 +3862,7 @@ yydefault: } case 170: yyDollar = yyS[yypt-8 : yypt+1] - //line php7/php7.y:1491 + //line php7/php7.y:1512 { name := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewClass(name, nil, nil, yyDollar[3].ClassExtends, yyDollar[4].ClassImplements, yyDollar[7].list, yyDollar[5].str) @@ -3860,7 +3881,7 @@ yydefault: } case 171: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1511 + //line php7/php7.y:1532 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -3868,7 +3889,7 @@ yydefault: } case 172: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1517 + //line php7/php7.y:1538 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -3876,7 +3897,7 @@ yydefault: } case 173: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1526 + //line php7/php7.y:1547 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -3890,7 +3911,7 @@ yydefault: } case 174: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1538 + //line php7/php7.y:1559 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -3904,7 +3925,7 @@ yydefault: } case 175: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1553 + //line php7/php7.y:1574 { name := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewTrait(name, yyDollar[5].list, yyDollar[3].str) @@ -3923,7 +3944,7 @@ yydefault: } case 176: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:1573 + //line php7/php7.y:1594 { name := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewInterface(name, yyDollar[3].InterfaceExtends, yyDollar[6].list, yyDollar[4].str) @@ -3942,7 +3963,7 @@ yydefault: } case 177: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1593 + //line php7/php7.y:1614 { yyVAL.ClassExtends = nil @@ -3950,7 +3971,7 @@ yydefault: } case 178: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1599 + //line php7/php7.y:1620 { yyVAL.ClassExtends = stmt.NewClassExtends(yyDollar[2].node) @@ -3964,7 +3985,7 @@ yydefault: } case 179: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1614 + //line php7/php7.y:1635 { yyVAL.InterfaceExtends = nil @@ -3972,7 +3993,7 @@ yydefault: } case 180: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1620 + //line php7/php7.y:1641 { yyVAL.InterfaceExtends = stmt.NewInterfaceExtends(yyDollar[2].list) @@ -3986,7 +4007,7 @@ yydefault: } case 181: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1635 + //line php7/php7.y:1656 { yyVAL.ClassImplements = nil @@ -3994,7 +4015,7 @@ yydefault: } case 182: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1641 + //line php7/php7.y:1662 { yyVAL.ClassImplements = stmt.NewClassImplements(yyDollar[2].list) @@ -4008,7 +4029,7 @@ yydefault: } case 183: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1656 + //line php7/php7.y:1677 { yyVAL.node = yyDollar[1].node @@ -4016,7 +4037,7 @@ yydefault: } case 184: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1662 + //line php7/php7.y:1683 { yyVAL.node = expr.NewReference(yyDollar[2].node) @@ -4030,7 +4051,7 @@ yydefault: } case 185: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1674 + //line php7/php7.y:1695 { yyVAL.node = expr.NewList(yyDollar[3].list) @@ -4046,7 +4067,7 @@ yydefault: } case 186: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1688 + //line php7/php7.y:1709 { yyVAL.node = expr.NewShortList(yyDollar[2].list) @@ -4061,7 +4082,7 @@ yydefault: } case 187: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1704 + //line php7/php7.y:1725 { yyVAL.node = stmt.NewFor(nil, nil, nil, yyDollar[1].node) @@ -4072,7 +4093,7 @@ yydefault: } case 188: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1713 + //line php7/php7.y:1734 { stmtList := stmt.NewStmtList(yyDollar[2].list) yyVAL.node = stmt.NewAltFor(nil, nil, nil, stmtList) @@ -4091,7 +4112,7 @@ yydefault: } case 189: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1733 + //line php7/php7.y:1754 { yyVAL.node = stmt.NewForeach(nil, nil, nil, yyDollar[1].node) @@ -4102,7 +4123,7 @@ yydefault: } case 190: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1742 + //line php7/php7.y:1763 { stmtList := stmt.NewStmtList(yyDollar[2].list) yyVAL.node = stmt.NewAltForeach(nil, nil, nil, stmtList) @@ -4121,7 +4142,7 @@ yydefault: } case 191: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1762 + //line php7/php7.y:1783 { yyVAL.node = stmt.NewDeclare(nil, yyDollar[1].node, false) @@ -4132,7 +4153,7 @@ yydefault: } case 192: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1771 + //line php7/php7.y:1792 { stmtList := stmt.NewStmtList(yyDollar[2].list) yyVAL.node = stmt.NewDeclare(nil, stmtList, true) @@ -4151,7 +4172,7 @@ yydefault: } case 193: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1791 + //line php7/php7.y:1812 { caseList := stmt.NewCaseList(yyDollar[2].list) yyVAL.node = stmt.NewSwitch(nil, caseList) @@ -4168,7 +4189,7 @@ yydefault: } case 194: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1806 + //line php7/php7.y:1827 { caseList := stmt.NewCaseList(yyDollar[3].list) yyVAL.node = stmt.NewSwitch(nil, caseList) @@ -4187,7 +4208,7 @@ yydefault: } case 195: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1823 + //line php7/php7.y:1844 { caseList := stmt.NewCaseList(yyDollar[2].list) yyVAL.node = stmt.NewAltSwitch(nil, caseList) @@ -4206,7 +4227,7 @@ yydefault: } case 196: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:1840 + //line php7/php7.y:1861 { caseList := stmt.NewCaseList(yyDollar[3].list) @@ -4228,7 +4249,7 @@ yydefault: } case 197: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1863 + //line php7/php7.y:1884 { yyVAL.list = []node.Node{} @@ -4236,7 +4257,7 @@ yydefault: } case 198: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:1869 + //line php7/php7.y:1890 { _case := stmt.NewCase(yyDollar[3].node, yyDollar[5].list) yyVAL.list = append(yyDollar[1].list, _case) @@ -4253,7 +4274,7 @@ yydefault: } case 199: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1884 + //line php7/php7.y:1905 { _default := stmt.NewDefault(yyDollar[4].list) yyVAL.list = append(yyDollar[1].list, _default) @@ -4270,19 +4291,19 @@ yydefault: } case 200: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1902 + //line php7/php7.y:1923 { yyVAL.token = yyDollar[1].token } case 201: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1906 + //line php7/php7.y:1927 { yyVAL.token = yyDollar[1].token } case 202: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1913 + //line php7/php7.y:1934 { yyVAL.node = stmt.NewWhile(nil, yyDollar[1].node) @@ -4293,7 +4314,7 @@ yydefault: } case 203: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1922 + //line php7/php7.y:1943 { stmtList := stmt.NewStmtList(yyDollar[2].list) yyVAL.node = stmt.NewAltWhile(nil, stmtList) @@ -4312,7 +4333,7 @@ yydefault: } case 204: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:1942 + //line php7/php7.y:1963 { yyVAL.node = stmt.NewIf(yyDollar[3].node, yyDollar[5].node, nil, nil) @@ -4328,7 +4349,7 @@ yydefault: } case 205: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1956 + //line php7/php7.y:1977 { _elseIf := stmt.NewElseIf(yyDollar[4].node, yyDollar[6].node) yyVAL.node = yyDollar[1].node.(*stmt.If).AddElseIf(_elseIf) @@ -4346,7 +4367,7 @@ yydefault: } case 206: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1975 + //line php7/php7.y:1996 { yyVAL.node = yyDollar[1].node @@ -4354,7 +4375,7 @@ yydefault: } case 207: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1981 + //line php7/php7.y:2002 { _else := stmt.NewElse(yyDollar[3].node) yyVAL.node = yyDollar[1].node.(*stmt.If).SetElse(_else) @@ -4370,7 +4391,7 @@ yydefault: } case 208: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1998 + //line php7/php7.y:2019 { stmts := stmt.NewStmtList(yyDollar[6].list) yyVAL.node = stmt.NewAltIf(yyDollar[3].node, stmts, nil, nil) @@ -4389,7 +4410,7 @@ yydefault: } case 209: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:2015 + //line php7/php7.y:2036 { stmts := stmt.NewStmtList(yyDollar[7].list) _elseIf := stmt.NewAltElseIf(yyDollar[4].node, stmts) @@ -4409,7 +4430,7 @@ yydefault: } case 210: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2036 + //line php7/php7.y:2057 { yyVAL.node = yyDollar[1].node @@ -4425,7 +4446,7 @@ yydefault: } case 211: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:2050 + //line php7/php7.y:2071 { stmts := stmt.NewStmtList(yyDollar[4].list) _else := stmt.NewAltElse(stmts) @@ -4447,7 +4468,7 @@ yydefault: } case 212: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2073 + //line php7/php7.y:2094 { yyVAL.list = yyDollar[1].list @@ -4455,7 +4476,7 @@ yydefault: } case 213: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:2079 + //line php7/php7.y:2100 { yyVAL.list = nil @@ -4463,7 +4484,7 @@ yydefault: } case 214: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2088 + //line php7/php7.y:2109 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4471,7 +4492,7 @@ yydefault: } case 215: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2094 + //line php7/php7.y:2115 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4482,7 +4503,7 @@ yydefault: } case 216: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2106 + //line php7/php7.y:2127 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[4].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -4515,7 +4536,7 @@ yydefault: } case 217: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:2137 + //line php7/php7.y:2158 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[4].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -4549,7 +4570,7 @@ yydefault: } case 218: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:2172 + //line php7/php7.y:2193 { yyVAL.node = nil @@ -4557,7 +4578,7 @@ yydefault: } case 219: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2178 + //line php7/php7.y:2199 { yyVAL.node = yyDollar[1].node @@ -4565,7 +4586,7 @@ yydefault: } case 220: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2187 + //line php7/php7.y:2208 { yyVAL.node = yyDollar[1].node @@ -4573,7 +4594,7 @@ yydefault: } case 221: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2193 + //line php7/php7.y:2214 { yyVAL.node = node.NewNullable(yyDollar[2].node) @@ -4587,7 +4608,7 @@ yydefault: } case 222: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2208 + //line php7/php7.y:2229 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4601,7 +4622,7 @@ yydefault: } case 223: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2220 + //line php7/php7.y:2241 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4615,7 +4636,7 @@ yydefault: } case 224: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2232 + //line php7/php7.y:2253 { yyVAL.node = yyDollar[1].node @@ -4623,7 +4644,7 @@ yydefault: } case 225: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:2241 + //line php7/php7.y:2262 { yyVAL.node = nil @@ -4631,7 +4652,7 @@ yydefault: } case 226: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2247 + //line php7/php7.y:2268 { yyVAL.node = yyDollar[2].node @@ -4642,7 +4663,7 @@ yydefault: } case 227: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2259 + //line php7/php7.y:2280 { yyVAL.node = node.NewArgumentList(nil) @@ -4657,7 +4678,7 @@ yydefault: } case 228: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2272 + //line php7/php7.y:2293 { yyVAL.node = node.NewArgumentList(yyDollar[2].list) @@ -4676,7 +4697,7 @@ yydefault: } case 229: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2292 + //line php7/php7.y:2313 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4684,7 +4705,7 @@ yydefault: } case 230: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2298 + //line php7/php7.y:2319 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4695,7 +4716,7 @@ yydefault: } case 231: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2310 + //line php7/php7.y:2331 { yyVAL.node = node.NewArgument(yyDollar[1].node, false, false) @@ -4706,7 +4727,7 @@ yydefault: } case 232: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2319 + //line php7/php7.y:2340 { yyVAL.node = node.NewArgument(yyDollar[2].node, true, false) @@ -4720,7 +4741,7 @@ yydefault: } case 233: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2334 + //line php7/php7.y:2355 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4731,7 +4752,7 @@ yydefault: } case 234: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2343 + //line php7/php7.y:2364 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4739,7 +4760,7 @@ yydefault: } case 235: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2352 + //line php7/php7.y:2373 { yyVAL.node = yyDollar[1].node @@ -4747,7 +4768,7 @@ yydefault: } case 236: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2361 + //line php7/php7.y:2382 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4758,7 +4779,7 @@ yydefault: } case 237: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2370 + //line php7/php7.y:2391 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4766,7 +4787,7 @@ yydefault: } case 238: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2379 + //line php7/php7.y:2400 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -4785,7 +4806,7 @@ yydefault: } case 239: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2396 + //line php7/php7.y:2417 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -4805,7 +4826,7 @@ yydefault: } case 240: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2417 + //line php7/php7.y:2438 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -4813,7 +4834,7 @@ yydefault: } case 241: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:2423 + //line php7/php7.y:2444 { yyVAL.list = []node.Node{} @@ -4821,7 +4842,7 @@ yydefault: } case 242: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2432 + //line php7/php7.y:2453 { yyVAL.node = stmt.NewPropertyList(yyDollar[1].list, yyDollar[2].list) @@ -4836,7 +4857,7 @@ yydefault: } case 243: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2445 + //line php7/php7.y:2466 { yyVAL.node = stmt.NewClassConstList(yyDollar[1].list, yyDollar[3].list) @@ -4852,7 +4873,7 @@ yydefault: } case 244: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2459 + //line php7/php7.y:2480 { yyVAL.node = stmt.NewTraitUse(yyDollar[2].list, yyDollar[3].node) @@ -4866,7 +4887,7 @@ yydefault: } case 245: yyDollar = yyS[yypt-10 : yypt+1] - //line php7/php7.y:2471 + //line php7/php7.y:2492 { name := node.NewIdentifier(yyDollar[4].token.Value) yyVAL.node = stmt.NewClassMethod(name, yyDollar[1].list, yyDollar[3].token != nil, yyDollar[7].list, yyDollar[9].node, yyDollar[10].node, yyDollar[5].str) @@ -4892,7 +4913,7 @@ yydefault: } case 246: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2498 + //line php7/php7.y:2519 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4900,7 +4921,7 @@ yydefault: } case 247: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2504 + //line php7/php7.y:2525 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4911,7 +4932,7 @@ yydefault: } case 248: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2516 + //line php7/php7.y:2537 { yyVAL.node = stmt.NewNop() @@ -4925,7 +4946,7 @@ yydefault: } case 249: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2529 + //line php7/php7.y:2550 { yyVAL.node = stmt.NewTraitAdaptationList(nil) @@ -4939,7 +4960,7 @@ yydefault: } case 250: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2541 + //line php7/php7.y:2562 { yyVAL.node = stmt.NewTraitAdaptationList(yyDollar[2].list) @@ -4953,7 +4974,7 @@ yydefault: } case 251: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2556 + //line php7/php7.y:2577 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4961,7 +4982,7 @@ yydefault: } case 252: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2562 + //line php7/php7.y:2583 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -4969,7 +4990,7 @@ yydefault: } case 253: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2571 + //line php7/php7.y:2592 { yyVAL.node = yyDollar[1].node @@ -4981,7 +5002,7 @@ yydefault: } case 254: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2581 + //line php7/php7.y:2602 { yyVAL.node = yyDollar[1].node @@ -4993,7 +5014,7 @@ yydefault: } case 255: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2594 + //line php7/php7.y:2615 { yyVAL.node = stmt.NewTraitUsePrecedence(yyDollar[1].node, yyDollar[3].list) @@ -5007,7 +5028,7 @@ yydefault: } case 256: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2609 + //line php7/php7.y:2630 { alias := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, nil, alias) @@ -5024,7 +5045,7 @@ yydefault: } case 257: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2624 + //line php7/php7.y:2645 { alias := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, nil, alias) @@ -5041,7 +5062,7 @@ yydefault: } case 258: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2639 + //line php7/php7.y:2660 { alias := node.NewIdentifier(yyDollar[4].token.Value) yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, yyDollar[3].node, alias) @@ -5058,7 +5079,7 @@ yydefault: } case 259: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2654 + //line php7/php7.y:2675 { yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, yyDollar[3].node, nil) @@ -5072,7 +5093,7 @@ yydefault: } case 260: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2669 + //line php7/php7.y:2690 { name := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewTraitMethodRef(nil, name) @@ -5088,7 +5109,7 @@ yydefault: } case 261: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2683 + //line php7/php7.y:2704 { yyVAL.node = yyDollar[1].node @@ -5096,7 +5117,7 @@ yydefault: } case 262: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2692 + //line php7/php7.y:2713 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewTraitMethodRef(yyDollar[1].node, target) @@ -5113,7 +5134,7 @@ yydefault: } case 263: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2710 + //line php7/php7.y:2731 { yyVAL.node = stmt.NewNop() @@ -5128,7 +5149,7 @@ yydefault: } case 264: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2723 + //line php7/php7.y:2744 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) @@ -5143,7 +5164,7 @@ yydefault: } case 265: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2739 + //line php7/php7.y:2760 { yyVAL.list = yyDollar[1].list @@ -5151,7 +5172,7 @@ yydefault: } case 266: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2745 + //line php7/php7.y:2766 { modifier := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.list = []node.Node{modifier} @@ -5166,7 +5187,7 @@ yydefault: } case 267: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:2761 + //line php7/php7.y:2782 { yyVAL.list = nil @@ -5174,7 +5195,7 @@ yydefault: } case 268: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2767 + //line php7/php7.y:2788 { yyVAL.list = yyDollar[1].list @@ -5182,7 +5203,7 @@ yydefault: } case 269: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2776 + //line php7/php7.y:2797 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -5190,7 +5211,7 @@ yydefault: } case 270: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2782 + //line php7/php7.y:2803 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -5198,7 +5219,7 @@ yydefault: } case 271: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2791 + //line php7/php7.y:2812 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5212,7 +5233,7 @@ yydefault: } case 272: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2803 + //line php7/php7.y:2824 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5226,7 +5247,7 @@ yydefault: } case 273: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2815 + //line php7/php7.y:2836 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5240,7 +5261,7 @@ yydefault: } case 274: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2827 + //line php7/php7.y:2848 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5254,7 +5275,7 @@ yydefault: } case 275: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2839 + //line php7/php7.y:2860 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5268,7 +5289,7 @@ yydefault: } case 276: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2851 + //line php7/php7.y:2872 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5282,7 +5303,7 @@ yydefault: } case 277: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2866 + //line php7/php7.y:2887 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -5293,7 +5314,7 @@ yydefault: } case 278: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2875 + //line php7/php7.y:2896 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -5301,7 +5322,7 @@ yydefault: } case 279: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2884 + //line php7/php7.y:2905 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -5320,7 +5341,7 @@ yydefault: } case 280: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2901 + //line php7/php7.y:2922 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -5340,7 +5361,7 @@ yydefault: } case 281: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2922 + //line php7/php7.y:2943 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -5351,7 +5372,7 @@ yydefault: } case 282: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2931 + //line php7/php7.y:2952 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -5359,7 +5380,7 @@ yydefault: } case 283: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2940 + //line php7/php7.y:2961 { name := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewConstant(name, yyDollar[3].node, yyDollar[4].str) @@ -5376,7 +5397,7 @@ yydefault: } case 284: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2958 + //line php7/php7.y:2979 { name := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewConstant(name, yyDollar[3].node, yyDollar[4].str) @@ -5393,7 +5414,7 @@ yydefault: } case 285: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2976 + //line php7/php7.y:2997 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -5404,7 +5425,7 @@ yydefault: } case 286: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2985 + //line php7/php7.y:3006 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -5412,7 +5433,7 @@ yydefault: } case 287: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2994 + //line php7/php7.y:3015 { yyVAL.node = yyDollar[1].node @@ -5420,7 +5441,7 @@ yydefault: } case 288: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3003 + //line php7/php7.y:3024 { yyVAL.list = nil @@ -5428,7 +5449,7 @@ yydefault: } case 289: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3009 + //line php7/php7.y:3030 { yyVAL.list = yyDollar[1].list @@ -5436,7 +5457,7 @@ yydefault: } case 290: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3018 + //line php7/php7.y:3039 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -5447,7 +5468,7 @@ yydefault: } case 291: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3027 + //line php7/php7.y:3048 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -5455,7 +5476,7 @@ yydefault: } case 292: yyDollar = yyS[yypt-8 : yypt+1] - //line php7/php7.y:3036 + //line php7/php7.y:3057 { if yyDollar[2].node != nil { yyVAL.node = stmt.NewClass(nil, nil, yyDollar[2].node.(*node.ArgumentList), yyDollar[3].ClassExtends, yyDollar[4].ClassImplements, yyDollar[7].list, yyDollar[5].str) @@ -5475,7 +5496,7 @@ yydefault: } case 293: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3057 + //line php7/php7.y:3078 { if yyDollar[3].node != nil { yyVAL.node = expr.NewNew(yyDollar[2].node, yyDollar[3].node.(*node.ArgumentList)) @@ -5492,7 +5513,7 @@ yydefault: } case 294: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3072 + //line php7/php7.y:3093 { yyVAL.node = expr.NewNew(yyDollar[2].node, nil) @@ -5506,7 +5527,7 @@ yydefault: } case 295: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:3087 + //line php7/php7.y:3108 { list := expr.NewList(yyDollar[3].list) yyVAL.node = assign.NewAssign(list, yyDollar[6].node) @@ -5525,7 +5546,7 @@ yydefault: } case 296: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:3104 + //line php7/php7.y:3125 { shortList := expr.NewShortList(yyDollar[2].list) yyVAL.node = assign.NewAssign(shortList, yyDollar[5].node) @@ -5543,7 +5564,7 @@ yydefault: } case 297: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3120 + //line php7/php7.y:3141 { yyVAL.node = assign.NewAssign(yyDollar[1].node, yyDollar[3].node) @@ -5557,7 +5578,7 @@ yydefault: } case 298: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3132 + //line php7/php7.y:3153 { yyVAL.node = assign.NewReference(yyDollar[1].node, yyDollar[4].node) @@ -5572,7 +5593,7 @@ yydefault: } case 299: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3145 + //line php7/php7.y:3166 { yyVAL.node = expr.NewClone(yyDollar[2].node) @@ -5586,7 +5607,7 @@ yydefault: } case 300: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3157 + //line php7/php7.y:3178 { yyVAL.node = assign.NewPlus(yyDollar[1].node, yyDollar[3].node) @@ -5600,7 +5621,7 @@ yydefault: } case 301: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3169 + //line php7/php7.y:3190 { yyVAL.node = assign.NewMinus(yyDollar[1].node, yyDollar[3].node) @@ -5614,7 +5635,7 @@ yydefault: } case 302: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3181 + //line php7/php7.y:3202 { yyVAL.node = assign.NewMul(yyDollar[1].node, yyDollar[3].node) @@ -5628,7 +5649,7 @@ yydefault: } case 303: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3193 + //line php7/php7.y:3214 { yyVAL.node = assign.NewPow(yyDollar[1].node, yyDollar[3].node) @@ -5642,7 +5663,7 @@ yydefault: } case 304: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3205 + //line php7/php7.y:3226 { yyVAL.node = assign.NewDiv(yyDollar[1].node, yyDollar[3].node) @@ -5656,7 +5677,7 @@ yydefault: } case 305: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3217 + //line php7/php7.y:3238 { yyVAL.node = assign.NewConcat(yyDollar[1].node, yyDollar[3].node) @@ -5670,7 +5691,7 @@ yydefault: } case 306: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3229 + //line php7/php7.y:3250 { yyVAL.node = assign.NewMod(yyDollar[1].node, yyDollar[3].node) @@ -5684,7 +5705,7 @@ yydefault: } case 307: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3241 + //line php7/php7.y:3262 { yyVAL.node = assign.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) @@ -5698,7 +5719,7 @@ yydefault: } case 308: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3253 + //line php7/php7.y:3274 { yyVAL.node = assign.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) @@ -5712,7 +5733,7 @@ yydefault: } case 309: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3265 + //line php7/php7.y:3286 { yyVAL.node = assign.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) @@ -5726,7 +5747,7 @@ yydefault: } case 310: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3277 + //line php7/php7.y:3298 { yyVAL.node = assign.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) @@ -5740,7 +5761,7 @@ yydefault: } case 311: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3289 + //line php7/php7.y:3310 { yyVAL.node = assign.NewShiftRight(yyDollar[1].node, yyDollar[3].node) @@ -5754,7 +5775,7 @@ yydefault: } case 312: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3301 + //line php7/php7.y:3322 { yyVAL.node = expr.NewPostInc(yyDollar[1].node) @@ -5768,7 +5789,7 @@ yydefault: } case 313: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3313 + //line php7/php7.y:3334 { yyVAL.node = expr.NewPreInc(yyDollar[2].node) @@ -5782,7 +5803,7 @@ yydefault: } case 314: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3325 + //line php7/php7.y:3346 { yyVAL.node = expr.NewPostDec(yyDollar[1].node) @@ -5796,7 +5817,7 @@ yydefault: } case 315: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3337 + //line php7/php7.y:3358 { yyVAL.node = expr.NewPreDec(yyDollar[2].node) @@ -5810,7 +5831,7 @@ yydefault: } case 316: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3349 + //line php7/php7.y:3370 { yyVAL.node = binary.NewBooleanOr(yyDollar[1].node, yyDollar[3].node) @@ -5824,7 +5845,7 @@ yydefault: } case 317: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3361 + //line php7/php7.y:3382 { yyVAL.node = binary.NewBooleanAnd(yyDollar[1].node, yyDollar[3].node) @@ -5838,7 +5859,7 @@ yydefault: } case 318: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3373 + //line php7/php7.y:3394 { yyVAL.node = binary.NewLogicalOr(yyDollar[1].node, yyDollar[3].node) @@ -5852,7 +5873,7 @@ yydefault: } case 319: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3385 + //line php7/php7.y:3406 { yyVAL.node = binary.NewLogicalAnd(yyDollar[1].node, yyDollar[3].node) @@ -5866,7 +5887,7 @@ yydefault: } case 320: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3397 + //line php7/php7.y:3418 { yyVAL.node = binary.NewLogicalXor(yyDollar[1].node, yyDollar[3].node) @@ -5880,7 +5901,7 @@ yydefault: } case 321: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3409 + //line php7/php7.y:3430 { yyVAL.node = binary.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) @@ -5894,7 +5915,7 @@ yydefault: } case 322: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3421 + //line php7/php7.y:3442 { yyVAL.node = binary.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) @@ -5908,7 +5929,7 @@ yydefault: } case 323: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3433 + //line php7/php7.y:3454 { yyVAL.node = binary.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) @@ -5922,7 +5943,7 @@ yydefault: } case 324: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3445 + //line php7/php7.y:3466 { yyVAL.node = binary.NewConcat(yyDollar[1].node, yyDollar[3].node) @@ -5936,7 +5957,7 @@ yydefault: } case 325: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3457 + //line php7/php7.y:3478 { yyVAL.node = binary.NewPlus(yyDollar[1].node, yyDollar[3].node) @@ -5950,7 +5971,7 @@ yydefault: } case 326: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3469 + //line php7/php7.y:3490 { yyVAL.node = binary.NewMinus(yyDollar[1].node, yyDollar[3].node) @@ -5964,7 +5985,7 @@ yydefault: } case 327: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3481 + //line php7/php7.y:3502 { yyVAL.node = binary.NewMul(yyDollar[1].node, yyDollar[3].node) @@ -5978,7 +5999,7 @@ yydefault: } case 328: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3493 + //line php7/php7.y:3514 { yyVAL.node = binary.NewPow(yyDollar[1].node, yyDollar[3].node) @@ -5992,7 +6013,7 @@ yydefault: } case 329: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3505 + //line php7/php7.y:3526 { yyVAL.node = binary.NewDiv(yyDollar[1].node, yyDollar[3].node) @@ -6006,7 +6027,7 @@ yydefault: } case 330: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3517 + //line php7/php7.y:3538 { yyVAL.node = binary.NewMod(yyDollar[1].node, yyDollar[3].node) @@ -6020,7 +6041,7 @@ yydefault: } case 331: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3529 + //line php7/php7.y:3550 { yyVAL.node = binary.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) @@ -6034,7 +6055,7 @@ yydefault: } case 332: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3541 + //line php7/php7.y:3562 { yyVAL.node = binary.NewShiftRight(yyDollar[1].node, yyDollar[3].node) @@ -6048,7 +6069,7 @@ yydefault: } case 333: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3553 + //line php7/php7.y:3574 { yyVAL.node = expr.NewUnaryPlus(yyDollar[2].node) @@ -6062,7 +6083,7 @@ yydefault: } case 334: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3565 + //line php7/php7.y:3586 { yyVAL.node = expr.NewUnaryMinus(yyDollar[2].node) @@ -6076,7 +6097,7 @@ yydefault: } case 335: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3577 + //line php7/php7.y:3598 { yyVAL.node = expr.NewBooleanNot(yyDollar[2].node) @@ -6090,7 +6111,7 @@ yydefault: } case 336: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3589 + //line php7/php7.y:3610 { yyVAL.node = expr.NewBitwiseNot(yyDollar[2].node) @@ -6104,7 +6125,7 @@ yydefault: } case 337: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3601 + //line php7/php7.y:3622 { yyVAL.node = binary.NewIdentical(yyDollar[1].node, yyDollar[3].node) @@ -6118,7 +6139,7 @@ yydefault: } case 338: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3613 + //line php7/php7.y:3634 { yyVAL.node = binary.NewNotIdentical(yyDollar[1].node, yyDollar[3].node) @@ -6132,7 +6153,7 @@ yydefault: } case 339: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3625 + //line php7/php7.y:3646 { yyVAL.node = binary.NewEqual(yyDollar[1].node, yyDollar[3].node) @@ -6146,7 +6167,7 @@ yydefault: } case 340: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3637 + //line php7/php7.y:3658 { yyVAL.node = binary.NewNotEqual(yyDollar[1].node, yyDollar[3].node) @@ -6161,7 +6182,7 @@ yydefault: } case 341: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3650 + //line php7/php7.y:3671 { yyVAL.node = binary.NewSmaller(yyDollar[1].node, yyDollar[3].node) @@ -6175,7 +6196,7 @@ yydefault: } case 342: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3662 + //line php7/php7.y:3683 { yyVAL.node = binary.NewSmallerOrEqual(yyDollar[1].node, yyDollar[3].node) @@ -6189,7 +6210,7 @@ yydefault: } case 343: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3674 + //line php7/php7.y:3695 { yyVAL.node = binary.NewGreater(yyDollar[1].node, yyDollar[3].node) @@ -6203,7 +6224,7 @@ yydefault: } case 344: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3686 + //line php7/php7.y:3707 { yyVAL.node = binary.NewGreaterOrEqual(yyDollar[1].node, yyDollar[3].node) @@ -6217,7 +6238,7 @@ yydefault: } case 345: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3698 + //line php7/php7.y:3719 { yyVAL.node = binary.NewSpaceship(yyDollar[1].node, yyDollar[3].node) @@ -6231,7 +6252,7 @@ yydefault: } case 346: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3710 + //line php7/php7.y:3731 { yyVAL.node = expr.NewInstanceOf(yyDollar[1].node, yyDollar[3].node) @@ -6245,7 +6266,7 @@ yydefault: } case 347: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3722 + //line php7/php7.y:3743 { yyVAL.node = yyDollar[2].node @@ -6259,7 +6280,7 @@ yydefault: } case 348: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3734 + //line php7/php7.y:3755 { yyVAL.node = yyDollar[1].node @@ -6267,7 +6288,7 @@ yydefault: } case 349: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:3740 + //line php7/php7.y:3761 { yyVAL.node = expr.NewTernary(yyDollar[1].node, yyDollar[3].node, yyDollar[5].node) @@ -6282,7 +6303,7 @@ yydefault: } case 350: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3753 + //line php7/php7.y:3774 { yyVAL.node = expr.NewTernary(yyDollar[1].node, nil, yyDollar[4].node) @@ -6297,7 +6318,7 @@ yydefault: } case 351: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3766 + //line php7/php7.y:3787 { yyVAL.node = binary.NewCoalesce(yyDollar[1].node, yyDollar[3].node) @@ -6311,7 +6332,7 @@ yydefault: } case 352: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3778 + //line php7/php7.y:3799 { yyVAL.node = yyDollar[1].node @@ -6319,7 +6340,7 @@ yydefault: } case 353: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3784 + //line php7/php7.y:3805 { yyVAL.node = cast.NewInt(yyDollar[2].node) @@ -6334,7 +6355,7 @@ yydefault: } case 354: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3797 + //line php7/php7.y:3818 { yyVAL.node = cast.NewDouble(yyDollar[2].node) @@ -6349,7 +6370,7 @@ yydefault: } case 355: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3810 + //line php7/php7.y:3831 { yyVAL.node = cast.NewString(yyDollar[2].node) @@ -6364,7 +6385,7 @@ yydefault: } case 356: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3823 + //line php7/php7.y:3844 { yyVAL.node = cast.NewArray(yyDollar[2].node) @@ -6379,7 +6400,7 @@ yydefault: } case 357: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3836 + //line php7/php7.y:3857 { yyVAL.node = cast.NewObject(yyDollar[2].node) @@ -6394,7 +6415,7 @@ yydefault: } case 358: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3849 + //line php7/php7.y:3870 { yyVAL.node = cast.NewBool(yyDollar[2].node) @@ -6409,7 +6430,7 @@ yydefault: } case 359: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3862 + //line php7/php7.y:3883 { yyVAL.node = cast.NewUnset(yyDollar[2].node) @@ -6424,7 +6445,7 @@ yydefault: } case 360: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3875 + //line php7/php7.y:3896 { var e *expr.Exit if yyDollar[2].node != nil { @@ -6453,7 +6474,7 @@ yydefault: } case 361: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3902 + //line php7/php7.y:3923 { yyVAL.node = expr.NewErrorSuppress(yyDollar[2].node) @@ -6467,7 +6488,7 @@ yydefault: } case 362: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3914 + //line php7/php7.y:3935 { yyVAL.node = yyDollar[1].node @@ -6475,7 +6496,7 @@ yydefault: } case 363: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3920 + //line php7/php7.y:3941 { yyVAL.node = expr.NewShellExec(yyDollar[2].list) @@ -6489,7 +6510,7 @@ yydefault: } case 364: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3932 + //line php7/php7.y:3953 { yyVAL.node = expr.NewPrint(yyDollar[2].node) @@ -6503,7 +6524,7 @@ yydefault: } case 365: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3944 + //line php7/php7.y:3965 { yyVAL.node = expr.NewYield(nil, nil) @@ -6517,7 +6538,7 @@ yydefault: } case 366: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3956 + //line php7/php7.y:3977 { yyVAL.node = expr.NewYield(nil, yyDollar[2].node) @@ -6531,7 +6552,7 @@ yydefault: } case 367: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3968 + //line php7/php7.y:3989 { yyVAL.node = expr.NewYield(yyDollar[2].node, yyDollar[4].node) @@ -6546,7 +6567,7 @@ yydefault: } case 368: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3981 + //line php7/php7.y:4002 { yyVAL.node = expr.NewYieldFrom(yyDollar[2].node) @@ -6560,7 +6581,7 @@ yydefault: } case 369: yyDollar = yyS[yypt-11 : yypt+1] - //line php7/php7.y:3993 + //line php7/php7.y:4014 { yyVAL.node = expr.NewClosure(yyDollar[5].list, yyDollar[7].ClosureUse, yyDollar[8].node, yyDollar[10].list, false, yyDollar[2].token != nil, yyDollar[3].str) @@ -6581,7 +6602,7 @@ yydefault: } case 370: yyDollar = yyS[yypt-12 : yypt+1] - //line php7/php7.y:4012 + //line php7/php7.y:4033 { yyVAL.node = expr.NewClosure(yyDollar[6].list, yyDollar[8].ClosureUse, yyDollar[9].node, yyDollar[11].list, true, yyDollar[3].token != nil, yyDollar[4].str) @@ -6603,7 +6624,7 @@ yydefault: } case 371: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4035 + //line php7/php7.y:4056 { yyVAL.str = yylex.(*Parser).PhpDocComment yylex.(*Parser).PhpDocComment = "" @@ -6612,19 +6633,19 @@ yydefault: } case 372: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4045 + //line php7/php7.y:4066 { yyVAL.token = nil } case 373: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4049 + //line php7/php7.y:4070 { yyVAL.token = yyDollar[1].token } case 374: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4056 + //line php7/php7.y:4077 { yyVAL.ClosureUse = nil @@ -6632,7 +6653,7 @@ yydefault: } case 375: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4062 + //line php7/php7.y:4083 { yyVAL.ClosureUse = expr.NewClosureUse(yyDollar[3].list) @@ -6648,7 +6669,7 @@ yydefault: } case 376: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4079 + //line php7/php7.y:4100 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -6659,7 +6680,7 @@ yydefault: } case 377: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4088 + //line php7/php7.y:4109 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -6667,7 +6688,7 @@ yydefault: } case 378: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4097 + //line php7/php7.y:4118 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(identifier) @@ -6684,7 +6705,7 @@ yydefault: } case 379: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4112 + //line php7/php7.y:4133 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[2].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -6704,7 +6725,7 @@ yydefault: } case 380: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4133 + //line php7/php7.y:4154 { yyVAL.node = expr.NewFunctionCall(yyDollar[1].node, yyDollar[2].node.(*node.ArgumentList)) @@ -6715,7 +6736,7 @@ yydefault: } case 381: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4142 + //line php7/php7.y:4163 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -6729,7 +6750,7 @@ yydefault: } case 382: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4154 + //line php7/php7.y:4175 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -6743,7 +6764,7 @@ yydefault: } case 383: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4166 + //line php7/php7.y:4187 { yyVAL.node = expr.NewFunctionCall(yyDollar[1].node, yyDollar[2].node.(*node.ArgumentList)) @@ -6754,7 +6775,7 @@ yydefault: } case 384: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4178 + //line php7/php7.y:4199 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -6768,7 +6789,7 @@ yydefault: } case 385: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4190 + //line php7/php7.y:4211 { yyVAL.node = yyDollar[1].node @@ -6776,7 +6797,7 @@ yydefault: } case 386: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4199 + //line php7/php7.y:4220 { yyVAL.node = yyDollar[1].node @@ -6784,7 +6805,7 @@ yydefault: } case 387: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4205 + //line php7/php7.y:4226 { yyVAL.node = yyDollar[1].node @@ -6792,7 +6813,7 @@ yydefault: } case 388: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4214 + //line php7/php7.y:4235 { yyVAL.node = nil @@ -6800,7 +6821,7 @@ yydefault: } case 389: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4220 + //line php7/php7.y:4241 { yyVAL.node = expr.NewExit(yyDollar[2].node) @@ -6817,7 +6838,7 @@ yydefault: } case 390: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4238 + //line php7/php7.y:4259 { yyVAL.list = []node.Node{} @@ -6825,7 +6846,7 @@ yydefault: } case 391: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4244 + //line php7/php7.y:4265 { yyVAL.list = []node.Node{scalar.NewEncapsedStringPart(yyDollar[1].token.Value)} @@ -6833,7 +6854,7 @@ yydefault: } case 392: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4250 + //line php7/php7.y:4271 { yyVAL.list = yyDollar[1].list @@ -6841,7 +6862,7 @@ yydefault: } case 393: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4259 + //line php7/php7.y:4280 { yyVAL.node = nil @@ -6849,7 +6870,7 @@ yydefault: } case 394: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4265 + //line php7/php7.y:4286 { yyVAL.node = yyDollar[1].node @@ -6857,7 +6878,7 @@ yydefault: } case 395: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4274 + //line php7/php7.y:4295 { yyVAL.node = expr.NewArray(yyDollar[3].list) @@ -6873,7 +6894,7 @@ yydefault: } case 396: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4288 + //line php7/php7.y:4309 { yyVAL.node = expr.NewShortArray(yyDollar[2].list) @@ -6888,7 +6909,7 @@ yydefault: } case 397: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4301 + //line php7/php7.y:4322 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) @@ -6902,7 +6923,7 @@ yydefault: } case 398: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4316 + //line php7/php7.y:4337 { yyVAL.node = scalar.NewLnumber(yyDollar[1].token.Value) @@ -6916,7 +6937,7 @@ yydefault: } case 399: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4328 + //line php7/php7.y:4349 { yyVAL.node = scalar.NewDnumber(yyDollar[1].token.Value) @@ -6930,7 +6951,7 @@ yydefault: } case 400: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4340 + //line php7/php7.y:4361 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6944,7 +6965,7 @@ yydefault: } case 401: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4352 + //line php7/php7.y:4373 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6958,7 +6979,7 @@ yydefault: } case 402: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4364 + //line php7/php7.y:4385 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6972,7 +6993,7 @@ yydefault: } case 403: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4376 + //line php7/php7.y:4397 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6986,7 +7007,7 @@ yydefault: } case 404: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4388 + //line php7/php7.y:4409 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7000,7 +7021,7 @@ yydefault: } case 405: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4400 + //line php7/php7.y:4421 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7014,7 +7035,7 @@ yydefault: } case 406: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4412 + //line php7/php7.y:4433 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7028,7 +7049,7 @@ yydefault: } case 407: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4424 + //line php7/php7.y:4445 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7042,7 +7063,7 @@ yydefault: } case 408: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4436 + //line php7/php7.y:4457 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, []node.Node{encapsed}) @@ -7058,7 +7079,7 @@ yydefault: } case 409: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4450 + //line php7/php7.y:4471 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, nil) @@ -7072,7 +7093,7 @@ yydefault: } case 410: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4462 + //line php7/php7.y:4483 { yyVAL.node = scalar.NewEncapsed(yyDollar[2].list) @@ -7086,7 +7107,7 @@ yydefault: } case 411: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4474 + //line php7/php7.y:4495 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, yyDollar[2].list) @@ -7100,7 +7121,7 @@ yydefault: } case 412: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4486 + //line php7/php7.y:4507 { yyVAL.node = yyDollar[1].node @@ -7108,7 +7129,7 @@ yydefault: } case 413: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4492 + //line php7/php7.y:4513 { yyVAL.node = yyDollar[1].node @@ -7116,7 +7137,7 @@ yydefault: } case 414: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4501 + //line php7/php7.y:4522 { yyVAL.node = expr.NewConstFetch(yyDollar[1].node) @@ -7127,7 +7148,7 @@ yydefault: } case 415: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4510 + //line php7/php7.y:4531 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -7144,7 +7165,7 @@ yydefault: } case 416: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4525 + //line php7/php7.y:4546 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -7161,7 +7182,7 @@ yydefault: } case 417: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4543 + //line php7/php7.y:4564 { yyVAL.node = yyDollar[1].node @@ -7169,7 +7190,7 @@ yydefault: } case 418: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4549 + //line php7/php7.y:4570 { yyVAL.node = yyDollar[1].node @@ -7177,7 +7198,7 @@ yydefault: } case 419: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4558 + //line php7/php7.y:4579 { yyVAL.node = nil @@ -7185,7 +7206,7 @@ yydefault: } case 420: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4564 + //line php7/php7.y:4585 { yyVAL.node = yyDollar[1].node @@ -7193,7 +7214,7 @@ yydefault: } case 421: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4573 + //line php7/php7.y:4594 { yyVAL.node = yyDollar[1].node @@ -7201,7 +7222,7 @@ yydefault: } case 422: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4582 + //line php7/php7.y:4603 { yyVAL.node = yyDollar[1].node @@ -7209,7 +7230,7 @@ yydefault: } case 423: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4588 + //line php7/php7.y:4609 { yyVAL.node = yyDollar[2].node @@ -7223,7 +7244,7 @@ yydefault: } case 424: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4600 + //line php7/php7.y:4621 { yyVAL.node = yyDollar[1].node @@ -7231,7 +7252,7 @@ yydefault: } case 425: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4609 + //line php7/php7.y:4630 { yyVAL.node = yyDollar[1].node @@ -7239,7 +7260,7 @@ yydefault: } case 426: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4615 + //line php7/php7.y:4636 { yyVAL.node = yyDollar[2].node @@ -7253,7 +7274,7 @@ yydefault: } case 427: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4627 + //line php7/php7.y:4648 { yyVAL.node = yyDollar[1].node @@ -7261,7 +7282,7 @@ yydefault: } case 428: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4636 + //line php7/php7.y:4657 { yyVAL.node = yyDollar[1].node @@ -7269,7 +7290,7 @@ yydefault: } case 429: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4642 + //line php7/php7.y:4663 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -7286,7 +7307,7 @@ yydefault: } case 430: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4657 + //line php7/php7.y:4678 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -7303,7 +7324,7 @@ yydefault: } case 431: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4672 + //line php7/php7.y:4693 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -7320,7 +7341,7 @@ yydefault: } case 432: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4687 + //line php7/php7.y:4708 { yyVAL.node = expr.NewMethodCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -7334,7 +7355,7 @@ yydefault: } case 433: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4699 + //line php7/php7.y:4720 { yyVAL.node = yyDollar[1].node @@ -7342,7 +7363,7 @@ yydefault: } case 434: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4708 + //line php7/php7.y:4729 { yyVAL.node = yyDollar[1].node @@ -7350,7 +7371,7 @@ yydefault: } case 435: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4714 + //line php7/php7.y:4735 { yyVAL.node = yyDollar[1].node @@ -7358,7 +7379,7 @@ yydefault: } case 436: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4720 + //line php7/php7.y:4741 { yyVAL.node = expr.NewPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -7372,7 +7393,7 @@ yydefault: } case 437: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4735 + //line php7/php7.y:4756 { name := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(name) @@ -7389,7 +7410,7 @@ yydefault: } case 438: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4750 + //line php7/php7.y:4771 { yyVAL.node = expr.NewVariable(yyDollar[3].node) @@ -7408,7 +7429,7 @@ yydefault: } case 439: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4767 + //line php7/php7.y:4788 { yyVAL.node = expr.NewVariable(yyDollar[2].node) @@ -7423,7 +7444,7 @@ yydefault: } case 440: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4783 + //line php7/php7.y:4804 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -7437,7 +7458,7 @@ yydefault: } case 441: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4795 + //line php7/php7.y:4816 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -7451,7 +7472,7 @@ yydefault: } case 442: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4810 + //line php7/php7.y:4831 { yyVAL.node = yyDollar[1].node @@ -7459,7 +7480,7 @@ yydefault: } case 443: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4816 + //line php7/php7.y:4837 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -7476,7 +7497,7 @@ yydefault: } case 444: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4831 + //line php7/php7.y:4852 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -7493,7 +7514,7 @@ yydefault: } case 445: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4846 + //line php7/php7.y:4867 { yyVAL.node = expr.NewPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -7507,7 +7528,7 @@ yydefault: } case 446: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4858 + //line php7/php7.y:4879 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -7521,7 +7542,7 @@ yydefault: } case 447: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4870 + //line php7/php7.y:4891 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -7535,7 +7556,7 @@ yydefault: } case 448: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4885 + //line php7/php7.y:4906 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -7549,7 +7570,7 @@ yydefault: } case 449: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4897 + //line php7/php7.y:4918 { yyVAL.node = yyDollar[2].node @@ -7563,7 +7584,7 @@ yydefault: } case 450: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4909 + //line php7/php7.y:4930 { yyVAL.node = yyDollar[1].node @@ -7571,7 +7592,7 @@ yydefault: } case 451: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4918 + //line php7/php7.y:4939 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -7585,7 +7606,7 @@ yydefault: } case 452: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4930 + //line php7/php7.y:4951 { yyVAL.node = yyDollar[2].node @@ -7599,7 +7620,7 @@ yydefault: } case 453: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4942 + //line php7/php7.y:4963 { yyVAL.node = yyDollar[1].node @@ -7607,7 +7628,7 @@ yydefault: } case 454: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4951 + //line php7/php7.y:4972 { yyVAL.list = yyDollar[1].list @@ -7615,7 +7636,7 @@ yydefault: } case 455: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4960 + //line php7/php7.y:4981 { yyVAL.node = expr.NewArrayItem(nil, nil) @@ -7623,7 +7644,7 @@ yydefault: } case 456: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4966 + //line php7/php7.y:4987 { yyVAL.node = yyDollar[1].node @@ -7631,7 +7652,7 @@ yydefault: } case 457: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4975 + //line php7/php7.y:4996 { if len(yyDollar[1].list) == 0 { yyDollar[1].list = []node.Node{expr.NewArrayItem(nil, nil)} @@ -7646,7 +7667,7 @@ yydefault: } case 458: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4988 + //line php7/php7.y:5009 { if yyDollar[1].node.(*expr.ArrayItem).Key == nil && yyDollar[1].node.(*expr.ArrayItem).Val == nil { yyVAL.list = []node.Node{} @@ -7658,7 +7679,7 @@ yydefault: } case 459: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5001 + //line php7/php7.y:5022 { yyVAL.node = expr.NewArrayItem(yyDollar[1].node, yyDollar[3].node) @@ -7672,7 +7693,7 @@ yydefault: } case 460: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5013 + //line php7/php7.y:5034 { yyVAL.node = expr.NewArrayItem(nil, yyDollar[1].node) @@ -7683,7 +7704,7 @@ yydefault: } case 461: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:5022 + //line php7/php7.y:5043 { reference := expr.NewReference(yyDollar[4].node) yyVAL.node = expr.NewArrayItem(yyDollar[1].node, reference) @@ -7700,7 +7721,7 @@ yydefault: } case 462: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5037 + //line php7/php7.y:5058 { reference := expr.NewReference(yyDollar[2].node) yyVAL.node = expr.NewArrayItem(nil, reference) @@ -7716,7 +7737,7 @@ yydefault: } case 463: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:5051 + //line php7/php7.y:5072 { // TODO: Cannot use list() as standalone expression list := expr.NewList(yyDollar[5].list) @@ -7736,7 +7757,7 @@ yydefault: } case 464: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:5069 + //line php7/php7.y:5090 { // TODO: Cannot use list() as standalone expression list := expr.NewList(yyDollar[3].list) @@ -7755,7 +7776,7 @@ yydefault: } case 465: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5089 + //line php7/php7.y:5110 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -7763,7 +7784,7 @@ yydefault: } case 466: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5095 + //line php7/php7.y:5116 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yyVAL.list = append(yyDollar[1].list, encapsed) @@ -7778,7 +7799,7 @@ yydefault: } case 467: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5108 + //line php7/php7.y:5129 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -7786,7 +7807,7 @@ yydefault: } case 468: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5114 + //line php7/php7.y:5135 { encapsed := scalar.NewEncapsedStringPart(yyDollar[1].token.Value) yyVAL.list = []node.Node{encapsed, yyDollar[2].node} @@ -7801,7 +7822,7 @@ yydefault: } case 469: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5130 + //line php7/php7.y:5151 { name := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(name) @@ -7818,7 +7839,7 @@ yydefault: } case 470: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:5145 + //line php7/php7.y:5166 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -7841,7 +7862,7 @@ yydefault: } case 471: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5166 + //line php7/php7.y:5187 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -7864,7 +7885,7 @@ yydefault: } case 472: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5187 + //line php7/php7.y:5208 { variable := expr.NewVariable(yyDollar[2].node) @@ -7883,7 +7904,7 @@ yydefault: } case 473: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5204 + //line php7/php7.y:5225 { name := node.NewIdentifier(yyDollar[2].token.Value) variable := expr.NewVariable(name) @@ -7905,7 +7926,7 @@ yydefault: } case 474: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:5224 + //line php7/php7.y:5245 { identifier := node.NewIdentifier(yyDollar[2].token.Value) variable := expr.NewVariable(identifier) @@ -7930,7 +7951,7 @@ yydefault: } case 475: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5247 + //line php7/php7.y:5268 { yyVAL.node = yyDollar[2].node @@ -7944,7 +7965,7 @@ yydefault: } case 476: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5262 + //line php7/php7.y:5283 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) @@ -7958,7 +7979,7 @@ yydefault: } case 477: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5274 + //line php7/php7.y:5295 { // TODO: add option to handle 64 bit integer if _, err := strconv.Atoi(yyDollar[1].token.Value); err == nil { @@ -7974,7 +7995,7 @@ yydefault: } case 478: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5288 + //line php7/php7.y:5309 { var lnumber *scalar.Lnumber // TODO: add option to handle 64 bit integer @@ -8002,7 +8023,7 @@ yydefault: } case 479: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5314 + //line php7/php7.y:5335 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(identifier) @@ -8019,7 +8040,7 @@ yydefault: } case 480: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:5332 + //line php7/php7.y:5353 { yyVAL.node = expr.NewIsset(yyDollar[3].list) @@ -8039,7 +8060,7 @@ yydefault: } case 481: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:5350 + //line php7/php7.y:5371 { yyVAL.node = expr.NewEmpty(yyDollar[3].node) @@ -8055,7 +8076,7 @@ yydefault: } case 482: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5364 + //line php7/php7.y:5385 { yyVAL.node = expr.NewInclude(yyDollar[2].node) @@ -8069,7 +8090,7 @@ yydefault: } case 483: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5376 + //line php7/php7.y:5397 { yyVAL.node = expr.NewIncludeOnce(yyDollar[2].node) @@ -8083,7 +8104,7 @@ yydefault: } case 484: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:5388 + //line php7/php7.y:5409 { yyVAL.node = expr.NewEval(yyDollar[3].node) @@ -8099,7 +8120,7 @@ yydefault: } case 485: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5402 + //line php7/php7.y:5423 { yyVAL.node = expr.NewRequire(yyDollar[2].node) @@ -8113,7 +8134,7 @@ yydefault: } case 486: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5414 + //line php7/php7.y:5435 { yyVAL.node = expr.NewRequireOnce(yyDollar[2].node) @@ -8127,7 +8148,7 @@ yydefault: } case 487: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5429 + //line php7/php7.y:5450 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -8135,7 +8156,7 @@ yydefault: } case 488: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5435 + //line php7/php7.y:5456 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -8146,7 +8167,7 @@ yydefault: } case 489: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5447 + //line php7/php7.y:5468 { yyVAL.node = yyDollar[1].node diff --git a/php7/php7.y b/php7/php7.y index 7e6529f..2f4a51f 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -395,6 +395,9 @@ name: // save position $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) + // save comments + $1[0].GetMeta().Cut(meta.TokenNameFilter(meta.NodeStart)).AppendTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_NAMESPACE T_NS_SEPARATOR namespace_name @@ -644,6 +647,8 @@ group_use_declaration: } $6.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) + $1[0].GetMeta().Cut(meta.TokenNameFilter(meta.NodeStart)).AppendTo(name.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_NS_SEPARATOR namespace_name T_NS_SEPARATOR '{' unprefixed_use_declarations possible_comma '}' @@ -666,6 +671,8 @@ group_use_declaration: } $7.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) + $2[0].GetMeta().Cut(meta.TokenNameFilter(meta.NodeStart)).AppendTo(name.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -689,6 +696,8 @@ mixed_group_use_declaration: } $6.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) + $1[0].GetMeta().Cut(meta.TokenNameFilter(meta.NodeStart)).AppendTo(name.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_NS_SEPARATOR namespace_name T_NS_SEPARATOR '{' inline_use_declarations possible_comma '}' @@ -711,6 +720,8 @@ mixed_group_use_declaration: } $7.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) + $2[0].GetMeta().Cut(meta.TokenNameFilter(meta.NodeStart)).AppendTo(name.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -785,12 +796,16 @@ inline_use_declaration: { $$ = $1 + $1.(*stmt.Use).Use.GetMeta().Cut(meta.TokenNameFilter(meta.NodeStart)).AppendTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | use_type unprefixed_use_declaration { $$ = $2.(*stmt.Use).SetUseType($1) + $1.GetMeta().Cut(meta.TokenNameFilter(meta.NodeStart)).AppendTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -805,6 +820,8 @@ unprefixed_use_declaration: name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) + $1[0].GetMeta().Cut(meta.TokenNameFilter(meta.NodeStart)).AppendTo(name.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | namespace_name T_AS T_STRING @@ -822,6 +839,8 @@ unprefixed_use_declaration: $2.Meta.SetTokenName(meta.AsToken).AppendTo($$.GetMeta()) $3.Meta.SetTokenName(meta.NodeStart).AppendTo(alias.GetMeta()) + $1[0].GetMeta().Cut(meta.TokenNameFilter(meta.NodeStart)).AppendTo(name.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -831,6 +850,8 @@ use_declaration: { $$ = $1 + $1.(*stmt.Use).Use.GetMeta().Cut(meta.TokenNameFilter(meta.NodeStart)).AppendTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_NS_SEPARATOR unprefixed_use_declaration @@ -838,8 +859,8 @@ use_declaration: $$ = $2; // save comments - $1.Meta.SetTokenName(meta.UseLeadingNsSeparatorToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $1, meta.UseLeadingNsSeparatorToken) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/visitor/dumper_test.go b/visitor/dumper_test.go index f69b879..285e510 100644 --- a/visitor/dumper_test.go +++ b/visitor/dumper_test.go @@ -122,11 +122,11 @@ func ExampleDumper() { // | [*name.Name] // | "Position": Pos{Line: 5-5 Pos: 86-89} // | "NamespacedName": "null" + // | "Meta": + // | " " before "NodeStart" // | "Parts": // | [*name.NamePart] // | "Position": Pos{Line: 5-5 Pos: 86-89} - // | "Meta": - // | " " before "NodeStart" // | "Value": "null" // | "Stmt": // | [*stmt.StmtList] diff --git a/visitor/go_dumper_test.go b/visitor/go_dumper_test.go index e06a3a1..e81c019 100644 --- a/visitor/go_dumper_test.go +++ b/visitor/go_dumper_test.go @@ -355,6 +355,19 @@ func ExampleGoDumper() { // StartPos: 86, // EndPos: 89, // }, + // Meta: meta.Collection{ + // &meta.Data{ + // Type: meta.WhiteSpaceType, + // Position: &position.Position{ + // StartLine: 5, + // EndLine: 5, + // StartPos: 85, + // EndPos: 85, + // }, + // Value: " ", + // TokenName: meta.NodeStart, + // }, + // }, // Parts: []node.Node{ // &name.NamePart{ // Position: &position.Position{ @@ -363,19 +376,6 @@ func ExampleGoDumper() { // StartPos: 86, // EndPos: 89, // }, - // Meta: meta.Collection{ - // &meta.Data{ - // Type: meta.WhiteSpaceType, - // Position: &position.Position{ - // StartLine: 5, - // EndLine: 5, - // StartPos: 85, - // EndPos: 85, - // }, - // Value: " ", - // TokenName: meta.NodeStart, - // }, - // }, // Value: "null", // }, // }, diff --git a/visitor/json_dumper_test.go b/visitor/json_dumper_test.go index 9d91c7a..87ed55c 100644 --- a/visitor/json_dumper_test.go +++ b/visitor/json_dumper_test.go @@ -37,5 +37,5 @@ func ExampleJsonDumper() { nodes.Walk(dumper) // Output: - // {"type":"*node.Root","position":{"startPos":10,"endPos":166,"startLine":3,"endLine":12},"Stmts":[{"type":"*stmt.Namespace","position":{"startPos":10,"endPos":166,"startLine":3,"endLine":12},"meta":[{"type":"*meta.TokenType","value":" Date: Tue, 25 Dec 2018 11:56:32 +0200 Subject: [PATCH 099/117] #70: [php7] inherit meta.Data at stmt.Expression and stmt.Label --- php7/parser.go | 8 + php7/php7.go | 714 +++++++++++++++-------------- php7/php7.y | 24 +- visitor/dumper_test.go | 6 +- visitor/go_dumper_test.go | 66 +-- visitor/json_dumper_test.go | 2 +- visitor/pretty_json_dumper_test.go | 50 +- 7 files changed, 441 insertions(+), 429 deletions(-) diff --git a/php7/parser.go b/php7/parser.go index bf082bb..c8cb795 100644 --- a/php7/parser.go +++ b/php7/parser.go @@ -13,6 +13,14 @@ import ( "github.com/z7zmey/php-parser/scanner" ) +var inheritMetaFilter = meta.AndFilter( + meta.TokenNameFilter(meta.NodeStart), + meta.OrFilter( + meta.TypeFilter(meta.CommentType, meta.WhiteSpaceType), + meta.ValueFilter(" Date: Tue, 25 Dec 2018 22:16:19 +0200 Subject: [PATCH 100/117] #70: [php7] inherit meta.Data at stmt.Class and node.Parameter --- php7/php7.go | 666 +++++++++++++++-------------- php7/php7.y | 22 +- visitor/dumper_test.go | 2 +- visitor/go_dumper_test.go | 2 +- visitor/json_dumper_test.go | 2 +- visitor/pretty_json_dumper_test.go | 2 +- 6 files changed, 363 insertions(+), 333 deletions(-) diff --git a/php7/php7.go b/php7/php7.go index 920653f..57dea94 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -1,5 +1,3 @@ -// Code generated by goyacc -o php7/php7.go php7/php7.y. DO NOT EDIT. - //line php7/php7.y:2 package php7 @@ -348,7 +346,7 @@ const yyEofCode = 1 const yyErrCode = 2 const yyInitialStackSize = 16 -//line php7/php7.y:5479 +//line php7/php7.y:5495 //line yacctab:1 var yyExca = [...]int{ @@ -3860,11 +3858,13 @@ yydefault: yyDollar[7].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[9].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].list[0].GetMeta().Cut(inheritMetaFilter).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 170: yyDollar = yyS[yypt-8 : yypt+1] - //line php7/php7.y:1514 + //line php7/php7.y:1516 { name := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewClass(name, nil, nil, yyDollar[3].ClassExtends, yyDollar[4].ClassImplements, yyDollar[7].list, yyDollar[5].str) @@ -3874,7 +3874,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[8].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.ClassToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) yyDollar[6].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[8].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) @@ -3883,7 +3883,7 @@ yydefault: } case 171: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1534 + //line php7/php7.y:1536 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -3891,7 +3891,7 @@ yydefault: } case 172: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1540 + //line php7/php7.y:1542 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -3899,7 +3899,7 @@ yydefault: } case 173: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1549 + //line php7/php7.y:1551 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -3913,7 +3913,7 @@ yydefault: } case 174: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1561 + //line php7/php7.y:1563 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -3927,7 +3927,7 @@ yydefault: } case 175: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1576 + //line php7/php7.y:1578 { name := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewTrait(name, yyDollar[5].list, yyDollar[3].str) @@ -3946,7 +3946,7 @@ yydefault: } case 176: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:1596 + //line php7/php7.y:1598 { name := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewInterface(name, yyDollar[3].InterfaceExtends, yyDollar[6].list, yyDollar[4].str) @@ -3965,7 +3965,7 @@ yydefault: } case 177: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1616 + //line php7/php7.y:1618 { yyVAL.ClassExtends = nil @@ -3973,7 +3973,7 @@ yydefault: } case 178: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1622 + //line php7/php7.y:1624 { yyVAL.ClassExtends = stmt.NewClassExtends(yyDollar[2].node) @@ -3987,7 +3987,7 @@ yydefault: } case 179: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1637 + //line php7/php7.y:1639 { yyVAL.InterfaceExtends = nil @@ -3995,7 +3995,7 @@ yydefault: } case 180: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1643 + //line php7/php7.y:1645 { yyVAL.InterfaceExtends = stmt.NewInterfaceExtends(yyDollar[2].list) @@ -4009,7 +4009,7 @@ yydefault: } case 181: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1658 + //line php7/php7.y:1660 { yyVAL.ClassImplements = nil @@ -4017,7 +4017,7 @@ yydefault: } case 182: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1664 + //line php7/php7.y:1666 { yyVAL.ClassImplements = stmt.NewClassImplements(yyDollar[2].list) @@ -4031,7 +4031,7 @@ yydefault: } case 183: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1679 + //line php7/php7.y:1681 { yyVAL.node = yyDollar[1].node @@ -4039,7 +4039,7 @@ yydefault: } case 184: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1685 + //line php7/php7.y:1687 { yyVAL.node = expr.NewReference(yyDollar[2].node) @@ -4053,7 +4053,7 @@ yydefault: } case 185: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1697 + //line php7/php7.y:1699 { yyVAL.node = expr.NewList(yyDollar[3].list) @@ -4069,7 +4069,7 @@ yydefault: } case 186: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1711 + //line php7/php7.y:1713 { yyVAL.node = expr.NewShortList(yyDollar[2].list) @@ -4084,7 +4084,7 @@ yydefault: } case 187: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1727 + //line php7/php7.y:1729 { yyVAL.node = stmt.NewFor(nil, nil, nil, yyDollar[1].node) @@ -4095,7 +4095,7 @@ yydefault: } case 188: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1736 + //line php7/php7.y:1738 { stmtList := stmt.NewStmtList(yyDollar[2].list) yyVAL.node = stmt.NewAltFor(nil, nil, nil, stmtList) @@ -4114,7 +4114,7 @@ yydefault: } case 189: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1756 + //line php7/php7.y:1758 { yyVAL.node = stmt.NewForeach(nil, nil, nil, yyDollar[1].node) @@ -4125,7 +4125,7 @@ yydefault: } case 190: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1765 + //line php7/php7.y:1767 { stmtList := stmt.NewStmtList(yyDollar[2].list) yyVAL.node = stmt.NewAltForeach(nil, nil, nil, stmtList) @@ -4144,7 +4144,7 @@ yydefault: } case 191: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1785 + //line php7/php7.y:1787 { yyVAL.node = stmt.NewDeclare(nil, yyDollar[1].node, false) @@ -4155,7 +4155,7 @@ yydefault: } case 192: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1794 + //line php7/php7.y:1796 { stmtList := stmt.NewStmtList(yyDollar[2].list) yyVAL.node = stmt.NewDeclare(nil, stmtList, true) @@ -4174,7 +4174,7 @@ yydefault: } case 193: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1814 + //line php7/php7.y:1816 { caseList := stmt.NewCaseList(yyDollar[2].list) yyVAL.node = stmt.NewSwitch(nil, caseList) @@ -4191,7 +4191,7 @@ yydefault: } case 194: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1829 + //line php7/php7.y:1831 { caseList := stmt.NewCaseList(yyDollar[3].list) yyVAL.node = stmt.NewSwitch(nil, caseList) @@ -4210,7 +4210,7 @@ yydefault: } case 195: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1846 + //line php7/php7.y:1848 { caseList := stmt.NewCaseList(yyDollar[2].list) yyVAL.node = stmt.NewAltSwitch(nil, caseList) @@ -4229,7 +4229,7 @@ yydefault: } case 196: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:1863 + //line php7/php7.y:1865 { caseList := stmt.NewCaseList(yyDollar[3].list) @@ -4251,7 +4251,7 @@ yydefault: } case 197: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1886 + //line php7/php7.y:1888 { yyVAL.list = []node.Node{} @@ -4259,7 +4259,7 @@ yydefault: } case 198: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:1892 + //line php7/php7.y:1894 { _case := stmt.NewCase(yyDollar[3].node, yyDollar[5].list) yyVAL.list = append(yyDollar[1].list, _case) @@ -4276,7 +4276,7 @@ yydefault: } case 199: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1907 + //line php7/php7.y:1909 { _default := stmt.NewDefault(yyDollar[4].list) yyVAL.list = append(yyDollar[1].list, _default) @@ -4293,19 +4293,19 @@ yydefault: } case 200: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1925 + //line php7/php7.y:1927 { yyVAL.token = yyDollar[1].token } case 201: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1929 + //line php7/php7.y:1931 { yyVAL.token = yyDollar[1].token } case 202: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1936 + //line php7/php7.y:1938 { yyVAL.node = stmt.NewWhile(nil, yyDollar[1].node) @@ -4316,7 +4316,7 @@ yydefault: } case 203: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1945 + //line php7/php7.y:1947 { stmtList := stmt.NewStmtList(yyDollar[2].list) yyVAL.node = stmt.NewAltWhile(nil, stmtList) @@ -4335,7 +4335,7 @@ yydefault: } case 204: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:1965 + //line php7/php7.y:1967 { yyVAL.node = stmt.NewIf(yyDollar[3].node, yyDollar[5].node, nil, nil) @@ -4351,7 +4351,7 @@ yydefault: } case 205: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1979 + //line php7/php7.y:1981 { _elseIf := stmt.NewElseIf(yyDollar[4].node, yyDollar[6].node) yyVAL.node = yyDollar[1].node.(*stmt.If).AddElseIf(_elseIf) @@ -4369,7 +4369,7 @@ yydefault: } case 206: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1998 + //line php7/php7.y:2000 { yyVAL.node = yyDollar[1].node @@ -4377,7 +4377,7 @@ yydefault: } case 207: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2004 + //line php7/php7.y:2006 { _else := stmt.NewElse(yyDollar[3].node) yyVAL.node = yyDollar[1].node.(*stmt.If).SetElse(_else) @@ -4393,7 +4393,7 @@ yydefault: } case 208: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:2021 + //line php7/php7.y:2023 { stmts := stmt.NewStmtList(yyDollar[6].list) yyVAL.node = stmt.NewAltIf(yyDollar[3].node, stmts, nil, nil) @@ -4412,7 +4412,7 @@ yydefault: } case 209: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:2038 + //line php7/php7.y:2040 { stmts := stmt.NewStmtList(yyDollar[7].list) _elseIf := stmt.NewAltElseIf(yyDollar[4].node, stmts) @@ -4432,7 +4432,7 @@ yydefault: } case 210: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2059 + //line php7/php7.y:2061 { yyVAL.node = yyDollar[1].node @@ -4448,7 +4448,7 @@ yydefault: } case 211: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:2073 + //line php7/php7.y:2075 { stmts := stmt.NewStmtList(yyDollar[4].list) _else := stmt.NewAltElse(stmts) @@ -4470,7 +4470,7 @@ yydefault: } case 212: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2096 + //line php7/php7.y:2098 { yyVAL.list = yyDollar[1].list @@ -4478,7 +4478,7 @@ yydefault: } case 213: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:2102 + //line php7/php7.y:2104 { yyVAL.list = nil @@ -4486,7 +4486,7 @@ yydefault: } case 214: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2111 + //line php7/php7.y:2113 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4494,7 +4494,7 @@ yydefault: } case 215: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2117 + //line php7/php7.y:2119 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4505,7 +4505,7 @@ yydefault: } case 216: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2129 + //line php7/php7.y:2131 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[4].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -4525,20 +4525,27 @@ yydefault: } // save comments + if yyDollar[1].node != nil { + yyDollar[1].node.GetMeta().Cut(inheritMetaFilter).PrependTo(yyVAL.node.GetMeta()) + } if yyDollar[2].token != nil { yyDollar[2].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(yyVAL.node.GetMeta()) } if yyDollar[3].token != nil { yyDollar[3].token.Meta.SetTokenName(meta.EllipsisToken).AppendTo(yyVAL.node.GetMeta()) } - yyDollar[4].token.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + if yyDollar[1].node == nil && yyDollar[2].token == nil && yyDollar[3].token == nil { + yyDollar[4].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + } else { + yyDollar[4].token.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + } yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 217: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:2160 + //line php7/php7.y:2169 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[4].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -4558,13 +4565,20 @@ yydefault: } // save comments + if yyDollar[1].node != nil { + yyDollar[1].node.GetMeta().Cut(inheritMetaFilter).PrependTo(yyVAL.node.GetMeta()) + } if yyDollar[2].token != nil { yyDollar[2].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(yyVAL.node.GetMeta()) } if yyDollar[3].token != nil { yyDollar[3].token.Meta.SetTokenName(meta.EllipsisToken).AppendTo(yyVAL.node.GetMeta()) } - yyDollar[4].token.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + if yyDollar[1].node == nil && yyDollar[2].token == nil && yyDollar[3].token == nil { + yyDollar[4].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + } else { + yyDollar[4].token.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + } yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yyDollar[5].token.Meta.SetTokenName(meta.EqualToken).AppendTo(yyVAL.node.GetMeta()) @@ -4572,7 +4586,7 @@ yydefault: } case 218: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:2195 + //line php7/php7.y:2211 { yyVAL.node = nil @@ -4580,7 +4594,7 @@ yydefault: } case 219: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2201 + //line php7/php7.y:2217 { yyVAL.node = yyDollar[1].node @@ -4588,7 +4602,7 @@ yydefault: } case 220: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2210 + //line php7/php7.y:2226 { yyVAL.node = yyDollar[1].node @@ -4596,7 +4610,7 @@ yydefault: } case 221: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2216 + //line php7/php7.y:2232 { yyVAL.node = node.NewNullable(yyDollar[2].node) @@ -4610,7 +4624,7 @@ yydefault: } case 222: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2231 + //line php7/php7.y:2247 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4624,7 +4638,7 @@ yydefault: } case 223: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2243 + //line php7/php7.y:2259 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4638,7 +4652,7 @@ yydefault: } case 224: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2255 + //line php7/php7.y:2271 { yyVAL.node = yyDollar[1].node @@ -4646,7 +4660,7 @@ yydefault: } case 225: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:2264 + //line php7/php7.y:2280 { yyVAL.node = nil @@ -4654,7 +4668,7 @@ yydefault: } case 226: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2270 + //line php7/php7.y:2286 { yyVAL.node = yyDollar[2].node @@ -4665,7 +4679,7 @@ yydefault: } case 227: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2282 + //line php7/php7.y:2298 { yyVAL.node = node.NewArgumentList(nil) @@ -4680,7 +4694,7 @@ yydefault: } case 228: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2295 + //line php7/php7.y:2311 { yyVAL.node = node.NewArgumentList(yyDollar[2].list) @@ -4699,7 +4713,7 @@ yydefault: } case 229: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2315 + //line php7/php7.y:2331 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4707,7 +4721,7 @@ yydefault: } case 230: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2321 + //line php7/php7.y:2337 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4718,7 +4732,7 @@ yydefault: } case 231: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2333 + //line php7/php7.y:2349 { yyVAL.node = node.NewArgument(yyDollar[1].node, false, false) @@ -4729,7 +4743,7 @@ yydefault: } case 232: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2342 + //line php7/php7.y:2358 { yyVAL.node = node.NewArgument(yyDollar[2].node, true, false) @@ -4743,7 +4757,7 @@ yydefault: } case 233: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2357 + //line php7/php7.y:2373 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4754,7 +4768,7 @@ yydefault: } case 234: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2366 + //line php7/php7.y:2382 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4762,7 +4776,7 @@ yydefault: } case 235: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2375 + //line php7/php7.y:2391 { yyVAL.node = yyDollar[1].node @@ -4770,7 +4784,7 @@ yydefault: } case 236: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2384 + //line php7/php7.y:2400 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4781,7 +4795,7 @@ yydefault: } case 237: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2393 + //line php7/php7.y:2409 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4789,7 +4803,7 @@ yydefault: } case 238: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2402 + //line php7/php7.y:2418 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -4808,7 +4822,7 @@ yydefault: } case 239: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2419 + //line php7/php7.y:2435 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -4828,7 +4842,7 @@ yydefault: } case 240: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2440 + //line php7/php7.y:2456 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -4836,7 +4850,7 @@ yydefault: } case 241: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:2446 + //line php7/php7.y:2462 { yyVAL.list = []node.Node{} @@ -4844,7 +4858,7 @@ yydefault: } case 242: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2455 + //line php7/php7.y:2471 { yyVAL.node = stmt.NewPropertyList(yyDollar[1].list, yyDollar[2].list) @@ -4859,7 +4873,7 @@ yydefault: } case 243: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2468 + //line php7/php7.y:2484 { yyVAL.node = stmt.NewClassConstList(yyDollar[1].list, yyDollar[3].list) @@ -4875,7 +4889,7 @@ yydefault: } case 244: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2482 + //line php7/php7.y:2498 { yyVAL.node = stmt.NewTraitUse(yyDollar[2].list, yyDollar[3].node) @@ -4889,7 +4903,7 @@ yydefault: } case 245: yyDollar = yyS[yypt-10 : yypt+1] - //line php7/php7.y:2494 + //line php7/php7.y:2510 { name := node.NewIdentifier(yyDollar[4].token.Value) yyVAL.node = stmt.NewClassMethod(name, yyDollar[1].list, yyDollar[3].token != nil, yyDollar[7].list, yyDollar[9].node, yyDollar[10].node, yyDollar[5].str) @@ -4915,7 +4929,7 @@ yydefault: } case 246: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2521 + //line php7/php7.y:2537 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4923,7 +4937,7 @@ yydefault: } case 247: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2527 + //line php7/php7.y:2543 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4934,7 +4948,7 @@ yydefault: } case 248: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2539 + //line php7/php7.y:2555 { yyVAL.node = stmt.NewNop() @@ -4948,7 +4962,7 @@ yydefault: } case 249: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2552 + //line php7/php7.y:2568 { yyVAL.node = stmt.NewTraitAdaptationList(nil) @@ -4962,7 +4976,7 @@ yydefault: } case 250: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2564 + //line php7/php7.y:2580 { yyVAL.node = stmt.NewTraitAdaptationList(yyDollar[2].list) @@ -4976,7 +4990,7 @@ yydefault: } case 251: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2579 + //line php7/php7.y:2595 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4984,7 +4998,7 @@ yydefault: } case 252: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2585 + //line php7/php7.y:2601 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -4992,7 +5006,7 @@ yydefault: } case 253: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2594 + //line php7/php7.y:2610 { yyVAL.node = yyDollar[1].node @@ -5004,7 +5018,7 @@ yydefault: } case 254: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2604 + //line php7/php7.y:2620 { yyVAL.node = yyDollar[1].node @@ -5016,7 +5030,7 @@ yydefault: } case 255: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2617 + //line php7/php7.y:2633 { yyVAL.node = stmt.NewTraitUsePrecedence(yyDollar[1].node, yyDollar[3].list) @@ -5030,7 +5044,7 @@ yydefault: } case 256: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2632 + //line php7/php7.y:2648 { alias := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, nil, alias) @@ -5047,7 +5061,7 @@ yydefault: } case 257: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2647 + //line php7/php7.y:2663 { alias := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, nil, alias) @@ -5064,7 +5078,7 @@ yydefault: } case 258: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2662 + //line php7/php7.y:2678 { alias := node.NewIdentifier(yyDollar[4].token.Value) yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, yyDollar[3].node, alias) @@ -5081,7 +5095,7 @@ yydefault: } case 259: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2677 + //line php7/php7.y:2693 { yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, yyDollar[3].node, nil) @@ -5095,7 +5109,7 @@ yydefault: } case 260: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2692 + //line php7/php7.y:2708 { name := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewTraitMethodRef(nil, name) @@ -5111,7 +5125,7 @@ yydefault: } case 261: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2706 + //line php7/php7.y:2722 { yyVAL.node = yyDollar[1].node @@ -5119,7 +5133,7 @@ yydefault: } case 262: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2715 + //line php7/php7.y:2731 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewTraitMethodRef(yyDollar[1].node, target) @@ -5136,7 +5150,7 @@ yydefault: } case 263: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2733 + //line php7/php7.y:2749 { yyVAL.node = stmt.NewNop() @@ -5151,7 +5165,7 @@ yydefault: } case 264: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2746 + //line php7/php7.y:2762 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) @@ -5166,7 +5180,7 @@ yydefault: } case 265: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2762 + //line php7/php7.y:2778 { yyVAL.list = yyDollar[1].list @@ -5174,7 +5188,7 @@ yydefault: } case 266: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2768 + //line php7/php7.y:2784 { modifier := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.list = []node.Node{modifier} @@ -5189,7 +5203,7 @@ yydefault: } case 267: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:2784 + //line php7/php7.y:2800 { yyVAL.list = nil @@ -5197,7 +5211,7 @@ yydefault: } case 268: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2790 + //line php7/php7.y:2806 { yyVAL.list = yyDollar[1].list @@ -5205,7 +5219,7 @@ yydefault: } case 269: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2799 + //line php7/php7.y:2815 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -5213,7 +5227,7 @@ yydefault: } case 270: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2805 + //line php7/php7.y:2821 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -5221,7 +5235,7 @@ yydefault: } case 271: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2814 + //line php7/php7.y:2830 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5235,7 +5249,7 @@ yydefault: } case 272: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2826 + //line php7/php7.y:2842 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5249,7 +5263,7 @@ yydefault: } case 273: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2838 + //line php7/php7.y:2854 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5263,7 +5277,7 @@ yydefault: } case 274: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2850 + //line php7/php7.y:2866 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5277,7 +5291,7 @@ yydefault: } case 275: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2862 + //line php7/php7.y:2878 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5291,7 +5305,7 @@ yydefault: } case 276: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2874 + //line php7/php7.y:2890 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5305,7 +5319,7 @@ yydefault: } case 277: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2889 + //line php7/php7.y:2905 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -5316,7 +5330,7 @@ yydefault: } case 278: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2898 + //line php7/php7.y:2914 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -5324,7 +5338,7 @@ yydefault: } case 279: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2907 + //line php7/php7.y:2923 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -5343,7 +5357,7 @@ yydefault: } case 280: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2924 + //line php7/php7.y:2940 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -5363,7 +5377,7 @@ yydefault: } case 281: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2945 + //line php7/php7.y:2961 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -5374,7 +5388,7 @@ yydefault: } case 282: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2954 + //line php7/php7.y:2970 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -5382,7 +5396,7 @@ yydefault: } case 283: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2963 + //line php7/php7.y:2979 { name := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewConstant(name, yyDollar[3].node, yyDollar[4].str) @@ -5399,7 +5413,7 @@ yydefault: } case 284: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2981 + //line php7/php7.y:2997 { name := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewConstant(name, yyDollar[3].node, yyDollar[4].str) @@ -5416,7 +5430,7 @@ yydefault: } case 285: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2999 + //line php7/php7.y:3015 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -5427,7 +5441,7 @@ yydefault: } case 286: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3008 + //line php7/php7.y:3024 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -5435,7 +5449,7 @@ yydefault: } case 287: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3017 + //line php7/php7.y:3033 { yyVAL.node = yyDollar[1].node @@ -5443,7 +5457,7 @@ yydefault: } case 288: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3026 + //line php7/php7.y:3042 { yyVAL.list = nil @@ -5451,7 +5465,7 @@ yydefault: } case 289: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3032 + //line php7/php7.y:3048 { yyVAL.list = yyDollar[1].list @@ -5459,7 +5473,7 @@ yydefault: } case 290: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3041 + //line php7/php7.y:3057 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -5470,7 +5484,7 @@ yydefault: } case 291: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3050 + //line php7/php7.y:3066 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -5478,7 +5492,7 @@ yydefault: } case 292: yyDollar = yyS[yypt-8 : yypt+1] - //line php7/php7.y:3059 + //line php7/php7.y:3075 { if yyDollar[2].node != nil { yyVAL.node = stmt.NewClass(nil, nil, yyDollar[2].node.(*node.ArgumentList), yyDollar[3].ClassExtends, yyDollar[4].ClassImplements, yyDollar[7].list, yyDollar[5].str) @@ -5498,7 +5512,7 @@ yydefault: } case 293: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3080 + //line php7/php7.y:3096 { if yyDollar[3].node != nil { yyVAL.node = expr.NewNew(yyDollar[2].node, yyDollar[3].node.(*node.ArgumentList)) @@ -5515,7 +5529,7 @@ yydefault: } case 294: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3095 + //line php7/php7.y:3111 { yyVAL.node = expr.NewNew(yyDollar[2].node, nil) @@ -5529,7 +5543,7 @@ yydefault: } case 295: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:3110 + //line php7/php7.y:3126 { list := expr.NewList(yyDollar[3].list) yyVAL.node = assign.NewAssign(list, yyDollar[6].node) @@ -5548,7 +5562,7 @@ yydefault: } case 296: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:3127 + //line php7/php7.y:3143 { shortList := expr.NewShortList(yyDollar[2].list) yyVAL.node = assign.NewAssign(shortList, yyDollar[5].node) @@ -5566,7 +5580,7 @@ yydefault: } case 297: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3143 + //line php7/php7.y:3159 { yyVAL.node = assign.NewAssign(yyDollar[1].node, yyDollar[3].node) @@ -5580,7 +5594,7 @@ yydefault: } case 298: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3155 + //line php7/php7.y:3171 { yyVAL.node = assign.NewReference(yyDollar[1].node, yyDollar[4].node) @@ -5595,7 +5609,7 @@ yydefault: } case 299: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3168 + //line php7/php7.y:3184 { yyVAL.node = expr.NewClone(yyDollar[2].node) @@ -5609,7 +5623,7 @@ yydefault: } case 300: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3180 + //line php7/php7.y:3196 { yyVAL.node = assign.NewPlus(yyDollar[1].node, yyDollar[3].node) @@ -5623,7 +5637,7 @@ yydefault: } case 301: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3192 + //line php7/php7.y:3208 { yyVAL.node = assign.NewMinus(yyDollar[1].node, yyDollar[3].node) @@ -5637,7 +5651,7 @@ yydefault: } case 302: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3204 + //line php7/php7.y:3220 { yyVAL.node = assign.NewMul(yyDollar[1].node, yyDollar[3].node) @@ -5651,7 +5665,7 @@ yydefault: } case 303: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3216 + //line php7/php7.y:3232 { yyVAL.node = assign.NewPow(yyDollar[1].node, yyDollar[3].node) @@ -5665,7 +5679,7 @@ yydefault: } case 304: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3228 + //line php7/php7.y:3244 { yyVAL.node = assign.NewDiv(yyDollar[1].node, yyDollar[3].node) @@ -5679,7 +5693,7 @@ yydefault: } case 305: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3240 + //line php7/php7.y:3256 { yyVAL.node = assign.NewConcat(yyDollar[1].node, yyDollar[3].node) @@ -5693,7 +5707,7 @@ yydefault: } case 306: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3252 + //line php7/php7.y:3268 { yyVAL.node = assign.NewMod(yyDollar[1].node, yyDollar[3].node) @@ -5707,7 +5721,7 @@ yydefault: } case 307: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3264 + //line php7/php7.y:3280 { yyVAL.node = assign.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) @@ -5721,7 +5735,7 @@ yydefault: } case 308: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3276 + //line php7/php7.y:3292 { yyVAL.node = assign.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) @@ -5735,7 +5749,7 @@ yydefault: } case 309: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3288 + //line php7/php7.y:3304 { yyVAL.node = assign.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) @@ -5749,7 +5763,7 @@ yydefault: } case 310: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3300 + //line php7/php7.y:3316 { yyVAL.node = assign.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) @@ -5763,7 +5777,7 @@ yydefault: } case 311: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3312 + //line php7/php7.y:3328 { yyVAL.node = assign.NewShiftRight(yyDollar[1].node, yyDollar[3].node) @@ -5777,7 +5791,7 @@ yydefault: } case 312: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3324 + //line php7/php7.y:3340 { yyVAL.node = expr.NewPostInc(yyDollar[1].node) @@ -5791,7 +5805,7 @@ yydefault: } case 313: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3336 + //line php7/php7.y:3352 { yyVAL.node = expr.NewPreInc(yyDollar[2].node) @@ -5805,7 +5819,7 @@ yydefault: } case 314: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3348 + //line php7/php7.y:3364 { yyVAL.node = expr.NewPostDec(yyDollar[1].node) @@ -5819,7 +5833,7 @@ yydefault: } case 315: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3360 + //line php7/php7.y:3376 { yyVAL.node = expr.NewPreDec(yyDollar[2].node) @@ -5833,7 +5847,7 @@ yydefault: } case 316: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3372 + //line php7/php7.y:3388 { yyVAL.node = binary.NewBooleanOr(yyDollar[1].node, yyDollar[3].node) @@ -5847,7 +5861,7 @@ yydefault: } case 317: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3384 + //line php7/php7.y:3400 { yyVAL.node = binary.NewBooleanAnd(yyDollar[1].node, yyDollar[3].node) @@ -5861,7 +5875,7 @@ yydefault: } case 318: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3396 + //line php7/php7.y:3412 { yyVAL.node = binary.NewLogicalOr(yyDollar[1].node, yyDollar[3].node) @@ -5875,7 +5889,7 @@ yydefault: } case 319: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3408 + //line php7/php7.y:3424 { yyVAL.node = binary.NewLogicalAnd(yyDollar[1].node, yyDollar[3].node) @@ -5889,7 +5903,7 @@ yydefault: } case 320: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3420 + //line php7/php7.y:3436 { yyVAL.node = binary.NewLogicalXor(yyDollar[1].node, yyDollar[3].node) @@ -5903,7 +5917,7 @@ yydefault: } case 321: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3432 + //line php7/php7.y:3448 { yyVAL.node = binary.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) @@ -5917,7 +5931,7 @@ yydefault: } case 322: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3444 + //line php7/php7.y:3460 { yyVAL.node = binary.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) @@ -5931,7 +5945,7 @@ yydefault: } case 323: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3456 + //line php7/php7.y:3472 { yyVAL.node = binary.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) @@ -5945,7 +5959,7 @@ yydefault: } case 324: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3468 + //line php7/php7.y:3484 { yyVAL.node = binary.NewConcat(yyDollar[1].node, yyDollar[3].node) @@ -5959,7 +5973,7 @@ yydefault: } case 325: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3480 + //line php7/php7.y:3496 { yyVAL.node = binary.NewPlus(yyDollar[1].node, yyDollar[3].node) @@ -5973,7 +5987,7 @@ yydefault: } case 326: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3492 + //line php7/php7.y:3508 { yyVAL.node = binary.NewMinus(yyDollar[1].node, yyDollar[3].node) @@ -5987,7 +6001,7 @@ yydefault: } case 327: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3504 + //line php7/php7.y:3520 { yyVAL.node = binary.NewMul(yyDollar[1].node, yyDollar[3].node) @@ -6001,7 +6015,7 @@ yydefault: } case 328: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3516 + //line php7/php7.y:3532 { yyVAL.node = binary.NewPow(yyDollar[1].node, yyDollar[3].node) @@ -6015,7 +6029,7 @@ yydefault: } case 329: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3528 + //line php7/php7.y:3544 { yyVAL.node = binary.NewDiv(yyDollar[1].node, yyDollar[3].node) @@ -6029,7 +6043,7 @@ yydefault: } case 330: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3540 + //line php7/php7.y:3556 { yyVAL.node = binary.NewMod(yyDollar[1].node, yyDollar[3].node) @@ -6043,7 +6057,7 @@ yydefault: } case 331: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3552 + //line php7/php7.y:3568 { yyVAL.node = binary.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) @@ -6057,7 +6071,7 @@ yydefault: } case 332: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3564 + //line php7/php7.y:3580 { yyVAL.node = binary.NewShiftRight(yyDollar[1].node, yyDollar[3].node) @@ -6071,7 +6085,7 @@ yydefault: } case 333: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3576 + //line php7/php7.y:3592 { yyVAL.node = expr.NewUnaryPlus(yyDollar[2].node) @@ -6085,7 +6099,7 @@ yydefault: } case 334: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3588 + //line php7/php7.y:3604 { yyVAL.node = expr.NewUnaryMinus(yyDollar[2].node) @@ -6099,7 +6113,7 @@ yydefault: } case 335: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3600 + //line php7/php7.y:3616 { yyVAL.node = expr.NewBooleanNot(yyDollar[2].node) @@ -6113,7 +6127,7 @@ yydefault: } case 336: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3612 + //line php7/php7.y:3628 { yyVAL.node = expr.NewBitwiseNot(yyDollar[2].node) @@ -6127,7 +6141,7 @@ yydefault: } case 337: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3624 + //line php7/php7.y:3640 { yyVAL.node = binary.NewIdentical(yyDollar[1].node, yyDollar[3].node) @@ -6141,7 +6155,7 @@ yydefault: } case 338: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3636 + //line php7/php7.y:3652 { yyVAL.node = binary.NewNotIdentical(yyDollar[1].node, yyDollar[3].node) @@ -6155,7 +6169,7 @@ yydefault: } case 339: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3648 + //line php7/php7.y:3664 { yyVAL.node = binary.NewEqual(yyDollar[1].node, yyDollar[3].node) @@ -6169,7 +6183,7 @@ yydefault: } case 340: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3660 + //line php7/php7.y:3676 { yyVAL.node = binary.NewNotEqual(yyDollar[1].node, yyDollar[3].node) @@ -6184,7 +6198,7 @@ yydefault: } case 341: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3673 + //line php7/php7.y:3689 { yyVAL.node = binary.NewSmaller(yyDollar[1].node, yyDollar[3].node) @@ -6198,7 +6212,7 @@ yydefault: } case 342: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3685 + //line php7/php7.y:3701 { yyVAL.node = binary.NewSmallerOrEqual(yyDollar[1].node, yyDollar[3].node) @@ -6212,7 +6226,7 @@ yydefault: } case 343: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3697 + //line php7/php7.y:3713 { yyVAL.node = binary.NewGreater(yyDollar[1].node, yyDollar[3].node) @@ -6226,7 +6240,7 @@ yydefault: } case 344: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3709 + //line php7/php7.y:3725 { yyVAL.node = binary.NewGreaterOrEqual(yyDollar[1].node, yyDollar[3].node) @@ -6240,7 +6254,7 @@ yydefault: } case 345: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3721 + //line php7/php7.y:3737 { yyVAL.node = binary.NewSpaceship(yyDollar[1].node, yyDollar[3].node) @@ -6254,7 +6268,7 @@ yydefault: } case 346: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3733 + //line php7/php7.y:3749 { yyVAL.node = expr.NewInstanceOf(yyDollar[1].node, yyDollar[3].node) @@ -6268,7 +6282,7 @@ yydefault: } case 347: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3745 + //line php7/php7.y:3761 { yyVAL.node = yyDollar[2].node @@ -6282,7 +6296,7 @@ yydefault: } case 348: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3757 + //line php7/php7.y:3773 { yyVAL.node = yyDollar[1].node @@ -6290,7 +6304,7 @@ yydefault: } case 349: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:3763 + //line php7/php7.y:3779 { yyVAL.node = expr.NewTernary(yyDollar[1].node, yyDollar[3].node, yyDollar[5].node) @@ -6305,7 +6319,7 @@ yydefault: } case 350: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3776 + //line php7/php7.y:3792 { yyVAL.node = expr.NewTernary(yyDollar[1].node, nil, yyDollar[4].node) @@ -6320,7 +6334,7 @@ yydefault: } case 351: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3789 + //line php7/php7.y:3805 { yyVAL.node = binary.NewCoalesce(yyDollar[1].node, yyDollar[3].node) @@ -6334,7 +6348,7 @@ yydefault: } case 352: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3801 + //line php7/php7.y:3817 { yyVAL.node = yyDollar[1].node @@ -6342,7 +6356,7 @@ yydefault: } case 353: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3807 + //line php7/php7.y:3823 { yyVAL.node = cast.NewInt(yyDollar[2].node) @@ -6357,7 +6371,7 @@ yydefault: } case 354: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3820 + //line php7/php7.y:3836 { yyVAL.node = cast.NewDouble(yyDollar[2].node) @@ -6372,7 +6386,7 @@ yydefault: } case 355: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3833 + //line php7/php7.y:3849 { yyVAL.node = cast.NewString(yyDollar[2].node) @@ -6387,7 +6401,7 @@ yydefault: } case 356: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3846 + //line php7/php7.y:3862 { yyVAL.node = cast.NewArray(yyDollar[2].node) @@ -6402,7 +6416,7 @@ yydefault: } case 357: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3859 + //line php7/php7.y:3875 { yyVAL.node = cast.NewObject(yyDollar[2].node) @@ -6417,7 +6431,7 @@ yydefault: } case 358: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3872 + //line php7/php7.y:3888 { yyVAL.node = cast.NewBool(yyDollar[2].node) @@ -6432,7 +6446,7 @@ yydefault: } case 359: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3885 + //line php7/php7.y:3901 { yyVAL.node = cast.NewUnset(yyDollar[2].node) @@ -6447,7 +6461,7 @@ yydefault: } case 360: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3898 + //line php7/php7.y:3914 { var e *expr.Exit if yyDollar[2].node != nil { @@ -6476,7 +6490,7 @@ yydefault: } case 361: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3925 + //line php7/php7.y:3941 { yyVAL.node = expr.NewErrorSuppress(yyDollar[2].node) @@ -6490,7 +6504,7 @@ yydefault: } case 362: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3937 + //line php7/php7.y:3953 { yyVAL.node = yyDollar[1].node @@ -6498,7 +6512,7 @@ yydefault: } case 363: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3943 + //line php7/php7.y:3959 { yyVAL.node = expr.NewShellExec(yyDollar[2].list) @@ -6512,7 +6526,7 @@ yydefault: } case 364: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3955 + //line php7/php7.y:3971 { yyVAL.node = expr.NewPrint(yyDollar[2].node) @@ -6526,7 +6540,7 @@ yydefault: } case 365: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3967 + //line php7/php7.y:3983 { yyVAL.node = expr.NewYield(nil, nil) @@ -6540,7 +6554,7 @@ yydefault: } case 366: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3979 + //line php7/php7.y:3995 { yyVAL.node = expr.NewYield(nil, yyDollar[2].node) @@ -6554,7 +6568,7 @@ yydefault: } case 367: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3991 + //line php7/php7.y:4007 { yyVAL.node = expr.NewYield(yyDollar[2].node, yyDollar[4].node) @@ -6569,7 +6583,7 @@ yydefault: } case 368: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4004 + //line php7/php7.y:4020 { yyVAL.node = expr.NewYieldFrom(yyDollar[2].node) @@ -6583,7 +6597,7 @@ yydefault: } case 369: yyDollar = yyS[yypt-11 : yypt+1] - //line php7/php7.y:4016 + //line php7/php7.y:4032 { yyVAL.node = expr.NewClosure(yyDollar[5].list, yyDollar[7].ClosureUse, yyDollar[8].node, yyDollar[10].list, false, yyDollar[2].token != nil, yyDollar[3].str) @@ -6604,7 +6618,7 @@ yydefault: } case 370: yyDollar = yyS[yypt-12 : yypt+1] - //line php7/php7.y:4035 + //line php7/php7.y:4051 { yyVAL.node = expr.NewClosure(yyDollar[6].list, yyDollar[8].ClosureUse, yyDollar[9].node, yyDollar[11].list, true, yyDollar[3].token != nil, yyDollar[4].str) @@ -6626,7 +6640,7 @@ yydefault: } case 371: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4058 + //line php7/php7.y:4074 { yyVAL.str = yylex.(*Parser).PhpDocComment yylex.(*Parser).PhpDocComment = "" @@ -6635,19 +6649,19 @@ yydefault: } case 372: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4068 + //line php7/php7.y:4084 { yyVAL.token = nil } case 373: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4072 + //line php7/php7.y:4088 { yyVAL.token = yyDollar[1].token } case 374: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4079 + //line php7/php7.y:4095 { yyVAL.ClosureUse = nil @@ -6655,7 +6669,7 @@ yydefault: } case 375: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4085 + //line php7/php7.y:4101 { yyVAL.ClosureUse = expr.NewClosureUse(yyDollar[3].list) @@ -6671,7 +6685,7 @@ yydefault: } case 376: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4102 + //line php7/php7.y:4118 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -6682,7 +6696,7 @@ yydefault: } case 377: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4111 + //line php7/php7.y:4127 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -6690,7 +6704,7 @@ yydefault: } case 378: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4120 + //line php7/php7.y:4136 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(identifier) @@ -6707,7 +6721,7 @@ yydefault: } case 379: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4135 + //line php7/php7.y:4151 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[2].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -6727,7 +6741,7 @@ yydefault: } case 380: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4156 + //line php7/php7.y:4172 { yyVAL.node = expr.NewFunctionCall(yyDollar[1].node, yyDollar[2].node.(*node.ArgumentList)) @@ -6738,7 +6752,7 @@ yydefault: } case 381: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4165 + //line php7/php7.y:4181 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -6752,7 +6766,7 @@ yydefault: } case 382: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4177 + //line php7/php7.y:4193 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -6766,7 +6780,7 @@ yydefault: } case 383: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4189 + //line php7/php7.y:4205 { yyVAL.node = expr.NewFunctionCall(yyDollar[1].node, yyDollar[2].node.(*node.ArgumentList)) @@ -6777,7 +6791,7 @@ yydefault: } case 384: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4201 + //line php7/php7.y:4217 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -6791,7 +6805,7 @@ yydefault: } case 385: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4213 + //line php7/php7.y:4229 { yyVAL.node = yyDollar[1].node @@ -6799,7 +6813,7 @@ yydefault: } case 386: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4222 + //line php7/php7.y:4238 { yyVAL.node = yyDollar[1].node @@ -6807,7 +6821,7 @@ yydefault: } case 387: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4228 + //line php7/php7.y:4244 { yyVAL.node = yyDollar[1].node @@ -6815,7 +6829,7 @@ yydefault: } case 388: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4237 + //line php7/php7.y:4253 { yyVAL.node = nil @@ -6823,7 +6837,7 @@ yydefault: } case 389: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4243 + //line php7/php7.y:4259 { yyVAL.node = expr.NewExit(yyDollar[2].node) @@ -6840,7 +6854,7 @@ yydefault: } case 390: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4261 + //line php7/php7.y:4277 { yyVAL.list = []node.Node{} @@ -6848,7 +6862,7 @@ yydefault: } case 391: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4267 + //line php7/php7.y:4283 { yyVAL.list = []node.Node{scalar.NewEncapsedStringPart(yyDollar[1].token.Value)} @@ -6856,7 +6870,7 @@ yydefault: } case 392: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4273 + //line php7/php7.y:4289 { yyVAL.list = yyDollar[1].list @@ -6864,7 +6878,7 @@ yydefault: } case 393: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4282 + //line php7/php7.y:4298 { yyVAL.node = nil @@ -6872,7 +6886,7 @@ yydefault: } case 394: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4288 + //line php7/php7.y:4304 { yyVAL.node = yyDollar[1].node @@ -6880,7 +6894,7 @@ yydefault: } case 395: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4297 + //line php7/php7.y:4313 { yyVAL.node = expr.NewArray(yyDollar[3].list) @@ -6896,7 +6910,7 @@ yydefault: } case 396: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4311 + //line php7/php7.y:4327 { yyVAL.node = expr.NewShortArray(yyDollar[2].list) @@ -6911,7 +6925,7 @@ yydefault: } case 397: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4324 + //line php7/php7.y:4340 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) @@ -6925,7 +6939,7 @@ yydefault: } case 398: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4339 + //line php7/php7.y:4355 { yyVAL.node = scalar.NewLnumber(yyDollar[1].token.Value) @@ -6939,7 +6953,7 @@ yydefault: } case 399: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4351 + //line php7/php7.y:4367 { yyVAL.node = scalar.NewDnumber(yyDollar[1].token.Value) @@ -6953,7 +6967,7 @@ yydefault: } case 400: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4363 + //line php7/php7.y:4379 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6967,7 +6981,7 @@ yydefault: } case 401: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4375 + //line php7/php7.y:4391 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6981,7 +6995,7 @@ yydefault: } case 402: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4387 + //line php7/php7.y:4403 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6995,7 +7009,7 @@ yydefault: } case 403: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4399 + //line php7/php7.y:4415 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7009,7 +7023,7 @@ yydefault: } case 404: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4411 + //line php7/php7.y:4427 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7023,7 +7037,7 @@ yydefault: } case 405: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4423 + //line php7/php7.y:4439 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7037,7 +7051,7 @@ yydefault: } case 406: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4435 + //line php7/php7.y:4451 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7051,7 +7065,7 @@ yydefault: } case 407: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4447 + //line php7/php7.y:4463 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7065,7 +7079,7 @@ yydefault: } case 408: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4459 + //line php7/php7.y:4475 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, []node.Node{encapsed}) @@ -7081,7 +7095,7 @@ yydefault: } case 409: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4473 + //line php7/php7.y:4489 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, nil) @@ -7095,7 +7109,7 @@ yydefault: } case 410: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4485 + //line php7/php7.y:4501 { yyVAL.node = scalar.NewEncapsed(yyDollar[2].list) @@ -7109,7 +7123,7 @@ yydefault: } case 411: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4497 + //line php7/php7.y:4513 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, yyDollar[2].list) @@ -7123,7 +7137,7 @@ yydefault: } case 412: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4509 + //line php7/php7.y:4525 { yyVAL.node = yyDollar[1].node @@ -7131,7 +7145,7 @@ yydefault: } case 413: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4515 + //line php7/php7.y:4531 { yyVAL.node = yyDollar[1].node @@ -7139,7 +7153,7 @@ yydefault: } case 414: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4524 + //line php7/php7.y:4540 { yyVAL.node = expr.NewConstFetch(yyDollar[1].node) @@ -7150,7 +7164,7 @@ yydefault: } case 415: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4533 + //line php7/php7.y:4549 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -7167,7 +7181,7 @@ yydefault: } case 416: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4548 + //line php7/php7.y:4564 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -7184,7 +7198,7 @@ yydefault: } case 417: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4566 + //line php7/php7.y:4582 { yyVAL.node = yyDollar[1].node @@ -7192,7 +7206,7 @@ yydefault: } case 418: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4572 + //line php7/php7.y:4588 { yyVAL.node = yyDollar[1].node @@ -7200,7 +7214,7 @@ yydefault: } case 419: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4581 + //line php7/php7.y:4597 { yyVAL.node = nil @@ -7208,7 +7222,7 @@ yydefault: } case 420: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4587 + //line php7/php7.y:4603 { yyVAL.node = yyDollar[1].node @@ -7216,7 +7230,7 @@ yydefault: } case 421: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4596 + //line php7/php7.y:4612 { yyVAL.node = yyDollar[1].node @@ -7224,7 +7238,7 @@ yydefault: } case 422: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4605 + //line php7/php7.y:4621 { yyVAL.node = yyDollar[1].node @@ -7232,7 +7246,7 @@ yydefault: } case 423: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4611 + //line php7/php7.y:4627 { yyVAL.node = yyDollar[2].node @@ -7246,7 +7260,7 @@ yydefault: } case 424: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4623 + //line php7/php7.y:4639 { yyVAL.node = yyDollar[1].node @@ -7254,7 +7268,7 @@ yydefault: } case 425: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4632 + //line php7/php7.y:4648 { yyVAL.node = yyDollar[1].node @@ -7262,7 +7276,7 @@ yydefault: } case 426: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4638 + //line php7/php7.y:4654 { yyVAL.node = yyDollar[2].node @@ -7276,7 +7290,7 @@ yydefault: } case 427: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4650 + //line php7/php7.y:4666 { yyVAL.node = yyDollar[1].node @@ -7284,7 +7298,7 @@ yydefault: } case 428: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4659 + //line php7/php7.y:4675 { yyVAL.node = yyDollar[1].node @@ -7292,7 +7306,7 @@ yydefault: } case 429: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4665 + //line php7/php7.y:4681 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -7309,7 +7323,7 @@ yydefault: } case 430: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4680 + //line php7/php7.y:4696 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -7326,7 +7340,7 @@ yydefault: } case 431: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4695 + //line php7/php7.y:4711 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -7343,7 +7357,7 @@ yydefault: } case 432: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4710 + //line php7/php7.y:4726 { yyVAL.node = expr.NewMethodCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -7357,7 +7371,7 @@ yydefault: } case 433: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4722 + //line php7/php7.y:4738 { yyVAL.node = yyDollar[1].node @@ -7365,7 +7379,7 @@ yydefault: } case 434: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4731 + //line php7/php7.y:4747 { yyVAL.node = yyDollar[1].node @@ -7373,7 +7387,7 @@ yydefault: } case 435: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4737 + //line php7/php7.y:4753 { yyVAL.node = yyDollar[1].node @@ -7381,7 +7395,7 @@ yydefault: } case 436: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4743 + //line php7/php7.y:4759 { yyVAL.node = expr.NewPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -7395,7 +7409,7 @@ yydefault: } case 437: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4758 + //line php7/php7.y:4774 { name := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(name) @@ -7412,7 +7426,7 @@ yydefault: } case 438: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4773 + //line php7/php7.y:4789 { yyVAL.node = expr.NewVariable(yyDollar[3].node) @@ -7431,7 +7445,7 @@ yydefault: } case 439: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4790 + //line php7/php7.y:4806 { yyVAL.node = expr.NewVariable(yyDollar[2].node) @@ -7446,7 +7460,7 @@ yydefault: } case 440: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4806 + //line php7/php7.y:4822 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -7460,7 +7474,7 @@ yydefault: } case 441: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4818 + //line php7/php7.y:4834 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -7474,7 +7488,7 @@ yydefault: } case 442: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4833 + //line php7/php7.y:4849 { yyVAL.node = yyDollar[1].node @@ -7482,7 +7496,7 @@ yydefault: } case 443: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4839 + //line php7/php7.y:4855 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -7499,7 +7513,7 @@ yydefault: } case 444: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4854 + //line php7/php7.y:4870 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -7516,7 +7530,7 @@ yydefault: } case 445: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4869 + //line php7/php7.y:4885 { yyVAL.node = expr.NewPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -7530,7 +7544,7 @@ yydefault: } case 446: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4881 + //line php7/php7.y:4897 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -7544,7 +7558,7 @@ yydefault: } case 447: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4893 + //line php7/php7.y:4909 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -7558,7 +7572,7 @@ yydefault: } case 448: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4908 + //line php7/php7.y:4924 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -7572,7 +7586,7 @@ yydefault: } case 449: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4920 + //line php7/php7.y:4936 { yyVAL.node = yyDollar[2].node @@ -7586,7 +7600,7 @@ yydefault: } case 450: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4932 + //line php7/php7.y:4948 { yyVAL.node = yyDollar[1].node @@ -7594,7 +7608,7 @@ yydefault: } case 451: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4941 + //line php7/php7.y:4957 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -7608,7 +7622,7 @@ yydefault: } case 452: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4953 + //line php7/php7.y:4969 { yyVAL.node = yyDollar[2].node @@ -7622,7 +7636,7 @@ yydefault: } case 453: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4965 + //line php7/php7.y:4981 { yyVAL.node = yyDollar[1].node @@ -7630,7 +7644,7 @@ yydefault: } case 454: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4974 + //line php7/php7.y:4990 { yyVAL.list = yyDollar[1].list @@ -7638,7 +7652,7 @@ yydefault: } case 455: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4983 + //line php7/php7.y:4999 { yyVAL.node = expr.NewArrayItem(nil, nil) @@ -7646,7 +7660,7 @@ yydefault: } case 456: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4989 + //line php7/php7.y:5005 { yyVAL.node = yyDollar[1].node @@ -7654,7 +7668,7 @@ yydefault: } case 457: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4998 + //line php7/php7.y:5014 { if len(yyDollar[1].list) == 0 { yyDollar[1].list = []node.Node{expr.NewArrayItem(nil, nil)} @@ -7669,7 +7683,7 @@ yydefault: } case 458: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5011 + //line php7/php7.y:5027 { if yyDollar[1].node.(*expr.ArrayItem).Key == nil && yyDollar[1].node.(*expr.ArrayItem).Val == nil { yyVAL.list = []node.Node{} @@ -7681,7 +7695,7 @@ yydefault: } case 459: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5024 + //line php7/php7.y:5040 { yyVAL.node = expr.NewArrayItem(yyDollar[1].node, yyDollar[3].node) @@ -7695,7 +7709,7 @@ yydefault: } case 460: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5036 + //line php7/php7.y:5052 { yyVAL.node = expr.NewArrayItem(nil, yyDollar[1].node) @@ -7706,7 +7720,7 @@ yydefault: } case 461: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:5045 + //line php7/php7.y:5061 { reference := expr.NewReference(yyDollar[4].node) yyVAL.node = expr.NewArrayItem(yyDollar[1].node, reference) @@ -7723,7 +7737,7 @@ yydefault: } case 462: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5060 + //line php7/php7.y:5076 { reference := expr.NewReference(yyDollar[2].node) yyVAL.node = expr.NewArrayItem(nil, reference) @@ -7739,7 +7753,7 @@ yydefault: } case 463: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:5074 + //line php7/php7.y:5090 { // TODO: Cannot use list() as standalone expression list := expr.NewList(yyDollar[5].list) @@ -7759,7 +7773,7 @@ yydefault: } case 464: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:5092 + //line php7/php7.y:5108 { // TODO: Cannot use list() as standalone expression list := expr.NewList(yyDollar[3].list) @@ -7778,7 +7792,7 @@ yydefault: } case 465: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5112 + //line php7/php7.y:5128 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -7786,7 +7800,7 @@ yydefault: } case 466: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5118 + //line php7/php7.y:5134 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yyVAL.list = append(yyDollar[1].list, encapsed) @@ -7801,7 +7815,7 @@ yydefault: } case 467: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5131 + //line php7/php7.y:5147 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -7809,7 +7823,7 @@ yydefault: } case 468: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5137 + //line php7/php7.y:5153 { encapsed := scalar.NewEncapsedStringPart(yyDollar[1].token.Value) yyVAL.list = []node.Node{encapsed, yyDollar[2].node} @@ -7824,7 +7838,7 @@ yydefault: } case 469: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5153 + //line php7/php7.y:5169 { name := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(name) @@ -7841,7 +7855,7 @@ yydefault: } case 470: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:5168 + //line php7/php7.y:5184 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -7864,7 +7878,7 @@ yydefault: } case 471: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5189 + //line php7/php7.y:5205 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -7887,7 +7901,7 @@ yydefault: } case 472: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5210 + //line php7/php7.y:5226 { variable := expr.NewVariable(yyDollar[2].node) @@ -7906,7 +7920,7 @@ yydefault: } case 473: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5227 + //line php7/php7.y:5243 { name := node.NewIdentifier(yyDollar[2].token.Value) variable := expr.NewVariable(name) @@ -7928,7 +7942,7 @@ yydefault: } case 474: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:5247 + //line php7/php7.y:5263 { identifier := node.NewIdentifier(yyDollar[2].token.Value) variable := expr.NewVariable(identifier) @@ -7953,7 +7967,7 @@ yydefault: } case 475: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5270 + //line php7/php7.y:5286 { yyVAL.node = yyDollar[2].node @@ -7967,7 +7981,7 @@ yydefault: } case 476: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5285 + //line php7/php7.y:5301 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) @@ -7981,7 +7995,7 @@ yydefault: } case 477: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5297 + //line php7/php7.y:5313 { // TODO: add option to handle 64 bit integer if _, err := strconv.Atoi(yyDollar[1].token.Value); err == nil { @@ -7997,7 +8011,7 @@ yydefault: } case 478: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5311 + //line php7/php7.y:5327 { var lnumber *scalar.Lnumber // TODO: add option to handle 64 bit integer @@ -8025,7 +8039,7 @@ yydefault: } case 479: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5337 + //line php7/php7.y:5353 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(identifier) @@ -8042,7 +8056,7 @@ yydefault: } case 480: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:5355 + //line php7/php7.y:5371 { yyVAL.node = expr.NewIsset(yyDollar[3].list) @@ -8062,7 +8076,7 @@ yydefault: } case 481: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:5373 + //line php7/php7.y:5389 { yyVAL.node = expr.NewEmpty(yyDollar[3].node) @@ -8078,7 +8092,7 @@ yydefault: } case 482: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5387 + //line php7/php7.y:5403 { yyVAL.node = expr.NewInclude(yyDollar[2].node) @@ -8092,7 +8106,7 @@ yydefault: } case 483: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5399 + //line php7/php7.y:5415 { yyVAL.node = expr.NewIncludeOnce(yyDollar[2].node) @@ -8106,7 +8120,7 @@ yydefault: } case 484: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:5411 + //line php7/php7.y:5427 { yyVAL.node = expr.NewEval(yyDollar[3].node) @@ -8122,7 +8136,7 @@ yydefault: } case 485: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5425 + //line php7/php7.y:5441 { yyVAL.node = expr.NewRequire(yyDollar[2].node) @@ -8136,7 +8150,7 @@ yydefault: } case 486: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5437 + //line php7/php7.y:5453 { yyVAL.node = expr.NewRequireOnce(yyDollar[2].node) @@ -8150,7 +8164,7 @@ yydefault: } case 487: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5452 + //line php7/php7.y:5468 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -8158,7 +8172,7 @@ yydefault: } case 488: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5458 + //line php7/php7.y:5474 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -8169,7 +8183,7 @@ yydefault: } case 489: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5470 + //line php7/php7.y:5486 { yyVAL.node = yyDollar[1].node diff --git a/php7/php7.y b/php7/php7.y index a4ba1c3..62e396d 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -1508,6 +1508,8 @@ class_declaration_statement: $7.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) $9.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) + $1[0].GetMeta().Cut(inheritMetaFilter).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_CLASS T_STRING extends_from implements_list backup_doc_comment '{' class_statement_list '}' @@ -1520,7 +1522,7 @@ class_declaration_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $8)) // save comments - $1.Meta.SetTokenName(meta.ClassToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $2.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) $6.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) $8.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) @@ -2145,13 +2147,20 @@ parameter: } // save comments + if $1 != nil { + $1.GetMeta().Cut(inheritMetaFilter).PrependTo($$.GetMeta()) + } if $2 != nil { $2.Meta.SetTokenName(meta.AmpersandToken).AppendTo($$.GetMeta()) } if $3 != nil { $3.Meta.SetTokenName(meta.EllipsisToken).AppendTo($$.GetMeta()) } - $4.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + if $1 == nil && $2 == nil && $3 == nil { + $4.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + } else { + $4.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + } yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -2176,13 +2185,20 @@ parameter: } // save comments + if $1 != nil { + $1.GetMeta().Cut(inheritMetaFilter).PrependTo($$.GetMeta()) + } if $2 != nil { $2.Meta.SetTokenName(meta.AmpersandToken).AppendTo($$.GetMeta()) } if $3 != nil { $3.Meta.SetTokenName(meta.EllipsisToken).AppendTo($$.GetMeta()) } - $4.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + if $1 == nil && $2 == nil && $3 == nil { + $4.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + } else { + $4.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + } yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) $5.Meta.SetTokenName(meta.EqualToken).AppendTo($$.GetMeta()) diff --git a/visitor/dumper_test.go b/visitor/dumper_test.go index d785983..214f1d9 100644 --- a/visitor/dumper_test.go +++ b/visitor/dumper_test.go @@ -61,7 +61,7 @@ func ExampleDumper() { // | "Position": Pos{Line: 4-10 Pos: 29-139} // | "NamespacedName": "Foo\\Bar" // | "Meta": - // | "\n\t\t\t" before "ClassToken" + // | "\n\t\t\t" before "NodeStart" // | " " before "OpenCurlyBracesToken" // | "\n\t\t\t" before "CloseCurlyBracesToken" // | "PhpDocComment": "" diff --git a/visitor/go_dumper_test.go b/visitor/go_dumper_test.go index 03a6f4b..1765cee 100644 --- a/visitor/go_dumper_test.go +++ b/visitor/go_dumper_test.go @@ -146,7 +146,7 @@ func ExampleGoDumper() { // EndPos: 28, // }, // Value: "\n\t\t\t", - // TokenName: meta.ClassToken, + // TokenName: meta.NodeStart, // }, // &meta.Data{ // Type: meta.WhiteSpaceType, diff --git a/visitor/json_dumper_test.go b/visitor/json_dumper_test.go index 13435a7..4b6328a 100644 --- a/visitor/json_dumper_test.go +++ b/visitor/json_dumper_test.go @@ -37,5 +37,5 @@ func ExampleJsonDumper() { nodes.Walk(dumper) // Output: - // {"type":"*node.Root","position":{"startPos":10,"endPos":166,"startLine":3,"endLine":12},"Stmts":[{"type":"*stmt.Namespace","position":{"startPos":10,"endPos":166,"startLine":3,"endLine":12},"meta":[{"type":"*meta.TokenType","value":" Date: Wed, 26 Dec 2018 12:09:54 +0200 Subject: [PATCH 101/117] #70: [php7] inherit meta.Data at node.Argument, stmt.PropertyList, stmt.ClassConstList, stmt.ClassMethod, stmt.TraitUsePrecedence, stmt.TraitUseAlias, stmt.TraitMethodRef --- php5/php5.go | 1 + php7/php7.go | 545 +++++++++++++++-------------- php7/php7.y | 27 +- visitor/dumper_test.go | 3 +- visitor/go_dumper_test.go | 24 +- visitor/json_dumper_test.go | 2 +- visitor/pretty_json_dumper_test.go | 12 +- 7 files changed, 328 insertions(+), 286 deletions(-) diff --git a/php5/php5.go b/php5/php5.go index f704ada..87a32d0 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -349,6 +349,7 @@ const yyErrCode = 2 const yyInitialStackSize = 16 //line php5/php5.y:6988 + type simpleIndirectReference struct { all []*expr.Variable last *expr.Variable diff --git a/php7/php7.go b/php7/php7.go index 57dea94..b4d962d 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -1,3 +1,5 @@ +// Code generated by goyacc -o php7/php7.go php7/php7.y. DO NOT EDIT. + //line php7/php7.y:2 package php7 @@ -346,7 +348,7 @@ const yyEofCode = 1 const yyErrCode = 2 const yyInitialStackSize = 16 -//line php7/php7.y:5495 +//line php7/php7.y:5518 //line yacctab:1 var yyExca = [...]int{ @@ -4739,11 +4741,14 @@ yydefault: // save position yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) + // save comments + yyDollar[1].node.GetMeta().Cut(inheritMetaFilter).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 232: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2358 + //line php7/php7.y:2361 { yyVAL.node = node.NewArgument(yyDollar[2].node, true, false) @@ -4751,13 +4756,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.EllipsisToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 233: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2373 + //line php7/php7.y:2376 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4768,7 +4773,7 @@ yydefault: } case 234: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2382 + //line php7/php7.y:2385 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4776,7 +4781,7 @@ yydefault: } case 235: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2391 + //line php7/php7.y:2394 { yyVAL.node = yyDollar[1].node @@ -4784,7 +4789,7 @@ yydefault: } case 236: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2400 + //line php7/php7.y:2403 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4795,7 +4800,7 @@ yydefault: } case 237: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2409 + //line php7/php7.y:2412 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4803,7 +4808,7 @@ yydefault: } case 238: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2418 + //line php7/php7.y:2421 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -4822,7 +4827,7 @@ yydefault: } case 239: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2435 + //line php7/php7.y:2438 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -4842,7 +4847,7 @@ yydefault: } case 240: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2456 + //line php7/php7.y:2459 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -4850,7 +4855,7 @@ yydefault: } case 241: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:2462 + //line php7/php7.y:2465 { yyVAL.list = []node.Node{} @@ -4858,7 +4863,7 @@ yydefault: } case 242: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2471 + //line php7/php7.y:2474 { yyVAL.node = stmt.NewPropertyList(yyDollar[1].list, yyDollar[2].list) @@ -4869,11 +4874,13 @@ yydefault: yyDollar[3].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.SemiColonToken) + yyDollar[1].list[0].GetMeta().Cut(inheritMetaFilter).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 243: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2484 + //line php7/php7.y:2489 { yyVAL.node = stmt.NewClassConstList(yyDollar[1].list, yyDollar[3].list) @@ -4889,7 +4896,7 @@ yydefault: } case 244: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2498 + //line php7/php7.y:2505 { yyVAL.node = stmt.NewTraitUse(yyDollar[2].list, yyDollar[3].node) @@ -4903,7 +4910,7 @@ yydefault: } case 245: yyDollar = yyS[yypt-10 : yypt+1] - //line php7/php7.y:2510 + //line php7/php7.y:2517 { name := node.NewIdentifier(yyDollar[4].token.Value) yyVAL.node = stmt.NewClassMethod(name, yyDollar[1].list, yyDollar[3].token != nil, yyDollar[7].list, yyDollar[9].node, yyDollar[10].node, yyDollar[5].str) @@ -4925,11 +4932,15 @@ yydefault: yyDollar[6].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[8].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + if len(yyDollar[1].list) > 0 { + yyDollar[1].list[0].GetMeta().Cut(inheritMetaFilter).PrependTo(yyVAL.node.GetMeta()) + } + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 246: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2537 + //line php7/php7.y:2548 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4937,7 +4948,7 @@ yydefault: } case 247: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2543 + //line php7/php7.y:2554 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4948,7 +4959,7 @@ yydefault: } case 248: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2555 + //line php7/php7.y:2566 { yyVAL.node = stmt.NewNop() @@ -4962,7 +4973,7 @@ yydefault: } case 249: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2568 + //line php7/php7.y:2579 { yyVAL.node = stmt.NewTraitAdaptationList(nil) @@ -4976,7 +4987,7 @@ yydefault: } case 250: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2580 + //line php7/php7.y:2591 { yyVAL.node = stmt.NewTraitAdaptationList(yyDollar[2].list) @@ -4990,7 +5001,7 @@ yydefault: } case 251: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2595 + //line php7/php7.y:2606 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4998,7 +5009,7 @@ yydefault: } case 252: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2601 + //line php7/php7.y:2612 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -5006,7 +5017,7 @@ yydefault: } case 253: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2610 + //line php7/php7.y:2621 { yyVAL.node = yyDollar[1].node @@ -5018,7 +5029,7 @@ yydefault: } case 254: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2620 + //line php7/php7.y:2631 { yyVAL.node = yyDollar[1].node @@ -5030,7 +5041,7 @@ yydefault: } case 255: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2633 + //line php7/php7.y:2644 { yyVAL.node = stmt.NewTraitUsePrecedence(yyDollar[1].node, yyDollar[3].list) @@ -5040,11 +5051,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.InsteadofToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(inheritMetaFilter).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 256: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2648 + //line php7/php7.y:2661 { alias := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, nil, alias) @@ -5057,11 +5070,13 @@ yydefault: yyDollar[2].token.Meta.SetTokenName(meta.AsToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(alias.GetMeta()) + yyDollar[1].node.GetMeta().Cut(inheritMetaFilter).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 257: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2663 + //line php7/php7.y:2678 { alias := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, nil, alias) @@ -5074,11 +5089,13 @@ yydefault: yyDollar[2].token.Meta.SetTokenName(meta.AsToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(alias.GetMeta()) + yyDollar[1].node.GetMeta().Cut(inheritMetaFilter).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 258: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2678 + //line php7/php7.y:2695 { alias := node.NewIdentifier(yyDollar[4].token.Value) yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, yyDollar[3].node, alias) @@ -5091,11 +5108,13 @@ yydefault: yyDollar[2].token.Meta.SetTokenName(meta.AsToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.NodeStart).AppendTo(alias.GetMeta()) + yyDollar[1].node.GetMeta().Cut(inheritMetaFilter).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 259: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2693 + //line php7/php7.y:2712 { yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, yyDollar[3].node, nil) @@ -5105,11 +5124,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.AsToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(inheritMetaFilter).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 260: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2708 + //line php7/php7.y:2729 { name := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewTraitMethodRef(nil, name) @@ -5119,13 +5140,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 261: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2722 + //line php7/php7.y:2743 { yyVAL.node = yyDollar[1].node @@ -5133,7 +5154,7 @@ yydefault: } case 262: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2731 + //line php7/php7.y:2752 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewTraitMethodRef(yyDollar[1].node, target) @@ -5146,11 +5167,13 @@ yydefault: yyDollar[2].token.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(target.GetMeta()) + yyDollar[1].node.GetMeta().Cut(inheritMetaFilter).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 263: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2749 + //line php7/php7.y:2772 { yyVAL.node = stmt.NewNop() @@ -5165,7 +5188,7 @@ yydefault: } case 264: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2762 + //line php7/php7.y:2785 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) @@ -5180,7 +5203,7 @@ yydefault: } case 265: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2778 + //line php7/php7.y:2801 { yyVAL.list = yyDollar[1].list @@ -5188,7 +5211,7 @@ yydefault: } case 266: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2784 + //line php7/php7.y:2807 { modifier := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.list = []node.Node{modifier} @@ -5203,7 +5226,7 @@ yydefault: } case 267: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:2800 + //line php7/php7.y:2823 { yyVAL.list = nil @@ -5211,7 +5234,7 @@ yydefault: } case 268: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2806 + //line php7/php7.y:2829 { yyVAL.list = yyDollar[1].list @@ -5219,7 +5242,7 @@ yydefault: } case 269: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2815 + //line php7/php7.y:2838 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -5227,7 +5250,7 @@ yydefault: } case 270: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2821 + //line php7/php7.y:2844 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -5235,7 +5258,7 @@ yydefault: } case 271: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2830 + //line php7/php7.y:2853 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5249,7 +5272,7 @@ yydefault: } case 272: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2842 + //line php7/php7.y:2865 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5263,7 +5286,7 @@ yydefault: } case 273: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2854 + //line php7/php7.y:2877 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5277,7 +5300,7 @@ yydefault: } case 274: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2866 + //line php7/php7.y:2889 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5291,7 +5314,7 @@ yydefault: } case 275: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2878 + //line php7/php7.y:2901 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5305,7 +5328,7 @@ yydefault: } case 276: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2890 + //line php7/php7.y:2913 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5319,7 +5342,7 @@ yydefault: } case 277: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2905 + //line php7/php7.y:2928 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -5330,7 +5353,7 @@ yydefault: } case 278: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2914 + //line php7/php7.y:2937 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -5338,7 +5361,7 @@ yydefault: } case 279: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2923 + //line php7/php7.y:2946 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -5357,7 +5380,7 @@ yydefault: } case 280: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2940 + //line php7/php7.y:2963 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -5377,7 +5400,7 @@ yydefault: } case 281: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2961 + //line php7/php7.y:2984 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -5388,7 +5411,7 @@ yydefault: } case 282: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2970 + //line php7/php7.y:2993 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -5396,7 +5419,7 @@ yydefault: } case 283: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2979 + //line php7/php7.y:3002 { name := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewConstant(name, yyDollar[3].node, yyDollar[4].str) @@ -5413,7 +5436,7 @@ yydefault: } case 284: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2997 + //line php7/php7.y:3020 { name := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewConstant(name, yyDollar[3].node, yyDollar[4].str) @@ -5430,7 +5453,7 @@ yydefault: } case 285: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3015 + //line php7/php7.y:3038 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -5441,7 +5464,7 @@ yydefault: } case 286: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3024 + //line php7/php7.y:3047 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -5449,7 +5472,7 @@ yydefault: } case 287: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3033 + //line php7/php7.y:3056 { yyVAL.node = yyDollar[1].node @@ -5457,7 +5480,7 @@ yydefault: } case 288: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3042 + //line php7/php7.y:3065 { yyVAL.list = nil @@ -5465,7 +5488,7 @@ yydefault: } case 289: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3048 + //line php7/php7.y:3071 { yyVAL.list = yyDollar[1].list @@ -5473,7 +5496,7 @@ yydefault: } case 290: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3057 + //line php7/php7.y:3080 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -5484,7 +5507,7 @@ yydefault: } case 291: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3066 + //line php7/php7.y:3089 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -5492,7 +5515,7 @@ yydefault: } case 292: yyDollar = yyS[yypt-8 : yypt+1] - //line php7/php7.y:3075 + //line php7/php7.y:3098 { if yyDollar[2].node != nil { yyVAL.node = stmt.NewClass(nil, nil, yyDollar[2].node.(*node.ArgumentList), yyDollar[3].ClassExtends, yyDollar[4].ClassImplements, yyDollar[7].list, yyDollar[5].str) @@ -5512,7 +5535,7 @@ yydefault: } case 293: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3096 + //line php7/php7.y:3119 { if yyDollar[3].node != nil { yyVAL.node = expr.NewNew(yyDollar[2].node, yyDollar[3].node.(*node.ArgumentList)) @@ -5529,7 +5552,7 @@ yydefault: } case 294: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3111 + //line php7/php7.y:3134 { yyVAL.node = expr.NewNew(yyDollar[2].node, nil) @@ -5543,7 +5566,7 @@ yydefault: } case 295: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:3126 + //line php7/php7.y:3149 { list := expr.NewList(yyDollar[3].list) yyVAL.node = assign.NewAssign(list, yyDollar[6].node) @@ -5562,7 +5585,7 @@ yydefault: } case 296: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:3143 + //line php7/php7.y:3166 { shortList := expr.NewShortList(yyDollar[2].list) yyVAL.node = assign.NewAssign(shortList, yyDollar[5].node) @@ -5580,7 +5603,7 @@ yydefault: } case 297: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3159 + //line php7/php7.y:3182 { yyVAL.node = assign.NewAssign(yyDollar[1].node, yyDollar[3].node) @@ -5594,7 +5617,7 @@ yydefault: } case 298: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3171 + //line php7/php7.y:3194 { yyVAL.node = assign.NewReference(yyDollar[1].node, yyDollar[4].node) @@ -5609,7 +5632,7 @@ yydefault: } case 299: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3184 + //line php7/php7.y:3207 { yyVAL.node = expr.NewClone(yyDollar[2].node) @@ -5623,7 +5646,7 @@ yydefault: } case 300: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3196 + //line php7/php7.y:3219 { yyVAL.node = assign.NewPlus(yyDollar[1].node, yyDollar[3].node) @@ -5637,7 +5660,7 @@ yydefault: } case 301: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3208 + //line php7/php7.y:3231 { yyVAL.node = assign.NewMinus(yyDollar[1].node, yyDollar[3].node) @@ -5651,7 +5674,7 @@ yydefault: } case 302: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3220 + //line php7/php7.y:3243 { yyVAL.node = assign.NewMul(yyDollar[1].node, yyDollar[3].node) @@ -5665,7 +5688,7 @@ yydefault: } case 303: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3232 + //line php7/php7.y:3255 { yyVAL.node = assign.NewPow(yyDollar[1].node, yyDollar[3].node) @@ -5679,7 +5702,7 @@ yydefault: } case 304: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3244 + //line php7/php7.y:3267 { yyVAL.node = assign.NewDiv(yyDollar[1].node, yyDollar[3].node) @@ -5693,7 +5716,7 @@ yydefault: } case 305: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3256 + //line php7/php7.y:3279 { yyVAL.node = assign.NewConcat(yyDollar[1].node, yyDollar[3].node) @@ -5707,7 +5730,7 @@ yydefault: } case 306: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3268 + //line php7/php7.y:3291 { yyVAL.node = assign.NewMod(yyDollar[1].node, yyDollar[3].node) @@ -5721,7 +5744,7 @@ yydefault: } case 307: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3280 + //line php7/php7.y:3303 { yyVAL.node = assign.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) @@ -5735,7 +5758,7 @@ yydefault: } case 308: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3292 + //line php7/php7.y:3315 { yyVAL.node = assign.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) @@ -5749,7 +5772,7 @@ yydefault: } case 309: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3304 + //line php7/php7.y:3327 { yyVAL.node = assign.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) @@ -5763,7 +5786,7 @@ yydefault: } case 310: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3316 + //line php7/php7.y:3339 { yyVAL.node = assign.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) @@ -5777,7 +5800,7 @@ yydefault: } case 311: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3328 + //line php7/php7.y:3351 { yyVAL.node = assign.NewShiftRight(yyDollar[1].node, yyDollar[3].node) @@ -5791,7 +5814,7 @@ yydefault: } case 312: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3340 + //line php7/php7.y:3363 { yyVAL.node = expr.NewPostInc(yyDollar[1].node) @@ -5805,7 +5828,7 @@ yydefault: } case 313: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3352 + //line php7/php7.y:3375 { yyVAL.node = expr.NewPreInc(yyDollar[2].node) @@ -5819,7 +5842,7 @@ yydefault: } case 314: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3364 + //line php7/php7.y:3387 { yyVAL.node = expr.NewPostDec(yyDollar[1].node) @@ -5833,7 +5856,7 @@ yydefault: } case 315: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3376 + //line php7/php7.y:3399 { yyVAL.node = expr.NewPreDec(yyDollar[2].node) @@ -5847,7 +5870,7 @@ yydefault: } case 316: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3388 + //line php7/php7.y:3411 { yyVAL.node = binary.NewBooleanOr(yyDollar[1].node, yyDollar[3].node) @@ -5861,7 +5884,7 @@ yydefault: } case 317: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3400 + //line php7/php7.y:3423 { yyVAL.node = binary.NewBooleanAnd(yyDollar[1].node, yyDollar[3].node) @@ -5875,7 +5898,7 @@ yydefault: } case 318: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3412 + //line php7/php7.y:3435 { yyVAL.node = binary.NewLogicalOr(yyDollar[1].node, yyDollar[3].node) @@ -5889,7 +5912,7 @@ yydefault: } case 319: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3424 + //line php7/php7.y:3447 { yyVAL.node = binary.NewLogicalAnd(yyDollar[1].node, yyDollar[3].node) @@ -5903,7 +5926,7 @@ yydefault: } case 320: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3436 + //line php7/php7.y:3459 { yyVAL.node = binary.NewLogicalXor(yyDollar[1].node, yyDollar[3].node) @@ -5917,7 +5940,7 @@ yydefault: } case 321: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3448 + //line php7/php7.y:3471 { yyVAL.node = binary.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) @@ -5931,7 +5954,7 @@ yydefault: } case 322: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3460 + //line php7/php7.y:3483 { yyVAL.node = binary.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) @@ -5945,7 +5968,7 @@ yydefault: } case 323: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3472 + //line php7/php7.y:3495 { yyVAL.node = binary.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) @@ -5959,7 +5982,7 @@ yydefault: } case 324: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3484 + //line php7/php7.y:3507 { yyVAL.node = binary.NewConcat(yyDollar[1].node, yyDollar[3].node) @@ -5973,7 +5996,7 @@ yydefault: } case 325: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3496 + //line php7/php7.y:3519 { yyVAL.node = binary.NewPlus(yyDollar[1].node, yyDollar[3].node) @@ -5987,7 +6010,7 @@ yydefault: } case 326: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3508 + //line php7/php7.y:3531 { yyVAL.node = binary.NewMinus(yyDollar[1].node, yyDollar[3].node) @@ -6001,7 +6024,7 @@ yydefault: } case 327: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3520 + //line php7/php7.y:3543 { yyVAL.node = binary.NewMul(yyDollar[1].node, yyDollar[3].node) @@ -6015,7 +6038,7 @@ yydefault: } case 328: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3532 + //line php7/php7.y:3555 { yyVAL.node = binary.NewPow(yyDollar[1].node, yyDollar[3].node) @@ -6029,7 +6052,7 @@ yydefault: } case 329: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3544 + //line php7/php7.y:3567 { yyVAL.node = binary.NewDiv(yyDollar[1].node, yyDollar[3].node) @@ -6043,7 +6066,7 @@ yydefault: } case 330: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3556 + //line php7/php7.y:3579 { yyVAL.node = binary.NewMod(yyDollar[1].node, yyDollar[3].node) @@ -6057,7 +6080,7 @@ yydefault: } case 331: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3568 + //line php7/php7.y:3591 { yyVAL.node = binary.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) @@ -6071,7 +6094,7 @@ yydefault: } case 332: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3580 + //line php7/php7.y:3603 { yyVAL.node = binary.NewShiftRight(yyDollar[1].node, yyDollar[3].node) @@ -6085,7 +6108,7 @@ yydefault: } case 333: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3592 + //line php7/php7.y:3615 { yyVAL.node = expr.NewUnaryPlus(yyDollar[2].node) @@ -6099,7 +6122,7 @@ yydefault: } case 334: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3604 + //line php7/php7.y:3627 { yyVAL.node = expr.NewUnaryMinus(yyDollar[2].node) @@ -6113,7 +6136,7 @@ yydefault: } case 335: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3616 + //line php7/php7.y:3639 { yyVAL.node = expr.NewBooleanNot(yyDollar[2].node) @@ -6127,7 +6150,7 @@ yydefault: } case 336: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3628 + //line php7/php7.y:3651 { yyVAL.node = expr.NewBitwiseNot(yyDollar[2].node) @@ -6141,7 +6164,7 @@ yydefault: } case 337: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3640 + //line php7/php7.y:3663 { yyVAL.node = binary.NewIdentical(yyDollar[1].node, yyDollar[3].node) @@ -6155,7 +6178,7 @@ yydefault: } case 338: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3652 + //line php7/php7.y:3675 { yyVAL.node = binary.NewNotIdentical(yyDollar[1].node, yyDollar[3].node) @@ -6169,7 +6192,7 @@ yydefault: } case 339: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3664 + //line php7/php7.y:3687 { yyVAL.node = binary.NewEqual(yyDollar[1].node, yyDollar[3].node) @@ -6183,7 +6206,7 @@ yydefault: } case 340: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3676 + //line php7/php7.y:3699 { yyVAL.node = binary.NewNotEqual(yyDollar[1].node, yyDollar[3].node) @@ -6198,7 +6221,7 @@ yydefault: } case 341: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3689 + //line php7/php7.y:3712 { yyVAL.node = binary.NewSmaller(yyDollar[1].node, yyDollar[3].node) @@ -6212,7 +6235,7 @@ yydefault: } case 342: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3701 + //line php7/php7.y:3724 { yyVAL.node = binary.NewSmallerOrEqual(yyDollar[1].node, yyDollar[3].node) @@ -6226,7 +6249,7 @@ yydefault: } case 343: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3713 + //line php7/php7.y:3736 { yyVAL.node = binary.NewGreater(yyDollar[1].node, yyDollar[3].node) @@ -6240,7 +6263,7 @@ yydefault: } case 344: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3725 + //line php7/php7.y:3748 { yyVAL.node = binary.NewGreaterOrEqual(yyDollar[1].node, yyDollar[3].node) @@ -6254,7 +6277,7 @@ yydefault: } case 345: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3737 + //line php7/php7.y:3760 { yyVAL.node = binary.NewSpaceship(yyDollar[1].node, yyDollar[3].node) @@ -6268,7 +6291,7 @@ yydefault: } case 346: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3749 + //line php7/php7.y:3772 { yyVAL.node = expr.NewInstanceOf(yyDollar[1].node, yyDollar[3].node) @@ -6282,7 +6305,7 @@ yydefault: } case 347: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3761 + //line php7/php7.y:3784 { yyVAL.node = yyDollar[2].node @@ -6296,7 +6319,7 @@ yydefault: } case 348: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3773 + //line php7/php7.y:3796 { yyVAL.node = yyDollar[1].node @@ -6304,7 +6327,7 @@ yydefault: } case 349: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:3779 + //line php7/php7.y:3802 { yyVAL.node = expr.NewTernary(yyDollar[1].node, yyDollar[3].node, yyDollar[5].node) @@ -6319,7 +6342,7 @@ yydefault: } case 350: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3792 + //line php7/php7.y:3815 { yyVAL.node = expr.NewTernary(yyDollar[1].node, nil, yyDollar[4].node) @@ -6334,7 +6357,7 @@ yydefault: } case 351: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3805 + //line php7/php7.y:3828 { yyVAL.node = binary.NewCoalesce(yyDollar[1].node, yyDollar[3].node) @@ -6348,7 +6371,7 @@ yydefault: } case 352: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3817 + //line php7/php7.y:3840 { yyVAL.node = yyDollar[1].node @@ -6356,7 +6379,7 @@ yydefault: } case 353: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3823 + //line php7/php7.y:3846 { yyVAL.node = cast.NewInt(yyDollar[2].node) @@ -6371,7 +6394,7 @@ yydefault: } case 354: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3836 + //line php7/php7.y:3859 { yyVAL.node = cast.NewDouble(yyDollar[2].node) @@ -6386,7 +6409,7 @@ yydefault: } case 355: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3849 + //line php7/php7.y:3872 { yyVAL.node = cast.NewString(yyDollar[2].node) @@ -6401,7 +6424,7 @@ yydefault: } case 356: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3862 + //line php7/php7.y:3885 { yyVAL.node = cast.NewArray(yyDollar[2].node) @@ -6416,7 +6439,7 @@ yydefault: } case 357: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3875 + //line php7/php7.y:3898 { yyVAL.node = cast.NewObject(yyDollar[2].node) @@ -6431,7 +6454,7 @@ yydefault: } case 358: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3888 + //line php7/php7.y:3911 { yyVAL.node = cast.NewBool(yyDollar[2].node) @@ -6446,7 +6469,7 @@ yydefault: } case 359: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3901 + //line php7/php7.y:3924 { yyVAL.node = cast.NewUnset(yyDollar[2].node) @@ -6461,7 +6484,7 @@ yydefault: } case 360: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3914 + //line php7/php7.y:3937 { var e *expr.Exit if yyDollar[2].node != nil { @@ -6490,7 +6513,7 @@ yydefault: } case 361: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3941 + //line php7/php7.y:3964 { yyVAL.node = expr.NewErrorSuppress(yyDollar[2].node) @@ -6504,7 +6527,7 @@ yydefault: } case 362: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3953 + //line php7/php7.y:3976 { yyVAL.node = yyDollar[1].node @@ -6512,7 +6535,7 @@ yydefault: } case 363: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3959 + //line php7/php7.y:3982 { yyVAL.node = expr.NewShellExec(yyDollar[2].list) @@ -6526,7 +6549,7 @@ yydefault: } case 364: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3971 + //line php7/php7.y:3994 { yyVAL.node = expr.NewPrint(yyDollar[2].node) @@ -6540,7 +6563,7 @@ yydefault: } case 365: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3983 + //line php7/php7.y:4006 { yyVAL.node = expr.NewYield(nil, nil) @@ -6554,7 +6577,7 @@ yydefault: } case 366: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3995 + //line php7/php7.y:4018 { yyVAL.node = expr.NewYield(nil, yyDollar[2].node) @@ -6568,7 +6591,7 @@ yydefault: } case 367: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4007 + //line php7/php7.y:4030 { yyVAL.node = expr.NewYield(yyDollar[2].node, yyDollar[4].node) @@ -6583,7 +6606,7 @@ yydefault: } case 368: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4020 + //line php7/php7.y:4043 { yyVAL.node = expr.NewYieldFrom(yyDollar[2].node) @@ -6597,7 +6620,7 @@ yydefault: } case 369: yyDollar = yyS[yypt-11 : yypt+1] - //line php7/php7.y:4032 + //line php7/php7.y:4055 { yyVAL.node = expr.NewClosure(yyDollar[5].list, yyDollar[7].ClosureUse, yyDollar[8].node, yyDollar[10].list, false, yyDollar[2].token != nil, yyDollar[3].str) @@ -6618,7 +6641,7 @@ yydefault: } case 370: yyDollar = yyS[yypt-12 : yypt+1] - //line php7/php7.y:4051 + //line php7/php7.y:4074 { yyVAL.node = expr.NewClosure(yyDollar[6].list, yyDollar[8].ClosureUse, yyDollar[9].node, yyDollar[11].list, true, yyDollar[3].token != nil, yyDollar[4].str) @@ -6640,7 +6663,7 @@ yydefault: } case 371: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4074 + //line php7/php7.y:4097 { yyVAL.str = yylex.(*Parser).PhpDocComment yylex.(*Parser).PhpDocComment = "" @@ -6649,19 +6672,19 @@ yydefault: } case 372: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4084 + //line php7/php7.y:4107 { yyVAL.token = nil } case 373: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4088 + //line php7/php7.y:4111 { yyVAL.token = yyDollar[1].token } case 374: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4095 + //line php7/php7.y:4118 { yyVAL.ClosureUse = nil @@ -6669,7 +6692,7 @@ yydefault: } case 375: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4101 + //line php7/php7.y:4124 { yyVAL.ClosureUse = expr.NewClosureUse(yyDollar[3].list) @@ -6685,7 +6708,7 @@ yydefault: } case 376: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4118 + //line php7/php7.y:4141 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -6696,7 +6719,7 @@ yydefault: } case 377: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4127 + //line php7/php7.y:4150 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -6704,7 +6727,7 @@ yydefault: } case 378: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4136 + //line php7/php7.y:4159 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(identifier) @@ -6721,7 +6744,7 @@ yydefault: } case 379: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4151 + //line php7/php7.y:4174 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[2].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -6741,7 +6764,7 @@ yydefault: } case 380: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4172 + //line php7/php7.y:4195 { yyVAL.node = expr.NewFunctionCall(yyDollar[1].node, yyDollar[2].node.(*node.ArgumentList)) @@ -6752,7 +6775,7 @@ yydefault: } case 381: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4181 + //line php7/php7.y:4204 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -6766,7 +6789,7 @@ yydefault: } case 382: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4193 + //line php7/php7.y:4216 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -6780,7 +6803,7 @@ yydefault: } case 383: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4205 + //line php7/php7.y:4228 { yyVAL.node = expr.NewFunctionCall(yyDollar[1].node, yyDollar[2].node.(*node.ArgumentList)) @@ -6791,7 +6814,7 @@ yydefault: } case 384: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4217 + //line php7/php7.y:4240 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -6805,7 +6828,7 @@ yydefault: } case 385: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4229 + //line php7/php7.y:4252 { yyVAL.node = yyDollar[1].node @@ -6813,7 +6836,7 @@ yydefault: } case 386: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4238 + //line php7/php7.y:4261 { yyVAL.node = yyDollar[1].node @@ -6821,7 +6844,7 @@ yydefault: } case 387: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4244 + //line php7/php7.y:4267 { yyVAL.node = yyDollar[1].node @@ -6829,7 +6852,7 @@ yydefault: } case 388: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4253 + //line php7/php7.y:4276 { yyVAL.node = nil @@ -6837,7 +6860,7 @@ yydefault: } case 389: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4259 + //line php7/php7.y:4282 { yyVAL.node = expr.NewExit(yyDollar[2].node) @@ -6854,7 +6877,7 @@ yydefault: } case 390: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4277 + //line php7/php7.y:4300 { yyVAL.list = []node.Node{} @@ -6862,7 +6885,7 @@ yydefault: } case 391: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4283 + //line php7/php7.y:4306 { yyVAL.list = []node.Node{scalar.NewEncapsedStringPart(yyDollar[1].token.Value)} @@ -6870,7 +6893,7 @@ yydefault: } case 392: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4289 + //line php7/php7.y:4312 { yyVAL.list = yyDollar[1].list @@ -6878,7 +6901,7 @@ yydefault: } case 393: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4298 + //line php7/php7.y:4321 { yyVAL.node = nil @@ -6886,7 +6909,7 @@ yydefault: } case 394: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4304 + //line php7/php7.y:4327 { yyVAL.node = yyDollar[1].node @@ -6894,7 +6917,7 @@ yydefault: } case 395: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4313 + //line php7/php7.y:4336 { yyVAL.node = expr.NewArray(yyDollar[3].list) @@ -6910,7 +6933,7 @@ yydefault: } case 396: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4327 + //line php7/php7.y:4350 { yyVAL.node = expr.NewShortArray(yyDollar[2].list) @@ -6925,7 +6948,7 @@ yydefault: } case 397: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4340 + //line php7/php7.y:4363 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) @@ -6939,7 +6962,7 @@ yydefault: } case 398: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4355 + //line php7/php7.y:4378 { yyVAL.node = scalar.NewLnumber(yyDollar[1].token.Value) @@ -6953,7 +6976,7 @@ yydefault: } case 399: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4367 + //line php7/php7.y:4390 { yyVAL.node = scalar.NewDnumber(yyDollar[1].token.Value) @@ -6967,7 +6990,7 @@ yydefault: } case 400: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4379 + //line php7/php7.y:4402 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6981,7 +7004,7 @@ yydefault: } case 401: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4391 + //line php7/php7.y:4414 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6995,7 +7018,7 @@ yydefault: } case 402: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4403 + //line php7/php7.y:4426 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7009,7 +7032,7 @@ yydefault: } case 403: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4415 + //line php7/php7.y:4438 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7023,7 +7046,7 @@ yydefault: } case 404: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4427 + //line php7/php7.y:4450 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7037,7 +7060,7 @@ yydefault: } case 405: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4439 + //line php7/php7.y:4462 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7051,7 +7074,7 @@ yydefault: } case 406: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4451 + //line php7/php7.y:4474 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7065,7 +7088,7 @@ yydefault: } case 407: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4463 + //line php7/php7.y:4486 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7079,7 +7102,7 @@ yydefault: } case 408: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4475 + //line php7/php7.y:4498 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, []node.Node{encapsed}) @@ -7095,7 +7118,7 @@ yydefault: } case 409: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4489 + //line php7/php7.y:4512 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, nil) @@ -7109,7 +7132,7 @@ yydefault: } case 410: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4501 + //line php7/php7.y:4524 { yyVAL.node = scalar.NewEncapsed(yyDollar[2].list) @@ -7123,7 +7146,7 @@ yydefault: } case 411: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4513 + //line php7/php7.y:4536 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, yyDollar[2].list) @@ -7137,7 +7160,7 @@ yydefault: } case 412: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4525 + //line php7/php7.y:4548 { yyVAL.node = yyDollar[1].node @@ -7145,7 +7168,7 @@ yydefault: } case 413: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4531 + //line php7/php7.y:4554 { yyVAL.node = yyDollar[1].node @@ -7153,7 +7176,7 @@ yydefault: } case 414: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4540 + //line php7/php7.y:4563 { yyVAL.node = expr.NewConstFetch(yyDollar[1].node) @@ -7164,7 +7187,7 @@ yydefault: } case 415: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4549 + //line php7/php7.y:4572 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -7181,7 +7204,7 @@ yydefault: } case 416: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4564 + //line php7/php7.y:4587 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -7198,7 +7221,7 @@ yydefault: } case 417: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4582 + //line php7/php7.y:4605 { yyVAL.node = yyDollar[1].node @@ -7206,7 +7229,7 @@ yydefault: } case 418: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4588 + //line php7/php7.y:4611 { yyVAL.node = yyDollar[1].node @@ -7214,7 +7237,7 @@ yydefault: } case 419: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4597 + //line php7/php7.y:4620 { yyVAL.node = nil @@ -7222,7 +7245,7 @@ yydefault: } case 420: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4603 + //line php7/php7.y:4626 { yyVAL.node = yyDollar[1].node @@ -7230,7 +7253,7 @@ yydefault: } case 421: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4612 + //line php7/php7.y:4635 { yyVAL.node = yyDollar[1].node @@ -7238,7 +7261,7 @@ yydefault: } case 422: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4621 + //line php7/php7.y:4644 { yyVAL.node = yyDollar[1].node @@ -7246,7 +7269,7 @@ yydefault: } case 423: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4627 + //line php7/php7.y:4650 { yyVAL.node = yyDollar[2].node @@ -7260,7 +7283,7 @@ yydefault: } case 424: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4639 + //line php7/php7.y:4662 { yyVAL.node = yyDollar[1].node @@ -7268,7 +7291,7 @@ yydefault: } case 425: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4648 + //line php7/php7.y:4671 { yyVAL.node = yyDollar[1].node @@ -7276,7 +7299,7 @@ yydefault: } case 426: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4654 + //line php7/php7.y:4677 { yyVAL.node = yyDollar[2].node @@ -7290,7 +7313,7 @@ yydefault: } case 427: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4666 + //line php7/php7.y:4689 { yyVAL.node = yyDollar[1].node @@ -7298,7 +7321,7 @@ yydefault: } case 428: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4675 + //line php7/php7.y:4698 { yyVAL.node = yyDollar[1].node @@ -7306,7 +7329,7 @@ yydefault: } case 429: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4681 + //line php7/php7.y:4704 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -7323,7 +7346,7 @@ yydefault: } case 430: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4696 + //line php7/php7.y:4719 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -7340,7 +7363,7 @@ yydefault: } case 431: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4711 + //line php7/php7.y:4734 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -7357,7 +7380,7 @@ yydefault: } case 432: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4726 + //line php7/php7.y:4749 { yyVAL.node = expr.NewMethodCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -7371,7 +7394,7 @@ yydefault: } case 433: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4738 + //line php7/php7.y:4761 { yyVAL.node = yyDollar[1].node @@ -7379,7 +7402,7 @@ yydefault: } case 434: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4747 + //line php7/php7.y:4770 { yyVAL.node = yyDollar[1].node @@ -7387,7 +7410,7 @@ yydefault: } case 435: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4753 + //line php7/php7.y:4776 { yyVAL.node = yyDollar[1].node @@ -7395,7 +7418,7 @@ yydefault: } case 436: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4759 + //line php7/php7.y:4782 { yyVAL.node = expr.NewPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -7409,7 +7432,7 @@ yydefault: } case 437: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4774 + //line php7/php7.y:4797 { name := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(name) @@ -7426,7 +7449,7 @@ yydefault: } case 438: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4789 + //line php7/php7.y:4812 { yyVAL.node = expr.NewVariable(yyDollar[3].node) @@ -7445,7 +7468,7 @@ yydefault: } case 439: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4806 + //line php7/php7.y:4829 { yyVAL.node = expr.NewVariable(yyDollar[2].node) @@ -7460,7 +7483,7 @@ yydefault: } case 440: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4822 + //line php7/php7.y:4845 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -7474,7 +7497,7 @@ yydefault: } case 441: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4834 + //line php7/php7.y:4857 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -7488,7 +7511,7 @@ yydefault: } case 442: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4849 + //line php7/php7.y:4872 { yyVAL.node = yyDollar[1].node @@ -7496,7 +7519,7 @@ yydefault: } case 443: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4855 + //line php7/php7.y:4878 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -7513,7 +7536,7 @@ yydefault: } case 444: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4870 + //line php7/php7.y:4893 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -7530,7 +7553,7 @@ yydefault: } case 445: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4885 + //line php7/php7.y:4908 { yyVAL.node = expr.NewPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -7544,7 +7567,7 @@ yydefault: } case 446: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4897 + //line php7/php7.y:4920 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -7558,7 +7581,7 @@ yydefault: } case 447: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4909 + //line php7/php7.y:4932 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -7572,7 +7595,7 @@ yydefault: } case 448: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4924 + //line php7/php7.y:4947 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -7586,7 +7609,7 @@ yydefault: } case 449: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4936 + //line php7/php7.y:4959 { yyVAL.node = yyDollar[2].node @@ -7600,7 +7623,7 @@ yydefault: } case 450: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4948 + //line php7/php7.y:4971 { yyVAL.node = yyDollar[1].node @@ -7608,7 +7631,7 @@ yydefault: } case 451: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4957 + //line php7/php7.y:4980 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -7622,7 +7645,7 @@ yydefault: } case 452: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4969 + //line php7/php7.y:4992 { yyVAL.node = yyDollar[2].node @@ -7636,7 +7659,7 @@ yydefault: } case 453: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4981 + //line php7/php7.y:5004 { yyVAL.node = yyDollar[1].node @@ -7644,7 +7667,7 @@ yydefault: } case 454: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4990 + //line php7/php7.y:5013 { yyVAL.list = yyDollar[1].list @@ -7652,7 +7675,7 @@ yydefault: } case 455: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4999 + //line php7/php7.y:5022 { yyVAL.node = expr.NewArrayItem(nil, nil) @@ -7660,7 +7683,7 @@ yydefault: } case 456: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5005 + //line php7/php7.y:5028 { yyVAL.node = yyDollar[1].node @@ -7668,7 +7691,7 @@ yydefault: } case 457: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5014 + //line php7/php7.y:5037 { if len(yyDollar[1].list) == 0 { yyDollar[1].list = []node.Node{expr.NewArrayItem(nil, nil)} @@ -7683,7 +7706,7 @@ yydefault: } case 458: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5027 + //line php7/php7.y:5050 { if yyDollar[1].node.(*expr.ArrayItem).Key == nil && yyDollar[1].node.(*expr.ArrayItem).Val == nil { yyVAL.list = []node.Node{} @@ -7695,7 +7718,7 @@ yydefault: } case 459: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5040 + //line php7/php7.y:5063 { yyVAL.node = expr.NewArrayItem(yyDollar[1].node, yyDollar[3].node) @@ -7709,7 +7732,7 @@ yydefault: } case 460: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5052 + //line php7/php7.y:5075 { yyVAL.node = expr.NewArrayItem(nil, yyDollar[1].node) @@ -7720,7 +7743,7 @@ yydefault: } case 461: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:5061 + //line php7/php7.y:5084 { reference := expr.NewReference(yyDollar[4].node) yyVAL.node = expr.NewArrayItem(yyDollar[1].node, reference) @@ -7737,7 +7760,7 @@ yydefault: } case 462: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5076 + //line php7/php7.y:5099 { reference := expr.NewReference(yyDollar[2].node) yyVAL.node = expr.NewArrayItem(nil, reference) @@ -7753,7 +7776,7 @@ yydefault: } case 463: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:5090 + //line php7/php7.y:5113 { // TODO: Cannot use list() as standalone expression list := expr.NewList(yyDollar[5].list) @@ -7773,7 +7796,7 @@ yydefault: } case 464: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:5108 + //line php7/php7.y:5131 { // TODO: Cannot use list() as standalone expression list := expr.NewList(yyDollar[3].list) @@ -7792,7 +7815,7 @@ yydefault: } case 465: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5128 + //line php7/php7.y:5151 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -7800,7 +7823,7 @@ yydefault: } case 466: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5134 + //line php7/php7.y:5157 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yyVAL.list = append(yyDollar[1].list, encapsed) @@ -7815,7 +7838,7 @@ yydefault: } case 467: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5147 + //line php7/php7.y:5170 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -7823,7 +7846,7 @@ yydefault: } case 468: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5153 + //line php7/php7.y:5176 { encapsed := scalar.NewEncapsedStringPart(yyDollar[1].token.Value) yyVAL.list = []node.Node{encapsed, yyDollar[2].node} @@ -7838,7 +7861,7 @@ yydefault: } case 469: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5169 + //line php7/php7.y:5192 { name := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(name) @@ -7855,7 +7878,7 @@ yydefault: } case 470: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:5184 + //line php7/php7.y:5207 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -7878,7 +7901,7 @@ yydefault: } case 471: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5205 + //line php7/php7.y:5228 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -7901,7 +7924,7 @@ yydefault: } case 472: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5226 + //line php7/php7.y:5249 { variable := expr.NewVariable(yyDollar[2].node) @@ -7920,7 +7943,7 @@ yydefault: } case 473: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5243 + //line php7/php7.y:5266 { name := node.NewIdentifier(yyDollar[2].token.Value) variable := expr.NewVariable(name) @@ -7942,7 +7965,7 @@ yydefault: } case 474: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:5263 + //line php7/php7.y:5286 { identifier := node.NewIdentifier(yyDollar[2].token.Value) variable := expr.NewVariable(identifier) @@ -7967,7 +7990,7 @@ yydefault: } case 475: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5286 + //line php7/php7.y:5309 { yyVAL.node = yyDollar[2].node @@ -7981,7 +8004,7 @@ yydefault: } case 476: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5301 + //line php7/php7.y:5324 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) @@ -7995,7 +8018,7 @@ yydefault: } case 477: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5313 + //line php7/php7.y:5336 { // TODO: add option to handle 64 bit integer if _, err := strconv.Atoi(yyDollar[1].token.Value); err == nil { @@ -8011,7 +8034,7 @@ yydefault: } case 478: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5327 + //line php7/php7.y:5350 { var lnumber *scalar.Lnumber // TODO: add option to handle 64 bit integer @@ -8039,7 +8062,7 @@ yydefault: } case 479: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5353 + //line php7/php7.y:5376 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(identifier) @@ -8056,7 +8079,7 @@ yydefault: } case 480: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:5371 + //line php7/php7.y:5394 { yyVAL.node = expr.NewIsset(yyDollar[3].list) @@ -8076,7 +8099,7 @@ yydefault: } case 481: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:5389 + //line php7/php7.y:5412 { yyVAL.node = expr.NewEmpty(yyDollar[3].node) @@ -8092,7 +8115,7 @@ yydefault: } case 482: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5403 + //line php7/php7.y:5426 { yyVAL.node = expr.NewInclude(yyDollar[2].node) @@ -8106,7 +8129,7 @@ yydefault: } case 483: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5415 + //line php7/php7.y:5438 { yyVAL.node = expr.NewIncludeOnce(yyDollar[2].node) @@ -8120,7 +8143,7 @@ yydefault: } case 484: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:5427 + //line php7/php7.y:5450 { yyVAL.node = expr.NewEval(yyDollar[3].node) @@ -8136,7 +8159,7 @@ yydefault: } case 485: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5441 + //line php7/php7.y:5464 { yyVAL.node = expr.NewRequire(yyDollar[2].node) @@ -8150,7 +8173,7 @@ yydefault: } case 486: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5453 + //line php7/php7.y:5476 { yyVAL.node = expr.NewRequireOnce(yyDollar[2].node) @@ -8164,7 +8187,7 @@ yydefault: } case 487: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5468 + //line php7/php7.y:5491 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -8172,7 +8195,7 @@ yydefault: } case 488: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5474 + //line php7/php7.y:5497 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -8183,7 +8206,7 @@ yydefault: } case 489: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5486 + //line php7/php7.y:5509 { yyVAL.node = yyDollar[1].node diff --git a/php7/php7.y b/php7/php7.y index 62e396d..8ac9435 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -2352,6 +2352,9 @@ argument: // save position $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($1)) + // save comments + $1.GetMeta().Cut(inheritMetaFilter).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_ELLIPSIS expr @@ -2362,7 +2365,7 @@ argument: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.EllipsisToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2478,6 +2481,8 @@ class_statement: $3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken) + $1[0].GetMeta().Cut(inheritMetaFilter).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | method_modifiers T_CONST class_const_list ';' @@ -2492,6 +2497,8 @@ class_statement: $4.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $4, meta.SemiColonToken) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_USE name_list trait_adaptations @@ -2528,6 +2535,10 @@ class_statement: $6.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) $8.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) + if len($1) > 0 { + $1[0].GetMeta().Cut(inheritMetaFilter).PrependTo($$.GetMeta()) + } + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -2639,6 +2650,8 @@ trait_precedence: // save comments $2.Meta.SetTokenName(meta.InsteadofToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(inheritMetaFilter).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -2657,6 +2670,8 @@ trait_alias: $2.Meta.SetTokenName(meta.AsToken).AppendTo($$.GetMeta()) $3.Meta.SetTokenName(meta.NodeStart).AppendTo(alias.GetMeta()) + $1.GetMeta().Cut(inheritMetaFilter).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | trait_method_reference T_AS reserved_non_modifiers @@ -2672,6 +2687,8 @@ trait_alias: $2.Meta.SetTokenName(meta.AsToken).AppendTo($$.GetMeta()) $3.Meta.SetTokenName(meta.NodeStart).AppendTo(alias.GetMeta()) + $1.GetMeta().Cut(inheritMetaFilter).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | trait_method_reference T_AS member_modifier identifier @@ -2687,6 +2704,8 @@ trait_alias: $2.Meta.SetTokenName(meta.AsToken).AppendTo($$.GetMeta()) $4.Meta.SetTokenName(meta.NodeStart).AppendTo(alias.GetMeta()) + $1.GetMeta().Cut(inheritMetaFilter).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | trait_method_reference T_AS member_modifier @@ -2699,6 +2718,8 @@ trait_alias: // save comments $2.Meta.SetTokenName(meta.AsToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(inheritMetaFilter).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -2714,7 +2735,7 @@ trait_method_reference: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2740,6 +2761,8 @@ absolute_trait_method_reference: $2.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo($$.GetMeta()) $3.Meta.SetTokenName(meta.NodeStart).AppendTo(target.GetMeta()) + $1.GetMeta().Cut(inheritMetaFilter).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; diff --git a/visitor/dumper_test.go b/visitor/dumper_test.go index 214f1d9..8944b64 100644 --- a/visitor/dumper_test.go +++ b/visitor/dumper_test.go @@ -75,6 +75,7 @@ func ExampleDumper() { // | [*stmt.ClassMethod] // | "Position": Pos{Line: 5-9 Pos: 45-134} // | "Meta": + // | "\n\t\t\t\t" before "NodeStart" // | " " before "FunctionToken" // | "ReturnsRef": false // | "PhpDocComment": "" @@ -87,8 +88,6 @@ func ExampleDumper() { // | "Modifiers": // | [*node.Identifier] // | "Position": Pos{Line: 5-5 Pos: 45-50} - // | "Meta": - // | "\n\t\t\t\t" before "NodeStart" // | "Value": "public" // | "Params": // | [*node.Parameter] diff --git a/visitor/go_dumper_test.go b/visitor/go_dumper_test.go index 1765cee..a3c13c6 100644 --- a/visitor/go_dumper_test.go +++ b/visitor/go_dumper_test.go @@ -206,6 +206,17 @@ func ExampleGoDumper() { // &meta.Data{ // Type: meta.WhiteSpaceType, // Position: &position.Position{ + // StartLine: 4, + // EndLine: 5, + // StartPos: 40, + // EndPos: 44, + // }, + // Value: "\n\t\t\t\t", + // TokenName: meta.NodeStart, + // }, + // &meta.Data{ + // Type: meta.WhiteSpaceType, + // Position: &position.Position{ // StartLine: 5, // EndLine: 5, // StartPos: 51, @@ -247,19 +258,6 @@ func ExampleGoDumper() { // StartPos: 45, // EndPos: 50, // }, - // Meta: meta.Collection{ - // &meta.Data{ - // Type: meta.WhiteSpaceType, - // Position: &position.Position{ - // StartLine: 4, - // EndLine: 5, - // StartPos: 40, - // EndPos: 44, - // }, - // Value: "\n\t\t\t\t", - // TokenName: meta.NodeStart, - // }, - // }, // Value: "public", // }, // }, diff --git a/visitor/json_dumper_test.go b/visitor/json_dumper_test.go index 4b6328a..81af330 100644 --- a/visitor/json_dumper_test.go +++ b/visitor/json_dumper_test.go @@ -37,5 +37,5 @@ func ExampleJsonDumper() { nodes.Walk(dumper) // Output: - // {"type":"*node.Root","position":{"startPos":10,"endPos":166,"startLine":3,"endLine":12},"Stmts":[{"type":"*stmt.Namespace","position":{"startPos":10,"endPos":166,"startLine":3,"endLine":12},"meta":[{"type":"*meta.TokenType","value":" Date: Mon, 31 Dec 2018 17:06:27 +0200 Subject: [PATCH 102/117] #70: [php7] fix meta filter --- php7/parser.go | 20 ++++++++++++-------- php7/php7.go | 48 +++++++++++++++++++++++------------------------- php7/php7.y | 46 +++++++++++++++++++++++----------------------- 3 files changed, 58 insertions(+), 56 deletions(-) diff --git a/php7/parser.go b/php7/parser.go index c8cb795..fe46e28 100644 --- a/php7/parser.go +++ b/php7/parser.go @@ -13,14 +13,6 @@ import ( "github.com/z7zmey/php-parser/scanner" ) -var inheritMetaFilter = meta.AndFilter( - meta.TokenNameFilter(meta.NodeStart), - meta.OrFilter( - meta.TypeFilter(meta.CommentType, meta.WhiteSpaceType), - meta.ValueFilter(" 0 { - yyDollar[1].list[0].GetMeta().Cut(inheritMetaFilter).PrependTo(yyVAL.node.GetMeta()) + yyDollar[1].list[0].GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -5051,7 +5049,7 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.InsteadofToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[1].node.GetMeta().Cut(inheritMetaFilter).PrependTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5070,7 +5068,7 @@ yydefault: yyDollar[2].token.Meta.SetTokenName(meta.AsToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(alias.GetMeta()) - yyDollar[1].node.GetMeta().Cut(inheritMetaFilter).PrependTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5089,7 +5087,7 @@ yydefault: yyDollar[2].token.Meta.SetTokenName(meta.AsToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(alias.GetMeta()) - yyDollar[1].node.GetMeta().Cut(inheritMetaFilter).PrependTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5108,7 +5106,7 @@ yydefault: yyDollar[2].token.Meta.SetTokenName(meta.AsToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.NodeStart).AppendTo(alias.GetMeta()) - yyDollar[1].node.GetMeta().Cut(inheritMetaFilter).PrependTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5124,7 +5122,7 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.AsToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[1].node.GetMeta().Cut(inheritMetaFilter).PrependTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5167,7 +5165,7 @@ yydefault: yyDollar[2].token.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(target.GetMeta()) - yyDollar[1].node.GetMeta().Cut(inheritMetaFilter).PrependTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php7/php7.y b/php7/php7.y index 8ac9435..cbba504 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -396,7 +396,7 @@ name: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) // save comments - $1[0].GetMeta().Cut(inheritMetaFilter).PrependTo($$.GetMeta()) + $1[0].GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -647,7 +647,7 @@ group_use_declaration: } $6.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) - $1[0].GetMeta().Cut(inheritMetaFilter).PrependTo(name.GetMeta()) + $1[0].GetMeta().Cut(newInheritMetaFilter()).PrependTo(name.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -671,7 +671,7 @@ group_use_declaration: } $7.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) - $2[0].GetMeta().Cut(inheritMetaFilter).PrependTo(name.GetMeta()) + $2[0].GetMeta().Cut(newInheritMetaFilter()).PrependTo(name.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -696,7 +696,7 @@ mixed_group_use_declaration: } $6.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) - $1[0].GetMeta().Cut(inheritMetaFilter).PrependTo(name.GetMeta()) + $1[0].GetMeta().Cut(newInheritMetaFilter()).PrependTo(name.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -720,7 +720,7 @@ mixed_group_use_declaration: } $7.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) - $2[0].GetMeta().Cut(inheritMetaFilter).PrependTo(name.GetMeta()) + $2[0].GetMeta().Cut(newInheritMetaFilter()).PrependTo(name.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -796,7 +796,7 @@ inline_use_declaration: { $$ = $1 - $1.(*stmt.Use).Use.GetMeta().Cut(inheritMetaFilter).PrependTo($$.GetMeta()) + $1.(*stmt.Use).Use.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -804,7 +804,7 @@ inline_use_declaration: { $$ = $2.(*stmt.Use).SetUseType($1) - $1.GetMeta().Cut(inheritMetaFilter).PrependTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -820,7 +820,7 @@ unprefixed_use_declaration: name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) - $1[0].GetMeta().Cut(inheritMetaFilter).PrependTo(name.GetMeta()) + $1[0].GetMeta().Cut(newInheritMetaFilter()).PrependTo(name.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -839,7 +839,7 @@ unprefixed_use_declaration: $2.Meta.SetTokenName(meta.AsToken).AppendTo($$.GetMeta()) $3.Meta.SetTokenName(meta.NodeStart).AppendTo(alias.GetMeta()) - $1[0].GetMeta().Cut(inheritMetaFilter).PrependTo(name.GetMeta()) + $1[0].GetMeta().Cut(newInheritMetaFilter()).PrependTo(name.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -850,7 +850,7 @@ use_declaration: { $$ = $1 - $1.(*stmt.Use).Use.GetMeta().Cut(inheritMetaFilter).PrependTo($$.GetMeta()) + $1.(*stmt.Use).Use.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1178,7 +1178,7 @@ statement: $2.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $2, meta.SemiColonToken) - $1.GetMeta().Cut(inheritMetaFilter).PrependTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1508,7 +1508,7 @@ class_declaration_statement: $7.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) $9.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) - $1[0].GetMeta().Cut(inheritMetaFilter).PrependTo($$.GetMeta()) + $1[0].GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2148,7 +2148,7 @@ parameter: // save comments if $1 != nil { - $1.GetMeta().Cut(inheritMetaFilter).PrependTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) } if $2 != nil { $2.Meta.SetTokenName(meta.AmpersandToken).AppendTo($$.GetMeta()) @@ -2186,7 +2186,7 @@ parameter: // save comments if $1 != nil { - $1.GetMeta().Cut(inheritMetaFilter).PrependTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) } if $2 != nil { $2.Meta.SetTokenName(meta.AmpersandToken).AppendTo($$.GetMeta()) @@ -2353,7 +2353,7 @@ argument: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($1)) // save comments - $1.GetMeta().Cut(inheritMetaFilter).PrependTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2481,7 +2481,7 @@ class_statement: $3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken) - $1[0].GetMeta().Cut(inheritMetaFilter).PrependTo($$.GetMeta()) + $1[0].GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2536,7 +2536,7 @@ class_statement: $8.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) if len($1) > 0 { - $1[0].GetMeta().Cut(inheritMetaFilter).PrependTo($$.GetMeta()) + $1[0].GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -2650,7 +2650,7 @@ trait_precedence: // save comments $2.Meta.SetTokenName(meta.InsteadofToken).AppendTo($$.GetMeta()) - $1.GetMeta().Cut(inheritMetaFilter).PrependTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2670,7 +2670,7 @@ trait_alias: $2.Meta.SetTokenName(meta.AsToken).AppendTo($$.GetMeta()) $3.Meta.SetTokenName(meta.NodeStart).AppendTo(alias.GetMeta()) - $1.GetMeta().Cut(inheritMetaFilter).PrependTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2687,7 +2687,7 @@ trait_alias: $2.Meta.SetTokenName(meta.AsToken).AppendTo($$.GetMeta()) $3.Meta.SetTokenName(meta.NodeStart).AppendTo(alias.GetMeta()) - $1.GetMeta().Cut(inheritMetaFilter).PrependTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2704,7 +2704,7 @@ trait_alias: $2.Meta.SetTokenName(meta.AsToken).AppendTo($$.GetMeta()) $4.Meta.SetTokenName(meta.NodeStart).AppendTo(alias.GetMeta()) - $1.GetMeta().Cut(inheritMetaFilter).PrependTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2718,7 +2718,7 @@ trait_alias: // save comments $2.Meta.SetTokenName(meta.AsToken).AppendTo($$.GetMeta()) - $1.GetMeta().Cut(inheritMetaFilter).PrependTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2761,7 +2761,7 @@ absolute_trait_method_reference: $2.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo($$.GetMeta()) $3.Meta.SetTokenName(meta.NodeStart).AppendTo(target.GetMeta()) - $1.GetMeta().Cut(inheritMetaFilter).PrependTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } From a0dda154bfce9af97fe57f00a13b265aa56bf81c Mon Sep 17 00:00:00 2001 From: z7zmey Date: Mon, 31 Dec 2018 17:13:05 +0200 Subject: [PATCH 103/117] #70: [php7] inherit meta.Data at stmt.Property, stmt.Constant, stmt.Class, expr.PostDec, expr.PostInc, expr.Ternary and assign, binary nodes --- php7/php7.go | 500 ++++++++++++++++++++++++++++++--------------------- php7/php7.y | 114 ++++++++++-- 2 files changed, 399 insertions(+), 215 deletions(-) diff --git a/php7/php7.go b/php7/php7.go index 7303841..a9c5f79 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -346,7 +346,7 @@ const yyEofCode = 1 const yyErrCode = 2 const yyInitialStackSize = 16 -//line php7/php7.y:5518 +//line php7/php7.y:5610 //line yacctab:1 var yyExca = [...]int{ @@ -5371,7 +5371,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -5390,7 +5390,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yyDollar[2].token.Meta.SetTokenName(meta.EqualToken).AppendTo(yyVAL.node.GetMeta()) @@ -5427,7 +5427,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.EqualToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -5444,7 +5444,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.EqualToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -5525,7 +5525,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[8].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.ClassToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[6].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[8].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) @@ -5574,7 +5574,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[6].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(list.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(list.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(list.GetMeta()) yyDollar[5].token.Meta.SetTokenName(meta.EqualToken).AppendTo(yyVAL.node.GetMeta()) @@ -5593,7 +5593,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[5].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(shortList.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(shortList.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.EqualToken).AppendTo(yyVAL.node.GetMeta()) @@ -5611,11 +5611,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.EqualToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 298: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3194 + //line php7/php7.y:3196 { yyVAL.node = assign.NewReference(yyDollar[1].node, yyDollar[4].node) @@ -5626,11 +5628,13 @@ yydefault: yyDollar[2].token.Meta.SetTokenName(meta.EqualToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 299: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3207 + //line php7/php7.y:3211 { yyVAL.node = expr.NewClone(yyDollar[2].node) @@ -5644,7 +5648,7 @@ yydefault: } case 300: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3219 + //line php7/php7.y:3223 { yyVAL.node = assign.NewPlus(yyDollar[1].node, yyDollar[3].node) @@ -5654,11 +5658,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.PlusEqualToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 301: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3231 + //line php7/php7.y:3237 { yyVAL.node = assign.NewMinus(yyDollar[1].node, yyDollar[3].node) @@ -5668,11 +5674,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.MinusEqualToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 302: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3243 + //line php7/php7.y:3251 { yyVAL.node = assign.NewMul(yyDollar[1].node, yyDollar[3].node) @@ -5682,11 +5690,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.MulEqualToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 303: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3255 + //line php7/php7.y:3265 { yyVAL.node = assign.NewPow(yyDollar[1].node, yyDollar[3].node) @@ -5696,11 +5706,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.PowEqualToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 304: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3267 + //line php7/php7.y:3279 { yyVAL.node = assign.NewDiv(yyDollar[1].node, yyDollar[3].node) @@ -5710,11 +5722,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.DivEqualToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 305: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3279 + //line php7/php7.y:3293 { yyVAL.node = assign.NewConcat(yyDollar[1].node, yyDollar[3].node) @@ -5724,11 +5738,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.ConcatEqualToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 306: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3291 + //line php7/php7.y:3307 { yyVAL.node = assign.NewMod(yyDollar[1].node, yyDollar[3].node) @@ -5738,11 +5754,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.ModEqualToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 307: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3303 + //line php7/php7.y:3321 { yyVAL.node = assign.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) @@ -5752,11 +5770,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.AndEqualToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 308: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3315 + //line php7/php7.y:3335 { yyVAL.node = assign.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) @@ -5766,11 +5786,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.OrEqualToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 309: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3327 + //line php7/php7.y:3349 { yyVAL.node = assign.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) @@ -5780,11 +5802,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.XorEqualToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 310: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3339 + //line php7/php7.y:3363 { yyVAL.node = assign.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) @@ -5794,11 +5818,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.SlEqualToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 311: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3351 + //line php7/php7.y:3377 { yyVAL.node = assign.NewShiftRight(yyDollar[1].node, yyDollar[3].node) @@ -5808,11 +5834,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.SrEqualToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 312: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3363 + //line php7/php7.y:3391 { yyVAL.node = expr.NewPostInc(yyDollar[1].node) @@ -5822,11 +5850,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.IncToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 313: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3375 + //line php7/php7.y:3405 { yyVAL.node = expr.NewPreInc(yyDollar[2].node) @@ -5840,7 +5870,7 @@ yydefault: } case 314: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3387 + //line php7/php7.y:3417 { yyVAL.node = expr.NewPostDec(yyDollar[1].node) @@ -5850,11 +5880,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.DecToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 315: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3399 + //line php7/php7.y:3431 { yyVAL.node = expr.NewPreDec(yyDollar[2].node) @@ -5868,7 +5900,7 @@ yydefault: } case 316: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3411 + //line php7/php7.y:3443 { yyVAL.node = binary.NewBooleanOr(yyDollar[1].node, yyDollar[3].node) @@ -5878,11 +5910,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.BooleanOrToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 317: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3423 + //line php7/php7.y:3457 { yyVAL.node = binary.NewBooleanAnd(yyDollar[1].node, yyDollar[3].node) @@ -5892,11 +5926,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.BooleanAndToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 318: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3435 + //line php7/php7.y:3471 { yyVAL.node = binary.NewLogicalOr(yyDollar[1].node, yyDollar[3].node) @@ -5906,11 +5942,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.LogicalOrToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 319: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3447 + //line php7/php7.y:3485 { yyVAL.node = binary.NewLogicalAnd(yyDollar[1].node, yyDollar[3].node) @@ -5920,11 +5958,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.LogicalAndToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 320: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3459 + //line php7/php7.y:3499 { yyVAL.node = binary.NewLogicalXor(yyDollar[1].node, yyDollar[3].node) @@ -5934,11 +5974,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.LogicalXorToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 321: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3471 + //line php7/php7.y:3513 { yyVAL.node = binary.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) @@ -5948,11 +5990,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.VerticalBarToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 322: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3483 + //line php7/php7.y:3527 { yyVAL.node = binary.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) @@ -5962,11 +6006,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 323: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3495 + //line php7/php7.y:3541 { yyVAL.node = binary.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) @@ -5976,11 +6022,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.CaretToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 324: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3507 + //line php7/php7.y:3555 { yyVAL.node = binary.NewConcat(yyDollar[1].node, yyDollar[3].node) @@ -5990,11 +6038,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.DotToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 325: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3519 + //line php7/php7.y:3569 { yyVAL.node = binary.NewPlus(yyDollar[1].node, yyDollar[3].node) @@ -6004,11 +6054,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.PlusToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 326: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3531 + //line php7/php7.y:3583 { yyVAL.node = binary.NewMinus(yyDollar[1].node, yyDollar[3].node) @@ -6018,11 +6070,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.MinusToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 327: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3543 + //line php7/php7.y:3597 { yyVAL.node = binary.NewMul(yyDollar[1].node, yyDollar[3].node) @@ -6032,11 +6086,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.AsteriskToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 328: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3555 + //line php7/php7.y:3611 { yyVAL.node = binary.NewPow(yyDollar[1].node, yyDollar[3].node) @@ -6046,11 +6102,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.PowToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 329: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3567 + //line php7/php7.y:3625 { yyVAL.node = binary.NewDiv(yyDollar[1].node, yyDollar[3].node) @@ -6060,11 +6118,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.SlashToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 330: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3579 + //line php7/php7.y:3639 { yyVAL.node = binary.NewMod(yyDollar[1].node, yyDollar[3].node) @@ -6074,11 +6134,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.PercentToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 331: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3591 + //line php7/php7.y:3653 { yyVAL.node = binary.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) @@ -6088,11 +6150,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.SlToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 332: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3603 + //line php7/php7.y:3667 { yyVAL.node = binary.NewShiftRight(yyDollar[1].node, yyDollar[3].node) @@ -6102,11 +6166,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.SrToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 333: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3615 + //line php7/php7.y:3681 { yyVAL.node = expr.NewUnaryPlus(yyDollar[2].node) @@ -6120,7 +6186,7 @@ yydefault: } case 334: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3627 + //line php7/php7.y:3693 { yyVAL.node = expr.NewUnaryMinus(yyDollar[2].node) @@ -6134,7 +6200,7 @@ yydefault: } case 335: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3639 + //line php7/php7.y:3705 { yyVAL.node = expr.NewBooleanNot(yyDollar[2].node) @@ -6148,7 +6214,7 @@ yydefault: } case 336: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3651 + //line php7/php7.y:3717 { yyVAL.node = expr.NewBitwiseNot(yyDollar[2].node) @@ -6162,7 +6228,7 @@ yydefault: } case 337: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3663 + //line php7/php7.y:3729 { yyVAL.node = binary.NewIdentical(yyDollar[1].node, yyDollar[3].node) @@ -6172,11 +6238,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.IsIdenticalToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 338: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3675 + //line php7/php7.y:3743 { yyVAL.node = binary.NewNotIdentical(yyDollar[1].node, yyDollar[3].node) @@ -6186,11 +6254,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.IsNotIdenticalToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 339: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3687 + //line php7/php7.y:3757 { yyVAL.node = binary.NewEqual(yyDollar[1].node, yyDollar[3].node) @@ -6200,11 +6270,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.IsEqualToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 340: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3699 + //line php7/php7.y:3771 { yyVAL.node = binary.NewNotEqual(yyDollar[1].node, yyDollar[3].node) @@ -6215,11 +6287,13 @@ yydefault: yyDollar[2].token.Meta.SetTokenName(meta.IsNotEqualToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.IsNotEqualToken) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 341: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3712 + //line php7/php7.y:3786 { yyVAL.node = binary.NewSmaller(yyDollar[1].node, yyDollar[3].node) @@ -6229,11 +6303,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.LessToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 342: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3724 + //line php7/php7.y:3800 { yyVAL.node = binary.NewSmallerOrEqual(yyDollar[1].node, yyDollar[3].node) @@ -6243,11 +6319,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.IsSmallerOrEqualToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 343: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3736 + //line php7/php7.y:3814 { yyVAL.node = binary.NewGreater(yyDollar[1].node, yyDollar[3].node) @@ -6257,11 +6335,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.GreaterToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 344: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3748 + //line php7/php7.y:3828 { yyVAL.node = binary.NewGreaterOrEqual(yyDollar[1].node, yyDollar[3].node) @@ -6271,11 +6351,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.IsGreaterOrEqualToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 345: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3760 + //line php7/php7.y:3842 { yyVAL.node = binary.NewSpaceship(yyDollar[1].node, yyDollar[3].node) @@ -6285,11 +6367,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.SpaceshipToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 346: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3772 + //line php7/php7.y:3856 { yyVAL.node = expr.NewInstanceOf(yyDollar[1].node, yyDollar[3].node) @@ -6299,11 +6383,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.InstanceofToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 347: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3784 + //line php7/php7.y:3870 { yyVAL.node = yyDollar[2].node @@ -6317,7 +6403,7 @@ yydefault: } case 348: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3796 + //line php7/php7.y:3882 { yyVAL.node = yyDollar[1].node @@ -6325,7 +6411,7 @@ yydefault: } case 349: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:3802 + //line php7/php7.y:3888 { yyVAL.node = expr.NewTernary(yyDollar[1].node, yyDollar[3].node, yyDollar[5].node) @@ -6336,11 +6422,13 @@ yydefault: yyDollar[2].token.Meta.SetTokenName(meta.QuestionMarkToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.ColonToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 350: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3815 + //line php7/php7.y:3903 { yyVAL.node = expr.NewTernary(yyDollar[1].node, nil, yyDollar[4].node) @@ -6351,11 +6439,13 @@ yydefault: yyDollar[2].token.Meta.SetTokenName(meta.QuestionMarkToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.ColonToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 351: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3828 + //line php7/php7.y:3918 { yyVAL.node = binary.NewCoalesce(yyDollar[1].node, yyDollar[3].node) @@ -6365,11 +6455,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.CoalesceToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 352: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3840 + //line php7/php7.y:3932 { yyVAL.node = yyDollar[1].node @@ -6377,7 +6469,7 @@ yydefault: } case 353: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3846 + //line php7/php7.y:3938 { yyVAL.node = cast.NewInt(yyDollar[2].node) @@ -6392,7 +6484,7 @@ yydefault: } case 354: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3859 + //line php7/php7.y:3951 { yyVAL.node = cast.NewDouble(yyDollar[2].node) @@ -6407,7 +6499,7 @@ yydefault: } case 355: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3872 + //line php7/php7.y:3964 { yyVAL.node = cast.NewString(yyDollar[2].node) @@ -6422,7 +6514,7 @@ yydefault: } case 356: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3885 + //line php7/php7.y:3977 { yyVAL.node = cast.NewArray(yyDollar[2].node) @@ -6437,7 +6529,7 @@ yydefault: } case 357: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3898 + //line php7/php7.y:3990 { yyVAL.node = cast.NewObject(yyDollar[2].node) @@ -6452,7 +6544,7 @@ yydefault: } case 358: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3911 + //line php7/php7.y:4003 { yyVAL.node = cast.NewBool(yyDollar[2].node) @@ -6467,7 +6559,7 @@ yydefault: } case 359: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3924 + //line php7/php7.y:4016 { yyVAL.node = cast.NewUnset(yyDollar[2].node) @@ -6482,7 +6574,7 @@ yydefault: } case 360: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3937 + //line php7/php7.y:4029 { var e *expr.Exit if yyDollar[2].node != nil { @@ -6511,7 +6603,7 @@ yydefault: } case 361: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3964 + //line php7/php7.y:4056 { yyVAL.node = expr.NewErrorSuppress(yyDollar[2].node) @@ -6525,7 +6617,7 @@ yydefault: } case 362: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3976 + //line php7/php7.y:4068 { yyVAL.node = yyDollar[1].node @@ -6533,7 +6625,7 @@ yydefault: } case 363: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3982 + //line php7/php7.y:4074 { yyVAL.node = expr.NewShellExec(yyDollar[2].list) @@ -6547,7 +6639,7 @@ yydefault: } case 364: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3994 + //line php7/php7.y:4086 { yyVAL.node = expr.NewPrint(yyDollar[2].node) @@ -6561,7 +6653,7 @@ yydefault: } case 365: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4006 + //line php7/php7.y:4098 { yyVAL.node = expr.NewYield(nil, nil) @@ -6575,7 +6667,7 @@ yydefault: } case 366: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4018 + //line php7/php7.y:4110 { yyVAL.node = expr.NewYield(nil, yyDollar[2].node) @@ -6589,7 +6681,7 @@ yydefault: } case 367: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4030 + //line php7/php7.y:4122 { yyVAL.node = expr.NewYield(yyDollar[2].node, yyDollar[4].node) @@ -6604,7 +6696,7 @@ yydefault: } case 368: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4043 + //line php7/php7.y:4135 { yyVAL.node = expr.NewYieldFrom(yyDollar[2].node) @@ -6618,7 +6710,7 @@ yydefault: } case 369: yyDollar = yyS[yypt-11 : yypt+1] - //line php7/php7.y:4055 + //line php7/php7.y:4147 { yyVAL.node = expr.NewClosure(yyDollar[5].list, yyDollar[7].ClosureUse, yyDollar[8].node, yyDollar[10].list, false, yyDollar[2].token != nil, yyDollar[3].str) @@ -6639,7 +6731,7 @@ yydefault: } case 370: yyDollar = yyS[yypt-12 : yypt+1] - //line php7/php7.y:4074 + //line php7/php7.y:4166 { yyVAL.node = expr.NewClosure(yyDollar[6].list, yyDollar[8].ClosureUse, yyDollar[9].node, yyDollar[11].list, true, yyDollar[3].token != nil, yyDollar[4].str) @@ -6661,7 +6753,7 @@ yydefault: } case 371: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4097 + //line php7/php7.y:4189 { yyVAL.str = yylex.(*Parser).PhpDocComment yylex.(*Parser).PhpDocComment = "" @@ -6670,19 +6762,19 @@ yydefault: } case 372: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4107 + //line php7/php7.y:4199 { yyVAL.token = nil } case 373: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4111 + //line php7/php7.y:4203 { yyVAL.token = yyDollar[1].token } case 374: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4118 + //line php7/php7.y:4210 { yyVAL.ClosureUse = nil @@ -6690,7 +6782,7 @@ yydefault: } case 375: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4124 + //line php7/php7.y:4216 { yyVAL.ClosureUse = expr.NewClosureUse(yyDollar[3].list) @@ -6706,7 +6798,7 @@ yydefault: } case 376: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4141 + //line php7/php7.y:4233 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -6717,7 +6809,7 @@ yydefault: } case 377: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4150 + //line php7/php7.y:4242 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -6725,7 +6817,7 @@ yydefault: } case 378: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4159 + //line php7/php7.y:4251 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(identifier) @@ -6742,7 +6834,7 @@ yydefault: } case 379: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4174 + //line php7/php7.y:4266 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[2].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -6762,7 +6854,7 @@ yydefault: } case 380: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4195 + //line php7/php7.y:4287 { yyVAL.node = expr.NewFunctionCall(yyDollar[1].node, yyDollar[2].node.(*node.ArgumentList)) @@ -6773,7 +6865,7 @@ yydefault: } case 381: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4204 + //line php7/php7.y:4296 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -6787,7 +6879,7 @@ yydefault: } case 382: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4216 + //line php7/php7.y:4308 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -6801,7 +6893,7 @@ yydefault: } case 383: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4228 + //line php7/php7.y:4320 { yyVAL.node = expr.NewFunctionCall(yyDollar[1].node, yyDollar[2].node.(*node.ArgumentList)) @@ -6812,7 +6904,7 @@ yydefault: } case 384: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4240 + //line php7/php7.y:4332 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -6826,7 +6918,7 @@ yydefault: } case 385: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4252 + //line php7/php7.y:4344 { yyVAL.node = yyDollar[1].node @@ -6834,7 +6926,7 @@ yydefault: } case 386: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4261 + //line php7/php7.y:4353 { yyVAL.node = yyDollar[1].node @@ -6842,7 +6934,7 @@ yydefault: } case 387: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4267 + //line php7/php7.y:4359 { yyVAL.node = yyDollar[1].node @@ -6850,7 +6942,7 @@ yydefault: } case 388: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4276 + //line php7/php7.y:4368 { yyVAL.node = nil @@ -6858,7 +6950,7 @@ yydefault: } case 389: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4282 + //line php7/php7.y:4374 { yyVAL.node = expr.NewExit(yyDollar[2].node) @@ -6875,7 +6967,7 @@ yydefault: } case 390: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4300 + //line php7/php7.y:4392 { yyVAL.list = []node.Node{} @@ -6883,7 +6975,7 @@ yydefault: } case 391: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4306 + //line php7/php7.y:4398 { yyVAL.list = []node.Node{scalar.NewEncapsedStringPart(yyDollar[1].token.Value)} @@ -6891,7 +6983,7 @@ yydefault: } case 392: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4312 + //line php7/php7.y:4404 { yyVAL.list = yyDollar[1].list @@ -6899,7 +6991,7 @@ yydefault: } case 393: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4321 + //line php7/php7.y:4413 { yyVAL.node = nil @@ -6907,7 +6999,7 @@ yydefault: } case 394: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4327 + //line php7/php7.y:4419 { yyVAL.node = yyDollar[1].node @@ -6915,7 +7007,7 @@ yydefault: } case 395: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4336 + //line php7/php7.y:4428 { yyVAL.node = expr.NewArray(yyDollar[3].list) @@ -6931,7 +7023,7 @@ yydefault: } case 396: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4350 + //line php7/php7.y:4442 { yyVAL.node = expr.NewShortArray(yyDollar[2].list) @@ -6946,7 +7038,7 @@ yydefault: } case 397: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4363 + //line php7/php7.y:4455 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) @@ -6960,7 +7052,7 @@ yydefault: } case 398: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4378 + //line php7/php7.y:4470 { yyVAL.node = scalar.NewLnumber(yyDollar[1].token.Value) @@ -6974,7 +7066,7 @@ yydefault: } case 399: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4390 + //line php7/php7.y:4482 { yyVAL.node = scalar.NewDnumber(yyDollar[1].token.Value) @@ -6988,7 +7080,7 @@ yydefault: } case 400: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4402 + //line php7/php7.y:4494 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7002,7 +7094,7 @@ yydefault: } case 401: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4414 + //line php7/php7.y:4506 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7016,7 +7108,7 @@ yydefault: } case 402: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4426 + //line php7/php7.y:4518 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7030,7 +7122,7 @@ yydefault: } case 403: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4438 + //line php7/php7.y:4530 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7044,7 +7136,7 @@ yydefault: } case 404: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4450 + //line php7/php7.y:4542 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7058,7 +7150,7 @@ yydefault: } case 405: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4462 + //line php7/php7.y:4554 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7072,7 +7164,7 @@ yydefault: } case 406: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4474 + //line php7/php7.y:4566 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7086,7 +7178,7 @@ yydefault: } case 407: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4486 + //line php7/php7.y:4578 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7100,7 +7192,7 @@ yydefault: } case 408: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4498 + //line php7/php7.y:4590 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, []node.Node{encapsed}) @@ -7116,7 +7208,7 @@ yydefault: } case 409: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4512 + //line php7/php7.y:4604 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, nil) @@ -7130,7 +7222,7 @@ yydefault: } case 410: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4524 + //line php7/php7.y:4616 { yyVAL.node = scalar.NewEncapsed(yyDollar[2].list) @@ -7144,7 +7236,7 @@ yydefault: } case 411: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4536 + //line php7/php7.y:4628 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, yyDollar[2].list) @@ -7158,7 +7250,7 @@ yydefault: } case 412: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4548 + //line php7/php7.y:4640 { yyVAL.node = yyDollar[1].node @@ -7166,7 +7258,7 @@ yydefault: } case 413: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4554 + //line php7/php7.y:4646 { yyVAL.node = yyDollar[1].node @@ -7174,7 +7266,7 @@ yydefault: } case 414: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4563 + //line php7/php7.y:4655 { yyVAL.node = expr.NewConstFetch(yyDollar[1].node) @@ -7185,7 +7277,7 @@ yydefault: } case 415: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4572 + //line php7/php7.y:4664 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -7202,7 +7294,7 @@ yydefault: } case 416: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4587 + //line php7/php7.y:4679 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -7219,7 +7311,7 @@ yydefault: } case 417: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4605 + //line php7/php7.y:4697 { yyVAL.node = yyDollar[1].node @@ -7227,7 +7319,7 @@ yydefault: } case 418: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4611 + //line php7/php7.y:4703 { yyVAL.node = yyDollar[1].node @@ -7235,7 +7327,7 @@ yydefault: } case 419: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4620 + //line php7/php7.y:4712 { yyVAL.node = nil @@ -7243,7 +7335,7 @@ yydefault: } case 420: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4626 + //line php7/php7.y:4718 { yyVAL.node = yyDollar[1].node @@ -7251,7 +7343,7 @@ yydefault: } case 421: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4635 + //line php7/php7.y:4727 { yyVAL.node = yyDollar[1].node @@ -7259,7 +7351,7 @@ yydefault: } case 422: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4644 + //line php7/php7.y:4736 { yyVAL.node = yyDollar[1].node @@ -7267,7 +7359,7 @@ yydefault: } case 423: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4650 + //line php7/php7.y:4742 { yyVAL.node = yyDollar[2].node @@ -7281,7 +7373,7 @@ yydefault: } case 424: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4662 + //line php7/php7.y:4754 { yyVAL.node = yyDollar[1].node @@ -7289,7 +7381,7 @@ yydefault: } case 425: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4671 + //line php7/php7.y:4763 { yyVAL.node = yyDollar[1].node @@ -7297,7 +7389,7 @@ yydefault: } case 426: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4677 + //line php7/php7.y:4769 { yyVAL.node = yyDollar[2].node @@ -7311,7 +7403,7 @@ yydefault: } case 427: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4689 + //line php7/php7.y:4781 { yyVAL.node = yyDollar[1].node @@ -7319,7 +7411,7 @@ yydefault: } case 428: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4698 + //line php7/php7.y:4790 { yyVAL.node = yyDollar[1].node @@ -7327,7 +7419,7 @@ yydefault: } case 429: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4704 + //line php7/php7.y:4796 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -7344,7 +7436,7 @@ yydefault: } case 430: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4719 + //line php7/php7.y:4811 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -7361,7 +7453,7 @@ yydefault: } case 431: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4734 + //line php7/php7.y:4826 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -7378,7 +7470,7 @@ yydefault: } case 432: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4749 + //line php7/php7.y:4841 { yyVAL.node = expr.NewMethodCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -7392,7 +7484,7 @@ yydefault: } case 433: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4761 + //line php7/php7.y:4853 { yyVAL.node = yyDollar[1].node @@ -7400,7 +7492,7 @@ yydefault: } case 434: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4770 + //line php7/php7.y:4862 { yyVAL.node = yyDollar[1].node @@ -7408,7 +7500,7 @@ yydefault: } case 435: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4776 + //line php7/php7.y:4868 { yyVAL.node = yyDollar[1].node @@ -7416,7 +7508,7 @@ yydefault: } case 436: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4782 + //line php7/php7.y:4874 { yyVAL.node = expr.NewPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -7430,7 +7522,7 @@ yydefault: } case 437: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4797 + //line php7/php7.y:4889 { name := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(name) @@ -7447,7 +7539,7 @@ yydefault: } case 438: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4812 + //line php7/php7.y:4904 { yyVAL.node = expr.NewVariable(yyDollar[3].node) @@ -7466,7 +7558,7 @@ yydefault: } case 439: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4829 + //line php7/php7.y:4921 { yyVAL.node = expr.NewVariable(yyDollar[2].node) @@ -7481,7 +7573,7 @@ yydefault: } case 440: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4845 + //line php7/php7.y:4937 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -7495,7 +7587,7 @@ yydefault: } case 441: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4857 + //line php7/php7.y:4949 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -7509,7 +7601,7 @@ yydefault: } case 442: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4872 + //line php7/php7.y:4964 { yyVAL.node = yyDollar[1].node @@ -7517,7 +7609,7 @@ yydefault: } case 443: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4878 + //line php7/php7.y:4970 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -7534,7 +7626,7 @@ yydefault: } case 444: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4893 + //line php7/php7.y:4985 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -7551,7 +7643,7 @@ yydefault: } case 445: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4908 + //line php7/php7.y:5000 { yyVAL.node = expr.NewPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -7565,7 +7657,7 @@ yydefault: } case 446: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4920 + //line php7/php7.y:5012 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -7579,7 +7671,7 @@ yydefault: } case 447: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4932 + //line php7/php7.y:5024 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -7593,7 +7685,7 @@ yydefault: } case 448: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4947 + //line php7/php7.y:5039 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -7607,13 +7699,13 @@ yydefault: } case 449: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4959 + //line php7/php7.y:5051 { yyVAL.node = yyDollar[2].node // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) + yylex.(*Parser).prependMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).PrependTo(yyVAL.node.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.NodeEnd) @@ -7621,7 +7713,7 @@ yydefault: } case 450: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4971 + //line php7/php7.y:5063 { yyVAL.node = yyDollar[1].node @@ -7629,7 +7721,7 @@ yydefault: } case 451: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4980 + //line php7/php7.y:5072 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -7643,13 +7735,13 @@ yydefault: } case 452: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4992 + //line php7/php7.y:5084 { yyVAL.node = yyDollar[2].node // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) + yylex.(*Parser).prependMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).PrependTo(yyVAL.node.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.NodeEnd) @@ -7657,7 +7749,7 @@ yydefault: } case 453: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5004 + //line php7/php7.y:5096 { yyVAL.node = yyDollar[1].node @@ -7665,7 +7757,7 @@ yydefault: } case 454: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5013 + //line php7/php7.y:5105 { yyVAL.list = yyDollar[1].list @@ -7673,7 +7765,7 @@ yydefault: } case 455: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:5022 + //line php7/php7.y:5114 { yyVAL.node = expr.NewArrayItem(nil, nil) @@ -7681,7 +7773,7 @@ yydefault: } case 456: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5028 + //line php7/php7.y:5120 { yyVAL.node = yyDollar[1].node @@ -7689,7 +7781,7 @@ yydefault: } case 457: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5037 + //line php7/php7.y:5129 { if len(yyDollar[1].list) == 0 { yyDollar[1].list = []node.Node{expr.NewArrayItem(nil, nil)} @@ -7704,7 +7796,7 @@ yydefault: } case 458: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5050 + //line php7/php7.y:5142 { if yyDollar[1].node.(*expr.ArrayItem).Key == nil && yyDollar[1].node.(*expr.ArrayItem).Val == nil { yyVAL.list = []node.Node{} @@ -7716,7 +7808,7 @@ yydefault: } case 459: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5063 + //line php7/php7.y:5155 { yyVAL.node = expr.NewArrayItem(yyDollar[1].node, yyDollar[3].node) @@ -7730,7 +7822,7 @@ yydefault: } case 460: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5075 + //line php7/php7.y:5167 { yyVAL.node = expr.NewArrayItem(nil, yyDollar[1].node) @@ -7741,7 +7833,7 @@ yydefault: } case 461: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:5084 + //line php7/php7.y:5176 { reference := expr.NewReference(yyDollar[4].node) yyVAL.node = expr.NewArrayItem(yyDollar[1].node, reference) @@ -7758,7 +7850,7 @@ yydefault: } case 462: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5099 + //line php7/php7.y:5191 { reference := expr.NewReference(yyDollar[2].node) yyVAL.node = expr.NewArrayItem(nil, reference) @@ -7774,7 +7866,7 @@ yydefault: } case 463: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:5113 + //line php7/php7.y:5205 { // TODO: Cannot use list() as standalone expression list := expr.NewList(yyDollar[5].list) @@ -7794,7 +7886,7 @@ yydefault: } case 464: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:5131 + //line php7/php7.y:5223 { // TODO: Cannot use list() as standalone expression list := expr.NewList(yyDollar[3].list) @@ -7813,7 +7905,7 @@ yydefault: } case 465: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5151 + //line php7/php7.y:5243 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -7821,7 +7913,7 @@ yydefault: } case 466: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5157 + //line php7/php7.y:5249 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yyVAL.list = append(yyDollar[1].list, encapsed) @@ -7836,7 +7928,7 @@ yydefault: } case 467: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5170 + //line php7/php7.y:5262 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -7844,7 +7936,7 @@ yydefault: } case 468: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5176 + //line php7/php7.y:5268 { encapsed := scalar.NewEncapsedStringPart(yyDollar[1].token.Value) yyVAL.list = []node.Node{encapsed, yyDollar[2].node} @@ -7859,7 +7951,7 @@ yydefault: } case 469: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5192 + //line php7/php7.y:5284 { name := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(name) @@ -7876,7 +7968,7 @@ yydefault: } case 470: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:5207 + //line php7/php7.y:5299 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -7899,7 +7991,7 @@ yydefault: } case 471: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5228 + //line php7/php7.y:5320 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -7922,7 +8014,7 @@ yydefault: } case 472: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5249 + //line php7/php7.y:5341 { variable := expr.NewVariable(yyDollar[2].node) @@ -7941,7 +8033,7 @@ yydefault: } case 473: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5266 + //line php7/php7.y:5358 { name := node.NewIdentifier(yyDollar[2].token.Value) variable := expr.NewVariable(name) @@ -7963,7 +8055,7 @@ yydefault: } case 474: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:5286 + //line php7/php7.y:5378 { identifier := node.NewIdentifier(yyDollar[2].token.Value) variable := expr.NewVariable(identifier) @@ -7988,7 +8080,7 @@ yydefault: } case 475: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5309 + //line php7/php7.y:5401 { yyVAL.node = yyDollar[2].node @@ -8002,7 +8094,7 @@ yydefault: } case 476: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5324 + //line php7/php7.y:5416 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) @@ -8016,7 +8108,7 @@ yydefault: } case 477: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5336 + //line php7/php7.y:5428 { // TODO: add option to handle 64 bit integer if _, err := strconv.Atoi(yyDollar[1].token.Value); err == nil { @@ -8032,7 +8124,7 @@ yydefault: } case 478: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5350 + //line php7/php7.y:5442 { var lnumber *scalar.Lnumber // TODO: add option to handle 64 bit integer @@ -8060,7 +8152,7 @@ yydefault: } case 479: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5376 + //line php7/php7.y:5468 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(identifier) @@ -8077,7 +8169,7 @@ yydefault: } case 480: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:5394 + //line php7/php7.y:5486 { yyVAL.node = expr.NewIsset(yyDollar[3].list) @@ -8097,7 +8189,7 @@ yydefault: } case 481: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:5412 + //line php7/php7.y:5504 { yyVAL.node = expr.NewEmpty(yyDollar[3].node) @@ -8113,7 +8205,7 @@ yydefault: } case 482: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5426 + //line php7/php7.y:5518 { yyVAL.node = expr.NewInclude(yyDollar[2].node) @@ -8127,7 +8219,7 @@ yydefault: } case 483: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5438 + //line php7/php7.y:5530 { yyVAL.node = expr.NewIncludeOnce(yyDollar[2].node) @@ -8141,7 +8233,7 @@ yydefault: } case 484: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:5450 + //line php7/php7.y:5542 { yyVAL.node = expr.NewEval(yyDollar[3].node) @@ -8157,7 +8249,7 @@ yydefault: } case 485: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5464 + //line php7/php7.y:5556 { yyVAL.node = expr.NewRequire(yyDollar[2].node) @@ -8171,7 +8263,7 @@ yydefault: } case 486: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5476 + //line php7/php7.y:5568 { yyVAL.node = expr.NewRequireOnce(yyDollar[2].node) @@ -8185,7 +8277,7 @@ yydefault: } case 487: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5491 + //line php7/php7.y:5583 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -8193,7 +8285,7 @@ yydefault: } case 488: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5497 + //line php7/php7.y:5589 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -8204,7 +8296,7 @@ yydefault: } case 489: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5509 + //line php7/php7.y:5601 { yyVAL.node = yyDollar[1].node diff --git a/php7/php7.y b/php7/php7.y index cbba504..e78c9d6 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -2954,7 +2954,7 @@ property: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -2971,7 +2971,7 @@ property: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) $2.Meta.SetTokenName(meta.EqualToken).AppendTo($$.GetMeta()) @@ -3008,7 +3008,7 @@ class_const_decl: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $2.Meta.SetTokenName(meta.EqualToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -3026,7 +3026,7 @@ const_decl: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $2.Meta.SetTokenName(meta.EqualToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -3106,7 +3106,7 @@ anonymous_class: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $8)) // save comments - $1.Meta.SetTokenName(meta.ClassToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $6.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) $8.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) @@ -3155,7 +3155,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $6)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo(list.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(list.GetMeta()) $4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(list.GetMeta()) $5.Meta.SetTokenName(meta.EqualToken).AppendTo($$.GetMeta()) @@ -3172,7 +3172,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo(shortList.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $3.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(shortList.GetMeta()) $4.Meta.SetTokenName(meta.EqualToken).AppendTo($$.GetMeta()) @@ -3188,6 +3188,8 @@ expr_without_variable: // save comments $2.Meta.SetTokenName(meta.EqualToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | variable '=' '&' expr @@ -3201,6 +3203,8 @@ expr_without_variable: $2.Meta.SetTokenName(meta.EqualToken).AppendTo($$.GetMeta()) $3.Meta.SetTokenName(meta.AmpersandToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_CLONE expr @@ -3225,6 +3229,8 @@ expr_without_variable: // save comments $2.Meta.SetTokenName(meta.PlusEqualToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | variable T_MINUS_EQUAL expr @@ -3237,6 +3243,8 @@ expr_without_variable: // save comments $2.Meta.SetTokenName(meta.MinusEqualToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | variable T_MUL_EQUAL expr @@ -3249,6 +3257,8 @@ expr_without_variable: // save comments $2.Meta.SetTokenName(meta.MulEqualToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | variable T_POW_EQUAL expr @@ -3261,6 +3271,8 @@ expr_without_variable: // save comments $2.Meta.SetTokenName(meta.PowEqualToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | variable T_DIV_EQUAL expr @@ -3273,6 +3285,8 @@ expr_without_variable: // save comments $2.Meta.SetTokenName(meta.DivEqualToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | variable T_CONCAT_EQUAL expr @@ -3285,6 +3299,8 @@ expr_without_variable: // save comments $2.Meta.SetTokenName(meta.ConcatEqualToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | variable T_MOD_EQUAL expr @@ -3297,6 +3313,8 @@ expr_without_variable: // save comments $2.Meta.SetTokenName(meta.ModEqualToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | variable T_AND_EQUAL expr @@ -3309,6 +3327,8 @@ expr_without_variable: // save comments $2.Meta.SetTokenName(meta.AndEqualToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | variable T_OR_EQUAL expr @@ -3321,6 +3341,8 @@ expr_without_variable: // save comments $2.Meta.SetTokenName(meta.OrEqualToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | variable T_XOR_EQUAL expr @@ -3333,6 +3355,8 @@ expr_without_variable: // save comments $2.Meta.SetTokenName(meta.XorEqualToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | variable T_SL_EQUAL expr @@ -3345,6 +3369,8 @@ expr_without_variable: // save comments $2.Meta.SetTokenName(meta.SlEqualToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | variable T_SR_EQUAL expr @@ -3357,6 +3383,8 @@ expr_without_variable: // save comments $2.Meta.SetTokenName(meta.SrEqualToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | variable T_INC @@ -3369,6 +3397,8 @@ expr_without_variable: // save comments $2.Meta.SetTokenName(meta.IncToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_INC variable @@ -3393,6 +3423,8 @@ expr_without_variable: // save comments $2.Meta.SetTokenName(meta.DecToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_DEC variable @@ -3417,6 +3449,8 @@ expr_without_variable: // save comments $2.Meta.SetTokenName(meta.BooleanOrToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr T_BOOLEAN_AND expr @@ -3429,6 +3463,8 @@ expr_without_variable: // save comments $2.Meta.SetTokenName(meta.BooleanAndToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr T_LOGICAL_OR expr @@ -3441,6 +3477,8 @@ expr_without_variable: // save comments $2.Meta.SetTokenName(meta.LogicalOrToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr T_LOGICAL_AND expr @@ -3453,6 +3491,8 @@ expr_without_variable: // save comments $2.Meta.SetTokenName(meta.LogicalAndToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr T_LOGICAL_XOR expr @@ -3465,6 +3505,8 @@ expr_without_variable: // save comments $2.Meta.SetTokenName(meta.LogicalXorToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr '|' expr @@ -3477,6 +3519,8 @@ expr_without_variable: // save comments $2.Meta.SetTokenName(meta.VerticalBarToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr '&' expr @@ -3489,6 +3533,8 @@ expr_without_variable: // save comments $2.Meta.SetTokenName(meta.AmpersandToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr '^' expr @@ -3501,6 +3547,8 @@ expr_without_variable: // save comments $2.Meta.SetTokenName(meta.CaretToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr '.' expr @@ -3513,6 +3561,8 @@ expr_without_variable: // save comments $2.Meta.SetTokenName(meta.DotToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr '+' expr @@ -3525,6 +3575,8 @@ expr_without_variable: // save comments $2.Meta.SetTokenName(meta.PlusToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr '-' expr @@ -3537,6 +3589,8 @@ expr_without_variable: // save comments $2.Meta.SetTokenName(meta.MinusToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr '*' expr @@ -3549,6 +3603,8 @@ expr_without_variable: // save comments $2.Meta.SetTokenName(meta.AsteriskToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr T_POW expr @@ -3561,6 +3617,8 @@ expr_without_variable: // save comments $2.Meta.SetTokenName(meta.PowToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr '/' expr @@ -3573,6 +3631,8 @@ expr_without_variable: // save comments $2.Meta.SetTokenName(meta.SlashToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr '%' expr @@ -3585,6 +3645,8 @@ expr_without_variable: // save comments $2.Meta.SetTokenName(meta.PercentToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr T_SL expr @@ -3597,6 +3659,8 @@ expr_without_variable: // save comments $2.Meta.SetTokenName(meta.SlToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr T_SR expr @@ -3609,6 +3673,8 @@ expr_without_variable: // save comments $2.Meta.SetTokenName(meta.SrToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | '+' expr %prec T_INC @@ -3669,6 +3735,8 @@ expr_without_variable: // save comments $2.Meta.SetTokenName(meta.IsIdenticalToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr T_IS_NOT_IDENTICAL expr @@ -3681,6 +3749,8 @@ expr_without_variable: // save comments $2.Meta.SetTokenName(meta.IsNotIdenticalToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr T_IS_EQUAL expr @@ -3693,6 +3763,8 @@ expr_without_variable: // save comments $2.Meta.SetTokenName(meta.IsEqualToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr T_IS_NOT_EQUAL expr @@ -3706,6 +3778,8 @@ expr_without_variable: $2.Meta.SetTokenName(meta.IsNotEqualToken).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $2, meta.IsNotEqualToken) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr '<' expr @@ -3718,6 +3792,8 @@ expr_without_variable: // save comments $2.Meta.SetTokenName(meta.LessToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr T_IS_SMALLER_OR_EQUAL expr @@ -3730,6 +3806,8 @@ expr_without_variable: // save comments $2.Meta.SetTokenName(meta.IsSmallerOrEqualToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr '>' expr @@ -3742,6 +3820,8 @@ expr_without_variable: // save comments $2.Meta.SetTokenName(meta.GreaterToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr T_IS_GREATER_OR_EQUAL expr @@ -3754,6 +3834,8 @@ expr_without_variable: // save comments $2.Meta.SetTokenName(meta.IsGreaterOrEqualToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr T_SPACESHIP expr @@ -3766,6 +3848,8 @@ expr_without_variable: // save comments $2.Meta.SetTokenName(meta.SpaceshipToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr T_INSTANCEOF class_name_reference @@ -3778,6 +3862,8 @@ expr_without_variable: // save comments $2.Meta.SetTokenName(meta.InstanceofToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | '(' expr ')' @@ -3809,6 +3895,8 @@ expr_without_variable: $2.Meta.SetTokenName(meta.QuestionMarkToken).AppendTo($$.GetMeta()) $4.Meta.SetTokenName(meta.ColonToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr '?' ':' expr @@ -3822,6 +3910,8 @@ expr_without_variable: $2.Meta.SetTokenName(meta.QuestionMarkToken).AppendTo($$.GetMeta()) $3.Meta.SetTokenName(meta.ColonToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr T_COALESCE expr @@ -3834,6 +3924,8 @@ expr_without_variable: // save comments $2.Meta.SetTokenName(meta.CoalesceToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | internal_functions_in_yacc @@ -4960,8 +5052,8 @@ member_name: $$ = $2; // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) + yylex.(*Parser).prependMetaToken($$, $1, meta.NodeStart) + $1.Meta.SetTokenName(meta.NodeStart).PrependTo($$.GetMeta()) $3.Meta.SetTokenName(meta.NodeEnd).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $3, meta.NodeEnd) @@ -4993,8 +5085,8 @@ property_name: $$ = $2; // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) + yylex.(*Parser).prependMetaToken($$, $1, meta.NodeStart) + $1.Meta.SetTokenName(meta.NodeStart).PrependTo($$.GetMeta()) $3.Meta.SetTokenName(meta.NodeEnd).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $3, meta.NodeEnd) From 4abd14d2a6bc158cbe591e261005b1f808dd745f Mon Sep 17 00:00:00 2001 From: z7zmey Date: Mon, 31 Dec 2018 18:27:46 +0200 Subject: [PATCH 104/117] #70: [php7] inherit meta.Data at expr.FunctionCall, expr.StaticCall, expr.ConstFetch, expr.ArrayDimFetch, expr.MethodCall, expr.PropertyFetch, expr.StaticPropertyFetch, expr.ArrayItem --- php7/php7.go | 332 ++++++++++++++++------------- php7/php7.y | 86 ++++++-- visitor/dumper_test.go | 4 +- visitor/go_dumper_test.go | 26 +-- visitor/json_dumper_test.go | 2 +- visitor/pretty_json_dumper_test.go | 14 +- 6 files changed, 274 insertions(+), 190 deletions(-) diff --git a/php7/php7.go b/php7/php7.go index a9c5f79..5c73743 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -346,7 +346,7 @@ const yyEofCode = 1 const yyErrCode = 2 const yyInitialStackSize = 16 -//line php7/php7.y:5610 +//line php7/php7.y:5652 //line yacctab:1 var yyExca = [...]int{ @@ -6861,11 +6861,14 @@ yydefault: // save position yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[2].node)) + // save comments + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 381: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4296 + //line php7/php7.y:4299 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -6874,12 +6877,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 382: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4308 + //line php7/php7.y:4312 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -6888,23 +6892,25 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 383: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4320 + //line php7/php7.y:4325 { yyVAL.node = expr.NewFunctionCall(yyDollar[1].node, yyDollar[2].node.(*node.ArgumentList)) // save position yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[2].node)) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 384: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4332 + //line php7/php7.y:4338 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -6918,7 +6924,7 @@ yydefault: } case 385: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4344 + //line php7/php7.y:4350 { yyVAL.node = yyDollar[1].node @@ -6926,7 +6932,7 @@ yydefault: } case 386: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4353 + //line php7/php7.y:4359 { yyVAL.node = yyDollar[1].node @@ -6934,7 +6940,7 @@ yydefault: } case 387: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4359 + //line php7/php7.y:4365 { yyVAL.node = yyDollar[1].node @@ -6942,7 +6948,7 @@ yydefault: } case 388: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4368 + //line php7/php7.y:4374 { yyVAL.node = nil @@ -6950,7 +6956,7 @@ yydefault: } case 389: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4374 + //line php7/php7.y:4380 { yyVAL.node = expr.NewExit(yyDollar[2].node) @@ -6958,8 +6964,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.OpenParenthesisToken) + yylex.(*Parser).prependMetaToken(yyVAL.node, yyDollar[1].token, meta.OpenParenthesisToken) + yyDollar[1].token.Meta.SetTokenName(meta.OpenParenthesisToken).PrependTo(yyVAL.node.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.CloseParenthesisToken) @@ -6967,7 +6973,7 @@ yydefault: } case 390: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4392 + //line php7/php7.y:4398 { yyVAL.list = []node.Node{} @@ -6975,7 +6981,7 @@ yydefault: } case 391: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4398 + //line php7/php7.y:4404 { yyVAL.list = []node.Node{scalar.NewEncapsedStringPart(yyDollar[1].token.Value)} @@ -6983,7 +6989,7 @@ yydefault: } case 392: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4404 + //line php7/php7.y:4410 { yyVAL.list = yyDollar[1].list @@ -6991,7 +6997,7 @@ yydefault: } case 393: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4413 + //line php7/php7.y:4419 { yyVAL.node = nil @@ -6999,7 +7005,7 @@ yydefault: } case 394: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4419 + //line php7/php7.y:4425 { yyVAL.node = yyDollar[1].node @@ -7007,7 +7013,7 @@ yydefault: } case 395: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4428 + //line php7/php7.y:4434 { yyVAL.node = expr.NewArray(yyDollar[3].list) @@ -7023,7 +7029,7 @@ yydefault: } case 396: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4442 + //line php7/php7.y:4448 { yyVAL.node = expr.NewShortArray(yyDollar[2].list) @@ -7038,7 +7044,7 @@ yydefault: } case 397: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4455 + //line php7/php7.y:4461 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) @@ -7052,7 +7058,7 @@ yydefault: } case 398: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4470 + //line php7/php7.y:4476 { yyVAL.node = scalar.NewLnumber(yyDollar[1].token.Value) @@ -7066,7 +7072,7 @@ yydefault: } case 399: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4482 + //line php7/php7.y:4488 { yyVAL.node = scalar.NewDnumber(yyDollar[1].token.Value) @@ -7080,7 +7086,7 @@ yydefault: } case 400: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4494 + //line php7/php7.y:4500 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7094,7 +7100,7 @@ yydefault: } case 401: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4506 + //line php7/php7.y:4512 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7108,7 +7114,7 @@ yydefault: } case 402: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4518 + //line php7/php7.y:4524 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7122,7 +7128,7 @@ yydefault: } case 403: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4530 + //line php7/php7.y:4536 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7136,7 +7142,7 @@ yydefault: } case 404: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4542 + //line php7/php7.y:4548 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7150,7 +7156,7 @@ yydefault: } case 405: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4554 + //line php7/php7.y:4560 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7164,7 +7170,7 @@ yydefault: } case 406: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4566 + //line php7/php7.y:4572 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7178,7 +7184,7 @@ yydefault: } case 407: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4578 + //line php7/php7.y:4584 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7192,7 +7198,7 @@ yydefault: } case 408: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4590 + //line php7/php7.y:4596 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, []node.Node{encapsed}) @@ -7208,7 +7214,7 @@ yydefault: } case 409: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4604 + //line php7/php7.y:4610 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, nil) @@ -7222,7 +7228,7 @@ yydefault: } case 410: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4616 + //line php7/php7.y:4622 { yyVAL.node = scalar.NewEncapsed(yyDollar[2].list) @@ -7236,7 +7242,7 @@ yydefault: } case 411: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4628 + //line php7/php7.y:4634 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, yyDollar[2].list) @@ -7250,7 +7256,7 @@ yydefault: } case 412: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4640 + //line php7/php7.y:4646 { yyVAL.node = yyDollar[1].node @@ -7258,7 +7264,7 @@ yydefault: } case 413: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4646 + //line php7/php7.y:4652 { yyVAL.node = yyDollar[1].node @@ -7266,18 +7272,21 @@ yydefault: } case 414: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4655 + //line php7/php7.y:4661 { yyVAL.node = expr.NewConstFetch(yyDollar[1].node) // save position yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) + // save comments + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 415: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4664 + //line php7/php7.y:4673 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -7290,11 +7299,13 @@ yydefault: yyDollar[2].token.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(target.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 416: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4679 + //line php7/php7.y:4690 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -7307,11 +7318,13 @@ yydefault: yyDollar[2].token.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(target.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 417: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4697 + //line php7/php7.y:4710 { yyVAL.node = yyDollar[1].node @@ -7319,7 +7332,7 @@ yydefault: } case 418: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4703 + //line php7/php7.y:4716 { yyVAL.node = yyDollar[1].node @@ -7327,7 +7340,7 @@ yydefault: } case 419: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4712 + //line php7/php7.y:4725 { yyVAL.node = nil @@ -7335,7 +7348,7 @@ yydefault: } case 420: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4718 + //line php7/php7.y:4731 { yyVAL.node = yyDollar[1].node @@ -7343,7 +7356,7 @@ yydefault: } case 421: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4727 + //line php7/php7.y:4740 { yyVAL.node = yyDollar[1].node @@ -7351,7 +7364,7 @@ yydefault: } case 422: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4736 + //line php7/php7.y:4749 { yyVAL.node = yyDollar[1].node @@ -7359,7 +7372,7 @@ yydefault: } case 423: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4742 + //line php7/php7.y:4755 { yyVAL.node = yyDollar[2].node @@ -7373,7 +7386,7 @@ yydefault: } case 424: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4754 + //line php7/php7.y:4767 { yyVAL.node = yyDollar[1].node @@ -7381,7 +7394,7 @@ yydefault: } case 425: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4763 + //line php7/php7.y:4776 { yyVAL.node = yyDollar[1].node @@ -7389,13 +7402,13 @@ yydefault: } case 426: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4769 + //line php7/php7.y:4782 { yyVAL.node = yyDollar[2].node // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) + yylex.(*Parser).prependMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).PrependTo(yyVAL.node.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.NodeEnd) @@ -7403,7 +7416,7 @@ yydefault: } case 427: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4781 + //line php7/php7.y:4794 { yyVAL.node = yyDollar[1].node @@ -7411,7 +7424,7 @@ yydefault: } case 428: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4790 + //line php7/php7.y:4803 { yyVAL.node = yyDollar[1].node @@ -7419,7 +7432,7 @@ yydefault: } case 429: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4796 + //line php7/php7.y:4809 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -7427,31 +7440,16 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.OpenSquareBracket) + yylex.(*Parser).prependMetaToken(yyVAL.node, yyDollar[2].token, meta.OpenSquareBracket) + yyDollar[2].token.Meta.SetTokenName(meta.OpenSquareBracket).PrependTo(yyVAL.node.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.CloseSquareBracket) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 430: - yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4811 - { - yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) - - // save position - yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) - - // save comments - yyDollar[2].token.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.OpenSquareBracket) - yyDollar[4].token.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.CloseSquareBracket) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - case 431: yyDollar = yyS[yypt-4 : yypt+1] //line php7/php7.y:4826 { @@ -7461,16 +7459,37 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.OpenCurlyBracesToken) + yylex.(*Parser).prependMetaToken(yyVAL.node, yyDollar[2].token, meta.OpenSquareBracket) + yyDollar[2].token.Meta.SetTokenName(meta.OpenSquareBracket).PrependTo(yyVAL.node.GetMeta()) + yyDollar[4].token.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.CloseSquareBracket) + + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + case 431: + yyDollar = yyS[yypt-4 : yypt+1] + //line php7/php7.y:4843 + { + yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) + + // save position + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) + + // save comments + yylex.(*Parser).prependMetaToken(yyVAL.node, yyDollar[2].token, meta.OpenCurlyBracesToken) + yyDollar[2].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).PrependTo(yyVAL.node.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.CloseCurlyBracesToken) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 432: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4841 + //line php7/php7.y:4860 { yyVAL.node = expr.NewMethodCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -7480,11 +7499,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.ObjectOperatorToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 433: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4853 + //line php7/php7.y:4874 { yyVAL.node = yyDollar[1].node @@ -7492,7 +7513,7 @@ yydefault: } case 434: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4862 + //line php7/php7.y:4883 { yyVAL.node = yyDollar[1].node @@ -7500,7 +7521,7 @@ yydefault: } case 435: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4868 + //line php7/php7.y:4889 { yyVAL.node = yyDollar[1].node @@ -7508,7 +7529,7 @@ yydefault: } case 436: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4874 + //line php7/php7.y:4895 { yyVAL.node = expr.NewPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -7518,11 +7539,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.ObjectOperatorToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 437: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4889 + //line php7/php7.y:4912 { name := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(name) @@ -7539,7 +7562,7 @@ yydefault: } case 438: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4904 + //line php7/php7.y:4927 { yyVAL.node = expr.NewVariable(yyDollar[3].node) @@ -7558,7 +7581,7 @@ yydefault: } case 439: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4921 + //line php7/php7.y:4944 { yyVAL.node = expr.NewVariable(yyDollar[2].node) @@ -7573,7 +7596,7 @@ yydefault: } case 440: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4937 + //line php7/php7.y:4960 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -7583,11 +7606,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 441: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4949 + //line php7/php7.y:4974 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -7597,11 +7622,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 442: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4964 + //line php7/php7.y:4991 { yyVAL.node = yyDollar[1].node @@ -7609,7 +7636,7 @@ yydefault: } case 443: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4970 + //line php7/php7.y:4997 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -7617,16 +7644,18 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.OpenSquareBracket) + yylex.(*Parser).prependMetaToken(yyVAL.node, yyDollar[2].token, meta.OpenSquareBracket) + yyDollar[2].token.Meta.SetTokenName(meta.OpenSquareBracket).PrependTo(yyVAL.node.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.CloseSquareBracket) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 444: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4985 + //line php7/php7.y:5014 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -7634,16 +7663,18 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.OpenCurlyBracesToken) + yylex.(*Parser).prependMetaToken(yyVAL.node, yyDollar[2].token, meta.OpenCurlyBracesToken) + yyDollar[2].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).PrependTo(yyVAL.node.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.CloseCurlyBracesToken) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 445: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5000 + //line php7/php7.y:5031 { yyVAL.node = expr.NewPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -7653,11 +7684,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.ObjectOperatorToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 446: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5012 + //line php7/php7.y:5045 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -7667,11 +7700,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 447: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5024 + //line php7/php7.y:5059 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -7681,11 +7716,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 448: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5039 + //line php7/php7.y:5076 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -7699,7 +7736,7 @@ yydefault: } case 449: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5051 + //line php7/php7.y:5088 { yyVAL.node = yyDollar[2].node @@ -7713,7 +7750,7 @@ yydefault: } case 450: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5063 + //line php7/php7.y:5100 { yyVAL.node = yyDollar[1].node @@ -7721,7 +7758,7 @@ yydefault: } case 451: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5072 + //line php7/php7.y:5109 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -7735,7 +7772,7 @@ yydefault: } case 452: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5084 + //line php7/php7.y:5121 { yyVAL.node = yyDollar[2].node @@ -7749,7 +7786,7 @@ yydefault: } case 453: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5096 + //line php7/php7.y:5133 { yyVAL.node = yyDollar[1].node @@ -7757,7 +7794,7 @@ yydefault: } case 454: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5105 + //line php7/php7.y:5142 { yyVAL.list = yyDollar[1].list @@ -7765,7 +7802,7 @@ yydefault: } case 455: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:5114 + //line php7/php7.y:5151 { yyVAL.node = expr.NewArrayItem(nil, nil) @@ -7773,7 +7810,7 @@ yydefault: } case 456: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5120 + //line php7/php7.y:5157 { yyVAL.node = yyDollar[1].node @@ -7781,7 +7818,7 @@ yydefault: } case 457: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5129 + //line php7/php7.y:5166 { if len(yyDollar[1].list) == 0 { yyDollar[1].list = []node.Node{expr.NewArrayItem(nil, nil)} @@ -7796,7 +7833,7 @@ yydefault: } case 458: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5142 + //line php7/php7.y:5179 { if yyDollar[1].node.(*expr.ArrayItem).Key == nil && yyDollar[1].node.(*expr.ArrayItem).Val == nil { yyVAL.list = []node.Node{} @@ -7808,7 +7845,7 @@ yydefault: } case 459: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5155 + //line php7/php7.y:5192 { yyVAL.node = expr.NewArrayItem(yyDollar[1].node, yyDollar[3].node) @@ -7818,22 +7855,26 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 460: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5167 + //line php7/php7.y:5206 { yyVAL.node = expr.NewArrayItem(nil, yyDollar[1].node) // save position yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 461: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:5176 + //line php7/php7.y:5217 { reference := expr.NewReference(yyDollar[4].node) yyVAL.node = expr.NewArrayItem(yyDollar[1].node, reference) @@ -7846,11 +7887,13 @@ yydefault: yyDollar[2].token.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(reference.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 462: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5191 + //line php7/php7.y:5234 { reference := expr.NewReference(yyDollar[2].node) yyVAL.node = expr.NewArrayItem(nil, reference) @@ -7860,13 +7903,13 @@ yydefault: reference.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(reference.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 463: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:5205 + //line php7/php7.y:5248 { // TODO: Cannot use list() as standalone expression list := expr.NewList(yyDollar[5].list) @@ -7882,11 +7925,13 @@ yydefault: yyDollar[4].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(list.GetMeta()) yyDollar[6].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(list.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 464: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:5223 + //line php7/php7.y:5268 { // TODO: Cannot use list() as standalone expression list := expr.NewList(yyDollar[3].list) @@ -7897,7 +7942,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(list.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(list.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(list.GetMeta()) @@ -7905,7 +7950,7 @@ yydefault: } case 465: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5243 + //line php7/php7.y:5288 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -7913,7 +7958,7 @@ yydefault: } case 466: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5249 + //line php7/php7.y:5294 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yyVAL.list = append(yyDollar[1].list, encapsed) @@ -7928,7 +7973,7 @@ yydefault: } case 467: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5262 + //line php7/php7.y:5307 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -7936,7 +7981,7 @@ yydefault: } case 468: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5268 + //line php7/php7.y:5313 { encapsed := scalar.NewEncapsedStringPart(yyDollar[1].token.Value) yyVAL.list = []node.Node{encapsed, yyDollar[2].node} @@ -7951,7 +7996,7 @@ yydefault: } case 469: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5284 + //line php7/php7.y:5329 { name := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(name) @@ -7968,7 +8013,7 @@ yydefault: } case 470: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:5299 + //line php7/php7.y:5344 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -7980,7 +8025,6 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yyDollar[2].token.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.OpenCurlyBracesToken) @@ -7991,7 +8035,7 @@ yydefault: } case 471: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5320 + //line php7/php7.y:5364 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -8005,7 +8049,6 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yyDollar[2].token.Meta.SetTokenName(meta.ObjectOperatorToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(fetch.GetMeta()) @@ -8014,7 +8057,7 @@ yydefault: } case 472: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5341 + //line php7/php7.y:5384 { variable := expr.NewVariable(yyDollar[2].node) @@ -8024,7 +8067,6 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) yyDollar[3].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.NodeEnd) @@ -8033,7 +8075,7 @@ yydefault: } case 473: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5358 + //line php7/php7.y:5400 { name := node.NewIdentifier(yyDollar[2].token.Value) variable := expr.NewVariable(name) @@ -8045,7 +8087,6 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(yyVAL.node.GetMeta()) @@ -8055,7 +8096,7 @@ yydefault: } case 474: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:5378 + //line php7/php7.y:5419 { identifier := node.NewIdentifier(yyDollar[2].token.Value) variable := expr.NewVariable(identifier) @@ -8067,7 +8108,6 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[6].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) yyDollar[3].token.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.OpenSquareBracket) @@ -8080,12 +8120,11 @@ yydefault: } case 475: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5401 + //line php7/php7.y:5441 { yyVAL.node = yyDollar[2].node // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).PrependTo(yyVAL.node.GetMeta()) yylex.(*Parser).prependMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) yyDollar[3].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.NodeEnd) @@ -8094,7 +8133,7 @@ yydefault: } case 476: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5416 + //line php7/php7.y:5455 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) @@ -8108,7 +8147,7 @@ yydefault: } case 477: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5428 + //line php7/php7.y:5467 { // TODO: add option to handle 64 bit integer if _, err := strconv.Atoi(yyDollar[1].token.Value); err == nil { @@ -8120,11 +8159,14 @@ yydefault: // save position yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + // save comments + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 478: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5442 + //line php7/php7.y:5484 { var lnumber *scalar.Lnumber // TODO: add option to handle 64 bit integer @@ -8152,7 +8194,7 @@ yydefault: } case 479: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5468 + //line php7/php7.y:5510 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(identifier) @@ -8169,7 +8211,7 @@ yydefault: } case 480: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:5486 + //line php7/php7.y:5528 { yyVAL.node = expr.NewIsset(yyDollar[3].list) @@ -8189,7 +8231,7 @@ yydefault: } case 481: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:5504 + //line php7/php7.y:5546 { yyVAL.node = expr.NewEmpty(yyDollar[3].node) @@ -8205,7 +8247,7 @@ yydefault: } case 482: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5518 + //line php7/php7.y:5560 { yyVAL.node = expr.NewInclude(yyDollar[2].node) @@ -8219,7 +8261,7 @@ yydefault: } case 483: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5530 + //line php7/php7.y:5572 { yyVAL.node = expr.NewIncludeOnce(yyDollar[2].node) @@ -8233,7 +8275,7 @@ yydefault: } case 484: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:5542 + //line php7/php7.y:5584 { yyVAL.node = expr.NewEval(yyDollar[3].node) @@ -8249,7 +8291,7 @@ yydefault: } case 485: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5556 + //line php7/php7.y:5598 { yyVAL.node = expr.NewRequire(yyDollar[2].node) @@ -8263,7 +8305,7 @@ yydefault: } case 486: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5568 + //line php7/php7.y:5610 { yyVAL.node = expr.NewRequireOnce(yyDollar[2].node) @@ -8277,7 +8319,7 @@ yydefault: } case 487: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5583 + //line php7/php7.y:5625 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -8285,7 +8327,7 @@ yydefault: } case 488: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5589 + //line php7/php7.y:5631 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -8296,7 +8338,7 @@ yydefault: } case 489: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5601 + //line php7/php7.y:5643 { yyVAL.node = yyDollar[1].node diff --git a/php7/php7.y b/php7/php7.y index e78c9d6..cb3cb14 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -4290,6 +4290,9 @@ function_call: // save position $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $2)) + // save comments + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | class_name T_PAAMAYIM_NEKUDOTAYIM member_name argument_list @@ -4301,6 +4304,7 @@ function_call: // save comments $2.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4313,6 +4317,7 @@ function_call: // save comments $2.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4322,6 +4327,7 @@ function_call: // save position $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $2)) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4378,8 +4384,8 @@ exit_expr: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $1, meta.OpenParenthesisToken) + yylex.(*Parser).prependMetaToken($$, $1, meta.OpenParenthesisToken) + $1.Meta.SetTokenName(meta.OpenParenthesisToken).PrependTo($$.GetMeta()) $3.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $3, meta.CloseParenthesisToken) @@ -4658,6 +4664,9 @@ constant: // save position $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($1)) + // save comments + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | class_name T_PAAMAYIM_NEKUDOTAYIM identifier @@ -4673,6 +4682,8 @@ constant: $2.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo($$.GetMeta()) $3.Meta.SetTokenName(meta.NodeStart).AppendTo(target.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | variable_class_name T_PAAMAYIM_NEKUDOTAYIM identifier @@ -4688,6 +4699,8 @@ constant: $2.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo($$.GetMeta()) $3.Meta.SetTokenName(meta.NodeStart).AppendTo(target.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -4770,8 +4783,8 @@ callable_expr: $$ = $2; // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) + yylex.(*Parser).prependMetaToken($$, $1, meta.NodeStart) + $1.Meta.SetTokenName(meta.NodeStart).PrependTo($$.GetMeta()) $3.Meta.SetTokenName(meta.NodeEnd).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $3, meta.NodeEnd) @@ -4800,11 +4813,13 @@ callable_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments - $2.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $2, meta.OpenSquareBracket) + yylex.(*Parser).prependMetaToken($$, $2, meta.OpenSquareBracket) + $2.Meta.SetTokenName(meta.OpenSquareBracket).PrependTo($$.GetMeta()) $4.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $4, meta.CloseSquareBracket) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | constant '[' optional_expr ']' @@ -4815,11 +4830,13 @@ callable_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments - $2.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $2, meta.OpenSquareBracket) + yylex.(*Parser).prependMetaToken($$, $2, meta.OpenSquareBracket) + $2.Meta.SetTokenName(meta.OpenSquareBracket).PrependTo($$.GetMeta()) $4.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $4, meta.CloseSquareBracket) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | dereferencable '{' expr '}' @@ -4830,11 +4847,13 @@ callable_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments - $2.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $2, meta.OpenCurlyBracesToken) + yylex.(*Parser).prependMetaToken($$, $2, meta.OpenCurlyBracesToken) + $2.Meta.SetTokenName(meta.OpenCurlyBracesToken).PrependTo($$.GetMeta()) $4.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $4, meta.CloseCurlyBracesToken) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | dereferencable T_OBJECT_OPERATOR property_name argument_list @@ -4847,6 +4866,8 @@ callable_variable: // save comments $2.Meta.SetTokenName(meta.ObjectOperatorToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | function_call @@ -4880,6 +4901,8 @@ variable: // save comments $2.Meta.SetTokenName(meta.ObjectOperatorToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -4943,6 +4966,8 @@ static_member: // save comments $2.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | variable_class_name T_PAAMAYIM_NEKUDOTAYIM simple_variable @@ -4955,6 +4980,8 @@ static_member: // save comments $2.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -4974,11 +5001,13 @@ new_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments - $2.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $2, meta.OpenSquareBracket) + yylex.(*Parser).prependMetaToken($$, $2, meta.OpenSquareBracket) + $2.Meta.SetTokenName(meta.OpenSquareBracket).PrependTo($$.GetMeta()) $4.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $4, meta.CloseSquareBracket) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | new_variable '{' expr '}' @@ -4989,11 +5018,13 @@ new_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments - $2.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $2, meta.OpenCurlyBracesToken) + yylex.(*Parser).prependMetaToken($$, $2, meta.OpenCurlyBracesToken) + $2.Meta.SetTokenName(meta.OpenCurlyBracesToken).PrependTo($$.GetMeta()) $4.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $4, meta.CloseCurlyBracesToken) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | new_variable T_OBJECT_OPERATOR property_name @@ -5006,6 +5037,8 @@ new_variable: // save comments $2.Meta.SetTokenName(meta.ObjectOperatorToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | class_name T_PAAMAYIM_NEKUDOTAYIM simple_variable @@ -5018,6 +5051,8 @@ new_variable: // save comments $2.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | new_variable T_PAAMAYIM_NEKUDOTAYIM simple_variable @@ -5030,6 +5065,8 @@ new_variable: // save comments $2.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -5161,6 +5198,8 @@ array_pair: // save comments $2.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr @@ -5170,6 +5209,8 @@ array_pair: // save position $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($1)) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr T_DOUBLE_ARROW '&' variable @@ -5185,6 +5226,8 @@ array_pair: $2.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo($$.GetMeta()) $3.Meta.SetTokenName(meta.NodeStart).AppendTo(reference.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | '&' variable @@ -5197,7 +5240,7 @@ array_pair: reference.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo(reference.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5217,6 +5260,8 @@ array_pair: $4.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(list.GetMeta()) $6.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(list.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_LIST '(' array_pair_list ')' @@ -5230,7 +5275,7 @@ array_pair: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo(list.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(list.GetMeta()) $4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(list.GetMeta()) @@ -5307,7 +5352,6 @@ encaps_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) $2.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $2, meta.OpenCurlyBracesToken) @@ -5330,7 +5374,6 @@ encaps_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) $2.Meta.SetTokenName(meta.ObjectOperatorToken).AppendTo($$.GetMeta()) $3.Meta.SetTokenName(meta.NodeStart).AppendTo(fetch.GetMeta()) @@ -5347,7 +5390,6 @@ encaps_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) $3.Meta.SetTokenName(meta.NodeEnd).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $3, meta.NodeEnd) @@ -5366,7 +5408,6 @@ encaps_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) $2.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) $3.Meta.SetTokenName(meta.NodeEnd).AppendTo($$.GetMeta()) @@ -5386,7 +5427,6 @@ encaps_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $6)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) $3.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $3, meta.OpenSquareBracket) @@ -5402,7 +5442,6 @@ encaps_var: $$ = $2; // save comments - $1.Meta.SetTokenName(meta.NodeStart).PrependTo($$.GetMeta()) yylex.(*Parser).prependMetaToken($$, $1, meta.NodeStart) $3.Meta.SetTokenName(meta.NodeEnd).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $3, meta.NodeEnd) @@ -5436,6 +5475,9 @@ encaps_var_offset: // save position $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + // save comments + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | '-' T_NUM_STRING diff --git a/visitor/dumper_test.go b/visitor/dumper_test.go index 8944b64..6451ca1 100644 --- a/visitor/dumper_test.go +++ b/visitor/dumper_test.go @@ -117,12 +117,12 @@ func ExampleDumper() { // | "DefaultValue": // | [*expr.ConstFetch] // | "Position": Pos{Line: 5-5 Pos: 86-89} + // | "Meta": + // | " " before "NodeStart" // | "Constant": // | [*name.Name] // | "Position": Pos{Line: 5-5 Pos: 86-89} // | "NamespacedName": "null" - // | "Meta": - // | " " before "NodeStart" // | "Parts": // | [*name.NamePart] // | "Position": Pos{Line: 5-5 Pos: 86-89} diff --git a/visitor/go_dumper_test.go b/visitor/go_dumper_test.go index a3c13c6..c7aa0db 100644 --- a/visitor/go_dumper_test.go +++ b/visitor/go_dumper_test.go @@ -346,6 +346,19 @@ func ExampleGoDumper() { // StartPos: 86, // EndPos: 89, // }, + // Meta: meta.Collection{ + // &meta.Data{ + // Type: meta.WhiteSpaceType, + // Position: &position.Position{ + // StartLine: 5, + // EndLine: 5, + // StartPos: 85, + // EndPos: 85, + // }, + // Value: " ", + // TokenName: meta.NodeStart, + // }, + // }, // Constant: &name.Name{ // Position: &position.Position{ // StartLine: 5, @@ -353,19 +366,6 @@ func ExampleGoDumper() { // StartPos: 86, // EndPos: 89, // }, - // Meta: meta.Collection{ - // &meta.Data{ - // Type: meta.WhiteSpaceType, - // Position: &position.Position{ - // StartLine: 5, - // EndLine: 5, - // StartPos: 85, - // EndPos: 85, - // }, - // Value: " ", - // TokenName: meta.NodeStart, - // }, - // }, // Parts: []node.Node{ // &name.NamePart{ // Position: &position.Position{ diff --git a/visitor/json_dumper_test.go b/visitor/json_dumper_test.go index 81af330..aacc186 100644 --- a/visitor/json_dumper_test.go +++ b/visitor/json_dumper_test.go @@ -37,5 +37,5 @@ func ExampleJsonDumper() { nodes.Walk(dumper) // Output: - // {"type":"*node.Root","position":{"startPos":10,"endPos":166,"startLine":3,"endLine":12},"Stmts":[{"type":"*stmt.Namespace","position":{"startPos":10,"endPos":166,"startLine":3,"endLine":12},"meta":[{"type":"*meta.TokenType","value":" Date: Wed, 2 Jan 2019 23:21:09 +0200 Subject: [PATCH 105/117] #70: [php7] fix inheriting meta.Data at stmt.GroupUse, stmt.Use --- php7/php7.go | 759 ++++++++++++++++++++++++++------------------------- php7/php7.y | 13 +- 2 files changed, 387 insertions(+), 385 deletions(-) diff --git a/php7/php7.go b/php7/php7.go index 5c73743..18d76a6 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -346,7 +346,7 @@ const yyEofCode = 1 const yyErrCode = 2 const yyInitialStackSize = 16 -//line php7/php7.y:5652 +//line php7/php7.y:5653 //line yacctab:1 var yyExca = [...]int{ @@ -2940,8 +2940,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[7].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.UseLeadingNsSeparatorToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.UseLeadingNsSeparatorToken) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) + yylex.(*Parser).appendMetaToken(name, yyDollar[1].token, meta.NodeStart) + yyDollar[2].list[0].GetMeta().Cut(newInheritMetaFilter()).AppendTo(name.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) if yyDollar[6].token != nil { @@ -2950,13 +2951,11 @@ yydefault: } yyDollar[7].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].list[0].GetMeta().Cut(newInheritMetaFilter()).PrependTo(name.GetMeta()) - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 104: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:682 + //line php7/php7.y:681 { name := name.NewName(yyDollar[1].list) yyVAL.node = stmt.NewGroupUse(nil, name, yyDollar[4].list) @@ -2980,7 +2979,7 @@ yydefault: } case 105: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:704 + //line php7/php7.y:703 { name := name.NewName(yyDollar[2].list) yyVAL.node = stmt.NewGroupUse(nil, name, yyDollar[5].list) @@ -2990,8 +2989,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[7].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.UseLeadingNsSeparatorToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.UseLeadingNsSeparatorToken) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) + yylex.(*Parser).appendMetaToken(name, yyDollar[1].token, meta.NodeStart) + yyDollar[2].list[0].GetMeta().Cut(newInheritMetaFilter()).AppendTo(name.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) if yyDollar[6].token != nil { @@ -3148,12 +3148,13 @@ yydefault: // save comments yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) + yyDollar[2].node.(*stmt.Use).Use.GetMeta().Cut(newInheritMetaFilter()).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 120: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:871 + //line php7/php7.y:872 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -3164,7 +3165,7 @@ yydefault: } case 121: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:880 + //line php7/php7.y:881 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -3172,7 +3173,7 @@ yydefault: } case 122: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:889 + //line php7/php7.y:890 { if yyDollar[2].node != nil { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -3182,7 +3183,7 @@ yydefault: } case 123: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:897 + //line php7/php7.y:898 { yyVAL.list = []node.Node{} @@ -3190,7 +3191,7 @@ yydefault: } case 124: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:906 + //line php7/php7.y:907 { // error yyVAL.node = nil @@ -3199,7 +3200,7 @@ yydefault: } case 125: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:913 + //line php7/php7.y:914 { yyVAL.node = yyDollar[1].node @@ -3207,7 +3208,7 @@ yydefault: } case 126: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:919 + //line php7/php7.y:920 { yyVAL.node = yyDollar[1].node @@ -3215,7 +3216,7 @@ yydefault: } case 127: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:925 + //line php7/php7.y:926 { yyVAL.node = yyDollar[1].node @@ -3223,7 +3224,7 @@ yydefault: } case 128: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:931 + //line php7/php7.y:932 { yyVAL.node = yyDollar[1].node @@ -3231,7 +3232,7 @@ yydefault: } case 129: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:937 + //line php7/php7.y:938 { yyVAL.node = yyDollar[1].node @@ -3239,7 +3240,7 @@ yydefault: } case 130: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:943 + //line php7/php7.y:944 { yyVAL.node = stmt.NewHaltCompiler() @@ -3257,7 +3258,7 @@ yydefault: } case 131: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:961 + //line php7/php7.y:962 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) @@ -3272,7 +3273,7 @@ yydefault: } case 132: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:974 + //line php7/php7.y:975 { yyVAL.node = yyDollar[1].node @@ -3280,7 +3281,7 @@ yydefault: } case 133: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:980 + //line php7/php7.y:981 { yyVAL.node = yyDollar[1].node @@ -3288,7 +3289,7 @@ yydefault: } case 134: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:986 + //line php7/php7.y:987 { switch n := yyDollar[5].node.(type) { case *stmt.While: @@ -3311,7 +3312,7 @@ yydefault: } case 135: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:1007 + //line php7/php7.y:1008 { yyVAL.node = stmt.NewDo(yyDollar[2].node, yyDollar[5].node) @@ -3330,7 +3331,7 @@ yydefault: } case 136: yyDollar = yyS[yypt-9 : yypt+1] - //line php7/php7.y:1024 + //line php7/php7.y:1025 { switch n := yyDollar[9].node.(type) { case *stmt.For: @@ -3359,7 +3360,7 @@ yydefault: } case 137: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:1051 + //line php7/php7.y:1052 { switch n := yyDollar[5].node.(type) { case *stmt.Switch: @@ -3384,7 +3385,7 @@ yydefault: } case 138: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1074 + //line php7/php7.y:1075 { yyVAL.node = stmt.NewBreak(yyDollar[2].node) @@ -3400,7 +3401,7 @@ yydefault: } case 139: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1088 + //line php7/php7.y:1089 { yyVAL.node = stmt.NewContinue(yyDollar[2].node) @@ -3416,7 +3417,7 @@ yydefault: } case 140: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1102 + //line php7/php7.y:1103 { yyVAL.node = stmt.NewReturn(yyDollar[2].node) @@ -3432,7 +3433,7 @@ yydefault: } case 141: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1116 + //line php7/php7.y:1117 { yyVAL.node = stmt.NewGlobal(yyDollar[2].list) @@ -3448,7 +3449,7 @@ yydefault: } case 142: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1130 + //line php7/php7.y:1131 { yyVAL.node = stmt.NewStatic(yyDollar[2].list) @@ -3464,7 +3465,7 @@ yydefault: } case 143: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1144 + //line php7/php7.y:1145 { yyVAL.node = stmt.NewEcho(yyDollar[2].list) @@ -3481,7 +3482,7 @@ yydefault: } case 144: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1159 + //line php7/php7.y:1160 { yyVAL.node = stmt.NewInlineHtml(yyDollar[1].token.Value) @@ -3495,7 +3496,7 @@ yydefault: } case 145: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1171 + //line php7/php7.y:1172 { yyVAL.node = stmt.NewExpression(yyDollar[1].node) @@ -3512,7 +3513,7 @@ yydefault: } case 146: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1186 + //line php7/php7.y:1187 { yyVAL.node = stmt.NewUnset(yyDollar[3].list) @@ -3534,7 +3535,7 @@ yydefault: } case 147: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:1206 + //line php7/php7.y:1207 { switch n := yyDollar[7].node.(type) { case *stmt.Foreach: @@ -3560,7 +3561,7 @@ yydefault: } case 148: yyDollar = yyS[yypt-9 : yypt+1] - //line php7/php7.y:1230 + //line php7/php7.y:1231 { switch n := yyDollar[9].node.(type) { case *stmt.Foreach: @@ -3589,7 +3590,7 @@ yydefault: } case 149: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:1257 + //line php7/php7.y:1258 { yyVAL.node = yyDollar[5].node yyVAL.node.(*stmt.Declare).Consts = yyDollar[3].list @@ -3606,7 +3607,7 @@ yydefault: } case 150: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1272 + //line php7/php7.y:1273 { yyVAL.node = stmt.NewNop() @@ -3621,7 +3622,7 @@ yydefault: } case 151: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1285 + //line php7/php7.y:1286 { if yyDollar[6].node == nil { yyVAL.node = stmt.NewTry(yyDollar[3].list, yyDollar[5].list, yyDollar[6].node) @@ -3640,7 +3641,7 @@ yydefault: } case 152: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1302 + //line php7/php7.y:1303 { yyVAL.node = stmt.NewThrow(yyDollar[2].node) @@ -3656,7 +3657,7 @@ yydefault: } case 153: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1316 + //line php7/php7.y:1317 { label := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewGoto(label) @@ -3675,7 +3676,7 @@ yydefault: } case 154: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1333 + //line php7/php7.y:1334 { label := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewLabel(label) @@ -3692,7 +3693,7 @@ yydefault: } case 155: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1350 + //line php7/php7.y:1351 { yyVAL.list = []node.Node{} @@ -3700,7 +3701,7 @@ yydefault: } case 156: yyDollar = yyS[yypt-9 : yypt+1] - //line php7/php7.y:1356 + //line php7/php7.y:1357 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[5].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -3725,7 +3726,7 @@ yydefault: } case 157: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1381 + //line php7/php7.y:1382 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -3733,7 +3734,7 @@ yydefault: } case 158: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1387 + //line php7/php7.y:1388 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -3744,7 +3745,7 @@ yydefault: } case 159: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1399 + //line php7/php7.y:1400 { yyVAL.node = nil @@ -3752,7 +3753,7 @@ yydefault: } case 160: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1405 + //line php7/php7.y:1406 { yyVAL.node = stmt.NewFinally(yyDollar[3].list) @@ -3768,7 +3769,7 @@ yydefault: } case 161: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1422 + //line php7/php7.y:1423 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -3776,7 +3777,7 @@ yydefault: } case 162: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1428 + //line php7/php7.y:1429 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -3787,7 +3788,7 @@ yydefault: } case 163: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1440 + //line php7/php7.y:1441 { yyVAL.node = yyDollar[1].node @@ -3795,7 +3796,7 @@ yydefault: } case 164: yyDollar = yyS[yypt-11 : yypt+1] - //line php7/php7.y:1449 + //line php7/php7.y:1450 { name := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewFunction(name, yyDollar[2].token != nil, yyDollar[6].list, yyDollar[8].node, yyDollar[10].list, yyDollar[4].str) @@ -3819,31 +3820,31 @@ yydefault: } case 165: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1475 + //line php7/php7.y:1476 { yyVAL.token = nil } case 166: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1479 + //line php7/php7.y:1480 { yyVAL.token = yyDollar[1].token } case 167: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1486 + //line php7/php7.y:1487 { yyVAL.token = nil } case 168: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1490 + //line php7/php7.y:1491 { yyVAL.token = yyDollar[1].token } case 169: yyDollar = yyS[yypt-9 : yypt+1] - //line php7/php7.y:1497 + //line php7/php7.y:1498 { name := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewClass(name, yyDollar[1].list, nil, yyDollar[4].ClassExtends, yyDollar[5].ClassImplements, yyDollar[8].list, yyDollar[6].str) @@ -3864,7 +3865,7 @@ yydefault: } case 170: yyDollar = yyS[yypt-8 : yypt+1] - //line php7/php7.y:1516 + //line php7/php7.y:1517 { name := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewClass(name, nil, nil, yyDollar[3].ClassExtends, yyDollar[4].ClassImplements, yyDollar[7].list, yyDollar[5].str) @@ -3883,7 +3884,7 @@ yydefault: } case 171: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1536 + //line php7/php7.y:1537 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -3891,7 +3892,7 @@ yydefault: } case 172: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1542 + //line php7/php7.y:1543 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -3899,7 +3900,7 @@ yydefault: } case 173: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1551 + //line php7/php7.y:1552 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -3913,7 +3914,7 @@ yydefault: } case 174: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1563 + //line php7/php7.y:1564 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -3927,7 +3928,7 @@ yydefault: } case 175: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1578 + //line php7/php7.y:1579 { name := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewTrait(name, yyDollar[5].list, yyDollar[3].str) @@ -3946,7 +3947,7 @@ yydefault: } case 176: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:1598 + //line php7/php7.y:1599 { name := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewInterface(name, yyDollar[3].InterfaceExtends, yyDollar[6].list, yyDollar[4].str) @@ -3965,7 +3966,7 @@ yydefault: } case 177: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1618 + //line php7/php7.y:1619 { yyVAL.ClassExtends = nil @@ -3973,7 +3974,7 @@ yydefault: } case 178: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1624 + //line php7/php7.y:1625 { yyVAL.ClassExtends = stmt.NewClassExtends(yyDollar[2].node) @@ -3987,7 +3988,7 @@ yydefault: } case 179: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1639 + //line php7/php7.y:1640 { yyVAL.InterfaceExtends = nil @@ -3995,7 +3996,7 @@ yydefault: } case 180: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1645 + //line php7/php7.y:1646 { yyVAL.InterfaceExtends = stmt.NewInterfaceExtends(yyDollar[2].list) @@ -4009,7 +4010,7 @@ yydefault: } case 181: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1660 + //line php7/php7.y:1661 { yyVAL.ClassImplements = nil @@ -4017,7 +4018,7 @@ yydefault: } case 182: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1666 + //line php7/php7.y:1667 { yyVAL.ClassImplements = stmt.NewClassImplements(yyDollar[2].list) @@ -4031,7 +4032,7 @@ yydefault: } case 183: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1681 + //line php7/php7.y:1682 { yyVAL.node = yyDollar[1].node @@ -4039,7 +4040,7 @@ yydefault: } case 184: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1687 + //line php7/php7.y:1688 { yyVAL.node = expr.NewReference(yyDollar[2].node) @@ -4053,7 +4054,7 @@ yydefault: } case 185: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1699 + //line php7/php7.y:1700 { yyVAL.node = expr.NewList(yyDollar[3].list) @@ -4069,7 +4070,7 @@ yydefault: } case 186: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1713 + //line php7/php7.y:1714 { yyVAL.node = expr.NewShortList(yyDollar[2].list) @@ -4084,7 +4085,7 @@ yydefault: } case 187: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1729 + //line php7/php7.y:1730 { yyVAL.node = stmt.NewFor(nil, nil, nil, yyDollar[1].node) @@ -4095,7 +4096,7 @@ yydefault: } case 188: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1738 + //line php7/php7.y:1739 { stmtList := stmt.NewStmtList(yyDollar[2].list) yyVAL.node = stmt.NewAltFor(nil, nil, nil, stmtList) @@ -4114,7 +4115,7 @@ yydefault: } case 189: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1758 + //line php7/php7.y:1759 { yyVAL.node = stmt.NewForeach(nil, nil, nil, yyDollar[1].node) @@ -4125,7 +4126,7 @@ yydefault: } case 190: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1767 + //line php7/php7.y:1768 { stmtList := stmt.NewStmtList(yyDollar[2].list) yyVAL.node = stmt.NewAltForeach(nil, nil, nil, stmtList) @@ -4144,7 +4145,7 @@ yydefault: } case 191: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1787 + //line php7/php7.y:1788 { yyVAL.node = stmt.NewDeclare(nil, yyDollar[1].node, false) @@ -4155,7 +4156,7 @@ yydefault: } case 192: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1796 + //line php7/php7.y:1797 { stmtList := stmt.NewStmtList(yyDollar[2].list) yyVAL.node = stmt.NewDeclare(nil, stmtList, true) @@ -4174,7 +4175,7 @@ yydefault: } case 193: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1816 + //line php7/php7.y:1817 { caseList := stmt.NewCaseList(yyDollar[2].list) yyVAL.node = stmt.NewSwitch(nil, caseList) @@ -4191,7 +4192,7 @@ yydefault: } case 194: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1831 + //line php7/php7.y:1832 { caseList := stmt.NewCaseList(yyDollar[3].list) yyVAL.node = stmt.NewSwitch(nil, caseList) @@ -4210,7 +4211,7 @@ yydefault: } case 195: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1848 + //line php7/php7.y:1849 { caseList := stmt.NewCaseList(yyDollar[2].list) yyVAL.node = stmt.NewAltSwitch(nil, caseList) @@ -4229,7 +4230,7 @@ yydefault: } case 196: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:1865 + //line php7/php7.y:1866 { caseList := stmt.NewCaseList(yyDollar[3].list) @@ -4251,7 +4252,7 @@ yydefault: } case 197: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1888 + //line php7/php7.y:1889 { yyVAL.list = []node.Node{} @@ -4259,7 +4260,7 @@ yydefault: } case 198: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:1894 + //line php7/php7.y:1895 { _case := stmt.NewCase(yyDollar[3].node, yyDollar[5].list) yyVAL.list = append(yyDollar[1].list, _case) @@ -4276,7 +4277,7 @@ yydefault: } case 199: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1909 + //line php7/php7.y:1910 { _default := stmt.NewDefault(yyDollar[4].list) yyVAL.list = append(yyDollar[1].list, _default) @@ -4293,19 +4294,19 @@ yydefault: } case 200: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1927 + //line php7/php7.y:1928 { yyVAL.token = yyDollar[1].token } case 201: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1931 + //line php7/php7.y:1932 { yyVAL.token = yyDollar[1].token } case 202: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1938 + //line php7/php7.y:1939 { yyVAL.node = stmt.NewWhile(nil, yyDollar[1].node) @@ -4316,7 +4317,7 @@ yydefault: } case 203: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1947 + //line php7/php7.y:1948 { stmtList := stmt.NewStmtList(yyDollar[2].list) yyVAL.node = stmt.NewAltWhile(nil, stmtList) @@ -4335,7 +4336,7 @@ yydefault: } case 204: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:1967 + //line php7/php7.y:1968 { yyVAL.node = stmt.NewIf(yyDollar[3].node, yyDollar[5].node, nil, nil) @@ -4351,7 +4352,7 @@ yydefault: } case 205: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1981 + //line php7/php7.y:1982 { _elseIf := stmt.NewElseIf(yyDollar[4].node, yyDollar[6].node) yyVAL.node = yyDollar[1].node.(*stmt.If).AddElseIf(_elseIf) @@ -4369,7 +4370,7 @@ yydefault: } case 206: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2000 + //line php7/php7.y:2001 { yyVAL.node = yyDollar[1].node @@ -4377,7 +4378,7 @@ yydefault: } case 207: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2006 + //line php7/php7.y:2007 { _else := stmt.NewElse(yyDollar[3].node) yyVAL.node = yyDollar[1].node.(*stmt.If).SetElse(_else) @@ -4393,7 +4394,7 @@ yydefault: } case 208: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:2023 + //line php7/php7.y:2024 { stmts := stmt.NewStmtList(yyDollar[6].list) yyVAL.node = stmt.NewAltIf(yyDollar[3].node, stmts, nil, nil) @@ -4412,7 +4413,7 @@ yydefault: } case 209: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:2040 + //line php7/php7.y:2041 { stmts := stmt.NewStmtList(yyDollar[7].list) _elseIf := stmt.NewAltElseIf(yyDollar[4].node, stmts) @@ -4432,7 +4433,7 @@ yydefault: } case 210: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2061 + //line php7/php7.y:2062 { yyVAL.node = yyDollar[1].node @@ -4448,7 +4449,7 @@ yydefault: } case 211: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:2075 + //line php7/php7.y:2076 { stmts := stmt.NewStmtList(yyDollar[4].list) _else := stmt.NewAltElse(stmts) @@ -4470,7 +4471,7 @@ yydefault: } case 212: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2098 + //line php7/php7.y:2099 { yyVAL.list = yyDollar[1].list @@ -4478,7 +4479,7 @@ yydefault: } case 213: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:2104 + //line php7/php7.y:2105 { yyVAL.list = nil @@ -4486,7 +4487,7 @@ yydefault: } case 214: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2113 + //line php7/php7.y:2114 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4494,7 +4495,7 @@ yydefault: } case 215: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2119 + //line php7/php7.y:2120 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4505,7 +4506,7 @@ yydefault: } case 216: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2131 + //line php7/php7.y:2132 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[4].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -4545,7 +4546,7 @@ yydefault: } case 217: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:2169 + //line php7/php7.y:2170 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[4].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -4586,7 +4587,7 @@ yydefault: } case 218: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:2211 + //line php7/php7.y:2212 { yyVAL.node = nil @@ -4594,7 +4595,7 @@ yydefault: } case 219: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2217 + //line php7/php7.y:2218 { yyVAL.node = yyDollar[1].node @@ -4602,7 +4603,7 @@ yydefault: } case 220: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2226 + //line php7/php7.y:2227 { yyVAL.node = yyDollar[1].node @@ -4610,7 +4611,7 @@ yydefault: } case 221: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2232 + //line php7/php7.y:2233 { yyVAL.node = node.NewNullable(yyDollar[2].node) @@ -4624,7 +4625,7 @@ yydefault: } case 222: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2247 + //line php7/php7.y:2248 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4638,7 +4639,7 @@ yydefault: } case 223: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2259 + //line php7/php7.y:2260 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4652,7 +4653,7 @@ yydefault: } case 224: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2271 + //line php7/php7.y:2272 { yyVAL.node = yyDollar[1].node @@ -4660,7 +4661,7 @@ yydefault: } case 225: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:2280 + //line php7/php7.y:2281 { yyVAL.node = nil @@ -4668,7 +4669,7 @@ yydefault: } case 226: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2286 + //line php7/php7.y:2287 { yyVAL.node = yyDollar[2].node @@ -4679,7 +4680,7 @@ yydefault: } case 227: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2298 + //line php7/php7.y:2299 { yyVAL.node = node.NewArgumentList(nil) @@ -4694,7 +4695,7 @@ yydefault: } case 228: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2311 + //line php7/php7.y:2312 { yyVAL.node = node.NewArgumentList(yyDollar[2].list) @@ -4713,7 +4714,7 @@ yydefault: } case 229: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2331 + //line php7/php7.y:2332 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4721,7 +4722,7 @@ yydefault: } case 230: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2337 + //line php7/php7.y:2338 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4732,7 +4733,7 @@ yydefault: } case 231: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2349 + //line php7/php7.y:2350 { yyVAL.node = node.NewArgument(yyDollar[1].node, false, false) @@ -4746,7 +4747,7 @@ yydefault: } case 232: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2361 + //line php7/php7.y:2362 { yyVAL.node = node.NewArgument(yyDollar[2].node, true, false) @@ -4760,7 +4761,7 @@ yydefault: } case 233: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2376 + //line php7/php7.y:2377 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4771,7 +4772,7 @@ yydefault: } case 234: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2385 + //line php7/php7.y:2386 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4779,7 +4780,7 @@ yydefault: } case 235: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2394 + //line php7/php7.y:2395 { yyVAL.node = yyDollar[1].node @@ -4787,7 +4788,7 @@ yydefault: } case 236: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2403 + //line php7/php7.y:2404 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4798,7 +4799,7 @@ yydefault: } case 237: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2412 + //line php7/php7.y:2413 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4806,7 +4807,7 @@ yydefault: } case 238: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2421 + //line php7/php7.y:2422 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -4825,7 +4826,7 @@ yydefault: } case 239: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2438 + //line php7/php7.y:2439 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -4845,7 +4846,7 @@ yydefault: } case 240: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2459 + //line php7/php7.y:2460 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -4853,7 +4854,7 @@ yydefault: } case 241: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:2465 + //line php7/php7.y:2466 { yyVAL.list = []node.Node{} @@ -4861,7 +4862,7 @@ yydefault: } case 242: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2474 + //line php7/php7.y:2475 { yyVAL.node = stmt.NewPropertyList(yyDollar[1].list, yyDollar[2].list) @@ -4878,7 +4879,7 @@ yydefault: } case 243: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2489 + //line php7/php7.y:2490 { yyVAL.node = stmt.NewClassConstList(yyDollar[1].list, yyDollar[3].list) @@ -4894,7 +4895,7 @@ yydefault: } case 244: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2505 + //line php7/php7.y:2506 { yyVAL.node = stmt.NewTraitUse(yyDollar[2].list, yyDollar[3].node) @@ -4908,7 +4909,7 @@ yydefault: } case 245: yyDollar = yyS[yypt-10 : yypt+1] - //line php7/php7.y:2517 + //line php7/php7.y:2518 { name := node.NewIdentifier(yyDollar[4].token.Value) yyVAL.node = stmt.NewClassMethod(name, yyDollar[1].list, yyDollar[3].token != nil, yyDollar[7].list, yyDollar[9].node, yyDollar[10].node, yyDollar[5].str) @@ -4938,7 +4939,7 @@ yydefault: } case 246: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2548 + //line php7/php7.y:2549 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4946,7 +4947,7 @@ yydefault: } case 247: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2554 + //line php7/php7.y:2555 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4957,7 +4958,7 @@ yydefault: } case 248: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2566 + //line php7/php7.y:2567 { yyVAL.node = stmt.NewNop() @@ -4971,7 +4972,7 @@ yydefault: } case 249: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2579 + //line php7/php7.y:2580 { yyVAL.node = stmt.NewTraitAdaptationList(nil) @@ -4985,7 +4986,7 @@ yydefault: } case 250: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2591 + //line php7/php7.y:2592 { yyVAL.node = stmt.NewTraitAdaptationList(yyDollar[2].list) @@ -4999,7 +5000,7 @@ yydefault: } case 251: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2606 + //line php7/php7.y:2607 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -5007,7 +5008,7 @@ yydefault: } case 252: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2612 + //line php7/php7.y:2613 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -5015,7 +5016,7 @@ yydefault: } case 253: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2621 + //line php7/php7.y:2622 { yyVAL.node = yyDollar[1].node @@ -5027,7 +5028,7 @@ yydefault: } case 254: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2631 + //line php7/php7.y:2632 { yyVAL.node = yyDollar[1].node @@ -5039,7 +5040,7 @@ yydefault: } case 255: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2644 + //line php7/php7.y:2645 { yyVAL.node = stmt.NewTraitUsePrecedence(yyDollar[1].node, yyDollar[3].list) @@ -5055,7 +5056,7 @@ yydefault: } case 256: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2661 + //line php7/php7.y:2662 { alias := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, nil, alias) @@ -5074,7 +5075,7 @@ yydefault: } case 257: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2678 + //line php7/php7.y:2679 { alias := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, nil, alias) @@ -5093,7 +5094,7 @@ yydefault: } case 258: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2695 + //line php7/php7.y:2696 { alias := node.NewIdentifier(yyDollar[4].token.Value) yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, yyDollar[3].node, alias) @@ -5112,7 +5113,7 @@ yydefault: } case 259: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2712 + //line php7/php7.y:2713 { yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, yyDollar[3].node, nil) @@ -5128,7 +5129,7 @@ yydefault: } case 260: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2729 + //line php7/php7.y:2730 { name := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewTraitMethodRef(nil, name) @@ -5144,7 +5145,7 @@ yydefault: } case 261: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2743 + //line php7/php7.y:2744 { yyVAL.node = yyDollar[1].node @@ -5152,7 +5153,7 @@ yydefault: } case 262: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2752 + //line php7/php7.y:2753 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewTraitMethodRef(yyDollar[1].node, target) @@ -5171,7 +5172,7 @@ yydefault: } case 263: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2772 + //line php7/php7.y:2773 { yyVAL.node = stmt.NewNop() @@ -5186,7 +5187,7 @@ yydefault: } case 264: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2785 + //line php7/php7.y:2786 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) @@ -5201,7 +5202,7 @@ yydefault: } case 265: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2801 + //line php7/php7.y:2802 { yyVAL.list = yyDollar[1].list @@ -5209,7 +5210,7 @@ yydefault: } case 266: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2807 + //line php7/php7.y:2808 { modifier := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.list = []node.Node{modifier} @@ -5224,7 +5225,7 @@ yydefault: } case 267: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:2823 + //line php7/php7.y:2824 { yyVAL.list = nil @@ -5232,7 +5233,7 @@ yydefault: } case 268: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2829 + //line php7/php7.y:2830 { yyVAL.list = yyDollar[1].list @@ -5240,7 +5241,7 @@ yydefault: } case 269: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2838 + //line php7/php7.y:2839 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -5248,7 +5249,7 @@ yydefault: } case 270: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2844 + //line php7/php7.y:2845 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -5256,7 +5257,7 @@ yydefault: } case 271: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2853 + //line php7/php7.y:2854 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5270,7 +5271,7 @@ yydefault: } case 272: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2865 + //line php7/php7.y:2866 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5284,7 +5285,7 @@ yydefault: } case 273: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2877 + //line php7/php7.y:2878 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5298,7 +5299,7 @@ yydefault: } case 274: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2889 + //line php7/php7.y:2890 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5312,7 +5313,7 @@ yydefault: } case 275: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2901 + //line php7/php7.y:2902 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5326,7 +5327,7 @@ yydefault: } case 276: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2913 + //line php7/php7.y:2914 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5340,7 +5341,7 @@ yydefault: } case 277: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2928 + //line php7/php7.y:2929 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -5351,7 +5352,7 @@ yydefault: } case 278: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2937 + //line php7/php7.y:2938 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -5359,7 +5360,7 @@ yydefault: } case 279: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2946 + //line php7/php7.y:2947 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -5378,7 +5379,7 @@ yydefault: } case 280: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2963 + //line php7/php7.y:2964 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -5398,7 +5399,7 @@ yydefault: } case 281: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2984 + //line php7/php7.y:2985 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -5409,7 +5410,7 @@ yydefault: } case 282: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2993 + //line php7/php7.y:2994 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -5417,7 +5418,7 @@ yydefault: } case 283: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3002 + //line php7/php7.y:3003 { name := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewConstant(name, yyDollar[3].node, yyDollar[4].str) @@ -5434,7 +5435,7 @@ yydefault: } case 284: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3020 + //line php7/php7.y:3021 { name := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewConstant(name, yyDollar[3].node, yyDollar[4].str) @@ -5451,7 +5452,7 @@ yydefault: } case 285: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3038 + //line php7/php7.y:3039 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -5462,7 +5463,7 @@ yydefault: } case 286: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3047 + //line php7/php7.y:3048 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -5470,7 +5471,7 @@ yydefault: } case 287: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3056 + //line php7/php7.y:3057 { yyVAL.node = yyDollar[1].node @@ -5478,7 +5479,7 @@ yydefault: } case 288: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3065 + //line php7/php7.y:3066 { yyVAL.list = nil @@ -5486,7 +5487,7 @@ yydefault: } case 289: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3071 + //line php7/php7.y:3072 { yyVAL.list = yyDollar[1].list @@ -5494,7 +5495,7 @@ yydefault: } case 290: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3080 + //line php7/php7.y:3081 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -5505,7 +5506,7 @@ yydefault: } case 291: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3089 + //line php7/php7.y:3090 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -5513,7 +5514,7 @@ yydefault: } case 292: yyDollar = yyS[yypt-8 : yypt+1] - //line php7/php7.y:3098 + //line php7/php7.y:3099 { if yyDollar[2].node != nil { yyVAL.node = stmt.NewClass(nil, nil, yyDollar[2].node.(*node.ArgumentList), yyDollar[3].ClassExtends, yyDollar[4].ClassImplements, yyDollar[7].list, yyDollar[5].str) @@ -5533,7 +5534,7 @@ yydefault: } case 293: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3119 + //line php7/php7.y:3120 { if yyDollar[3].node != nil { yyVAL.node = expr.NewNew(yyDollar[2].node, yyDollar[3].node.(*node.ArgumentList)) @@ -5550,7 +5551,7 @@ yydefault: } case 294: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3134 + //line php7/php7.y:3135 { yyVAL.node = expr.NewNew(yyDollar[2].node, nil) @@ -5564,7 +5565,7 @@ yydefault: } case 295: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:3149 + //line php7/php7.y:3150 { list := expr.NewList(yyDollar[3].list) yyVAL.node = assign.NewAssign(list, yyDollar[6].node) @@ -5583,7 +5584,7 @@ yydefault: } case 296: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:3166 + //line php7/php7.y:3167 { shortList := expr.NewShortList(yyDollar[2].list) yyVAL.node = assign.NewAssign(shortList, yyDollar[5].node) @@ -5601,7 +5602,7 @@ yydefault: } case 297: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3182 + //line php7/php7.y:3183 { yyVAL.node = assign.NewAssign(yyDollar[1].node, yyDollar[3].node) @@ -5617,7 +5618,7 @@ yydefault: } case 298: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3196 + //line php7/php7.y:3197 { yyVAL.node = assign.NewReference(yyDollar[1].node, yyDollar[4].node) @@ -5634,7 +5635,7 @@ yydefault: } case 299: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3211 + //line php7/php7.y:3212 { yyVAL.node = expr.NewClone(yyDollar[2].node) @@ -5648,7 +5649,7 @@ yydefault: } case 300: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3223 + //line php7/php7.y:3224 { yyVAL.node = assign.NewPlus(yyDollar[1].node, yyDollar[3].node) @@ -5664,7 +5665,7 @@ yydefault: } case 301: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3237 + //line php7/php7.y:3238 { yyVAL.node = assign.NewMinus(yyDollar[1].node, yyDollar[3].node) @@ -5680,7 +5681,7 @@ yydefault: } case 302: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3251 + //line php7/php7.y:3252 { yyVAL.node = assign.NewMul(yyDollar[1].node, yyDollar[3].node) @@ -5696,7 +5697,7 @@ yydefault: } case 303: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3265 + //line php7/php7.y:3266 { yyVAL.node = assign.NewPow(yyDollar[1].node, yyDollar[3].node) @@ -5712,7 +5713,7 @@ yydefault: } case 304: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3279 + //line php7/php7.y:3280 { yyVAL.node = assign.NewDiv(yyDollar[1].node, yyDollar[3].node) @@ -5728,7 +5729,7 @@ yydefault: } case 305: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3293 + //line php7/php7.y:3294 { yyVAL.node = assign.NewConcat(yyDollar[1].node, yyDollar[3].node) @@ -5744,7 +5745,7 @@ yydefault: } case 306: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3307 + //line php7/php7.y:3308 { yyVAL.node = assign.NewMod(yyDollar[1].node, yyDollar[3].node) @@ -5760,7 +5761,7 @@ yydefault: } case 307: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3321 + //line php7/php7.y:3322 { yyVAL.node = assign.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) @@ -5776,7 +5777,7 @@ yydefault: } case 308: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3335 + //line php7/php7.y:3336 { yyVAL.node = assign.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) @@ -5792,7 +5793,7 @@ yydefault: } case 309: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3349 + //line php7/php7.y:3350 { yyVAL.node = assign.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) @@ -5808,7 +5809,7 @@ yydefault: } case 310: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3363 + //line php7/php7.y:3364 { yyVAL.node = assign.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) @@ -5824,7 +5825,7 @@ yydefault: } case 311: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3377 + //line php7/php7.y:3378 { yyVAL.node = assign.NewShiftRight(yyDollar[1].node, yyDollar[3].node) @@ -5840,7 +5841,7 @@ yydefault: } case 312: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3391 + //line php7/php7.y:3392 { yyVAL.node = expr.NewPostInc(yyDollar[1].node) @@ -5856,7 +5857,7 @@ yydefault: } case 313: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3405 + //line php7/php7.y:3406 { yyVAL.node = expr.NewPreInc(yyDollar[2].node) @@ -5870,7 +5871,7 @@ yydefault: } case 314: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3417 + //line php7/php7.y:3418 { yyVAL.node = expr.NewPostDec(yyDollar[1].node) @@ -5886,7 +5887,7 @@ yydefault: } case 315: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3431 + //line php7/php7.y:3432 { yyVAL.node = expr.NewPreDec(yyDollar[2].node) @@ -5900,7 +5901,7 @@ yydefault: } case 316: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3443 + //line php7/php7.y:3444 { yyVAL.node = binary.NewBooleanOr(yyDollar[1].node, yyDollar[3].node) @@ -5916,7 +5917,7 @@ yydefault: } case 317: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3457 + //line php7/php7.y:3458 { yyVAL.node = binary.NewBooleanAnd(yyDollar[1].node, yyDollar[3].node) @@ -5932,7 +5933,7 @@ yydefault: } case 318: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3471 + //line php7/php7.y:3472 { yyVAL.node = binary.NewLogicalOr(yyDollar[1].node, yyDollar[3].node) @@ -5948,7 +5949,7 @@ yydefault: } case 319: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3485 + //line php7/php7.y:3486 { yyVAL.node = binary.NewLogicalAnd(yyDollar[1].node, yyDollar[3].node) @@ -5964,7 +5965,7 @@ yydefault: } case 320: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3499 + //line php7/php7.y:3500 { yyVAL.node = binary.NewLogicalXor(yyDollar[1].node, yyDollar[3].node) @@ -5980,7 +5981,7 @@ yydefault: } case 321: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3513 + //line php7/php7.y:3514 { yyVAL.node = binary.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) @@ -5996,7 +5997,7 @@ yydefault: } case 322: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3527 + //line php7/php7.y:3528 { yyVAL.node = binary.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) @@ -6012,7 +6013,7 @@ yydefault: } case 323: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3541 + //line php7/php7.y:3542 { yyVAL.node = binary.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) @@ -6028,7 +6029,7 @@ yydefault: } case 324: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3555 + //line php7/php7.y:3556 { yyVAL.node = binary.NewConcat(yyDollar[1].node, yyDollar[3].node) @@ -6044,7 +6045,7 @@ yydefault: } case 325: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3569 + //line php7/php7.y:3570 { yyVAL.node = binary.NewPlus(yyDollar[1].node, yyDollar[3].node) @@ -6060,7 +6061,7 @@ yydefault: } case 326: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3583 + //line php7/php7.y:3584 { yyVAL.node = binary.NewMinus(yyDollar[1].node, yyDollar[3].node) @@ -6076,7 +6077,7 @@ yydefault: } case 327: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3597 + //line php7/php7.y:3598 { yyVAL.node = binary.NewMul(yyDollar[1].node, yyDollar[3].node) @@ -6092,7 +6093,7 @@ yydefault: } case 328: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3611 + //line php7/php7.y:3612 { yyVAL.node = binary.NewPow(yyDollar[1].node, yyDollar[3].node) @@ -6108,7 +6109,7 @@ yydefault: } case 329: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3625 + //line php7/php7.y:3626 { yyVAL.node = binary.NewDiv(yyDollar[1].node, yyDollar[3].node) @@ -6124,7 +6125,7 @@ yydefault: } case 330: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3639 + //line php7/php7.y:3640 { yyVAL.node = binary.NewMod(yyDollar[1].node, yyDollar[3].node) @@ -6140,7 +6141,7 @@ yydefault: } case 331: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3653 + //line php7/php7.y:3654 { yyVAL.node = binary.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) @@ -6156,7 +6157,7 @@ yydefault: } case 332: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3667 + //line php7/php7.y:3668 { yyVAL.node = binary.NewShiftRight(yyDollar[1].node, yyDollar[3].node) @@ -6172,7 +6173,7 @@ yydefault: } case 333: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3681 + //line php7/php7.y:3682 { yyVAL.node = expr.NewUnaryPlus(yyDollar[2].node) @@ -6186,7 +6187,7 @@ yydefault: } case 334: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3693 + //line php7/php7.y:3694 { yyVAL.node = expr.NewUnaryMinus(yyDollar[2].node) @@ -6200,7 +6201,7 @@ yydefault: } case 335: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3705 + //line php7/php7.y:3706 { yyVAL.node = expr.NewBooleanNot(yyDollar[2].node) @@ -6214,7 +6215,7 @@ yydefault: } case 336: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3717 + //line php7/php7.y:3718 { yyVAL.node = expr.NewBitwiseNot(yyDollar[2].node) @@ -6228,7 +6229,7 @@ yydefault: } case 337: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3729 + //line php7/php7.y:3730 { yyVAL.node = binary.NewIdentical(yyDollar[1].node, yyDollar[3].node) @@ -6244,7 +6245,7 @@ yydefault: } case 338: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3743 + //line php7/php7.y:3744 { yyVAL.node = binary.NewNotIdentical(yyDollar[1].node, yyDollar[3].node) @@ -6260,7 +6261,7 @@ yydefault: } case 339: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3757 + //line php7/php7.y:3758 { yyVAL.node = binary.NewEqual(yyDollar[1].node, yyDollar[3].node) @@ -6276,7 +6277,7 @@ yydefault: } case 340: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3771 + //line php7/php7.y:3772 { yyVAL.node = binary.NewNotEqual(yyDollar[1].node, yyDollar[3].node) @@ -6293,7 +6294,7 @@ yydefault: } case 341: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3786 + //line php7/php7.y:3787 { yyVAL.node = binary.NewSmaller(yyDollar[1].node, yyDollar[3].node) @@ -6309,7 +6310,7 @@ yydefault: } case 342: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3800 + //line php7/php7.y:3801 { yyVAL.node = binary.NewSmallerOrEqual(yyDollar[1].node, yyDollar[3].node) @@ -6325,7 +6326,7 @@ yydefault: } case 343: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3814 + //line php7/php7.y:3815 { yyVAL.node = binary.NewGreater(yyDollar[1].node, yyDollar[3].node) @@ -6341,7 +6342,7 @@ yydefault: } case 344: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3828 + //line php7/php7.y:3829 { yyVAL.node = binary.NewGreaterOrEqual(yyDollar[1].node, yyDollar[3].node) @@ -6357,7 +6358,7 @@ yydefault: } case 345: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3842 + //line php7/php7.y:3843 { yyVAL.node = binary.NewSpaceship(yyDollar[1].node, yyDollar[3].node) @@ -6373,7 +6374,7 @@ yydefault: } case 346: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3856 + //line php7/php7.y:3857 { yyVAL.node = expr.NewInstanceOf(yyDollar[1].node, yyDollar[3].node) @@ -6389,7 +6390,7 @@ yydefault: } case 347: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3870 + //line php7/php7.y:3871 { yyVAL.node = yyDollar[2].node @@ -6403,7 +6404,7 @@ yydefault: } case 348: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3882 + //line php7/php7.y:3883 { yyVAL.node = yyDollar[1].node @@ -6411,7 +6412,7 @@ yydefault: } case 349: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:3888 + //line php7/php7.y:3889 { yyVAL.node = expr.NewTernary(yyDollar[1].node, yyDollar[3].node, yyDollar[5].node) @@ -6428,7 +6429,7 @@ yydefault: } case 350: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3903 + //line php7/php7.y:3904 { yyVAL.node = expr.NewTernary(yyDollar[1].node, nil, yyDollar[4].node) @@ -6445,7 +6446,7 @@ yydefault: } case 351: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3918 + //line php7/php7.y:3919 { yyVAL.node = binary.NewCoalesce(yyDollar[1].node, yyDollar[3].node) @@ -6461,7 +6462,7 @@ yydefault: } case 352: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3932 + //line php7/php7.y:3933 { yyVAL.node = yyDollar[1].node @@ -6469,7 +6470,7 @@ yydefault: } case 353: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3938 + //line php7/php7.y:3939 { yyVAL.node = cast.NewInt(yyDollar[2].node) @@ -6484,7 +6485,7 @@ yydefault: } case 354: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3951 + //line php7/php7.y:3952 { yyVAL.node = cast.NewDouble(yyDollar[2].node) @@ -6499,7 +6500,7 @@ yydefault: } case 355: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3964 + //line php7/php7.y:3965 { yyVAL.node = cast.NewString(yyDollar[2].node) @@ -6514,7 +6515,7 @@ yydefault: } case 356: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3977 + //line php7/php7.y:3978 { yyVAL.node = cast.NewArray(yyDollar[2].node) @@ -6529,7 +6530,7 @@ yydefault: } case 357: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3990 + //line php7/php7.y:3991 { yyVAL.node = cast.NewObject(yyDollar[2].node) @@ -6544,7 +6545,7 @@ yydefault: } case 358: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4003 + //line php7/php7.y:4004 { yyVAL.node = cast.NewBool(yyDollar[2].node) @@ -6559,7 +6560,7 @@ yydefault: } case 359: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4016 + //line php7/php7.y:4017 { yyVAL.node = cast.NewUnset(yyDollar[2].node) @@ -6574,7 +6575,7 @@ yydefault: } case 360: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4029 + //line php7/php7.y:4030 { var e *expr.Exit if yyDollar[2].node != nil { @@ -6603,7 +6604,7 @@ yydefault: } case 361: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4056 + //line php7/php7.y:4057 { yyVAL.node = expr.NewErrorSuppress(yyDollar[2].node) @@ -6617,7 +6618,7 @@ yydefault: } case 362: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4068 + //line php7/php7.y:4069 { yyVAL.node = yyDollar[1].node @@ -6625,7 +6626,7 @@ yydefault: } case 363: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4074 + //line php7/php7.y:4075 { yyVAL.node = expr.NewShellExec(yyDollar[2].list) @@ -6639,7 +6640,7 @@ yydefault: } case 364: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4086 + //line php7/php7.y:4087 { yyVAL.node = expr.NewPrint(yyDollar[2].node) @@ -6653,7 +6654,7 @@ yydefault: } case 365: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4098 + //line php7/php7.y:4099 { yyVAL.node = expr.NewYield(nil, nil) @@ -6667,7 +6668,7 @@ yydefault: } case 366: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4110 + //line php7/php7.y:4111 { yyVAL.node = expr.NewYield(nil, yyDollar[2].node) @@ -6681,7 +6682,7 @@ yydefault: } case 367: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4122 + //line php7/php7.y:4123 { yyVAL.node = expr.NewYield(yyDollar[2].node, yyDollar[4].node) @@ -6696,7 +6697,7 @@ yydefault: } case 368: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4135 + //line php7/php7.y:4136 { yyVAL.node = expr.NewYieldFrom(yyDollar[2].node) @@ -6710,7 +6711,7 @@ yydefault: } case 369: yyDollar = yyS[yypt-11 : yypt+1] - //line php7/php7.y:4147 + //line php7/php7.y:4148 { yyVAL.node = expr.NewClosure(yyDollar[5].list, yyDollar[7].ClosureUse, yyDollar[8].node, yyDollar[10].list, false, yyDollar[2].token != nil, yyDollar[3].str) @@ -6731,7 +6732,7 @@ yydefault: } case 370: yyDollar = yyS[yypt-12 : yypt+1] - //line php7/php7.y:4166 + //line php7/php7.y:4167 { yyVAL.node = expr.NewClosure(yyDollar[6].list, yyDollar[8].ClosureUse, yyDollar[9].node, yyDollar[11].list, true, yyDollar[3].token != nil, yyDollar[4].str) @@ -6753,7 +6754,7 @@ yydefault: } case 371: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4189 + //line php7/php7.y:4190 { yyVAL.str = yylex.(*Parser).PhpDocComment yylex.(*Parser).PhpDocComment = "" @@ -6762,19 +6763,19 @@ yydefault: } case 372: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4199 + //line php7/php7.y:4200 { yyVAL.token = nil } case 373: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4203 + //line php7/php7.y:4204 { yyVAL.token = yyDollar[1].token } case 374: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4210 + //line php7/php7.y:4211 { yyVAL.ClosureUse = nil @@ -6782,7 +6783,7 @@ yydefault: } case 375: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4216 + //line php7/php7.y:4217 { yyVAL.ClosureUse = expr.NewClosureUse(yyDollar[3].list) @@ -6798,7 +6799,7 @@ yydefault: } case 376: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4233 + //line php7/php7.y:4234 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -6809,7 +6810,7 @@ yydefault: } case 377: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4242 + //line php7/php7.y:4243 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -6817,7 +6818,7 @@ yydefault: } case 378: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4251 + //line php7/php7.y:4252 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(identifier) @@ -6834,7 +6835,7 @@ yydefault: } case 379: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4266 + //line php7/php7.y:4267 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[2].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -6854,7 +6855,7 @@ yydefault: } case 380: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4287 + //line php7/php7.y:4288 { yyVAL.node = expr.NewFunctionCall(yyDollar[1].node, yyDollar[2].node.(*node.ArgumentList)) @@ -6868,7 +6869,7 @@ yydefault: } case 381: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4299 + //line php7/php7.y:4300 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -6883,7 +6884,7 @@ yydefault: } case 382: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4312 + //line php7/php7.y:4313 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -6898,7 +6899,7 @@ yydefault: } case 383: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4325 + //line php7/php7.y:4326 { yyVAL.node = expr.NewFunctionCall(yyDollar[1].node, yyDollar[2].node.(*node.ArgumentList)) @@ -6910,7 +6911,7 @@ yydefault: } case 384: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4338 + //line php7/php7.y:4339 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -6924,7 +6925,7 @@ yydefault: } case 385: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4350 + //line php7/php7.y:4351 { yyVAL.node = yyDollar[1].node @@ -6932,7 +6933,7 @@ yydefault: } case 386: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4359 + //line php7/php7.y:4360 { yyVAL.node = yyDollar[1].node @@ -6940,7 +6941,7 @@ yydefault: } case 387: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4365 + //line php7/php7.y:4366 { yyVAL.node = yyDollar[1].node @@ -6948,7 +6949,7 @@ yydefault: } case 388: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4374 + //line php7/php7.y:4375 { yyVAL.node = nil @@ -6956,7 +6957,7 @@ yydefault: } case 389: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4380 + //line php7/php7.y:4381 { yyVAL.node = expr.NewExit(yyDollar[2].node) @@ -6973,7 +6974,7 @@ yydefault: } case 390: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4398 + //line php7/php7.y:4399 { yyVAL.list = []node.Node{} @@ -6981,7 +6982,7 @@ yydefault: } case 391: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4404 + //line php7/php7.y:4405 { yyVAL.list = []node.Node{scalar.NewEncapsedStringPart(yyDollar[1].token.Value)} @@ -6989,7 +6990,7 @@ yydefault: } case 392: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4410 + //line php7/php7.y:4411 { yyVAL.list = yyDollar[1].list @@ -6997,7 +6998,7 @@ yydefault: } case 393: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4419 + //line php7/php7.y:4420 { yyVAL.node = nil @@ -7005,7 +7006,7 @@ yydefault: } case 394: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4425 + //line php7/php7.y:4426 { yyVAL.node = yyDollar[1].node @@ -7013,7 +7014,7 @@ yydefault: } case 395: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4434 + //line php7/php7.y:4435 { yyVAL.node = expr.NewArray(yyDollar[3].list) @@ -7029,7 +7030,7 @@ yydefault: } case 396: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4448 + //line php7/php7.y:4449 { yyVAL.node = expr.NewShortArray(yyDollar[2].list) @@ -7044,7 +7045,7 @@ yydefault: } case 397: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4461 + //line php7/php7.y:4462 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) @@ -7058,7 +7059,7 @@ yydefault: } case 398: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4476 + //line php7/php7.y:4477 { yyVAL.node = scalar.NewLnumber(yyDollar[1].token.Value) @@ -7072,7 +7073,7 @@ yydefault: } case 399: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4488 + //line php7/php7.y:4489 { yyVAL.node = scalar.NewDnumber(yyDollar[1].token.Value) @@ -7086,7 +7087,7 @@ yydefault: } case 400: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4500 + //line php7/php7.y:4501 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7100,7 +7101,7 @@ yydefault: } case 401: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4512 + //line php7/php7.y:4513 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7114,7 +7115,7 @@ yydefault: } case 402: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4524 + //line php7/php7.y:4525 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7128,7 +7129,7 @@ yydefault: } case 403: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4536 + //line php7/php7.y:4537 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7142,7 +7143,7 @@ yydefault: } case 404: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4548 + //line php7/php7.y:4549 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7156,7 +7157,7 @@ yydefault: } case 405: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4560 + //line php7/php7.y:4561 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7170,7 +7171,7 @@ yydefault: } case 406: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4572 + //line php7/php7.y:4573 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7184,7 +7185,7 @@ yydefault: } case 407: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4584 + //line php7/php7.y:4585 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7198,7 +7199,7 @@ yydefault: } case 408: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4596 + //line php7/php7.y:4597 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, []node.Node{encapsed}) @@ -7214,7 +7215,7 @@ yydefault: } case 409: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4610 + //line php7/php7.y:4611 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, nil) @@ -7228,7 +7229,7 @@ yydefault: } case 410: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4622 + //line php7/php7.y:4623 { yyVAL.node = scalar.NewEncapsed(yyDollar[2].list) @@ -7242,7 +7243,7 @@ yydefault: } case 411: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4634 + //line php7/php7.y:4635 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, yyDollar[2].list) @@ -7256,7 +7257,7 @@ yydefault: } case 412: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4646 + //line php7/php7.y:4647 { yyVAL.node = yyDollar[1].node @@ -7264,7 +7265,7 @@ yydefault: } case 413: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4652 + //line php7/php7.y:4653 { yyVAL.node = yyDollar[1].node @@ -7272,7 +7273,7 @@ yydefault: } case 414: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4661 + //line php7/php7.y:4662 { yyVAL.node = expr.NewConstFetch(yyDollar[1].node) @@ -7286,7 +7287,7 @@ yydefault: } case 415: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4673 + //line php7/php7.y:4674 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -7305,7 +7306,7 @@ yydefault: } case 416: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4690 + //line php7/php7.y:4691 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -7324,7 +7325,7 @@ yydefault: } case 417: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4710 + //line php7/php7.y:4711 { yyVAL.node = yyDollar[1].node @@ -7332,7 +7333,7 @@ yydefault: } case 418: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4716 + //line php7/php7.y:4717 { yyVAL.node = yyDollar[1].node @@ -7340,7 +7341,7 @@ yydefault: } case 419: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4725 + //line php7/php7.y:4726 { yyVAL.node = nil @@ -7348,7 +7349,7 @@ yydefault: } case 420: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4731 + //line php7/php7.y:4732 { yyVAL.node = yyDollar[1].node @@ -7356,7 +7357,7 @@ yydefault: } case 421: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4740 + //line php7/php7.y:4741 { yyVAL.node = yyDollar[1].node @@ -7364,7 +7365,7 @@ yydefault: } case 422: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4749 + //line php7/php7.y:4750 { yyVAL.node = yyDollar[1].node @@ -7372,7 +7373,7 @@ yydefault: } case 423: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4755 + //line php7/php7.y:4756 { yyVAL.node = yyDollar[2].node @@ -7386,7 +7387,7 @@ yydefault: } case 424: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4767 + //line php7/php7.y:4768 { yyVAL.node = yyDollar[1].node @@ -7394,7 +7395,7 @@ yydefault: } case 425: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4776 + //line php7/php7.y:4777 { yyVAL.node = yyDollar[1].node @@ -7402,7 +7403,7 @@ yydefault: } case 426: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4782 + //line php7/php7.y:4783 { yyVAL.node = yyDollar[2].node @@ -7416,7 +7417,7 @@ yydefault: } case 427: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4794 + //line php7/php7.y:4795 { yyVAL.node = yyDollar[1].node @@ -7424,7 +7425,7 @@ yydefault: } case 428: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4803 + //line php7/php7.y:4804 { yyVAL.node = yyDollar[1].node @@ -7432,7 +7433,7 @@ yydefault: } case 429: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4809 + //line php7/php7.y:4810 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -7451,7 +7452,7 @@ yydefault: } case 430: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4826 + //line php7/php7.y:4827 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -7470,7 +7471,7 @@ yydefault: } case 431: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4843 + //line php7/php7.y:4844 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -7489,7 +7490,7 @@ yydefault: } case 432: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4860 + //line php7/php7.y:4861 { yyVAL.node = expr.NewMethodCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -7505,7 +7506,7 @@ yydefault: } case 433: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4874 + //line php7/php7.y:4875 { yyVAL.node = yyDollar[1].node @@ -7513,7 +7514,7 @@ yydefault: } case 434: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4883 + //line php7/php7.y:4884 { yyVAL.node = yyDollar[1].node @@ -7521,7 +7522,7 @@ yydefault: } case 435: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4889 + //line php7/php7.y:4890 { yyVAL.node = yyDollar[1].node @@ -7529,7 +7530,7 @@ yydefault: } case 436: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4895 + //line php7/php7.y:4896 { yyVAL.node = expr.NewPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -7545,7 +7546,7 @@ yydefault: } case 437: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4912 + //line php7/php7.y:4913 { name := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(name) @@ -7562,7 +7563,7 @@ yydefault: } case 438: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4927 + //line php7/php7.y:4928 { yyVAL.node = expr.NewVariable(yyDollar[3].node) @@ -7581,7 +7582,7 @@ yydefault: } case 439: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4944 + //line php7/php7.y:4945 { yyVAL.node = expr.NewVariable(yyDollar[2].node) @@ -7596,7 +7597,7 @@ yydefault: } case 440: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4960 + //line php7/php7.y:4961 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -7612,7 +7613,7 @@ yydefault: } case 441: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4974 + //line php7/php7.y:4975 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -7628,7 +7629,7 @@ yydefault: } case 442: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4991 + //line php7/php7.y:4992 { yyVAL.node = yyDollar[1].node @@ -7636,7 +7637,7 @@ yydefault: } case 443: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4997 + //line php7/php7.y:4998 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -7655,7 +7656,7 @@ yydefault: } case 444: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:5014 + //line php7/php7.y:5015 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -7674,7 +7675,7 @@ yydefault: } case 445: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5031 + //line php7/php7.y:5032 { yyVAL.node = expr.NewPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -7690,7 +7691,7 @@ yydefault: } case 446: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5045 + //line php7/php7.y:5046 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -7706,7 +7707,7 @@ yydefault: } case 447: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5059 + //line php7/php7.y:5060 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -7722,7 +7723,7 @@ yydefault: } case 448: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5076 + //line php7/php7.y:5077 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -7736,7 +7737,7 @@ yydefault: } case 449: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5088 + //line php7/php7.y:5089 { yyVAL.node = yyDollar[2].node @@ -7750,7 +7751,7 @@ yydefault: } case 450: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5100 + //line php7/php7.y:5101 { yyVAL.node = yyDollar[1].node @@ -7758,7 +7759,7 @@ yydefault: } case 451: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5109 + //line php7/php7.y:5110 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -7772,7 +7773,7 @@ yydefault: } case 452: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5121 + //line php7/php7.y:5122 { yyVAL.node = yyDollar[2].node @@ -7786,7 +7787,7 @@ yydefault: } case 453: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5133 + //line php7/php7.y:5134 { yyVAL.node = yyDollar[1].node @@ -7794,7 +7795,7 @@ yydefault: } case 454: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5142 + //line php7/php7.y:5143 { yyVAL.list = yyDollar[1].list @@ -7802,7 +7803,7 @@ yydefault: } case 455: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:5151 + //line php7/php7.y:5152 { yyVAL.node = expr.NewArrayItem(nil, nil) @@ -7810,7 +7811,7 @@ yydefault: } case 456: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5157 + //line php7/php7.y:5158 { yyVAL.node = yyDollar[1].node @@ -7818,7 +7819,7 @@ yydefault: } case 457: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5166 + //line php7/php7.y:5167 { if len(yyDollar[1].list) == 0 { yyDollar[1].list = []node.Node{expr.NewArrayItem(nil, nil)} @@ -7833,7 +7834,7 @@ yydefault: } case 458: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5179 + //line php7/php7.y:5180 { if yyDollar[1].node.(*expr.ArrayItem).Key == nil && yyDollar[1].node.(*expr.ArrayItem).Val == nil { yyVAL.list = []node.Node{} @@ -7845,7 +7846,7 @@ yydefault: } case 459: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5192 + //line php7/php7.y:5193 { yyVAL.node = expr.NewArrayItem(yyDollar[1].node, yyDollar[3].node) @@ -7861,7 +7862,7 @@ yydefault: } case 460: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5206 + //line php7/php7.y:5207 { yyVAL.node = expr.NewArrayItem(nil, yyDollar[1].node) @@ -7874,7 +7875,7 @@ yydefault: } case 461: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:5217 + //line php7/php7.y:5218 { reference := expr.NewReference(yyDollar[4].node) yyVAL.node = expr.NewArrayItem(yyDollar[1].node, reference) @@ -7893,7 +7894,7 @@ yydefault: } case 462: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5234 + //line php7/php7.y:5235 { reference := expr.NewReference(yyDollar[2].node) yyVAL.node = expr.NewArrayItem(nil, reference) @@ -7909,7 +7910,7 @@ yydefault: } case 463: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:5248 + //line php7/php7.y:5249 { // TODO: Cannot use list() as standalone expression list := expr.NewList(yyDollar[5].list) @@ -7931,7 +7932,7 @@ yydefault: } case 464: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:5268 + //line php7/php7.y:5269 { // TODO: Cannot use list() as standalone expression list := expr.NewList(yyDollar[3].list) @@ -7950,7 +7951,7 @@ yydefault: } case 465: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5288 + //line php7/php7.y:5289 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -7958,7 +7959,7 @@ yydefault: } case 466: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5294 + //line php7/php7.y:5295 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yyVAL.list = append(yyDollar[1].list, encapsed) @@ -7973,7 +7974,7 @@ yydefault: } case 467: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5307 + //line php7/php7.y:5308 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -7981,7 +7982,7 @@ yydefault: } case 468: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5313 + //line php7/php7.y:5314 { encapsed := scalar.NewEncapsedStringPart(yyDollar[1].token.Value) yyVAL.list = []node.Node{encapsed, yyDollar[2].node} @@ -7996,7 +7997,7 @@ yydefault: } case 469: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5329 + //line php7/php7.y:5330 { name := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(name) @@ -8013,7 +8014,7 @@ yydefault: } case 470: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:5344 + //line php7/php7.y:5345 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -8035,7 +8036,7 @@ yydefault: } case 471: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5364 + //line php7/php7.y:5365 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -8057,7 +8058,7 @@ yydefault: } case 472: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5384 + //line php7/php7.y:5385 { variable := expr.NewVariable(yyDollar[2].node) @@ -8075,7 +8076,7 @@ yydefault: } case 473: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5400 + //line php7/php7.y:5401 { name := node.NewIdentifier(yyDollar[2].token.Value) variable := expr.NewVariable(name) @@ -8096,7 +8097,7 @@ yydefault: } case 474: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:5419 + //line php7/php7.y:5420 { identifier := node.NewIdentifier(yyDollar[2].token.Value) variable := expr.NewVariable(identifier) @@ -8120,7 +8121,7 @@ yydefault: } case 475: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5441 + //line php7/php7.y:5442 { yyVAL.node = yyDollar[2].node @@ -8133,7 +8134,7 @@ yydefault: } case 476: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5455 + //line php7/php7.y:5456 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) @@ -8147,7 +8148,7 @@ yydefault: } case 477: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5467 + //line php7/php7.y:5468 { // TODO: add option to handle 64 bit integer if _, err := strconv.Atoi(yyDollar[1].token.Value); err == nil { @@ -8166,7 +8167,7 @@ yydefault: } case 478: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5484 + //line php7/php7.y:5485 { var lnumber *scalar.Lnumber // TODO: add option to handle 64 bit integer @@ -8194,7 +8195,7 @@ yydefault: } case 479: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5510 + //line php7/php7.y:5511 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(identifier) @@ -8211,7 +8212,7 @@ yydefault: } case 480: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:5528 + //line php7/php7.y:5529 { yyVAL.node = expr.NewIsset(yyDollar[3].list) @@ -8231,7 +8232,7 @@ yydefault: } case 481: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:5546 + //line php7/php7.y:5547 { yyVAL.node = expr.NewEmpty(yyDollar[3].node) @@ -8247,7 +8248,7 @@ yydefault: } case 482: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5560 + //line php7/php7.y:5561 { yyVAL.node = expr.NewInclude(yyDollar[2].node) @@ -8261,7 +8262,7 @@ yydefault: } case 483: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5572 + //line php7/php7.y:5573 { yyVAL.node = expr.NewIncludeOnce(yyDollar[2].node) @@ -8275,7 +8276,7 @@ yydefault: } case 484: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:5584 + //line php7/php7.y:5585 { yyVAL.node = expr.NewEval(yyDollar[3].node) @@ -8291,7 +8292,7 @@ yydefault: } case 485: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5598 + //line php7/php7.y:5599 { yyVAL.node = expr.NewRequire(yyDollar[2].node) @@ -8305,7 +8306,7 @@ yydefault: } case 486: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5610 + //line php7/php7.y:5611 { yyVAL.node = expr.NewRequireOnce(yyDollar[2].node) @@ -8319,7 +8320,7 @@ yydefault: } case 487: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5625 + //line php7/php7.y:5626 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -8327,7 +8328,7 @@ yydefault: } case 488: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5631 + //line php7/php7.y:5632 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -8338,7 +8339,7 @@ yydefault: } case 489: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5643 + //line php7/php7.y:5644 { yyVAL.node = yyDollar[1].node diff --git a/php7/php7.y b/php7/php7.y index cb3cb14..47f0a59 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -661,8 +661,9 @@ group_use_declaration: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $7)) // save comments - $1.Meta.SetTokenName(meta.UseLeadingNsSeparatorToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $1, meta.UseLeadingNsSeparatorToken) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) + yylex.(*Parser).appendMetaToken(name, $1, meta.NodeStart) + $2[0].GetMeta().Cut(newInheritMetaFilter()).AppendTo(name.GetMeta()) $3.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo($$.GetMeta()) $4.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) if $6 != nil { @@ -671,8 +672,6 @@ group_use_declaration: } $7.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) - $2[0].GetMeta().Cut(newInheritMetaFilter()).PrependTo(name.GetMeta()) - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -710,8 +709,9 @@ mixed_group_use_declaration: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $7)) // save comments - $1.Meta.SetTokenName(meta.UseLeadingNsSeparatorToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $1, meta.UseLeadingNsSeparatorToken) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) + yylex.(*Parser).appendMetaToken(name, $1, meta.NodeStart) + $2[0].GetMeta().Cut(newInheritMetaFilter()).AppendTo(name.GetMeta()) $3.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo($$.GetMeta()) $4.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) if $6 != nil { @@ -861,6 +861,7 @@ use_declaration: // save comments $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) + $2.(*stmt.Use).Use.GetMeta().Cut(newInheritMetaFilter()).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } From 28e5540108f138842942e3f28d98b99f47360b6e Mon Sep 17 00:00:00 2001 From: z7zmey Date: Wed, 2 Jan 2019 23:22:28 +0200 Subject: [PATCH 106/117] #70: [php5] inherit meta.Data at stmt.Use --- php5/parser.go | 12 + php5/php5.go | 1047 ++++++++++++++++++++++++------------------------ php5/php5.y | 43 +- 3 files changed, 575 insertions(+), 527 deletions(-) diff --git a/php5/parser.go b/php5/parser.go index c08eda8..e3c4802 100644 --- a/php5/parser.go +++ b/php5/parser.go @@ -113,6 +113,18 @@ func isDollar(r rune) bool { return r == '$' } +func newInheritMetaFilter() meta.Filter { + return meta.StopOnFailureFilter( + meta.AndFilter( + meta.TokenNameFilter(meta.NodeStart), + meta.OrFilter( + meta.TypeFilter(meta.CommentType, meta.WhiteSpaceType), + meta.ValueFilter(" Date: Wed, 2 Jan 2019 23:23:21 +0200 Subject: [PATCH 107/117] #70: remove constant UseLeadingNsSeparatorToken --- meta/tokenName.go | 1 - meta/tokenName_string.go | 4 ++-- printer/printer.go | 3 --- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/meta/tokenName.go b/meta/tokenName.go index e1018d1..348a203 100644 --- a/meta/tokenName.go +++ b/meta/tokenName.go @@ -24,7 +24,6 @@ const ( ImplementsToken DoubleArrowToken PaamayimNekudotayimToken - UseLeadingNsSeparatorToken NsSeparatorToken EllipsisToken LogicalOrToken diff --git a/meta/tokenName_string.go b/meta/tokenName_string.go index 10d56de..6eebadc 100644 --- a/meta/tokenName_string.go +++ b/meta/tokenName_string.go @@ -4,9 +4,9 @@ package meta import "strconv" -const _TokenName_name = "NodeStartNodeEndWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenEndforTokenEndforeachTokenEnddeclareTokenAsTokenEndswitchTokenFunctionTokenConstTokenInsteadofTokenClassTokenExtendsTokenImplementsTokenDoubleArrowTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenEndifTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" +const _TokenName_name = "NodeStartNodeEndWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenEndforTokenEndforeachTokenEnddeclareTokenAsTokenEndswitchTokenFunctionTokenConstTokenInsteadofTokenClassTokenExtendsTokenImplementsTokenDoubleArrowTokenPaamayimNekudotayimTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenEndifTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" -var _TokenName_index = [...]uint16{0, 9, 16, 26, 39, 60, 81, 92, 107, 122, 129, 143, 156, 166, 180, 190, 202, 217, 233, 257, 283, 299, 312, 326, 341, 356, 371, 381, 389, 397, 416, 429, 443, 457, 472, 485, 498, 511, 527, 540, 553, 565, 578, 590, 602, 616, 631, 639, 646, 653, 669, 688, 700, 715, 736, 757, 775, 795, 816, 830, 840, 860, 881, 898, 916, 933, 947, 957, 966, 976, 992, 1002, 1012, 1025, 1035, 1047, 1056, 1068, 1076} +var _TokenName_index = [...]uint16{0, 9, 16, 26, 39, 60, 81, 92, 107, 122, 129, 143, 156, 166, 180, 190, 202, 217, 233, 257, 273, 286, 300, 315, 330, 345, 355, 363, 371, 390, 403, 417, 431, 446, 459, 472, 485, 501, 514, 527, 539, 552, 564, 576, 590, 605, 613, 620, 627, 643, 662, 674, 689, 710, 731, 749, 769, 790, 804, 814, 834, 855, 872, 890, 907, 921, 931, 940, 950, 966, 976, 986, 999, 1009, 1021, 1030, 1042, 1050} func (i TokenName) String() string { if i < 0 || i >= TokenName(len(_TokenName_index)-1) { diff --git a/printer/printer.go b/printer/printer.go index 24b2bbb..e6d701f 100644 --- a/printer/printer.go +++ b/printer/printer.go @@ -2293,7 +2293,6 @@ func (p *Printer) printStmtGroupUse(n node.Node) { p.Print(nn.UseType) } - p.printMeta(nn, meta.UseLeadingNsSeparatorToken) p.Print(nn.Prefix) p.printMeta(nn, meta.NsSeparatorToken) io.WriteString(p.w, "\\") @@ -2675,8 +2674,6 @@ func (p *Printer) printStmtUse(n node.Node) { p.Print(nn.UseType) } - p.printMeta(nn, meta.UseLeadingNsSeparatorToken) - p.Print(nn.Use) if nn.Alias != nil { From 1ee63c5e63b16addf4f3026fc3ed037a4efe47f8 Mon Sep 17 00:00:00 2001 From: z7zmey Date: Thu, 3 Jan 2019 19:02:58 +0200 Subject: [PATCH 108/117] #70: [php7] fix saving meta for *expr.NewArrayDimFetch at encaps_var --- php7/php7.go | 6 ++++-- php7/php7.y | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/php7/php7.go b/php7/php7.go index 18d76a6..57b32e7 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -1,3 +1,5 @@ +// Code generated by goyacc -o php7/php7.go php7/php7.y. DO NOT EDIT. + //line php7/php7.y:2 package php7 @@ -8028,9 +8030,9 @@ yydefault: // save comments yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yyDollar[2].token.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.OpenCurlyBracesToken) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.OpenSquareBracket) yyDollar[4].token.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.CloseCurlyBracesToken) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php7/php7.y b/php7/php7.y index 47f0a59..f1ecbed 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -5355,9 +5355,9 @@ encaps_var: // save comments yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) $2.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $2, meta.OpenCurlyBracesToken) + yylex.(*Parser).appendMetaToken($$, $2, meta.OpenSquareBracket) $4.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $4, meta.CloseCurlyBracesToken) + yylex.(*Parser).appendMetaToken($$, $4, meta.CloseSquareBracket) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } From d7ca55693f74ed2e1cd0cd3c54459595d3b4efb1 Mon Sep 17 00:00:00 2001 From: z7zmey Date: Thu, 3 Jan 2019 19:03:20 +0200 Subject: [PATCH 109/117] #70: [php5] inherit meta.Data --- php5/php5.go | 1262 ++++++++++++++++++++++++++++++-------------------- php5/php5.y | 340 ++++++++++++-- 2 files changed, 1054 insertions(+), 548 deletions(-) diff --git a/php5/php5.go b/php5/php5.go index 04a27a6..822ab09 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -1,3 +1,5 @@ +// Code generated by goyacc -o php5/php5.go php5/php5.y. DO NOT EDIT. + //line php5/php5.y:2 package php5 @@ -346,7 +348,7 @@ const yyEofCode = 1 const yyErrCode = 2 const yyInitialStackSize = 16 -//line php5/php5.y:7007 +//line php5/php5.y:7259 type simpleIndirectReference struct { all []*expr.Variable @@ -2864,7 +2866,7 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastConst.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(constant.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.EqualToken).AppendTo(constant.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -2885,7 +2887,7 @@ yydefault: // save comments yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(constant.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.EqualToken).AppendTo(constant.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -2979,7 +2981,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(label.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.ColonToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -3264,11 +3266,13 @@ yydefault: yyDollar[2].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.SemiColonToken) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 62: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1145 + //line php5/php5.y:1147 { yyVAL.node = stmt.NewGlobal(yyDollar[2].list) @@ -3284,7 +3288,7 @@ yydefault: } case 63: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1159 + //line php5/php5.y:1161 { yyVAL.node = stmt.NewStatic(yyDollar[2].list) @@ -3300,7 +3304,7 @@ yydefault: } case 64: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1173 + //line php5/php5.y:1175 { yyVAL.node = stmt.NewEcho(yyDollar[2].list) @@ -3317,7 +3321,7 @@ yydefault: } case 65: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1188 + //line php5/php5.y:1190 { yyVAL.node = stmt.NewInlineHtml(yyDollar[1].token.Value) @@ -3331,7 +3335,7 @@ yydefault: } case 66: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1200 + //line php5/php5.y:1202 { yyVAL.node = stmt.NewExpression(yyDollar[1].node) @@ -3342,11 +3346,13 @@ yydefault: yyDollar[2].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.SemiColonToken) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 67: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1213 + //line php5/php5.y:1217 { yyVAL.node = stmt.NewUnset(yyDollar[3].list) @@ -3364,7 +3370,7 @@ yydefault: } case 68: yyDollar = yyS[yypt-8 : yypt+1] - //line php5/php5.y:1229 + //line php5/php5.y:1233 { if yyDollar[6].node == nil { switch n := yyDollar[8].node.(type) { @@ -3406,7 +3412,7 @@ yydefault: } case 69: yyDollar = yyS[yypt-8 : yypt+1] - //line php5/php5.y:1269 + //line php5/php5.y:1273 { if yyDollar[6].node == nil { switch n := yyDollar[8].node.(type) { @@ -3448,7 +3454,7 @@ yydefault: } case 70: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1309 + //line php5/php5.y:1313 { yyVAL.node = yyDollar[5].node yyVAL.node.(*stmt.Declare).Consts = yyDollar[3].list @@ -3465,7 +3471,7 @@ yydefault: } case 71: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1324 + //line php5/php5.y:1328 { yyVAL.node = stmt.NewNop() @@ -3480,7 +3486,7 @@ yydefault: } case 72: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:1337 + //line php5/php5.y:1341 { yyVAL.node = stmt.NewTry(yyDollar[3].list, yyDollar[5].list, yyDollar[6].node) @@ -3500,7 +3506,7 @@ yydefault: } case 73: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1355 + //line php5/php5.y:1359 { yyVAL.node = stmt.NewThrow(yyDollar[2].node) @@ -3516,7 +3522,7 @@ yydefault: } case 74: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1369 + //line php5/php5.y:1373 { label := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewGoto(label) @@ -3535,7 +3541,7 @@ yydefault: } case 75: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1389 + //line php5/php5.y:1393 { yyVAL.list = []node.Node{} @@ -3543,7 +3549,7 @@ yydefault: } case 76: yyDollar = yyS[yypt-9 : yypt+1] - //line php5/php5.y:1395 + //line php5/php5.y:1399 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[4].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -3568,7 +3574,7 @@ yydefault: } case 77: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1421 + //line php5/php5.y:1425 { yyVAL.node = nil @@ -3576,7 +3582,7 @@ yydefault: } case 78: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1427 + //line php5/php5.y:1431 { yyVAL.node = stmt.NewFinally(yyDollar[3].list) @@ -3592,7 +3598,7 @@ yydefault: } case 79: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1444 + //line php5/php5.y:1448 { yyVAL.list = yyDollar[1].list @@ -3600,7 +3606,7 @@ yydefault: } case 80: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1450 + //line php5/php5.y:1454 { yyVAL.list = []node.Node{} @@ -3608,7 +3614,7 @@ yydefault: } case 81: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1459 + //line php5/php5.y:1463 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -3616,7 +3622,7 @@ yydefault: } case 82: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1465 + //line php5/php5.y:1469 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -3624,7 +3630,7 @@ yydefault: } case 83: yyDollar = yyS[yypt-8 : yypt+1] - //line php5/php5.y:1474 + //line php5/php5.y:1478 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[4].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -3648,7 +3654,7 @@ yydefault: } case 84: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1499 + //line php5/php5.y:1503 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -3656,7 +3662,7 @@ yydefault: } case 85: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1505 + //line php5/php5.y:1509 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -3667,7 +3673,7 @@ yydefault: } case 86: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1517 + //line php5/php5.y:1521 { yyVAL.node = yyDollar[1].node @@ -3675,7 +3681,7 @@ yydefault: } case 87: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1526 + //line php5/php5.y:1530 { yyVAL.node = yyDollar[1].node @@ -3683,7 +3689,7 @@ yydefault: } case 88: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1535 + //line php5/php5.y:1539 { yyVAL.node = yyDollar[1].node @@ -3691,31 +3697,31 @@ yydefault: } case 89: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1544 + //line php5/php5.y:1548 { yyVAL.token = nil } case 90: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1548 + //line php5/php5.y:1552 { yyVAL.token = yyDollar[1].token } case 91: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1555 + //line php5/php5.y:1559 { yyVAL.token = nil } case 92: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1559 + //line php5/php5.y:1563 { yyVAL.token = yyDollar[1].token } case 93: yyDollar = yyS[yypt-9 : yypt+1] - //line php5/php5.y:1566 + //line php5/php5.y:1570 { name := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewFunction(name, yyDollar[2].token != nil, yyDollar[5].list, nil, yyDollar[8].list, "") @@ -3739,7 +3745,7 @@ yydefault: } case 94: yyDollar = yyS[yypt-7 : yypt+1] - //line php5/php5.y:1591 + //line php5/php5.y:1595 { name := node.NewIdentifier(yyDollar[2].token.Value) switch n := yyDollar[1].node.(type) { @@ -3769,7 +3775,7 @@ yydefault: } case 95: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:1619 + //line php5/php5.y:1623 { name := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewInterface(name, yyDollar[3].InterfaceExtends, yyDollar[5].list, "") @@ -3788,7 +3794,7 @@ yydefault: } case 96: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1640 + //line php5/php5.y:1644 { yyVAL.node = stmt.NewClass(nil, nil, nil, nil, nil, nil, "") @@ -3796,13 +3802,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.ClassToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 97: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1652 + //line php5/php5.y:1656 { classModifier := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewClass(nil, []node.Node{classModifier}, nil, nil, nil, nil, "") @@ -3812,14 +3818,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(classModifier.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.ClassToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 98: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1667 + //line php5/php5.y:1671 { yyVAL.node = stmt.NewTrait(nil, nil, "") @@ -3833,7 +3839,7 @@ yydefault: } case 99: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1679 + //line php5/php5.y:1683 { classModifier := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewClass(nil, []node.Node{classModifier}, nil, nil, nil, nil, "") @@ -3843,14 +3849,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(classModifier.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.ClassToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 100: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1697 + //line php5/php5.y:1701 { yyVAL.ClassExtends = nil @@ -3858,7 +3864,7 @@ yydefault: } case 101: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1703 + //line php5/php5.y:1707 { yyVAL.ClassExtends = stmt.NewClassExtends(yyDollar[2].node) @@ -3872,13 +3878,13 @@ yydefault: } case 102: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1718 + //line php5/php5.y:1722 { yyVAL.token = yyDollar[1].token } case 103: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1725 + //line php5/php5.y:1729 { yyVAL.InterfaceExtends = nil @@ -3886,7 +3892,7 @@ yydefault: } case 104: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1731 + //line php5/php5.y:1735 { yyVAL.InterfaceExtends = stmt.NewInterfaceExtends(yyDollar[2].list) @@ -3900,7 +3906,7 @@ yydefault: } case 105: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1746 + //line php5/php5.y:1750 { yyVAL.ClassImplements = nil @@ -3908,7 +3914,7 @@ yydefault: } case 106: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1752 + //line php5/php5.y:1756 { yyVAL.ClassImplements = stmt.NewClassImplements(yyDollar[2].list) @@ -3922,7 +3928,7 @@ yydefault: } case 107: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1767 + //line php5/php5.y:1771 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -3930,7 +3936,7 @@ yydefault: } case 108: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1773 + //line php5/php5.y:1777 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -3941,7 +3947,7 @@ yydefault: } case 109: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1785 + //line php5/php5.y:1789 { yyVAL.node = nil @@ -3949,7 +3955,7 @@ yydefault: } case 110: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1791 + //line php5/php5.y:1795 { yyVAL.node = yyDollar[2].node @@ -3960,7 +3966,7 @@ yydefault: } case 111: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1803 + //line php5/php5.y:1807 { yyVAL.node = yyDollar[1].node @@ -3968,7 +3974,7 @@ yydefault: } case 112: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1809 + //line php5/php5.y:1813 { yyVAL.node = expr.NewReference(yyDollar[2].node) @@ -3982,7 +3988,7 @@ yydefault: } case 113: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1821 + //line php5/php5.y:1825 { yyVAL.node = expr.NewList(yyDollar[3].list) @@ -3998,7 +4004,7 @@ yydefault: } case 114: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1838 + //line php5/php5.y:1842 { yyVAL.node = stmt.NewFor(nil, nil, nil, yyDollar[1].node) @@ -4009,7 +4015,7 @@ yydefault: } case 115: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1847 + //line php5/php5.y:1851 { stmtList := stmt.NewStmtList(yyDollar[2].list) yyVAL.node = stmt.NewAltFor(nil, nil, nil, stmtList) @@ -4028,7 +4034,7 @@ yydefault: } case 116: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1867 + //line php5/php5.y:1871 { yyVAL.node = stmt.NewForeach(nil, nil, nil, yyDollar[1].node) @@ -4039,7 +4045,7 @@ yydefault: } case 117: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1876 + //line php5/php5.y:1880 { stmtList := stmt.NewStmtList(yyDollar[2].list) yyVAL.node = stmt.NewAltForeach(nil, nil, nil, stmtList) @@ -4058,7 +4064,7 @@ yydefault: } case 118: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1897 + //line php5/php5.y:1901 { yyVAL.node = stmt.NewDeclare(nil, yyDollar[1].node, false) @@ -4069,7 +4075,7 @@ yydefault: } case 119: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1906 + //line php5/php5.y:1910 { stmtList := stmt.NewStmtList(yyDollar[2].list) yyVAL.node = stmt.NewDeclare(nil, stmtList, true) @@ -4088,7 +4094,7 @@ yydefault: } case 120: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1927 + //line php5/php5.y:1931 { name := node.NewIdentifier(yyDollar[1].token.Value) constant := stmt.NewConstant(name, yyDollar[3].node, "") @@ -4099,14 +4105,14 @@ yydefault: constant.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(constant.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.EqualToken).AppendTo(constant.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 121: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1943 + //line php5/php5.y:1947 { name := node.NewIdentifier(yyDollar[3].token.Value) constant := stmt.NewConstant(name, yyDollar[5].node, "") @@ -4118,14 +4124,14 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(constant.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.EqualToken).AppendTo(constant.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 122: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1964 + //line php5/php5.y:1968 { caseList := stmt.NewCaseList(yyDollar[2].list) yyVAL.node = stmt.NewSwitch(nil, caseList) @@ -4142,7 +4148,7 @@ yydefault: } case 123: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1979 + //line php5/php5.y:1983 { caseList := stmt.NewCaseList(yyDollar[3].list) yyVAL.node = stmt.NewSwitch(nil, caseList) @@ -4161,7 +4167,7 @@ yydefault: } case 124: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1996 + //line php5/php5.y:2000 { caseList := stmt.NewCaseList(yyDollar[2].list) yyVAL.node = stmt.NewAltSwitch(nil, caseList) @@ -4180,7 +4186,7 @@ yydefault: } case 125: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:2013 + //line php5/php5.y:2017 { caseList := stmt.NewCaseList(yyDollar[3].list) @@ -4202,7 +4208,7 @@ yydefault: } case 126: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2037 + //line php5/php5.y:2041 { yyVAL.list = []node.Node{} @@ -4210,7 +4216,7 @@ yydefault: } case 127: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:2043 + //line php5/php5.y:2047 { _case := stmt.NewCase(yyDollar[3].node, yyDollar[5].list) yyVAL.list = append(yyDollar[1].list, _case) @@ -4227,7 +4233,7 @@ yydefault: } case 128: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2058 + //line php5/php5.y:2062 { _default := stmt.NewDefault(yyDollar[4].list) yyVAL.list = append(yyDollar[1].list, _default) @@ -4244,19 +4250,19 @@ yydefault: } case 129: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2077 + //line php5/php5.y:2081 { yyVAL.token = yyDollar[1].token } case 130: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2081 + //line php5/php5.y:2085 { yyVAL.token = yyDollar[1].token } case 131: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2089 + //line php5/php5.y:2093 { yyVAL.node = stmt.NewWhile(nil, yyDollar[1].node) @@ -4267,7 +4273,7 @@ yydefault: } case 132: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2098 + //line php5/php5.y:2102 { stmtList := stmt.NewStmtList(yyDollar[2].list) yyVAL.node = stmt.NewAltWhile(nil, stmtList) @@ -4286,7 +4292,7 @@ yydefault: } case 133: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2120 + //line php5/php5.y:2124 { yyVAL.list = nil @@ -4294,7 +4300,7 @@ yydefault: } case 134: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2126 + //line php5/php5.y:2130 { _elseIf := stmt.NewElseIf(yyDollar[3].node, yyDollar[4].node) yyVAL.list = append(yyDollar[1].list, _elseIf) @@ -4311,7 +4317,7 @@ yydefault: } case 135: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2145 + //line php5/php5.y:2149 { yyVAL.list = nil @@ -4319,7 +4325,7 @@ yydefault: } case 136: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:2151 + //line php5/php5.y:2155 { stmts := stmt.NewStmtList(yyDollar[5].list) _elseIf := stmt.NewAltElseIf(yyDollar[3].node, stmts) @@ -4339,7 +4345,7 @@ yydefault: } case 137: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2173 + //line php5/php5.y:2177 { yyVAL.node = nil @@ -4347,7 +4353,7 @@ yydefault: } case 138: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2179 + //line php5/php5.y:2183 { yyVAL.node = stmt.NewElse(yyDollar[2].node) @@ -4361,7 +4367,7 @@ yydefault: } case 139: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2195 + //line php5/php5.y:2199 { yyVAL.node = nil @@ -4369,7 +4375,7 @@ yydefault: } case 140: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2201 + //line php5/php5.y:2205 { stmts := stmt.NewStmtList(yyDollar[3].list) yyVAL.node = stmt.NewAltElse(stmts) @@ -4386,7 +4392,7 @@ yydefault: } case 141: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2220 + //line php5/php5.y:2224 { yyVAL.list = yyDollar[1].list @@ -4394,7 +4400,7 @@ yydefault: } case 142: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2226 + //line php5/php5.y:2230 { yyVAL.list = nil @@ -4402,7 +4408,7 @@ yydefault: } case 143: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2235 + //line php5/php5.y:2239 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4410,7 +4416,7 @@ yydefault: } case 144: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2241 + //line php5/php5.y:2245 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4421,7 +4427,7 @@ yydefault: } case 145: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2253 + //line php5/php5.y:2257 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[4].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -4441,20 +4447,27 @@ yydefault: } // save comments + if yyDollar[1].node != nil { + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + } if yyDollar[2].token != nil { yyDollar[2].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(yyVAL.node.GetMeta()) } if yyDollar[3].token != nil { yyDollar[3].token.Meta.SetTokenName(meta.EllipsisToken).AppendTo(yyVAL.node.GetMeta()) } - yyDollar[4].token.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + if yyDollar[1].node == nil && yyDollar[2].token == nil && yyDollar[3].token == nil { + yyDollar[4].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + } else { + yyDollar[4].token.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + } yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 146: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:2284 + //line php5/php5.y:2295 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[4].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -4474,13 +4487,20 @@ yydefault: } // save comments + if yyDollar[1].node != nil { + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + } if yyDollar[2].token != nil { yyDollar[2].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(yyVAL.node.GetMeta()) } if yyDollar[3].token != nil { yyDollar[3].token.Meta.SetTokenName(meta.EllipsisToken).AppendTo(yyVAL.node.GetMeta()) } - yyDollar[4].token.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + if yyDollar[1].node == nil && yyDollar[2].token == nil && yyDollar[3].token == nil { + yyDollar[4].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + } else { + yyDollar[4].token.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + } yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yyDollar[5].token.Meta.SetTokenName(meta.EqualToken).AppendTo(yyVAL.node.GetMeta()) @@ -4488,7 +4508,7 @@ yydefault: } case 147: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2320 + //line php5/php5.y:2338 { yyVAL.node = nil @@ -4496,7 +4516,7 @@ yydefault: } case 148: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2326 + //line php5/php5.y:2344 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4510,7 +4530,7 @@ yydefault: } case 149: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2338 + //line php5/php5.y:2356 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4524,7 +4544,7 @@ yydefault: } case 150: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2350 + //line php5/php5.y:2368 { yyVAL.node = yyDollar[1].node @@ -4532,7 +4552,7 @@ yydefault: } case 151: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2360 + //line php5/php5.y:2378 { yyVAL.node = node.NewArgumentList(nil) @@ -4547,7 +4567,7 @@ yydefault: } case 152: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2373 + //line php5/php5.y:2391 { yyVAL.node = node.NewArgumentList(yyDollar[2].list) @@ -4562,7 +4582,7 @@ yydefault: } case 153: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2386 + //line php5/php5.y:2404 { arg := node.NewArgument(yyDollar[2].node, false, false) yyVAL.node = node.NewArgumentList([]node.Node{arg}) @@ -4579,7 +4599,7 @@ yydefault: } case 154: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2405 + //line php5/php5.y:2423 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4587,7 +4607,7 @@ yydefault: } case 155: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2411 + //line php5/php5.y:2429 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4598,29 +4618,35 @@ yydefault: } case 156: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2423 + //line php5/php5.y:2441 { yyVAL.node = node.NewArgument(yyDollar[1].node, false, false) // save position yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) + // save comments + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 157: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2432 + //line php5/php5.y:2453 { yyVAL.node = node.NewArgument(yyDollar[1].node, false, false) // save position yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) + // save comments + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 158: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2441 + //line php5/php5.y:2465 { yyVAL.node = node.NewArgument(yyDollar[2].node, false, true) @@ -4634,7 +4660,7 @@ yydefault: } case 159: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2453 + //line php5/php5.y:2477 { yyVAL.node = node.NewArgument(yyDollar[2].node, true, false) @@ -4648,7 +4674,7 @@ yydefault: } case 160: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2468 + //line php5/php5.y:2492 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4659,7 +4685,7 @@ yydefault: } case 161: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2477 + //line php5/php5.y:2501 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4667,7 +4693,7 @@ yydefault: } case 162: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2487 + //line php5/php5.y:2511 { name := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(name) @@ -4684,7 +4710,7 @@ yydefault: } case 163: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2502 + //line php5/php5.y:2526 { yyVAL.node = expr.NewVariable(yyDollar[2].node) @@ -4700,7 +4726,7 @@ yydefault: } case 164: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2516 + //line php5/php5.y:2540 { yyVAL.node = expr.NewVariable(yyDollar[3].node) @@ -4719,7 +4745,7 @@ yydefault: } case 165: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2537 + //line php5/php5.y:2561 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[3].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -4733,14 +4759,14 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(staticVar.GetMeta()) yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 166: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:2556 + //line php5/php5.y:2580 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[3].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -4754,7 +4780,7 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(staticVar.GetMeta()) yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yyDollar[4].token.Meta.SetTokenName(meta.EqualToken).AppendTo(staticVar.GetMeta()) @@ -4762,7 +4788,7 @@ yydefault: } case 167: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2576 + //line php5/php5.y:2600 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -4775,14 +4801,14 @@ yydefault: staticVar.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(staticVar.GetMeta()) yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 168: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2594 + //line php5/php5.y:2618 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -4795,7 +4821,7 @@ yydefault: staticVar.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(staticVar.GetMeta()) yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yyDollar[2].token.Meta.SetTokenName(meta.EqualToken).AppendTo(staticVar.GetMeta()) @@ -4803,7 +4829,7 @@ yydefault: } case 169: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2617 + //line php5/php5.y:2641 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -4811,7 +4837,7 @@ yydefault: } case 170: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2623 + //line php5/php5.y:2647 { yyVAL.list = []node.Node{} @@ -4819,7 +4845,7 @@ yydefault: } case 171: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2633 + //line php5/php5.y:2657 { yyVAL.node = stmt.NewPropertyList(yyDollar[1].list, yyDollar[2].list) @@ -4830,11 +4856,13 @@ yydefault: yyDollar[3].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.SemiColonToken) + yyDollar[1].list[0].GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 172: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2646 + //line php5/php5.y:2672 { yyVAL.node = yyDollar[1].node @@ -4849,7 +4877,7 @@ yydefault: } case 173: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2659 + //line php5/php5.y:2685 { yyVAL.node = yyDollar[1].node @@ -4857,7 +4885,7 @@ yydefault: } case 174: yyDollar = yyS[yypt-8 : yypt+1] - //line php5/php5.y:2665 + //line php5/php5.y:2691 { name := node.NewIdentifier(yyDollar[4].token.Value) yyVAL.node = stmt.NewClassMethod(name, yyDollar[1].list, yyDollar[3].token != nil, yyDollar[6].list, nil, yyDollar[8].node, "") @@ -4883,7 +4911,7 @@ yydefault: } case 175: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2692 + //line php5/php5.y:2718 { yyVAL.node = stmt.NewTraitUse(yyDollar[2].list, yyDollar[3].node) @@ -4897,7 +4925,7 @@ yydefault: } case 176: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2707 + //line php5/php5.y:2733 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4905,7 +4933,7 @@ yydefault: } case 177: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2713 + //line php5/php5.y:2739 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4916,7 +4944,7 @@ yydefault: } case 178: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2725 + //line php5/php5.y:2751 { yyVAL.node = stmt.NewNop() @@ -4930,7 +4958,7 @@ yydefault: } case 179: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2738 + //line php5/php5.y:2764 { yyVAL.node = stmt.NewTraitAdaptationList(yyDollar[2].list) @@ -4944,7 +4972,7 @@ yydefault: } case 180: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2753 + //line php5/php5.y:2779 { yyVAL.list = nil @@ -4952,7 +4980,7 @@ yydefault: } case 181: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2759 + //line php5/php5.y:2785 { yyVAL.list = yyDollar[1].list @@ -4960,7 +4988,7 @@ yydefault: } case 182: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2768 + //line php5/php5.y:2794 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4968,7 +4996,7 @@ yydefault: } case 183: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2774 + //line php5/php5.y:2800 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -4976,7 +5004,7 @@ yydefault: } case 184: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2783 + //line php5/php5.y:2809 { yyVAL.node = yyDollar[1].node @@ -4988,7 +5016,7 @@ yydefault: } case 185: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2793 + //line php5/php5.y:2819 { yyVAL.node = yyDollar[1].node @@ -5000,7 +5028,7 @@ yydefault: } case 186: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2806 + //line php5/php5.y:2832 { yyVAL.node = stmt.NewTraitUsePrecedence(yyDollar[1].node, yyDollar[3].list) @@ -5014,7 +5042,7 @@ yydefault: } case 187: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2821 + //line php5/php5.y:2847 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -5022,7 +5050,7 @@ yydefault: } case 188: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2827 + //line php5/php5.y:2853 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -5033,7 +5061,7 @@ yydefault: } case 189: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2839 + //line php5/php5.y:2865 { name := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewTraitMethodRef(nil, name) @@ -5049,7 +5077,7 @@ yydefault: } case 190: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2853 + //line php5/php5.y:2879 { yyVAL.node = yyDollar[1].node @@ -5057,7 +5085,7 @@ yydefault: } case 191: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2862 + //line php5/php5.y:2888 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewTraitMethodRef(yyDollar[1].node, target) @@ -5074,7 +5102,7 @@ yydefault: } case 192: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2880 + //line php5/php5.y:2906 { alias := node.NewIdentifier(yyDollar[4].token.Value) yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, yyDollar[3].node, alias) @@ -5091,7 +5119,7 @@ yydefault: } case 193: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2895 + //line php5/php5.y:2921 { yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, yyDollar[3].node, nil) @@ -5105,7 +5133,7 @@ yydefault: } case 194: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2910 + //line php5/php5.y:2936 { yyVAL.node = nil @@ -5113,7 +5141,7 @@ yydefault: } case 195: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2916 + //line php5/php5.y:2942 { yyVAL.node = yyDollar[1].node @@ -5121,7 +5149,7 @@ yydefault: } case 196: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2925 + //line php5/php5.y:2951 { yyVAL.node = stmt.NewNop() @@ -5136,7 +5164,7 @@ yydefault: } case 197: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2938 + //line php5/php5.y:2964 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) @@ -5151,7 +5179,7 @@ yydefault: } case 198: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2954 + //line php5/php5.y:2980 { yyVAL.list = yyDollar[1].list @@ -5159,7 +5187,7 @@ yydefault: } case 199: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2960 + //line php5/php5.y:2986 { modifier := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.list = []node.Node{modifier} @@ -5174,7 +5202,7 @@ yydefault: } case 200: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2976 + //line php5/php5.y:3002 { yyVAL.list = nil @@ -5182,7 +5210,7 @@ yydefault: } case 201: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2982 + //line php5/php5.y:3008 { yyVAL.list = yyDollar[1].list @@ -5190,7 +5218,7 @@ yydefault: } case 202: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2991 + //line php5/php5.y:3017 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -5198,7 +5226,7 @@ yydefault: } case 203: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2997 + //line php5/php5.y:3023 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -5206,7 +5234,7 @@ yydefault: } case 204: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3006 + //line php5/php5.y:3032 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5220,7 +5248,7 @@ yydefault: } case 205: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3018 + //line php5/php5.y:3044 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5234,7 +5262,7 @@ yydefault: } case 206: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3030 + //line php5/php5.y:3056 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5248,7 +5276,7 @@ yydefault: } case 207: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3042 + //line php5/php5.y:3068 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5262,7 +5290,7 @@ yydefault: } case 208: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3054 + //line php5/php5.y:3080 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5276,7 +5304,7 @@ yydefault: } case 209: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3066 + //line php5/php5.y:3092 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5290,7 +5318,7 @@ yydefault: } case 210: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3081 + //line php5/php5.y:3107 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[3].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -5311,7 +5339,7 @@ yydefault: } case 211: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:3100 + //line php5/php5.y:3126 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[3].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -5333,7 +5361,7 @@ yydefault: } case 212: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3120 + //line php5/php5.y:3146 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -5353,7 +5381,7 @@ yydefault: } case 213: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3138 + //line php5/php5.y:3164 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -5374,7 +5402,7 @@ yydefault: } case 214: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:3160 + //line php5/php5.y:3186 { name := node.NewIdentifier(yyDollar[3].token.Value) constant := stmt.NewConstant(name, yyDollar[5].node, "") @@ -5390,14 +5418,14 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastConst.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(constant.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.EqualToken).AppendTo(constant.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 215: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3181 + //line php5/php5.y:3207 { name := node.NewIdentifier(yyDollar[2].token.Value) constant := stmt.NewConstant(name, yyDollar[4].node, "") @@ -5410,14 +5438,14 @@ yydefault: // save comments yyDollar[1].token.Meta.SetTokenName(meta.ConstToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) + yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(constant.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.EqualToken).AppendTo(constant.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 216: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3202 + //line php5/php5.y:3228 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -5428,7 +5456,7 @@ yydefault: } case 217: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3211 + //line php5/php5.y:3237 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -5436,7 +5464,7 @@ yydefault: } case 218: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3221 + //line php5/php5.y:3247 { yyVAL.list = nil @@ -5444,7 +5472,7 @@ yydefault: } case 219: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3227 + //line php5/php5.y:3253 { yyVAL.list = yyDollar[1].list @@ -5452,7 +5480,7 @@ yydefault: } case 220: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3236 + //line php5/php5.y:3262 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -5463,7 +5491,7 @@ yydefault: } case 221: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3245 + //line php5/php5.y:3271 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -5471,7 +5499,7 @@ yydefault: } case 222: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3254 + //line php5/php5.y:3280 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) @@ -5479,7 +5507,7 @@ yydefault: } case 223: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3260 + //line php5/php5.y:3286 { yyVAL.list = yyDollar[1].list @@ -5487,7 +5515,7 @@ yydefault: } case 224: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3269 + //line php5/php5.y:3295 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yyVAL.list = append(yyDollar[1].list, fetch) @@ -5505,7 +5533,7 @@ yydefault: } case 225: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3285 + //line php5/php5.y:3311 { fetch := expr.NewArrayDimFetch(nil, yyDollar[2].node) yyVAL.list = []node.Node{fetch} @@ -5523,7 +5551,7 @@ yydefault: } case 226: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3304 + //line php5/php5.y:3330 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) @@ -5531,7 +5559,7 @@ yydefault: } case 227: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3310 + //line php5/php5.y:3336 { yyVAL.list = yyDollar[1].list @@ -5539,7 +5567,7 @@ yydefault: } case 228: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3316 + //line php5/php5.y:3342 { yyVAL.list = yyDollar[1].list @@ -5547,7 +5575,7 @@ yydefault: } case 229: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3325 + //line php5/php5.y:3351 { yyVAL.list = nil @@ -5555,7 +5583,7 @@ yydefault: } case 230: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3331 + //line php5/php5.y:3357 { yyVAL.list = yyDollar[1].list @@ -5563,7 +5591,7 @@ yydefault: } case 231: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3340 + //line php5/php5.y:3366 { if yyDollar[3].node != nil { @@ -5581,7 +5609,7 @@ yydefault: } case 232: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:3359 + //line php5/php5.y:3385 { list := expr.NewList(yyDollar[3].list) yyVAL.node = assign.NewAssign(list, yyDollar[6].node) @@ -5591,7 +5619,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[6].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(list.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(list.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(list.GetMeta()) yyDollar[5].token.Meta.SetTokenName(meta.EqualToken).AppendTo(yyVAL.node.GetMeta()) @@ -5600,7 +5628,7 @@ yydefault: } case 233: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3376 + //line php5/php5.y:3402 { yyVAL.node = assign.NewAssign(yyDollar[1].node, yyDollar[3].node) @@ -5614,13 +5642,15 @@ yydefault: } case 234: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3388 + //line php5/php5.y:3414 { yyVAL.node = assign.NewReference(yyDollar[1].node, yyDollar[4].node) // save position yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + // save comments yyDollar[2].token.Meta.SetTokenName(meta.EqualToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(yyVAL.node.GetMeta()) @@ -5629,7 +5659,7 @@ yydefault: } case 235: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:3401 + //line php5/php5.y:3429 { var _new *expr.New @@ -5653,11 +5683,13 @@ yydefault: yyDollar[3].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.NodeStart).AppendTo(_new.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 236: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3427 + //line php5/php5.y:3457 { yyVAL.node = expr.NewClone(yyDollar[2].node) @@ -5671,7 +5703,7 @@ yydefault: } case 237: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3439 + //line php5/php5.y:3469 { yyVAL.node = assign.NewPlus(yyDollar[1].node, yyDollar[3].node) @@ -5681,11 +5713,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.PlusEqualToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 238: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3451 + //line php5/php5.y:3483 { yyVAL.node = assign.NewMinus(yyDollar[1].node, yyDollar[3].node) @@ -5695,11 +5729,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.MinusEqualToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 239: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3463 + //line php5/php5.y:3497 { yyVAL.node = assign.NewMul(yyDollar[1].node, yyDollar[3].node) @@ -5709,11 +5745,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.MulEqualToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 240: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3475 + //line php5/php5.y:3511 { yyVAL.node = assign.NewPow(yyDollar[1].node, yyDollar[3].node) @@ -5723,11 +5761,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.PowEqualToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 241: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3487 + //line php5/php5.y:3525 { yyVAL.node = assign.NewDiv(yyDollar[1].node, yyDollar[3].node) @@ -5737,11 +5777,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.DivEqualToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 242: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3499 + //line php5/php5.y:3539 { yyVAL.node = assign.NewConcat(yyDollar[1].node, yyDollar[3].node) @@ -5751,11 +5793,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.ConcatEqualToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 243: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3511 + //line php5/php5.y:3553 { yyVAL.node = assign.NewMod(yyDollar[1].node, yyDollar[3].node) @@ -5765,11 +5809,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.ModEqualToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 244: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3523 + //line php5/php5.y:3567 { yyVAL.node = assign.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) @@ -5779,11 +5825,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.AndEqualToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 245: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3535 + //line php5/php5.y:3581 { yyVAL.node = assign.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) @@ -5793,11 +5841,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.OrEqualToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 246: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3547 + //line php5/php5.y:3595 { yyVAL.node = assign.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) @@ -5807,11 +5857,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.XorEqualToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 247: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3559 + //line php5/php5.y:3609 { yyVAL.node = assign.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) @@ -5821,11 +5873,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.SlEqualToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 248: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3571 + //line php5/php5.y:3623 { yyVAL.node = assign.NewShiftRight(yyDollar[1].node, yyDollar[3].node) @@ -5835,11 +5889,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.SrEqualToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 249: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3583 + //line php5/php5.y:3637 { yyVAL.node = expr.NewPostInc(yyDollar[1].node) @@ -5849,11 +5905,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.IncToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 250: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3595 + //line php5/php5.y:3651 { yyVAL.node = expr.NewPreInc(yyDollar[2].node) @@ -5867,7 +5925,7 @@ yydefault: } case 251: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3607 + //line php5/php5.y:3663 { yyVAL.node = expr.NewPostDec(yyDollar[1].node) @@ -5877,11 +5935,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.DecToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 252: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3619 + //line php5/php5.y:3677 { yyVAL.node = expr.NewPreDec(yyDollar[2].node) @@ -5895,7 +5955,7 @@ yydefault: } case 253: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3631 + //line php5/php5.y:3689 { yyVAL.node = binary.NewBooleanOr(yyDollar[1].node, yyDollar[3].node) @@ -5905,11 +5965,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.BooleanOrToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 254: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3643 + //line php5/php5.y:3703 { yyVAL.node = binary.NewBooleanAnd(yyDollar[1].node, yyDollar[3].node) @@ -5919,11 +5981,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.BooleanAndToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 255: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3655 + //line php5/php5.y:3717 { yyVAL.node = binary.NewLogicalOr(yyDollar[1].node, yyDollar[3].node) @@ -5933,11 +5997,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.LogicalOrToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 256: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3667 + //line php5/php5.y:3731 { yyVAL.node = binary.NewLogicalAnd(yyDollar[1].node, yyDollar[3].node) @@ -5947,11 +6013,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.LogicalAndToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 257: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3679 + //line php5/php5.y:3745 { yyVAL.node = binary.NewLogicalXor(yyDollar[1].node, yyDollar[3].node) @@ -5961,11 +6029,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.LogicalXorToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 258: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3691 + //line php5/php5.y:3759 { yyVAL.node = binary.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) @@ -5975,11 +6045,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.VerticalBarToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 259: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3703 + //line php5/php5.y:3773 { yyVAL.node = binary.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) @@ -5989,11 +6061,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 260: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3715 + //line php5/php5.y:3787 { yyVAL.node = binary.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) @@ -6003,11 +6077,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.CaretToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 261: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3727 + //line php5/php5.y:3801 { yyVAL.node = binary.NewConcat(yyDollar[1].node, yyDollar[3].node) @@ -6017,11 +6093,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.DotToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 262: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3739 + //line php5/php5.y:3815 { yyVAL.node = binary.NewPlus(yyDollar[1].node, yyDollar[3].node) @@ -6031,11 +6109,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.PlusToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 263: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3751 + //line php5/php5.y:3829 { yyVAL.node = binary.NewMinus(yyDollar[1].node, yyDollar[3].node) @@ -6045,11 +6125,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.MinusToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 264: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3763 + //line php5/php5.y:3843 { yyVAL.node = binary.NewMul(yyDollar[1].node, yyDollar[3].node) @@ -6059,11 +6141,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.AsteriskToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 265: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3775 + //line php5/php5.y:3857 { yyVAL.node = binary.NewPow(yyDollar[1].node, yyDollar[3].node) @@ -6073,11 +6157,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.PowToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 266: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3787 + //line php5/php5.y:3871 { yyVAL.node = binary.NewDiv(yyDollar[1].node, yyDollar[3].node) @@ -6087,11 +6173,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.SlashToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 267: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3799 + //line php5/php5.y:3885 { yyVAL.node = binary.NewMod(yyDollar[1].node, yyDollar[3].node) @@ -6101,11 +6189,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.PercentToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 268: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3811 + //line php5/php5.y:3899 { yyVAL.node = binary.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) @@ -6115,11 +6205,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.SlToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 269: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3823 + //line php5/php5.y:3913 { yyVAL.node = binary.NewShiftRight(yyDollar[1].node, yyDollar[3].node) @@ -6129,11 +6221,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.SrToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 270: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3835 + //line php5/php5.y:3927 { yyVAL.node = expr.NewUnaryPlus(yyDollar[2].node) @@ -6147,7 +6241,7 @@ yydefault: } case 271: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3847 + //line php5/php5.y:3939 { yyVAL.node = expr.NewUnaryMinus(yyDollar[2].node) @@ -6161,7 +6255,7 @@ yydefault: } case 272: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3859 + //line php5/php5.y:3951 { yyVAL.node = expr.NewBooleanNot(yyDollar[2].node) @@ -6175,7 +6269,7 @@ yydefault: } case 273: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3871 + //line php5/php5.y:3963 { yyVAL.node = expr.NewBitwiseNot(yyDollar[2].node) @@ -6189,7 +6283,7 @@ yydefault: } case 274: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3883 + //line php5/php5.y:3975 { yyVAL.node = binary.NewIdentical(yyDollar[1].node, yyDollar[3].node) @@ -6199,11 +6293,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.IsIdenticalToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 275: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3895 + //line php5/php5.y:3989 { yyVAL.node = binary.NewNotIdentical(yyDollar[1].node, yyDollar[3].node) @@ -6213,11 +6309,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.IsNotIdenticalToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 276: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3907 + //line php5/php5.y:4003 { yyVAL.node = binary.NewEqual(yyDollar[1].node, yyDollar[3].node) @@ -6227,11 +6325,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.IsEqualToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 277: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3919 + //line php5/php5.y:4017 { yyVAL.node = binary.NewNotEqual(yyDollar[1].node, yyDollar[3].node) @@ -6242,11 +6342,13 @@ yydefault: yyDollar[2].token.Meta.SetTokenName(meta.IsNotEqualToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.IsNotEqualToken) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 278: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3932 + //line php5/php5.y:4032 { yyVAL.node = binary.NewSmaller(yyDollar[1].node, yyDollar[3].node) @@ -6256,11 +6358,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.LessToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 279: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3944 + //line php5/php5.y:4046 { yyVAL.node = binary.NewSmallerOrEqual(yyDollar[1].node, yyDollar[3].node) @@ -6270,11 +6374,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.IsSmallerOrEqualToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 280: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3956 + //line php5/php5.y:4060 { yyVAL.node = binary.NewGreater(yyDollar[1].node, yyDollar[3].node) @@ -6284,11 +6390,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.GreaterToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 281: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3968 + //line php5/php5.y:4074 { yyVAL.node = binary.NewGreaterOrEqual(yyDollar[1].node, yyDollar[3].node) @@ -6298,11 +6406,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.IsGreaterOrEqualToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 282: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3980 + //line php5/php5.y:4088 { yyVAL.node = expr.NewInstanceOf(yyDollar[1].node, yyDollar[3].node) @@ -6312,11 +6422,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.InstanceofToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 283: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3992 + //line php5/php5.y:4102 { yyVAL.node = yyDollar[1].node @@ -6327,7 +6439,7 @@ yydefault: } case 284: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4001 + //line php5/php5.y:4111 { yyVAL.node = yyDollar[1].node @@ -6335,38 +6447,43 @@ yydefault: } case 285: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4007 + //line php5/php5.y:4117 { yyVAL.node = yyDollar[2].node + // save comments + yylex.(*Parser).prependMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).PrependTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.NodeEnd) + for _, n := range yyDollar[4].list { switch nn := n.(type) { case *expr.ArrayDimFetch: nn.Variable = yyVAL.node yyVAL.node = nn + nn.Variable.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) case *expr.PropertyFetch: nn.Variable = yyVAL.node yyVAL.node = nn + nn.Variable.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) case *expr.MethodCall: nn.Variable = yyVAL.node yyVAL.node = nn + nn.Variable.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) } // save position yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyVAL.node, n)) } - // save comments - yyDollar[1].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 286: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:4036 + //line php5/php5.y:4151 { yyVAL.node = expr.NewTernary(yyDollar[1].node, yyDollar[3].node, yyDollar[5].node) @@ -6377,11 +6494,13 @@ yydefault: yyDollar[2].token.Meta.SetTokenName(meta.QuestionMarkToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.ColonToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 287: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4049 + //line php5/php5.y:4166 { yyVAL.node = expr.NewTernary(yyDollar[1].node, nil, yyDollar[4].node) @@ -6392,11 +6511,13 @@ yydefault: yyDollar[2].token.Meta.SetTokenName(meta.QuestionMarkToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.ColonToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 288: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4062 + //line php5/php5.y:4181 { yyVAL.node = yyDollar[1].node @@ -6404,7 +6525,7 @@ yydefault: } case 289: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4068 + //line php5/php5.y:4187 { yyVAL.node = cast.NewInt(yyDollar[2].node) @@ -6419,7 +6540,7 @@ yydefault: } case 290: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4081 + //line php5/php5.y:4200 { yyVAL.node = cast.NewDouble(yyDollar[2].node) @@ -6434,7 +6555,7 @@ yydefault: } case 291: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4094 + //line php5/php5.y:4213 { yyVAL.node = cast.NewString(yyDollar[2].node) @@ -6449,7 +6570,7 @@ yydefault: } case 292: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4107 + //line php5/php5.y:4226 { yyVAL.node = cast.NewArray(yyDollar[2].node) @@ -6464,7 +6585,7 @@ yydefault: } case 293: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4120 + //line php5/php5.y:4239 { yyVAL.node = cast.NewObject(yyDollar[2].node) @@ -6479,7 +6600,7 @@ yydefault: } case 294: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4133 + //line php5/php5.y:4252 { yyVAL.node = cast.NewBool(yyDollar[2].node) @@ -6494,7 +6615,7 @@ yydefault: } case 295: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4146 + //line php5/php5.y:4265 { yyVAL.node = cast.NewUnset(yyDollar[2].node) @@ -6509,7 +6630,7 @@ yydefault: } case 296: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4159 + //line php5/php5.y:4278 { var e *expr.Exit if yyDollar[2].node != nil { @@ -6538,7 +6659,7 @@ yydefault: } case 297: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4186 + //line php5/php5.y:4305 { yyVAL.node = expr.NewErrorSuppress(yyDollar[2].node) @@ -6552,7 +6673,7 @@ yydefault: } case 298: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4198 + //line php5/php5.y:4317 { yyVAL.node = yyDollar[1].node @@ -6560,7 +6681,7 @@ yydefault: } case 299: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4204 + //line php5/php5.y:4323 { yyVAL.node = yyDollar[1].node @@ -6568,7 +6689,7 @@ yydefault: } case 300: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4210 + //line php5/php5.y:4329 { yyVAL.node = yyDollar[1].node @@ -6576,7 +6697,7 @@ yydefault: } case 301: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4216 + //line php5/php5.y:4335 { yyVAL.node = expr.NewShellExec(yyDollar[2].list) @@ -6590,7 +6711,7 @@ yydefault: } case 302: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4228 + //line php5/php5.y:4347 { yyVAL.node = expr.NewPrint(yyDollar[2].node) @@ -6604,7 +6725,7 @@ yydefault: } case 303: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4240 + //line php5/php5.y:4359 { yyVAL.node = expr.NewYield(nil, nil) @@ -6618,7 +6739,7 @@ yydefault: } case 304: yyDollar = yyS[yypt-9 : yypt+1] - //line php5/php5.y:4252 + //line php5/php5.y:4371 { yyVAL.node = expr.NewClosure(yyDollar[4].list, yyDollar[6].ClosureUse, nil, yyDollar[8].list, false, yyDollar[2].token != nil, "") @@ -6639,7 +6760,7 @@ yydefault: } case 305: yyDollar = yyS[yypt-10 : yypt+1] - //line php5/php5.y:4271 + //line php5/php5.y:4390 { yyVAL.node = expr.NewClosure(yyDollar[5].list, yyDollar[7].ClosureUse, nil, yyDollar[9].list, true, yyDollar[3].token != nil, "") @@ -6661,7 +6782,7 @@ yydefault: } case 306: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4294 + //line php5/php5.y:4413 { yyVAL.node = expr.NewYield(nil, yyDollar[2].node) @@ -6675,7 +6796,7 @@ yydefault: } case 307: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4306 + //line php5/php5.y:4425 { yyVAL.node = expr.NewYield(nil, yyDollar[2].node) @@ -6689,7 +6810,7 @@ yydefault: } case 308: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4318 + //line php5/php5.y:4437 { yyVAL.node = expr.NewYield(yyDollar[2].node, yyDollar[4].node) @@ -6704,7 +6825,7 @@ yydefault: } case 309: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4331 + //line php5/php5.y:4450 { yyVAL.node = expr.NewYield(yyDollar[2].node, yyDollar[4].node) @@ -6719,7 +6840,7 @@ yydefault: } case 310: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4347 + //line php5/php5.y:4466 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -6732,11 +6853,13 @@ yydefault: yyDollar[4].token.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.CloseSquareBracket) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 311: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4362 + //line php5/php5.y:4483 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -6749,11 +6872,13 @@ yydefault: yyDollar[4].token.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.CloseSquareBracket) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 312: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4377 + //line php5/php5.y:4500 { str := scalar.NewString(yyDollar[1].token.Value) yyVAL.node = expr.NewArrayDimFetch(str, yyDollar[3].node) @@ -6763,6 +6888,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(str, yyDollar[4].token)) // save comments + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.OpenSquareBracket) yyDollar[4].token.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(yyVAL.node.GetMeta()) @@ -6772,7 +6898,7 @@ yydefault: } case 313: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4394 + //line php5/php5.y:4518 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -6785,11 +6911,13 @@ yydefault: yyDollar[4].token.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.CloseSquareBracket) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 314: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4412 + //line php5/php5.y:4538 { yyVAL.node = expr.NewArray(yyDollar[3].list) @@ -6805,7 +6933,7 @@ yydefault: } case 315: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4426 + //line php5/php5.y:4552 { yyVAL.node = expr.NewShortArray(yyDollar[2].list) @@ -6820,13 +6948,13 @@ yydefault: } case 316: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4442 + //line php5/php5.y:4568 { yyVAL.token = yyDollar[1].token } case 317: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:4449 + //line php5/php5.y:4575 { yyVAL.ClosureUse = nil @@ -6834,7 +6962,7 @@ yydefault: } case 318: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4455 + //line php5/php5.y:4581 { yyVAL.ClosureUse = expr.NewClosureUse(yyDollar[3].list) @@ -6850,7 +6978,7 @@ yydefault: } case 319: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4472 + //line php5/php5.y:4598 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[3].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -6869,7 +6997,7 @@ yydefault: } case 320: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4489 + //line php5/php5.y:4615 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[4].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -6891,7 +7019,7 @@ yydefault: } case 321: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4509 + //line php5/php5.y:4635 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -6909,7 +7037,7 @@ yydefault: } case 322: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4525 + //line php5/php5.y:4651 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[2].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -6930,7 +7058,7 @@ yydefault: } case 323: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4547 + //line php5/php5.y:4673 { name := name.NewName(yyDollar[1].list) yyVAL.node = expr.NewFunctionCall(name, yyDollar[2].node.(*node.ArgumentList)) @@ -6939,11 +7067,14 @@ yydefault: name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(name, yyDollar[2].node)) + // save comments + yyDollar[1].list[0].GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 324: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4558 + //line php5/php5.y:4687 { funcName := name.NewRelative(yyDollar[3].list) yyVAL.node = expr.NewFunctionCall(funcName, yyDollar[4].node.(*node.ArgumentList)) @@ -6953,14 +7084,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(funcName, yyDollar[4].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(funcName.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo(funcName.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 325: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4573 + //line php5/php5.y:4702 { funcName := name.NewFullyQualified(yyDollar[2].list) yyVAL.node = expr.NewFunctionCall(funcName, yyDollar[3].node.(*node.ArgumentList)) @@ -6970,13 +7101,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(funcName, yyDollar[3].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(funcName.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 326: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4587 + //line php5/php5.y:4716 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -6985,12 +7116,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 327: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4599 + //line php5/php5.y:4729 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -6999,12 +7131,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 328: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4611 + //line php5/php5.y:4742 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -7013,12 +7146,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 329: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4623 + //line php5/php5.y:4755 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -7027,23 +7161,25 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 330: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4635 + //line php5/php5.y:4768 { yyVAL.node = expr.NewFunctionCall(yyDollar[1].node, yyDollar[2].node.(*node.ArgumentList)) // save position yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[2].node)) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 331: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4647 + //line php5/php5.y:4781 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -7057,18 +7193,21 @@ yydefault: } case 332: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4659 + //line php5/php5.y:4793 { yyVAL.node = name.NewName(yyDollar[1].list) // save position yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) + // save comments + yyDollar[1].list[0].GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 333: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4668 + //line php5/php5.y:4805 { yyVAL.node = name.NewRelative(yyDollar[3].list) @@ -7083,7 +7222,7 @@ yydefault: } case 334: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4681 + //line php5/php5.y:4818 { yyVAL.node = name.NewFullyQualified(yyDollar[2].list) @@ -7097,18 +7236,21 @@ yydefault: } case 335: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4696 + //line php5/php5.y:4833 { yyVAL.node = name.NewName(yyDollar[1].list) // save position yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) + // save comments + yyDollar[1].list[0].GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 336: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4705 + //line php5/php5.y:4845 { yyVAL.node = name.NewRelative(yyDollar[3].list) @@ -7123,7 +7265,7 @@ yydefault: } case 337: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4718 + //line php5/php5.y:4858 { yyVAL.node = name.NewFullyQualified(yyDollar[2].list) @@ -7137,7 +7279,7 @@ yydefault: } case 338: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4733 + //line php5/php5.y:4873 { yyVAL.node = yyDollar[1].node @@ -7145,7 +7287,7 @@ yydefault: } case 339: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4739 + //line php5/php5.y:4879 { yyVAL.node = yyDollar[1].node @@ -7153,7 +7295,7 @@ yydefault: } case 340: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4748 + //line php5/php5.y:4888 { yyVAL.node = yyDollar[1].node @@ -7166,11 +7308,13 @@ yydefault: nn.Variable = yyVAL.node yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyVAL.node, nn)) yyVAL.node = nn + nn.Variable.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) case *expr.PropertyFetch: nn.Variable = yyVAL.node yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyVAL.node, nn)) yyVAL.node = nn + nn.Variable.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) } } @@ -7180,11 +7324,13 @@ yydefault: nn.Variable = yyVAL.node yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyVAL.node, nn)) yyVAL.node = nn + nn.Variable.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) case *expr.PropertyFetch: nn.Variable = yyVAL.node yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyVAL.node, nn)) yyVAL.node = nn + nn.Variable.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) } } @@ -7192,7 +7338,7 @@ yydefault: } case 341: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4785 + //line php5/php5.y:4929 { yyVAL.node = yyDollar[1].node @@ -7200,7 +7346,7 @@ yydefault: } case 342: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4795 + //line php5/php5.y:4939 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) @@ -7208,7 +7354,7 @@ yydefault: } case 343: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:4801 + //line php5/php5.y:4945 { yyVAL.list = []node.Node{} @@ -7216,7 +7362,7 @@ yydefault: } case 344: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4811 + //line php5/php5.y:4955 { yyVAL.list = yyDollar[2].list @@ -7227,7 +7373,7 @@ yydefault: } case 345: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:4823 + //line php5/php5.y:4967 { yyVAL.node = nil @@ -7235,7 +7381,7 @@ yydefault: } case 346: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4829 + //line php5/php5.y:4973 { yyVAL.node = expr.NewExit(nil) @@ -7252,7 +7398,7 @@ yydefault: } case 347: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4844 + //line php5/php5.y:4988 { yyVAL.node = expr.NewExit(yyDollar[1].node) @@ -7271,7 +7417,7 @@ yydefault: } case 348: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:4864 + //line php5/php5.y:5008 { yyVAL.list = []node.Node{} @@ -7279,7 +7425,7 @@ yydefault: } case 349: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4870 + //line php5/php5.y:5014 { yyVAL.list = []node.Node{scalar.NewEncapsedStringPart(yyDollar[1].token.Value)} @@ -7287,7 +7433,7 @@ yydefault: } case 350: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4876 + //line php5/php5.y:5020 { yyVAL.list = yyDollar[1].list @@ -7295,7 +7441,7 @@ yydefault: } case 351: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:4885 + //line php5/php5.y:5029 { yyVAL.node = nil @@ -7303,7 +7449,7 @@ yydefault: } case 352: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4891 + //line php5/php5.y:5035 { yyVAL.node = yyDollar[1].node @@ -7311,7 +7457,7 @@ yydefault: } case 353: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4900 + //line php5/php5.y:5044 { yyVAL.node = scalar.NewLnumber(yyDollar[1].token.Value) @@ -7325,7 +7471,7 @@ yydefault: } case 354: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4912 + //line php5/php5.y:5056 { yyVAL.node = scalar.NewDnumber(yyDollar[1].token.Value) @@ -7339,7 +7485,7 @@ yydefault: } case 355: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4924 + //line php5/php5.y:5068 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) @@ -7353,7 +7499,7 @@ yydefault: } case 356: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4936 + //line php5/php5.y:5080 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7367,7 +7513,7 @@ yydefault: } case 357: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4948 + //line php5/php5.y:5092 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7381,7 +7527,7 @@ yydefault: } case 358: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4960 + //line php5/php5.y:5104 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7395,7 +7541,7 @@ yydefault: } case 359: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4972 + //line php5/php5.y:5116 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7409,7 +7555,7 @@ yydefault: } case 360: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4984 + //line php5/php5.y:5128 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7423,7 +7569,7 @@ yydefault: } case 361: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4996 + //line php5/php5.y:5140 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7437,7 +7583,7 @@ yydefault: } case 362: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5008 + //line php5/php5.y:5152 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7451,7 +7597,7 @@ yydefault: } case 363: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5020 + //line php5/php5.y:5164 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, []node.Node{encapsed}) @@ -7467,7 +7613,7 @@ yydefault: } case 364: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5034 + //line php5/php5.y:5178 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, nil) @@ -7481,7 +7627,7 @@ yydefault: } case 365: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5049 + //line php5/php5.y:5193 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -7494,11 +7640,13 @@ yydefault: yyDollar[2].token.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(target.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 366: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5067 + //line php5/php5.y:5213 { yyVAL.node = yyDollar[1].node @@ -7506,7 +7654,7 @@ yydefault: } case 367: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5076 + //line php5/php5.y:5222 { yyVAL.node = yyDollar[1].node @@ -7514,7 +7662,7 @@ yydefault: } case 368: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5082 + //line php5/php5.y:5228 { yyVAL.node = yyDollar[1].node @@ -7522,7 +7670,7 @@ yydefault: } case 369: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5088 + //line php5/php5.y:5234 { name := name.NewName(yyDollar[1].list) yyVAL.node = expr.NewConstFetch(name) @@ -7531,11 +7679,14 @@ yydefault: name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(name)) + // save comments + yyDollar[1].list[0].GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 370: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5099 + //line php5/php5.y:5248 { name := name.NewRelative(yyDollar[3].list) yyVAL.node = expr.NewConstFetch(name) @@ -7545,14 +7696,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo(name.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 371: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5114 + //line php5/php5.y:5263 { name := name.NewFullyQualified(yyDollar[2].list) yyVAL.node = expr.NewConstFetch(name) @@ -7562,13 +7713,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 372: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:5128 + //line php5/php5.y:5277 { yyVAL.node = expr.NewArray(yyDollar[3].list) @@ -7584,7 +7735,7 @@ yydefault: } case 373: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5142 + //line php5/php5.y:5291 { yyVAL.node = expr.NewShortArray(yyDollar[2].list) @@ -7599,7 +7750,7 @@ yydefault: } case 374: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5155 + //line php5/php5.y:5304 { yyVAL.node = yyDollar[1].node @@ -7607,7 +7758,7 @@ yydefault: } case 375: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5161 + //line php5/php5.y:5310 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7621,7 +7772,7 @@ yydefault: } case 376: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5173 + //line php5/php5.y:5322 { yyVAL.node = yyDollar[1].node @@ -7629,7 +7780,7 @@ yydefault: } case 377: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:5182 + //line php5/php5.y:5331 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -7642,11 +7793,13 @@ yydefault: yyDollar[4].token.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.CloseSquareBracket) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 378: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5197 + //line php5/php5.y:5348 { yyVAL.node = binary.NewPlus(yyDollar[1].node, yyDollar[3].node) @@ -7656,11 +7809,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.PlusToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 379: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5209 + //line php5/php5.y:5362 { yyVAL.node = binary.NewMinus(yyDollar[1].node, yyDollar[3].node) @@ -7670,11 +7825,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.MinusToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 380: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5221 + //line php5/php5.y:5376 { yyVAL.node = binary.NewMul(yyDollar[1].node, yyDollar[3].node) @@ -7684,11 +7841,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.AsteriskToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 381: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5233 + //line php5/php5.y:5390 { yyVAL.node = binary.NewPow(yyDollar[1].node, yyDollar[3].node) @@ -7698,11 +7857,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.PowToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 382: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5245 + //line php5/php5.y:5404 { yyVAL.node = binary.NewDiv(yyDollar[1].node, yyDollar[3].node) @@ -7712,11 +7873,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.SlashToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 383: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5257 + //line php5/php5.y:5418 { yyVAL.node = binary.NewMod(yyDollar[1].node, yyDollar[3].node) @@ -7726,11 +7889,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.PercentToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 384: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5269 + //line php5/php5.y:5432 { yyVAL.node = expr.NewBooleanNot(yyDollar[2].node) @@ -7744,7 +7909,7 @@ yydefault: } case 385: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5281 + //line php5/php5.y:5444 { yyVAL.node = expr.NewBitwiseNot(yyDollar[2].node) @@ -7758,7 +7923,7 @@ yydefault: } case 386: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5293 + //line php5/php5.y:5456 { yyVAL.node = binary.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) @@ -7768,11 +7933,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.VerticalBarToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 387: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5305 + //line php5/php5.y:5470 { yyVAL.node = binary.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) @@ -7782,11 +7949,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 388: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5317 + //line php5/php5.y:5484 { yyVAL.node = binary.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) @@ -7796,11 +7965,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.CaretToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 389: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5329 + //line php5/php5.y:5498 { yyVAL.node = binary.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) @@ -7810,11 +7981,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.SlToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 390: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5341 + //line php5/php5.y:5512 { yyVAL.node = binary.NewShiftRight(yyDollar[1].node, yyDollar[3].node) @@ -7824,11 +7997,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.SrToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 391: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5353 + //line php5/php5.y:5526 { yyVAL.node = binary.NewConcat(yyDollar[1].node, yyDollar[3].node) @@ -7838,11 +8013,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.DotToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 392: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5365 + //line php5/php5.y:5540 { yyVAL.node = binary.NewLogicalXor(yyDollar[1].node, yyDollar[3].node) @@ -7852,11 +8029,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.LogicalXorToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 393: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5377 + //line php5/php5.y:5554 { yyVAL.node = binary.NewLogicalAnd(yyDollar[1].node, yyDollar[3].node) @@ -7866,11 +8045,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.LogicalAndToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 394: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5389 + //line php5/php5.y:5568 { yyVAL.node = binary.NewLogicalOr(yyDollar[1].node, yyDollar[3].node) @@ -7880,11 +8061,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.LogicalOrToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 395: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5401 + //line php5/php5.y:5582 { yyVAL.node = binary.NewBooleanAnd(yyDollar[1].node, yyDollar[3].node) @@ -7894,11 +8077,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.BooleanAndToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 396: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5413 + //line php5/php5.y:5596 { yyVAL.node = binary.NewBooleanOr(yyDollar[1].node, yyDollar[3].node) @@ -7908,11 +8093,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.BooleanOrToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 397: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5425 + //line php5/php5.y:5610 { yyVAL.node = binary.NewIdentical(yyDollar[1].node, yyDollar[3].node) @@ -7922,11 +8109,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.IsIdenticalToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 398: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5437 + //line php5/php5.y:5624 { yyVAL.node = binary.NewNotIdentical(yyDollar[1].node, yyDollar[3].node) @@ -7936,11 +8125,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.IsNotIdenticalToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 399: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5449 + //line php5/php5.y:5638 { yyVAL.node = binary.NewEqual(yyDollar[1].node, yyDollar[3].node) @@ -7950,11 +8141,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.IsEqualToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 400: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5461 + //line php5/php5.y:5652 { yyVAL.node = binary.NewNotEqual(yyDollar[1].node, yyDollar[3].node) @@ -7965,11 +8158,13 @@ yydefault: yyDollar[2].token.Meta.SetTokenName(meta.IsNotEqualToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.IsNotEqualToken) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 401: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5474 + //line php5/php5.y:5667 { yyVAL.node = binary.NewSmaller(yyDollar[1].node, yyDollar[3].node) @@ -7979,11 +8174,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.LessToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 402: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5486 + //line php5/php5.y:5681 { yyVAL.node = binary.NewGreater(yyDollar[1].node, yyDollar[3].node) @@ -7993,11 +8190,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.GreaterToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 403: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5498 + //line php5/php5.y:5695 { yyVAL.node = binary.NewSmallerOrEqual(yyDollar[1].node, yyDollar[3].node) @@ -8007,11 +8206,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.IsSmallerOrEqualToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 404: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5510 + //line php5/php5.y:5709 { yyVAL.node = binary.NewGreaterOrEqual(yyDollar[1].node, yyDollar[3].node) @@ -8021,11 +8222,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.IsGreaterOrEqualToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 405: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:5522 + //line php5/php5.y:5723 { yyVAL.node = expr.NewTernary(yyDollar[1].node, nil, yyDollar[4].node) @@ -8036,11 +8239,13 @@ yydefault: yyDollar[2].token.Meta.SetTokenName(meta.QuestionMarkToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.ColonToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 406: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:5535 + //line php5/php5.y:5738 { yyVAL.node = expr.NewTernary(yyDollar[1].node, yyDollar[3].node, yyDollar[5].node) @@ -8051,11 +8256,13 @@ yydefault: yyDollar[2].token.Meta.SetTokenName(meta.QuestionMarkToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.ColonToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 407: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5548 + //line php5/php5.y:5753 { yyVAL.node = expr.NewUnaryPlus(yyDollar[2].node) @@ -8069,7 +8276,7 @@ yydefault: } case 408: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5560 + //line php5/php5.y:5765 { yyVAL.node = expr.NewUnaryMinus(yyDollar[2].node) @@ -8083,19 +8290,21 @@ yydefault: } case 409: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5572 + //line php5/php5.y:5777 { yyVAL.node = yyDollar[2].node // save comments - yyDollar[1].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).prependMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).PrependTo(yyVAL.node.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 410: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5585 + //line php5/php5.y:5792 { yyVAL.node = yyDollar[1].node @@ -8103,7 +8312,7 @@ yydefault: } case 411: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5591 + //line php5/php5.y:5798 { name := name.NewName(yyDollar[1].list) yyVAL.node = expr.NewConstFetch(name) @@ -8112,11 +8321,14 @@ yydefault: name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(name)) + // save comments + yyDollar[1].list[0].GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 412: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5602 + //line php5/php5.y:5812 { name := name.NewRelative(yyDollar[3].list) yyVAL.node = expr.NewConstFetch(name) @@ -8124,14 +8336,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(name)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo(name.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 413: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5615 + //line php5/php5.y:5825 { name := name.NewFullyQualified(yyDollar[2].list) yyVAL.node = expr.NewConstFetch(name) @@ -8141,13 +8353,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(name)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 414: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5632 + //line php5/php5.y:5842 { name := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = expr.NewVariable(name) @@ -8164,7 +8376,7 @@ yydefault: } case 415: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5647 + //line php5/php5.y:5857 { yyVAL.node = yyDollar[1].node @@ -8172,7 +8384,7 @@ yydefault: } case 416: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5653 + //line php5/php5.y:5863 { yyVAL.node = yyDollar[1].node @@ -8180,7 +8392,7 @@ yydefault: } case 417: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5659 + //line php5/php5.y:5869 { yyVAL.node = yyDollar[1].node @@ -8188,7 +8400,7 @@ yydefault: } case 418: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5665 + //line php5/php5.y:5875 { yyVAL.node = scalar.NewEncapsed(yyDollar[2].list) @@ -8202,7 +8414,7 @@ yydefault: } case 419: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5677 + //line php5/php5.y:5887 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, yyDollar[2].list) @@ -8216,7 +8428,7 @@ yydefault: } case 420: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5689 + //line php5/php5.y:5899 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -8230,7 +8442,7 @@ yydefault: } case 421: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:5704 + //line php5/php5.y:5914 { yyVAL.list = nil @@ -8238,7 +8450,7 @@ yydefault: } case 422: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5710 + //line php5/php5.y:5920 { yyVAL.list = yyDollar[1].list @@ -8251,19 +8463,19 @@ yydefault: } case 423: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:5724 + //line php5/php5.y:5934 { yyVAL.token = nil } case 424: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5728 + //line php5/php5.y:5938 { yyVAL.token = yyDollar[1].token } case 425: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:5735 + //line php5/php5.y:5945 { arrayItem := expr.NewArrayItem(yyDollar[3].node, yyDollar[5].node) yyVAL.list = append(yyDollar[1].list, arrayItem) @@ -8275,11 +8487,13 @@ yydefault: yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo(arrayItem.GetMeta()) + yyDollar[3].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(arrayItem.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 426: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5749 + //line php5/php5.y:5961 { arrayItem := expr.NewArrayItem(nil, yyDollar[3].node) yyVAL.list = append(yyDollar[1].list, arrayItem) @@ -8290,11 +8504,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) + yyDollar[3].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(arrayItem.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 427: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5762 + //line php5/php5.y:5976 { arrayItem := expr.NewArrayItem(yyDollar[1].node, yyDollar[3].node) yyVAL.list = []node.Node{arrayItem} @@ -8305,11 +8521,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo(arrayItem.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(arrayItem.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 428: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5775 + //line php5/php5.y:5991 { arrayItem := expr.NewArrayItem(nil, yyDollar[1].node) yyVAL.list = []node.Node{arrayItem} @@ -8317,11 +8535,13 @@ yydefault: // save position arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(arrayItem.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 429: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5788 + //line php5/php5.y:6006 { yyVAL.node = yyDollar[1].node @@ -8329,7 +8549,7 @@ yydefault: } case 430: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5794 + //line php5/php5.y:6012 { yyVAL.node = yyDollar[1].node @@ -8337,13 +8557,13 @@ yydefault: } case 431: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5803 + //line php5/php5.y:6021 { yyVAL.node = yyDollar[2].node // save comments - yyDollar[1].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.OpenParenthesisToken) + yylex.(*Parser).prependMetaToken(yyVAL.node, yyDollar[1].token, meta.OpenParenthesisToken) + yyDollar[1].token.Meta.SetTokenName(meta.OpenParenthesisToken).PrependTo(yyVAL.node.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.CloseParenthesisToken) @@ -8351,13 +8571,13 @@ yydefault: } case 432: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5815 + //line php5/php5.y:6033 { yyVAL.node = yyDollar[2].node // save comments - yyDollar[1].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.OpenParenthesisToken) + yylex.(*Parser).prependMetaToken(yyVAL.node, yyDollar[1].token, meta.OpenParenthesisToken) + yyDollar[1].token.Meta.SetTokenName(meta.OpenParenthesisToken).PrependTo(yyVAL.node.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.CloseParenthesisToken) @@ -8365,7 +8585,7 @@ yydefault: } case 433: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5831 + //line php5/php5.y:6049 { yyVAL.node = yyDollar[1].node @@ -8373,7 +8593,7 @@ yydefault: } case 434: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5841 + //line php5/php5.y:6059 { yyVAL.node = yyDollar[1].node @@ -8381,7 +8601,7 @@ yydefault: } case 435: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5850 + //line php5/php5.y:6068 { yyVAL.node = yyDollar[1].node @@ -8389,7 +8609,7 @@ yydefault: } case 436: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:5859 + //line php5/php5.y:6077 { yyVAL.node = yyDollar[1].node @@ -8407,16 +8627,19 @@ yydefault: nn.Variable = yyVAL.node nn.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyVAL.node, nn)) yyVAL.node = nn + nn.Variable.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) case *expr.PropertyFetch: nn.Variable = yyVAL.node nn.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyVAL.node, nn)) yyVAL.node = nn + nn.Variable.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) case *expr.MethodCall: nn.Variable = yyVAL.node nn.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyVAL.node, nn)) yyVAL.node = nn + nn.Variable.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) } } @@ -8426,16 +8649,19 @@ yydefault: nn.Variable = yyVAL.node nn.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyVAL.node, nn)) yyVAL.node = nn + nn.Variable.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) case *expr.PropertyFetch: nn.Variable = yyVAL.node nn.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyVAL.node, nn)) yyVAL.node = nn + nn.Variable.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) case *expr.MethodCall: nn.Variable = yyVAL.node nn.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyVAL.node, nn)) yyVAL.node = nn + nn.Variable.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) } } @@ -8443,7 +8669,7 @@ yydefault: } case 437: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5911 + //line php5/php5.y:6135 { yyVAL.node = yyDollar[1].node @@ -8451,7 +8677,7 @@ yydefault: } case 438: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5920 + //line php5/php5.y:6144 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) @@ -8459,7 +8685,7 @@ yydefault: } case 439: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:5926 + //line php5/php5.y:6150 { yyVAL.list = []node.Node{} @@ -8467,7 +8693,7 @@ yydefault: } case 440: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5936 + //line php5/php5.y:6160 { if yyDollar[3].list != nil { yyDollar[3].list[0].(*expr.MethodCall).Method = yyDollar[2].list[len(yyDollar[2].list)-1].(*expr.PropertyFetch).Property @@ -8483,7 +8709,7 @@ yydefault: } case 441: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:5953 + //line php5/php5.y:6177 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yyVAL.list = append(yyDollar[1].list, fetch) @@ -8501,7 +8727,7 @@ yydefault: } case 442: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:5969 + //line php5/php5.y:6193 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yyVAL.list = []node.Node{yyDollar[1].node, fetch} @@ -8519,7 +8745,7 @@ yydefault: } case 443: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5988 + //line php5/php5.y:6212 { yyVAL.node = expr.NewMethodCall(nil, nil, yyDollar[1].node.(*node.ArgumentList)) @@ -8530,7 +8756,7 @@ yydefault: } case 444: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6000 + //line php5/php5.y:6224 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -8538,7 +8764,7 @@ yydefault: } case 445: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6006 + //line php5/php5.y:6230 { yyVAL.list = yyDollar[1].list @@ -8546,7 +8772,7 @@ yydefault: } case 446: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:6012 + //line php5/php5.y:6236 { yyVAL.list = nil @@ -8554,7 +8780,7 @@ yydefault: } case 447: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6021 + //line php5/php5.y:6245 { yyVAL.node = yyDollar[1].node @@ -8562,7 +8788,7 @@ yydefault: } case 448: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6027 + //line php5/php5.y:6251 { yyDollar[1].simpleIndirectReference.last.SetVarName(yyDollar[2].node) @@ -8576,7 +8802,7 @@ yydefault: } case 449: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6042 + //line php5/php5.y:6266 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -8586,11 +8812,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 450: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6054 + //line php5/php5.y:6280 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -8600,11 +8828,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 451: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6069 + //line php5/php5.y:6297 { yyVAL.node = yyDollar[1].node @@ -8612,7 +8842,7 @@ yydefault: } case 452: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6078 + //line php5/php5.y:6306 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -8625,11 +8855,13 @@ yydefault: yyDollar[4].token.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.CloseSquareBracket) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 453: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6093 + //line php5/php5.y:6323 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -8642,11 +8874,13 @@ yydefault: yyDollar[4].token.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.CloseSquareBracket) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 454: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6111 + //line php5/php5.y:6343 { yyVAL.node = yyDollar[1].node @@ -8654,7 +8888,7 @@ yydefault: } case 455: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6117 + //line php5/php5.y:6349 { yyVAL.node = yyDollar[1].node @@ -8662,7 +8896,7 @@ yydefault: } case 456: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6123 + //line php5/php5.y:6355 { yyVAL.node = yyDollar[1].node @@ -8670,7 +8904,7 @@ yydefault: } case 457: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6133 + //line php5/php5.y:6365 { yyVAL.node = yyDollar[1].node @@ -8678,7 +8912,7 @@ yydefault: } case 458: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6139 + //line php5/php5.y:6371 { yyDollar[1].simpleIndirectReference.last.SetVarName(yyDollar[2].node) @@ -8692,7 +8926,7 @@ yydefault: } case 459: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6151 + //line php5/php5.y:6383 { yyVAL.node = yyDollar[1].node @@ -8700,7 +8934,7 @@ yydefault: } case 460: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6160 + //line php5/php5.y:6392 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -8713,11 +8947,13 @@ yydefault: yyDollar[4].token.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.CloseSquareBracket) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 461: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6175 + //line php5/php5.y:6409 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -8730,11 +8966,13 @@ yydefault: yyDollar[4].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.CloseCurlyBracesToken) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 462: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6190 + //line php5/php5.y:6426 { yyVAL.node = yyDollar[1].node @@ -8742,7 +8980,7 @@ yydefault: } case 463: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6200 + //line php5/php5.y:6436 { name := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(name) @@ -8759,7 +8997,7 @@ yydefault: } case 464: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6215 + //line php5/php5.y:6451 { yyVAL.node = expr.NewVariable(yyDollar[3].node) @@ -8778,7 +9016,7 @@ yydefault: } case 465: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:6235 + //line php5/php5.y:6471 { yyVAL.node = nil @@ -8786,7 +9024,7 @@ yydefault: } case 466: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6241 + //line php5/php5.y:6477 { yyVAL.node = yyDollar[1].node @@ -8794,7 +9032,7 @@ yydefault: } case 467: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6251 + //line php5/php5.y:6487 { yyVAL.list = yyDollar[1].list @@ -8802,7 +9040,7 @@ yydefault: } case 468: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6257 + //line php5/php5.y:6493 { fetch := expr.NewPropertyFetch(nil, yyDollar[1].node) yyVAL.list = []node.Node{fetch} @@ -8814,7 +9052,7 @@ yydefault: } case 469: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6270 + //line php5/php5.y:6506 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yyVAL.list = append(yyDollar[1].list, fetch) @@ -8832,7 +9070,7 @@ yydefault: } case 470: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6286 + //line php5/php5.y:6522 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yyVAL.list = append(yyDollar[1].list, fetch) @@ -8850,7 +9088,7 @@ yydefault: } case 471: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6302 + //line php5/php5.y:6538 { fetch := expr.NewPropertyFetch(nil, yyDollar[1].node) yyVAL.list = []node.Node{fetch} @@ -8862,7 +9100,7 @@ yydefault: } case 472: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6315 + //line php5/php5.y:6551 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -8876,7 +9114,7 @@ yydefault: } case 473: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6327 + //line php5/php5.y:6563 { yyVAL.node = yyDollar[2].node @@ -8884,8 +9122,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) + yylex.(*Parser).prependMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).PrependTo(yyVAL.node.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.NodeEnd) @@ -8893,7 +9131,7 @@ yydefault: } case 474: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6345 + //line php5/php5.y:6581 { n := expr.NewVariable(nil) yyVAL.simpleIndirectReference = simpleIndirectReference{[]*expr.Variable{n}, n} @@ -8909,7 +9147,7 @@ yydefault: } case 475: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6359 + //line php5/php5.y:6595 { n := expr.NewVariable(nil) @@ -8929,7 +9167,7 @@ yydefault: } case 476: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6380 + //line php5/php5.y:6616 { if len(yyDollar[1].list) == 0 { yyDollar[1].list = []node.Node{expr.NewArrayItem(nil, nil)} @@ -8944,7 +9182,7 @@ yydefault: } case 477: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6393 + //line php5/php5.y:6629 { if yyDollar[1].node.(*expr.ArrayItem).Key == nil && yyDollar[1].node.(*expr.ArrayItem).Val == nil { yyVAL.list = []node.Node{} @@ -8956,18 +9194,20 @@ yydefault: } case 478: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6407 + //line php5/php5.y:6643 { yyVAL.node = expr.NewArrayItem(nil, yyDollar[1].node) // save position yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 479: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6416 + //line php5/php5.y:6654 { item := expr.NewList(yyDollar[3].list) yyVAL.node = expr.NewArrayItem(nil, item) @@ -8977,7 +9217,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(item)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(item.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(item.GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(item.GetMeta()) @@ -8985,7 +9225,7 @@ yydefault: } case 480: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:6432 + //line php5/php5.y:6670 { yyVAL.node = expr.NewArrayItem(nil, nil) @@ -8993,7 +9233,7 @@ yydefault: } case 481: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:6442 + //line php5/php5.y:6680 { yyVAL.list = []node.Node{} @@ -9001,7 +9241,7 @@ yydefault: } case 482: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6448 + //line php5/php5.y:6686 { yyVAL.list = yyDollar[1].list @@ -9018,7 +9258,7 @@ yydefault: } case 483: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:6466 + //line php5/php5.y:6704 { arrayItem := expr.NewArrayItem(yyDollar[3].node, yyDollar[5].node) yyVAL.list = append(yyDollar[1].list, arrayItem) @@ -9030,11 +9270,13 @@ yydefault: yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) yyDollar[4].token.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo(arrayItem.GetMeta()) + yyDollar[3].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(arrayItem.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 484: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6480 + //line php5/php5.y:6720 { arrayItem := expr.NewArrayItem(nil, yyDollar[3].node) yyVAL.list = append(yyDollar[1].list, arrayItem) @@ -9045,11 +9287,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) + yyDollar[3].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(arrayItem.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 485: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6493 + //line php5/php5.y:6735 { arrayItem := expr.NewArrayItem(yyDollar[1].node, yyDollar[3].node) yyVAL.list = []node.Node{arrayItem} @@ -9060,11 +9304,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo(arrayItem.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(arrayItem.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 486: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6506 + //line php5/php5.y:6750 { arrayItem := expr.NewArrayItem(nil, yyDollar[1].node) yyVAL.list = []node.Node{arrayItem} @@ -9072,11 +9318,13 @@ yydefault: // save position arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(arrayItem.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 487: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:6516 + //line php5/php5.y:6762 { reference := expr.NewReference(yyDollar[6].node) arrayItem := expr.NewArrayItem(yyDollar[3].node, reference) @@ -9091,11 +9339,13 @@ yydefault: yyDollar[4].token.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo(arrayItem.GetMeta()) yyDollar[5].token.Meta.SetTokenName(meta.NodeStart).AppendTo(reference.GetMeta()) + yyDollar[3].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(arrayItem.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 488: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6533 + //line php5/php5.y:6781 { reference := expr.NewReference(yyDollar[4].node) arrayItem := expr.NewArrayItem(nil, reference) @@ -9107,13 +9357,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(reference.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(arrayItem.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 489: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6549 + //line php5/php5.y:6797 { reference := expr.NewReference(yyDollar[4].node) arrayItem := expr.NewArrayItem(yyDollar[1].node, reference) @@ -9127,11 +9377,13 @@ yydefault: yyDollar[2].token.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo(arrayItem.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(reference.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(arrayItem.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 490: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6565 + //line php5/php5.y:6815 { reference := expr.NewReference(yyDollar[2].node) arrayItem := expr.NewArrayItem(nil, reference) @@ -9142,13 +9394,13 @@ yydefault: arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(reference.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(arrayItem.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 491: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6583 + //line php5/php5.y:6833 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -9156,7 +9408,7 @@ yydefault: } case 492: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6589 + //line php5/php5.y:6839 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yyVAL.list = append(yyDollar[1].list, encapsed) @@ -9171,7 +9423,7 @@ yydefault: } case 493: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6602 + //line php5/php5.y:6852 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -9179,7 +9431,7 @@ yydefault: } case 494: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6608 + //line php5/php5.y:6858 { encapsed := scalar.NewEncapsedStringPart(yyDollar[1].token.Value) yyVAL.list = []node.Node{encapsed, yyDollar[2].node} @@ -9194,7 +9446,7 @@ yydefault: } case 495: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6624 + //line php5/php5.y:6874 { name := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(name) @@ -9211,7 +9463,7 @@ yydefault: } case 496: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6639 + //line php5/php5.y:6889 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -9223,7 +9475,6 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yyDollar[2].token.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.OpenSquareBracket) @@ -9234,7 +9485,7 @@ yydefault: } case 497: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6660 + //line php5/php5.y:6909 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -9248,7 +9499,6 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yyDollar[2].token.Meta.SetTokenName(meta.ObjectOperatorToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(fetch.GetMeta()) @@ -9257,7 +9507,7 @@ yydefault: } case 498: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6681 + //line php5/php5.y:6929 { variable := expr.NewVariable(yyDollar[2].node) @@ -9267,7 +9517,6 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) yyDollar[3].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.NodeEnd) @@ -9276,7 +9525,7 @@ yydefault: } case 499: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6698 + //line php5/php5.y:6945 { name := node.NewIdentifier(yyDollar[2].token.Value) variable := expr.NewVariable(name) @@ -9288,7 +9537,6 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(yyVAL.node.GetMeta()) @@ -9298,7 +9546,7 @@ yydefault: } case 500: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:6718 + //line php5/php5.y:6964 { identifier := node.NewIdentifier(yyDollar[2].token.Value) variable := expr.NewVariable(identifier) @@ -9310,7 +9558,6 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[6].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) yyDollar[3].token.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.OpenSquareBracket) @@ -9323,12 +9570,11 @@ yydefault: } case 501: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6741 + //line php5/php5.y:6986 { yyVAL.node = yyDollar[2].node // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).PrependTo(yyVAL.node.GetMeta()) yylex.(*Parser).prependMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) yyDollar[3].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.NodeEnd) @@ -9337,7 +9583,7 @@ yydefault: } case 502: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6756 + //line php5/php5.y:7000 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) @@ -9351,7 +9597,7 @@ yydefault: } case 503: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6768 + //line php5/php5.y:7012 { // TODO: add option to handle 64 bit integer if _, err := strconv.Atoi(yyDollar[1].token.Value); err == nil { @@ -9367,7 +9613,7 @@ yydefault: } case 504: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6782 + //line php5/php5.y:7026 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(identifier) @@ -9384,7 +9630,7 @@ yydefault: } case 505: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6800 + //line php5/php5.y:7044 { yyVAL.node = expr.NewIsset(yyDollar[3].list) @@ -9400,7 +9646,7 @@ yydefault: } case 506: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6814 + //line php5/php5.y:7058 { yyVAL.node = expr.NewEmpty(yyDollar[3].node) @@ -9416,7 +9662,7 @@ yydefault: } case 507: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6828 + //line php5/php5.y:7072 { yyVAL.node = expr.NewEmpty(yyDollar[3].node) @@ -9432,7 +9678,7 @@ yydefault: } case 508: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6842 + //line php5/php5.y:7086 { yyVAL.node = expr.NewInclude(yyDollar[2].node) @@ -9446,7 +9692,7 @@ yydefault: } case 509: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6854 + //line php5/php5.y:7098 { yyVAL.node = expr.NewIncludeOnce(yyDollar[2].node) @@ -9460,7 +9706,7 @@ yydefault: } case 510: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6866 + //line php5/php5.y:7110 { yyVAL.node = expr.NewEval(yyDollar[3].node) @@ -9476,7 +9722,7 @@ yydefault: } case 511: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6880 + //line php5/php5.y:7124 { yyVAL.node = expr.NewRequire(yyDollar[2].node) @@ -9490,7 +9736,7 @@ yydefault: } case 512: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6892 + //line php5/php5.y:7136 { yyVAL.node = expr.NewRequireOnce(yyDollar[2].node) @@ -9504,7 +9750,7 @@ yydefault: } case 513: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6907 + //line php5/php5.y:7151 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -9512,7 +9758,7 @@ yydefault: } case 514: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6913 + //line php5/php5.y:7157 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -9523,7 +9769,7 @@ yydefault: } case 515: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6925 + //line php5/php5.y:7169 { yyVAL.node = yyDollar[1].node @@ -9531,7 +9777,7 @@ yydefault: } case 516: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6931 + //line php5/php5.y:7175 { yyVAL.node = yyDollar[1].node @@ -9539,7 +9785,7 @@ yydefault: } case 517: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6940 + //line php5/php5.y:7184 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -9552,11 +9798,13 @@ yydefault: yyDollar[2].token.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(target.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 518: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6955 + //line php5/php5.y:7201 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -9569,11 +9817,13 @@ yydefault: yyDollar[2].token.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(target.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 519: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6973 + //line php5/php5.y:7221 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -9586,11 +9836,13 @@ yydefault: yyDollar[2].token.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(target.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 520: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6991 + //line php5/php5.y:7241 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -9603,6 +9855,8 @@ yydefault: yyDollar[2].token.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo(yyVAL.node.GetMeta()) yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(target.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } } diff --git a/php5/php5.y b/php5/php5.y index 543e801..5c6de94 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -775,7 +775,7 @@ constant_declaration: // save comments $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastConst.GetMeta()) - $3.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) + $3.Meta.SetTokenName(meta.NodeStart).AppendTo(constant.GetMeta()) $4.Meta.SetTokenName(meta.EqualToken).AppendTo(constant.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -794,7 +794,7 @@ constant_declaration: // save comments $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) + $2.Meta.SetTokenName(meta.NodeStart).AppendTo(constant.GetMeta()) $3.Meta.SetTokenName(meta.EqualToken).AppendTo(constant.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -881,7 +881,7 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo(label.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $2.Meta.SetTokenName(meta.ColonToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -1139,6 +1139,8 @@ unticked_statement: $2.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $2, meta.SemiColonToken) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_GLOBAL global_var_list ';' @@ -1207,6 +1209,8 @@ unticked_statement: $2.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $2, meta.SemiColonToken) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_UNSET '(' unset_variables ')' ';' @@ -1644,7 +1648,7 @@ class_entry_type: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.ClassToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1658,7 +1662,7 @@ class_entry_type: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo(classModifier.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $2.Meta.SetTokenName(meta.ClassToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -1685,7 +1689,7 @@ class_entry_type: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo(classModifier.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $2.Meta.SetTokenName(meta.ClassToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -1934,7 +1938,7 @@ declare_list: constant.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo(constant.GetMeta()) $2.Meta.SetTokenName(meta.EqualToken).AppendTo(constant.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -1951,7 +1955,7 @@ declare_list: // save comments $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) - $3.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) + $3.Meta.SetTokenName(meta.NodeStart).AppendTo(constant.GetMeta()) $4.Meta.SetTokenName(meta.EqualToken).AppendTo(constant.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -2269,13 +2273,20 @@ parameter: } // save comments + if $1 != nil { + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + } if $2 != nil { $2.Meta.SetTokenName(meta.AmpersandToken).AppendTo($$.GetMeta()) } if $3 != nil { $3.Meta.SetTokenName(meta.EllipsisToken).AppendTo($$.GetMeta()) } - $4.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + if $1 == nil && $2 == nil && $3 == nil { + $4.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + } else { + $4.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + } yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -2300,13 +2311,20 @@ parameter: } // save comments + if $1 != nil { + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + } if $2 != nil { $2.Meta.SetTokenName(meta.AmpersandToken).AppendTo($$.GetMeta()) } if $3 != nil { $3.Meta.SetTokenName(meta.EllipsisToken).AppendTo($$.GetMeta()) } - $4.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + if $1 == nil && $2 == nil && $3 == nil { + $4.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + } else { + $4.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + } yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) $5.Meta.SetTokenName(meta.EqualToken).AppendTo($$.GetMeta()) @@ -2426,6 +2444,9 @@ function_call_parameter: // save position $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($1)) + // save comments + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | variable @@ -2435,6 +2456,9 @@ function_call_parameter: // save position $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($1)) + // save comments + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | '&' w_variable @@ -2547,7 +2571,7 @@ static_var_list: // save comments $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) - $3.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + $3.Meta.SetTokenName(meta.NodeStart).AppendTo(staticVar.GetMeta()) yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -2566,7 +2590,7 @@ static_var_list: // save comments $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) - $3.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + $3.Meta.SetTokenName(meta.NodeStart).AppendTo(staticVar.GetMeta()) yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) $4.Meta.SetTokenName(meta.EqualToken).AppendTo(staticVar.GetMeta()) @@ -2585,7 +2609,7 @@ static_var_list: staticVar.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo(staticVar.GetMeta()) yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -2603,7 +2627,7 @@ static_var_list: staticVar.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo(staticVar.GetMeta()) yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) $2.Meta.SetTokenName(meta.EqualToken).AppendTo(staticVar.GetMeta()) @@ -2640,6 +2664,8 @@ class_statement: $3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken) + $1[0].GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | class_constant_declaration ';' @@ -3172,7 +3198,7 @@ class_constant_declaration: // save comments $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastConst.GetMeta()) - $3.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) + $3.Meta.SetTokenName(meta.NodeStart).AppendTo(constant.GetMeta()) $4.Meta.SetTokenName(meta.EqualToken).AppendTo(constant.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -3190,7 +3216,7 @@ class_constant_declaration: // save comments $1.Meta.SetTokenName(meta.ConstToken).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) + $2.Meta.SetTokenName(meta.NodeStart).AppendTo(constant.GetMeta()) $3.Meta.SetTokenName(meta.EqualToken).AppendTo(constant.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -3365,7 +3391,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $6)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo(list.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(list.GetMeta()) $4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(list.GetMeta()) $5.Meta.SetTokenName(meta.EqualToken).AppendTo($$.GetMeta()) @@ -3391,6 +3417,8 @@ expr_without_variable: // save position $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + // save comments $2.Meta.SetTokenName(meta.EqualToken).AppendTo($$.GetMeta()) $3.Meta.SetTokenName(meta.AmpersandToken).AppendTo($$.GetMeta()) @@ -3421,6 +3449,8 @@ expr_without_variable: $3.Meta.SetTokenName(meta.AmpersandToken).AppendTo($$.GetMeta()) $4.Meta.SetTokenName(meta.NodeStart).AppendTo(_new.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_CLONE expr @@ -3445,6 +3475,8 @@ expr_without_variable: // save comments $2.Meta.SetTokenName(meta.PlusEqualToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | variable T_MINUS_EQUAL expr @@ -3457,6 +3489,8 @@ expr_without_variable: // save comments $2.Meta.SetTokenName(meta.MinusEqualToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | variable T_MUL_EQUAL expr @@ -3469,6 +3503,8 @@ expr_without_variable: // save comments $2.Meta.SetTokenName(meta.MulEqualToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | variable T_POW_EQUAL expr @@ -3481,6 +3517,8 @@ expr_without_variable: // save comments $2.Meta.SetTokenName(meta.PowEqualToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | variable T_DIV_EQUAL expr @@ -3493,6 +3531,8 @@ expr_without_variable: // save comments $2.Meta.SetTokenName(meta.DivEqualToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | variable T_CONCAT_EQUAL expr @@ -3505,6 +3545,8 @@ expr_without_variable: // save comments $2.Meta.SetTokenName(meta.ConcatEqualToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | variable T_MOD_EQUAL expr @@ -3517,6 +3559,8 @@ expr_without_variable: // save comments $2.Meta.SetTokenName(meta.ModEqualToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | variable T_AND_EQUAL expr @@ -3529,6 +3573,8 @@ expr_without_variable: // save comments $2.Meta.SetTokenName(meta.AndEqualToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | variable T_OR_EQUAL expr @@ -3541,6 +3587,8 @@ expr_without_variable: // save comments $2.Meta.SetTokenName(meta.OrEqualToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | variable T_XOR_EQUAL expr @@ -3553,6 +3601,8 @@ expr_without_variable: // save comments $2.Meta.SetTokenName(meta.XorEqualToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | variable T_SL_EQUAL expr @@ -3565,6 +3615,8 @@ expr_without_variable: // save comments $2.Meta.SetTokenName(meta.SlEqualToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | variable T_SR_EQUAL expr @@ -3577,6 +3629,8 @@ expr_without_variable: // save comments $2.Meta.SetTokenName(meta.SrEqualToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | rw_variable T_INC @@ -3589,6 +3643,8 @@ expr_without_variable: // save comments $2.Meta.SetTokenName(meta.IncToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_INC rw_variable @@ -3613,6 +3669,8 @@ expr_without_variable: // save comments $2.Meta.SetTokenName(meta.DecToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_DEC rw_variable @@ -3637,6 +3695,8 @@ expr_without_variable: // save comments $2.Meta.SetTokenName(meta.BooleanOrToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr T_BOOLEAN_AND expr @@ -3649,6 +3709,8 @@ expr_without_variable: // save comments $2.Meta.SetTokenName(meta.BooleanAndToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr T_LOGICAL_OR expr @@ -3661,6 +3723,8 @@ expr_without_variable: // save comments $2.Meta.SetTokenName(meta.LogicalOrToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr T_LOGICAL_AND expr @@ -3673,6 +3737,8 @@ expr_without_variable: // save comments $2.Meta.SetTokenName(meta.LogicalAndToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr T_LOGICAL_XOR expr @@ -3685,6 +3751,8 @@ expr_without_variable: // save comments $2.Meta.SetTokenName(meta.LogicalXorToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr '|' expr @@ -3697,6 +3765,8 @@ expr_without_variable: // save comments $2.Meta.SetTokenName(meta.VerticalBarToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr '&' expr @@ -3709,6 +3779,8 @@ expr_without_variable: // save comments $2.Meta.SetTokenName(meta.AmpersandToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr '^' expr @@ -3721,6 +3793,8 @@ expr_without_variable: // save comments $2.Meta.SetTokenName(meta.CaretToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr '.' expr @@ -3733,6 +3807,8 @@ expr_without_variable: // save comments $2.Meta.SetTokenName(meta.DotToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr '+' expr @@ -3745,6 +3821,8 @@ expr_without_variable: // save comments $2.Meta.SetTokenName(meta.PlusToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr '-' expr @@ -3757,6 +3835,8 @@ expr_without_variable: // save comments $2.Meta.SetTokenName(meta.MinusToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr '*' expr @@ -3769,6 +3849,8 @@ expr_without_variable: // save comments $2.Meta.SetTokenName(meta.AsteriskToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr T_POW expr @@ -3781,6 +3863,8 @@ expr_without_variable: // save comments $2.Meta.SetTokenName(meta.PowToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr '/' expr @@ -3793,6 +3877,8 @@ expr_without_variable: // save comments $2.Meta.SetTokenName(meta.SlashToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr '%' expr @@ -3805,6 +3891,8 @@ expr_without_variable: // save comments $2.Meta.SetTokenName(meta.PercentToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr T_SL expr @@ -3817,6 +3905,8 @@ expr_without_variable: // save comments $2.Meta.SetTokenName(meta.SlToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr T_SR expr @@ -3829,6 +3919,8 @@ expr_without_variable: // save comments $2.Meta.SetTokenName(meta.SrToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | '+' expr %prec T_INC @@ -3889,6 +3981,8 @@ expr_without_variable: // save comments $2.Meta.SetTokenName(meta.IsIdenticalToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr T_IS_NOT_IDENTICAL expr @@ -3901,6 +3995,8 @@ expr_without_variable: // save comments $2.Meta.SetTokenName(meta.IsNotIdenticalToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr T_IS_EQUAL expr @@ -3913,6 +4009,8 @@ expr_without_variable: // save comments $2.Meta.SetTokenName(meta.IsEqualToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr T_IS_NOT_EQUAL expr @@ -3926,6 +4024,8 @@ expr_without_variable: $2.Meta.SetTokenName(meta.IsNotEqualToken).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $2, meta.IsNotEqualToken) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr '<' expr @@ -3938,6 +4038,8 @@ expr_without_variable: // save comments $2.Meta.SetTokenName(meta.LessToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr T_IS_SMALLER_OR_EQUAL expr @@ -3950,6 +4052,8 @@ expr_without_variable: // save comments $2.Meta.SetTokenName(meta.IsSmallerOrEqualToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr '>' expr @@ -3962,6 +4066,8 @@ expr_without_variable: // save comments $2.Meta.SetTokenName(meta.GreaterToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr T_IS_GREATER_OR_EQUAL expr @@ -3974,6 +4080,8 @@ expr_without_variable: // save comments $2.Meta.SetTokenName(meta.IsGreaterOrEqualToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr T_INSTANCEOF class_name_reference @@ -3986,6 +4094,8 @@ expr_without_variable: // save comments $2.Meta.SetTokenName(meta.InstanceofToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | parenthesis_expr @@ -4007,29 +4117,34 @@ expr_without_variable: { $$ = $2 + // save comments + yylex.(*Parser).prependMetaToken($$, $1, meta.NodeStart) + $1.Meta.SetTokenName(meta.NodeStart).PrependTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.NodeEnd).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $3, meta.NodeEnd) + for _, n := range($4) { switch nn := n.(type) { case *expr.ArrayDimFetch: nn.Variable = $$ $$ = nn + nn.Variable.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) case *expr.PropertyFetch: nn.Variable = $$ $$ = nn + nn.Variable.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) case *expr.MethodCall: nn.Variable = $$ $$ = nn + nn.Variable.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) } // save position $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($$, n)) } - // save comments - $1.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr '?' expr ':' expr @@ -4043,6 +4158,8 @@ expr_without_variable: $2.Meta.SetTokenName(meta.QuestionMarkToken).AppendTo($$.GetMeta()) $4.Meta.SetTokenName(meta.ColonToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr '?' ':' expr @@ -4056,6 +4173,8 @@ expr_without_variable: $2.Meta.SetTokenName(meta.QuestionMarkToken).AppendTo($$.GetMeta()) $3.Meta.SetTokenName(meta.ColonToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | internal_functions_in_yacc @@ -4356,6 +4475,8 @@ combined_scalar_offset: $4.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $4, meta.CloseSquareBracket) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | combined_scalar_offset '[' dim_offset ']' @@ -4371,6 +4492,8 @@ combined_scalar_offset: $4.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $4, meta.CloseSquareBracket) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_CONSTANT_ENCAPSED_STRING '[' dim_offset ']' @@ -4383,6 +4506,7 @@ combined_scalar_offset: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(str, $4)) // save comments + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $2.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $2, meta.OpenSquareBracket) $4.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo($$.GetMeta()) @@ -4403,6 +4527,8 @@ combined_scalar_offset: $4.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $4, meta.CloseSquareBracket) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -4552,6 +4678,9 @@ function_call: name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(name, $2)) + // save comments + $1[0].GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_NAMESPACE T_NS_SEPARATOR namespace_name function_call_parameter_list @@ -4564,7 +4693,7 @@ function_call: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(funcName, $4)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo(funcName.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $2.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo(funcName.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -4579,7 +4708,7 @@ function_call: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(funcName, $3)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo(funcName.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4592,6 +4721,7 @@ function_call: // save comments $2.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4604,6 +4734,7 @@ function_call: // save comments $2.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4616,6 +4747,7 @@ function_call: // save comments $2.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4628,6 +4760,7 @@ function_call: // save comments $2.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4637,6 +4770,7 @@ function_call: // save position $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $2)) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4661,6 +4795,9 @@ class_name: // save position $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) + + // save comments + $1[0].GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4698,6 +4835,9 @@ fully_qualified_class_name: // save position $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) + + // save comments + $1[0].GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4757,11 +4897,13 @@ dynamic_class_name_reference: nn.Variable = $$ $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn)) $$ = nn + nn.Variable.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) case *expr.PropertyFetch: nn.Variable = $$ $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn)) $$ = nn + nn.Variable.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) } } @@ -4771,11 +4913,13 @@ dynamic_class_name_reference: nn.Variable = $$ $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn)) $$ = nn + nn.Variable.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) case *expr.PropertyFetch: nn.Variable = $$ $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn)) $$ = nn + nn.Variable.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) } } @@ -5058,6 +5202,8 @@ static_class_constant: $2.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo($$.GetMeta()) $3.Meta.SetTokenName(meta.NodeStart).AppendTo(target.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -5093,6 +5239,9 @@ static_scalar_value: name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(name)) + // save comments + $1[0].GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_NAMESPACE T_NS_SEPARATOR namespace_name @@ -5105,7 +5254,7 @@ static_scalar_value: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $2.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo(name.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -5120,7 +5269,7 @@ static_scalar_value: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5191,6 +5340,8 @@ static_operation: $4.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $4, meta.CloseSquareBracket) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | static_scalar_value '+' static_scalar_value @@ -5203,6 +5354,8 @@ static_operation: // save comments $2.Meta.SetTokenName(meta.PlusToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | static_scalar_value '-' static_scalar_value @@ -5214,6 +5367,8 @@ static_operation: // save comments $2.Meta.SetTokenName(meta.MinusToken).AppendTo($$.GetMeta()) + + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5226,6 +5381,8 @@ static_operation: // save comments $2.Meta.SetTokenName(meta.AsteriskToken).AppendTo($$.GetMeta()) + + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5238,6 +5395,8 @@ static_operation: // save comments $2.Meta.SetTokenName(meta.PowToken).AppendTo($$.GetMeta()) + + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5250,6 +5409,8 @@ static_operation: // save comments $2.Meta.SetTokenName(meta.SlashToken).AppendTo($$.GetMeta()) + + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5262,6 +5423,8 @@ static_operation: // save comments $2.Meta.SetTokenName(meta.PercentToken).AppendTo($$.GetMeta()) + + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5298,6 +5461,8 @@ static_operation: // save comments $2.Meta.SetTokenName(meta.VerticalBarToken).AppendTo($$.GetMeta()) + + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5310,6 +5475,8 @@ static_operation: // save comments $2.Meta.SetTokenName(meta.AmpersandToken).AppendTo($$.GetMeta()) + + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5322,6 +5489,8 @@ static_operation: // save comments $2.Meta.SetTokenName(meta.CaretToken).AppendTo($$.GetMeta()) + + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5334,6 +5503,8 @@ static_operation: // save comments $2.Meta.SetTokenName(meta.SlToken).AppendTo($$.GetMeta()) + + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5346,6 +5517,8 @@ static_operation: // save comments $2.Meta.SetTokenName(meta.SrToken).AppendTo($$.GetMeta()) + + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5358,6 +5531,8 @@ static_operation: // save comments $2.Meta.SetTokenName(meta.DotToken).AppendTo($$.GetMeta()) + + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5370,6 +5545,8 @@ static_operation: // save comments $2.Meta.SetTokenName(meta.LogicalXorToken).AppendTo($$.GetMeta()) + + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5382,6 +5559,8 @@ static_operation: // save comments $2.Meta.SetTokenName(meta.LogicalAndToken).AppendTo($$.GetMeta()) + + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5394,6 +5573,8 @@ static_operation: // save comments $2.Meta.SetTokenName(meta.LogicalOrToken).AppendTo($$.GetMeta()) + + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5406,6 +5587,8 @@ static_operation: // save comments $2.Meta.SetTokenName(meta.BooleanAndToken).AppendTo($$.GetMeta()) + + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5418,6 +5601,8 @@ static_operation: // save comments $2.Meta.SetTokenName(meta.BooleanOrToken).AppendTo($$.GetMeta()) + + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5430,6 +5615,8 @@ static_operation: // save comments $2.Meta.SetTokenName(meta.IsIdenticalToken).AppendTo($$.GetMeta()) + + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5442,6 +5629,8 @@ static_operation: // save comments $2.Meta.SetTokenName(meta.IsNotIdenticalToken).AppendTo($$.GetMeta()) + + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5454,6 +5643,8 @@ static_operation: // save comments $2.Meta.SetTokenName(meta.IsEqualToken).AppendTo($$.GetMeta()) + + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5467,6 +5658,8 @@ static_operation: // save comments $2.Meta.SetTokenName(meta.IsNotEqualToken).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $2, meta.IsNotEqualToken) + + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5479,6 +5672,8 @@ static_operation: // save comments $2.Meta.SetTokenName(meta.LessToken).AppendTo($$.GetMeta()) + + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5491,6 +5686,8 @@ static_operation: // save comments $2.Meta.SetTokenName(meta.GreaterToken).AppendTo($$.GetMeta()) + + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5503,6 +5700,8 @@ static_operation: // save comments $2.Meta.SetTokenName(meta.IsSmallerOrEqualToken).AppendTo($$.GetMeta()) + + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5515,6 +5714,8 @@ static_operation: // save comments $2.Meta.SetTokenName(meta.IsGreaterOrEqualToken).AppendTo($$.GetMeta()) + + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5528,6 +5729,8 @@ static_operation: // save comments $2.Meta.SetTokenName(meta.QuestionMarkToken).AppendTo($$.GetMeta()) $3.Meta.SetTokenName(meta.ColonToken).AppendTo($$.GetMeta()) + + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5541,6 +5744,8 @@ static_operation: // save comments $2.Meta.SetTokenName(meta.QuestionMarkToken).AppendTo($$.GetMeta()) $4.Meta.SetTokenName(meta.ColonToken).AppendTo($$.GetMeta()) + + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5573,8 +5778,10 @@ static_operation: $$ = $2 // save comments - $1.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) + yylex.(*Parser).prependMetaToken($$, $1, meta.NodeStart) + $1.Meta.SetTokenName(meta.NodeStart).PrependTo($$.GetMeta()) + $3.Meta.SetTokenName(meta.NodeEnd).AppendTo($$.GetMeta()) + yylex.(*Parser).appendMetaToken($$, $3, meta.NodeEnd) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5596,6 +5803,9 @@ general_constant: name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(name)) + // save comments + $1[0].GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_NAMESPACE T_NS_SEPARATOR namespace_name @@ -5606,7 +5816,7 @@ general_constant: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(name)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $2.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo(name.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -5621,7 +5831,7 @@ general_constant: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(name)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5743,6 +5953,8 @@ non_empty_static_array_pair_list: $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) $4.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo(arrayItem.GetMeta()) + $3.GetMeta().Cut(newInheritMetaFilter()).PrependTo(arrayItem.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | non_empty_static_array_pair_list ',' static_scalar_value @@ -5756,6 +5968,8 @@ non_empty_static_array_pair_list: // save comments $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) + $3.GetMeta().Cut(newInheritMetaFilter()).PrependTo(arrayItem.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | static_scalar_value T_DOUBLE_ARROW static_scalar_value @@ -5769,6 +5983,8 @@ non_empty_static_array_pair_list: // save comments $2.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo(arrayItem.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo(arrayItem.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | static_scalar_value @@ -5779,6 +5995,8 @@ non_empty_static_array_pair_list: // save position arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($1)) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo(arrayItem.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -5804,8 +6022,8 @@ parenthesis_expr: $$ = $2 // save comments - $1.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $1, meta.OpenParenthesisToken) + yylex.(*Parser).prependMetaToken($$, $1, meta.OpenParenthesisToken) + $1.Meta.SetTokenName(meta.OpenParenthesisToken).PrependTo($$.GetMeta()) $3.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $3, meta.CloseParenthesisToken) @@ -5816,8 +6034,8 @@ parenthesis_expr: $$ = $2 // save comments - $1.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $1, meta.OpenParenthesisToken) + yylex.(*Parser).prependMetaToken($$, $1, meta.OpenParenthesisToken) + $1.Meta.SetTokenName(meta.OpenParenthesisToken).PrependTo($$.GetMeta()) $3.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $3, meta.CloseParenthesisToken) @@ -5873,16 +6091,19 @@ variable: nn.Variable = $$ nn.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn)) $$ = nn + nn.Variable.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) case *expr.PropertyFetch: nn.Variable = $$ nn.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn)) $$ = nn + nn.Variable.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) case *expr.MethodCall: nn.Variable = $$ nn.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn)) $$ = nn + nn.Variable.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) } } @@ -5892,16 +6113,19 @@ variable: nn.Variable = $$ nn.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn)) $$ = nn + nn.Variable.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) case *expr.PropertyFetch: nn.Variable = $$ nn.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn)) $$ = nn + nn.Variable.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) case *expr.MethodCall: nn.Variable = $$ nn.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn)) $$ = nn + nn.Variable.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) } } @@ -6048,6 +6272,8 @@ static_member: // save comments $2.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | variable_class_name T_PAAMAYIM_NEKUDOTAYIM variable_without_objects @@ -6060,6 +6286,8 @@ static_member: // save comments $2.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -6087,6 +6315,8 @@ array_function_dereference: $4.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $4, meta.CloseSquareBracket) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | function_call '[' dim_offset ']' @@ -6102,6 +6332,8 @@ array_function_dereference: $4.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $4, meta.CloseSquareBracket) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -6169,6 +6401,8 @@ reference_variable: $4.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $4, meta.CloseSquareBracket) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | reference_variable '{' expr '}' @@ -6184,6 +6418,8 @@ reference_variable: $4.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $4, meta.CloseCurlyBracesToken) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | compound_variable @@ -6331,8 +6567,8 @@ variable_name: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) + yylex.(*Parser).prependMetaToken($$, $1, meta.NodeStart) + $1.Meta.SetTokenName(meta.NodeStart).PrependTo($$.GetMeta()) $3.Meta.SetTokenName(meta.NodeEnd).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $3, meta.NodeEnd) @@ -6410,6 +6646,8 @@ assignment_list_element: // save position $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($1)) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_LIST '(' assignment_list ')' @@ -6422,7 +6660,7 @@ assignment_list_element: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(item)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo(item.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(item.GetMeta()) $4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(item.GetMeta()) @@ -6474,6 +6712,8 @@ non_empty_array_pair_list: $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) $4.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo(arrayItem.GetMeta()) + $3.GetMeta().Cut(newInheritMetaFilter()).PrependTo(arrayItem.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | non_empty_array_pair_list ',' expr @@ -6487,6 +6727,8 @@ non_empty_array_pair_list: // save comments $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) + $3.GetMeta().Cut(newInheritMetaFilter()).PrependTo(arrayItem.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr T_DOUBLE_ARROW expr @@ -6500,6 +6742,8 @@ non_empty_array_pair_list: // save comments $2.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo(arrayItem.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo(arrayItem.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr @@ -6510,6 +6754,8 @@ non_empty_array_pair_list: // save position arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($1)) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo(arrayItem.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | non_empty_array_pair_list ',' expr T_DOUBLE_ARROW '&' w_variable @@ -6527,6 +6773,8 @@ non_empty_array_pair_list: $4.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo(arrayItem.GetMeta()) $5.Meta.SetTokenName(meta.NodeStart).AppendTo(reference.GetMeta()) + $3.GetMeta().Cut(newInheritMetaFilter()).PrependTo(arrayItem.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | non_empty_array_pair_list ',' '&' w_variable @@ -6541,7 +6789,7 @@ non_empty_array_pair_list: // save comments $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) - $3.Meta.SetTokenName(meta.NodeStart).AppendTo(reference.GetMeta()) + $3.Meta.SetTokenName(meta.NodeStart).AppendTo(arrayItem.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6559,6 +6807,8 @@ non_empty_array_pair_list: $2.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo(arrayItem.GetMeta()) $3.Meta.SetTokenName(meta.NodeStart).AppendTo(reference.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo(arrayItem.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | '&' w_variable @@ -6572,7 +6822,7 @@ non_empty_array_pair_list: arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo(reference.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo(arrayItem.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6647,7 +6897,6 @@ encaps_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) $2.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $2, meta.OpenSquareBracket) @@ -6670,7 +6919,6 @@ encaps_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) $2.Meta.SetTokenName(meta.ObjectOperatorToken).AppendTo($$.GetMeta()) $3.Meta.SetTokenName(meta.NodeStart).AppendTo(fetch.GetMeta()) @@ -6687,7 +6935,6 @@ encaps_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) $3.Meta.SetTokenName(meta.NodeEnd).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $3, meta.NodeEnd) @@ -6706,7 +6953,6 @@ encaps_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) $2.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) $3.Meta.SetTokenName(meta.NodeEnd).AppendTo($$.GetMeta()) @@ -6726,7 +6972,6 @@ encaps_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $6)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) $3.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $3, meta.OpenSquareBracket) @@ -6742,7 +6987,6 @@ encaps_var: $$ = $2; // save comments - $1.Meta.SetTokenName(meta.NodeStart).PrependTo($$.GetMeta()) yylex.(*Parser).prependMetaToken($$, $1, meta.NodeStart) $3.Meta.SetTokenName(meta.NodeEnd).AppendTo($$.GetMeta()) yylex.(*Parser).appendMetaToken($$, $3, meta.NodeEnd) @@ -6949,6 +7193,8 @@ class_constant: $2.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo($$.GetMeta()) $3.Meta.SetTokenName(meta.NodeStart).AppendTo(target.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | variable_class_name T_PAAMAYIM_NEKUDOTAYIM T_STRING @@ -6964,6 +7210,8 @@ class_constant: $2.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo($$.GetMeta()) $3.Meta.SetTokenName(meta.NodeStart).AppendTo(target.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -6982,6 +7230,8 @@ static_class_name_scalar: $2.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo($$.GetMeta()) $3.Meta.SetTokenName(meta.NodeStart).AppendTo(target.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -7000,6 +7250,8 @@ class_name_scalar: $2.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo($$.GetMeta()) $3.Meta.SetTokenName(meta.NodeStart).AppendTo(target.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; From f2e5271e2ad34d5643027f067ba5e6b2314e3ac0 Mon Sep 17 00:00:00 2001 From: z7zmey Date: Fri, 4 Jan 2019 10:01:12 +0200 Subject: [PATCH 110/117] #70: [php5] inherit meta.Data at assign.Assign --- php5/php5.go | 578 ++++++++++++++++++++++++++------------------------- php5/php5.y | 2 + 2 files changed, 292 insertions(+), 288 deletions(-) diff --git a/php5/php5.go b/php5/php5.go index 822ab09..77757d7 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -348,7 +348,7 @@ const yyEofCode = 1 const yyErrCode = 2 const yyInitialStackSize = 16 -//line php5/php5.y:7259 +//line php5/php5.y:7261 type simpleIndirectReference struct { all []*expr.Variable @@ -5638,11 +5638,13 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.EqualToken).AppendTo(yyVAL.node.GetMeta()) + yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 234: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3414 + //line php5/php5.y:3416 { yyVAL.node = assign.NewReference(yyDollar[1].node, yyDollar[4].node) @@ -5659,7 +5661,7 @@ yydefault: } case 235: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:3429 + //line php5/php5.y:3431 { var _new *expr.New @@ -5689,7 +5691,7 @@ yydefault: } case 236: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3457 + //line php5/php5.y:3459 { yyVAL.node = expr.NewClone(yyDollar[2].node) @@ -5703,7 +5705,7 @@ yydefault: } case 237: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3469 + //line php5/php5.y:3471 { yyVAL.node = assign.NewPlus(yyDollar[1].node, yyDollar[3].node) @@ -5719,7 +5721,7 @@ yydefault: } case 238: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3483 + //line php5/php5.y:3485 { yyVAL.node = assign.NewMinus(yyDollar[1].node, yyDollar[3].node) @@ -5735,7 +5737,7 @@ yydefault: } case 239: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3497 + //line php5/php5.y:3499 { yyVAL.node = assign.NewMul(yyDollar[1].node, yyDollar[3].node) @@ -5751,7 +5753,7 @@ yydefault: } case 240: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3511 + //line php5/php5.y:3513 { yyVAL.node = assign.NewPow(yyDollar[1].node, yyDollar[3].node) @@ -5767,7 +5769,7 @@ yydefault: } case 241: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3525 + //line php5/php5.y:3527 { yyVAL.node = assign.NewDiv(yyDollar[1].node, yyDollar[3].node) @@ -5783,7 +5785,7 @@ yydefault: } case 242: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3539 + //line php5/php5.y:3541 { yyVAL.node = assign.NewConcat(yyDollar[1].node, yyDollar[3].node) @@ -5799,7 +5801,7 @@ yydefault: } case 243: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3553 + //line php5/php5.y:3555 { yyVAL.node = assign.NewMod(yyDollar[1].node, yyDollar[3].node) @@ -5815,7 +5817,7 @@ yydefault: } case 244: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3567 + //line php5/php5.y:3569 { yyVAL.node = assign.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) @@ -5831,7 +5833,7 @@ yydefault: } case 245: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3581 + //line php5/php5.y:3583 { yyVAL.node = assign.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) @@ -5847,7 +5849,7 @@ yydefault: } case 246: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3595 + //line php5/php5.y:3597 { yyVAL.node = assign.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) @@ -5863,7 +5865,7 @@ yydefault: } case 247: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3609 + //line php5/php5.y:3611 { yyVAL.node = assign.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) @@ -5879,7 +5881,7 @@ yydefault: } case 248: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3623 + //line php5/php5.y:3625 { yyVAL.node = assign.NewShiftRight(yyDollar[1].node, yyDollar[3].node) @@ -5895,7 +5897,7 @@ yydefault: } case 249: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3637 + //line php5/php5.y:3639 { yyVAL.node = expr.NewPostInc(yyDollar[1].node) @@ -5911,7 +5913,7 @@ yydefault: } case 250: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3651 + //line php5/php5.y:3653 { yyVAL.node = expr.NewPreInc(yyDollar[2].node) @@ -5925,7 +5927,7 @@ yydefault: } case 251: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3663 + //line php5/php5.y:3665 { yyVAL.node = expr.NewPostDec(yyDollar[1].node) @@ -5941,7 +5943,7 @@ yydefault: } case 252: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3677 + //line php5/php5.y:3679 { yyVAL.node = expr.NewPreDec(yyDollar[2].node) @@ -5955,7 +5957,7 @@ yydefault: } case 253: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3689 + //line php5/php5.y:3691 { yyVAL.node = binary.NewBooleanOr(yyDollar[1].node, yyDollar[3].node) @@ -5971,7 +5973,7 @@ yydefault: } case 254: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3703 + //line php5/php5.y:3705 { yyVAL.node = binary.NewBooleanAnd(yyDollar[1].node, yyDollar[3].node) @@ -5987,7 +5989,7 @@ yydefault: } case 255: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3717 + //line php5/php5.y:3719 { yyVAL.node = binary.NewLogicalOr(yyDollar[1].node, yyDollar[3].node) @@ -6003,7 +6005,7 @@ yydefault: } case 256: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3731 + //line php5/php5.y:3733 { yyVAL.node = binary.NewLogicalAnd(yyDollar[1].node, yyDollar[3].node) @@ -6019,7 +6021,7 @@ yydefault: } case 257: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3745 + //line php5/php5.y:3747 { yyVAL.node = binary.NewLogicalXor(yyDollar[1].node, yyDollar[3].node) @@ -6035,7 +6037,7 @@ yydefault: } case 258: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3759 + //line php5/php5.y:3761 { yyVAL.node = binary.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) @@ -6051,7 +6053,7 @@ yydefault: } case 259: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3773 + //line php5/php5.y:3775 { yyVAL.node = binary.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) @@ -6067,7 +6069,7 @@ yydefault: } case 260: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3787 + //line php5/php5.y:3789 { yyVAL.node = binary.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) @@ -6083,7 +6085,7 @@ yydefault: } case 261: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3801 + //line php5/php5.y:3803 { yyVAL.node = binary.NewConcat(yyDollar[1].node, yyDollar[3].node) @@ -6099,7 +6101,7 @@ yydefault: } case 262: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3815 + //line php5/php5.y:3817 { yyVAL.node = binary.NewPlus(yyDollar[1].node, yyDollar[3].node) @@ -6115,7 +6117,7 @@ yydefault: } case 263: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3829 + //line php5/php5.y:3831 { yyVAL.node = binary.NewMinus(yyDollar[1].node, yyDollar[3].node) @@ -6131,7 +6133,7 @@ yydefault: } case 264: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3843 + //line php5/php5.y:3845 { yyVAL.node = binary.NewMul(yyDollar[1].node, yyDollar[3].node) @@ -6147,7 +6149,7 @@ yydefault: } case 265: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3857 + //line php5/php5.y:3859 { yyVAL.node = binary.NewPow(yyDollar[1].node, yyDollar[3].node) @@ -6163,7 +6165,7 @@ yydefault: } case 266: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3871 + //line php5/php5.y:3873 { yyVAL.node = binary.NewDiv(yyDollar[1].node, yyDollar[3].node) @@ -6179,7 +6181,7 @@ yydefault: } case 267: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3885 + //line php5/php5.y:3887 { yyVAL.node = binary.NewMod(yyDollar[1].node, yyDollar[3].node) @@ -6195,7 +6197,7 @@ yydefault: } case 268: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3899 + //line php5/php5.y:3901 { yyVAL.node = binary.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) @@ -6211,7 +6213,7 @@ yydefault: } case 269: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3913 + //line php5/php5.y:3915 { yyVAL.node = binary.NewShiftRight(yyDollar[1].node, yyDollar[3].node) @@ -6227,7 +6229,7 @@ yydefault: } case 270: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3927 + //line php5/php5.y:3929 { yyVAL.node = expr.NewUnaryPlus(yyDollar[2].node) @@ -6241,7 +6243,7 @@ yydefault: } case 271: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3939 + //line php5/php5.y:3941 { yyVAL.node = expr.NewUnaryMinus(yyDollar[2].node) @@ -6255,7 +6257,7 @@ yydefault: } case 272: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3951 + //line php5/php5.y:3953 { yyVAL.node = expr.NewBooleanNot(yyDollar[2].node) @@ -6269,7 +6271,7 @@ yydefault: } case 273: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3963 + //line php5/php5.y:3965 { yyVAL.node = expr.NewBitwiseNot(yyDollar[2].node) @@ -6283,7 +6285,7 @@ yydefault: } case 274: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3975 + //line php5/php5.y:3977 { yyVAL.node = binary.NewIdentical(yyDollar[1].node, yyDollar[3].node) @@ -6299,7 +6301,7 @@ yydefault: } case 275: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3989 + //line php5/php5.y:3991 { yyVAL.node = binary.NewNotIdentical(yyDollar[1].node, yyDollar[3].node) @@ -6315,7 +6317,7 @@ yydefault: } case 276: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4003 + //line php5/php5.y:4005 { yyVAL.node = binary.NewEqual(yyDollar[1].node, yyDollar[3].node) @@ -6331,7 +6333,7 @@ yydefault: } case 277: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4017 + //line php5/php5.y:4019 { yyVAL.node = binary.NewNotEqual(yyDollar[1].node, yyDollar[3].node) @@ -6348,7 +6350,7 @@ yydefault: } case 278: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4032 + //line php5/php5.y:4034 { yyVAL.node = binary.NewSmaller(yyDollar[1].node, yyDollar[3].node) @@ -6364,7 +6366,7 @@ yydefault: } case 279: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4046 + //line php5/php5.y:4048 { yyVAL.node = binary.NewSmallerOrEqual(yyDollar[1].node, yyDollar[3].node) @@ -6380,7 +6382,7 @@ yydefault: } case 280: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4060 + //line php5/php5.y:4062 { yyVAL.node = binary.NewGreater(yyDollar[1].node, yyDollar[3].node) @@ -6396,7 +6398,7 @@ yydefault: } case 281: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4074 + //line php5/php5.y:4076 { yyVAL.node = binary.NewGreaterOrEqual(yyDollar[1].node, yyDollar[3].node) @@ -6412,7 +6414,7 @@ yydefault: } case 282: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4088 + //line php5/php5.y:4090 { yyVAL.node = expr.NewInstanceOf(yyDollar[1].node, yyDollar[3].node) @@ -6428,7 +6430,7 @@ yydefault: } case 283: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4102 + //line php5/php5.y:4104 { yyVAL.node = yyDollar[1].node @@ -6439,7 +6441,7 @@ yydefault: } case 284: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4111 + //line php5/php5.y:4113 { yyVAL.node = yyDollar[1].node @@ -6447,7 +6449,7 @@ yydefault: } case 285: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4117 + //line php5/php5.y:4119 { yyVAL.node = yyDollar[2].node @@ -6483,7 +6485,7 @@ yydefault: } case 286: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:4151 + //line php5/php5.y:4153 { yyVAL.node = expr.NewTernary(yyDollar[1].node, yyDollar[3].node, yyDollar[5].node) @@ -6500,7 +6502,7 @@ yydefault: } case 287: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4166 + //line php5/php5.y:4168 { yyVAL.node = expr.NewTernary(yyDollar[1].node, nil, yyDollar[4].node) @@ -6517,7 +6519,7 @@ yydefault: } case 288: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4181 + //line php5/php5.y:4183 { yyVAL.node = yyDollar[1].node @@ -6525,7 +6527,7 @@ yydefault: } case 289: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4187 + //line php5/php5.y:4189 { yyVAL.node = cast.NewInt(yyDollar[2].node) @@ -6540,7 +6542,7 @@ yydefault: } case 290: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4200 + //line php5/php5.y:4202 { yyVAL.node = cast.NewDouble(yyDollar[2].node) @@ -6555,7 +6557,7 @@ yydefault: } case 291: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4213 + //line php5/php5.y:4215 { yyVAL.node = cast.NewString(yyDollar[2].node) @@ -6570,7 +6572,7 @@ yydefault: } case 292: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4226 + //line php5/php5.y:4228 { yyVAL.node = cast.NewArray(yyDollar[2].node) @@ -6585,7 +6587,7 @@ yydefault: } case 293: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4239 + //line php5/php5.y:4241 { yyVAL.node = cast.NewObject(yyDollar[2].node) @@ -6600,7 +6602,7 @@ yydefault: } case 294: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4252 + //line php5/php5.y:4254 { yyVAL.node = cast.NewBool(yyDollar[2].node) @@ -6615,7 +6617,7 @@ yydefault: } case 295: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4265 + //line php5/php5.y:4267 { yyVAL.node = cast.NewUnset(yyDollar[2].node) @@ -6630,7 +6632,7 @@ yydefault: } case 296: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4278 + //line php5/php5.y:4280 { var e *expr.Exit if yyDollar[2].node != nil { @@ -6659,7 +6661,7 @@ yydefault: } case 297: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4305 + //line php5/php5.y:4307 { yyVAL.node = expr.NewErrorSuppress(yyDollar[2].node) @@ -6673,7 +6675,7 @@ yydefault: } case 298: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4317 + //line php5/php5.y:4319 { yyVAL.node = yyDollar[1].node @@ -6681,7 +6683,7 @@ yydefault: } case 299: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4323 + //line php5/php5.y:4325 { yyVAL.node = yyDollar[1].node @@ -6689,7 +6691,7 @@ yydefault: } case 300: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4329 + //line php5/php5.y:4331 { yyVAL.node = yyDollar[1].node @@ -6697,7 +6699,7 @@ yydefault: } case 301: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4335 + //line php5/php5.y:4337 { yyVAL.node = expr.NewShellExec(yyDollar[2].list) @@ -6711,7 +6713,7 @@ yydefault: } case 302: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4347 + //line php5/php5.y:4349 { yyVAL.node = expr.NewPrint(yyDollar[2].node) @@ -6725,7 +6727,7 @@ yydefault: } case 303: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4359 + //line php5/php5.y:4361 { yyVAL.node = expr.NewYield(nil, nil) @@ -6739,7 +6741,7 @@ yydefault: } case 304: yyDollar = yyS[yypt-9 : yypt+1] - //line php5/php5.y:4371 + //line php5/php5.y:4373 { yyVAL.node = expr.NewClosure(yyDollar[4].list, yyDollar[6].ClosureUse, nil, yyDollar[8].list, false, yyDollar[2].token != nil, "") @@ -6760,7 +6762,7 @@ yydefault: } case 305: yyDollar = yyS[yypt-10 : yypt+1] - //line php5/php5.y:4390 + //line php5/php5.y:4392 { yyVAL.node = expr.NewClosure(yyDollar[5].list, yyDollar[7].ClosureUse, nil, yyDollar[9].list, true, yyDollar[3].token != nil, "") @@ -6782,7 +6784,7 @@ yydefault: } case 306: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4413 + //line php5/php5.y:4415 { yyVAL.node = expr.NewYield(nil, yyDollar[2].node) @@ -6796,7 +6798,7 @@ yydefault: } case 307: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4425 + //line php5/php5.y:4427 { yyVAL.node = expr.NewYield(nil, yyDollar[2].node) @@ -6810,7 +6812,7 @@ yydefault: } case 308: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4437 + //line php5/php5.y:4439 { yyVAL.node = expr.NewYield(yyDollar[2].node, yyDollar[4].node) @@ -6825,7 +6827,7 @@ yydefault: } case 309: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4450 + //line php5/php5.y:4452 { yyVAL.node = expr.NewYield(yyDollar[2].node, yyDollar[4].node) @@ -6840,7 +6842,7 @@ yydefault: } case 310: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4466 + //line php5/php5.y:4468 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -6859,7 +6861,7 @@ yydefault: } case 311: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4483 + //line php5/php5.y:4485 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -6878,7 +6880,7 @@ yydefault: } case 312: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4500 + //line php5/php5.y:4502 { str := scalar.NewString(yyDollar[1].token.Value) yyVAL.node = expr.NewArrayDimFetch(str, yyDollar[3].node) @@ -6898,7 +6900,7 @@ yydefault: } case 313: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4518 + //line php5/php5.y:4520 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -6917,7 +6919,7 @@ yydefault: } case 314: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4538 + //line php5/php5.y:4540 { yyVAL.node = expr.NewArray(yyDollar[3].list) @@ -6933,7 +6935,7 @@ yydefault: } case 315: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4552 + //line php5/php5.y:4554 { yyVAL.node = expr.NewShortArray(yyDollar[2].list) @@ -6948,13 +6950,13 @@ yydefault: } case 316: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4568 + //line php5/php5.y:4570 { yyVAL.token = yyDollar[1].token } case 317: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:4575 + //line php5/php5.y:4577 { yyVAL.ClosureUse = nil @@ -6962,7 +6964,7 @@ yydefault: } case 318: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4581 + //line php5/php5.y:4583 { yyVAL.ClosureUse = expr.NewClosureUse(yyDollar[3].list) @@ -6978,7 +6980,7 @@ yydefault: } case 319: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4598 + //line php5/php5.y:4600 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[3].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -6997,7 +6999,7 @@ yydefault: } case 320: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4615 + //line php5/php5.y:4617 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[4].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -7019,7 +7021,7 @@ yydefault: } case 321: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4635 + //line php5/php5.y:4637 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -7037,7 +7039,7 @@ yydefault: } case 322: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4651 + //line php5/php5.y:4653 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[2].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -7058,7 +7060,7 @@ yydefault: } case 323: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4673 + //line php5/php5.y:4675 { name := name.NewName(yyDollar[1].list) yyVAL.node = expr.NewFunctionCall(name, yyDollar[2].node.(*node.ArgumentList)) @@ -7074,7 +7076,7 @@ yydefault: } case 324: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4687 + //line php5/php5.y:4689 { funcName := name.NewRelative(yyDollar[3].list) yyVAL.node = expr.NewFunctionCall(funcName, yyDollar[4].node.(*node.ArgumentList)) @@ -7091,7 +7093,7 @@ yydefault: } case 325: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4702 + //line php5/php5.y:4704 { funcName := name.NewFullyQualified(yyDollar[2].list) yyVAL.node = expr.NewFunctionCall(funcName, yyDollar[3].node.(*node.ArgumentList)) @@ -7107,7 +7109,7 @@ yydefault: } case 326: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4716 + //line php5/php5.y:4718 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -7122,7 +7124,7 @@ yydefault: } case 327: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4729 + //line php5/php5.y:4731 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -7137,7 +7139,7 @@ yydefault: } case 328: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4742 + //line php5/php5.y:4744 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -7152,7 +7154,7 @@ yydefault: } case 329: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4755 + //line php5/php5.y:4757 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -7167,7 +7169,7 @@ yydefault: } case 330: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4768 + //line php5/php5.y:4770 { yyVAL.node = expr.NewFunctionCall(yyDollar[1].node, yyDollar[2].node.(*node.ArgumentList)) @@ -7179,7 +7181,7 @@ yydefault: } case 331: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4781 + //line php5/php5.y:4783 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -7193,7 +7195,7 @@ yydefault: } case 332: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4793 + //line php5/php5.y:4795 { yyVAL.node = name.NewName(yyDollar[1].list) @@ -7207,7 +7209,7 @@ yydefault: } case 333: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4805 + //line php5/php5.y:4807 { yyVAL.node = name.NewRelative(yyDollar[3].list) @@ -7222,7 +7224,7 @@ yydefault: } case 334: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4818 + //line php5/php5.y:4820 { yyVAL.node = name.NewFullyQualified(yyDollar[2].list) @@ -7236,7 +7238,7 @@ yydefault: } case 335: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4833 + //line php5/php5.y:4835 { yyVAL.node = name.NewName(yyDollar[1].list) @@ -7250,7 +7252,7 @@ yydefault: } case 336: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4845 + //line php5/php5.y:4847 { yyVAL.node = name.NewRelative(yyDollar[3].list) @@ -7265,7 +7267,7 @@ yydefault: } case 337: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4858 + //line php5/php5.y:4860 { yyVAL.node = name.NewFullyQualified(yyDollar[2].list) @@ -7279,7 +7281,7 @@ yydefault: } case 338: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4873 + //line php5/php5.y:4875 { yyVAL.node = yyDollar[1].node @@ -7287,7 +7289,7 @@ yydefault: } case 339: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4879 + //line php5/php5.y:4881 { yyVAL.node = yyDollar[1].node @@ -7295,7 +7297,7 @@ yydefault: } case 340: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4888 + //line php5/php5.y:4890 { yyVAL.node = yyDollar[1].node @@ -7338,7 +7340,7 @@ yydefault: } case 341: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4929 + //line php5/php5.y:4931 { yyVAL.node = yyDollar[1].node @@ -7346,7 +7348,7 @@ yydefault: } case 342: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4939 + //line php5/php5.y:4941 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) @@ -7354,7 +7356,7 @@ yydefault: } case 343: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:4945 + //line php5/php5.y:4947 { yyVAL.list = []node.Node{} @@ -7362,7 +7364,7 @@ yydefault: } case 344: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4955 + //line php5/php5.y:4957 { yyVAL.list = yyDollar[2].list @@ -7373,7 +7375,7 @@ yydefault: } case 345: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:4967 + //line php5/php5.y:4969 { yyVAL.node = nil @@ -7381,7 +7383,7 @@ yydefault: } case 346: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4973 + //line php5/php5.y:4975 { yyVAL.node = expr.NewExit(nil) @@ -7398,7 +7400,7 @@ yydefault: } case 347: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4988 + //line php5/php5.y:4990 { yyVAL.node = expr.NewExit(yyDollar[1].node) @@ -7417,7 +7419,7 @@ yydefault: } case 348: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:5008 + //line php5/php5.y:5010 { yyVAL.list = []node.Node{} @@ -7425,7 +7427,7 @@ yydefault: } case 349: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5014 + //line php5/php5.y:5016 { yyVAL.list = []node.Node{scalar.NewEncapsedStringPart(yyDollar[1].token.Value)} @@ -7433,7 +7435,7 @@ yydefault: } case 350: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5020 + //line php5/php5.y:5022 { yyVAL.list = yyDollar[1].list @@ -7441,7 +7443,7 @@ yydefault: } case 351: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:5029 + //line php5/php5.y:5031 { yyVAL.node = nil @@ -7449,7 +7451,7 @@ yydefault: } case 352: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5035 + //line php5/php5.y:5037 { yyVAL.node = yyDollar[1].node @@ -7457,7 +7459,7 @@ yydefault: } case 353: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5044 + //line php5/php5.y:5046 { yyVAL.node = scalar.NewLnumber(yyDollar[1].token.Value) @@ -7471,7 +7473,7 @@ yydefault: } case 354: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5056 + //line php5/php5.y:5058 { yyVAL.node = scalar.NewDnumber(yyDollar[1].token.Value) @@ -7485,7 +7487,7 @@ yydefault: } case 355: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5068 + //line php5/php5.y:5070 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) @@ -7499,7 +7501,7 @@ yydefault: } case 356: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5080 + //line php5/php5.y:5082 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7513,7 +7515,7 @@ yydefault: } case 357: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5092 + //line php5/php5.y:5094 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7527,7 +7529,7 @@ yydefault: } case 358: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5104 + //line php5/php5.y:5106 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7541,7 +7543,7 @@ yydefault: } case 359: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5116 + //line php5/php5.y:5118 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7555,7 +7557,7 @@ yydefault: } case 360: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5128 + //line php5/php5.y:5130 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7569,7 +7571,7 @@ yydefault: } case 361: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5140 + //line php5/php5.y:5142 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7583,7 +7585,7 @@ yydefault: } case 362: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5152 + //line php5/php5.y:5154 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7597,7 +7599,7 @@ yydefault: } case 363: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5164 + //line php5/php5.y:5166 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, []node.Node{encapsed}) @@ -7613,7 +7615,7 @@ yydefault: } case 364: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5178 + //line php5/php5.y:5180 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, nil) @@ -7627,7 +7629,7 @@ yydefault: } case 365: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5193 + //line php5/php5.y:5195 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -7646,7 +7648,7 @@ yydefault: } case 366: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5213 + //line php5/php5.y:5215 { yyVAL.node = yyDollar[1].node @@ -7654,7 +7656,7 @@ yydefault: } case 367: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5222 + //line php5/php5.y:5224 { yyVAL.node = yyDollar[1].node @@ -7662,7 +7664,7 @@ yydefault: } case 368: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5228 + //line php5/php5.y:5230 { yyVAL.node = yyDollar[1].node @@ -7670,7 +7672,7 @@ yydefault: } case 369: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5234 + //line php5/php5.y:5236 { name := name.NewName(yyDollar[1].list) yyVAL.node = expr.NewConstFetch(name) @@ -7686,7 +7688,7 @@ yydefault: } case 370: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5248 + //line php5/php5.y:5250 { name := name.NewRelative(yyDollar[3].list) yyVAL.node = expr.NewConstFetch(name) @@ -7703,7 +7705,7 @@ yydefault: } case 371: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5263 + //line php5/php5.y:5265 { name := name.NewFullyQualified(yyDollar[2].list) yyVAL.node = expr.NewConstFetch(name) @@ -7719,7 +7721,7 @@ yydefault: } case 372: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:5277 + //line php5/php5.y:5279 { yyVAL.node = expr.NewArray(yyDollar[3].list) @@ -7735,7 +7737,7 @@ yydefault: } case 373: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5291 + //line php5/php5.y:5293 { yyVAL.node = expr.NewShortArray(yyDollar[2].list) @@ -7750,7 +7752,7 @@ yydefault: } case 374: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5304 + //line php5/php5.y:5306 { yyVAL.node = yyDollar[1].node @@ -7758,7 +7760,7 @@ yydefault: } case 375: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5310 + //line php5/php5.y:5312 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7772,7 +7774,7 @@ yydefault: } case 376: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5322 + //line php5/php5.y:5324 { yyVAL.node = yyDollar[1].node @@ -7780,7 +7782,7 @@ yydefault: } case 377: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:5331 + //line php5/php5.y:5333 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -7799,7 +7801,7 @@ yydefault: } case 378: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5348 + //line php5/php5.y:5350 { yyVAL.node = binary.NewPlus(yyDollar[1].node, yyDollar[3].node) @@ -7815,7 +7817,7 @@ yydefault: } case 379: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5362 + //line php5/php5.y:5364 { yyVAL.node = binary.NewMinus(yyDollar[1].node, yyDollar[3].node) @@ -7831,7 +7833,7 @@ yydefault: } case 380: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5376 + //line php5/php5.y:5378 { yyVAL.node = binary.NewMul(yyDollar[1].node, yyDollar[3].node) @@ -7847,7 +7849,7 @@ yydefault: } case 381: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5390 + //line php5/php5.y:5392 { yyVAL.node = binary.NewPow(yyDollar[1].node, yyDollar[3].node) @@ -7863,7 +7865,7 @@ yydefault: } case 382: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5404 + //line php5/php5.y:5406 { yyVAL.node = binary.NewDiv(yyDollar[1].node, yyDollar[3].node) @@ -7879,7 +7881,7 @@ yydefault: } case 383: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5418 + //line php5/php5.y:5420 { yyVAL.node = binary.NewMod(yyDollar[1].node, yyDollar[3].node) @@ -7895,7 +7897,7 @@ yydefault: } case 384: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5432 + //line php5/php5.y:5434 { yyVAL.node = expr.NewBooleanNot(yyDollar[2].node) @@ -7909,7 +7911,7 @@ yydefault: } case 385: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5444 + //line php5/php5.y:5446 { yyVAL.node = expr.NewBitwiseNot(yyDollar[2].node) @@ -7923,7 +7925,7 @@ yydefault: } case 386: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5456 + //line php5/php5.y:5458 { yyVAL.node = binary.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) @@ -7939,7 +7941,7 @@ yydefault: } case 387: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5470 + //line php5/php5.y:5472 { yyVAL.node = binary.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) @@ -7955,7 +7957,7 @@ yydefault: } case 388: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5484 + //line php5/php5.y:5486 { yyVAL.node = binary.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) @@ -7971,7 +7973,7 @@ yydefault: } case 389: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5498 + //line php5/php5.y:5500 { yyVAL.node = binary.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) @@ -7987,7 +7989,7 @@ yydefault: } case 390: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5512 + //line php5/php5.y:5514 { yyVAL.node = binary.NewShiftRight(yyDollar[1].node, yyDollar[3].node) @@ -8003,7 +8005,7 @@ yydefault: } case 391: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5526 + //line php5/php5.y:5528 { yyVAL.node = binary.NewConcat(yyDollar[1].node, yyDollar[3].node) @@ -8019,7 +8021,7 @@ yydefault: } case 392: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5540 + //line php5/php5.y:5542 { yyVAL.node = binary.NewLogicalXor(yyDollar[1].node, yyDollar[3].node) @@ -8035,7 +8037,7 @@ yydefault: } case 393: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5554 + //line php5/php5.y:5556 { yyVAL.node = binary.NewLogicalAnd(yyDollar[1].node, yyDollar[3].node) @@ -8051,7 +8053,7 @@ yydefault: } case 394: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5568 + //line php5/php5.y:5570 { yyVAL.node = binary.NewLogicalOr(yyDollar[1].node, yyDollar[3].node) @@ -8067,7 +8069,7 @@ yydefault: } case 395: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5582 + //line php5/php5.y:5584 { yyVAL.node = binary.NewBooleanAnd(yyDollar[1].node, yyDollar[3].node) @@ -8083,7 +8085,7 @@ yydefault: } case 396: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5596 + //line php5/php5.y:5598 { yyVAL.node = binary.NewBooleanOr(yyDollar[1].node, yyDollar[3].node) @@ -8099,7 +8101,7 @@ yydefault: } case 397: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5610 + //line php5/php5.y:5612 { yyVAL.node = binary.NewIdentical(yyDollar[1].node, yyDollar[3].node) @@ -8115,7 +8117,7 @@ yydefault: } case 398: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5624 + //line php5/php5.y:5626 { yyVAL.node = binary.NewNotIdentical(yyDollar[1].node, yyDollar[3].node) @@ -8131,7 +8133,7 @@ yydefault: } case 399: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5638 + //line php5/php5.y:5640 { yyVAL.node = binary.NewEqual(yyDollar[1].node, yyDollar[3].node) @@ -8147,7 +8149,7 @@ yydefault: } case 400: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5652 + //line php5/php5.y:5654 { yyVAL.node = binary.NewNotEqual(yyDollar[1].node, yyDollar[3].node) @@ -8164,7 +8166,7 @@ yydefault: } case 401: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5667 + //line php5/php5.y:5669 { yyVAL.node = binary.NewSmaller(yyDollar[1].node, yyDollar[3].node) @@ -8180,7 +8182,7 @@ yydefault: } case 402: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5681 + //line php5/php5.y:5683 { yyVAL.node = binary.NewGreater(yyDollar[1].node, yyDollar[3].node) @@ -8196,7 +8198,7 @@ yydefault: } case 403: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5695 + //line php5/php5.y:5697 { yyVAL.node = binary.NewSmallerOrEqual(yyDollar[1].node, yyDollar[3].node) @@ -8212,7 +8214,7 @@ yydefault: } case 404: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5709 + //line php5/php5.y:5711 { yyVAL.node = binary.NewGreaterOrEqual(yyDollar[1].node, yyDollar[3].node) @@ -8228,7 +8230,7 @@ yydefault: } case 405: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:5723 + //line php5/php5.y:5725 { yyVAL.node = expr.NewTernary(yyDollar[1].node, nil, yyDollar[4].node) @@ -8245,7 +8247,7 @@ yydefault: } case 406: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:5738 + //line php5/php5.y:5740 { yyVAL.node = expr.NewTernary(yyDollar[1].node, yyDollar[3].node, yyDollar[5].node) @@ -8262,7 +8264,7 @@ yydefault: } case 407: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5753 + //line php5/php5.y:5755 { yyVAL.node = expr.NewUnaryPlus(yyDollar[2].node) @@ -8276,7 +8278,7 @@ yydefault: } case 408: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5765 + //line php5/php5.y:5767 { yyVAL.node = expr.NewUnaryMinus(yyDollar[2].node) @@ -8290,7 +8292,7 @@ yydefault: } case 409: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5777 + //line php5/php5.y:5779 { yyVAL.node = yyDollar[2].node @@ -8304,7 +8306,7 @@ yydefault: } case 410: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5792 + //line php5/php5.y:5794 { yyVAL.node = yyDollar[1].node @@ -8312,7 +8314,7 @@ yydefault: } case 411: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5798 + //line php5/php5.y:5800 { name := name.NewName(yyDollar[1].list) yyVAL.node = expr.NewConstFetch(name) @@ -8328,7 +8330,7 @@ yydefault: } case 412: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5812 + //line php5/php5.y:5814 { name := name.NewRelative(yyDollar[3].list) yyVAL.node = expr.NewConstFetch(name) @@ -8343,7 +8345,7 @@ yydefault: } case 413: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5825 + //line php5/php5.y:5827 { name := name.NewFullyQualified(yyDollar[2].list) yyVAL.node = expr.NewConstFetch(name) @@ -8359,7 +8361,7 @@ yydefault: } case 414: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5842 + //line php5/php5.y:5844 { name := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = expr.NewVariable(name) @@ -8376,7 +8378,7 @@ yydefault: } case 415: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5857 + //line php5/php5.y:5859 { yyVAL.node = yyDollar[1].node @@ -8384,7 +8386,7 @@ yydefault: } case 416: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5863 + //line php5/php5.y:5865 { yyVAL.node = yyDollar[1].node @@ -8392,7 +8394,7 @@ yydefault: } case 417: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5869 + //line php5/php5.y:5871 { yyVAL.node = yyDollar[1].node @@ -8400,7 +8402,7 @@ yydefault: } case 418: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5875 + //line php5/php5.y:5877 { yyVAL.node = scalar.NewEncapsed(yyDollar[2].list) @@ -8414,7 +8416,7 @@ yydefault: } case 419: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5887 + //line php5/php5.y:5889 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, yyDollar[2].list) @@ -8428,7 +8430,7 @@ yydefault: } case 420: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5899 + //line php5/php5.y:5901 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -8442,7 +8444,7 @@ yydefault: } case 421: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:5914 + //line php5/php5.y:5916 { yyVAL.list = nil @@ -8450,7 +8452,7 @@ yydefault: } case 422: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5920 + //line php5/php5.y:5922 { yyVAL.list = yyDollar[1].list @@ -8463,19 +8465,19 @@ yydefault: } case 423: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:5934 + //line php5/php5.y:5936 { yyVAL.token = nil } case 424: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5938 + //line php5/php5.y:5940 { yyVAL.token = yyDollar[1].token } case 425: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:5945 + //line php5/php5.y:5947 { arrayItem := expr.NewArrayItem(yyDollar[3].node, yyDollar[5].node) yyVAL.list = append(yyDollar[1].list, arrayItem) @@ -8493,7 +8495,7 @@ yydefault: } case 426: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5961 + //line php5/php5.y:5963 { arrayItem := expr.NewArrayItem(nil, yyDollar[3].node) yyVAL.list = append(yyDollar[1].list, arrayItem) @@ -8510,7 +8512,7 @@ yydefault: } case 427: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5976 + //line php5/php5.y:5978 { arrayItem := expr.NewArrayItem(yyDollar[1].node, yyDollar[3].node) yyVAL.list = []node.Node{arrayItem} @@ -8527,7 +8529,7 @@ yydefault: } case 428: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5991 + //line php5/php5.y:5993 { arrayItem := expr.NewArrayItem(nil, yyDollar[1].node) yyVAL.list = []node.Node{arrayItem} @@ -8541,7 +8543,7 @@ yydefault: } case 429: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6006 + //line php5/php5.y:6008 { yyVAL.node = yyDollar[1].node @@ -8549,7 +8551,7 @@ yydefault: } case 430: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6012 + //line php5/php5.y:6014 { yyVAL.node = yyDollar[1].node @@ -8557,7 +8559,7 @@ yydefault: } case 431: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6021 + //line php5/php5.y:6023 { yyVAL.node = yyDollar[2].node @@ -8571,7 +8573,7 @@ yydefault: } case 432: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6033 + //line php5/php5.y:6035 { yyVAL.node = yyDollar[2].node @@ -8585,7 +8587,7 @@ yydefault: } case 433: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6049 + //line php5/php5.y:6051 { yyVAL.node = yyDollar[1].node @@ -8593,7 +8595,7 @@ yydefault: } case 434: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6059 + //line php5/php5.y:6061 { yyVAL.node = yyDollar[1].node @@ -8601,7 +8603,7 @@ yydefault: } case 435: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6068 + //line php5/php5.y:6070 { yyVAL.node = yyDollar[1].node @@ -8609,7 +8611,7 @@ yydefault: } case 436: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:6077 + //line php5/php5.y:6079 { yyVAL.node = yyDollar[1].node @@ -8669,7 +8671,7 @@ yydefault: } case 437: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6135 + //line php5/php5.y:6137 { yyVAL.node = yyDollar[1].node @@ -8677,7 +8679,7 @@ yydefault: } case 438: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6144 + //line php5/php5.y:6146 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) @@ -8685,7 +8687,7 @@ yydefault: } case 439: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:6150 + //line php5/php5.y:6152 { yyVAL.list = []node.Node{} @@ -8693,7 +8695,7 @@ yydefault: } case 440: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6160 + //line php5/php5.y:6162 { if yyDollar[3].list != nil { yyDollar[3].list[0].(*expr.MethodCall).Method = yyDollar[2].list[len(yyDollar[2].list)-1].(*expr.PropertyFetch).Property @@ -8709,7 +8711,7 @@ yydefault: } case 441: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6177 + //line php5/php5.y:6179 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yyVAL.list = append(yyDollar[1].list, fetch) @@ -8727,7 +8729,7 @@ yydefault: } case 442: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6193 + //line php5/php5.y:6195 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yyVAL.list = []node.Node{yyDollar[1].node, fetch} @@ -8745,7 +8747,7 @@ yydefault: } case 443: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6212 + //line php5/php5.y:6214 { yyVAL.node = expr.NewMethodCall(nil, nil, yyDollar[1].node.(*node.ArgumentList)) @@ -8756,7 +8758,7 @@ yydefault: } case 444: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6224 + //line php5/php5.y:6226 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -8764,7 +8766,7 @@ yydefault: } case 445: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6230 + //line php5/php5.y:6232 { yyVAL.list = yyDollar[1].list @@ -8772,7 +8774,7 @@ yydefault: } case 446: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:6236 + //line php5/php5.y:6238 { yyVAL.list = nil @@ -8780,7 +8782,7 @@ yydefault: } case 447: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6245 + //line php5/php5.y:6247 { yyVAL.node = yyDollar[1].node @@ -8788,7 +8790,7 @@ yydefault: } case 448: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6251 + //line php5/php5.y:6253 { yyDollar[1].simpleIndirectReference.last.SetVarName(yyDollar[2].node) @@ -8802,7 +8804,7 @@ yydefault: } case 449: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6266 + //line php5/php5.y:6268 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -8818,7 +8820,7 @@ yydefault: } case 450: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6280 + //line php5/php5.y:6282 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -8834,7 +8836,7 @@ yydefault: } case 451: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6297 + //line php5/php5.y:6299 { yyVAL.node = yyDollar[1].node @@ -8842,7 +8844,7 @@ yydefault: } case 452: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6306 + //line php5/php5.y:6308 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -8861,7 +8863,7 @@ yydefault: } case 453: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6323 + //line php5/php5.y:6325 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -8880,7 +8882,7 @@ yydefault: } case 454: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6343 + //line php5/php5.y:6345 { yyVAL.node = yyDollar[1].node @@ -8888,7 +8890,7 @@ yydefault: } case 455: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6349 + //line php5/php5.y:6351 { yyVAL.node = yyDollar[1].node @@ -8896,7 +8898,7 @@ yydefault: } case 456: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6355 + //line php5/php5.y:6357 { yyVAL.node = yyDollar[1].node @@ -8904,7 +8906,7 @@ yydefault: } case 457: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6365 + //line php5/php5.y:6367 { yyVAL.node = yyDollar[1].node @@ -8912,7 +8914,7 @@ yydefault: } case 458: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6371 + //line php5/php5.y:6373 { yyDollar[1].simpleIndirectReference.last.SetVarName(yyDollar[2].node) @@ -8926,7 +8928,7 @@ yydefault: } case 459: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6383 + //line php5/php5.y:6385 { yyVAL.node = yyDollar[1].node @@ -8934,7 +8936,7 @@ yydefault: } case 460: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6392 + //line php5/php5.y:6394 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -8953,7 +8955,7 @@ yydefault: } case 461: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6409 + //line php5/php5.y:6411 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -8972,7 +8974,7 @@ yydefault: } case 462: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6426 + //line php5/php5.y:6428 { yyVAL.node = yyDollar[1].node @@ -8980,7 +8982,7 @@ yydefault: } case 463: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6436 + //line php5/php5.y:6438 { name := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(name) @@ -8997,7 +8999,7 @@ yydefault: } case 464: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6451 + //line php5/php5.y:6453 { yyVAL.node = expr.NewVariable(yyDollar[3].node) @@ -9016,7 +9018,7 @@ yydefault: } case 465: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:6471 + //line php5/php5.y:6473 { yyVAL.node = nil @@ -9024,7 +9026,7 @@ yydefault: } case 466: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6477 + //line php5/php5.y:6479 { yyVAL.node = yyDollar[1].node @@ -9032,7 +9034,7 @@ yydefault: } case 467: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6487 + //line php5/php5.y:6489 { yyVAL.list = yyDollar[1].list @@ -9040,7 +9042,7 @@ yydefault: } case 468: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6493 + //line php5/php5.y:6495 { fetch := expr.NewPropertyFetch(nil, yyDollar[1].node) yyVAL.list = []node.Node{fetch} @@ -9052,7 +9054,7 @@ yydefault: } case 469: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6506 + //line php5/php5.y:6508 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yyVAL.list = append(yyDollar[1].list, fetch) @@ -9070,7 +9072,7 @@ yydefault: } case 470: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6522 + //line php5/php5.y:6524 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yyVAL.list = append(yyDollar[1].list, fetch) @@ -9088,7 +9090,7 @@ yydefault: } case 471: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6538 + //line php5/php5.y:6540 { fetch := expr.NewPropertyFetch(nil, yyDollar[1].node) yyVAL.list = []node.Node{fetch} @@ -9100,7 +9102,7 @@ yydefault: } case 472: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6551 + //line php5/php5.y:6553 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -9114,7 +9116,7 @@ yydefault: } case 473: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6563 + //line php5/php5.y:6565 { yyVAL.node = yyDollar[2].node @@ -9131,7 +9133,7 @@ yydefault: } case 474: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6581 + //line php5/php5.y:6583 { n := expr.NewVariable(nil) yyVAL.simpleIndirectReference = simpleIndirectReference{[]*expr.Variable{n}, n} @@ -9147,7 +9149,7 @@ yydefault: } case 475: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6595 + //line php5/php5.y:6597 { n := expr.NewVariable(nil) @@ -9167,7 +9169,7 @@ yydefault: } case 476: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6616 + //line php5/php5.y:6618 { if len(yyDollar[1].list) == 0 { yyDollar[1].list = []node.Node{expr.NewArrayItem(nil, nil)} @@ -9182,7 +9184,7 @@ yydefault: } case 477: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6629 + //line php5/php5.y:6631 { if yyDollar[1].node.(*expr.ArrayItem).Key == nil && yyDollar[1].node.(*expr.ArrayItem).Val == nil { yyVAL.list = []node.Node{} @@ -9194,7 +9196,7 @@ yydefault: } case 478: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6643 + //line php5/php5.y:6645 { yyVAL.node = expr.NewArrayItem(nil, yyDollar[1].node) @@ -9207,7 +9209,7 @@ yydefault: } case 479: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6654 + //line php5/php5.y:6656 { item := expr.NewList(yyDollar[3].list) yyVAL.node = expr.NewArrayItem(nil, item) @@ -9225,7 +9227,7 @@ yydefault: } case 480: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:6670 + //line php5/php5.y:6672 { yyVAL.node = expr.NewArrayItem(nil, nil) @@ -9233,7 +9235,7 @@ yydefault: } case 481: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:6680 + //line php5/php5.y:6682 { yyVAL.list = []node.Node{} @@ -9241,7 +9243,7 @@ yydefault: } case 482: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6686 + //line php5/php5.y:6688 { yyVAL.list = yyDollar[1].list @@ -9258,7 +9260,7 @@ yydefault: } case 483: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:6704 + //line php5/php5.y:6706 { arrayItem := expr.NewArrayItem(yyDollar[3].node, yyDollar[5].node) yyVAL.list = append(yyDollar[1].list, arrayItem) @@ -9276,7 +9278,7 @@ yydefault: } case 484: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6720 + //line php5/php5.y:6722 { arrayItem := expr.NewArrayItem(nil, yyDollar[3].node) yyVAL.list = append(yyDollar[1].list, arrayItem) @@ -9293,7 +9295,7 @@ yydefault: } case 485: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6735 + //line php5/php5.y:6737 { arrayItem := expr.NewArrayItem(yyDollar[1].node, yyDollar[3].node) yyVAL.list = []node.Node{arrayItem} @@ -9310,7 +9312,7 @@ yydefault: } case 486: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6750 + //line php5/php5.y:6752 { arrayItem := expr.NewArrayItem(nil, yyDollar[1].node) yyVAL.list = []node.Node{arrayItem} @@ -9324,7 +9326,7 @@ yydefault: } case 487: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:6762 + //line php5/php5.y:6764 { reference := expr.NewReference(yyDollar[6].node) arrayItem := expr.NewArrayItem(yyDollar[3].node, reference) @@ -9345,7 +9347,7 @@ yydefault: } case 488: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6781 + //line php5/php5.y:6783 { reference := expr.NewReference(yyDollar[4].node) arrayItem := expr.NewArrayItem(nil, reference) @@ -9363,7 +9365,7 @@ yydefault: } case 489: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6797 + //line php5/php5.y:6799 { reference := expr.NewReference(yyDollar[4].node) arrayItem := expr.NewArrayItem(yyDollar[1].node, reference) @@ -9383,7 +9385,7 @@ yydefault: } case 490: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6815 + //line php5/php5.y:6817 { reference := expr.NewReference(yyDollar[2].node) arrayItem := expr.NewArrayItem(nil, reference) @@ -9400,7 +9402,7 @@ yydefault: } case 491: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6833 + //line php5/php5.y:6835 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -9408,7 +9410,7 @@ yydefault: } case 492: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6839 + //line php5/php5.y:6841 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yyVAL.list = append(yyDollar[1].list, encapsed) @@ -9423,7 +9425,7 @@ yydefault: } case 493: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6852 + //line php5/php5.y:6854 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -9431,7 +9433,7 @@ yydefault: } case 494: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6858 + //line php5/php5.y:6860 { encapsed := scalar.NewEncapsedStringPart(yyDollar[1].token.Value) yyVAL.list = []node.Node{encapsed, yyDollar[2].node} @@ -9446,7 +9448,7 @@ yydefault: } case 495: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6874 + //line php5/php5.y:6876 { name := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(name) @@ -9463,7 +9465,7 @@ yydefault: } case 496: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6889 + //line php5/php5.y:6891 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -9485,7 +9487,7 @@ yydefault: } case 497: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6909 + //line php5/php5.y:6911 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -9507,7 +9509,7 @@ yydefault: } case 498: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6929 + //line php5/php5.y:6931 { variable := expr.NewVariable(yyDollar[2].node) @@ -9525,7 +9527,7 @@ yydefault: } case 499: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6945 + //line php5/php5.y:6947 { name := node.NewIdentifier(yyDollar[2].token.Value) variable := expr.NewVariable(name) @@ -9546,7 +9548,7 @@ yydefault: } case 500: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:6964 + //line php5/php5.y:6966 { identifier := node.NewIdentifier(yyDollar[2].token.Value) variable := expr.NewVariable(identifier) @@ -9570,7 +9572,7 @@ yydefault: } case 501: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6986 + //line php5/php5.y:6988 { yyVAL.node = yyDollar[2].node @@ -9583,7 +9585,7 @@ yydefault: } case 502: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:7000 + //line php5/php5.y:7002 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) @@ -9597,7 +9599,7 @@ yydefault: } case 503: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:7012 + //line php5/php5.y:7014 { // TODO: add option to handle 64 bit integer if _, err := strconv.Atoi(yyDollar[1].token.Value); err == nil { @@ -9613,7 +9615,7 @@ yydefault: } case 504: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:7026 + //line php5/php5.y:7028 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(identifier) @@ -9630,7 +9632,7 @@ yydefault: } case 505: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:7044 + //line php5/php5.y:7046 { yyVAL.node = expr.NewIsset(yyDollar[3].list) @@ -9646,7 +9648,7 @@ yydefault: } case 506: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:7058 + //line php5/php5.y:7060 { yyVAL.node = expr.NewEmpty(yyDollar[3].node) @@ -9662,7 +9664,7 @@ yydefault: } case 507: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:7072 + //line php5/php5.y:7074 { yyVAL.node = expr.NewEmpty(yyDollar[3].node) @@ -9678,7 +9680,7 @@ yydefault: } case 508: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:7086 + //line php5/php5.y:7088 { yyVAL.node = expr.NewInclude(yyDollar[2].node) @@ -9692,7 +9694,7 @@ yydefault: } case 509: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:7098 + //line php5/php5.y:7100 { yyVAL.node = expr.NewIncludeOnce(yyDollar[2].node) @@ -9706,7 +9708,7 @@ yydefault: } case 510: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:7110 + //line php5/php5.y:7112 { yyVAL.node = expr.NewEval(yyDollar[3].node) @@ -9722,7 +9724,7 @@ yydefault: } case 511: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:7124 + //line php5/php5.y:7126 { yyVAL.node = expr.NewRequire(yyDollar[2].node) @@ -9736,7 +9738,7 @@ yydefault: } case 512: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:7136 + //line php5/php5.y:7138 { yyVAL.node = expr.NewRequireOnce(yyDollar[2].node) @@ -9750,7 +9752,7 @@ yydefault: } case 513: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:7151 + //line php5/php5.y:7153 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -9758,7 +9760,7 @@ yydefault: } case 514: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:7157 + //line php5/php5.y:7159 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -9769,7 +9771,7 @@ yydefault: } case 515: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:7169 + //line php5/php5.y:7171 { yyVAL.node = yyDollar[1].node @@ -9777,7 +9779,7 @@ yydefault: } case 516: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:7175 + //line php5/php5.y:7177 { yyVAL.node = yyDollar[1].node @@ -9785,7 +9787,7 @@ yydefault: } case 517: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:7184 + //line php5/php5.y:7186 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -9804,7 +9806,7 @@ yydefault: } case 518: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:7201 + //line php5/php5.y:7203 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -9823,7 +9825,7 @@ yydefault: } case 519: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:7221 + //line php5/php5.y:7223 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -9842,7 +9844,7 @@ yydefault: } case 520: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:7241 + //line php5/php5.y:7243 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) diff --git a/php5/php5.y b/php5/php5.y index 5c6de94..6f2c7d7 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -3408,6 +3408,8 @@ expr_without_variable: // save comments $2.Meta.SetTokenName(meta.EqualToken).AppendTo($$.GetMeta()) + $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | variable '=' '&' variable From 02a77f7fb0511db45ec0b1d607e019cf741b3d80 Mon Sep 17 00:00:00 2001 From: z7zmey Date: Mon, 17 Dec 2018 15:24:13 +0200 Subject: [PATCH 111/117] #63: print valid code even without meta --- php5/parser.go | 68 + php5/php5.go | 1078 +++--- php5/php5.y | 18 +- php7/parser.go | 68 + php7/php7.go | 856 ++--- php7/php7.y | 10 + printer/printer.go | 483 ++- printer/printer_parsed_php7_test.go | 1 + printer/printer_test.go | 4740 ++------------------------- 9 files changed, 1859 insertions(+), 5463 deletions(-) diff --git a/php5/parser.go b/php5/parser.go index e3c4802..4c67385 100644 --- a/php5/parser.go +++ b/php5/parser.go @@ -2,6 +2,7 @@ package php5 import ( "io" + "strings" "github.com/z7zmey/php-parser/errors" "github.com/z7zmey/php-parser/meta" @@ -163,6 +164,73 @@ func (l *Parser) prependMetaToken(n node.Node, t *scanner.Token, tn meta.TokenNa n.GetMeta().Unshift(m) } +func (l *Parser) splitSemicolonTokenAndPhpCloseTag(htmlNode node.Node, prevNode node.Node) { + SemiColonTokenMeta := prevNode.GetMeta().Cut(meta.AndFilter( + meta.TokenNameFilter(meta.SemiColonToken), + meta.TypeFilter(meta.TokenType), + )) + + if len(*SemiColonTokenMeta) < 1 { + return + } + + metaTokenValue := (*SemiColonTokenMeta)[0].Value + + i := strings.Index(metaTokenValue, "?>") + + if i < 0 { + SemiColonTokenMeta.AppendTo(prevNode.GetMeta()) + } else { + if metaTokenValue[0] == ';' { + prevNode.GetMeta().Push(&meta.Data{ + Value: metaTokenValue[0:1], + Type: meta.TokenType, + Position: nil, + TokenName: meta.SemiColonToken, + }) + + htmlNode.GetMeta().Push(&meta.Data{ + Value: metaTokenValue[1:i], + Type: meta.WhiteSpaceType, + Position: nil, + TokenName: meta.NodeStart, + }) + + htmlNode.GetMeta().Push(&meta.Data{ + Value: metaTokenValue[i : i+2], + Type: meta.TokenType, + Position: nil, + TokenName: meta.NodeStart, + }) + + if len(metaTokenValue) > i+2 { + htmlNode.GetMeta().Push(&meta.Data{ + Value: metaTokenValue[i+2:], + Type: meta.WhiteSpaceType, + Position: nil, + TokenName: meta.NodeStart, + }) + } + } else { + htmlNode.GetMeta().Push(&meta.Data{ + Value: metaTokenValue[:2], + Type: meta.TokenType, + Position: nil, + TokenName: meta.NodeStart, + }) + + if len(metaTokenValue) > 2 { + htmlNode.GetMeta().Push(&meta.Data{ + Value: metaTokenValue[2:], + Type: meta.WhiteSpaceType, + Position: nil, + TokenName: meta.NodeStart, + }) + } + } + } +} + func (p *Parser) returnTokenToPool(yyDollar []yySymType, yyVAL *yySymType) { for i := 1; i < len(yyDollar); i++ { if yyDollar[i].token != nil { diff --git a/php5/php5.go b/php5/php5.go index 77757d7..5728047 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -1,5 +1,3 @@ -// Code generated by goyacc -o php5/php5.go php5/php5.y. DO NOT EDIT. - //line php5/php5.y:2 package php5 @@ -348,7 +346,7 @@ const yyEofCode = 1 const yyErrCode = 2 const yyInitialStackSize = 16 -//line php5/php5.y:7261 +//line php5/php5.y:7271 type simpleIndirectReference struct { all []*expr.Variable @@ -2343,6 +2341,11 @@ yydefault: yyDollar = yyS[yypt-2 : yypt+1] //line php5/php5.y:295 { + if inlineHtmlNode, ok := yyDollar[2].node.(*stmt.InlineHtml); ok && len(yyDollar[1].list) > 0 { + prevNode := lastNode(yyDollar[1].list) + yylex.(*Parser).splitSemicolonTokenAndPhpCloseTag(inlineHtmlNode, prevNode) + } + if yyDollar[2].node != nil { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } @@ -2351,7 +2354,7 @@ yydefault: } case 3: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:303 + //line php5/php5.y:308 { yyVAL.list = []node.Node{} @@ -2359,7 +2362,7 @@ yydefault: } case 4: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:312 + //line php5/php5.y:317 { namePart := name.NewNamePart(yyDollar[1].token.Value) yyVAL.list = []node.Node{namePart} @@ -2374,7 +2377,7 @@ yydefault: } case 5: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:325 + //line php5/php5.y:330 { namePart := name.NewNamePart(yyDollar[3].token.Value) yyVAL.list = append(yyDollar[1].list, namePart) @@ -2390,7 +2393,7 @@ yydefault: } case 6: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:342 + //line php5/php5.y:347 { // error yyVAL.node = nil @@ -2399,7 +2402,7 @@ yydefault: } case 7: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:349 + //line php5/php5.y:354 { yyVAL.node = yyDollar[1].node @@ -2407,7 +2410,7 @@ yydefault: } case 8: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:355 + //line php5/php5.y:360 { yyVAL.node = yyDollar[1].node @@ -2415,7 +2418,7 @@ yydefault: } case 9: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:361 + //line php5/php5.y:366 { yyVAL.node = yyDollar[1].node @@ -2423,7 +2426,7 @@ yydefault: } case 10: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:367 + //line php5/php5.y:372 { yyVAL.node = stmt.NewHaltCompiler() @@ -2443,7 +2446,7 @@ yydefault: } case 11: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:385 + //line php5/php5.y:390 { name := name.NewName(yyDollar[2].list) yyVAL.node = stmt.NewNamespace(name, nil) @@ -2461,7 +2464,7 @@ yydefault: } case 12: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:401 + //line php5/php5.y:406 { name := name.NewName(yyDollar[2].list) yyVAL.node = stmt.NewNamespace(name, yyDollar[4].list) @@ -2479,7 +2482,7 @@ yydefault: } case 13: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:417 + //line php5/php5.y:422 { yyVAL.node = stmt.NewNamespace(nil, yyDollar[3].list) @@ -2495,7 +2498,7 @@ yydefault: } case 14: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:431 + //line php5/php5.y:436 { yyVAL.node = stmt.NewUseList(nil, yyDollar[2].list) @@ -2511,7 +2514,7 @@ yydefault: } case 15: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:445 + //line php5/php5.y:450 { useType := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewUseList(useType, yyDollar[3].list) @@ -2530,7 +2533,7 @@ yydefault: } case 16: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:462 + //line php5/php5.y:467 { useType := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewUseList(useType, yyDollar[3].list) @@ -2549,7 +2552,7 @@ yydefault: } case 17: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:479 + //line php5/php5.y:484 { yyVAL.node = yyDollar[1].node @@ -2564,7 +2567,7 @@ yydefault: } case 18: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:495 + //line php5/php5.y:500 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -2575,7 +2578,7 @@ yydefault: } case 19: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:504 + //line php5/php5.y:509 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -2583,7 +2586,7 @@ yydefault: } case 20: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:513 + //line php5/php5.y:518 { name := name.NewName(yyDollar[1].list) yyVAL.node = stmt.NewUse(nil, name, nil) @@ -2599,7 +2602,7 @@ yydefault: } case 21: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:527 + //line php5/php5.y:532 { name := name.NewName(yyDollar[1].list) alias := node.NewIdentifier(yyDollar[3].token.Value) @@ -2620,7 +2623,7 @@ yydefault: } case 22: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:546 + //line php5/php5.y:551 { name := name.NewName(yyDollar[2].list) yyVAL.node = stmt.NewUse(nil, name, nil) @@ -2638,7 +2641,7 @@ yydefault: } case 23: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:562 + //line php5/php5.y:567 { name := name.NewName(yyDollar[2].list) alias := node.NewIdentifier(yyDollar[4].token.Value) @@ -2660,7 +2663,7 @@ yydefault: } case 24: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:585 + //line php5/php5.y:590 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -2671,7 +2674,7 @@ yydefault: } case 25: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:594 + //line php5/php5.y:599 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -2679,7 +2682,7 @@ yydefault: } case 26: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:603 + //line php5/php5.y:608 { name := name.NewName(yyDollar[1].list) yyVAL.node = stmt.NewUse(nil, name, nil) @@ -2695,7 +2698,7 @@ yydefault: } case 27: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:617 + //line php5/php5.y:622 { name := name.NewName(yyDollar[1].list) alias := node.NewIdentifier(yyDollar[3].token.Value) @@ -2715,7 +2718,7 @@ yydefault: } case 28: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:635 + //line php5/php5.y:640 { name := name.NewName(yyDollar[2].list) yyVAL.node = stmt.NewUse(nil, name, nil) @@ -2733,7 +2736,7 @@ yydefault: } case 29: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:651 + //line php5/php5.y:656 { name := name.NewName(yyDollar[2].list) alias := node.NewIdentifier(yyDollar[4].token.Value) @@ -2755,7 +2758,7 @@ yydefault: } case 30: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:674 + //line php5/php5.y:679 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -2766,7 +2769,7 @@ yydefault: } case 31: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:683 + //line php5/php5.y:688 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -2774,7 +2777,7 @@ yydefault: } case 32: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:692 + //line php5/php5.y:697 { name := name.NewName(yyDollar[1].list) yyVAL.node = stmt.NewUse(nil, name, nil) @@ -2790,7 +2793,7 @@ yydefault: } case 33: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:706 + //line php5/php5.y:711 { name := name.NewName(yyDollar[1].list) alias := node.NewIdentifier(yyDollar[3].token.Value) @@ -2810,7 +2813,7 @@ yydefault: } case 34: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:724 + //line php5/php5.y:729 { name := name.NewName(yyDollar[2].list) yyVAL.node = stmt.NewUse(nil, name, nil) @@ -2828,7 +2831,7 @@ yydefault: } case 35: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:740 + //line php5/php5.y:745 { name := name.NewName(yyDollar[2].list) alias := node.NewIdentifier(yyDollar[4].token.Value) @@ -2850,7 +2853,7 @@ yydefault: } case 36: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:763 + //line php5/php5.y:768 { name := node.NewIdentifier(yyDollar[3].token.Value) constant := stmt.NewConstant(name, yyDollar[5].node, "") @@ -2873,7 +2876,7 @@ yydefault: } case 37: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:784 + //line php5/php5.y:789 { name := node.NewIdentifier(yyDollar[2].token.Value) constant := stmt.NewConstant(name, yyDollar[4].node, "") @@ -2894,8 +2897,13 @@ yydefault: } case 38: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:806 + //line php5/php5.y:811 { + if inlineHtmlNode, ok := yyDollar[2].node.(*stmt.InlineHtml); ok && len(yyDollar[1].list) > 0 { + prevNode := lastNode(yyDollar[1].list) + yylex.(*Parser).splitSemicolonTokenAndPhpCloseTag(inlineHtmlNode, prevNode) + } + if yyDollar[2].node != nil { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } @@ -2904,7 +2912,7 @@ yydefault: } case 39: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:814 + //line php5/php5.y:824 { yyVAL.list = []node.Node{} @@ -2912,7 +2920,7 @@ yydefault: } case 40: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:824 + //line php5/php5.y:834 { // error yyVAL.node = nil @@ -2921,7 +2929,7 @@ yydefault: } case 41: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:831 + //line php5/php5.y:841 { yyVAL.node = yyDollar[1].node @@ -2929,7 +2937,7 @@ yydefault: } case 42: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:837 + //line php5/php5.y:847 { yyVAL.node = yyDollar[1].node @@ -2937,7 +2945,7 @@ yydefault: } case 43: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:843 + //line php5/php5.y:853 { yyVAL.node = yyDollar[1].node @@ -2945,7 +2953,7 @@ yydefault: } case 44: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:849 + //line php5/php5.y:859 { yyVAL.node = stmt.NewHaltCompiler() @@ -2963,7 +2971,7 @@ yydefault: } case 45: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:869 + //line php5/php5.y:879 { yyVAL.node = yyDollar[1].node @@ -2971,7 +2979,7 @@ yydefault: } case 46: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:875 + //line php5/php5.y:885 { label := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewLabel(label) @@ -2988,7 +2996,7 @@ yydefault: } case 47: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:893 + //line php5/php5.y:903 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) @@ -3003,7 +3011,7 @@ yydefault: } case 48: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:906 + //line php5/php5.y:916 { yyVAL.node = stmt.NewIf(yyDollar[2].node, yyDollar[3].node, yyDollar[4].list, yyDollar[5].node) @@ -3025,7 +3033,7 @@ yydefault: } case 49: yyDollar = yyS[yypt-8 : yypt+1] - //line php5/php5.y:926 + //line php5/php5.y:936 { stmts := stmt.NewStmtList(yyDollar[4].list) yyVAL.node = stmt.NewAltIf(yyDollar[2].node, stmts, yyDollar[5].list, yyDollar[6].node) @@ -3047,7 +3055,7 @@ yydefault: } case 50: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:946 + //line php5/php5.y:956 { switch n := yyDollar[3].node.(type) { case *stmt.While: @@ -3070,7 +3078,7 @@ yydefault: } case 51: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:967 + //line php5/php5.y:977 { yyVAL.node = stmt.NewDo(yyDollar[2].node, yyDollar[4].node) @@ -3089,7 +3097,7 @@ yydefault: } case 52: yyDollar = yyS[yypt-9 : yypt+1] - //line php5/php5.y:984 + //line php5/php5.y:994 { switch n := yyDollar[9].node.(type) { case *stmt.For: @@ -3118,7 +3126,7 @@ yydefault: } case 53: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1011 + //line php5/php5.y:1021 { switch n := yyDollar[3].node.(type) { case *stmt.Switch: @@ -3143,7 +3151,7 @@ yydefault: } case 54: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1034 + //line php5/php5.y:1044 { yyVAL.node = stmt.NewBreak(nil) @@ -3159,7 +3167,7 @@ yydefault: } case 55: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1048 + //line php5/php5.y:1058 { yyVAL.node = stmt.NewBreak(yyDollar[2].node) @@ -3175,7 +3183,7 @@ yydefault: } case 56: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1062 + //line php5/php5.y:1072 { yyVAL.node = stmt.NewContinue(nil) @@ -3191,7 +3199,7 @@ yydefault: } case 57: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1076 + //line php5/php5.y:1086 { yyVAL.node = stmt.NewContinue(yyDollar[2].node) @@ -3207,7 +3215,7 @@ yydefault: } case 58: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1090 + //line php5/php5.y:1100 { yyVAL.node = stmt.NewReturn(nil) @@ -3223,7 +3231,7 @@ yydefault: } case 59: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1104 + //line php5/php5.y:1114 { yyVAL.node = stmt.NewReturn(yyDollar[2].node) @@ -3239,7 +3247,7 @@ yydefault: } case 60: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1118 + //line php5/php5.y:1128 { yyVAL.node = stmt.NewReturn(yyDollar[2].node) @@ -3255,7 +3263,7 @@ yydefault: } case 61: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1132 + //line php5/php5.y:1142 { yyVAL.node = stmt.NewExpression(yyDollar[1].node) @@ -3272,7 +3280,7 @@ yydefault: } case 62: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1147 + //line php5/php5.y:1157 { yyVAL.node = stmt.NewGlobal(yyDollar[2].list) @@ -3288,7 +3296,7 @@ yydefault: } case 63: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1161 + //line php5/php5.y:1171 { yyVAL.node = stmt.NewStatic(yyDollar[2].list) @@ -3304,7 +3312,7 @@ yydefault: } case 64: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1175 + //line php5/php5.y:1185 { yyVAL.node = stmt.NewEcho(yyDollar[2].list) @@ -3321,7 +3329,7 @@ yydefault: } case 65: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1190 + //line php5/php5.y:1200 { yyVAL.node = stmt.NewInlineHtml(yyDollar[1].token.Value) @@ -3335,7 +3343,7 @@ yydefault: } case 66: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1202 + //line php5/php5.y:1212 { yyVAL.node = stmt.NewExpression(yyDollar[1].node) @@ -3352,7 +3360,7 @@ yydefault: } case 67: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1217 + //line php5/php5.y:1227 { yyVAL.node = stmt.NewUnset(yyDollar[3].list) @@ -3370,7 +3378,7 @@ yydefault: } case 68: yyDollar = yyS[yypt-8 : yypt+1] - //line php5/php5.y:1233 + //line php5/php5.y:1243 { if yyDollar[6].node == nil { switch n := yyDollar[8].node.(type) { @@ -3412,7 +3420,7 @@ yydefault: } case 69: yyDollar = yyS[yypt-8 : yypt+1] - //line php5/php5.y:1273 + //line php5/php5.y:1283 { if yyDollar[6].node == nil { switch n := yyDollar[8].node.(type) { @@ -3454,7 +3462,7 @@ yydefault: } case 70: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1313 + //line php5/php5.y:1323 { yyVAL.node = yyDollar[5].node yyVAL.node.(*stmt.Declare).Consts = yyDollar[3].list @@ -3471,7 +3479,7 @@ yydefault: } case 71: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1328 + //line php5/php5.y:1338 { yyVAL.node = stmt.NewNop() @@ -3486,7 +3494,7 @@ yydefault: } case 72: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:1341 + //line php5/php5.y:1351 { yyVAL.node = stmt.NewTry(yyDollar[3].list, yyDollar[5].list, yyDollar[6].node) @@ -3506,7 +3514,7 @@ yydefault: } case 73: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1359 + //line php5/php5.y:1369 { yyVAL.node = stmt.NewThrow(yyDollar[2].node) @@ -3522,7 +3530,7 @@ yydefault: } case 74: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1373 + //line php5/php5.y:1383 { label := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewGoto(label) @@ -3541,7 +3549,7 @@ yydefault: } case 75: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1393 + //line php5/php5.y:1403 { yyVAL.list = []node.Node{} @@ -3549,7 +3557,7 @@ yydefault: } case 76: yyDollar = yyS[yypt-9 : yypt+1] - //line php5/php5.y:1399 + //line php5/php5.y:1409 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[4].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -3574,7 +3582,7 @@ yydefault: } case 77: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1425 + //line php5/php5.y:1435 { yyVAL.node = nil @@ -3582,7 +3590,7 @@ yydefault: } case 78: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1431 + //line php5/php5.y:1441 { yyVAL.node = stmt.NewFinally(yyDollar[3].list) @@ -3598,7 +3606,7 @@ yydefault: } case 79: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1448 + //line php5/php5.y:1458 { yyVAL.list = yyDollar[1].list @@ -3606,7 +3614,7 @@ yydefault: } case 80: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1454 + //line php5/php5.y:1464 { yyVAL.list = []node.Node{} @@ -3614,7 +3622,7 @@ yydefault: } case 81: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1463 + //line php5/php5.y:1473 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -3622,7 +3630,7 @@ yydefault: } case 82: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1469 + //line php5/php5.y:1479 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -3630,7 +3638,7 @@ yydefault: } case 83: yyDollar = yyS[yypt-8 : yypt+1] - //line php5/php5.y:1478 + //line php5/php5.y:1488 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[4].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -3654,7 +3662,7 @@ yydefault: } case 84: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1503 + //line php5/php5.y:1513 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -3662,7 +3670,7 @@ yydefault: } case 85: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1509 + //line php5/php5.y:1519 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -3673,7 +3681,7 @@ yydefault: } case 86: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1521 + //line php5/php5.y:1531 { yyVAL.node = yyDollar[1].node @@ -3681,7 +3689,7 @@ yydefault: } case 87: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1530 + //line php5/php5.y:1540 { yyVAL.node = yyDollar[1].node @@ -3689,7 +3697,7 @@ yydefault: } case 88: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1539 + //line php5/php5.y:1549 { yyVAL.node = yyDollar[1].node @@ -3697,31 +3705,31 @@ yydefault: } case 89: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1548 + //line php5/php5.y:1558 { yyVAL.token = nil } case 90: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1552 + //line php5/php5.y:1562 { yyVAL.token = yyDollar[1].token } case 91: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1559 + //line php5/php5.y:1569 { yyVAL.token = nil } case 92: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1563 + //line php5/php5.y:1573 { yyVAL.token = yyDollar[1].token } case 93: yyDollar = yyS[yypt-9 : yypt+1] - //line php5/php5.y:1570 + //line php5/php5.y:1580 { name := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewFunction(name, yyDollar[2].token != nil, yyDollar[5].list, nil, yyDollar[8].list, "") @@ -3745,7 +3753,7 @@ yydefault: } case 94: yyDollar = yyS[yypt-7 : yypt+1] - //line php5/php5.y:1595 + //line php5/php5.y:1605 { name := node.NewIdentifier(yyDollar[2].token.Value) switch n := yyDollar[1].node.(type) { @@ -3775,7 +3783,7 @@ yydefault: } case 95: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:1623 + //line php5/php5.y:1633 { name := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewInterface(name, yyDollar[3].InterfaceExtends, yyDollar[5].list, "") @@ -3794,7 +3802,7 @@ yydefault: } case 96: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1644 + //line php5/php5.y:1654 { yyVAL.node = stmt.NewClass(nil, nil, nil, nil, nil, nil, "") @@ -3808,7 +3816,7 @@ yydefault: } case 97: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1656 + //line php5/php5.y:1666 { classModifier := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewClass(nil, []node.Node{classModifier}, nil, nil, nil, nil, "") @@ -3825,7 +3833,7 @@ yydefault: } case 98: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1671 + //line php5/php5.y:1681 { yyVAL.node = stmt.NewTrait(nil, nil, "") @@ -3839,7 +3847,7 @@ yydefault: } case 99: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1683 + //line php5/php5.y:1693 { classModifier := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewClass(nil, []node.Node{classModifier}, nil, nil, nil, nil, "") @@ -3856,7 +3864,7 @@ yydefault: } case 100: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1701 + //line php5/php5.y:1711 { yyVAL.ClassExtends = nil @@ -3864,7 +3872,7 @@ yydefault: } case 101: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1707 + //line php5/php5.y:1717 { yyVAL.ClassExtends = stmt.NewClassExtends(yyDollar[2].node) @@ -3878,13 +3886,13 @@ yydefault: } case 102: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1722 + //line php5/php5.y:1732 { yyVAL.token = yyDollar[1].token } case 103: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1729 + //line php5/php5.y:1739 { yyVAL.InterfaceExtends = nil @@ -3892,7 +3900,7 @@ yydefault: } case 104: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1735 + //line php5/php5.y:1745 { yyVAL.InterfaceExtends = stmt.NewInterfaceExtends(yyDollar[2].list) @@ -3906,7 +3914,7 @@ yydefault: } case 105: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1750 + //line php5/php5.y:1760 { yyVAL.ClassImplements = nil @@ -3914,7 +3922,7 @@ yydefault: } case 106: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1756 + //line php5/php5.y:1766 { yyVAL.ClassImplements = stmt.NewClassImplements(yyDollar[2].list) @@ -3928,7 +3936,7 @@ yydefault: } case 107: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1771 + //line php5/php5.y:1781 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -3936,7 +3944,7 @@ yydefault: } case 108: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1777 + //line php5/php5.y:1787 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -3947,7 +3955,7 @@ yydefault: } case 109: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1789 + //line php5/php5.y:1799 { yyVAL.node = nil @@ -3955,7 +3963,7 @@ yydefault: } case 110: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1795 + //line php5/php5.y:1805 { yyVAL.node = yyDollar[2].node @@ -3966,7 +3974,7 @@ yydefault: } case 111: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1807 + //line php5/php5.y:1817 { yyVAL.node = yyDollar[1].node @@ -3974,7 +3982,7 @@ yydefault: } case 112: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1813 + //line php5/php5.y:1823 { yyVAL.node = expr.NewReference(yyDollar[2].node) @@ -3988,7 +3996,7 @@ yydefault: } case 113: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1825 + //line php5/php5.y:1835 { yyVAL.node = expr.NewList(yyDollar[3].list) @@ -4004,7 +4012,7 @@ yydefault: } case 114: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1842 + //line php5/php5.y:1852 { yyVAL.node = stmt.NewFor(nil, nil, nil, yyDollar[1].node) @@ -4015,7 +4023,7 @@ yydefault: } case 115: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1851 + //line php5/php5.y:1861 { stmtList := stmt.NewStmtList(yyDollar[2].list) yyVAL.node = stmt.NewAltFor(nil, nil, nil, stmtList) @@ -4034,7 +4042,7 @@ yydefault: } case 116: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1871 + //line php5/php5.y:1881 { yyVAL.node = stmt.NewForeach(nil, nil, nil, yyDollar[1].node) @@ -4045,7 +4053,7 @@ yydefault: } case 117: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1880 + //line php5/php5.y:1890 { stmtList := stmt.NewStmtList(yyDollar[2].list) yyVAL.node = stmt.NewAltForeach(nil, nil, nil, stmtList) @@ -4064,7 +4072,7 @@ yydefault: } case 118: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1901 + //line php5/php5.y:1911 { yyVAL.node = stmt.NewDeclare(nil, yyDollar[1].node, false) @@ -4075,7 +4083,7 @@ yydefault: } case 119: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1910 + //line php5/php5.y:1920 { stmtList := stmt.NewStmtList(yyDollar[2].list) yyVAL.node = stmt.NewDeclare(nil, stmtList, true) @@ -4094,7 +4102,7 @@ yydefault: } case 120: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1931 + //line php5/php5.y:1941 { name := node.NewIdentifier(yyDollar[1].token.Value) constant := stmt.NewConstant(name, yyDollar[3].node, "") @@ -4112,7 +4120,7 @@ yydefault: } case 121: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1947 + //line php5/php5.y:1957 { name := node.NewIdentifier(yyDollar[3].token.Value) constant := stmt.NewConstant(name, yyDollar[5].node, "") @@ -4131,7 +4139,7 @@ yydefault: } case 122: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1968 + //line php5/php5.y:1978 { caseList := stmt.NewCaseList(yyDollar[2].list) yyVAL.node = stmt.NewSwitch(nil, caseList) @@ -4148,7 +4156,7 @@ yydefault: } case 123: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1983 + //line php5/php5.y:1993 { caseList := stmt.NewCaseList(yyDollar[3].list) yyVAL.node = stmt.NewSwitch(nil, caseList) @@ -4167,7 +4175,7 @@ yydefault: } case 124: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2000 + //line php5/php5.y:2010 { caseList := stmt.NewCaseList(yyDollar[2].list) yyVAL.node = stmt.NewAltSwitch(nil, caseList) @@ -4186,7 +4194,7 @@ yydefault: } case 125: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:2017 + //line php5/php5.y:2027 { caseList := stmt.NewCaseList(yyDollar[3].list) @@ -4208,7 +4216,7 @@ yydefault: } case 126: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2041 + //line php5/php5.y:2051 { yyVAL.list = []node.Node{} @@ -4216,7 +4224,7 @@ yydefault: } case 127: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:2047 + //line php5/php5.y:2057 { _case := stmt.NewCase(yyDollar[3].node, yyDollar[5].list) yyVAL.list = append(yyDollar[1].list, _case) @@ -4233,7 +4241,7 @@ yydefault: } case 128: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2062 + //line php5/php5.y:2072 { _default := stmt.NewDefault(yyDollar[4].list) yyVAL.list = append(yyDollar[1].list, _default) @@ -4250,19 +4258,19 @@ yydefault: } case 129: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2081 + //line php5/php5.y:2091 { yyVAL.token = yyDollar[1].token } case 130: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2085 + //line php5/php5.y:2095 { yyVAL.token = yyDollar[1].token } case 131: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2093 + //line php5/php5.y:2103 { yyVAL.node = stmt.NewWhile(nil, yyDollar[1].node) @@ -4273,7 +4281,7 @@ yydefault: } case 132: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2102 + //line php5/php5.y:2112 { stmtList := stmt.NewStmtList(yyDollar[2].list) yyVAL.node = stmt.NewAltWhile(nil, stmtList) @@ -4292,7 +4300,7 @@ yydefault: } case 133: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2124 + //line php5/php5.y:2134 { yyVAL.list = nil @@ -4300,7 +4308,7 @@ yydefault: } case 134: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2130 + //line php5/php5.y:2140 { _elseIf := stmt.NewElseIf(yyDollar[3].node, yyDollar[4].node) yyVAL.list = append(yyDollar[1].list, _elseIf) @@ -4317,7 +4325,7 @@ yydefault: } case 135: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2149 + //line php5/php5.y:2159 { yyVAL.list = nil @@ -4325,7 +4333,7 @@ yydefault: } case 136: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:2155 + //line php5/php5.y:2165 { stmts := stmt.NewStmtList(yyDollar[5].list) _elseIf := stmt.NewAltElseIf(yyDollar[3].node, stmts) @@ -4345,7 +4353,7 @@ yydefault: } case 137: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2177 + //line php5/php5.y:2187 { yyVAL.node = nil @@ -4353,7 +4361,7 @@ yydefault: } case 138: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2183 + //line php5/php5.y:2193 { yyVAL.node = stmt.NewElse(yyDollar[2].node) @@ -4367,7 +4375,7 @@ yydefault: } case 139: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2199 + //line php5/php5.y:2209 { yyVAL.node = nil @@ -4375,7 +4383,7 @@ yydefault: } case 140: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2205 + //line php5/php5.y:2215 { stmts := stmt.NewStmtList(yyDollar[3].list) yyVAL.node = stmt.NewAltElse(stmts) @@ -4392,7 +4400,7 @@ yydefault: } case 141: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2224 + //line php5/php5.y:2234 { yyVAL.list = yyDollar[1].list @@ -4400,7 +4408,7 @@ yydefault: } case 142: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2230 + //line php5/php5.y:2240 { yyVAL.list = nil @@ -4408,7 +4416,7 @@ yydefault: } case 143: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2239 + //line php5/php5.y:2249 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4416,7 +4424,7 @@ yydefault: } case 144: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2245 + //line php5/php5.y:2255 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4427,7 +4435,7 @@ yydefault: } case 145: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2257 + //line php5/php5.y:2267 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[4].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -4467,7 +4475,7 @@ yydefault: } case 146: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:2295 + //line php5/php5.y:2305 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[4].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -4508,7 +4516,7 @@ yydefault: } case 147: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2338 + //line php5/php5.y:2348 { yyVAL.node = nil @@ -4516,7 +4524,7 @@ yydefault: } case 148: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2344 + //line php5/php5.y:2354 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4530,7 +4538,7 @@ yydefault: } case 149: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2356 + //line php5/php5.y:2366 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4544,7 +4552,7 @@ yydefault: } case 150: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2368 + //line php5/php5.y:2378 { yyVAL.node = yyDollar[1].node @@ -4552,7 +4560,7 @@ yydefault: } case 151: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2378 + //line php5/php5.y:2388 { yyVAL.node = node.NewArgumentList(nil) @@ -4567,7 +4575,7 @@ yydefault: } case 152: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2391 + //line php5/php5.y:2401 { yyVAL.node = node.NewArgumentList(yyDollar[2].list) @@ -4582,7 +4590,7 @@ yydefault: } case 153: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2404 + //line php5/php5.y:2414 { arg := node.NewArgument(yyDollar[2].node, false, false) yyVAL.node = node.NewArgumentList([]node.Node{arg}) @@ -4599,7 +4607,7 @@ yydefault: } case 154: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2423 + //line php5/php5.y:2433 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4607,7 +4615,7 @@ yydefault: } case 155: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2429 + //line php5/php5.y:2439 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4618,7 +4626,7 @@ yydefault: } case 156: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2441 + //line php5/php5.y:2451 { yyVAL.node = node.NewArgument(yyDollar[1].node, false, false) @@ -4632,7 +4640,7 @@ yydefault: } case 157: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2453 + //line php5/php5.y:2463 { yyVAL.node = node.NewArgument(yyDollar[1].node, false, false) @@ -4646,7 +4654,7 @@ yydefault: } case 158: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2465 + //line php5/php5.y:2475 { yyVAL.node = node.NewArgument(yyDollar[2].node, false, true) @@ -4660,7 +4668,7 @@ yydefault: } case 159: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2477 + //line php5/php5.y:2487 { yyVAL.node = node.NewArgument(yyDollar[2].node, true, false) @@ -4674,7 +4682,7 @@ yydefault: } case 160: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2492 + //line php5/php5.y:2502 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4685,7 +4693,7 @@ yydefault: } case 161: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2501 + //line php5/php5.y:2511 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4693,7 +4701,7 @@ yydefault: } case 162: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2511 + //line php5/php5.y:2521 { name := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(name) @@ -4710,7 +4718,7 @@ yydefault: } case 163: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2526 + //line php5/php5.y:2536 { yyVAL.node = expr.NewVariable(yyDollar[2].node) @@ -4726,7 +4734,7 @@ yydefault: } case 164: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2540 + //line php5/php5.y:2550 { yyVAL.node = expr.NewVariable(yyDollar[3].node) @@ -4745,7 +4753,7 @@ yydefault: } case 165: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2561 + //line php5/php5.y:2571 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[3].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -4766,7 +4774,7 @@ yydefault: } case 166: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:2580 + //line php5/php5.y:2590 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[3].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -4788,7 +4796,7 @@ yydefault: } case 167: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2600 + //line php5/php5.y:2610 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -4808,7 +4816,7 @@ yydefault: } case 168: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2618 + //line php5/php5.y:2628 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -4829,7 +4837,7 @@ yydefault: } case 169: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2641 + //line php5/php5.y:2651 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -4837,7 +4845,7 @@ yydefault: } case 170: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2647 + //line php5/php5.y:2657 { yyVAL.list = []node.Node{} @@ -4845,7 +4853,7 @@ yydefault: } case 171: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2657 + //line php5/php5.y:2667 { yyVAL.node = stmt.NewPropertyList(yyDollar[1].list, yyDollar[2].list) @@ -4862,7 +4870,7 @@ yydefault: } case 172: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2672 + //line php5/php5.y:2682 { yyVAL.node = yyDollar[1].node @@ -4877,7 +4885,7 @@ yydefault: } case 173: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2685 + //line php5/php5.y:2695 { yyVAL.node = yyDollar[1].node @@ -4885,7 +4893,7 @@ yydefault: } case 174: yyDollar = yyS[yypt-8 : yypt+1] - //line php5/php5.y:2691 + //line php5/php5.y:2701 { name := node.NewIdentifier(yyDollar[4].token.Value) yyVAL.node = stmt.NewClassMethod(name, yyDollar[1].list, yyDollar[3].token != nil, yyDollar[6].list, nil, yyDollar[8].node, "") @@ -4911,7 +4919,7 @@ yydefault: } case 175: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2718 + //line php5/php5.y:2728 { yyVAL.node = stmt.NewTraitUse(yyDollar[2].list, yyDollar[3].node) @@ -4925,7 +4933,7 @@ yydefault: } case 176: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2733 + //line php5/php5.y:2743 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4933,7 +4941,7 @@ yydefault: } case 177: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2739 + //line php5/php5.y:2749 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4944,7 +4952,7 @@ yydefault: } case 178: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2751 + //line php5/php5.y:2761 { yyVAL.node = stmt.NewNop() @@ -4958,7 +4966,7 @@ yydefault: } case 179: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2764 + //line php5/php5.y:2774 { yyVAL.node = stmt.NewTraitAdaptationList(yyDollar[2].list) @@ -4972,7 +4980,7 @@ yydefault: } case 180: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2779 + //line php5/php5.y:2789 { yyVAL.list = nil @@ -4980,7 +4988,7 @@ yydefault: } case 181: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2785 + //line php5/php5.y:2795 { yyVAL.list = yyDollar[1].list @@ -4988,7 +4996,7 @@ yydefault: } case 182: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2794 + //line php5/php5.y:2804 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4996,25 +5004,13 @@ yydefault: } case 183: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2800 + //line php5/php5.y:2810 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 184: - yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2809 - { - yyVAL.node = yyDollar[1].node - - // save comments - yyDollar[2].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.SemiColonToken) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - case 185: yyDollar = yyS[yypt-2 : yypt+1] //line php5/php5.y:2819 { @@ -5024,11 +5020,23 @@ yydefault: yyDollar[2].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.SemiColonToken) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + case 185: + yyDollar = yyS[yypt-2 : yypt+1] + //line php5/php5.y:2829 + { + yyVAL.node = yyDollar[1].node + + // save comments + yyDollar[2].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.SemiColonToken) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 186: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2832 + //line php5/php5.y:2842 { yyVAL.node = stmt.NewTraitUsePrecedence(yyDollar[1].node, yyDollar[3].list) @@ -5042,7 +5050,7 @@ yydefault: } case 187: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2847 + //line php5/php5.y:2857 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -5050,7 +5058,7 @@ yydefault: } case 188: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2853 + //line php5/php5.y:2863 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -5061,7 +5069,7 @@ yydefault: } case 189: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2865 + //line php5/php5.y:2875 { name := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewTraitMethodRef(nil, name) @@ -5077,7 +5085,7 @@ yydefault: } case 190: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2879 + //line php5/php5.y:2889 { yyVAL.node = yyDollar[1].node @@ -5085,7 +5093,7 @@ yydefault: } case 191: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2888 + //line php5/php5.y:2898 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewTraitMethodRef(yyDollar[1].node, target) @@ -5102,7 +5110,7 @@ yydefault: } case 192: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2906 + //line php5/php5.y:2916 { alias := node.NewIdentifier(yyDollar[4].token.Value) yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, yyDollar[3].node, alias) @@ -5119,7 +5127,7 @@ yydefault: } case 193: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2921 + //line php5/php5.y:2931 { yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, yyDollar[3].node, nil) @@ -5133,7 +5141,7 @@ yydefault: } case 194: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2936 + //line php5/php5.y:2946 { yyVAL.node = nil @@ -5141,7 +5149,7 @@ yydefault: } case 195: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2942 + //line php5/php5.y:2952 { yyVAL.node = yyDollar[1].node @@ -5149,7 +5157,7 @@ yydefault: } case 196: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2951 + //line php5/php5.y:2961 { yyVAL.node = stmt.NewNop() @@ -5164,7 +5172,7 @@ yydefault: } case 197: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2964 + //line php5/php5.y:2974 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) @@ -5179,7 +5187,7 @@ yydefault: } case 198: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2980 + //line php5/php5.y:2990 { yyVAL.list = yyDollar[1].list @@ -5187,7 +5195,7 @@ yydefault: } case 199: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2986 + //line php5/php5.y:2996 { modifier := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.list = []node.Node{modifier} @@ -5202,7 +5210,7 @@ yydefault: } case 200: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3002 + //line php5/php5.y:3012 { yyVAL.list = nil @@ -5210,7 +5218,7 @@ yydefault: } case 201: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3008 + //line php5/php5.y:3018 { yyVAL.list = yyDollar[1].list @@ -5218,7 +5226,7 @@ yydefault: } case 202: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3017 + //line php5/php5.y:3027 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -5226,7 +5234,7 @@ yydefault: } case 203: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3023 + //line php5/php5.y:3033 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -5234,7 +5242,7 @@ yydefault: } case 204: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3032 + //line php5/php5.y:3042 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5248,7 +5256,7 @@ yydefault: } case 205: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3044 + //line php5/php5.y:3054 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5262,7 +5270,7 @@ yydefault: } case 206: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3056 + //line php5/php5.y:3066 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5276,7 +5284,7 @@ yydefault: } case 207: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3068 + //line php5/php5.y:3078 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5290,7 +5298,7 @@ yydefault: } case 208: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3080 + //line php5/php5.y:3090 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5304,7 +5312,7 @@ yydefault: } case 209: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3092 + //line php5/php5.y:3102 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5318,7 +5326,7 @@ yydefault: } case 210: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3107 + //line php5/php5.y:3117 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[3].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -5332,14 +5340,14 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(property.GetMeta()) yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 211: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:3126 + //line php5/php5.y:3136 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[3].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -5353,7 +5361,7 @@ yydefault: // save comments yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(property.GetMeta()) yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yyDollar[4].token.Meta.SetTokenName(meta.EqualToken).AppendTo(property.GetMeta()) @@ -5361,7 +5369,7 @@ yydefault: } case 212: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3146 + //line php5/php5.y:3156 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -5374,14 +5382,14 @@ yydefault: property.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(property.GetMeta()) yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 213: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3164 + //line php5/php5.y:3174 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -5394,7 +5402,7 @@ yydefault: property.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(property.GetMeta()) yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yyDollar[2].token.Meta.SetTokenName(meta.EqualToken).AppendTo(property.GetMeta()) @@ -5402,7 +5410,7 @@ yydefault: } case 214: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:3186 + //line php5/php5.y:3196 { name := node.NewIdentifier(yyDollar[3].token.Value) constant := stmt.NewConstant(name, yyDollar[5].node, "") @@ -5425,7 +5433,7 @@ yydefault: } case 215: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3207 + //line php5/php5.y:3217 { name := node.NewIdentifier(yyDollar[2].token.Value) constant := stmt.NewConstant(name, yyDollar[4].node, "") @@ -5445,7 +5453,7 @@ yydefault: } case 216: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3228 + //line php5/php5.y:3238 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -5456,7 +5464,7 @@ yydefault: } case 217: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3237 + //line php5/php5.y:3247 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -5464,7 +5472,7 @@ yydefault: } case 218: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3247 + //line php5/php5.y:3257 { yyVAL.list = nil @@ -5472,7 +5480,7 @@ yydefault: } case 219: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3253 + //line php5/php5.y:3263 { yyVAL.list = yyDollar[1].list @@ -5480,7 +5488,7 @@ yydefault: } case 220: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3262 + //line php5/php5.y:3272 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -5491,7 +5499,7 @@ yydefault: } case 221: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3271 + //line php5/php5.y:3281 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -5499,7 +5507,7 @@ yydefault: } case 222: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3280 + //line php5/php5.y:3290 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) @@ -5507,7 +5515,7 @@ yydefault: } case 223: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3286 + //line php5/php5.y:3296 { yyVAL.list = yyDollar[1].list @@ -5515,7 +5523,7 @@ yydefault: } case 224: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3295 + //line php5/php5.y:3305 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yyVAL.list = append(yyDollar[1].list, fetch) @@ -5533,7 +5541,7 @@ yydefault: } case 225: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3311 + //line php5/php5.y:3321 { fetch := expr.NewArrayDimFetch(nil, yyDollar[2].node) yyVAL.list = []node.Node{fetch} @@ -5551,7 +5559,7 @@ yydefault: } case 226: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3330 + //line php5/php5.y:3340 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) @@ -5559,7 +5567,7 @@ yydefault: } case 227: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3336 + //line php5/php5.y:3346 { yyVAL.list = yyDollar[1].list @@ -5567,7 +5575,7 @@ yydefault: } case 228: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3342 + //line php5/php5.y:3352 { yyVAL.list = yyDollar[1].list @@ -5575,7 +5583,7 @@ yydefault: } case 229: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3351 + //line php5/php5.y:3361 { yyVAL.list = nil @@ -5583,7 +5591,7 @@ yydefault: } case 230: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3357 + //line php5/php5.y:3367 { yyVAL.list = yyDollar[1].list @@ -5591,7 +5599,7 @@ yydefault: } case 231: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3366 + //line php5/php5.y:3376 { if yyDollar[3].node != nil { @@ -5609,7 +5617,7 @@ yydefault: } case 232: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:3385 + //line php5/php5.y:3395 { list := expr.NewList(yyDollar[3].list) yyVAL.node = assign.NewAssign(list, yyDollar[6].node) @@ -5628,7 +5636,7 @@ yydefault: } case 233: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3402 + //line php5/php5.y:3412 { yyVAL.node = assign.NewAssign(yyDollar[1].node, yyDollar[3].node) @@ -5644,7 +5652,7 @@ yydefault: } case 234: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3416 + //line php5/php5.y:3426 { yyVAL.node = assign.NewReference(yyDollar[1].node, yyDollar[4].node) @@ -5661,7 +5669,7 @@ yydefault: } case 235: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:3431 + //line php5/php5.y:3441 { var _new *expr.New @@ -5691,7 +5699,7 @@ yydefault: } case 236: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3459 + //line php5/php5.y:3469 { yyVAL.node = expr.NewClone(yyDollar[2].node) @@ -5705,7 +5713,7 @@ yydefault: } case 237: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3471 + //line php5/php5.y:3481 { yyVAL.node = assign.NewPlus(yyDollar[1].node, yyDollar[3].node) @@ -5721,7 +5729,7 @@ yydefault: } case 238: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3485 + //line php5/php5.y:3495 { yyVAL.node = assign.NewMinus(yyDollar[1].node, yyDollar[3].node) @@ -5737,7 +5745,7 @@ yydefault: } case 239: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3499 + //line php5/php5.y:3509 { yyVAL.node = assign.NewMul(yyDollar[1].node, yyDollar[3].node) @@ -5753,7 +5761,7 @@ yydefault: } case 240: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3513 + //line php5/php5.y:3523 { yyVAL.node = assign.NewPow(yyDollar[1].node, yyDollar[3].node) @@ -5769,7 +5777,7 @@ yydefault: } case 241: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3527 + //line php5/php5.y:3537 { yyVAL.node = assign.NewDiv(yyDollar[1].node, yyDollar[3].node) @@ -5785,7 +5793,7 @@ yydefault: } case 242: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3541 + //line php5/php5.y:3551 { yyVAL.node = assign.NewConcat(yyDollar[1].node, yyDollar[3].node) @@ -5801,7 +5809,7 @@ yydefault: } case 243: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3555 + //line php5/php5.y:3565 { yyVAL.node = assign.NewMod(yyDollar[1].node, yyDollar[3].node) @@ -5817,7 +5825,7 @@ yydefault: } case 244: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3569 + //line php5/php5.y:3579 { yyVAL.node = assign.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) @@ -5833,7 +5841,7 @@ yydefault: } case 245: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3583 + //line php5/php5.y:3593 { yyVAL.node = assign.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) @@ -5849,7 +5857,7 @@ yydefault: } case 246: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3597 + //line php5/php5.y:3607 { yyVAL.node = assign.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) @@ -5865,7 +5873,7 @@ yydefault: } case 247: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3611 + //line php5/php5.y:3621 { yyVAL.node = assign.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) @@ -5881,7 +5889,7 @@ yydefault: } case 248: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3625 + //line php5/php5.y:3635 { yyVAL.node = assign.NewShiftRight(yyDollar[1].node, yyDollar[3].node) @@ -5897,7 +5905,7 @@ yydefault: } case 249: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3639 + //line php5/php5.y:3649 { yyVAL.node = expr.NewPostInc(yyDollar[1].node) @@ -5913,7 +5921,7 @@ yydefault: } case 250: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3653 + //line php5/php5.y:3663 { yyVAL.node = expr.NewPreInc(yyDollar[2].node) @@ -5927,7 +5935,7 @@ yydefault: } case 251: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3665 + //line php5/php5.y:3675 { yyVAL.node = expr.NewPostDec(yyDollar[1].node) @@ -5943,7 +5951,7 @@ yydefault: } case 252: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3679 + //line php5/php5.y:3689 { yyVAL.node = expr.NewPreDec(yyDollar[2].node) @@ -5957,7 +5965,7 @@ yydefault: } case 253: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3691 + //line php5/php5.y:3701 { yyVAL.node = binary.NewBooleanOr(yyDollar[1].node, yyDollar[3].node) @@ -5973,7 +5981,7 @@ yydefault: } case 254: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3705 + //line php5/php5.y:3715 { yyVAL.node = binary.NewBooleanAnd(yyDollar[1].node, yyDollar[3].node) @@ -5989,7 +5997,7 @@ yydefault: } case 255: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3719 + //line php5/php5.y:3729 { yyVAL.node = binary.NewLogicalOr(yyDollar[1].node, yyDollar[3].node) @@ -6005,7 +6013,7 @@ yydefault: } case 256: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3733 + //line php5/php5.y:3743 { yyVAL.node = binary.NewLogicalAnd(yyDollar[1].node, yyDollar[3].node) @@ -6021,7 +6029,7 @@ yydefault: } case 257: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3747 + //line php5/php5.y:3757 { yyVAL.node = binary.NewLogicalXor(yyDollar[1].node, yyDollar[3].node) @@ -6037,7 +6045,7 @@ yydefault: } case 258: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3761 + //line php5/php5.y:3771 { yyVAL.node = binary.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) @@ -6053,7 +6061,7 @@ yydefault: } case 259: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3775 + //line php5/php5.y:3785 { yyVAL.node = binary.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) @@ -6069,7 +6077,7 @@ yydefault: } case 260: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3789 + //line php5/php5.y:3799 { yyVAL.node = binary.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) @@ -6085,7 +6093,7 @@ yydefault: } case 261: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3803 + //line php5/php5.y:3813 { yyVAL.node = binary.NewConcat(yyDollar[1].node, yyDollar[3].node) @@ -6101,7 +6109,7 @@ yydefault: } case 262: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3817 + //line php5/php5.y:3827 { yyVAL.node = binary.NewPlus(yyDollar[1].node, yyDollar[3].node) @@ -6117,7 +6125,7 @@ yydefault: } case 263: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3831 + //line php5/php5.y:3841 { yyVAL.node = binary.NewMinus(yyDollar[1].node, yyDollar[3].node) @@ -6133,7 +6141,7 @@ yydefault: } case 264: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3845 + //line php5/php5.y:3855 { yyVAL.node = binary.NewMul(yyDollar[1].node, yyDollar[3].node) @@ -6149,7 +6157,7 @@ yydefault: } case 265: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3859 + //line php5/php5.y:3869 { yyVAL.node = binary.NewPow(yyDollar[1].node, yyDollar[3].node) @@ -6165,7 +6173,7 @@ yydefault: } case 266: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3873 + //line php5/php5.y:3883 { yyVAL.node = binary.NewDiv(yyDollar[1].node, yyDollar[3].node) @@ -6181,7 +6189,7 @@ yydefault: } case 267: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3887 + //line php5/php5.y:3897 { yyVAL.node = binary.NewMod(yyDollar[1].node, yyDollar[3].node) @@ -6197,7 +6205,7 @@ yydefault: } case 268: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3901 + //line php5/php5.y:3911 { yyVAL.node = binary.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) @@ -6213,7 +6221,7 @@ yydefault: } case 269: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3915 + //line php5/php5.y:3925 { yyVAL.node = binary.NewShiftRight(yyDollar[1].node, yyDollar[3].node) @@ -6229,7 +6237,7 @@ yydefault: } case 270: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3929 + //line php5/php5.y:3939 { yyVAL.node = expr.NewUnaryPlus(yyDollar[2].node) @@ -6243,7 +6251,7 @@ yydefault: } case 271: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3941 + //line php5/php5.y:3951 { yyVAL.node = expr.NewUnaryMinus(yyDollar[2].node) @@ -6257,7 +6265,7 @@ yydefault: } case 272: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3953 + //line php5/php5.y:3963 { yyVAL.node = expr.NewBooleanNot(yyDollar[2].node) @@ -6271,7 +6279,7 @@ yydefault: } case 273: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3965 + //line php5/php5.y:3975 { yyVAL.node = expr.NewBitwiseNot(yyDollar[2].node) @@ -6285,7 +6293,7 @@ yydefault: } case 274: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3977 + //line php5/php5.y:3987 { yyVAL.node = binary.NewIdentical(yyDollar[1].node, yyDollar[3].node) @@ -6301,7 +6309,7 @@ yydefault: } case 275: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3991 + //line php5/php5.y:4001 { yyVAL.node = binary.NewNotIdentical(yyDollar[1].node, yyDollar[3].node) @@ -6317,7 +6325,7 @@ yydefault: } case 276: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4005 + //line php5/php5.y:4015 { yyVAL.node = binary.NewEqual(yyDollar[1].node, yyDollar[3].node) @@ -6333,7 +6341,7 @@ yydefault: } case 277: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4019 + //line php5/php5.y:4029 { yyVAL.node = binary.NewNotEqual(yyDollar[1].node, yyDollar[3].node) @@ -6350,7 +6358,7 @@ yydefault: } case 278: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4034 + //line php5/php5.y:4044 { yyVAL.node = binary.NewSmaller(yyDollar[1].node, yyDollar[3].node) @@ -6366,7 +6374,7 @@ yydefault: } case 279: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4048 + //line php5/php5.y:4058 { yyVAL.node = binary.NewSmallerOrEqual(yyDollar[1].node, yyDollar[3].node) @@ -6382,7 +6390,7 @@ yydefault: } case 280: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4062 + //line php5/php5.y:4072 { yyVAL.node = binary.NewGreater(yyDollar[1].node, yyDollar[3].node) @@ -6398,7 +6406,7 @@ yydefault: } case 281: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4076 + //line php5/php5.y:4086 { yyVAL.node = binary.NewGreaterOrEqual(yyDollar[1].node, yyDollar[3].node) @@ -6414,7 +6422,7 @@ yydefault: } case 282: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4090 + //line php5/php5.y:4100 { yyVAL.node = expr.NewInstanceOf(yyDollar[1].node, yyDollar[3].node) @@ -6430,7 +6438,7 @@ yydefault: } case 283: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4104 + //line php5/php5.y:4114 { yyVAL.node = yyDollar[1].node @@ -6441,7 +6449,7 @@ yydefault: } case 284: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4113 + //line php5/php5.y:4123 { yyVAL.node = yyDollar[1].node @@ -6449,7 +6457,7 @@ yydefault: } case 285: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4119 + //line php5/php5.y:4129 { yyVAL.node = yyDollar[2].node @@ -6485,7 +6493,7 @@ yydefault: } case 286: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:4153 + //line php5/php5.y:4163 { yyVAL.node = expr.NewTernary(yyDollar[1].node, yyDollar[3].node, yyDollar[5].node) @@ -6502,7 +6510,7 @@ yydefault: } case 287: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4168 + //line php5/php5.y:4178 { yyVAL.node = expr.NewTernary(yyDollar[1].node, nil, yyDollar[4].node) @@ -6519,7 +6527,7 @@ yydefault: } case 288: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4183 + //line php5/php5.y:4193 { yyVAL.node = yyDollar[1].node @@ -6527,7 +6535,7 @@ yydefault: } case 289: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4189 + //line php5/php5.y:4199 { yyVAL.node = cast.NewInt(yyDollar[2].node) @@ -6542,7 +6550,7 @@ yydefault: } case 290: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4202 + //line php5/php5.y:4212 { yyVAL.node = cast.NewDouble(yyDollar[2].node) @@ -6557,7 +6565,7 @@ yydefault: } case 291: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4215 + //line php5/php5.y:4225 { yyVAL.node = cast.NewString(yyDollar[2].node) @@ -6572,7 +6580,7 @@ yydefault: } case 292: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4228 + //line php5/php5.y:4238 { yyVAL.node = cast.NewArray(yyDollar[2].node) @@ -6587,7 +6595,7 @@ yydefault: } case 293: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4241 + //line php5/php5.y:4251 { yyVAL.node = cast.NewObject(yyDollar[2].node) @@ -6602,7 +6610,7 @@ yydefault: } case 294: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4254 + //line php5/php5.y:4264 { yyVAL.node = cast.NewBool(yyDollar[2].node) @@ -6617,7 +6625,7 @@ yydefault: } case 295: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4267 + //line php5/php5.y:4277 { yyVAL.node = cast.NewUnset(yyDollar[2].node) @@ -6632,7 +6640,7 @@ yydefault: } case 296: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4280 + //line php5/php5.y:4290 { var e *expr.Exit if yyDollar[2].node != nil { @@ -6661,7 +6669,7 @@ yydefault: } case 297: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4307 + //line php5/php5.y:4317 { yyVAL.node = expr.NewErrorSuppress(yyDollar[2].node) @@ -6675,7 +6683,7 @@ yydefault: } case 298: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4319 + //line php5/php5.y:4329 { yyVAL.node = yyDollar[1].node @@ -6683,7 +6691,7 @@ yydefault: } case 299: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4325 + //line php5/php5.y:4335 { yyVAL.node = yyDollar[1].node @@ -6691,7 +6699,7 @@ yydefault: } case 300: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4331 + //line php5/php5.y:4341 { yyVAL.node = yyDollar[1].node @@ -6699,7 +6707,7 @@ yydefault: } case 301: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4337 + //line php5/php5.y:4347 { yyVAL.node = expr.NewShellExec(yyDollar[2].list) @@ -6713,7 +6721,7 @@ yydefault: } case 302: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4349 + //line php5/php5.y:4359 { yyVAL.node = expr.NewPrint(yyDollar[2].node) @@ -6727,7 +6735,7 @@ yydefault: } case 303: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4361 + //line php5/php5.y:4371 { yyVAL.node = expr.NewYield(nil, nil) @@ -6741,7 +6749,7 @@ yydefault: } case 304: yyDollar = yyS[yypt-9 : yypt+1] - //line php5/php5.y:4373 + //line php5/php5.y:4383 { yyVAL.node = expr.NewClosure(yyDollar[4].list, yyDollar[6].ClosureUse, nil, yyDollar[8].list, false, yyDollar[2].token != nil, "") @@ -6762,7 +6770,7 @@ yydefault: } case 305: yyDollar = yyS[yypt-10 : yypt+1] - //line php5/php5.y:4392 + //line php5/php5.y:4402 { yyVAL.node = expr.NewClosure(yyDollar[5].list, yyDollar[7].ClosureUse, nil, yyDollar[9].list, true, yyDollar[3].token != nil, "") @@ -6784,7 +6792,7 @@ yydefault: } case 306: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4415 + //line php5/php5.y:4425 { yyVAL.node = expr.NewYield(nil, yyDollar[2].node) @@ -6798,7 +6806,7 @@ yydefault: } case 307: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4427 + //line php5/php5.y:4437 { yyVAL.node = expr.NewYield(nil, yyDollar[2].node) @@ -6812,7 +6820,7 @@ yydefault: } case 308: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4439 + //line php5/php5.y:4449 { yyVAL.node = expr.NewYield(yyDollar[2].node, yyDollar[4].node) @@ -6827,7 +6835,7 @@ yydefault: } case 309: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4452 + //line php5/php5.y:4462 { yyVAL.node = expr.NewYield(yyDollar[2].node, yyDollar[4].node) @@ -6842,7 +6850,7 @@ yydefault: } case 310: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4468 + //line php5/php5.y:4478 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -6861,7 +6869,7 @@ yydefault: } case 311: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4485 + //line php5/php5.y:4495 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -6880,7 +6888,7 @@ yydefault: } case 312: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4502 + //line php5/php5.y:4512 { str := scalar.NewString(yyDollar[1].token.Value) yyVAL.node = expr.NewArrayDimFetch(str, yyDollar[3].node) @@ -6900,7 +6908,7 @@ yydefault: } case 313: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4520 + //line php5/php5.y:4530 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -6919,7 +6927,7 @@ yydefault: } case 314: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4540 + //line php5/php5.y:4550 { yyVAL.node = expr.NewArray(yyDollar[3].list) @@ -6935,7 +6943,7 @@ yydefault: } case 315: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4554 + //line php5/php5.y:4564 { yyVAL.node = expr.NewShortArray(yyDollar[2].list) @@ -6950,13 +6958,13 @@ yydefault: } case 316: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4570 + //line php5/php5.y:4580 { yyVAL.token = yyDollar[1].token } case 317: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:4577 + //line php5/php5.y:4587 { yyVAL.ClosureUse = nil @@ -6964,7 +6972,7 @@ yydefault: } case 318: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4583 + //line php5/php5.y:4593 { yyVAL.ClosureUse = expr.NewClosureUse(yyDollar[3].list) @@ -6980,7 +6988,7 @@ yydefault: } case 319: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4600 + //line php5/php5.y:4610 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[3].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -6999,7 +7007,7 @@ yydefault: } case 320: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4617 + //line php5/php5.y:4627 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[4].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -7021,7 +7029,7 @@ yydefault: } case 321: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4637 + //line php5/php5.y:4647 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -7039,7 +7047,7 @@ yydefault: } case 322: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4653 + //line php5/php5.y:4663 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[2].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -7060,7 +7068,7 @@ yydefault: } case 323: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4675 + //line php5/php5.y:4685 { name := name.NewName(yyDollar[1].list) yyVAL.node = expr.NewFunctionCall(name, yyDollar[2].node.(*node.ArgumentList)) @@ -7076,7 +7084,7 @@ yydefault: } case 324: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4689 + //line php5/php5.y:4699 { funcName := name.NewRelative(yyDollar[3].list) yyVAL.node = expr.NewFunctionCall(funcName, yyDollar[4].node.(*node.ArgumentList)) @@ -7093,7 +7101,7 @@ yydefault: } case 325: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4704 + //line php5/php5.y:4714 { funcName := name.NewFullyQualified(yyDollar[2].list) yyVAL.node = expr.NewFunctionCall(funcName, yyDollar[3].node.(*node.ArgumentList)) @@ -7109,7 +7117,7 @@ yydefault: } case 326: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4718 + //line php5/php5.y:4728 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -7124,7 +7132,7 @@ yydefault: } case 327: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4731 + //line php5/php5.y:4741 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -7139,7 +7147,7 @@ yydefault: } case 328: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4744 + //line php5/php5.y:4754 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -7154,7 +7162,7 @@ yydefault: } case 329: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4757 + //line php5/php5.y:4767 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -7169,7 +7177,7 @@ yydefault: } case 330: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4770 + //line php5/php5.y:4780 { yyVAL.node = expr.NewFunctionCall(yyDollar[1].node, yyDollar[2].node.(*node.ArgumentList)) @@ -7181,7 +7189,7 @@ yydefault: } case 331: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4783 + //line php5/php5.y:4793 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -7195,7 +7203,7 @@ yydefault: } case 332: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4795 + //line php5/php5.y:4805 { yyVAL.node = name.NewName(yyDollar[1].list) @@ -7209,7 +7217,7 @@ yydefault: } case 333: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4807 + //line php5/php5.y:4817 { yyVAL.node = name.NewRelative(yyDollar[3].list) @@ -7224,7 +7232,7 @@ yydefault: } case 334: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4820 + //line php5/php5.y:4830 { yyVAL.node = name.NewFullyQualified(yyDollar[2].list) @@ -7238,7 +7246,7 @@ yydefault: } case 335: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4835 + //line php5/php5.y:4845 { yyVAL.node = name.NewName(yyDollar[1].list) @@ -7252,7 +7260,7 @@ yydefault: } case 336: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4847 + //line php5/php5.y:4857 { yyVAL.node = name.NewRelative(yyDollar[3].list) @@ -7267,7 +7275,7 @@ yydefault: } case 337: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4860 + //line php5/php5.y:4870 { yyVAL.node = name.NewFullyQualified(yyDollar[2].list) @@ -7281,7 +7289,7 @@ yydefault: } case 338: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4875 + //line php5/php5.y:4885 { yyVAL.node = yyDollar[1].node @@ -7289,7 +7297,7 @@ yydefault: } case 339: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4881 + //line php5/php5.y:4891 { yyVAL.node = yyDollar[1].node @@ -7297,7 +7305,7 @@ yydefault: } case 340: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4890 + //line php5/php5.y:4900 { yyVAL.node = yyDollar[1].node @@ -7340,7 +7348,7 @@ yydefault: } case 341: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4931 + //line php5/php5.y:4941 { yyVAL.node = yyDollar[1].node @@ -7348,7 +7356,7 @@ yydefault: } case 342: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4941 + //line php5/php5.y:4951 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) @@ -7356,7 +7364,7 @@ yydefault: } case 343: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:4947 + //line php5/php5.y:4957 { yyVAL.list = []node.Node{} @@ -7364,7 +7372,7 @@ yydefault: } case 344: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4957 + //line php5/php5.y:4967 { yyVAL.list = yyDollar[2].list @@ -7375,7 +7383,7 @@ yydefault: } case 345: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:4969 + //line php5/php5.y:4979 { yyVAL.node = nil @@ -7383,7 +7391,7 @@ yydefault: } case 346: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4975 + //line php5/php5.y:4985 { yyVAL.node = expr.NewExit(nil) @@ -7400,7 +7408,7 @@ yydefault: } case 347: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4990 + //line php5/php5.y:5000 { yyVAL.node = expr.NewExit(yyDollar[1].node) @@ -7419,7 +7427,7 @@ yydefault: } case 348: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:5010 + //line php5/php5.y:5020 { yyVAL.list = []node.Node{} @@ -7427,7 +7435,7 @@ yydefault: } case 349: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5016 + //line php5/php5.y:5026 { yyVAL.list = []node.Node{scalar.NewEncapsedStringPart(yyDollar[1].token.Value)} @@ -7435,7 +7443,7 @@ yydefault: } case 350: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5022 + //line php5/php5.y:5032 { yyVAL.list = yyDollar[1].list @@ -7443,7 +7451,7 @@ yydefault: } case 351: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:5031 + //line php5/php5.y:5041 { yyVAL.node = nil @@ -7451,7 +7459,7 @@ yydefault: } case 352: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5037 + //line php5/php5.y:5047 { yyVAL.node = yyDollar[1].node @@ -7459,7 +7467,7 @@ yydefault: } case 353: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5046 + //line php5/php5.y:5056 { yyVAL.node = scalar.NewLnumber(yyDollar[1].token.Value) @@ -7473,7 +7481,7 @@ yydefault: } case 354: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5058 + //line php5/php5.y:5068 { yyVAL.node = scalar.NewDnumber(yyDollar[1].token.Value) @@ -7487,7 +7495,7 @@ yydefault: } case 355: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5070 + //line php5/php5.y:5080 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) @@ -7501,7 +7509,7 @@ yydefault: } case 356: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5082 + //line php5/php5.y:5092 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7515,7 +7523,7 @@ yydefault: } case 357: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5094 + //line php5/php5.y:5104 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7529,7 +7537,7 @@ yydefault: } case 358: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5106 + //line php5/php5.y:5116 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7543,7 +7551,7 @@ yydefault: } case 359: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5118 + //line php5/php5.y:5128 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7557,7 +7565,7 @@ yydefault: } case 360: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5130 + //line php5/php5.y:5140 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7571,7 +7579,7 @@ yydefault: } case 361: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5142 + //line php5/php5.y:5152 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7585,7 +7593,7 @@ yydefault: } case 362: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5154 + //line php5/php5.y:5164 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7599,7 +7607,7 @@ yydefault: } case 363: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5166 + //line php5/php5.y:5176 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, []node.Node{encapsed}) @@ -7615,7 +7623,7 @@ yydefault: } case 364: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5180 + //line php5/php5.y:5190 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, nil) @@ -7629,7 +7637,7 @@ yydefault: } case 365: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5195 + //line php5/php5.y:5205 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -7648,7 +7656,7 @@ yydefault: } case 366: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5215 + //line php5/php5.y:5225 { yyVAL.node = yyDollar[1].node @@ -7656,7 +7664,7 @@ yydefault: } case 367: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5224 + //line php5/php5.y:5234 { yyVAL.node = yyDollar[1].node @@ -7664,7 +7672,7 @@ yydefault: } case 368: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5230 + //line php5/php5.y:5240 { yyVAL.node = yyDollar[1].node @@ -7672,7 +7680,7 @@ yydefault: } case 369: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5236 + //line php5/php5.y:5246 { name := name.NewName(yyDollar[1].list) yyVAL.node = expr.NewConstFetch(name) @@ -7688,7 +7696,7 @@ yydefault: } case 370: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5250 + //line php5/php5.y:5260 { name := name.NewRelative(yyDollar[3].list) yyVAL.node = expr.NewConstFetch(name) @@ -7705,7 +7713,7 @@ yydefault: } case 371: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5265 + //line php5/php5.y:5275 { name := name.NewFullyQualified(yyDollar[2].list) yyVAL.node = expr.NewConstFetch(name) @@ -7721,7 +7729,7 @@ yydefault: } case 372: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:5279 + //line php5/php5.y:5289 { yyVAL.node = expr.NewArray(yyDollar[3].list) @@ -7737,7 +7745,7 @@ yydefault: } case 373: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5293 + //line php5/php5.y:5303 { yyVAL.node = expr.NewShortArray(yyDollar[2].list) @@ -7752,7 +7760,7 @@ yydefault: } case 374: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5306 + //line php5/php5.y:5316 { yyVAL.node = yyDollar[1].node @@ -7760,7 +7768,7 @@ yydefault: } case 375: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5312 + //line php5/php5.y:5322 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7774,7 +7782,7 @@ yydefault: } case 376: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5324 + //line php5/php5.y:5334 { yyVAL.node = yyDollar[1].node @@ -7782,7 +7790,7 @@ yydefault: } case 377: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:5333 + //line php5/php5.y:5343 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -7801,7 +7809,7 @@ yydefault: } case 378: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5350 + //line php5/php5.y:5360 { yyVAL.node = binary.NewPlus(yyDollar[1].node, yyDollar[3].node) @@ -7817,7 +7825,7 @@ yydefault: } case 379: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5364 + //line php5/php5.y:5374 { yyVAL.node = binary.NewMinus(yyDollar[1].node, yyDollar[3].node) @@ -7833,7 +7841,7 @@ yydefault: } case 380: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5378 + //line php5/php5.y:5388 { yyVAL.node = binary.NewMul(yyDollar[1].node, yyDollar[3].node) @@ -7849,7 +7857,7 @@ yydefault: } case 381: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5392 + //line php5/php5.y:5402 { yyVAL.node = binary.NewPow(yyDollar[1].node, yyDollar[3].node) @@ -7865,7 +7873,7 @@ yydefault: } case 382: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5406 + //line php5/php5.y:5416 { yyVAL.node = binary.NewDiv(yyDollar[1].node, yyDollar[3].node) @@ -7881,7 +7889,7 @@ yydefault: } case 383: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5420 + //line php5/php5.y:5430 { yyVAL.node = binary.NewMod(yyDollar[1].node, yyDollar[3].node) @@ -7897,7 +7905,7 @@ yydefault: } case 384: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5434 + //line php5/php5.y:5444 { yyVAL.node = expr.NewBooleanNot(yyDollar[2].node) @@ -7911,7 +7919,7 @@ yydefault: } case 385: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5446 + //line php5/php5.y:5456 { yyVAL.node = expr.NewBitwiseNot(yyDollar[2].node) @@ -7925,7 +7933,7 @@ yydefault: } case 386: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5458 + //line php5/php5.y:5468 { yyVAL.node = binary.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) @@ -7941,7 +7949,7 @@ yydefault: } case 387: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5472 + //line php5/php5.y:5482 { yyVAL.node = binary.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) @@ -7957,7 +7965,7 @@ yydefault: } case 388: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5486 + //line php5/php5.y:5496 { yyVAL.node = binary.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) @@ -7973,7 +7981,7 @@ yydefault: } case 389: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5500 + //line php5/php5.y:5510 { yyVAL.node = binary.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) @@ -7989,7 +7997,7 @@ yydefault: } case 390: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5514 + //line php5/php5.y:5524 { yyVAL.node = binary.NewShiftRight(yyDollar[1].node, yyDollar[3].node) @@ -8005,7 +8013,7 @@ yydefault: } case 391: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5528 + //line php5/php5.y:5538 { yyVAL.node = binary.NewConcat(yyDollar[1].node, yyDollar[3].node) @@ -8021,7 +8029,7 @@ yydefault: } case 392: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5542 + //line php5/php5.y:5552 { yyVAL.node = binary.NewLogicalXor(yyDollar[1].node, yyDollar[3].node) @@ -8037,7 +8045,7 @@ yydefault: } case 393: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5556 + //line php5/php5.y:5566 { yyVAL.node = binary.NewLogicalAnd(yyDollar[1].node, yyDollar[3].node) @@ -8053,7 +8061,7 @@ yydefault: } case 394: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5570 + //line php5/php5.y:5580 { yyVAL.node = binary.NewLogicalOr(yyDollar[1].node, yyDollar[3].node) @@ -8069,7 +8077,7 @@ yydefault: } case 395: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5584 + //line php5/php5.y:5594 { yyVAL.node = binary.NewBooleanAnd(yyDollar[1].node, yyDollar[3].node) @@ -8085,7 +8093,7 @@ yydefault: } case 396: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5598 + //line php5/php5.y:5608 { yyVAL.node = binary.NewBooleanOr(yyDollar[1].node, yyDollar[3].node) @@ -8101,7 +8109,7 @@ yydefault: } case 397: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5612 + //line php5/php5.y:5622 { yyVAL.node = binary.NewIdentical(yyDollar[1].node, yyDollar[3].node) @@ -8117,7 +8125,7 @@ yydefault: } case 398: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5626 + //line php5/php5.y:5636 { yyVAL.node = binary.NewNotIdentical(yyDollar[1].node, yyDollar[3].node) @@ -8133,7 +8141,7 @@ yydefault: } case 399: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5640 + //line php5/php5.y:5650 { yyVAL.node = binary.NewEqual(yyDollar[1].node, yyDollar[3].node) @@ -8149,7 +8157,7 @@ yydefault: } case 400: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5654 + //line php5/php5.y:5664 { yyVAL.node = binary.NewNotEqual(yyDollar[1].node, yyDollar[3].node) @@ -8166,7 +8174,7 @@ yydefault: } case 401: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5669 + //line php5/php5.y:5679 { yyVAL.node = binary.NewSmaller(yyDollar[1].node, yyDollar[3].node) @@ -8182,7 +8190,7 @@ yydefault: } case 402: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5683 + //line php5/php5.y:5693 { yyVAL.node = binary.NewGreater(yyDollar[1].node, yyDollar[3].node) @@ -8198,7 +8206,7 @@ yydefault: } case 403: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5697 + //line php5/php5.y:5707 { yyVAL.node = binary.NewSmallerOrEqual(yyDollar[1].node, yyDollar[3].node) @@ -8214,7 +8222,7 @@ yydefault: } case 404: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5711 + //line php5/php5.y:5721 { yyVAL.node = binary.NewGreaterOrEqual(yyDollar[1].node, yyDollar[3].node) @@ -8230,7 +8238,7 @@ yydefault: } case 405: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:5725 + //line php5/php5.y:5735 { yyVAL.node = expr.NewTernary(yyDollar[1].node, nil, yyDollar[4].node) @@ -8247,7 +8255,7 @@ yydefault: } case 406: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:5740 + //line php5/php5.y:5750 { yyVAL.node = expr.NewTernary(yyDollar[1].node, yyDollar[3].node, yyDollar[5].node) @@ -8264,7 +8272,7 @@ yydefault: } case 407: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5755 + //line php5/php5.y:5765 { yyVAL.node = expr.NewUnaryPlus(yyDollar[2].node) @@ -8278,7 +8286,7 @@ yydefault: } case 408: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5767 + //line php5/php5.y:5777 { yyVAL.node = expr.NewUnaryMinus(yyDollar[2].node) @@ -8292,7 +8300,7 @@ yydefault: } case 409: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5779 + //line php5/php5.y:5789 { yyVAL.node = yyDollar[2].node @@ -8306,7 +8314,7 @@ yydefault: } case 410: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5794 + //line php5/php5.y:5804 { yyVAL.node = yyDollar[1].node @@ -8314,7 +8322,7 @@ yydefault: } case 411: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5800 + //line php5/php5.y:5810 { name := name.NewName(yyDollar[1].list) yyVAL.node = expr.NewConstFetch(name) @@ -8330,7 +8338,7 @@ yydefault: } case 412: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5814 + //line php5/php5.y:5824 { name := name.NewRelative(yyDollar[3].list) yyVAL.node = expr.NewConstFetch(name) @@ -8345,7 +8353,7 @@ yydefault: } case 413: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5827 + //line php5/php5.y:5837 { name := name.NewFullyQualified(yyDollar[2].list) yyVAL.node = expr.NewConstFetch(name) @@ -8361,7 +8369,7 @@ yydefault: } case 414: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5844 + //line php5/php5.y:5854 { name := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = expr.NewVariable(name) @@ -8378,7 +8386,7 @@ yydefault: } case 415: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5859 + //line php5/php5.y:5869 { yyVAL.node = yyDollar[1].node @@ -8386,7 +8394,7 @@ yydefault: } case 416: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5865 + //line php5/php5.y:5875 { yyVAL.node = yyDollar[1].node @@ -8394,7 +8402,7 @@ yydefault: } case 417: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5871 + //line php5/php5.y:5881 { yyVAL.node = yyDollar[1].node @@ -8402,7 +8410,7 @@ yydefault: } case 418: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5877 + //line php5/php5.y:5887 { yyVAL.node = scalar.NewEncapsed(yyDollar[2].list) @@ -8416,7 +8424,7 @@ yydefault: } case 419: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5889 + //line php5/php5.y:5899 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, yyDollar[2].list) @@ -8430,7 +8438,7 @@ yydefault: } case 420: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5901 + //line php5/php5.y:5911 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -8444,7 +8452,7 @@ yydefault: } case 421: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:5916 + //line php5/php5.y:5926 { yyVAL.list = nil @@ -8452,7 +8460,7 @@ yydefault: } case 422: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5922 + //line php5/php5.y:5932 { yyVAL.list = yyDollar[1].list @@ -8465,19 +8473,19 @@ yydefault: } case 423: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:5936 + //line php5/php5.y:5946 { yyVAL.token = nil } case 424: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5940 + //line php5/php5.y:5950 { yyVAL.token = yyDollar[1].token } case 425: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:5947 + //line php5/php5.y:5957 { arrayItem := expr.NewArrayItem(yyDollar[3].node, yyDollar[5].node) yyVAL.list = append(yyDollar[1].list, arrayItem) @@ -8495,7 +8503,7 @@ yydefault: } case 426: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5963 + //line php5/php5.y:5973 { arrayItem := expr.NewArrayItem(nil, yyDollar[3].node) yyVAL.list = append(yyDollar[1].list, arrayItem) @@ -8512,7 +8520,7 @@ yydefault: } case 427: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5978 + //line php5/php5.y:5988 { arrayItem := expr.NewArrayItem(yyDollar[1].node, yyDollar[3].node) yyVAL.list = []node.Node{arrayItem} @@ -8529,7 +8537,7 @@ yydefault: } case 428: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5993 + //line php5/php5.y:6003 { arrayItem := expr.NewArrayItem(nil, yyDollar[1].node) yyVAL.list = []node.Node{arrayItem} @@ -8543,7 +8551,7 @@ yydefault: } case 429: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6008 + //line php5/php5.y:6018 { yyVAL.node = yyDollar[1].node @@ -8551,7 +8559,7 @@ yydefault: } case 430: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6014 + //line php5/php5.y:6024 { yyVAL.node = yyDollar[1].node @@ -8559,7 +8567,7 @@ yydefault: } case 431: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6023 + //line php5/php5.y:6033 { yyVAL.node = yyDollar[2].node @@ -8573,7 +8581,7 @@ yydefault: } case 432: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6035 + //line php5/php5.y:6045 { yyVAL.node = yyDollar[2].node @@ -8587,7 +8595,7 @@ yydefault: } case 433: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6051 + //line php5/php5.y:6061 { yyVAL.node = yyDollar[1].node @@ -8595,7 +8603,7 @@ yydefault: } case 434: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6061 + //line php5/php5.y:6071 { yyVAL.node = yyDollar[1].node @@ -8603,7 +8611,7 @@ yydefault: } case 435: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6070 + //line php5/php5.y:6080 { yyVAL.node = yyDollar[1].node @@ -8611,7 +8619,7 @@ yydefault: } case 436: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:6079 + //line php5/php5.y:6089 { yyVAL.node = yyDollar[1].node @@ -8671,7 +8679,7 @@ yydefault: } case 437: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6137 + //line php5/php5.y:6147 { yyVAL.node = yyDollar[1].node @@ -8679,7 +8687,7 @@ yydefault: } case 438: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6146 + //line php5/php5.y:6156 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) @@ -8687,7 +8695,7 @@ yydefault: } case 439: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:6152 + //line php5/php5.y:6162 { yyVAL.list = []node.Node{} @@ -8695,7 +8703,7 @@ yydefault: } case 440: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6162 + //line php5/php5.y:6172 { if yyDollar[3].list != nil { yyDollar[3].list[0].(*expr.MethodCall).Method = yyDollar[2].list[len(yyDollar[2].list)-1].(*expr.PropertyFetch).Property @@ -8711,7 +8719,7 @@ yydefault: } case 441: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6179 + //line php5/php5.y:6189 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yyVAL.list = append(yyDollar[1].list, fetch) @@ -8729,7 +8737,7 @@ yydefault: } case 442: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6195 + //line php5/php5.y:6205 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yyVAL.list = []node.Node{yyDollar[1].node, fetch} @@ -8747,7 +8755,7 @@ yydefault: } case 443: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6214 + //line php5/php5.y:6224 { yyVAL.node = expr.NewMethodCall(nil, nil, yyDollar[1].node.(*node.ArgumentList)) @@ -8758,7 +8766,7 @@ yydefault: } case 444: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6226 + //line php5/php5.y:6236 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -8766,7 +8774,7 @@ yydefault: } case 445: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6232 + //line php5/php5.y:6242 { yyVAL.list = yyDollar[1].list @@ -8774,7 +8782,7 @@ yydefault: } case 446: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:6238 + //line php5/php5.y:6248 { yyVAL.list = nil @@ -8782,7 +8790,7 @@ yydefault: } case 447: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6247 + //line php5/php5.y:6257 { yyVAL.node = yyDollar[1].node @@ -8790,7 +8798,7 @@ yydefault: } case 448: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6253 + //line php5/php5.y:6263 { yyDollar[1].simpleIndirectReference.last.SetVarName(yyDollar[2].node) @@ -8804,7 +8812,7 @@ yydefault: } case 449: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6268 + //line php5/php5.y:6278 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -8820,7 +8828,7 @@ yydefault: } case 450: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6282 + //line php5/php5.y:6292 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -8836,7 +8844,7 @@ yydefault: } case 451: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6299 + //line php5/php5.y:6309 { yyVAL.node = yyDollar[1].node @@ -8844,7 +8852,7 @@ yydefault: } case 452: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6308 + //line php5/php5.y:6318 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -8863,7 +8871,7 @@ yydefault: } case 453: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6325 + //line php5/php5.y:6335 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -8882,7 +8890,7 @@ yydefault: } case 454: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6345 + //line php5/php5.y:6355 { yyVAL.node = yyDollar[1].node @@ -8890,7 +8898,7 @@ yydefault: } case 455: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6351 + //line php5/php5.y:6361 { yyVAL.node = yyDollar[1].node @@ -8898,7 +8906,7 @@ yydefault: } case 456: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6357 + //line php5/php5.y:6367 { yyVAL.node = yyDollar[1].node @@ -8906,7 +8914,7 @@ yydefault: } case 457: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6367 + //line php5/php5.y:6377 { yyVAL.node = yyDollar[1].node @@ -8914,7 +8922,7 @@ yydefault: } case 458: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6373 + //line php5/php5.y:6383 { yyDollar[1].simpleIndirectReference.last.SetVarName(yyDollar[2].node) @@ -8928,7 +8936,7 @@ yydefault: } case 459: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6385 + //line php5/php5.y:6395 { yyVAL.node = yyDollar[1].node @@ -8936,7 +8944,7 @@ yydefault: } case 460: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6394 + //line php5/php5.y:6404 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -8955,7 +8963,7 @@ yydefault: } case 461: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6411 + //line php5/php5.y:6421 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -8974,7 +8982,7 @@ yydefault: } case 462: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6428 + //line php5/php5.y:6438 { yyVAL.node = yyDollar[1].node @@ -8982,7 +8990,7 @@ yydefault: } case 463: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6438 + //line php5/php5.y:6448 { name := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(name) @@ -8999,7 +9007,7 @@ yydefault: } case 464: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6453 + //line php5/php5.y:6463 { yyVAL.node = expr.NewVariable(yyDollar[3].node) @@ -9018,7 +9026,7 @@ yydefault: } case 465: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:6473 + //line php5/php5.y:6483 { yyVAL.node = nil @@ -9026,7 +9034,7 @@ yydefault: } case 466: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6479 + //line php5/php5.y:6489 { yyVAL.node = yyDollar[1].node @@ -9034,7 +9042,7 @@ yydefault: } case 467: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6489 + //line php5/php5.y:6499 { yyVAL.list = yyDollar[1].list @@ -9042,7 +9050,7 @@ yydefault: } case 468: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6495 + //line php5/php5.y:6505 { fetch := expr.NewPropertyFetch(nil, yyDollar[1].node) yyVAL.list = []node.Node{fetch} @@ -9054,7 +9062,7 @@ yydefault: } case 469: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6508 + //line php5/php5.y:6518 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yyVAL.list = append(yyDollar[1].list, fetch) @@ -9072,7 +9080,7 @@ yydefault: } case 470: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6524 + //line php5/php5.y:6534 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yyVAL.list = append(yyDollar[1].list, fetch) @@ -9090,7 +9098,7 @@ yydefault: } case 471: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6540 + //line php5/php5.y:6550 { fetch := expr.NewPropertyFetch(nil, yyDollar[1].node) yyVAL.list = []node.Node{fetch} @@ -9102,7 +9110,7 @@ yydefault: } case 472: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6553 + //line php5/php5.y:6563 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -9116,7 +9124,7 @@ yydefault: } case 473: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6565 + //line php5/php5.y:6575 { yyVAL.node = yyDollar[2].node @@ -9133,7 +9141,7 @@ yydefault: } case 474: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6583 + //line php5/php5.y:6593 { n := expr.NewVariable(nil) yyVAL.simpleIndirectReference = simpleIndirectReference{[]*expr.Variable{n}, n} @@ -9149,7 +9157,7 @@ yydefault: } case 475: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6597 + //line php5/php5.y:6607 { n := expr.NewVariable(nil) @@ -9169,7 +9177,7 @@ yydefault: } case 476: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6618 + //line php5/php5.y:6628 { if len(yyDollar[1].list) == 0 { yyDollar[1].list = []node.Node{expr.NewArrayItem(nil, nil)} @@ -9184,7 +9192,7 @@ yydefault: } case 477: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6631 + //line php5/php5.y:6641 { if yyDollar[1].node.(*expr.ArrayItem).Key == nil && yyDollar[1].node.(*expr.ArrayItem).Val == nil { yyVAL.list = []node.Node{} @@ -9196,7 +9204,7 @@ yydefault: } case 478: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6645 + //line php5/php5.y:6655 { yyVAL.node = expr.NewArrayItem(nil, yyDollar[1].node) @@ -9209,7 +9217,7 @@ yydefault: } case 479: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6656 + //line php5/php5.y:6666 { item := expr.NewList(yyDollar[3].list) yyVAL.node = expr.NewArrayItem(nil, item) @@ -9227,7 +9235,7 @@ yydefault: } case 480: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:6672 + //line php5/php5.y:6682 { yyVAL.node = expr.NewArrayItem(nil, nil) @@ -9235,7 +9243,7 @@ yydefault: } case 481: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:6682 + //line php5/php5.y:6692 { yyVAL.list = []node.Node{} @@ -9243,7 +9251,7 @@ yydefault: } case 482: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6688 + //line php5/php5.y:6698 { yyVAL.list = yyDollar[1].list @@ -9260,7 +9268,7 @@ yydefault: } case 483: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:6706 + //line php5/php5.y:6716 { arrayItem := expr.NewArrayItem(yyDollar[3].node, yyDollar[5].node) yyVAL.list = append(yyDollar[1].list, arrayItem) @@ -9278,7 +9286,7 @@ yydefault: } case 484: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6722 + //line php5/php5.y:6732 { arrayItem := expr.NewArrayItem(nil, yyDollar[3].node) yyVAL.list = append(yyDollar[1].list, arrayItem) @@ -9295,7 +9303,7 @@ yydefault: } case 485: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6737 + //line php5/php5.y:6747 { arrayItem := expr.NewArrayItem(yyDollar[1].node, yyDollar[3].node) yyVAL.list = []node.Node{arrayItem} @@ -9312,7 +9320,7 @@ yydefault: } case 486: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6752 + //line php5/php5.y:6762 { arrayItem := expr.NewArrayItem(nil, yyDollar[1].node) yyVAL.list = []node.Node{arrayItem} @@ -9326,7 +9334,7 @@ yydefault: } case 487: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:6764 + //line php5/php5.y:6774 { reference := expr.NewReference(yyDollar[6].node) arrayItem := expr.NewArrayItem(yyDollar[3].node, reference) @@ -9347,7 +9355,7 @@ yydefault: } case 488: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6783 + //line php5/php5.y:6793 { reference := expr.NewReference(yyDollar[4].node) arrayItem := expr.NewArrayItem(nil, reference) @@ -9365,7 +9373,7 @@ yydefault: } case 489: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6799 + //line php5/php5.y:6809 { reference := expr.NewReference(yyDollar[4].node) arrayItem := expr.NewArrayItem(yyDollar[1].node, reference) @@ -9385,7 +9393,7 @@ yydefault: } case 490: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6817 + //line php5/php5.y:6827 { reference := expr.NewReference(yyDollar[2].node) arrayItem := expr.NewArrayItem(nil, reference) @@ -9402,7 +9410,7 @@ yydefault: } case 491: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6835 + //line php5/php5.y:6845 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -9410,7 +9418,7 @@ yydefault: } case 492: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6841 + //line php5/php5.y:6851 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yyVAL.list = append(yyDollar[1].list, encapsed) @@ -9425,7 +9433,7 @@ yydefault: } case 493: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6854 + //line php5/php5.y:6864 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -9433,7 +9441,7 @@ yydefault: } case 494: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6860 + //line php5/php5.y:6870 { encapsed := scalar.NewEncapsedStringPart(yyDollar[1].token.Value) yyVAL.list = []node.Node{encapsed, yyDollar[2].node} @@ -9448,7 +9456,7 @@ yydefault: } case 495: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6876 + //line php5/php5.y:6886 { name := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(name) @@ -9465,7 +9473,7 @@ yydefault: } case 496: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6891 + //line php5/php5.y:6901 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -9487,7 +9495,7 @@ yydefault: } case 497: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6911 + //line php5/php5.y:6921 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -9509,7 +9517,7 @@ yydefault: } case 498: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6931 + //line php5/php5.y:6941 { variable := expr.NewVariable(yyDollar[2].node) @@ -9527,7 +9535,7 @@ yydefault: } case 499: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6947 + //line php5/php5.y:6957 { name := node.NewIdentifier(yyDollar[2].token.Value) variable := expr.NewVariable(name) @@ -9548,7 +9556,7 @@ yydefault: } case 500: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:6966 + //line php5/php5.y:6976 { identifier := node.NewIdentifier(yyDollar[2].token.Value) variable := expr.NewVariable(identifier) @@ -9572,7 +9580,7 @@ yydefault: } case 501: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6988 + //line php5/php5.y:6998 { yyVAL.node = yyDollar[2].node @@ -9585,7 +9593,7 @@ yydefault: } case 502: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:7002 + //line php5/php5.y:7012 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) @@ -9599,7 +9607,7 @@ yydefault: } case 503: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:7014 + //line php5/php5.y:7024 { // TODO: add option to handle 64 bit integer if _, err := strconv.Atoi(yyDollar[1].token.Value); err == nil { @@ -9615,7 +9623,7 @@ yydefault: } case 504: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:7028 + //line php5/php5.y:7038 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(identifier) @@ -9632,7 +9640,7 @@ yydefault: } case 505: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:7046 + //line php5/php5.y:7056 { yyVAL.node = expr.NewIsset(yyDollar[3].list) @@ -9648,7 +9656,7 @@ yydefault: } case 506: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:7060 + //line php5/php5.y:7070 { yyVAL.node = expr.NewEmpty(yyDollar[3].node) @@ -9664,7 +9672,7 @@ yydefault: } case 507: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:7074 + //line php5/php5.y:7084 { yyVAL.node = expr.NewEmpty(yyDollar[3].node) @@ -9680,7 +9688,7 @@ yydefault: } case 508: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:7088 + //line php5/php5.y:7098 { yyVAL.node = expr.NewInclude(yyDollar[2].node) @@ -9694,7 +9702,7 @@ yydefault: } case 509: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:7100 + //line php5/php5.y:7110 { yyVAL.node = expr.NewIncludeOnce(yyDollar[2].node) @@ -9708,7 +9716,7 @@ yydefault: } case 510: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:7112 + //line php5/php5.y:7122 { yyVAL.node = expr.NewEval(yyDollar[3].node) @@ -9724,7 +9732,7 @@ yydefault: } case 511: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:7126 + //line php5/php5.y:7136 { yyVAL.node = expr.NewRequire(yyDollar[2].node) @@ -9738,7 +9746,7 @@ yydefault: } case 512: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:7138 + //line php5/php5.y:7148 { yyVAL.node = expr.NewRequireOnce(yyDollar[2].node) @@ -9752,7 +9760,7 @@ yydefault: } case 513: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:7153 + //line php5/php5.y:7163 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -9760,7 +9768,7 @@ yydefault: } case 514: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:7159 + //line php5/php5.y:7169 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -9771,7 +9779,7 @@ yydefault: } case 515: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:7171 + //line php5/php5.y:7181 { yyVAL.node = yyDollar[1].node @@ -9779,7 +9787,7 @@ yydefault: } case 516: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:7177 + //line php5/php5.y:7187 { yyVAL.node = yyDollar[1].node @@ -9787,7 +9795,7 @@ yydefault: } case 517: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:7186 + //line php5/php5.y:7196 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -9806,7 +9814,7 @@ yydefault: } case 518: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:7203 + //line php5/php5.y:7213 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -9825,7 +9833,7 @@ yydefault: } case 519: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:7223 + //line php5/php5.y:7233 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -9844,7 +9852,7 @@ yydefault: } case 520: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:7243 + //line php5/php5.y:7253 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) diff --git a/php5/php5.y b/php5/php5.y index 6f2c7d7..80316ec 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -293,6 +293,11 @@ start: top_statement_list: top_statement_list top_statement { + if inlineHtmlNode, ok := $2.(*stmt.InlineHtml); ok && len($1) > 0 { + prevNode := lastNode($1) + yylex.(*Parser).splitSemicolonTokenAndPhpCloseTag(inlineHtmlNode, prevNode) + } + if $2 != nil { $$ = append($1, $2) } @@ -804,6 +809,11 @@ constant_declaration: inner_statement_list: inner_statement_list inner_statement { + if inlineHtmlNode, ok := $2.(*stmt.InlineHtml); ok && len($1) > 0 { + prevNode := lastNode($1) + yylex.(*Parser).splitSemicolonTokenAndPhpCloseTag(inlineHtmlNode, prevNode) + } + if $2 != nil { $$ = append($1, $2) } @@ -3117,7 +3127,7 @@ class_variable_declaration: // save comments $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) - $3.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + $3.Meta.SetTokenName(meta.NodeStart).AppendTo(property.GetMeta()) yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -3136,7 +3146,7 @@ class_variable_declaration: // save comments $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) - $3.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + $3.Meta.SetTokenName(meta.NodeStart).AppendTo(property.GetMeta()) yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) $4.Meta.SetTokenName(meta.EqualToken).AppendTo(property.GetMeta()) @@ -3155,7 +3165,7 @@ class_variable_declaration: property.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo(property.GetMeta()) yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -3173,7 +3183,7 @@ class_variable_declaration: property.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo(property.GetMeta()) yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) $2.Meta.SetTokenName(meta.EqualToken).AppendTo(property.GetMeta()) diff --git a/php7/parser.go b/php7/parser.go index fe46e28..6ffd6b4 100644 --- a/php7/parser.go +++ b/php7/parser.go @@ -2,6 +2,7 @@ package php7 import ( "io" + "strings" "github.com/z7zmey/php-parser/position" @@ -155,6 +156,73 @@ func (l *Parser) prependMetaToken(n node.Node, t *scanner.Token, tn meta.TokenNa n.GetMeta().Unshift(m) } +func (l *Parser) splitSemicolonTokenAndPhpCloseTag(htmlNode node.Node, prevNode node.Node) { + SemiColonTokenMeta := prevNode.GetMeta().Cut(meta.AndFilter( + meta.TokenNameFilter(meta.SemiColonToken), + meta.TypeFilter(meta.TokenType), + )) + + if len(*SemiColonTokenMeta) < 1 { + return + } + + metaTokenValue := (*SemiColonTokenMeta)[0].Value + + i := strings.Index(metaTokenValue, "?>") + + if i < 0 { + SemiColonTokenMeta.AppendTo(prevNode.GetMeta()) + } else { + if metaTokenValue[0] == ';' { + prevNode.GetMeta().Push(&meta.Data{ + Value: metaTokenValue[0:1], + Type: meta.TokenType, + Position: nil, + TokenName: meta.SemiColonToken, + }) + + htmlNode.GetMeta().Push(&meta.Data{ + Value: metaTokenValue[1:i], + Type: meta.WhiteSpaceType, + Position: nil, + TokenName: meta.NodeStart, + }) + + htmlNode.GetMeta().Push(&meta.Data{ + Value: metaTokenValue[i : i+2], + Type: meta.TokenType, + Position: nil, + TokenName: meta.NodeStart, + }) + + if len(metaTokenValue) > i+2 { + htmlNode.GetMeta().Push(&meta.Data{ + Value: metaTokenValue[i+2:], + Type: meta.WhiteSpaceType, + Position: nil, + TokenName: meta.NodeStart, + }) + } + } else { + htmlNode.GetMeta().Push(&meta.Data{ + Value: metaTokenValue[:2], + Type: meta.TokenType, + Position: nil, + TokenName: meta.NodeStart, + }) + + if len(metaTokenValue) > 2 { + htmlNode.GetMeta().Push(&meta.Data{ + Value: metaTokenValue[2:], + Type: meta.WhiteSpaceType, + Position: nil, + TokenName: meta.NodeStart, + }) + } + } + } +} + func (p *Parser) returnTokenToPool(yyDollar []yySymType, yyVAL *yySymType) { for i := 1; i < len(yyDollar); i++ { if yyDollar[i].token != nil { diff --git a/php7/php7.go b/php7/php7.go index 57b32e7..8826f2a 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -1,5 +1,3 @@ -// Code generated by goyacc -o php7/php7.go php7/php7.y. DO NOT EDIT. - //line php7/php7.y:2 package php7 @@ -348,7 +346,7 @@ const yyEofCode = 1 const yyErrCode = 2 const yyInitialStackSize = 16 -//line php7/php7.y:5653 +//line php7/php7.y:5663 //line yacctab:1 var yyExca = [...]int{ @@ -2589,6 +2587,11 @@ yydefault: yyDollar = yyS[yypt-2 : yypt+1] //line php7/php7.y:345 { + if inlineHtmlNode, ok := yyDollar[2].node.(*stmt.InlineHtml); ok && len(yyDollar[1].list) > 0 { + prevNode := lastNode(yyDollar[1].list) + yylex.(*Parser).splitSemicolonTokenAndPhpCloseTag(inlineHtmlNode, prevNode) + } + if yyDollar[2].node != nil { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } @@ -2597,7 +2600,7 @@ yydefault: } case 79: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:353 + //line php7/php7.y:358 { yyVAL.list = []node.Node{} @@ -2605,7 +2608,7 @@ yydefault: } case 80: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:362 + //line php7/php7.y:367 { namePart := name.NewNamePart(yyDollar[1].token.Value) yyVAL.list = []node.Node{namePart} @@ -2620,7 +2623,7 @@ yydefault: } case 81: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:375 + //line php7/php7.y:380 { namePart := name.NewNamePart(yyDollar[3].token.Value) yyVAL.list = append(yyDollar[1].list, namePart) @@ -2636,7 +2639,7 @@ yydefault: } case 82: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:392 + //line php7/php7.y:397 { yyVAL.node = name.NewName(yyDollar[1].list) @@ -2650,7 +2653,7 @@ yydefault: } case 83: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:404 + //line php7/php7.y:409 { yyVAL.node = name.NewRelative(yyDollar[3].list) @@ -2665,7 +2668,7 @@ yydefault: } case 84: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:417 + //line php7/php7.y:422 { yyVAL.node = name.NewFullyQualified(yyDollar[2].list) @@ -2679,7 +2682,7 @@ yydefault: } case 85: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:432 + //line php7/php7.y:437 { // error yyVAL.node = nil @@ -2688,7 +2691,7 @@ yydefault: } case 86: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:439 + //line php7/php7.y:444 { yyVAL.node = yyDollar[1].node @@ -2696,7 +2699,7 @@ yydefault: } case 87: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:445 + //line php7/php7.y:450 { yyVAL.node = yyDollar[1].node @@ -2704,7 +2707,7 @@ yydefault: } case 88: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:451 + //line php7/php7.y:456 { yyVAL.node = yyDollar[1].node @@ -2712,7 +2715,7 @@ yydefault: } case 89: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:457 + //line php7/php7.y:462 { yyVAL.node = yyDollar[1].node @@ -2720,7 +2723,7 @@ yydefault: } case 90: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:463 + //line php7/php7.y:468 { yyVAL.node = yyDollar[1].node @@ -2728,7 +2731,7 @@ yydefault: } case 91: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:469 + //line php7/php7.y:474 { yyVAL.node = stmt.NewHaltCompiler() @@ -2748,7 +2751,7 @@ yydefault: } case 92: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:487 + //line php7/php7.y:492 { name := name.NewName(yyDollar[2].list) yyVAL.node = stmt.NewNamespace(name, nil) @@ -2766,7 +2769,7 @@ yydefault: } case 93: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:503 + //line php7/php7.y:508 { name := name.NewName(yyDollar[2].list) yyVAL.node = stmt.NewNamespace(name, yyDollar[4].list) @@ -2784,7 +2787,7 @@ yydefault: } case 94: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:519 + //line php7/php7.y:524 { yyVAL.node = stmt.NewNamespace(nil, yyDollar[3].list) @@ -2800,7 +2803,7 @@ yydefault: } case 95: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:533 + //line php7/php7.y:538 { yyVAL.node = yyDollar[2].node @@ -2816,7 +2819,7 @@ yydefault: } case 96: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:547 + //line php7/php7.y:552 { yyVAL.node = yyDollar[3].node.(*stmt.GroupUse).SetUseType(yyDollar[2].node) @@ -2832,7 +2835,7 @@ yydefault: } case 97: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:561 + //line php7/php7.y:566 { yyVAL.node = stmt.NewUseList(nil, yyDollar[2].list) @@ -2848,7 +2851,7 @@ yydefault: } case 98: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:575 + //line php7/php7.y:580 { yyVAL.node = stmt.NewUseList(yyDollar[2].node, yyDollar[3].list) @@ -2864,7 +2867,7 @@ yydefault: } case 99: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:589 + //line php7/php7.y:594 { yyVAL.node = stmt.NewConstList(yyDollar[2].list) @@ -2880,7 +2883,7 @@ yydefault: } case 100: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:606 + //line php7/php7.y:611 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -2894,7 +2897,7 @@ yydefault: } case 101: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:618 + //line php7/php7.y:623 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -2908,7 +2911,7 @@ yydefault: } case 102: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:633 + //line php7/php7.y:638 { name := name.NewName(yyDollar[1].list) yyVAL.node = stmt.NewGroupUse(nil, name, yyDollar[4].list) @@ -2932,7 +2935,7 @@ yydefault: } case 103: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:655 + //line php7/php7.y:660 { name := name.NewName(yyDollar[2].list) yyVAL.node = stmt.NewGroupUse(nil, name, yyDollar[5].list) @@ -2957,7 +2960,7 @@ yydefault: } case 104: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:681 + //line php7/php7.y:686 { name := name.NewName(yyDollar[1].list) yyVAL.node = stmt.NewGroupUse(nil, name, yyDollar[4].list) @@ -2981,7 +2984,7 @@ yydefault: } case 105: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:703 + //line php7/php7.y:708 { name := name.NewName(yyDollar[2].list) yyVAL.node = stmt.NewGroupUse(nil, name, yyDollar[5].list) @@ -3008,19 +3011,19 @@ yydefault: } case 106: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:731 + //line php7/php7.y:736 { yyVAL.token = nil } case 107: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:735 + //line php7/php7.y:740 { yyVAL.token = yyDollar[1].token } case 108: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:742 + //line php7/php7.y:747 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -3031,7 +3034,7 @@ yydefault: } case 109: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:751 + //line php7/php7.y:756 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -3039,7 +3042,7 @@ yydefault: } case 110: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:760 + //line php7/php7.y:765 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -3050,7 +3053,7 @@ yydefault: } case 111: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:769 + //line php7/php7.y:774 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -3058,7 +3061,7 @@ yydefault: } case 112: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:778 + //line php7/php7.y:783 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -3069,7 +3072,7 @@ yydefault: } case 113: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:787 + //line php7/php7.y:792 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -3077,7 +3080,7 @@ yydefault: } case 114: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:796 + //line php7/php7.y:801 { yyVAL.node = yyDollar[1].node @@ -3087,7 +3090,7 @@ yydefault: } case 115: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:804 + //line php7/php7.y:809 { yyVAL.node = yyDollar[2].node.(*stmt.Use).SetUseType(yyDollar[1].node) @@ -3097,7 +3100,7 @@ yydefault: } case 116: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:815 + //line php7/php7.y:820 { name := name.NewName(yyDollar[1].list) yyVAL.node = stmt.NewUse(nil, name, nil) @@ -3112,7 +3115,7 @@ yydefault: } case 117: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:828 + //line php7/php7.y:833 { name := name.NewName(yyDollar[1].list) alias := node.NewIdentifier(yyDollar[3].token.Value) @@ -3133,7 +3136,7 @@ yydefault: } case 118: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:850 + //line php7/php7.y:855 { yyVAL.node = yyDollar[1].node @@ -3143,7 +3146,7 @@ yydefault: } case 119: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:858 + //line php7/php7.y:863 { yyVAL.node = yyDollar[2].node @@ -3156,7 +3159,7 @@ yydefault: } case 120: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:872 + //line php7/php7.y:877 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -3167,7 +3170,7 @@ yydefault: } case 121: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:881 + //line php7/php7.y:886 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -3175,8 +3178,13 @@ yydefault: } case 122: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:890 + //line php7/php7.y:895 { + if inlineHtmlNode, ok := yyDollar[2].node.(*stmt.InlineHtml); ok && len(yyDollar[1].list) > 0 { + prevNode := lastNode(yyDollar[1].list) + yylex.(*Parser).splitSemicolonTokenAndPhpCloseTag(inlineHtmlNode, prevNode) + } + if yyDollar[2].node != nil { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } @@ -3185,7 +3193,7 @@ yydefault: } case 123: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:898 + //line php7/php7.y:908 { yyVAL.list = []node.Node{} @@ -3193,7 +3201,7 @@ yydefault: } case 124: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:907 + //line php7/php7.y:917 { // error yyVAL.node = nil @@ -3202,7 +3210,7 @@ yydefault: } case 125: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:914 + //line php7/php7.y:924 { yyVAL.node = yyDollar[1].node @@ -3210,7 +3218,7 @@ yydefault: } case 126: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:920 + //line php7/php7.y:930 { yyVAL.node = yyDollar[1].node @@ -3218,7 +3226,7 @@ yydefault: } case 127: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:926 + //line php7/php7.y:936 { yyVAL.node = yyDollar[1].node @@ -3226,7 +3234,7 @@ yydefault: } case 128: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:932 + //line php7/php7.y:942 { yyVAL.node = yyDollar[1].node @@ -3234,7 +3242,7 @@ yydefault: } case 129: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:938 + //line php7/php7.y:948 { yyVAL.node = yyDollar[1].node @@ -3242,7 +3250,7 @@ yydefault: } case 130: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:944 + //line php7/php7.y:954 { yyVAL.node = stmt.NewHaltCompiler() @@ -3260,7 +3268,7 @@ yydefault: } case 131: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:962 + //line php7/php7.y:972 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) @@ -3275,7 +3283,7 @@ yydefault: } case 132: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:975 + //line php7/php7.y:985 { yyVAL.node = yyDollar[1].node @@ -3283,7 +3291,7 @@ yydefault: } case 133: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:981 + //line php7/php7.y:991 { yyVAL.node = yyDollar[1].node @@ -3291,7 +3299,7 @@ yydefault: } case 134: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:987 + //line php7/php7.y:997 { switch n := yyDollar[5].node.(type) { case *stmt.While: @@ -3314,7 +3322,7 @@ yydefault: } case 135: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:1008 + //line php7/php7.y:1018 { yyVAL.node = stmt.NewDo(yyDollar[2].node, yyDollar[5].node) @@ -3333,7 +3341,7 @@ yydefault: } case 136: yyDollar = yyS[yypt-9 : yypt+1] - //line php7/php7.y:1025 + //line php7/php7.y:1035 { switch n := yyDollar[9].node.(type) { case *stmt.For: @@ -3362,7 +3370,7 @@ yydefault: } case 137: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:1052 + //line php7/php7.y:1062 { switch n := yyDollar[5].node.(type) { case *stmt.Switch: @@ -3387,7 +3395,7 @@ yydefault: } case 138: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1075 + //line php7/php7.y:1085 { yyVAL.node = stmt.NewBreak(yyDollar[2].node) @@ -3403,7 +3411,7 @@ yydefault: } case 139: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1089 + //line php7/php7.y:1099 { yyVAL.node = stmt.NewContinue(yyDollar[2].node) @@ -3419,7 +3427,7 @@ yydefault: } case 140: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1103 + //line php7/php7.y:1113 { yyVAL.node = stmt.NewReturn(yyDollar[2].node) @@ -3435,7 +3443,7 @@ yydefault: } case 141: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1117 + //line php7/php7.y:1127 { yyVAL.node = stmt.NewGlobal(yyDollar[2].list) @@ -3451,7 +3459,7 @@ yydefault: } case 142: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1131 + //line php7/php7.y:1141 { yyVAL.node = stmt.NewStatic(yyDollar[2].list) @@ -3467,7 +3475,7 @@ yydefault: } case 143: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1145 + //line php7/php7.y:1155 { yyVAL.node = stmt.NewEcho(yyDollar[2].list) @@ -3484,7 +3492,7 @@ yydefault: } case 144: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1160 + //line php7/php7.y:1170 { yyVAL.node = stmt.NewInlineHtml(yyDollar[1].token.Value) @@ -3498,7 +3506,7 @@ yydefault: } case 145: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1172 + //line php7/php7.y:1182 { yyVAL.node = stmt.NewExpression(yyDollar[1].node) @@ -3515,7 +3523,7 @@ yydefault: } case 146: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1187 + //line php7/php7.y:1197 { yyVAL.node = stmt.NewUnset(yyDollar[3].list) @@ -3537,7 +3545,7 @@ yydefault: } case 147: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:1207 + //line php7/php7.y:1217 { switch n := yyDollar[7].node.(type) { case *stmt.Foreach: @@ -3563,7 +3571,7 @@ yydefault: } case 148: yyDollar = yyS[yypt-9 : yypt+1] - //line php7/php7.y:1231 + //line php7/php7.y:1241 { switch n := yyDollar[9].node.(type) { case *stmt.Foreach: @@ -3592,7 +3600,7 @@ yydefault: } case 149: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:1258 + //line php7/php7.y:1268 { yyVAL.node = yyDollar[5].node yyVAL.node.(*stmt.Declare).Consts = yyDollar[3].list @@ -3609,7 +3617,7 @@ yydefault: } case 150: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1273 + //line php7/php7.y:1283 { yyVAL.node = stmt.NewNop() @@ -3624,7 +3632,7 @@ yydefault: } case 151: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1286 + //line php7/php7.y:1296 { if yyDollar[6].node == nil { yyVAL.node = stmt.NewTry(yyDollar[3].list, yyDollar[5].list, yyDollar[6].node) @@ -3643,7 +3651,7 @@ yydefault: } case 152: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1303 + //line php7/php7.y:1313 { yyVAL.node = stmt.NewThrow(yyDollar[2].node) @@ -3659,7 +3667,7 @@ yydefault: } case 153: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1317 + //line php7/php7.y:1327 { label := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewGoto(label) @@ -3678,7 +3686,7 @@ yydefault: } case 154: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1334 + //line php7/php7.y:1344 { label := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewLabel(label) @@ -3695,7 +3703,7 @@ yydefault: } case 155: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1351 + //line php7/php7.y:1361 { yyVAL.list = []node.Node{} @@ -3703,7 +3711,7 @@ yydefault: } case 156: yyDollar = yyS[yypt-9 : yypt+1] - //line php7/php7.y:1357 + //line php7/php7.y:1367 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[5].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -3728,7 +3736,7 @@ yydefault: } case 157: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1382 + //line php7/php7.y:1392 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -3736,7 +3744,7 @@ yydefault: } case 158: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1388 + //line php7/php7.y:1398 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -3747,7 +3755,7 @@ yydefault: } case 159: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1400 + //line php7/php7.y:1410 { yyVAL.node = nil @@ -3755,7 +3763,7 @@ yydefault: } case 160: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1406 + //line php7/php7.y:1416 { yyVAL.node = stmt.NewFinally(yyDollar[3].list) @@ -3771,7 +3779,7 @@ yydefault: } case 161: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1423 + //line php7/php7.y:1433 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -3779,7 +3787,7 @@ yydefault: } case 162: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1429 + //line php7/php7.y:1439 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -3790,7 +3798,7 @@ yydefault: } case 163: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1441 + //line php7/php7.y:1451 { yyVAL.node = yyDollar[1].node @@ -3798,7 +3806,7 @@ yydefault: } case 164: yyDollar = yyS[yypt-11 : yypt+1] - //line php7/php7.y:1450 + //line php7/php7.y:1460 { name := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewFunction(name, yyDollar[2].token != nil, yyDollar[6].list, yyDollar[8].node, yyDollar[10].list, yyDollar[4].str) @@ -3822,31 +3830,31 @@ yydefault: } case 165: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1476 + //line php7/php7.y:1486 { yyVAL.token = nil } case 166: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1480 + //line php7/php7.y:1490 { yyVAL.token = yyDollar[1].token } case 167: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1487 + //line php7/php7.y:1497 { yyVAL.token = nil } case 168: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1491 + //line php7/php7.y:1501 { yyVAL.token = yyDollar[1].token } case 169: yyDollar = yyS[yypt-9 : yypt+1] - //line php7/php7.y:1498 + //line php7/php7.y:1508 { name := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewClass(name, yyDollar[1].list, nil, yyDollar[4].ClassExtends, yyDollar[5].ClassImplements, yyDollar[8].list, yyDollar[6].str) @@ -3867,7 +3875,7 @@ yydefault: } case 170: yyDollar = yyS[yypt-8 : yypt+1] - //line php7/php7.y:1517 + //line php7/php7.y:1527 { name := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewClass(name, nil, nil, yyDollar[3].ClassExtends, yyDollar[4].ClassImplements, yyDollar[7].list, yyDollar[5].str) @@ -3886,7 +3894,7 @@ yydefault: } case 171: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1537 + //line php7/php7.y:1547 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -3894,7 +3902,7 @@ yydefault: } case 172: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1543 + //line php7/php7.y:1553 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -3902,7 +3910,7 @@ yydefault: } case 173: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1552 + //line php7/php7.y:1562 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -3916,7 +3924,7 @@ yydefault: } case 174: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1564 + //line php7/php7.y:1574 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -3930,7 +3938,7 @@ yydefault: } case 175: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1579 + //line php7/php7.y:1589 { name := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewTrait(name, yyDollar[5].list, yyDollar[3].str) @@ -3949,7 +3957,7 @@ yydefault: } case 176: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:1599 + //line php7/php7.y:1609 { name := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewInterface(name, yyDollar[3].InterfaceExtends, yyDollar[6].list, yyDollar[4].str) @@ -3968,7 +3976,7 @@ yydefault: } case 177: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1619 + //line php7/php7.y:1629 { yyVAL.ClassExtends = nil @@ -3976,7 +3984,7 @@ yydefault: } case 178: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1625 + //line php7/php7.y:1635 { yyVAL.ClassExtends = stmt.NewClassExtends(yyDollar[2].node) @@ -3990,7 +3998,7 @@ yydefault: } case 179: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1640 + //line php7/php7.y:1650 { yyVAL.InterfaceExtends = nil @@ -3998,7 +4006,7 @@ yydefault: } case 180: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1646 + //line php7/php7.y:1656 { yyVAL.InterfaceExtends = stmt.NewInterfaceExtends(yyDollar[2].list) @@ -4012,7 +4020,7 @@ yydefault: } case 181: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1661 + //line php7/php7.y:1671 { yyVAL.ClassImplements = nil @@ -4020,7 +4028,7 @@ yydefault: } case 182: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1667 + //line php7/php7.y:1677 { yyVAL.ClassImplements = stmt.NewClassImplements(yyDollar[2].list) @@ -4034,7 +4042,7 @@ yydefault: } case 183: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1682 + //line php7/php7.y:1692 { yyVAL.node = yyDollar[1].node @@ -4042,7 +4050,7 @@ yydefault: } case 184: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1688 + //line php7/php7.y:1698 { yyVAL.node = expr.NewReference(yyDollar[2].node) @@ -4056,7 +4064,7 @@ yydefault: } case 185: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1700 + //line php7/php7.y:1710 { yyVAL.node = expr.NewList(yyDollar[3].list) @@ -4072,7 +4080,7 @@ yydefault: } case 186: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1714 + //line php7/php7.y:1724 { yyVAL.node = expr.NewShortList(yyDollar[2].list) @@ -4087,7 +4095,7 @@ yydefault: } case 187: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1730 + //line php7/php7.y:1740 { yyVAL.node = stmt.NewFor(nil, nil, nil, yyDollar[1].node) @@ -4098,7 +4106,7 @@ yydefault: } case 188: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1739 + //line php7/php7.y:1749 { stmtList := stmt.NewStmtList(yyDollar[2].list) yyVAL.node = stmt.NewAltFor(nil, nil, nil, stmtList) @@ -4117,7 +4125,7 @@ yydefault: } case 189: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1759 + //line php7/php7.y:1769 { yyVAL.node = stmt.NewForeach(nil, nil, nil, yyDollar[1].node) @@ -4128,7 +4136,7 @@ yydefault: } case 190: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1768 + //line php7/php7.y:1778 { stmtList := stmt.NewStmtList(yyDollar[2].list) yyVAL.node = stmt.NewAltForeach(nil, nil, nil, stmtList) @@ -4147,7 +4155,7 @@ yydefault: } case 191: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1788 + //line php7/php7.y:1798 { yyVAL.node = stmt.NewDeclare(nil, yyDollar[1].node, false) @@ -4158,7 +4166,7 @@ yydefault: } case 192: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1797 + //line php7/php7.y:1807 { stmtList := stmt.NewStmtList(yyDollar[2].list) yyVAL.node = stmt.NewDeclare(nil, stmtList, true) @@ -4177,7 +4185,7 @@ yydefault: } case 193: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1817 + //line php7/php7.y:1827 { caseList := stmt.NewCaseList(yyDollar[2].list) yyVAL.node = stmt.NewSwitch(nil, caseList) @@ -4194,7 +4202,7 @@ yydefault: } case 194: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1832 + //line php7/php7.y:1842 { caseList := stmt.NewCaseList(yyDollar[3].list) yyVAL.node = stmt.NewSwitch(nil, caseList) @@ -4213,7 +4221,7 @@ yydefault: } case 195: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1849 + //line php7/php7.y:1859 { caseList := stmt.NewCaseList(yyDollar[2].list) yyVAL.node = stmt.NewAltSwitch(nil, caseList) @@ -4232,7 +4240,7 @@ yydefault: } case 196: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:1866 + //line php7/php7.y:1876 { caseList := stmt.NewCaseList(yyDollar[3].list) @@ -4254,7 +4262,7 @@ yydefault: } case 197: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1889 + //line php7/php7.y:1899 { yyVAL.list = []node.Node{} @@ -4262,7 +4270,7 @@ yydefault: } case 198: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:1895 + //line php7/php7.y:1905 { _case := stmt.NewCase(yyDollar[3].node, yyDollar[5].list) yyVAL.list = append(yyDollar[1].list, _case) @@ -4279,7 +4287,7 @@ yydefault: } case 199: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1910 + //line php7/php7.y:1920 { _default := stmt.NewDefault(yyDollar[4].list) yyVAL.list = append(yyDollar[1].list, _default) @@ -4296,19 +4304,19 @@ yydefault: } case 200: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1928 + //line php7/php7.y:1938 { yyVAL.token = yyDollar[1].token } case 201: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1932 + //line php7/php7.y:1942 { yyVAL.token = yyDollar[1].token } case 202: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1939 + //line php7/php7.y:1949 { yyVAL.node = stmt.NewWhile(nil, yyDollar[1].node) @@ -4319,7 +4327,7 @@ yydefault: } case 203: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1948 + //line php7/php7.y:1958 { stmtList := stmt.NewStmtList(yyDollar[2].list) yyVAL.node = stmt.NewAltWhile(nil, stmtList) @@ -4338,7 +4346,7 @@ yydefault: } case 204: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:1968 + //line php7/php7.y:1978 { yyVAL.node = stmt.NewIf(yyDollar[3].node, yyDollar[5].node, nil, nil) @@ -4354,7 +4362,7 @@ yydefault: } case 205: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1982 + //line php7/php7.y:1992 { _elseIf := stmt.NewElseIf(yyDollar[4].node, yyDollar[6].node) yyVAL.node = yyDollar[1].node.(*stmt.If).AddElseIf(_elseIf) @@ -4372,7 +4380,7 @@ yydefault: } case 206: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2001 + //line php7/php7.y:2011 { yyVAL.node = yyDollar[1].node @@ -4380,7 +4388,7 @@ yydefault: } case 207: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2007 + //line php7/php7.y:2017 { _else := stmt.NewElse(yyDollar[3].node) yyVAL.node = yyDollar[1].node.(*stmt.If).SetElse(_else) @@ -4396,7 +4404,7 @@ yydefault: } case 208: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:2024 + //line php7/php7.y:2034 { stmts := stmt.NewStmtList(yyDollar[6].list) yyVAL.node = stmt.NewAltIf(yyDollar[3].node, stmts, nil, nil) @@ -4415,7 +4423,7 @@ yydefault: } case 209: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:2041 + //line php7/php7.y:2051 { stmts := stmt.NewStmtList(yyDollar[7].list) _elseIf := stmt.NewAltElseIf(yyDollar[4].node, stmts) @@ -4435,7 +4443,7 @@ yydefault: } case 210: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2062 + //line php7/php7.y:2072 { yyVAL.node = yyDollar[1].node @@ -4451,7 +4459,7 @@ yydefault: } case 211: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:2076 + //line php7/php7.y:2086 { stmts := stmt.NewStmtList(yyDollar[4].list) _else := stmt.NewAltElse(stmts) @@ -4473,7 +4481,7 @@ yydefault: } case 212: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2099 + //line php7/php7.y:2109 { yyVAL.list = yyDollar[1].list @@ -4481,7 +4489,7 @@ yydefault: } case 213: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:2105 + //line php7/php7.y:2115 { yyVAL.list = nil @@ -4489,7 +4497,7 @@ yydefault: } case 214: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2114 + //line php7/php7.y:2124 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4497,7 +4505,7 @@ yydefault: } case 215: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2120 + //line php7/php7.y:2130 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4508,7 +4516,7 @@ yydefault: } case 216: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2132 + //line php7/php7.y:2142 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[4].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -4548,7 +4556,7 @@ yydefault: } case 217: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:2170 + //line php7/php7.y:2180 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[4].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -4589,7 +4597,7 @@ yydefault: } case 218: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:2212 + //line php7/php7.y:2222 { yyVAL.node = nil @@ -4597,7 +4605,7 @@ yydefault: } case 219: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2218 + //line php7/php7.y:2228 { yyVAL.node = yyDollar[1].node @@ -4605,7 +4613,7 @@ yydefault: } case 220: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2227 + //line php7/php7.y:2237 { yyVAL.node = yyDollar[1].node @@ -4613,7 +4621,7 @@ yydefault: } case 221: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2233 + //line php7/php7.y:2243 { yyVAL.node = node.NewNullable(yyDollar[2].node) @@ -4627,7 +4635,7 @@ yydefault: } case 222: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2248 + //line php7/php7.y:2258 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4641,7 +4649,7 @@ yydefault: } case 223: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2260 + //line php7/php7.y:2270 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4655,7 +4663,7 @@ yydefault: } case 224: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2272 + //line php7/php7.y:2282 { yyVAL.node = yyDollar[1].node @@ -4663,7 +4671,7 @@ yydefault: } case 225: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:2281 + //line php7/php7.y:2291 { yyVAL.node = nil @@ -4671,7 +4679,7 @@ yydefault: } case 226: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2287 + //line php7/php7.y:2297 { yyVAL.node = yyDollar[2].node @@ -4682,7 +4690,7 @@ yydefault: } case 227: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2299 + //line php7/php7.y:2309 { yyVAL.node = node.NewArgumentList(nil) @@ -4697,7 +4705,7 @@ yydefault: } case 228: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2312 + //line php7/php7.y:2322 { yyVAL.node = node.NewArgumentList(yyDollar[2].list) @@ -4716,7 +4724,7 @@ yydefault: } case 229: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2332 + //line php7/php7.y:2342 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4724,7 +4732,7 @@ yydefault: } case 230: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2338 + //line php7/php7.y:2348 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4735,7 +4743,7 @@ yydefault: } case 231: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2350 + //line php7/php7.y:2360 { yyVAL.node = node.NewArgument(yyDollar[1].node, false, false) @@ -4749,7 +4757,7 @@ yydefault: } case 232: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2362 + //line php7/php7.y:2372 { yyVAL.node = node.NewArgument(yyDollar[2].node, true, false) @@ -4763,7 +4771,7 @@ yydefault: } case 233: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2377 + //line php7/php7.y:2387 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4774,7 +4782,7 @@ yydefault: } case 234: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2386 + //line php7/php7.y:2396 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4782,7 +4790,7 @@ yydefault: } case 235: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2395 + //line php7/php7.y:2405 { yyVAL.node = yyDollar[1].node @@ -4790,7 +4798,7 @@ yydefault: } case 236: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2404 + //line php7/php7.y:2414 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4801,7 +4809,7 @@ yydefault: } case 237: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2413 + //line php7/php7.y:2423 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4809,7 +4817,7 @@ yydefault: } case 238: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2422 + //line php7/php7.y:2432 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -4828,7 +4836,7 @@ yydefault: } case 239: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2439 + //line php7/php7.y:2449 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -4848,7 +4856,7 @@ yydefault: } case 240: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2460 + //line php7/php7.y:2470 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -4856,7 +4864,7 @@ yydefault: } case 241: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:2466 + //line php7/php7.y:2476 { yyVAL.list = []node.Node{} @@ -4864,7 +4872,7 @@ yydefault: } case 242: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2475 + //line php7/php7.y:2485 { yyVAL.node = stmt.NewPropertyList(yyDollar[1].list, yyDollar[2].list) @@ -4881,7 +4889,7 @@ yydefault: } case 243: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2490 + //line php7/php7.y:2500 { yyVAL.node = stmt.NewClassConstList(yyDollar[1].list, yyDollar[3].list) @@ -4897,7 +4905,7 @@ yydefault: } case 244: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2506 + //line php7/php7.y:2516 { yyVAL.node = stmt.NewTraitUse(yyDollar[2].list, yyDollar[3].node) @@ -4911,7 +4919,7 @@ yydefault: } case 245: yyDollar = yyS[yypt-10 : yypt+1] - //line php7/php7.y:2518 + //line php7/php7.y:2528 { name := node.NewIdentifier(yyDollar[4].token.Value) yyVAL.node = stmt.NewClassMethod(name, yyDollar[1].list, yyDollar[3].token != nil, yyDollar[7].list, yyDollar[9].node, yyDollar[10].node, yyDollar[5].str) @@ -4941,7 +4949,7 @@ yydefault: } case 246: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2549 + //line php7/php7.y:2559 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4949,7 +4957,7 @@ yydefault: } case 247: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2555 + //line php7/php7.y:2565 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4960,7 +4968,7 @@ yydefault: } case 248: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2567 + //line php7/php7.y:2577 { yyVAL.node = stmt.NewNop() @@ -4974,7 +4982,7 @@ yydefault: } case 249: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2580 + //line php7/php7.y:2590 { yyVAL.node = stmt.NewTraitAdaptationList(nil) @@ -4988,7 +4996,7 @@ yydefault: } case 250: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2592 + //line php7/php7.y:2602 { yyVAL.node = stmt.NewTraitAdaptationList(yyDollar[2].list) @@ -5002,7 +5010,7 @@ yydefault: } case 251: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2607 + //line php7/php7.y:2617 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -5010,25 +5018,13 @@ yydefault: } case 252: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2613 + //line php7/php7.y:2623 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 253: - yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2622 - { - yyVAL.node = yyDollar[1].node - - // save comments - yyDollar[2].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.SemiColonToken) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - case 254: yyDollar = yyS[yypt-2 : yypt+1] //line php7/php7.y:2632 { @@ -5038,11 +5034,23 @@ yydefault: yyDollar[2].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.SemiColonToken) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + case 254: + yyDollar = yyS[yypt-2 : yypt+1] + //line php7/php7.y:2642 + { + yyVAL.node = yyDollar[1].node + + // save comments + yyDollar[2].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.SemiColonToken) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 255: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2645 + //line php7/php7.y:2655 { yyVAL.node = stmt.NewTraitUsePrecedence(yyDollar[1].node, yyDollar[3].list) @@ -5058,7 +5066,7 @@ yydefault: } case 256: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2662 + //line php7/php7.y:2672 { alias := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, nil, alias) @@ -5077,7 +5085,7 @@ yydefault: } case 257: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2679 + //line php7/php7.y:2689 { alias := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, nil, alias) @@ -5096,7 +5104,7 @@ yydefault: } case 258: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2696 + //line php7/php7.y:2706 { alias := node.NewIdentifier(yyDollar[4].token.Value) yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, yyDollar[3].node, alias) @@ -5115,7 +5123,7 @@ yydefault: } case 259: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2713 + //line php7/php7.y:2723 { yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, yyDollar[3].node, nil) @@ -5131,7 +5139,7 @@ yydefault: } case 260: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2730 + //line php7/php7.y:2740 { name := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewTraitMethodRef(nil, name) @@ -5147,7 +5155,7 @@ yydefault: } case 261: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2744 + //line php7/php7.y:2754 { yyVAL.node = yyDollar[1].node @@ -5155,7 +5163,7 @@ yydefault: } case 262: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2753 + //line php7/php7.y:2763 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewTraitMethodRef(yyDollar[1].node, target) @@ -5174,7 +5182,7 @@ yydefault: } case 263: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2773 + //line php7/php7.y:2783 { yyVAL.node = stmt.NewNop() @@ -5189,7 +5197,7 @@ yydefault: } case 264: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2786 + //line php7/php7.y:2796 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) @@ -5204,7 +5212,7 @@ yydefault: } case 265: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2802 + //line php7/php7.y:2812 { yyVAL.list = yyDollar[1].list @@ -5212,7 +5220,7 @@ yydefault: } case 266: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2808 + //line php7/php7.y:2818 { modifier := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.list = []node.Node{modifier} @@ -5227,7 +5235,7 @@ yydefault: } case 267: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:2824 + //line php7/php7.y:2834 { yyVAL.list = nil @@ -5235,7 +5243,7 @@ yydefault: } case 268: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2830 + //line php7/php7.y:2840 { yyVAL.list = yyDollar[1].list @@ -5243,7 +5251,7 @@ yydefault: } case 269: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2839 + //line php7/php7.y:2849 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -5251,7 +5259,7 @@ yydefault: } case 270: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2845 + //line php7/php7.y:2855 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -5259,7 +5267,7 @@ yydefault: } case 271: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2854 + //line php7/php7.y:2864 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5273,7 +5281,7 @@ yydefault: } case 272: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2866 + //line php7/php7.y:2876 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5287,7 +5295,7 @@ yydefault: } case 273: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2878 + //line php7/php7.y:2888 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5301,7 +5309,7 @@ yydefault: } case 274: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2890 + //line php7/php7.y:2900 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5315,7 +5323,7 @@ yydefault: } case 275: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2902 + //line php7/php7.y:2912 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5329,7 +5337,7 @@ yydefault: } case 276: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2914 + //line php7/php7.y:2924 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5343,7 +5351,7 @@ yydefault: } case 277: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2929 + //line php7/php7.y:2939 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -5354,7 +5362,7 @@ yydefault: } case 278: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2938 + //line php7/php7.y:2948 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -5362,7 +5370,7 @@ yydefault: } case 279: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2947 + //line php7/php7.y:2957 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -5381,7 +5389,7 @@ yydefault: } case 280: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2964 + //line php7/php7.y:2974 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -5401,7 +5409,7 @@ yydefault: } case 281: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2985 + //line php7/php7.y:2995 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -5412,7 +5420,7 @@ yydefault: } case 282: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2994 + //line php7/php7.y:3004 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -5420,7 +5428,7 @@ yydefault: } case 283: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3003 + //line php7/php7.y:3013 { name := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewConstant(name, yyDollar[3].node, yyDollar[4].str) @@ -5437,7 +5445,7 @@ yydefault: } case 284: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3021 + //line php7/php7.y:3031 { name := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewConstant(name, yyDollar[3].node, yyDollar[4].str) @@ -5454,7 +5462,7 @@ yydefault: } case 285: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3039 + //line php7/php7.y:3049 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -5465,7 +5473,7 @@ yydefault: } case 286: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3048 + //line php7/php7.y:3058 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -5473,7 +5481,7 @@ yydefault: } case 287: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3057 + //line php7/php7.y:3067 { yyVAL.node = yyDollar[1].node @@ -5481,7 +5489,7 @@ yydefault: } case 288: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3066 + //line php7/php7.y:3076 { yyVAL.list = nil @@ -5489,7 +5497,7 @@ yydefault: } case 289: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3072 + //line php7/php7.y:3082 { yyVAL.list = yyDollar[1].list @@ -5497,7 +5505,7 @@ yydefault: } case 290: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3081 + //line php7/php7.y:3091 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -5508,7 +5516,7 @@ yydefault: } case 291: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3090 + //line php7/php7.y:3100 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -5516,7 +5524,7 @@ yydefault: } case 292: yyDollar = yyS[yypt-8 : yypt+1] - //line php7/php7.y:3099 + //line php7/php7.y:3109 { if yyDollar[2].node != nil { yyVAL.node = stmt.NewClass(nil, nil, yyDollar[2].node.(*node.ArgumentList), yyDollar[3].ClassExtends, yyDollar[4].ClassImplements, yyDollar[7].list, yyDollar[5].str) @@ -5536,7 +5544,7 @@ yydefault: } case 293: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3120 + //line php7/php7.y:3130 { if yyDollar[3].node != nil { yyVAL.node = expr.NewNew(yyDollar[2].node, yyDollar[3].node.(*node.ArgumentList)) @@ -5553,7 +5561,7 @@ yydefault: } case 294: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3135 + //line php7/php7.y:3145 { yyVAL.node = expr.NewNew(yyDollar[2].node, nil) @@ -5567,7 +5575,7 @@ yydefault: } case 295: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:3150 + //line php7/php7.y:3160 { list := expr.NewList(yyDollar[3].list) yyVAL.node = assign.NewAssign(list, yyDollar[6].node) @@ -5586,7 +5594,7 @@ yydefault: } case 296: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:3167 + //line php7/php7.y:3177 { shortList := expr.NewShortList(yyDollar[2].list) yyVAL.node = assign.NewAssign(shortList, yyDollar[5].node) @@ -5604,7 +5612,7 @@ yydefault: } case 297: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3183 + //line php7/php7.y:3193 { yyVAL.node = assign.NewAssign(yyDollar[1].node, yyDollar[3].node) @@ -5620,7 +5628,7 @@ yydefault: } case 298: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3197 + //line php7/php7.y:3207 { yyVAL.node = assign.NewReference(yyDollar[1].node, yyDollar[4].node) @@ -5637,7 +5645,7 @@ yydefault: } case 299: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3212 + //line php7/php7.y:3222 { yyVAL.node = expr.NewClone(yyDollar[2].node) @@ -5651,7 +5659,7 @@ yydefault: } case 300: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3224 + //line php7/php7.y:3234 { yyVAL.node = assign.NewPlus(yyDollar[1].node, yyDollar[3].node) @@ -5667,7 +5675,7 @@ yydefault: } case 301: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3238 + //line php7/php7.y:3248 { yyVAL.node = assign.NewMinus(yyDollar[1].node, yyDollar[3].node) @@ -5683,7 +5691,7 @@ yydefault: } case 302: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3252 + //line php7/php7.y:3262 { yyVAL.node = assign.NewMul(yyDollar[1].node, yyDollar[3].node) @@ -5699,7 +5707,7 @@ yydefault: } case 303: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3266 + //line php7/php7.y:3276 { yyVAL.node = assign.NewPow(yyDollar[1].node, yyDollar[3].node) @@ -5715,7 +5723,7 @@ yydefault: } case 304: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3280 + //line php7/php7.y:3290 { yyVAL.node = assign.NewDiv(yyDollar[1].node, yyDollar[3].node) @@ -5731,7 +5739,7 @@ yydefault: } case 305: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3294 + //line php7/php7.y:3304 { yyVAL.node = assign.NewConcat(yyDollar[1].node, yyDollar[3].node) @@ -5747,7 +5755,7 @@ yydefault: } case 306: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3308 + //line php7/php7.y:3318 { yyVAL.node = assign.NewMod(yyDollar[1].node, yyDollar[3].node) @@ -5763,7 +5771,7 @@ yydefault: } case 307: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3322 + //line php7/php7.y:3332 { yyVAL.node = assign.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) @@ -5779,7 +5787,7 @@ yydefault: } case 308: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3336 + //line php7/php7.y:3346 { yyVAL.node = assign.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) @@ -5795,7 +5803,7 @@ yydefault: } case 309: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3350 + //line php7/php7.y:3360 { yyVAL.node = assign.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) @@ -5811,7 +5819,7 @@ yydefault: } case 310: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3364 + //line php7/php7.y:3374 { yyVAL.node = assign.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) @@ -5827,7 +5835,7 @@ yydefault: } case 311: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3378 + //line php7/php7.y:3388 { yyVAL.node = assign.NewShiftRight(yyDollar[1].node, yyDollar[3].node) @@ -5843,7 +5851,7 @@ yydefault: } case 312: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3392 + //line php7/php7.y:3402 { yyVAL.node = expr.NewPostInc(yyDollar[1].node) @@ -5859,7 +5867,7 @@ yydefault: } case 313: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3406 + //line php7/php7.y:3416 { yyVAL.node = expr.NewPreInc(yyDollar[2].node) @@ -5873,7 +5881,7 @@ yydefault: } case 314: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3418 + //line php7/php7.y:3428 { yyVAL.node = expr.NewPostDec(yyDollar[1].node) @@ -5889,7 +5897,7 @@ yydefault: } case 315: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3432 + //line php7/php7.y:3442 { yyVAL.node = expr.NewPreDec(yyDollar[2].node) @@ -5903,7 +5911,7 @@ yydefault: } case 316: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3444 + //line php7/php7.y:3454 { yyVAL.node = binary.NewBooleanOr(yyDollar[1].node, yyDollar[3].node) @@ -5919,7 +5927,7 @@ yydefault: } case 317: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3458 + //line php7/php7.y:3468 { yyVAL.node = binary.NewBooleanAnd(yyDollar[1].node, yyDollar[3].node) @@ -5935,7 +5943,7 @@ yydefault: } case 318: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3472 + //line php7/php7.y:3482 { yyVAL.node = binary.NewLogicalOr(yyDollar[1].node, yyDollar[3].node) @@ -5951,7 +5959,7 @@ yydefault: } case 319: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3486 + //line php7/php7.y:3496 { yyVAL.node = binary.NewLogicalAnd(yyDollar[1].node, yyDollar[3].node) @@ -5967,7 +5975,7 @@ yydefault: } case 320: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3500 + //line php7/php7.y:3510 { yyVAL.node = binary.NewLogicalXor(yyDollar[1].node, yyDollar[3].node) @@ -5983,7 +5991,7 @@ yydefault: } case 321: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3514 + //line php7/php7.y:3524 { yyVAL.node = binary.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) @@ -5999,7 +6007,7 @@ yydefault: } case 322: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3528 + //line php7/php7.y:3538 { yyVAL.node = binary.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) @@ -6015,7 +6023,7 @@ yydefault: } case 323: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3542 + //line php7/php7.y:3552 { yyVAL.node = binary.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) @@ -6031,7 +6039,7 @@ yydefault: } case 324: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3556 + //line php7/php7.y:3566 { yyVAL.node = binary.NewConcat(yyDollar[1].node, yyDollar[3].node) @@ -6047,7 +6055,7 @@ yydefault: } case 325: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3570 + //line php7/php7.y:3580 { yyVAL.node = binary.NewPlus(yyDollar[1].node, yyDollar[3].node) @@ -6063,7 +6071,7 @@ yydefault: } case 326: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3584 + //line php7/php7.y:3594 { yyVAL.node = binary.NewMinus(yyDollar[1].node, yyDollar[3].node) @@ -6079,7 +6087,7 @@ yydefault: } case 327: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3598 + //line php7/php7.y:3608 { yyVAL.node = binary.NewMul(yyDollar[1].node, yyDollar[3].node) @@ -6095,7 +6103,7 @@ yydefault: } case 328: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3612 + //line php7/php7.y:3622 { yyVAL.node = binary.NewPow(yyDollar[1].node, yyDollar[3].node) @@ -6111,7 +6119,7 @@ yydefault: } case 329: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3626 + //line php7/php7.y:3636 { yyVAL.node = binary.NewDiv(yyDollar[1].node, yyDollar[3].node) @@ -6127,7 +6135,7 @@ yydefault: } case 330: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3640 + //line php7/php7.y:3650 { yyVAL.node = binary.NewMod(yyDollar[1].node, yyDollar[3].node) @@ -6143,7 +6151,7 @@ yydefault: } case 331: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3654 + //line php7/php7.y:3664 { yyVAL.node = binary.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) @@ -6159,7 +6167,7 @@ yydefault: } case 332: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3668 + //line php7/php7.y:3678 { yyVAL.node = binary.NewShiftRight(yyDollar[1].node, yyDollar[3].node) @@ -6175,7 +6183,7 @@ yydefault: } case 333: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3682 + //line php7/php7.y:3692 { yyVAL.node = expr.NewUnaryPlus(yyDollar[2].node) @@ -6189,7 +6197,7 @@ yydefault: } case 334: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3694 + //line php7/php7.y:3704 { yyVAL.node = expr.NewUnaryMinus(yyDollar[2].node) @@ -6203,7 +6211,7 @@ yydefault: } case 335: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3706 + //line php7/php7.y:3716 { yyVAL.node = expr.NewBooleanNot(yyDollar[2].node) @@ -6217,7 +6225,7 @@ yydefault: } case 336: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3718 + //line php7/php7.y:3728 { yyVAL.node = expr.NewBitwiseNot(yyDollar[2].node) @@ -6231,7 +6239,7 @@ yydefault: } case 337: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3730 + //line php7/php7.y:3740 { yyVAL.node = binary.NewIdentical(yyDollar[1].node, yyDollar[3].node) @@ -6247,7 +6255,7 @@ yydefault: } case 338: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3744 + //line php7/php7.y:3754 { yyVAL.node = binary.NewNotIdentical(yyDollar[1].node, yyDollar[3].node) @@ -6263,7 +6271,7 @@ yydefault: } case 339: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3758 + //line php7/php7.y:3768 { yyVAL.node = binary.NewEqual(yyDollar[1].node, yyDollar[3].node) @@ -6279,7 +6287,7 @@ yydefault: } case 340: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3772 + //line php7/php7.y:3782 { yyVAL.node = binary.NewNotEqual(yyDollar[1].node, yyDollar[3].node) @@ -6296,7 +6304,7 @@ yydefault: } case 341: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3787 + //line php7/php7.y:3797 { yyVAL.node = binary.NewSmaller(yyDollar[1].node, yyDollar[3].node) @@ -6312,7 +6320,7 @@ yydefault: } case 342: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3801 + //line php7/php7.y:3811 { yyVAL.node = binary.NewSmallerOrEqual(yyDollar[1].node, yyDollar[3].node) @@ -6328,7 +6336,7 @@ yydefault: } case 343: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3815 + //line php7/php7.y:3825 { yyVAL.node = binary.NewGreater(yyDollar[1].node, yyDollar[3].node) @@ -6344,7 +6352,7 @@ yydefault: } case 344: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3829 + //line php7/php7.y:3839 { yyVAL.node = binary.NewGreaterOrEqual(yyDollar[1].node, yyDollar[3].node) @@ -6360,7 +6368,7 @@ yydefault: } case 345: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3843 + //line php7/php7.y:3853 { yyVAL.node = binary.NewSpaceship(yyDollar[1].node, yyDollar[3].node) @@ -6376,7 +6384,7 @@ yydefault: } case 346: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3857 + //line php7/php7.y:3867 { yyVAL.node = expr.NewInstanceOf(yyDollar[1].node, yyDollar[3].node) @@ -6392,7 +6400,7 @@ yydefault: } case 347: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3871 + //line php7/php7.y:3881 { yyVAL.node = yyDollar[2].node @@ -6406,7 +6414,7 @@ yydefault: } case 348: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3883 + //line php7/php7.y:3893 { yyVAL.node = yyDollar[1].node @@ -6414,7 +6422,7 @@ yydefault: } case 349: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:3889 + //line php7/php7.y:3899 { yyVAL.node = expr.NewTernary(yyDollar[1].node, yyDollar[3].node, yyDollar[5].node) @@ -6431,7 +6439,7 @@ yydefault: } case 350: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3904 + //line php7/php7.y:3914 { yyVAL.node = expr.NewTernary(yyDollar[1].node, nil, yyDollar[4].node) @@ -6448,7 +6456,7 @@ yydefault: } case 351: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3919 + //line php7/php7.y:3929 { yyVAL.node = binary.NewCoalesce(yyDollar[1].node, yyDollar[3].node) @@ -6464,7 +6472,7 @@ yydefault: } case 352: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3933 + //line php7/php7.y:3943 { yyVAL.node = yyDollar[1].node @@ -6472,7 +6480,7 @@ yydefault: } case 353: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3939 + //line php7/php7.y:3949 { yyVAL.node = cast.NewInt(yyDollar[2].node) @@ -6487,7 +6495,7 @@ yydefault: } case 354: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3952 + //line php7/php7.y:3962 { yyVAL.node = cast.NewDouble(yyDollar[2].node) @@ -6502,7 +6510,7 @@ yydefault: } case 355: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3965 + //line php7/php7.y:3975 { yyVAL.node = cast.NewString(yyDollar[2].node) @@ -6517,7 +6525,7 @@ yydefault: } case 356: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3978 + //line php7/php7.y:3988 { yyVAL.node = cast.NewArray(yyDollar[2].node) @@ -6532,7 +6540,7 @@ yydefault: } case 357: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3991 + //line php7/php7.y:4001 { yyVAL.node = cast.NewObject(yyDollar[2].node) @@ -6547,7 +6555,7 @@ yydefault: } case 358: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4004 + //line php7/php7.y:4014 { yyVAL.node = cast.NewBool(yyDollar[2].node) @@ -6562,7 +6570,7 @@ yydefault: } case 359: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4017 + //line php7/php7.y:4027 { yyVAL.node = cast.NewUnset(yyDollar[2].node) @@ -6577,7 +6585,7 @@ yydefault: } case 360: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4030 + //line php7/php7.y:4040 { var e *expr.Exit if yyDollar[2].node != nil { @@ -6606,7 +6614,7 @@ yydefault: } case 361: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4057 + //line php7/php7.y:4067 { yyVAL.node = expr.NewErrorSuppress(yyDollar[2].node) @@ -6620,7 +6628,7 @@ yydefault: } case 362: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4069 + //line php7/php7.y:4079 { yyVAL.node = yyDollar[1].node @@ -6628,7 +6636,7 @@ yydefault: } case 363: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4075 + //line php7/php7.y:4085 { yyVAL.node = expr.NewShellExec(yyDollar[2].list) @@ -6642,7 +6650,7 @@ yydefault: } case 364: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4087 + //line php7/php7.y:4097 { yyVAL.node = expr.NewPrint(yyDollar[2].node) @@ -6656,7 +6664,7 @@ yydefault: } case 365: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4099 + //line php7/php7.y:4109 { yyVAL.node = expr.NewYield(nil, nil) @@ -6670,7 +6678,7 @@ yydefault: } case 366: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4111 + //line php7/php7.y:4121 { yyVAL.node = expr.NewYield(nil, yyDollar[2].node) @@ -6684,7 +6692,7 @@ yydefault: } case 367: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4123 + //line php7/php7.y:4133 { yyVAL.node = expr.NewYield(yyDollar[2].node, yyDollar[4].node) @@ -6699,7 +6707,7 @@ yydefault: } case 368: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4136 + //line php7/php7.y:4146 { yyVAL.node = expr.NewYieldFrom(yyDollar[2].node) @@ -6713,7 +6721,7 @@ yydefault: } case 369: yyDollar = yyS[yypt-11 : yypt+1] - //line php7/php7.y:4148 + //line php7/php7.y:4158 { yyVAL.node = expr.NewClosure(yyDollar[5].list, yyDollar[7].ClosureUse, yyDollar[8].node, yyDollar[10].list, false, yyDollar[2].token != nil, yyDollar[3].str) @@ -6734,7 +6742,7 @@ yydefault: } case 370: yyDollar = yyS[yypt-12 : yypt+1] - //line php7/php7.y:4167 + //line php7/php7.y:4177 { yyVAL.node = expr.NewClosure(yyDollar[6].list, yyDollar[8].ClosureUse, yyDollar[9].node, yyDollar[11].list, true, yyDollar[3].token != nil, yyDollar[4].str) @@ -6756,7 +6764,7 @@ yydefault: } case 371: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4190 + //line php7/php7.y:4200 { yyVAL.str = yylex.(*Parser).PhpDocComment yylex.(*Parser).PhpDocComment = "" @@ -6765,19 +6773,19 @@ yydefault: } case 372: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4200 + //line php7/php7.y:4210 { yyVAL.token = nil } case 373: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4204 + //line php7/php7.y:4214 { yyVAL.token = yyDollar[1].token } case 374: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4211 + //line php7/php7.y:4221 { yyVAL.ClosureUse = nil @@ -6785,7 +6793,7 @@ yydefault: } case 375: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4217 + //line php7/php7.y:4227 { yyVAL.ClosureUse = expr.NewClosureUse(yyDollar[3].list) @@ -6801,7 +6809,7 @@ yydefault: } case 376: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4234 + //line php7/php7.y:4244 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -6812,7 +6820,7 @@ yydefault: } case 377: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4243 + //line php7/php7.y:4253 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -6820,7 +6828,7 @@ yydefault: } case 378: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4252 + //line php7/php7.y:4262 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(identifier) @@ -6837,7 +6845,7 @@ yydefault: } case 379: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4267 + //line php7/php7.y:4277 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[2].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -6857,7 +6865,7 @@ yydefault: } case 380: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4288 + //line php7/php7.y:4298 { yyVAL.node = expr.NewFunctionCall(yyDollar[1].node, yyDollar[2].node.(*node.ArgumentList)) @@ -6871,7 +6879,7 @@ yydefault: } case 381: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4300 + //line php7/php7.y:4310 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -6886,7 +6894,7 @@ yydefault: } case 382: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4313 + //line php7/php7.y:4323 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -6901,7 +6909,7 @@ yydefault: } case 383: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4326 + //line php7/php7.y:4336 { yyVAL.node = expr.NewFunctionCall(yyDollar[1].node, yyDollar[2].node.(*node.ArgumentList)) @@ -6913,7 +6921,7 @@ yydefault: } case 384: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4339 + //line php7/php7.y:4349 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -6927,7 +6935,7 @@ yydefault: } case 385: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4351 + //line php7/php7.y:4361 { yyVAL.node = yyDollar[1].node @@ -6935,7 +6943,7 @@ yydefault: } case 386: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4360 + //line php7/php7.y:4370 { yyVAL.node = yyDollar[1].node @@ -6943,7 +6951,7 @@ yydefault: } case 387: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4366 + //line php7/php7.y:4376 { yyVAL.node = yyDollar[1].node @@ -6951,7 +6959,7 @@ yydefault: } case 388: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4375 + //line php7/php7.y:4385 { yyVAL.node = nil @@ -6959,7 +6967,7 @@ yydefault: } case 389: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4381 + //line php7/php7.y:4391 { yyVAL.node = expr.NewExit(yyDollar[2].node) @@ -6976,7 +6984,7 @@ yydefault: } case 390: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4399 + //line php7/php7.y:4409 { yyVAL.list = []node.Node{} @@ -6984,7 +6992,7 @@ yydefault: } case 391: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4405 + //line php7/php7.y:4415 { yyVAL.list = []node.Node{scalar.NewEncapsedStringPart(yyDollar[1].token.Value)} @@ -6992,7 +7000,7 @@ yydefault: } case 392: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4411 + //line php7/php7.y:4421 { yyVAL.list = yyDollar[1].list @@ -7000,7 +7008,7 @@ yydefault: } case 393: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4420 + //line php7/php7.y:4430 { yyVAL.node = nil @@ -7008,7 +7016,7 @@ yydefault: } case 394: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4426 + //line php7/php7.y:4436 { yyVAL.node = yyDollar[1].node @@ -7016,7 +7024,7 @@ yydefault: } case 395: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4435 + //line php7/php7.y:4445 { yyVAL.node = expr.NewArray(yyDollar[3].list) @@ -7032,7 +7040,7 @@ yydefault: } case 396: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4449 + //line php7/php7.y:4459 { yyVAL.node = expr.NewShortArray(yyDollar[2].list) @@ -7047,7 +7055,7 @@ yydefault: } case 397: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4462 + //line php7/php7.y:4472 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) @@ -7061,7 +7069,7 @@ yydefault: } case 398: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4477 + //line php7/php7.y:4487 { yyVAL.node = scalar.NewLnumber(yyDollar[1].token.Value) @@ -7075,7 +7083,7 @@ yydefault: } case 399: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4489 + //line php7/php7.y:4499 { yyVAL.node = scalar.NewDnumber(yyDollar[1].token.Value) @@ -7089,7 +7097,7 @@ yydefault: } case 400: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4501 + //line php7/php7.y:4511 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7103,7 +7111,7 @@ yydefault: } case 401: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4513 + //line php7/php7.y:4523 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7117,7 +7125,7 @@ yydefault: } case 402: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4525 + //line php7/php7.y:4535 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7131,7 +7139,7 @@ yydefault: } case 403: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4537 + //line php7/php7.y:4547 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7145,7 +7153,7 @@ yydefault: } case 404: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4549 + //line php7/php7.y:4559 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7159,7 +7167,7 @@ yydefault: } case 405: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4561 + //line php7/php7.y:4571 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7173,7 +7181,7 @@ yydefault: } case 406: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4573 + //line php7/php7.y:4583 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7187,7 +7195,7 @@ yydefault: } case 407: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4585 + //line php7/php7.y:4595 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7201,7 +7209,7 @@ yydefault: } case 408: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4597 + //line php7/php7.y:4607 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, []node.Node{encapsed}) @@ -7217,7 +7225,7 @@ yydefault: } case 409: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4611 + //line php7/php7.y:4621 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, nil) @@ -7231,7 +7239,7 @@ yydefault: } case 410: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4623 + //line php7/php7.y:4633 { yyVAL.node = scalar.NewEncapsed(yyDollar[2].list) @@ -7245,7 +7253,7 @@ yydefault: } case 411: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4635 + //line php7/php7.y:4645 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, yyDollar[2].list) @@ -7259,7 +7267,7 @@ yydefault: } case 412: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4647 + //line php7/php7.y:4657 { yyVAL.node = yyDollar[1].node @@ -7267,7 +7275,7 @@ yydefault: } case 413: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4653 + //line php7/php7.y:4663 { yyVAL.node = yyDollar[1].node @@ -7275,7 +7283,7 @@ yydefault: } case 414: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4662 + //line php7/php7.y:4672 { yyVAL.node = expr.NewConstFetch(yyDollar[1].node) @@ -7289,7 +7297,7 @@ yydefault: } case 415: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4674 + //line php7/php7.y:4684 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -7308,7 +7316,7 @@ yydefault: } case 416: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4691 + //line php7/php7.y:4701 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -7327,7 +7335,7 @@ yydefault: } case 417: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4711 + //line php7/php7.y:4721 { yyVAL.node = yyDollar[1].node @@ -7335,7 +7343,7 @@ yydefault: } case 418: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4717 + //line php7/php7.y:4727 { yyVAL.node = yyDollar[1].node @@ -7343,7 +7351,7 @@ yydefault: } case 419: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4726 + //line php7/php7.y:4736 { yyVAL.node = nil @@ -7351,7 +7359,7 @@ yydefault: } case 420: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4732 + //line php7/php7.y:4742 { yyVAL.node = yyDollar[1].node @@ -7359,7 +7367,7 @@ yydefault: } case 421: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4741 + //line php7/php7.y:4751 { yyVAL.node = yyDollar[1].node @@ -7367,7 +7375,7 @@ yydefault: } case 422: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4750 + //line php7/php7.y:4760 { yyVAL.node = yyDollar[1].node @@ -7375,7 +7383,7 @@ yydefault: } case 423: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4756 + //line php7/php7.y:4766 { yyVAL.node = yyDollar[2].node @@ -7389,7 +7397,7 @@ yydefault: } case 424: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4768 + //line php7/php7.y:4778 { yyVAL.node = yyDollar[1].node @@ -7397,7 +7405,7 @@ yydefault: } case 425: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4777 + //line php7/php7.y:4787 { yyVAL.node = yyDollar[1].node @@ -7405,7 +7413,7 @@ yydefault: } case 426: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4783 + //line php7/php7.y:4793 { yyVAL.node = yyDollar[2].node @@ -7419,7 +7427,7 @@ yydefault: } case 427: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4795 + //line php7/php7.y:4805 { yyVAL.node = yyDollar[1].node @@ -7427,7 +7435,7 @@ yydefault: } case 428: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4804 + //line php7/php7.y:4814 { yyVAL.node = yyDollar[1].node @@ -7435,7 +7443,7 @@ yydefault: } case 429: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4810 + //line php7/php7.y:4820 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -7454,7 +7462,7 @@ yydefault: } case 430: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4827 + //line php7/php7.y:4837 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -7473,7 +7481,7 @@ yydefault: } case 431: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4844 + //line php7/php7.y:4854 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -7492,7 +7500,7 @@ yydefault: } case 432: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4861 + //line php7/php7.y:4871 { yyVAL.node = expr.NewMethodCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -7508,7 +7516,7 @@ yydefault: } case 433: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4875 + //line php7/php7.y:4885 { yyVAL.node = yyDollar[1].node @@ -7516,7 +7524,7 @@ yydefault: } case 434: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4884 + //line php7/php7.y:4894 { yyVAL.node = yyDollar[1].node @@ -7524,7 +7532,7 @@ yydefault: } case 435: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4890 + //line php7/php7.y:4900 { yyVAL.node = yyDollar[1].node @@ -7532,7 +7540,7 @@ yydefault: } case 436: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4896 + //line php7/php7.y:4906 { yyVAL.node = expr.NewPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -7548,7 +7556,7 @@ yydefault: } case 437: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4913 + //line php7/php7.y:4923 { name := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(name) @@ -7565,7 +7573,7 @@ yydefault: } case 438: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4928 + //line php7/php7.y:4938 { yyVAL.node = expr.NewVariable(yyDollar[3].node) @@ -7584,7 +7592,7 @@ yydefault: } case 439: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4945 + //line php7/php7.y:4955 { yyVAL.node = expr.NewVariable(yyDollar[2].node) @@ -7599,7 +7607,7 @@ yydefault: } case 440: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4961 + //line php7/php7.y:4971 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -7615,7 +7623,7 @@ yydefault: } case 441: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4975 + //line php7/php7.y:4985 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -7631,7 +7639,7 @@ yydefault: } case 442: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4992 + //line php7/php7.y:5002 { yyVAL.node = yyDollar[1].node @@ -7639,7 +7647,7 @@ yydefault: } case 443: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4998 + //line php7/php7.y:5008 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -7658,7 +7666,7 @@ yydefault: } case 444: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:5015 + //line php7/php7.y:5025 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -7677,7 +7685,7 @@ yydefault: } case 445: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5032 + //line php7/php7.y:5042 { yyVAL.node = expr.NewPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -7693,7 +7701,7 @@ yydefault: } case 446: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5046 + //line php7/php7.y:5056 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -7709,7 +7717,7 @@ yydefault: } case 447: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5060 + //line php7/php7.y:5070 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -7725,7 +7733,7 @@ yydefault: } case 448: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5077 + //line php7/php7.y:5087 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -7739,7 +7747,7 @@ yydefault: } case 449: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5089 + //line php7/php7.y:5099 { yyVAL.node = yyDollar[2].node @@ -7753,7 +7761,7 @@ yydefault: } case 450: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5101 + //line php7/php7.y:5111 { yyVAL.node = yyDollar[1].node @@ -7761,7 +7769,7 @@ yydefault: } case 451: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5110 + //line php7/php7.y:5120 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -7775,7 +7783,7 @@ yydefault: } case 452: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5122 + //line php7/php7.y:5132 { yyVAL.node = yyDollar[2].node @@ -7789,7 +7797,7 @@ yydefault: } case 453: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5134 + //line php7/php7.y:5144 { yyVAL.node = yyDollar[1].node @@ -7797,7 +7805,7 @@ yydefault: } case 454: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5143 + //line php7/php7.y:5153 { yyVAL.list = yyDollar[1].list @@ -7805,7 +7813,7 @@ yydefault: } case 455: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:5152 + //line php7/php7.y:5162 { yyVAL.node = expr.NewArrayItem(nil, nil) @@ -7813,7 +7821,7 @@ yydefault: } case 456: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5158 + //line php7/php7.y:5168 { yyVAL.node = yyDollar[1].node @@ -7821,7 +7829,7 @@ yydefault: } case 457: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5167 + //line php7/php7.y:5177 { if len(yyDollar[1].list) == 0 { yyDollar[1].list = []node.Node{expr.NewArrayItem(nil, nil)} @@ -7836,7 +7844,7 @@ yydefault: } case 458: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5180 + //line php7/php7.y:5190 { if yyDollar[1].node.(*expr.ArrayItem).Key == nil && yyDollar[1].node.(*expr.ArrayItem).Val == nil { yyVAL.list = []node.Node{} @@ -7848,7 +7856,7 @@ yydefault: } case 459: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5193 + //line php7/php7.y:5203 { yyVAL.node = expr.NewArrayItem(yyDollar[1].node, yyDollar[3].node) @@ -7864,7 +7872,7 @@ yydefault: } case 460: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5207 + //line php7/php7.y:5217 { yyVAL.node = expr.NewArrayItem(nil, yyDollar[1].node) @@ -7877,7 +7885,7 @@ yydefault: } case 461: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:5218 + //line php7/php7.y:5228 { reference := expr.NewReference(yyDollar[4].node) yyVAL.node = expr.NewArrayItem(yyDollar[1].node, reference) @@ -7896,7 +7904,7 @@ yydefault: } case 462: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5235 + //line php7/php7.y:5245 { reference := expr.NewReference(yyDollar[2].node) yyVAL.node = expr.NewArrayItem(nil, reference) @@ -7912,7 +7920,7 @@ yydefault: } case 463: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:5249 + //line php7/php7.y:5259 { // TODO: Cannot use list() as standalone expression list := expr.NewList(yyDollar[5].list) @@ -7934,7 +7942,7 @@ yydefault: } case 464: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:5269 + //line php7/php7.y:5279 { // TODO: Cannot use list() as standalone expression list := expr.NewList(yyDollar[3].list) @@ -7953,7 +7961,7 @@ yydefault: } case 465: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5289 + //line php7/php7.y:5299 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -7961,7 +7969,7 @@ yydefault: } case 466: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5295 + //line php7/php7.y:5305 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yyVAL.list = append(yyDollar[1].list, encapsed) @@ -7976,7 +7984,7 @@ yydefault: } case 467: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5308 + //line php7/php7.y:5318 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -7984,7 +7992,7 @@ yydefault: } case 468: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5314 + //line php7/php7.y:5324 { encapsed := scalar.NewEncapsedStringPart(yyDollar[1].token.Value) yyVAL.list = []node.Node{encapsed, yyDollar[2].node} @@ -7999,7 +8007,7 @@ yydefault: } case 469: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5330 + //line php7/php7.y:5340 { name := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(name) @@ -8016,7 +8024,7 @@ yydefault: } case 470: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:5345 + //line php7/php7.y:5355 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -8038,7 +8046,7 @@ yydefault: } case 471: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5365 + //line php7/php7.y:5375 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -8060,7 +8068,7 @@ yydefault: } case 472: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5385 + //line php7/php7.y:5395 { variable := expr.NewVariable(yyDollar[2].node) @@ -8078,7 +8086,7 @@ yydefault: } case 473: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5401 + //line php7/php7.y:5411 { name := node.NewIdentifier(yyDollar[2].token.Value) variable := expr.NewVariable(name) @@ -8099,7 +8107,7 @@ yydefault: } case 474: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:5420 + //line php7/php7.y:5430 { identifier := node.NewIdentifier(yyDollar[2].token.Value) variable := expr.NewVariable(identifier) @@ -8123,7 +8131,7 @@ yydefault: } case 475: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5442 + //line php7/php7.y:5452 { yyVAL.node = yyDollar[2].node @@ -8136,7 +8144,7 @@ yydefault: } case 476: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5456 + //line php7/php7.y:5466 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) @@ -8150,7 +8158,7 @@ yydefault: } case 477: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5468 + //line php7/php7.y:5478 { // TODO: add option to handle 64 bit integer if _, err := strconv.Atoi(yyDollar[1].token.Value); err == nil { @@ -8169,7 +8177,7 @@ yydefault: } case 478: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5485 + //line php7/php7.y:5495 { var lnumber *scalar.Lnumber // TODO: add option to handle 64 bit integer @@ -8197,7 +8205,7 @@ yydefault: } case 479: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5511 + //line php7/php7.y:5521 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(identifier) @@ -8214,7 +8222,7 @@ yydefault: } case 480: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:5529 + //line php7/php7.y:5539 { yyVAL.node = expr.NewIsset(yyDollar[3].list) @@ -8234,7 +8242,7 @@ yydefault: } case 481: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:5547 + //line php7/php7.y:5557 { yyVAL.node = expr.NewEmpty(yyDollar[3].node) @@ -8250,7 +8258,7 @@ yydefault: } case 482: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5561 + //line php7/php7.y:5571 { yyVAL.node = expr.NewInclude(yyDollar[2].node) @@ -8264,7 +8272,7 @@ yydefault: } case 483: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5573 + //line php7/php7.y:5583 { yyVAL.node = expr.NewIncludeOnce(yyDollar[2].node) @@ -8278,7 +8286,7 @@ yydefault: } case 484: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:5585 + //line php7/php7.y:5595 { yyVAL.node = expr.NewEval(yyDollar[3].node) @@ -8294,7 +8302,7 @@ yydefault: } case 485: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5599 + //line php7/php7.y:5609 { yyVAL.node = expr.NewRequire(yyDollar[2].node) @@ -8308,7 +8316,7 @@ yydefault: } case 486: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5611 + //line php7/php7.y:5621 { yyVAL.node = expr.NewRequireOnce(yyDollar[2].node) @@ -8322,7 +8330,7 @@ yydefault: } case 487: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5626 + //line php7/php7.y:5636 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -8330,7 +8338,7 @@ yydefault: } case 488: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5632 + //line php7/php7.y:5642 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -8341,7 +8349,7 @@ yydefault: } case 489: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5644 + //line php7/php7.y:5654 { yyVAL.node = yyDollar[1].node diff --git a/php7/php7.y b/php7/php7.y index f1ecbed..a87a408 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -343,6 +343,11 @@ identifier: top_statement_list: top_statement_list top_statement { + if inlineHtmlNode, ok := $2.(*stmt.InlineHtml); ok && len($1) > 0 { + prevNode := lastNode($1) + yylex.(*Parser).splitSemicolonTokenAndPhpCloseTag(inlineHtmlNode, prevNode) + } + if $2 != nil { $$ = append($1, $2) } @@ -888,6 +893,11 @@ const_list: inner_statement_list: inner_statement_list inner_statement { + if inlineHtmlNode, ok := $2.(*stmt.InlineHtml); ok && len($1) > 0 { + prevNode := lastNode($1) + yylex.(*Parser).splitSemicolonTokenAndPhpCloseTag(inlineHtmlNode, prevNode) + } + if $2 != nil { $$ = append($1, $2) } diff --git a/printer/printer.go b/printer/printer.go index e6d701f..e90a3b4 100644 --- a/printer/printer.go +++ b/printer/printer.go @@ -17,8 +17,16 @@ import ( "github.com/z7zmey/php-parser/node/scalar" ) +type printerState int + +const ( + PhpState printerState = iota + HtmlState +) + type Printer struct { w io.Writer + s printerState } // NewPrinter - Constructor for Printer @@ -28,7 +36,25 @@ func NewPrinter(w io.Writer) *Printer { } } +func (p *Printer) SetState(s printerState) { + p.s = s +} + func (p *Printer) Print(n node.Node) { + _, isRoot := n.(*node.Root) + _, isInlineHtml := n.(*stmt.InlineHtml) + _, isEcho := n.(*stmt.Echo) + if p.s == HtmlState && !isInlineHtml && !isRoot && !isEcho { + if len((*n.GetMeta())) == 0 { + io.WriteString(p.w, "") + } else { + if len((*nn.Value.GetMeta())) == 0 { + io.WriteString(p.w, " ") + } } p.Print(nn.Value) @@ -1747,6 +1927,9 @@ func (p *Printer) printStmtAltFor(n node.Node) { p.printMeta(nn, meta.EndforToken) io.WriteString(p.w, "endfor") p.printMeta(nn, meta.SemiColonToken) + if len((*nn.GetMeta())) == 0 { + io.WriteString(p.w, ";") + } p.printMeta(nn, meta.NodeEnd) } @@ -1759,13 +1942,23 @@ func (p *Printer) printStmtAltForeach(n node.Node) { p.printMeta(nn, meta.OpenParenthesisToken) io.WriteString(p.w, "(") p.Print(nn.Expr) + if len((*nn.GetMeta())) == 0 { + io.WriteString(p.w, " ") + } p.printMeta(nn, meta.AsToken) io.WriteString(p.w, "as") if nn.Key != nil { + if len((*nn.Key.GetMeta())) == 0 { + io.WriteString(p.w, " ") + } p.Print(nn.Key) p.printMeta(nn, meta.DoubleArrowToken) io.WriteString(p.w, "=>") + } else { + if len((*nn.Variable.GetMeta())) == 0 { + io.WriteString(p.w, " ") + } } p.Print(nn.Variable) @@ -1781,6 +1974,9 @@ func (p *Printer) printStmtAltForeach(n node.Node) { p.printMeta(nn, meta.EndforeachToken) io.WriteString(p.w, "endforeach") p.printMeta(nn, meta.SemiColonToken) + if len((*nn.GetMeta())) == 0 { + io.WriteString(p.w, ";") + } p.printMeta(nn, meta.NodeEnd) } @@ -1812,6 +2008,9 @@ func (p *Printer) printStmtAltIf(n node.Node) { p.printMeta(nn, meta.EndifToken) io.WriteString(p.w, "endif") p.printMeta(nn, meta.SemiColonToken) + if len((*nn.GetMeta())) == 0 { + io.WriteString(p.w, ";") + } p.printMeta(nn, meta.NodeEnd) } @@ -1836,6 +2035,9 @@ func (p *Printer) printStmtAltSwitch(n node.Node) { p.printMeta(nn, meta.EndswitchToken) io.WriteString(p.w, "endswitch") p.printMeta(nn, meta.SemiColonToken) + if len((*nn.GetMeta())) == 0 { + io.WriteString(p.w, ";") + } p.printMeta(nn, meta.NodeEnd) } @@ -1859,6 +2061,9 @@ func (p *Printer) printStmtAltWhile(n node.Node) { p.printMeta(nn, meta.EndwhileToken) io.WriteString(p.w, "endwhile") p.printMeta(nn, meta.SemiColonToken) + if len((*nn.GetMeta())) == 0 { + io.WriteString(p.w, ";") + } p.printMeta(nn, meta.NodeEnd) } @@ -1869,10 +2074,16 @@ func (p *Printer) printStmtBreak(n node.Node) { io.WriteString(p.w, "break") if nn.Expr != nil { + if len((*nn.Expr.GetMeta())) == 0 { + io.WriteString(p.w, " ") + } p.Print(nn.Expr) } p.printMeta(nn, meta.SemiColonToken) + if len((*nn.GetMeta())) == 0 { + io.WriteString(p.w, ";") + } p.printMeta(nn, meta.NodeEnd) } @@ -1882,6 +2093,9 @@ func (p *Printer) printStmtCase(n node.Node) { p.printMeta(nn, meta.NodeStart) io.WriteString(p.w, "case") + if len((*nn.Cond.GetMeta())) == 0 { + io.WriteString(p.w, " ") + } p.Print(nn.Cond) r := p.printMeta(nn, meta.CaseSeparatorToken) if !r { @@ -1920,14 +2134,30 @@ func (p *Printer) printStmtClassMethod(n node.Node) { p.printMeta(nn, meta.NodeStart) if nn.Modifiers != nil { - p.joinPrint("", nn.Modifiers) + for k, m := range nn.Modifiers { + if k > 0 && len(m.GetMeta().FindBy(meta.AndFilter(meta.TokenNameFilter(meta.NodeStart), meta.TypeFilter(meta.WhiteSpaceType)))) == 0 { + io.WriteString(p.w, " ") + } + p.Print(m) + } + + if len((*nn.GetMeta())) == 0 { + io.WriteString(p.w, " ") + } } p.printMeta(nn, meta.FunctionToken) io.WriteString(p.w, "function") if nn.ReturnsRef { + if len((*nn.GetMeta())) == 0 { + io.WriteString(p.w, " ") + } p.printMeta(nn, meta.AmpersandToken) io.WriteString(p.w, "&") + } else { + if len((*nn.MethodName.GetMeta())) == 0 { + io.WriteString(p.w, " ") + } } p.Print(nn.MethodName) @@ -1953,12 +2183,24 @@ func (p *Printer) printStmtClass(n node.Node) { p.printMeta(nn, meta.NodeStart) if nn.Modifiers != nil { - p.joinPrint("", nn.Modifiers) + for k, m := range nn.Modifiers { + if k > 0 && len(m.GetMeta().FindBy(meta.AndFilter(meta.TokenNameFilter(meta.NodeStart), meta.TypeFilter(meta.WhiteSpaceType)))) == 0 { + io.WriteString(p.w, " ") + } + p.Print(m) + } + + if len((*nn.GetMeta())) == 0 { + io.WriteString(p.w, " ") + } } p.printMeta(nn, meta.ClassToken) io.WriteString(p.w, "class") if nn.ClassName != nil { + if len((*nn.ClassName.GetMeta())) == 0 { + io.WriteString(p.w, " ") + } p.Print(nn.ClassName) } @@ -1973,15 +2215,27 @@ func (p *Printer) printStmtClass(n node.Node) { if nn.Extends != nil { p.printMeta(nn.Extends, meta.NodeStart) + if len((*nn.Extends.GetMeta())) == 0 { + io.WriteString(p.w, " ") + } p.printMeta(nn.Extends, meta.ExtendsToken) io.WriteString(p.w, "extends") + if len((*nn.Extends.ClassName.GetMeta())) == 0 { + io.WriteString(p.w, " ") + } p.Print(nn.Extends.ClassName) } if nn.Implements != nil { p.printMeta(nn.Implements, meta.NodeStart) + if len((*nn.Implements.GetMeta())) == 0 { + io.WriteString(p.w, " ") + } p.printMeta(nn.Implements, meta.ImplementsToken) io.WriteString(p.w, "implements") + if len((*nn.Implements.InterfaceNames[0].GetMeta())) == 0 { + io.WriteString(p.w, " ") + } p.joinPrint(",", nn.Implements.InterfaceNames) } @@ -1999,14 +2253,29 @@ func (p *Printer) printStmtClassConstList(n node.Node) { p.printMeta(nn, meta.NodeStart) if nn.Modifiers != nil { - p.joinPrint("", nn.Modifiers) + for k, m := range nn.Modifiers { + if k > 0 && len(m.GetMeta().FindBy(meta.AndFilter(meta.TokenNameFilter(meta.NodeStart), meta.TypeFilter(meta.WhiteSpaceType)))) == 0 { + io.WriteString(p.w, " ") + } + p.Print(m) + } + + if len((*nn.GetMeta())) == 0 { + io.WriteString(p.w, " ") + } } p.printMeta(nn, meta.ConstToken) io.WriteString(p.w, "const") + if len((*nn.Consts[0].GetMeta())) == 0 { + io.WriteString(p.w, " ") + } p.joinPrint(",", nn.Consts) p.printMeta(nn, meta.SemiColonToken) + if len((*nn.GetMeta())) == 0 { + io.WriteString(p.w, ";") + } p.printMeta(nn, meta.NodeEnd) } @@ -2017,9 +2286,15 @@ func (p *Printer) printStmtConstList(n node.Node) { io.WriteString(p.w, "const") + if len((*nn.Consts[0].GetMeta())) == 0 { + io.WriteString(p.w, " ") + } p.joinPrint(",", nn.Consts) p.printMeta(nn, meta.SemiColonToken) + if len((*nn.GetMeta())) == 0 { + io.WriteString(p.w, ";") + } p.printMeta(nn, meta.NodeEnd) } @@ -2043,10 +2318,16 @@ func (p *Printer) printStmtContinue(n node.Node) { io.WriteString(p.w, "continue") if nn.Expr != nil { + if len((*nn.Expr.GetMeta())) == 0 { + io.WriteString(p.w, " ") + } p.Print(nn.Expr) } p.printMeta(nn, meta.SemiColonToken) + if len((*nn.GetMeta())) == 0 { + io.WriteString(p.w, ";") + } p.printMeta(nn, meta.NodeEnd) } @@ -2072,6 +2353,9 @@ func (p *Printer) printStmtDeclare(n node.Node) { p.printMeta(nn, meta.EnddeclareToken) io.WriteString(p.w, "enddeclare") p.printMeta(nn, meta.SemiColonToken) + if len((*nn.GetMeta())) == 0 { + io.WriteString(p.w, ";") + } } else { p.Print(nn.Stmt) @@ -2103,6 +2387,12 @@ func (p *Printer) printStmtDo(n node.Node) { io.WriteString(p.w, "do") + if _, ok := nn.Stmt.(*stmt.StmtList); !ok { + if len((*nn.Stmt.GetMeta())) == 0 { + io.WriteString(p.w, " ") + } + } + p.Print(nn.Stmt) p.printMeta(nn, meta.WhileToken) @@ -2113,16 +2403,38 @@ func (p *Printer) printStmtDo(n node.Node) { p.printMeta(nn, meta.CloseParenthesisToken) io.WriteString(p.w, ")") p.printMeta(nn, meta.SemiColonToken) + if len((*nn.GetMeta())) == 0 { + io.WriteString(p.w, ";") + } p.printMeta(nn, meta.NodeEnd) } func (p *Printer) printStmtEcho(n node.Node) { nn := n.(*stmt.Echo) + + if p.s == HtmlState { + if len((*n.GetMeta())) == 0 { + io.WriteString(p.w, "") + } else { + if len((*nn.Variable.GetMeta())) == 0 { + io.WriteString(p.w, " ") + } } p.Print(nn.Variable) @@ -2234,8 +2565,15 @@ func (p *Printer) printStmtFunction(n node.Node) { io.WriteString(p.w, "function") if nn.ReturnsRef { + if len((*nn.GetMeta())) == 0 { + io.WriteString(p.w, " ") + } p.printMeta(nn, meta.AmpersandToken) io.WriteString(p.w, "&") + } else { + if len((*nn.FunctionName.GetMeta())) == 0 { + io.WriteString(p.w, " ") + } } p.Print(nn.FunctionName) @@ -2268,6 +2606,9 @@ func (p *Printer) printStmtGlobal(n node.Node) { io.WriteString(p.w, "global") p.joinPrint(",", nn.Vars) p.printMeta(nn, meta.SemiColonToken) + if len((*nn.GetMeta())) == 0 { + io.WriteString(p.w, ";") + } p.printMeta(nn, meta.NodeEnd) } @@ -2277,8 +2618,14 @@ func (p *Printer) printStmtGoto(n node.Node) { p.printMeta(nn, meta.NodeStart) io.WriteString(p.w, "goto") + if len((*nn.Label.GetMeta())) == 0 { + io.WriteString(p.w, " ") + } p.Print(nn.Label) p.printMeta(nn, meta.SemiColonToken) + if len((*nn.GetMeta())) == 0 { + io.WriteString(p.w, ";") + } p.printMeta(nn, meta.NodeEnd) } @@ -2290,9 +2637,15 @@ func (p *Printer) printStmtGroupUse(n node.Node) { io.WriteString(p.w, "use") if nn.UseType != nil { + if len((*nn.UseType.GetMeta())) == 0 { + io.WriteString(p.w, " ") + } p.Print(nn.UseType) } + if len((*nn.Prefix.GetMeta())) == 0 { + io.WriteString(p.w, " ") + } p.Print(nn.Prefix) p.printMeta(nn, meta.NsSeparatorToken) io.WriteString(p.w, "\\") @@ -2303,6 +2656,9 @@ func (p *Printer) printStmtGroupUse(n node.Node) { p.printMeta(nn, meta.CloseCurlyBracesToken) io.WriteString(p.w, "}") p.printMeta(nn, meta.SemiColonToken) + if len((*nn.GetMeta())) == 0 { + io.WriteString(p.w, ";") + } p.printMeta(nn, meta.NodeEnd) } @@ -2316,7 +2672,10 @@ func (p *Printer) printStmtHaltCompiler(n node.Node) { io.WriteString(p.w, "(") p.printMeta(n, meta.CloseParenthesisToken) io.WriteString(p.w, ")") - p.printMeta(n, meta.SemiColonToken) + p.printMeta(nn, meta.SemiColonToken) + if len((*nn.GetMeta())) == 0 { + io.WriteString(p.w, ";") + } p.printMeta(nn, meta.NodeEnd) } @@ -2349,6 +2708,11 @@ func (p *Printer) printStmtInlineHTML(n node.Node) { nn := n.(*stmt.InlineHtml) p.printMeta(nn, meta.NodeStart) + if p.s == PhpState && len(n.GetMeta().FindBy(meta.ValueFilter("?>"))) == 0 { + io.WriteString(p.w, "?>") + } + p.SetState(HtmlState) + io.WriteString(p.w, nn.Value) p.printMeta(nn, meta.NodeEnd) @@ -2360,14 +2724,22 @@ func (p *Printer) printStmtInterface(n node.Node) { io.WriteString(p.w, "interface") - if nn.InterfaceName != nil { - p.Print(nn.InterfaceName) + if len((*nn.InterfaceName.GetMeta())) == 0 { + io.WriteString(p.w, " ") } + p.Print(nn.InterfaceName) + if nn.Extends != nil { p.printMeta(nn.Extends, meta.NodeStart) + if len((*nn.Extends.GetMeta())) == 0 { + io.WriteString(p.w, " ") + } p.printMeta(nn.Extends, meta.ExtendsToken) io.WriteString(p.w, "extends") + if len((*nn.Extends.InterfaceNames[0].GetMeta())) == 0 { + io.WriteString(p.w, " ") + } p.joinPrint(",", nn.Extends.InterfaceNames) } @@ -2397,6 +2769,9 @@ func (p *Printer) printStmtNamespace(n node.Node) { io.WriteString(p.w, "namespace") if nn.NamespaceName != nil { + if len((*nn.GetMeta())) == 0 { + io.WriteString(p.w, " ") + } p.Print(nn.NamespaceName) } @@ -2407,7 +2782,10 @@ func (p *Printer) printStmtNamespace(n node.Node) { p.printMeta(n, meta.CloseCurlyBracesToken) io.WriteString(p.w, "}") } else { - p.printMeta(n, meta.SemiColonToken) + p.printMeta(nn, meta.SemiColonToken) + if len((*nn.GetMeta())) == 0 { + io.WriteString(p.w, ";") + } } p.printMeta(nn, meta.NodeEnd) @@ -2415,6 +2793,9 @@ func (p *Printer) printStmtNamespace(n node.Node) { func (p *Printer) printStmtNop(n node.Node) { p.printMeta(n, meta.NodeStart) + if len((*n.GetMeta())) == 0 { + io.WriteString(p.w, ";") + } p.printMeta(n, meta.NodeEnd) } @@ -2422,9 +2803,22 @@ func (p *Printer) printStmtPropertyList(n node.Node) { nn := n.(*stmt.PropertyList) p.printMeta(nn, meta.NodeStart) - p.joinPrint("", nn.Modifiers) + for k, m := range nn.Modifiers { + if k > 0 && len(m.GetMeta().FindBy(meta.AndFilter(meta.TokenNameFilter(meta.NodeStart), meta.TypeFilter(meta.WhiteSpaceType)))) == 0 { + io.WriteString(p.w, " ") + } + p.Print(m) + } + + if len((*nn.Properties[0].GetMeta())) == 0 { + io.WriteString(p.w, " ") + } + p.joinPrint(",", nn.Properties) - p.printMeta(n, meta.SemiColonToken) + p.printMeta(nn, meta.SemiColonToken) + if len((*nn.GetMeta())) == 0 { + io.WriteString(p.w, ";") + } p.printMeta(nn, meta.NodeEnd) } @@ -2449,8 +2843,14 @@ func (p *Printer) printStmtReturn(n node.Node) { p.printMeta(nn, meta.NodeStart) io.WriteString(p.w, "return") + if len((*nn.Expr.GetMeta())) == 0 { + io.WriteString(p.w, " ") + } p.Print(nn.Expr) p.printMeta(nn, meta.SemiColonToken) + if len((*nn.GetMeta())) == 0 { + io.WriteString(p.w, ";") + } p.printMeta(nn, meta.NodeEnd) } @@ -2476,6 +2876,9 @@ func (p *Printer) printStmtStatic(n node.Node) { io.WriteString(p.w, "static") p.joinPrint(",", nn.Vars) p.printMeta(nn, meta.SemiColonToken) + if len((*nn.GetMeta())) == 0 { + io.WriteString(p.w, ";") + } p.printMeta(nn, meta.NodeEnd) } @@ -2517,8 +2920,14 @@ func (p *Printer) printStmtThrow(n node.Node) { p.printMeta(nn, meta.NodeStart) io.WriteString(p.w, "throw") + if len((*nn.Expr.GetMeta())) == 0 { + io.WriteString(p.w, " ") + } p.Print(nn.Expr) p.printMeta(nn, meta.SemiColonToken) + if len((*nn.GetMeta())) == 0 { + io.WriteString(p.w, ";") + } p.printMeta(nn, meta.NodeEnd) } @@ -2555,17 +2964,29 @@ func (p *Printer) printStmtTraitUseAlias(n node.Node) { p.Print(nn.Ref) p.printMeta(nn, meta.AsToken) + if len((*nn.GetMeta())) == 0 { + io.WriteString(p.w, " ") + } io.WriteString(p.w, "as") if nn.Modifier != nil { + if len((*nn.Modifier.GetMeta())) == 0 { + io.WriteString(p.w, " ") + } p.Print(nn.Modifier) } if nn.Alias != nil { + if len((*nn.Alias.GetMeta())) == 0 { + io.WriteString(p.w, " ") + } p.Print(nn.Alias) } p.printMeta(nn, meta.SemiColonToken) + if len((*nn.GetMeta())) == 0 { + io.WriteString(p.w, ";") + } p.printMeta(nn, meta.NodeEnd) } @@ -2575,11 +2996,20 @@ func (p *Printer) printStmtTraitUsePrecedence(n node.Node) { p.printMeta(nn, meta.NodeStart) p.Print(nn.Ref) + if len((*nn.GetMeta())) == 0 { + io.WriteString(p.w, " ") + } p.printMeta(nn, meta.InsteadofToken) io.WriteString(p.w, "insteadof") + if len((*nn.Insteadof[0].GetMeta())) == 0 { + io.WriteString(p.w, " ") + } p.joinPrint(",", nn.Insteadof) p.printMeta(nn, meta.SemiColonToken) + if len((*nn.GetMeta())) == 0 { + io.WriteString(p.w, ";") + } p.printMeta(nn, meta.NodeEnd) } @@ -2589,6 +3019,9 @@ func (p *Printer) printStmtTraitUse(n node.Node) { p.printMeta(nn, meta.NodeStart) io.WriteString(p.w, "use") + if len((*nn.Traits[0].GetMeta())) == 0 { + io.WriteString(p.w, " ") + } p.joinPrint(",", nn.Traits) p.Print(nn.TraitAdaptationList) @@ -2601,6 +3034,9 @@ func (p *Printer) printStmtTrait(n node.Node) { p.printMeta(nn, meta.NodeStart) io.WriteString(p.w, "trait") + if len((*nn.TraitName.GetMeta())) == 0 { + io.WriteString(p.w, " ") + } p.Print(nn.TraitName) p.printMeta(nn, meta.OpenCurlyBracesToken) @@ -2646,6 +3082,9 @@ func (p *Printer) printStmtUnset(n node.Node) { p.printMeta(nn, meta.CloseParenthesisToken) io.WriteString(p.w, ")") p.printMeta(nn, meta.SemiColonToken) + if len((*nn.GetMeta())) == 0 { + io.WriteString(p.w, ";") + } p.printMeta(nn, meta.NodeEnd) } @@ -2657,11 +3096,20 @@ func (p *Printer) printStmtUseList(n node.Node) { io.WriteString(p.w, "use") if nn.UseType != nil { + if len((*nn.UseType.GetMeta())) == 0 { + io.WriteString(p.w, " ") + } p.Print(nn.UseType) } + if len((*nn.Uses[0].GetMeta())) == 0 { + io.WriteString(p.w, " ") + } p.joinPrint(",", nn.Uses) p.printMeta(nn, meta.SemiColonToken) + if len((*nn.GetMeta())) == 0 { + io.WriteString(p.w, ";") + } p.printMeta(nn, meta.NodeEnd) } @@ -2672,13 +3120,22 @@ func (p *Printer) printStmtUse(n node.Node) { if nn.UseType != nil { p.Print(nn.UseType) + if len((*nn.GetMeta())) == 0 { + io.WriteString(p.w, " ") + } } p.Print(nn.Use) if nn.Alias != nil { + if len((*nn.GetMeta())) == 0 { + io.WriteString(p.w, " ") + } p.printMeta(nn, meta.AsToken) io.WriteString(p.w, "as") + if len((*nn.Alias.GetMeta())) == 0 { + io.WriteString(p.w, " ") + } p.Print(nn.Alias) } diff --git a/printer/printer_parsed_php7_test.go b/printer/printer_parsed_php7_test.go index 84a3e72..0d8f38c 100644 --- a/printer/printer_parsed_php7_test.go +++ b/printer/printer_parsed_php7_test.go @@ -1491,6 +1491,7 @@ func TestParseAndPrintComplexString3(t *testing.T) { src := `HTML"}, &stmt.Expression{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "HTML"}, + &stmt.Expression{ Expr: &expr.Variable{ Meta: meta.Collection{ &meta.Data{ @@ -107,7 +110,7 @@ func TestPrinterPrintFileInlineHtml(t *testing.T) { }, }) - expected := `
HTML
HTML
HTML
>=$b` + expected := `$a>>=$b` actual := o.String() if expected != actual { @@ -1348,36 +781,15 @@ func TestPrinterPrintBinaryBitwiseAnd(t *testing.T) { p := printer.NewPrinter(o) p.Print(&binary.BitwiseAnd{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.AmpersandToken, - }, - }, Left: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "a"}, }, Right: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "b"}, }, }) - expected := `$a &$b` + expected := `$a&$b` actual := o.String() if expected != actual { @@ -1390,36 +802,15 @@ func TestPrinterPrintBinaryBitwiseOr(t *testing.T) { p := printer.NewPrinter(o) p.Print(&binary.BitwiseOr{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.VerticalBarToken, - }, - }, Left: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "a"}, }, Right: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "b"}, }, }) - expected := `$a |$b` + expected := `$a|$b` actual := o.String() if expected != actual { @@ -1432,36 +823,15 @@ func TestPrinterPrintBinaryBitwiseXor(t *testing.T) { p := printer.NewPrinter(o) p.Print(&binary.BitwiseXor{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.CaretToken, - }, - }, Left: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "a"}, }, Right: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "b"}, }, }) - expected := `$a ^$b` + expected := `$a^$b` actual := o.String() if expected != actual { @@ -1474,36 +844,15 @@ func TestPrinterPrintBinaryBooleanAnd(t *testing.T) { p := printer.NewPrinter(o) p.Print(&binary.BooleanAnd{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.BooleanAndToken, - }, - }, Left: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "a"}, }, Right: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "b"}, }, }) - expected := `$a &&$b` + expected := `$a&&$b` actual := o.String() if expected != actual { @@ -1516,36 +865,15 @@ func TestPrinterPrintBinaryBooleanOr(t *testing.T) { p := printer.NewPrinter(o) p.Print(&binary.BooleanOr{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.BooleanOrToken, - }, - }, Left: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "a"}, }, Right: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "b"}, }, }) - expected := `$a ||$b` + expected := `$a||$b` actual := o.String() if expected != actual { @@ -1558,36 +886,15 @@ func TestPrinterPrintBinaryCoalesce(t *testing.T) { p := printer.NewPrinter(o) p.Print(&binary.Coalesce{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.CoalesceToken, - }, - }, Left: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "a"}, }, Right: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "b"}, }, }) - expected := `$a ??$b` + expected := `$a??$b` actual := o.String() if expected != actual { @@ -1600,36 +907,15 @@ func TestPrinterPrintBinaryConcat(t *testing.T) { p := printer.NewPrinter(o) p.Print(&binary.Concat{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.DotToken, - }, - }, Left: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "a"}, }, Right: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "b"}, }, }) - expected := `$a .$b` + expected := `$a.$b` actual := o.String() if expected != actual { @@ -1642,36 +928,15 @@ func TestPrinterPrintBinaryDiv(t *testing.T) { p := printer.NewPrinter(o) p.Print(&binary.Div{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.SlashToken, - }, - }, Left: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "a"}, }, Right: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "b"}, }, }) - expected := `$a /$b` + expected := `$a/$b` actual := o.String() if expected != actual { @@ -1684,36 +949,15 @@ func TestPrinterPrintBinaryEqual(t *testing.T) { p := printer.NewPrinter(o) p.Print(&binary.Equal{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.IsEqualToken, - }, - }, Left: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "a"}, }, Right: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "b"}, }, }) - expected := `$a ==$b` + expected := `$a==$b` actual := o.String() if expected != actual { @@ -1726,36 +970,15 @@ func TestPrinterPrintBinaryGreaterOrEqual(t *testing.T) { p := printer.NewPrinter(o) p.Print(&binary.GreaterOrEqual{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.IsGreaterOrEqualToken, - }, - }, Left: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "a"}, }, Right: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "b"}, }, }) - expected := `$a >=$b` + expected := `$a>=$b` actual := o.String() if expected != actual { @@ -1768,36 +991,15 @@ func TestPrinterPrintBinaryGreater(t *testing.T) { p := printer.NewPrinter(o) p.Print(&binary.Greater{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.GreaterToken, - }, - }, Left: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "a"}, }, Right: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "b"}, }, }) - expected := `$a >$b` + expected := `$a>$b` actual := o.String() if expected != actual { @@ -1810,36 +1012,15 @@ func TestPrinterPrintBinaryIdentical(t *testing.T) { p := printer.NewPrinter(o) p.Print(&binary.Identical{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.IsIdenticalToken, - }, - }, Left: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "a"}, }, Right: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "b"}, }, }) - expected := `$a ===$b` + expected := `$a===$b` actual := o.String() if expected != actual { @@ -1852,36 +1033,15 @@ func TestPrinterPrintBinaryLogicalAnd(t *testing.T) { p := printer.NewPrinter(o) p.Print(&binary.LogicalAnd{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.LogicalAndToken, - }, - }, Left: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "a"}, }, Right: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "b"}, }, }) - expected := `$a and$b` + expected := `$a and $b` actual := o.String() if expected != actual { @@ -1894,36 +1054,15 @@ func TestPrinterPrintBinaryLogicalOr(t *testing.T) { p := printer.NewPrinter(o) p.Print(&binary.LogicalOr{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.LogicalOrToken, - }, - }, Left: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "a"}, }, Right: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "b"}, }, }) - expected := `$a or$b` + expected := `$a or $b` actual := o.String() if expected != actual { @@ -1936,36 +1075,15 @@ func TestPrinterPrintBinaryLogicalXor(t *testing.T) { p := printer.NewPrinter(o) p.Print(&binary.LogicalXor{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.LogicalXorToken, - }, - }, Left: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "a"}, }, Right: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "b"}, }, }) - expected := `$a xor$b` + expected := `$a xor $b` actual := o.String() if expected != actual { @@ -1978,36 +1096,15 @@ func TestPrinterPrintBinaryMinus(t *testing.T) { p := printer.NewPrinter(o) p.Print(&binary.Minus{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.MinusToken, - }, - }, Left: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "a"}, }, Right: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "b"}, }, }) - expected := `$a -$b` + expected := `$a-$b` actual := o.String() if expected != actual { @@ -2020,36 +1117,15 @@ func TestPrinterPrintBinaryMod(t *testing.T) { p := printer.NewPrinter(o) p.Print(&binary.Mod{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.PercentToken, - }, - }, Left: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "a"}, }, Right: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "b"}, }, }) - expected := `$a %$b` + expected := `$a%$b` actual := o.String() if expected != actual { @@ -2062,36 +1138,15 @@ func TestPrinterPrintBinaryMul(t *testing.T) { p := printer.NewPrinter(o) p.Print(&binary.Mul{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.AsteriskToken, - }, - }, Left: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "a"}, }, Right: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "b"}, }, }) - expected := `$a *$b` + expected := `$a*$b` actual := o.String() if expected != actual { @@ -2104,41 +1159,15 @@ func TestPrinterPrintBinaryNotEqual(t *testing.T) { p := printer.NewPrinter(o) p.Print(&binary.NotEqual{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.IsNotEqualToken, - }, - &meta.Data{ - Type: meta.TokenType, - Value: "!=", - TokenName: meta.IsNotEqualToken, - }, - }, Left: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "a"}, }, Right: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "b"}, }, }) - expected := `$a !=$b` + expected := `$a!=$b` actual := o.String() if expected != actual { @@ -2151,36 +1180,15 @@ func TestPrinterPrintBinaryNotIdentical(t *testing.T) { p := printer.NewPrinter(o) p.Print(&binary.NotIdentical{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.IsNotIdenticalToken, - }, - }, Left: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "a"}, }, Right: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "b"}, }, }) - expected := `$a !==$b` + expected := `$a!==$b` actual := o.String() if expected != actual { @@ -2193,36 +1201,15 @@ func TestPrinterPrintBinaryPlus(t *testing.T) { p := printer.NewPrinter(o) p.Print(&binary.Plus{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.PlusToken, - }, - }, Left: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "a"}, }, Right: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "b"}, }, }) - expected := `$a +$b` + expected := `$a+$b` actual := o.String() if expected != actual { @@ -2235,36 +1222,15 @@ func TestPrinterPrintBinaryPow(t *testing.T) { p := printer.NewPrinter(o) p.Print(&binary.Pow{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.PowToken, - }, - }, Left: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "a"}, }, Right: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "b"}, }, }) - expected := `$a **$b` + expected := `$a**$b` actual := o.String() if expected != actual { @@ -2277,36 +1243,15 @@ func TestPrinterPrintBinaryShiftLeft(t *testing.T) { p := printer.NewPrinter(o) p.Print(&binary.ShiftLeft{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.SlToken, - }, - }, Left: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "a"}, }, Right: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "b"}, }, }) - expected := `$a <<$b` + expected := `$a<<$b` actual := o.String() if expected != actual { @@ -2319,36 +1264,15 @@ func TestPrinterPrintBinaryShiftRight(t *testing.T) { p := printer.NewPrinter(o) p.Print(&binary.ShiftRight{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.SrToken, - }, - }, Left: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "a"}, }, Right: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "b"}, }, }) - expected := `$a >>$b` + expected := `$a>>$b` actual := o.String() if expected != actual { @@ -2361,36 +1285,15 @@ func TestPrinterPrintBinarySmallerOrEqual(t *testing.T) { p := printer.NewPrinter(o) p.Print(&binary.SmallerOrEqual{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.IsSmallerOrEqualToken, - }, - }, Left: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "a"}, }, Right: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "b"}, }, }) - expected := `$a <=$b` + expected := `$a<=$b` actual := o.String() if expected != actual { @@ -2403,36 +1306,15 @@ func TestPrinterPrintBinarySmaller(t *testing.T) { p := printer.NewPrinter(o) p.Print(&binary.Smaller{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.LessToken, - }, - }, Left: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "a"}, }, Right: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "b"}, }, }) - expected := `$a <$b` + expected := `$a<$b` actual := o.String() if expected != actual { @@ -2445,36 +1327,15 @@ func TestPrinterPrintBinarySpaceship(t *testing.T) { p := printer.NewPrinter(o) p.Print(&binary.Spaceship{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.SpaceshipToken, - }, - }, Left: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "a"}, }, Right: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "b"}, }, }) - expected := `$a <=>$b` + expected := `$a<=>$b` actual := o.String() if expected != actual { @@ -2489,31 +1350,12 @@ func TestPrinterPrintArray(t *testing.T) { p := printer.NewPrinter(o) p.Print(&cast.Array{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - &meta.Data{ - Type: meta.TokenType, - Value: "(array)", - TokenName: meta.NodeStart, - }, - }, Expr: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "var"}, }, }) - expected := ` (array)$var` + expected := `(array)$var` actual := o.String() if expected != actual { @@ -2526,31 +1368,12 @@ func TestPrinterPrintBool(t *testing.T) { p := printer.NewPrinter(o) p.Print(&cast.Bool{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - &meta.Data{ - Type: meta.TokenType, - Value: "(bool)", - TokenName: meta.NodeStart, - }, - }, Expr: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "var"}, }, }) - expected := ` (bool)$var` + expected := `(boolean)$var` actual := o.String() if expected != actual { @@ -2563,31 +1386,12 @@ func TestPrinterPrintDouble(t *testing.T) { p := printer.NewPrinter(o) p.Print(&cast.Double{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - &meta.Data{ - Type: meta.TokenType, - Value: "(float)", - TokenName: meta.NodeStart, - }, - }, Expr: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "var"}, }, }) - expected := ` (float)$var` + expected := `(float)$var` actual := o.String() if expected != actual { @@ -2600,31 +1404,12 @@ func TestPrinterPrintInt(t *testing.T) { p := printer.NewPrinter(o) p.Print(&cast.Int{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - &meta.Data{ - Type: meta.TokenType, - Value: "(int)", - TokenName: meta.NodeStart, - }, - }, Expr: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "var"}, }, }) - expected := ` (int)$var` + expected := `(integer)$var` actual := o.String() if expected != actual { @@ -2637,31 +1422,12 @@ func TestPrinterPrintObject(t *testing.T) { p := printer.NewPrinter(o) p.Print(&cast.Object{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - &meta.Data{ - Type: meta.TokenType, - Value: "(object)", - TokenName: meta.NodeStart, - }, - }, Expr: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "var"}, }, }) - expected := ` (object)$var` + expected := `(object)$var` actual := o.String() if expected != actual { @@ -2674,31 +1440,12 @@ func TestPrinterPrintString(t *testing.T) { p := printer.NewPrinter(o) p.Print(&cast.String{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - &meta.Data{ - Type: meta.TokenType, - Value: "(string)", - TokenName: meta.NodeStart, - }, - }, Expr: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "var"}, }, }) - expected := ` (string)$var` + expected := `(string)$var` actual := o.String() if expected != actual { @@ -2711,31 +1458,12 @@ func TestPrinterPrintUnset(t *testing.T) { p := printer.NewPrinter(o) p.Print(&cast.Unset{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - &meta.Data{ - Type: meta.TokenType, - Value: "(unset)", - TokenName: meta.NodeStart, - }, - }, Expr: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "var"}, }, }) - expected := ` (unset)$var` + expected := `(unset)$var` actual := o.String() if expected != actual { @@ -2750,42 +1478,13 @@ func TestPrinterPrintExprArrayDimFetch(t *testing.T) { p := printer.NewPrinter(o) p.Print(&expr.ArrayDimFetch{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.OpenSquareBracket, - }, - &meta.Data{ - Type: meta.TokenType, - Value: "[", - TokenName: meta.OpenSquareBracket, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.CloseSquareBracket, - }, - &meta.Data{ - Type: meta.TokenType, - Value: "]", - TokenName: meta.CloseSquareBracket, - }, - }, Variable: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "var"}, }, Dim: &scalar.Lnumber{Value: "1"}, }) - expected := `$var [1 ]` + expected := `$var[1]` actual := o.String() if expected != actual { @@ -2798,32 +1497,13 @@ func TestPrinterPrintExprArrayItemWithKey(t *testing.T) { p := printer.NewPrinter(o) p.Print(&expr.ArrayItem{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.DoubleArrowToken, - }, - }, Key: &scalar.String{Value: "'Hello'"}, Val: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "world"}, }, }) - expected := `'Hello' => $world` + expected := `'Hello'=>$world` actual := o.String() if expected != actual { @@ -2837,13 +1517,6 @@ func TestPrinterPrintExprArrayItem(t *testing.T) { p := printer.NewPrinter(o) p.Print(&expr.ArrayItem{ Val: &expr.Reference{Variable: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "world"}, }}, }) @@ -2861,66 +1534,28 @@ func TestPrinterPrintExprArray(t *testing.T) { p := printer.NewPrinter(o) p.Print(&expr.Array{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.OpenParenthesisToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.CloseParenthesisToken, - }, - }, Items: []node.Node{ &expr.ArrayItem{ Key: &scalar.String{Value: "'Hello'"}, Val: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "world"}, }, }, &expr.ArrayItem{ Key: &scalar.Lnumber{Value: "2"}, Val: &expr.Reference{Variable: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "var"}, }}, }, &expr.ArrayItem{ Val: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "var"}, }, }, }, }) - expected := ` array ('Hello'=>$world,2=>&$var,$var )` + expected := `array('Hello'=>$world,2=>&$var,$var)` actual := o.String() if expected != actual { @@ -2933,26 +1568,12 @@ func TestPrinterPrintExprBitwiseNot(t *testing.T) { p := printer.NewPrinter(o) p.Print(&expr.BitwiseNot{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - }, Expr: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "var"}, }, }) - expected := ` ~$var` + expected := `~$var` actual := o.String() if expected != actual { @@ -2965,26 +1586,12 @@ func TestPrinterPrintExprBooleanNot(t *testing.T) { p := printer.NewPrinter(o) p.Print(&expr.BooleanNot{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - }, Expr: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "var"}, }, }) - expected := ` !$var` + expected := `!$var` actual := o.String() if expected != actual { @@ -2997,36 +1604,15 @@ func TestPrinterPrintExprClassConstFetch(t *testing.T) { p := printer.NewPrinter(o) p.Print(&expr.ClassConstFetch{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.PaamayimNekudotayimToken, - }, - }, Class: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "var"}, }, ConstantName: &node.Identifier{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - }, Value: "CONST", }, }) - expected := `$var :: CONST` + expected := `$var::CONST` actual := o.String() if expected != actual { @@ -3039,26 +1625,12 @@ func TestPrinterPrintExprClone(t *testing.T) { p := printer.NewPrinter(o) p.Print(&expr.Clone{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - }, Expr: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "var"}, }, }) - expected := ` clone$var` + expected := `clone $var` actual := o.String() if expected != actual { @@ -3071,48 +1643,17 @@ func TestPrinterPrintExprClosureUse(t *testing.T) { p := printer.NewPrinter(o) p.Print(&expr.ClosureUse{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.OpenParenthesisToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.CloseParenthesisToken, - }, - }, Uses: []node.Node{ &expr.Reference{Variable: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "foo"}, }}, &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "bar"}, }, }, }) - expected := ` use (&$foo,$bar )` + expected := `use(&$foo,$bar)` actual := o.String() if expected != actual { @@ -3125,43 +1666,6 @@ func TestPrinterPrintExprClosure(t *testing.T) { p := printer.NewPrinter(o) p.Print(&expr.Closure{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.FunctionToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.AmpersandToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.OpenParenthesisToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.CloseParenthesisToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.OpenCurlyBracesToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.CloseCurlyBracesToken, - }, - }, Static: true, ReturnsRef: true, Params: []node.Node{ @@ -3169,13 +1673,6 @@ func TestPrinterPrintExprClosure(t *testing.T) { ByRef: true, Variadic: false, Variable: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "var"}, }, }, @@ -3183,52 +1680,24 @@ func TestPrinterPrintExprClosure(t *testing.T) { ClosureUse: &expr.ClosureUse{ Uses: []node.Node{ &expr.Reference{Variable: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "a"}, }}, &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "b"}, }, }, }, ReturnType: &name.FullyQualified{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.ColonToken, - }, - }, Parts: []node.Node{&name.NamePart{Value: "Foo"}}, }, Stmts: []node.Node{ &stmt.Expression{Expr: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "a"}, }}, }, }) - expected := ` static function & (&$var )use(&$a,$b) :\Foo {$a }` + expected := `static function&(&$var)use(&$a,$b):\Foo{$a;}` actual := o.String() if expected != actual { @@ -3257,36 +1726,12 @@ func TestPrinterPrintEmpty(t *testing.T) { p := printer.NewPrinter(o) p.Print(&expr.Empty{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.OpenParenthesisToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.CloseParenthesisToken, - }, - }, Expr: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "var"}, }, }) - expected := ` empty ($var )` + expected := `empty($var)` actual := o.String() if expected != actual { @@ -3299,26 +1744,12 @@ func TestPrinterPrettyPrinterrorSuppress(t *testing.T) { p := printer.NewPrinter(o) p.Print(&expr.ErrorSuppress{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - }, Expr: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "var"}, }, }) - expected := ` @$var` + expected := `@$var` actual := o.String() if expected != actual { @@ -3331,36 +1762,12 @@ func TestPrinterPrintEval(t *testing.T) { p := printer.NewPrinter(o) p.Print(&expr.Eval{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.OpenParenthesisToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.CloseParenthesisToken, - }, - }, Expr: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "var"}, }, }) - expected := ` eval ($var )` + expected := `eval($var)` actual := o.String() if expected != actual { @@ -3373,37 +1780,13 @@ func TestPrinterPrintExit(t *testing.T) { p := printer.NewPrinter(o) p.Print(&expr.Exit{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.OpenParenthesisToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.CloseParenthesisToken, - }, - }, Die: false, Expr: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "var"}, }, }) - expected := ` exit $var ` + expected := `exit $var` actual := o.String() if expected != actual { @@ -3417,36 +1800,12 @@ func TestPrinterPrintDie(t *testing.T) { p := printer.NewPrinter(o) p.Print(&expr.Exit{ Die: true, - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.OpenParenthesisToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.CloseParenthesisToken, - }, - }, Expr: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "var"}, }, }) - expected := ` die $var ` + expected := `die $var` actual := o.String() if expected != actual { @@ -3460,64 +1819,24 @@ func TestPrinterPrintFunctionCall(t *testing.T) { p := printer.NewPrinter(o) p.Print(&expr.FunctionCall{ Function: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "var"}, }, ArgumentList: &node.ArgumentList{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.OpenParenthesisToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.CloseParenthesisToken, - }, - }, Arguments: []node.Node{ &node.Argument{ IsReference: true, Expr: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "a"}, }, }, &node.Argument{ Variadic: true, Expr: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "b"}, }, }, &node.Argument{ Expr: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "c"}, }, }, @@ -3525,7 +1844,7 @@ func TestPrinterPrintFunctionCall(t *testing.T) { }, }) - expected := `$var (&$a,...$b,$c )` + expected := `$var(&$a,...$b,$c)` actual := o.String() if expected != actual { @@ -3538,17 +1857,10 @@ func TestPrinterPrintInclude(t *testing.T) { p := printer.NewPrinter(o) p.Print(&expr.Include{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - }, Expr: &scalar.String{Value: "'path'"}, }) - expected := ` include'path'` + expected := `include 'path'` actual := o.String() if expected != actual { @@ -3561,16 +1873,10 @@ func TestPrinterPrintIncludeOnce(t *testing.T) { p := printer.NewPrinter(o) p.Print(&expr.IncludeOnce{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - }, Expr: &scalar.String{Value: "'path'"}, + Expr: &scalar.String{Value: "'path'"}, }) - expected := ` include_once'path'` + expected := `include_once 'path'` actual := o.String() if expected != actual { @@ -3583,27 +1889,13 @@ func TestPrinterPrintInstanceOf(t *testing.T) { p := printer.NewPrinter(o) p.Print(&expr.InstanceOf{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.InstanceofToken, - }, - }, Expr: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "var"}, }, Class: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Foo"}}}, }) - expected := `$var instanceofFoo` + expected := `$var instanceof Foo` actual := o.String() if expected != actual { @@ -3616,48 +1908,17 @@ func TestPrinterPrintIsset(t *testing.T) { p := printer.NewPrinter(o) p.Print(&expr.Isset{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.OpenParenthesisToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.CloseParenthesisToken, - }, - }, Variables: []node.Node{ &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "a"}, }, &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "b"}, }, }, }) - expected := ` isset ($a,$b )` + expected := `isset($a,$b)` actual := o.String() if expected != actual { @@ -3670,33 +1931,9 @@ func TestPrinterPrintList(t *testing.T) { p := printer.NewPrinter(o) p.Print(&expr.List{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.OpenParenthesisToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.CloseParenthesisToken, - }, - }, Items: []node.Node{ &expr.ArrayItem{ Val: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "a"}, }, }, @@ -3705,25 +1942,11 @@ func TestPrinterPrintList(t *testing.T) { Items: []node.Node{ &expr.ArrayItem{ Val: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "b"}, }, }, &expr.ArrayItem{ Val: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "c"}, }, }, @@ -3733,7 +1956,7 @@ func TestPrinterPrintList(t *testing.T) { }, }) - expected := ` list ($a,list($b,$c) )` + expected := `list($a,list($b,$c))` actual := o.String() if expected != actual { @@ -3746,59 +1969,19 @@ func TestPrinterPrintMethodCall(t *testing.T) { p := printer.NewPrinter(o) p.Print(&expr.MethodCall{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.ObjectOperatorToken, - }, - }, Variable: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "foo"}, }, Method: &node.Identifier{Value: "bar"}, ArgumentList: &node.ArgumentList{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.OpenParenthesisToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.CloseParenthesisToken, - }, - }, Arguments: []node.Node{ &node.Argument{ Expr: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "a"}, }, }, &node.Argument{ Expr: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "b"}, }, }, @@ -3806,7 +1989,7 @@ func TestPrinterPrintMethodCall(t *testing.T) { }, }) - expected := `$foo ->bar ($a,$b )` + expected := `$foo->bar($a,$b)` actual := o.String() if expected != actual { @@ -3819,62 +2002,22 @@ func TestPrinterPrintNew(t *testing.T) { p := printer.NewPrinter(o) p.Print(&expr.New{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - }, Class: &name.Name{ Parts: []node.Node{ &name.NamePart{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - }, Value: "Foo", }, }, }, ArgumentList: &node.ArgumentList{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.OpenParenthesisToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.CloseParenthesisToken, - }, - }, Arguments: []node.Node{ &node.Argument{ Expr: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "a"}, }, }, &node.Argument{ Expr: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "b"}, }, }, @@ -3882,7 +2025,7 @@ func TestPrinterPrintNew(t *testing.T) { }, }) - expected := ` new Foo ($a,$b )` + expected := `new Foo($a,$b)` actual := o.String() if expected != actual { @@ -3895,26 +2038,12 @@ func TestPrinterPrintPostDec(t *testing.T) { p := printer.NewPrinter(o) p.Print(&expr.PostDec{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.DecToken, - }, - }, Variable: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "var"}, }, }) - expected := `$var --` + expected := `$var--` actual := o.String() if expected != actual { @@ -3927,26 +2056,12 @@ func TestPrinterPrintPostInc(t *testing.T) { p := printer.NewPrinter(o) p.Print(&expr.PostInc{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.IncToken, - }, - }, Variable: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "var"}, }, }) - expected := `$var ++` + expected := `$var++` actual := o.String() if expected != actual { @@ -3959,26 +2074,12 @@ func TestPrinterPrintPreDec(t *testing.T) { p := printer.NewPrinter(o) p.Print(&expr.PreDec{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - }, Variable: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "var"}, }, }) - expected := ` --$var` + expected := `--$var` actual := o.String() if expected != actual { @@ -3991,26 +2092,12 @@ func TestPrinterPrintPreInc(t *testing.T) { p := printer.NewPrinter(o) p.Print(&expr.PreInc{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - }, Variable: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "var"}, }, }) - expected := ` ++$var` + expected := `++$var` actual := o.String() if expected != actual { @@ -4023,31 +2110,12 @@ func TestPrinterPrintPrint(t *testing.T) { p := printer.NewPrinter(o) p.Print(&expr.Print{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - }, Expr: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "var"}, }, }) - expected := ` print $var` + expected := `print $var` actual := o.String() if expected != actual { @@ -4060,27 +2128,13 @@ func TestPrinterPrintPropertyFetch(t *testing.T) { p := printer.NewPrinter(o) p.Print(&expr.PropertyFetch{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.ObjectOperatorToken, - }, - }, Variable: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "foo"}, }, Property: &node.Identifier{Value: "bar"}, }) - expected := `$foo ->bar` + expected := `$foo->bar` actual := o.String() if expected != actual { @@ -4093,26 +2147,12 @@ func TestPrinterPrintExprReference(t *testing.T) { p := printer.NewPrinter(o) p.Print(&expr.Reference{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - }, Variable: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "foo"}, }, }) - expected := ` &$foo` + expected := `&$foo` actual := o.String() if expected != actual { @@ -4125,17 +2165,10 @@ func TestPrinterPrintRequire(t *testing.T) { p := printer.NewPrinter(o) p.Print(&expr.Require{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - }, Expr: &scalar.String{Value: "'path'"}, }) - expected := ` require'path'` + expected := `require 'path'` actual := o.String() if expected != actual { @@ -4148,17 +2181,10 @@ func TestPrinterPrintRequireOnce(t *testing.T) { p := printer.NewPrinter(o) p.Print(&expr.RequireOnce{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - }, Expr: &scalar.String{Value: "'path'"}, }) - expected := ` require_once'path'` + expected := `require_once 'path'` actual := o.String() if expected != actual { @@ -4171,30 +2197,16 @@ func TestPrinterPrintShellExec(t *testing.T) { p := printer.NewPrinter(o) p.Print(&expr.ShellExec{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - }, Parts: []node.Node{ &scalar.EncapsedStringPart{Value: "hello "}, &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "world"}, }, &scalar.EncapsedStringPart{Value: "!"}, }, }) - expected := " `hello $world!`" + expected := "`hello $world!`" actual := o.String() if expected != actual { @@ -4207,61 +2219,28 @@ func TestPrinterPrintExprShortArray(t *testing.T) { p := printer.NewPrinter(o) p.Print(&expr.ShortArray{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.CloseSquareBracket, - }, - }, Items: []node.Node{ &expr.ArrayItem{ Key: &scalar.String{Value: "'Hello'"}, Val: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "world"}, }, }, &expr.ArrayItem{ Key: &scalar.Lnumber{Value: "2"}, Val: &expr.Reference{Variable: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "var"}, }}, }, &expr.ArrayItem{ Val: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "var"}, }, }, }, }) - expected := ` ['Hello'=>$world,2=>&$var,$var ]` + expected := `['Hello'=>$world,2=>&$var,$var]` actual := o.String() if expected != actual { @@ -4274,28 +2253,9 @@ func TestPrinterPrintShortList(t *testing.T) { p := printer.NewPrinter(o) p.Print(&expr.ShortList{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.CloseSquareBracket, - }, - }, Items: []node.Node{ &expr.ArrayItem{ Val: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "a"}, }, }, @@ -4304,25 +2264,11 @@ func TestPrinterPrintShortList(t *testing.T) { Items: []node.Node{ &expr.ArrayItem{ Val: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "b"}, }, }, &expr.ArrayItem{ Val: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "c"}, }, }, @@ -4332,7 +2278,7 @@ func TestPrinterPrintShortList(t *testing.T) { }, }) - expected := ` [$a,list($b,$c) ]` + expected := `[$a,list($b,$c)]` actual := o.String() if expected != actual { @@ -4345,50 +2291,17 @@ func TestPrinterPrintStaticCall(t *testing.T) { p := printer.NewPrinter(o) p.Print(&expr.StaticCall{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.PaamayimNekudotayimToken, - }, - }, Class: &node.Identifier{Value: "Foo"}, Call: &node.Identifier{Value: "bar"}, ArgumentList: &node.ArgumentList{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.OpenParenthesisToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.CloseParenthesisToken, - }, - }, Arguments: []node.Node{ &node.Argument{ Expr: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "a"}, }, }, &node.Argument{ Expr: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "b"}, }, }, @@ -4396,7 +2309,7 @@ func TestPrinterPrintStaticCall(t *testing.T) { }, }) - expected := `Foo ::bar ($a,$b )` + expected := `Foo::bar($a,$b)` actual := o.String() if expected != actual { @@ -4409,27 +2322,13 @@ func TestPrinterPrintStaticPropertyFetch(t *testing.T) { p := printer.NewPrinter(o) p.Print(&expr.StaticPropertyFetch{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.PaamayimNekudotayimToken, - }, - }, Class: &node.Identifier{Value: "Foo"}, Property: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "bar"}, }, }) - expected := `Foo ::$bar` + expected := `Foo::$bar` actual := o.String() if expected != actual { @@ -4442,41 +2341,15 @@ func TestPrinterPrintTernary(t *testing.T) { p := printer.NewPrinter(o) p.Print(&expr.Ternary{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.QuestionMarkToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.ColonToken, - }, - }, Condition: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "a"}, }, IfFalse: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "b"}, }, }) - expected := `$a ? :$b` + expected := `$a?:$b` actual := o.String() if expected != actual { @@ -4489,51 +2362,18 @@ func TestPrinterPrintTernaryFull(t *testing.T) { p := printer.NewPrinter(o) p.Print(&expr.Ternary{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.QuestionMarkToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.ColonToken, - }, - }, Condition: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "a"}, }, IfTrue: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "b"}, }, IfFalse: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "c"}, }, }) - expected := `$a ?$b :$c` + expected := `$a?$b:$c` actual := o.String() if expected != actual { @@ -4546,26 +2386,12 @@ func TestPrinterPrintUnaryMinus(t *testing.T) { p := printer.NewPrinter(o) p.Print(&expr.UnaryMinus{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - }, Expr: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "var"}, }, }) - expected := ` -$var` + expected := `-$var` actual := o.String() if expected != actual { @@ -4578,26 +2404,12 @@ func TestPrinterPrintUnaryPlus(t *testing.T) { p := printer.NewPrinter(o) p.Print(&expr.UnaryPlus{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - }, Expr: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "var"}, }, }) - expected := ` +$var` + expected := `+$var` actual := o.String() if expected != actual { @@ -4610,31 +2422,12 @@ func TestPrinterPrintVariable(t *testing.T) { p := printer.NewPrinter(o) p.Print(&expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "var"}, }, }) - expected := ` $$var` + expected := `$$var` actual := o.String() if expected != actual { @@ -4647,26 +2440,12 @@ func TestPrinterPrintYieldFrom(t *testing.T) { p := printer.NewPrinter(o) p.Print(&expr.YieldFrom{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - }, Expr: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "var"}, }, }) - expected := ` yield from$var` + expected := `yield from $var` actual := o.String() if expected != actual { @@ -4679,26 +2458,12 @@ func TestPrinterPrintYield(t *testing.T) { p := printer.NewPrinter(o) p.Print(&expr.Yield{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - }, Value: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "var"}, }, }) - expected := ` yield$var` + expected := `yield $var` actual := o.String() if expected != actual { @@ -4711,41 +2476,15 @@ func TestPrinterPrintYieldFull(t *testing.T) { p := printer.NewPrinter(o) p.Print(&expr.Yield{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.DoubleArrowToken, - }, - }, Key: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "k"}, }, Value: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "var"}, }, }) - expected := ` yield$k =>$var` + expected := `yield $k=>$var` actual := o.String() if expected != actual { @@ -4760,55 +2499,19 @@ func TestPrinterPrintAltElseIf(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.AltElseIf{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.OpenParenthesisToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.CloseParenthesisToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.ColonToken, - }, - }, Cond: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "a"}, }, Stmt: &stmt.StmtList{ Stmts: []node.Node{ &stmt.Expression{Expr: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "b"}, }}, }, }, }) - expected := ` elseif ($a ) :$b` + expected := `elseif($a):$b;` actual := o.String() if expected != actual { @@ -4821,42 +2524,13 @@ func TestPrinterPrintAltElseIfEmpty(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.AltElseIf{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.OpenParenthesisToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.CloseParenthesisToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.ColonToken, - }, - }, Cond: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "a"}, }, Stmt: &stmt.StmtList{}, }) - expected := ` elseif ($a ) :` + expected := `elseif($a):` actual := o.String() if expected != actual { @@ -4869,35 +2543,16 @@ func TestPrinterPrintAltElse(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.AltElse{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.ColonToken, - }, - }, Stmt: &stmt.StmtList{ Stmts: []node.Node{ &stmt.Expression{Expr: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "b"}, }}, }, }, }) - expected := ` else :$b` + expected := `else:$b;` actual := o.String() if expected != actual { @@ -4910,22 +2565,10 @@ func TestPrinterPrintAltElseEmpty(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.AltElse{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.ColonToken, - }, - }, Stmt: &stmt.StmtList{}, }) - expected := ` else :` + expected := `else:` actual := o.String() if expected != actual { @@ -4938,106 +2581,31 @@ func TestPrinterPrintAltFor(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.AltFor{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.OpenParenthesisToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.ForInitSemicolonToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.ForCondSemicolonToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.CloseParenthesisToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.ColonToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.EndforToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.SemiColonToken, - }, - &meta.Data{ - Type: meta.TokenType, - Value: "", - TokenName: meta.SemiColonToken, - }, - }, Init: []node.Node{ &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "a"}, }, }, Cond: []node.Node{ &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "b"}, }, }, Loop: []node.Node{ &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "c"}, }, }, Stmt: &stmt.StmtList{ Stmts: []node.Node{ &stmt.Expression{Expr: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "d"}, }}, }, }, }) - expected := ` for ($a ;$b ;$c ) :$d endfor ` + expected := `for($a;$b;$c):$d;endfor;` actual := o.String() if expected != actual { @@ -5050,100 +2618,25 @@ func TestPrinterPrintAltForeach(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.AltForeach{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.OpenParenthesisToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.AsToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.DoubleArrowToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.CloseParenthesisToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.ColonToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.EndforeachToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.SemiColonToken, - }, - &meta.Data{ - Type: meta.TokenType, - Value: "", - TokenName: meta.SemiColonToken, - }, - }, Expr: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "var"}, }, Key: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "key"}, }, Variable: &expr.Reference{Variable: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "val"}, }}, Stmt: &stmt.StmtList{ Stmts: []node.Node{ &stmt.Expression{Expr: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "d"}, }}, }, }, }) - expected := ` foreach ($var as$key =>&$val ) :$d endforeach ` + expected := `foreach($var as $key=>&$val):$d;endforeach;` actual := o.String() if expected != actual { @@ -5156,63 +2649,12 @@ func TestPrinterPrintAltIf(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.AltIf{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.OpenParenthesisToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.CloseParenthesisToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.ColonToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.EndifToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.SemiColonToken, - }, - &meta.Data{ - Type: meta.TokenType, - Value: "", - TokenName: meta.SemiColonToken, - }, - }, Cond: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "a"}, }, Stmt: &stmt.StmtList{ Stmts: []node.Node{ &stmt.Expression{Expr: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "d"}, }}, }, @@ -5220,25 +2662,11 @@ func TestPrinterPrintAltIf(t *testing.T) { ElseIf: []node.Node{ &stmt.AltElseIf{ Cond: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "b"}, }, Stmt: &stmt.StmtList{ Stmts: []node.Node{ &stmt.Expression{Expr: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "b"}, }}, }, @@ -5246,13 +2674,6 @@ func TestPrinterPrintAltIf(t *testing.T) { }, &stmt.AltElseIf{ Cond: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "c"}, }, Stmt: &stmt.StmtList{}, @@ -5262,13 +2683,6 @@ func TestPrinterPrintAltIf(t *testing.T) { Stmt: &stmt.StmtList{ Stmts: []node.Node{ &stmt.Expression{Expr: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "b"}, }}, }, @@ -5276,7 +2690,7 @@ func TestPrinterPrintAltIf(t *testing.T) { }, }) - expected := ` if ($a ) :$delseif($b):$belseif($c):else:$b endif ` + expected := `if($a):$d;elseif($b):$b;elseif($c):else:$b;endif;` actual := o.String() if expected != actual { @@ -5289,51 +2703,7 @@ func TestPrinterPrintStmtAltSwitch(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.AltSwitch{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.OpenParenthesisToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.CloseParenthesisToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.ColonToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.EndswitchToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.SemiColonToken, - }, - &meta.Data{ - Type: meta.TokenType, - Value: "", - TokenName: meta.SemiColonToken, - }, - }, Cond: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "var"}, }, CaseList: &stmt.CaseList{ @@ -5342,13 +2712,6 @@ func TestPrinterPrintStmtAltSwitch(t *testing.T) { Cond: &scalar.String{Value: "'a'"}, Stmts: []node.Node{ &stmt.Expression{Expr: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "a"}, }}, }, @@ -5357,13 +2720,6 @@ func TestPrinterPrintStmtAltSwitch(t *testing.T) { Cond: &scalar.String{Value: "'b'"}, Stmts: []node.Node{ &stmt.Expression{Expr: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "b"}, }}, }, @@ -5372,7 +2728,7 @@ func TestPrinterPrintStmtAltSwitch(t *testing.T) { }, }) - expected := ` switch ($var ) :case'a':$acase'b':$b endswitch ` + expected := `switch($var):case 'a':$a;case 'b':$b;endswitch;` actual := o.String() if expected != actual { @@ -5385,70 +2741,19 @@ func TestPrinterPrintAltWhile(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.AltWhile{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.OpenParenthesisToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.CloseParenthesisToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.ColonToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.EndwhileToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.SemiColonToken, - }, - &meta.Data{ - Type: meta.TokenType, - Value: "", - TokenName: meta.SemiColonToken, - }, - }, Cond: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "a"}, }, Stmt: &stmt.StmtList{ Stmts: []node.Node{ &stmt.Expression{Expr: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "b"}, }}, }, }, }) - expected := ` while ($a ) :$b endwhile ` + expected := `while($a):$b;endwhile;` actual := o.String() if expected != actual { @@ -5461,36 +2766,12 @@ func TestPrinterPrintStmtBreak(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.Break{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.SemiColonToken, - }, - &meta.Data{ - Type: meta.TokenType, - Value: "", - TokenName: meta.SemiColonToken, - }, - }, Expr: &scalar.Lnumber{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - }, Value: "1", }, }) - expected := " break 1 " + expected := "break 1;" actual := o.String() if expected != actual { @@ -5503,38 +2784,17 @@ func TestPrinterPrintStmtCase(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.Case{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - }, Cond: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "a"}, }, Stmts: []node.Node{ &stmt.Expression{Expr: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "a"}, }}, }, }) - expected := ` case$a:$a` + expected := `case $a:$a;` actual := o.String() if expected != actual { @@ -5547,27 +2807,13 @@ func TestPrinterPrintStmtCaseEmpty(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.Case{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - }, Cond: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "a"}, }, Stmts: []node.Node{}, }) - expected := " case$a:" + expected := "case $a:" actual := o.String() if expected != actual { @@ -5580,62 +2826,21 @@ func TestPrinterPrintStmtCatch(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.Catch{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.OpenParenthesisToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.CloseParenthesisToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.OpenCurlyBracesToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.CloseCurlyBracesToken, - }, - }, Types: []node.Node{ &name.Name{Parts: []node.Node{&name.NamePart{Value: "Exception"}}}, &name.FullyQualified{Parts: []node.Node{&name.NamePart{Value: "RuntimeException"}}}, }, Variable: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "e"}, }, Stmts: []node.Node{ &stmt.Expression{Expr: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "a"}, }}, }, }) - expected := ` catch (Exception|\RuntimeException$e ) {$a }` + expected := `catch(Exception|\RuntimeException$e){$a;}` actual := o.String() if expected != actual { @@ -5648,28 +2853,6 @@ func TestPrinterPrintStmtClassMethod(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.ClassMethod{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.FunctionToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.AmpersandToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.OpenParenthesisToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.CloseParenthesisToken, - }, - }, Modifiers: []node.Node{&node.Identifier{Value: "public"}}, ReturnsRef: true, MethodName: &node.Identifier{Value: "foo"}, @@ -5678,13 +2861,6 @@ func TestPrinterPrintStmtClassMethod(t *testing.T) { ByRef: true, VariableType: &node.Nullable{Expr: &name.Name{Parts: []node.Node{&name.NamePart{Value: "int"}}}}, Variable: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "a"}, }, DefaultValue: &expr.ConstFetch{Constant: &name.Name{Parts: []node.Node{&name.NamePart{Value: "null"}}}}, @@ -5692,56 +2868,23 @@ func TestPrinterPrintStmtClassMethod(t *testing.T) { &node.Parameter{ Variadic: true, Variable: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "b"}, }, }, }, ReturnType: &name.Name{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.ColonToken, - }, - }, Parts: []node.Node{&name.NamePart{Value: "void"}}, }, Stmt: &stmt.StmtList{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.CloseCurlyBracesToken, - }, - }, Stmts: []node.Node{ &stmt.Expression{Expr: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "a"}, }}, }, }, }) - expected := `public function &foo (?int&$a=null,...$b ) :void {$a }` + expected := `public function &foo(?int&$a=null,...$b):void{$a;}` actual := o.String() if expected != actual { @@ -5754,29 +2897,10 @@ func TestPrinterPrintStmtAbstractClassMethod(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.ClassMethod{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.FunctionToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.AmpersandToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.OpenParenthesisToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.CloseParenthesisToken, - }, + Modifiers: []node.Node{ + &node.Identifier{Value: "public"}, + &node.Identifier{Value: "static"}, }, - Modifiers: []node.Node{&node.Identifier{Value: "public"}}, ReturnsRef: true, MethodName: &node.Identifier{Value: "foo"}, Params: []node.Node{ @@ -5784,13 +2908,6 @@ func TestPrinterPrintStmtAbstractClassMethod(t *testing.T) { ByRef: true, VariableType: &node.Nullable{Expr: &name.Name{Parts: []node.Node{&name.NamePart{Value: "int"}}}}, Variable: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "a"}, }, DefaultValue: &expr.ConstFetch{Constant: &name.Name{Parts: []node.Node{&name.NamePart{Value: "null"}}}}, @@ -5798,31 +2915,17 @@ func TestPrinterPrintStmtAbstractClassMethod(t *testing.T) { &node.Parameter{ Variadic: true, Variable: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "b"}, }, }, }, ReturnType: &name.Name{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.ColonToken, - }, - }, Parts: []node.Node{&name.NamePart{Value: "void"}}, }, Stmt: &stmt.Nop{}, }) - expected := `public function &foo (?int&$a=null,...$b ) :void` + expected := `public static function &foo(?int&$a=null,...$b):void;` actual := o.String() if expected != actual { @@ -5835,43 +2938,12 @@ func TestPrinterPrintStmtClass(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.Class{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.ClassToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.OpenCurlyBracesToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.CloseCurlyBracesToken, - }, - }, Modifiers: []node.Node{&node.Identifier{Value: "abstract"}}, ClassName: &node.Identifier{Value: "Foo"}, Extends: &stmt.ClassExtends{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.ExtendsToken, - }, - }, ClassName: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Bar"}}}, }, Implements: &stmt.ClassImplements{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.ImplementsToken, - }, - }, InterfaceNames: []node.Node{ &name.Name{Parts: []node.Node{&name.NamePart{Value: "Baz"}}}, &name.Name{Parts: []node.Node{&name.NamePart{Value: "Quuz"}}}, @@ -5879,7 +2951,10 @@ func TestPrinterPrintStmtClass(t *testing.T) { }, Stmts: []node.Node{ &stmt.ClassConstList{ - Modifiers: []node.Node{&node.Identifier{Value: "public"}}, + Modifiers: []node.Node{ + &node.Identifier{Value: "public"}, + &node.Identifier{Value: "static"}, + }, Consts: []node.Node{ &stmt.Constant{ ConstantName: &node.Identifier{Value: "FOO"}, @@ -5890,7 +2965,7 @@ func TestPrinterPrintStmtClass(t *testing.T) { }, }) - expected := `abstract classFoo extendsBar implementsBaz,Quuz {publicconstFOO='bar' }` + expected := `abstract class Foo extends Bar implements Baz,Quuz{public static const FOO='bar';}` actual := o.String() if expected != actual { @@ -5903,82 +2978,25 @@ func TestPrinterPrintStmtAnonymousClass(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.Class{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.ClassToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.OpenCurlyBracesToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.CloseCurlyBracesToken, - }, - }, Modifiers: []node.Node{&node.Identifier{Value: "abstract"}}, ArgumentList: &node.ArgumentList{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.OpenParenthesisToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.CloseParenthesisToken, - }, - }, Arguments: []node.Node{ &node.Argument{ Expr: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "a"}, }, }, &node.Argument{ Expr: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "b"}, }, }, }, }, Extends: &stmt.ClassExtends{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.ExtendsToken, - }, - }, ClassName: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Bar"}}}, }, Implements: &stmt.ClassImplements{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.ImplementsToken, - }, - }, InterfaceNames: []node.Node{ &name.Name{Parts: []node.Node{&name.NamePart{Value: "Baz"}}}, &name.Name{Parts: []node.Node{&name.NamePart{Value: "Quuz"}}}, @@ -5997,7 +3015,7 @@ func TestPrinterPrintStmtAnonymousClass(t *testing.T) { }, }) - expected := `abstract class ($a,$b ) extendsBar implementsBaz,Quuz {publicconstFOO='bar' }` + expected := `abstract class($a,$b) extends Bar implements Baz,Quuz{public const FOO='bar';}` actual := o.String() if expected != actual { @@ -6010,23 +3028,6 @@ func TestPrinterPrintStmtClassConstList(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.ClassConstList{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.ConstToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.SemiColonToken, - }, - &meta.Data{ - Type: meta.TokenType, - Value: "", - TokenName: meta.SemiColonToken, - }, - }, Modifiers: []node.Node{&node.Identifier{Value: "public"}}, Consts: []node.Node{ &stmt.Constant{ @@ -6040,7 +3041,7 @@ func TestPrinterPrintStmtClassConstList(t *testing.T) { }, }) - expected := `public constFOO='a',BAR='b' ` + expected := `public const FOO='a',BAR='b';` actual := o.String() if expected != actual { @@ -6053,23 +3054,6 @@ func TestPrinterPrintStmtConstList(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.ConstList{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.SemiColonToken, - }, - &meta.Data{ - Type: meta.TokenType, - Value: "", - TokenName: meta.SemiColonToken, - }, - }, Consts: []node.Node{ &stmt.Constant{ ConstantName: &node.Identifier{Value: "FOO"}, @@ -6082,7 +3066,7 @@ func TestPrinterPrintStmtConstList(t *testing.T) { }, }) - expected := ` constFOO='a',BAR='b' ` + expected := `const FOO='a',BAR='b';` actual := o.String() if expected != actual { @@ -6095,18 +3079,11 @@ func TestPrinterPrintStmtConstant(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.Constant{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.EqualToken, - }, - }, ConstantName: &node.Identifier{Value: "FOO"}, Expr: &scalar.String{Value: "'BAR'"}, }) - expected := "FOO ='BAR'" + expected := "FOO='BAR'" actual := o.String() if expected != actual { @@ -6119,36 +3096,12 @@ func TestPrinterPrintStmtContinue(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.Continue{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.SemiColonToken, - }, - &meta.Data{ - Type: meta.TokenType, - Value: "", - TokenName: meta.SemiColonToken, - }, - }, Expr: &scalar.Lnumber{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - }, Value: "1", }, }) - expected := ` continue 1 ` + expected := `continue 1;` actual := o.String() if expected != actual { @@ -6161,23 +3114,6 @@ func TestPrinterPrintStmtDeclareStmts(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.Declare{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.OpenParenthesisToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.CloseParenthesisToken, - }, - }, Consts: []node.Node{ &stmt.Constant{ ConstantName: &node.Identifier{Value: "FOO"}, @@ -6191,7 +3127,7 @@ func TestPrinterPrintStmtDeclareStmts(t *testing.T) { }, }) - expected := ` declare (FOO='bar' ){}` + expected := `declare(FOO='bar'){;}` actual := o.String() if expected != actual { @@ -6204,23 +3140,6 @@ func TestPrinterPrintStmtDeclareExpr(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.Declare{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.OpenParenthesisToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.CloseParenthesisToken, - }, - }, Consts: []node.Node{ &stmt.Constant{ ConstantName: &node.Identifier{Value: "FOO"}, @@ -6230,7 +3149,7 @@ func TestPrinterPrintStmtDeclareExpr(t *testing.T) { Stmt: &stmt.Expression{Expr: &scalar.String{Value: "'bar'"}}, }) - expected := ` declare (FOO='bar' )'bar'` + expected := `declare(FOO='bar')'bar';` actual := o.String() if expected != actual { @@ -6252,7 +3171,7 @@ func TestPrinterPrintStmtDeclareNop(t *testing.T) { Stmt: &stmt.Nop{}, }) - expected := `declare(FOO='bar')` + expected := `declare(FOO='bar');` actual := o.String() if expected != actual { @@ -6265,28 +3184,14 @@ func TestPrinterPrintStmtDefalut(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.Default{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - }, Stmts: []node.Node{ &stmt.Expression{Expr: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "a"}, }}, }, }) - expected := ` default:$a` + expected := `default:$a;` actual := o.String() if expected != actual { @@ -6299,17 +3204,10 @@ func TestPrinterPrintStmtDefalutEmpty(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.Default{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - }, Stmts: []node.Node{}, }) - expected := ` default:` + expected := `default:` actual := o.String() if expected != actual { @@ -6322,54 +3220,15 @@ func TestPrinterPrintStmtDo_Expression(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.Do{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.WhileToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.OpenParenthesisToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.CloseParenthesisToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.SemiColonToken, - }, - &meta.Data{ - Type: meta.TokenType, - Value: "", - TokenName: meta.SemiColonToken, - }, - }, Cond: &scalar.Lnumber{Value: "1"}, Stmt: &stmt.Expression{ Expr: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "a"}, }, }, }) - expected := ` do$a while (1 ) ` + expected := `do $a;while(1);` actual := o.String() if expected != actual { @@ -6382,56 +3241,17 @@ func TestPrinterPrintStmtDo_StmtList(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.Do{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.WhileToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.OpenParenthesisToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.CloseParenthesisToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.SemiColonToken, - }, - &meta.Data{ - Type: meta.TokenType, - Value: "", - TokenName: meta.SemiColonToken, - }, - }, Cond: &scalar.Lnumber{Value: "1"}, Stmt: &stmt.StmtList{ Stmts: []node.Node{ &stmt.Expression{Expr: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "a"}, }}, }, }, }) - expected := ` do{$a} while (1 ) ` + expected := `do{$a;}while(1);` actual := o.String() if expected != actual { @@ -6439,58 +3259,49 @@ func TestPrinterPrintStmtDo_StmtList(t *testing.T) { } } -func TestPrinterPrintStmtEcho(t *testing.T) { +func TestPrinterPrintStmtEchoHtmlState(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrinter(o) + p.Print(&node.Root{ + Stmts: []node.Node{ + &stmt.Echo{ + Exprs: []node.Node{ + &expr.Variable{ + VarName: &node.Identifier{Value: "a"}, + }, + &expr.Variable{ + VarName: &node.Identifier{Value: "b"}, + }, + }, + }, + }, + }) + + expected := `$v ){}` + expected := `foreach($a as $k=>$v){;}` actual := o.String() if expected != actual { @@ -6947,38 +3536,6 @@ func TestPrinterPrintStmtFunction(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.Function{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.AmpersandToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.OpenParenthesisToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.CloseParenthesisToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.OpenCurlyBracesToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.CloseCurlyBracesToken, - }, - }, ReturnsRef: true, FunctionName: &node.Identifier{Value: "foo"}, Params: []node.Node{ @@ -6986,25 +3543,11 @@ func TestPrinterPrintStmtFunction(t *testing.T) { ByRef: true, Variadic: false, Variable: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "var"}, }, }, }, ReturnType: &name.FullyQualified{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.ColonToken, - }, - }, Parts: []node.Node{&name.NamePart{Value: "Foo"}}, }, Stmts: []node.Node{ @@ -7012,7 +3555,7 @@ func TestPrinterPrintStmtFunction(t *testing.T) { }, }) - expected := ` function &foo (&$var ) :\Foo { }` + expected := `function &foo(&$var):\Foo{;}` actual := o.String() if expected != actual { @@ -7025,48 +3568,17 @@ func TestPrinterPrintStmtGlobal(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.Global{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.SemiColonToken, - }, - &meta.Data{ - Type: meta.TokenType, - Value: "", - TokenName: meta.SemiColonToken, - }, - }, Vars: []node.Node{ &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "a"}, }, &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "b"}, }, }, }) - expected := ` global$a,$b ` + expected := `global$a,$b;` actual := o.String() if expected != actual { @@ -7079,27 +3591,10 @@ func TestPrinterPrintStmtGoto(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.Goto{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.SemiColonToken, - }, - &meta.Data{ - Type: meta.TokenType, - Value: "", - TokenName: meta.SemiColonToken, - }, - }, Label: &node.Identifier{Value: "FOO"}, }) - expected := ` gotoFOO ` + expected := `goto FOO;` actual := o.String() if expected != actual { @@ -7112,38 +3607,6 @@ func TestPrinterPrintStmtGroupUse(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.GroupUse{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NsSeparatorToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.OpenCurlyBracesToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.CloseCurlyBracesToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.SemiColonToken, - }, - &meta.Data{ - Type: meta.TokenType, - Value: "", - TokenName: meta.SemiColonToken, - }, - }, UseType: &node.Identifier{Value: "function"}, Prefix: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Foo"}}}, UseList: []node.Node{ @@ -7157,7 +3620,7 @@ func TestPrinterPrintStmtGroupUse(t *testing.T) { }, }) - expected := ` usefunctionFoo \ {BarasBaz,Quuz } ` + expected := `use function Foo\{Bar as Baz,Quuz};` actual := o.String() if expected != actual { @@ -7169,37 +3632,9 @@ func TestPrinterPrintHaltCompiler(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&stmt.HaltCompiler{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.OpenParenthesisToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.CloseParenthesisToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.SemiColonToken, - }, - &meta.Data{ - Type: meta.TokenType, - Value: "", - TokenName: meta.SemiColonToken, - }, - }, - }) + p.Print(&stmt.HaltCompiler{}) - expected := ` __halt_compiler ( ) ` + expected := `__halt_compiler();` actual := o.String() if expected != actual { @@ -7212,68 +3647,23 @@ func TestPrinterPrintIfExpression(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.If{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.OpenParenthesisToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.CloseParenthesisToken, - }, - }, Cond: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "a"}, }, Stmt: &stmt.Expression{ Expr: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "b"}, }, }, ElseIf: []node.Node{ &stmt.ElseIf{ Cond: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "c"}, }, Stmt: &stmt.StmtList{ Stmts: []node.Node{ &stmt.Expression{ Expr: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "d"}, }, }, @@ -7282,13 +3672,6 @@ func TestPrinterPrintIfExpression(t *testing.T) { }, &stmt.ElseIf{ Cond: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "e"}, }, Stmt: &stmt.Nop{}, @@ -7297,20 +3680,13 @@ func TestPrinterPrintIfExpression(t *testing.T) { Else: &stmt.Else{ Stmt: &stmt.Expression{ Expr: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "f"}, }, }, }, }) - expected := ` if ($a )$belseif($c){$d}elseif($e)else$f` + expected := `if($a)$b;elseif($c){$d;}elseif($e);else $f;` actual := o.String() if expected != actual { @@ -7323,44 +3699,13 @@ func TestPrinterPrintIfStmtList(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.If{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.OpenParenthesisToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.CloseParenthesisToken, - }, - }, Cond: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "a"}, }, Stmt: &stmt.StmtList{ Stmts: []node.Node{ &stmt.Expression{ Expr: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "b"}, }, }, @@ -7368,7 +3713,7 @@ func TestPrinterPrintIfStmtList(t *testing.T) { }, }) - expected := ` if ($a ){$b}` + expected := `if($a){$b;}` actual := o.String() if expected != actual { @@ -7382,19 +3727,12 @@ func TestPrinterPrintIfNop(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.If{ Cond: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "a"}, }, Stmt: &stmt.Nop{}, }) - expected := `if($a)` + expected := `if($a);` actual := o.String() if expected != actual { @@ -7406,18 +3744,15 @@ func TestPrinterPrintInlineHtml(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&stmt.InlineHtml{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, + p.Print(&node.Root{ + Stmts: []node.Node{ + &stmt.InlineHtml{ + Value: "test", }, }, - Value: "test", }) - expected := ` test` + expected := `test` actual := o.String() if expected != actual { @@ -7430,32 +3765,8 @@ func TestPrinterPrintInterface(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.Interface{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.OpenCurlyBracesToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.CloseCurlyBracesToken, - }, - }, InterfaceName: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Foo"}}}, Extends: &stmt.InterfaceExtends{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.ExtendsToken, - }, - }, InterfaceNames: []node.Node{ &name.Name{Parts: []node.Node{&name.NamePart{Value: "Bar"}}}, &name.Name{Parts: []node.Node{&name.NamePart{Value: "Baz"}}}, @@ -7469,13 +3780,6 @@ func TestPrinterPrintInterface(t *testing.T) { Stmt: &stmt.StmtList{ Stmts: []node.Node{ &stmt.Expression{Expr: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "a"}, }}, }, @@ -7484,7 +3788,7 @@ func TestPrinterPrintInterface(t *testing.T) { }, }) - expected := ` interfaceFoo extendsBar,Baz {publicfunctionfoo(){$a} }` + expected := `interface Foo extends Bar,Baz{public function foo(){$a;}}` actual := o.String() if expected != actual { @@ -7497,17 +3801,10 @@ func TestPrinterPrintLabel(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.Label{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.ColonToken, - }, - }, LabelName: &node.Identifier{Value: "FOO"}, }) - expected := `FOO :` + expected := `FOO:` actual := o.String() if expected != actual { @@ -7520,27 +3817,10 @@ func TestPrinterPrintNamespace(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.Namespace{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.SemiColonToken, - }, - &meta.Data{ - Type: meta.TokenType, - Value: "", - TokenName: meta.SemiColonToken, - }, - }, NamespaceName: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Foo"}}}, }) - expected := ` namespaceFoo ` + expected := `namespace Foo;` actual := o.String() if expected != actual { @@ -7553,39 +3833,15 @@ func TestPrinterPrintNamespaceWithStmts(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.Namespace{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.OpenCurlyBracesToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.CloseCurlyBracesToken, - }, - }, NamespaceName: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Foo"}}}, Stmts: []node.Node{ &stmt.Expression{Expr: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "a"}, }}, }, }) - expected := ` namespaceFoo {$a }` + expected := `namespace Foo{$a;}` actual := o.String() if expected != actual { @@ -7597,22 +3853,9 @@ func TestPrinterPrintNop(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&stmt.Nop{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - &meta.Data{ - Type: meta.TokenType, - Value: ";", - TokenName: meta.NodeStart, - }, - }, - }) + p.Print(&stmt.Nop{}) - expected := ` ;` + expected := `;` actual := o.String() if expected != actual { @@ -7625,18 +3868,6 @@ func TestPrinterPrintPropertyList(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.PropertyList{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.SemiColonToken, - }, - &meta.Data{ - Type: meta.TokenType, - Value: "", - TokenName: meta.SemiColonToken, - }, - }, Modifiers: []node.Node{ &node.Identifier{Value: "public"}, &node.Identifier{Value: "static"}, @@ -7644,32 +3875,19 @@ func TestPrinterPrintPropertyList(t *testing.T) { Properties: []node.Node{ &stmt.Property{ Variable: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "a"}, }, + Expr: &scalar.String{Value: "'a'"}, }, &stmt.Property{ Variable: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "b"}, }, }, }, }) - expected := `publicstatic$a,$b ` + expected := `public static $a='a',$b;` actual := o.String() if expected != actual { @@ -7682,13 +3900,6 @@ func TestPrinterPrintProperty(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.Property{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.EqualToken, - }, - }, Variable: &expr.Variable{ Meta: meta.Collection{ &meta.Data{ @@ -7702,7 +3913,7 @@ func TestPrinterPrintProperty(t *testing.T) { Expr: &scalar.Lnumber{Value: "1"}, }) - expected := `$a =1` + expected := `$a=1` actual := o.String() if expected != actual { @@ -7715,27 +3926,10 @@ func TestPrinterPrintReturn(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.Return{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.SemiColonToken, - }, - &meta.Data{ - Type: meta.TokenType, - Value: "", - TokenName: meta.SemiColonToken, - }, - }, Expr: &scalar.Lnumber{Value: "1"}, }) - expected := ` return1 ` + expected := `return 1;` actual := o.String() if expected != actual { @@ -7748,27 +3942,13 @@ func TestPrinterPrintStaticVar(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.StaticVar{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.EqualToken, - }, - }, Variable: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "a"}, }, Expr: &scalar.Lnumber{Value: "1"}, }) - expected := `$a =1` + expected := `$a=1` actual := o.String() if expected != actual { @@ -7781,52 +3961,21 @@ func TestPrinterPrintStatic(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.Static{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.SemiColonToken, - }, - &meta.Data{ - Type: meta.TokenType, - Value: "", - TokenName: meta.SemiColonToken, - }, - }, Vars: []node.Node{ &stmt.StaticVar{ Variable: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "a"}, }, }, &stmt.StaticVar{ Variable: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "b"}, }, }, }, }) - expected := ` static$a,$b ` + expected := `static$a,$b;` actual := o.String() if expected != actual { @@ -7839,43 +3988,17 @@ func TestPrinterPrintStmtList(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.StmtList{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.CloseCurlyBracesToken, - }, - }, Stmts: []node.Node{ &stmt.Expression{Expr: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "a"}, }}, &stmt.Expression{Expr: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "b"}, }}, }, }) - expected := ` {$a$b }` + expected := `{$a;$b;}` actual := o.String() if expected != actual { @@ -7888,51 +4011,18 @@ func TestPrinterPrintStmtListNested(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.StmtList{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.CloseCurlyBracesToken, - }, - }, Stmts: []node.Node{ &stmt.Expression{Expr: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "a"}, }}, &stmt.StmtList{ Stmts: []node.Node{ &stmt.Expression{Expr: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "b"}, }}, &stmt.StmtList{ Stmts: []node.Node{ &stmt.Expression{Expr: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "c"}, }}, }, @@ -7942,7 +4032,7 @@ func TestPrinterPrintStmtListNested(t *testing.T) { }, }) - expected := ` {$a{$b{$c}} }` + expected := `{$a;{$b;{$c;}}}` actual := o.String() if expected != actual { @@ -7955,58 +4045,15 @@ func TestPrinterPrintStmtSwitch(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.Switch{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.OpenParenthesisToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.CloseParenthesisToken, - }, - }, Cond: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "var"}, }, CaseList: &stmt.CaseList{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.OpenCurlyBracesToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.CloseCurlyBracesToken, - }, - }, Cases: []node.Node{ &stmt.Case{ Cond: &scalar.String{Value: "'a'"}, Stmts: []node.Node{ &stmt.Expression{Expr: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "a"}, }}, }, @@ -8015,13 +4062,6 @@ func TestPrinterPrintStmtSwitch(t *testing.T) { Cond: &scalar.String{Value: "'b'"}, Stmts: []node.Node{ &stmt.Expression{Expr: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "b"}, }}, }, @@ -8030,7 +4070,7 @@ func TestPrinterPrintStmtSwitch(t *testing.T) { }, }) - expected := ` switch ($var ) {case'a':$acase'b':$b }` + expected := `switch($var){case 'a':$a;case 'b':$b;}` actual := o.String() if expected != actual { @@ -8043,36 +4083,12 @@ func TestPrinterPrintStmtThrow(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.Throw{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.SemiColonToken, - }, - &meta.Data{ - Type: meta.TokenType, - Value: "", - TokenName: meta.SemiColonToken, - }, - }, Expr: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "var"}, }, }) - expected := ` throw$var ` + expected := `throw $var;` actual := o.String() if expected != actual { @@ -8085,18 +4101,6 @@ func TestPrinterPrintStmtTraitAdaptationList(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.TraitAdaptationList{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.CloseCurlyBracesToken, - }, - }, Adaptations: []node.Node{ &stmt.TraitUseAlias{ Ref: &stmt.TraitMethodRef{ @@ -8108,7 +4112,7 @@ func TestPrinterPrintStmtTraitAdaptationList(t *testing.T) { }, }) - expected := ` {Foo::aasb }` + expected := `{Foo::a as b;}` actual := o.String() if expected != actual { @@ -8137,18 +4141,11 @@ func TestPrinterPrintStmtTraitMethodRefFull(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.TraitMethodRef{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.PaamayimNekudotayimToken, - }, - }, Trait: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Foo"}}}, Method: &node.Identifier{Value: "a"}, }) - expected := `Foo ::a` + expected := `Foo::a` actual := o.String() if expected != actual { @@ -8161,23 +4158,6 @@ func TestPrinterPrintStmtTraitUseAlias(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.TraitUseAlias{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.AsToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.SemiColonToken, - }, - &meta.Data{ - Type: meta.TokenType, - Value: "", - TokenName: meta.SemiColonToken, - }, - }, Ref: &stmt.TraitMethodRef{ Trait: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Foo"}}}, Method: &node.Identifier{Value: "a"}, @@ -8186,7 +4166,7 @@ func TestPrinterPrintStmtTraitUseAlias(t *testing.T) { Alias: &node.Identifier{Value: "b"}, }) - expected := `Foo::a aspublicb ` + expected := `Foo::a as public b;` actual := o.String() if expected != actual { @@ -8199,23 +4179,6 @@ func TestPrinterPrintStmtTraitUsePrecedence(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.TraitUsePrecedence{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.InsteadofToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.SemiColonToken, - }, - &meta.Data{ - Type: meta.TokenType, - Value: "", - TokenName: meta.SemiColonToken, - }, - }, Ref: &stmt.TraitMethodRef{ Trait: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Foo"}}}, Method: &node.Identifier{Value: "a"}, @@ -8226,7 +4189,7 @@ func TestPrinterPrintStmtTraitUsePrecedence(t *testing.T) { }, }) - expected := `Foo::a insteadofBar,Baz ` + expected := `Foo::a insteadof Bar,Baz;` actual := o.String() if expected != actual { @@ -8239,34 +4202,14 @@ func TestPrinterPrintStmtTraitUse(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.TraitUse{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - }, Traits: []node.Node{ &name.Name{Parts: []node.Node{&name.NamePart{Value: "Foo"}}}, &name.Name{Parts: []node.Node{&name.NamePart{Value: "Bar"}}}, }, - TraitAdaptationList: &stmt.Nop{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - &meta.Data{ - Type: meta.TokenType, - Value: "", - TokenName: meta.NodeStart, - }, - }, - }, + TraitAdaptationList: &stmt.Nop{}, }) - expected := ` useFoo,Bar ` + expected := `use Foo,Bar;` actual := o.String() if expected != actual { @@ -8279,30 +4222,11 @@ func TestPrinterPrintStmtTraitAdaptations(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.TraitUse{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - }, Traits: []node.Node{ &name.Name{Parts: []node.Node{&name.NamePart{Value: "Foo"}}}, &name.Name{Parts: []node.Node{&name.NamePart{Value: "Bar"}}}, }, TraitAdaptationList: &stmt.TraitAdaptationList{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.CloseCurlyBracesToken, - }, - }, Adaptations: []node.Node{ &stmt.TraitUseAlias{ Ref: &stmt.TraitMethodRef{ @@ -8315,7 +4239,7 @@ func TestPrinterPrintStmtTraitAdaptations(t *testing.T) { }, }) - expected := ` useFoo,Bar {Foo::aasb }` + expected := `use Foo,Bar{Foo::a as b;}` actual := o.String() if expected != actual { @@ -8328,23 +4252,6 @@ func TestPrinterPrintTrait(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.Trait{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.OpenCurlyBracesToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.CloseCurlyBracesToken, - }, - }, TraitName: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Foo"}}}, Stmts: []node.Node{ &stmt.ClassMethod{ @@ -8354,13 +4261,6 @@ func TestPrinterPrintTrait(t *testing.T) { Stmt: &stmt.StmtList{ Stmts: []node.Node{ &stmt.Expression{Expr: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "a"}, }}, }, @@ -8369,7 +4269,7 @@ func TestPrinterPrintTrait(t *testing.T) { }, }) - expected := ` traitFoo {publicfunctionfoo(){$a} }` + expected := `trait Foo{public function foo(){$a;}}` actual := o.String() if expected != actual { @@ -8382,32 +4282,8 @@ func TestPrinterPrintStmtTry(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.Try{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.OpenCurlyBracesToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.CloseCurlyBracesToken, - }, - }, Stmts: []node.Node{ &stmt.Expression{Expr: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "a"}, }}, }, @@ -8418,24 +4294,10 @@ func TestPrinterPrintStmtTry(t *testing.T) { &name.FullyQualified{Parts: []node.Node{&name.NamePart{Value: "RuntimeException"}}}, }, Variable: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "e"}, }, Stmts: []node.Node{ &stmt.Expression{Expr: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "b"}, }}, }, @@ -8448,7 +4310,7 @@ func TestPrinterPrintStmtTry(t *testing.T) { }, }) - expected := ` try {$a }catch(Exception|\RuntimeException$e){$b}finally{}` + expected := `try{$a;}catch(Exception|\RuntimeException$e){$b;}finally{;}` actual := o.String() if expected != actual { @@ -8461,58 +4323,17 @@ func TestPrinterPrintStmtUnset(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.Unset{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.OpenParenthesisToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.CloseParenthesisToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.SemiColonToken, - }, - &meta.Data{ - Type: meta.TokenType, - Value: "", - TokenName: meta.SemiColonToken, - }, - }, Vars: []node.Node{ &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "a"}, }, &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "b"}, }, }, }) - expected := ` unset ($a,$b ) ` + expected := `unset($a,$b);` actual := o.String() if expected != actual { @@ -8525,23 +4346,6 @@ func TestPrinterPrintStmtUseList(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.UseList{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.SemiColonToken, - }, - &meta.Data{ - Type: meta.TokenType, - Value: "", - TokenName: meta.SemiColonToken, - }, - }, UseType: &node.Identifier{Value: "function"}, Uses: []node.Node{ &stmt.Use{ @@ -8554,7 +4358,7 @@ func TestPrinterPrintStmtUseList(t *testing.T) { }, }) - expected := ` usefunctionFooasBar,Baz ` + expected := `use function Foo as Bar,Baz;` actual := o.String() if expected != actual { @@ -8567,19 +4371,12 @@ func TestPrinterPrintUse(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.Use{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.AsToken, - }, - }, UseType: &node.Identifier{Value: "function"}, Use: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Foo"}}}, Alias: &node.Identifier{Value: "Bar"}, }) - expected := `functionFoo asBar` + expected := `function Foo as Bar` actual := o.String() if expected != actual { @@ -8592,50 +4389,19 @@ func TestPrinterPrintWhileStmtList(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.While{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.NodeStart, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.OpenParenthesisToken, - }, - &meta.Data{ - Type: meta.WhiteSpaceType, - Value: " ", - TokenName: meta.CloseParenthesisToken, - }, - }, Cond: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "a"}, }, Stmt: &stmt.StmtList{ Stmts: []node.Node{ &stmt.Expression{Expr: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, - }, - }, VarName: &node.Identifier{Value: "a"}, }}, }, }, }) - expected := ` while ($a ){$a}` + expected := `while($a){$a;}` actual := o.String() if expected != actual { From b3800a2595a447704e99a73dc62fbee128da72a4 Mon Sep 17 00:00:00 2001 From: z7zmey Date: Wed, 13 Feb 2019 22:18:07 +0200 Subject: [PATCH 112/117] rename meta to freefloating; refactoring --- freefloating/position_string.go | 16 + freefloating/string.go | 112 + meta/collection.go | 168 -- meta/collection_test.go | 648 ----- meta/data.go | 17 - meta/data_test.go | 21 - meta/tokenName.go | 85 - meta/tokenName_string.go | 16 - meta/tokenName_test.go | 29 - meta/type.go | 11 - meta/type_string.go | 16 - meta/type_test.go | 29 - node/expr/assign/n_assign.go | 19 +- node/expr/assign/n_assign_ref.go | 19 +- node/expr/assign/n_bitwise_and.go | 19 +- node/expr/assign/n_bitwise_or.go | 19 +- node/expr/assign/n_bitwise_xor.go | 19 +- node/expr/assign/n_concat.go | 19 +- node/expr/assign/n_div.go | 19 +- node/expr/assign/n_minus.go | 19 +- node/expr/assign/n_mod.go | 19 +- node/expr/assign/n_mul.go | 19 +- node/expr/assign/n_plus.go | 19 +- node/expr/assign/n_pow.go | 19 +- node/expr/assign/n_shift_left.go | 19 +- node/expr/assign/n_shift_right.go | 19 +- node/expr/assign/t_assign_op_test.go | 81 +- node/expr/assign/t_freefloating_test.go | 81 + node/expr/assign/t_meta_test.go | 49 - node/expr/assign/t_position_test.go | 4 +- node/expr/assign/t_visitor_test.go | 53 +- node/expr/binary/n_bitwise_and.go | 19 +- node/expr/binary/n_bitwise_or.go | 19 +- node/expr/binary/n_bitwise_xor.go | 19 +- node/expr/binary/n_boolean_and.go | 19 +- node/expr/binary/n_boolean_or.go | 19 +- node/expr/binary/n_coalesce.go | 19 +- node/expr/binary/n_concat.go | 19 +- node/expr/binary/n_div.go | 19 +- node/expr/binary/n_equal.go | 19 +- node/expr/binary/n_greater.go | 19 +- node/expr/binary/n_greater_or_equal.go | 19 +- node/expr/binary/n_identical.go | 19 +- node/expr/binary/n_logical_and.go | 19 +- node/expr/binary/n_logical_or.go | 19 +- node/expr/binary/n_logical_xor.go | 19 +- node/expr/binary/n_minus.go | 19 +- node/expr/binary/n_mod.go | 19 +- node/expr/binary/n_mul.go | 19 +- node/expr/binary/n_not_equal.go | 19 +- node/expr/binary/n_not_identical.go | 19 +- node/expr/binary/n_plus.go | 19 +- node/expr/binary/n_pow.go | 19 +- node/expr/binary/n_shift_left.go | 19 +- node/expr/binary/n_shift_right.go | 19 +- node/expr/binary/n_smaller.go | 19 +- node/expr/binary/n_smaller_or_equal.go | 19 +- node/expr/binary/n_spaceship.go | 19 +- node/expr/binary/t_binary_op_test.go | 119 +- node/expr/binary/t_freefloating_test.go | 117 + node/expr/binary/t_meta_test.go | 61 - node/expr/binary/t_position_test.go | 4 +- node/expr/binary/t_visitor_test.go | 77 +- node/expr/cast/n_cast_array.go | 15 +- node/expr/cast/n_cast_bool.go | 15 +- node/expr/cast/n_cast_double.go | 15 +- node/expr/cast/n_cast_int.go | 15 +- node/expr/cast/n_cast_object.go | 15 +- node/expr/cast/n_cast_string.go | 15 +- node/expr/cast/n_cast_unset.go | 15 +- node/expr/cast/t_cast_test.go | 59 +- node/expr/cast/t_freefloating_test.go | 57 + node/expr/cast/t_meta_test.go | 41 - node/expr/cast/t_position_test.go | 4 +- node/expr/cast/t_visitor_test.go | 36 +- node/expr/n_array.go | 15 +- node/expr/n_array_dim_fetch.go | 19 +- node/expr/n_array_item.go | 19 +- node/expr/n_bitwise_not.go | 15 +- node/expr/n_boolean_not.go | 15 +- node/expr/n_class_const_fetch.go | 9 +- node/expr/n_clone.go | 15 +- node/expr/n_closure.go | 9 +- node/expr/n_closure_use.go | 15 +- node/expr/n_const_fetch.go | 15 +- node/expr/n_empty.go | 15 +- node/expr/n_error_suppress.go | 15 +- node/expr/n_eval.go | 15 +- node/expr/n_exit.go | 17 +- node/expr/n_function_call.go | 9 +- node/expr/n_include.go | 15 +- node/expr/n_include_once.go | 15 +- node/expr/n_instance_of.go | 19 +- node/expr/n_isset.go | 15 +- node/expr/n_list.go | 15 +- node/expr/n_method_call.go | 9 +- node/expr/n_new.go | 9 +- node/expr/n_post_dec.go | 15 +- node/expr/n_post_inc.go | 15 +- node/expr/n_pre_dec.go | 15 +- node/expr/n_pre_inc.go | 15 +- node/expr/n_print.go | 15 +- node/expr/n_property_fetch.go | 19 +- node/expr/n_reference.go | 15 +- node/expr/n_require.go | 15 +- node/expr/n_require_once.go | 15 +- node/expr/n_shell_exec.go | 15 +- node/expr/n_short_array.go | 15 +- node/expr/n_short_list.go | 15 +- node/expr/n_static_call.go | 9 +- node/expr/n_static_property_fetch.go | 19 +- node/expr/n_ternary.go | 23 +- node/expr/n_unary_minus.go | 15 +- node/expr/n_unary_plus.go | 15 +- node/expr/n_variable.go | 15 +- node/expr/n_yield.go | 19 +- node/expr/n_yield_from.go | 15 +- node/expr/t_array_dim_fetch_test.go | 30 +- node/expr/t_array_test.go | 20 +- node/expr/t_bitwise_not_test.go | 6 +- node/expr/t_boolean_not_test.go | 6 +- node/expr/t_class_const_fetch_test.go | 10 +- node/expr/t_clone_test.go | 10 +- node/expr/t_closure_test.go | 16 +- node/expr/t_const_fetch_test.go | 14 +- node/expr/t_empty_test.go | 6 +- node/expr/t_error_supress_test.go | 6 +- node/expr/t_eval_test.go | 6 +- node/expr/t_exit_test.go | 32 +- node/expr/t_freefloating_test.go | 162 ++ node/expr/t_function_call_test.go | 22 +- node/expr/t_inc_dec_test.go | 18 +- node/expr/t_include_test.go | 18 +- node/expr/t_instance_of_test.go | 14 +- node/expr/t_isset_test.go | 10 +- node/expr/t_list_test.go | 32 +- node/expr/t_meta_test.go | 76 - node/expr/t_method_call_test.go | 6 +- node/expr/t_new_test.go | 16 +- node/expr/t_position_test.go | 4 +- node/expr/t_print_test.go | 6 +- node/expr/t_property_fetch_test.go | 6 +- node/expr/t_reference_test.go | 6 +- node/expr/t_shell_exec_test.go | 6 +- node/expr/t_short_array_test.go | 20 +- node/expr/t_short_list_test.go | 14 +- node/expr/t_static_call_test.go | 22 +- node/expr/t_static_property_fetch_test.go | 14 +- node/expr/t_ternary_test.go | 18 +- node/expr/t_unary_test.go | 10 +- node/expr/t_variable_test.go | 10 +- node/expr/t_visitor_test.go | 102 +- node/expr/t_yield_test.go | 24 +- node/n_argument.go | 23 +- node/n_argument_list.go | 15 +- node/n_identifier.go | 15 +- node/n_nullable.go | 15 +- node/n_parameter.go | 9 +- node/n_root.go | 15 +- node/name/n_fully_qualified.go | 15 +- node/name/n_name.go | 15 +- node/name/n_name_part.go | 15 +- node/name/n_relative.go | 15 +- node/name/t_freefloating_test.go | 48 + node/name/t_meta_test.go | 38 - node/name/t_name_test.go | 35 +- node/name/t_position_test.go | 4 +- node/name/t_visitor_test.go | 26 +- node/node.go | 4 +- node/scalar/node_dnumber.go | 15 +- node/scalar/node_encapsed.go | 15 +- node/scalar/node_encapsed_string_part.go | 15 +- node/scalar/node_heredoc.go | 19 +- node/scalar/node_lnumber.go | 15 +- node/scalar/node_magic_constant.go | 15 +- node/scalar/node_string.go | 15 +- node/scalar/t_encapsed_test.go | 34 +- node/scalar/t_freefloating_test.go | 57 + node/scalar/t_heredoc_test.go | 22 +- node/scalar/t_magic_constant_test.go | 6 +- node/scalar/t_meta_test.go | 41 - node/scalar/t_numbers_test.go | 45 +- node/scalar/t_position_test.go | 4 +- node/scalar/t_string_test.go | 22 +- node/stmt/n_alt_else.go | 15 +- node/stmt/n_alt_else_if.go | 19 +- node/stmt/n_alt_for.go | 27 +- node/stmt/n_alt_foreach.go | 27 +- node/stmt/n_alt_if.go | 27 +- node/stmt/n_alt_switch.go | 19 +- node/stmt/n_alt_while.go | 19 +- node/stmt/n_break.go | 15 +- node/stmt/n_case.go | 19 +- node/stmt/n_case_list.go | 15 +- node/stmt/n_catch.go | 23 +- node/stmt/n_class.go | 9 +- node/stmt/n_class_const_list.go | 19 +- node/stmt/n_class_extends.go | 15 +- node/stmt/n_class_implements.go | 9 +- node/stmt/n_class_method.go | 9 +- node/stmt/n_const_list.go | 15 +- node/stmt/n_constant.go | 9 +- node/stmt/n_continue.go | 15 +- node/stmt/n_declare.go | 23 +- node/stmt/n_default.go | 15 +- node/stmt/n_do.go | 19 +- node/stmt/n_echo.go | 15 +- node/stmt/n_else.go | 15 +- node/stmt/n_else_if.go | 19 +- node/stmt/n_expression.go | 15 +- node/stmt/n_finally.go | 15 +- node/stmt/n_for.go | 27 +- node/stmt/n_foreach.go | 27 +- node/stmt/n_function.go | 9 +- node/stmt/n_global.go | 15 +- node/stmt/n_goto.go | 15 +- node/stmt/n_group_use.go | 23 +- node/stmt/n_halt_compiler.go | 10 +- node/stmt/n_if.go | 27 +- node/stmt/n_inline_html.go | 15 +- node/stmt/n_interface.go | 9 +- node/stmt/n_interface_extends.go | 9 +- node/stmt/n_label.go | 15 +- node/stmt/n_namespace.go | 9 +- node/stmt/n_nop.go | 10 +- node/stmt/n_property.go | 9 +- node/stmt/n_property_list.go | 19 +- node/stmt/n_return.go | 15 +- node/stmt/n_static.go | 15 +- node/stmt/n_static_var.go | 19 +- node/stmt/n_stmt_list.go | 15 +- node/stmt/n_switch.go | 19 +- node/stmt/n_throw.go | 15 +- node/stmt/n_trait.go | 9 +- node/stmt/n_trait_adaptation_list.go | 15 +- node/stmt/n_trait_method_ref.go | 19 +- node/stmt/n_trait_use.go | 9 +- node/stmt/n_trait_use_alias.go | 23 +- node/stmt/n_trait_use_precedence.go | 19 +- node/stmt/n_try.go | 23 +- node/stmt/n_unset.go | 15 +- node/stmt/n_use.go | 23 +- node/stmt/n_use_list.go | 19 +- node/stmt/n_while.go | 19 +- node/stmt/t_alt_if_test.go | 39 +- node/stmt/t_class_const_list_test.go | 8 +- node/stmt/t_class_method_test.go | 20 +- node/stmt/t_class_test.go | 24 +- node/stmt/t_const_list_test.go | 6 +- node/stmt/t_continue_test.go | 14 +- node/stmt/t_declare_test.go | 14 +- node/stmt/t_do_test.go | 6 +- node/stmt/t_echo_test.go | 10 +- node/stmt/t_expression_test.go | 6 +- node/stmt/t_for_test.go | 10 +- node/stmt/t_foreach_test.go | 30 +- node/stmt/t_freefloating_test.go | 216 ++ node/stmt/t_function_test.go | 20 +- node/stmt/t_global_test.go | 10 +- node/stmt/t_goto_label_test.go | 6 +- node/stmt/t_halt_compiler_test.go | 6 +- node/stmt/t_if_test.go | 22 +- node/stmt/t_inline_html_test.go | 6 +- node/stmt/t_interface_test.go | 14 +- node/stmt/t_meta_test.go | 94 - node/stmt/t_namespace_test.go | 14 +- node/stmt/t_position_test.go | 4 +- node/stmt/t_property_list_test.go | 14 +- node/stmt/t_static_var_test.go | 14 +- node/stmt/t_switch_case_default_test.go | 18 +- node/stmt/t_throw_test.go | 6 +- node/stmt/t_trait_test.go | 6 +- node/stmt/t_trait_use_test.go | 26 +- node/stmt/t_try_catch_finnaly_test.go | 24 +- node/stmt/t_unset_test.go | 12 +- node/stmt/t_use_test.go | 48 +- node/stmt/t_visitor_test.go | 129 +- node/stmt/t_while_break_test.go | 14 +- node/t_freefloating_test.go | 53 + node/t_meta_test.go | 38 - node/t_node_test.go | 33 +- node/t_position_test.go | 4 +- node/t_visitor_test.go | 36 +- php5/parser.go | 214 +- php5/php5.go | 3040 ++++++++++----------- php5/php5.y | 1995 +++++++------- php5/php5_test.go | 36 +- php7/parser.go | 207 +- php7/php7.go | 2353 ++++++++-------- php7/php7.y | 1573 ++++++----- php7/php7_test.go | 31 +- printer/printer.go | 1522 ++++++----- printer/printer_parsed_php5_test.go | 9 +- printer/printer_parsed_php7_test.go | 9 +- printer/printer_test.go | 36 +- scanner/lexer.go | 18 +- scanner/scanner.go | 24 +- scanner/scanner.l | 25 +- scanner/scanner_test.go | 387 ++- scanner/token.go | 30 +- scanner/token_test.go | 17 +- visitor/dumper.go | 11 +- visitor/dumper_test.go | 109 +- visitor/go_dumper.go | 74 +- visitor/go_dumper_test.go | 477 ++-- visitor/json_dumper.go | 59 +- visitor/json_dumper_test.go | 2 +- visitor/pretty_json_dumper.go | 57 +- visitor/pretty_json_dumper_test.go | 429 +-- 309 files changed, 9671 insertions(+), 10115 deletions(-) create mode 100644 freefloating/position_string.go create mode 100644 freefloating/string.go delete mode 100644 meta/collection.go delete mode 100644 meta/collection_test.go delete mode 100644 meta/data.go delete mode 100644 meta/data_test.go delete mode 100644 meta/tokenName.go delete mode 100644 meta/tokenName_string.go delete mode 100644 meta/tokenName_test.go delete mode 100644 meta/type.go delete mode 100644 meta/type_string.go delete mode 100644 meta/type_test.go create mode 100644 node/expr/assign/t_freefloating_test.go delete mode 100644 node/expr/assign/t_meta_test.go create mode 100644 node/expr/binary/t_freefloating_test.go delete mode 100644 node/expr/binary/t_meta_test.go create mode 100644 node/expr/cast/t_freefloating_test.go delete mode 100644 node/expr/cast/t_meta_test.go create mode 100644 node/expr/t_freefloating_test.go delete mode 100644 node/expr/t_meta_test.go create mode 100644 node/name/t_freefloating_test.go delete mode 100644 node/name/t_meta_test.go create mode 100644 node/scalar/t_freefloating_test.go delete mode 100644 node/scalar/t_meta_test.go create mode 100644 node/stmt/t_freefloating_test.go delete mode 100644 node/stmt/t_meta_test.go create mode 100644 node/t_freefloating_test.go delete mode 100644 node/t_meta_test.go diff --git a/freefloating/position_string.go b/freefloating/position_string.go new file mode 100644 index 0000000..d10a397 --- /dev/null +++ b/freefloating/position_string.go @@ -0,0 +1,16 @@ +// Code generated by "stringer -type=Position -output ./position_string.go"; DO NOT EDIT. + +package freefloating + +import "strconv" + +const _Position_name = "StartEndSlashColonSemiColonAltEndDollarAmpersandNamePrefixKeyVarUseTypeReturnTypeOptionalTypeCaseSeparatorLexicalVarsParamsRefCastExprInitExprCondExprIncExprTrueCondHaltCompillerNamespaceStaticClassUseWhileForSwitchBreakForeachDeclareLabelFinallyListDefaultIfElseIfElseVariadicFunctionAliasAsEqualExitArrayIssetEmptyEvalEchoTryCatchUnsetStmtsVarListConstListNameListParamListModifierListArrayPairListCaseListStartCaseListEndArgumentListPropertyListParameterListAdaptationListLexicalVarListUseDeclarationListOpenParenthesisTokenCloseParenthesisToken" + +var _Position_index = [...]uint16{0, 5, 8, 13, 18, 27, 33, 39, 48, 52, 58, 61, 64, 71, 81, 93, 106, 117, 123, 126, 130, 134, 142, 150, 157, 161, 165, 178, 187, 193, 198, 201, 206, 209, 215, 220, 227, 234, 239, 246, 250, 257, 259, 265, 269, 277, 285, 290, 292, 297, 301, 306, 311, 316, 320, 324, 327, 332, 337, 342, 349, 358, 366, 375, 387, 400, 413, 424, 436, 448, 461, 475, 489, 507, 527, 548} + +func (i Position) String() string { + if i < 0 || i >= Position(len(_Position_index)-1) { + return "Position(" + strconv.FormatInt(int64(i), 10) + ")" + } + return _Position_name[_Position_index[i]:_Position_index[i+1]] +} diff --git a/freefloating/string.go b/freefloating/string.go new file mode 100644 index 0000000..be5507f --- /dev/null +++ b/freefloating/string.go @@ -0,0 +1,112 @@ +package freefloating + +import "github.com/z7zmey/php-parser/position" + +type StringType int + +const ( + WhiteSpaceType StringType = iota + CommentType + TokenType +) + +type Position int + +//go:generate stringer -type=Position -output ./position_string.go +const ( + Start Position = iota + End + Slash + Colon + SemiColon + AltEnd + Dollar + Ampersand + Name + Prefix + Key + Var + UseType + ReturnType + OptionalType + CaseSeparator + LexicalVars + Params + Ref + Cast + Expr + InitExpr + CondExpr + IncExpr + True + Cond + + HaltCompiller + Namespace + Static + Class + Use + While + For + Switch + Break + Foreach + Declare + Label + Finally + List + Default + If + ElseIf + Else + Variadic + Function + Alias + As + Equal + Exit + Array + Isset + Empty + Eval + Echo + Try + Catch + Unset + + Stmts + VarList + ConstList + NameList + ParamList + ModifierList + ArrayPairList + CaseListStart + CaseListEnd + ArgumentList + PropertyList + ParameterList + AdaptationList + LexicalVarList + UseDeclarationList + + OpenParenthesisToken + CloseParenthesisToken +) + +type String struct { + StringType StringType + Value string + Position *position.Position +} + +type Collection map[Position][]String + +func (c Collection) IsEmpty() bool { + for _, v := range c { + if len(v) > 0 { + return false + } + } + return true +} diff --git a/meta/collection.go b/meta/collection.go deleted file mode 100644 index 0264283..0000000 --- a/meta/collection.go +++ /dev/null @@ -1,168 +0,0 @@ -package meta - -// Collection of Meta objects -type Collection []*Data - -// SetTokenName sets TokenName for the all elements in the collection -func (mc *Collection) SetTokenName(tn TokenName) *Collection { - for _, m := range *mc { - m.TokenName = tn - } - - return mc -} - -// Push adds elements to the end of an Collection -func (mc *Collection) Push(mm ...*Data) *Collection { - *mc = append(*mc, mm...) - return mc -} - -// Unshift prepends elements to the beginning of an Collection -func (mc *Collection) Unshift(mm ...*Data) *Collection { - *mc = append(mm, *mc...) - return mc -} - -// AppendTo - appends elements of the collection to the end of the target collection -func (mc *Collection) AppendTo(target *Collection) *Collection { - if len(*mc) == 0 { - return mc - } - *target = append(*target, *mc...) - return mc -} - -// PrependTo - prepends elements of the collection to the start of the target collection -func (mc *Collection) PrependTo(target *Collection) *Collection { - if len(*mc) == 0 { - return mc - } - *target = append(*mc, *target...) - return mc -} - -// Cut elements by TokenName -func (mc *Collection) Cut(f Filter) *Collection { - collection := (*mc)[:0] - cutted := Collection{} - - for _, m := range *mc { - if fr := f(m); fr { - cutted = append(cutted, m) - } else { - collection = append(collection, m) - } - } - - *mc = collection - - return &cutted -} - -// FindBy filter -func (mc *Collection) FindBy(f Filter) Collection { - found := Collection{} - - for _, m := range *mc { - if fr := f(m); fr { - found = append(found, m) - } - } - - return found -} - -// Filter function signature -type Filter func(d *Data) bool - -// TokenNameFilter generates filter function that returns true -// if data.TokenName has in the arguments list -func TokenNameFilter(tokenNames ...TokenName) Filter { - return func(d *Data) bool { - for _, tn := range tokenNames { - if d.TokenName == tn { - return true - } - } - return false - } -} - -// TypeFilter generates filter function that returns true -// if data.Type has in the arguments list -func TypeFilter(types ...Type) Filter { - return func(d *Data) bool { - for _, t := range types { - if d.Type == t { - return true - } - } - return false - } -} - -// ValueFilter generates filter function that returns true -// if data.Value has in the arguments list -func ValueFilter(values ...string) Filter { - return func(d *Data) bool { - for _, v := range values { - if d.Value == v { - return true - } - } - return false - } -} - -// AndFilter generates filter function that returns true -// if all given filters return true -func AndFilter(filters ...Filter) Filter { - return func(d *Data) bool { - for _, filter := range filters { - if result := filter(d); !result { - return false - } - } - - return true - } -} - -// OrFilter generates filter function that returns true -// if one of given filters return true -func OrFilter(filters ...Filter) Filter { - return func(d *Data) bool { - for _, filter := range filters { - if result := filter(d); result { - return true - } - } - - return false - } -} - -// NotFilter negates given filter -func NotFilter(f Filter) Filter { - return func(d *Data) bool { - return !f(d) - } -} - -// StopOnFailureFilter always returns false after first failure -func StopOnFailureFilter(f Filter) Filter { - stopFlag := false - return func(d *Data) bool { - if stopFlag == true { - return false - } - - if !f(d) { - stopFlag = true - return false - } - - return true - } -} diff --git a/meta/collection_test.go b/meta/collection_test.go deleted file mode 100644 index 99248ec..0000000 --- a/meta/collection_test.go +++ /dev/null @@ -1,648 +0,0 @@ -package meta_test - -import ( - "reflect" - "testing" - - "github.com/kylelemons/godebug/pretty" - "github.com/z7zmey/php-parser/meta" -) - -func TestCollectionSetTokenName(t *testing.T) { - - // prepare - - whiteSpace := &meta.Data{ - Type: meta.WhiteSpaceType, - Value: "\n", - } - comment := &meta.Data{ - Type: meta.CommentType, - Value: "// some comment", - } - - baseCollection := meta.Collection{whiteSpace, comment} - - // action - - baseCollection.SetTokenName(meta.OpenParenthesisToken) - - // check - - for _, m := range baseCollection { - if m.TokenName != meta.OpenParenthesisToken { - t.Error("The TokenName must be set for all Meta objects") - } - } -} - -func TestCollectionPush(t *testing.T) { - - // prepare - - whiteSpace := &meta.Data{ - Type: meta.WhiteSpaceType, - Value: "\n", - } - comment := &meta.Data{ - Type: meta.CommentType, - Value: "// some comment", - } - - actualCollection := meta.Collection{whiteSpace} - expectedCollection := meta.Collection{whiteSpace, comment} - - // action - - actualCollection.Push(comment) - - // check - - if !reflect.DeepEqual(expectedCollection, actualCollection) { - diff := pretty.Compare(expectedCollection, actualCollection) - - if diff != "" { - t.Errorf("\nexpected and actual collections are not equal\ndiff: (-expected +actual)\n%s", diff) - } else { - t.Errorf("\nexpected and actual collections are not equal\n") - } - } -} - -func TestCollectionUnshift(t *testing.T) { - - // prepare - - whiteSpace := &meta.Data{ - Type: meta.WhiteSpaceType, - Value: "\n", - } - comment := &meta.Data{ - Type: meta.CommentType, - Value: "// some comment", - } - - actualCollection := meta.Collection{comment} - expectedCollection := meta.Collection{whiteSpace, comment} - - // action - - actualCollection.Unshift(whiteSpace) - - // check - - if !reflect.DeepEqual(expectedCollection, actualCollection) { - diff := pretty.Compare(expectedCollection, actualCollection) - - if diff != "" { - t.Errorf("\nexpected and actual collections are not equal\ndiff: (-expected +actual)\n%s", diff) - } else { - t.Errorf("\nexpected and actual collections are not equal\n") - } - } -} - -func TestCollectionAppendTo(t *testing.T) { - - // prepare - - whiteSpace := &meta.Data{ - Type: meta.WhiteSpaceType, - Value: "\n", - } - comment := &meta.Data{ - Type: meta.CommentType, - Value: "// some comment", - } - - actualCollection := meta.Collection{whiteSpace} - expectedCollection := meta.Collection{whiteSpace, comment} - - baseCollection := meta.Collection{comment} - - // action - - baseCollection.AppendTo(&actualCollection) - - // check - - if !reflect.DeepEqual(expectedCollection, actualCollection) { - diff := pretty.Compare(expectedCollection, actualCollection) - - if diff != "" { - t.Errorf("\nexpected and actual collections are not equal\ndiff: (-expected +actual)\n%s", diff) - } else { - t.Errorf("\nexpected and actual collections are not equal\n") - } - } -} - -func TestEmptyCollectionAppendTo(t *testing.T) { - - // prepare - - whiteSpace := &meta.Data{ - Type: meta.WhiteSpaceType, - Value: "\n", - } - - actualCollection := meta.Collection{whiteSpace} - expectedCollection := meta.Collection{whiteSpace} - - var baseCollection meta.Collection = nil - - // action - - baseCollection.AppendTo(&actualCollection) - - // check - - if !reflect.DeepEqual(expectedCollection, actualCollection) { - diff := pretty.Compare(expectedCollection, actualCollection) - - if diff != "" { - t.Errorf("\nexpected and actual collections are not equal\ndiff: (-expected +actual)\n%s", diff) - } else { - t.Errorf("\nexpected and actual collections are not equal\n") - } - } -} - -func TestCollectionPrependTo(t *testing.T) { - - // prepare - - whiteSpace := &meta.Data{ - Type: meta.WhiteSpaceType, - Value: "\n", - } - comment := &meta.Data{ - Type: meta.CommentType, - Value: "// some comment", - } - - actualCollection := meta.Collection{comment} - expectedCollection := meta.Collection{whiteSpace, comment} - - baseCollection := meta.Collection{whiteSpace} - - // action - - baseCollection.PrependTo(&actualCollection) - - // check - - if !reflect.DeepEqual(expectedCollection, actualCollection) { - diff := pretty.Compare(expectedCollection, actualCollection) - - if diff != "" { - t.Errorf("\nexpected and actual collections are not equal\ndiff: (-expected +actual)\n%s", diff) - } else { - t.Errorf("\nexpected and actual collections are not equal\n") - } - } -} - -func TestEmptyCollectionPrependTo(t *testing.T) { - - // prepare - - comment := &meta.Data{ - Type: meta.CommentType, - Value: "// some comment", - } - - actualCollection := meta.Collection{comment} - expectedCollection := meta.Collection{comment} - - baseCollection := meta.Collection{} - - // action - - baseCollection.PrependTo(&actualCollection) - - // check - - if !reflect.DeepEqual(expectedCollection, actualCollection) { - diff := pretty.Compare(expectedCollection, actualCollection) - - if diff != "" { - t.Errorf("\nexpected and actual collections are not equal\ndiff: (-expected +actual)\n%s", diff) - } else { - t.Errorf("\nexpected and actual collections are not equal\n") - } - } -} - -func TestCollectionCutByTokenName(t *testing.T) { - - // prepare - - whiteSpace := &meta.Data{ - Type: meta.WhiteSpaceType, - Value: "\n", - } - OpenParenthesisComment := &meta.Data{ - Type: meta.CommentType, - Value: "// some comment", - TokenName: meta.OpenParenthesisToken, - } - OpenParenthesisToken := &meta.Data{ - Type: meta.TokenType, - Value: "(", - TokenName: meta.OpenParenthesisToken, - } - CloseParenthesisToken := &meta.Data{ - Type: meta.TokenType, - Value: ")", - TokenName: meta.CloseParenthesisToken, - } - - actualCollection := meta.Collection{whiteSpace, OpenParenthesisComment, OpenParenthesisToken, CloseParenthesisToken} - - expectedCollection := meta.Collection{whiteSpace, CloseParenthesisToken} - expectedCutCollection := &meta.Collection{OpenParenthesisComment, OpenParenthesisToken} - - // action - - actualCutCollection := actualCollection.Cut( - meta.TokenNameFilter(meta.OpenParenthesisToken), - ) - - // check - - if !reflect.DeepEqual(expectedCollection, actualCollection) { - diff := pretty.Compare(expectedCollection, actualCollection) - - if diff != "" { - t.Errorf("\nexpected and actual collections are not equal\ndiff: (-expected +actual)\n%s", diff) - } else { - t.Errorf("\nexpected and actual collections are not equal\n") - } - } - - if !reflect.DeepEqual(expectedCutCollection, actualCutCollection) { - diff := pretty.Compare(expectedCutCollection, actualCutCollection) - - if diff != "" { - t.Errorf("\nexpected and actual Cut collections are not equal\ndiff: (-expected +actual)\n%s", diff) - } else { - t.Errorf("\nexpected and actual Cut collections are not equal\n") - } - } -} - -func TestCollectionCutByTokenTypes(t *testing.T) { - - // prepare - - whiteSpace := &meta.Data{ - Type: meta.WhiteSpaceType, - Value: "\n", - } - OpenParenthesisComment := &meta.Data{ - Type: meta.CommentType, - Value: "// some comment", - TokenName: meta.OpenParenthesisToken, - } - OpenParenthesisToken := &meta.Data{ - Type: meta.TokenType, - Value: "(", - TokenName: meta.OpenParenthesisToken, - } - CloseParenthesisToken := &meta.Data{ - Type: meta.TokenType, - Value: ")", - TokenName: meta.CloseParenthesisToken, - } - - actualCollection := meta.Collection{whiteSpace, OpenParenthesisComment, OpenParenthesisToken, CloseParenthesisToken} - - expectedCollection := meta.Collection{OpenParenthesisToken, CloseParenthesisToken} - expectedCutCollection := &meta.Collection{whiteSpace, OpenParenthesisComment} - - // action - - actualCutCollection := actualCollection.Cut(meta.OrFilter( - meta.TypeFilter(meta.CommentType), - meta.TypeFilter(meta.WhiteSpaceType)), - ) - - // check - - if !reflect.DeepEqual(expectedCollection, actualCollection) { - diff := pretty.Compare(expectedCollection, actualCollection) - - if diff != "" { - t.Errorf("\nexpected and actual collections are not equal\ndiff: (-expected +actual)\n%s", diff) - } else { - t.Errorf("\nexpected and actual collections are not equal\n") - } - } - - if !reflect.DeepEqual(expectedCutCollection, actualCutCollection) { - diff := pretty.Compare(expectedCutCollection, actualCutCollection) - - if diff != "" { - t.Errorf("\nexpected and actual Cut collections are not equal\ndiff: (-expected +actual)\n%s", diff) - } else { - t.Errorf("\nexpected and actual Cut collections are not equal\n") - } - } -} - -func TestCollectionCutByTokenNameButNotType(t *testing.T) { - - // prepare - - whiteSpace := &meta.Data{ - Type: meta.WhiteSpaceType, - Value: "\n", - } - OpenParenthesisComment := &meta.Data{ - Type: meta.CommentType, - Value: "// some comment", - TokenName: meta.OpenParenthesisToken, - } - OpenParenthesisToken := &meta.Data{ - Type: meta.TokenType, - Value: "(", - TokenName: meta.OpenParenthesisToken, - } - CloseParenthesisToken := &meta.Data{ - Type: meta.TokenType, - Value: ")", - TokenName: meta.CloseParenthesisToken, - } - - actualCollection := meta.Collection{ - whiteSpace, - OpenParenthesisComment, - OpenParenthesisToken, - CloseParenthesisToken, - } - - expectedCollection := meta.Collection{ - whiteSpace, - OpenParenthesisToken, - CloseParenthesisToken, - } - expectedCutCollection := &meta.Collection{ - OpenParenthesisComment, - } - - // action - - actualCutCollection := actualCollection.Cut(meta.AndFilter( - meta.TokenNameFilter(meta.OpenParenthesisToken), - meta.NotFilter(meta.TypeFilter(meta.TokenType))), - ) - - // check - - if !reflect.DeepEqual(expectedCollection, actualCollection) { - diff := pretty.Compare(expectedCollection, actualCollection) - - if diff != "" { - t.Errorf("\nexpected and actual collections are not equal\ndiff: (-expected +actual)\n%s", diff) - } else { - t.Errorf("\nexpected and actual collections are not equal\n") - } - } - - if !reflect.DeepEqual(expectedCutCollection, actualCutCollection) { - diff := pretty.Compare(expectedCutCollection, actualCutCollection) - - if diff != "" { - t.Errorf("\nexpected and actual Cut collections are not equal\ndiff: (-expected +actual)\n%s", diff) - } else { - t.Errorf("\nexpected and actual Cut collections are not equal\n") - } - } -} - -func TestCollectionCutByValue(t *testing.T) { - - // prepare - - whiteSpace := &meta.Data{ - Type: meta.WhiteSpaceType, - Value: "\n", - } - OpenParenthesisComment := &meta.Data{ - Type: meta.CommentType, - Value: "// some comment", - TokenName: meta.OpenParenthesisToken, - } - OpenParenthesisToken := &meta.Data{ - Type: meta.TokenType, - Value: "(", - TokenName: meta.OpenParenthesisToken, - } - CloseParenthesisToken := &meta.Data{ - Type: meta.TokenType, - Value: ")", - TokenName: meta.CloseParenthesisToken, - } - - actualCollection := meta.Collection{ - whiteSpace, - OpenParenthesisComment, - OpenParenthesisToken, - CloseParenthesisToken, - } - - expectedCollection := meta.Collection{ - whiteSpace, - OpenParenthesisComment, - } - expectedCutCollection := &meta.Collection{ - OpenParenthesisToken, - CloseParenthesisToken, - } - - // action - - actualCutCollection := actualCollection.Cut(meta.ValueFilter("(", ")")) - - // check - - if !reflect.DeepEqual(expectedCollection, actualCollection) { - diff := pretty.Compare(expectedCollection, actualCollection) - - if diff != "" { - t.Errorf("\nexpected and actual collections are not equal\ndiff: (-expected +actual)\n%s", diff) - } else { - t.Errorf("\nexpected and actual collections are not equal\n") - } - } - - if !reflect.DeepEqual(expectedCutCollection, actualCutCollection) { - diff := pretty.Compare(expectedCutCollection, actualCutCollection) - - if diff != "" { - t.Errorf("\nexpected and actual Cut collections are not equal\ndiff: (-expected +actual)\n%s", diff) - } else { - t.Errorf("\nexpected and actual Cut collections are not equal\n") - } - } -} - -func TestCollectionCutUntilFirstToken(t *testing.T) { - - // prepare - - whiteSpace := &meta.Data{ - Type: meta.WhiteSpaceType, - Value: "\n", - TokenName: meta.NodeStart, - } - OpenParenthesisComment := &meta.Data{ - Type: meta.CommentType, - Value: "// some comment", - TokenName: meta.NodeStart, - } - OpenParenthesisToken := &meta.Data{ - Type: meta.TokenType, - Value: "(", - TokenName: meta.OpenParenthesisToken, - } - CloseParenthesisComment := &meta.Data{ - Type: meta.WhiteSpaceType, - Value: "// some comment", - TokenName: meta.OpenParenthesisToken, - } - CloseParenthesisToken := &meta.Data{ - Type: meta.TokenType, - Value: ")", - TokenName: meta.CloseParenthesisToken, - } - - actualCollection := meta.Collection{ - whiteSpace, - OpenParenthesisComment, - OpenParenthesisToken, - CloseParenthesisComment, - CloseParenthesisToken, - } - - expectedCutCollection := &meta.Collection{ - whiteSpace, - OpenParenthesisComment, - } - expectedCollection := meta.Collection{ - OpenParenthesisToken, - CloseParenthesisComment, // must not be cut - CloseParenthesisToken, - } - - // action - - actualCutCollection := actualCollection.Cut( - meta.StopOnFailureFilter( - meta.NotFilter( - meta.TypeFilter(meta.TokenType), - ), - ), - ) - - // check - - if !reflect.DeepEqual(expectedCollection, actualCollection) { - diff := pretty.Compare(expectedCollection, actualCollection) - - if diff != "" { - t.Errorf("\nexpected and actual collections are not equal\ndiff: (-expected +actual)\n%s", diff) - } else { - t.Errorf("\nexpected and actual collections are not equal\n") - } - } - - if !reflect.DeepEqual(expectedCutCollection, actualCutCollection) { - diff := pretty.Compare(expectedCutCollection, actualCutCollection) - - if diff != "" { - t.Errorf("\nexpected and actual Cut collections are not equal\ndiff: (-expected +actual)\n%s", diff) - } else { - t.Errorf("\nexpected and actual Cut collections are not equal\n") - } - } -} - -func TestCollectionFindByType(t *testing.T) { - - // prepare - - whiteSpace := &meta.Data{ - Type: meta.WhiteSpaceType, - Value: "\n", - TokenName: meta.NodeStart, - } - OpenParenthesisComment := &meta.Data{ - Type: meta.CommentType, - Value: "// some comment", - TokenName: meta.NodeStart, - } - OpenParenthesisToken := &meta.Data{ - Type: meta.TokenType, - Value: "(", - TokenName: meta.OpenParenthesisToken, - } - CloseParenthesisComment := &meta.Data{ - Type: meta.WhiteSpaceType, - Value: "// some comment", - TokenName: meta.OpenParenthesisToken, - } - CloseParenthesisToken := &meta.Data{ - Type: meta.TokenType, - Value: ")", - TokenName: meta.CloseParenthesisToken, - } - - actualCollection := meta.Collection{ - whiteSpace, - OpenParenthesisComment, - OpenParenthesisToken, - CloseParenthesisComment, - CloseParenthesisToken, - } - - expectedCollection := meta.Collection{ - whiteSpace, - OpenParenthesisComment, - OpenParenthesisToken, - CloseParenthesisComment, - CloseParenthesisToken, - } - - expectedFoundCollection := meta.Collection{ - OpenParenthesisToken, - CloseParenthesisToken, - } - - // action - - actualFoundCollection := actualCollection.FindBy(meta.TypeFilter(meta.TokenType)) - - // check - - if !reflect.DeepEqual(expectedCollection, actualCollection) { - diff := pretty.Compare(expectedCollection, actualCollection) - - if diff != "" { - t.Errorf("\nexpected and actual collections are not equal\ndiff: (-expected +actual)\n%s", diff) - } else { - t.Errorf("\nexpected and actual collections are not equal\n") - } - } - - if !reflect.DeepEqual(expectedFoundCollection, actualFoundCollection) { - diff := pretty.Compare(expectedFoundCollection, actualFoundCollection) - - if diff != "" { - t.Errorf("\nexpected and actual Cut collections are not equal\ndiff: (-expected +actual)\n%s", diff) - } else { - t.Errorf("\nexpected and actual Cut collections are not equal\n") - } - } -} diff --git a/meta/data.go b/meta/data.go deleted file mode 100644 index e45e6a0..0000000 --- a/meta/data.go +++ /dev/null @@ -1,17 +0,0 @@ -package meta - -import ( - "github.com/z7zmey/php-parser/position" -) - -// Data contain additional information that isn't part of AST -type Data struct { - Value string - Type Type - Position *position.Position - TokenName TokenName -} - -func (d *Data) String() string { - return d.Value -} diff --git a/meta/data_test.go b/meta/data_test.go deleted file mode 100644 index cb5c5e8..0000000 --- a/meta/data_test.go +++ /dev/null @@ -1,21 +0,0 @@ -package meta_test - -import ( - "testing" - - "github.com/z7zmey/php-parser/meta" -) - -func TestCommentPrint(t *testing.T) { - expected := "/** hello world */" - - comment := meta.Data{ - Value: expected, - } - - actual := comment.String() - - if expected != actual { - t.Errorf("expected and actual are not equal\n") - } -} diff --git a/meta/tokenName.go b/meta/tokenName.go deleted file mode 100644 index 348a203..0000000 --- a/meta/tokenName.go +++ /dev/null @@ -1,85 +0,0 @@ -package meta - -// TokenName is used to specify a comment position -type TokenName int - -//go:generate stringer -type=TokenName -output ./tokenName_string.go -const ( - NodeStart TokenName = iota - NodeEnd - WhileToken - EndwhileToken - ForInitSemicolonToken - ForCondSemicolonToken - EndforToken - EndforeachToken - EnddeclareToken - AsToken - EndswitchToken - FunctionToken - ConstToken - InsteadofToken - ClassToken - ExtendsToken - ImplementsToken - DoubleArrowToken - PaamayimNekudotayimToken - NsSeparatorToken - EllipsisToken - LogicalOrToken - LogicalXorToken - LogicalAndToken - InstanceofToken - EndifToken - IncToken - DecToken - ObjectOperatorToken - CoalesceToken - SpaceshipToken - PlusEqualToken - MinusEqualToken - MulEqualToken - PowEqualToken - DivEqualToken - ConcatEqualToken - ModEqualToken - AndEqualToken - OrEqualToken - XorEqualToken - SlEqualToken - SrEqualToken - BooleanOrToken - BooleanAndToken - PowToken - SlToken - SrToken - IsIdenticalToken - IsNotIdenticalToken - IsEqualToken - IsNotEqualToken - IsSmallerOrEqualToken - IsGreaterOrEqualToken - CaseSeparatorToken // ';' or ':' - OpenCurlyBracesToken // '{' - CloseCurlyBracesToken // '}' - SemiColonToken // ';' - ColonToken // ':' - OpenParenthesisToken // '(' - CloseParenthesisToken // ')' - OpenSquareBracket // '[' - CloseSquareBracket // ']' - QuestionMarkToken // '?' - AmpersandToken // '&' - MinusToken // '-' - PlusToken // '+' - CommaToken // ',' - VerticalBarToken // '|' - EqualToken // '=' - CaretToken // '^' - AsteriskToken // '*' - SlashToken // '/' - PercentToken // '%' - LessToken // '<' - GreaterToken // '>' - DotToken // '.' -) diff --git a/meta/tokenName_string.go b/meta/tokenName_string.go deleted file mode 100644 index 6eebadc..0000000 --- a/meta/tokenName_string.go +++ /dev/null @@ -1,16 +0,0 @@ -// Code generated by "stringer -type=TokenName -output ./tokenName_string.go"; DO NOT EDIT. - -package meta - -import "strconv" - -const _TokenName_name = "NodeStartNodeEndWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenEndforTokenEndforeachTokenEnddeclareTokenAsTokenEndswitchTokenFunctionTokenConstTokenInsteadofTokenClassTokenExtendsTokenImplementsTokenDoubleArrowTokenPaamayimNekudotayimTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenEndifTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" - -var _TokenName_index = [...]uint16{0, 9, 16, 26, 39, 60, 81, 92, 107, 122, 129, 143, 156, 166, 180, 190, 202, 217, 233, 257, 273, 286, 300, 315, 330, 345, 355, 363, 371, 390, 403, 417, 431, 446, 459, 472, 485, 501, 514, 527, 539, 552, 564, 576, 590, 605, 613, 620, 627, 643, 662, 674, 689, 710, 731, 749, 769, 790, 804, 814, 834, 855, 872, 890, 907, 921, 931, 940, 950, 966, 976, 986, 999, 1009, 1021, 1030, 1042, 1050} - -func (i TokenName) String() string { - if i < 0 || i >= TokenName(len(_TokenName_index)-1) { - return "TokenName(" + strconv.FormatInt(int64(i), 10) + ")" - } - return _TokenName_name[_TokenName_index[i]:_TokenName_index[i+1]] -} diff --git a/meta/tokenName_test.go b/meta/tokenName_test.go deleted file mode 100644 index ab3c706..0000000 --- a/meta/tokenName_test.go +++ /dev/null @@ -1,29 +0,0 @@ -package meta_test - -import ( - "testing" - - "github.com/z7zmey/php-parser/meta" -) - -func TestTokenNameString(t *testing.T) { - c := meta.NsSeparatorToken - - expected := "NsSeparatorToken" - actual := c.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestWrongTokenNameString(t *testing.T) { - c := meta.TokenName(-1) - - expected := "TokenName(-1)" - actual := c.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} diff --git a/meta/type.go b/meta/type.go deleted file mode 100644 index 783149f..0000000 --- a/meta/type.go +++ /dev/null @@ -1,11 +0,0 @@ -package meta - -// Type TODO -type Type int - -//go:generate stringer -type=Type -output ./type_string.go -const ( - CommentType Type = iota - WhiteSpaceType - TokenType -) diff --git a/meta/type_string.go b/meta/type_string.go deleted file mode 100644 index 69cb010..0000000 --- a/meta/type_string.go +++ /dev/null @@ -1,16 +0,0 @@ -// Code generated by "stringer -type=Type -output ./type_string.go"; DO NOT EDIT. - -package meta - -import "strconv" - -const _Type_name = "CommentTypeWhiteSpaceTypeTokenType" - -var _Type_index = [...]uint8{0, 11, 25, 34} - -func (i Type) String() string { - if i < 0 || i >= Type(len(_Type_index)-1) { - return "Type(" + strconv.FormatInt(int64(i), 10) + ")" - } - return _Type_name[_Type_index[i]:_Type_index[i+1]] -} diff --git a/meta/type_test.go b/meta/type_test.go deleted file mode 100644 index bb2564e..0000000 --- a/meta/type_test.go +++ /dev/null @@ -1,29 +0,0 @@ -package meta_test - -import ( - "testing" - - "github.com/z7zmey/php-parser/meta" -) - -func TestTypeString(t *testing.T) { - c := meta.CommentType - - expected := "CommentType" - actual := c.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestWrongTypeString(t *testing.T) { - c := meta.Type(-1) - - expected := "Type(-1)" - actual := c.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} diff --git a/node/expr/assign/n_assign.go b/node/expr/assign/n_assign.go index d2d4db4..dd55306 100644 --- a/node/expr/assign/n_assign.go +++ b/node/expr/assign/n_assign.go @@ -1,7 +1,7 @@ package assign import ( - "github.com/z7zmey/php-parser/meta" + "github.com/z7zmey/php-parser/freefloating" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,17 +9,18 @@ import ( // Assign node type Assign struct { - Meta meta.Collection - Position *position.Position - Variable node.Node - Expression node.Node + FreeFloating freefloating.Collection + Position *position.Position + Variable node.Node + Expression node.Node } // NewAssign node constructor func NewAssign(Variable node.Node, Expression node.Node) *Assign { return &Assign{ - Variable: Variable, - Expression: Expression, + FreeFloating: nil, + Variable: Variable, + Expression: Expression, } } @@ -33,8 +34,8 @@ func (n *Assign) GetPosition() *position.Position { return n.Position } -func (n *Assign) GetMeta() *meta.Collection { - return &n.Meta +func (n *Assign) GetFreeFloating() *freefloating.Collection { + return &n.FreeFloating } // Attributes returns node attributes as map diff --git a/node/expr/assign/n_assign_ref.go b/node/expr/assign/n_assign_ref.go index 90eff92..fbf95ae 100644 --- a/node/expr/assign/n_assign_ref.go +++ b/node/expr/assign/n_assign_ref.go @@ -1,7 +1,7 @@ package assign import ( - "github.com/z7zmey/php-parser/meta" + "github.com/z7zmey/php-parser/freefloating" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,17 +9,18 @@ import ( // Reference node type Reference struct { - Meta meta.Collection - Position *position.Position - Variable node.Node - Expression node.Node + FreeFloating freefloating.Collection + Position *position.Position + Variable node.Node + Expression node.Node } // NewReference node constructor func NewReference(Variable node.Node, Expression node.Node) *Reference { return &Reference{ - Variable: Variable, - Expression: Expression, + FreeFloating: nil, + Variable: Variable, + Expression: Expression, } } @@ -33,8 +34,8 @@ func (n *Reference) GetPosition() *position.Position { return n.Position } -func (n *Reference) GetMeta() *meta.Collection { - return &n.Meta +func (n *Reference) GetFreeFloating() *freefloating.Collection { + return &n.FreeFloating } // Attributes returns node attributes as map diff --git a/node/expr/assign/n_bitwise_and.go b/node/expr/assign/n_bitwise_and.go index 5d84216..1ba0a97 100644 --- a/node/expr/assign/n_bitwise_and.go +++ b/node/expr/assign/n_bitwise_and.go @@ -1,7 +1,7 @@ package assign import ( - "github.com/z7zmey/php-parser/meta" + "github.com/z7zmey/php-parser/freefloating" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,17 +9,18 @@ import ( // BitwiseAnd node type BitwiseAnd struct { - Meta meta.Collection - Position *position.Position - Variable node.Node - Expression node.Node + FreeFloating freefloating.Collection + Position *position.Position + Variable node.Node + Expression node.Node } // NewBitwiseAnd node constructor func NewBitwiseAnd(Variable node.Node, Expression node.Node) *BitwiseAnd { return &BitwiseAnd{ - Variable: Variable, - Expression: Expression, + FreeFloating: nil, + Variable: Variable, + Expression: Expression, } } @@ -33,8 +34,8 @@ func (n *BitwiseAnd) GetPosition() *position.Position { return n.Position } -func (n *BitwiseAnd) GetMeta() *meta.Collection { - return &n.Meta +func (n *BitwiseAnd) GetFreeFloating() *freefloating.Collection { + return &n.FreeFloating } // Attributes returns node attributes as map diff --git a/node/expr/assign/n_bitwise_or.go b/node/expr/assign/n_bitwise_or.go index bb54040..46f9ee4 100644 --- a/node/expr/assign/n_bitwise_or.go +++ b/node/expr/assign/n_bitwise_or.go @@ -1,7 +1,7 @@ package assign import ( - "github.com/z7zmey/php-parser/meta" + "github.com/z7zmey/php-parser/freefloating" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,17 +9,18 @@ import ( // BitwiseOr node type BitwiseOr struct { - Meta meta.Collection - Position *position.Position - Variable node.Node - Expression node.Node + FreeFloating freefloating.Collection + Position *position.Position + Variable node.Node + Expression node.Node } // NewBitwiseOr node constructor func NewBitwiseOr(Variable node.Node, Expression node.Node) *BitwiseOr { return &BitwiseOr{ - Variable: Variable, - Expression: Expression, + FreeFloating: nil, + Variable: Variable, + Expression: Expression, } } @@ -33,8 +34,8 @@ func (n *BitwiseOr) GetPosition() *position.Position { return n.Position } -func (n *BitwiseOr) GetMeta() *meta.Collection { - return &n.Meta +func (n *BitwiseOr) GetFreeFloating() *freefloating.Collection { + return &n.FreeFloating } // Attributes returns node attributes as map diff --git a/node/expr/assign/n_bitwise_xor.go b/node/expr/assign/n_bitwise_xor.go index b1f9dad..7f8050f 100644 --- a/node/expr/assign/n_bitwise_xor.go +++ b/node/expr/assign/n_bitwise_xor.go @@ -1,7 +1,7 @@ package assign import ( - "github.com/z7zmey/php-parser/meta" + "github.com/z7zmey/php-parser/freefloating" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,17 +9,18 @@ import ( // BitwiseXor node type BitwiseXor struct { - Meta meta.Collection - Position *position.Position - Variable node.Node - Expression node.Node + FreeFloating freefloating.Collection + Position *position.Position + Variable node.Node + Expression node.Node } // NewBitwiseXor node constructor func NewBitwiseXor(Variable node.Node, Expression node.Node) *BitwiseXor { return &BitwiseXor{ - Variable: Variable, - Expression: Expression, + FreeFloating: nil, + Variable: Variable, + Expression: Expression, } } @@ -33,8 +34,8 @@ func (n *BitwiseXor) GetPosition() *position.Position { return n.Position } -func (n *BitwiseXor) GetMeta() *meta.Collection { - return &n.Meta +func (n *BitwiseXor) GetFreeFloating() *freefloating.Collection { + return &n.FreeFloating } // Attributes returns node attributes as map diff --git a/node/expr/assign/n_concat.go b/node/expr/assign/n_concat.go index 44c175b..63c7e9d 100644 --- a/node/expr/assign/n_concat.go +++ b/node/expr/assign/n_concat.go @@ -1,7 +1,7 @@ package assign import ( - "github.com/z7zmey/php-parser/meta" + "github.com/z7zmey/php-parser/freefloating" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,17 +9,18 @@ import ( // Concat node type Concat struct { - Meta meta.Collection - Position *position.Position - Variable node.Node - Expression node.Node + FreeFloating freefloating.Collection + Position *position.Position + Variable node.Node + Expression node.Node } // NewConcat node constructor func NewConcat(Variable node.Node, Expression node.Node) *Concat { return &Concat{ - Variable: Variable, - Expression: Expression, + FreeFloating: nil, + Variable: Variable, + Expression: Expression, } } @@ -33,8 +34,8 @@ func (n *Concat) GetPosition() *position.Position { return n.Position } -func (n *Concat) GetMeta() *meta.Collection { - return &n.Meta +func (n *Concat) GetFreeFloating() *freefloating.Collection { + return &n.FreeFloating } // Attributes returns node attributes as map diff --git a/node/expr/assign/n_div.go b/node/expr/assign/n_div.go index a988398..2073b15 100644 --- a/node/expr/assign/n_div.go +++ b/node/expr/assign/n_div.go @@ -1,7 +1,7 @@ package assign import ( - "github.com/z7zmey/php-parser/meta" + "github.com/z7zmey/php-parser/freefloating" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,17 +9,18 @@ import ( // Div node type Div struct { - Meta meta.Collection - Position *position.Position - Variable node.Node - Expression node.Node + FreeFloating freefloating.Collection + Position *position.Position + Variable node.Node + Expression node.Node } // NewDiv node constructor func NewDiv(Variable node.Node, Expression node.Node) *Div { return &Div{ - Variable: Variable, - Expression: Expression, + FreeFloating: nil, + Variable: Variable, + Expression: Expression, } } @@ -33,8 +34,8 @@ func (n *Div) GetPosition() *position.Position { return n.Position } -func (n *Div) GetMeta() *meta.Collection { - return &n.Meta +func (n *Div) GetFreeFloating() *freefloating.Collection { + return &n.FreeFloating } // Attributes returns node attributes as map diff --git a/node/expr/assign/n_minus.go b/node/expr/assign/n_minus.go index 1ea308c..efc147c 100644 --- a/node/expr/assign/n_minus.go +++ b/node/expr/assign/n_minus.go @@ -1,7 +1,7 @@ package assign import ( - "github.com/z7zmey/php-parser/meta" + "github.com/z7zmey/php-parser/freefloating" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,17 +9,18 @@ import ( // Minus node type Minus struct { - Meta meta.Collection - Position *position.Position - Variable node.Node - Expression node.Node + FreeFloating freefloating.Collection + Position *position.Position + Variable node.Node + Expression node.Node } // NewMinus node constructor func NewMinus(Variable node.Node, Expression node.Node) *Minus { return &Minus{ - Variable: Variable, - Expression: Expression, + FreeFloating: nil, + Variable: Variable, + Expression: Expression, } } @@ -33,8 +34,8 @@ func (n *Minus) GetPosition() *position.Position { return n.Position } -func (n *Minus) GetMeta() *meta.Collection { - return &n.Meta +func (n *Minus) GetFreeFloating() *freefloating.Collection { + return &n.FreeFloating } // Attributes returns node attributes as map diff --git a/node/expr/assign/n_mod.go b/node/expr/assign/n_mod.go index 281394e..8fab46a 100644 --- a/node/expr/assign/n_mod.go +++ b/node/expr/assign/n_mod.go @@ -1,7 +1,7 @@ package assign import ( - "github.com/z7zmey/php-parser/meta" + "github.com/z7zmey/php-parser/freefloating" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,17 +9,18 @@ import ( // Mod node type Mod struct { - Meta meta.Collection - Position *position.Position - Variable node.Node - Expression node.Node + FreeFloating freefloating.Collection + Position *position.Position + Variable node.Node + Expression node.Node } // NewMod node constructor func NewMod(Variable node.Node, Expression node.Node) *Mod { return &Mod{ - Variable: Variable, - Expression: Expression, + FreeFloating: nil, + Variable: Variable, + Expression: Expression, } } @@ -33,8 +34,8 @@ func (n *Mod) GetPosition() *position.Position { return n.Position } -func (n *Mod) GetMeta() *meta.Collection { - return &n.Meta +func (n *Mod) GetFreeFloating() *freefloating.Collection { + return &n.FreeFloating } // Attributes returns node attributes as map diff --git a/node/expr/assign/n_mul.go b/node/expr/assign/n_mul.go index f2cb5ae..3076b05 100644 --- a/node/expr/assign/n_mul.go +++ b/node/expr/assign/n_mul.go @@ -1,7 +1,7 @@ package assign import ( - "github.com/z7zmey/php-parser/meta" + "github.com/z7zmey/php-parser/freefloating" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,17 +9,18 @@ import ( // Mul node type Mul struct { - Meta meta.Collection - Position *position.Position - Variable node.Node - Expression node.Node + FreeFloating freefloating.Collection + Position *position.Position + Variable node.Node + Expression node.Node } // NewMul node constructor func NewMul(Variable node.Node, Expression node.Node) *Mul { return &Mul{ - Variable: Variable, - Expression: Expression, + FreeFloating: nil, + Variable: Variable, + Expression: Expression, } } @@ -33,8 +34,8 @@ func (n *Mul) GetPosition() *position.Position { return n.Position } -func (n *Mul) GetMeta() *meta.Collection { - return &n.Meta +func (n *Mul) GetFreeFloating() *freefloating.Collection { + return &n.FreeFloating } // Attributes returns node attributes as map diff --git a/node/expr/assign/n_plus.go b/node/expr/assign/n_plus.go index 0f3b137..f2c3753 100644 --- a/node/expr/assign/n_plus.go +++ b/node/expr/assign/n_plus.go @@ -1,7 +1,7 @@ package assign import ( - "github.com/z7zmey/php-parser/meta" + "github.com/z7zmey/php-parser/freefloating" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,17 +9,18 @@ import ( // Plus node type Plus struct { - Meta meta.Collection - Position *position.Position - Variable node.Node - Expression node.Node + FreeFloating freefloating.Collection + Position *position.Position + Variable node.Node + Expression node.Node } // NewPlus node constructor func NewPlus(Variable node.Node, Expression node.Node) *Plus { return &Plus{ - Variable: Variable, - Expression: Expression, + FreeFloating: nil, + Variable: Variable, + Expression: Expression, } } @@ -33,8 +34,8 @@ func (n *Plus) GetPosition() *position.Position { return n.Position } -func (n *Plus) GetMeta() *meta.Collection { - return &n.Meta +func (n *Plus) GetFreeFloating() *freefloating.Collection { + return &n.FreeFloating } // Attributes returns node attributes as map diff --git a/node/expr/assign/n_pow.go b/node/expr/assign/n_pow.go index fa5a17f..6bd48e7 100644 --- a/node/expr/assign/n_pow.go +++ b/node/expr/assign/n_pow.go @@ -1,7 +1,7 @@ package assign import ( - "github.com/z7zmey/php-parser/meta" + "github.com/z7zmey/php-parser/freefloating" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,17 +9,18 @@ import ( // Pow node type Pow struct { - Meta meta.Collection - Position *position.Position - Variable node.Node - Expression node.Node + FreeFloating freefloating.Collection + Position *position.Position + Variable node.Node + Expression node.Node } // NewPow node constructor func NewPow(Variable node.Node, Expression node.Node) *Pow { return &Pow{ - Variable: Variable, - Expression: Expression, + FreeFloating: nil, + Variable: Variable, + Expression: Expression, } } @@ -33,8 +34,8 @@ func (n *Pow) GetPosition() *position.Position { return n.Position } -func (n *Pow) GetMeta() *meta.Collection { - return &n.Meta +func (n *Pow) GetFreeFloating() *freefloating.Collection { + return &n.FreeFloating } // Attributes returns node attributes as map diff --git a/node/expr/assign/n_shift_left.go b/node/expr/assign/n_shift_left.go index 963bf56..0c541ba 100644 --- a/node/expr/assign/n_shift_left.go +++ b/node/expr/assign/n_shift_left.go @@ -1,7 +1,7 @@ package assign import ( - "github.com/z7zmey/php-parser/meta" + "github.com/z7zmey/php-parser/freefloating" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,17 +9,18 @@ import ( // ShiftLeft node type ShiftLeft struct { - Meta meta.Collection - Position *position.Position - Variable node.Node - Expression node.Node + FreeFloating freefloating.Collection + Position *position.Position + Variable node.Node + Expression node.Node } // NewShiftLeft node constructor func NewShiftLeft(Variable node.Node, Expression node.Node) *ShiftLeft { return &ShiftLeft{ - Variable: Variable, - Expression: Expression, + FreeFloating: nil, + Variable: Variable, + Expression: Expression, } } @@ -33,8 +34,8 @@ func (n *ShiftLeft) GetPosition() *position.Position { return n.Position } -func (n *ShiftLeft) GetMeta() *meta.Collection { - return &n.Meta +func (n *ShiftLeft) GetFreeFloating() *freefloating.Collection { + return &n.FreeFloating } // Attributes returns node attributes as map diff --git a/node/expr/assign/n_shift_right.go b/node/expr/assign/n_shift_right.go index 3a1cd4c..c496e7e 100644 --- a/node/expr/assign/n_shift_right.go +++ b/node/expr/assign/n_shift_right.go @@ -1,7 +1,7 @@ package assign import ( - "github.com/z7zmey/php-parser/meta" + "github.com/z7zmey/php-parser/freefloating" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/walker" @@ -9,17 +9,18 @@ import ( // ShiftRight node type ShiftRight struct { - Meta meta.Collection - Position *position.Position - Variable node.Node - Expression node.Node + FreeFloating freefloating.Collection + Position *position.Position + Variable node.Node + Expression node.Node } // NewShiftRight node constructor func NewShiftRight(Variable node.Node, Expression node.Node) *ShiftRight { return &ShiftRight{ - Variable: Variable, - Expression: Expression, + FreeFloating: nil, + Variable: Variable, + Expression: Expression, } } @@ -33,8 +34,8 @@ func (n *ShiftRight) GetPosition() *position.Position { return n.Position } -func (n *ShiftRight) GetMeta() *meta.Collection { - return &n.Meta +func (n *ShiftRight) GetFreeFloating() *freefloating.Collection { + return &n.FreeFloating } // Attributes returns node attributes as map diff --git a/node/expr/assign/t_assign_op_test.go b/node/expr/assign/t_assign_op_test.go index 4a00579..19b0ca7 100644 --- a/node/expr/assign/t_assign_op_test.go +++ b/node/expr/assign/t_assign_op_test.go @@ -2,14 +2,13 @@ package assign_test import ( "bytes" - "reflect" "testing" + "gotest.tools/assert" + "github.com/z7zmey/php-parser/node/expr/assign" "github.com/z7zmey/php-parser/position" - "github.com/kylelemons/godebug/pretty" - "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node/expr" "github.com/z7zmey/php-parser/node/name" @@ -18,18 +17,6 @@ import ( "github.com/z7zmey/php-parser/php7" ) -func assertEqual(t *testing.T, expected interface{}, actual interface{}) { - if !reflect.DeepEqual(expected, actual) { - diff := pretty.Compare(expected, actual) - - if diff != "" { - t.Errorf("diff: (-expected +actual)\n%s", diff) - } else { - t.Errorf("expected and actual are not equal\n") - } - } -} - func TestReference(t *testing.T) { src := `") - - if i < 0 { - SemiColonTokenMeta.AppendTo(prevNode.GetMeta()) - } else { - if metaTokenValue[0] == ';' { - prevNode.GetMeta().Push(&meta.Data{ - Value: metaTokenValue[0:1], - Type: meta.TokenType, - Position: nil, - TokenName: meta.SemiColonToken, - }) - - htmlNode.GetMeta().Push(&meta.Data{ - Value: metaTokenValue[1:i], - Type: meta.WhiteSpaceType, - Position: nil, - TokenName: meta.NodeStart, - }) - - htmlNode.GetMeta().Push(&meta.Data{ - Value: metaTokenValue[i : i+2], - Type: meta.TokenType, - Position: nil, - TokenName: meta.NodeStart, - }) - - if len(metaTokenValue) > i+2 { - htmlNode.GetMeta().Push(&meta.Data{ - Value: metaTokenValue[i+2:], - Type: meta.WhiteSpaceType, - Position: nil, - TokenName: meta.NodeStart, - }) - } - } else { - htmlNode.GetMeta().Push(&meta.Data{ - Value: metaTokenValue[:2], - Type: meta.TokenType, - Position: nil, - TokenName: meta.NodeStart, - }) - - if len(metaTokenValue) > 2 { - htmlNode.GetMeta().Push(&meta.Data{ - Value: metaTokenValue[2:], - Type: meta.WhiteSpaceType, - Position: nil, - TokenName: meta.NodeStart, - }) - } - } + dstCollection := dst.GetFreeFloating() + if *dstCollection == nil { + *dstCollection = make(freefloating.Collection) } + + (*dstCollection)[p] = strings +} + +func (l *Parser) GetFreeFloatingToken(t *scanner.Token) []freefloating.String { + if l.Lexer.WithMeta == false { + return []freefloating.String{} + } + + return t.GetFreeFloatingToken() +} + +func (l *Parser) addDollarToken(v node.Node) { + if l.Lexer.WithMeta == false { + return + } + + l.setFreeFloating(v, freefloating.Dollar, []freefloating.String{ + { + StringType: freefloating.TokenType, + Value: "$", + Position: &position.Position{ + StartLine: v.GetPosition().StartLine, + EndLine: v.GetPosition().StartLine, + StartPos: v.GetPosition().StartPos, + EndPos: v.GetPosition().StartPos + 1, + }, + }, + }) +} + +func (l *Parser) splitSemiColonAndPhpCloseTag(htmlNode node.Node, prevNode node.Node) { + if l.Lexer.WithMeta == false { + return + } + + semiColon := (*prevNode.GetFreeFloating())[freefloating.SemiColon] + delete((*prevNode.GetFreeFloating()), freefloating.SemiColon) + if len(semiColon) == 0 { + return + } + + p := semiColon[0].Position + if semiColon[0].Value[0] == ';' { + l.setFreeFloating(prevNode, freefloating.SemiColon, []freefloating.String{ + { + StringType: freefloating.TokenType, + Value: ";", + Position: &position.Position{ + StartLine: p.StartLine, + EndLine: p.StartLine, + StartPos: p.StartPos, + EndPos: p.StartPos + 1, + }, + }, + }) + } + + vlen := len(semiColon[0].Value) + tlen := 2 + if strings.HasSuffix(semiColon[0].Value, "?>\n") { + tlen = 3 + } + + phpCloseTag := []freefloating.String{} + if vlen-tlen > 1 { + phpCloseTag = append(phpCloseTag, freefloating.String{ + StringType: freefloating.WhiteSpaceType, + Value: semiColon[0].Value[1 : vlen-tlen], + Position: &position.Position{ + StartLine: p.StartLine, + EndLine: p.EndLine, + StartPos: p.StartPos + 1, + EndPos: p.EndPos - tlen, + }, + }) + } + + phpCloseTag = append(phpCloseTag, freefloating.String{ + StringType: freefloating.WhiteSpaceType, + Value: semiColon[0].Value[vlen-tlen:], + Position: &position.Position{ + StartLine: p.EndLine, + EndLine: p.EndLine, + StartPos: p.EndPos - tlen, + EndPos: p.EndPos, + }, + }) + + l.setFreeFloating(htmlNode, freefloating.Start, append(phpCloseTag, (*htmlNode.GetFreeFloating())[freefloating.Start]...)) } func (p *Parser) returnTokenToPool(yyDollar []yySymType, yyVAL *yySymType) { diff --git a/php5/php5.go b/php5/php5.go index 5728047..e27c885 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -8,7 +8,7 @@ import ( "strconv" "strings" - "github.com/z7zmey/php-parser/meta" + "github.com/z7zmey/php-parser/freefloating" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node/expr" "github.com/z7zmey/php-parser/node/expr/assign" @@ -346,7 +346,7 @@ const yyEofCode = 1 const yyErrCode = 2 const yyInitialStackSize = 16 -//line php5/php5.y:7271 +//line php5/php5.y:7204 type simpleIndirectReference struct { all []*expr.Variable @@ -2334,7 +2334,7 @@ yydefault: yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) if yylex.(*Parser).currentToken.Value == "\xff" { - yylex.(*Parser).currentToken.Meta.SetTokenName(meta.NodeEnd).AppendTo(yylex.(*Parser).rootNode.GetMeta()) + yylex.(*Parser).setFreeFloating(yylex.(*Parser).rootNode, freefloating.End, yylex.(*Parser).currentToken.FreeFloating) } } case 2: @@ -2343,7 +2343,7 @@ yydefault: { if inlineHtmlNode, ok := yyDollar[2].node.(*stmt.InlineHtml); ok && len(yyDollar[1].list) > 0 { prevNode := lastNode(yyDollar[1].list) - yylex.(*Parser).splitSemicolonTokenAndPhpCloseTag(inlineHtmlNode, prevNode) + yylex.(*Parser).splitSemiColonAndPhpCloseTag(inlineHtmlNode, prevNode) } if yyDollar[2].node != nil { @@ -2371,7 +2371,7 @@ yydefault: namePart.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(namePart.GetMeta()) + yylex.(*Parser).setFreeFloating(namePart, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2386,8 +2386,8 @@ yydefault: namePart.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(namePart.GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode(yyDollar[1].list), freefloating.End, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(namePart, freefloating.Start, yyDollar[3].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2434,11 +2434,11 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.HaltCompiller, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.OpenParenthesisToken, yyDollar[3].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.CloseParenthesisToken, yyDollar[4].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken(yyDollar[4].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -2456,15 +2456,16 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).MoveFreeFloating(yyDollar[2].list[0], name) + yylex.(*Parser).setFreeFloating(name, freefloating.End, yyDollar[3].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken(yyDollar[3].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 12: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:406 + //line php5/php5.y:407 { name := name.NewName(yyDollar[2].list) yyVAL.node = stmt.NewNamespace(name, yyDollar[4].list) @@ -2474,15 +2475,16 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[5].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[5].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).MoveFreeFloating(yyDollar[2].list[0], name) + yylex.(*Parser).setFreeFloating(name, freefloating.End, yyDollar[3].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Stmts, yyDollar[5].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 13: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:422 + //line php5/php5.y:424 { yyVAL.node = stmt.NewNamespace(nil, yyDollar[3].list) @@ -2490,15 +2492,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Namespace, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Stmts, yyDollar[4].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 14: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:436 + //line php5/php5.y:438 { yyVAL.node = stmt.NewUseList(nil, yyDollar[2].list) @@ -2506,15 +2508,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.UseDeclarationList, yyDollar[3].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken(yyDollar[3].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 15: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:450 + //line php5/php5.y:452 { useType := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewUseList(useType, yyDollar[3].list) @@ -2524,16 +2526,16 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(useType.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(useType, freefloating.Start, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.UseDeclarationList, yyDollar[4].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken(yyDollar[4].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 16: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:467 + //line php5/php5.y:469 { useType := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewUseList(useType, yyDollar[3].list) @@ -2543,16 +2545,16 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(useType.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(useType, freefloating.Start, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.UseDeclarationList, yyDollar[4].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken(yyDollar[4].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 17: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:484 + //line php5/php5.y:486 { yyVAL.node = yyDollar[1].node @@ -2560,25 +2562,25 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Stmts, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken(yyDollar[2].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 18: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:500 + //line php5/php5.y:502 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode(yyDollar[1].list), freefloating.End, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 19: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:509 + //line php5/php5.y:511 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -2586,7 +2588,7 @@ yydefault: } case 20: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:518 + //line php5/php5.y:520 { name := name.NewName(yyDollar[1].list) yyVAL.node = stmt.NewUse(nil, name, nil) @@ -2596,13 +2598,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) // save comments - yyDollar[1].list[0].GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].list[0], yyVAL.node) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 21: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:532 + //line php5/php5.y:534 { name := name.NewName(yyDollar[1].list) alias := node.NewIdentifier(yyDollar[3].token.Value) @@ -2614,16 +2616,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition(yyDollar[1].list, yyDollar[3].token)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.AsToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(alias.GetMeta()) - - yyDollar[1].list[0].GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].list[0], yyVAL.node) + yylex.(*Parser).setFreeFloating(name, freefloating.End, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(alias, freefloating.Start, yyDollar[3].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 22: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:551 + //line php5/php5.y:552 { name := name.NewName(yyDollar[2].list) yyVAL.node = stmt.NewUse(nil, name, nil) @@ -2633,15 +2634,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) - yyDollar[2].list[0].GetMeta().Cut(newInheritMetaFilter()).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Slash, yylex.(*Parser).GetFreeFloatingToken(yyDollar[1].token)) + yylex.(*Parser).MoveFreeFloating(yyDollar[2].list[0], name) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 23: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:567 + //line php5/php5.y:568 { name := name.NewName(yyDollar[2].list) alias := node.NewIdentifier(yyDollar[4].token.Value) @@ -2653,28 +2654,28 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition(yyDollar[2].list, yyDollar[4].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) - yyDollar[2].list[0].GetMeta().Cut(newInheritMetaFilter()).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.AsToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.NodeStart).AppendTo(alias.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Slash, yylex.(*Parser).GetFreeFloatingToken(yyDollar[1].token)) + yylex.(*Parser).MoveFreeFloating(yyDollar[2].list[0], name) + yylex.(*Parser).setFreeFloating(name, freefloating.End, yyDollar[3].token.FreeFloating) + yylex.(*Parser).setFreeFloating(alias, freefloating.Start, yyDollar[4].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 24: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:590 + //line php5/php5.y:591 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode(yyDollar[1].list), freefloating.End, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 25: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:599 + //line php5/php5.y:600 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -2682,7 +2683,7 @@ yydefault: } case 26: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:608 + //line php5/php5.y:609 { name := name.NewName(yyDollar[1].list) yyVAL.node = stmt.NewUse(nil, name, nil) @@ -2692,13 +2693,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) // save comments - yyDollar[1].list[0].GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].list[0], yyVAL.node) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 27: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:622 + //line php5/php5.y:623 { name := name.NewName(yyDollar[1].list) alias := node.NewIdentifier(yyDollar[3].token.Value) @@ -2710,15 +2711,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition(yyDollar[1].list, yyDollar[3].token)) // save comments - yyDollar[1].list[0].GetMeta().Cut(newInheritMetaFilter()).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.AsToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(alias.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].list[0], yyVAL.node) + yylex.(*Parser).setFreeFloating(name, freefloating.End, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(alias, freefloating.Start, yyDollar[3].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 28: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:640 + //line php5/php5.y:641 { name := name.NewName(yyDollar[2].list) yyVAL.node = stmt.NewUse(nil, name, nil) @@ -2728,15 +2729,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) - yyDollar[2].list[0].GetMeta().Cut(newInheritMetaFilter()).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Slash, yylex.(*Parser).GetFreeFloatingToken(yyDollar[1].token)) + yylex.(*Parser).MoveFreeFloating(yyDollar[2].list[0], name) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 29: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:656 + //line php5/php5.y:657 { name := name.NewName(yyDollar[2].list) alias := node.NewIdentifier(yyDollar[4].token.Value) @@ -2748,28 +2749,28 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition(yyDollar[2].list, yyDollar[4].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) - yyDollar[2].list[0].GetMeta().Cut(newInheritMetaFilter()).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.AsToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.NodeStart).AppendTo(alias.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Slash, yylex.(*Parser).GetFreeFloatingToken(yyDollar[1].token)) + yylex.(*Parser).MoveFreeFloating(yyDollar[2].list[0], name) + yylex.(*Parser).setFreeFloating(name, freefloating.End, yyDollar[3].token.FreeFloating) + yylex.(*Parser).setFreeFloating(alias, freefloating.Start, yyDollar[4].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 30: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:679 + //line php5/php5.y:680 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode(yyDollar[1].list), freefloating.End, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 31: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:688 + //line php5/php5.y:689 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -2777,7 +2778,7 @@ yydefault: } case 32: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:697 + //line php5/php5.y:698 { name := name.NewName(yyDollar[1].list) yyVAL.node = stmt.NewUse(nil, name, nil) @@ -2787,13 +2788,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) // save comments - yyDollar[1].list[0].GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].list[0], yyVAL.node) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 33: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:711 + //line php5/php5.y:712 { name := name.NewName(yyDollar[1].list) alias := node.NewIdentifier(yyDollar[3].token.Value) @@ -2805,15 +2806,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition(yyDollar[1].list, yyDollar[3].token)) // save comments - yyDollar[1].list[0].GetMeta().Cut(newInheritMetaFilter()).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.AsToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(alias.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].list[0], yyVAL.node) + yylex.(*Parser).setFreeFloating(name, freefloating.End, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(alias, freefloating.Start, yyDollar[3].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 34: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:729 + //line php5/php5.y:730 { name := name.NewName(yyDollar[2].list) yyVAL.node = stmt.NewUse(nil, name, nil) @@ -2823,15 +2824,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) - yyDollar[2].list[0].GetMeta().Cut(newInheritMetaFilter()).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Slash, yylex.(*Parser).GetFreeFloatingToken(yyDollar[1].token)) + yylex.(*Parser).MoveFreeFloating(yyDollar[2].list[0], name) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 35: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:745 + //line php5/php5.y:746 { name := name.NewName(yyDollar[2].list) alias := node.NewIdentifier(yyDollar[4].token.Value) @@ -2843,17 +2844,17 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition(yyDollar[2].list, yyDollar[4].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) - yyDollar[2].list[0].GetMeta().Cut(newInheritMetaFilter()).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.AsToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.NodeStart).AppendTo(alias.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Slash, yylex.(*Parser).GetFreeFloatingToken(yyDollar[1].token)) + yylex.(*Parser).MoveFreeFloating(yyDollar[2].list[0], name) + yylex.(*Parser).setFreeFloating(name, freefloating.End, yyDollar[3].token.FreeFloating) + yylex.(*Parser).setFreeFloating(alias, freefloating.Start, yyDollar[4].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 36: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:768 + //line php5/php5.y:769 { name := node.NewIdentifier(yyDollar[3].token.Value) constant := stmt.NewConstant(name, yyDollar[5].node, "") @@ -2868,15 +2869,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeNodeListPosition(yyDollar[1].node, constList.Consts)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastConst.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(constant.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.EqualToken).AppendTo(constant.GetMeta()) + yylex.(*Parser).setFreeFloating(lastConst, freefloating.End, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(constant, freefloating.Start, yyDollar[3].token.FreeFloating) + yylex.(*Parser).setFreeFloating(constant, freefloating.Name, yyDollar[4].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 37: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:789 + //line php5/php5.y:790 { name := node.NewIdentifier(yyDollar[2].token.Value) constant := stmt.NewConstant(name, yyDollar[4].node, "") @@ -2889,19 +2890,19 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, constList)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(constant.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.EqualToken).AppendTo(constant.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(constant, freefloating.Start, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(constant, freefloating.Name, yyDollar[3].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 38: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:811 + //line php5/php5.y:812 { if inlineHtmlNode, ok := yyDollar[2].node.(*stmt.InlineHtml); ok && len(yyDollar[1].list) > 0 { prevNode := lastNode(yyDollar[1].list) - yylex.(*Parser).splitSemicolonTokenAndPhpCloseTag(inlineHtmlNode, prevNode) + yylex.(*Parser).splitSemiColonAndPhpCloseTag(inlineHtmlNode, prevNode) } if yyDollar[2].node != nil { @@ -2912,7 +2913,7 @@ yydefault: } case 39: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:824 + //line php5/php5.y:825 { yyVAL.list = []node.Node{} @@ -2920,7 +2921,7 @@ yydefault: } case 40: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:834 + //line php5/php5.y:835 { // error yyVAL.node = nil @@ -2929,7 +2930,7 @@ yydefault: } case 41: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:841 + //line php5/php5.y:842 { yyVAL.node = yyDollar[1].node @@ -2937,7 +2938,7 @@ yydefault: } case 42: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:847 + //line php5/php5.y:848 { yyVAL.node = yyDollar[1].node @@ -2945,7 +2946,7 @@ yydefault: } case 43: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:853 + //line php5/php5.y:854 { yyVAL.node = yyDollar[1].node @@ -2953,7 +2954,7 @@ yydefault: } case 44: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:859 + //line php5/php5.y:860 { yyVAL.node = stmt.NewHaltCompiler() @@ -2961,17 +2962,19 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.HaltCompiller, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.OpenParenthesisToken, yyDollar[3].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.CloseParenthesisToken, yyDollar[4].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken(yyDollar[4].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + + yylex.(*Parser).Begin(scanner.HALT_COMPILER) } case 45: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:879 + //line php5/php5.y:882 { yyVAL.node = yyDollar[1].node @@ -2979,7 +2982,7 @@ yydefault: } case 46: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:885 + //line php5/php5.y:888 { label := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewLabel(label) @@ -2989,14 +2992,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.ColonToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Label, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 47: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:903 + //line php5/php5.y:906 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) @@ -3004,14 +3007,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Stmts, yyDollar[3].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 48: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:916 + //line php5/php5.y:919 { yyVAL.node = stmt.NewIf(yyDollar[2].node, yyDollar[3].node, yyDollar[4].list, yyDollar[5].node) @@ -3025,15 +3028,21 @@ yydefault: } // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].node.GetMeta().Cut(meta.TokenNameFilter(meta.OpenParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].node.GetMeta().Cut(meta.TokenNameFilter(meta.CloseParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + if len((*yyDollar[2].node.GetFreeFloating())[freefloating.OpenParenthesisToken]) > 0 { + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.If, (*yyDollar[2].node.GetFreeFloating())[freefloating.OpenParenthesisToken][:len((*yyDollar[2].node.GetFreeFloating())[freefloating.OpenParenthesisToken])-1]) + delete((*yyDollar[2].node.GetFreeFloating()), freefloating.OpenParenthesisToken) + } + if len((*yyDollar[2].node.GetFreeFloating())[freefloating.CloseParenthesisToken]) > 0 { + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, (*yyDollar[2].node.GetFreeFloating())[freefloating.CloseParenthesisToken][:len((*yyDollar[2].node.GetFreeFloating())[freefloating.CloseParenthesisToken])-1]) + delete((*yyDollar[2].node.GetFreeFloating()), freefloating.CloseParenthesisToken) + } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 49: yyDollar = yyS[yypt-8 : yypt+1] - //line php5/php5.y:936 + //line php5/php5.y:943 { stmts := stmt.NewStmtList(yyDollar[4].list) yyVAL.node = stmt.NewAltIf(yyDollar[2].node, stmts, yyDollar[5].list, yyDollar[6].node) @@ -3043,19 +3052,25 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[8].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].node.GetMeta().Cut(meta.TokenNameFilter(meta.OpenParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].node.GetMeta().Cut(meta.TokenNameFilter(meta.CloseParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.ColonToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[7].token.Meta.SetTokenName(meta.EndifToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[8].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[8].token, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + if len((*yyDollar[2].node.GetFreeFloating())[freefloating.OpenParenthesisToken]) > 0 { + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.If, (*yyDollar[2].node.GetFreeFloating())[freefloating.OpenParenthesisToken][:len((*yyDollar[2].node.GetFreeFloating())[freefloating.OpenParenthesisToken])-1]) + delete((*yyDollar[2].node.GetFreeFloating()), freefloating.OpenParenthesisToken) + } + if len((*yyDollar[2].node.GetFreeFloating())[freefloating.CloseParenthesisToken]) > 0 { + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, (*yyDollar[2].node.GetFreeFloating())[freefloating.CloseParenthesisToken][:len((*yyDollar[2].node.GetFreeFloating())[freefloating.CloseParenthesisToken])-1]) + delete((*yyDollar[2].node.GetFreeFloating()), freefloating.CloseParenthesisToken) + } + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Cond, yyDollar[3].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Stmts, yyDollar[7].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.AltEnd, yyDollar[8].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken(yyDollar[8].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 50: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:956 + //line php5/php5.y:967 { switch n := yyDollar[3].node.(type) { case *stmt.While: @@ -3070,15 +3085,21 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].node.GetMeta().Cut(meta.TokenNameFilter(meta.OpenParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].node.GetMeta().Cut(meta.TokenNameFilter(meta.CloseParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + if len((*yyDollar[2].node.GetFreeFloating())[freefloating.OpenParenthesisToken]) > 0 { + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.While, (*yyDollar[2].node.GetFreeFloating())[freefloating.OpenParenthesisToken][:len((*yyDollar[2].node.GetFreeFloating())[freefloating.OpenParenthesisToken])-1]) + delete((*yyDollar[2].node.GetFreeFloating()), freefloating.OpenParenthesisToken) + } + if len((*yyDollar[2].node.GetFreeFloating())[freefloating.CloseParenthesisToken]) > 0 { + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, (*yyDollar[2].node.GetFreeFloating())[freefloating.CloseParenthesisToken][:len((*yyDollar[2].node.GetFreeFloating())[freefloating.CloseParenthesisToken])-1]) + delete((*yyDollar[2].node.GetFreeFloating()), freefloating.CloseParenthesisToken) + } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 51: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:977 + //line php5/php5.y:992 { yyVAL.node = stmt.NewDo(yyDollar[2].node, yyDollar[4].node) @@ -3086,18 +3107,24 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[5].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.WhileToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[4].node.GetMeta().Cut(meta.TokenNameFilter(meta.OpenParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo(yyVAL.node.GetMeta()) - yyDollar[4].node.GetMeta().Cut(meta.TokenNameFilter(meta.CloseParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo(yyVAL.node.GetMeta()) - yyDollar[5].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[5].token, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Stmts, yyDollar[3].token.FreeFloating) + if len((*yyDollar[4].node.GetFreeFloating())[freefloating.OpenParenthesisToken]) > 0 { + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.While, (*yyDollar[4].node.GetFreeFloating())[freefloating.OpenParenthesisToken][:len((*yyDollar[4].node.GetFreeFloating())[freefloating.OpenParenthesisToken])-1]) + delete((*yyDollar[4].node.GetFreeFloating()), freefloating.OpenParenthesisToken) + } + if len((*yyDollar[4].node.GetFreeFloating())[freefloating.CloseParenthesisToken]) > 0 { + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, (*yyDollar[4].node.GetFreeFloating())[freefloating.CloseParenthesisToken][:len((*yyDollar[4].node.GetFreeFloating())[freefloating.CloseParenthesisToken])-1]) + delete((*yyDollar[4].node.GetFreeFloating()), freefloating.CloseParenthesisToken) + } + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Cond, yyDollar[5].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken(yyDollar[5].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 52: yyDollar = yyS[yypt-9 : yypt+1] - //line php5/php5.y:994 + //line php5/php5.y:1013 { switch n := yyDollar[9].node.(type) { case *stmt.For: @@ -3116,17 +3143,17 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[9].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.ForInitSemicolonToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[6].token.Meta.SetTokenName(meta.ForCondSemicolonToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[8].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.For, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.InitExpr, yyDollar[4].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.CondExpr, yyDollar[6].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.IncExpr, yyDollar[8].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 53: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1021 + //line php5/php5.y:1040 { switch n := yyDollar[3].node.(type) { case *stmt.Switch: @@ -3143,15 +3170,21 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].node.GetMeta().Cut(meta.TokenNameFilter(meta.OpenParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].node.GetMeta().Cut(meta.TokenNameFilter(meta.CloseParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + if len((*yyDollar[2].node.GetFreeFloating())[freefloating.OpenParenthesisToken]) > 0 { + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Switch, (*yyDollar[2].node.GetFreeFloating())[freefloating.OpenParenthesisToken][:len((*yyDollar[2].node.GetFreeFloating())[freefloating.OpenParenthesisToken])-1]) + delete((*yyDollar[2].node.GetFreeFloating()), freefloating.OpenParenthesisToken) + } + if len((*yyDollar[2].node.GetFreeFloating())[freefloating.CloseParenthesisToken]) > 0 { + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, (*yyDollar[2].node.GetFreeFloating())[freefloating.CloseParenthesisToken][:len((*yyDollar[2].node.GetFreeFloating())[freefloating.CloseParenthesisToken])-1]) + delete((*yyDollar[2].node.GetFreeFloating()), freefloating.CloseParenthesisToken) + } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 54: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1044 + //line php5/php5.y:1067 { yyVAL.node = stmt.NewBreak(nil) @@ -3159,15 +3192,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken(yyDollar[2].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 55: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1058 + //line php5/php5.y:1081 { yyVAL.node = stmt.NewBreak(yyDollar[2].node) @@ -3175,15 +3208,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[3].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken(yyDollar[3].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 56: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1072 + //line php5/php5.y:1095 { yyVAL.node = stmt.NewContinue(nil) @@ -3191,15 +3224,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken(yyDollar[2].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 57: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1086 + //line php5/php5.y:1109 { yyVAL.node = stmt.NewContinue(yyDollar[2].node) @@ -3207,15 +3240,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[3].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken(yyDollar[3].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 58: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1100 + //line php5/php5.y:1123 { yyVAL.node = stmt.NewReturn(nil) @@ -3223,15 +3256,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken(yyDollar[2].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 59: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1114 + //line php5/php5.y:1137 { yyVAL.node = stmt.NewReturn(yyDollar[2].node) @@ -3239,15 +3272,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[3].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken(yyDollar[3].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 60: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1128 + //line php5/php5.y:1151 { yyVAL.node = stmt.NewReturn(yyDollar[2].node) @@ -3255,15 +3288,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[3].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken(yyDollar[3].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 61: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1142 + //line php5/php5.y:1165 { yyVAL.node = stmt.NewExpression(yyDollar[1].node) @@ -3271,16 +3304,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.SemiColonToken) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken(yyDollar[2].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 62: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1157 + //line php5/php5.y:1179 { yyVAL.node = stmt.NewGlobal(yyDollar[2].list) @@ -3288,15 +3320,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.VarList, yyDollar[3].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken(yyDollar[3].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 63: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1171 + //line php5/php5.y:1193 { yyVAL.node = stmt.NewStatic(yyDollar[2].list) @@ -3304,15 +3336,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.VarList, yyDollar[3].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken(yyDollar[3].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 64: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1185 + //line php5/php5.y:1207 { yyVAL.node = stmt.NewEcho(yyDollar[2].list) @@ -3320,16 +3352,16 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) - yyDollar[3].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Echo, yylex.(*Parser).GetFreeFloatingToken(yyDollar[1].token)) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[3].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken(yyDollar[3].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 65: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1200 + //line php5/php5.y:1222 { yyVAL.node = stmt.NewInlineHtml(yyDollar[1].token.Value) @@ -3337,13 +3369,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 66: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1212 + //line php5/php5.y:1234 { yyVAL.node = stmt.NewExpression(yyDollar[1].node) @@ -3351,16 +3383,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.SemiColonToken) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken(yyDollar[2].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 67: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1227 + //line php5/php5.y:1248 { yyVAL.node = stmt.NewUnset(yyDollar[3].list) @@ -3368,17 +3399,17 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[5].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[5].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[5].token, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Unset, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.VarList, yyDollar[4].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.CloseParenthesisToken, yyDollar[5].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken(yyDollar[5].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 68: yyDollar = yyS[yypt-8 : yypt+1] - //line php5/php5.y:1243 + //line php5/php5.y:1264 { if yyDollar[6].node == nil { switch n := yyDollar[8].node.(type) { @@ -3408,19 +3439,20 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[8].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.AsToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Foreach, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[4].token.FreeFloating) if yyDollar[6].node != nil { - yyDollar[6].node.GetMeta().Cut(meta.TokenNameFilter(meta.DoubleArrowToken)).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Key, (*yyDollar[6].node.GetFreeFloating())[freefloating.Key]) + delete((*yyDollar[6].node.GetFreeFloating()), freefloating.Key) } - yyDollar[7].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Var, yyDollar[7].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 69: yyDollar = yyS[yypt-8 : yypt+1] - //line php5/php5.y:1283 + //line php5/php5.y:1304 { if yyDollar[6].node == nil { switch n := yyDollar[8].node.(type) { @@ -3450,19 +3482,20 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[8].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.AsToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Foreach, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[4].token.FreeFloating) if yyDollar[6].node != nil { - yyDollar[6].node.GetMeta().Cut(meta.TokenNameFilter(meta.DoubleArrowToken)).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Key, (*yyDollar[6].node.GetFreeFloating())[freefloating.Key]) + delete((*yyDollar[6].node.GetFreeFloating()), freefloating.Key) } - yyDollar[7].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Var, yyDollar[7].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 70: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1323 + //line php5/php5.y:1344 { yyVAL.node = yyDollar[5].node yyVAL.node.(*stmt.Declare).Consts = yyDollar[3].list @@ -3471,15 +3504,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[5].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Declare, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.ConstList, yyDollar[4].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 71: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1338 + //line php5/php5.y:1359 { yyVAL.node = stmt.NewNop() @@ -3487,14 +3520,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken(yyDollar[1].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 72: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:1351 + //line php5/php5.y:1372 { yyVAL.node = stmt.NewTry(yyDollar[3].list, yyDollar[5].list, yyDollar[6].node) @@ -3506,15 +3539,15 @@ yydefault: } // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Try, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Stmts, yyDollar[4].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 73: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1369 + //line php5/php5.y:1390 { yyVAL.node = stmt.NewThrow(yyDollar[2].node) @@ -3522,15 +3555,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[3].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken(yyDollar[3].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 74: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1383 + //line php5/php5.y:1404 { label := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewGoto(label) @@ -3540,16 +3573,16 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(label.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(label, freefloating.Start, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Label, yyDollar[3].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken(yyDollar[3].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 75: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1403 + //line php5/php5.y:1424 { yyVAL.list = []node.Node{} @@ -3557,32 +3590,32 @@ yydefault: } case 76: yyDollar = yyS[yypt-9 : yypt+1] - //line php5/php5.y:1409 + //line php5/php5.y:1430 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[4].token.Value, isDollar)) variable := expr.NewVariable(identifier) - catch := stmt.NewCatch([]node.Node{yyDollar[3].node}, variable, yyDollar[7].list) - yyVAL.list = append([]node.Node{catch}, yyDollar[9].list...) + catchNode := stmt.NewCatch([]node.Node{yyDollar[3].node}, variable, yyDollar[7].list) + yyVAL.list = append([]node.Node{catchNode}, yyDollar[9].list...) // save position identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) - catch.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[8].token)) + catchNode.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[8].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(catch.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(catch.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) - yyDollar[5].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(catch.GetMeta()) - yyDollar[6].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(catch.GetMeta()) - yyDollar[8].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(catch.GetMeta()) + yylex.(*Parser).setFreeFloating(catchNode, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(catchNode, freefloating.Catch, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(variable, freefloating.Start, yyDollar[4].token.FreeFloating) + yylex.(*Parser).addDollarToken(variable) + yylex.(*Parser).setFreeFloating(catchNode, freefloating.Var, yyDollar[5].token.FreeFloating) + yylex.(*Parser).setFreeFloating(catchNode, freefloating.Cond, yyDollar[6].token.FreeFloating) + yylex.(*Parser).setFreeFloating(catchNode, freefloating.Stmts, yyDollar[8].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 77: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1435 + //line php5/php5.y:1456 { yyVAL.node = nil @@ -3590,7 +3623,7 @@ yydefault: } case 78: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1441 + //line php5/php5.y:1462 { yyVAL.node = stmt.NewFinally(yyDollar[3].list) @@ -3598,15 +3631,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Finally, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Stmts, yyDollar[4].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 79: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1458 + //line php5/php5.y:1479 { yyVAL.list = yyDollar[1].list @@ -3614,7 +3647,7 @@ yydefault: } case 80: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1464 + //line php5/php5.y:1485 { yyVAL.list = []node.Node{} @@ -3622,7 +3655,7 @@ yydefault: } case 81: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1473 + //line php5/php5.y:1494 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -3630,7 +3663,7 @@ yydefault: } case 82: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1479 + //line php5/php5.y:1500 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -3638,7 +3671,7 @@ yydefault: } case 83: yyDollar = yyS[yypt-8 : yypt+1] - //line php5/php5.y:1488 + //line php5/php5.y:1509 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[4].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -3650,19 +3683,19 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[8].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) - yyDollar[5].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[6].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[8].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Catch, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(variable, freefloating.Start, yyDollar[4].token.FreeFloating) + yylex.(*Parser).addDollarToken(variable) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Var, yyDollar[5].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Cond, yyDollar[6].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Stmts, yyDollar[8].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 84: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1513 + //line php5/php5.y:1534 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -3670,18 +3703,18 @@ yydefault: } case 85: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1519 + //line php5/php5.y:1540 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode(yyDollar[1].list), freefloating.End, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 86: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1531 + //line php5/php5.y:1552 { yyVAL.node = yyDollar[1].node @@ -3689,7 +3722,7 @@ yydefault: } case 87: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1540 + //line php5/php5.y:1561 { yyVAL.node = yyDollar[1].node @@ -3697,7 +3730,7 @@ yydefault: } case 88: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1549 + //line php5/php5.y:1570 { yyVAL.node = yyDollar[1].node @@ -3705,31 +3738,31 @@ yydefault: } case 89: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1558 + //line php5/php5.y:1579 { yyVAL.token = nil } case 90: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1562 + //line php5/php5.y:1583 { yyVAL.token = yyDollar[1].token } case 91: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1569 + //line php5/php5.y:1590 { yyVAL.token = nil } case 92: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1573 + //line php5/php5.y:1594 { yyVAL.token = yyDollar[1].token } case 93: yyDollar = yyS[yypt-9 : yypt+1] - //line php5/php5.y:1580 + //line php5/php5.y:1601 { name := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewFunction(name, yyDollar[2].token != nil, yyDollar[5].list, nil, yyDollar[8].list, "") @@ -3739,21 +3772,23 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[9].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) if yyDollar[2].token != nil { - yyDollar[2].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Function, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(name, freefloating.Start, yyDollar[3].token.FreeFloating) + } else { + yylex.(*Parser).setFreeFloating(name, freefloating.Start, yyDollar[3].token.FreeFloating) } - yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[6].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[7].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[9].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Name, yyDollar[4].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.ParamList, yyDollar[6].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Params, yyDollar[7].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Stmts, yyDollar[9].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 94: yyDollar = yyS[yypt-7 : yypt+1] - //line php5/php5.y:1605 + //line php5/php5.y:1628 { name := node.NewIdentifier(yyDollar[2].token.Value) switch n := yyDollar[1].node.(type) { @@ -3775,15 +3810,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[7].token)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) - yyDollar[5].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[7].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(name, freefloating.Start, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Name, yyDollar[5].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Stmts, yyDollar[7].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 95: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:1633 + //line php5/php5.y:1656 { name := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewInterface(name, yyDollar[3].InterfaceExtends, yyDollar[5].list, "") @@ -3793,16 +3828,16 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[6].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[6].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(name, freefloating.Start, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Name, yyDollar[4].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Stmts, yyDollar[6].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 96: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1654 + //line php5/php5.y:1677 { yyVAL.node = stmt.NewClass(nil, nil, nil, nil, nil, nil, "") @@ -3810,13 +3845,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 97: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1666 + //line php5/php5.y:1689 { classModifier := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewClass(nil, []node.Node{classModifier}, nil, nil, nil, nil, "") @@ -3826,14 +3861,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.ClassToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.ModifierList, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 98: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1681 + //line php5/php5.y:1704 { yyVAL.node = stmt.NewTrait(nil, nil, "") @@ -3841,13 +3876,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 99: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1693 + //line php5/php5.y:1716 { classModifier := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewClass(nil, []node.Node{classModifier}, nil, nil, nil, nil, "") @@ -3857,14 +3892,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.ClassToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.ModifierList, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 100: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1711 + //line php5/php5.y:1734 { yyVAL.ClassExtends = nil @@ -3872,7 +3907,7 @@ yydefault: } case 101: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1717 + //line php5/php5.y:1740 { yyVAL.ClassExtends = stmt.NewClassExtends(yyDollar[2].node) @@ -3880,19 +3915,19 @@ yydefault: yyVAL.ClassExtends.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.ExtendsToken).AppendTo(yyVAL.ClassExtends.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.ClassExtends, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 102: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1732 + //line php5/php5.y:1755 { yyVAL.token = yyDollar[1].token } case 103: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1739 + //line php5/php5.y:1762 { yyVAL.InterfaceExtends = nil @@ -3900,7 +3935,7 @@ yydefault: } case 104: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1745 + //line php5/php5.y:1768 { yyVAL.InterfaceExtends = stmt.NewInterfaceExtends(yyDollar[2].list) @@ -3908,13 +3943,13 @@ yydefault: yyVAL.InterfaceExtends.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.ExtendsToken).AppendTo(yyVAL.InterfaceExtends.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.InterfaceExtends, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 105: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1760 + //line php5/php5.y:1783 { yyVAL.ClassImplements = nil @@ -3922,7 +3957,7 @@ yydefault: } case 106: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1766 + //line php5/php5.y:1789 { yyVAL.ClassImplements = stmt.NewClassImplements(yyDollar[2].list) @@ -3930,13 +3965,13 @@ yydefault: yyVAL.ClassImplements.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.ImplementsToken).AppendTo(yyVAL.ClassImplements.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.ClassImplements, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 107: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1781 + //line php5/php5.y:1804 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -3944,18 +3979,18 @@ yydefault: } case 108: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1787 + //line php5/php5.y:1810 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode(yyDollar[1].list), freefloating.End, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 109: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1799 + //line php5/php5.y:1822 { yyVAL.node = nil @@ -3963,18 +3998,18 @@ yydefault: } case 110: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1805 + //line php5/php5.y:1828 { yyVAL.node = yyDollar[2].node // save comments - yyDollar[1].token.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Key, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 111: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1817 + //line php5/php5.y:1840 { yyVAL.node = yyDollar[1].node @@ -3982,7 +4017,7 @@ yydefault: } case 112: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1823 + //line php5/php5.y:1846 { yyVAL.node = expr.NewReference(yyDollar[2].node) @@ -3990,13 +4025,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 113: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1835 + //line php5/php5.y:1858 { yyVAL.node = expr.NewList(yyDollar[3].list) @@ -4004,15 +4039,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.List, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.ArrayPairList, yyDollar[4].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 114: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1852 + //line php5/php5.y:1875 { yyVAL.node = stmt.NewFor(nil, nil, nil, yyDollar[1].node) @@ -4023,7 +4058,7 @@ yydefault: } case 115: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1861 + //line php5/php5.y:1884 { stmtList := stmt.NewStmtList(yyDollar[2].list) yyVAL.node = stmt.NewAltFor(nil, nil, nil, stmtList) @@ -4033,16 +4068,16 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.ColonToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.EndforToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Cond, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Stmts, yyDollar[3].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.AltEnd, yyDollar[4].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken(yyDollar[4].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 116: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1881 + //line php5/php5.y:1904 { yyVAL.node = stmt.NewForeach(nil, nil, nil, yyDollar[1].node) @@ -4053,7 +4088,7 @@ yydefault: } case 117: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1890 + //line php5/php5.y:1913 { stmtList := stmt.NewStmtList(yyDollar[2].list) yyVAL.node = stmt.NewAltForeach(nil, nil, nil, stmtList) @@ -4063,16 +4098,16 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.ColonToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.EndforeachToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Cond, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Stmts, yyDollar[3].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.AltEnd, yyDollar[4].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken(yyDollar[4].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 118: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1911 + //line php5/php5.y:1934 { yyVAL.node = stmt.NewDeclare(nil, yyDollar[1].node, false) @@ -4083,7 +4118,7 @@ yydefault: } case 119: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1920 + //line php5/php5.y:1943 { stmtList := stmt.NewStmtList(yyDollar[2].list) yyVAL.node = stmt.NewDeclare(nil, stmtList, true) @@ -4093,16 +4128,16 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.ColonToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.EnddeclareToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Cond, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Stmts, yyDollar[3].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.AltEnd, yyDollar[4].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken(yyDollar[4].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 120: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1941 + //line php5/php5.y:1964 { name := node.NewIdentifier(yyDollar[1].token.Value) constant := stmt.NewConstant(name, yyDollar[3].node, "") @@ -4113,14 +4148,14 @@ yydefault: constant.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(constant.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.EqualToken).AppendTo(constant.GetMeta()) + yylex.(*Parser).setFreeFloating(constant, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(constant, freefloating.Name, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 121: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1957 + //line php5/php5.y:1980 { name := node.NewIdentifier(yyDollar[3].token.Value) constant := stmt.NewConstant(name, yyDollar[5].node, "") @@ -4131,15 +4166,15 @@ yydefault: constant.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[3].token, yyDollar[5].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(constant.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.EqualToken).AppendTo(constant.GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode(yyDollar[1].list), freefloating.End, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(constant, freefloating.Start, yyDollar[3].token.FreeFloating) + yylex.(*Parser).setFreeFloating(constant, freefloating.Name, yyDollar[4].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 122: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1978 + //line php5/php5.y:2001 { caseList := stmt.NewCaseList(yyDollar[2].list) yyVAL.node = stmt.NewSwitch(nil, caseList) @@ -4149,14 +4184,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(caseList.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(caseList.GetMeta()) + yylex.(*Parser).setFreeFloating(caseList, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(caseList, freefloating.CaseListEnd, yyDollar[3].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 123: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1993 + //line php5/php5.y:2016 { caseList := stmt.NewCaseList(yyDollar[3].list) yyVAL.node = stmt.NewSwitch(nil, caseList) @@ -4166,16 +4201,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(caseList.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.CaseSeparatorToken).AppendTo(caseList.GetMeta()) - yylex.(*Parser).appendMetaToken(caseList, yyDollar[2].token, meta.CaseSeparatorToken) - yyDollar[4].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(caseList.GetMeta()) + yylex.(*Parser).setFreeFloating(caseList, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(caseList, freefloating.CaseListStart, append(yyDollar[2].token.FreeFloating, yylex.(*Parser).GetFreeFloatingToken(yyDollar[2].token)...)) + yylex.(*Parser).setFreeFloating(caseList, freefloating.CaseListEnd, yyDollar[4].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 124: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2010 + //line php5/php5.y:2032 { caseList := stmt.NewCaseList(yyDollar[2].list) yyVAL.node = stmt.NewAltSwitch(nil, caseList) @@ -4185,16 +4219,16 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.ColonToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.EndswitchToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Cond, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(caseList, freefloating.CaseListEnd, yyDollar[3].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.AltEnd, yyDollar[4].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken(yyDollar[4].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 125: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:2027 + //line php5/php5.y:2049 { caseList := stmt.NewCaseList(yyDollar[3].list) @@ -4205,18 +4239,17 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[5].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.ColonToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.CaseSeparatorToken).AppendTo(caseList.GetMeta()) - yylex.(*Parser).appendMetaToken(caseList, yyDollar[2].token, meta.CaseSeparatorToken) - yyDollar[4].token.Meta.SetTokenName(meta.EndswitchToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[5].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[5].token, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Cond, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(caseList, freefloating.CaseListStart, append(yyDollar[2].token.FreeFloating, yylex.(*Parser).GetFreeFloatingToken(yyDollar[2].token)...)) + yylex.(*Parser).setFreeFloating(caseList, freefloating.CaseListEnd, yyDollar[4].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.AltEnd, yyDollar[5].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken(yyDollar[5].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 126: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2051 + //line php5/php5.y:2072 { yyVAL.list = []node.Node{} @@ -4224,7 +4257,7 @@ yydefault: } case 127: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:2057 + //line php5/php5.y:2078 { _case := stmt.NewCase(yyDollar[3].node, yyDollar[5].list) yyVAL.list = append(yyDollar[1].list, _case) @@ -4233,15 +4266,15 @@ yydefault: _case.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[5].list)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(_case.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.CaseSeparatorToken).AppendTo(_case.GetMeta()) - yylex.(*Parser).appendMetaToken(_case, yyDollar[4].token, meta.CaseSeparatorToken) + yylex.(*Parser).setFreeFloating(_case, freefloating.Start, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(_case, freefloating.Expr, yyDollar[4].token.FreeFloating) + yylex.(*Parser).setFreeFloating(_case, freefloating.CaseSeparator, yylex.(*Parser).GetFreeFloatingToken(yyDollar[4].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 128: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2072 + //line php5/php5.y:2093 { _default := stmt.NewDefault(yyDollar[4].list) yyVAL.list = append(yyDollar[1].list, _default) @@ -4250,27 +4283,27 @@ yydefault: _default.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[4].list)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(_default.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.CaseSeparatorToken).AppendTo(_default.GetMeta()) - yylex.(*Parser).appendMetaToken(_default, yyDollar[3].token, meta.CaseSeparatorToken) + yylex.(*Parser).setFreeFloating(_default, freefloating.Start, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(_default, freefloating.Default, yyDollar[3].token.FreeFloating) + yylex.(*Parser).setFreeFloating(_default, freefloating.CaseSeparator, yylex.(*Parser).GetFreeFloatingToken(yyDollar[3].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 129: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2091 + //line php5/php5.y:2112 { yyVAL.token = yyDollar[1].token } case 130: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2095 + //line php5/php5.y:2116 { yyVAL.token = yyDollar[1].token } case 131: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2103 + //line php5/php5.y:2124 { yyVAL.node = stmt.NewWhile(nil, yyDollar[1].node) @@ -4281,7 +4314,7 @@ yydefault: } case 132: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2112 + //line php5/php5.y:2133 { stmtList := stmt.NewStmtList(yyDollar[2].list) yyVAL.node = stmt.NewAltWhile(nil, stmtList) @@ -4291,16 +4324,16 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.ColonToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.EndwhileToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Cond, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Stmts, yyDollar[3].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.AltEnd, yyDollar[4].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken(yyDollar[4].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 133: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2134 + //line php5/php5.y:2155 { yyVAL.list = nil @@ -4308,7 +4341,7 @@ yydefault: } case 134: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2140 + //line php5/php5.y:2161 { _elseIf := stmt.NewElseIf(yyDollar[3].node, yyDollar[4].node) yyVAL.list = append(yyDollar[1].list, _elseIf) @@ -4317,15 +4350,21 @@ yydefault: _elseIf.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[2].token, yyDollar[4].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(_elseIf.GetMeta()) - yyDollar[3].node.GetMeta().Cut(meta.TokenNameFilter(meta.OpenParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo(_elseIf.GetMeta()) - yyDollar[3].node.GetMeta().Cut(meta.TokenNameFilter(meta.CloseParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo(_elseIf.GetMeta()) + yylex.(*Parser).setFreeFloating(_elseIf, freefloating.Start, yyDollar[2].token.FreeFloating) + if len((*yyDollar[3].node.GetFreeFloating())[freefloating.OpenParenthesisToken]) > 0 { + yylex.(*Parser).setFreeFloating(_elseIf, freefloating.ElseIf, (*yyDollar[3].node.GetFreeFloating())[freefloating.OpenParenthesisToken][:len((*yyDollar[3].node.GetFreeFloating())[freefloating.OpenParenthesisToken])-1]) + delete((*yyDollar[3].node.GetFreeFloating()), freefloating.OpenParenthesisToken) + } + if len((*yyDollar[3].node.GetFreeFloating())[freefloating.CloseParenthesisToken]) > 0 { + yylex.(*Parser).setFreeFloating(_elseIf, freefloating.Expr, (*yyDollar[3].node.GetFreeFloating())[freefloating.CloseParenthesisToken][:len((*yyDollar[3].node.GetFreeFloating())[freefloating.CloseParenthesisToken])-1]) + delete((*yyDollar[3].node.GetFreeFloating()), freefloating.CloseParenthesisToken) + } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 135: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2159 + //line php5/php5.y:2184 { yyVAL.list = nil @@ -4333,7 +4372,7 @@ yydefault: } case 136: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:2165 + //line php5/php5.y:2190 { stmts := stmt.NewStmtList(yyDollar[5].list) _elseIf := stmt.NewAltElseIf(yyDollar[3].node, stmts) @@ -4344,16 +4383,22 @@ yydefault: _elseIf.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[5].list)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(_elseIf.GetMeta()) - yyDollar[3].node.GetMeta().Cut(meta.TokenNameFilter(meta.OpenParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo(_elseIf.GetMeta()) - yyDollar[3].node.GetMeta().Cut(meta.TokenNameFilter(meta.CloseParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo(_elseIf.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.ColonToken).AppendTo(_elseIf.GetMeta()) + yylex.(*Parser).setFreeFloating(_elseIf, freefloating.Start, yyDollar[2].token.FreeFloating) + if len((*yyDollar[3].node.GetFreeFloating())[freefloating.OpenParenthesisToken]) > 0 { + yylex.(*Parser).setFreeFloating(_elseIf, freefloating.ElseIf, (*yyDollar[3].node.GetFreeFloating())[freefloating.OpenParenthesisToken][:len((*yyDollar[3].node.GetFreeFloating())[freefloating.OpenParenthesisToken])-1]) + delete((*yyDollar[3].node.GetFreeFloating()), freefloating.OpenParenthesisToken) + } + if len((*yyDollar[3].node.GetFreeFloating())[freefloating.CloseParenthesisToken]) > 0 { + yylex.(*Parser).setFreeFloating(_elseIf, freefloating.Expr, (*yyDollar[3].node.GetFreeFloating())[freefloating.CloseParenthesisToken][:len((*yyDollar[3].node.GetFreeFloating())[freefloating.CloseParenthesisToken])-1]) + delete((*yyDollar[3].node.GetFreeFloating()), freefloating.CloseParenthesisToken) + } + yylex.(*Parser).setFreeFloating(_elseIf, freefloating.Cond, yyDollar[4].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 137: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2187 + //line php5/php5.y:2216 { yyVAL.node = nil @@ -4361,7 +4406,7 @@ yydefault: } case 138: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2193 + //line php5/php5.y:2222 { yyVAL.node = stmt.NewElse(yyDollar[2].node) @@ -4369,13 +4414,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 139: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2209 + //line php5/php5.y:2238 { yyVAL.node = nil @@ -4383,7 +4428,7 @@ yydefault: } case 140: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2215 + //line php5/php5.y:2244 { stmts := stmt.NewStmtList(yyDollar[3].list) yyVAL.node = stmt.NewAltElse(stmts) @@ -4393,14 +4438,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.ColonToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Else, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 141: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2234 + //line php5/php5.y:2263 { yyVAL.list = yyDollar[1].list @@ -4408,7 +4453,7 @@ yydefault: } case 142: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2240 + //line php5/php5.y:2269 { yyVAL.list = nil @@ -4416,7 +4461,7 @@ yydefault: } case 143: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2249 + //line php5/php5.y:2278 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4424,18 +4469,18 @@ yydefault: } case 144: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2255 + //line php5/php5.y:2284 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode(yyDollar[1].list), freefloating.End, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 145: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2267 + //line php5/php5.y:2296 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[4].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -4456,26 +4501,36 @@ yydefault: // save comments if yyDollar[1].node != nil { - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) } if yyDollar[2].token != nil { - yyDollar[2].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.OptionalType, yyDollar[2].token.FreeFloating) } if yyDollar[3].token != nil { - yyDollar[3].token.Meta.SetTokenName(meta.EllipsisToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Ampersand, yyDollar[3].token.FreeFloating) } - if yyDollar[1].node == nil && yyDollar[2].token == nil && yyDollar[3].token == nil { - yyDollar[4].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - } else { - yyDollar[4].token.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Variadic, yyDollar[4].token.FreeFloating) + yylex.(*Parser).addDollarToken(variable) + + // normalize + if yyDollar[3].token == nil { + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Ampersand, (*yyVAL.node.GetFreeFloating())[freefloating.Variadic]) + delete((*yyVAL.node.GetFreeFloating()), freefloating.Variadic) + } + if yyDollar[2].token == nil { + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.OptionalType, (*yyVAL.node.GetFreeFloating())[freefloating.Ampersand]) + delete((*yyVAL.node.GetFreeFloating()), freefloating.Ampersand) + } + if yyDollar[1].node == nil { + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, (*yyVAL.node.GetFreeFloating())[freefloating.OptionalType]) + delete((*yyVAL.node.GetFreeFloating()), freefloating.OptionalType) } - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 146: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:2305 + //line php5/php5.y:2341 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[4].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -4496,27 +4551,37 @@ yydefault: // save comments if yyDollar[1].node != nil { - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) } if yyDollar[2].token != nil { - yyDollar[2].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.OptionalType, yyDollar[2].token.FreeFloating) } if yyDollar[3].token != nil { - yyDollar[3].token.Meta.SetTokenName(meta.EllipsisToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Ampersand, yyDollar[3].token.FreeFloating) } - if yyDollar[1].node == nil && yyDollar[2].token == nil && yyDollar[3].token == nil { - yyDollar[4].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - } else { - yyDollar[4].token.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Variadic, yyDollar[4].token.FreeFloating) + yylex.(*Parser).addDollarToken(variable) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Var, yyDollar[5].token.FreeFloating) + + // normalize + if yyDollar[3].token == nil { + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Ampersand, (*yyVAL.node.GetFreeFloating())[freefloating.Variadic]) + delete((*yyVAL.node.GetFreeFloating()), freefloating.Variadic) + } + if yyDollar[2].token == nil { + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.OptionalType, (*yyVAL.node.GetFreeFloating())[freefloating.Ampersand]) + delete((*yyVAL.node.GetFreeFloating()), freefloating.Ampersand) + } + if yyDollar[1].node == nil { + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, (*yyVAL.node.GetFreeFloating())[freefloating.OptionalType]) + delete((*yyVAL.node.GetFreeFloating()), freefloating.OptionalType) } - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) - yyDollar[5].token.Meta.SetTokenName(meta.EqualToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 147: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2348 + //line php5/php5.y:2391 { yyVAL.node = nil @@ -4524,7 +4589,7 @@ yydefault: } case 148: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2354 + //line php5/php5.y:2397 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4532,13 +4597,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 149: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2366 + //line php5/php5.y:2409 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4546,13 +4611,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 150: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2378 + //line php5/php5.y:2421 { yyVAL.node = yyDollar[1].node @@ -4560,7 +4625,7 @@ yydefault: } case 151: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2388 + //line php5/php5.y:2431 { yyVAL.node = node.NewArgumentList(nil) @@ -4568,14 +4633,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.ArgumentList, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 152: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2401 + //line php5/php5.y:2444 { yyVAL.node = node.NewArgumentList(yyDollar[2].list) @@ -4583,14 +4648,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.ArgumentList, yyDollar[3].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 153: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2414 + //line php5/php5.y:2457 { arg := node.NewArgument(yyDollar[2].node, false, false) yyVAL.node = node.NewArgumentList([]node.Node{arg}) @@ -4600,14 +4665,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.ArgumentList, yyDollar[3].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 154: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2433 + //line php5/php5.y:2476 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4615,18 +4680,18 @@ yydefault: } case 155: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2439 + //line php5/php5.y:2482 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode(yyDollar[1].list), freefloating.End, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 156: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2451 + //line php5/php5.y:2494 { yyVAL.node = node.NewArgument(yyDollar[1].node, false, false) @@ -4634,13 +4699,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) // save comments - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 157: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2463 + //line php5/php5.y:2506 { yyVAL.node = node.NewArgument(yyDollar[1].node, false, false) @@ -4648,13 +4713,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) // save comments - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 158: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2475 + //line php5/php5.y:2518 { yyVAL.node = node.NewArgument(yyDollar[2].node, false, true) @@ -4662,13 +4727,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 159: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2487 + //line php5/php5.y:2530 { yyVAL.node = node.NewArgument(yyDollar[2].node, true, false) @@ -4676,24 +4741,24 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.EllipsisToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 160: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2502 + //line php5/php5.y:2545 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode(yyDollar[1].list), freefloating.End, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 161: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2511 + //line php5/php5.y:2554 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4701,7 +4766,7 @@ yydefault: } case 162: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2521 + //line php5/php5.y:2564 { name := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(name) @@ -4711,14 +4776,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMeta(yyVAL.node, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).addDollarToken(yyVAL.node) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 163: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2536 + //line php5/php5.y:2579 { yyVAL.node = expr.NewVariable(yyDollar[2].node) @@ -4726,15 +4791,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) - yylex.(*Parser).appendMeta(yyVAL.node, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Dollar, yylex.(*Parser).GetFreeFloatingToken(yyDollar[1].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 164: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2550 + //line php5/php5.y:2592 { yyVAL.node = expr.NewVariable(yyDollar[3].node) @@ -4742,18 +4806,16 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) - yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.NodeStart) - yyDollar[4].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.NodeEnd) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Dollar, yylex.(*Parser).GetFreeFloatingToken(yyDollar[1].token)) + yylex.(*Parser).setFreeFloating(yyDollar[3].node, freefloating.Start, append(yyDollar[2].token.FreeFloating, append(yylex.(*Parser).GetFreeFloatingToken(yyDollar[2].token), (*yyDollar[3].node.GetFreeFloating())[freefloating.Start]...)...)) + yylex.(*Parser).setFreeFloating(yyDollar[3].node, freefloating.End, append((*yyDollar[3].node.GetFreeFloating())[freefloating.End], append(yyDollar[4].token.FreeFloating, yylex.(*Parser).GetFreeFloatingToken(yyDollar[4].token)...)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 165: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2571 + //line php5/php5.y:2611 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[3].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -4766,15 +4828,15 @@ yydefault: staticVar.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(staticVar.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) + yylex.(*Parser).setFreeFloating(lastNode(yyDollar[1].list), freefloating.End, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(staticVar, freefloating.Start, yyDollar[3].token.FreeFloating) + yylex.(*Parser).addDollarToken(variable) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 166: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:2590 + //line php5/php5.y:2630 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[3].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -4787,16 +4849,16 @@ yydefault: staticVar.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[3].token, yyDollar[5].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(staticVar.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) - yyDollar[4].token.Meta.SetTokenName(meta.EqualToken).AppendTo(staticVar.GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode(yyDollar[1].list), freefloating.End, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(staticVar, freefloating.Start, yyDollar[3].token.FreeFloating) + yylex.(*Parser).addDollarToken(variable) + yylex.(*Parser).setFreeFloating(staticVar, freefloating.Var, yyDollar[4].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 167: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2610 + //line php5/php5.y:2650 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -4809,14 +4871,14 @@ yydefault: staticVar.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(staticVar.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) + yylex.(*Parser).setFreeFloating(staticVar, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).addDollarToken(variable) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 168: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2628 + //line php5/php5.y:2668 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -4829,15 +4891,15 @@ yydefault: staticVar.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(staticVar.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) - yyDollar[2].token.Meta.SetTokenName(meta.EqualToken).AppendTo(staticVar.GetMeta()) + yylex.(*Parser).setFreeFloating(staticVar, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).addDollarToken(variable) + yylex.(*Parser).setFreeFloating(staticVar, freefloating.Var, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 169: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2651 + //line php5/php5.y:2691 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -4845,7 +4907,7 @@ yydefault: } case 170: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2657 + //line php5/php5.y:2697 { yyVAL.list = []node.Node{} @@ -4853,7 +4915,7 @@ yydefault: } case 171: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2667 + //line php5/php5.y:2707 { yyVAL.node = stmt.NewPropertyList(yyDollar[1].list, yyDollar[2].list) @@ -4861,16 +4923,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition(yyDollar[1].list, yyDollar[3].token)) // save comments - yyDollar[3].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.SemiColonToken) - - yyDollar[1].list[0].GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].list[0], yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.PropertyList, yyDollar[3].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken(yyDollar[3].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 172: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2682 + //line php5/php5.y:2721 { yyVAL.node = yyDollar[1].node @@ -4878,14 +4939,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.ConstList, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken(yyDollar[2].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 173: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2695 + //line php5/php5.y:2734 { yyVAL.node = yyDollar[1].node @@ -4893,7 +4954,7 @@ yydefault: } case 174: yyDollar = yyS[yypt-8 : yypt+1] - //line php5/php5.y:2701 + //line php5/php5.y:2740 { name := node.NewIdentifier(yyDollar[4].token.Value) yyVAL.node = stmt.NewClassMethod(name, yyDollar[1].list, yyDollar[3].token != nil, yyDollar[6].list, nil, yyDollar[8].node, "") @@ -4907,19 +4968,26 @@ yydefault: } // save comments - yyDollar[2].token.Meta.SetTokenName(meta.FunctionToken).AppendTo(yyVAL.node.GetMeta()) - if yyDollar[3].token != nil { - yyDollar[3].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(yyVAL.node.GetMeta()) + if len(yyDollar[1].list) > 0 { + yylex.(*Parser).MoveFreeFloating(yyDollar[1].list[0], yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.ModifierList, yyDollar[2].token.FreeFloating) + } else { + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[2].token.FreeFloating) } - yyDollar[4].token.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) - yyDollar[5].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[7].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + if yyDollar[3].token == nil { + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Function, yyDollar[4].token.FreeFloating) + } else { + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Function, yyDollar[3].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Ampersand, yyDollar[4].token.FreeFloating) + } + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Name, yyDollar[5].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.ParameterList, yyDollar[7].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 175: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2728 + //line php5/php5.y:2774 { yyVAL.node = stmt.NewTraitUse(yyDollar[2].list, yyDollar[3].node) @@ -4927,13 +4995,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 176: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2743 + //line php5/php5.y:2789 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4941,46 +5009,46 @@ yydefault: } case 177: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2749 + //line php5/php5.y:2795 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode(yyDollar[1].list), freefloating.End, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 178: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2761 + //line php5/php5.y:2807 { yyVAL.node = stmt.NewNop() yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken(yyDollar[1].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 179: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2774 + //line php5/php5.y:2819 { yyVAL.node = stmt.NewTraitAdaptationList(yyDollar[2].list) yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.AdaptationList, yyDollar[3].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 180: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2789 + //line php5/php5.y:2834 { yyVAL.list = nil @@ -4988,7 +5056,7 @@ yydefault: } case 181: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2795 + //line php5/php5.y:2840 { yyVAL.list = yyDollar[1].list @@ -4996,7 +5064,7 @@ yydefault: } case 182: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2804 + //line php5/php5.y:2849 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -5004,7 +5072,7 @@ yydefault: } case 183: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2810 + //line php5/php5.y:2855 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -5012,31 +5080,31 @@ yydefault: } case 184: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2819 + //line php5/php5.y:2864 { yyVAL.node = yyDollar[1].node // save comments - yyDollar[2].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.NameList, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken(yyDollar[2].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 185: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2829 + //line php5/php5.y:2874 { yyVAL.node = yyDollar[1].node // save comments - yyDollar[2].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Alias, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken(yyDollar[2].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 186: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2842 + //line php5/php5.y:2887 { yyVAL.node = stmt.NewTraitUsePrecedence(yyDollar[1].node, yyDollar[3].list) @@ -5044,13 +5112,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeNodeListPosition(yyDollar[1].node, yyDollar[3].list)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.InsteadofToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Ref, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 187: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2857 + //line php5/php5.y:2903 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -5058,18 +5127,18 @@ yydefault: } case 188: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2863 + //line php5/php5.y:2909 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode(yyDollar[1].list), freefloating.End, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 189: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2875 + //line php5/php5.y:2921 { name := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewTraitMethodRef(nil, name) @@ -5079,13 +5148,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 190: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2889 + //line php5/php5.y:2935 { yyVAL.node = yyDollar[1].node @@ -5093,7 +5162,7 @@ yydefault: } case 191: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2898 + //line php5/php5.y:2944 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewTraitMethodRef(yyDollar[1].node, target) @@ -5103,14 +5172,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(target.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Name, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(target, freefloating.Start, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 192: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2916 + //line php5/php5.y:2963 { alias := node.NewIdentifier(yyDollar[4].token.Value) yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, yyDollar[3].node, alias) @@ -5120,14 +5190,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.AsToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.NodeStart).AppendTo(alias.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Ref, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(alias, freefloating.Start, yyDollar[4].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 193: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2931 + //line php5/php5.y:2979 { yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, yyDollar[3].node, nil) @@ -5135,13 +5206,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.AsToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Ref, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 194: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2946 + //line php5/php5.y:2995 { yyVAL.node = nil @@ -5149,7 +5221,7 @@ yydefault: } case 195: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2952 + //line php5/php5.y:3001 { yyVAL.node = yyDollar[1].node @@ -5157,7 +5229,7 @@ yydefault: } case 196: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2961 + //line php5/php5.y:3010 { yyVAL.node = stmt.NewNop() @@ -5165,14 +5237,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken(yyDollar[1].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 197: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2974 + //line php5/php5.y:3023 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) @@ -5180,14 +5252,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Stmts, yyDollar[3].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 198: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2990 + //line php5/php5.y:3039 { yyVAL.list = yyDollar[1].list @@ -5195,7 +5267,7 @@ yydefault: } case 199: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2996 + //line php5/php5.y:3045 { modifier := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.list = []node.Node{modifier} @@ -5204,13 +5276,13 @@ yydefault: modifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(modifier.GetMeta()) + yylex.(*Parser).setFreeFloating(modifier, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 200: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3012 + //line php5/php5.y:3061 { yyVAL.list = nil @@ -5218,7 +5290,7 @@ yydefault: } case 201: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3018 + //line php5/php5.y:3067 { yyVAL.list = yyDollar[1].list @@ -5226,7 +5298,7 @@ yydefault: } case 202: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3027 + //line php5/php5.y:3076 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -5234,7 +5306,7 @@ yydefault: } case 203: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3033 + //line php5/php5.y:3082 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -5242,7 +5314,7 @@ yydefault: } case 204: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3042 + //line php5/php5.y:3091 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5250,13 +5322,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 205: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3054 + //line php5/php5.y:3103 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5264,13 +5336,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 206: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3066 + //line php5/php5.y:3115 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5278,13 +5350,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 207: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3078 + //line php5/php5.y:3127 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5292,13 +5364,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 208: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3090 + //line php5/php5.y:3139 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5306,13 +5378,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 209: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3102 + //line php5/php5.y:3151 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5320,13 +5392,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 210: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3117 + //line php5/php5.y:3166 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[3].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -5339,15 +5411,15 @@ yydefault: property.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(property.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) + yylex.(*Parser).setFreeFloating(lastNode(yyDollar[1].list), freefloating.End, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(property, freefloating.Start, yyDollar[3].token.FreeFloating) + yylex.(*Parser).addDollarToken(variable) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 211: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:3136 + //line php5/php5.y:3185 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[3].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -5360,16 +5432,16 @@ yydefault: property.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[3].token, yyDollar[5].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(property.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) - yyDollar[4].token.Meta.SetTokenName(meta.EqualToken).AppendTo(property.GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode(yyDollar[1].list), freefloating.End, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(property, freefloating.Start, yyDollar[3].token.FreeFloating) + yylex.(*Parser).addDollarToken(variable) + yylex.(*Parser).setFreeFloating(property, freefloating.Var, yyDollar[4].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 212: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3156 + //line php5/php5.y:3205 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -5382,14 +5454,14 @@ yydefault: property.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(property.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) + yylex.(*Parser).setFreeFloating(property, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).addDollarToken(variable) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 213: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3174 + //line php5/php5.y:3223 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -5402,15 +5474,15 @@ yydefault: property.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(property.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) - yyDollar[2].token.Meta.SetTokenName(meta.EqualToken).AppendTo(property.GetMeta()) + yylex.(*Parser).setFreeFloating(property, freefloating.Start, yyDollar[2].token.FreeFloating) + yylex.(*Parser).addDollarToken(variable) + yylex.(*Parser).setFreeFloating(property, freefloating.Var, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 214: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:3196 + //line php5/php5.y:3245 { name := node.NewIdentifier(yyDollar[3].token.Value) constant := stmt.NewConstant(name, yyDollar[5].node, "") @@ -5425,15 +5497,15 @@ yydefault: yyDollar[1].node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[5].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastConst.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(constant.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.EqualToken).AppendTo(constant.GetMeta()) + yylex.(*Parser).setFreeFloating(lastConst, freefloating.End, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(constant, freefloating.Start, yyDollar[3].token.FreeFloating) + yylex.(*Parser).setFreeFloating(constant, freefloating.Name, yyDollar[4].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 215: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3217 + //line php5/php5.y:3266 { name := node.NewIdentifier(yyDollar[2].token.Value) constant := stmt.NewConstant(name, yyDollar[4].node, "") @@ -5445,26 +5517,26 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[4].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.ConstToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(constant.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.EqualToken).AppendTo(constant.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(constant, freefloating.Start, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(constant, freefloating.Name, yyDollar[3].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 216: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3238 + //line php5/php5.y:3287 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode(yyDollar[1].list), freefloating.End, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 217: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3247 + //line php5/php5.y:3296 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -5472,7 +5544,7 @@ yydefault: } case 218: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3257 + //line php5/php5.y:3306 { yyVAL.list = nil @@ -5480,7 +5552,7 @@ yydefault: } case 219: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3263 + //line php5/php5.y:3312 { yyVAL.list = yyDollar[1].list @@ -5488,18 +5560,18 @@ yydefault: } case 220: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3272 + //line php5/php5.y:3321 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode(yyDollar[1].list), freefloating.End, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 221: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3281 + //line php5/php5.y:3330 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -5507,7 +5579,7 @@ yydefault: } case 222: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3290 + //line php5/php5.y:3339 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) @@ -5515,7 +5587,7 @@ yydefault: } case 223: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3296 + //line php5/php5.y:3345 { yyVAL.list = yyDollar[1].list @@ -5523,7 +5595,7 @@ yydefault: } case 224: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3305 + //line php5/php5.y:3354 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yyVAL.list = append(yyDollar[1].list, fetch) @@ -5532,16 +5604,14 @@ yydefault: fetch.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo(fetch.GetMeta()) - yylex.(*Parser).appendMetaToken(fetch, yyDollar[2].token, meta.OpenSquareBracket) - yyDollar[4].token.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(fetch.GetMeta()) - yylex.(*Parser).appendMetaToken(fetch, yyDollar[4].token, meta.CloseSquareBracket) + yylex.(*Parser).setFreeFloating(fetch, freefloating.Var, append(yyDollar[2].token.FreeFloating, yylex.(*Parser).GetFreeFloatingToken(yyDollar[2].token)...)) + yylex.(*Parser).setFreeFloating(fetch, freefloating.Expr, append(yyDollar[4].token.FreeFloating, yylex.(*Parser).GetFreeFloatingToken(yyDollar[4].token)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 225: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3321 + //line php5/php5.y:3368 { fetch := expr.NewArrayDimFetch(nil, yyDollar[2].node) yyVAL.list = []node.Node{fetch} @@ -5550,16 +5620,14 @@ yydefault: fetch.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo(fetch.GetMeta()) - yylex.(*Parser).appendMetaToken(fetch, yyDollar[1].token, meta.OpenSquareBracket) - yyDollar[3].token.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(fetch.GetMeta()) - yylex.(*Parser).appendMetaToken(fetch, yyDollar[3].token, meta.CloseSquareBracket) + yylex.(*Parser).setFreeFloating(fetch, freefloating.Var, append(yyDollar[1].token.FreeFloating, yylex.(*Parser).GetFreeFloatingToken(yyDollar[1].token)...)) + yylex.(*Parser).setFreeFloating(fetch, freefloating.Expr, append(yyDollar[3].token.FreeFloating, yylex.(*Parser).GetFreeFloatingToken(yyDollar[3].token)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 226: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3340 + //line php5/php5.y:3385 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) @@ -5567,7 +5635,7 @@ yydefault: } case 227: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3346 + //line php5/php5.y:3391 { yyVAL.list = yyDollar[1].list @@ -5575,7 +5643,7 @@ yydefault: } case 228: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3352 + //line php5/php5.y:3397 { yyVAL.list = yyDollar[1].list @@ -5583,7 +5651,7 @@ yydefault: } case 229: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3361 + //line php5/php5.y:3406 { yyVAL.list = nil @@ -5591,7 +5659,7 @@ yydefault: } case 230: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3367 + //line php5/php5.y:3412 { yyVAL.list = yyDollar[1].list @@ -5599,7 +5667,7 @@ yydefault: } case 231: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3376 + //line php5/php5.y:3421 { if yyDollar[3].node != nil { @@ -5611,32 +5679,32 @@ yydefault: } // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 232: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:3395 + //line php5/php5.y:3440 { - list := expr.NewList(yyDollar[3].list) - yyVAL.node = assign.NewAssign(list, yyDollar[6].node) + listNode := expr.NewList(yyDollar[3].list) + yyVAL.node = assign.NewAssign(listNode, yyDollar[6].node) // save position - list.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + listNode.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[6].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(list.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(list.GetMeta()) - yyDollar[5].token.Meta.SetTokenName(meta.EqualToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(listNode, freefloating.List, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(listNode, freefloating.ArrayPairList, yyDollar[4].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Var, yyDollar[5].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 233: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3412 + //line php5/php5.y:3457 { yyVAL.node = assign.NewAssign(yyDollar[1].node, yyDollar[3].node) @@ -5644,32 +5712,30 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.EqualToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Var, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 234: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3426 + //line php5/php5.y:3470 { yyVAL.node = assign.NewReference(yyDollar[1].node, yyDollar[4].node) // save position yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) - // save comments - yyDollar[2].token.Meta.SetTokenName(meta.EqualToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Var, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Equal, yyDollar[3].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 235: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:3441 + //line php5/php5.y:3484 { var _new *expr.New @@ -5689,17 +5755,16 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, _new)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.EqualToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.NodeStart).AppendTo(_new.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Var, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Equal, yyDollar[3].token.FreeFloating) + yylex.(*Parser).setFreeFloating(_new, freefloating.Start, yyDollar[4].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 236: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3469 + //line php5/php5.y:3511 { yyVAL.node = expr.NewClone(yyDollar[2].node) @@ -5707,29 +5772,27 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 237: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3481 + //line php5/php5.y:3523 { yyVAL.node = assign.NewPlus(yyDollar[1].node, yyDollar[3].node) // save position yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - // save comments - yyDollar[2].token.Meta.SetTokenName(meta.PlusEqualToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Var, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 238: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3495 + //line php5/php5.y:3535 { yyVAL.node = assign.NewMinus(yyDollar[1].node, yyDollar[3].node) @@ -5737,15 +5800,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.MinusEqualToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Var, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 239: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3509 + //line php5/php5.y:3548 { yyVAL.node = assign.NewMul(yyDollar[1].node, yyDollar[3].node) @@ -5753,15 +5815,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.MulEqualToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Var, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 240: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3523 + //line php5/php5.y:3561 { yyVAL.node = assign.NewPow(yyDollar[1].node, yyDollar[3].node) @@ -5769,15 +5830,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.PowEqualToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Var, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 241: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3537 + //line php5/php5.y:3574 { yyVAL.node = assign.NewDiv(yyDollar[1].node, yyDollar[3].node) @@ -5785,15 +5845,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.DivEqualToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Var, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 242: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3551 + //line php5/php5.y:3587 { yyVAL.node = assign.NewConcat(yyDollar[1].node, yyDollar[3].node) @@ -5801,15 +5860,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.ConcatEqualToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Var, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 243: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3565 + //line php5/php5.y:3600 { yyVAL.node = assign.NewMod(yyDollar[1].node, yyDollar[3].node) @@ -5817,15 +5875,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.ModEqualToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Var, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 244: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3579 + //line php5/php5.y:3613 { yyVAL.node = assign.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) @@ -5833,15 +5890,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.AndEqualToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Var, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 245: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3593 + //line php5/php5.y:3626 { yyVAL.node = assign.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) @@ -5849,15 +5905,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.OrEqualToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Var, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 246: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3607 + //line php5/php5.y:3639 { yyVAL.node = assign.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) @@ -5865,15 +5920,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.XorEqualToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Var, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 247: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3621 + //line php5/php5.y:3652 { yyVAL.node = assign.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) @@ -5881,15 +5935,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.SlEqualToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Var, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 248: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3635 + //line php5/php5.y:3665 { yyVAL.node = assign.NewShiftRight(yyDollar[1].node, yyDollar[3].node) @@ -5897,15 +5950,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.SrEqualToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Var, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 249: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3649 + //line php5/php5.y:3678 { yyVAL.node = expr.NewPostInc(yyDollar[1].node) @@ -5913,15 +5965,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.IncToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Var, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 250: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3663 + //line php5/php5.y:3691 { yyVAL.node = expr.NewPreInc(yyDollar[2].node) @@ -5929,13 +5980,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 251: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3675 + //line php5/php5.y:3703 { yyVAL.node = expr.NewPostDec(yyDollar[1].node) @@ -5943,15 +5994,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.DecToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Var, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 252: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3689 + //line php5/php5.y:3716 { yyVAL.node = expr.NewPreDec(yyDollar[2].node) @@ -5959,13 +6009,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 253: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3701 + //line php5/php5.y:3728 { yyVAL.node = binary.NewBooleanOr(yyDollar[1].node, yyDollar[3].node) @@ -5973,15 +6023,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.BooleanOrToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 254: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3715 + //line php5/php5.y:3741 { yyVAL.node = binary.NewBooleanAnd(yyDollar[1].node, yyDollar[3].node) @@ -5989,15 +6038,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.BooleanAndToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 255: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3729 + //line php5/php5.y:3754 { yyVAL.node = binary.NewLogicalOr(yyDollar[1].node, yyDollar[3].node) @@ -6005,15 +6053,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.LogicalOrToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 256: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3743 + //line php5/php5.y:3767 { yyVAL.node = binary.NewLogicalAnd(yyDollar[1].node, yyDollar[3].node) @@ -6021,15 +6068,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.LogicalAndToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 257: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3757 + //line php5/php5.y:3780 { yyVAL.node = binary.NewLogicalXor(yyDollar[1].node, yyDollar[3].node) @@ -6037,15 +6083,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.LogicalXorToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 258: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3771 + //line php5/php5.y:3793 { yyVAL.node = binary.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) @@ -6053,15 +6098,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.VerticalBarToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 259: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3785 + //line php5/php5.y:3806 { yyVAL.node = binary.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) @@ -6069,15 +6113,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 260: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3799 + //line php5/php5.y:3819 { yyVAL.node = binary.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) @@ -6085,15 +6128,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.CaretToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 261: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3813 + //line php5/php5.y:3832 { yyVAL.node = binary.NewConcat(yyDollar[1].node, yyDollar[3].node) @@ -6101,15 +6143,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.DotToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 262: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3827 + //line php5/php5.y:3845 { yyVAL.node = binary.NewPlus(yyDollar[1].node, yyDollar[3].node) @@ -6117,15 +6158,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.PlusToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 263: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3841 + //line php5/php5.y:3858 { yyVAL.node = binary.NewMinus(yyDollar[1].node, yyDollar[3].node) @@ -6133,15 +6173,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.MinusToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 264: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3855 + //line php5/php5.y:3871 { yyVAL.node = binary.NewMul(yyDollar[1].node, yyDollar[3].node) @@ -6149,15 +6188,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.AsteriskToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 265: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3869 + //line php5/php5.y:3884 { yyVAL.node = binary.NewPow(yyDollar[1].node, yyDollar[3].node) @@ -6165,15 +6203,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.PowToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 266: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3883 + //line php5/php5.y:3897 { yyVAL.node = binary.NewDiv(yyDollar[1].node, yyDollar[3].node) @@ -6181,15 +6218,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.SlashToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 267: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3897 + //line php5/php5.y:3910 { yyVAL.node = binary.NewMod(yyDollar[1].node, yyDollar[3].node) @@ -6197,15 +6233,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.PercentToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 268: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3911 + //line php5/php5.y:3923 { yyVAL.node = binary.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) @@ -6213,15 +6248,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.SlToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 269: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3925 + //line php5/php5.y:3936 { yyVAL.node = binary.NewShiftRight(yyDollar[1].node, yyDollar[3].node) @@ -6229,15 +6263,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.SrToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 270: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3939 + //line php5/php5.y:3949 { yyVAL.node = expr.NewUnaryPlus(yyDollar[2].node) @@ -6245,13 +6278,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 271: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3951 + //line php5/php5.y:3961 { yyVAL.node = expr.NewUnaryMinus(yyDollar[2].node) @@ -6259,13 +6292,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 272: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3963 + //line php5/php5.y:3973 { yyVAL.node = expr.NewBooleanNot(yyDollar[2].node) @@ -6273,13 +6306,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 273: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3975 + //line php5/php5.y:3985 { yyVAL.node = expr.NewBitwiseNot(yyDollar[2].node) @@ -6287,13 +6320,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 274: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3987 + //line php5/php5.y:3997 { yyVAL.node = binary.NewIdentical(yyDollar[1].node, yyDollar[3].node) @@ -6301,15 +6334,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.IsIdenticalToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 275: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4001 + //line php5/php5.y:4010 { yyVAL.node = binary.NewNotIdentical(yyDollar[1].node, yyDollar[3].node) @@ -6317,15 +6349,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.IsNotIdenticalToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 276: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4015 + //line php5/php5.y:4023 { yyVAL.node = binary.NewEqual(yyDollar[1].node, yyDollar[3].node) @@ -6333,15 +6364,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.IsEqualToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 277: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4029 + //line php5/php5.y:4036 { yyVAL.node = binary.NewNotEqual(yyDollar[1].node, yyDollar[3].node) @@ -6349,16 +6379,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.IsNotEqualToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.IsNotEqualToken) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Equal, yylex.(*Parser).GetFreeFloatingToken(yyDollar[2].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 278: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4044 + //line php5/php5.y:4050 { yyVAL.node = binary.NewSmaller(yyDollar[1].node, yyDollar[3].node) @@ -6366,15 +6395,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.LessToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 279: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4058 + //line php5/php5.y:4063 { yyVAL.node = binary.NewSmallerOrEqual(yyDollar[1].node, yyDollar[3].node) @@ -6382,15 +6410,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.IsSmallerOrEqualToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 280: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4072 + //line php5/php5.y:4076 { yyVAL.node = binary.NewGreater(yyDollar[1].node, yyDollar[3].node) @@ -6398,15 +6425,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.GreaterToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 281: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4086 + //line php5/php5.y:4089 { yyVAL.node = binary.NewGreaterOrEqual(yyDollar[1].node, yyDollar[3].node) @@ -6414,15 +6440,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.IsGreaterOrEqualToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 282: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4100 + //line php5/php5.y:4102 { yyVAL.node = expr.NewInstanceOf(yyDollar[1].node, yyDollar[3].node) @@ -6430,26 +6455,27 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.InstanceofToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 283: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4114 + //line php5/php5.y:4115 { yyVAL.node = yyDollar[1].node yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - yyVAL.node.GetMeta().Cut(meta.TokenNameFilter(meta.OpenParenthesisToken)).SetTokenName(meta.NodeStart).PrependTo(yyVAL.node.GetMeta()) - yyVAL.node.GetMeta().Cut(meta.TokenNameFilter(meta.CloseParenthesisToken)).SetTokenName(meta.NodeEnd).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyDollar[1].node, freefloating.Start, append((*yyDollar[1].node.GetFreeFloating())[freefloating.OpenParenthesisToken], (*yyDollar[1].node.GetFreeFloating())[freefloating.Start]...)) + delete((*yyDollar[1].node.GetFreeFloating()), freefloating.OpenParenthesisToken) + yylex.(*Parser).setFreeFloating(yyDollar[1].node, freefloating.End, append((*yyDollar[1].node.GetFreeFloating())[freefloating.End], (*yyDollar[1].node.GetFreeFloating())[freefloating.CloseParenthesisToken]...)) + delete((*yyDollar[1].node.GetFreeFloating()), freefloating.CloseParenthesisToken) } case 284: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4123 + //line php5/php5.y:4124 { yyVAL.node = yyDollar[1].node @@ -6457,32 +6483,30 @@ yydefault: } case 285: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4129 + //line php5/php5.y:4130 { yyVAL.node = yyDollar[2].node // save comments - yylex.(*Parser).prependMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).PrependTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.NodeEnd) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, append(yyDollar[1].token.FreeFloating, append(yylex.(*Parser).GetFreeFloatingToken(yyDollar[1].token), (*yyVAL.node.GetFreeFloating())[freefloating.Start]...)...)) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.End, append((*yyVAL.node.GetFreeFloating())[freefloating.End], append(yyDollar[3].token.FreeFloating, yylex.(*Parser).GetFreeFloatingToken(yyDollar[3].token)...)...)) for _, n := range yyDollar[4].list { switch nn := n.(type) { case *expr.ArrayDimFetch: nn.Variable = yyVAL.node yyVAL.node = nn - nn.Variable.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(nn.Variable, yyVAL.node) case *expr.PropertyFetch: nn.Variable = yyVAL.node yyVAL.node = nn - nn.Variable.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(nn.Variable, yyVAL.node) case *expr.MethodCall: nn.Variable = yyVAL.node yyVAL.node = nn - nn.Variable.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(nn.Variable, yyVAL.node) } // save position @@ -6493,7 +6517,7 @@ yydefault: } case 286: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:4163 + //line php5/php5.y:4162 { yyVAL.node = expr.NewTernary(yyDollar[1].node, yyDollar[3].node, yyDollar[5].node) @@ -6501,16 +6525,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[5].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.QuestionMarkToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.ColonToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Cond, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.True, yyDollar[4].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 287: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4178 + //line php5/php5.y:4176 { yyVAL.node = expr.NewTernary(yyDollar[1].node, nil, yyDollar[4].node) @@ -6518,16 +6541,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.QuestionMarkToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.ColonToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Cond, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.True, yyDollar[3].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 288: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4193 + //line php5/php5.y:4190 { yyVAL.node = yyDollar[1].node @@ -6535,7 +6557,7 @@ yydefault: } case 289: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4199 + //line php5/php5.y:4196 { yyVAL.node = cast.NewInt(yyDollar[2].node) @@ -6543,14 +6565,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Cast, yylex.(*Parser).GetFreeFloatingToken(yyDollar[1].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 290: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4212 + //line php5/php5.y:4209 { yyVAL.node = cast.NewDouble(yyDollar[2].node) @@ -6558,14 +6580,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Cast, yylex.(*Parser).GetFreeFloatingToken(yyDollar[1].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 291: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4225 + //line php5/php5.y:4222 { yyVAL.node = cast.NewString(yyDollar[2].node) @@ -6573,14 +6595,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Cast, yylex.(*Parser).GetFreeFloatingToken(yyDollar[1].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 292: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4238 + //line php5/php5.y:4235 { yyVAL.node = cast.NewArray(yyDollar[2].node) @@ -6588,14 +6610,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Cast, yylex.(*Parser).GetFreeFloatingToken(yyDollar[1].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 293: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4251 + //line php5/php5.y:4248 { yyVAL.node = cast.NewObject(yyDollar[2].node) @@ -6603,14 +6625,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Cast, yylex.(*Parser).GetFreeFloatingToken(yyDollar[1].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 294: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4264 + //line php5/php5.y:4261 { yyVAL.node = cast.NewBool(yyDollar[2].node) @@ -6618,14 +6640,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Cast, yylex.(*Parser).GetFreeFloatingToken(yyDollar[1].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 295: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4277 + //line php5/php5.y:4274 { yyVAL.node = cast.NewUnset(yyDollar[2].node) @@ -6633,43 +6655,37 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Cast, yylex.(*Parser).GetFreeFloatingToken(yyDollar[1].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 296: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4290 + //line php5/php5.y:4287 { - var e *expr.Exit - if yyDollar[2].node != nil { - e = yyDollar[2].node.(*expr.Exit) - } else { - e = expr.NewExit(nil) - } - - yyVAL.node = e + e := yyDollar[2].node.(*expr.Exit) + yyVAL.node = yyDollar[2].node if strings.EqualFold(yyDollar[1].token.Value, "die") { e.Die = true } // save position - if yyDollar[2].node == nil { + if yyDollar[2].node.GetPosition() == nil { yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) } else { yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) } // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 297: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4317 + //line php5/php5.y:4308 { yyVAL.node = expr.NewErrorSuppress(yyDollar[2].node) @@ -6677,13 +6693,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 298: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4329 + //line php5/php5.y:4320 { yyVAL.node = yyDollar[1].node @@ -6691,7 +6707,7 @@ yydefault: } case 299: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4335 + //line php5/php5.y:4326 { yyVAL.node = yyDollar[1].node @@ -6699,7 +6715,7 @@ yydefault: } case 300: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4341 + //line php5/php5.y:4332 { yyVAL.node = yyDollar[1].node @@ -6707,7 +6723,7 @@ yydefault: } case 301: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4347 + //line php5/php5.y:4338 { yyVAL.node = expr.NewShellExec(yyDollar[2].list) @@ -6715,13 +6731,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 302: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4359 + //line php5/php5.y:4350 { yyVAL.node = expr.NewPrint(yyDollar[2].node) @@ -6729,13 +6745,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 303: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4371 + //line php5/php5.y:4362 { yyVAL.node = expr.NewYield(nil, nil) @@ -6743,13 +6759,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 304: yyDollar = yyS[yypt-9 : yypt+1] - //line php5/php5.y:4383 + //line php5/php5.y:4374 { yyVAL.node = expr.NewClosure(yyDollar[4].list, yyDollar[6].ClosureUse, nil, yyDollar[8].list, false, yyDollar[2].token != nil, "") @@ -6757,20 +6773,28 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[9].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - if yyDollar[2].token != nil { - yyDollar[2].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + if yyDollar[2].token == nil { + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Function, yyDollar[3].token.FreeFloating) + } else { + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Function, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Ampersand, yyDollar[3].token.FreeFloating) + } + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.ParameterList, yyDollar[5].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.LexicalVars, yyDollar[7].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Stmts, yyDollar[9].token.FreeFloating) + + // normalize + if yyDollar[6].ClosureUse == nil { + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Params, (*yyVAL.node.GetFreeFloating())[freefloating.LexicalVars]) + delete((*yyVAL.node.GetFreeFloating()), freefloating.LexicalVars) } - yyDollar[3].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[5].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[7].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[9].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 305: yyDollar = yyS[yypt-10 : yypt+1] - //line php5/php5.y:4402 + //line php5/php5.y:4400 { yyVAL.node = expr.NewClosure(yyDollar[5].list, yyDollar[7].ClosureUse, nil, yyDollar[9].list, true, yyDollar[3].token != nil, "") @@ -6778,21 +6802,29 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[10].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.FunctionToken).AppendTo(yyVAL.node.GetMeta()) - if yyDollar[3].token != nil { - yyDollar[3].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Static, yyDollar[2].token.FreeFloating) + if yyDollar[3].token == nil { + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Function, yyDollar[4].token.FreeFloating) + } else { + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Function, yyDollar[3].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Ampersand, yyDollar[4].token.FreeFloating) + } + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.ParameterList, yyDollar[6].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.LexicalVars, yyDollar[8].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Stmts, yyDollar[10].token.FreeFloating) + + // normalize + if yyDollar[7].ClosureUse == nil { + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Params, (*yyVAL.node.GetFreeFloating())[freefloating.LexicalVars]) + delete((*yyVAL.node.GetFreeFloating()), freefloating.LexicalVars) } - yyDollar[4].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[6].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[8].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[10].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 306: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4425 + //line php5/php5.y:4430 { yyVAL.node = expr.NewYield(nil, yyDollar[2].node) @@ -6800,13 +6832,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 307: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4437 + //line php5/php5.y:4442 { yyVAL.node = expr.NewYield(nil, yyDollar[2].node) @@ -6814,13 +6846,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 308: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4449 + //line php5/php5.y:4454 { yyVAL.node = expr.NewYield(yyDollar[2].node, yyDollar[4].node) @@ -6828,14 +6860,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[4].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[3].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 309: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4462 + //line php5/php5.y:4467 { yyVAL.node = expr.NewYield(yyDollar[2].node, yyDollar[4].node) @@ -6843,14 +6875,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[4].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[3].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 310: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4478 + //line php5/php5.y:4483 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -6858,18 +6890,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.OpenSquareBracket) - yyDollar[4].token.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.CloseSquareBracket) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Var, append(yyDollar[2].token.FreeFloating, yylex.(*Parser).GetFreeFloatingToken(yyDollar[2].token)...)) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, append(yyDollar[4].token.FreeFloating, yylex.(*Parser).GetFreeFloatingToken(yyDollar[4].token)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 311: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4495 + //line php5/php5.y:4497 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -6877,18 +6906,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.OpenSquareBracket) - yyDollar[4].token.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.CloseSquareBracket) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Var, append(yyDollar[2].token.FreeFloating, yylex.(*Parser).GetFreeFloatingToken(yyDollar[2].token)...)) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, append(yyDollar[4].token.FreeFloating, yylex.(*Parser).GetFreeFloatingToken(yyDollar[4].token)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 312: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4512 + //line php5/php5.y:4511 { str := scalar.NewString(yyDollar[1].token.Value) yyVAL.node = expr.NewArrayDimFetch(str, yyDollar[3].node) @@ -6898,17 +6924,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(str, yyDollar[4].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.OpenSquareBracket) - yyDollar[4].token.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.CloseSquareBracket) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Var, append(yyDollar[2].token.FreeFloating, yylex.(*Parser).GetFreeFloatingToken(yyDollar[2].token)...)) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, append(yyDollar[4].token.FreeFloating, yylex.(*Parser).GetFreeFloatingToken(yyDollar[4].token)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 313: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4530 + //line php5/php5.y:4527 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -6916,18 +6940,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.OpenSquareBracket) - yyDollar[4].token.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.CloseSquareBracket) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Var, append(yyDollar[2].token.FreeFloating, yylex.(*Parser).GetFreeFloatingToken(yyDollar[2].token)...)) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, append(yyDollar[4].token.FreeFloating, yylex.(*Parser).GetFreeFloatingToken(yyDollar[4].token)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 314: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4550 + //line php5/php5.y:4544 { yyVAL.node = expr.NewArray(yyDollar[3].list) @@ -6935,15 +6956,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Array, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.ArrayPairList, yyDollar[4].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 315: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4564 + //line php5/php5.y:4558 { yyVAL.node = expr.NewShortArray(yyDollar[2].list) @@ -6951,20 +6972,20 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.ArrayPairList, yyDollar[3].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 316: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4580 + //line php5/php5.y:4574 { yyVAL.token = yyDollar[1].token } case 317: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:4587 + //line php5/php5.y:4581 { yyVAL.ClosureUse = nil @@ -6972,7 +6993,7 @@ yydefault: } case 318: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4593 + //line php5/php5.y:4587 { yyVAL.ClosureUse = expr.NewClosureUse(yyDollar[3].list) @@ -6980,15 +7001,15 @@ yydefault: yyVAL.ClosureUse.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.ClosureUse.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.ClosureUse.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.ClosureUse.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.ClosureUse, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.ClosureUse, freefloating.Use, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.ClosureUse, freefloating.LexicalVarList, yyDollar[4].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 319: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4610 + //line php5/php5.y:4604 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[3].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -6999,15 +7020,15 @@ yydefault: variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) + yylex.(*Parser).setFreeFloating(lastNode(yyDollar[1].list), freefloating.End, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(variable, freefloating.Start, yyDollar[3].token.FreeFloating) + yylex.(*Parser).addDollarToken(variable) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 320: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4627 + //line php5/php5.y:4621 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[4].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -7020,16 +7041,16 @@ yydefault: reference.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[3].token, yyDollar[4].token)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(reference.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) + yylex.(*Parser).setFreeFloating(lastNode(yyDollar[1].list), freefloating.End, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(reference, freefloating.Start, yyDollar[3].token.FreeFloating) + yylex.(*Parser).setFreeFloating(variable, freefloating.Start, yyDollar[4].token.FreeFloating) + yylex.(*Parser).addDollarToken(variable) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 321: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4647 + //line php5/php5.y:4641 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -7040,14 +7061,14 @@ yydefault: variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) + yylex.(*Parser).setFreeFloating(variable, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).addDollarToken(variable) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 322: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4663 + //line php5/php5.y:4657 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[2].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -7060,15 +7081,15 @@ yydefault: reference.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(reference.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) + yylex.(*Parser).setFreeFloating(reference, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(variable, freefloating.Start, yyDollar[2].token.FreeFloating) + yylex.(*Parser).addDollarToken(variable) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 323: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4685 + //line php5/php5.y:4679 { name := name.NewName(yyDollar[1].list) yyVAL.node = expr.NewFunctionCall(name, yyDollar[2].node.(*node.ArgumentList)) @@ -7078,13 +7099,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(name, yyDollar[2].node)) // save comments - yyDollar[1].list[0].GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].list[0], yyVAL.node) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 324: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4699 + //line php5/php5.y:4693 { funcName := name.NewRelative(yyDollar[3].list) yyVAL.node = expr.NewFunctionCall(funcName, yyDollar[4].node.(*node.ArgumentList)) @@ -7094,14 +7115,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(funcName, yyDollar[4].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo(funcName.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(funcName, freefloating.Namespace, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 325: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4714 + //line php5/php5.y:4708 { funcName := name.NewFullyQualified(yyDollar[2].list) yyVAL.node = expr.NewFunctionCall(funcName, yyDollar[3].node.(*node.ArgumentList)) @@ -7111,13 +7132,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(funcName, yyDollar[3].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 326: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4728 + //line php5/php5.y:4722 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -7125,14 +7146,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Name, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 327: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4741 + //line php5/php5.y:4735 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -7140,14 +7161,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Name, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 328: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4754 + //line php5/php5.y:4748 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -7155,14 +7176,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Name, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 329: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4767 + //line php5/php5.y:4761 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -7170,26 +7191,28 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Name, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 330: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4780 + //line php5/php5.y:4774 { yyVAL.node = expr.NewFunctionCall(yyDollar[1].node, yyDollar[2].node.(*node.ArgumentList)) // save position yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[2].node)) - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + + // save comments + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 331: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4793 + //line php5/php5.y:4789 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -7197,13 +7220,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 332: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4805 + //line php5/php5.y:4801 { yyVAL.node = name.NewName(yyDollar[1].list) @@ -7211,13 +7234,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) // save comments - yyDollar[1].list[0].GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].list[0], yyVAL.node) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 333: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4817 + //line php5/php5.y:4813 { yyVAL.node = name.NewRelative(yyDollar[3].list) @@ -7225,14 +7248,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Namespace, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 334: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4830 + //line php5/php5.y:4826 { yyVAL.node = name.NewFullyQualified(yyDollar[2].list) @@ -7240,13 +7263,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 335: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4845 + //line php5/php5.y:4841 { yyVAL.node = name.NewName(yyDollar[1].list) @@ -7254,13 +7277,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) // save comments - yyDollar[1].list[0].GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].list[0], yyVAL.node) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 336: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4857 + //line php5/php5.y:4853 { yyVAL.node = name.NewRelative(yyDollar[3].list) @@ -7268,14 +7291,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Namespace, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 337: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4870 + //line php5/php5.y:4866 { yyVAL.node = name.NewFullyQualified(yyDollar[2].list) @@ -7283,13 +7306,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 338: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4885 + //line php5/php5.y:4881 { yyVAL.node = yyDollar[1].node @@ -7297,7 +7320,7 @@ yydefault: } case 339: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4891 + //line php5/php5.y:4887 { yyVAL.node = yyDollar[1].node @@ -7305,12 +7328,12 @@ yydefault: } case 340: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:4900 + //line php5/php5.y:4896 { yyVAL.node = yyDollar[1].node // save comments - yyDollar[2].token.Meta.SetTokenName(meta.ObjectOperatorToken).AppendTo(yyDollar[3].list[0].GetMeta()) + yylex.(*Parser).setFreeFloating(yyDollar[3].list[0], freefloating.Var, yyDollar[2].token.FreeFloating) for _, n := range yyDollar[3].list { switch nn := n.(type) { @@ -7318,13 +7341,13 @@ yydefault: nn.Variable = yyVAL.node yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyVAL.node, nn)) yyVAL.node = nn - nn.Variable.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(nn.Variable, yyVAL.node) case *expr.PropertyFetch: nn.Variable = yyVAL.node yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyVAL.node, nn)) yyVAL.node = nn - nn.Variable.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(nn.Variable, yyVAL.node) } } @@ -7334,13 +7357,13 @@ yydefault: nn.Variable = yyVAL.node yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyVAL.node, nn)) yyVAL.node = nn - nn.Variable.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(nn.Variable, yyVAL.node) case *expr.PropertyFetch: nn.Variable = yyVAL.node yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyVAL.node, nn)) yyVAL.node = nn - nn.Variable.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(nn.Variable, yyVAL.node) } } @@ -7348,7 +7371,7 @@ yydefault: } case 341: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:4941 + //line php5/php5.y:4937 { yyVAL.node = yyDollar[1].node @@ -7356,7 +7379,7 @@ yydefault: } case 342: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4951 + //line php5/php5.y:4947 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) @@ -7364,7 +7387,7 @@ yydefault: } case 343: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:4957 + //line php5/php5.y:4953 { yyVAL.list = []node.Node{} @@ -7372,26 +7395,26 @@ yydefault: } case 344: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4967 + //line php5/php5.y:4963 { yyVAL.list = yyDollar[2].list // save comments - yyDollar[1].token.Meta.SetTokenName(meta.ObjectOperatorToken).AppendTo(yyDollar[2].list[0].GetMeta()) + yylex.(*Parser).setFreeFloating(yyDollar[2].list[0], freefloating.Var, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 345: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:4979 + //line php5/php5.y:4975 { - yyVAL.node = nil + yyVAL.node = expr.NewExit(nil) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 346: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:4985 + //line php5/php5.y:4981 { yyVAL.node = expr.NewExit(nil) @@ -7399,16 +7422,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.OpenParenthesisToken) - yyDollar[2].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.CloseParenthesisToken) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Exit, append(yyDollar[1].token.FreeFloating, yylex.(*Parser).GetFreeFloatingToken(yyDollar[1].token)...)) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, append(yyDollar[2].token.FreeFloating, yylex.(*Parser).GetFreeFloatingToken(yyDollar[2].token)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 347: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5000 + //line php5/php5.y:4994 { yyVAL.node = expr.NewExit(yyDollar[1].node) @@ -7422,12 +7443,14 @@ yydefault: yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) // save comments - yyDollar[1].node.GetMeta().Cut(meta.TokenNameFilter(meta.OpenParenthesisToken)).AppendTo(yyVAL.node.GetMeta()) - yyDollar[1].node.GetMeta().Cut(meta.TokenNameFilter(meta.CloseParenthesisToken)).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Exit, (*yyDollar[1].node.GetFreeFloating())[freefloating.OpenParenthesisToken]) + delete((*yyDollar[1].node.GetFreeFloating()), freefloating.OpenParenthesisToken) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, (*yyDollar[1].node.GetFreeFloating())[freefloating.CloseParenthesisToken]) + delete((*yyDollar[1].node.GetFreeFloating()), freefloating.CloseParenthesisToken) } case 348: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:5020 + //line php5/php5.y:5014 { yyVAL.list = []node.Node{} @@ -7435,15 +7458,19 @@ yydefault: } case 349: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5026 + //line php5/php5.y:5020 { - yyVAL.list = []node.Node{scalar.NewEncapsedStringPart(yyDollar[1].token.Value)} + part := scalar.NewEncapsedStringPart(yyDollar[1].token.Value) + yyVAL.list = []node.Node{part} + + // save position + part.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 350: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5032 + //line php5/php5.y:5030 { yyVAL.list = yyDollar[1].list @@ -7451,7 +7478,7 @@ yydefault: } case 351: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:5041 + //line php5/php5.y:5039 { yyVAL.node = nil @@ -7459,7 +7486,7 @@ yydefault: } case 352: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5047 + //line php5/php5.y:5045 { yyVAL.node = yyDollar[1].node @@ -7467,7 +7494,7 @@ yydefault: } case 353: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5056 + //line php5/php5.y:5054 { yyVAL.node = scalar.NewLnumber(yyDollar[1].token.Value) @@ -7475,13 +7502,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 354: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5068 + //line php5/php5.y:5066 { yyVAL.node = scalar.NewDnumber(yyDollar[1].token.Value) @@ -7489,13 +7516,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 355: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5080 + //line php5/php5.y:5078 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) @@ -7503,13 +7530,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 356: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5092 + //line php5/php5.y:5090 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7517,13 +7544,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 357: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5104 + //line php5/php5.y:5102 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7531,13 +7558,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 358: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5116 + //line php5/php5.y:5114 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7545,13 +7572,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 359: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5128 + //line php5/php5.y:5126 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7559,13 +7586,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 360: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5140 + //line php5/php5.y:5138 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7573,13 +7600,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 361: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5152 + //line php5/php5.y:5150 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7587,13 +7614,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 362: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5164 + //line php5/php5.y:5162 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7601,13 +7628,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 363: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5176 + //line php5/php5.y:5174 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, []node.Node{encapsed}) @@ -7617,13 +7644,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 364: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5190 + //line php5/php5.y:5188 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, nil) @@ -7631,13 +7658,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 365: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5205 + //line php5/php5.y:5203 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -7647,16 +7674,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(target.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Name, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(target, freefloating.Start, yyDollar[3].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 366: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5225 + //line php5/php5.y:5222 { yyVAL.node = yyDollar[1].node @@ -7664,7 +7690,7 @@ yydefault: } case 367: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5234 + //line php5/php5.y:5231 { yyVAL.node = yyDollar[1].node @@ -7672,7 +7698,7 @@ yydefault: } case 368: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5240 + //line php5/php5.y:5237 { yyVAL.node = yyDollar[1].node @@ -7680,7 +7706,7 @@ yydefault: } case 369: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5246 + //line php5/php5.y:5243 { name := name.NewName(yyDollar[1].list) yyVAL.node = expr.NewConstFetch(name) @@ -7690,13 +7716,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(name)) // save comments - yyDollar[1].list[0].GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].list[0], yyVAL.node) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 370: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5260 + //line php5/php5.y:5257 { name := name.NewRelative(yyDollar[3].list) yyVAL.node = expr.NewConstFetch(name) @@ -7706,14 +7732,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo(name.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Namespace, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 371: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5275 + //line php5/php5.y:5272 { name := name.NewFullyQualified(yyDollar[2].list) yyVAL.node = expr.NewConstFetch(name) @@ -7723,13 +7749,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 372: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:5289 + //line php5/php5.y:5286 { yyVAL.node = expr.NewArray(yyDollar[3].list) @@ -7737,15 +7763,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Array, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.ArrayPairList, yyDollar[4].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 373: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5303 + //line php5/php5.y:5300 { yyVAL.node = expr.NewShortArray(yyDollar[2].list) @@ -7753,14 +7779,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.ArrayPairList, yyDollar[3].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 374: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5316 + //line php5/php5.y:5313 { yyVAL.node = yyDollar[1].node @@ -7768,7 +7794,7 @@ yydefault: } case 375: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5322 + //line php5/php5.y:5319 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -7776,13 +7802,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 376: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5334 + //line php5/php5.y:5331 { yyVAL.node = yyDollar[1].node @@ -7790,7 +7816,7 @@ yydefault: } case 377: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:5343 + //line php5/php5.y:5340 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -7798,18 +7824,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.OpenSquareBracket) - yyDollar[4].token.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.CloseSquareBracket) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Var, append(yyDollar[2].token.FreeFloating, yylex.(*Parser).GetFreeFloatingToken(yyDollar[2].token)...)) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, append(yyDollar[4].token.FreeFloating, yylex.(*Parser).GetFreeFloatingToken(yyDollar[4].token)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 378: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5360 + //line php5/php5.y:5354 { yyVAL.node = binary.NewPlus(yyDollar[1].node, yyDollar[3].node) @@ -7817,15 +7840,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.PlusToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 379: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5374 + //line php5/php5.y:5367 { yyVAL.node = binary.NewMinus(yyDollar[1].node, yyDollar[3].node) @@ -7833,15 +7855,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.MinusToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 380: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5388 + //line php5/php5.y:5380 { yyVAL.node = binary.NewMul(yyDollar[1].node, yyDollar[3].node) @@ -7849,15 +7870,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.AsteriskToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 381: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5402 + //line php5/php5.y:5393 { yyVAL.node = binary.NewPow(yyDollar[1].node, yyDollar[3].node) @@ -7865,15 +7885,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.PowToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 382: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5416 + //line php5/php5.y:5406 { yyVAL.node = binary.NewDiv(yyDollar[1].node, yyDollar[3].node) @@ -7881,15 +7900,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.SlashToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 383: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5430 + //line php5/php5.y:5419 { yyVAL.node = binary.NewMod(yyDollar[1].node, yyDollar[3].node) @@ -7897,15 +7915,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.PercentToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 384: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5444 + //line php5/php5.y:5432 { yyVAL.node = expr.NewBooleanNot(yyDollar[2].node) @@ -7913,13 +7930,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 385: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5456 + //line php5/php5.y:5444 { yyVAL.node = expr.NewBitwiseNot(yyDollar[2].node) @@ -7927,13 +7944,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 386: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5468 + //line php5/php5.y:5456 { yyVAL.node = binary.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) @@ -7941,15 +7958,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.VerticalBarToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 387: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5482 + //line php5/php5.y:5469 { yyVAL.node = binary.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) @@ -7957,15 +7973,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 388: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5496 + //line php5/php5.y:5482 { yyVAL.node = binary.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) @@ -7973,15 +7988,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.CaretToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 389: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5510 + //line php5/php5.y:5495 { yyVAL.node = binary.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) @@ -7989,15 +8003,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.SlToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 390: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5524 + //line php5/php5.y:5508 { yyVAL.node = binary.NewShiftRight(yyDollar[1].node, yyDollar[3].node) @@ -8005,15 +8018,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.SrToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 391: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5538 + //line php5/php5.y:5521 { yyVAL.node = binary.NewConcat(yyDollar[1].node, yyDollar[3].node) @@ -8021,15 +8033,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.DotToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 392: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5552 + //line php5/php5.y:5534 { yyVAL.node = binary.NewLogicalXor(yyDollar[1].node, yyDollar[3].node) @@ -8037,15 +8048,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.LogicalXorToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 393: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5566 + //line php5/php5.y:5547 { yyVAL.node = binary.NewLogicalAnd(yyDollar[1].node, yyDollar[3].node) @@ -8053,15 +8063,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.LogicalAndToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 394: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5580 + //line php5/php5.y:5560 { yyVAL.node = binary.NewLogicalOr(yyDollar[1].node, yyDollar[3].node) @@ -8069,15 +8078,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.LogicalOrToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 395: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5594 + //line php5/php5.y:5573 { yyVAL.node = binary.NewBooleanAnd(yyDollar[1].node, yyDollar[3].node) @@ -8085,15 +8093,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.BooleanAndToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 396: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5608 + //line php5/php5.y:5586 { yyVAL.node = binary.NewBooleanOr(yyDollar[1].node, yyDollar[3].node) @@ -8101,15 +8108,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.BooleanOrToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 397: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5622 + //line php5/php5.y:5599 { yyVAL.node = binary.NewIdentical(yyDollar[1].node, yyDollar[3].node) @@ -8117,15 +8123,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.IsIdenticalToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 398: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5636 + //line php5/php5.y:5612 { yyVAL.node = binary.NewNotIdentical(yyDollar[1].node, yyDollar[3].node) @@ -8133,15 +8138,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.IsNotIdenticalToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 399: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5650 + //line php5/php5.y:5625 { yyVAL.node = binary.NewEqual(yyDollar[1].node, yyDollar[3].node) @@ -8149,15 +8153,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.IsEqualToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 400: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5664 + //line php5/php5.y:5638 { yyVAL.node = binary.NewNotEqual(yyDollar[1].node, yyDollar[3].node) @@ -8165,16 +8168,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.IsNotEqualToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.IsNotEqualToken) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Equal, yylex.(*Parser).GetFreeFloatingToken(yyDollar[2].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 401: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5679 + //line php5/php5.y:5652 { yyVAL.node = binary.NewSmaller(yyDollar[1].node, yyDollar[3].node) @@ -8182,15 +8184,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.LessToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 402: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5693 + //line php5/php5.y:5665 { yyVAL.node = binary.NewGreater(yyDollar[1].node, yyDollar[3].node) @@ -8198,15 +8199,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.GreaterToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 403: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5707 + //line php5/php5.y:5678 { yyVAL.node = binary.NewSmallerOrEqual(yyDollar[1].node, yyDollar[3].node) @@ -8214,15 +8214,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.IsSmallerOrEqualToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 404: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5721 + //line php5/php5.y:5691 { yyVAL.node = binary.NewGreaterOrEqual(yyDollar[1].node, yyDollar[3].node) @@ -8230,15 +8229,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.IsGreaterOrEqualToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 405: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:5735 + //line php5/php5.y:5704 { yyVAL.node = expr.NewTernary(yyDollar[1].node, nil, yyDollar[4].node) @@ -8246,16 +8244,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.QuestionMarkToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.ColonToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Cond, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.True, yyDollar[3].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 406: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:5750 + //line php5/php5.y:5718 { yyVAL.node = expr.NewTernary(yyDollar[1].node, yyDollar[3].node, yyDollar[5].node) @@ -8263,16 +8260,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[5].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.QuestionMarkToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.ColonToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Cond, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.True, yyDollar[4].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 407: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5765 + //line php5/php5.y:5732 { yyVAL.node = expr.NewUnaryPlus(yyDollar[2].node) @@ -8280,13 +8276,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 408: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5777 + //line php5/php5.y:5744 { yyVAL.node = expr.NewUnaryMinus(yyDollar[2].node) @@ -8294,27 +8290,25 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 409: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5789 + //line php5/php5.y:5756 { yyVAL.node = yyDollar[2].node // save comments - yylex.(*Parser).prependMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).PrependTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.NodeEnd) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, append(yyDollar[1].token.FreeFloating, append(yylex.(*Parser).GetFreeFloatingToken(yyDollar[1].token), (*yyVAL.node.GetFreeFloating())[freefloating.Start]...)...)) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.End, append((*yyVAL.node.GetFreeFloating())[freefloating.End], append(yyDollar[3].token.FreeFloating, yylex.(*Parser).GetFreeFloatingToken(yyDollar[3].token)...)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 410: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5804 + //line php5/php5.y:5769 { yyVAL.node = yyDollar[1].node @@ -8322,7 +8316,7 @@ yydefault: } case 411: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5810 + //line php5/php5.y:5775 { name := name.NewName(yyDollar[1].list) yyVAL.node = expr.NewConstFetch(name) @@ -8332,28 +8326,30 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(name)) // save comments - yyDollar[1].list[0].GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].list[0], yyVAL.node) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 412: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5824 + //line php5/php5.y:5789 { name := name.NewRelative(yyDollar[3].list) yyVAL.node = expr.NewConstFetch(name) + + // save position name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(name)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo(name.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(name, freefloating.Namespace, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 413: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5837 + //line php5/php5.y:5804 { name := name.NewFullyQualified(yyDollar[2].list) yyVAL.node = expr.NewConstFetch(name) @@ -8363,13 +8359,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(name)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 414: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5854 + //line php5/php5.y:5821 { name := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = expr.NewVariable(name) @@ -8379,14 +8375,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) - yylex.(*Parser).appendMeta(yyVAL.node, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 415: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5869 + //line php5/php5.y:5835 { yyVAL.node = yyDollar[1].node @@ -8394,7 +8389,7 @@ yydefault: } case 416: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5875 + //line php5/php5.y:5841 { yyVAL.node = yyDollar[1].node @@ -8402,7 +8397,7 @@ yydefault: } case 417: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5881 + //line php5/php5.y:5847 { yyVAL.node = yyDollar[1].node @@ -8410,7 +8405,7 @@ yydefault: } case 418: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5887 + //line php5/php5.y:5853 { yyVAL.node = scalar.NewEncapsed(yyDollar[2].list) @@ -8418,13 +8413,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 419: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5899 + //line php5/php5.y:5865 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, yyDollar[2].list) @@ -8432,13 +8427,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 420: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5911 + //line php5/php5.y:5877 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -8446,13 +8441,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 421: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:5926 + //line php5/php5.y:5892 { yyVAL.list = nil @@ -8460,32 +8455,32 @@ yydefault: } case 422: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:5932 + //line php5/php5.y:5898 { yyVAL.list = yyDollar[1].list // save comments if yyDollar[2].token != nil { - yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode(yyDollar[1].list), freefloating.End, yyDollar[2].token.FreeFloating) } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 423: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:5946 + //line php5/php5.y:5912 { yyVAL.token = nil } case 424: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:5950 + //line php5/php5.y:5916 { yyVAL.token = yyDollar[1].token } case 425: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:5957 + //line php5/php5.y:5923 { arrayItem := expr.NewArrayItem(yyDollar[3].node, yyDollar[5].node) yyVAL.list = append(yyDollar[1].list, arrayItem) @@ -8494,16 +8489,15 @@ yydefault: arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[3].node, yyDollar[5].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo(arrayItem.GetMeta()) - - yyDollar[3].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(arrayItem.GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode(yyDollar[1].list), freefloating.End, yyDollar[2].token.FreeFloating) + yylex.(*Parser).MoveFreeFloating(yyDollar[3].node, arrayItem) + yylex.(*Parser).setFreeFloating(arrayItem, freefloating.Expr, yyDollar[4].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 426: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5973 + //line php5/php5.y:5938 { arrayItem := expr.NewArrayItem(nil, yyDollar[3].node) yyVAL.list = append(yyDollar[1].list, arrayItem) @@ -8512,15 +8506,14 @@ yydefault: arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) - - yyDollar[3].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(arrayItem.GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode(yyDollar[1].list), freefloating.End, yyDollar[2].token.FreeFloating) + yylex.(*Parser).MoveFreeFloating(yyDollar[3].node, arrayItem) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 427: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:5988 + //line php5/php5.y:5952 { arrayItem := expr.NewArrayItem(yyDollar[1].node, yyDollar[3].node) yyVAL.list = []node.Node{arrayItem} @@ -8529,15 +8522,14 @@ yydefault: arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo(arrayItem.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(arrayItem.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, arrayItem) + yylex.(*Parser).setFreeFloating(arrayItem, freefloating.Expr, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 428: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6003 + //line php5/php5.y:5966 { arrayItem := expr.NewArrayItem(nil, yyDollar[1].node) yyVAL.list = []node.Node{arrayItem} @@ -8545,13 +8537,14 @@ yydefault: // save position arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(arrayItem.GetMeta()) + // save comments + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, arrayItem) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 429: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6018 + //line php5/php5.y:5982 { yyVAL.node = yyDollar[1].node @@ -8559,7 +8552,7 @@ yydefault: } case 430: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6024 + //line php5/php5.y:5988 { yyVAL.node = yyDollar[1].node @@ -8567,35 +8560,43 @@ yydefault: } case 431: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6033 + //line php5/php5.y:5997 { yyVAL.node = yyDollar[2].node // save comments - yylex.(*Parser).prependMetaToken(yyVAL.node, yyDollar[1].token, meta.OpenParenthesisToken) - yyDollar[1].token.Meta.SetTokenName(meta.OpenParenthesisToken).PrependTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.CloseParenthesisToken) + if len((*yyDollar[2].node.GetFreeFloating())[freefloating.OpenParenthesisToken]) > 0 { + yylex.(*Parser).setFreeFloating(yyDollar[2].node, freefloating.Start, append((*yyDollar[2].node.GetFreeFloating())[freefloating.OpenParenthesisToken], (*yyDollar[2].node.GetFreeFloating())[freefloating.Start]...)) + } + if len((*yyDollar[2].node.GetFreeFloating())[freefloating.CloseParenthesisToken]) > 0 { + yylex.(*Parser).setFreeFloating(yyDollar[2].node, freefloating.End, append((*yyDollar[2].node.GetFreeFloating())[freefloating.End], (*yyDollar[2].node.GetFreeFloating())[freefloating.CloseParenthesisToken]...)) + } + yylex.(*Parser).setFreeFloating(yyDollar[2].node, freefloating.OpenParenthesisToken, append(yyDollar[1].token.FreeFloating, yylex.(*Parser).GetFreeFloatingToken(yyDollar[1].token)...)) + yylex.(*Parser).setFreeFloating(yyDollar[2].node, freefloating.CloseParenthesisToken, append(yyDollar[3].token.FreeFloating, yylex.(*Parser).GetFreeFloatingToken(yyDollar[3].token)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 432: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6045 + //line php5/php5.y:6013 { yyVAL.node = yyDollar[2].node // save comments - yylex.(*Parser).prependMetaToken(yyVAL.node, yyDollar[1].token, meta.OpenParenthesisToken) - yyDollar[1].token.Meta.SetTokenName(meta.OpenParenthesisToken).PrependTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.CloseParenthesisToken) + if len((*yyDollar[2].node.GetFreeFloating())[freefloating.OpenParenthesisToken]) > 0 { + yylex.(*Parser).setFreeFloating(yyDollar[2].node, freefloating.Start, append((*yyDollar[2].node.GetFreeFloating())[freefloating.OpenParenthesisToken], (*yyDollar[2].node.GetFreeFloating())[freefloating.Start]...)) + } + if len((*yyDollar[2].node.GetFreeFloating())[freefloating.CloseParenthesisToken]) > 0 { + yylex.(*Parser).setFreeFloating(yyDollar[2].node, freefloating.End, append((*yyDollar[2].node.GetFreeFloating())[freefloating.End], (*yyDollar[2].node.GetFreeFloating())[freefloating.CloseParenthesisToken]...)) + } + yylex.(*Parser).setFreeFloating(yyDollar[2].node, freefloating.OpenParenthesisToken, append(yyDollar[1].token.FreeFloating, yylex.(*Parser).GetFreeFloatingToken(yyDollar[1].token)...)) + yylex.(*Parser).setFreeFloating(yyDollar[2].node, freefloating.CloseParenthesisToken, append(yyDollar[3].token.FreeFloating, yylex.(*Parser).GetFreeFloatingToken(yyDollar[3].token)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 433: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6061 + //line php5/php5.y:6033 { yyVAL.node = yyDollar[1].node @@ -8603,7 +8604,7 @@ yydefault: } case 434: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6071 + //line php5/php5.y:6043 { yyVAL.node = yyDollar[1].node @@ -8611,7 +8612,7 @@ yydefault: } case 435: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6080 + //line php5/php5.y:6052 { yyVAL.node = yyDollar[1].node @@ -8619,7 +8620,7 @@ yydefault: } case 436: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:6089 + //line php5/php5.y:6061 { yyVAL.node = yyDollar[1].node @@ -8629,7 +8630,7 @@ yydefault: } // save comments - yyDollar[2].token.Meta.SetTokenName(meta.ObjectOperatorToken).AppendTo(yyDollar[3].list[0].GetMeta()) + yylex.(*Parser).setFreeFloating(yyDollar[3].list[0], freefloating.Var, yyDollar[2].token.FreeFloating) for _, n := range yyDollar[3].list { switch nn := n.(type) { @@ -8637,19 +8638,19 @@ yydefault: nn.Variable = yyVAL.node nn.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyVAL.node, nn)) yyVAL.node = nn - nn.Variable.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(nn.Variable, yyVAL.node) case *expr.PropertyFetch: nn.Variable = yyVAL.node nn.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyVAL.node, nn)) yyVAL.node = nn - nn.Variable.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(nn.Variable, yyVAL.node) case *expr.MethodCall: nn.Variable = yyVAL.node nn.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyVAL.node, nn)) yyVAL.node = nn - nn.Variable.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(nn.Variable, yyVAL.node) } } @@ -8659,19 +8660,19 @@ yydefault: nn.Variable = yyVAL.node nn.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyVAL.node, nn)) yyVAL.node = nn - nn.Variable.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(nn.Variable, yyVAL.node) case *expr.PropertyFetch: nn.Variable = yyVAL.node nn.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyVAL.node, nn)) yyVAL.node = nn - nn.Variable.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(nn.Variable, yyVAL.node) case *expr.MethodCall: nn.Variable = yyVAL.node nn.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyVAL.node, nn)) yyVAL.node = nn - nn.Variable.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(nn.Variable, yyVAL.node) } } @@ -8679,7 +8680,7 @@ yydefault: } case 437: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6147 + //line php5/php5.y:6119 { yyVAL.node = yyDollar[1].node @@ -8687,7 +8688,7 @@ yydefault: } case 438: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6156 + //line php5/php5.y:6128 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) @@ -8695,7 +8696,7 @@ yydefault: } case 439: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:6162 + //line php5/php5.y:6134 { yyVAL.list = []node.Node{} @@ -8703,7 +8704,7 @@ yydefault: } case 440: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6172 + //line php5/php5.y:6144 { if yyDollar[3].list != nil { yyDollar[3].list[0].(*expr.MethodCall).Method = yyDollar[2].list[len(yyDollar[2].list)-1].(*expr.PropertyFetch).Property @@ -8713,13 +8714,13 @@ yydefault: yyVAL.list = yyDollar[2].list // save comments - yyDollar[1].token.Meta.SetTokenName(meta.ObjectOperatorToken).AppendTo(yyDollar[2].list[0].GetMeta()) + yylex.(*Parser).setFreeFloating(yyDollar[2].list[0], freefloating.Var, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 441: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6189 + //line php5/php5.y:6161 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yyVAL.list = append(yyDollar[1].list, fetch) @@ -8728,16 +8729,14 @@ yydefault: fetch.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo(fetch.GetMeta()) - yylex.(*Parser).appendMetaToken(fetch, yyDollar[2].token, meta.OpenSquareBracket) - yyDollar[4].token.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(fetch.GetMeta()) - yylex.(*Parser).appendMetaToken(fetch, yyDollar[4].token, meta.CloseSquareBracket) + yylex.(*Parser).setFreeFloating(fetch, freefloating.Var, append(yyDollar[2].token.FreeFloating, yylex.(*Parser).GetFreeFloatingToken(yyDollar[2].token)...)) + yylex.(*Parser).setFreeFloating(fetch, freefloating.Expr, append(yyDollar[4].token.FreeFloating, yylex.(*Parser).GetFreeFloatingToken(yyDollar[4].token)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 442: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6205 + //line php5/php5.y:6175 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yyVAL.list = []node.Node{yyDollar[1].node, fetch} @@ -8746,16 +8745,14 @@ yydefault: fetch.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo(fetch.GetMeta()) - yylex.(*Parser).appendMetaToken(fetch, yyDollar[2].token, meta.OpenSquareBracket) - yyDollar[4].token.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(fetch.GetMeta()) - yylex.(*Parser).appendMetaToken(fetch, yyDollar[4].token, meta.CloseSquareBracket) + yylex.(*Parser).setFreeFloating(fetch, freefloating.Var, append(yyDollar[2].token.FreeFloating, yylex.(*Parser).GetFreeFloatingToken(yyDollar[2].token)...)) + yylex.(*Parser).setFreeFloating(fetch, freefloating.Expr, append(yyDollar[4].token.FreeFloating, yylex.(*Parser).GetFreeFloatingToken(yyDollar[4].token)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 443: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6224 + //line php5/php5.y:6192 { yyVAL.node = expr.NewMethodCall(nil, nil, yyDollar[1].node.(*node.ArgumentList)) @@ -8766,7 +8763,7 @@ yydefault: } case 444: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6236 + //line php5/php5.y:6204 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -8774,7 +8771,7 @@ yydefault: } case 445: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6242 + //line php5/php5.y:6210 { yyVAL.list = yyDollar[1].list @@ -8782,7 +8779,7 @@ yydefault: } case 446: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:6248 + //line php5/php5.y:6216 { yyVAL.list = nil @@ -8790,7 +8787,7 @@ yydefault: } case 447: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6257 + //line php5/php5.y:6225 { yyVAL.node = yyDollar[1].node @@ -8798,7 +8795,7 @@ yydefault: } case 448: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6263 + //line php5/php5.y:6231 { yyDollar[1].simpleIndirectReference.last.SetVarName(yyDollar[2].node) @@ -8812,7 +8809,7 @@ yydefault: } case 449: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6278 + //line php5/php5.y:6246 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -8820,15 +8817,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Name, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 450: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6292 + //line php5/php5.y:6259 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -8836,15 +8832,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Name, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 451: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6309 + //line php5/php5.y:6275 { yyVAL.node = yyDollar[1].node @@ -8852,7 +8847,7 @@ yydefault: } case 452: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6318 + //line php5/php5.y:6284 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -8860,18 +8855,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.OpenSquareBracket) - yyDollar[4].token.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.CloseSquareBracket) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Var, append(yyDollar[2].token.FreeFloating, yylex.(*Parser).GetFreeFloatingToken(yyDollar[2].token)...)) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, append(yyDollar[4].token.FreeFloating, yylex.(*Parser).GetFreeFloatingToken(yyDollar[4].token)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 453: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6335 + //line php5/php5.y:6298 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -8879,18 +8871,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.OpenSquareBracket) - yyDollar[4].token.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.CloseSquareBracket) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Var, append(yyDollar[2].token.FreeFloating, yylex.(*Parser).GetFreeFloatingToken(yyDollar[2].token)...)) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, append(yyDollar[4].token.FreeFloating, yylex.(*Parser).GetFreeFloatingToken(yyDollar[4].token)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 454: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6355 + //line php5/php5.y:6315 { yyVAL.node = yyDollar[1].node @@ -8898,7 +8887,7 @@ yydefault: } case 455: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6361 + //line php5/php5.y:6321 { yyVAL.node = yyDollar[1].node @@ -8906,7 +8895,7 @@ yydefault: } case 456: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6367 + //line php5/php5.y:6327 { yyVAL.node = yyDollar[1].node @@ -8914,7 +8903,7 @@ yydefault: } case 457: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6377 + //line php5/php5.y:6337 { yyVAL.node = yyDollar[1].node @@ -8922,7 +8911,7 @@ yydefault: } case 458: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6383 + //line php5/php5.y:6343 { yyDollar[1].simpleIndirectReference.last.SetVarName(yyDollar[2].node) @@ -8936,7 +8925,7 @@ yydefault: } case 459: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6395 + //line php5/php5.y:6355 { yyVAL.node = yyDollar[1].node @@ -8944,7 +8933,7 @@ yydefault: } case 460: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6404 + //line php5/php5.y:6364 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -8952,18 +8941,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.OpenSquareBracket) - yyDollar[4].token.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.CloseSquareBracket) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Var, append(yyDollar[2].token.FreeFloating, yylex.(*Parser).GetFreeFloatingToken(yyDollar[2].token)...)) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, append(yyDollar[4].token.FreeFloating, yylex.(*Parser).GetFreeFloatingToken(yyDollar[4].token)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 461: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6421 + //line php5/php5.y:6378 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -8971,18 +8957,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.OpenCurlyBracesToken) - yyDollar[4].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.CloseCurlyBracesToken) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Var, append(yyDollar[2].token.FreeFloating, yylex.(*Parser).GetFreeFloatingToken(yyDollar[2].token)...)) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, append(yyDollar[4].token.FreeFloating, yylex.(*Parser).GetFreeFloatingToken(yyDollar[4].token)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 462: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6438 + //line php5/php5.y:6392 { yyVAL.node = yyDollar[1].node @@ -8990,7 +8973,7 @@ yydefault: } case 463: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6448 + //line php5/php5.y:6402 { name := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(name) @@ -9000,14 +8983,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMeta(yyVAL.node, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).addDollarToken(yyVAL.node) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 464: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6463 + //line php5/php5.y:6417 { yyVAL.node = expr.NewVariable(yyDollar[3].node) @@ -9015,18 +8998,16 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) - yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.NodeStart) - yyDollar[4].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.NodeEnd) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Dollar, yylex.(*Parser).GetFreeFloatingToken(yyDollar[1].token)) + yylex.(*Parser).setFreeFloating(yyDollar[3].node, freefloating.Start, append(yyDollar[2].token.FreeFloating, append(yylex.(*Parser).GetFreeFloatingToken(yyDollar[2].token), (*yyDollar[3].node.GetFreeFloating())[freefloating.Start]...)...)) + yylex.(*Parser).setFreeFloating(yyDollar[3].node, freefloating.End, append((*yyDollar[3].node.GetFreeFloating())[freefloating.End], append(yyDollar[4].token.FreeFloating, yylex.(*Parser).GetFreeFloatingToken(yyDollar[4].token)...)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 465: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:6483 + //line php5/php5.y:6435 { yyVAL.node = nil @@ -9034,7 +9015,7 @@ yydefault: } case 466: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6489 + //line php5/php5.y:6441 { yyVAL.node = yyDollar[1].node @@ -9042,7 +9023,7 @@ yydefault: } case 467: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6499 + //line php5/php5.y:6451 { yyVAL.list = yyDollar[1].list @@ -9050,7 +9031,7 @@ yydefault: } case 468: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6505 + //line php5/php5.y:6457 { fetch := expr.NewPropertyFetch(nil, yyDollar[1].node) yyVAL.list = []node.Node{fetch} @@ -9062,7 +9043,7 @@ yydefault: } case 469: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6518 + //line php5/php5.y:6470 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yyVAL.list = append(yyDollar[1].list, fetch) @@ -9071,16 +9052,14 @@ yydefault: fetch.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo(fetch.GetMeta()) - yylex.(*Parser).appendMetaToken(fetch, yyDollar[2].token, meta.OpenSquareBracket) - yyDollar[4].token.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(fetch.GetMeta()) - yylex.(*Parser).appendMetaToken(fetch, yyDollar[4].token, meta.CloseSquareBracket) + yylex.(*Parser).setFreeFloating(fetch, freefloating.Var, append(yyDollar[2].token.FreeFloating, yylex.(*Parser).GetFreeFloatingToken(yyDollar[2].token)...)) + yylex.(*Parser).setFreeFloating(fetch, freefloating.Expr, append(yyDollar[4].token.FreeFloating, yylex.(*Parser).GetFreeFloatingToken(yyDollar[4].token)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 470: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6534 + //line php5/php5.y:6484 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yyVAL.list = append(yyDollar[1].list, fetch) @@ -9089,16 +9068,14 @@ yydefault: fetch.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(fetch.GetMeta()) - yylex.(*Parser).appendMetaToken(fetch, yyDollar[2].token, meta.OpenCurlyBracesToken) - yyDollar[4].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(fetch.GetMeta()) - yylex.(*Parser).appendMetaToken(fetch, yyDollar[4].token, meta.CloseCurlyBracesToken) + yylex.(*Parser).setFreeFloating(fetch, freefloating.Var, append(yyDollar[2].token.FreeFloating, yylex.(*Parser).GetFreeFloatingToken(yyDollar[2].token)...)) + yylex.(*Parser).setFreeFloating(fetch, freefloating.Expr, append(yyDollar[4].token.FreeFloating, yylex.(*Parser).GetFreeFloatingToken(yyDollar[4].token)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 471: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6550 + //line php5/php5.y:6498 { fetch := expr.NewPropertyFetch(nil, yyDollar[1].node) yyVAL.list = []node.Node{fetch} @@ -9110,7 +9087,7 @@ yydefault: } case 472: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6563 + //line php5/php5.y:6511 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -9118,13 +9095,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 473: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6575 + //line php5/php5.y:6523 { yyVAL.node = yyDollar[2].node @@ -9132,16 +9109,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yylex.(*Parser).prependMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).PrependTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.NodeEnd) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, append(yyDollar[1].token.FreeFloating, append(yylex.(*Parser).GetFreeFloatingToken(yyDollar[1].token), (*yyVAL.node.GetFreeFloating())[freefloating.Start]...)...)) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.End, append((*yyVAL.node.GetFreeFloating())[freefloating.End], append(yyDollar[3].token.FreeFloating, yylex.(*Parser).GetFreeFloatingToken(yyDollar[3].token)...)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 474: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6593 + //line php5/php5.y:6539 { n := expr.NewVariable(nil) yyVAL.simpleIndirectReference = simpleIndirectReference{[]*expr.Variable{n}, n} @@ -9150,14 +9125,14 @@ yydefault: n.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(n.GetMeta()) - yylex.(*Parser).appendMetaToken(n, yyDollar[1].token, meta.NodeStart) + yylex.(*Parser).setFreeFloating(n, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(n, freefloating.Dollar, yylex.(*Parser).GetFreeFloatingToken(yyDollar[1].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 475: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6607 + //line php5/php5.y:6553 { n := expr.NewVariable(nil) @@ -9170,14 +9145,14 @@ yydefault: n.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(n.GetMeta()) - yylex.(*Parser).appendMetaToken(n, yyDollar[2].token, meta.NodeStart) + yylex.(*Parser).setFreeFloating(n, freefloating.Start, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(n, freefloating.Dollar, yylex.(*Parser).GetFreeFloatingToken(yyDollar[2].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 476: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6628 + //line php5/php5.y:6574 { if len(yyDollar[1].list) == 0 { yyDollar[1].list = []node.Node{expr.NewArrayItem(nil, nil)} @@ -9186,13 +9161,13 @@ yydefault: yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode(yyDollar[1].list), freefloating.End, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 477: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6641 + //line php5/php5.y:6587 { if yyDollar[1].node.(*expr.ArrayItem).Key == nil && yyDollar[1].node.(*expr.ArrayItem).Val == nil { yyVAL.list = []node.Node{} @@ -9204,38 +9179,39 @@ yydefault: } case 478: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6655 + //line php5/php5.y:6601 { yyVAL.node = expr.NewArrayItem(nil, yyDollar[1].node) // save position yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + // save comments + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 479: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6666 + //line php5/php5.y:6613 { - item := expr.NewList(yyDollar[3].list) - yyVAL.node = expr.NewArrayItem(nil, item) + listNode := expr.NewList(yyDollar[3].list) + yyVAL.node = expr.NewArrayItem(nil, listNode) // save position - item.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) - yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(item)) + listNode.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(listNode)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(item.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(item.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(listNode, freefloating.List, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(listNode, freefloating.ArrayPairList, yyDollar[4].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 480: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:6682 + //line php5/php5.y:6629 { yyVAL.node = expr.NewArrayItem(nil, nil) @@ -9243,7 +9219,7 @@ yydefault: } case 481: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:6692 + //line php5/php5.y:6639 { yyVAL.list = []node.Node{} @@ -9251,7 +9227,7 @@ yydefault: } case 482: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6698 + //line php5/php5.y:6645 { yyVAL.list = yyDollar[1].list @@ -9261,14 +9237,14 @@ yydefault: // save comments if yyDollar[2].token != nil { - yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode(yyDollar[1].list), freefloating.End, yyDollar[2].token.FreeFloating) } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 483: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:6716 + //line php5/php5.y:6663 { arrayItem := expr.NewArrayItem(yyDollar[3].node, yyDollar[5].node) yyVAL.list = append(yyDollar[1].list, arrayItem) @@ -9277,16 +9253,15 @@ yydefault: arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[3].node, yyDollar[5].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo(arrayItem.GetMeta()) - - yyDollar[3].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(arrayItem.GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode(yyDollar[1].list), freefloating.End, yyDollar[2].token.FreeFloating) + yylex.(*Parser).MoveFreeFloating(yyDollar[3].node, arrayItem) + yylex.(*Parser).setFreeFloating(arrayItem, freefloating.Expr, yyDollar[4].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 484: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6732 + //line php5/php5.y:6678 { arrayItem := expr.NewArrayItem(nil, yyDollar[3].node) yyVAL.list = append(yyDollar[1].list, arrayItem) @@ -9295,15 +9270,14 @@ yydefault: arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) - - yyDollar[3].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(arrayItem.GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode(yyDollar[1].list), freefloating.End, yyDollar[2].token.FreeFloating) + yylex.(*Parser).MoveFreeFloating(yyDollar[3].node, arrayItem) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 485: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6747 + //line php5/php5.y:6692 { arrayItem := expr.NewArrayItem(yyDollar[1].node, yyDollar[3].node) yyVAL.list = []node.Node{arrayItem} @@ -9312,15 +9286,14 @@ yydefault: arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo(arrayItem.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(arrayItem.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, arrayItem) + yylex.(*Parser).setFreeFloating(arrayItem, freefloating.Expr, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 486: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6762 + //line php5/php5.y:6706 { arrayItem := expr.NewArrayItem(nil, yyDollar[1].node) yyVAL.list = []node.Node{arrayItem} @@ -9328,13 +9301,14 @@ yydefault: // save position arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(arrayItem.GetMeta()) + // save comments + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, arrayItem) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 487: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:6774 + //line php5/php5.y:6719 { reference := expr.NewReference(yyDollar[6].node) arrayItem := expr.NewArrayItem(yyDollar[3].node, reference) @@ -9345,17 +9319,16 @@ yydefault: arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[3].node, yyDollar[6].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo(arrayItem.GetMeta()) - yyDollar[5].token.Meta.SetTokenName(meta.NodeStart).AppendTo(reference.GetMeta()) - - yyDollar[3].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(arrayItem.GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode(yyDollar[1].list), freefloating.End, yyDollar[2].token.FreeFloating) + yylex.(*Parser).MoveFreeFloating(yyDollar[3].node, arrayItem) + yylex.(*Parser).setFreeFloating(arrayItem, freefloating.Expr, yyDollar[4].token.FreeFloating) + yylex.(*Parser).setFreeFloating(reference, freefloating.Start, yyDollar[5].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 488: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6793 + //line php5/php5.y:6737 { reference := expr.NewReference(yyDollar[4].node) arrayItem := expr.NewArrayItem(nil, reference) @@ -9366,14 +9339,14 @@ yydefault: arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[3].token, yyDollar[4].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(arrayItem.GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode(yyDollar[1].list), freefloating.End, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(arrayItem, freefloating.Start, yyDollar[3].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 489: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6809 + //line php5/php5.y:6753 { reference := expr.NewReference(yyDollar[4].node) arrayItem := expr.NewArrayItem(yyDollar[1].node, reference) @@ -9384,16 +9357,15 @@ yydefault: arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo(arrayItem.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(reference.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(arrayItem.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, arrayItem) + yylex.(*Parser).setFreeFloating(arrayItem, freefloating.Expr, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(reference, freefloating.Start, yyDollar[3].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 490: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6827 + //line php5/php5.y:6770 { reference := expr.NewReference(yyDollar[2].node) arrayItem := expr.NewArrayItem(nil, reference) @@ -9404,13 +9376,13 @@ yydefault: arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(arrayItem.GetMeta()) + yylex.(*Parser).setFreeFloating(arrayItem, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 491: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6845 + //line php5/php5.y:6788 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -9418,7 +9390,7 @@ yydefault: } case 492: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6851 + //line php5/php5.y:6794 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yyVAL.list = append(yyDollar[1].list, encapsed) @@ -9427,13 +9399,13 @@ yydefault: encapsed.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(encapsed.GetMeta()) + yylex.(*Parser).setFreeFloating(encapsed, freefloating.Start, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 493: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6864 + //line php5/php5.y:6807 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -9441,7 +9413,7 @@ yydefault: } case 494: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:6870 + //line php5/php5.y:6813 { encapsed := scalar.NewEncapsedStringPart(yyDollar[1].token.Value) yyVAL.list = []node.Node{encapsed, yyDollar[2].node} @@ -9450,13 +9422,13 @@ yydefault: encapsed.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(encapsed.GetMeta()) + yylex.(*Parser).setFreeFloating(encapsed, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 495: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:6886 + //line php5/php5.y:6829 { name := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(name) @@ -9466,14 +9438,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMeta(yyVAL.node, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).addDollarToken(yyVAL.node) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 496: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:6901 + //line php5/php5.y:6844 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -9485,17 +9457,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) - yyDollar[2].token.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.OpenSquareBracket) - yyDollar[4].token.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.CloseSquareBracket) + yylex.(*Parser).addDollarToken(variable) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Var, append(yyDollar[2].token.FreeFloating, yylex.(*Parser).GetFreeFloatingToken(yyDollar[2].token)...)) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, append(yyDollar[4].token.FreeFloating, yylex.(*Parser).GetFreeFloatingToken(yyDollar[4].token)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 497: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6921 + //line php5/php5.y:6862 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -9509,15 +9479,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) - yyDollar[2].token.Meta.SetTokenName(meta.ObjectOperatorToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(fetch.GetMeta()) + yylex.(*Parser).addDollarToken(variable) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Var, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(fetch, freefloating.Start, yyDollar[3].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 498: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6941 + //line php5/php5.y:6882 { variable := expr.NewVariable(yyDollar[2].node) @@ -9527,15 +9497,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) - yyDollar[3].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.NodeEnd) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yylex.(*Parser).GetFreeFloatingToken(yyDollar[1].token)) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.End, append(yyDollar[3].token.FreeFloating, yylex.(*Parser).GetFreeFloatingToken(yyDollar[3].token)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 499: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6957 + //line php5/php5.y:6897 { name := node.NewIdentifier(yyDollar[2].token.Value) variable := expr.NewVariable(name) @@ -9547,16 +9516,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) - yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.NodeEnd) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yylex.(*Parser).GetFreeFloatingToken(yyDollar[1].token)) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.End, append(yyDollar[3].token.FreeFloating, yylex.(*Parser).GetFreeFloatingToken(yyDollar[3].token)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 500: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:6976 + //line php5/php5.y:6914 { identifier := node.NewIdentifier(yyDollar[2].token.Value) variable := expr.NewVariable(identifier) @@ -9568,32 +9535,28 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[6].token)) // save comments - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) - yyDollar[3].token.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.OpenSquareBracket) - yyDollar[5].token.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[5].token, meta.CloseSquareBracket) - yyDollar[6].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[6].token, meta.NodeEnd) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yylex.(*Parser).GetFreeFloatingToken(yyDollar[1].token)) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Var, append(yyDollar[3].token.FreeFloating, yylex.(*Parser).GetFreeFloatingToken(yyDollar[3].token)...)) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, append(yyDollar[5].token.FreeFloating, yylex.(*Parser).GetFreeFloatingToken(yyDollar[5].token)...)) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.End, append(yyDollar[6].token.FreeFloating, yylex.(*Parser).GetFreeFloatingToken(yyDollar[6].token)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 501: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:6998 + //line php5/php5.y:6933 { yyVAL.node = yyDollar[2].node // save comments - yylex.(*Parser).prependMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) - yyDollar[3].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.NodeEnd) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yylex.(*Parser).GetFreeFloatingToken(yyDollar[1].token)) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.End, append(yyDollar[3].token.FreeFloating, yylex.(*Parser).GetFreeFloatingToken(yyDollar[3].token)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 502: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:7012 + //line php5/php5.y:6946 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) @@ -9601,13 +9564,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 503: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:7024 + //line php5/php5.y:6958 { // TODO: add option to handle 64 bit integer if _, err := strconv.Atoi(yyDollar[1].token.Value); err == nil { @@ -9619,11 +9582,14 @@ yydefault: // save position yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + // save comments + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 504: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:7038 + //line php5/php5.y:6975 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(identifier) @@ -9633,14 +9599,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMeta(yyVAL.node, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).addDollarToken(yyVAL.node) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 505: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:7056 + //line php5/php5.y:6993 { yyVAL.node = expr.NewIsset(yyDollar[3].list) @@ -9648,15 +9614,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Isset, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.VarList, yyDollar[4].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 506: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:7070 + //line php5/php5.y:7007 { yyVAL.node = expr.NewEmpty(yyDollar[3].node) @@ -9664,15 +9630,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Empty, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[4].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 507: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:7084 + //line php5/php5.y:7021 { yyVAL.node = expr.NewEmpty(yyDollar[3].node) @@ -9680,15 +9646,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Empty, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[4].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 508: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:7098 + //line php5/php5.y:7035 { yyVAL.node = expr.NewInclude(yyDollar[2].node) @@ -9696,13 +9662,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 509: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:7110 + //line php5/php5.y:7047 { yyVAL.node = expr.NewIncludeOnce(yyDollar[2].node) @@ -9710,13 +9676,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 510: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:7122 + //line php5/php5.y:7059 { yyVAL.node = expr.NewEval(yyDollar[3].node) @@ -9724,15 +9690,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Eval, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[4].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 511: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:7136 + //line php5/php5.y:7073 { yyVAL.node = expr.NewRequire(yyDollar[2].node) @@ -9740,13 +9706,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 512: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:7148 + //line php5/php5.y:7085 { yyVAL.node = expr.NewRequireOnce(yyDollar[2].node) @@ -9754,13 +9720,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 513: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:7163 + //line php5/php5.y:7100 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -9768,18 +9734,18 @@ yydefault: } case 514: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:7169 + //line php5/php5.y:7106 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode(yyDollar[1].list), freefloating.End, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 515: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:7181 + //line php5/php5.y:7118 { yyVAL.node = yyDollar[1].node @@ -9787,7 +9753,7 @@ yydefault: } case 516: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:7187 + //line php5/php5.y:7124 { yyVAL.node = yyDollar[1].node @@ -9795,7 +9761,7 @@ yydefault: } case 517: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:7196 + //line php5/php5.y:7133 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -9805,16 +9771,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(target.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Name, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(target, freefloating.Start, yyDollar[3].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 518: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:7213 + //line php5/php5.y:7149 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -9824,16 +9789,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(target.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Name, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(target, freefloating.Start, yyDollar[3].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 519: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:7233 + //line php5/php5.y:7168 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -9843,16 +9807,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(target.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Name, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(target, freefloating.Start, yyDollar[3].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 520: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:7253 + //line php5/php5.y:7187 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -9862,10 +9825,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(target.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Name, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(target, freefloating.Start, yyDollar[3].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php5/php5.y b/php5/php5.y index 80316ec..57a8ba7 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -5,7 +5,7 @@ import ( "strings" "strconv" - "github.com/z7zmey/php-parser/meta" + "github.com/z7zmey/php-parser/freefloating" "github.com/z7zmey/php-parser/scanner" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node/scalar" @@ -285,7 +285,7 @@ start: yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) if yylex.(*Parser).currentToken.Value == "\xff" { - yylex.(*Parser).currentToken.Meta.SetTokenName(meta.NodeEnd).AppendTo(yylex.(*Parser).rootNode.GetMeta()) + yylex.(*Parser).setFreeFloating(yylex.(*Parser).rootNode, freefloating.End, yylex.(*Parser).currentToken.FreeFloating) } } ; @@ -295,7 +295,7 @@ top_statement_list: { if inlineHtmlNode, ok := $2.(*stmt.InlineHtml); ok && len($1) > 0 { prevNode := lastNode($1) - yylex.(*Parser).splitSemicolonTokenAndPhpCloseTag(inlineHtmlNode, prevNode) + yylex.(*Parser).splitSemiColonAndPhpCloseTag(inlineHtmlNode, prevNode) } if $2 != nil { @@ -322,7 +322,7 @@ namespace_name: namePart.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo(namePart.GetMeta()) + yylex.(*Parser).setFreeFloating(namePart, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -335,8 +335,8 @@ namespace_name: namePart.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) // save comments - $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) - $3.Meta.SetTokenName(meta.NodeStart).AppendTo(namePart.GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(namePart, freefloating.Start, $3.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -376,11 +376,11 @@ top_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) - $4.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $4, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.HaltCompiller, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.OpenParenthesisToken, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.CloseParenthesisToken, $4.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -396,9 +396,10 @@ top_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).MoveFreeFloating($2[0], name) + yylex.(*Parser).setFreeFloating(name, freefloating.End, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -412,9 +413,10 @@ top_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) - $5.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).MoveFreeFloating($2[0], name) + yylex.(*Parser).setFreeFloating(name, freefloating.End, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $5.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -426,9 +428,9 @@ top_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) - $4.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Namespace, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $4.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -440,9 +442,9 @@ top_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.UseDeclarationList, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -456,10 +458,10 @@ top_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.NodeStart).AppendTo(useType.GetMeta()) - $4.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $4, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating(useType, freefloating.Start, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.UseDeclarationList, $4.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -473,10 +475,10 @@ top_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.NodeStart).AppendTo(useType.GetMeta()) - $4.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $4, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating(useType, freefloating.Start, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.UseDeclarationList, $4.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -488,8 +490,8 @@ top_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) // save comments - $2.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $2, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($2)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -501,7 +503,7 @@ use_declarations: $$ = append($1, $3) // save comments - $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -524,7 +526,7 @@ use_declaration: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) // save comments - $1[0].GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1[0], $$) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -540,10 +542,9 @@ use_declaration: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.AsToken).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.NodeStart).AppendTo(alias.GetMeta()) - - $1[0].GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1[0], $$) + yylex.(*Parser).setFreeFloating(name, freefloating.End, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(alias, freefloating.Start, $3.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -557,9 +558,9 @@ use_declaration: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) - $2[0].GetMeta().Cut(newInheritMetaFilter()).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Slash, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).MoveFreeFloating($2[0], name) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -575,11 +576,11 @@ use_declaration: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($2, $4)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) - $2[0].GetMeta().Cut(newInheritMetaFilter()).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.AsToken).AppendTo($$.GetMeta()) - $4.Meta.SetTokenName(meta.NodeStart).AppendTo(alias.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Slash, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).MoveFreeFloating($2[0], name) + yylex.(*Parser).setFreeFloating(name, freefloating.End, $3.FreeFloating) + yylex.(*Parser).setFreeFloating(alias, freefloating.Start, $4.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -591,7 +592,7 @@ use_function_declarations: $$ = append($1, $3) // save comments - $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -614,7 +615,7 @@ use_function_declaration: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) // save comments - $1[0].GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1[0], $$) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -630,9 +631,9 @@ use_function_declaration: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $3)) // save comments - $1[0].GetMeta().Cut(newInheritMetaFilter()).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.AsToken).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.NodeStart).AppendTo(alias.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1[0], $$) + yylex.(*Parser).setFreeFloating(name, freefloating.End, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(alias, freefloating.Start, $3.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -646,9 +647,9 @@ use_function_declaration: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) - $2[0].GetMeta().Cut(newInheritMetaFilter()).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Slash, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).MoveFreeFloating($2[0], name) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -664,11 +665,11 @@ use_function_declaration: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($2, $4)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) - $2[0].GetMeta().Cut(newInheritMetaFilter()).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.AsToken).AppendTo($$.GetMeta()) - $4.Meta.SetTokenName(meta.NodeStart).AppendTo(alias.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Slash, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).MoveFreeFloating($2[0], name) + yylex.(*Parser).setFreeFloating(name, freefloating.End, $3.FreeFloating) + yylex.(*Parser).setFreeFloating(alias, freefloating.Start, $4.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -680,7 +681,7 @@ use_const_declarations: $$ = append($1, $3) // save comments - $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -703,7 +704,7 @@ use_const_declaration: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) // save comments - $1[0].GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1[0], $$) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -719,9 +720,9 @@ use_const_declaration: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $3)) // save comments - $1[0].GetMeta().Cut(newInheritMetaFilter()).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.AsToken).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.NodeStart).AppendTo(alias.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1[0], $$) + yylex.(*Parser).setFreeFloating(name, freefloating.End, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(alias, freefloating.Start, $3.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -735,9 +736,9 @@ use_const_declaration: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) - $2[0].GetMeta().Cut(newInheritMetaFilter()).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Slash, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).MoveFreeFloating($2[0], name) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -753,11 +754,11 @@ use_const_declaration: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($2, $4)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) - $2[0].GetMeta().Cut(newInheritMetaFilter()).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.AsToken).AppendTo($$.GetMeta()) - $4.Meta.SetTokenName(meta.NodeStart).AppendTo(alias.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Slash, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).MoveFreeFloating($2[0], name) + yylex.(*Parser).setFreeFloating(name, freefloating.End, $3.FreeFloating) + yylex.(*Parser).setFreeFloating(alias, freefloating.Start, $4.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -779,9 +780,9 @@ constant_declaration: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeNodeListPosition($1, constList.Consts)) // save comments - $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastConst.GetMeta()) - $3.Meta.SetTokenName(meta.NodeStart).AppendTo(constant.GetMeta()) - $4.Meta.SetTokenName(meta.EqualToken).AppendTo(constant.GetMeta()) + yylex.(*Parser).setFreeFloating(lastConst, freefloating.End, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(constant, freefloating.Start, $3.FreeFloating) + yylex.(*Parser).setFreeFloating(constant, freefloating.Name, $4.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -798,9 +799,9 @@ constant_declaration: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, constList)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.NodeStart).AppendTo(constant.GetMeta()) - $3.Meta.SetTokenName(meta.EqualToken).AppendTo(constant.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating(constant, freefloating.Start, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(constant, freefloating.Name, $3.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -811,7 +812,7 @@ inner_statement_list: { if inlineHtmlNode, ok := $2.(*stmt.InlineHtml); ok && len($1) > 0 { prevNode := lastNode($1) - yylex.(*Parser).splitSemicolonTokenAndPhpCloseTag(inlineHtmlNode, prevNode) + yylex.(*Parser).splitSemiColonAndPhpCloseTag(inlineHtmlNode, prevNode) } if $2 != nil { @@ -863,13 +864,15 @@ inner_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) - $4.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $4, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.HaltCompiller, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.OpenParenthesisToken, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.CloseParenthesisToken, $4.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + + yylex.(*Parser).Begin(scanner.HALT_COMPILER) } ; @@ -891,8 +894,8 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.ColonToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Label, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -907,8 +910,8 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $3.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -926,9 +929,13 @@ unticked_statement: } // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $2.GetMeta().Cut(meta.TokenNameFilter(meta.OpenParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo($$.GetMeta()) - $2.GetMeta().Cut(meta.TokenNameFilter(meta.CloseParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + if len((*$2.GetFreeFloating())[freefloating.OpenParenthesisToken]) > 0 { + yylex.(*Parser).setFreeFloating($$, freefloating.If, (*$2.GetFreeFloating())[freefloating.OpenParenthesisToken][:len((*$2.GetFreeFloating())[freefloating.OpenParenthesisToken])-1]); delete((*$2.GetFreeFloating()), freefloating.OpenParenthesisToken) + } + if len((*$2.GetFreeFloating())[freefloating.CloseParenthesisToken]) > 0 { + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, (*$2.GetFreeFloating())[freefloating.CloseParenthesisToken][:len((*$2.GetFreeFloating())[freefloating.CloseParenthesisToken])-1]); delete((*$2.GetFreeFloating()), freefloating.CloseParenthesisToken) + } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -942,13 +949,17 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $8)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $2.GetMeta().Cut(meta.TokenNameFilter(meta.OpenParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo($$.GetMeta()) - $2.GetMeta().Cut(meta.TokenNameFilter(meta.CloseParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.ColonToken).AppendTo($$.GetMeta()) - $7.Meta.SetTokenName(meta.EndifToken).AppendTo($$.GetMeta()) - $8.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $8, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + if len((*$2.GetFreeFloating())[freefloating.OpenParenthesisToken]) > 0 { + yylex.(*Parser).setFreeFloating($$, freefloating.If, (*$2.GetFreeFloating())[freefloating.OpenParenthesisToken][:len((*$2.GetFreeFloating())[freefloating.OpenParenthesisToken])-1]); delete((*$2.GetFreeFloating()), freefloating.OpenParenthesisToken) + } + if len((*$2.GetFreeFloating())[freefloating.CloseParenthesisToken]) > 0 { + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, (*$2.GetFreeFloating())[freefloating.CloseParenthesisToken][:len((*$2.GetFreeFloating())[freefloating.CloseParenthesisToken])-1]); delete((*$2.GetFreeFloating()), freefloating.CloseParenthesisToken) + } + yylex.(*Parser).setFreeFloating($$, freefloating.Cond, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $7.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.AltEnd, $8.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($8)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -967,9 +978,13 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $2.GetMeta().Cut(meta.TokenNameFilter(meta.OpenParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo($$.GetMeta()) - $2.GetMeta().Cut(meta.TokenNameFilter(meta.CloseParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + if len((*$2.GetFreeFloating())[freefloating.OpenParenthesisToken]) > 0 { + yylex.(*Parser).setFreeFloating($$, freefloating.While, (*$2.GetFreeFloating())[freefloating.OpenParenthesisToken][:len((*$2.GetFreeFloating())[freefloating.OpenParenthesisToken])-1]); delete((*$2.GetFreeFloating()), freefloating.OpenParenthesisToken) + } + if len((*$2.GetFreeFloating())[freefloating.CloseParenthesisToken]) > 0 { + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, (*$2.GetFreeFloating())[freefloating.CloseParenthesisToken][:len((*$2.GetFreeFloating())[freefloating.CloseParenthesisToken])-1]); delete((*$2.GetFreeFloating()), freefloating.CloseParenthesisToken) + } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -981,12 +996,16 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.WhileToken).AppendTo($$.GetMeta()) - $4.GetMeta().Cut(meta.TokenNameFilter(meta.OpenParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo($$.GetMeta()) - $4.GetMeta().Cut(meta.TokenNameFilter(meta.CloseParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo($$.GetMeta()) - $5.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $5, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $3.FreeFloating) + if len((*$4.GetFreeFloating())[freefloating.OpenParenthesisToken]) > 0 { + yylex.(*Parser).setFreeFloating($$, freefloating.While, (*$4.GetFreeFloating())[freefloating.OpenParenthesisToken][:len((*$4.GetFreeFloating())[freefloating.OpenParenthesisToken])-1]); delete((*$4.GetFreeFloating()), freefloating.OpenParenthesisToken) + } + if len((*$4.GetFreeFloating())[freefloating.CloseParenthesisToken]) > 0 { + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, (*$4.GetFreeFloating())[freefloating.CloseParenthesisToken][:len((*$4.GetFreeFloating())[freefloating.CloseParenthesisToken])-1]); delete((*$4.GetFreeFloating()), freefloating.CloseParenthesisToken) + } + yylex.(*Parser).setFreeFloating($$, freefloating.Cond, $5.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($5)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1009,11 +1028,11 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $9)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) - $4.Meta.SetTokenName(meta.ForInitSemicolonToken).AppendTo($$.GetMeta()) - $6.Meta.SetTokenName(meta.ForCondSemicolonToken).AppendTo($$.GetMeta()) - $8.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.For, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.InitExpr, $4.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.CondExpr, $6.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.IncExpr, $8.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1034,9 +1053,13 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $2.GetMeta().Cut(meta.TokenNameFilter(meta.OpenParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo($$.GetMeta()) - $2.GetMeta().Cut(meta.TokenNameFilter(meta.CloseParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + if len((*$2.GetFreeFloating())[freefloating.OpenParenthesisToken]) > 0 { + yylex.(*Parser).setFreeFloating($$, freefloating.Switch, (*$2.GetFreeFloating())[freefloating.OpenParenthesisToken][:len((*$2.GetFreeFloating())[freefloating.OpenParenthesisToken])-1]); delete((*$2.GetFreeFloating()), freefloating.OpenParenthesisToken) + } + if len((*$2.GetFreeFloating())[freefloating.CloseParenthesisToken]) > 0 { + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, (*$2.GetFreeFloating())[freefloating.CloseParenthesisToken][:len((*$2.GetFreeFloating())[freefloating.CloseParenthesisToken])-1]); delete((*$2.GetFreeFloating()), freefloating.CloseParenthesisToken) + } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1048,9 +1071,9 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $2, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($2)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1062,9 +1085,9 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1076,9 +1099,9 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $2, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($2)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1090,9 +1113,9 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1104,9 +1127,9 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $2, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($2)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1118,9 +1141,9 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1132,9 +1155,9 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1146,10 +1169,9 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) // save comments - $2.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $2, meta.SemiColonToken) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($2)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1161,9 +1183,9 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.VarList, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1175,9 +1197,9 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.VarList, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1189,10 +1211,10 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) - $3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Echo, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1204,7 +1226,7 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1216,10 +1238,9 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) // save comments - $2.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $2, meta.SemiColonToken) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($2)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1231,11 +1252,11 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) - $4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) - $5.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $5, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Unset, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.VarList, $4.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.CloseParenthesisToken, $5.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($5)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1269,13 +1290,13 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $8)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) - $4.Meta.SetTokenName(meta.AsToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Foreach, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $4.FreeFloating) if $6 != nil { - $6.GetMeta().Cut(meta.TokenNameFilter(meta.DoubleArrowToken)).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Key, (*$6.GetFreeFloating())[freefloating.Key]); delete((*$6.GetFreeFloating()), freefloating.Key) } - $7.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Var, $7.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1309,13 +1330,13 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $8)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) - $4.Meta.SetTokenName(meta.AsToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Foreach, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $4.FreeFloating) if $6 != nil { - $6.GetMeta().Cut(meta.TokenNameFilter(meta.DoubleArrowToken)).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Key, (*$6.GetFreeFloating())[freefloating.Key]); delete((*$6.GetFreeFloating()), freefloating.Key) } - $7.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Var, $7.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1328,9 +1349,9 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) - $4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Declare, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.ConstList, $4.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1342,8 +1363,8 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1359,9 +1380,9 @@ unticked_statement: } // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) - $4.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Try, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $4.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1373,9 +1394,9 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1389,10 +1410,10 @@ unticked_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.NodeStart).AppendTo(label.GetMeta()) - $3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating(label, freefloating.Start, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Label, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1409,22 +1430,22 @@ catch_statement: { identifier := node.NewIdentifier(strings.TrimLeftFunc($4.Value, isDollar)) variable := expr.NewVariable(identifier) - catch := stmt.NewCatch([]node.Node{$3}, variable, $7) - $$ = append([]node.Node{catch}, $9...) + catchNode := stmt.NewCatch([]node.Node{$3}, variable, $7) + $$ = append([]node.Node{catchNode}, $9...) // save position identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($4)) variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($4)) - catch.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $8)) + catchNode.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $8)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo(catch.GetMeta()) - $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(catch.GetMeta()) - $4.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) - $5.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(catch.GetMeta()) - $6.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(catch.GetMeta()) - $8.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(catch.GetMeta()) + yylex.(*Parser).setFreeFloating(catchNode, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating(catchNode, freefloating.Catch, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(variable, freefloating.Start, $4.FreeFloating) + yylex.(*Parser).addDollarToken(variable) + yylex.(*Parser).setFreeFloating(catchNode, freefloating.Var, $5.FreeFloating) + yylex.(*Parser).setFreeFloating(catchNode, freefloating.Cond, $6.FreeFloating) + yylex.(*Parser).setFreeFloating(catchNode, freefloating.Stmts, $8.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1445,9 +1466,9 @@ finally_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) - $4.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Finally, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $4.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1496,13 +1517,13 @@ additional_catch: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $8)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) - $4.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) - $5.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) - $6.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) - $8.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Catch, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(variable, freefloating.Start, $4.FreeFloating) + yylex.(*Parser).addDollarToken(variable) + yylex.(*Parser).setFreeFloating($$, freefloating.Var, $5.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Cond, $6.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $8.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1520,7 +1541,7 @@ unset_variables: $$ = append($1, $3) // save comments - $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1586,15 +1607,17 @@ unticked_function_declaration_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $9)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) if $2 != nil { - $2.Meta.SetTokenName(meta.AmpersandToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Function, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(name, freefloating.Start, $3.FreeFloating) + } else { + yylex.(*Parser).setFreeFloating(name, freefloating.Start, $3.FreeFloating) } - $3.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) - $4.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) - $6.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) - $7.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) - $9.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Name, $4.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.ParamList, $6.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Params, $7.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $9.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1623,9 +1646,9 @@ unticked_class_declaration_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $7)) // save comments - $2.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) - $5.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) - $7.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating(name, freefloating.Start, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Name, $5.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $7.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1639,10 +1662,10 @@ unticked_class_declaration_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $6)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) - $4.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) - $6.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating(name, freefloating.Start, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Name, $4.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $6.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1658,7 +1681,7 @@ class_entry_type: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1672,8 +1695,8 @@ class_entry_type: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.ClassToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.ModifierList, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1685,7 +1708,7 @@ class_entry_type: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1699,8 +1722,8 @@ class_entry_type: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.ClassToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.ModifierList, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1721,7 +1744,7 @@ extends_from: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.ExtendsToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1749,7 +1772,7 @@ interface_extends_list: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.ExtendsToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1770,7 +1793,7 @@ implements_list: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.ImplementsToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1788,7 +1811,7 @@ interface_list: $$ = append($1, $3) // save comments - $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1806,7 +1829,7 @@ foreach_optional_arg: $$ = $2 // save comments - $1.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Key, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1827,7 +1850,7 @@ foreach_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1839,9 +1862,9 @@ foreach_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) - $4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.List, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.ArrayPairList, $4.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1867,10 +1890,10 @@ for_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $1.Meta.SetTokenName(meta.ColonToken).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.EndforToken).AppendTo($$.GetMeta()) - $4.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $4, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating($$, freefloating.Cond, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.AltEnd, $4.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1896,10 +1919,10 @@ foreach_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $1.Meta.SetTokenName(meta.ColonToken).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.EndforeachToken).AppendTo($$.GetMeta()) - $4.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $4, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating($$, freefloating.Cond, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.AltEnd, $4.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1926,10 +1949,10 @@ declare_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $1.Meta.SetTokenName(meta.ColonToken).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.EnddeclareToken).AppendTo($$.GetMeta()) - $4.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $4, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating($$, freefloating.Cond, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.AltEnd, $4.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1948,8 +1971,8 @@ declare_list: constant.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo(constant.GetMeta()) - $2.Meta.SetTokenName(meta.EqualToken).AppendTo(constant.GetMeta()) + yylex.(*Parser).setFreeFloating(constant, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating(constant, freefloating.Name, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1964,9 +1987,9 @@ declare_list: constant.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $5)) // save comments - $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) - $3.Meta.SetTokenName(meta.NodeStart).AppendTo(constant.GetMeta()) - $4.Meta.SetTokenName(meta.EqualToken).AppendTo(constant.GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(constant, freefloating.Start, $3.FreeFloating) + yylex.(*Parser).setFreeFloating(constant, freefloating.Name, $4.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1984,8 +2007,8 @@ switch_case_list: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(caseList.GetMeta()) - $3.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(caseList.GetMeta()) + yylex.(*Parser).setFreeFloating(caseList, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating(caseList, freefloating.CaseListEnd, $3.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1999,10 +2022,9 @@ switch_case_list: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $1.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(caseList.GetMeta()) - $2.Meta.SetTokenName(meta.CaseSeparatorToken).AppendTo(caseList.GetMeta()) - yylex.(*Parser).appendMetaToken(caseList, $2, meta.CaseSeparatorToken) - $4.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(caseList.GetMeta()) + yylex.(*Parser).setFreeFloating(caseList, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating(caseList, freefloating.CaseListStart, append($2.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating(caseList, freefloating.CaseListEnd, $4.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2016,10 +2038,10 @@ switch_case_list: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $1.Meta.SetTokenName(meta.ColonToken).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.EndswitchToken).AppendTo($$.GetMeta()) - $4.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $4, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating($$, freefloating.Cond, $1.FreeFloating) + yylex.(*Parser).setFreeFloating(caseList, freefloating.CaseListEnd, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.AltEnd, $4.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2034,12 +2056,11 @@ switch_case_list: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5)) // save comments - $1.Meta.SetTokenName(meta.ColonToken).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.CaseSeparatorToken).AppendTo(caseList.GetMeta()) - yylex.(*Parser).appendMetaToken(caseList, $2, meta.CaseSeparatorToken) - $4.Meta.SetTokenName(meta.EndswitchToken).AppendTo($$.GetMeta()) - $5.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $5, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating($$, freefloating.Cond, $1.FreeFloating) + yylex.(*Parser).setFreeFloating(caseList, freefloating.CaseListStart, append($2.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating(caseList, freefloating.CaseListEnd, $4.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.AltEnd, $5.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($5)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2062,9 +2083,9 @@ case_list: _case.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $5)) // save comments - $2.Meta.SetTokenName(meta.NodeStart).AppendTo(_case.GetMeta()) - $4.Meta.SetTokenName(meta.CaseSeparatorToken).AppendTo(_case.GetMeta()) - yylex.(*Parser).appendMetaToken(_case, $4, meta.CaseSeparatorToken) + yylex.(*Parser).setFreeFloating(_case, freefloating.Start, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(_case, freefloating.Expr, $4.FreeFloating) + yylex.(*Parser).setFreeFloating(_case, freefloating.CaseSeparator, yylex.(*Parser).GetFreeFloatingToken($4)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2077,9 +2098,9 @@ case_list: _default.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $4)) // save comments - $2.Meta.SetTokenName(meta.NodeStart).AppendTo(_default.GetMeta()) - $3.Meta.SetTokenName(meta.CaseSeparatorToken).AppendTo(_default.GetMeta()) - yylex.(*Parser).appendMetaToken(_default, $3, meta.CaseSeparatorToken) + yylex.(*Parser).setFreeFloating(_default, freefloating.Start, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(_default, freefloating.Default, $3.FreeFloating) + yylex.(*Parser).setFreeFloating(_default, freefloating.CaseSeparator, yylex.(*Parser).GetFreeFloatingToken($3)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2118,10 +2139,10 @@ while_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $1.Meta.SetTokenName(meta.ColonToken).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.EndwhileToken).AppendTo($$.GetMeta()) - $4.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $4, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating($$, freefloating.Cond, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.AltEnd, $4.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2145,9 +2166,13 @@ elseif_list: _elseIf.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $4)) // save comments - $2.Meta.SetTokenName(meta.NodeStart).AppendTo(_elseIf.GetMeta()) - $3.GetMeta().Cut(meta.TokenNameFilter(meta.OpenParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo(_elseIf.GetMeta()) - $3.GetMeta().Cut(meta.TokenNameFilter(meta.CloseParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo(_elseIf.GetMeta()) + yylex.(*Parser).setFreeFloating(_elseIf, freefloating.Start, $2.FreeFloating) + if len((*$3.GetFreeFloating())[freefloating.OpenParenthesisToken]) > 0 { + yylex.(*Parser).setFreeFloating(_elseIf, freefloating.ElseIf, (*$3.GetFreeFloating())[freefloating.OpenParenthesisToken][:len((*$3.GetFreeFloating())[freefloating.OpenParenthesisToken])-1]); delete((*$3.GetFreeFloating()), freefloating.OpenParenthesisToken) + } + if len((*$3.GetFreeFloating())[freefloating.CloseParenthesisToken]) > 0 { + yylex.(*Parser).setFreeFloating(_elseIf, freefloating.Expr, (*$3.GetFreeFloating())[freefloating.CloseParenthesisToken][:len((*$3.GetFreeFloating())[freefloating.CloseParenthesisToken])-1]); delete((*$3.GetFreeFloating()), freefloating.CloseParenthesisToken) + } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2172,10 +2197,14 @@ new_elseif_list: _elseIf.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $5)) // save comments - $2.Meta.SetTokenName(meta.NodeStart).AppendTo(_elseIf.GetMeta()) - $3.GetMeta().Cut(meta.TokenNameFilter(meta.OpenParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo(_elseIf.GetMeta()) - $3.GetMeta().Cut(meta.TokenNameFilter(meta.CloseParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo(_elseIf.GetMeta()) - $4.Meta.SetTokenName(meta.ColonToken).AppendTo(_elseIf.GetMeta()) + yylex.(*Parser).setFreeFloating(_elseIf, freefloating.Start, $2.FreeFloating) + if len((*$3.GetFreeFloating())[freefloating.OpenParenthesisToken]) > 0 { + yylex.(*Parser).setFreeFloating(_elseIf, freefloating.ElseIf, (*$3.GetFreeFloating())[freefloating.OpenParenthesisToken][:len((*$3.GetFreeFloating())[freefloating.OpenParenthesisToken])-1]); delete((*$3.GetFreeFloating()), freefloating.OpenParenthesisToken) + } + if len((*$3.GetFreeFloating())[freefloating.CloseParenthesisToken]) > 0 { + yylex.(*Parser).setFreeFloating(_elseIf, freefloating.Expr, (*$3.GetFreeFloating())[freefloating.CloseParenthesisToken][:len((*$3.GetFreeFloating())[freefloating.CloseParenthesisToken])-1]); delete((*$3.GetFreeFloating()), freefloating.CloseParenthesisToken) + } + yylex.(*Parser).setFreeFloating(_elseIf, freefloating.Cond, $4.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2197,7 +2226,7 @@ else_single: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2221,8 +2250,8 @@ new_else_single: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.ColonToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Else, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2256,7 +2285,7 @@ non_empty_parameter_list: $$ = append($1, $3) // save comments - $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2284,20 +2313,27 @@ parameter: // save comments if $1 != nil { - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) } if $2 != nil { - $2.Meta.SetTokenName(meta.AmpersandToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.OptionalType, $2.FreeFloating) } if $3 != nil { - $3.Meta.SetTokenName(meta.EllipsisToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Ampersand, $3.FreeFloating) } - if $1 == nil && $2 == nil && $3 == nil { - $4.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - } else { - $4.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Variadic, $4.FreeFloating) + yylex.(*Parser).addDollarToken(variable) + + // normalize + if $3 == nil { + yylex.(*Parser).setFreeFloating($$, freefloating.Ampersand, (*$$.GetFreeFloating())[freefloating.Variadic]); delete((*$$.GetFreeFloating()), freefloating.Variadic) + } + if $2 == nil { + yylex.(*Parser).setFreeFloating($$, freefloating.OptionalType, (*$$.GetFreeFloating())[freefloating.Ampersand]); delete((*$$.GetFreeFloating()), freefloating.Ampersand) + } + if $1 == nil { + yylex.(*Parser).setFreeFloating($$, freefloating.Start, (*$$.GetFreeFloating())[freefloating.OptionalType]); delete((*$$.GetFreeFloating()), freefloating.OptionalType) } - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2322,21 +2358,28 @@ parameter: // save comments if $1 != nil { - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) } if $2 != nil { - $2.Meta.SetTokenName(meta.AmpersandToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.OptionalType, $2.FreeFloating) } if $3 != nil { - $3.Meta.SetTokenName(meta.EllipsisToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Ampersand, $3.FreeFloating) } - if $1 == nil && $2 == nil && $3 == nil { - $4.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - } else { - $4.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Variadic, $4.FreeFloating) + yylex.(*Parser).addDollarToken(variable) + yylex.(*Parser).setFreeFloating($$, freefloating.Var, $5.FreeFloating) + + // normalize + if $3 == nil { + yylex.(*Parser).setFreeFloating($$, freefloating.Ampersand, (*$$.GetFreeFloating())[freefloating.Variadic]); delete((*$$.GetFreeFloating()), freefloating.Variadic) + } + if $2 == nil { + yylex.(*Parser).setFreeFloating($$, freefloating.OptionalType, (*$$.GetFreeFloating())[freefloating.Ampersand]); delete((*$$.GetFreeFloating()), freefloating.Ampersand) + } + if $1 == nil { + yylex.(*Parser).setFreeFloating($$, freefloating.Start, (*$$.GetFreeFloating())[freefloating.OptionalType]); delete((*$$.GetFreeFloating()), freefloating.OptionalType) } - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) - $5.Meta.SetTokenName(meta.EqualToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2358,7 +2401,7 @@ optional_class_type: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2370,7 +2413,7 @@ optional_class_type: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2392,8 +2435,8 @@ function_call_parameter_list: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.ArgumentList, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2405,8 +2448,8 @@ function_call_parameter_list: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.ArgumentList, $3.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2420,8 +2463,8 @@ function_call_parameter_list: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.ArgumentList, $3.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2440,7 +2483,7 @@ non_empty_function_call_parameter_list: $$ = append($1, $3) // save comments - $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2455,7 +2498,7 @@ function_call_parameter: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($1)) // save comments - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2467,7 +2510,7 @@ function_call_parameter: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($1)) // save comments - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2479,7 +2522,7 @@ function_call_parameter: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($2)) // save comments - $1.Meta.SetTokenName(meta.AmpersandToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2491,7 +2534,7 @@ function_call_parameter: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.EllipsisToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2503,7 +2546,7 @@ global_var_list: $$ = append($1, $3) // save comments - $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2527,8 +2570,8 @@ global_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMeta($$, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).addDollarToken($$) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2540,9 +2583,8 @@ global_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) - yylex.(*Parser).appendMeta($$, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Dollar, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2554,12 +2596,10 @@ global_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) - $2.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $2, meta.NodeStart) - $4.Meta.SetTokenName(meta.NodeEnd).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $4, meta.NodeEnd) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Dollar, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($3, freefloating.Start, append($2.FreeFloating, append(yylex.(*Parser).GetFreeFloatingToken($2), (*$3.GetFreeFloating())[freefloating.Start]...)...)) + yylex.(*Parser).setFreeFloating($3, freefloating.End, append((*$3.GetFreeFloating())[freefloating.End], append($4.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($4)...)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2580,9 +2620,9 @@ static_var_list: staticVar.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) // save comments - $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) - $3.Meta.SetTokenName(meta.NodeStart).AppendTo(staticVar.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) + yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(staticVar, freefloating.Start, $3.FreeFloating) + yylex.(*Parser).addDollarToken(variable) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2599,10 +2639,10 @@ static_var_list: staticVar.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $5)) // save comments - $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) - $3.Meta.SetTokenName(meta.NodeStart).AppendTo(staticVar.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) - $4.Meta.SetTokenName(meta.EqualToken).AppendTo(staticVar.GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(staticVar, freefloating.Start, $3.FreeFloating) + yylex.(*Parser).addDollarToken(variable) + yylex.(*Parser).setFreeFloating(staticVar, freefloating.Var, $4.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2619,8 +2659,8 @@ static_var_list: staticVar.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo(staticVar.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) + yylex.(*Parser).setFreeFloating(staticVar, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).addDollarToken(variable) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2637,9 +2677,9 @@ static_var_list: staticVar.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo(staticVar.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) - $2.Meta.SetTokenName(meta.EqualToken).AppendTo(staticVar.GetMeta()) + yylex.(*Parser).setFreeFloating(staticVar, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).addDollarToken(variable) + yylex.(*Parser).setFreeFloating(staticVar, freefloating.Var, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2671,10 +2711,9 @@ class_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $3)) // save comments - $3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken) - - $1[0].GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1[0], $$) + yylex.(*Parser).setFreeFloating($$, freefloating.PropertyList, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2686,8 +2725,8 @@ class_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) // save comments - $2.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $2, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating($$, freefloating.ConstList, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($2)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2711,13 +2750,20 @@ class_statement: } // save comments - $2.Meta.SetTokenName(meta.FunctionToken).AppendTo($$.GetMeta()) - if $3 != nil { - $3.Meta.SetTokenName(meta.AmpersandToken).AppendTo($$.GetMeta()) + if len($1) > 0 { + yylex.(*Parser).MoveFreeFloating($1[0], $$) + yylex.(*Parser).setFreeFloating($$, freefloating.ModifierList, $2.FreeFloating) + } else { + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $2.FreeFloating) } - $4.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) - $5.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) - $7.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) + if $3 == nil { + yylex.(*Parser).setFreeFloating($$, freefloating.Function, $4.FreeFloating) + } else { + yylex.(*Parser).setFreeFloating($$, freefloating.Function, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Ampersand, $4.FreeFloating) + } + yylex.(*Parser).setFreeFloating($$, freefloating.Name, $5.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.ParameterList, $7.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2732,7 +2778,7 @@ trait_use_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2750,7 +2796,7 @@ trait_list: $$ = append($1, $3) // save comments - $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2764,9 +2810,8 @@ trait_adaptations: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) - + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2777,8 +2822,8 @@ trait_adaptations: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.AdaptationList, $3.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2820,8 +2865,8 @@ trait_adaptation_statement: $$ = $1; // save comments - $2.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $2, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating($$, freefloating.NameList, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($2)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2830,8 +2875,8 @@ trait_adaptation_statement: $$ = $1; // save comments - $2.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $2, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating($$, freefloating.Alias, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($2)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2846,7 +2891,8 @@ trait_precedence: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeNodeListPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.InsteadofToken).AppendTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Ref, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2864,7 +2910,7 @@ trait_reference_list: $$ = append($1, $3) // save comments - $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2881,7 +2927,7 @@ trait_method_reference: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2904,8 +2950,9 @@ trait_method_reference_fully_qualified: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.NodeStart).AppendTo(target.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Name, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(target, freefloating.Start, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2922,8 +2969,9 @@ trait_alias: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments - $2.Meta.SetTokenName(meta.AsToken).AppendTo($$.GetMeta()) - $4.Meta.SetTokenName(meta.NodeStart).AppendTo(alias.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Ref, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(alias, freefloating.Start, $4.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2935,7 +2983,8 @@ trait_alias: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.AsToken).AppendTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Ref, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2965,8 +3014,8 @@ method_body: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2978,8 +3027,8 @@ method_body: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $3.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3001,7 +3050,7 @@ variable_modifiers: modifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo(modifier.GetMeta()) + yylex.(*Parser).setFreeFloating(modifier, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3046,7 +3095,7 @@ member_modifier: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3058,7 +3107,7 @@ member_modifier: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3070,7 +3119,7 @@ member_modifier: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3082,7 +3131,7 @@ member_modifier: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3094,7 +3143,7 @@ member_modifier: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3106,7 +3155,7 @@ member_modifier: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3126,9 +3175,9 @@ class_variable_declaration: property.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) // save comments - $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) - $3.Meta.SetTokenName(meta.NodeStart).AppendTo(property.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) + yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(property, freefloating.Start, $3.FreeFloating) + yylex.(*Parser).addDollarToken(variable) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3145,10 +3194,10 @@ class_variable_declaration: property.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $5)) // save comments - $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) - $3.Meta.SetTokenName(meta.NodeStart).AppendTo(property.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) - $4.Meta.SetTokenName(meta.EqualToken).AppendTo(property.GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(property, freefloating.Start, $3.FreeFloating) + yylex.(*Parser).addDollarToken(variable) + yylex.(*Parser).setFreeFloating(property, freefloating.Var, $4.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3165,8 +3214,8 @@ class_variable_declaration: property.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo(property.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) + yylex.(*Parser).setFreeFloating(property, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).addDollarToken(variable) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3183,9 +3232,9 @@ class_variable_declaration: property.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo(property.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) - $2.Meta.SetTokenName(meta.EqualToken).AppendTo(property.GetMeta()) + yylex.(*Parser).setFreeFloating(property, freefloating.Start, $2.FreeFloating) + yylex.(*Parser).addDollarToken(variable) + yylex.(*Parser).setFreeFloating(property, freefloating.Var, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3207,9 +3256,9 @@ class_constant_declaration: $1.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $5)) // save comments - $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastConst.GetMeta()) - $3.Meta.SetTokenName(meta.NodeStart).AppendTo(constant.GetMeta()) - $4.Meta.SetTokenName(meta.EqualToken).AppendTo(constant.GetMeta()) + yylex.(*Parser).setFreeFloating(lastConst, freefloating.End, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(constant, freefloating.Start, $3.FreeFloating) + yylex.(*Parser).setFreeFloating(constant, freefloating.Name, $4.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3225,9 +3274,9 @@ class_constant_declaration: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $4)) // save comments - $1.Meta.SetTokenName(meta.ConstToken).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.NodeStart).AppendTo(constant.GetMeta()) - $3.Meta.SetTokenName(meta.EqualToken).AppendTo(constant.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating(constant, freefloating.Start, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(constant, freefloating.Name, $3.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3239,7 +3288,7 @@ echo_expr_list: $$ = append($1, $3) // save comments - $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3273,7 +3322,7 @@ non_empty_for_expr: $$ = append($1, $3) // save comments - $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3310,10 +3359,8 @@ chaining_dereference: fetch.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($3)) // save comments - $2.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo(fetch.GetMeta()) - yylex.(*Parser).appendMetaToken(fetch, $2, meta.OpenSquareBracket) - $4.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(fetch.GetMeta()) - yylex.(*Parser).appendMetaToken(fetch, $4, meta.CloseSquareBracket) + yylex.(*Parser).setFreeFloating(fetch, freefloating.Var, append($2.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating(fetch, freefloating.Expr, append($4.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($4)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3326,10 +3373,8 @@ chaining_dereference: fetch.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($2)) // save comments - $1.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo(fetch.GetMeta()) - yylex.(*Parser).appendMetaToken(fetch, $1, meta.OpenSquareBracket) - $3.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(fetch.GetMeta()) - yylex.(*Parser).appendMetaToken(fetch, $3, meta.CloseSquareBracket) + yylex.(*Parser).setFreeFloating(fetch, freefloating.Var, append($1.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($1)...)) + yylex.(*Parser).setFreeFloating(fetch, freefloating.Expr, append($3.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($3)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3384,7 +3429,7 @@ new_expr: } // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3393,18 +3438,18 @@ new_expr: expr_without_variable: T_LIST '(' assignment_list ')' '=' expr { - list := expr.NewList($3) - $$ = assign.NewAssign(list, $6) + listNode := expr.NewList($3) + $$ = assign.NewAssign(listNode, $6) // save position - list.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + listNode.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $6)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(list.GetMeta()) - $4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(list.GetMeta()) - $5.Meta.SetTokenName(meta.EqualToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating(listNode, freefloating.List, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(listNode, freefloating.ArrayPairList, $4.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Var, $5.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3416,9 +3461,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.EqualToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3429,11 +3473,10 @@ expr_without_variable: // save position $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) - // save comments - $2.Meta.SetTokenName(meta.EqualToken).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.AmpersandToken).AppendTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Equal, $3.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3457,11 +3500,10 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, _new)) // save comments - $2.Meta.SetTokenName(meta.EqualToken).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.AmpersandToken).AppendTo($$.GetMeta()) - $4.Meta.SetTokenName(meta.NodeStart).AppendTo(_new.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Equal, $3.FreeFloating) + yylex.(*Parser).setFreeFloating(_new, freefloating.Start, $4.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3473,7 +3515,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3484,10 +3526,8 @@ expr_without_variable: // save position $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - // save comments - $2.Meta.SetTokenName(meta.PlusEqualToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3499,9 +3539,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.MinusEqualToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3513,9 +3552,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.MulEqualToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3527,9 +3565,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.PowEqualToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3541,9 +3578,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.DivEqualToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3555,9 +3591,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.ConcatEqualToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3569,9 +3604,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.ModEqualToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3583,9 +3617,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.AndEqualToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3597,9 +3630,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.OrEqualToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3611,9 +3643,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.XorEqualToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3625,9 +3656,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.SlEqualToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3639,9 +3669,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.SrEqualToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3653,9 +3682,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) // save comments - $2.Meta.SetTokenName(meta.IncToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3667,7 +3695,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3679,9 +3707,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) // save comments - $2.Meta.SetTokenName(meta.DecToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3693,7 +3720,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3705,9 +3732,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.BooleanOrToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3719,9 +3745,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.BooleanAndToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3733,9 +3758,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.LogicalOrToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3747,9 +3771,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.LogicalAndToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3761,9 +3784,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.LogicalXorToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3775,9 +3797,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.VerticalBarToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3789,9 +3810,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.AmpersandToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3803,9 +3823,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.CaretToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3817,9 +3836,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.DotToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3831,9 +3849,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.PlusToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3845,9 +3862,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.MinusToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3859,9 +3875,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.AsteriskToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3873,9 +3888,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.PowToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3887,9 +3901,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.SlashToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3901,9 +3914,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.PercentToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3915,9 +3927,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.SlToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3929,9 +3940,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.SrToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3943,7 +3953,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3955,7 +3965,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3967,7 +3977,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3979,7 +3989,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3991,9 +4001,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.IsIdenticalToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4005,9 +4014,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.IsNotIdenticalToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4019,9 +4027,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.IsEqualToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4033,10 +4040,9 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.IsNotEqualToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $2, meta.IsNotEqualToken) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Equal, yylex.(*Parser).GetFreeFloatingToken($2)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4048,9 +4054,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.LessToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4062,9 +4067,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.IsSmallerOrEqualToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4076,9 +4080,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.GreaterToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4090,9 +4093,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.IsGreaterOrEqualToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4104,9 +4106,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.InstanceofToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4116,8 +4117,8 @@ expr_without_variable: yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - $$.GetMeta().Cut(meta.TokenNameFilter(meta.OpenParenthesisToken)).SetTokenName(meta.NodeStart).PrependTo($$.GetMeta()) - $$.GetMeta().Cut(meta.TokenNameFilter(meta.CloseParenthesisToken)).SetTokenName(meta.NodeEnd).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($1, freefloating.Start, append((*$1.GetFreeFloating())[freefloating.OpenParenthesisToken], (*$1.GetFreeFloating())[freefloating.Start]...)); delete((*$1.GetFreeFloating()), freefloating.OpenParenthesisToken) + yylex.(*Parser).setFreeFloating($1, freefloating.End, append((*$1.GetFreeFloating())[freefloating.End], (*$1.GetFreeFloating())[freefloating.CloseParenthesisToken]...)); delete((*$1.GetFreeFloating()), freefloating.CloseParenthesisToken) } | new_expr { @@ -4130,27 +4131,25 @@ expr_without_variable: $$ = $2 // save comments - yylex.(*Parser).prependMetaToken($$, $1, meta.NodeStart) - $1.Meta.SetTokenName(meta.NodeStart).PrependTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.NodeEnd).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $3, meta.NodeEnd) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, append($1.FreeFloating, append(yylex.(*Parser).GetFreeFloatingToken($1), (*$$.GetFreeFloating())[freefloating.Start]...)...)) + yylex.(*Parser).setFreeFloating($$, freefloating.End, append((*$$.GetFreeFloating())[freefloating.End], append($3.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($3)...)...)) for _, n := range($4) { switch nn := n.(type) { case *expr.ArrayDimFetch: nn.Variable = $$ $$ = nn - nn.Variable.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating(nn.Variable, $$) case *expr.PropertyFetch: nn.Variable = $$ $$ = nn - nn.Variable.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating(nn.Variable, $$) case *expr.MethodCall: nn.Variable = $$ $$ = nn - nn.Variable.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating(nn.Variable, $$) } // save position @@ -4167,10 +4166,9 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $5)) // save comments - $2.Meta.SetTokenName(meta.QuestionMarkToken).AppendTo($$.GetMeta()) - $4.Meta.SetTokenName(meta.ColonToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Cond, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.True, $4.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4182,10 +4180,9 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) // save comments - $2.Meta.SetTokenName(meta.QuestionMarkToken).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.ColonToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Cond, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.True, $3.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4203,8 +4200,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Cast, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4216,8 +4213,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Cast, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4229,8 +4226,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Cast, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4242,8 +4239,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Cast, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4255,8 +4252,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Cast, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4268,8 +4265,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Cast, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4281,35 +4278,29 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Cast, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_EXIT exit_expr { - var e *expr.Exit; - if $2 != nil { - e = $2.(*expr.Exit) - } else { - e = expr.NewExit(nil) - } - - $$ = e + e := $2.(*expr.Exit) + $$ = $2 if (strings.EqualFold($1.Value, "die")) { e.Die = true } // save position - if $2 == nil { + if $2.GetPosition() == nil { $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) } else { $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) } // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4321,7 +4312,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4351,7 +4342,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4363,7 +4354,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4375,7 +4366,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4387,14 +4378,21 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $9)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - if $2 != nil { - $2.Meta.SetTokenName(meta.AmpersandToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + if $2 == nil { + yylex.(*Parser).setFreeFloating($$, freefloating.Function, $3.FreeFloating) + } else { + yylex.(*Parser).setFreeFloating($$, freefloating.Function, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Ampersand, $3.FreeFloating) + } + yylex.(*Parser).setFreeFloating($$, freefloating.ParameterList, $5.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.LexicalVars, $7.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $9.FreeFloating) + + // normalize + if $6 == nil { + yylex.(*Parser).setFreeFloating($$, freefloating.Params, (*$$.GetFreeFloating())[freefloating.LexicalVars]); delete((*$$.GetFreeFloating()), freefloating.LexicalVars) } - $3.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) - $5.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) - $7.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) - $9.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4406,15 +4404,22 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $10)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.FunctionToken).AppendTo($$.GetMeta()) - if $3 != nil { - $3.Meta.SetTokenName(meta.AmpersandToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Static, $2.FreeFloating) + if $3 == nil { + yylex.(*Parser).setFreeFloating($$, freefloating.Function, $4.FreeFloating) + } else { + yylex.(*Parser).setFreeFloating($$, freefloating.Function, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Ampersand, $4.FreeFloating) + } + yylex.(*Parser).setFreeFloating($$, freefloating.ParameterList, $6.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.LexicalVars, $8.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $10.FreeFloating) + + // normalize + if $7 == nil { + yylex.(*Parser).setFreeFloating($$, freefloating.Params, (*$$.GetFreeFloating())[freefloating.LexicalVars]); delete((*$$.GetFreeFloating()), freefloating.LexicalVars) } - $4.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) - $6.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) - $8.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) - $10.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4429,7 +4434,7 @@ yield_expr: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4441,7 +4446,7 @@ yield_expr: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4453,8 +4458,8 @@ yield_expr: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $4)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $3.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4466,8 +4471,8 @@ yield_expr: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $4)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $3.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4482,12 +4487,9 @@ combined_scalar_offset: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments - $2.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $2, meta.OpenSquareBracket) - $4.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $4, meta.CloseSquareBracket) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Var, append($2.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, append($4.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($4)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4499,12 +4501,9 @@ combined_scalar_offset: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments - $2.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $2, meta.OpenSquareBracket) - $4.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $4, meta.CloseSquareBracket) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Var, append($2.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, append($4.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($4)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4518,11 +4517,9 @@ combined_scalar_offset: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(str, $4)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $2, meta.OpenSquareBracket) - $4.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $4, meta.CloseSquareBracket) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Var, append($2.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, append($4.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($4)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4534,12 +4531,9 @@ combined_scalar_offset: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments - $2.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $2, meta.OpenSquareBracket) - $4.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $4, meta.CloseSquareBracket) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Var, append($2.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, append($4.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($4)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4554,9 +4548,9 @@ combined_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) - $4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Array, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.ArrayPairList, $4.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4568,8 +4562,8 @@ combined_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.ArrayPairList, $3.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4597,9 +4591,9 @@ lexical_vars: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) - $4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Use, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.LexicalVarList, $4.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4617,9 +4611,9 @@ lexical_var_list: variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) // save comments - $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) - $3.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) + yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(variable, freefloating.Start, $3.FreeFloating) + yylex.(*Parser).addDollarToken(variable) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4636,10 +4630,10 @@ lexical_var_list: reference.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($3, $4)) // save comments - $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) - $3.Meta.SetTokenName(meta.NodeStart).AppendTo(reference.GetMeta()) - $4.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) + yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(reference, freefloating.Start, $3.FreeFloating) + yylex.(*Parser).setFreeFloating(variable, freefloating.Start, $4.FreeFloating) + yylex.(*Parser).addDollarToken(variable) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4654,8 +4648,8 @@ lexical_var_list: variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) + yylex.(*Parser).setFreeFloating(variable, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).addDollarToken(variable) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4672,9 +4666,9 @@ lexical_var_list: reference.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo(reference.GetMeta()) - $2.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) + yylex.(*Parser).setFreeFloating(reference, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating(variable, freefloating.Start, $2.FreeFloating) + yylex.(*Parser).addDollarToken(variable) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4691,7 +4685,7 @@ function_call: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(name, $2)) // save comments - $1[0].GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1[0], $$) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4705,8 +4699,8 @@ function_call: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(funcName, $4)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo(funcName.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating(funcName, freefloating.Namespace, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4720,7 +4714,7 @@ function_call: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(funcName, $3)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4732,8 +4726,8 @@ function_call: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) // save comments - $2.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo($$.GetMeta()) - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Name, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4745,8 +4739,8 @@ function_call: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) // save comments - $2.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo($$.GetMeta()) - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Name, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4758,8 +4752,8 @@ function_call: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) // save comments - $2.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo($$.GetMeta()) - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Name, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4771,8 +4765,8 @@ function_call: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) // save comments - $2.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo($$.GetMeta()) - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Name, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4782,7 +4776,9 @@ function_call: // save position $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $2)) - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4797,7 +4793,7 @@ class_name: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4809,7 +4805,7 @@ class_name: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) // save comments - $1[0].GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1[0], $$) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4821,8 +4817,8 @@ class_name: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Namespace, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4834,7 +4830,7 @@ class_name: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4849,7 +4845,7 @@ fully_qualified_class_name: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) // save comments - $1[0].GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1[0], $$) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4861,8 +4857,8 @@ fully_qualified_class_name: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Namespace, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4874,7 +4870,7 @@ fully_qualified_class_name: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4901,7 +4897,7 @@ dynamic_class_name_reference: $$ = $1 // save comments - $2.Meta.SetTokenName(meta.ObjectOperatorToken).AppendTo($3[0].GetMeta()) + yylex.(*Parser).setFreeFloating($3[0], freefloating.Var, $2.FreeFloating) for _, n := range($3) { switch nn := n.(type) { @@ -4909,13 +4905,13 @@ dynamic_class_name_reference: nn.Variable = $$ $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn)) $$ = nn - nn.Variable.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating(nn.Variable, $$) case *expr.PropertyFetch: nn.Variable = $$ $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn)) $$ = nn - nn.Variable.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating(nn.Variable, $$) } } @@ -4925,13 +4921,13 @@ dynamic_class_name_reference: nn.Variable = $$ $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn)) $$ = nn - nn.Variable.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating(nn.Variable, $$) case *expr.PropertyFetch: nn.Variable = $$ $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn)) $$ = nn - nn.Variable.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating(nn.Variable, $$) } } @@ -4968,7 +4964,7 @@ dynamic_class_name_variable_property: $$ = $2 // save comments - $1.Meta.SetTokenName(meta.ObjectOperatorToken).AppendTo($2[0].GetMeta()) + yylex.(*Parser).setFreeFloating($2[0], freefloating.Var, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4977,7 +4973,7 @@ dynamic_class_name_variable_property: exit_expr: /* empty */ { - $$ = nil + $$ = expr.NewExit(nil); yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4989,10 +4985,8 @@ exit_expr: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $1, meta.OpenParenthesisToken) - $2.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $2, meta.CloseParenthesisToken) + yylex.(*Parser).setFreeFloating($$, freefloating.Exit, append($1.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($1)...)) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, append($2.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($2)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5010,8 +5004,8 @@ exit_expr: yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) // save comments - $1.GetMeta().Cut(meta.TokenNameFilter(meta.OpenParenthesisToken)).AppendTo($$.GetMeta()) - $1.GetMeta().Cut(meta.TokenNameFilter(meta.CloseParenthesisToken)).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Exit, (*$1.GetFreeFloating())[freefloating.OpenParenthesisToken]); delete((*$1.GetFreeFloating()), freefloating.OpenParenthesisToken) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, (*$1.GetFreeFloating())[freefloating.CloseParenthesisToken]); delete((*$1.GetFreeFloating()), freefloating.CloseParenthesisToken) } ; @@ -5024,7 +5018,11 @@ backticks_expr: } | T_ENCAPSED_AND_WHITESPACE { - $$ = []node.Node{scalar.NewEncapsedStringPart($1.Value)} + part := scalar.NewEncapsedStringPart($1.Value) + $$ = []node.Node{part} + + // save position + part.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5060,7 +5058,7 @@ common_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5072,7 +5070,7 @@ common_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5084,7 +5082,7 @@ common_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5096,7 +5094,7 @@ common_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5108,7 +5106,7 @@ common_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5120,7 +5118,7 @@ common_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5132,7 +5130,7 @@ common_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5144,7 +5142,7 @@ common_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5156,7 +5154,7 @@ common_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5168,11 +5166,11 @@ common_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } - | T_START_HEREDOC T_ENCAPSED_AND_WHITESPACE T_END_HEREDOC + | T_START_HEREDOC T_ENCAPSED_AND_WHITESPACE T_END_HEREDOC { encapsed := scalar.NewEncapsedStringPart($2.Value) $$ = scalar.NewHeredoc($1.Value, []node.Node{encapsed}) @@ -5182,7 +5180,7 @@ common_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5194,7 +5192,7 @@ common_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5211,10 +5209,9 @@ static_class_constant: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.NodeStart).AppendTo(target.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Name, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(target, freefloating.Start, $3.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5252,7 +5249,7 @@ static_scalar_value: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(name)) // save comments - $1[0].GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1[0], $$) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5266,8 +5263,8 @@ static_scalar_value: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo(name.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Namespace, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5281,7 +5278,7 @@ static_scalar_value: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5293,9 +5290,9 @@ static_scalar_value: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) - $4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Array, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.ArrayPairList, $4.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5307,8 +5304,8 @@ static_scalar_value: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.ArrayPairList, $3.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5326,7 +5323,7 @@ static_scalar_value: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5347,12 +5344,9 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments - $2.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $2, meta.OpenSquareBracket) - $4.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $4, meta.CloseSquareBracket) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Var, append($2.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, append($4.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($4)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5364,9 +5358,8 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.PlusToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5378,9 +5371,8 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.MinusToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5392,9 +5384,8 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.AsteriskToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5406,9 +5397,8 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.PowToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5420,9 +5410,8 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.SlashToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5434,9 +5423,8 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.PercentToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5448,7 +5436,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5460,7 +5448,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5472,9 +5460,8 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.VerticalBarToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5486,9 +5473,8 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.AmpersandToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5500,9 +5486,8 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.CaretToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5514,9 +5499,8 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.SlToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5528,9 +5512,8 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.SrToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5542,9 +5525,8 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.DotToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5556,9 +5538,8 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.LogicalXorToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5570,9 +5551,8 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.LogicalAndToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5584,9 +5564,8 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.LogicalOrToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5598,9 +5577,8 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.BooleanAndToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5612,9 +5590,8 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.BooleanOrToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5626,9 +5603,8 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.IsIdenticalToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5640,9 +5616,8 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.IsNotIdenticalToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5654,9 +5629,8 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.IsEqualToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5668,10 +5642,9 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.IsNotEqualToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $2, meta.IsNotEqualToken) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Equal, yylex.(*Parser).GetFreeFloatingToken($2)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5683,9 +5656,8 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.LessToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5697,9 +5669,8 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.GreaterToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5711,9 +5682,8 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.IsSmallerOrEqualToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5725,9 +5695,8 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.IsGreaterOrEqualToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5739,10 +5708,9 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) // save comments - $2.Meta.SetTokenName(meta.QuestionMarkToken).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.ColonToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Cond, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.True, $3.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5754,10 +5722,9 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $5)) // save comments - $2.Meta.SetTokenName(meta.QuestionMarkToken).AppendTo($$.GetMeta()) - $4.Meta.SetTokenName(meta.ColonToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Cond, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.True, $4.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5769,7 +5736,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5781,7 +5748,7 @@ static_operation: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5790,10 +5757,8 @@ static_operation: $$ = $2 // save comments - yylex.(*Parser).prependMetaToken($$, $1, meta.NodeStart) - $1.Meta.SetTokenName(meta.NodeStart).PrependTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.NodeEnd).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $3, meta.NodeEnd) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, append($1.FreeFloating, append(yylex.(*Parser).GetFreeFloatingToken($1), (*$$.GetFreeFloating())[freefloating.Start]...)...)) + yylex.(*Parser).setFreeFloating($$, freefloating.End, append((*$$.GetFreeFloating())[freefloating.End], append($3.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($3)...)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5816,7 +5781,7 @@ general_constant: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(name)) // save comments - $1[0].GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1[0], $$) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5824,12 +5789,14 @@ general_constant: { name := name.NewRelative($3) $$ = expr.NewConstFetch(name) + + // save position name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3)) $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(name)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo(name.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating(name, freefloating.Namespace, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5843,7 +5810,7 @@ general_constant: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(name)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5860,8 +5827,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) - yylex.(*Parser).appendMeta($$, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5891,7 +5857,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5903,7 +5869,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5915,7 +5881,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5934,7 +5900,7 @@ static_array_pair_list: // save comments if $2 != nil { - $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -5962,10 +5928,9 @@ non_empty_static_array_pair_list: arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($3, $5)) // save comments - $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) - $4.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo(arrayItem.GetMeta()) - - $3.GetMeta().Cut(newInheritMetaFilter()).PrependTo(arrayItem.GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) + yylex.(*Parser).MoveFreeFloating($3, arrayItem) + yylex.(*Parser).setFreeFloating(arrayItem, freefloating.Expr, $4.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5978,9 +5943,8 @@ non_empty_static_array_pair_list: arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($3)) // save comments - $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) - - $3.GetMeta().Cut(newInheritMetaFilter()).PrependTo(arrayItem.GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) + yylex.(*Parser).MoveFreeFloating($3, arrayItem) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5993,9 +5957,8 @@ non_empty_static_array_pair_list: arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo(arrayItem.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo(arrayItem.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, arrayItem) + yylex.(*Parser).setFreeFloating(arrayItem, freefloating.Expr, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6007,7 +5970,8 @@ non_empty_static_array_pair_list: // save position arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($1)) - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo(arrayItem.GetMeta()) + // save comments + yylex.(*Parser).MoveFreeFloating($1, arrayItem) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6034,10 +5998,14 @@ parenthesis_expr: $$ = $2 // save comments - yylex.(*Parser).prependMetaToken($$, $1, meta.OpenParenthesisToken) - $1.Meta.SetTokenName(meta.OpenParenthesisToken).PrependTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $3, meta.CloseParenthesisToken) + if len((*$2.GetFreeFloating())[freefloating.OpenParenthesisToken]) > 0 { + yylex.(*Parser).setFreeFloating($2, freefloating.Start, append((*$2.GetFreeFloating())[freefloating.OpenParenthesisToken], (*$2.GetFreeFloating())[freefloating.Start]...)) + } + if len((*$2.GetFreeFloating())[freefloating.CloseParenthesisToken]) > 0 { + yylex.(*Parser).setFreeFloating($2, freefloating.End, append((*$2.GetFreeFloating())[freefloating.End], (*$2.GetFreeFloating())[freefloating.CloseParenthesisToken]...)) + } + yylex.(*Parser).setFreeFloating($2, freefloating.OpenParenthesisToken, append($1.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($1)...)) + yylex.(*Parser).setFreeFloating($2, freefloating.CloseParenthesisToken, append($3.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($3)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6046,10 +6014,14 @@ parenthesis_expr: $$ = $2 // save comments - yylex.(*Parser).prependMetaToken($$, $1, meta.OpenParenthesisToken) - $1.Meta.SetTokenName(meta.OpenParenthesisToken).PrependTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $3, meta.CloseParenthesisToken) + if len((*$2.GetFreeFloating())[freefloating.OpenParenthesisToken]) > 0 { + yylex.(*Parser).setFreeFloating($2, freefloating.Start, append((*$2.GetFreeFloating())[freefloating.OpenParenthesisToken], (*$2.GetFreeFloating())[freefloating.Start]...)) + } + if len((*$2.GetFreeFloating())[freefloating.CloseParenthesisToken]) > 0 { + yylex.(*Parser).setFreeFloating($2, freefloating.End, append((*$2.GetFreeFloating())[freefloating.End], (*$2.GetFreeFloating())[freefloating.CloseParenthesisToken]...)) + } + yylex.(*Parser).setFreeFloating($2, freefloating.OpenParenthesisToken, append($1.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($1)...)) + yylex.(*Parser).setFreeFloating($2, freefloating.CloseParenthesisToken, append($3.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($3)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6095,7 +6067,7 @@ variable: } // save comments - $2.Meta.SetTokenName(meta.ObjectOperatorToken).AppendTo($3[0].GetMeta()) + yylex.(*Parser).setFreeFloating($3[0], freefloating.Var, $2.FreeFloating) for _, n := range($3) { switch nn := n.(type) { @@ -6103,19 +6075,19 @@ variable: nn.Variable = $$ nn.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn)) $$ = nn - nn.Variable.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating(nn.Variable, $$) case *expr.PropertyFetch: nn.Variable = $$ nn.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn)) $$ = nn - nn.Variable.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating(nn.Variable, $$) case *expr.MethodCall: nn.Variable = $$ nn.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn)) $$ = nn - nn.Variable.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating(nn.Variable, $$) } } @@ -6125,19 +6097,19 @@ variable: nn.Variable = $$ nn.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn)) $$ = nn - nn.Variable.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating(nn.Variable, $$) case *expr.PropertyFetch: nn.Variable = $$ nn.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn)) $$ = nn - nn.Variable.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating(nn.Variable, $$) case *expr.MethodCall: nn.Variable = $$ nn.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn)) $$ = nn - nn.Variable.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating(nn.Variable, $$) } } @@ -6178,7 +6150,7 @@ variable_property: $$ = $2 // save comments - $1.Meta.SetTokenName(meta.ObjectOperatorToken).AppendTo($2[0].GetMeta()) + yylex.(*Parser).setFreeFloating($2[0], freefloating.Var, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6194,10 +6166,8 @@ array_method_dereference: fetch.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($3)) // save comments - $2.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo(fetch.GetMeta()) - yylex.(*Parser).appendMetaToken(fetch, $2, meta.OpenSquareBracket) - $4.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(fetch.GetMeta()) - yylex.(*Parser).appendMetaToken(fetch, $4, meta.CloseSquareBracket) + yylex.(*Parser).setFreeFloating(fetch, freefloating.Var, append($2.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating(fetch, freefloating.Expr, append($4.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($4)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6210,10 +6180,8 @@ array_method_dereference: fetch.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($3)) // save comments - $2.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo(fetch.GetMeta()) - yylex.(*Parser).appendMetaToken(fetch, $2, meta.OpenSquareBracket) - $4.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(fetch.GetMeta()) - yylex.(*Parser).appendMetaToken(fetch, $4, meta.CloseSquareBracket) + yylex.(*Parser).setFreeFloating(fetch, freefloating.Var, append($2.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating(fetch, freefloating.Expr, append($4.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($4)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6282,9 +6250,8 @@ static_member: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Name, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6296,9 +6263,8 @@ static_member: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Name, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6322,12 +6288,9 @@ array_function_dereference: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments - $2.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $2, meta.OpenSquareBracket) - $4.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $4, meta.CloseSquareBracket) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Var, append($2.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, append($4.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($4)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6339,12 +6302,9 @@ array_function_dereference: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments - $2.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $2, meta.OpenSquareBracket) - $4.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $4, meta.CloseSquareBracket) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Var, append($2.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, append($4.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($4)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6408,12 +6368,9 @@ reference_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments - $2.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $2, meta.OpenSquareBracket) - $4.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $4, meta.CloseSquareBracket) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Var, append($2.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, append($4.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($4)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6425,12 +6382,9 @@ reference_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments - $2.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $2, meta.OpenCurlyBracesToken) - $4.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $4, meta.CloseCurlyBracesToken) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Var, append($2.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, append($4.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($4)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6454,8 +6408,8 @@ compound_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMeta($$, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).addDollarToken($$) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6467,12 +6421,10 @@ compound_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) - $2.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $2, meta.NodeStart) - $4.Meta.SetTokenName(meta.NodeEnd).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $4, meta.NodeEnd) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Dollar, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($3, freefloating.Start, append($2.FreeFloating, append(yylex.(*Parser).GetFreeFloatingToken($2), (*$3.GetFreeFloating())[freefloating.Start]...)...)) + yylex.(*Parser).setFreeFloating($3, freefloating.End, append((*$3.GetFreeFloating())[freefloating.End], append($4.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($4)...)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6523,10 +6475,8 @@ object_dim_list: fetch.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($3)) // save comments - $2.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo(fetch.GetMeta()) - yylex.(*Parser).appendMetaToken(fetch, $2, meta.OpenSquareBracket) - $4.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(fetch.GetMeta()) - yylex.(*Parser).appendMetaToken(fetch, $4, meta.CloseSquareBracket) + yylex.(*Parser).setFreeFloating(fetch, freefloating.Var, append($2.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating(fetch, freefloating.Expr, append($4.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($4)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6539,10 +6489,8 @@ object_dim_list: fetch.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($3)) // save comments - $2.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(fetch.GetMeta()) - yylex.(*Parser).appendMetaToken(fetch, $2, meta.OpenCurlyBracesToken) - $4.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(fetch.GetMeta()) - yylex.(*Parser).appendMetaToken(fetch, $4, meta.CloseCurlyBracesToken) + yylex.(*Parser).setFreeFloating(fetch, freefloating.Var, append($2.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating(fetch, freefloating.Expr, append($4.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($4)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6567,7 +6515,7 @@ variable_name: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6579,10 +6527,8 @@ variable_name: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - yylex.(*Parser).prependMetaToken($$, $1, meta.NodeStart) - $1.Meta.SetTokenName(meta.NodeStart).PrependTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.NodeEnd).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $3, meta.NodeEnd) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, append($1.FreeFloating, append(yylex.(*Parser).GetFreeFloatingToken($1), (*$$.GetFreeFloating())[freefloating.Start]...)...)) + yylex.(*Parser).setFreeFloating($$, freefloating.End, append((*$$.GetFreeFloating())[freefloating.End], append($3.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($3)...)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6598,8 +6544,8 @@ simple_indirect_reference: n.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo(n.GetMeta()) - yylex.(*Parser).appendMetaToken(n, $1, meta.NodeStart) + yylex.(*Parser).setFreeFloating(n, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating(n, freefloating.Dollar, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6616,8 +6562,8 @@ simple_indirect_reference: n.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) // save comments - $2.Meta.SetTokenName(meta.NodeStart).AppendTo(n.GetMeta()) - yylex.(*Parser).appendMetaToken(n, $2, meta.NodeStart) + yylex.(*Parser).setFreeFloating(n, freefloating.Start, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(n, freefloating.Dollar, yylex.(*Parser).GetFreeFloatingToken($2)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6633,7 +6579,7 @@ assignment_list: $$ = append($1, $3) // save comments - $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6658,23 +6604,24 @@ assignment_list_element: // save position $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($1)) - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_LIST '(' assignment_list ')' { - item := expr.NewList($3) - $$ = expr.NewArrayItem(nil, item) + listNode := expr.NewList($3) + $$ = expr.NewArrayItem(nil, listNode) // save position - item.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(item)) + listNode.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(listNode)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(item.GetMeta()) - $4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(item.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating(listNode, freefloating.List, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(listNode, freefloating.ArrayPairList, $4.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6704,7 +6651,7 @@ array_pair_list: // save comments if $2 != nil { - $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -6721,10 +6668,9 @@ non_empty_array_pair_list: arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($3, $5)) // save comments - $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) - $4.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo(arrayItem.GetMeta()) - - $3.GetMeta().Cut(newInheritMetaFilter()).PrependTo(arrayItem.GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) + yylex.(*Parser).MoveFreeFloating($3, arrayItem) + yylex.(*Parser).setFreeFloating(arrayItem, freefloating.Expr, $4.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6737,9 +6683,8 @@ non_empty_array_pair_list: arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($3)) // save comments - $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) - - $3.GetMeta().Cut(newInheritMetaFilter()).PrependTo(arrayItem.GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) + yylex.(*Parser).MoveFreeFloating($3, arrayItem) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6752,9 +6697,8 @@ non_empty_array_pair_list: arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo(arrayItem.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo(arrayItem.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, arrayItem) + yylex.(*Parser).setFreeFloating(arrayItem, freefloating.Expr, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6766,7 +6710,8 @@ non_empty_array_pair_list: // save position arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($1)) - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo(arrayItem.GetMeta()) + // save comments + yylex.(*Parser).MoveFreeFloating($1, arrayItem) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6781,11 +6726,10 @@ non_empty_array_pair_list: arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($3, $6)) // save comments - $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) - $4.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo(arrayItem.GetMeta()) - $5.Meta.SetTokenName(meta.NodeStart).AppendTo(reference.GetMeta()) - - $3.GetMeta().Cut(newInheritMetaFilter()).PrependTo(arrayItem.GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) + yylex.(*Parser).MoveFreeFloating($3, arrayItem) + yylex.(*Parser).setFreeFloating(arrayItem, freefloating.Expr, $4.FreeFloating) + yylex.(*Parser).setFreeFloating(reference, freefloating.Start, $5.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6800,8 +6744,8 @@ non_empty_array_pair_list: arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $4)) // save comments - $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) - $3.Meta.SetTokenName(meta.NodeStart).AppendTo(arrayItem.GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(arrayItem, freefloating.Start, $3.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6816,10 +6760,9 @@ non_empty_array_pair_list: arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) // save comments - $2.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo(arrayItem.GetMeta()) - $3.Meta.SetTokenName(meta.NodeStart).AppendTo(reference.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo(arrayItem.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, arrayItem) + yylex.(*Parser).setFreeFloating(arrayItem, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(reference, freefloating.Start, $3.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6834,7 +6777,7 @@ non_empty_array_pair_list: arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo(arrayItem.GetMeta()) + yylex.(*Parser).setFreeFloating(arrayItem, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6856,7 +6799,7 @@ encaps_list: encapsed.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) // save comments - $2.Meta.SetTokenName(meta.NodeStart).AppendTo(encapsed.GetMeta()) + yylex.(*Parser).setFreeFloating(encapsed, freefloating.Start, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6875,7 +6818,7 @@ encaps_list: encapsed.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo(encapsed.GetMeta()) + yylex.(*Parser).setFreeFloating(encapsed, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6892,8 +6835,8 @@ encaps_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMeta($$, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).addDollarToken($$) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6909,11 +6852,9 @@ encaps_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) - $2.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $2, meta.OpenSquareBracket) - $4.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $4, meta.CloseSquareBracket) + yylex.(*Parser).addDollarToken(variable) + yylex.(*Parser).setFreeFloating($$, freefloating.Var, append($2.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, append($4.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($4)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6931,9 +6872,9 @@ encaps_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) - $2.Meta.SetTokenName(meta.ObjectOperatorToken).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.NodeStart).AppendTo(fetch.GetMeta()) + yylex.(*Parser).addDollarToken(variable) + yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(fetch, freefloating.Start, $3.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6947,9 +6888,8 @@ encaps_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) - $3.Meta.SetTokenName(meta.NodeEnd).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $3, meta.NodeEnd) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($$, freefloating.End, append($3.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($3)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6965,10 +6905,8 @@ encaps_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) - $2.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) - $3.Meta.SetTokenName(meta.NodeEnd).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $3, meta.NodeEnd) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($$, freefloating.End, append($3.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($3)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6984,13 +6922,10 @@ encaps_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $6)) // save comments - yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) - $3.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $3, meta.OpenSquareBracket) - $5.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $5, meta.CloseSquareBracket) - $6.Meta.SetTokenName(meta.NodeEnd).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $6, meta.NodeEnd) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($$, freefloating.Var, append($3.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($3)...)) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, append($5.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($5)...)) + yylex.(*Parser).setFreeFloating($$, freefloating.End, append($6.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($6)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6999,9 +6934,8 @@ encaps_var: $$ = $2; // save comments - yylex.(*Parser).prependMetaToken($$, $1, meta.NodeStart) - $3.Meta.SetTokenName(meta.NodeEnd).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $3, meta.NodeEnd) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($$, freefloating.End, append($3.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($3)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7016,7 +6950,7 @@ encaps_var_offset: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7032,6 +6966,9 @@ encaps_var_offset: // save position $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + // save comments + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_VARIABLE @@ -7044,8 +6981,8 @@ encaps_var_offset: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMeta($$, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).addDollarToken($$) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7060,9 +6997,9 @@ internal_functions_in_yacc: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) - $4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Isset, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.VarList, $4.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7074,9 +7011,9 @@ internal_functions_in_yacc: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) - $4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Empty, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $4.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7088,9 +7025,9 @@ internal_functions_in_yacc: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) - $4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Empty, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $4.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7102,7 +7039,7 @@ internal_functions_in_yacc: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7114,7 +7051,7 @@ internal_functions_in_yacc: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7126,9 +7063,9 @@ internal_functions_in_yacc: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) - $4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Eval, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $4.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7140,7 +7077,7 @@ internal_functions_in_yacc: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7152,7 +7089,7 @@ internal_functions_in_yacc: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7170,7 +7107,7 @@ isset_variables: $$ = append($1, $3) // save comments - $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7202,10 +7139,9 @@ class_constant: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.NodeStart).AppendTo(target.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Name, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(target, freefloating.Start, $3.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7219,10 +7155,9 @@ class_constant: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.NodeStart).AppendTo(target.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Name, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(target, freefloating.Start, $3.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7239,10 +7174,9 @@ static_class_name_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.NodeStart).AppendTo(target.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Name, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(target, freefloating.Start, $3.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7259,10 +7193,9 @@ class_name_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.NodeStart).AppendTo(target.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Name, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(target, freefloating.Start, $3.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php5/php5_test.go b/php5/php5_test.go index b47bc17..dbf370f 100644 --- a/php5/php5_test.go +++ b/php5/php5_test.go @@ -2,37 +2,23 @@ package php5_test import ( "bytes" - "reflect" "testing" - "github.com/kylelemons/godebug/pretty" + "gotest.tools/assert" + "github.com/z7zmey/php-parser/errors" + "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node/expr" "github.com/z7zmey/php-parser/node/expr/assign" "github.com/z7zmey/php-parser/node/expr/binary" "github.com/z7zmey/php-parser/node/expr/cast" "github.com/z7zmey/php-parser/node/name" "github.com/z7zmey/php-parser/node/scalar" + "github.com/z7zmey/php-parser/node/stmt" "github.com/z7zmey/php-parser/php5" "github.com/z7zmey/php-parser/position" - - "github.com/z7zmey/php-parser/node" - "github.com/z7zmey/php-parser/node/stmt" ) -func assertEqual(t *testing.T, expected interface{}, actual interface{}) { - if !reflect.DeepEqual(expected, actual) { - diff := pretty.Compare(expected, actual) - - if diff != "" { - t.Errorf("diff: (-expected +actual)\n%s", diff) - } else { - t.Errorf("expected and actual are not equal\n") - } - - } -} - func TestPhp5(t *testing.T) { src := `") - - if i < 0 { - SemiColonTokenMeta.AppendTo(prevNode.GetMeta()) - } else { - if metaTokenValue[0] == ';' { - prevNode.GetMeta().Push(&meta.Data{ - Value: metaTokenValue[0:1], - Type: meta.TokenType, - Position: nil, - TokenName: meta.SemiColonToken, - }) - - htmlNode.GetMeta().Push(&meta.Data{ - Value: metaTokenValue[1:i], - Type: meta.WhiteSpaceType, - Position: nil, - TokenName: meta.NodeStart, - }) - - htmlNode.GetMeta().Push(&meta.Data{ - Value: metaTokenValue[i : i+2], - Type: meta.TokenType, - Position: nil, - TokenName: meta.NodeStart, - }) - - if len(metaTokenValue) > i+2 { - htmlNode.GetMeta().Push(&meta.Data{ - Value: metaTokenValue[i+2:], - Type: meta.WhiteSpaceType, - Position: nil, - TokenName: meta.NodeStart, - }) - } - } else { - htmlNode.GetMeta().Push(&meta.Data{ - Value: metaTokenValue[:2], - Type: meta.TokenType, - Position: nil, - TokenName: meta.NodeStart, - }) - - if len(metaTokenValue) > 2 { - htmlNode.GetMeta().Push(&meta.Data{ - Value: metaTokenValue[2:], - Type: meta.WhiteSpaceType, - Position: nil, - TokenName: meta.NodeStart, - }) - } - } + dstCollection := dst.GetFreeFloating() + if *dstCollection == nil { + *dstCollection = make(freefloating.Collection) } + + (*dstCollection)[p] = strings +} + +func (l *Parser) GetFreeFloatingToken(t *scanner.Token) []freefloating.String { + if l.Lexer.WithMeta == false { + return []freefloating.String{} + } + + return t.GetFreeFloatingToken() +} + +func (l *Parser) addDollarToken(v node.Node) { + if l.Lexer.WithMeta == false { + return + } + + l.setFreeFloating(v, freefloating.Dollar, []freefloating.String{ + { + StringType: freefloating.TokenType, + Value: "$", + Position: &position.Position{ + StartLine: v.GetPosition().StartLine, + EndLine: v.GetPosition().StartLine, + StartPos: v.GetPosition().StartPos, + EndPos: v.GetPosition().StartPos + 1, + }, + }, + }) +} + +func (l *Parser) splitSemiColonAndPhpCloseTag(htmlNode node.Node, prevNode node.Node) { + if l.Lexer.WithMeta == false { + return + } + + semiColon := (*prevNode.GetFreeFloating())[freefloating.SemiColon] + delete((*prevNode.GetFreeFloating()), freefloating.SemiColon) + if len(semiColon) == 0 { + return + } + + p := semiColon[0].Position + if semiColon[0].Value[0] == ';' { + l.setFreeFloating(prevNode, freefloating.SemiColon, []freefloating.String{ + { + StringType: freefloating.TokenType, + Value: ";", + Position: &position.Position{ + StartLine: p.StartLine, + EndLine: p.StartLine, + StartPos: p.StartPos, + EndPos: p.StartPos + 1, + }, + }, + }) + } + + vlen := len(semiColon[0].Value) + tlen := 2 + if strings.HasSuffix(semiColon[0].Value, "?>\n") { + tlen = 3 + } + + phpCloseTag := []freefloating.String{} + if vlen-tlen > 1 { + phpCloseTag = append(phpCloseTag, freefloating.String{ + StringType: freefloating.WhiteSpaceType, + Value: semiColon[0].Value[1 : vlen-tlen], + Position: &position.Position{ + StartLine: p.StartLine, + EndLine: p.EndLine, + StartPos: p.StartPos + 1, + EndPos: p.EndPos - tlen, + }, + }) + } + + phpCloseTag = append(phpCloseTag, freefloating.String{ + StringType: freefloating.WhiteSpaceType, + Value: semiColon[0].Value[vlen-tlen:], + Position: &position.Position{ + StartLine: p.EndLine, + EndLine: p.EndLine, + StartPos: p.EndPos - tlen, + EndPos: p.EndPos, + }, + }) + + l.setFreeFloating(htmlNode, freefloating.Start, append(phpCloseTag, (*htmlNode.GetFreeFloating())[freefloating.Start]...)) } func (p *Parser) returnTokenToPool(yyDollar []yySymType, yyVAL *yySymType) { diff --git a/php7/php7.go b/php7/php7.go index 8826f2a..b3c5ada 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -8,7 +8,7 @@ import ( "strconv" "strings" - "github.com/z7zmey/php-parser/meta" + "github.com/z7zmey/php-parser/freefloating" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node/expr" "github.com/z7zmey/php-parser/node/expr/assign" @@ -346,7 +346,7 @@ const yyEofCode = 1 const yyErrCode = 2 const yyInitialStackSize = 16 -//line php7/php7.y:5663 +//line php7/php7.y:5618 //line yacctab:1 var yyExca = [...]int{ @@ -2124,7 +2124,7 @@ yydefault: yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) if yylex.(*Parser).currentToken.Value == "\xff" { - yylex.(*Parser).currentToken.Meta.SetTokenName(meta.NodeEnd).AppendTo(yylex.(*Parser).rootNode.GetMeta()) + yylex.(*Parser).setFreeFloating(yylex.(*Parser).rootNode, freefloating.End, yylex.(*Parser).currentToken.FreeFloating) } } case 2: @@ -2589,7 +2589,7 @@ yydefault: { if inlineHtmlNode, ok := yyDollar[2].node.(*stmt.InlineHtml); ok && len(yyDollar[1].list) > 0 { prevNode := lastNode(yyDollar[1].list) - yylex.(*Parser).splitSemicolonTokenAndPhpCloseTag(inlineHtmlNode, prevNode) + yylex.(*Parser).splitSemiColonAndPhpCloseTag(inlineHtmlNode, prevNode) } if yyDollar[2].node != nil { @@ -2617,7 +2617,7 @@ yydefault: namePart.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(namePart.GetMeta()) + yylex.(*Parser).setFreeFloating(namePart, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2632,8 +2632,8 @@ yydefault: namePart.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(namePart.GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode(yyDollar[1].list), freefloating.End, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(namePart, freefloating.Start, yyDollar[3].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2647,7 +2647,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) // save comments - yyDollar[1].list[0].GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].list[0], yyVAL.node) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2661,8 +2661,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Namespace, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2676,7 +2676,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2739,11 +2739,11 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.HaltCompiller, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.OpenParenthesisToken, yyDollar[3].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.CloseParenthesisToken, yyDollar[4].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken(yyDollar[4].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -2761,15 +2761,16 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).MoveFreeFloating(yyDollar[2].list[0], name) + yylex.(*Parser).setFreeFloating(name, freefloating.End, yyDollar[3].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken(yyDollar[3].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 93: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:508 + //line php7/php7.y:509 { name := name.NewName(yyDollar[2].list) yyVAL.node = stmt.NewNamespace(name, yyDollar[4].list) @@ -2779,15 +2780,16 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[5].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[5].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).MoveFreeFloating(yyDollar[2].list[0], name) + yylex.(*Parser).setFreeFloating(name, freefloating.End, yyDollar[3].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Stmts, yyDollar[5].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 94: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:524 + //line php7/php7.y:526 { yyVAL.node = stmt.NewNamespace(nil, yyDollar[3].list) @@ -2795,15 +2797,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Namespace, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Stmts, yyDollar[4].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 95: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:538 + //line php7/php7.y:540 { yyVAL.node = yyDollar[2].node @@ -2811,15 +2813,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.UseDeclarationList, yyDollar[3].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken(yyDollar[3].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 96: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:552 + //line php7/php7.y:554 { yyVAL.node = yyDollar[3].node.(*stmt.GroupUse).SetUseType(yyDollar[2].node) @@ -2827,15 +2829,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.UseDeclarationList, yyDollar[4].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken(yyDollar[4].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 97: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:566 + //line php7/php7.y:568 { yyVAL.node = stmt.NewUseList(nil, yyDollar[2].list) @@ -2843,15 +2845,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.UseDeclarationList, yyDollar[3].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken(yyDollar[3].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 98: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:580 + //line php7/php7.y:582 { yyVAL.node = stmt.NewUseList(yyDollar[2].node, yyDollar[3].list) @@ -2859,15 +2861,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.UseDeclarationList, yyDollar[4].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken(yyDollar[4].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 99: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:594 + //line php7/php7.y:596 { yyVAL.node = stmt.NewConstList(yyDollar[2].list) @@ -2875,15 +2877,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Stmts, yyDollar[3].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken(yyDollar[3].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 100: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:611 + //line php7/php7.y:613 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -2891,13 +2893,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 101: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:623 + //line php7/php7.y:625 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -2905,13 +2907,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 102: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:638 + //line php7/php7.y:640 { name := name.NewName(yyDollar[1].list) yyVAL.node = stmt.NewGroupUse(nil, name, yyDollar[4].list) @@ -2921,21 +2923,20 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition(yyDollar[1].list, yyDollar[6].token)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].list[0], name) + yylex.(*Parser).setFreeFloating(name, freefloating.End, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Slash, yyDollar[3].token.FreeFloating) if yyDollar[5].token != nil { - yyDollar[5].token.Meta.SetTokenName(meta.CommaToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[5].token, meta.CommaToken) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Stmts, append(yyDollar[5].token.FreeFloating, append(yylex.(*Parser).GetFreeFloatingToken(yyDollar[5].token), yyDollar[6].token.FreeFloating...)...)) + } else { + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Stmts, yyDollar[6].token.FreeFloating) } - yyDollar[6].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].list[0].GetMeta().Cut(newInheritMetaFilter()).PrependTo(name.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 103: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:660 + //line php7/php7.y:661 { name := name.NewName(yyDollar[2].list) yyVAL.node = stmt.NewGroupUse(nil, name, yyDollar[5].list) @@ -2945,16 +2946,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[7].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) - yylex.(*Parser).appendMetaToken(name, yyDollar[1].token, meta.NodeStart) - yyDollar[2].list[0].GetMeta().Cut(newInheritMetaFilter()).AppendTo(name.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.UseType, yyDollar[1].token.FreeFloating) + yylex.(*Parser).MoveFreeFloating(yyDollar[2].list[0], name) + yylex.(*Parser).setFreeFloating(name, freefloating.End, yyDollar[3].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Slash, yyDollar[4].token.FreeFloating) if yyDollar[6].token != nil { - yyDollar[6].token.Meta.SetTokenName(meta.CommaToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[6].token, meta.CommaToken) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Stmts, append(yyDollar[6].token.FreeFloating, append(yylex.(*Parser).GetFreeFloatingToken(yyDollar[6].token), yyDollar[7].token.FreeFloating...)...)) + } else { + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Stmts, yyDollar[7].token.FreeFloating) } - yyDollar[7].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2970,21 +2970,20 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition(yyDollar[1].list, yyDollar[6].token)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].list[0], name) + yylex.(*Parser).setFreeFloating(name, freefloating.End, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Slash, yyDollar[3].token.FreeFloating) if yyDollar[5].token != nil { - yyDollar[5].token.Meta.SetTokenName(meta.CommaToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[5].token, meta.CommaToken) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Stmts, append(yyDollar[5].token.FreeFloating, append(yylex.(*Parser).GetFreeFloatingToken(yyDollar[5].token), yyDollar[6].token.FreeFloating...)...)) + } else { + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Stmts, yyDollar[6].token.FreeFloating) } - yyDollar[6].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].list[0].GetMeta().Cut(newInheritMetaFilter()).PrependTo(name.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 105: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:708 + //line php7/php7.y:707 { name := name.NewName(yyDollar[2].list) yyVAL.node = stmt.NewGroupUse(nil, name, yyDollar[5].list) @@ -2994,47 +2993,44 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[7].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) - yylex.(*Parser).appendMetaToken(name, yyDollar[1].token, meta.NodeStart) - yyDollar[2].list[0].GetMeta().Cut(newInheritMetaFilter()).AppendTo(name.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Use, append(yyDollar[1].token.FreeFloating, yylex.(*Parser).GetFreeFloatingToken(yyDollar[1].token)...)) + yylex.(*Parser).MoveFreeFloating(yyDollar[2].list[0], name) + yylex.(*Parser).setFreeFloating(name, freefloating.End, yyDollar[3].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Slash, yyDollar[4].token.FreeFloating) if yyDollar[6].token != nil { - yyDollar[6].token.Meta.SetTokenName(meta.CommaToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[6].token, meta.CommaToken) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Stmts, append(yyDollar[6].token.FreeFloating, append(yylex.(*Parser).GetFreeFloatingToken(yyDollar[6].token), yyDollar[7].token.FreeFloating...)...)) + } else { + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Stmts, yyDollar[7].token.FreeFloating) } - yyDollar[7].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[2].list[0].GetMeta().Cut(newInheritMetaFilter()).PrependTo(name.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 106: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:736 + //line php7/php7.y:732 { yyVAL.token = nil } case 107: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:740 + //line php7/php7.y:736 { yyVAL.token = yyDollar[1].token } case 108: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:747 + //line php7/php7.y:743 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode(yyDollar[1].list), freefloating.End, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 109: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:756 + //line php7/php7.y:752 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -3042,18 +3038,18 @@ yydefault: } case 110: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:765 + //line php7/php7.y:761 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode(yyDollar[1].list), freefloating.End, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 111: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:774 + //line php7/php7.y:770 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -3061,18 +3057,18 @@ yydefault: } case 112: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:783 + //line php7/php7.y:779 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode(yyDollar[1].list), freefloating.End, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 113: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:792 + //line php7/php7.y:788 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -3080,27 +3076,23 @@ yydefault: } case 114: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:801 + //line php7/php7.y:797 { yyVAL.node = yyDollar[1].node - yyDollar[1].node.(*stmt.Use).Use.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 115: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:809 + //line php7/php7.y:803 { yyVAL.node = yyDollar[2].node.(*stmt.Use).SetUseType(yyDollar[1].node) - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 116: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:820 + //line php7/php7.y:812 { name := name.NewName(yyDollar[1].list) yyVAL.node = stmt.NewUse(nil, name, nil) @@ -3109,13 +3101,14 @@ yydefault: name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) - yyDollar[1].list[0].GetMeta().Cut(newInheritMetaFilter()).PrependTo(name.GetMeta()) + // save comments + yylex.(*Parser).MoveFreeFloating(yyDollar[1].list[0], name) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 117: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:833 + //line php7/php7.y:826 { name := name.NewName(yyDollar[1].list) alias := node.NewIdentifier(yyDollar[3].token.Value) @@ -3127,50 +3120,52 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition(yyDollar[1].list, yyDollar[3].token)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.AsToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(alias.GetMeta()) - - yyDollar[1].list[0].GetMeta().Cut(newInheritMetaFilter()).PrependTo(name.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].list[0], name) + yylex.(*Parser).setFreeFloating(name, freefloating.End, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(alias, freefloating.Start, yyDollar[3].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 118: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:855 + //line php7/php7.y:847 { yyVAL.node = yyDollar[1].node - yyDollar[1].node.(*stmt.Use).Use.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + // save coments + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node.(*stmt.Use).Use, yyVAL.node) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 119: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:863 + //line php7/php7.y:856 { yyVAL.node = yyDollar[2].node // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) - yyDollar[2].node.(*stmt.Use).Use.GetMeta().Cut(newInheritMetaFilter()).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Slash, yylex.(*Parser).GetFreeFloatingToken(yyDollar[1].token)) + + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Slash, yylex.(*Parser).GetFreeFloatingToken(yyDollar[1].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 120: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:877 + //line php7/php7.y:872 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode(yyDollar[1].list), freefloating.End, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 121: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:886 + //line php7/php7.y:881 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -3178,11 +3173,11 @@ yydefault: } case 122: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:895 + //line php7/php7.y:890 { if inlineHtmlNode, ok := yyDollar[2].node.(*stmt.InlineHtml); ok && len(yyDollar[1].list) > 0 { prevNode := lastNode(yyDollar[1].list) - yylex.(*Parser).splitSemicolonTokenAndPhpCloseTag(inlineHtmlNode, prevNode) + yylex.(*Parser).splitSemiColonAndPhpCloseTag(inlineHtmlNode, prevNode) } if yyDollar[2].node != nil { @@ -3193,7 +3188,7 @@ yydefault: } case 123: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:908 + //line php7/php7.y:903 { yyVAL.list = []node.Node{} @@ -3201,7 +3196,7 @@ yydefault: } case 124: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:917 + //line php7/php7.y:912 { // error yyVAL.node = nil @@ -3210,7 +3205,7 @@ yydefault: } case 125: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:924 + //line php7/php7.y:919 { yyVAL.node = yyDollar[1].node @@ -3218,7 +3213,7 @@ yydefault: } case 126: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:930 + //line php7/php7.y:925 { yyVAL.node = yyDollar[1].node @@ -3226,7 +3221,7 @@ yydefault: } case 127: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:936 + //line php7/php7.y:931 { yyVAL.node = yyDollar[1].node @@ -3234,7 +3229,7 @@ yydefault: } case 128: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:942 + //line php7/php7.y:937 { yyVAL.node = yyDollar[1].node @@ -3242,7 +3237,7 @@ yydefault: } case 129: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:948 + //line php7/php7.y:943 { yyVAL.node = yyDollar[1].node @@ -3250,7 +3245,7 @@ yydefault: } case 130: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:954 + //line php7/php7.y:949 { yyVAL.node = stmt.NewHaltCompiler() @@ -3258,17 +3253,17 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.HaltCompiller, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.OpenParenthesisToken, yyDollar[3].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.CloseParenthesisToken, yyDollar[4].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken(yyDollar[4].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 131: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:972 + //line php7/php7.y:967 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) @@ -3276,14 +3271,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Stmts, yyDollar[3].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 132: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:985 + //line php7/php7.y:980 { yyVAL.node = yyDollar[1].node @@ -3291,7 +3286,7 @@ yydefault: } case 133: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:991 + //line php7/php7.y:986 { yyVAL.node = yyDollar[1].node @@ -3299,7 +3294,7 @@ yydefault: } case 134: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:997 + //line php7/php7.y:992 { switch n := yyDollar[5].node.(type) { case *stmt.While: @@ -3314,15 +3309,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[5].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.While, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[4].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 135: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:1018 + //line php7/php7.y:1013 { yyVAL.node = stmt.NewDo(yyDollar[2].node, yyDollar[5].node) @@ -3330,18 +3325,18 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[7].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.WhileToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[6].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[7].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[7].token, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Stmts, yyDollar[3].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.While, yyDollar[4].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[6].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Cond, yyDollar[7].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken(yyDollar[7].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 136: yyDollar = yyS[yypt-9 : yypt+1] - //line php7/php7.y:1035 + //line php7/php7.y:1030 { switch n := yyDollar[9].node.(type) { case *stmt.For: @@ -3360,17 +3355,17 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[9].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.ForInitSemicolonToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[6].token.Meta.SetTokenName(meta.ForCondSemicolonToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[8].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.For, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.InitExpr, yyDollar[4].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.CondExpr, yyDollar[6].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.IncExpr, yyDollar[8].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 137: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:1062 + //line php7/php7.y:1057 { switch n := yyDollar[5].node.(type) { case *stmt.Switch: @@ -3387,15 +3382,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[5].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Switch, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[4].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 138: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1085 + //line php7/php7.y:1080 { yyVAL.node = stmt.NewBreak(yyDollar[2].node) @@ -3403,15 +3398,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[3].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken(yyDollar[3].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 139: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1099 + //line php7/php7.y:1094 { yyVAL.node = stmt.NewContinue(yyDollar[2].node) @@ -3419,15 +3414,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[3].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken(yyDollar[3].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 140: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1113 + //line php7/php7.y:1108 { yyVAL.node = stmt.NewReturn(yyDollar[2].node) @@ -3435,15 +3430,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[3].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken(yyDollar[3].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 141: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1127 + //line php7/php7.y:1122 { yyVAL.node = stmt.NewGlobal(yyDollar[2].list) @@ -3451,15 +3446,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.VarList, yyDollar[3].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken(yyDollar[3].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 142: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1141 + //line php7/php7.y:1136 { yyVAL.node = stmt.NewStatic(yyDollar[2].list) @@ -3467,15 +3462,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.VarList, yyDollar[3].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken(yyDollar[3].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 143: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1155 + //line php7/php7.y:1150 { yyVAL.node = stmt.NewEcho(yyDollar[2].list) @@ -3483,16 +3478,16 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) - yyDollar[3].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Echo, yylex.(*Parser).GetFreeFloatingToken(yyDollar[1].token)) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[3].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken(yyDollar[3].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 144: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1170 + //line php7/php7.y:1165 { yyVAL.node = stmt.NewInlineHtml(yyDollar[1].token.Value) @@ -3500,13 +3495,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 145: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1182 + //line php7/php7.y:1177 { yyVAL.node = stmt.NewExpression(yyDollar[1].node) @@ -3514,16 +3509,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.SemiColonToken) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken(yyDollar[2].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 146: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1197 + //line php7/php7.y:1191 { yyVAL.node = stmt.NewUnset(yyDollar[3].list) @@ -3531,21 +3525,21 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[6].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Unset, yyDollar[2].token.FreeFloating) if yyDollar[4].token != nil { - yyDollar[4].token.Meta.SetTokenName(meta.CommaToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.CommaToken) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.VarList, append(yyDollar[4].token.FreeFloating, append(yylex.(*Parser).GetFreeFloatingToken(yyDollar[4].token), yyDollar[5].token.FreeFloating...)...)) + } else { + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.VarList, yyDollar[5].token.FreeFloating) } - yyDollar[5].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[6].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[6].token, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.CloseParenthesisToken, yyDollar[6].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken(yyDollar[6].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 147: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:1217 + //line php7/php7.y:1211 { switch n := yyDollar[7].node.(type) { case *stmt.Foreach: @@ -3562,16 +3556,16 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[7].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.AsToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[6].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Foreach, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[4].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Var, yyDollar[6].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 148: yyDollar = yyS[yypt-9 : yypt+1] - //line php7/php7.y:1241 + //line php7/php7.y:1236 { switch n := yyDollar[9].node.(type) { case *stmt.Foreach: @@ -3590,17 +3584,17 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[9].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.AsToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[6].token.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[8].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Foreach, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[4].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Key, yyDollar[6].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Var, yyDollar[8].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 149: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:1268 + //line php7/php7.y:1263 { yyVAL.node = yyDollar[5].node yyVAL.node.(*stmt.Declare).Consts = yyDollar[3].list @@ -3609,15 +3603,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[5].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Declare, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.ConstList, yyDollar[4].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 150: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1283 + //line php7/php7.y:1278 { yyVAL.node = stmt.NewNop() @@ -3625,14 +3619,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken(yyDollar[1].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 151: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1296 + //line php7/php7.y:1291 { if yyDollar[6].node == nil { yyVAL.node = stmt.NewTry(yyDollar[3].list, yyDollar[5].list, yyDollar[6].node) @@ -3643,15 +3637,15 @@ yydefault: } // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Try, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Stmts, yyDollar[4].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 152: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1313 + //line php7/php7.y:1308 { yyVAL.node = stmt.NewThrow(yyDollar[2].node) @@ -3659,15 +3653,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[3].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken(yyDollar[3].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 153: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1327 + //line php7/php7.y:1322 { label := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewGoto(label) @@ -3677,16 +3671,16 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(label.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(label, freefloating.Start, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Label, yyDollar[3].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken(yyDollar[3].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 154: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1344 + //line php7/php7.y:1339 { label := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewLabel(label) @@ -3696,14 +3690,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.ColonToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Label, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 155: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1361 + //line php7/php7.y:1356 { yyVAL.list = []node.Node{} @@ -3711,7 +3705,7 @@ yydefault: } case 156: yyDollar = yyS[yypt-9 : yypt+1] - //line php7/php7.y:1367 + //line php7/php7.y:1362 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[5].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -3724,19 +3718,19 @@ yydefault: catch.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[2].token, yyDollar[9].token)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(catch.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(catch.GetMeta()) - yyDollar[5].token.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) - yyDollar[6].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(catch.GetMeta()) - yyDollar[7].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(catch.GetMeta()) - yyDollar[9].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(catch.GetMeta()) + yylex.(*Parser).setFreeFloating(catch, freefloating.Start, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(catch, freefloating.Catch, yyDollar[3].token.FreeFloating) + yylex.(*Parser).setFreeFloating(variable, freefloating.Start, yyDollar[5].token.FreeFloating) + yylex.(*Parser).addDollarToken(variable) + yylex.(*Parser).setFreeFloating(catch, freefloating.Var, yyDollar[6].token.FreeFloating) + yylex.(*Parser).setFreeFloating(catch, freefloating.Cond, yyDollar[7].token.FreeFloating) + yylex.(*Parser).setFreeFloating(catch, freefloating.Stmts, yyDollar[9].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 157: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1392 + //line php7/php7.y:1387 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -3744,18 +3738,18 @@ yydefault: } case 158: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1398 + //line php7/php7.y:1393 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode(yyDollar[1].list), freefloating.End, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 159: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1410 + //line php7/php7.y:1405 { yyVAL.node = nil @@ -3763,7 +3757,7 @@ yydefault: } case 160: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1416 + //line php7/php7.y:1411 { yyVAL.node = stmt.NewFinally(yyDollar[3].list) @@ -3771,15 +3765,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Finally, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Stmts, yyDollar[4].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 161: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1433 + //line php7/php7.y:1428 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -3787,18 +3781,18 @@ yydefault: } case 162: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1439 + //line php7/php7.y:1434 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode(yyDollar[1].list), freefloating.End, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 163: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1451 + //line php7/php7.y:1446 { yyVAL.node = yyDollar[1].node @@ -3806,7 +3800,7 @@ yydefault: } case 164: yyDollar = yyS[yypt-11 : yypt+1] - //line php7/php7.y:1460 + //line php7/php7.y:1455 { name := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewFunction(name, yyDollar[2].token != nil, yyDollar[6].list, yyDollar[8].node, yyDollar[10].list, yyDollar[4].str) @@ -3816,45 +3810,57 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[11].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) if yyDollar[2].token != nil { - yyDollar[2].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Function, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(name, freefloating.Start, yyDollar[3].token.FreeFloating) + } else { + yylex.(*Parser).setFreeFloating(name, freefloating.Start, yyDollar[3].token.FreeFloating) + } + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Name, yyDollar[5].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.ParamList, yyDollar[7].token.FreeFloating) + if yyDollar[8].node != nil { + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Params, (*yyDollar[8].node.GetFreeFloating())[freefloating.Colon]) + delete((*yyDollar[8].node.GetFreeFloating()), freefloating.Colon) + } + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.ReturnType, yyDollar[9].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Stmts, yyDollar[11].token.FreeFloating) + + // normalize + if yyDollar[8].node == nil { + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Params, (*yyVAL.node.GetFreeFloating())[freefloating.ReturnType]) + delete((*yyVAL.node.GetFreeFloating()), freefloating.ReturnType) } - yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) - yyDollar[5].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[7].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[9].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[11].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 165: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1486 + //line php7/php7.y:1491 { yyVAL.token = nil } case 166: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1490 + //line php7/php7.y:1495 { yyVAL.token = yyDollar[1].token } case 167: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1497 + //line php7/php7.y:1502 { yyVAL.token = nil } case 168: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1501 + //line php7/php7.y:1506 { yyVAL.token = yyDollar[1].token } case 169: yyDollar = yyS[yypt-9 : yypt+1] - //line php7/php7.y:1508 + //line php7/php7.y:1513 { name := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewClass(name, yyDollar[1].list, nil, yyDollar[4].ClassExtends, yyDollar[5].ClassImplements, yyDollar[8].list, yyDollar[6].str) @@ -3864,18 +3870,17 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewOptionalListTokensPosition(yyDollar[1].list, yyDollar[2].token, yyDollar[9].token)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.ClassToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) - yyDollar[7].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[9].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].list[0].GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].list[0], yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.ModifierList, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(name, freefloating.Start, yyDollar[3].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Name, yyDollar[7].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Stmts, yyDollar[9].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 170: yyDollar = yyS[yypt-8 : yypt+1] - //line php7/php7.y:1527 + //line php7/php7.y:1531 { name := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewClass(name, nil, nil, yyDollar[3].ClassExtends, yyDollar[4].ClassImplements, yyDollar[7].list, yyDollar[5].str) @@ -3885,16 +3890,16 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[8].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) - yyDollar[6].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[8].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(name, freefloating.Start, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Name, yyDollar[6].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Stmts, yyDollar[8].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 171: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1547 + //line php7/php7.y:1551 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -3902,7 +3907,7 @@ yydefault: } case 172: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1553 + //line php7/php7.y:1557 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -3910,7 +3915,7 @@ yydefault: } case 173: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1562 + //line php7/php7.y:1566 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -3918,13 +3923,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 174: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1574 + //line php7/php7.y:1578 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -3932,13 +3937,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 175: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1589 + //line php7/php7.y:1593 { name := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewTrait(name, yyDollar[5].list, yyDollar[3].str) @@ -3948,16 +3953,16 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[6].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[6].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(name, freefloating.Start, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Name, yyDollar[4].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Stmts, yyDollar[6].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 176: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:1609 + //line php7/php7.y:1613 { name := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewInterface(name, yyDollar[3].InterfaceExtends, yyDollar[6].list, yyDollar[4].str) @@ -3967,16 +3972,16 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[7].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) - yyDollar[5].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[7].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(name, freefloating.Start, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Name, yyDollar[5].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Stmts, yyDollar[7].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 177: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1629 + //line php7/php7.y:1633 { yyVAL.ClassExtends = nil @@ -3984,7 +3989,7 @@ yydefault: } case 178: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1635 + //line php7/php7.y:1639 { yyVAL.ClassExtends = stmt.NewClassExtends(yyDollar[2].node) @@ -3992,13 +3997,13 @@ yydefault: yyVAL.ClassExtends.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.ExtendsToken).AppendTo(yyVAL.ClassExtends.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.ClassExtends, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 179: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1650 + //line php7/php7.y:1654 { yyVAL.InterfaceExtends = nil @@ -4006,7 +4011,7 @@ yydefault: } case 180: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1656 + //line php7/php7.y:1660 { yyVAL.InterfaceExtends = stmt.NewInterfaceExtends(yyDollar[2].list) @@ -4014,13 +4019,13 @@ yydefault: yyVAL.InterfaceExtends.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.ExtendsToken).AppendTo(yyVAL.InterfaceExtends.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.InterfaceExtends, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 181: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1671 + //line php7/php7.y:1675 { yyVAL.ClassImplements = nil @@ -4028,7 +4033,7 @@ yydefault: } case 182: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1677 + //line php7/php7.y:1681 { yyVAL.ClassImplements = stmt.NewClassImplements(yyDollar[2].list) @@ -4036,13 +4041,13 @@ yydefault: yyVAL.ClassImplements.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.ImplementsToken).AppendTo(yyVAL.ClassImplements.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.ClassImplements, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 183: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1692 + //line php7/php7.y:1696 { yyVAL.node = yyDollar[1].node @@ -4050,7 +4055,7 @@ yydefault: } case 184: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1698 + //line php7/php7.y:1702 { yyVAL.node = expr.NewReference(yyDollar[2].node) @@ -4058,13 +4063,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 185: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1710 + //line php7/php7.y:1714 { yyVAL.node = expr.NewList(yyDollar[3].list) @@ -4072,30 +4077,30 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.List, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.ArrayPairList, yyDollar[4].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 186: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1724 + //line php7/php7.y:1728 { yyVAL.node = expr.NewShortList(yyDollar[2].list) // save position yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) - // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(yyVAL.node.GetMeta()) + // save commentsc + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.ArrayPairList, yyDollar[3].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 187: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1740 + //line php7/php7.y:1744 { yyVAL.node = stmt.NewFor(nil, nil, nil, yyDollar[1].node) @@ -4106,7 +4111,7 @@ yydefault: } case 188: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1749 + //line php7/php7.y:1753 { stmtList := stmt.NewStmtList(yyDollar[2].list) yyVAL.node = stmt.NewAltFor(nil, nil, nil, stmtList) @@ -4116,16 +4121,16 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.ColonToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.EndforToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Cond, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Stmts, yyDollar[3].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.AltEnd, yyDollar[4].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken(yyDollar[4].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 189: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1769 + //line php7/php7.y:1773 { yyVAL.node = stmt.NewForeach(nil, nil, nil, yyDollar[1].node) @@ -4136,7 +4141,7 @@ yydefault: } case 190: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1778 + //line php7/php7.y:1782 { stmtList := stmt.NewStmtList(yyDollar[2].list) yyVAL.node = stmt.NewAltForeach(nil, nil, nil, stmtList) @@ -4146,16 +4151,16 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.ColonToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.EndforeachToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Cond, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Stmts, yyDollar[3].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.AltEnd, yyDollar[4].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken(yyDollar[4].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 191: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1798 + //line php7/php7.y:1802 { yyVAL.node = stmt.NewDeclare(nil, yyDollar[1].node, false) @@ -4166,7 +4171,7 @@ yydefault: } case 192: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1807 + //line php7/php7.y:1811 { stmtList := stmt.NewStmtList(yyDollar[2].list) yyVAL.node = stmt.NewDeclare(nil, stmtList, true) @@ -4176,16 +4181,16 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.ColonToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.EnddeclareToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Cond, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Stmts, yyDollar[3].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.AltEnd, yyDollar[4].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken(yyDollar[4].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 193: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1827 + //line php7/php7.y:1831 { caseList := stmt.NewCaseList(yyDollar[2].list) yyVAL.node = stmt.NewSwitch(nil, caseList) @@ -4195,14 +4200,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(caseList.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(caseList.GetMeta()) + yylex.(*Parser).setFreeFloating(caseList, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(caseList, freefloating.CaseListEnd, yyDollar[3].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 194: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1842 + //line php7/php7.y:1846 { caseList := stmt.NewCaseList(yyDollar[3].list) yyVAL.node = stmt.NewSwitch(nil, caseList) @@ -4212,16 +4217,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(caseList.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.CaseSeparatorToken).AppendTo(caseList.GetMeta()) - yylex.(*Parser).appendMetaToken(caseList, yyDollar[2].token, meta.CaseSeparatorToken) - yyDollar[4].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(caseList.GetMeta()) + yylex.(*Parser).setFreeFloating(caseList, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(caseList, freefloating.CaseListStart, append(yyDollar[2].token.FreeFloating, yylex.(*Parser).GetFreeFloatingToken(yyDollar[2].token)...)) + yylex.(*Parser).setFreeFloating(caseList, freefloating.CaseListEnd, yyDollar[4].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 195: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1859 + //line php7/php7.y:1862 { caseList := stmt.NewCaseList(yyDollar[2].list) yyVAL.node = stmt.NewAltSwitch(nil, caseList) @@ -4231,16 +4235,16 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.ColonToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.EndswitchToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Cond, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(caseList, freefloating.CaseListEnd, yyDollar[3].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.AltEnd, yyDollar[4].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken(yyDollar[4].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 196: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:1876 + //line php7/php7.y:1879 { caseList := stmt.NewCaseList(yyDollar[3].list) @@ -4251,18 +4255,17 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[5].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.ColonToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.CaseSeparatorToken).AppendTo(caseList.GetMeta()) - yylex.(*Parser).appendMetaToken(caseList, yyDollar[2].token, meta.CaseSeparatorToken) - yyDollar[4].token.Meta.SetTokenName(meta.EndswitchToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[5].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[5].token, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Cond, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(caseList, freefloating.CaseListStart, append(yyDollar[2].token.FreeFloating, yylex.(*Parser).GetFreeFloatingToken(yyDollar[2].token)...)) + yylex.(*Parser).setFreeFloating(caseList, freefloating.CaseListEnd, yyDollar[4].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.AltEnd, yyDollar[5].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken(yyDollar[5].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 197: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1899 + //line php7/php7.y:1901 { yyVAL.list = []node.Node{} @@ -4270,7 +4273,7 @@ yydefault: } case 198: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:1905 + //line php7/php7.y:1907 { _case := stmt.NewCase(yyDollar[3].node, yyDollar[5].list) yyVAL.list = append(yyDollar[1].list, _case) @@ -4279,15 +4282,15 @@ yydefault: _case.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[5].list)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(_case.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.CaseSeparatorToken).AppendTo(_case.GetMeta()) - yylex.(*Parser).appendMetaToken(_case, yyDollar[4].token, meta.CaseSeparatorToken) + yylex.(*Parser).setFreeFloating(_case, freefloating.Start, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(_case, freefloating.Expr, append(yyDollar[4].token.FreeFloating)) + yylex.(*Parser).setFreeFloating(_case, freefloating.CaseSeparator, yylex.(*Parser).GetFreeFloatingToken(yyDollar[4].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 199: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1920 + //line php7/php7.y:1922 { _default := stmt.NewDefault(yyDollar[4].list) yyVAL.list = append(yyDollar[1].list, _default) @@ -4296,27 +4299,27 @@ yydefault: _default.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[4].list)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(_default.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.CaseSeparatorToken).AppendTo(_default.GetMeta()) - yylex.(*Parser).appendMetaToken(_default, yyDollar[3].token, meta.CaseSeparatorToken) + yylex.(*Parser).setFreeFloating(_default, freefloating.Start, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(_default, freefloating.Default, yyDollar[3].token.FreeFloating) + yylex.(*Parser).setFreeFloating(_default, freefloating.CaseSeparator, yylex.(*Parser).GetFreeFloatingToken(yyDollar[3].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 200: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1938 + //line php7/php7.y:1940 { yyVAL.token = yyDollar[1].token } case 201: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1942 + //line php7/php7.y:1944 { yyVAL.token = yyDollar[1].token } case 202: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1949 + //line php7/php7.y:1951 { yyVAL.node = stmt.NewWhile(nil, yyDollar[1].node) @@ -4327,7 +4330,7 @@ yydefault: } case 203: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1958 + //line php7/php7.y:1960 { stmtList := stmt.NewStmtList(yyDollar[2].list) yyVAL.node = stmt.NewAltWhile(nil, stmtList) @@ -4337,16 +4340,16 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.ColonToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.EndwhileToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Cond, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Stmts, yyDollar[3].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.AltEnd, yyDollar[4].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken(yyDollar[4].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 204: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:1978 + //line php7/php7.y:1980 { yyVAL.node = stmt.NewIf(yyDollar[3].node, yyDollar[5].node, nil, nil) @@ -4354,15 +4357,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[5].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.If, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[4].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 205: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1992 + //line php7/php7.y:1994 { _elseIf := stmt.NewElseIf(yyDollar[4].node, yyDollar[6].node) yyVAL.node = yyDollar[1].node.(*stmt.If).AddElseIf(_elseIf) @@ -4372,15 +4375,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[6].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(_elseIf.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(_elseIf.GetMeta()) - yyDollar[5].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(_elseIf.GetMeta()) + yylex.(*Parser).setFreeFloating(_elseIf, freefloating.Start, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(_elseIf, freefloating.ElseIf, yyDollar[3].token.FreeFloating) + yylex.(*Parser).setFreeFloating(_elseIf, freefloating.Expr, yyDollar[5].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 206: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2011 + //line php7/php7.y:2013 { yyVAL.node = yyDollar[1].node @@ -4388,7 +4391,7 @@ yydefault: } case 207: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2017 + //line php7/php7.y:2019 { _else := stmt.NewElse(yyDollar[3].node) yyVAL.node = yyDollar[1].node.(*stmt.If).SetElse(_else) @@ -4398,13 +4401,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(_else.GetMeta()) + yylex.(*Parser).setFreeFloating(_else, freefloating.Start, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 208: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:2034 + //line php7/php7.y:2036 { stmts := stmt.NewStmtList(yyDollar[6].list) yyVAL.node = stmt.NewAltIf(yyDollar[3].node, stmts, nil, nil) @@ -4414,16 +4417,16 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[6].list)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[5].token.Meta.SetTokenName(meta.ColonToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.If, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[4].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Cond, yyDollar[5].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 209: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:2051 + //line php7/php7.y:2053 { stmts := stmt.NewStmtList(yyDollar[7].list) _elseIf := stmt.NewAltElseIf(yyDollar[4].node, stmts) @@ -4434,16 +4437,16 @@ yydefault: _elseIf.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[7].list)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(_elseIf.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(_elseIf.GetMeta()) - yyDollar[5].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(_elseIf.GetMeta()) - yyDollar[6].token.Meta.SetTokenName(meta.ColonToken).AppendTo(_elseIf.GetMeta()) + yylex.(*Parser).setFreeFloating(_elseIf, freefloating.Start, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(_elseIf, freefloating.ElseIf, yyDollar[3].token.FreeFloating) + yylex.(*Parser).setFreeFloating(_elseIf, freefloating.Expr, yyDollar[5].token.FreeFloating) + yylex.(*Parser).setFreeFloating(_elseIf, freefloating.Cond, yyDollar[6].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 210: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2072 + //line php7/php7.y:2074 { yyVAL.node = yyDollar[1].node @@ -4451,15 +4454,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.EndifToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Stmts, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.AltEnd, yyDollar[3].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken(yyDollar[3].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 211: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:2086 + //line php7/php7.y:2088 { stmts := stmt.NewStmtList(yyDollar[4].list) _else := stmt.NewAltElse(stmts) @@ -4471,17 +4474,17 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[6].token)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(_else.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.ColonToken).AppendTo(_else.GetMeta()) - yyDollar[5].token.Meta.SetTokenName(meta.EndifToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[6].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[6].token, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating(_else, freefloating.Start, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(_else, freefloating.Else, yyDollar[3].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Stmts, yyDollar[5].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.AltEnd, yyDollar[6].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken(yyDollar[6].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 212: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2109 + //line php7/php7.y:2111 { yyVAL.list = yyDollar[1].list @@ -4489,7 +4492,7 @@ yydefault: } case 213: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:2115 + //line php7/php7.y:2117 { yyVAL.list = nil @@ -4497,7 +4500,7 @@ yydefault: } case 214: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2124 + //line php7/php7.y:2126 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4505,18 +4508,18 @@ yydefault: } case 215: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2130 + //line php7/php7.y:2132 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode(yyDollar[1].list), freefloating.End, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 216: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2142 + //line php7/php7.y:2144 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[4].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -4537,26 +4540,36 @@ yydefault: // save comments if yyDollar[1].node != nil { - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) } if yyDollar[2].token != nil { - yyDollar[2].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.OptionalType, yyDollar[2].token.FreeFloating) } if yyDollar[3].token != nil { - yyDollar[3].token.Meta.SetTokenName(meta.EllipsisToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Ampersand, yyDollar[3].token.FreeFloating) } - if yyDollar[1].node == nil && yyDollar[2].token == nil && yyDollar[3].token == nil { - yyDollar[4].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - } else { - yyDollar[4].token.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Variadic, yyDollar[4].token.FreeFloating) + yylex.(*Parser).addDollarToken(variable) + + // normalize + if yyDollar[3].token == nil { + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Ampersand, (*yyVAL.node.GetFreeFloating())[freefloating.Variadic]) + delete((*yyVAL.node.GetFreeFloating()), freefloating.Variadic) + } + if yyDollar[2].token == nil { + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.OptionalType, (*yyVAL.node.GetFreeFloating())[freefloating.Ampersand]) + delete((*yyVAL.node.GetFreeFloating()), freefloating.Ampersand) + } + if yyDollar[1].node == nil { + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, (*yyVAL.node.GetFreeFloating())[freefloating.OptionalType]) + delete((*yyVAL.node.GetFreeFloating()), freefloating.OptionalType) } - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 217: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:2180 + //line php7/php7.y:2189 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[4].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -4577,27 +4590,37 @@ yydefault: // save comments if yyDollar[1].node != nil { - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) } if yyDollar[2].token != nil { - yyDollar[2].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.OptionalType, yyDollar[2].token.FreeFloating) } if yyDollar[3].token != nil { - yyDollar[3].token.Meta.SetTokenName(meta.EllipsisToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Ampersand, yyDollar[3].token.FreeFloating) } - if yyDollar[1].node == nil && yyDollar[2].token == nil && yyDollar[3].token == nil { - yyDollar[4].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - } else { - yyDollar[4].token.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Variadic, yyDollar[4].token.FreeFloating) + yylex.(*Parser).addDollarToken(variable) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Var, yyDollar[5].token.FreeFloating) + + // normalize + if yyDollar[3].token == nil { + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Ampersand, (*yyVAL.node.GetFreeFloating())[freefloating.Variadic]) + delete((*yyVAL.node.GetFreeFloating()), freefloating.Variadic) + } + if yyDollar[2].token == nil { + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.OptionalType, (*yyVAL.node.GetFreeFloating())[freefloating.Ampersand]) + delete((*yyVAL.node.GetFreeFloating()), freefloating.Ampersand) + } + if yyDollar[1].node == nil { + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, (*yyVAL.node.GetFreeFloating())[freefloating.OptionalType]) + delete((*yyVAL.node.GetFreeFloating()), freefloating.OptionalType) } - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) - yyDollar[5].token.Meta.SetTokenName(meta.EqualToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 218: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:2222 + //line php7/php7.y:2238 { yyVAL.node = nil @@ -4605,7 +4628,7 @@ yydefault: } case 219: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2228 + //line php7/php7.y:2244 { yyVAL.node = yyDollar[1].node @@ -4613,7 +4636,7 @@ yydefault: } case 220: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2237 + //line php7/php7.y:2253 { yyVAL.node = yyDollar[1].node @@ -4621,7 +4644,7 @@ yydefault: } case 221: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2243 + //line php7/php7.y:2259 { yyVAL.node = node.NewNullable(yyDollar[2].node) @@ -4629,13 +4652,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 222: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2258 + //line php7/php7.y:2274 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4643,13 +4666,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 223: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2270 + //line php7/php7.y:2286 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4657,13 +4680,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 224: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2282 + //line php7/php7.y:2298 { yyVAL.node = yyDollar[1].node @@ -4671,7 +4694,7 @@ yydefault: } case 225: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:2291 + //line php7/php7.y:2307 { yyVAL.node = nil @@ -4679,18 +4702,18 @@ yydefault: } case 226: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2297 + //line php7/php7.y:2313 { yyVAL.node = yyDollar[2].node // save comments - yyDollar[1].token.Meta.SetTokenName(meta.ColonToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Colon, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 227: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2309 + //line php7/php7.y:2325 { yyVAL.node = node.NewArgumentList(nil) @@ -4698,14 +4721,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.ArgumentList, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 228: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2322 + //line php7/php7.y:2338 { yyVAL.node = node.NewArgumentList(yyDollar[2].list) @@ -4713,18 +4736,18 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) if yyDollar[3].token != nil { - yyDollar[3].token.Meta.SetTokenName(meta.CommaToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.CommaToken) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.ArgumentList, append(yyDollar[3].token.FreeFloating, append(yylex.(*Parser).GetFreeFloatingToken(yyDollar[3].token), yyDollar[4].token.FreeFloating...)...)) + } else { + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.ArgumentList, yyDollar[4].token.FreeFloating) } - yyDollar[4].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 229: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2342 + //line php7/php7.y:2358 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4732,18 +4755,18 @@ yydefault: } case 230: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2348 + //line php7/php7.y:2364 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode(yyDollar[1].list), freefloating.End, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 231: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2360 + //line php7/php7.y:2376 { yyVAL.node = node.NewArgument(yyDollar[1].node, false, false) @@ -4751,13 +4774,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) // save comments - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 232: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2372 + //line php7/php7.y:2388 { yyVAL.node = node.NewArgument(yyDollar[2].node, true, false) @@ -4765,24 +4788,24 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 233: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2387 + //line php7/php7.y:2403 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode(yyDollar[1].list), freefloating.End, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 234: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2396 + //line php7/php7.y:2412 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4790,7 +4813,7 @@ yydefault: } case 235: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2405 + //line php7/php7.y:2421 { yyVAL.node = yyDollar[1].node @@ -4798,18 +4821,18 @@ yydefault: } case 236: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2414 + //line php7/php7.y:2430 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode(yyDollar[1].list), freefloating.End, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 237: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2423 + //line php7/php7.y:2439 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4817,7 +4840,7 @@ yydefault: } case 238: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2432 + //line php7/php7.y:2448 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -4829,14 +4852,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).addDollarToken(variable) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 239: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2449 + //line php7/php7.y:2465 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -4848,15 +4871,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) - yyDollar[2].token.Meta.SetTokenName(meta.EqualToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).addDollarToken(variable) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Var, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 240: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2470 + //line php7/php7.y:2486 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -4864,7 +4887,7 @@ yydefault: } case 241: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:2476 + //line php7/php7.y:2492 { yyVAL.list = []node.Node{} @@ -4872,7 +4895,7 @@ yydefault: } case 242: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2485 + //line php7/php7.y:2501 { yyVAL.node = stmt.NewPropertyList(yyDollar[1].list, yyDollar[2].list) @@ -4880,16 +4903,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition(yyDollar[1].list, yyDollar[3].token)) // save comments - yyDollar[3].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.SemiColonToken) - - yyDollar[1].list[0].GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].list[0], yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.PropertyList, yyDollar[3].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken(yyDollar[3].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 243: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2500 + //line php7/php7.y:2515 { yyVAL.node = stmt.NewClassConstList(yyDollar[1].list, yyDollar[3].list) @@ -4897,15 +4919,20 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewOptionalListTokensPosition(yyDollar[1].list, yyDollar[2].token, yyDollar[4].token)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.ConstToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.SemiColonToken) + if len(yyDollar[1].list) > 0 { + yylex.(*Parser).MoveFreeFloating(yyDollar[1].list[0], yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.ModifierList, yyDollar[2].token.FreeFloating) + } else { + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[2].token.FreeFloating) + } + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.ConstList, yyDollar[4].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken(yyDollar[4].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 244: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2516 + //line php7/php7.y:2534 { yyVAL.node = stmt.NewTraitUse(yyDollar[2].list, yyDollar[3].node) @@ -4913,13 +4940,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 245: yyDollar = yyS[yypt-10 : yypt+1] - //line php7/php7.y:2528 + //line php7/php7.y:2546 { name := node.NewIdentifier(yyDollar[4].token.Value) yyVAL.node = stmt.NewClassMethod(name, yyDollar[1].list, yyDollar[3].token != nil, yyDollar[7].list, yyDollar[9].node, yyDollar[10].node, yyDollar[5].str) @@ -4933,23 +4960,30 @@ yydefault: } // save comments - yyDollar[2].token.Meta.SetTokenName(meta.FunctionToken).AppendTo(yyVAL.node.GetMeta()) - if yyDollar[3].token != nil { - yyDollar[3].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(yyVAL.node.GetMeta()) - } - yyDollar[4].token.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) - yyDollar[6].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[8].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) - if len(yyDollar[1].list) > 0 { - yyDollar[1].list[0].GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].list[0], yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.ModifierList, yyDollar[2].token.FreeFloating) + } else { + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[2].token.FreeFloating) + } + if yyDollar[3].token == nil { + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Function, yyDollar[4].token.FreeFloating) + } else { + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Function, yyDollar[3].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Ampersand, yyDollar[4].token.FreeFloating) + } + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Name, yyDollar[6].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.ParameterList, yyDollar[8].token.FreeFloating) + if yyDollar[9].node != nil { + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Params, (*yyDollar[9].node.GetFreeFloating())[freefloating.Colon]) + delete((*yyDollar[9].node.GetFreeFloating()), freefloating.Colon) } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 246: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2559 + //line php7/php7.y:2583 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -4957,60 +4991,60 @@ yydefault: } case 247: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2565 + //line php7/php7.y:2589 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode(yyDollar[1].list), freefloating.End, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 248: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2577 + //line php7/php7.y:2601 { yyVAL.node = stmt.NewNop() yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken(yyDollar[1].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 249: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2590 + //line php7/php7.y:2614 { yyVAL.node = stmt.NewTraitAdaptationList(nil) yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.AdaptationList, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 250: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2602 + //line php7/php7.y:2626 { yyVAL.node = stmt.NewTraitAdaptationList(yyDollar[2].list) yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.AdaptationList, yyDollar[3].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 251: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2617 + //line php7/php7.y:2641 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -5018,7 +5052,7 @@ yydefault: } case 252: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2623 + //line php7/php7.y:2647 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -5026,31 +5060,31 @@ yydefault: } case 253: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2632 + //line php7/php7.y:2656 { yyVAL.node = yyDollar[1].node // save comments - yyDollar[2].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.NameList, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken(yyDollar[2].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 254: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2642 + //line php7/php7.y:2666 { yyVAL.node = yyDollar[1].node // save comments - yyDollar[2].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Alias, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken(yyDollar[2].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 255: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2655 + //line php7/php7.y:2679 { yyVAL.node = stmt.NewTraitUsePrecedence(yyDollar[1].node, yyDollar[3].list) @@ -5058,15 +5092,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeNodeListPosition(yyDollar[1].node, yyDollar[3].list)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.InsteadofToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Ref, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 256: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2672 + //line php7/php7.y:2695 { alias := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, nil, alias) @@ -5076,16 +5109,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.AsToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(alias.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Ref, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(alias, freefloating.Start, yyDollar[3].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 257: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2689 + //line php7/php7.y:2711 { alias := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, nil, alias) @@ -5095,16 +5127,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.AsToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(alias.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Ref, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(alias, freefloating.Start, yyDollar[3].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 258: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2706 + //line php7/php7.y:2727 { alias := node.NewIdentifier(yyDollar[4].token.Value) yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, yyDollar[3].node, alias) @@ -5114,16 +5145,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.AsToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.NodeStart).AppendTo(alias.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Ref, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(alias, freefloating.Start, yyDollar[4].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 259: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2723 + //line php7/php7.y:2743 { yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, yyDollar[3].node, nil) @@ -5131,15 +5161,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.AsToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Ref, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 260: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2740 + //line php7/php7.y:2759 { name := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewTraitMethodRef(nil, name) @@ -5149,13 +5178,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 261: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2754 + //line php7/php7.y:2773 { yyVAL.node = yyDollar[1].node @@ -5163,7 +5192,7 @@ yydefault: } case 262: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2763 + //line php7/php7.y:2782 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewTraitMethodRef(yyDollar[1].node, target) @@ -5173,16 +5202,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(target.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Name, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(target, freefloating.Start, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 263: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2783 + //line php7/php7.y:2801 { yyVAL.node = stmt.NewNop() @@ -5190,14 +5218,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken(yyDollar[1].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 264: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2796 + //line php7/php7.y:2814 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) @@ -5205,14 +5233,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Stmts, yyDollar[3].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 265: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2812 + //line php7/php7.y:2830 { yyVAL.list = yyDollar[1].list @@ -5220,7 +5248,7 @@ yydefault: } case 266: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2818 + //line php7/php7.y:2836 { modifier := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.list = []node.Node{modifier} @@ -5229,13 +5257,13 @@ yydefault: modifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(modifier.GetMeta()) + yylex.(*Parser).setFreeFloating(modifier, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 267: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:2834 + //line php7/php7.y:2852 { yyVAL.list = nil @@ -5243,7 +5271,7 @@ yydefault: } case 268: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2840 + //line php7/php7.y:2858 { yyVAL.list = yyDollar[1].list @@ -5251,7 +5279,7 @@ yydefault: } case 269: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2849 + //line php7/php7.y:2867 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -5259,7 +5287,7 @@ yydefault: } case 270: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2855 + //line php7/php7.y:2873 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -5267,7 +5295,7 @@ yydefault: } case 271: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2864 + //line php7/php7.y:2882 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5275,13 +5303,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 272: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2876 + //line php7/php7.y:2894 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5289,13 +5317,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 273: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2888 + //line php7/php7.y:2906 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5303,13 +5331,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 274: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2900 + //line php7/php7.y:2918 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5317,13 +5345,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 275: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2912 + //line php7/php7.y:2930 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5331,13 +5359,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 276: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2924 + //line php7/php7.y:2942 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5345,24 +5373,24 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 277: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2939 + //line php7/php7.y:2957 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode(yyDollar[1].list), freefloating.End, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 278: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2948 + //line php7/php7.y:2966 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -5370,7 +5398,7 @@ yydefault: } case 279: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2957 + //line php7/php7.y:2975 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -5382,14 +5410,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).addDollarToken(variable) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 280: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2974 + //line php7/php7.y:2992 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -5401,49 +5429,32 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) - yyDollar[2].token.Meta.SetTokenName(meta.EqualToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).addDollarToken(variable) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Var, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 281: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2995 + //line php7/php7.y:3013 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode(yyDollar[1].list), freefloating.End, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 282: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3004 + //line php7/php7.y:3022 { yyVAL.list = []node.Node{yyDollar[1].node} yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 283: - yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3013 - { - name := node.NewIdentifier(yyDollar[1].token.Value) - yyVAL.node = stmt.NewConstant(name, yyDollar[3].node, yyDollar[4].str) - - // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) - - // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.EqualToken).AppendTo(yyVAL.node.GetMeta()) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - case 284: yyDollar = yyS[yypt-4 : yypt+1] //line php7/php7.y:3031 { @@ -5455,25 +5466,42 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.EqualToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Name, yyDollar[2].token.FreeFloating) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + case 284: + yyDollar = yyS[yypt-4 : yypt+1] + //line php7/php7.y:3049 + { + name := node.NewIdentifier(yyDollar[1].token.Value) + yyVAL.node = stmt.NewConstant(name, yyDollar[3].node, yyDollar[4].str) + + // save position + name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) + + // save comments + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Name, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 285: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3049 + //line php7/php7.y:3067 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode(yyDollar[1].list), freefloating.End, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 286: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3058 + //line php7/php7.y:3076 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -5481,7 +5509,7 @@ yydefault: } case 287: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3067 + //line php7/php7.y:3085 { yyVAL.node = yyDollar[1].node @@ -5489,7 +5517,7 @@ yydefault: } case 288: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3076 + //line php7/php7.y:3094 { yyVAL.list = nil @@ -5497,7 +5525,7 @@ yydefault: } case 289: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3082 + //line php7/php7.y:3100 { yyVAL.list = yyDollar[1].list @@ -5505,18 +5533,18 @@ yydefault: } case 290: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3091 + //line php7/php7.y:3109 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode(yyDollar[1].list), freefloating.End, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 291: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3100 + //line php7/php7.y:3118 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -5524,7 +5552,7 @@ yydefault: } case 292: yyDollar = yyS[yypt-8 : yypt+1] - //line php7/php7.y:3109 + //line php7/php7.y:3127 { if yyDollar[2].node != nil { yyVAL.node = stmt.NewClass(nil, nil, yyDollar[2].node.(*node.ArgumentList), yyDollar[3].ClassExtends, yyDollar[4].ClassImplements, yyDollar[7].list, yyDollar[5].str) @@ -5536,15 +5564,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[8].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[6].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[8].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Name, yyDollar[6].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Stmts, yyDollar[8].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 293: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3130 + //line php7/php7.y:3148 { if yyDollar[3].node != nil { yyVAL.node = expr.NewNew(yyDollar[2].node, yyDollar[3].node.(*node.ArgumentList)) @@ -5555,13 +5583,13 @@ yydefault: } // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 294: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3145 + //line php7/php7.y:3163 { yyVAL.node = expr.NewNew(yyDollar[2].node, nil) @@ -5569,32 +5597,32 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 295: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:3160 + //line php7/php7.y:3178 { - list := expr.NewList(yyDollar[3].list) - yyVAL.node = assign.NewAssign(list, yyDollar[6].node) + listNode := expr.NewList(yyDollar[3].list) + yyVAL.node = assign.NewAssign(listNode, yyDollar[6].node) // save position - list.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + listNode.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[6].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(list.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(list.GetMeta()) - yyDollar[5].token.Meta.SetTokenName(meta.EqualToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(listNode, freefloating.List, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(listNode, freefloating.ArrayPairList, yyDollar[4].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Var, yyDollar[5].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 296: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:3177 + //line php7/php7.y:3195 { shortList := expr.NewShortList(yyDollar[2].list) yyVAL.node = assign.NewAssign(shortList, yyDollar[5].node) @@ -5604,15 +5632,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[5].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(shortList.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.EqualToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(shortList, freefloating.ArrayPairList, yyDollar[3].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Var, yyDollar[4].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 297: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3193 + //line php7/php7.y:3211 { yyVAL.node = assign.NewAssign(yyDollar[1].node, yyDollar[3].node) @@ -5620,15 +5648,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.EqualToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Var, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 298: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3207 + //line php7/php7.y:3224 { yyVAL.node = assign.NewReference(yyDollar[1].node, yyDollar[4].node) @@ -5636,16 +5663,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.EqualToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Var, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Equal, yyDollar[3].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 299: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3222 + //line php7/php7.y:3238 { yyVAL.node = expr.NewClone(yyDollar[2].node) @@ -5653,13 +5679,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 300: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3234 + //line php7/php7.y:3250 { yyVAL.node = assign.NewPlus(yyDollar[1].node, yyDollar[3].node) @@ -5667,15 +5693,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.PlusEqualToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Var, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 301: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3248 + //line php7/php7.y:3263 { yyVAL.node = assign.NewMinus(yyDollar[1].node, yyDollar[3].node) @@ -5683,15 +5708,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.MinusEqualToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Var, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 302: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3262 + //line php7/php7.y:3276 { yyVAL.node = assign.NewMul(yyDollar[1].node, yyDollar[3].node) @@ -5699,15 +5723,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.MulEqualToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Var, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 303: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3276 + //line php7/php7.y:3289 { yyVAL.node = assign.NewPow(yyDollar[1].node, yyDollar[3].node) @@ -5715,15 +5738,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.PowEqualToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Var, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 304: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3290 + //line php7/php7.y:3302 { yyVAL.node = assign.NewDiv(yyDollar[1].node, yyDollar[3].node) @@ -5731,15 +5753,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.DivEqualToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Var, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 305: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3304 + //line php7/php7.y:3315 { yyVAL.node = assign.NewConcat(yyDollar[1].node, yyDollar[3].node) @@ -5747,15 +5768,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.ConcatEqualToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Var, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 306: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3318 + //line php7/php7.y:3328 { yyVAL.node = assign.NewMod(yyDollar[1].node, yyDollar[3].node) @@ -5763,15 +5783,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.ModEqualToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Var, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 307: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3332 + //line php7/php7.y:3341 { yyVAL.node = assign.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) @@ -5779,15 +5798,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.AndEqualToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Var, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 308: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3346 + //line php7/php7.y:3354 { yyVAL.node = assign.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) @@ -5795,15 +5813,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.OrEqualToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Var, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 309: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3360 + //line php7/php7.y:3367 { yyVAL.node = assign.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) @@ -5811,15 +5828,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.XorEqualToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Var, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 310: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3374 + //line php7/php7.y:3380 { yyVAL.node = assign.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) @@ -5827,15 +5843,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.SlEqualToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Var, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 311: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3388 + //line php7/php7.y:3393 { yyVAL.node = assign.NewShiftRight(yyDollar[1].node, yyDollar[3].node) @@ -5843,15 +5858,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.SrEqualToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Var, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 312: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3402 + //line php7/php7.y:3406 { yyVAL.node = expr.NewPostInc(yyDollar[1].node) @@ -5859,15 +5873,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.IncToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Var, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 313: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3416 + //line php7/php7.y:3419 { yyVAL.node = expr.NewPreInc(yyDollar[2].node) @@ -5875,13 +5888,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 314: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3428 + //line php7/php7.y:3431 { yyVAL.node = expr.NewPostDec(yyDollar[1].node) @@ -5889,15 +5902,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.DecToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Var, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 315: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3442 + //line php7/php7.y:3444 { yyVAL.node = expr.NewPreDec(yyDollar[2].node) @@ -5905,13 +5917,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 316: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3454 + //line php7/php7.y:3456 { yyVAL.node = binary.NewBooleanOr(yyDollar[1].node, yyDollar[3].node) @@ -5919,15 +5931,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.BooleanOrToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 317: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3468 + //line php7/php7.y:3469 { yyVAL.node = binary.NewBooleanAnd(yyDollar[1].node, yyDollar[3].node) @@ -5935,9 +5946,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.BooleanAndToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5951,15 +5961,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.LogicalOrToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 319: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3496 + //line php7/php7.y:3495 { yyVAL.node = binary.NewLogicalAnd(yyDollar[1].node, yyDollar[3].node) @@ -5967,15 +5976,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.LogicalAndToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 320: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3510 + //line php7/php7.y:3508 { yyVAL.node = binary.NewLogicalXor(yyDollar[1].node, yyDollar[3].node) @@ -5983,15 +5991,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.LogicalXorToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 321: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3524 + //line php7/php7.y:3521 { yyVAL.node = binary.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) @@ -5999,15 +6006,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.VerticalBarToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 322: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3538 + //line php7/php7.y:3534 { yyVAL.node = binary.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) @@ -6015,15 +6021,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 323: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3552 + //line php7/php7.y:3547 { yyVAL.node = binary.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) @@ -6031,15 +6036,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.CaretToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 324: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3566 + //line php7/php7.y:3560 { yyVAL.node = binary.NewConcat(yyDollar[1].node, yyDollar[3].node) @@ -6047,15 +6051,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.DotToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 325: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3580 + //line php7/php7.y:3573 { yyVAL.node = binary.NewPlus(yyDollar[1].node, yyDollar[3].node) @@ -6063,15 +6066,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.PlusToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 326: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3594 + //line php7/php7.y:3586 { yyVAL.node = binary.NewMinus(yyDollar[1].node, yyDollar[3].node) @@ -6079,15 +6081,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.MinusToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 327: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3608 + //line php7/php7.y:3599 { yyVAL.node = binary.NewMul(yyDollar[1].node, yyDollar[3].node) @@ -6095,15 +6096,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.AsteriskToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 328: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3622 + //line php7/php7.y:3612 { yyVAL.node = binary.NewPow(yyDollar[1].node, yyDollar[3].node) @@ -6111,15 +6111,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.PowToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 329: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3636 + //line php7/php7.y:3625 { yyVAL.node = binary.NewDiv(yyDollar[1].node, yyDollar[3].node) @@ -6127,15 +6126,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.SlashToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 330: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3650 + //line php7/php7.y:3638 { yyVAL.node = binary.NewMod(yyDollar[1].node, yyDollar[3].node) @@ -6143,15 +6141,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.PercentToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 331: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3664 + //line php7/php7.y:3651 { yyVAL.node = binary.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) @@ -6159,15 +6156,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.SlToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 332: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3678 + //line php7/php7.y:3664 { yyVAL.node = binary.NewShiftRight(yyDollar[1].node, yyDollar[3].node) @@ -6175,15 +6171,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.SrToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 333: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3692 + //line php7/php7.y:3677 { yyVAL.node = expr.NewUnaryPlus(yyDollar[2].node) @@ -6191,13 +6186,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 334: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3704 + //line php7/php7.y:3689 { yyVAL.node = expr.NewUnaryMinus(yyDollar[2].node) @@ -6205,13 +6200,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 335: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3716 + //line php7/php7.y:3701 { yyVAL.node = expr.NewBooleanNot(yyDollar[2].node) @@ -6219,13 +6214,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 336: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3728 + //line php7/php7.y:3713 { yyVAL.node = expr.NewBitwiseNot(yyDollar[2].node) @@ -6233,13 +6228,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 337: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3740 + //line php7/php7.y:3725 { yyVAL.node = binary.NewIdentical(yyDollar[1].node, yyDollar[3].node) @@ -6247,15 +6242,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.IsIdenticalToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 338: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3754 + //line php7/php7.y:3738 { yyVAL.node = binary.NewNotIdentical(yyDollar[1].node, yyDollar[3].node) @@ -6263,15 +6257,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.IsNotIdenticalToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 339: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3768 + //line php7/php7.y:3751 { yyVAL.node = binary.NewEqual(yyDollar[1].node, yyDollar[3].node) @@ -6279,15 +6272,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.IsEqualToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 340: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3782 + //line php7/php7.y:3764 { yyVAL.node = binary.NewNotEqual(yyDollar[1].node, yyDollar[3].node) @@ -6295,16 +6287,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.IsNotEqualToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.IsNotEqualToken) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Equal, yylex.(*Parser).GetFreeFloatingToken(yyDollar[2].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 341: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3797 + //line php7/php7.y:3778 { yyVAL.node = binary.NewSmaller(yyDollar[1].node, yyDollar[3].node) @@ -6312,15 +6303,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.LessToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 342: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3811 + //line php7/php7.y:3791 { yyVAL.node = binary.NewSmallerOrEqual(yyDollar[1].node, yyDollar[3].node) @@ -6328,15 +6318,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.IsSmallerOrEqualToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 343: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3825 + //line php7/php7.y:3804 { yyVAL.node = binary.NewGreater(yyDollar[1].node, yyDollar[3].node) @@ -6344,15 +6333,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.GreaterToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 344: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3839 + //line php7/php7.y:3817 { yyVAL.node = binary.NewGreaterOrEqual(yyDollar[1].node, yyDollar[3].node) @@ -6360,15 +6348,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.IsGreaterOrEqualToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 345: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3853 + //line php7/php7.y:3830 { yyVAL.node = binary.NewSpaceship(yyDollar[1].node, yyDollar[3].node) @@ -6376,15 +6363,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.SpaceshipToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 346: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3867 + //line php7/php7.y:3843 { yyVAL.node = expr.NewInstanceOf(yyDollar[1].node, yyDollar[3].node) @@ -6392,29 +6378,26 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.InstanceofToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 347: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3881 + //line php7/php7.y:3856 { yyVAL.node = yyDollar[2].node // save comments - yylex.(*Parser).prependMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).PrependTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.NodeEnd) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, append(yyDollar[1].token.FreeFloating, append(yylex.(*Parser).GetFreeFloatingToken(yyDollar[1].token), (*yyVAL.node.GetFreeFloating())[freefloating.Start]...)...)) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.End, append((*yyVAL.node.GetFreeFloating())[freefloating.End], append(yyDollar[3].token.FreeFloating, yylex.(*Parser).GetFreeFloatingToken(yyDollar[3].token)...)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 348: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3893 + //line php7/php7.y:3866 { yyVAL.node = yyDollar[1].node @@ -6422,7 +6405,7 @@ yydefault: } case 349: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:3899 + //line php7/php7.y:3872 { yyVAL.node = expr.NewTernary(yyDollar[1].node, yyDollar[3].node, yyDollar[5].node) @@ -6430,16 +6413,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[5].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.QuestionMarkToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.ColonToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Cond, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.True, yyDollar[4].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 350: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3914 + //line php7/php7.y:3886 { yyVAL.node = expr.NewTernary(yyDollar[1].node, nil, yyDollar[4].node) @@ -6447,16 +6429,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.QuestionMarkToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.ColonToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Cond, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.True, yyDollar[3].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 351: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3929 + //line php7/php7.y:3900 { yyVAL.node = binary.NewCoalesce(yyDollar[1].node, yyDollar[3].node) @@ -6464,15 +6445,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.CoalesceToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 352: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3943 + //line php7/php7.y:3913 { yyVAL.node = yyDollar[1].node @@ -6480,7 +6460,7 @@ yydefault: } case 353: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3949 + //line php7/php7.y:3919 { yyVAL.node = cast.NewInt(yyDollar[2].node) @@ -6488,14 +6468,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Cast, yylex.(*Parser).GetFreeFloatingToken(yyDollar[1].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 354: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3962 + //line php7/php7.y:3932 { yyVAL.node = cast.NewDouble(yyDollar[2].node) @@ -6503,14 +6483,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Cast, yylex.(*Parser).GetFreeFloatingToken(yyDollar[1].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 355: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3975 + //line php7/php7.y:3945 { yyVAL.node = cast.NewString(yyDollar[2].node) @@ -6518,14 +6498,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Cast, yylex.(*Parser).GetFreeFloatingToken(yyDollar[1].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 356: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3988 + //line php7/php7.y:3958 { yyVAL.node = cast.NewArray(yyDollar[2].node) @@ -6533,14 +6513,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Cast, yylex.(*Parser).GetFreeFloatingToken(yyDollar[1].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 357: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4001 + //line php7/php7.y:3971 { yyVAL.node = cast.NewObject(yyDollar[2].node) @@ -6548,14 +6528,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Cast, yylex.(*Parser).GetFreeFloatingToken(yyDollar[1].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 358: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4014 + //line php7/php7.y:3984 { yyVAL.node = cast.NewBool(yyDollar[2].node) @@ -6563,14 +6543,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Cast, yylex.(*Parser).GetFreeFloatingToken(yyDollar[1].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 359: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4027 + //line php7/php7.y:3997 { yyVAL.node = cast.NewUnset(yyDollar[2].node) @@ -6578,14 +6558,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Cast, yylex.(*Parser).GetFreeFloatingToken(yyDollar[1].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 360: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4040 + //line php7/php7.y:4010 { var e *expr.Exit if yyDollar[2].node != nil { @@ -6608,13 +6588,13 @@ yydefault: } // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 361: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4067 + //line php7/php7.y:4037 { yyVAL.node = expr.NewErrorSuppress(yyDollar[2].node) @@ -6622,13 +6602,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 362: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4079 + //line php7/php7.y:4049 { yyVAL.node = yyDollar[1].node @@ -6636,7 +6616,7 @@ yydefault: } case 363: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4085 + //line php7/php7.y:4055 { yyVAL.node = expr.NewShellExec(yyDollar[2].list) @@ -6644,13 +6624,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 364: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4097 + //line php7/php7.y:4067 { yyVAL.node = expr.NewPrint(yyDollar[2].node) @@ -6658,13 +6638,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 365: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4109 + //line php7/php7.y:4079 { yyVAL.node = expr.NewYield(nil, nil) @@ -6672,13 +6652,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 366: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4121 + //line php7/php7.y:4091 { yyVAL.node = expr.NewYield(nil, yyDollar[2].node) @@ -6686,13 +6666,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 367: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4133 + //line php7/php7.y:4103 { yyVAL.node = expr.NewYield(yyDollar[2].node, yyDollar[4].node) @@ -6700,14 +6680,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[4].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[3].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 368: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4146 + //line php7/php7.y:4116 { yyVAL.node = expr.NewYieldFrom(yyDollar[2].node) @@ -6715,13 +6695,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 369: yyDollar = yyS[yypt-11 : yypt+1] - //line php7/php7.y:4158 + //line php7/php7.y:4128 { yyVAL.node = expr.NewClosure(yyDollar[5].list, yyDollar[7].ClosureUse, yyDollar[8].node, yyDollar[10].list, false, yyDollar[2].token != nil, yyDollar[3].str) @@ -6729,20 +6709,36 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[11].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - if yyDollar[2].token != nil { - yyDollar[2].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + if yyDollar[2].token == nil { + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Function, yyDollar[4].token.FreeFloating) + } else { + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Function, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Ampersand, yyDollar[4].token.FreeFloating) + } + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.ParameterList, yyDollar[6].token.FreeFloating) + if yyDollar[8].node != nil { + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.LexicalVars, (*yyDollar[8].node.GetFreeFloating())[freefloating.Colon]) + delete((*yyDollar[8].node.GetFreeFloating()), freefloating.Colon) + } + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.ReturnType, yyDollar[9].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Stmts, yyDollar[11].token.FreeFloating) + + // normalize + if yyDollar[8].node == nil { + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.LexicalVars, (*yyVAL.node.GetFreeFloating())[freefloating.ReturnType]) + delete((*yyVAL.node.GetFreeFloating()), freefloating.ReturnType) + } + if yyDollar[7].ClosureUse == nil { + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Params, (*yyVAL.node.GetFreeFloating())[freefloating.LexicalVarList]) + delete((*yyVAL.node.GetFreeFloating()), freefloating.LexicalVarList) } - yyDollar[4].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[6].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[9].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[11].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 370: yyDollar = yyS[yypt-12 : yypt+1] - //line php7/php7.y:4177 + //line php7/php7.y:4160 { yyVAL.node = expr.NewClosure(yyDollar[6].list, yyDollar[8].ClosureUse, yyDollar[9].node, yyDollar[11].list, true, yyDollar[3].token != nil, yyDollar[4].str) @@ -6750,21 +6746,37 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[12].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.FunctionToken).AppendTo(yyVAL.node.GetMeta()) - if yyDollar[3].token != nil { - yyDollar[3].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Static, yyDollar[2].token.FreeFloating) + if yyDollar[3].token == nil { + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Function, yyDollar[5].token.FreeFloating) + } else { + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Function, yyDollar[3].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Ampersand, yyDollar[5].token.FreeFloating) + } + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.ParameterList, yyDollar[7].token.FreeFloating) + if yyDollar[9].node != nil { + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.LexicalVars, (*yyDollar[9].node.GetFreeFloating())[freefloating.Colon]) + delete((*yyDollar[9].node.GetFreeFloating()), freefloating.Colon) + } + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.ReturnType, yyDollar[10].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Stmts, yyDollar[12].token.FreeFloating) + + // normalize + if yyDollar[9].node == nil { + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.LexicalVars, (*yyVAL.node.GetFreeFloating())[freefloating.ReturnType]) + delete((*yyVAL.node.GetFreeFloating()), freefloating.ReturnType) + } + if yyDollar[8].ClosureUse == nil { + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Params, (*yyVAL.node.GetFreeFloating())[freefloating.LexicalVarList]) + delete((*yyVAL.node.GetFreeFloating()), freefloating.LexicalVarList) } - yyDollar[5].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[7].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[10].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[12].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 371: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4200 + //line php7/php7.y:4196 { yyVAL.str = yylex.(*Parser).PhpDocComment yylex.(*Parser).PhpDocComment = "" @@ -6773,19 +6785,19 @@ yydefault: } case 372: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4210 + //line php7/php7.y:4206 { yyVAL.token = nil } case 373: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4214 + //line php7/php7.y:4210 { yyVAL.token = yyDollar[1].token } case 374: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4221 + //line php7/php7.y:4217 { yyVAL.ClosureUse = nil @@ -6793,7 +6805,7 @@ yydefault: } case 375: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4227 + //line php7/php7.y:4223 { yyVAL.ClosureUse = expr.NewClosureUse(yyDollar[3].list) @@ -6801,26 +6813,26 @@ yydefault: yyVAL.ClosureUse.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.ClosureUse.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.ClosureUse.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.ClosureUse.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.ClosureUse, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.ClosureUse, freefloating.Use, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.ClosureUse, freefloating.LexicalVarList, yyDollar[4].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 376: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4244 + //line php7/php7.y:4240 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode(yyDollar[1].list), freefloating.End, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 377: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4253 + //line php7/php7.y:4249 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -6828,7 +6840,7 @@ yydefault: } case 378: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4262 + //line php7/php7.y:4258 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(identifier) @@ -6838,14 +6850,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMeta(yyVAL.node, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).addDollarToken(yyVAL.node) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 379: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4277 + //line php7/php7.y:4273 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[2].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -6857,15 +6869,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(variable, freefloating.Start, yyDollar[2].token.FreeFloating) + yylex.(*Parser).addDollarToken(variable) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 380: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4298 + //line php7/php7.y:4294 { yyVAL.node = expr.NewFunctionCall(yyDollar[1].node, yyDollar[2].node.(*node.ArgumentList)) @@ -6873,13 +6885,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[2].node)) // save comments - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 381: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4310 + //line php7/php7.y:4306 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -6887,14 +6899,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Name, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 382: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4323 + //line php7/php7.y:4319 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -6902,26 +6914,28 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Name, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 383: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4336 + //line php7/php7.y:4332 { yyVAL.node = expr.NewFunctionCall(yyDollar[1].node, yyDollar[2].node.(*node.ArgumentList)) // save position yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[2].node)) - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + + // save comments + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 384: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4349 + //line php7/php7.y:4347 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -6929,13 +6943,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 385: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4361 + //line php7/php7.y:4359 { yyVAL.node = yyDollar[1].node @@ -6943,7 +6957,7 @@ yydefault: } case 386: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4370 + //line php7/php7.y:4368 { yyVAL.node = yyDollar[1].node @@ -6951,7 +6965,7 @@ yydefault: } case 387: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4376 + //line php7/php7.y:4374 { yyVAL.node = yyDollar[1].node @@ -6959,7 +6973,7 @@ yydefault: } case 388: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4385 + //line php7/php7.y:4383 { yyVAL.node = nil @@ -6967,7 +6981,7 @@ yydefault: } case 389: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4391 + //line php7/php7.y:4389 { yyVAL.node = expr.NewExit(yyDollar[2].node) @@ -6975,16 +6989,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yylex.(*Parser).prependMetaToken(yyVAL.node, yyDollar[1].token, meta.OpenParenthesisToken) - yyDollar[1].token.Meta.SetTokenName(meta.OpenParenthesisToken).PrependTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.CloseParenthesisToken) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Exit, append(yyDollar[1].token.FreeFloating, yylex.(*Parser).GetFreeFloatingToken(yyDollar[1].token)...)) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, append(yyDollar[3].token.FreeFloating, yylex.(*Parser).GetFreeFloatingToken(yyDollar[3].token)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 390: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4409 + //line php7/php7.y:4405 { yyVAL.list = []node.Node{} @@ -6992,9 +7004,13 @@ yydefault: } case 391: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4415 + //line php7/php7.y:4411 { - yyVAL.list = []node.Node{scalar.NewEncapsedStringPart(yyDollar[1].token.Value)} + part := scalar.NewEncapsedStringPart(yyDollar[1].token.Value) + yyVAL.list = []node.Node{part} + + // save position + part.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7032,9 +7048,9 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Array, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.ArrayPairList, yyDollar[4].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7048,8 +7064,8 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.ArrayPairList, yyDollar[3].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7063,7 +7079,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7077,7 +7093,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7091,7 +7107,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7105,7 +7121,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7119,7 +7135,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7133,7 +7149,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7147,7 +7163,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7161,7 +7177,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7175,7 +7191,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7189,7 +7205,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7203,7 +7219,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7219,7 +7235,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7233,7 +7249,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7247,7 +7263,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7261,7 +7277,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7291,7 +7307,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) // save comments - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7307,16 +7323,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(target.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Name, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(target, freefloating.Start, yyDollar[3].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 416: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4701 + //line php7/php7.y:4700 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -7326,16 +7341,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(target.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Name, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(target, freefloating.Start, yyDollar[3].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 417: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4721 + //line php7/php7.y:4719 { yyVAL.node = yyDollar[1].node @@ -7343,7 +7357,7 @@ yydefault: } case 418: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4727 + //line php7/php7.y:4725 { yyVAL.node = yyDollar[1].node @@ -7351,7 +7365,7 @@ yydefault: } case 419: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:4736 + //line php7/php7.y:4734 { yyVAL.node = nil @@ -7359,7 +7373,7 @@ yydefault: } case 420: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4742 + //line php7/php7.y:4740 { yyVAL.node = yyDollar[1].node @@ -7367,7 +7381,7 @@ yydefault: } case 421: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4751 + //line php7/php7.y:4749 { yyVAL.node = yyDollar[1].node @@ -7375,7 +7389,7 @@ yydefault: } case 422: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4760 + //line php7/php7.y:4758 { yyVAL.node = yyDollar[1].node @@ -7383,21 +7397,19 @@ yydefault: } case 423: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4766 + //line php7/php7.y:4764 { yyVAL.node = yyDollar[2].node // save comments - yylex.(*Parser).prependMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).PrependTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.NodeEnd) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, append(yyDollar[1].token.FreeFloating, append(yylex.(*Parser).GetFreeFloatingToken(yyDollar[1].token), (*yyVAL.node.GetFreeFloating())[freefloating.Start]...)...)) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.End, append((*yyVAL.node.GetFreeFloating())[freefloating.End], append(yyDollar[3].token.FreeFloating, yylex.(*Parser).GetFreeFloatingToken(yyDollar[3].token)...)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 424: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4778 + //line php7/php7.y:4774 { yyVAL.node = yyDollar[1].node @@ -7405,7 +7417,7 @@ yydefault: } case 425: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4787 + //line php7/php7.y:4783 { yyVAL.node = yyDollar[1].node @@ -7413,21 +7425,19 @@ yydefault: } case 426: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4793 + //line php7/php7.y:4789 { yyVAL.node = yyDollar[2].node // save comments - yylex.(*Parser).prependMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).PrependTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.NodeEnd) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, append(yyDollar[1].token.FreeFloating, append(yylex.(*Parser).GetFreeFloatingToken(yyDollar[1].token), (*yyVAL.node.GetFreeFloating())[freefloating.Start]...)...)) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.End, append((*yyVAL.node.GetFreeFloating())[freefloating.End], append(yyDollar[3].token.FreeFloating, yylex.(*Parser).GetFreeFloatingToken(yyDollar[3].token)...)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 427: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4805 + //line php7/php7.y:4799 { yyVAL.node = yyDollar[1].node @@ -7435,7 +7445,7 @@ yydefault: } case 428: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4814 + //line php7/php7.y:4808 { yyVAL.node = yyDollar[1].node @@ -7443,7 +7453,7 @@ yydefault: } case 429: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4820 + //line php7/php7.y:4814 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -7451,18 +7461,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) // save comments - yylex.(*Parser).prependMetaToken(yyVAL.node, yyDollar[2].token, meta.OpenSquareBracket) - yyDollar[2].token.Meta.SetTokenName(meta.OpenSquareBracket).PrependTo(yyVAL.node.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.CloseSquareBracket) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Var, append(yyDollar[2].token.FreeFloating, yylex.(*Parser).GetFreeFloatingToken(yyDollar[2].token)...)) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, append(yyDollar[4].token.FreeFloating, yylex.(*Parser).GetFreeFloatingToken(yyDollar[4].token)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 430: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4837 + //line php7/php7.y:4828 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -7470,18 +7477,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) // save comments - yylex.(*Parser).prependMetaToken(yyVAL.node, yyDollar[2].token, meta.OpenSquareBracket) - yyDollar[2].token.Meta.SetTokenName(meta.OpenSquareBracket).PrependTo(yyVAL.node.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.CloseSquareBracket) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Var, append(yyDollar[2].token.FreeFloating, yylex.(*Parser).GetFreeFloatingToken(yyDollar[2].token)...)) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, append(yyDollar[4].token.FreeFloating, yylex.(*Parser).GetFreeFloatingToken(yyDollar[4].token)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 431: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4854 + //line php7/php7.y:4842 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -7489,18 +7493,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) // save comments - yylex.(*Parser).prependMetaToken(yyVAL.node, yyDollar[2].token, meta.OpenCurlyBracesToken) - yyDollar[2].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).PrependTo(yyVAL.node.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.CloseCurlyBracesToken) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Var, append(yyDollar[2].token.FreeFloating, yylex.(*Parser).GetFreeFloatingToken(yyDollar[2].token)...)) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, append(yyDollar[4].token.FreeFloating, yylex.(*Parser).GetFreeFloatingToken(yyDollar[4].token)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 432: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4871 + //line php7/php7.y:4856 { yyVAL.node = expr.NewMethodCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -7508,15 +7509,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.ObjectOperatorToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Var, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 433: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4885 + //line php7/php7.y:4869 { yyVAL.node = yyDollar[1].node @@ -7524,7 +7524,7 @@ yydefault: } case 434: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4894 + //line php7/php7.y:4878 { yyVAL.node = yyDollar[1].node @@ -7532,7 +7532,7 @@ yydefault: } case 435: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4900 + //line php7/php7.y:4884 { yyVAL.node = yyDollar[1].node @@ -7540,7 +7540,7 @@ yydefault: } case 436: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4906 + //line php7/php7.y:4890 { yyVAL.node = expr.NewPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -7548,15 +7548,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.ObjectOperatorToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Var, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 437: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4923 + //line php7/php7.y:4906 { name := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(name) @@ -7566,14 +7565,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMeta(yyVAL.node, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).addDollarToken(yyVAL.node) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 438: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4938 + //line php7/php7.y:4921 { yyVAL.node = expr.NewVariable(yyDollar[3].node) @@ -7581,18 +7580,16 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) - yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.NodeStart) - yyDollar[4].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.NodeEnd) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Dollar, yylex.(*Parser).GetFreeFloatingToken(yyDollar[1].token)) + yylex.(*Parser).setFreeFloating(yyDollar[3].node, freefloating.Start, append(yyDollar[2].token.FreeFloating, append(yylex.(*Parser).GetFreeFloatingToken(yyDollar[2].token), (*yyDollar[3].node.GetFreeFloating())[freefloating.Start]...)...)) + yylex.(*Parser).setFreeFloating(yyDollar[3].node, freefloating.End, append((*yyDollar[3].node.GetFreeFloating())[freefloating.End], append(yyDollar[4].token.FreeFloating, yylex.(*Parser).GetFreeFloatingToken(yyDollar[4].token)...)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 439: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4955 + //line php7/php7.y:4936 { yyVAL.node = expr.NewVariable(yyDollar[2].node) @@ -7600,14 +7597,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Dollar, yylex.(*Parser).GetFreeFloatingToken(yyDollar[1].token)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 440: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4971 + //line php7/php7.y:4952 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -7615,15 +7612,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Name, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 441: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4985 + //line php7/php7.y:4965 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -7631,15 +7627,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Name, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 442: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5002 + //line php7/php7.y:4981 { yyVAL.node = yyDollar[1].node @@ -7647,7 +7642,7 @@ yydefault: } case 443: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:5008 + //line php7/php7.y:4987 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -7655,18 +7650,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) // save comments - yylex.(*Parser).prependMetaToken(yyVAL.node, yyDollar[2].token, meta.OpenSquareBracket) - yyDollar[2].token.Meta.SetTokenName(meta.OpenSquareBracket).PrependTo(yyVAL.node.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.CloseSquareBracket) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Var, append(yyDollar[2].token.FreeFloating, yylex.(*Parser).GetFreeFloatingToken(yyDollar[2].token)...)) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, append(yyDollar[4].token.FreeFloating, yylex.(*Parser).GetFreeFloatingToken(yyDollar[4].token)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 444: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:5025 + //line php7/php7.y:5001 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -7674,18 +7666,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) // save comments - yylex.(*Parser).prependMetaToken(yyVAL.node, yyDollar[2].token, meta.OpenCurlyBracesToken) - yyDollar[2].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).PrependTo(yyVAL.node.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.CloseCurlyBracesToken) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Var, append(yyDollar[2].token.FreeFloating, yylex.(*Parser).GetFreeFloatingToken(yyDollar[2].token)...)) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, append(yyDollar[4].token.FreeFloating, yylex.(*Parser).GetFreeFloatingToken(yyDollar[4].token)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 445: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5042 + //line php7/php7.y:5015 { yyVAL.node = expr.NewPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -7693,15 +7682,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.ObjectOperatorToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Var, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 446: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5056 + //line php7/php7.y:5028 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -7709,15 +7697,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Var, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 447: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5070 + //line php7/php7.y:5041 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -7725,15 +7712,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Var, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 448: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5087 + //line php7/php7.y:5057 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -7741,27 +7727,25 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 449: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5099 + //line php7/php7.y:5069 { yyVAL.node = yyDollar[2].node // save comments - yylex.(*Parser).prependMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).PrependTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.NodeEnd) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, append(yyDollar[1].token.FreeFloating, append(yylex.(*Parser).GetFreeFloatingToken(yyDollar[1].token), (*yyVAL.node.GetFreeFloating())[freefloating.Start]...)...)) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.End, append((*yyVAL.node.GetFreeFloating())[freefloating.End], append(yyDollar[3].token.FreeFloating, yylex.(*Parser).GetFreeFloatingToken(yyDollar[3].token)...)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 450: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5111 + //line php7/php7.y:5079 { yyVAL.node = yyDollar[1].node @@ -7769,7 +7753,7 @@ yydefault: } case 451: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5120 + //line php7/php7.y:5088 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -7777,27 +7761,25 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 452: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5132 + //line php7/php7.y:5100 { yyVAL.node = yyDollar[2].node // save comments - yylex.(*Parser).prependMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).PrependTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.NodeEnd) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, append(yyDollar[1].token.FreeFloating, append(yylex.(*Parser).GetFreeFloatingToken(yyDollar[1].token), (*yyVAL.node.GetFreeFloating())[freefloating.Start]...)...)) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.End, append((*yyVAL.node.GetFreeFloating())[freefloating.End], append(yyDollar[3].token.FreeFloating, yylex.(*Parser).GetFreeFloatingToken(yyDollar[3].token)...)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 453: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5144 + //line php7/php7.y:5110 { yyVAL.node = yyDollar[1].node @@ -7805,7 +7787,7 @@ yydefault: } case 454: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5153 + //line php7/php7.y:5119 { yyVAL.list = yyDollar[1].list @@ -7813,7 +7795,7 @@ yydefault: } case 455: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:5162 + //line php7/php7.y:5128 { yyVAL.node = expr.NewArrayItem(nil, nil) @@ -7821,7 +7803,7 @@ yydefault: } case 456: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5168 + //line php7/php7.y:5134 { yyVAL.node = yyDollar[1].node @@ -7829,7 +7811,7 @@ yydefault: } case 457: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5177 + //line php7/php7.y:5143 { if len(yyDollar[1].list) == 0 { yyDollar[1].list = []node.Node{expr.NewArrayItem(nil, nil)} @@ -7838,13 +7820,13 @@ yydefault: yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode(yyDollar[1].list), freefloating.End, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 458: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5190 + //line php7/php7.y:5156 { if yyDollar[1].node.(*expr.ArrayItem).Key == nil && yyDollar[1].node.(*expr.ArrayItem).Val == nil { yyVAL.list = []node.Node{} @@ -7856,7 +7838,7 @@ yydefault: } case 459: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5203 + //line php7/php7.y:5169 { yyVAL.node = expr.NewArrayItem(yyDollar[1].node, yyDollar[3].node) @@ -7864,28 +7846,28 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo(yyVAL.node.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 460: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5217 + //line php7/php7.y:5182 { yyVAL.node = expr.NewArrayItem(nil, yyDollar[1].node) // save position yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + // save comments + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 461: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:5228 + //line php7/php7.y:5194 { reference := expr.NewReference(yyDollar[4].node) yyVAL.node = expr.NewArrayItem(yyDollar[1].node, reference) @@ -7895,16 +7877,15 @@ yydefault: reference.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[3].token, yyDollar[4].node)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(reference.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(reference, freefloating.Start, yyDollar[3].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 462: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5245 + //line php7/php7.y:5210 { reference := expr.NewReference(yyDollar[2].node) yyVAL.node = expr.NewArrayItem(nil, reference) @@ -7914,54 +7895,53 @@ yydefault: reference.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 463: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:5259 + //line php7/php7.y:5224 { // TODO: Cannot use list() as standalone expression - list := expr.NewList(yyDollar[5].list) - yyVAL.node = expr.NewArrayItem(yyDollar[1].node, list) + listNode := expr.NewList(yyDollar[5].list) + yyVAL.node = expr.NewArrayItem(yyDollar[1].node, listNode) // save position - list.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[3].token, yyDollar[6].token)) + listNode.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[3].token, yyDollar[6].token)) yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[6].token)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(list.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(list.GetMeta()) - yyDollar[6].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(list.GetMeta()) - - yyDollar[1].node.GetMeta().Cut(newInheritMetaFilter()).PrependTo(yyVAL.node.GetMeta()) + yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(listNode, freefloating.Start, yyDollar[3].token.FreeFloating) + yylex.(*Parser).setFreeFloating(listNode, freefloating.List, yyDollar[4].token.FreeFloating) + yylex.(*Parser).setFreeFloating(listNode, freefloating.ArrayPairList, yyDollar[6].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 464: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:5279 + //line php7/php7.y:5243 { // TODO: Cannot use list() as standalone expression - list := expr.NewList(yyDollar[3].list) - yyVAL.node = expr.NewArrayItem(nil, list) + listNode := expr.NewList(yyDollar[3].list) + yyVAL.node = expr.NewArrayItem(nil, listNode) // save position - list.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + listNode.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(list.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(list.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(listNode, freefloating.List, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(listNode, freefloating.ArrayPairList, yyDollar[4].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 465: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5299 + //line php7/php7.y:5263 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -7969,7 +7949,7 @@ yydefault: } case 466: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5305 + //line php7/php7.y:5269 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yyVAL.list = append(yyDollar[1].list, encapsed) @@ -7978,13 +7958,13 @@ yydefault: encapsed.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(encapsed.GetMeta()) + yylex.(*Parser).setFreeFloating(encapsed, freefloating.Start, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 467: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5318 + //line php7/php7.y:5282 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -7992,7 +7972,7 @@ yydefault: } case 468: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5324 + //line php7/php7.y:5288 { encapsed := scalar.NewEncapsedStringPart(yyDollar[1].token.Value) yyVAL.list = []node.Node{encapsed, yyDollar[2].node} @@ -8001,13 +7981,13 @@ yydefault: encapsed.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(encapsed.GetMeta()) + yylex.(*Parser).setFreeFloating(encapsed, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 469: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5340 + //line php7/php7.y:5304 { name := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(name) @@ -8017,14 +7997,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMeta(yyVAL.node, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).addDollarToken(yyVAL.node) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 470: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:5355 + //line php7/php7.y:5319 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -8036,17 +8016,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) - yyDollar[2].token.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.OpenSquareBracket) - yyDollar[4].token.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.CloseSquareBracket) + yylex.(*Parser).addDollarToken(variable) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Var, append(yyDollar[2].token.FreeFloating, yylex.(*Parser).GetFreeFloatingToken(yyDollar[2].token)...)) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, append(yyDollar[4].token.FreeFloating, yylex.(*Parser).GetFreeFloatingToken(yyDollar[4].token)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 471: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5375 + //line php7/php7.y:5337 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) variable := expr.NewVariable(identifier) @@ -8060,15 +8038,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) - yyDollar[2].token.Meta.SetTokenName(meta.ObjectOperatorToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.NodeStart).AppendTo(fetch.GetMeta()) + yylex.(*Parser).addDollarToken(variable) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Var, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(fetch, freefloating.Start, yyDollar[3].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 472: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5395 + //line php7/php7.y:5357 { variable := expr.NewVariable(yyDollar[2].node) @@ -8078,15 +8056,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) - yyDollar[3].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.NodeEnd) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yylex.(*Parser).GetFreeFloatingToken(yyDollar[1].token)) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.End, append(yyDollar[3].token.FreeFloating, yylex.(*Parser).GetFreeFloatingToken(yyDollar[3].token)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 473: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5411 + //line php7/php7.y:5372 { name := node.NewIdentifier(yyDollar[2].token.Value) variable := expr.NewVariable(name) @@ -8098,16 +8075,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) - yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) - yyDollar[3].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.NodeEnd) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yylex.(*Parser).GetFreeFloatingToken(yyDollar[1].token)) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.End, append(yyDollar[3].token.FreeFloating, yylex.(*Parser).GetFreeFloatingToken(yyDollar[3].token)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 474: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:5430 + //line php7/php7.y:5389 { identifier := node.NewIdentifier(yyDollar[2].token.Value) variable := expr.NewVariable(identifier) @@ -8119,32 +8094,28 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[6].token)) // save comments - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) - yyDollar[3].token.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.OpenSquareBracket) - yyDollar[5].token.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[5].token, meta.CloseSquareBracket) - yyDollar[6].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[6].token, meta.NodeEnd) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yylex.(*Parser).GetFreeFloatingToken(yyDollar[1].token)) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Var, append(yyDollar[3].token.FreeFloating, yylex.(*Parser).GetFreeFloatingToken(yyDollar[3].token)...)) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, append(yyDollar[5].token.FreeFloating, yylex.(*Parser).GetFreeFloatingToken(yyDollar[5].token)...)) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.End, append(yyDollar[6].token.FreeFloating, yylex.(*Parser).GetFreeFloatingToken(yyDollar[6].token)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 475: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5452 + //line php7/php7.y:5408 { yyVAL.node = yyDollar[2].node // save comments - yylex.(*Parser).prependMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart) - yyDollar[3].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.NodeEnd) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yylex.(*Parser).GetFreeFloatingToken(yyDollar[1].token)) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.End, append(yyDollar[3].token.FreeFloating, yylex.(*Parser).GetFreeFloatingToken(yyDollar[3].token)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 476: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5466 + //line php7/php7.y:5421 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) @@ -8152,13 +8123,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 477: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5478 + //line php7/php7.y:5433 { // TODO: add option to handle 64 bit integer if _, err := strconv.Atoi(yyDollar[1].token.Value); err == nil { @@ -8171,13 +8142,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 478: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5495 + //line php7/php7.y:5450 { var lnumber *scalar.Lnumber // TODO: add option to handle 64 bit integer @@ -8199,13 +8170,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 479: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5521 + //line php7/php7.y:5476 { identifier := node.NewIdentifier(strings.TrimLeftFunc(yyDollar[1].token.Value, isDollar)) yyVAL.node = expr.NewVariable(identifier) @@ -8215,14 +8186,14 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMeta(yyVAL.node, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).addDollarToken(yyVAL.node) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 480: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:5539 + //line php7/php7.y:5494 { yyVAL.node = expr.NewIsset(yyDollar[3].list) @@ -8230,19 +8201,19 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[5].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) - if yyDollar[4].token != nil { - yyDollar[4].token.Meta.SetTokenName(meta.CommaToken).AppendTo(yyVAL.node.GetMeta()) - yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[4].token, meta.CommaToken) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Isset, yyDollar[2].token.FreeFloating) + if yyDollar[4].token == nil { + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.VarList, yyDollar[5].token.FreeFloating) + } else { + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.VarList, append(yyDollar[4].token.FreeFloating, append(yylex.(*Parser).GetFreeFloatingToken(yyDollar[4].token), yyDollar[5].token.FreeFloating...)...)) } - yyDollar[5].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 481: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:5557 + //line php7/php7.y:5512 { yyVAL.node = expr.NewEmpty(yyDollar[3].node) @@ -8250,15 +8221,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Empty, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[4].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 482: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5571 + //line php7/php7.y:5526 { yyVAL.node = expr.NewInclude(yyDollar[2].node) @@ -8266,13 +8237,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 483: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5583 + //line php7/php7.y:5538 { yyVAL.node = expr.NewIncludeOnce(yyDollar[2].node) @@ -8280,13 +8251,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 484: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:5595 + //line php7/php7.y:5550 { yyVAL.node = expr.NewEval(yyDollar[3].node) @@ -8294,15 +8265,15 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) - yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta()) - yyDollar[4].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Eval, yyDollar[2].token.FreeFloating) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Expr, yyDollar[4].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 485: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5609 + //line php7/php7.y:5564 { yyVAL.node = expr.NewRequire(yyDollar[2].node) @@ -8310,13 +8281,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 486: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:5621 + //line php7/php7.y:5576 { yyVAL.node = expr.NewRequireOnce(yyDollar[2].node) @@ -8324,13 +8295,13 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta()) + yylex.(*Parser).setFreeFloating(yyVAL.node, freefloating.Start, yyDollar[1].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 487: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5636 + //line php7/php7.y:5591 { yyVAL.list = []node.Node{yyDollar[1].node} @@ -8338,18 +8309,18 @@ yydefault: } case 488: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:5642 + //line php7/php7.y:5597 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - yyDollar[2].token.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode(yyDollar[1].list).GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode(yyDollar[1].list), freefloating.End, yyDollar[2].token.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 489: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:5654 + //line php7/php7.y:5609 { yyVAL.node = yyDollar[1].node diff --git a/php7/php7.y b/php7/php7.y index a87a408..3ff11c0 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -5,7 +5,7 @@ import ( "strings" "strconv" - "github.com/z7zmey/php-parser/meta" + "github.com/z7zmey/php-parser/freefloating" "github.com/z7zmey/php-parser/scanner" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node/scalar" @@ -306,7 +306,7 @@ start: yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) if yylex.(*Parser).currentToken.Value == "\xff" { - yylex.(*Parser).currentToken.Meta.SetTokenName(meta.NodeEnd).AppendTo(yylex.(*Parser).rootNode.GetMeta()) + yylex.(*Parser).setFreeFloating(yylex.(*Parser).rootNode, freefloating.End, yylex.(*Parser).currentToken.FreeFloating) } } ; @@ -345,7 +345,7 @@ top_statement_list: { if inlineHtmlNode, ok := $2.(*stmt.InlineHtml); ok && len($1) > 0 { prevNode := lastNode($1) - yylex.(*Parser).splitSemicolonTokenAndPhpCloseTag(inlineHtmlNode, prevNode) + yylex.(*Parser).splitSemiColonAndPhpCloseTag(inlineHtmlNode, prevNode) } if $2 != nil { @@ -372,7 +372,7 @@ namespace_name: namePart.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo(namePart.GetMeta()) + yylex.(*Parser).setFreeFloating(namePart, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -385,8 +385,8 @@ namespace_name: namePart.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) // save comments - $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) - $3.Meta.SetTokenName(meta.NodeStart).AppendTo(namePart.GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(namePart, freefloating.Start, $3.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -401,7 +401,7 @@ name: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) // save comments - $1[0].GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1[0], $$) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -413,8 +413,8 @@ name: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Namespace, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -426,7 +426,7 @@ name: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -478,11 +478,11 @@ top_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) - $4.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $4, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.HaltCompiller, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.OpenParenthesisToken, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.CloseParenthesisToken, $4.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -498,9 +498,10 @@ top_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).MoveFreeFloating($2[0], name) + yylex.(*Parser).setFreeFloating(name, freefloating.End, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -514,9 +515,10 @@ top_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) - $5.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).MoveFreeFloating($2[0], name) + yylex.(*Parser).setFreeFloating(name, freefloating.End, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $5.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -528,9 +530,9 @@ top_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) - $4.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Namespace, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $4.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -542,9 +544,9 @@ top_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.UseDeclarationList, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -556,9 +558,9 @@ top_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $4.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $4, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.UseDeclarationList, $4.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -570,9 +572,9 @@ top_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.UseDeclarationList, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -584,9 +586,9 @@ top_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $4.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $4, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.UseDeclarationList, $4.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -598,9 +600,9 @@ top_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -615,7 +617,7 @@ use_type: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -627,7 +629,7 @@ use_type: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -644,15 +646,14 @@ group_use_declaration: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $6)) // save comments - $2.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1[0], name) + yylex.(*Parser).setFreeFloating(name, freefloating.End, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Slash, $3.FreeFloating) if $5 != nil { - $5.Meta.SetTokenName(meta.CommaToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $5, meta.CommaToken) + yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, append($5.FreeFloating, append(yylex.(*Parser).GetFreeFloatingToken($5), $6.FreeFloating...)...)) + } else { + yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $6.FreeFloating) } - $6.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) - - $1[0].GetMeta().Cut(newInheritMetaFilter()).PrependTo(name.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -666,16 +667,15 @@ group_use_declaration: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $7)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) - yylex.(*Parser).appendMetaToken(name, $1, meta.NodeStart) - $2[0].GetMeta().Cut(newInheritMetaFilter()).AppendTo(name.GetMeta()) - $3.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo($$.GetMeta()) - $4.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.UseType, $1.FreeFloating) + yylex.(*Parser).MoveFreeFloating($2[0], name) + yylex.(*Parser).setFreeFloating(name, freefloating.End, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Slash, $4.FreeFloating) if $6 != nil { - $6.Meta.SetTokenName(meta.CommaToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $6, meta.CommaToken) + yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, append($6.FreeFloating, append(yylex.(*Parser).GetFreeFloatingToken($6), $7.FreeFloating...)...)) + } else { + yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $7.FreeFloating) } - $7.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -692,15 +692,14 @@ mixed_group_use_declaration: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $6)) // save comments - $2.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1[0], name) + yylex.(*Parser).setFreeFloating(name, freefloating.End, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Slash, $3.FreeFloating) if $5 != nil { - $5.Meta.SetTokenName(meta.CommaToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $5, meta.CommaToken) + yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, append($5.FreeFloating, append(yylex.(*Parser).GetFreeFloatingToken($5), $6.FreeFloating...)...)) + } else { + yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $6.FreeFloating) } - $6.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) - - $1[0].GetMeta().Cut(newInheritMetaFilter()).PrependTo(name.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -714,18 +713,15 @@ mixed_group_use_declaration: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $7)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) - yylex.(*Parser).appendMetaToken(name, $1, meta.NodeStart) - $2[0].GetMeta().Cut(newInheritMetaFilter()).AppendTo(name.GetMeta()) - $3.Meta.SetTokenName(meta.NsSeparatorToken).AppendTo($$.GetMeta()) - $4.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Use, append($1.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($1)...)) + yylex.(*Parser).MoveFreeFloating($2[0], name) + yylex.(*Parser).setFreeFloating(name, freefloating.End, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Slash, $4.FreeFloating) if $6 != nil { - $6.Meta.SetTokenName(meta.CommaToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $6, meta.CommaToken) + yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, append($6.FreeFloating, append(yylex.(*Parser).GetFreeFloatingToken($6), $7.FreeFloating...)...)) + } else { + yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $7.FreeFloating) } - $7.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) - - $2[0].GetMeta().Cut(newInheritMetaFilter()).PrependTo(name.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -748,7 +744,7 @@ inline_use_declarations: $$ = append($1, $3) // save comments - $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -766,7 +762,7 @@ unprefixed_use_declarations: $$ = append($1, $3) // save comments - $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -784,7 +780,7 @@ use_declarations: $$ = append($1, $3) // save comments - $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -801,16 +797,12 @@ inline_use_declaration: { $$ = $1 - $1.(*stmt.Use).Use.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | use_type unprefixed_use_declaration { $$ = $2.(*stmt.Use).SetUseType($1) - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -825,7 +817,8 @@ unprefixed_use_declaration: name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) - $1[0].GetMeta().Cut(newInheritMetaFilter()).PrependTo(name.GetMeta()) + // save comments + yylex.(*Parser).MoveFreeFloating($1[0], name) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -841,10 +834,9 @@ unprefixed_use_declaration: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.AsToken).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.NodeStart).AppendTo(alias.GetMeta()) - - $1[0].GetMeta().Cut(newInheritMetaFilter()).PrependTo(name.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1[0], name) + yylex.(*Parser).setFreeFloating(name, freefloating.End, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(alias, freefloating.Start, $3.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -855,7 +847,8 @@ use_declaration: { $$ = $1 - $1.(*stmt.Use).Use.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + // save coments + yylex.(*Parser).MoveFreeFloating($1.(*stmt.Use).Use, $$) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -864,9 +857,11 @@ use_declaration: $$ = $2; // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) - $2.(*stmt.Use).Use.GetMeta().Cut(newInheritMetaFilter()).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Slash, yylex.(*Parser).GetFreeFloatingToken($1)) + + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Slash, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -878,7 +873,7 @@ const_list: $$ = append($1, $3) // save comments - $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -895,7 +890,7 @@ inner_statement_list: { if inlineHtmlNode, ok := $2.(*stmt.InlineHtml); ok && len($1) > 0 { prevNode := lastNode($1) - yylex.(*Parser).splitSemicolonTokenAndPhpCloseTag(inlineHtmlNode, prevNode) + yylex.(*Parser).splitSemiColonAndPhpCloseTag(inlineHtmlNode, prevNode) } if $2 != nil { @@ -958,11 +953,11 @@ inner_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) - $4.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $4, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.HaltCompiller, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.OpenParenthesisToken, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.CloseParenthesisToken, $4.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -976,8 +971,8 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $3.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1008,9 +1003,9 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) - $4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.While, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $4.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1022,12 +1017,12 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $7)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.WhileToken).AppendTo($$.GetMeta()) - $4.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) - $6.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) - $7.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $7, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.While, $4.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $6.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Cond, $7.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($7)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1050,11 +1045,11 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $9)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) - $4.Meta.SetTokenName(meta.ForInitSemicolonToken).AppendTo($$.GetMeta()) - $6.Meta.SetTokenName(meta.ForCondSemicolonToken).AppendTo($$.GetMeta()) - $8.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.For, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.InitExpr, $4.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.CondExpr, $6.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.IncExpr, $8.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1075,9 +1070,9 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) - $4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Switch, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $4.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1089,9 +1084,9 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1103,9 +1098,9 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1117,9 +1112,9 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1131,9 +1126,9 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.VarList, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1145,9 +1140,9 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.VarList, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1159,10 +1154,10 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) - $3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Echo, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1174,7 +1169,7 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1186,10 +1181,9 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) // save comments - $2.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $2, meta.SemiColonToken) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($2)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1201,15 +1195,15 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $6)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Unset, $2.FreeFloating) if $4 != nil { - $4.Meta.SetTokenName(meta.CommaToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $4, meta.CommaToken) + yylex.(*Parser).setFreeFloating($$, freefloating.VarList, append($4.FreeFloating, append(yylex.(*Parser).GetFreeFloatingToken($4), $5.FreeFloating...)...)) + } else { + yylex.(*Parser).setFreeFloating($$, freefloating.VarList, $5.FreeFloating) } - $5.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) - $6.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $6, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating($$, freefloating.CloseParenthesisToken, $6.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($6)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1230,10 +1224,11 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $7)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) - $4.Meta.SetTokenName(meta.AsToken).AppendTo($$.GetMeta()) - $6.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Foreach, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $4.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Var, $6.FreeFloating) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1256,11 +1251,11 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $9)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) - $4.Meta.SetTokenName(meta.AsToken).AppendTo($$.GetMeta()) - $6.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo($$.GetMeta()) - $8.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Foreach, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $4.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Key, $6.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Var, $8.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1273,9 +1268,9 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) - $4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Declare, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.ConstList, $4.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1287,8 +1282,8 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1303,9 +1298,9 @@ statement: } // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) - $4.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Try, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $4.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1317,9 +1312,9 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1333,10 +1328,10 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.NodeStart).AppendTo(label.GetMeta()) - $3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating(label, freefloating.Start, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Label, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1350,8 +1345,8 @@ statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.ColonToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Label, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1376,13 +1371,13 @@ catch_list: catch.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($2, $9)) // save comments - $2.Meta.SetTokenName(meta.NodeStart).AppendTo(catch.GetMeta()) - $3.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(catch.GetMeta()) - $5.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) - $6.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(catch.GetMeta()) - $7.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(catch.GetMeta()) - $9.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(catch.GetMeta()) + yylex.(*Parser).setFreeFloating(catch, freefloating.Start, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(catch, freefloating.Catch, $3.FreeFloating) + yylex.(*Parser).setFreeFloating(variable, freefloating.Start, $5.FreeFloating) + yylex.(*Parser).addDollarToken(variable) + yylex.(*Parser).setFreeFloating(catch, freefloating.Var, $6.FreeFloating) + yylex.(*Parser).setFreeFloating(catch, freefloating.Cond, $7.FreeFloating) + yylex.(*Parser).setFreeFloating(catch, freefloating.Stmts, $9.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1399,7 +1394,7 @@ catch_name_list: $$ = append($1, $3) // save comments - $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1420,9 +1415,9 @@ finally_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) - $4.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Finally, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $4.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1440,7 +1435,7 @@ unset_variables: $$ = append($1, $3) // save comments - $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1467,15 +1462,25 @@ function_declaration_statement: // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) if $2 != nil { - $2.Meta.SetTokenName(meta.AmpersandToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Function, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(name, freefloating.Start, $3.FreeFloating) + } else { + yylex.(*Parser).setFreeFloating(name, freefloating.Start, $3.FreeFloating) + } + yylex.(*Parser).setFreeFloating($$, freefloating.Name, $5.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.ParamList, $7.FreeFloating) + if $8 != nil { + yylex.(*Parser).setFreeFloating($$, freefloating.Params, (*$8.GetFreeFloating())[freefloating.Colon]); delete((*$8.GetFreeFloating()), freefloating.Colon) + } + yylex.(*Parser).setFreeFloating($$, freefloating.ReturnType, $9.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $11.FreeFloating) + + // normalize + if $8 == nil { + yylex.(*Parser).setFreeFloating($$, freefloating.Params, (*$$.GetFreeFloating())[freefloating.ReturnType]); delete((*$$.GetFreeFloating()), freefloating.ReturnType) } - $3.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) - $5.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) - $7.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) - $9.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) - $11.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1514,12 +1519,11 @@ class_declaration_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewOptionalListTokensPosition($1, $2, $9)) // save comments - $2.Meta.SetTokenName(meta.ClassToken).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) - $7.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) - $9.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) - - $1[0].GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1[0], $$) + yylex.(*Parser).setFreeFloating($$, freefloating.ModifierList, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(name, freefloating.Start, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Name, $7.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $9.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1533,10 +1537,10 @@ class_declaration_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $8)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) - $6.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) - $8.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating(name, freefloating.Start, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Name, $6.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $8.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1566,7 +1570,7 @@ class_modifier: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1578,7 +1582,7 @@ class_modifier: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1595,10 +1599,10 @@ trait_declaration_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $6)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) - $4.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) - $6.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating(name, freefloating.Start, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Name, $4.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $6.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1615,10 +1619,10 @@ interface_declaration_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $7)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) - $5.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) - $7.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating(name, freefloating.Start, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Name, $5.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $7.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1639,7 +1643,7 @@ extends_from: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.ExtendsToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1660,7 +1664,7 @@ interface_extends_list: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.ExtendsToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1681,7 +1685,7 @@ implements_list: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.ImplementsToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1702,7 +1706,7 @@ foreach_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1714,9 +1718,9 @@ foreach_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) - $4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.List, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.ArrayPairList, $4.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1727,9 +1731,9 @@ foreach_variable: // save position $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo($$.GetMeta()) + // save commentsc + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.ArrayPairList, $3.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1755,10 +1759,10 @@ for_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $1.Meta.SetTokenName(meta.ColonToken).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.EndforToken).AppendTo($$.GetMeta()) - $4.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $4, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating($$, freefloating.Cond, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.AltEnd, $4.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1784,10 +1788,10 @@ foreach_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $1.Meta.SetTokenName(meta.ColonToken).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.EndforeachToken).AppendTo($$.GetMeta()) - $4.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $4, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating($$, freefloating.Cond, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.AltEnd, $4.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1813,10 +1817,10 @@ declare_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $1.Meta.SetTokenName(meta.ColonToken).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.EnddeclareToken).AppendTo($$.GetMeta()) - $4.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $4, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating($$, freefloating.Cond, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.AltEnd, $4.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1833,8 +1837,8 @@ switch_case_list: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(caseList.GetMeta()) - $3.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(caseList.GetMeta()) + yylex.(*Parser).setFreeFloating(caseList, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating(caseList, freefloating.CaseListEnd, $3.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1848,10 +1852,9 @@ switch_case_list: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $1.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(caseList.GetMeta()) - $2.Meta.SetTokenName(meta.CaseSeparatorToken).AppendTo(caseList.GetMeta()) - yylex.(*Parser).appendMetaToken(caseList, $2, meta.CaseSeparatorToken) - $4.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(caseList.GetMeta()) + yylex.(*Parser).setFreeFloating(caseList, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating(caseList, freefloating.CaseListStart, append($2.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating(caseList, freefloating.CaseListEnd, $4.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1865,10 +1868,10 @@ switch_case_list: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $1.Meta.SetTokenName(meta.ColonToken).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.EndswitchToken).AppendTo($$.GetMeta()) - $4.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $4, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating($$, freefloating.Cond, $1.FreeFloating) + yylex.(*Parser).setFreeFloating(caseList, freefloating.CaseListEnd, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.AltEnd, $4.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1883,12 +1886,11 @@ switch_case_list: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5)) // save comments - $1.Meta.SetTokenName(meta.ColonToken).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.CaseSeparatorToken).AppendTo(caseList.GetMeta()) - yylex.(*Parser).appendMetaToken(caseList, $2, meta.CaseSeparatorToken) - $4.Meta.SetTokenName(meta.EndswitchToken).AppendTo($$.GetMeta()) - $5.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $5, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating($$, freefloating.Cond, $1.FreeFloating) + yylex.(*Parser).setFreeFloating(caseList, freefloating.CaseListStart, append($2.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating(caseList, freefloating.CaseListEnd, $4.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.AltEnd, $5.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($5)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1910,9 +1912,9 @@ case_list: _case.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $5)) // save comments - $2.Meta.SetTokenName(meta.NodeStart).AppendTo(_case.GetMeta()) - $4.Meta.SetTokenName(meta.CaseSeparatorToken).AppendTo(_case.GetMeta()) - yylex.(*Parser).appendMetaToken(_case, $4, meta.CaseSeparatorToken) + yylex.(*Parser).setFreeFloating(_case, freefloating.Start, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(_case, freefloating.Expr, append($4.FreeFloating)) + yylex.(*Parser).setFreeFloating(_case, freefloating.CaseSeparator, yylex.(*Parser).GetFreeFloatingToken($4)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1925,9 +1927,9 @@ case_list: _default.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $4)) // save comments - $2.Meta.SetTokenName(meta.NodeStart).AppendTo(_default.GetMeta()) - $3.Meta.SetTokenName(meta.CaseSeparatorToken).AppendTo(_default.GetMeta()) - yylex.(*Parser).appendMetaToken(_default, $3, meta.CaseSeparatorToken) + yylex.(*Parser).setFreeFloating(_default, freefloating.Start, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(_default, freefloating.Default, $3.FreeFloating) + yylex.(*Parser).setFreeFloating(_default, freefloating.CaseSeparator, yylex.(*Parser).GetFreeFloatingToken($3)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1964,10 +1966,10 @@ while_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $1.Meta.SetTokenName(meta.ColonToken).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.EndwhileToken).AppendTo($$.GetMeta()) - $4.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $4, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating($$, freefloating.Cond, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.AltEnd, $4.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1982,9 +1984,9 @@ if_stmt_without_else: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) - $4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.If, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $4.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1998,9 +2000,9 @@ if_stmt_without_else: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $6)) // save comments - $2.Meta.SetTokenName(meta.NodeStart).AppendTo(_elseIf.GetMeta()) - $3.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(_elseIf.GetMeta()) - $5.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(_elseIf.GetMeta()) + yylex.(*Parser).setFreeFloating(_elseIf, freefloating.Start, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(_elseIf, freefloating.ElseIf, $3.FreeFloating) + yylex.(*Parser).setFreeFloating(_elseIf, freefloating.Expr, $5.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2023,7 +2025,7 @@ if_stmt: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.NodeStart).AppendTo(_else.GetMeta()) + yylex.(*Parser).setFreeFloating(_else, freefloating.Start, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2040,10 +2042,10 @@ alt_if_stmt_without_else: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $6)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) - $4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) - $5.Meta.SetTokenName(meta.ColonToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.If, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $4.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Cond, $5.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2058,10 +2060,10 @@ alt_if_stmt_without_else: _elseIf.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $7)) // save comments - $2.Meta.SetTokenName(meta.NodeStart).AppendTo(_elseIf.GetMeta()) - $3.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(_elseIf.GetMeta()) - $5.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(_elseIf.GetMeta()) - $6.Meta.SetTokenName(meta.ColonToken).AppendTo(_elseIf.GetMeta()) + yylex.(*Parser).setFreeFloating(_elseIf, freefloating.Start, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(_elseIf, freefloating.ElseIf, $3.FreeFloating) + yylex.(*Parser).setFreeFloating(_elseIf, freefloating.Expr, $5.FreeFloating) + yylex.(*Parser).setFreeFloating(_elseIf, freefloating.Cond, $6.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2076,9 +2078,9 @@ alt_if_stmt: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.EndifToken).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.AltEnd, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2094,11 +2096,11 @@ alt_if_stmt: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $6)) // save comments - $2.Meta.SetTokenName(meta.NodeStart).AppendTo(_else.GetMeta()) - $3.Meta.SetTokenName(meta.ColonToken).AppendTo(_else.GetMeta()) - $5.Meta.SetTokenName(meta.EndifToken).AppendTo($$.GetMeta()) - $6.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $6, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating(_else, freefloating.Start, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(_else, freefloating.Else, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $5.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.AltEnd, $6.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($6)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2131,7 +2133,7 @@ non_empty_parameter_list: $$ = append($1, $3) // save comments - $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2159,20 +2161,27 @@ parameter: // save comments if $1 != nil { - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) } if $2 != nil { - $2.Meta.SetTokenName(meta.AmpersandToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.OptionalType, $2.FreeFloating) } if $3 != nil { - $3.Meta.SetTokenName(meta.EllipsisToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Ampersand, $3.FreeFloating) } - if $1 == nil && $2 == nil && $3 == nil { - $4.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - } else { - $4.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Variadic, $4.FreeFloating) + yylex.(*Parser).addDollarToken(variable) + + // normalize + if $3 == nil { + yylex.(*Parser).setFreeFloating($$, freefloating.Ampersand, (*$$.GetFreeFloating())[freefloating.Variadic]); delete((*$$.GetFreeFloating()), freefloating.Variadic) + } + if $2 == nil { + yylex.(*Parser).setFreeFloating($$, freefloating.OptionalType, (*$$.GetFreeFloating())[freefloating.Ampersand]); delete((*$$.GetFreeFloating()), freefloating.Ampersand) + } + if $1 == nil { + yylex.(*Parser).setFreeFloating($$, freefloating.Start, (*$$.GetFreeFloating())[freefloating.OptionalType]); delete((*$$.GetFreeFloating()), freefloating.OptionalType) } - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2197,21 +2206,28 @@ parameter: // save comments if $1 != nil { - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) } if $2 != nil { - $2.Meta.SetTokenName(meta.AmpersandToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.OptionalType, $2.FreeFloating) } if $3 != nil { - $3.Meta.SetTokenName(meta.EllipsisToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Ampersand, $3.FreeFloating) } - if $1 == nil && $2 == nil && $3 == nil { - $4.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - } else { - $4.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Variadic, $4.FreeFloating) + yylex.(*Parser).addDollarToken(variable) + yylex.(*Parser).setFreeFloating($$, freefloating.Var, $5.FreeFloating) + + // normalize + if $3 == nil { + yylex.(*Parser).setFreeFloating($$, freefloating.Ampersand, (*$$.GetFreeFloating())[freefloating.Variadic]); delete((*$$.GetFreeFloating()), freefloating.Variadic) + } + if $2 == nil { + yylex.(*Parser).setFreeFloating($$, freefloating.OptionalType, (*$$.GetFreeFloating())[freefloating.Ampersand]); delete((*$$.GetFreeFloating()), freefloating.Ampersand) + } + if $1 == nil { + yylex.(*Parser).setFreeFloating($$, freefloating.Start, (*$$.GetFreeFloating())[freefloating.OptionalType]); delete((*$$.GetFreeFloating()), freefloating.OptionalType) } - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) - $5.Meta.SetTokenName(meta.EqualToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2247,7 +2263,7 @@ type_expr: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2262,7 +2278,7 @@ type: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2274,7 +2290,7 @@ type: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2298,7 +2314,7 @@ return_type: $$ = $2; // save comments - $1.Meta.SetTokenName(meta.ColonToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Colon, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2313,8 +2329,8 @@ argument_list: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.ArgumentList, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2326,12 +2342,12 @@ argument_list: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $1.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) if $3 != nil { - $3.Meta.SetTokenName(meta.CommaToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $3, meta.CommaToken) + yylex.(*Parser).setFreeFloating($$, freefloating.ArgumentList, append($3.FreeFloating, append(yylex.(*Parser).GetFreeFloatingToken($3), $4.FreeFloating...)...)) + } else { + yylex.(*Parser).setFreeFloating($$, freefloating.ArgumentList, $4.FreeFloating) } - $4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2349,7 +2365,7 @@ non_empty_argument_list: $$ = append($1, $3) // save comments - $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2364,7 +2380,7 @@ argument: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($1)) // save comments - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2376,7 +2392,7 @@ argument: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2388,7 +2404,7 @@ global_var_list: $$ = append($1, $3) // save comments - $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2415,7 +2431,7 @@ static_var_list: $$ = append($1, $3) // save comments - $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2440,8 +2456,8 @@ static_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).addDollarToken(variable) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2457,9 +2473,9 @@ static_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) - $2.Meta.SetTokenName(meta.EqualToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).addDollarToken(variable) + yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2489,10 +2505,9 @@ class_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $3)) // save comments - $3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken) - - $1[0].GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1[0], $$) + yylex.(*Parser).setFreeFloating($$, freefloating.PropertyList, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2504,11 +2519,14 @@ class_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewOptionalListTokensPosition($1, $2, $4)) // save comments - $2.Meta.SetTokenName(meta.ConstToken).AppendTo($$.GetMeta()) - $4.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $4, meta.SemiColonToken) - - + if len($1) > 0 { + yylex.(*Parser).MoveFreeFloating($1[0], $$) + yylex.(*Parser).setFreeFloating($$, freefloating.ModifierList, $2.FreeFloating) + } else { + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $2.FreeFloating) + } + yylex.(*Parser).setFreeFloating($$, freefloating.ConstList, $4.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2520,7 +2538,7 @@ class_statement: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2538,16 +2556,22 @@ class_statement: } // save comments - $2.Meta.SetTokenName(meta.FunctionToken).AppendTo($$.GetMeta()) - if $3 != nil { - $3.Meta.SetTokenName(meta.AmpersandToken).AppendTo($$.GetMeta()) - } - $4.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) - $6.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) - $8.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) - if len($1) > 0 { - $1[0].GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1[0], $$) + yylex.(*Parser).setFreeFloating($$, freefloating.ModifierList, $2.FreeFloating) + } else { + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $2.FreeFloating) + } + if $3 == nil { + yylex.(*Parser).setFreeFloating($$, freefloating.Function, $4.FreeFloating) + } else { + yylex.(*Parser).setFreeFloating($$, freefloating.Function, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Ampersand, $4.FreeFloating) + } + yylex.(*Parser).setFreeFloating($$, freefloating.Name, $6.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.ParameterList, $8.FreeFloating) + if $9 != nil { + yylex.(*Parser).setFreeFloating($$, freefloating.Params, (*$9.GetFreeFloating())[freefloating.Colon]); delete((*$9.GetFreeFloating()), freefloating.Colon) } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -2566,7 +2590,7 @@ name_list: $$ = append($1, $3) // save comments - $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2580,8 +2604,8 @@ trait_adaptations: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -2593,8 +2617,8 @@ trait_adaptations: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.AdaptationList, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2605,8 +2629,8 @@ trait_adaptations: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.AdaptationList, $3.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2633,8 +2657,8 @@ trait_adaptation: $$ = $1; // save comments - $2.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $2, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating($$, freefloating.NameList, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($2)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2643,8 +2667,8 @@ trait_adaptation: $$ = $1; // save comments - $2.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $2, meta.SemiColonToken) + yylex.(*Parser).setFreeFloating($$, freefloating.Alias, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($2)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2659,9 +2683,8 @@ trait_precedence: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeNodeListPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.InsteadofToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Ref, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2678,10 +2701,9 @@ trait_alias: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.AsToken).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.NodeStart).AppendTo(alias.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Ref, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(alias, freefloating.Start, $3.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2695,10 +2717,9 @@ trait_alias: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.AsToken).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.NodeStart).AppendTo(alias.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Ref, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(alias, freefloating.Start, $3.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2712,10 +2733,9 @@ trait_alias: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments - $2.Meta.SetTokenName(meta.AsToken).AppendTo($$.GetMeta()) - $4.Meta.SetTokenName(meta.NodeStart).AppendTo(alias.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Ref, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(alias, freefloating.Start, $4.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2727,9 +2747,8 @@ trait_alias: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.AsToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Ref, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2746,7 +2765,7 @@ trait_method_reference: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2769,10 +2788,9 @@ absolute_trait_method_reference: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.NodeStart).AppendTo(target.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Name, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(target, freefloating.Start, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2787,8 +2805,8 @@ method_body: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2800,8 +2818,8 @@ method_body: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $3.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2823,7 +2841,7 @@ variable_modifiers: modifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo(modifier.GetMeta()) + yylex.(*Parser).setFreeFloating(modifier, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2868,7 +2886,7 @@ member_modifier: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2880,7 +2898,7 @@ member_modifier: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2892,7 +2910,7 @@ member_modifier: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2904,7 +2922,7 @@ member_modifier: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2916,7 +2934,7 @@ member_modifier: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2928,7 +2946,7 @@ member_modifier: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2940,7 +2958,7 @@ property_list: $$ = append($1, $3) // save comments - $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2965,8 +2983,8 @@ property: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).addDollarToken(variable) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2982,9 +3000,9 @@ property: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) - $2.Meta.SetTokenName(meta.EqualToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).addDollarToken(variable) + yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2996,7 +3014,7 @@ class_const_list: $$ = append($1, $3) // save comments - $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3019,8 +3037,8 @@ class_const_decl: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.EqualToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Name, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3037,8 +3055,8 @@ const_decl: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.EqualToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Name, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3050,7 +3068,7 @@ echo_expr_list: $$ = append($1, $3) // save comments - $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3092,7 +3110,7 @@ non_empty_for_exprs: $$ = append($1, $3) // save comments - $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3117,9 +3135,9 @@ anonymous_class: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $8)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $6.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) - $8.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Name, $6.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $8.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3137,7 +3155,7 @@ new_expr: } // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3149,7 +3167,7 @@ new_expr: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3158,18 +3176,18 @@ new_expr: expr_without_variable: T_LIST '(' array_pair_list ')' '=' expr { - list := expr.NewList($3) - $$ = assign.NewAssign(list, $6) + listNode := expr.NewList($3) + $$ = assign.NewAssign(listNode, $6) // save position - list.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + listNode.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $6)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(list.GetMeta()) - $4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(list.GetMeta()) - $5.Meta.SetTokenName(meta.EqualToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating(listNode, freefloating.List, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(listNode, freefloating.ArrayPairList, $4.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Var, $5.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3183,9 +3201,9 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(shortList.GetMeta()) - $4.Meta.SetTokenName(meta.EqualToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating(shortList, freefloating.ArrayPairList, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Var, $4.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3197,9 +3215,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.EqualToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3211,10 +3228,9 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) // save comments - $2.Meta.SetTokenName(meta.EqualToken).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.AmpersandToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Equal, $3.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3226,7 +3242,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3238,9 +3254,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.PlusEqualToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3252,9 +3267,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.MinusEqualToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3266,9 +3280,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.MulEqualToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3280,9 +3293,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.PowEqualToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3294,9 +3306,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.DivEqualToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3308,9 +3319,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.ConcatEqualToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3322,9 +3332,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.ModEqualToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3336,9 +3345,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.AndEqualToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3350,9 +3358,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.OrEqualToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3364,9 +3371,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.XorEqualToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3378,9 +3384,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.SlEqualToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3392,9 +3397,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.SrEqualToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3406,9 +3410,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) // save comments - $2.Meta.SetTokenName(meta.IncToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3420,7 +3423,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3432,9 +3435,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) // save comments - $2.Meta.SetTokenName(meta.DecToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3446,7 +3448,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3458,9 +3460,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.BooleanOrToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3472,9 +3473,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.BooleanAndToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3486,9 +3486,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.LogicalOrToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3500,9 +3499,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.LogicalAndToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3514,9 +3512,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.LogicalXorToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3528,9 +3525,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.VerticalBarToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3542,9 +3538,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.AmpersandToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3556,9 +3551,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.CaretToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3570,9 +3564,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.DotToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3584,9 +3577,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.PlusToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3598,9 +3590,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.MinusToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3612,9 +3603,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.AsteriskToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3626,9 +3616,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.PowToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3640,9 +3629,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.SlashToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3654,9 +3642,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.PercentToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3668,9 +3655,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.SlToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3682,9 +3668,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.SrToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3696,7 +3681,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3708,7 +3693,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3720,7 +3705,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3732,7 +3717,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3744,9 +3729,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.IsIdenticalToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3758,9 +3742,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.IsNotIdenticalToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3772,9 +3755,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.IsEqualToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3786,10 +3768,9 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.IsNotEqualToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $2, meta.IsNotEqualToken) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Equal, yylex.(*Parser).GetFreeFloatingToken($2)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3801,9 +3782,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.LessToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3815,9 +3795,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.IsSmallerOrEqualToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3829,9 +3808,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.GreaterToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3843,9 +3821,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.IsGreaterOrEqualToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3857,9 +3834,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.SpaceshipToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3871,9 +3847,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.InstanceofToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3882,10 +3857,8 @@ expr_without_variable: $$ = $2; // save comments - yylex.(*Parser).prependMetaToken($$, $1, meta.NodeStart) - $1.Meta.SetTokenName(meta.NodeStart).PrependTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.NodeEnd).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $3, meta.NodeEnd) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, append($1.FreeFloating, append(yylex.(*Parser).GetFreeFloatingToken($1), (*$$.GetFreeFloating())[freefloating.Start]...)...)) + yylex.(*Parser).setFreeFloating($$, freefloating.End, append((*$$.GetFreeFloating())[freefloating.End], append($3.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($3)...)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3903,10 +3876,9 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $5)) // save comments - $2.Meta.SetTokenName(meta.QuestionMarkToken).AppendTo($$.GetMeta()) - $4.Meta.SetTokenName(meta.ColonToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Cond, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.True, $4.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3918,10 +3890,9 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) // save comments - $2.Meta.SetTokenName(meta.QuestionMarkToken).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.ColonToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Cond, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.True, $3.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3933,9 +3904,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.CoalesceToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3953,8 +3923,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Cast, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3966,8 +3936,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Cast, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3979,8 +3949,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Cast, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3992,8 +3962,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Cast, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4005,8 +3975,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Cast, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4018,8 +3988,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Cast, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4031,8 +4001,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Cast, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4059,7 +4029,7 @@ expr_without_variable: } // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4071,7 +4041,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4089,7 +4059,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4101,7 +4071,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4113,7 +4083,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4125,7 +4095,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4137,8 +4107,8 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $4)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $3.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4150,7 +4120,7 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4162,14 +4132,27 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $11)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - if $2 != nil { - $2.Meta.SetTokenName(meta.AmpersandToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + if $2 == nil { + yylex.(*Parser).setFreeFloating($$, freefloating.Function, $4.FreeFloating) + } else { + yylex.(*Parser).setFreeFloating($$, freefloating.Function, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Ampersand, $4.FreeFloating) + } + yylex.(*Parser).setFreeFloating($$, freefloating.ParameterList, $6.FreeFloating) + if $8 != nil { + yylex.(*Parser).setFreeFloating($$, freefloating.LexicalVars, (*$8.GetFreeFloating())[freefloating.Colon]); delete((*$8.GetFreeFloating()), freefloating.Colon) + } + yylex.(*Parser).setFreeFloating($$, freefloating.ReturnType, $9.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $11.FreeFloating) + + // normalize + if $8 == nil { + yylex.(*Parser).setFreeFloating($$, freefloating.LexicalVars, (*$$.GetFreeFloating())[freefloating.ReturnType]); delete((*$$.GetFreeFloating()), freefloating.ReturnType) + } + if $7 == nil { + yylex.(*Parser).setFreeFloating($$, freefloating.Params, (*$$.GetFreeFloating())[freefloating.LexicalVarList]); delete((*$$.GetFreeFloating()), freefloating.LexicalVarList) } - $4.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) - $6.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) - $9.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) - $11.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4181,15 +4164,28 @@ expr_without_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $12)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.FunctionToken).AppendTo($$.GetMeta()) - if $3 != nil { - $3.Meta.SetTokenName(meta.AmpersandToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Static, $2.FreeFloating) + if $3 == nil { + yylex.(*Parser).setFreeFloating($$, freefloating.Function, $5.FreeFloating) + } else { + yylex.(*Parser).setFreeFloating($$, freefloating.Function, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Ampersand, $5.FreeFloating) + } + yylex.(*Parser).setFreeFloating($$, freefloating.ParameterList, $7.FreeFloating) + if $9 != nil { + yylex.(*Parser).setFreeFloating($$, freefloating.LexicalVars, (*$9.GetFreeFloating())[freefloating.Colon]); delete((*$9.GetFreeFloating()), freefloating.Colon) + } + yylex.(*Parser).setFreeFloating($$, freefloating.ReturnType, $10.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $12.FreeFloating) + + // normalize + if $9 == nil { + yylex.(*Parser).setFreeFloating($$, freefloating.LexicalVars, (*$$.GetFreeFloating())[freefloating.ReturnType]); delete((*$$.GetFreeFloating()), freefloating.ReturnType) + } + if $8 == nil { + yylex.(*Parser).setFreeFloating($$, freefloating.Params, (*$$.GetFreeFloating())[freefloating.LexicalVarList]); delete((*$$.GetFreeFloating()), freefloating.LexicalVarList) } - $5.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) - $7.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) - $10.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta()) - $12.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4231,9 +4227,9 @@ lexical_vars: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) - $4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Use, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.LexicalVarList, $4.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4245,7 +4241,7 @@ lexical_var_list: $$ = append($1, $3) // save comments - $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4268,8 +4264,8 @@ lexical_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMeta($$, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).addDollarToken($$) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4285,9 +4281,9 @@ lexical_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.NodeStart).AppendTo(variable.GetMeta()) - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating(variable, freefloating.Start, $2.FreeFloating) + yylex.(*Parser).addDollarToken(variable) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4302,7 +4298,7 @@ function_call: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $2)) // save comments - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4314,8 +4310,8 @@ function_call: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) // save comments - $2.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo($$.GetMeta()) - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Name, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4327,8 +4323,8 @@ function_call: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) // save comments - $2.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo($$.GetMeta()) - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Name, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4338,7 +4334,9 @@ function_call: // save position $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $2)) - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4353,7 +4351,7 @@ class_name: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4395,10 +4393,8 @@ exit_expr: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - yylex.(*Parser).prependMetaToken($$, $1, meta.OpenParenthesisToken) - $1.Meta.SetTokenName(meta.OpenParenthesisToken).PrependTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $3, meta.CloseParenthesisToken) + yylex.(*Parser).setFreeFloating($$, freefloating.Exit, append($1.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($1)...)) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, append($3.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($3)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4413,7 +4409,11 @@ backticks_expr: } | T_ENCAPSED_AND_WHITESPACE { - $$ = []node.Node{scalar.NewEncapsedStringPart($1.Value)} + part := scalar.NewEncapsedStringPart($1.Value) + $$ = []node.Node{part} + + // save position + part.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4449,9 +4449,9 @@ dereferencable_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) - $4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Array, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.ArrayPairList, $4.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4463,8 +4463,8 @@ dereferencable_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.ArrayPairList, $3.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4476,7 +4476,7 @@ dereferencable_scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4491,7 +4491,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4503,7 +4503,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4515,7 +4515,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4527,7 +4527,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4539,7 +4539,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4551,7 +4551,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4563,7 +4563,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4575,7 +4575,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4587,7 +4587,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4599,11 +4599,11 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } - | T_START_HEREDOC T_ENCAPSED_AND_WHITESPACE T_END_HEREDOC + | T_START_HEREDOC T_ENCAPSED_AND_WHITESPACE T_END_HEREDOC { encapsed := scalar.NewEncapsedStringPart($2.Value) $$ = scalar.NewHeredoc($1.Value, []node.Node{encapsed}) @@ -4613,7 +4613,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4625,7 +4625,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4637,7 +4637,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4649,7 +4649,7 @@ scalar: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4676,7 +4676,7 @@ constant: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($1)) // save comments - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4690,10 +4690,9 @@ constant: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.NodeStart).AppendTo(target.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Name, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(target, freefloating.Start, $3.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4707,10 +4706,9 @@ constant: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.NodeStart).AppendTo(target.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Name, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(target, freefloating.Start, $3.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4767,10 +4765,8 @@ dereferencable: $$ = $2; // save comments - yylex.(*Parser).prependMetaToken($$, $1, meta.NodeStart) - $1.Meta.SetTokenName(meta.NodeStart).PrependTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.NodeEnd).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $3, meta.NodeEnd) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, append($1.FreeFloating, append(yylex.(*Parser).GetFreeFloatingToken($1), (*$$.GetFreeFloating())[freefloating.Start]...)...)) + yylex.(*Parser).setFreeFloating($$, freefloating.End, append((*$$.GetFreeFloating())[freefloating.End], append($3.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($3)...)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4794,10 +4790,8 @@ callable_expr: $$ = $2; // save comments - yylex.(*Parser).prependMetaToken($$, $1, meta.NodeStart) - $1.Meta.SetTokenName(meta.NodeStart).PrependTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.NodeEnd).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $3, meta.NodeEnd) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, append($1.FreeFloating, append(yylex.(*Parser).GetFreeFloatingToken($1), (*$$.GetFreeFloating())[freefloating.Start]...)...)) + yylex.(*Parser).setFreeFloating($$, freefloating.End, append((*$$.GetFreeFloating())[freefloating.End], append($3.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($3)...)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4824,12 +4818,9 @@ callable_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments - yylex.(*Parser).prependMetaToken($$, $2, meta.OpenSquareBracket) - $2.Meta.SetTokenName(meta.OpenSquareBracket).PrependTo($$.GetMeta()) - $4.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $4, meta.CloseSquareBracket) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Var, append($2.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, append($4.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($4)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4841,12 +4832,9 @@ callable_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments - yylex.(*Parser).prependMetaToken($$, $2, meta.OpenSquareBracket) - $2.Meta.SetTokenName(meta.OpenSquareBracket).PrependTo($$.GetMeta()) - $4.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $4, meta.CloseSquareBracket) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Var, append($2.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, append($4.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($4)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4858,12 +4846,9 @@ callable_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments - yylex.(*Parser).prependMetaToken($$, $2, meta.OpenCurlyBracesToken) - $2.Meta.SetTokenName(meta.OpenCurlyBracesToken).PrependTo($$.GetMeta()) - $4.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $4, meta.CloseCurlyBracesToken) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Var, append($2.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, append($4.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($4)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4875,9 +4860,8 @@ callable_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) // save comments - $2.Meta.SetTokenName(meta.ObjectOperatorToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4910,9 +4894,8 @@ variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.ObjectOperatorToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4929,8 +4912,8 @@ simple_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMeta($$, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).addDollarToken($$) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4942,12 +4925,10 @@ simple_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) - $2.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $2, meta.NodeStart) - $4.Meta.SetTokenName(meta.NodeEnd).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $4, meta.NodeEnd) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Dollar, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($3, freefloating.Start, append($2.FreeFloating, append(yylex.(*Parser).GetFreeFloatingToken($2), (*$3.GetFreeFloating())[freefloating.Start]...)...)) + yylex.(*Parser).setFreeFloating($3, freefloating.End, append((*$3.GetFreeFloating())[freefloating.End], append($4.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($4)...)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4959,8 +4940,8 @@ simple_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Dollar, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4975,9 +4956,8 @@ static_member: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Name, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4989,9 +4969,8 @@ static_member: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Name, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5012,12 +4991,9 @@ new_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments - yylex.(*Parser).prependMetaToken($$, $2, meta.OpenSquareBracket) - $2.Meta.SetTokenName(meta.OpenSquareBracket).PrependTo($$.GetMeta()) - $4.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $4, meta.CloseSquareBracket) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Var, append($2.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, append($4.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($4)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5029,12 +5005,9 @@ new_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments - yylex.(*Parser).prependMetaToken($$, $2, meta.OpenCurlyBracesToken) - $2.Meta.SetTokenName(meta.OpenCurlyBracesToken).PrependTo($$.GetMeta()) - $4.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $4, meta.CloseCurlyBracesToken) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Var, append($2.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, append($4.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($4)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5046,9 +5019,8 @@ new_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.ObjectOperatorToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5060,9 +5032,8 @@ new_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5074,9 +5045,8 @@ new_variable: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.PaamayimNekudotayimToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5091,7 +5061,7 @@ member_name: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5100,10 +5070,8 @@ member_name: $$ = $2; // save comments - yylex.(*Parser).prependMetaToken($$, $1, meta.NodeStart) - $1.Meta.SetTokenName(meta.NodeStart).PrependTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.NodeEnd).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $3, meta.NodeEnd) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, append($1.FreeFloating, append(yylex.(*Parser).GetFreeFloatingToken($1), (*$$.GetFreeFloating())[freefloating.Start]...)...)) + yylex.(*Parser).setFreeFloating($$, freefloating.End, append((*$$.GetFreeFloating())[freefloating.End], append($3.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($3)...)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5124,7 +5092,7 @@ property_name: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5133,10 +5101,8 @@ property_name: $$ = $2; // save comments - yylex.(*Parser).prependMetaToken($$, $1, meta.NodeStart) - $1.Meta.SetTokenName(meta.NodeStart).PrependTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.NodeEnd).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $3, meta.NodeEnd) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, append($1.FreeFloating, append(yylex.(*Parser).GetFreeFloatingToken($1), (*$$.GetFreeFloating())[freefloating.Start]...)...)) + yylex.(*Parser).setFreeFloating($$, freefloating.End, append((*$$.GetFreeFloating())[freefloating.End], append($3.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($3)...)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5182,7 +5148,7 @@ non_empty_array_pair_list: $$ = append($1, $3) // save comments - $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5207,9 +5173,8 @@ array_pair: $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - $2.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo($$.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5220,7 +5185,8 @@ array_pair: // save position $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($1)) - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5234,10 +5200,9 @@ array_pair: reference.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $4)) // save comments - $2.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.NodeStart).AppendTo(reference.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(reference, freefloating.Start, $3.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5251,44 +5216,43 @@ array_pair: reference.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr T_DOUBLE_ARROW T_LIST '(' array_pair_list ')' { // TODO: Cannot use list() as standalone expression - list := expr.NewList($5) - $$ = expr.NewArrayItem($1, list) + listNode := expr.NewList($5) + $$ = expr.NewArrayItem($1, listNode) // save position - list.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($3, $6)) + listNode.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($3, $6)) $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $6)) // save comments - $2.Meta.SetTokenName(meta.DoubleArrowToken).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.NodeStart).AppendTo(list.GetMeta()) - $4.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(list.GetMeta()) - $6.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(list.GetMeta()) - - $1.GetMeta().Cut(newInheritMetaFilter()).PrependTo($$.GetMeta()) + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(listNode, freefloating.Start, $3.FreeFloating) + yylex.(*Parser).setFreeFloating(listNode, freefloating.List, $4.FreeFloating) + yylex.(*Parser).setFreeFloating(listNode, freefloating.ArrayPairList, $6.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_LIST '(' array_pair_list ')' { // TODO: Cannot use list() as standalone expression - list := expr.NewList($3) - $$ = expr.NewArrayItem(nil, list) + listNode := expr.NewList($3) + $$ = expr.NewArrayItem(nil, listNode) // save position - list.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + listNode.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(list.GetMeta()) - $4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(list.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating(listNode, freefloating.List, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(listNode, freefloating.ArrayPairList, $4.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5310,7 +5274,7 @@ encaps_list: encapsed.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) // save comments - $2.Meta.SetTokenName(meta.NodeStart).AppendTo(encapsed.GetMeta()) + yylex.(*Parser).setFreeFloating(encapsed, freefloating.Start, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5329,7 +5293,7 @@ encaps_list: encapsed.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo(encapsed.GetMeta()) + yylex.(*Parser).setFreeFloating(encapsed, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5346,8 +5310,8 @@ encaps_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMeta($$, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).addDollarToken($$) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5363,11 +5327,9 @@ encaps_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) - $2.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $2, meta.OpenSquareBracket) - $4.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $4, meta.CloseSquareBracket) + yylex.(*Parser).addDollarToken(variable) + yylex.(*Parser).setFreeFloating($$, freefloating.Var, append($2.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, append($4.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($4)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5385,9 +5347,9 @@ encaps_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - yylex.(*Parser).appendMeta(variable, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) - $2.Meta.SetTokenName(meta.ObjectOperatorToken).AppendTo($$.GetMeta()) - $3.Meta.SetTokenName(meta.NodeStart).AppendTo(fetch.GetMeta()) + yylex.(*Parser).addDollarToken(variable) + yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(fetch, freefloating.Start, $3.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5401,9 +5363,8 @@ encaps_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) - $3.Meta.SetTokenName(meta.NodeEnd).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $3, meta.NodeEnd) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($$, freefloating.End, append($3.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($3)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5419,10 +5380,8 @@ encaps_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) - $2.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta()) - $3.Meta.SetTokenName(meta.NodeEnd).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $3, meta.NodeEnd) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($$, freefloating.End, append($3.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($3)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5438,13 +5397,10 @@ encaps_var: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $6)) // save comments - yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart) - $3.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $3, meta.OpenSquareBracket) - $5.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $5, meta.CloseSquareBracket) - $6.Meta.SetTokenName(meta.NodeEnd).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $6, meta.NodeEnd) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($$, freefloating.Var, append($3.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($3)...)) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, append($5.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($5)...)) + yylex.(*Parser).setFreeFloating($$, freefloating.End, append($6.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($6)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5453,9 +5409,8 @@ encaps_var: $$ = $2; // save comments - yylex.(*Parser).prependMetaToken($$, $1, meta.NodeStart) - $3.Meta.SetTokenName(meta.NodeEnd).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $3, meta.NodeEnd) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($$, freefloating.End, append($3.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($3)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5470,7 +5425,7 @@ encaps_var_offset: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5487,7 +5442,7 @@ encaps_var_offset: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5513,7 +5468,7 @@ encaps_var_offset: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5527,8 +5482,8 @@ encaps_var_offset: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMeta($$, &meta.Data{"$", meta.TokenType, nil, meta.NodeStart}, meta.NodeStart) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).addDollarToken($$) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5543,13 +5498,13 @@ internal_functions_in_yacc: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) - if $4 != nil { - $4.Meta.SetTokenName(meta.CommaToken).AppendTo($$.GetMeta()) - yylex.(*Parser).appendMetaToken($$, $4, meta.CommaToken) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Isset, $2.FreeFloating) + if $4 == nil { + yylex.(*Parser).setFreeFloating($$, freefloating.VarList, $5.FreeFloating) + } else { + yylex.(*Parser).setFreeFloating($$, freefloating.VarList, append($4.FreeFloating, append(yylex.(*Parser).GetFreeFloatingToken($4), $5.FreeFloating...)...)) } - $5.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5561,9 +5516,9 @@ internal_functions_in_yacc: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) - $4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Empty, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $4.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5575,7 +5530,7 @@ internal_functions_in_yacc: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5587,7 +5542,7 @@ internal_functions_in_yacc: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5599,9 +5554,9 @@ internal_functions_in_yacc: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) - $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) - $4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Eval, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $4.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5613,7 +5568,7 @@ internal_functions_in_yacc: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5625,7 +5580,7 @@ internal_functions_in_yacc: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) + yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5643,7 +5598,7 @@ isset_variables: $$ = append($1, $3) // save comments - $2.Meta.SetTokenName(meta.NodeEnd).AppendTo(lastNode($1).GetMeta()) + yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/php7/php7_test.go b/php7/php7_test.go index 57110e7..df49ce0 100644 --- a/php7/php7_test.go +++ b/php7/php7_test.go @@ -2,10 +2,10 @@ package php7_test import ( "bytes" - "reflect" "testing" - "github.com/kylelemons/godebug/pretty" + "gotest.tools/assert" + "github.com/z7zmey/php-parser/errors" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node/expr" @@ -19,19 +19,6 @@ import ( "github.com/z7zmey/php-parser/position" ) -func assertEqual(t *testing.T, expected interface{}, actual interface{}) { - if !reflect.DeepEqual(expected, actual) { - diff := pretty.Compare(expected, actual) - - if diff != "" { - t.Errorf("diff: (-expected +actual)\n%s", diff) - } else { - t.Errorf("expected and actual are not equal\n") - } - - } -} - func TestPhp7(t *testing.T) { src := ` 0 { - io.WriteString(p.w, "\\") - } + p.joinPrint("\\", nn.Parts) - p.Print(part) - } - - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printNameFullyQualified(n node.Node) { nn := n.(*name.FullyQualified) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) - for _, part := range nn.Parts { - io.WriteString(p.w, "\\") - p.Print(part) - } + io.WriteString(p.w, "\\") + p.joinPrint("\\", nn.Parts) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printNameRelative(n node.Node) { nn := n.(*name.Relative) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) + io.WriteString(p.w, "namespace") - p.printMeta(nn, meta.NsSeparatorToken) + p.printFreeFloating(nn, freefloating.Namespace) for _, part := range nn.Parts { io.WriteString(p.w, "\\") p.Print(part) } - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } // scalar func (p *Printer) printScalarLNumber(n node.Node) { nn := n.(*scalar.Lnumber) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) io.WriteString(p.w, nn.Value) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printScalarDNumber(n node.Node) { nn := n.(*scalar.Dnumber) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) io.WriteString(p.w, nn.Value) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printScalarString(n node.Node) { nn := n.(*scalar.String) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) io.WriteString(p.w, nn.Value) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printScalarEncapsedStringPart(n node.Node) { nn := n.(*scalar.EncapsedStringPart) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) io.WriteString(p.w, nn.Value) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printScalarEncapsed(n node.Node) { nn := n.(*scalar.Encapsed) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) io.WriteString(p.w, "\"") for _, part := range nn.Parts { switch part.(type) { case *expr.ArrayDimFetch: - if len(part.GetMeta().FindBy(meta.ValueFilter("${"))) == 1 { + s := (*part.GetFreeFloating())[freefloating.Start] + if len(s) > 0 && s[0].Value == "${" { p.printExprArrayDimFetchWithoutLeadingDollar(part) } else { p.Print(part) } case *expr.Variable: - if len(part.GetMeta().FindBy(meta.ValueFilter("${"))) == 1 { + s := (*part.GetFreeFloating())[freefloating.Start] + if len(s) > 0 && s[0].Value == "${" { p.printExprVariableWithoutLeadingDollar(part) } else { p.Print(part) @@ -628,12 +611,12 @@ func (p *Printer) printScalarEncapsed(n node.Node) { } io.WriteString(p.w, "\"") - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printScalarHeredoc(n node.Node) { nn := n.(*scalar.Heredoc) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) io.WriteString(p.w, "<<<") io.WriteString(p.w, nn.Label) @@ -642,13 +625,15 @@ func (p *Printer) printScalarHeredoc(n node.Node) { for _, part := range nn.Parts { switch part.(type) { case *expr.ArrayDimFetch: - if len(part.GetMeta().FindBy(meta.ValueFilter("${"))) == 1 { + s := (*part.GetFreeFloating())[freefloating.Start] + if len(s) > 0 && s[0].Value == "${" { p.printExprArrayDimFetchWithoutLeadingDollar(part) } else { p.Print(part) } case *expr.Variable: - if len(part.GetMeta().FindBy(meta.ValueFilter("${"))) == 1 { + s := (*part.GetFreeFloating())[freefloating.Start] + if len(s) > 0 && s[0].Value == "${" { p.printExprVariableWithoutLeadingDollar(part) } else { p.Print(part) @@ -661,1337 +646,1360 @@ func (p *Printer) printScalarHeredoc(n node.Node) { io.WriteString(p.w, "\n") io.WriteString(p.w, strings.Trim(nn.Label, "\"'")) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printScalarMagicConstant(n node.Node) { nn := n.(*scalar.MagicConstant) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) io.WriteString(p.w, nn.Value) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } // Assign func (p *Printer) printAssign(n node.Node) { nn := n.(*assign.Assign) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) p.Print(nn.Variable) - p.printMeta(nn, meta.EqualToken) + p.printFreeFloating(nn, freefloating.Var) io.WriteString(p.w, "=") p.Print(nn.Expression) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printAssignReference(n node.Node) { nn := n.(*assign.Reference) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) p.Print(nn.Variable) - p.printMeta(nn, meta.EqualToken) + p.printFreeFloating(nn, freefloating.Var) io.WriteString(p.w, "=") - p.printMeta(nn, meta.AmpersandToken) + p.printFreeFloating(nn, freefloating.Equal) io.WriteString(p.w, "&") p.Print(nn.Expression) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printAssignBitwiseAnd(n node.Node) { nn := n.(*assign.BitwiseAnd) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) p.Print(nn.Variable) - p.printMeta(nn, meta.AndEqualToken) + p.printFreeFloating(nn, freefloating.Var) io.WriteString(p.w, "&") io.WriteString(p.w, "=") p.Print(nn.Expression) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printAssignBitwiseOr(n node.Node) { nn := n.(*assign.BitwiseOr) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) p.Print(nn.Variable) - p.printMeta(nn, meta.OrEqualToken) + p.printFreeFloating(nn, freefloating.Var) io.WriteString(p.w, "|=") p.Print(nn.Expression) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printAssignBitwiseXor(n node.Node) { nn := n.(*assign.BitwiseXor) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) p.Print(nn.Variable) - p.printMeta(nn, meta.XorEqualToken) + p.printFreeFloating(nn, freefloating.Var) io.WriteString(p.w, "^=") p.Print(nn.Expression) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printAssignConcat(n node.Node) { nn := n.(*assign.Concat) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) p.Print(nn.Variable) - p.printMeta(nn, meta.ConcatEqualToken) + p.printFreeFloating(nn, freefloating.Var) io.WriteString(p.w, ".=") p.Print(nn.Expression) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printAssignDiv(n node.Node) { nn := n.(*assign.Div) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) p.Print(nn.Variable) - p.printMeta(nn, meta.DivEqualToken) + p.printFreeFloating(nn, freefloating.Var) io.WriteString(p.w, "/=") p.Print(nn.Expression) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printAssignMinus(n node.Node) { nn := n.(*assign.Minus) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) p.Print(nn.Variable) - p.printMeta(nn, meta.MinusEqualToken) + p.printFreeFloating(nn, freefloating.Var) io.WriteString(p.w, "-=") p.Print(nn.Expression) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printAssignMod(n node.Node) { nn := n.(*assign.Mod) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) p.Print(nn.Variable) - p.printMeta(nn, meta.ModEqualToken) + p.printFreeFloating(nn, freefloating.Var) io.WriteString(p.w, "%=") p.Print(nn.Expression) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printAssignMul(n node.Node) { nn := n.(*assign.Mul) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) p.Print(nn.Variable) - p.printMeta(nn, meta.MulEqualToken) + p.printFreeFloating(nn, freefloating.Var) io.WriteString(p.w, "*=") p.Print(nn.Expression) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printAssignPlus(n node.Node) { nn := n.(*assign.Plus) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) p.Print(nn.Variable) - p.printMeta(nn, meta.PlusEqualToken) + p.printFreeFloating(nn, freefloating.Var) io.WriteString(p.w, "+=") p.Print(nn.Expression) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printAssignPow(n node.Node) { nn := n.(*assign.Pow) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) p.Print(nn.Variable) - p.printMeta(nn, meta.PowEqualToken) + p.printFreeFloating(nn, freefloating.Var) io.WriteString(p.w, "**=") p.Print(nn.Expression) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printAssignShiftLeft(n node.Node) { nn := n.(*assign.ShiftLeft) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) p.Print(nn.Variable) - p.printMeta(nn, meta.SlEqualToken) + p.printFreeFloating(nn, freefloating.Var) io.WriteString(p.w, "<<=") p.Print(nn.Expression) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printAssignShiftRight(n node.Node) { nn := n.(*assign.ShiftRight) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) p.Print(nn.Variable) - p.printMeta(nn, meta.SrEqualToken) + p.printFreeFloating(nn, freefloating.Var) io.WriteString(p.w, ">>=") p.Print(nn.Expression) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } // binary func (p *Printer) printBinaryBitwiseAnd(n node.Node) { nn := n.(*binary.BitwiseAnd) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) p.Print(nn.Left) - p.printMeta(nn, meta.AmpersandToken) + p.printFreeFloating(nn, freefloating.Expr) io.WriteString(p.w, "&") p.Print(nn.Right) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printBinaryBitwiseOr(n node.Node) { nn := n.(*binary.BitwiseOr) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) p.Print(nn.Left) - p.printMeta(nn, meta.VerticalBarToken) + p.printFreeFloating(nn, freefloating.Expr) io.WriteString(p.w, "|") p.Print(nn.Right) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printBinaryBitwiseXor(n node.Node) { nn := n.(*binary.BitwiseXor) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) p.Print(nn.Left) - p.printMeta(nn, meta.CaretToken) + p.printFreeFloating(nn, freefloating.Expr) io.WriteString(p.w, "^") p.Print(nn.Right) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printBinaryBooleanAnd(n node.Node) { nn := n.(*binary.BooleanAnd) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) p.Print(nn.Left) - p.printMeta(nn, meta.BooleanAndToken) + p.printFreeFloating(nn, freefloating.Expr) io.WriteString(p.w, "&&") p.Print(nn.Right) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printBinaryBooleanOr(n node.Node) { nn := n.(*binary.BooleanOr) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) p.Print(nn.Left) - p.printMeta(nn, meta.BooleanOrToken) + p.printFreeFloating(nn, freefloating.Expr) io.WriteString(p.w, "||") p.Print(nn.Right) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printBinaryCoalesce(n node.Node) { nn := n.(*binary.Coalesce) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) p.Print(nn.Left) - p.printMeta(nn, meta.CoalesceToken) + p.printFreeFloating(nn, freefloating.Expr) io.WriteString(p.w, "??") p.Print(nn.Right) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printBinaryConcat(n node.Node) { nn := n.(*binary.Concat) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) p.Print(nn.Left) - p.printMeta(nn, meta.DotToken) + p.printFreeFloating(nn, freefloating.Expr) io.WriteString(p.w, ".") p.Print(nn.Right) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printBinaryDiv(n node.Node) { nn := n.(*binary.Div) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) p.Print(nn.Left) - p.printMeta(nn, meta.SlashToken) + p.printFreeFloating(nn, freefloating.Expr) io.WriteString(p.w, "/") p.Print(nn.Right) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printBinaryEqual(n node.Node) { nn := n.(*binary.Equal) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) p.Print(nn.Left) - p.printMeta(nn, meta.IsEqualToken) + p.printFreeFloating(nn, freefloating.Expr) io.WriteString(p.w, "==") p.Print(nn.Right) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printBinaryGreaterOrEqual(n node.Node) { nn := n.(*binary.GreaterOrEqual) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) p.Print(nn.Left) - p.printMeta(nn, meta.IsGreaterOrEqualToken) + p.printFreeFloating(nn, freefloating.Expr) io.WriteString(p.w, ">=") p.Print(nn.Right) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printBinaryGreater(n node.Node) { nn := n.(*binary.Greater) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) p.Print(nn.Left) - p.printMeta(nn, meta.GreaterToken) + p.printFreeFloating(nn, freefloating.Expr) io.WriteString(p.w, ">") p.Print(nn.Right) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printBinaryIdentical(n node.Node) { nn := n.(*binary.Identical) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) p.Print(nn.Left) - p.printMeta(nn, meta.IsIdenticalToken) + p.printFreeFloating(nn, freefloating.Expr) io.WriteString(p.w, "===") p.Print(nn.Right) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printBinaryLogicalAnd(n node.Node) { nn := n.(*binary.LogicalAnd) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) p.Print(nn.Left) - if len((*nn.GetMeta())) == 0 { + p.printFreeFloating(nn, freefloating.Expr) + if nn.GetFreeFloating().IsEmpty() { io.WriteString(p.w, " ") } - p.printMeta(nn, meta.LogicalAndToken) io.WriteString(p.w, "and") - if len((*nn.Right.GetMeta())) == 0 { + if nn.Right.GetFreeFloating().IsEmpty() { io.WriteString(p.w, " ") } p.Print(nn.Right) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printBinaryLogicalOr(n node.Node) { nn := n.(*binary.LogicalOr) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) p.Print(nn.Left) - if len((*nn.GetMeta())) == 0 { + p.printFreeFloating(nn, freefloating.Expr) + if nn.GetFreeFloating().IsEmpty() { io.WriteString(p.w, " ") } - p.printMeta(nn, meta.LogicalOrToken) io.WriteString(p.w, "or") - if len((*nn.Right.GetMeta())) == 0 { + if nn.Right.GetFreeFloating().IsEmpty() { io.WriteString(p.w, " ") } p.Print(nn.Right) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printBinaryLogicalXor(n node.Node) { nn := n.(*binary.LogicalXor) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) p.Print(nn.Left) - if len((*nn.GetMeta())) == 0 { + p.printFreeFloating(nn, freefloating.Expr) + if nn.GetFreeFloating().IsEmpty() { io.WriteString(p.w, " ") } - p.printMeta(nn, meta.LogicalXorToken) io.WriteString(p.w, "xor") - if len((*nn.Right.GetMeta())) == 0 { + if nn.Right.GetFreeFloating().IsEmpty() { io.WriteString(p.w, " ") } p.Print(nn.Right) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printBinaryMinus(n node.Node) { nn := n.(*binary.Minus) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) p.Print(nn.Left) - p.printMeta(nn, meta.MinusToken) + p.printFreeFloating(nn, freefloating.Expr) io.WriteString(p.w, "-") p.Print(nn.Right) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printBinaryMod(n node.Node) { nn := n.(*binary.Mod) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) p.Print(nn.Left) - p.printMeta(nn, meta.PercentToken) + p.printFreeFloating(nn, freefloating.Expr) io.WriteString(p.w, "%") p.Print(nn.Right) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printBinaryMul(n node.Node) { nn := n.(*binary.Mul) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) p.Print(nn.Left) - p.printMeta(nn, meta.AsteriskToken) + p.printFreeFloating(nn, freefloating.Expr) io.WriteString(p.w, "*") p.Print(nn.Right) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printBinaryNotEqual(n node.Node) { nn := n.(*binary.NotEqual) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) p.Print(nn.Left) - if len((*n.GetMeta())) == 0 { + p.printFreeFloating(nn, freefloating.Expr) + p.printFreeFloating(nn, freefloating.Equal) + if nn.GetFreeFloating().IsEmpty() { io.WriteString(p.w, "!=") } - p.printMeta(nn, meta.IsNotEqualToken) p.Print(nn.Right) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printBinaryNotIdentical(n node.Node) { nn := n.(*binary.NotIdentical) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) p.Print(nn.Left) - p.printMeta(nn, meta.IsNotIdenticalToken) + p.printFreeFloating(nn, freefloating.Expr) io.WriteString(p.w, "!==") p.Print(nn.Right) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printBinaryPlus(n node.Node) { nn := n.(*binary.Plus) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) p.Print(nn.Left) - p.printMeta(nn, meta.PlusToken) + p.printFreeFloating(nn, freefloating.Expr) io.WriteString(p.w, "+") p.Print(nn.Right) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printBinaryPow(n node.Node) { nn := n.(*binary.Pow) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) p.Print(nn.Left) - p.printMeta(nn, meta.PowToken) + p.printFreeFloating(nn, freefloating.Expr) io.WriteString(p.w, "**") p.Print(nn.Right) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printBinaryShiftLeft(n node.Node) { nn := n.(*binary.ShiftLeft) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) p.Print(nn.Left) - p.printMeta(nn, meta.SlToken) + p.printFreeFloating(nn, freefloating.Expr) io.WriteString(p.w, "<<") p.Print(nn.Right) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printBinaryShiftRight(n node.Node) { nn := n.(*binary.ShiftRight) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) p.Print(nn.Left) - p.printMeta(nn, meta.SrToken) + p.printFreeFloating(nn, freefloating.Expr) io.WriteString(p.w, ">>") p.Print(nn.Right) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printBinarySmallerOrEqual(n node.Node) { nn := n.(*binary.SmallerOrEqual) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) p.Print(nn.Left) - p.printMeta(nn, meta.IsSmallerOrEqualToken) + p.printFreeFloating(nn, freefloating.Expr) io.WriteString(p.w, "<=") p.Print(nn.Right) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printBinarySmaller(n node.Node) { nn := n.(*binary.Smaller) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) p.Print(nn.Left) - p.printMeta(nn, meta.LessToken) + p.printFreeFloating(nn, freefloating.Expr) io.WriteString(p.w, "<") p.Print(nn.Right) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printBinarySpaceship(n node.Node) { nn := n.(*binary.Spaceship) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) p.Print(nn.Left) - p.printMeta(nn, meta.SpaceshipToken) + p.printFreeFloating(nn, freefloating.Expr) io.WriteString(p.w, "<=>") p.Print(nn.Right) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } // cast func (p *Printer) printArray(n node.Node) { nn := n.(*cast.Array) - p.printMeta(nn, meta.NodeStart) - if len((*n.GetMeta())) == 0 { + p.printFreeFloating(nn, freefloating.Start) + + p.printFreeFloating(nn, freefloating.Cast) + if nn.GetFreeFloating().IsEmpty() { io.WriteString(p.w, "(array)") } + p.Print(nn.Expr) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printBool(n node.Node) { nn := n.(*cast.Bool) - p.printMeta(nn, meta.NodeStart) - if len((*n.GetMeta())) == 0 { + p.printFreeFloating(nn, freefloating.Start) + + p.printFreeFloating(nn, freefloating.Cast) + if nn.GetFreeFloating().IsEmpty() { io.WriteString(p.w, "(boolean)") } + p.Print(nn.Expr) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printDouble(n node.Node) { nn := n.(*cast.Double) - p.printMeta(nn, meta.NodeStart) - if len((*n.GetMeta())) == 0 { + p.printFreeFloating(nn, freefloating.Start) + + p.printFreeFloating(nn, freefloating.Cast) + if nn.GetFreeFloating().IsEmpty() { io.WriteString(p.w, "(float)") } + p.Print(nn.Expr) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printInt(n node.Node) { nn := n.(*cast.Int) - p.printMeta(nn, meta.NodeStart) - if len((*n.GetMeta())) == 0 { + p.printFreeFloating(nn, freefloating.Start) + + p.printFreeFloating(nn, freefloating.Cast) + if nn.GetFreeFloating().IsEmpty() { io.WriteString(p.w, "(integer)") } + p.Print(nn.Expr) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printObject(n node.Node) { nn := n.(*cast.Object) - p.printMeta(nn, meta.NodeStart) - if len((*n.GetMeta())) == 0 { + p.printFreeFloating(nn, freefloating.Start) + + p.printFreeFloating(nn, freefloating.Cast) + if nn.GetFreeFloating().IsEmpty() { io.WriteString(p.w, "(object)") } + p.Print(nn.Expr) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printString(n node.Node) { nn := n.(*cast.String) - p.printMeta(nn, meta.NodeStart) - if len((*n.GetMeta())) == 0 { + p.printFreeFloating(nn, freefloating.Start) + + p.printFreeFloating(nn, freefloating.Cast) + if nn.GetFreeFloating().IsEmpty() { io.WriteString(p.w, "(string)") } + p.Print(nn.Expr) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printUnset(n node.Node) { nn := n.(*cast.Unset) - p.printMeta(nn, meta.NodeStart) - if len((*n.GetMeta())) == 0 { + p.printFreeFloating(nn, freefloating.Start) + + p.printFreeFloating(nn, freefloating.Cast) + if nn.GetFreeFloating().IsEmpty() { io.WriteString(p.w, "(unset)") } + p.Print(nn.Expr) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } // expr func (p *Printer) printExprArrayDimFetch(n node.Node) { nn := n.(*expr.ArrayDimFetch) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) p.Print(nn.Variable) - p.printMeta(nn, meta.OpenSquareBracket) - p.printMeta(nn, meta.OpenCurlyBracesToken) - if len((*n.GetMeta())) == 0 { + p.printFreeFloating(nn, freefloating.Var) + if nn.GetFreeFloating().IsEmpty() { io.WriteString(p.w, "[") } p.Print(nn.Dim) - p.printMeta(nn, meta.CloseSquareBracket) - p.printMeta(nn, meta.CloseCurlyBracesToken) - if len((*n.GetMeta())) == 0 { + p.printFreeFloating(nn, freefloating.Expr) + if nn.GetFreeFloating().IsEmpty() { io.WriteString(p.w, "]") } - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printExprArrayDimFetchWithoutLeadingDollar(n node.Node) { nn := n.(*expr.ArrayDimFetch) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) p.printExprVariableWithoutLeadingDollar(nn.Variable) - p.printMeta(nn, meta.OpenSquareBracket) - p.printMeta(nn, meta.OpenCurlyBracesToken) - if len((*n.GetMeta())) == 0 { + p.printFreeFloating(nn, freefloating.Var) + if nn.GetFreeFloating().IsEmpty() { io.WriteString(p.w, "[") } p.Print(nn.Dim) - p.printMeta(nn, meta.CloseSquareBracket) - p.printMeta(nn, meta.CloseCurlyBracesToken) - if len((*n.GetMeta())) == 0 { + p.printFreeFloating(nn, freefloating.Expr) + if nn.GetFreeFloating().IsEmpty() { io.WriteString(p.w, "]") } - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printExprArrayItem(n node.Node) { nn := n.(*expr.ArrayItem) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) if nn.Key != nil { p.Print(nn.Key) - p.printMeta(nn, meta.DoubleArrowToken) + p.printFreeFloating(nn, freefloating.Expr) io.WriteString(p.w, "=>") } p.Print(nn.Val) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printExprArray(n node.Node) { nn := n.(*expr.Array) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) io.WriteString(p.w, "array") - p.printMeta(nn, meta.OpenParenthesisToken) + p.printFreeFloating(nn, freefloating.Array) io.WriteString(p.w, "(") p.joinPrint(",", nn.Items) - p.printMeta(nn, meta.CloseParenthesisToken) + p.printFreeFloating(nn, freefloating.ArrayPairList) io.WriteString(p.w, ")") - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printExprBitwiseNot(n node.Node) { nn := n.(*expr.BitwiseNot) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) io.WriteString(p.w, "~") p.Print(nn.Expr) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printExprBooleanNot(n node.Node) { nn := n.(*expr.BooleanNot) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) io.WriteString(p.w, "!") p.Print(nn.Expr) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printExprClassConstFetch(n node.Node) { nn := n.(*expr.ClassConstFetch) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) p.Print(nn.Class) - p.printMeta(nn, meta.PaamayimNekudotayimToken) + p.printFreeFloating(nn, freefloating.Name) io.WriteString(p.w, "::") p.Print(nn.ConstantName) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printExprClone(n node.Node) { nn := n.(*expr.Clone) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) io.WriteString(p.w, "clone") - if len((*nn.Expr.GetMeta())) == 0 { + if nn.Expr.GetFreeFloating().IsEmpty() { io.WriteString(p.w, " ") } p.Print(nn.Expr) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printExprClosureUse(n node.Node) { nn := n.(*expr.ClosureUse) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) io.WriteString(p.w, "use") - p.printMeta(nn, meta.OpenParenthesisToken) + p.printFreeFloating(nn, freefloating.Use) io.WriteString(p.w, "(") p.joinPrint(",", nn.Uses) - p.printMeta(nn, meta.CloseParenthesisToken) + p.printFreeFloating(nn, freefloating.LexicalVarList) io.WriteString(p.w, ")") - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printExprClosure(n node.Node) { nn := n.(*expr.Closure) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) if nn.Static { io.WriteString(p.w, "static") } - - if nn.Static && len(n.GetMeta().FindBy(meta.TypeFilter(meta.WhiteSpaceType))) == 0 { + p.printFreeFloating(nn, freefloating.Static) + if nn.Static && n.GetFreeFloating().IsEmpty() { io.WriteString(p.w, " ") } - p.printMeta(nn, meta.FunctionToken) io.WriteString(p.w, "function") + p.printFreeFloating(nn, freefloating.Function) if nn.ReturnsRef { - p.printMeta(nn, meta.AmpersandToken) io.WriteString(p.w, "&") } + p.printFreeFloating(nn, freefloating.Ampersand) - p.printMeta(nn, meta.OpenParenthesisToken) io.WriteString(p.w, "(") p.joinPrint(",", nn.Params) - p.printMeta(nn, meta.CloseParenthesisToken) + p.printFreeFloating(nn, freefloating.ParameterList) io.WriteString(p.w, ")") + p.printFreeFloating(nn, freefloating.Params) if nn.ClosureUse != nil { p.Print(nn.ClosureUse) } + p.printFreeFloating(nn, freefloating.LexicalVars) if nn.ReturnType != nil { - p.printMeta(nn.ReturnType, meta.ColonToken) io.WriteString(p.w, ":") p.Print(nn.ReturnType) } + p.printFreeFloating(nn, freefloating.ReturnType) - p.printMeta(nn, meta.OpenCurlyBracesToken) io.WriteString(p.w, "{") p.printNodes(nn.Stmts) - p.printMeta(nn, meta.CloseCurlyBracesToken) + p.printFreeFloating(nn, freefloating.Stmts) io.WriteString(p.w, "}") - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printExprConstFetch(n node.Node) { nn := n.(*expr.ConstFetch) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) p.Print(nn.Constant) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printExprEmpty(n node.Node) { nn := n.(*expr.Empty) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) io.WriteString(p.w, "empty") - p.printMeta(nn, meta.OpenParenthesisToken) + p.printFreeFloating(nn, freefloating.Empty) io.WriteString(p.w, "(") p.Print(nn.Expr) - p.printMeta(nn, meta.CloseParenthesisToken) + p.printFreeFloating(nn, freefloating.Expr) io.WriteString(p.w, ")") - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printExprErrorSuppress(n node.Node) { nn := n.(*expr.ErrorSuppress) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) io.WriteString(p.w, "@") p.Print(nn.Expr) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printExprEval(n node.Node) { nn := n.(*expr.Eval) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) io.WriteString(p.w, "eval") - p.printMeta(nn, meta.OpenParenthesisToken) + p.printFreeFloating(nn, freefloating.Eval) io.WriteString(p.w, "(") p.Print(nn.Expr) - p.printMeta(nn, meta.CloseParenthesisToken) + p.printFreeFloating(nn, freefloating.Expr) io.WriteString(p.w, ")") - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printExprExit(n node.Node) { nn := n.(*expr.Exit) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) if nn.Die { io.WriteString(p.w, "die") } else { io.WriteString(p.w, "exit") } + p.printFreeFloating(nn, freefloating.Exit) - p.printMeta(nn, meta.OpenParenthesisToken) - if len((*nn.GetMeta())) == 0 && nn.Expr != nil && len((*nn.Expr.GetMeta())) == 0 { + if nn.Expr != nil && nn.Expr.GetFreeFloating().IsEmpty() && nn.GetFreeFloating().IsEmpty() { io.WriteString(p.w, " ") } p.Print(nn.Expr) - p.printMeta(nn, meta.CloseParenthesisToken) + p.printFreeFloating(nn, freefloating.Expr) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printExprFunctionCall(n node.Node) { nn := n.(*expr.FunctionCall) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) p.Print(nn.Function) - p.printMeta(nn.ArgumentList, meta.OpenParenthesisToken) + + p.printFreeFloating(nn.ArgumentList, freefloating.Start) io.WriteString(p.w, "(") p.joinPrint(",", nn.ArgumentList.Arguments) - p.printMeta(nn.ArgumentList, meta.CommaToken) - p.printMeta(nn.ArgumentList, meta.CloseParenthesisToken) + p.printFreeFloating(nn.ArgumentList, freefloating.ArgumentList) io.WriteString(p.w, ")") + p.printFreeFloating(nn.ArgumentList, freefloating.End) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printExprInclude(n node.Node) { nn := n.(*expr.Include) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) io.WriteString(p.w, "include") - if len((*nn.Expr.GetMeta())) == 0 { + if nn.Expr.GetFreeFloating().IsEmpty() { io.WriteString(p.w, " ") } p.Print(nn.Expr) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printExprIncludeOnce(n node.Node) { nn := n.(*expr.IncludeOnce) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) io.WriteString(p.w, "include_once") - if len((*nn.Expr.GetMeta())) == 0 { + if nn.Expr.GetFreeFloating().IsEmpty() { io.WriteString(p.w, " ") } p.Print(nn.Expr) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printExprInstanceOf(n node.Node) { nn := n.(*expr.InstanceOf) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) p.Print(nn.Expr) - p.printMeta(nn, meta.InstanceofToken) - if len((*nn.GetMeta())) == 0 { + p.printFreeFloating(nn, freefloating.Expr) + if nn.GetFreeFloating().IsEmpty() { io.WriteString(p.w, " ") } + io.WriteString(p.w, "instanceof") - if len((*nn.Class.GetMeta())) == 0 { + + if nn.Class.GetFreeFloating().IsEmpty() { io.WriteString(p.w, " ") } p.Print(nn.Class) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printExprIsset(n node.Node) { nn := n.(*expr.Isset) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) io.WriteString(p.w, "isset") - p.printMeta(nn, meta.OpenParenthesisToken) + p.printFreeFloating(nn, freefloating.Isset) io.WriteString(p.w, "(") p.joinPrint(",", nn.Variables) - p.printMeta(nn, meta.CommaToken) - p.printMeta(nn, meta.CloseParenthesisToken) + p.printFreeFloating(nn, freefloating.VarList) io.WriteString(p.w, ")") - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printExprList(n node.Node) { nn := n.(*expr.List) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) io.WriteString(p.w, "list") - p.printMeta(nn, meta.OpenParenthesisToken) + p.printFreeFloating(nn, freefloating.List) io.WriteString(p.w, "(") p.joinPrint(",", nn.Items) - p.printMeta(nn, meta.CloseParenthesisToken) + p.printFreeFloating(nn, freefloating.ArrayPairList) io.WriteString(p.w, ")") - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printExprMethodCall(n node.Node) { nn := n.(*expr.MethodCall) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) p.Print(nn.Variable) - p.printMeta(nn, meta.ObjectOperatorToken) + p.printFreeFloating(nn, freefloating.Var) io.WriteString(p.w, "->") p.Print(nn.Method) - p.printMeta(nn.ArgumentList, meta.OpenParenthesisToken) + + p.printFreeFloating(nn.ArgumentList, freefloating.Start) io.WriteString(p.w, "(") p.joinPrint(",", nn.ArgumentList.Arguments) - p.printMeta(nn.ArgumentList, meta.CommaToken) - p.printMeta(nn.ArgumentList, meta.CloseParenthesisToken) + p.printFreeFloating(nn.ArgumentList, freefloating.ArgumentList) io.WriteString(p.w, ")") + p.printFreeFloating(nn.ArgumentList, freefloating.End) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printExprNew(n node.Node) { nn := n.(*expr.New) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) io.WriteString(p.w, "new") - if len((*nn.Class.GetMeta())) == 0 { + if nn.Class.GetFreeFloating().IsEmpty() { io.WriteString(p.w, " ") } p.Print(nn.Class) if nn.ArgumentList != nil { - p.printMeta(nn.ArgumentList, meta.OpenParenthesisToken) + p.printFreeFloating(nn.ArgumentList, freefloating.Start) io.WriteString(p.w, "(") p.joinPrint(",", nn.ArgumentList.Arguments) - p.printMeta(nn.ArgumentList, meta.CommaToken) - p.printMeta(nn.ArgumentList, meta.CloseParenthesisToken) + p.printFreeFloating(nn.ArgumentList, freefloating.ArgumentList) io.WriteString(p.w, ")") + p.printFreeFloating(nn.ArgumentList, freefloating.End) } - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printExprPostDec(n node.Node) { nn := n.(*expr.PostDec) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) p.Print(nn.Variable) - p.printMeta(nn, meta.DecToken) + p.printFreeFloating(nn, freefloating.Var) io.WriteString(p.w, "--") - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printExprPostInc(n node.Node) { nn := n.(*expr.PostInc) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) p.Print(nn.Variable) - p.printMeta(nn, meta.IncToken) + p.printFreeFloating(nn, freefloating.Var) io.WriteString(p.w, "++") - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printExprPreDec(n node.Node) { nn := n.(*expr.PreDec) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) io.WriteString(p.w, "--") p.Print(nn.Variable) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printExprPreInc(n node.Node) { nn := n.(*expr.PreInc) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) io.WriteString(p.w, "++") p.Print(nn.Variable) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printExprPrint(n node.Node) { nn := n.(*expr.Print) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) io.WriteString(p.w, "print") - if len((*nn.Expr.GetMeta())) == 0 { + if nn.Expr.GetFreeFloating().IsEmpty() { io.WriteString(p.w, " ") } p.Print(nn.Expr) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printExprPropertyFetch(n node.Node) { nn := n.(*expr.PropertyFetch) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) p.Print(nn.Variable) - p.printMeta(nn, meta.ObjectOperatorToken) + p.printFreeFloating(nn, freefloating.Var) io.WriteString(p.w, "->") p.Print(nn.Property) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printExprReference(n node.Node) { nn := n.(*expr.Reference) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) io.WriteString(p.w, "&") p.Print(nn.Variable) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printExprRequire(n node.Node) { nn := n.(*expr.Require) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) io.WriteString(p.w, "require") - if len((*nn.Expr.GetMeta())) == 0 { + if nn.Expr.GetFreeFloating().IsEmpty() { io.WriteString(p.w, " ") } p.Print(nn.Expr) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printExprRequireOnce(n node.Node) { nn := n.(*expr.RequireOnce) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) io.WriteString(p.w, "require_once") - if len((*nn.Expr.GetMeta())) == 0 { + if nn.Expr.GetFreeFloating().IsEmpty() { io.WriteString(p.w, " ") } p.Print(nn.Expr) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printExprShellExec(n node.Node) { nn := n.(*expr.ShellExec) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) io.WriteString(p.w, "`") - for _, part := range nn.Parts { - p.Print(part) - } + p.joinPrint("", nn.Parts) io.WriteString(p.w, "`") - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printExprShortArray(n node.Node) { nn := n.(*expr.ShortArray) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) io.WriteString(p.w, "[") p.joinPrint(",", nn.Items) - p.printMeta(nn, meta.CloseSquareBracket) + p.printFreeFloating(nn, freefloating.ArrayPairList) io.WriteString(p.w, "]") - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printExprShortList(n node.Node) { nn := n.(*expr.ShortList) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) io.WriteString(p.w, "[") p.joinPrint(",", nn.Items) - p.printMeta(nn, meta.CloseSquareBracket) + p.printFreeFloating(nn, freefloating.ArrayPairList) io.WriteString(p.w, "]") - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printExprStaticCall(n node.Node) { nn := n.(*expr.StaticCall) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) p.Print(nn.Class) - p.printMeta(nn, meta.PaamayimNekudotayimToken) + p.printFreeFloating(nn, freefloating.Name) io.WriteString(p.w, "::") p.Print(nn.Call) - p.printMeta(nn.ArgumentList, meta.OpenParenthesisToken) + + p.printFreeFloating(nn.ArgumentList, freefloating.Start) io.WriteString(p.w, "(") p.joinPrint(",", nn.ArgumentList.Arguments) - p.printMeta(nn.ArgumentList, meta.CommaToken) - p.printMeta(nn.ArgumentList, meta.CloseParenthesisToken) + p.printFreeFloating(nn.ArgumentList, freefloating.ArgumentList) io.WriteString(p.w, ")") + p.printFreeFloating(nn.ArgumentList, freefloating.End) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printExprStaticPropertyFetch(n node.Node) { nn := n.(*expr.StaticPropertyFetch) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) p.Print(nn.Class) - p.printMeta(nn, meta.PaamayimNekudotayimToken) + p.printFreeFloating(nn, freefloating.Name) io.WriteString(p.w, "::") p.Print(nn.Property) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printExprTernary(n node.Node) { nn := n.(*expr.Ternary) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) p.Print(nn.Condition) - p.printMeta(nn, meta.QuestionMarkToken) + p.printFreeFloating(nn, freefloating.Cond) io.WriteString(p.w, "?") if nn.IfTrue != nil { p.Print(nn.IfTrue) } + p.printFreeFloating(nn, freefloating.True) - p.printMeta(nn, meta.ColonToken) io.WriteString(p.w, ":") p.Print(nn.IfFalse) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printExprUnaryMinus(n node.Node) { nn := n.(*expr.UnaryMinus) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) io.WriteString(p.w, "-") p.Print(nn.Expr) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printExprUnaryPlus(n node.Node) { nn := n.(*expr.UnaryPlus) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) io.WriteString(p.w, "+") p.Print(nn.Expr) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printExprVariable(n node.Node) { nn := n.(*expr.Variable) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) - if len((*n.GetMeta())) == 0 { + p.printFreeFloating(nn, freefloating.Dollar) + if nn.GetFreeFloating().IsEmpty() { io.WriteString(p.w, "$") } p.Print(nn.VarName) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printExprVariableWithoutLeadingDollar(n node.Node) { nn := n.(*expr.Variable) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) p.Print(nn.VarName) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printExprYieldFrom(n node.Node) { nn := n.(*expr.YieldFrom) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) io.WriteString(p.w, "yield from") - if len((*nn.Expr.GetMeta())) == 0 { + if nn.Expr.GetFreeFloating().IsEmpty() { io.WriteString(p.w, " ") } p.Print(nn.Expr) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printExprYield(n node.Node) { nn := n.(*expr.Yield) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) io.WriteString(p.w, "yield") if nn.Key != nil { - if len((*nn.Key.GetMeta())) == 0 { + if nn.Key.GetFreeFloating().IsEmpty() { io.WriteString(p.w, " ") } p.Print(nn.Key) - p.printMeta(nn, meta.DoubleArrowToken) + p.printFreeFloating(nn, freefloating.Expr) io.WriteString(p.w, "=>") } else { - if len((*nn.Value.GetMeta())) == 0 { + if nn.Value.GetFreeFloating().IsEmpty() { io.WriteString(p.w, " ") } } p.Print(nn.Value) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } // smtm func (p *Printer) printStmtAltElseIf(n node.Node) { nn := n.(*stmt.AltElseIf) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) io.WriteString(p.w, "elseif") - p.printMeta(nn, meta.OpenParenthesisToken) + p.printFreeFloating(nn, freefloating.ElseIf) io.WriteString(p.w, "(") p.Print(nn.Cond) - p.printMeta(nn, meta.CloseParenthesisToken) + p.printFreeFloating(nn, freefloating.Expr) io.WriteString(p.w, ")") - p.printMeta(nn, meta.ColonToken) + p.printFreeFloating(nn, freefloating.Cond) io.WriteString(p.w, ":") if s := nn.Stmt.(*stmt.StmtList).Stmts; len(s) > 0 { p.printNodes(s) } - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printStmtAltElse(n node.Node) { nn := n.(*stmt.AltElse) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) io.WriteString(p.w, "else") - p.printMeta(nn, meta.ColonToken) + p.printFreeFloating(nn, freefloating.Else) io.WriteString(p.w, ":") if s := nn.Stmt.(*stmt.StmtList).Stmts; len(s) > 0 { p.printNodes(s) } - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printStmtAltFor(n node.Node) { nn := n.(*stmt.AltFor) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) io.WriteString(p.w, "for") - p.printMeta(nn, meta.OpenParenthesisToken) + p.printFreeFloating(nn, freefloating.For) io.WriteString(p.w, "(") p.joinPrint(",", nn.Init) - p.printMeta(nn, meta.ForInitSemicolonToken) + p.printFreeFloating(nn, freefloating.InitExpr) io.WriteString(p.w, ";") p.joinPrint(",", nn.Cond) - p.printMeta(nn, meta.ForCondSemicolonToken) + p.printFreeFloating(nn, freefloating.CondExpr) io.WriteString(p.w, ";") p.joinPrint(",", nn.Loop) - p.printMeta(nn, meta.CloseParenthesisToken) + p.printFreeFloating(nn, freefloating.IncExpr) io.WriteString(p.w, ")") - p.printMeta(nn, meta.ColonToken) + p.printFreeFloating(nn, freefloating.Cond) io.WriteString(p.w, ":") s := nn.Stmt.(*stmt.StmtList) p.printNodes(s.Stmts) + p.printFreeFloating(nn, freefloating.Stmts) - p.printMeta(nn, meta.EndforToken) io.WriteString(p.w, "endfor") - p.printMeta(nn, meta.SemiColonToken) - if len((*nn.GetMeta())) == 0 { + p.printFreeFloating(nn, freefloating.AltEnd) + p.printFreeFloating(nn, freefloating.SemiColon) + if nn.GetFreeFloating().IsEmpty() { io.WriteString(p.w, ";") } - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printStmtAltForeach(n node.Node) { nn := n.(*stmt.AltForeach) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) io.WriteString(p.w, "foreach") - p.printMeta(nn, meta.OpenParenthesisToken) + p.printFreeFloating(nn, freefloating.Foreach) io.WriteString(p.w, "(") p.Print(nn.Expr) - if len((*nn.GetMeta())) == 0 { + p.printFreeFloating(nn, freefloating.Expr) + if nn.GetFreeFloating().IsEmpty() { io.WriteString(p.w, " ") } - p.printMeta(nn, meta.AsToken) io.WriteString(p.w, "as") if nn.Key != nil { - if len((*nn.Key.GetMeta())) == 0 { + if nn.Key.GetFreeFloating().IsEmpty() { io.WriteString(p.w, " ") } p.Print(nn.Key) - p.printMeta(nn, meta.DoubleArrowToken) + p.printFreeFloating(nn, freefloating.Key) io.WriteString(p.w, "=>") } else { - if len((*nn.Variable.GetMeta())) == 0 { + if nn.Variable.GetFreeFloating().IsEmpty() { io.WriteString(p.w, " ") } } p.Print(nn.Variable) + p.printFreeFloating(nn, freefloating.Var) - p.printMeta(nn, meta.CloseParenthesisToken) io.WriteString(p.w, ")") - p.printMeta(nn, meta.ColonToken) - io.WriteString(p.w, ":") + p.printFreeFloating(nn, freefloating.Cond) + io.WriteString(p.w, ":") s := nn.Stmt.(*stmt.StmtList) p.printNodes(s.Stmts) + p.printFreeFloating(nn, freefloating.Stmts) - p.printMeta(nn, meta.EndforeachToken) io.WriteString(p.w, "endforeach") - p.printMeta(nn, meta.SemiColonToken) - if len((*nn.GetMeta())) == 0 { + p.printFreeFloating(nn, freefloating.AltEnd) + p.printFreeFloating(nn, freefloating.SemiColon) + if nn.GetFreeFloating().IsEmpty() { io.WriteString(p.w, ";") } - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printStmtAltIf(n node.Node) { nn := n.(*stmt.AltIf) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) io.WriteString(p.w, "if") - p.printMeta(nn, meta.OpenParenthesisToken) + p.printFreeFloating(nn, freefloating.If) io.WriteString(p.w, "(") p.Print(nn.Cond) - p.printMeta(nn, meta.CloseParenthesisToken) + p.printFreeFloating(nn, freefloating.Expr) io.WriteString(p.w, ")") - p.printMeta(nn, meta.ColonToken) + p.printFreeFloating(nn, freefloating.Cond) io.WriteString(p.w, ":") s := nn.Stmt.(*stmt.StmtList) @@ -2005,100 +2013,106 @@ func (p *Printer) printStmtAltIf(n node.Node) { p.Print(nn.Else) } - p.printMeta(nn, meta.EndifToken) + p.printFreeFloating(nn, freefloating.Stmts) io.WriteString(p.w, "endif") - p.printMeta(nn, meta.SemiColonToken) - if len((*nn.GetMeta())) == 0 { + p.printFreeFloating(nn, freefloating.AltEnd) + p.printFreeFloating(nn, freefloating.SemiColon) + if nn.GetFreeFloating().IsEmpty() { io.WriteString(p.w, ";") } - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printStmtAltSwitch(n node.Node) { nn := n.(*stmt.AltSwitch) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) io.WriteString(p.w, "switch") - p.printMeta(nn, meta.OpenParenthesisToken) + p.printFreeFloating(nn, freefloating.Switch) io.WriteString(p.w, "(") p.Print(nn.Cond) - p.printMeta(nn, meta.CloseParenthesisToken) + p.printFreeFloating(nn, freefloating.Expr) io.WriteString(p.w, ")") - p.printMeta(nn, meta.ColonToken) + p.printFreeFloating(nn, freefloating.Cond) io.WriteString(p.w, ":") - p.printMeta(nn.CaseList, meta.CaseSeparatorToken) - s := nn.CaseList.Cases - p.printNodes(s) + p.printFreeFloating(nn.CaseList, freefloating.Start) + p.printFreeFloating(nn.CaseList, freefloating.CaseListStart) + p.printNodes(nn.CaseList.Cases) + p.printFreeFloating(nn.CaseList, freefloating.CaseListEnd) + p.printFreeFloating(nn.CaseList, freefloating.End) - p.printMeta(nn, meta.EndswitchToken) io.WriteString(p.w, "endswitch") - p.printMeta(nn, meta.SemiColonToken) - if len((*nn.GetMeta())) == 0 { + p.printFreeFloating(nn, freefloating.AltEnd) + p.printFreeFloating(nn, freefloating.SemiColon) + if nn.GetFreeFloating().IsEmpty() { io.WriteString(p.w, ";") } - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printStmtAltWhile(n node.Node) { nn := n.(*stmt.AltWhile) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) io.WriteString(p.w, "while") - p.printMeta(nn, meta.OpenParenthesisToken) + p.printFreeFloating(nn, freefloating.While) io.WriteString(p.w, "(") p.Print(nn.Cond) - p.printMeta(nn, meta.CloseParenthesisToken) + p.printFreeFloating(nn, freefloating.Expr) io.WriteString(p.w, ")") - p.printMeta(nn, meta.ColonToken) + p.printFreeFloating(nn, freefloating.Cond) io.WriteString(p.w, ":") s := nn.Stmt.(*stmt.StmtList) p.printNodes(s.Stmts) + p.printFreeFloating(nn, freefloating.Stmts) - p.printMeta(nn, meta.EndwhileToken) io.WriteString(p.w, "endwhile") - p.printMeta(nn, meta.SemiColonToken) - if len((*nn.GetMeta())) == 0 { + p.printFreeFloating(nn, freefloating.AltEnd) + p.printFreeFloating(nn, freefloating.SemiColon) + if nn.GetFreeFloating().IsEmpty() { io.WriteString(p.w, ";") } - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printStmtBreak(n node.Node) { nn := n.(*stmt.Break) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) io.WriteString(p.w, "break") if nn.Expr != nil { - if len((*nn.Expr.GetMeta())) == 0 { + if nn.Expr.GetFreeFloating().IsEmpty() { io.WriteString(p.w, " ") } p.Print(nn.Expr) } + p.printFreeFloating(nn, freefloating.Expr) - p.printMeta(nn, meta.SemiColonToken) - if len((*nn.GetMeta())) == 0 { + p.printFreeFloating(nn, freefloating.SemiColon) + if nn.GetFreeFloating().IsEmpty() { io.WriteString(p.w, ";") } - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printStmtCase(n node.Node) { nn := n.(*stmt.Case) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) io.WriteString(p.w, "case") - if len((*nn.Cond.GetMeta())) == 0 { + if nn.Cond.GetFreeFloating().IsEmpty() { io.WriteString(p.w, " ") } p.Print(nn.Cond) - r := p.printMeta(nn, meta.CaseSeparatorToken) - if !r { + p.printFreeFloating(nn, freefloating.Expr) + p.printFreeFloating(nn, freefloating.CaseSeparator) + if nn.GetFreeFloating().IsEmpty() { io.WriteString(p.w, ":") } @@ -2106,271 +2120,276 @@ func (p *Printer) printStmtCase(n node.Node) { p.printNodes(nn.Stmts) } - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printStmtCatch(n node.Node) { nn := n.(*stmt.Catch) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) io.WriteString(p.w, "catch") - p.printMeta(nn, meta.OpenParenthesisToken) + p.printFreeFloating(nn, freefloating.Catch) io.WriteString(p.w, "(") p.joinPrint("|", nn.Types) p.Print(nn.Variable) - p.printMeta(nn, meta.CloseParenthesisToken) + p.printFreeFloating(nn, freefloating.Var) io.WriteString(p.w, ")") - p.printMeta(nn, meta.OpenCurlyBracesToken) + p.printFreeFloating(nn, freefloating.Cond) io.WriteString(p.w, "{") p.printNodes(nn.Stmts) - p.printMeta(nn, meta.CloseCurlyBracesToken) + p.printFreeFloating(nn, freefloating.Stmts) io.WriteString(p.w, "}") - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printStmtClassMethod(n node.Node) { nn := n.(*stmt.ClassMethod) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) if nn.Modifiers != nil { for k, m := range nn.Modifiers { - if k > 0 && len(m.GetMeta().FindBy(meta.AndFilter(meta.TokenNameFilter(meta.NodeStart), meta.TypeFilter(meta.WhiteSpaceType)))) == 0 { + if k > 0 && m.GetFreeFloating().IsEmpty() { io.WriteString(p.w, " ") } p.Print(m) } - if len((*nn.GetMeta())) == 0 { + if nn.GetFreeFloating().IsEmpty() { io.WriteString(p.w, " ") } } - p.printMeta(nn, meta.FunctionToken) + p.printFreeFloating(nn, freefloating.ModifierList) io.WriteString(p.w, "function") + p.printFreeFloating(nn, freefloating.Function) if nn.ReturnsRef { - if len((*nn.GetMeta())) == 0 { + if nn.GetFreeFloating().IsEmpty() { io.WriteString(p.w, " ") } - p.printMeta(nn, meta.AmpersandToken) io.WriteString(p.w, "&") + p.printFreeFloating(nn, freefloating.Ampersand) } else { - if len((*nn.MethodName.GetMeta())) == 0 { + if nn.GetFreeFloating().IsEmpty() { io.WriteString(p.w, " ") } } p.Print(nn.MethodName) - p.printMeta(nn, meta.OpenParenthesisToken) + p.printFreeFloating(nn, freefloating.Name) io.WriteString(p.w, "(") p.joinPrint(",", nn.Params) - p.printMeta(nn, meta.CloseParenthesisToken) + p.printFreeFloating(nn, freefloating.ParameterList) io.WriteString(p.w, ")") + p.printFreeFloating(nn, freefloating.Params) if nn.ReturnType != nil { - p.printMeta(nn.ReturnType, meta.ColonToken) io.WriteString(p.w, ":") p.Print(nn.ReturnType) } p.Print(nn.Stmt) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printStmtClass(n node.Node) { nn := n.(*stmt.Class) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) if nn.Modifiers != nil { for k, m := range nn.Modifiers { - if k > 0 && len(m.GetMeta().FindBy(meta.AndFilter(meta.TokenNameFilter(meta.NodeStart), meta.TypeFilter(meta.WhiteSpaceType)))) == 0 { + if k > 0 && m.GetFreeFloating().IsEmpty() { io.WriteString(p.w, " ") } p.Print(m) } - if len((*nn.GetMeta())) == 0 { + if nn.GetFreeFloating().IsEmpty() { io.WriteString(p.w, " ") } } - p.printMeta(nn, meta.ClassToken) + p.printFreeFloating(nn, freefloating.ModifierList) io.WriteString(p.w, "class") + p.printFreeFloating(nn, freefloating.Class) if nn.ClassName != nil { - if len((*nn.ClassName.GetMeta())) == 0 { + if nn.ClassName.GetFreeFloating().IsEmpty() { io.WriteString(p.w, " ") } p.Print(nn.ClassName) } if nn.ArgumentList != nil { - p.printMeta(nn.ArgumentList, meta.OpenParenthesisToken) + p.printFreeFloating(nn.ArgumentList, freefloating.Start) io.WriteString(p.w, "(") p.joinPrint(",", nn.ArgumentList.Arguments) - p.printMeta(nn.ArgumentList, meta.CommaToken) - p.printMeta(nn.ArgumentList, meta.CloseParenthesisToken) + p.printFreeFloating(nn.ArgumentList, freefloating.ArgumentList) io.WriteString(p.w, ")") + p.printFreeFloating(nn.ArgumentList, freefloating.End) } if nn.Extends != nil { - p.printMeta(nn.Extends, meta.NodeStart) - if len((*nn.Extends.GetMeta())) == 0 { + p.printFreeFloating(nn.Extends, freefloating.Start) + if nn.Extends.GetFreeFloating().IsEmpty() { io.WriteString(p.w, " ") } - p.printMeta(nn.Extends, meta.ExtendsToken) io.WriteString(p.w, "extends") - if len((*nn.Extends.ClassName.GetMeta())) == 0 { + if nn.Extends.ClassName.GetFreeFloating().IsEmpty() { io.WriteString(p.w, " ") } p.Print(nn.Extends.ClassName) } if nn.Implements != nil { - p.printMeta(nn.Implements, meta.NodeStart) - if len((*nn.Implements.GetMeta())) == 0 { + p.printFreeFloating(nn.Implements, freefloating.Start) + if nn.Implements.GetFreeFloating().IsEmpty() { io.WriteString(p.w, " ") } - p.printMeta(nn.Implements, meta.ImplementsToken) io.WriteString(p.w, "implements") - if len((*nn.Implements.InterfaceNames[0].GetMeta())) == 0 { + if nn.Implements.InterfaceNames[0].GetFreeFloating().IsEmpty() { io.WriteString(p.w, " ") } p.joinPrint(",", nn.Implements.InterfaceNames) } - p.printMeta(nn, meta.OpenCurlyBracesToken) + p.printFreeFloating(nn, freefloating.Name) io.WriteString(p.w, "{") p.printNodes(nn.Stmts) - p.printMeta(nn, meta.CloseCurlyBracesToken) + p.printFreeFloating(nn, freefloating.Stmts) io.WriteString(p.w, "}") - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printStmtClassConstList(n node.Node) { nn := n.(*stmt.ClassConstList) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) if nn.Modifiers != nil { for k, m := range nn.Modifiers { - if k > 0 && len(m.GetMeta().FindBy(meta.AndFilter(meta.TokenNameFilter(meta.NodeStart), meta.TypeFilter(meta.WhiteSpaceType)))) == 0 { + if k > 0 && m.GetFreeFloating().IsEmpty() { io.WriteString(p.w, " ") } p.Print(m) } - if len((*nn.GetMeta())) == 0 { + if nn.GetFreeFloating().IsEmpty() { io.WriteString(p.w, " ") } } - p.printMeta(nn, meta.ConstToken) + p.printFreeFloating(nn, freefloating.ModifierList) io.WriteString(p.w, "const") - if len((*nn.Consts[0].GetMeta())) == 0 { + if nn.Consts[0].GetFreeFloating().IsEmpty() { io.WriteString(p.w, " ") } p.joinPrint(",", nn.Consts) + p.printFreeFloating(nn, freefloating.ConstList) - p.printMeta(nn, meta.SemiColonToken) - if len((*nn.GetMeta())) == 0 { + p.printFreeFloating(nn, freefloating.SemiColon) + if nn.GetFreeFloating().IsEmpty() { io.WriteString(p.w, ";") } - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printStmtConstList(n node.Node) { nn := n.(*stmt.ConstList) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) io.WriteString(p.w, "const") - if len((*nn.Consts[0].GetMeta())) == 0 { + if nn.Consts[0].GetFreeFloating().IsEmpty() { io.WriteString(p.w, " ") } p.joinPrint(",", nn.Consts) + p.printFreeFloating(nn, freefloating.Stmts) - p.printMeta(nn, meta.SemiColonToken) - if len((*nn.GetMeta())) == 0 { + p.printFreeFloating(nn, freefloating.SemiColon) + if nn.GetFreeFloating().IsEmpty() { io.WriteString(p.w, ";") } - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printStmtConstant(n node.Node) { nn := n.(*stmt.Constant) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) p.Print(nn.ConstantName) - p.printMeta(nn, meta.EqualToken) + p.printFreeFloating(nn, freefloating.Name) io.WriteString(p.w, "=") p.Print(nn.Expr) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printStmtContinue(n node.Node) { nn := n.(*stmt.Continue) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) io.WriteString(p.w, "continue") if nn.Expr != nil { - if len((*nn.Expr.GetMeta())) == 0 { + if nn.Expr.GetFreeFloating().IsEmpty() { io.WriteString(p.w, " ") } p.Print(nn.Expr) } + p.printFreeFloating(nn, freefloating.Expr) - p.printMeta(nn, meta.SemiColonToken) - if len((*nn.GetMeta())) == 0 { + p.printFreeFloating(nn, freefloating.SemiColon) + if nn.GetFreeFloating().IsEmpty() { io.WriteString(p.w, ";") } - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printStmtDeclare(n node.Node) { nn := n.(*stmt.Declare) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) io.WriteString(p.w, "declare") - p.printMeta(nn, meta.OpenParenthesisToken) + p.printFreeFloating(nn, freefloating.Declare) io.WriteString(p.w, "(") p.joinPrint(",", nn.Consts) - p.printMeta(nn, meta.CloseParenthesisToken) + p.printFreeFloating(nn, freefloating.ConstList) io.WriteString(p.w, ")") if nn.Alt { - p.printMeta(nn, meta.ColonToken) + p.printFreeFloating(nn, freefloating.Cond) io.WriteString(p.w, ":") s := nn.Stmt.(*stmt.StmtList) p.printNodes(s.Stmts) + p.printFreeFloating(nn, freefloating.Stmts) - p.printMeta(nn, meta.EnddeclareToken) io.WriteString(p.w, "enddeclare") - p.printMeta(nn, meta.SemiColonToken) - if len((*nn.GetMeta())) == 0 { + p.printFreeFloating(nn, freefloating.AltEnd) + + p.printFreeFloating(nn, freefloating.SemiColon) + if nn.GetFreeFloating().IsEmpty() { io.WriteString(p.w, ";") } - } else { p.Print(nn.Stmt) } - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printStmtDefault(n node.Node) { nn := n.(*stmt.Default) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) io.WriteString(p.w, "default") - r := p.printMeta(nn, meta.CaseSeparatorToken) - if !r { + p.printFreeFloating(nn, freefloating.Default) + p.printFreeFloating(nn, freefloating.CaseSeparator) + if nn.GetFreeFloating().IsEmpty() { io.WriteString(p.w, ":") } @@ -2378,317 +2397,333 @@ func (p *Printer) printStmtDefault(n node.Node) { p.printNodes(nn.Stmts) } - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printStmtDo(n node.Node) { nn := n.(*stmt.Do) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) io.WriteString(p.w, "do") if _, ok := nn.Stmt.(*stmt.StmtList); !ok { - if len((*nn.Stmt.GetMeta())) == 0 { + if nn.Stmt.GetFreeFloating().IsEmpty() { io.WriteString(p.w, " ") } } p.Print(nn.Stmt) + p.printFreeFloating(nn, freefloating.Stmts) - p.printMeta(nn, meta.WhileToken) io.WriteString(p.w, "while") - p.printMeta(nn, meta.OpenParenthesisToken) + p.printFreeFloating(nn, freefloating.While) io.WriteString(p.w, "(") p.Print(nn.Cond) - p.printMeta(nn, meta.CloseParenthesisToken) + p.printFreeFloating(nn, freefloating.Expr) io.WriteString(p.w, ")") - p.printMeta(nn, meta.SemiColonToken) - if len((*nn.GetMeta())) == 0 { + p.printFreeFloating(nn, freefloating.Cond) + + p.printFreeFloating(nn, freefloating.SemiColon) + if nn.GetFreeFloating().IsEmpty() { io.WriteString(p.w, ";") } - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printStmtEcho(n node.Node) { nn := n.(*stmt.Echo) if p.s == HtmlState { - if len((*n.GetMeta())) == 0 { + if nn.GetFreeFloating().IsEmpty() { io.WriteString(p.w, "") } else { - if len((*nn.Variable.GetMeta())) == 0 { + if nn.Variable.GetFreeFloating().IsEmpty() { io.WriteString(p.w, " ") } } - p.Print(nn.Variable) - p.printMeta(nn, meta.CloseParenthesisToken) + p.printFreeFloating(nn, freefloating.Var) + io.WriteString(p.w, ")") p.Print(nn.Stmt) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printStmtFunction(n node.Node) { nn := n.(*stmt.Function) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) io.WriteString(p.w, "function") + p.printFreeFloating(nn, freefloating.Function) if nn.ReturnsRef { - if len((*nn.GetMeta())) == 0 { + if nn.GetFreeFloating().IsEmpty() { io.WriteString(p.w, " ") } - p.printMeta(nn, meta.AmpersandToken) io.WriteString(p.w, "&") } else { - if len((*nn.FunctionName.GetMeta())) == 0 { + if nn.FunctionName.GetFreeFloating().IsEmpty() { io.WriteString(p.w, " ") } } p.Print(nn.FunctionName) + p.printFreeFloating(nn, freefloating.Name) - p.printMeta(nn, meta.OpenParenthesisToken) io.WriteString(p.w, "(") p.joinPrint(",", nn.Params) - p.printMeta(nn, meta.CloseParenthesisToken) + p.printFreeFloating(nn, freefloating.ParamList) io.WriteString(p.w, ")") + p.printFreeFloating(nn, freefloating.Params) if nn.ReturnType != nil { - p.printMeta(nn.ReturnType, meta.ColonToken) io.WriteString(p.w, ":") p.Print(nn.ReturnType) } + p.printFreeFloating(nn, freefloating.ReturnType) - p.printMeta(nn, meta.OpenCurlyBracesToken) io.WriteString(p.w, "{") p.printNodes(nn.Stmts) - p.printMeta(nn, meta.CloseCurlyBracesToken) + p.printFreeFloating(nn, freefloating.Stmts) io.WriteString(p.w, "}") - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printStmtGlobal(n node.Node) { nn := n.(*stmt.Global) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) io.WriteString(p.w, "global") p.joinPrint(",", nn.Vars) - p.printMeta(nn, meta.SemiColonToken) - if len((*nn.GetMeta())) == 0 { + p.printFreeFloating(nn, freefloating.VarList) + + p.printFreeFloating(nn, freefloating.SemiColon) + if nn.GetFreeFloating().IsEmpty() { io.WriteString(p.w, ";") } - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printStmtGoto(n node.Node) { nn := n.(*stmt.Goto) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) io.WriteString(p.w, "goto") - if len((*nn.Label.GetMeta())) == 0 { + if nn.Label.GetFreeFloating().IsEmpty() { io.WriteString(p.w, " ") } p.Print(nn.Label) - p.printMeta(nn, meta.SemiColonToken) - if len((*nn.GetMeta())) == 0 { + p.printFreeFloating(nn, freefloating.Label) + + p.printFreeFloating(nn, freefloating.SemiColon) + if nn.GetFreeFloating().IsEmpty() { io.WriteString(p.w, ";") } - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printStmtGroupUse(n node.Node) { nn := n.(*stmt.GroupUse) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) io.WriteString(p.w, "use") + p.printFreeFloating(nn, freefloating.Use) if nn.UseType != nil { - if len((*nn.UseType.GetMeta())) == 0 { + if nn.UseType.GetFreeFloating().IsEmpty() { io.WriteString(p.w, " ") } p.Print(nn.UseType) } - if len((*nn.Prefix.GetMeta())) == 0 { + if nn.Prefix.GetFreeFloating().IsEmpty() { io.WriteString(p.w, " ") } p.Print(nn.Prefix) - p.printMeta(nn, meta.NsSeparatorToken) io.WriteString(p.w, "\\") - p.printMeta(nn, meta.OpenCurlyBracesToken) + p.printFreeFloating(nn, freefloating.Slash) + io.WriteString(p.w, "{") p.joinPrint(",", nn.UseList) - p.printMeta(nn, meta.CommaToken) - p.printMeta(nn, meta.CloseCurlyBracesToken) + p.printFreeFloating(nn, freefloating.Stmts) io.WriteString(p.w, "}") - p.printMeta(nn, meta.SemiColonToken) - if len((*nn.GetMeta())) == 0 { + p.printFreeFloating(nn, freefloating.UseDeclarationList) + + p.printFreeFloating(nn, freefloating.SemiColon) + if nn.GetFreeFloating().IsEmpty() { io.WriteString(p.w, ";") } - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printStmtHaltCompiler(n node.Node) { nn := n.(*stmt.HaltCompiler) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) io.WriteString(p.w, "__halt_compiler") - p.printMeta(n, meta.OpenParenthesisToken) + p.printFreeFloating(nn, freefloating.HaltCompiller) io.WriteString(p.w, "(") - p.printMeta(n, meta.CloseParenthesisToken) + p.printFreeFloating(nn, freefloating.OpenParenthesisToken) io.WriteString(p.w, ")") - p.printMeta(nn, meta.SemiColonToken) - if len((*nn.GetMeta())) == 0 { + p.printFreeFloating(nn, freefloating.CloseParenthesisToken) + + p.printFreeFloating(nn, freefloating.SemiColon) + if nn.GetFreeFloating().IsEmpty() { io.WriteString(p.w, ";") } - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printStmtIf(n node.Node) { nn := n.(*stmt.If) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) io.WriteString(p.w, "if") - p.printMeta(n, meta.OpenParenthesisToken) + p.printFreeFloating(n, freefloating.If) io.WriteString(p.w, "(") p.Print(nn.Cond) - p.printMeta(n, meta.CloseParenthesisToken) + p.printFreeFloating(n, freefloating.Expr) io.WriteString(p.w, ")") p.Print(nn.Stmt) @@ -2701,362 +2736,379 @@ func (p *Printer) printStmtIf(n node.Node) { p.Print(nn.Else) } - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printStmtInlineHTML(n node.Node) { nn := n.(*stmt.InlineHtml) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) - if p.s == PhpState && len(n.GetMeta().FindBy(meta.ValueFilter("?>"))) == 0 { + if p.s == PhpState && nn.GetFreeFloating().IsEmpty() { io.WriteString(p.w, "?>") } p.SetState(HtmlState) io.WriteString(p.w, nn.Value) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printStmtInterface(n node.Node) { nn := n.(*stmt.Interface) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) io.WriteString(p.w, "interface") - if len((*nn.InterfaceName.GetMeta())) == 0 { + if nn.InterfaceName.GetFreeFloating().IsEmpty() { io.WriteString(p.w, " ") } p.Print(nn.InterfaceName) if nn.Extends != nil { - p.printMeta(nn.Extends, meta.NodeStart) - if len((*nn.Extends.GetMeta())) == 0 { + p.printFreeFloating(nn.Extends, freefloating.Start) + if nn.Extends.GetFreeFloating().IsEmpty() { io.WriteString(p.w, " ") } - p.printMeta(nn.Extends, meta.ExtendsToken) io.WriteString(p.w, "extends") - if len((*nn.Extends.InterfaceNames[0].GetMeta())) == 0 { + if nn.Extends.InterfaceNames[0].GetFreeFloating().IsEmpty() { io.WriteString(p.w, " ") } p.joinPrint(",", nn.Extends.InterfaceNames) } - p.printMeta(n, meta.OpenCurlyBracesToken) + p.printFreeFloating(nn, freefloating.Name) io.WriteString(p.w, "{") p.printNodes(nn.Stmts) - p.printMeta(n, meta.CloseCurlyBracesToken) + p.printFreeFloating(nn, freefloating.Stmts) io.WriteString(p.w, "}") - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printStmtLabel(n node.Node) { nn := n.(*stmt.Label) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) p.Print(nn.LabelName) - p.printMeta(n, meta.ColonToken) + p.printFreeFloating(nn, freefloating.Label) + io.WriteString(p.w, ":") - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printStmtNamespace(n node.Node) { nn := n.(*stmt.Namespace) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) io.WriteString(p.w, "namespace") if nn.NamespaceName != nil { - if len((*nn.GetMeta())) == 0 { + if nn.NamespaceName.GetFreeFloating().IsEmpty() { io.WriteString(p.w, " ") } p.Print(nn.NamespaceName) } if nn.Stmts != nil { - p.printMeta(n, meta.OpenCurlyBracesToken) + p.printFreeFloating(nn, freefloating.Namespace) io.WriteString(p.w, "{") p.printNodes(nn.Stmts) - p.printMeta(n, meta.CloseCurlyBracesToken) + p.printFreeFloating(nn, freefloating.Stmts) io.WriteString(p.w, "}") } else { - p.printMeta(nn, meta.SemiColonToken) - if len((*nn.GetMeta())) == 0 { + p.printFreeFloating(nn, freefloating.SemiColon) + if nn.GetFreeFloating().IsEmpty() { io.WriteString(p.w, ";") } } - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printStmtNop(n node.Node) { - p.printMeta(n, meta.NodeStart) - if len((*n.GetMeta())) == 0 { + p.printFreeFloating(n, freefloating.Start) + p.printFreeFloating(n, freefloating.SemiColon) + if n.GetFreeFloating().IsEmpty() { io.WriteString(p.w, ";") } - p.printMeta(n, meta.NodeEnd) + p.printFreeFloating(n, freefloating.End) } func (p *Printer) printStmtPropertyList(n node.Node) { nn := n.(*stmt.PropertyList) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) for k, m := range nn.Modifiers { - if k > 0 && len(m.GetMeta().FindBy(meta.AndFilter(meta.TokenNameFilter(meta.NodeStart), meta.TypeFilter(meta.WhiteSpaceType)))) == 0 { + if k > 0 && m.GetFreeFloating().IsEmpty() { io.WriteString(p.w, " ") } p.Print(m) } - if len((*nn.Properties[0].GetMeta())) == 0 { + if nn.Properties[0].GetFreeFloating().IsEmpty() { io.WriteString(p.w, " ") } p.joinPrint(",", nn.Properties) - p.printMeta(nn, meta.SemiColonToken) - if len((*nn.GetMeta())) == 0 { + p.printFreeFloating(n, freefloating.PropertyList) + + p.printFreeFloating(n, freefloating.SemiColon) + if n.GetFreeFloating().IsEmpty() { io.WriteString(p.w, ";") } - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printStmtProperty(n node.Node) { nn := n.(*stmt.Property) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) p.Print(nn.Variable) if nn.Expr != nil { - p.printMeta(n, meta.EqualToken) + p.printFreeFloating(nn, freefloating.Var) io.WriteString(p.w, "=") p.Print(nn.Expr) } - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printStmtReturn(n node.Node) { nn := n.(*stmt.Return) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) io.WriteString(p.w, "return") - if len((*nn.Expr.GetMeta())) == 0 { + if nn.Expr != nil && nn.Expr.GetFreeFloating().IsEmpty() { io.WriteString(p.w, " ") } p.Print(nn.Expr) - p.printMeta(nn, meta.SemiColonToken) - if len((*nn.GetMeta())) == 0 { + p.printFreeFloating(nn, freefloating.Expr) + + p.printFreeFloating(nn, freefloating.SemiColon) + if n.GetFreeFloating().IsEmpty() { io.WriteString(p.w, ";") } - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printStmtStaticVar(n node.Node) { nn := n.(*stmt.StaticVar) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) p.Print(nn.Variable) if nn.Expr != nil { - p.printMeta(nn, meta.EqualToken) + p.printFreeFloating(nn, freefloating.Var) io.WriteString(p.w, "=") p.Print(nn.Expr) } - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printStmtStatic(n node.Node) { nn := n.(*stmt.Static) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) io.WriteString(p.w, "static") + p.joinPrint(",", nn.Vars) - p.printMeta(nn, meta.SemiColonToken) - if len((*nn.GetMeta())) == 0 { + p.printFreeFloating(nn, freefloating.VarList) + + p.printFreeFloating(nn, freefloating.SemiColon) + if n.GetFreeFloating().IsEmpty() { io.WriteString(p.w, ";") } - p.printMeta(nn, meta.NodeEnd) + + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printStmtStmtList(n node.Node) { nn := n.(*stmt.StmtList) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) io.WriteString(p.w, "{") p.printNodes(nn.Stmts) - p.printMeta(nn, meta.CloseCurlyBracesToken) + p.printFreeFloating(nn, freefloating.Stmts) io.WriteString(p.w, "}") - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printStmtSwitch(n node.Node) { nn := n.(*stmt.Switch) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) io.WriteString(p.w, "switch") - p.printMeta(nn, meta.OpenParenthesisToken) + p.printFreeFloating(nn, freefloating.Switch) io.WriteString(p.w, "(") p.Print(nn.Cond) - p.printMeta(nn, meta.CloseParenthesisToken) + p.printFreeFloating(nn, freefloating.Expr) io.WriteString(p.w, ")") - p.printMeta(nn.CaseList, meta.OpenCurlyBracesToken) + p.printFreeFloating(nn.CaseList, freefloating.Start) io.WriteString(p.w, "{") - p.printMeta(nn.CaseList, meta.CaseSeparatorToken) + p.printFreeFloating(nn.CaseList, freefloating.CaseListStart) p.printNodes(nn.CaseList.Cases) - p.printMeta(nn.CaseList, meta.CloseCurlyBracesToken) + p.printFreeFloating(nn.CaseList, freefloating.CaseListEnd) io.WriteString(p.w, "}") + p.printFreeFloating(nn.CaseList, freefloating.End) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printStmtThrow(n node.Node) { nn := n.(*stmt.Throw) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) io.WriteString(p.w, "throw") - if len((*nn.Expr.GetMeta())) == 0 { + if nn.Expr.GetFreeFloating().IsEmpty() { io.WriteString(p.w, " ") } p.Print(nn.Expr) - p.printMeta(nn, meta.SemiColonToken) - if len((*nn.GetMeta())) == 0 { + p.printFreeFloating(nn, freefloating.Expr) + + p.printFreeFloating(nn, freefloating.SemiColon) + if n.GetFreeFloating().IsEmpty() { io.WriteString(p.w, ";") } - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printStmtTraitAdaptationList(n node.Node) { nn := n.(*stmt.TraitAdaptationList) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) io.WriteString(p.w, "{") p.printNodes(nn.Adaptations) - p.printMeta(nn, meta.CloseCurlyBracesToken) + p.printFreeFloating(nn, freefloating.AdaptationList) io.WriteString(p.w, "}") - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printStmtTraitMethodRef(n node.Node) { nn := n.(*stmt.TraitMethodRef) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) if nn.Trait != nil { p.Print(nn.Trait) - p.printMeta(nn, meta.PaamayimNekudotayimToken) + p.printFreeFloating(nn, freefloating.Name) io.WriteString(p.w, "::") } + p.Print(nn.Method) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printStmtTraitUseAlias(n node.Node) { nn := n.(*stmt.TraitUseAlias) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) p.Print(nn.Ref) - p.printMeta(nn, meta.AsToken) - if len((*nn.GetMeta())) == 0 { + p.printFreeFloating(nn, freefloating.Ref) + + if nn.GetFreeFloating().IsEmpty() { io.WriteString(p.w, " ") } io.WriteString(p.w, "as") if nn.Modifier != nil { - if len((*nn.Modifier.GetMeta())) == 0 { + if nn.Modifier.GetFreeFloating().IsEmpty() { io.WriteString(p.w, " ") } p.Print(nn.Modifier) } if nn.Alias != nil { - if len((*nn.Alias.GetMeta())) == 0 { + if nn.Alias.GetFreeFloating().IsEmpty() { io.WriteString(p.w, " ") } p.Print(nn.Alias) } + p.printFreeFloating(nn, freefloating.Alias) - p.printMeta(nn, meta.SemiColonToken) - if len((*nn.GetMeta())) == 0 { + p.printFreeFloating(nn, freefloating.SemiColon) + if n.GetFreeFloating().IsEmpty() { io.WriteString(p.w, ";") } - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printStmtTraitUsePrecedence(n node.Node) { nn := n.(*stmt.TraitUsePrecedence) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) p.Print(nn.Ref) - if len((*nn.GetMeta())) == 0 { + p.printFreeFloating(nn, freefloating.Ref) + if nn.GetFreeFloating().IsEmpty() { io.WriteString(p.w, " ") } - p.printMeta(nn, meta.InsteadofToken) + io.WriteString(p.w, "insteadof") - if len((*nn.Insteadof[0].GetMeta())) == 0 { + if nn.Insteadof[0].GetFreeFloating().IsEmpty() { io.WriteString(p.w, " ") } p.joinPrint(",", nn.Insteadof) + p.printFreeFloating(nn, freefloating.NameList) - p.printMeta(nn, meta.SemiColonToken) - if len((*nn.GetMeta())) == 0 { + p.printFreeFloating(nn, freefloating.SemiColon) + if n.GetFreeFloating().IsEmpty() { io.WriteString(p.w, ";") } - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printStmtTraitUse(n node.Node) { nn := n.(*stmt.TraitUse) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) io.WriteString(p.w, "use") - if len((*nn.Traits[0].GetMeta())) == 0 { + if nn.Traits[0].GetFreeFloating().IsEmpty() { io.WriteString(p.w, " ") } p.joinPrint(",", nn.Traits) p.Print(nn.TraitAdaptationList) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printStmtTrait(n node.Node) { nn := n.(*stmt.Trait) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) io.WriteString(p.w, "trait") - if len((*nn.TraitName.GetMeta())) == 0 { + if nn.TraitName.GetFreeFloating().IsEmpty() { io.WriteString(p.w, " ") } p.Print(nn.TraitName) - p.printMeta(nn, meta.OpenCurlyBracesToken) + p.printFreeFloating(nn, freefloating.Name) io.WriteString(p.w, "{") p.printNodes(nn.Stmts) - p.printMeta(nn, meta.CloseCurlyBracesToken) + p.printFreeFloating(nn, freefloating.Stmts) io.WriteString(p.w, "}") - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printStmtTry(n node.Node) { nn := n.(*stmt.Try) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) io.WriteString(p.w, "try") - p.printMeta(nn, meta.OpenCurlyBracesToken) + p.printFreeFloating(nn, freefloating.Try) io.WriteString(p.w, "{") p.printNodes(nn.Stmts) - p.printMeta(nn, meta.CloseCurlyBracesToken) + p.printFreeFloating(nn, freefloating.Stmts) io.WriteString(p.w, "}") if nn.Catches != nil { @@ -3067,93 +3119,97 @@ func (p *Printer) printStmtTry(n node.Node) { p.Print(nn.Finally) } - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printStmtUnset(n node.Node) { nn := n.(*stmt.Unset) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) io.WriteString(p.w, "unset") - p.printMeta(nn, meta.OpenParenthesisToken) + p.printFreeFloating(nn, freefloating.Unset) io.WriteString(p.w, "(") p.joinPrint(",", nn.Vars) - p.printMeta(nn, meta.CommaToken) - p.printMeta(nn, meta.CloseParenthesisToken) + p.printFreeFloating(nn, freefloating.VarList) io.WriteString(p.w, ")") - p.printMeta(nn, meta.SemiColonToken) - if len((*nn.GetMeta())) == 0 { + p.printFreeFloating(nn, freefloating.CloseParenthesisToken) + + p.printFreeFloating(nn, freefloating.SemiColon) + if n.GetFreeFloating().IsEmpty() { io.WriteString(p.w, ";") } - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printStmtUseList(n node.Node) { nn := n.(*stmt.UseList) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) io.WriteString(p.w, "use") if nn.UseType != nil { - if len((*nn.UseType.GetMeta())) == 0 { + if nn.UseType.GetFreeFloating().IsEmpty() { io.WriteString(p.w, " ") } p.Print(nn.UseType) } - if len((*nn.Uses[0].GetMeta())) == 0 { + if nn.Uses[0].GetFreeFloating().IsEmpty() { io.WriteString(p.w, " ") } p.joinPrint(",", nn.Uses) - p.printMeta(nn, meta.SemiColonToken) - if len((*nn.GetMeta())) == 0 { + p.printFreeFloating(nn, freefloating.UseDeclarationList) + + p.printFreeFloating(nn, freefloating.SemiColon) + if nn.GetFreeFloating().IsEmpty() { io.WriteString(p.w, ";") } - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printStmtUse(n node.Node) { nn := n.(*stmt.Use) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) if nn.UseType != nil { p.Print(nn.UseType) - if len((*nn.GetMeta())) == 0 { + if nn.UseType.GetFreeFloating().IsEmpty() { io.WriteString(p.w, " ") } } + p.printFreeFloating(nn, freefloating.Slash) + p.Print(nn.Use) if nn.Alias != nil { - if len((*nn.GetMeta())) == 0 { + if nn.Alias.GetFreeFloating().IsEmpty() { io.WriteString(p.w, " ") } - p.printMeta(nn, meta.AsToken) io.WriteString(p.w, "as") - if len((*nn.Alias.GetMeta())) == 0 { + if nn.Alias.GetFreeFloating().IsEmpty() { io.WriteString(p.w, " ") } p.Print(nn.Alias) } - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } func (p *Printer) printStmtWhile(n node.Node) { nn := n.(*stmt.While) - p.printMeta(nn, meta.NodeStart) + p.printFreeFloating(nn, freefloating.Start) io.WriteString(p.w, "while") - p.printMeta(nn, meta.OpenParenthesisToken) + p.printFreeFloating(nn, freefloating.While) io.WriteString(p.w, "(") p.Print(nn.Cond) - p.printMeta(nn, meta.CloseParenthesisToken) + p.printFreeFloating(nn, freefloating.Expr) io.WriteString(p.w, ")") p.Print(nn.Stmt) - p.printMeta(nn, meta.NodeEnd) + p.printFreeFloating(nn, freefloating.End) } diff --git a/printer/printer_parsed_php5_test.go b/printer/printer_parsed_php5_test.go index 8f8b958..7c074f9 100644 --- a/printer/printer_parsed_php5_test.go +++ b/printer/printer_parsed_php5_test.go @@ -463,9 +463,11 @@ func TestParseAndPrintPhp5Exit(t *testing.T) { src := `HTML"}, &stmt.Expression{ Expr: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, + FreeFloating: freefloating.Collection{ + freefloating.Start: []freefloating.String{ + { + StringType: freefloating.TokenType, + Value: "$", + }, }, }, VarName: &node.Identifier{ @@ -95,11 +95,12 @@ func TestPrinterPrintFileInlineHtml(t *testing.T) { &stmt.InlineHtml{Value: "
HTML
"}, &stmt.Expression{ Expr: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, + FreeFloating: freefloating.Collection{ + freefloating.Start: []freefloating.String{ + { + StringType: freefloating.TokenType, + Value: "$", + }, }, }, VarName: &node.Identifier{ @@ -3901,11 +3902,12 @@ func TestPrinterPrintProperty(t *testing.T) { p := printer.NewPrinter(o) p.Print(&stmt.Property{ Variable: &expr.Variable{ - Meta: meta.Collection{ - &meta.Data{ - Type: meta.TokenType, - Value: "$", - TokenName: meta.NodeStart, + FreeFloating: freefloating.Collection{ + freefloating.Start: []freefloating.String{ + { + StringType: freefloating.TokenType, + Value: "$", + }, }, }, VarName: &node.Identifier{Value: "a"}, diff --git a/scanner/lexer.go b/scanner/lexer.go index e76e0d8..d8b08cc 100644 --- a/scanner/lexer.go +++ b/scanner/lexer.go @@ -9,10 +9,10 @@ import ( "unicode" "github.com/z7zmey/php-parser/errors" + "github.com/z7zmey/php-parser/freefloating" "github.com/z7zmey/php-parser/position" "github.com/cznic/golex/lex" - "github.com/z7zmey/php-parser/meta" ) // Allocate Character classes anywhere in [0x80, 0xFF]. @@ -33,7 +33,7 @@ type Lexer struct { *lex.Lexer StateStack []int PhpDocComment string - Meta meta.Collection + FreeFloating []freefloating.String heredocLabel string tokenBytesBuf *bytes.Buffer TokenPool *TokenPool @@ -74,7 +74,7 @@ func NewLexer(src io.Reader, fName string) *Lexer { Lexer: lx, StateStack: []int{0}, PhpDocComment: "", - Meta: nil, + FreeFloating: nil, heredocLabel: "", tokenBytesBuf: &bytes.Buffer{}, TokenPool: &TokenPool{}, @@ -140,7 +140,7 @@ func (l *Lexer) createToken(chars []lex.Char) *Token { lastChar := chars[len(chars)-1] token := l.TokenPool.Get() - token.Meta = l.Meta + token.FreeFloating = l.FreeFloating token.Value = l.tokenString(chars) // fmt.Println(l.tokenString(chars)) @@ -165,7 +165,7 @@ func (l *Lexer) tokenString(chars []lex.Char) string { // meta -func (l *Lexer) addMeta(mt meta.Type, chars []lex.Char) { +func (l *Lexer) addFreeFloating(t freefloating.StringType, chars []lex.Char) { if !l.WithMeta { return } @@ -180,9 +180,9 @@ func (l *Lexer) addMeta(mt meta.Type, chars []lex.Char) { int(lastChar.Pos()), ) - l.Meta.Push(&meta.Data{ - Value: l.tokenString(chars), - Type: mt, - Position: pos, + l.FreeFloating = append(l.FreeFloating, freefloating.String{ + StringType: t, + Value: l.tokenString(chars), + Position: pos, }) } diff --git a/scanner/scanner.go b/scanner/scanner.go index d2cf8e2..b9a5ae4 100644 --- a/scanner/scanner.go +++ b/scanner/scanner.go @@ -11,7 +11,7 @@ package scanner import ( "fmt" "github.com/cznic/golex/lex" - "github.com/z7zmey/php-parser/meta" + "github.com/z7zmey/php-parser/freefloating" ) const ( @@ -34,7 +34,7 @@ func isValidFirstVarNameRune(r rune) bool { } func (l *Lexer) Lex(lval Lval) int { - l.Meta = nil + l.FreeFloating = nil c := l.Enter() yystate0: @@ -7632,7 +7632,7 @@ yystate611: yyrule1: // [ \t\n\r]+ { - l.addMeta(meta.WhiteSpaceType, l.Token()) + l.addFreeFloating(freefloating.WhiteSpaceType, l.Token()) goto yystate0 } yyrule2: // . @@ -7660,14 +7660,14 @@ yyrule2: // . } yyrule3: // \<\?php([ \t]|{NEW_LINE}) { - l.addMeta(meta.TokenType, l.Token()[:5]) + l.addFreeFloating(freefloating.TokenType, l.Token()[:5]) l.Begin(PHP) l.ungetChars(len(l.Token()) - 5) goto yystate0 } yyrule4: // \<\? { - l.addMeta(meta.TokenType, l.Token()) + l.addFreeFloating(freefloating.TokenType, l.Token()) l.Begin(PHP) goto yystate0 } @@ -7680,7 +7680,7 @@ yyrule5: // \<\?= } yyrule6: // [ \t\n\r]+ { - l.addMeta(meta.WhiteSpaceType, l.Token()) + l.addFreeFloating(freefloating.WhiteSpaceType, l.Token()) goto yystate0 } yyrule7: // [;][ \t\n\r]*\?\>{NEW_LINE}? @@ -8478,13 +8478,13 @@ yyrule126: // (#|[/][/]) } break } - l.addMeta(meta.CommentType, tb) + l.addFreeFloating(freefloating.CommentType, tb) goto yystate0 } yyrule127: // [/][*][*][/] { - l.addMeta(meta.CommentType, l.Token()) + l.addFreeFloating(freefloating.CommentType, l.Token()) goto yystate0 } yyrule128: // ([/][*])|([/][*][*]) @@ -8509,9 +8509,9 @@ yyrule128: // ([/][*])|([/][*][*]) } if is_doc_comment { l.PhpDocComment = string(l.TokenBytes(nil)) - l.addMeta(meta.CommentType, l.Token()) + l.addFreeFloating(freefloating.CommentType, l.Token()) } else { - l.addMeta(meta.CommentType, l.Token()) + l.addFreeFloating(freefloating.CommentType, l.Token()) } goto yystate0 } @@ -8557,7 +8557,7 @@ yyrule134: // -> } yyrule135: // [ \t\n\r]+ { - l.addMeta(meta.WhiteSpaceType, l.Token()) + l.addFreeFloating(freefloating.WhiteSpaceType, l.Token()) goto yystate0 } yyrule136: // -> @@ -9024,7 +9024,7 @@ yyrule167: // . } yyrule168: // .|[ \t\n\r] { - l.addMeta(meta.TokenType, l.Token()) + l.addFreeFloating(freefloating.TokenType, l.Token()) goto yystate0 } yyrule169: // {ANY_CHAR} diff --git a/scanner/scanner.l b/scanner/scanner.l index 365c596..3986e50 100644 --- a/scanner/scanner.l +++ b/scanner/scanner.l @@ -9,7 +9,7 @@ package scanner import ( "fmt" - "github.com/z7zmey/php-parser/meta" + "github.com/z7zmey/php-parser/freefloating" "github.com/cznic/golex/lex" ) @@ -33,9 +33,8 @@ func isValidFirstVarNameRune(r rune) bool { } func (l *Lexer) Lex(lval Lval) int { - l.Meta = nil + l.FreeFloating = nil c := l.Enter() - %} %s PHP STRING STRING_VAR STRING_VAR_INDEX STRING_VAR_NAME PROPERTY HEREDOC_END NOWDOC HEREDOC BACKQUOTE HALT_COMPILER @@ -60,7 +59,7 @@ ANY_CHAR . %% c = l.Rule0() -[ \t\n\r]+ l.addMeta(meta.WhiteSpaceType, l.Token()) +[ \t\n\r]+ l.addFreeFloating(freefloating.WhiteSpaceType, l.Token()) . tb := []lex.Char{} @@ -87,12 +86,12 @@ ANY_CHAR . lval.Token(l.createToken(tb)) return int(T_INLINE_HTML) -\<\?php([ \t]|{NEW_LINE}) l.addMeta(meta.TokenType, l.Token()[:5]);l.Begin(PHP);l.ungetChars(len(l.Token())-5) -\<\? l.addMeta(meta.TokenType, l.Token());l.Begin(PHP); +\<\?php([ \t]|{NEW_LINE}) l.addFreeFloating(freefloating.TokenType, l.Token()[:5]);l.Begin(PHP);l.ungetChars(len(l.Token())-5) +\<\? l.addFreeFloating(freefloating.TokenType, l.Token());l.Begin(PHP); \<\?= l.Begin(PHP);lval.Token(l.createToken(l.Token())); return int(T_ECHO); -[ \t\n\r]+ l.addMeta(meta.WhiteSpaceType, l.Token()) +[ \t\n\r]+ l.addFreeFloating(freefloating.WhiteSpaceType, l.Token()) [;][ \t\n\r]*\?\>{NEW_LINE}? l.Begin(INITIAL);lval.Token(l.createToken(l.Token())); return Rune2Class(';'); \?\>{NEW_LINE}? l.Begin(INITIAL);lval.Token(l.createToken(l.Token())); return Rune2Class(';'); @@ -289,10 +288,10 @@ ANY_CHAR . break; } - l.addMeta(meta.CommentType, tb) + l.addFreeFloating(freefloating.CommentType, tb) [/][*][*][/] - l.addMeta(meta.CommentType, l.Token()) + l.addFreeFloating(freefloating.CommentType, l.Token()) ([/][*])|([/][*][*]) tb := l.Token() is_doc_comment := false @@ -317,9 +316,9 @@ ANY_CHAR . if is_doc_comment { l.PhpDocComment = string(l.TokenBytes(nil)) - l.addMeta(meta.CommentType, l.Token()) + l.addFreeFloating(freefloating.CommentType, l.Token()) } else { - l.addMeta(meta.CommentType, l.Token()) + l.addFreeFloating(freefloating.CommentType, l.Token()) } {OPERATORS} lval.Token(l.createToken(l.Token())); return Rune2Class(rune(l.TokenBytes(nil)[0])) @@ -330,7 +329,7 @@ ANY_CHAR . {VAR_NAME} lval.Token(l.createToken(l.Token())); return int(T_STRING) -> l.Begin(PROPERTY);lval.Token(l.createToken(l.Token())); return int(T_OBJECT_OPERATOR); -[ \t\n\r]+ l.addMeta(meta.WhiteSpaceType, l.Token()) +[ \t\n\r]+ l.addFreeFloating(freefloating.WhiteSpaceType, l.Token()) -> lval.Token(l.createToken(l.Token())); return int(T_OBJECT_OPERATOR); {VAR_NAME} l.Begin(PHP);lval.Token(l.createToken(l.Token())); return int(T_STRING); . l.ungetChars(1);l.Begin(PHP) @@ -674,7 +673,7 @@ ANY_CHAR . {VAR_NAME}[\[\}] l.popState();l.pushState(PHP);lval.Token(l.createToken(l.ungetChars(1))); return int(T_STRING_VARNAME) . l.ungetChars(1);l.popState();l.pushState(PHP) -.|[ \t\n\r] l.addMeta(meta.TokenType, l.Token()) +.|[ \t\n\r] l.addFreeFloating(freefloating.TokenType, l.Token()) {ANY_CHAR} l.Error(fmt.Sprintf("WARNING: Unexpected character in input: '%c' (ASCII=%d)", l.TokenBytes(nil)[0], l.TokenBytes(nil)[0]));l.Abort(); diff --git a/scanner/scanner_test.go b/scanner/scanner_test.go index 06387c4..a4bf5fc 100644 --- a/scanner/scanner_test.go +++ b/scanner/scanner_test.go @@ -5,10 +5,9 @@ import ( "reflect" "testing" + "github.com/z7zmey/php-parser/freefloating" "github.com/z7zmey/php-parser/position" - "github.com/z7zmey/php-parser/meta" - "github.com/z7zmey/php-parser/scanner" "github.com/kylelemons/godebug/pretty" @@ -967,21 +966,21 @@ func TestSlashAfterVariable(t *testing.T) { func TestCommentEnd(t *testing.T) { src := ` test` - expected := meta.Collection{ - &meta.Data{ - Value: " 0 { - fmt.Fprintf(d.Writer, "%v\"Meta\":\n", d.Indent+" ") - for _, m := range *mm { - fmt.Fprintf(d.Writer, "%v%q before %q\n", d.Indent+" ", m, m.TokenName.String()) + if !n.GetFreeFloating().IsEmpty() { + fmt.Fprintf(d.Writer, "%v\"freefloating\":\n", d.Indent+" ") + for key, freeFloatingStrings := range *n.GetFreeFloating() { + for _, freeFloatingString := range freeFloatingStrings { + fmt.Fprintf(d.Writer, "%v%q: %q\n", d.Indent+" ", key.String(), freeFloatingString.Value) + } } } diff --git a/visitor/dumper_test.go b/visitor/dumper_test.go index 6451ca1..d3aea69 100644 --- a/visitor/dumper_test.go +++ b/visitor/dumper_test.go @@ -12,7 +12,7 @@ func ExampleDumper() { src := ` 0 { + if !n.GetFreeFloating().IsEmpty() { printIndent(d.Writer, d.depth) - fmt.Fprint(d.Writer, "Meta: meta.Collection{\n") + fmt.Fprint(d.Writer, "FreeFloating: freefloating.Collection{\n") d.depth++ - for _, m := range *mm { + for key, freeFloatingStrings := range *n.GetFreeFloating() { printIndent(d.Writer, d.depth) - fmt.Fprint(d.Writer, "&meta.Data{\n") + fmt.Fprintf(d.Writer, "%q: []freefloating.String{\n", key) d.depth++ - printIndent(d.Writer, d.depth) - - switch m.Type { - case meta.CommentType: - fmt.Fprint(d.Writer, "Type: meta.CommentType,\n") - case meta.WhiteSpaceType: - fmt.Fprint(d.Writer, "Type: meta.WhiteSpaceType,\n") - case meta.TokenType: - fmt.Fprint(d.Writer, "Type: meta.TokenType,\n") - } - - printIndent(d.Writer, d.depth) - - if m.Position != nil { - fmt.Fprint(d.Writer, "Position: &position.Position{\n") + for _, freeFloatingString := range freeFloatingStrings { + printIndent(d.Writer, d.depth) + fmt.Fprint(d.Writer, "freefloating.String{\n") d.depth++ + printIndent(d.Writer, d.depth) - fmt.Fprintf(d.Writer, "StartLine: %d,\n", m.Position.StartLine) + + switch freeFloatingString.StringType { + case freefloating.CommentType: + fmt.Fprint(d.Writer, "Type: freefloating.CommentType,\n") + case freefloating.WhiteSpaceType: + fmt.Fprint(d.Writer, "Type: freefloating.WhiteSpaceType,\n") + case freefloating.TokenType: + fmt.Fprint(d.Writer, "Type: freefloating.TokenType,\n") + } + printIndent(d.Writer, d.depth) - fmt.Fprintf(d.Writer, "EndLine: %d,\n", m.Position.EndLine) + + if freeFloatingString.Position != nil { + fmt.Fprint(d.Writer, "Position: &position.Position{\n") + d.depth++ + printIndent(d.Writer, d.depth) + fmt.Fprintf(d.Writer, "StartLine: %d,\n", freeFloatingString.Position.StartLine) + printIndent(d.Writer, d.depth) + fmt.Fprintf(d.Writer, "EndLine: %d,\n", freeFloatingString.Position.EndLine) + printIndent(d.Writer, d.depth) + fmt.Fprintf(d.Writer, "StartPos: %d,\n", freeFloatingString.Position.StartPos) + printIndent(d.Writer, d.depth) + fmt.Fprintf(d.Writer, "EndPos: %d,\n", freeFloatingString.Position.EndPos) + d.depth-- + printIndent(d.Writer, d.depth) + fmt.Fprint(d.Writer, "},\n") + } else { + fmt.Fprint(d.Writer, "Position: nil,\n") + } + printIndent(d.Writer, d.depth) - fmt.Fprintf(d.Writer, "StartPos: %d,\n", m.Position.StartPos) - printIndent(d.Writer, d.depth) - fmt.Fprintf(d.Writer, "EndPos: %d,\n", m.Position.EndPos) + fmt.Fprintf(d.Writer, "Value: %q,\n", freeFloatingString.Value) + d.depth-- printIndent(d.Writer, d.depth) fmt.Fprint(d.Writer, "},\n") - } else { - fmt.Fprint(d.Writer, "Position: nil,\n") } - printIndent(d.Writer, d.depth) - fmt.Fprintf(d.Writer, "Value: %q,\n", m.String()) - printIndent(d.Writer, d.depth) - fmt.Fprintf(d.Writer, "TokenName: meta.%s,\n", m.TokenName.String()) - d.depth-- printIndent(d.Writer, d.depth) fmt.Fprint(d.Writer, "},\n") diff --git a/visitor/go_dumper_test.go b/visitor/go_dumper_test.go index c7aa0db..fe467a3 100644 --- a/visitor/go_dumper_test.go +++ b/visitor/go_dumper_test.go @@ -50,50 +50,40 @@ func ExampleGoDumper() { // StartPos: 10, // EndPos: 143, // }, - // Meta: meta.Collection{ - // &meta.Data{ - // Type: meta.TokenType, - // Position: &position.Position{ - // StartLine: 1, - // EndLine: 1, - // StartPos: 1, - // EndPos: 5, + // FreeFloating: freefloating.Collection{ + // "Stmts": []freefloating.String{ + // freefloating.String{ + // Type: freefloating.WhiteSpaceType, + // Position: &position.Position{ + // StartLine: 10, + // EndLine: 11, + // StartPos: 140, + // EndPos: 142, + // }, + // Value: "\n\t\t", // }, - // Value: " 0 { - fmt.Fprintf(d.Writer, ",%q:[", "meta") + if !n.GetFreeFloating().IsEmpty() { + fmt.Fprintf(d.Writer, ",%q:{", "freefloating") - for k, m := range *mm { - if k != 0 { - fmt.Fprint(d.Writer, ",") - } - - switch m.Type { - case meta.CommentType: - fmt.Fprintf(d.Writer, "{%q:%q,%q:%q,%q:%q}", "type", "*meta.CommentType", "value", m.String(), "tokenName", m.TokenName.String()) - case meta.WhiteSpaceType: - fmt.Fprintf(d.Writer, "{%q:%q,%q:%q,%q:%q}", "type", "*meta.WhiteSpaceType", "value", m.String(), "tokenName", m.TokenName.String()) - case meta.TokenType: - fmt.Fprintf(d.Writer, "{%q:%q,%q:%q,%q:%q}", "type", "*meta.TokenType", "value", m.String(), "tokenName", m.TokenName.String()) - } + var freefloatingStringsKeys []int + for key := range *n.GetFreeFloating() { + freefloatingStringsKeys = append(freefloatingStringsKeys, int(key)) } - fmt.Fprint(d.Writer, "]") + sort.Ints(freefloatingStringsKeys) + + i := 0 + for _, k := range freefloatingStringsKeys { + key := freefloating.Position(k) + freeFloatingStrings := (*n.GetFreeFloating())[key] + if i != 0 { + fmt.Fprint(d.Writer, ",") + } + i++ + + fmt.Fprintf(d.Writer, "%q: [", key.String()) + + j := 0 + for _, freeFloatingString := range freeFloatingStrings { + if j != 0 { + fmt.Fprint(d.Writer, ",") + } + j++ + + switch freeFloatingString.StringType { + case freefloating.CommentType: + fmt.Fprintf(d.Writer, "{%q:%q,%q:%q}", "type", "freefloating.CommentType", "value", freeFloatingString.Value) + case freefloating.WhiteSpaceType: + fmt.Fprintf(d.Writer, "{%q:%q,%q:%q}", "type", "freefloating.WhiteSpaceType", "value", freeFloatingString.Value) + case freefloating.TokenType: + fmt.Fprintf(d.Writer, "{%q:%q,%q:%q}", "type", "freefloating.TokenType", "value", freeFloatingString.Value) + } + } + + fmt.Fprint(d.Writer, "]") + } + + fmt.Fprint(d.Writer, "}") } if a := n.Attributes(); len(a) > 0 { diff --git a/visitor/json_dumper_test.go b/visitor/json_dumper_test.go index aacc186..20b1c47 100644 --- a/visitor/json_dumper_test.go +++ b/visitor/json_dumper_test.go @@ -37,5 +37,5 @@ func ExampleJsonDumper() { nodes.Walk(dumper) // Output: - // {"type":"*node.Root","position":{"startPos":10,"endPos":166,"startLine":3,"endLine":12},"Stmts":[{"type":"*stmt.Namespace","position":{"startPos":10,"endPos":166,"startLine":3,"endLine":12},"meta":[{"type":"*meta.TokenType","value":" 0 { + if !n.GetFreeFloating().IsEmpty() { fmt.Fprint(d.Writer, ",\n") d.printIndent(d.Writer) - fmt.Fprint(d.Writer, "\"meta\": [\n") + fmt.Fprint(d.Writer, "\"freefloating\": {\n") d.depth++ - for k, m := range *mm { - if k != 0 { + i := 0 + for key, freeFloatingStrings := range *n.GetFreeFloating() { + if i != 0 { fmt.Fprint(d.Writer, ",\n") } + i++ d.printIndent(d.Writer) - fmt.Fprint(d.Writer, "{\n") + fmt.Fprintf(d.Writer, "%q: [\n", key) d.depth++ - d.printIndent(d.Writer) - switch m.Type { - case meta.CommentType: - fmt.Fprintf(d.Writer, "%q: %q,\n", "type", "*meta.CommentType") - case meta.WhiteSpaceType: - fmt.Fprintf(d.Writer, "%q: %q,\n", "type", "*meta.WhiteSpaceType") - case meta.TokenType: - fmt.Fprintf(d.Writer, "%q: %q,\n", "type", "*meta.TokenType") + + j := 0 + for _, freeFloatingString := range freeFloatingStrings { + if j != 0 { + fmt.Fprint(d.Writer, ",\n") + } + j++ + + d.printIndent(d.Writer) + fmt.Fprint(d.Writer, "{\n") + d.depth++ + d.printIndent(d.Writer) + switch freeFloatingString.StringType { + case freefloating.CommentType: + fmt.Fprintf(d.Writer, "%q: %q,\n", "type", "freefloating.CommentType") + case freefloating.WhiteSpaceType: + fmt.Fprintf(d.Writer, "%q: %q,\n", "type", "freefloating.WhiteSpaceType") + case freefloating.TokenType: + fmt.Fprintf(d.Writer, "%q: %q,\n", "type", "freefloating.TokenType") + } + d.printIndent(d.Writer) + fmt.Fprintf(d.Writer, "%q: %q\n", "value", freeFloatingString.Value) + d.depth-- + d.printIndent(d.Writer) + fmt.Fprint(d.Writer, "}") } - d.printIndent(d.Writer) - fmt.Fprintf(d.Writer, "%q: %q,\n", "value", m.String()) - d.printIndent(d.Writer) - fmt.Fprintf(d.Writer, "%q: %q\n", "tokenName", m.TokenName.String()) + d.depth-- + fmt.Fprint(d.Writer, "\n") d.printIndent(d.Writer) - fmt.Fprint(d.Writer, "}") + fmt.Fprint(d.Writer, "]") } d.depth-- fmt.Fprint(d.Writer, "\n") d.printIndent(d.Writer) - fmt.Fprint(d.Writer, "]") + fmt.Fprint(d.Writer, "}") } if a := n.Attributes(); len(a) > 0 { diff --git a/visitor/pretty_json_dumper_test.go b/visitor/pretty_json_dumper_test.go index 2dd72b8..d5b66e4 100644 --- a/visitor/pretty_json_dumper_test.go +++ b/visitor/pretty_json_dumper_test.go @@ -47,13 +47,14 @@ func ExamplePrettyJsonDumper() { // "startLine": 3, // "endLine": 16 // }, - // "meta": [ - // { - // "type": "*meta.WhiteSpaceType", - // "value": "\n\t\t", - // "tokenName": "NodeEnd" - // } - // ], + // "freefloating": { + // "End": [ + // { + // "type": "freefloating.WhiteSpaceType", + // "value": "\n\t\t" + // } + // ] + // }, // "Stmts": [ // { // "type": "*stmt.Namespace", @@ -63,28 +64,24 @@ func ExamplePrettyJsonDumper() { // "startLine": 3, // "endLine": 16 // }, - // "meta": [ - // { - // "type": "*meta.TokenType", - // "value": " Date: Mon, 25 Feb 2019 16:11:51 +0200 Subject: [PATCH 113/117] remove karrick/godirwalk --- main.go | 34 +++++++++------------------------- 1 file changed, 9 insertions(+), 25 deletions(-) diff --git a/main.go b/main.go index 3d0a4df..d71eec2 100644 --- a/main.go +++ b/main.go @@ -12,7 +12,6 @@ import ( "runtime" "sync" - "github.com/karrick/godirwalk" "github.com/pkg/profile" "github.com/yookoala/realpath" "github.com/z7zmey/php-parser/parser" @@ -81,31 +80,16 @@ func processPath(pathList []string, fileCh chan<- *file) { real, err := realpath.Realpath(path) checkErr(err) - s, err := os.Stat(real) + err = filepath.Walk(real, func(path string, f os.FileInfo, err error) error { + if !f.IsDir() && filepath.Ext(path) == ".php" { + wg.Add(1) + content, err := ioutil.ReadFile(path) + checkErr(err) + fileCh <- &file{path, content} + } + return nil + }) checkErr(err) - - if !s.IsDir() { - wg.Add(1) - content, err := ioutil.ReadFile(real) - checkErr(err) - fileCh <- &file{real, content} - } else { - godirwalk.Walk(real, &godirwalk.Options{ - Unsorted: true, - Callback: func(osPathname string, de *godirwalk.Dirent) error { - if !de.IsDir() && filepath.Ext(osPathname) == ".php" { - wg.Add(1) - content, err := ioutil.ReadFile(osPathname) - checkErr(err) - fileCh <- &file{osPathname, content} - } - return nil - }, - ErrorCallback: func(osPathname string, err error) godirwalk.ErrorAction { - return godirwalk.SkipNode - }, - }) - } } } From a7229f53ddf383c2eab92f83bb8ba287588c7ace Mon Sep 17 00:00:00 2001 From: z7zmey Date: Mon, 25 Feb 2019 16:52:47 +0200 Subject: [PATCH 114/117] rename flag -meta to -ff --- main.go | 8 +++---- parser/parser.go | 2 +- php5/parser.go | 14 +++++------ php7/parser.go | 14 +++++------ printer/printer_parsed_php5_test.go | 2 +- printer/printer_parsed_php7_test.go | 4 ++-- scanner/lexer.go | 22 +++++++++--------- scanner/scanner_test.go | 36 ++++++++++++++--------------- visitor/dumper_test.go | 2 +- visitor/go_dumper_test.go | 2 +- visitor/json_dumper_test.go | 2 +- visitor/pretty_json_dumper_test.go | 2 +- 12 files changed, 55 insertions(+), 55 deletions(-) diff --git a/main.go b/main.go index d71eec2..a0a2dc1 100644 --- a/main.go +++ b/main.go @@ -25,7 +25,7 @@ var wg sync.WaitGroup var usePhp5 *bool var dumpType string var profiler string -var withMeta *bool +var withFreeFloating *bool var showResolvedNs *bool var printBack *bool @@ -36,7 +36,7 @@ type file struct { func main() { usePhp5 = flag.Bool("php5", false, "parse as PHP5") - withMeta = flag.Bool("meta", false, "show meta") + withFreeFloating = flag.Bool("ff", false, "parse and show free floating strings") showResolvedNs = flag.Bool("r", false, "resolve names") printBack = flag.Bool("pb", false, "print AST back into the parsed file") flag.StringVar(&dumpType, "d", "", "dump format: [custom, go, json, pretty_json]") @@ -110,8 +110,8 @@ func parserWorker(fileCh <-chan *file, result chan<- parser.Parser) { parserWorker = php7.NewParser(src, f.path) } - if *withMeta { - parserWorker.WithMeta() + if *withFreeFloating { + parserWorker.WithFreeFloating() } parserWorker.Parse() diff --git a/parser/parser.go b/parser/parser.go index 7fb233b..f2a583c 100644 --- a/parser/parser.go +++ b/parser/parser.go @@ -11,5 +11,5 @@ type Parser interface { GetPath() string GetRootNode() node.Node GetErrors() []*errors.Error - WithMeta() + WithFreeFloating() } diff --git a/php5/parser.go b/php5/parser.go index a45b602..df3d665 100644 --- a/php5/parser.go +++ b/php5/parser.go @@ -57,8 +57,8 @@ func (l *Parser) Error(msg string) { l.Lexer.Errors = append(l.Lexer.Errors, errors.NewError(msg, pos)) } -func (l *Parser) WithMeta() { - l.Lexer.WithMeta = true +func (l *Parser) WithFreeFloating() { + l.Lexer.WithFreeFloating = true } // Parse the php7 Parser entrypoint @@ -106,7 +106,7 @@ func isDollar(r rune) bool { } func (l *Parser) MoveFreeFloating(src node.Node, dst node.Node) { - if l.Lexer.WithMeta == false { + if l.Lexer.WithFreeFloating == false { return } @@ -119,7 +119,7 @@ func (l *Parser) MoveFreeFloating(src node.Node, dst node.Node) { } func (l *Parser) setFreeFloating(dst node.Node, p freefloating.Position, strings []freefloating.String) { - if l.Lexer.WithMeta == false { + if l.Lexer.WithFreeFloating == false { return } @@ -136,7 +136,7 @@ func (l *Parser) setFreeFloating(dst node.Node, p freefloating.Position, strings } func (l *Parser) GetFreeFloatingToken(t *scanner.Token) []freefloating.String { - if l.Lexer.WithMeta == false { + if l.Lexer.WithFreeFloating == false { return []freefloating.String{} } @@ -144,7 +144,7 @@ func (l *Parser) GetFreeFloatingToken(t *scanner.Token) []freefloating.String { } func (l *Parser) addDollarToken(v node.Node) { - if l.Lexer.WithMeta == false { + if l.Lexer.WithFreeFloating == false { return } @@ -163,7 +163,7 @@ func (l *Parser) addDollarToken(v node.Node) { } func (l *Parser) splitSemiColonAndPhpCloseTag(htmlNode node.Node, prevNode node.Node) { - if l.Lexer.WithMeta == false { + if l.Lexer.WithFreeFloating == false { return } diff --git a/php7/parser.go b/php7/parser.go index 159b2eb..a161e52 100644 --- a/php7/parser.go +++ b/php7/parser.go @@ -56,8 +56,8 @@ func (l *Parser) Error(msg string) { l.Lexer.Errors = append(l.Lexer.Errors, errors.NewError(msg, pos)) } -func (l *Parser) WithMeta() { - l.Lexer.WithMeta = true +func (l *Parser) WithFreeFloating() { + l.Lexer.WithFreeFloating = true } // Parse the php7 Parser entrypoint @@ -105,7 +105,7 @@ func isDollar(r rune) bool { } func (l *Parser) MoveFreeFloating(src node.Node, dst node.Node) { - if l.Lexer.WithMeta == false { + if l.Lexer.WithFreeFloating == false { return } @@ -118,7 +118,7 @@ func (l *Parser) MoveFreeFloating(src node.Node, dst node.Node) { } func (l *Parser) setFreeFloating(dst node.Node, p freefloating.Position, strings []freefloating.String) { - if l.Lexer.WithMeta == false { + if l.Lexer.WithFreeFloating == false { return } @@ -135,7 +135,7 @@ func (l *Parser) setFreeFloating(dst node.Node, p freefloating.Position, strings } func (l *Parser) GetFreeFloatingToken(t *scanner.Token) []freefloating.String { - if l.Lexer.WithMeta == false { + if l.Lexer.WithFreeFloating == false { return []freefloating.String{} } @@ -143,7 +143,7 @@ func (l *Parser) GetFreeFloatingToken(t *scanner.Token) []freefloating.String { } func (l *Parser) addDollarToken(v node.Node) { - if l.Lexer.WithMeta == false { + if l.Lexer.WithFreeFloating == false { return } @@ -162,7 +162,7 @@ func (l *Parser) addDollarToken(v node.Node) { } func (l *Parser) splitSemiColonAndPhpCloseTag(htmlNode node.Node, prevNode node.Node) { - if l.Lexer.WithMeta == false { + if l.Lexer.WithFreeFloating == false { return } diff --git a/printer/printer_parsed_php5_test.go b/printer/printer_parsed_php5_test.go index 7c074f9..a860ee2 100644 --- a/printer/printer_parsed_php5_test.go +++ b/printer/printer_parsed_php5_test.go @@ -11,7 +11,7 @@ import ( func parsePhp5(src string) node.Node { php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php") - php5parser.WithMeta() + php5parser.WithFreeFloating() php5parser.Parse() return php5parser.GetRootNode() diff --git a/printer/printer_parsed_php7_test.go b/printer/printer_parsed_php7_test.go index 7aaa088..7585e2c 100644 --- a/printer/printer_parsed_php7_test.go +++ b/printer/printer_parsed_php7_test.go @@ -30,7 +30,7 @@ abstract class Bar extends Baz // parse php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php") - php7parser.WithMeta() + php7parser.WithFreeFloating() php7parser.Parse() rootNode := php7parser.GetRootNode() @@ -62,7 +62,7 @@ abstract class Bar extends Baz func parse(src string) node.Node { php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php") - php7parser.WithMeta() + php7parser.WithFreeFloating() php7parser.Parse() return php7parser.GetRootNode() diff --git a/scanner/lexer.go b/scanner/lexer.go index d8b08cc..52d47c7 100644 --- a/scanner/lexer.go +++ b/scanner/lexer.go @@ -31,15 +31,15 @@ type Lval interface { // Lexer php lexer type Lexer struct { *lex.Lexer - StateStack []int - PhpDocComment string - FreeFloating []freefloating.String - heredocLabel string - tokenBytesBuf *bytes.Buffer - TokenPool *TokenPool - WithMeta bool - lastToken *Token - Errors []*errors.Error + StateStack []int + PhpDocComment string + FreeFloating []freefloating.String + heredocLabel string + tokenBytesBuf *bytes.Buffer + TokenPool *TokenPool + WithFreeFloating bool + lastToken *Token + Errors []*errors.Error } // Rune2Class returns the rune integer id @@ -163,10 +163,10 @@ func (l *Lexer) tokenString(chars []lex.Char) string { return string(l.tokenBytesBuf.Bytes()) } -// meta +// free-floating func (l *Lexer) addFreeFloating(t freefloating.StringType, chars []lex.Char) { - if !l.WithMeta { + if !l.WithFreeFloating { return } diff --git a/scanner/scanner_test.go b/scanner/scanner_test.go index a4bf5fc..9bcaf2f 100644 --- a/scanner/scanner_test.go +++ b/scanner/scanner_test.go @@ -414,7 +414,7 @@ func TestTokens(t *testing.T) { } lexer := scanner.NewLexer(bytes.NewBufferString(src), "test.php") - lexer.WithMeta = true + lexer.WithFreeFloating = true lv := &lval{} actual := []string{} @@ -550,7 +550,7 @@ func TestTeplateStringTokens(t *testing.T) { } lexer := scanner.NewLexer(bytes.NewBufferString(src), "test.php") - lexer.WithMeta = true + lexer.WithFreeFloating = true lv := &lval{} actual := []string{} @@ -636,7 +636,7 @@ func TestBackquoteStringTokens(t *testing.T) { } lexer := scanner.NewLexer(bytes.NewBufferString(src), "test.php") - lexer.WithMeta = true + lexer.WithFreeFloating = true lv := &lval{} actual := []string{} @@ -731,7 +731,7 @@ CAT; } lexer := scanner.NewLexer(bytes.NewBufferString(src), "test.php") - lexer.WithMeta = true + lexer.WithFreeFloating = true lv := &lval{} actual := []string{} @@ -803,7 +803,7 @@ CAT } lexer := scanner.NewLexer(bytes.NewBufferString(src), "test.php") - lexer.WithMeta = true + lexer.WithFreeFloating = true lv := &lval{} actual := []string{} @@ -842,7 +842,7 @@ CAT; } lexer := scanner.NewLexer(bytes.NewBufferString(src), "test.php") - lexer.WithMeta = true + lexer.WithFreeFloating = true lv := &lval{} actual := []string{} @@ -875,7 +875,7 @@ func TestInlineHtmlNopTokens(t *testing.T) { } lexer := scanner.NewLexer(bytes.NewBufferString(src), "test.php") - lexer.WithMeta = true + lexer.WithFreeFloating = true lv := &lval{} actual := []string{} @@ -985,7 +985,7 @@ func TestCommentEnd(t *testing.T) { } lexer := scanner.NewLexer(bytes.NewBufferString(src), "test.php") - lexer.WithMeta = true + lexer.WithFreeFloating = true lv := &lval{} lexer.Lex(lv) @@ -1017,7 +1017,7 @@ func TestCommentNewLine(t *testing.T) { } lexer := scanner.NewLexer(bytes.NewBufferString(src), "test.php") - lexer.WithMeta = true + lexer.WithFreeFloating = true lv := &lval{} lexer.Lex(lv) @@ -1049,7 +1049,7 @@ func TestCommentNewLine1(t *testing.T) { } lexer := scanner.NewLexer(bytes.NewBufferString(src), "test.php") - lexer.WithMeta = true + lexer.WithFreeFloating = true lv := &lval{} lexer.Lex(lv) @@ -1081,7 +1081,7 @@ func TestCommentNewLine2(t *testing.T) { } lexer := scanner.NewLexer(bytes.NewBufferString(src), "test.php") - lexer.WithMeta = true + lexer.WithFreeFloating = true lv := &lval{} lexer.Lex(lv) @@ -1114,7 +1114,7 @@ func TestCommentWithPhpEndTag(t *testing.T) { } lexer := scanner.NewLexer(bytes.NewBufferString(src), "test.php") - lexer.WithMeta = true + lexer.WithFreeFloating = true lv := &lval{} lexer.Lex(lv) @@ -1147,7 +1147,7 @@ func TestInlineComment(t *testing.T) { } lexer := scanner.NewLexer(bytes.NewBufferString(src), "test.php") - lexer.WithMeta = true + lexer.WithFreeFloating = true lv := &lval{} lexer.Lex(lv) @@ -1180,7 +1180,7 @@ func TestInlineComment2(t *testing.T) { } lexer := scanner.NewLexer(bytes.NewBufferString(src), "test.php") - lexer.WithMeta = true + lexer.WithFreeFloating = true lv := &lval{} lexer.Lex(lv) @@ -1218,7 +1218,7 @@ func TestEmptyInlineComment(t *testing.T) { } lexer := scanner.NewLexer(bytes.NewBufferString(src), "test.php") - lexer.WithMeta = true + lexer.WithFreeFloating = true lv := &lval{} lexer.Lex(lv) @@ -1251,7 +1251,7 @@ func TestEmptyInlineComment2(t *testing.T) { } lexer := scanner.NewLexer(bytes.NewBufferString(src), "test.php") - lexer.WithMeta = true + lexer.WithFreeFloating = true lv := &lval{} lexer.Lex(lv) @@ -1266,7 +1266,7 @@ func TestMethodCallTokens(t *testing.T) { $a -> bar ( '' ) ;` lexer := scanner.NewLexer(bytes.NewBufferString(src), "test.php") - lexer.WithMeta = true + lexer.WithFreeFloating = true lv := &lval{} expected := []freefloating.String{ @@ -1357,7 +1357,7 @@ func TestYieldFromTokens(t *testing.T) { yield from $a` lexer := scanner.NewLexer(bytes.NewBufferString(src), "test.php") - lexer.WithMeta = true + lexer.WithFreeFloating = true lv := &lval{} expected := []freefloating.String{ diff --git a/visitor/dumper_test.go b/visitor/dumper_test.go index d3aea69..c5dc4d4 100644 --- a/visitor/dumper_test.go +++ b/visitor/dumper_test.go @@ -22,7 +22,7 @@ func ExampleDumper() { }` php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php") - php7parser.WithMeta() + php7parser.WithFreeFloating() php7parser.Parse() nodes := php7parser.GetRootNode() diff --git a/visitor/go_dumper_test.go b/visitor/go_dumper_test.go index fe467a3..d7cf0ef 100644 --- a/visitor/go_dumper_test.go +++ b/visitor/go_dumper_test.go @@ -22,7 +22,7 @@ func ExampleGoDumper() { }` php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php") - php7parser.WithMeta() + php7parser.WithFreeFloating() php7parser.Parse() nodes := php7parser.GetRootNode() diff --git a/visitor/json_dumper_test.go b/visitor/json_dumper_test.go index 20b1c47..13243c2 100644 --- a/visitor/json_dumper_test.go +++ b/visitor/json_dumper_test.go @@ -23,7 +23,7 @@ func ExampleJsonDumper() { }` php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php") - php7parser.WithMeta() + php7parser.WithFreeFloating() php7parser.Parse() nodes := php7parser.GetRootNode() diff --git a/visitor/pretty_json_dumper_test.go b/visitor/pretty_json_dumper_test.go index d5b66e4..180efff 100644 --- a/visitor/pretty_json_dumper_test.go +++ b/visitor/pretty_json_dumper_test.go @@ -28,7 +28,7 @@ func ExamplePrettyJsonDumper() { ` php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php") - php7parser.WithMeta() + php7parser.WithFreeFloating() php7parser.Parse() nodes := php7parser.GetRootNode() From c456fa90ceb687442061c6488c17afdc6230405a Mon Sep 17 00:00:00 2001 From: z7zmey Date: Mon, 25 Feb 2019 17:01:06 +0200 Subject: [PATCH 115/117] update README.md --- README.md | 96 ++++--------------------------------------------------- 1 file changed, 6 insertions(+), 90 deletions(-) diff --git a/README.md b/README.md index ec37a4b..c932164 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,3 @@ - - PHP Parser written in Go ======================== @@ -26,13 +19,13 @@ Features: - Fully support PHP 5 and PHP 7 syntax - Abstract syntax tree (AST) representation - Traversing AST -- Namespace resolver -- Able to parse syntax-invalid PHP files +- Resolving namespaced names +- Parsing syntax-invalid PHP files +- Saving and printing free-floating comments and whitespaces Roadmap ------- -- Pretty printer - Control Flow Graph (CFG) - PhpDocComment parser - Stabilize api @@ -53,11 +46,10 @@ php-parser [flags] ... | flag | type | description | |-------|------|----------------------------------------------| -| -d |string| dump format: [custom, go, json, pretty-json] | -| -p | bool | show positions | -| -r | bool | resolve names | +| -d |string| dump format: [custom, go, json, pretty-json] | +| -r | bool | resolve names | +| -ff | bool | parse and show free floating strings | | -prof |string| start profiler: [cpu, mem, trace] | -| -meta | bool | show meta info | | -php5 | bool | parse as PHP5 | Dump AST to stdout. @@ -106,79 +98,3 @@ Namespace resolver is a visitor that resolves nodes fully qualified name and sav - For `Class`, `Interface`, `Trait`, `Function`, `Constant` nodes it saves name with current namespace. - For `Name`, `Relative`, `FullyQualified` nodes it resolves `use` aliases and saves a fully qualified name. - -Parsing syntax-invalid PHP files --------------------------------- - -If we try to parse `$a$b;` then the parser triggers error 'syntax error: unexpected T_VARIABLE'. Token `$b` is unexpected, but parser recovers parsing process and returns `$b;` statement to AST, because it is syntactically correct. - -Pretty printer [work in progress] ---------------------------------- - -```Golang -nodes := &stmt.StmtList{ - Stmts: []node.Node{ - &stmt.Namespace{ - NamespaceName: &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "Foo"}, - }, - }, - }, - &stmt.Class{ - Modifiers: []node.Node{ - &node.Identifier{Value: "abstract"}, - }, - ClassName: &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "Bar"}, - }, - }, - Extends: &stmt.ClassExtends{ - ClassName: &name.Name{ - Parts: []node.Node{ - &name.NamePart{ - Value: "Baz" - }, - }, - }, - }, - Stmts: []node.Node{ - &stmt.ClassMethod{ - Modifiers: []node.Node{ - &node.Identifier{Value: "public"}, - }, - MethodName: &node.Identifier{Value: "greet"}, - Stmt: &stmt.StmtList{ - Stmts: []node.Node{ - &stmt.Echo{ - Exprs: []node.Node{ - &scalar.String{Value: "'Hello world'"}, - }, - }, - }, - }, - }, - }, - }, - }, -} - -file := os.Stdout -p := printer.NewPrinter(file, " ") -p.Print(nodes) -``` - -It prints to stdout: - -```PHP - Date: Mon, 25 Feb 2019 17:59:06 +0200 Subject: [PATCH 116/117] update .travis.yml --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 01803e1..3288aca 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ branches: - master before_script: - go get -u golang.org/x/tools/cmd/goyacc - - go get -u github.com/kylelemons/godebug/pretty + - go get -u github.com/pkg/profile - go get -u github.com/cznic/golex/lex - go get -u github.com/yookoala/realpath - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter From 32d9c634d1bd879d4c7e52446032393c7b2ffe27 Mon Sep 17 00:00:00 2001 From: z7zmey Date: Mon, 25 Feb 2019 18:11:28 +0200 Subject: [PATCH 117/117] remove kylelemons/godebug --- .travis.yml | 1 + errors/error_test.go | 25 ++------ node/scalar/t_visitor_test.go | 23 +++----- scanner/scanner_test.go | 92 ++++++++++++------------------ visitor/namespace_resolver_test.go | 69 +++++++++------------- 5 files changed, 78 insertions(+), 132 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3288aca..4abba27 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,6 +3,7 @@ branches: only: - master before_script: + - go get -u gotest.tools/assert - go get -u golang.org/x/tools/cmd/goyacc - go get -u github.com/pkg/profile - go get -u github.com/cznic/golex/lex diff --git a/errors/error_test.go b/errors/error_test.go index 8d563ea..439157e 100644 --- a/errors/error_test.go +++ b/errors/error_test.go @@ -1,29 +1,14 @@ package errors_test import ( - "reflect" "testing" - "github.com/z7zmey/php-parser/position" + "gotest.tools/assert" "github.com/z7zmey/php-parser/errors" - - "github.com/kylelemons/godebug/pretty" + "github.com/z7zmey/php-parser/position" ) -func assertEqual(t *testing.T, expected interface{}, actual interface{}) { - if !reflect.DeepEqual(expected, actual) { - diff := pretty.Compare(expected, actual) - - if diff != "" { - t.Errorf("diff: (-expected +actual)\n%s", diff) - } else { - t.Errorf("expected and actual are not equal\n") - } - - } -} - func TestConstructor(t *testing.T) { pos := position.NewPosition(1, 2, 3, 4) @@ -34,7 +19,7 @@ func TestConstructor(t *testing.T) { Pos: pos, } - assertEqual(t, expected, actual) + assert.DeepEqual(t, expected, actual) } func TestPrint(t *testing.T) { @@ -46,7 +31,7 @@ func TestPrint(t *testing.T) { expected := "message at line 1" - assertEqual(t, expected, actual) + assert.DeepEqual(t, expected, actual) } func TestPrintWithotPos(t *testing.T) { @@ -56,5 +41,5 @@ func TestPrintWithotPos(t *testing.T) { expected := "message" - assertEqual(t, expected, actual) + assert.DeepEqual(t, expected, actual) } diff --git a/node/scalar/t_visitor_test.go b/node/scalar/t_visitor_test.go index f3bc581..85d7b63 100644 --- a/node/scalar/t_visitor_test.go +++ b/node/scalar/t_visitor_test.go @@ -1,10 +1,10 @@ package scalar_test import ( - "reflect" "testing" - "github.com/kylelemons/godebug/pretty" + "gotest.tools/assert" + "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node/scalar" "github.com/z7zmey/php-parser/walker" @@ -70,31 +70,25 @@ func (v *visitorMock) LeaveChildList(key string, w walker.Walkable) {} func TestNameVisitorDisableChildren(t *testing.T) { for _, tt := range nameNodesTests { - v := &visitorMock{false, nil} + v := &visitorMock{false, []string{}} tt.node.Walk(v) expected := []string{} actual := v.visitedKeys - diff := pretty.Compare(expected, actual) - if diff != "" { - t.Errorf("%s diff: (-expected +actual)\n%s", reflect.TypeOf(tt.node), diff) - } + assert.DeepEqual(t, expected, actual) } } func TestNameVisitor(t *testing.T) { for _, tt := range nameNodesTests { - v := &visitorMock{true, nil} + v := &visitorMock{true, []string{}} tt.node.Walk(v) expected := tt.expectedVisitedKeys actual := v.visitedKeys - diff := pretty.Compare(expected, actual) - if diff != "" { - t.Errorf("%s diff: (-expected +actual)\n%s", reflect.TypeOf(tt.node), diff) - } + assert.DeepEqual(t, expected, actual) } } @@ -105,9 +99,6 @@ func TestNameAttributes(t *testing.T) { expected := tt.expectedAttributes actual := tt.node.Attributes() - diff := pretty.Compare(expected, actual) - if diff != "" { - t.Errorf("%s diff: (-expected +actual)\n%s", reflect.TypeOf(tt.node), diff) - } + assert.DeepEqual(t, expected, actual) } } diff --git a/scanner/scanner_test.go b/scanner/scanner_test.go index 9bcaf2f..68127d1 100644 --- a/scanner/scanner_test.go +++ b/scanner/scanner_test.go @@ -2,30 +2,14 @@ package scanner_test import ( "bytes" - "reflect" "testing" "github.com/z7zmey/php-parser/freefloating" "github.com/z7zmey/php-parser/position" - "github.com/z7zmey/php-parser/scanner" - - "github.com/kylelemons/godebug/pretty" + "gotest.tools/assert" ) -func assertEqual(t *testing.T, expected interface{}, actual interface{}) { - if !reflect.DeepEqual(expected, actual) { - diff := pretty.Compare(expected, actual) - - if diff != "" { - t.Errorf("diff: (-expected +actual)\n%s", diff) - } else { - t.Errorf("expected and actual are not equal\n") - } - - } -} - type lval struct { Tkn *scanner.Token } @@ -427,7 +411,7 @@ func TestTokens(t *testing.T) { actual = append(actual, scanner.LexerToken(token).String()) } - assertEqual(t, expected, actual) + assert.DeepEqual(t, expected, actual) } func TestSingleQuoteStringTokens(t *testing.T) { @@ -474,7 +458,7 @@ func TestSingleQuoteStringTokens(t *testing.T) { actual = append(actual, scanner.LexerToken(token).String()) } - assertEqual(t, expected, actual) + assert.DeepEqual(t, expected, actual) } func TestTeplateStringTokens(t *testing.T) { @@ -563,7 +547,7 @@ func TestTeplateStringTokens(t *testing.T) { actual = append(actual, scanner.LexerToken(token).String()) } - assertEqual(t, expected, actual) + assert.DeepEqual(t, expected, actual) } func TestBackquoteStringTokens(t *testing.T) { @@ -649,7 +633,7 @@ func TestBackquoteStringTokens(t *testing.T) { actual = append(actual, scanner.LexerToken(token).String()) } - assertEqual(t, expected, actual) + assert.DeepEqual(t, expected, actual) } func TestHereDocTokens(t *testing.T) { @@ -744,7 +728,7 @@ CAT; actual = append(actual, scanner.LexerToken(token).String()) } - assertEqual(t, expected, actual) + assert.DeepEqual(t, expected, actual) } func TestHereDocTokens2(t *testing.T) { @@ -816,7 +800,7 @@ CAT actual = append(actual, scanner.LexerToken(token).String()) } - assertEqual(t, expected, actual) + assert.DeepEqual(t, expected, actual) } func TestHereDocTokens3(t *testing.T) { @@ -855,7 +839,7 @@ CAT; actual = append(actual, scanner.LexerToken(token).String()) } - assertEqual(t, expected, actual) + assert.DeepEqual(t, expected, actual) } func TestInlineHtmlNopTokens(t *testing.T) { @@ -888,7 +872,7 @@ func TestInlineHtmlNopTokens(t *testing.T) { actual = append(actual, scanner.LexerToken(token).String()) } - assertEqual(t, expected, actual) + assert.DeepEqual(t, expected, actual) } func TestStringTokensAfterVariable(t *testing.T) { @@ -925,8 +909,8 @@ func TestStringTokensAfterVariable(t *testing.T) { actual = append(actual, scanner.LexerToken(token).String()) } - assertEqual(t, expected, actual) - assertEqual(t, expectedTokens, actualTokens) + assert.DeepEqual(t, expected, actual) + assert.DeepEqual(t, expectedTokens, actualTokens) } func TestSlashAfterVariable(t *testing.T) { @@ -959,8 +943,8 @@ func TestSlashAfterVariable(t *testing.T) { actual = append(actual, scanner.LexerToken(token).String()) } - assertEqual(t, expected, actual) - assertEqual(t, expectedTokens, actualTokens) + assert.DeepEqual(t, expected, actual) + assert.DeepEqual(t, expectedTokens, actualTokens) } func TestCommentEnd(t *testing.T) { @@ -992,7 +976,7 @@ func TestCommentEnd(t *testing.T) { actual := lexer.FreeFloating - assertEqual(t, expected, actual) + assert.DeepEqual(t, expected, actual) } func TestCommentNewLine(t *testing.T) { @@ -1024,7 +1008,7 @@ func TestCommentNewLine(t *testing.T) { actual := lv.Tkn.FreeFloating - assertEqual(t, expected, actual) + assert.DeepEqual(t, expected, actual) } func TestCommentNewLine1(t *testing.T) { @@ -1056,7 +1040,7 @@ func TestCommentNewLine1(t *testing.T) { actual := lv.Tkn.FreeFloating - assertEqual(t, expected, actual) + assert.DeepEqual(t, expected, actual) } func TestCommentNewLine2(t *testing.T) { @@ -1088,7 +1072,7 @@ func TestCommentNewLine2(t *testing.T) { actual := lv.Tkn.FreeFloating - assertEqual(t, expected, actual) + assert.DeepEqual(t, expected, actual) } func TestCommentWithPhpEndTag(t *testing.T) { @@ -1121,7 +1105,7 @@ func TestCommentWithPhpEndTag(t *testing.T) { actual := lv.Tkn.FreeFloating - assertEqual(t, expected, actual) + assert.DeepEqual(t, expected, actual) } func TestInlineComment(t *testing.T) { @@ -1154,7 +1138,7 @@ func TestInlineComment(t *testing.T) { actual := lv.Tkn.FreeFloating - assertEqual(t, expected, actual) + assert.DeepEqual(t, expected, actual) } func TestInlineComment2(t *testing.T) { @@ -1187,7 +1171,7 @@ func TestInlineComment2(t *testing.T) { actual := lexer.FreeFloating - assertEqual(t, expected, actual) + assert.DeepEqual(t, expected, actual) } func TestEmptyInlineComment(t *testing.T) { @@ -1225,7 +1209,7 @@ func TestEmptyInlineComment(t *testing.T) { actual := lexer.FreeFloating - assertEqual(t, expected, actual) + assert.DeepEqual(t, expected, actual) } func TestEmptyInlineComment2(t *testing.T) { @@ -1258,7 +1242,7 @@ func TestEmptyInlineComment2(t *testing.T) { actual := lv.Tkn.FreeFloating - assertEqual(t, expected, actual) + assert.DeepEqual(t, expected, actual) } func TestMethodCallTokens(t *testing.T) { @@ -1283,7 +1267,7 @@ func TestMethodCallTokens(t *testing.T) { } lexer.Lex(lv) actual := lv.Tkn.FreeFloating - assertEqual(t, expected, actual) + assert.DeepEqual(t, expected, actual) expected = []freefloating.String{ { @@ -1294,7 +1278,7 @@ func TestMethodCallTokens(t *testing.T) { } lexer.Lex(lv) actual = lv.Tkn.FreeFloating - assertEqual(t, expected, actual) + assert.DeepEqual(t, expected, actual) expected = []freefloating.String{ { @@ -1305,7 +1289,7 @@ func TestMethodCallTokens(t *testing.T) { } lexer.Lex(lv) actual = lv.Tkn.FreeFloating - assertEqual(t, expected, actual) + assert.DeepEqual(t, expected, actual) expected = []freefloating.String{ { @@ -1316,7 +1300,7 @@ func TestMethodCallTokens(t *testing.T) { } lexer.Lex(lv) actual = lv.Tkn.FreeFloating - assertEqual(t, expected, actual) + assert.DeepEqual(t, expected, actual) expected = []freefloating.String{ { @@ -1327,7 +1311,7 @@ func TestMethodCallTokens(t *testing.T) { } lexer.Lex(lv) actual = lv.Tkn.FreeFloating - assertEqual(t, expected, actual) + assert.DeepEqual(t, expected, actual) expected = []freefloating.String{ { @@ -1338,7 +1322,7 @@ func TestMethodCallTokens(t *testing.T) { } lexer.Lex(lv) actual = lv.Tkn.FreeFloating - assertEqual(t, expected, actual) + assert.DeepEqual(t, expected, actual) expected = []freefloating.String{ { @@ -1349,7 +1333,7 @@ func TestMethodCallTokens(t *testing.T) { } lexer.Lex(lv) actual = lv.Tkn.FreeFloating - assertEqual(t, expected, actual) + assert.DeepEqual(t, expected, actual) } func TestYieldFromTokens(t *testing.T) { @@ -1374,7 +1358,7 @@ func TestYieldFromTokens(t *testing.T) { } lexer.Lex(lv) actual := lv.Tkn.FreeFloating - assertEqual(t, expected, actual) + assert.DeepEqual(t, expected, actual) expected = []freefloating.String{ { @@ -1385,7 +1369,7 @@ func TestYieldFromTokens(t *testing.T) { } lexer.Lex(lv) actual = lv.Tkn.FreeFloating - assertEqual(t, expected, actual) + assert.DeepEqual(t, expected, actual) } func TestIgnoreControllCharacters(t *testing.T) { @@ -1397,12 +1381,12 @@ func TestIgnoreControllCharacters(t *testing.T) { expected := "echo" lexer.Lex(lv) actual := lv.Tkn.Value - assertEqual(t, expected, actual) + assert.DeepEqual(t, expected, actual) expected = "$b" lexer.Lex(lv) actual = lv.Tkn.Value - assertEqual(t, expected, actual) + assert.DeepEqual(t, expected, actual) } func TestIgnoreControllCharactersAtStringVarOffset(t *testing.T) { @@ -1414,25 +1398,25 @@ func TestIgnoreControllCharactersAtStringVarOffset(t *testing.T) { expected := "\"" lexer.Lex(lv) actual := lv.Tkn.Value - assertEqual(t, expected, actual) + assert.DeepEqual(t, expected, actual) expected = "$a" lexer.Lex(lv) actual = lv.Tkn.Value - assertEqual(t, expected, actual) + assert.DeepEqual(t, expected, actual) expected = "[" lexer.Lex(lv) actual = lv.Tkn.Value - assertEqual(t, expected, actual) + assert.DeepEqual(t, expected, actual) expected = "test" lexer.Lex(lv) actual = lv.Tkn.Value - assertEqual(t, expected, actual) + assert.DeepEqual(t, expected, actual) expected = "]" lexer.Lex(lv) actual = lv.Tkn.Value - assertEqual(t, expected, actual) + assert.DeepEqual(t, expected, actual) } diff --git a/visitor/namespace_resolver_test.go b/visitor/namespace_resolver_test.go index 37db7fc..d626dbb 100644 --- a/visitor/namespace_resolver_test.go +++ b/visitor/namespace_resolver_test.go @@ -1,33 +1,18 @@ package visitor_test import ( - "reflect" "testing" - "github.com/kylelemons/godebug/pretty" - "github.com/z7zmey/php-parser/node/scalar" - - "github.com/z7zmey/php-parser/node/expr" - "github.com/z7zmey/php-parser/visitor" - - "github.com/z7zmey/php-parser/node/stmt" + "gotest.tools/assert" "github.com/z7zmey/php-parser/node" + "github.com/z7zmey/php-parser/node/expr" "github.com/z7zmey/php-parser/node/name" + "github.com/z7zmey/php-parser/node/scalar" + "github.com/z7zmey/php-parser/node/stmt" + "github.com/z7zmey/php-parser/visitor" ) -func assertEqual(t *testing.T, expected interface{}, actual interface{}) { - if !reflect.DeepEqual(expected, actual) { - diff := pretty.Compare(expected, actual) - - if diff != "" { - t.Errorf("diff: (-expected +actual)\n%s", diff) - } else { - t.Errorf("expected and actual are not equal\n") - } - } -} - func TestResolveStaticCall(t *testing.T) { nameAB := &name.Name{Parts: []node.Node{&name.NamePart{Value: "A"}, &name.NamePart{Value: "B"}}} nameBC := &name.Name{Parts: []node.Node{&name.NamePart{Value: "B"}, &name.NamePart{Value: "C"}}} @@ -56,7 +41,7 @@ func TestResolveStaticCall(t *testing.T) { nsResolver := visitor.NewNamespaceResolver() ast.Walk(nsResolver) - assertEqual(t, expected, nsResolver.ResolvedNames) + assert.DeepEqual(t, expected, nsResolver.ResolvedNames) } func TestResolveStaticPropertyFetch(t *testing.T) { @@ -86,7 +71,7 @@ func TestResolveStaticPropertyFetch(t *testing.T) { nsResolver := visitor.NewNamespaceResolver() ast.Walk(nsResolver) - assertEqual(t, expected, nsResolver.ResolvedNames) + assert.DeepEqual(t, expected, nsResolver.ResolvedNames) } func TestResolveClassConstFetch(t *testing.T) { @@ -116,7 +101,7 @@ func TestResolveClassConstFetch(t *testing.T) { nsResolver := visitor.NewNamespaceResolver() ast.Walk(nsResolver) - assertEqual(t, expected, nsResolver.ResolvedNames) + assert.DeepEqual(t, expected, nsResolver.ResolvedNames) } func TestResolveNew(t *testing.T) { @@ -146,7 +131,7 @@ func TestResolveNew(t *testing.T) { nsResolver := visitor.NewNamespaceResolver() ast.Walk(nsResolver) - assertEqual(t, expected, nsResolver.ResolvedNames) + assert.DeepEqual(t, expected, nsResolver.ResolvedNames) } func TestResolveInstanceOf(t *testing.T) { @@ -176,7 +161,7 @@ func TestResolveInstanceOf(t *testing.T) { nsResolver := visitor.NewNamespaceResolver() ast.Walk(nsResolver) - assertEqual(t, expected, nsResolver.ResolvedNames) + assert.DeepEqual(t, expected, nsResolver.ResolvedNames) } func TestResolveInstanceCatch(t *testing.T) { @@ -223,7 +208,7 @@ func TestResolveInstanceCatch(t *testing.T) { nsResolver := visitor.NewNamespaceResolver() ast.Walk(nsResolver) - assertEqual(t, expected, nsResolver.ResolvedNames) + assert.DeepEqual(t, expected, nsResolver.ResolvedNames) } func TestResolveFunctionCall(t *testing.T) { @@ -254,7 +239,7 @@ func TestResolveFunctionCall(t *testing.T) { nsResolver := visitor.NewNamespaceResolver() ast.Walk(nsResolver) - assertEqual(t, expected, nsResolver.ResolvedNames) + assert.DeepEqual(t, expected, nsResolver.ResolvedNames) } func TestResolveConstFetch(t *testing.T) { @@ -284,7 +269,7 @@ func TestResolveConstFetch(t *testing.T) { nsResolver := visitor.NewNamespaceResolver() ast.Walk(nsResolver) - assertEqual(t, expected, nsResolver.ResolvedNames) + assert.DeepEqual(t, expected, nsResolver.ResolvedNames) } func TestResolveGroupUse(t *testing.T) { @@ -341,7 +326,7 @@ func TestResolveGroupUse(t *testing.T) { nsResolver := visitor.NewNamespaceResolver() ast.Walk(nsResolver) - assertEqual(t, expected, nsResolver.ResolvedNames) + assert.DeepEqual(t, expected, nsResolver.ResolvedNames) } func TestResolveTraitUse(t *testing.T) { @@ -407,7 +392,7 @@ func TestResolveTraitUse(t *testing.T) { nsResolver := visitor.NewNamespaceResolver() ast.Walk(nsResolver) - assertEqual(t, expected, nsResolver.ResolvedNames) + assert.DeepEqual(t, expected, nsResolver.ResolvedNames) } func TestResolveClassName(t *testing.T) { @@ -442,7 +427,7 @@ func TestResolveClassName(t *testing.T) { nsResolver := visitor.NewNamespaceResolver() ast.Walk(nsResolver) - assertEqual(t, expected, nsResolver.ResolvedNames) + assert.DeepEqual(t, expected, nsResolver.ResolvedNames) } func TestResolveInterfaceName(t *testing.T) { @@ -475,7 +460,7 @@ func TestResolveInterfaceName(t *testing.T) { nsResolver := visitor.NewNamespaceResolver() ast.Walk(nsResolver) - assertEqual(t, expected, nsResolver.ResolvedNames) + assert.DeepEqual(t, expected, nsResolver.ResolvedNames) } func TestResolveTraitName(t *testing.T) { @@ -498,7 +483,7 @@ func TestResolveTraitName(t *testing.T) { nsResolver := visitor.NewNamespaceResolver() ast.Walk(nsResolver) - assertEqual(t, expected, nsResolver.ResolvedNames) + assert.DeepEqual(t, expected, nsResolver.ResolvedNames) } func TestResolveFunctionName(t *testing.T) { @@ -536,7 +521,7 @@ func TestResolveFunctionName(t *testing.T) { nsResolver := visitor.NewNamespaceResolver() ast.Walk(nsResolver) - assertEqual(t, expected, nsResolver.ResolvedNames) + assert.DeepEqual(t, expected, nsResolver.ResolvedNames) } func TestResolveMethodName(t *testing.T) { @@ -569,7 +554,7 @@ func TestResolveMethodName(t *testing.T) { nsResolver := visitor.NewNamespaceResolver() methodNode.Walk(nsResolver) - assertEqual(t, expected, nsResolver.ResolvedNames) + assert.DeepEqual(t, expected, nsResolver.ResolvedNames) } func TestResolveClosureName(t *testing.T) { @@ -600,7 +585,7 @@ func TestResolveClosureName(t *testing.T) { nsResolver := visitor.NewNamespaceResolver() closureNode.Walk(nsResolver) - assertEqual(t, expected, nsResolver.ResolvedNames) + assert.DeepEqual(t, expected, nsResolver.ResolvedNames) } func TestResolveConstantsName(t *testing.T) { @@ -639,7 +624,7 @@ func TestResolveConstantsName(t *testing.T) { nsResolver := visitor.NewNamespaceResolver() ast.Walk(nsResolver) - assertEqual(t, expected, nsResolver.ResolvedNames) + assert.DeepEqual(t, expected, nsResolver.ResolvedNames) } func TestResolveNamespaces(t *testing.T) { @@ -717,7 +702,7 @@ func TestResolveNamespaces(t *testing.T) { nsResolver := visitor.NewNamespaceResolver() ast.Walk(nsResolver) - assertEqual(t, expected, nsResolver.ResolvedNames) + assert.DeepEqual(t, expected, nsResolver.ResolvedNames) } func TestResolveStaticCallDinamicClassName(t *testing.T) { @@ -736,7 +721,7 @@ func TestResolveStaticCallDinamicClassName(t *testing.T) { nsResolver := visitor.NewNamespaceResolver() ast.Walk(nsResolver) - assertEqual(t, expected, nsResolver.ResolvedNames) + assert.DeepEqual(t, expected, nsResolver.ResolvedNames) } func TestDoNotResolveReservedConstants(t *testing.T) { @@ -792,7 +777,7 @@ func TestDoNotResolveReservedConstants(t *testing.T) { nsResolver := visitor.NewNamespaceResolver() ast.Walk(nsResolver) - assertEqual(t, expected, nsResolver.ResolvedNames) + assert.DeepEqual(t, expected, nsResolver.ResolvedNames) } func TestDoNotResolveReservedNames(t *testing.T) { @@ -914,7 +899,7 @@ func TestDoNotResolveReservedNames(t *testing.T) { nsResolver := visitor.NewNamespaceResolver() ast.Walk(nsResolver) - assertEqual(t, expected, nsResolver.ResolvedNames) + assert.DeepEqual(t, expected, nsResolver.ResolvedNames) } func TestDoNotResolveReservedSpecialNames(t *testing.T) { @@ -987,5 +972,5 @@ func TestDoNotResolveReservedSpecialNames(t *testing.T) { nsResolver := visitor.NewNamespaceResolver() ast.Walk(nsResolver) - assertEqual(t, expected, nsResolver.ResolvedNames) + assert.DeepEqual(t, expected, nsResolver.ResolvedNames) }